diff options
author | Justin Lecher <jlec@gentoo.org> | 2014-07-22 16:49:37 +0000 |
---|---|---|
committer | Justin Lecher <jlec@gentoo.org> | 2014-07-22 16:49:37 +0000 |
commit | 71c0a60ae2430a37520f99f8649175cbe07ffda1 (patch) | |
tree | 64b5ccd1c388bade6284e34607d4ff4613c951fc /sci-chemistry | |
parent | remove dev-python/numpy[lapack], virtual/cblas is keyworded stable for arm now (diff) | |
download | historical-71c0a60ae2430a37520f99f8649175cbe07ffda1.tar.gz historical-71c0a60ae2430a37520f99f8649175cbe07ffda1.tar.bz2 historical-71c0a60ae2430a37520f99f8649175cbe07ffda1.zip |
sci-chemistry/molmol: Importing latest changes from sf.net molmol for mac project
Package-Manager: portage-2.2.10/cvs/Linux x86_64
Manifest-Sign-Key: 0xB9D4F231BD1558AB!
Diffstat (limited to 'sci-chemistry')
-rw-r--r-- | sci-chemistry/molmol/ChangeLog | 10 | ||||
-rw-r--r-- | sci-chemistry/molmol/Manifest | 25 | ||||
-rw-r--r-- | sci-chemistry/molmol/files/opengl.patch | 96 | ||||
-rw-r--r-- | sci-chemistry/molmol/files/wild.patch | 1866 | ||||
-rw-r--r-- | sci-chemistry/molmol/molmol-2k_p2-r5.ebuild | 88 |
5 files changed, 2078 insertions, 7 deletions
diff --git a/sci-chemistry/molmol/ChangeLog b/sci-chemistry/molmol/ChangeLog index 3e8eaa9df355..330f9695b3ec 100644 --- a/sci-chemistry/molmol/ChangeLog +++ b/sci-chemistry/molmol/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sci-chemistry/molmol -# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/molmol/ChangeLog,v 1.34 2013/05/02 10:17:43 jlec Exp $ +# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/molmol/ChangeLog,v 1.35 2014/07/22 16:49:36 jlec Exp $ + +*molmol-2k_p2-r5 (22 Jul 2014) + + 22 Jul 2014; Justin Lecher <jlec@gentoo.org> +molmol-2k_p2-r5.ebuild, + +files/opengl.patch, +files/wild.patch: + Importing latest changes from sf.net molmol for mac project *molmol-2k_p2-r4 (02 May 2013) diff --git a/sci-chemistry/molmol/Manifest b/sci-chemistry/molmol/Manifest index cca44300ca89..e2a621102a4d 100644 --- a/sci-chemistry/molmol/Manifest +++ b/sci-chemistry/molmol/Manifest @@ -5,19 +5,34 @@ AUX cast.patch 519 SHA256 25acec7df7e5739e2e4664672e979636ccd13c68b2ce5d26e555b3 AUX ldflags.patch 435 SHA256 cbae8934e2be43ceac0f541ed14e843ed76baf86219e0f669eab0af6d5714c64 SHA512 32c266444bf4341bf2db3fb3330c240729f7a538750c0962ee6b128947c5895fa84425a380a9f0897dacfe95bdc8d395e56e62a44c070513274000d5a493e0e3 WHIRLPOOL 39e7ec799e81a814e8f75e33b9996f82f0ecfde31cb4d0d02a01a98b1ac93cdd57879b58c57941b86ae67047f7d235af18844370474f9409c09397ff11f4d2c0 AUX libpng15.patch 826 SHA256 656a088b11f0ce171ab666aed8de36e3eeac3576322055ab0036794b02c370ed SHA512 df973c637f09225d3f193bb6f977df515b9d475fb47d3a5e6288daaf1cea79afc1fe022803f9cbc1331b373c6ac1e52056e1fbb8e909562065347cf1ae87a205 WHIRLPOOL 54ba85edd7481a6532cba1ffbf007ec408d27965aa19a8ca358140b137ffee2a69237443ad25698b9ab1ce2bc36cd71914af62889c4be219a2584411ddfcba41 AUX molmol-2k_p2-fink.patch 12821 SHA256 b7ddc4d48e6149f6ced7e287bf7b72b798394d17d01dee373d2615bf6407f04b SHA512 5646ae8f4801d53f1673c0656b3e5d152767a7cd6b85adec0d13fcb8e60a39e825ac733d18ed14ee1ef738d24841061f7fac2f6aa02cae78bead7f6b39a0a77f WHIRLPOOL 539b94c01fd7333b778b9c534bbc0c3c19c93331170c5afa8f2c4ea5e945a4398ab238fa5b988ff81f7d580b4f677e74e391174ab92f0de5986ceb6caba94c28 +AUX opengl.patch 2416 SHA256 d793e26446440289492457f7deeae5bce27bce02320d80613c6733d66fa4b86a SHA512 71062a378a024d058015a7921045ebd6ee388876e29c919b4cb6b624208a4634cbe3bbd8190849dbf7397f318ae31d0023c5fe36d640773e1196d40903258f8a WHIRLPOOL 084bb35e19c82606edf3c176e67002104cc9a7249d3482c32e10364780e31aabf0d1ed100be9428394ff145cd7788eb12d57a47edd16c24942ee808e271dc819 AUX pjf_RH9_molmol2k2.diff 3138 SHA256 5b7c3ede5714b123824cc0b8533f679d22d1c5219bf88e8d6a4cebe8e245aeb9 SHA512 93b78202d7bb705e253f2111eeda64c44269e2662c44e2ad5e02a0db9eaa62a7ef3efa25463668a17be9dcc39c81ac1f1875ac7d1990ee537c3dcbd53258bece WHIRLPOOL 9b5a9f5576535e96f23046ca4ce5c9b3e34167818b8c8fa469c4fdf10549e33d75fb4a290547791bb37d7c7ad07e297fc63659bf1c87eafc468b6b2fca4b7b76 AUX prefix.patch 513 SHA256 efcb5d3fa7258cf88f02b63d1df3100eb0b73848c0ebabb59c84cb9ea082d8e7 SHA512 5e566b80238a5caf1f1d6de4d14ce4088b38dd5f1263390afa4304853f2b8bd71285da21cd14bf56c44211781593686696571e283915f528cffa8d6d3b8f12a4 WHIRLPOOL ac502216971039b07e43596d545b05b52b8a94e32339883c3cfaa46264d8b0992f39beb149b7d5bbb650500cc6040876d0e0818317e34db7abf193813c5f0744 +AUX wild.patch 50570 SHA256 927ee484527eadf2abe9172d42c95cd00d00a210fa74867bdfc711f1926806b7 SHA512 fe1f321aea36d6ba01164168ade75681808b8bdb91c76e4067a063690d89623027c71f36add0037d2d92eb061dc65ff2809cc4df7a529b56e693aaa85f1645a2 WHIRLPOOL 63e1c3d0b5f3062259275f376a922adb6c1ec63192a9a5764361cb184733c6f0315ac72170725f7dd90bd9e5fc9168907ae06c9e2d88d45dd1726c0b1136565b DIST molmol-2k.2.0-doc.tar.gz 1062297 SHA256 07e1c3fd04ffe7c9e9d91eaefa0bf72e6d0913a981eec3bf0879bfc65537a6be SHA512 131f747a5762859398ebe9b676a07df56c82c8864ecc035ec914f1dea74dafcd67f87993421dfe5899c640470c7e1e1ef03ae262b04a9b360ae329eb19a331fe WHIRLPOOL b74f47149c4dce8199722075fda17c9cbe22263eec57b647ef543b15386d53b267ee85d5a2c44a4fda7e533fd6ccdafb82fbbbd71e671ec4e1fd58e07363677c DIST molmol-2k.2.0-src.tar.gz 1088805 SHA256 1104dcb1b2517581c7d6b1695ff2e92f4076ad34afc48dd896eec38e5acf2287 SHA512 6ab01a6fd3d19752634a2cf22919a20e43d195768bd4bdacd5f0bbe016c3058c94915bad4c7fa64dcd86576be39cad0ae112cb62f5e69ffb10041518101e7a9b WHIRLPOOL e258ede83ac4a8fe9b4a9274588ced7e1294415d864c909ed83e3e56d36512e1388e6f77e45da614bc19992a265d32b739c54aace7faa28971c61a01bba27541 EBUILD molmol-2k_p2-r2.ebuild 1809 SHA256 803495e522e7c3fafa8f4c301afe651da1edbcffe3c0222605d0d44e7e27ac4c SHA512 9b6e2502331a9b66b065a66a27ae85d4f6ce4bbf0f95346085551bd6ab8d7aff59fff69b369c08ea05008393a842c32874e2cba4829bb084e8f9757d7b098a10 WHIRLPOOL 73eae76759bcb0bbc870c659dcec3f7576127b568c491b052d55795e606eb45a4483efce6871d6ddbeae9608d53dd3059e63be55d0e9e484468220b0d290774c EBUILD molmol-2k_p2-r3.ebuild 1933 SHA256 abd280691faf4e624e2c2e4c0460b5ec5a65d9dbd5019d0a4babedee4bc2ef6e SHA512 9abd13cd33239aa3d70ff9eef968078fe98e6ff3580f1dde8260a420c9d01deba5751703da8a82e92db2dc34e8d0bb9e63e87a0a2a263a3bf28b223603c1e9aa WHIRLPOOL 82d9d867807d8f26b9dfffe1cef066126798b6ccccbbce51bf0f015904f37b3092a91b0d0c5179ff6eb7c0cc4643b296fa42f34e86232d67ecc7982d4f5c0006 EBUILD molmol-2k_p2-r4.ebuild 1948 SHA256 5ed609b3d84bcf7b137de7d4f2d04ec1e34b0d1ea3beb038a8c2ad3b88dac29c SHA512 4a1adbbc89db083b9916a37a90c4b4e492843cc56bd4f20e06a418766a11ade75184c4fdbc5b6148d23eb59191c2faf56f8bc0b2564398139103646f719a31da WHIRLPOOL 3fd873c39d91c2422d457c968a5473a3288c10e2ccfe976e146844bbd8cca3e5c907ff769b1bcdd12cb697bb6eef2cf3dba628f604536b0dd5000a98eb831505 -MISC ChangeLog 4902 SHA256 e1f6c3bb02a4f237b01876b1db8213f6833029fd5efd6762045cfa0c5ee0a618 SHA512 c2e0c48e3b9420928fc1e0e49bb74c6fa0b3d48de897f7d9d6080a56948c0103d467283aa0ad0cf6c3dc9a96a0a653315c149cb3bb859ffddb97ba1d2c024f4c WHIRLPOOL 78d78814f60be49d689ef8c988dc8c7deb2184f67c367719a8b0b968be66712a0d9ca65ca07c5c0e7c14da970dea5a2d44961248206b7e84f4f32315eab4fa07 +EBUILD molmol-2k_p2-r5.ebuild 2011 SHA256 3b196ab21c43145bdfd954e06cc0b0119b34883d0aed7c61e5b4ebeeff4f5206 SHA512 13a9077bcc15d0f068fedf2a779cd4758138edf25cb16ed0f35a5024df280b1cd1228d5169b467a6049114c46cba79d7d16b3c59e55ca195f8856f45b7431d95 WHIRLPOOL 9902201a4ae1135a95521cbd3cfc5b54962e105721b60b4a23a27be2d6c1d13efea18df96a285c1cd99e8219504c11c82a627c34c3682b662c37ad24b2fe9f8f +MISC ChangeLog 5111 SHA256 fe5c560de66fc5c7197b118c565a91c3ae4edd528108173fb090f504bb2b5f39 SHA512 ab814022bb2dadb19789e24cd33d6d65b1b75edb21f9079ffa76e0b6713a05f05fed673ce38b619de92d8e777a3267ac43f1fbd0cf1aa1366e9647e4272e9c4a WHIRLPOOL 6d1de5d53acc6786b41e0434241c49000d84fb263ec846748d77c1a435089be44c78d538124e94c6cd61c8b07e718fc0dbb149d358200c98944fb7ca8562d2c0 MISC metadata.xml 168 SHA256 705462092174cd3e2e3ec1557a28108a746b7351f803d8ca6d1b925b3111c3ff SHA512 f0073fb277e20adb7781aa6ea7f8237bc2d350f0aa43f0f0cca33e02cf52b8fc117bd984c11721ac519a2637ea145976148ac1aba7335dc74c42f7b9531cbed3 WHIRLPOOL 07dd7a302e695440f5033889e5b20cada57beedf17ad33f95d45fb5c39da98bf206eaff13334c20c1c08140a9c5e6041341d29c58efc5ca59b112b60e1662318 -----BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.19 (GNU/Linux) +Version: GnuPG v2.0 -iEYEAREKAAYFAlGCPUgACgkQgAnW8HDreRaDcACgmUeSSxRUje7eEBEGgb3OeQrr -BRUAoLDohxFQwQtoKw+H4zgfoSTlEpGe -=6tcu +iQJ8BAEBCgBmBQJTzpYhXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w +ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQyQ0JDQjFGMzBDQ0UxMjFGNENDNDgxMDdC +OUQ0RjIzMUJEMTU1OEFCAAoJELnU8jG9FVirJeEQAIeXhL+g/SO6iSZXiydSJl2B +HfoPJzHd1FTbqiF0o0REpcHxjNWECH9OA6rOcIcsMnL60gjVzlooa0OGvjHcwbTV +YAQDVYzFVDheNHU6oTew0yD8ku+JDOz7PP2hSXFrQGARjXaZO/vM9Tk8HGe5y7Ea +Vua/tkrqDCqu4PRfhXWSKM635JyHlKPSMMuLRNwQ2Y2D/2nf2OW4qC0GQLJ0dGge +if4ChpUX+v1ljhfsBswAShzQKgUxojmFm+8grHHAwW4aEf8u0/0pqq45Ok6gZZtC +Bt7vHqK/rLUIq0/SAnHy3NGdmJRoUqcVrJ2PcWfy3OYyPeSj9a/Bl01iisOtNCUB +SBFSmCmaRHm+0RtS9RayjL6d90HWylBnBY14Ca+Lhpu7oCYmvdgG/GpKagBmzLfp +Q5ynK5vVN56HzQ9ii2yZ4os93WATbYAqLXOn6v1G13DFcty6HgTIssuoAnydKh/J +kl45ZZjMhHWxJK8LWriueD6Ng5TND99eniA+Kl0LEAbUm0Z5/n8p2IxvO7QtXfG1 +XnPl5lGCDDZ62dFuEcuTCbnnGH1vaH3Feo3j7mtbw0L4t9HX+iHrEyiflcn5plD1 +RunpXeoVayqqQmrrjletjOvLPdkSwoULR3DgN2q1g2oX/8xVf7+cO2lZ+ce3hwT1 +3NVyvpqTKZKyR0UdC6F2 +=1Ta9 -----END PGP SIGNATURE----- diff --git a/sci-chemistry/molmol/files/opengl.patch b/sci-chemistry/molmol/files/opengl.patch new file mode 100644 index 000000000000..940858f62d50 --- /dev/null +++ b/sci-chemistry/molmol/files/opengl.patch @@ -0,0 +1,96 @@ + molmol | 65 +++++++++-------------------------------------------------------- + 1 file changed, 9 insertions(+), 56 deletions(-) + +diff --git a/molmol b/molmol +index 7863225..b6c75ce 100755 +--- a/molmol ++++ b/molmol +@@ -11,55 +11,8 @@ ostype=`uname` + osrel=`uname -r` + osmaj=`echo $osrel | awk -F. '{print $1}'` + osmin=`echo $osrel | awk -F. '{print $2}'` +-localdev= +-glxdev= +- +-if [ $ostype = "IRIX" -o $ostype = "IRIX64" ]; then +- if [ $osmaj -eq 6 -a $osmin -ge 2 -o $osmaj -gt 6 ]; then +- arch=sgi6 +- localdev=Motif/OpenGL +- glxdev=Motif/OpenGL +- elif [ $osmaj -eq 5 -a $osmin -ge 3 -o $osmaj -gt 5 ]; then +- arch=sgi5 +- localdev=Motif/OpenGL +- glxdev=Motif/OpenGL +- else +- arch=sgi4 +- localdev=Motif/GL +- fi +- MONITOR=72HZ; export MONITOR +-elif [ $ostype = "AIX" ]; then +- arch=aix +- localdev=Motif/OpenGL +-elif [ $ostype = "HP-UX" ]; then +- arch=hp +- localdev=Motif/OpenGL +- glxdev=Motif/OpenGL +-elif [ $ostype = "OSF1" ]; then +- arch=dec +- localdev=Motif/OpenGL +-elif [ $ostype = "Linux" ]; then +- arch=lnx +- localdev=Motif/OpenGL +-elif [ $ostype = "SunOS" ]; then +- if [ $osmaj -eq 5 -a $osmin -ge 4 -o $osmaj -gt 5 ]; then +- arch=sol +- localdev=Motif/OpenGL +- else +- arch=sun +- fi +-else +- arch=unknown +-fi +- +-if [ $ostype = "SunOS" ]; then +- xdpy=/usr/openwin/bin/xdpyinfo +-elif [ $ostype = "HP-UX" ]; then +- xdpy=/usr/contrib/bin/X11/xdpyinfo +-else +- xdpy=/usr/bin/xdpyinfo +-fi +- ++localdev=Motif/OpenGL ++glxdev=Motif/OpenGL + printUsage () { + echo "Usage: molmol -ht2as [-o dev] [-r range] [-f macro] files" + echo "" +@@ -121,15 +74,15 @@ done + + magictmp=/tmp/molmol_magic$$ + +-if [ ! -d $HOME/molmol ]; then +- mkdir $HOME/molmol ++if [ ! -d $HOME/.molmol ]; then ++ mkdir $HOME/.molmol + fi +-startmacro=$HOME/molmol/options.mac ++startmacro=$HOME/.molmol/options.mac + cp /dev/null $startmacro + + if [ -n "$*" ]; then +- if [ -f $HOME/molmol/dump ]; then +- mv -f $HOME/molmol/dump $HOME/molmol/dump.old ++ if [ -f $HOME/.molmol/dump ]; then ++ mv -f $HOME/.molmol/dump $HOME/.molmol/dump.old + fi + echo "0 long 0x3b7a12f9 MOLMOL" > $magictmp + echo "0 long 0xf9127a3b MOLMOL" >> $magictmp +@@ -209,7 +162,7 @@ elif [ -x $xdpy ]; then + fi + + if [ "$input" = "-" -o -n "$nograph" ]; then +- $MOLMOLHOME/molmol.$arch $xopt ++ $MOLMOLHOME/molmol $xopt + else +- $MOLMOLHOME/molmol.$arch $xopt < /dev/null ++ $MOLMOLHOME/molmol $xopt < /dev/null + fi diff --git a/sci-chemistry/molmol/files/wild.patch b/sci-chemistry/molmol/files/wild.patch new file mode 100644 index 000000000000..a6079d53fc33 --- /dev/null +++ b/sci-chemistry/molmol/files/wild.patch @@ -0,0 +1,1866 @@ + include/cmd_dial.h | 1 + + include/cmd_io.h | 7 +- + include/cmd_struc.h | 1 + + include/curr_dir.h | 1 + + include/data_hand.h | 6 + + src/cip/cmd_tab.h | 3 + + src/cmddial/ExDialColor.c | 314 +++++++++++++++++++++++++++++++----------- + src/cmddial/ExDialRes.c | 340 ++++++++++++++++++++++++++++++++++++++++++++++ + src/cmddial/Makefile | 2 +- + src/cmdio/ExPdb.c | 70 +++++++++- + src/cmdstruc/ExBuild.c | 123 +++++++++++++++++ + src/data/DataHand.c | 114 +++++++++++++++- + src/iodev/IODev.c | 2 + + src/main/MolInit.c | 5 +- + src/main/MolMol.c | 2 +- + src/motif/MotifDial.c | 32 ++--- + src/motogl/MotOGLDump.c | 2 +- + src/os/CurrDir.c | 46 ++----- + src/os/ProgDir.c | 25 +++- + src/win/WinDial.c | 255 +++++++++++++++++----------------- + src/winogl/WinOGLDump.c | 7 +- + 21 files changed, 1073 insertions(+), 285 deletions(-) + +diff --git a/include/cmd_dial.h b/include/cmd_dial.h +index f60e918..47fb8f8 100644 +--- a/include/cmd_dial.h ++++ b/include/cmd_dial.h +@@ -29,6 +29,7 @@ extern ErrCode ExUserInterface(char *); + + extern ErrCode ExDialColor(char *); + extern ErrCode ExDialMol(char *); ++extern ErrCode ExDialRes(char *); + extern ErrCode ExDialMeasure(char *); + extern ErrCode ExDialRmsd(char *); + extern ErrCode ExDialSelect(char *); +diff --git a/include/cmd_io.h b/include/cmd_io.h +index 79b173c..9a7b12c 100644 +--- a/include/cmd_io.h ++++ b/include/cmd_io.h +@@ -30,15 +30,16 @@ extern ErrCode ExReadAng(char *); + extern ErrCode ExReadDg(char *); + extern ErrCode ExReadDump(char *); + extern ErrCode ExReadLib(char *); +-extern ErrCode ExReadPdb(char *); +-extern ErrCode ExReadSeq(char *); +-extern ErrCode ExReadShift(char *); + extern ErrCode ExReadLimit(char *); + extern ErrCode ExReadListAng(char *); + extern ErrCode ExReadListDg(char *); + extern ErrCode ExReadListPdb(char *); ++extern ErrCode ExReadOldPdb(char *); + extern ErrCode ExReadOmap(char *); ++extern ErrCode ExReadPdb(char *); + extern ErrCode ExReadPot(char *); ++extern ErrCode ExReadSeq(char *); ++extern ErrCode ExReadShift(char *); + extern ErrCode ExReadSybyl(char *); + extern ErrCode ExReadXyz(char *); + extern ErrCode ExWriteAng(char *); +diff --git a/include/cmd_struc.h b/include/cmd_struc.h +index e0d729f..f4950b9 100644 +--- a/include/cmd_struc.h ++++ b/include/cmd_struc.h +@@ -33,6 +33,7 @@ extern ErrCode ExAddDist(char *); + extern ErrCode ExAddLimit(char *); + extern ErrCode ExAddPseudo(char *); + extern ErrCode ExAddRes(char *); ++extern ErrCode ExMakeMolCyclic(char *); + extern ErrCode ExChangeRes(char *); + extern ErrCode ExFirstMol(char *); + extern ErrCode ExFlipAtom(char *); +diff --git a/include/curr_dir.h b/include/curr_dir.h +index c7895c4..04e404d 100644 +--- a/include/curr_dir.h ++++ b/include/curr_dir.h +@@ -26,6 +26,7 @@ + #ifndef _CURR_DIR_H_ + #define _CURR_DIR_H_ + ++extern void CurrDirSet(char *dir); + extern char *CurrDirGet(void); + + #endif /* _CURR_DIR_H_ */ +diff --git a/include/data_hand.h b/include/data_hand.h +index 4462328..74a716a 100644 +--- a/include/data_hand.h ++++ b/include/data_hand.h +@@ -112,6 +112,7 @@ extern void DhMolMoveFirst(DhMolP); + extern void DhMolDestroy(DhMolP); + + extern DhResP DhResNew(DhMolP, DhResDefP, DhSeqPos); ++extern DhResP DhResNewCyclic(DhMolP, DhResDefP, DhSeqPos); + extern void DhResMutate(DhResP, DhResDefP, DhMutationKind); + extern void DhResSetNeigh(DhResP, DhNeighChoice, DhResP); + extern BOOL DhResDestroy(DhResP); +@@ -287,6 +288,7 @@ extern void DhMolGetTransVect(DhMolP, Vec3); + extern MolAttrP DhMolGetAttr(DhMolP); + + extern DSTR DhResGetName(DhResP); ++extern DhAtomP DhResGetAtomA(DhResP); + extern int DhResGetNumber(DhResP); + + extern DSTR DhAtomGetName(DhAtomP); +@@ -335,6 +337,10 @@ extern void DhResAnglesChanged(DhResP); + extern void DhResDockPrev(DhResP); + extern void DhResDockNext(DhResP); + extern void DhResCalcAtom(DhResP, DSTR); ++extern DhResP DhResPrev(DhResP resP); ++extern DhResP DhResNext(DhResP resP); ++extern DhResP DhResFirst(DhMolP molP); ++extern DhResP DhResLast(DhMolP molP); + + /* dump/undump */ + +diff --git a/src/cip/cmd_tab.h b/src/cip/cmd_tab.h +index 0b73f65..cf7bc2a 100644 +--- a/src/cip/cmd_tab.h ++++ b/src/cip/cmd_tab.h +@@ -108,6 +108,7 @@ static CmdTabEntry BuiltinCmdTab[] = { + {"DialColor", ExDialColor, US_NONE}, + {"DialMeasure", ExDialMeasure, US_NONE}, + {"DialMol", ExDialMol, US_NONE}, ++ {"DialRes", ExDialRes, US_NONE}, + {"DialRmsd", ExDialRmsd, US_NONE}, + {"DialSelect", ExDialSelect, US_NONE}, + {"DialStyle", ExDialStyle, US_NONE}, +@@ -164,6 +165,7 @@ static CmdTabEntry BuiltinCmdTab[] = { + {"ListSelectedDist", ExListSelected, US_NONE}, + {"ListSelectedMol", ExListSelected, US_NONE}, + {"ListSelectedRes", ExListSelected, US_NONE}, ++ {"MakeMolCyclic", ExMakeMolCyclic, US_ALL}, + {"MaterialAtom", ExMaterial, US_ALL}, + {"MaterialBond", ExMaterial, US_ALL}, + {"MaterialDist", ExMaterial, US_ALL}, +@@ -213,6 +215,7 @@ static CmdTabEntry BuiltinCmdTab[] = { + {"ReadListDg", ExReadListDg, US_ALL}, + {"ReadListPdb", ExReadListPdb, US_ALL}, + {"ReadLol", ExReadLimit, US_ALL}, ++ {"ReadOldPdb", ExReadOldPdb, US_ALL}, + {"ReadOmap", ExReadOmap, US_ALL}, + {"ReadPdb", ExReadPdb, US_ALL}, + {"ReadPot", ExReadPot, US_ALL}, +diff --git a/src/cmddial/ExDialColor.c b/src/cmddial/ExDialColor.c +index f960e1d..e827c4f 100644 +--- a/src/cmddial/ExDialColor.c ++++ b/src/cmddial/ExDialColor.c +@@ -43,6 +43,9 @@ + #define NAME_LEN 100 + #define NUM_LEN 6 + #define CMD_NO 7 ++#define MAXRGBVALUE 255 ++#define ICOLOR(c) (int) ((float)c * (float)MAXRGBVALUE) ++#define FCOLOR(c) (float) ((float)c / (float)MAXRGBVALUE) + + #define EPS ((float) 1.0e-5) + +@@ -56,8 +59,8 @@ typedef struct { + static ColorDesc *ColorList; + static int ColorNo = 0; + static BOOL DialOn = FALSE; +-static PuGizmo DialGizmo = NULL, NameGizmo, RGizmo, GGizmo, BGizmo, ColGizmo; +-static DSTR NameStr = NULL, RStr, GStr, BStr; ++static PuGizmo DialGizmo = NULL, NameGizmo, RGizmo, GGizmo, BGizmo, ColGizmo, rGizmo, gGizmo, bGizmo; ++static DSTR NameStr = NULL, RStr, GStr, BStr, rStr, gStr, bStr; + + static char *LabelList[] = { + "Back", +@@ -136,22 +139,50 @@ editCB(PuGizmo g, char *name, void *clientData, void *callData) + char *field = clientData; + PuTextCBStruc *callP = callData; + +- if (field[0] == 'N') ++ if (field[0] == 'N') { + DStrAssignStr(NameStr, callP->newText); +- else if (field[0] == 'R') ++ } ++ else if (field[0] == 'R') { + DStrAssignStr(RStr, callP->newText); +- else if (field[0] == 'G') ++ } ++ else if (field[0] == 'G') { + DStrAssignStr(GStr, callP->newText); +- else ++ } ++ else if (field[0] == 'B') { + DStrAssignStr(BStr, callP->newText); ++ } ++ else if (field[0] == 'r') { ++ DStrAssignStr(rStr, callP->newText); ++ } ++ else if (field[0] == 'g') { ++ DStrAssignStr(gStr, callP->newText); ++ } ++ else if (field[0] == 'b') { ++ DStrAssignStr(bStr, callP->newText); ++ } + } + + static void + updateFields(int colorI) + { ++ char buf[10]; ++ float f; ++ + PuSetStr(RGizmo, PU_SC_TEXT, ColorList[colorI].r); + PuSetStr(GGizmo, PU_SC_TEXT, ColorList[colorI].g); + PuSetStr(BGizmo, PU_SC_TEXT, ColorList[colorI].b); ++ ++ f = atof(ColorList[colorI].r); ++ (void) sprintf(buf, "%i", ICOLOR(f)); ++ PuSetStr(rGizmo, PU_SC_TEXT, buf); ++ ++ f = atof(ColorList[colorI].g); ++ (void) sprintf(buf, "%i", ICOLOR(f)); ++ PuSetStr(gGizmo, PU_SC_TEXT, buf); ++ ++ f = atof(ColorList[colorI].b); ++ (void) sprintf(buf, "%i", ICOLOR(f)); ++ PuSetStr(bGizmo, PU_SC_TEXT, buf); + } + + static void +@@ -190,17 +221,96 @@ activateCB(PuGizmo g, char *name, void *clientData, void *callData) + { + char *field = clientData; + int i; ++ float f; ++ char buf[10]; + + if (field[0] == 'N') { + for (i = 0; i < ColorNo; i++) + if (strcmp(ColorList[i].name, DStrToStr(NameStr)) == 0) { +- updateFields(i); +- break; ++ updateFields(i); ++ break; + } + } else { ++ if (field[0] == 'R') { ++ f = atof(DStrToStr(RStr)); ++ if (f>1.0) { ++ f=1.0; ++ i=MAXRGBVALUE; ++ sprintf(buf,"%1.3f", FCOLOR(i)); ++ DStrAssignStr(RStr, buf); ++ PuSetStr(RGizmo, PU_SC_TEXT, buf); ++ } ++ sprintf(buf,"%i", ICOLOR(f)); ++ DStrAssignStr(rStr, buf); ++ PuSetStr(rGizmo, PU_SC_TEXT, buf); ++ } ++ else if (field[0] == 'G') { ++ f = atof(DStrToStr(GStr)); ++ if (f>1.0) { ++ f=1.0; ++ i=MAXRGBVALUE; ++ sprintf(buf,"%1.3f", FCOLOR(i)); ++ DStrAssignStr(GStr, buf); ++ PuSetStr(GGizmo, PU_SC_TEXT, buf); ++ } ++ sprintf(buf,"%i", ICOLOR(f)); ++ DStrAssignStr(gStr, buf); ++ PuSetStr(gGizmo, PU_SC_TEXT, buf); ++ } ++ else if (field[0] == 'B') { ++ f = atof(DStrToStr(BStr)); ++ if (f>1.0) { ++ f=1.0; ++ i=MAXRGBVALUE; ++ sprintf(buf,"%1.3f", FCOLOR(i)); ++ DStrAssignStr(BStr, buf); ++ PuSetStr(BGizmo, PU_SC_TEXT, buf); ++ } ++ sprintf(buf,"%i", ICOLOR(f)); ++ DStrAssignStr(bStr, buf); ++ PuSetStr(bGizmo, PU_SC_TEXT, buf); ++ } ++ else if (field[0] == 'r') { ++ i = atoi(DStrToStr(rStr)); ++ if (i>MAXRGBVALUE) { ++ f=1.0; ++ i=MAXRGBVALUE; ++ sprintf(buf,"%i", ICOLOR(f)); ++ DStrAssignStr(rStr, buf); ++ PuSetStr(rGizmo, PU_SC_TEXT, buf); ++ } ++ sprintf(buf,"%1.3f", FCOLOR(i)); ++ DStrAssignStr(RStr, buf); ++ PuSetStr(RGizmo, PU_SC_TEXT, buf); ++ } ++ else if (field[0] == 'g') { ++ i = atoi(DStrToStr(gStr)); ++ if (i>MAXRGBVALUE) { ++ f=1.0; ++ i=MAXRGBVALUE; ++ sprintf(buf,"%i", ICOLOR(f)); ++ DStrAssignStr(gStr, buf); ++ PuSetStr(gGizmo, PU_SC_TEXT, buf); ++ } ++ sprintf(buf,"%1.3f", FCOLOR(i)); ++ DStrAssignStr(GStr, buf); ++ PuSetStr(GGizmo, PU_SC_TEXT, buf); ++ } ++ else if (field[0] == 'b') { ++ i = atoi(DStrToStr(bStr)); ++ if (i>MAXRGBVALUE) { ++ f=1.0; ++ i=MAXRGBVALUE; ++ sprintf(buf,"%i", ICOLOR(f)); ++ DStrAssignStr(bStr, buf); ++ PuSetStr(bGizmo, PU_SC_TEXT, buf); ++ } ++ sprintf(buf,"%1.3f", FCOLOR(i)); ++ DStrAssignStr(BStr, buf); ++ PuSetStr(BGizmo, PU_SC_TEXT, buf); ++ } + showName(); + } +- + showColor(); + } + +@@ -258,13 +368,20 @@ showAttr(AttrP attrP) + { + char buf[10]; + +- (void) sprintf(buf, "%5.3f", attrP->colR); ++ (void) sprintf(buf, "%1.3f", attrP->colR); + PuSetStr(RGizmo, PU_SC_TEXT, buf); +- (void) sprintf(buf, "%5.3f", attrP->colG); ++ (void) sprintf(buf, "%1.3f", attrP->colG); + PuSetStr(GGizmo, PU_SC_TEXT, buf); +- (void) sprintf(buf, "%5.3f", attrP->colB); ++ (void) sprintf(buf, "%1.3f", attrP->colB); + PuSetStr(BGizmo, PU_SC_TEXT, buf); + ++ (void) sprintf(buf, "%i", ICOLOR(attrP->colR)); ++ PuSetStr(rGizmo, PU_SC_TEXT, buf); ++ (void) sprintf(buf, "%i", ICOLOR(attrP->colG)); ++ PuSetStr(gGizmo, PU_SC_TEXT, buf); ++ (void) sprintf(buf, "%i", ICOLOR(attrP->colB)); ++ PuSetStr(bGizmo, PU_SC_TEXT, buf); ++ + showName(); + showColor(); + } +@@ -315,107 +432,152 @@ buildDial(void) + PuGizmo g; + PuConstraints con; + int i; +- +- DialGizmo = PuCreateDialog("Color Dialog", 7, 5); +- PuSetBool(DialGizmo, PU_BC_PLACE_OUTSIDE, TRUE); +- +- con.x = 0; +- con.w = 1; +- con.h = 1; +- +- g = PuCreateLabel(DialGizmo, "Name"); +- con.y = 0; +- PuSetConstraints(g, con); +- PuSwitchGizmo(g, TRUE); +- +- g = PuCreateLabel(DialGizmo, "Red"); +- con.y = 1; +- PuSetConstraints(g, con); +- PuSwitchGizmo(g, TRUE); +- +- g = PuCreateLabel(DialGizmo, "Green"); +- con.y = 2; +- PuSetConstraints(g, con); +- PuSwitchGizmo(g, TRUE); +- +- g = PuCreateLabel(DialGizmo, "Blue"); +- con.y = 3; +- PuSetConstraints(g, con); +- PuSwitchGizmo(g, TRUE); +- +- con.x = 1; +- con.w = 2; +- con.h = 1; +- + NameStr = DStrNew(); ++ + RStr = DStrNew(); + GStr = DStrNew(); + BStr = DStrNew(); ++ rStr = DStrNew(); ++ gStr = DStrNew(); ++ bStr = DStrNew(); ++ + DStrAssignStr(RStr, "0.0"); + DStrAssignStr(GStr, "0.0"); + DStrAssignStr(BStr, "0.0"); ++ DStrAssignStr(rStr, "0"); ++ DStrAssignStr(gStr, "0"); ++ DStrAssignStr(bStr, "0"); + ++ DialGizmo = PuCreateDialog("Color Dialog", 3, 20); ++ PuSetBool(DialGizmo, PU_BC_PLACE_OUTSIDE, TRUE); ++ ++ con.x = 1; ++ con.y = 0; ++ con.w = 2; ++ con.h = 3; ++ ColGizmo = PuCreateColorField(DialGizmo, "Color"); ++ PuSetConstraints(ColGizmo, con); ++ PuSetConstraints(ColGizmo, con); ++ showColor(); ++ PuSwitchGizmo(ColGizmo, TRUE); ++ ++ con.x = 0; ++ con.y = 4; ++ con.w = 1; ++ con.h = 1; ++ g = PuCreateLabel(DialGizmo, "Name"); ++ PuSetConstraints(g, con); ++ PuSwitchGizmo(g, TRUE); ++ con.x = 1; ++ con.w = 2; ++ con.h = 1; + NameGizmo = PuCreateTextField(DialGizmo, "Name", DStrToStr(NameStr)); +- con.y = 0; + PuSetConstraints(NameGizmo, con); +- PuSetInt(NameGizmo, PU_IC_TEXT_WIDTH, 13); ++ PuSetInt(NameGizmo, PU_IC_TEXT_WIDTH, 10); + PuAddGizmoCB(NameGizmo, PU_CT_MODIFY, editCB, "N", NULL); + PuAddGizmoCB(NameGizmo, PU_CT_ACTIVATE, activateCB, "N", NULL); + showName(); + PuSwitchGizmo(NameGizmo, TRUE); + +- RGizmo = PuCreateTextField(DialGizmo, "Red", DStrToStr(RStr)); +- con.y = 1; ++ con.x = 1; ++ con.y = 5; ++ con.w = 2; ++ con.h = 5; ++ g = PuCreateList(DialGizmo, "Color List"); ++ for (i = 0; i < ColorNo; i++) ++ PuAddListEntry(g, ColorList[i].name, FALSE); ++ PuSetConstraints(g, con); ++ PuSetBool(g, PU_BC_AUTO_DESEL, TRUE); ++ PuAddGizmoCB(g, PU_CT_SELECT, selectCB, NULL, NULL); ++ PuSwitchGizmo(g, TRUE); ++ ++ con.x = 1; ++ con.y = 11; ++ con.w = 1; ++ con.h = 1; ++ g = PuCreateLabel(DialGizmo, "Float"); ++ PuSetConstraints(g, con); ++ PuSwitchGizmo(g, TRUE); ++ con.x = 2; ++ con.y = 11; ++ g = PuCreateLabel(DialGizmo, "RGB"); ++ PuSetConstraints(g, con); ++ PuSwitchGizmo(g, TRUE); ++ ++ con.x = 0; ++ con.y = 12; ++ con.w = 1; ++ con.h = 1; ++ g = PuCreateLabel(DialGizmo, "Red"); ++ PuSetConstraints(g, con); ++ PuSwitchGizmo(g, TRUE); ++ con.x = 1; ++ RGizmo = PuCreateTextField(DialGizmo, "RED", DStrToStr(RStr)); + PuSetConstraints(RGizmo, con); + PuSetInt(RGizmo, PU_IC_TEXT_WIDTH, NUM_LEN); + PuAddGizmoCB(RGizmo, PU_CT_MODIFY, editCB, "R", NULL); + PuAddGizmoCB(RGizmo, PU_CT_ACTIVATE, activateCB, "R", NULL); + PuSwitchGizmo(RGizmo, TRUE); ++ con.x = 2; ++ rGizmo = PuCreateTextField(DialGizmo, "red", DStrToStr(rStr)); ++ PuSetConstraints(rGizmo, con); ++ PuSetInt(rGizmo, PU_IC_TEXT_WIDTH, NUM_LEN); ++ PuAddGizmoCB(rGizmo, PU_CT_MODIFY, editCB, "r", NULL); ++ PuAddGizmoCB(rGizmo, PU_CT_ACTIVATE, activateCB, "r", NULL); ++ PuSwitchGizmo(rGizmo, TRUE); + +- GGizmo = PuCreateTextField(DialGizmo, "Green", DStrToStr(GStr)); +- con.y = 2; ++ con.x = 0; ++ con.y = 13; ++ con.w = 1; ++ con.h = 1; ++ g = PuCreateLabel(DialGizmo, "Green"); ++ PuSetConstraints(g, con); ++ PuSwitchGizmo(g, TRUE); ++ con.x = 1; ++ GGizmo = PuCreateTextField(DialGizmo, "GREEN", DStrToStr(GStr)); + PuSetConstraints(GGizmo, con); + PuSetInt(GGizmo, PU_IC_TEXT_WIDTH, NUM_LEN); + PuAddGizmoCB(GGizmo, PU_CT_MODIFY, editCB, "G", NULL); + PuAddGizmoCB(GGizmo, PU_CT_ACTIVATE, activateCB, "G", NULL); + PuSwitchGizmo(GGizmo, TRUE); ++ con.x = 2; ++ gGizmo = PuCreateTextField(DialGizmo, "green", DStrToStr(gStr)); ++ PuSetConstraints(gGizmo, con); ++ PuSetInt(gGizmo, PU_IC_TEXT_WIDTH, NUM_LEN); ++ PuAddGizmoCB(gGizmo, PU_CT_MODIFY, editCB, "g", NULL); ++ PuAddGizmoCB(gGizmo, PU_CT_ACTIVATE, activateCB, "g", NULL); ++ PuSwitchGizmo(gGizmo, TRUE); + +- BGizmo = PuCreateTextField(DialGizmo, "Blue", DStrToStr(BStr)); +- con.y = 3; ++ con.x = 0; ++ con.y = 14; ++ con.w = 1; ++ con.h = 1; ++ g = PuCreateLabel(DialGizmo, "Blue"); ++ PuSetConstraints(g, con); ++ PuSwitchGizmo(g, TRUE); ++ con.x = 1; ++ BGizmo = PuCreateTextField(DialGizmo, "BLUE", DStrToStr(BStr)); + PuSetConstraints(BGizmo, con); + PuSetInt(BGizmo, PU_IC_TEXT_WIDTH, NUM_LEN); + PuAddGizmoCB(BGizmo, PU_CT_MODIFY, editCB, "B", NULL); + PuAddGizmoCB(BGizmo, PU_CT_ACTIVATE, activateCB, "B", NULL); + PuSwitchGizmo(BGizmo, TRUE); ++ con.x = 2; ++ bGizmo = PuCreateTextField(DialGizmo, "blue", DStrToStr(bStr)); ++ PuSetConstraints(bGizmo, con); ++ PuSetInt(bGizmo, PU_IC_TEXT_WIDTH, NUM_LEN); ++ PuAddGizmoCB(bGizmo, PU_CT_MODIFY, editCB, "b", NULL); ++ PuAddGizmoCB(bGizmo, PU_CT_ACTIVATE, activateCB, "b", NULL); ++ PuSwitchGizmo(bGizmo, TRUE); + +- ColGizmo = PuCreateColorField(DialGizmo, "Color"); +- con.x = 3; +- con.y = 0; +- con.w = 2; +- con.h = 4; +- PuSetConstraints(ColGizmo, con); +- showColor(); +- PuSwitchGizmo(ColGizmo, TRUE); +- +- g = PuCreateList(DialGizmo, "Color List"); +- for (i = 0; i < ColorNo; i++) +- PuAddListEntry(g, ColorList[i].name, FALSE); +- con.x = 5; +- con.y = 0; +- con.w = 2; +- con.h = 4; +- PuSetConstraints(g, con); +- PuSetBool(g, PU_BC_AUTO_DESEL, TRUE); +- PuAddGizmoCB(g, PU_CT_SELECT, selectCB, NULL, NULL); +- PuSwitchGizmo(g, TRUE); +- +- con.y = 4; ++ con.x = 0; ++ con.y = 15; + con.w = 1; + con.h = 1; +- + for (i = 0; i < CMD_NO; i++) { + g = PuCreateButton(DialGizmo, LabelList[i]); +- con.x = i; ++ con.x = i%3; ++ if (i%3 == 0) con.y++; + PuSetConstraints(g, con); + PuAddGizmoCB(g, PU_CT_ACTIVATE, cmdCB, NULL, NULL); + PuSwitchGizmo(g, TRUE); +diff --git a/src/cmddial/ExDialRes.c b/src/cmddial/ExDialRes.c +new file mode 100644 +index 0000000..06925ff +--- /dev/null ++++ src/cmddial/ExDialRes.c +@@ -0,0 +1,340 @@ ++/* ++************************************************************************ ++* ++* ExDialMol.c - DialMol command ++* ++* Copyright (c) 1994-98 ++* ++* ETH Zuerich ++* Institut fuer Molekularbiologie und Biophysik ++* ETH-Hoenggerberg ++* CH-8093 Zuerich ++* ++* SPECTROSPIN AG ++* Industriestr. 26 ++* CH-8117 Faellanden ++* ++* All Rights Reserved ++* ++* Date of last modification : 98/08/17 ++* Pathname of SCCS file : /tmp_mnt/net/sn/homeb/rkoradi/molmol-master/src/cmddial/SCCS/s.ExDialMol.c ++* SCCS identification : 1.10 ++* ++************************************************************************ ++*/ ++ ++#include <cmd_dial.h> ++ ++#include <stdio.h> ++#include <string.h> ++#include <stdlib.h> ++ ++#include <break.h> ++#include <pu.h> ++#include <arg.h> ++#include <cip.h> ++#include <data_hand.h> ++ ++#define PROP_NO 3 ++ ++typedef struct { ++ char *label; ++ char *propName; ++ char *cmd; ++} PropDesc; ++typedef struct { ++ char *name; ++ BOOL active; ++} Residue; ++ ++static BOOL DialOn = FALSE; ++static PuGizmo DialGizmo = NULL, ListGizmo; ++static int CurrProp; ++static PropRefP CurrRefP; ++static int MolNo, MolI; ++static BOOL *MolStateA; ++static BOOL SuppressUpdate = FALSE; ++static PropDesc PropTab[] = { ++ {"sel", PROP_SELECTED, "SelectRes"}, ++ {"disp", PROP_DISPLAYED, "DefPropRes 'displayed'"}, ++ {"move", PROP_MOVABLE, "DefProRes 'movable'"} ++}; ++static Residue ResidueTab[] = { ++ {"ARG", FALSE}, ++ {"CYS", FALSE}, ++ {"PRO", FALSE}, ++ {"ASP", FALSE}, ++ {"PHE", FALSE}, ++ {"LEU", FALSE}, ++ {"GLU", FALSE}, ++ {"PRO", FALSE}, ++ {"TYR", FALSE}, ++ {"GLY", FALSE}, ++ {"ASN", FALSE}, ++ {"ALA", FALSE}, ++ {"SER", FALSE}, ++ {"THR", FALSE}, ++ {"LYS", FALSE}, ++ {"ILE", FALSE} ++}; ++ ++static void ++countMol(DhResP molP, void *clientData) ++{ ++ MolNo++; ++} ++ ++ ++ ++static void ++addMol(DhResP molP, void *clientData) ++{ ++ ++ ++ DSTR name; ++ DSTR residue; ++ char buf[10]; ++ char buf2[5]; ++ BOOL propVal; ++ int j; ++ name = DStrNew(); ++ residue = DStrNew(); ++ ++ ++ j= DhResGetNumber(molP); ++ (void) sprintf(buf, "%5d " , j); ++ ++ DStrAssignStr(name, buf); ++ DStrAssignStr(residue, buf2); ++ DStrAppStr(name, " "); ++ ++ DStrAppDStr(residue, DhResGetName(molP)); ++ DStrAppDStr(name, DhResGetName(molP)); ++ propVal = DhResGetProp(CurrRefP, molP); ++ ++ ++ ++ if (! BreakCheck(10)){ ++ PuAddListEntry(ListGizmo, DStrToStr(name), propVal); ++ ++ } ++ ++ ++ ++ MolStateA[MolI] = propVal; ++ ++ DStrFree(name); ++ ++ MolI++; ++} ++ ++static void ++selectMolCB(PuGizmo g, char *name, void *clientData, void *callData) ++{ ++ PuSelectCBStruc *callP = callData; ++ DSTR cmd; ++ BOOL isFirst; ++ char buf[10]; ++ int num, startI, i; ++ ++ (void) sscanf(name, "%d", &num); ++ MolStateA[num - 1] = callP->onOff; ++ ++ if (! callP->last) ++ return; ++ ++ cmd = DStrNew(); ++ DStrAssignStr(cmd, PropTab[CurrProp].cmd); ++ isFirst = TRUE; ++ ++ for (i = 0; i < MolNo; i++) { ++ if (i == 0 || ! MolStateA[i - 1]) ++ startI = i; ++ if (MolStateA[i] && (i == MolNo - 1 || ! MolStateA[i + 1])) { ++ if (isFirst) ++ DStrAppStr(cmd, " 'num = "); ++ else ++ DStrAppStr(cmd, ","); ++ (void) sprintf(buf, "%d", startI + 1); ++ DStrAppStr(cmd, buf); ++ if (i > startI) { ++ DStrAppStr(cmd, ".."); ++ (void) sprintf(buf, "%d", i + 1); ++ DStrAppStr(cmd, buf); ++ } ++ ++ isFirst = FALSE; ++ } ++ } ++ ++ if (isFirst) ++ DStrAppStr(cmd, " '0'"); ++ else ++ DStrAppStr(cmd, "'"); ++ ++ SuppressUpdate = TRUE; ++ CipExecCmd(DStrToStr(cmd)); ++ SuppressUpdate = FALSE; ++ ++ DStrFree(cmd); ++} ++ ++static void ++buildList(void) ++{ ++ int lineNo; ++ ++ MolNo = 0; ++ DhApplyRes(PropGetRef(PROP_ALL, FALSE), countMol, NULL); ++ if (MolNo > 0) { ++ if (MolStateA == NULL) ++ MolStateA = malloc(MolNo * sizeof(*MolStateA)); ++ else ++ MolStateA = realloc(MolStateA, MolNo * sizeof(*MolStateA)); ++ lineNo = MolNo; ++ if (lineNo > 40) ++ lineNo = 40; ++ } else { ++ lineNo = 1; ++ } ++ ++ PuSetInt(ListGizmo, PU_IC_ENTRY_NO, lineNo); ++ ++ MolI = 0; ++ BreakActivate(TRUE); ++ DhApplyRes(PropGetRef(PROP_ALL, FALSE), addMol, NULL); ++ BreakActivate(FALSE); ++ ++ PuSwitchGizmo(ListGizmo, TRUE); ++} ++ ++static void ++updateList(void) ++{ ++ if (SuppressUpdate) ++ return; ++ ++ PuSwitchGizmo(ListGizmo, FALSE); ++ PuRemoveListEntries(ListGizmo, 0, MolNo); ++ buildList(); ++} ++ ++static void ++selectPropCB(PuGizmo g, char *name, void *clientData, void *callData) ++{ ++ PuSelectCBStruc *callP = callData; ++ PropRefP newPropP; ++ int i; ++ ++ if (! callP->onOff) ++ return; ++ ++ for (i = 0; i < PROP_NO; i++) ++ if (strcmp(name, PropTab[i].label) == 0) ++ break; ++ ++ newPropP = PropGetRef(PropTab[i].propName, FALSE); ++ ++ if (newPropP != CurrRefP) { ++ CurrRefP = newPropP; ++ CurrProp = i; ++ updateList(); ++ } ++} ++ ++static void ++popdownCB(PuGizmo g, char *name, void *clientData, void *callData) ++{ ++ PuSwitchGizmo(DialGizmo, FALSE); ++ DialOn = FALSE; ++} ++ ++static void ++listCB(void *clientData) ++{ ++ updateList(); ++} ++ ++static void ++helpCB(PuGizmo g, char *name, void *clientData, void *callData) ++{ ++ CipShowHelpFile(DialGizmo, "DialMol"); ++} ++ ++static void ++buildDial(void) ++{ ++ ++ PuGizmo g; ++ int i; ++ ++ CurrProp = 0; ++ CurrRefP = PropGetRef(PropTab[CurrProp].propName, FALSE); ++ ++ DialGizmo = PuCreateDialog("Residue Dialog", 0, 0); ++ PuSetBool(DialGizmo, PU_BC_PLACE_OUTSIDE, TRUE); ++ ++ g = PuCreateRadioBox(DialGizmo, "Property"); ++ for (i = 0; i < PROP_NO; i++) ++ PuAddToggle(g, PropTab[i].label, i == 0); ++ PuAddGizmoCB(g, PU_CT_SELECT, selectPropCB, NULL, NULL); ++ PuSwitchGizmo(g, TRUE); ++ ++ ListGizmo = PuCreateList(DialGizmo, "Molecules"); ++ PuAddGizmoCB(ListGizmo, PU_CT_SELECT, selectMolCB, NULL, NULL); ++ PuSetBool(ListGizmo, PU_BC_MULT_SEL, TRUE); ++ buildList(); ++ ++ PuAddGizmoCB(DialGizmo, PU_CT_CLOSE, popdownCB, NULL, NULL); ++ PuAddGizmoCB(DialGizmo, PU_CT_HELP, helpCB, NULL, NULL); ++ ++} ++ ++ErrCode ++ExDialRes(char *cmd) ++{ ++ ArgDescr arg; ++ EnumEntryDescr enumEntry[2]; ++ ErrCode errCode; ++ ++ arg.type = AT_ENUM; ++ ++ ArgInit(&arg, 1); ++ ++ arg.prompt = "Residue Dialog"; ++ arg.u.enumD.entryP = enumEntry; ++ arg.u.enumD.n = 2; ++ ++ enumEntry[0].str = "off"; ++ enumEntry[1].str = "on"; ++ ++ enumEntry[0].onOff = DialOn; ++ enumEntry[1].onOff = ! DialOn; ++ if (DialOn) ++ arg.v.intVal = 0; ++ else ++ arg.v.intVal = 1; ++ ++ errCode = ArgGet(&arg, 1); ++ if (errCode != EC_OK) { ++ ArgCleanup(&arg, 1); ++ return errCode; ++ } ++ ++ DialOn = (arg.v.intVal == 1); ++ ++ ArgCleanup(&arg, 1); ++ ++ if (DialOn) { ++ if (DialGizmo == NULL) { ++ buildDial(); ++ DhAddMolListCB(listCB, NULL); ++ } ++ PuSwitchGizmo(DialGizmo, TRUE); ++ } else { ++ if (DialGizmo != NULL) ++ PuSwitchGizmo(DialGizmo, FALSE); ++ } ++ ++ return EC_OK; ++} +\ No newline at end of file +diff --git a/src/cmddial/Makefile b/src/cmddial/Makefile +index d94609d..66fdea9 100644 +--- a/src/cmddial/Makefile ++++ b/src/cmddial/Makefile +@@ -8,7 +8,7 @@ CPPFLAGS = $(INCLUDES) $(MCPPFLAGS) + CFLAGS = $(CPPFLAGS) $(MCFLAGS) + + OBJ = ExDialColor.o ExDialSelect.o ExDialStyle.o ExDialMol.o ExDialMeas.o \ +- ExDialRmsd.o ExUserInterf.o ExRecordMac.o ++ ExDialRes.o ExDialRmsd.o ExUserInterf.o ExRecordMac.o + SRC = $(OBJ:.o=.c) + + default: $(LIBDIR)/libcmd.a +diff --git a/src/cmdio/ExPdb.c b/src/cmdio/ExPdb.c +index 8447c4c..fde9c73 100644 +--- a/src/cmdio/ExPdb.c ++++ b/src/cmdio/ExPdb.c +@@ -1,7 +1,7 @@ + /* + ************************************************************************ + * +-* ExPdb.c - ReadPdb, ReadListPdb and WritePdb commands ++* ExPdb.c - ReadPdb, ReadOldPdb, ReadListPdb and WritePdb commands + * + * Copyright (c) 1994-98 + * +@@ -105,7 +105,7 @@ compFunc(void *p1, void *p2) + } + + static void +-readTransTab(BOOL pdbToIntern) ++readTransTab(BOOL pdbToIntern, BOOL isNewNomenclature) + { + GFile gf; + GFileRes res; +@@ -114,7 +114,7 @@ readTransTab(BOOL pdbToIntern) + + TransTab = TreeOpen(sizeof(TransTabEntry), compFunc); + gf = SetupOpen(PN_PDB_ATOMS, "PdbAtoms", FALSE); +- if (gf == NULL) ++ if (gf == NULL || isNewNomenclature) + return; + + if (pdbToIntern) { +@@ -675,7 +675,7 @@ ExReadPdb(char *cmd) + return errCode; + } + +- readTransTab(TRUE); ++ readTransTab(TRUE, TRUE); + UnknownErrInit(); + + if (replace) { +@@ -755,7 +755,7 @@ ExReadListPdb(char *cmd) + + FileNamePath(fileName); + +- readTransTab(TRUE); ++ readTransTab(TRUE,TRUE); + UnknownErrInit(); + inName = DStrNew(); + pdbName = DStrNew(); +@@ -932,7 +932,7 @@ ExWritePdb(char *cmd) + if (gf == NULL) + return EC_ERROR; + +- readTransTab(FALSE); ++ readTransTab(FALSE,TRUE); + + CHECK_RES(GFileWriteStr(gf, "HEADER Structure from")); + CHECK_RES(GFileWriteStr(gf, PROG_NAME)); +@@ -987,3 +987,61 @@ ExWritePdb(char *cmd) + + return EC_OK; + } ++ ++ErrCode ++ExReadOldPdb(char *cmd) ++{ ++ BOOL replace; ++ DSTR name; ++ int molNo, readNo; ++ DhMolP *molPA; ++ ErrCode errCode; ++ DSTR errStr; ++ ++ replace = (strncmp(cmd, "Replace", 7) == 0); ++ ++ name = DStrNew(); ++ errCode = ArgGetFilename(name, CurrDirGet(), "*.pdb", TRUE); ++ if (errCode != EC_OK) { ++ DStrFree(name); ++ return errCode; ++ } ++ ++ readTransTab(TRUE, FALSE); ++ UnknownErrInit(); ++ ++ if (replace) { ++ molNo = SelMolGet(NULL, 0); ++ if (molNo > 0) { ++ molPA = malloc(molNo * sizeof(*molPA)); ++ (void) SelMolGet(molPA, molNo); ++ } ++ } else { ++ molNo = 0; ++ molPA = NULL; ++ } ++ ++ BreakActivate(TRUE); ++ errCode = readFile(molPA, molNo, name, &readNo); ++ BreakActivate(FALSE); ++ ++ DStrFree(name); ++ TreeClose(TransTab); ++ if (molNo > 0) ++ free(molPA); ++ ++ if (errCode != EC_OK) ++ return EC_ERROR; ++ ++ if (replace) ++ GraphMolChanged(PROP_SELECTED); ++ ++ errStr = UnknownErrGet(); ++ if (errStr != NULL) { ++ CipSetError(DStrToStr(errStr)); ++ DStrFree(errStr); ++ return EC_WARNING; ++ } ++ ++ return EC_OK; ++} +diff --git a/src/cmdstruc/ExBuild.c b/src/cmdstruc/ExBuild.c +index 32bc650..7f003b2 100644 +--- a/src/cmdstruc/ExBuild.c ++++ b/src/cmdstruc/ExBuild.c +@@ -31,11 +31,16 @@ + #include <data_hand.h> + #include <data_sel.h> + #include <graph_draw.h> ++#include <pu.h> + + #define ARG_NUM 1 + + static int CurrPos = 1; + static int CurrKind = 0; ++static PuTextWindow TextW; ++static DhMolP LastMolP=NULL; ++static BOOL messageWindowCreated=FALSE; ++static BOOL cyclicResidueFound=FALSE; + + ErrCode + ExNewMol(char *cmd) +@@ -206,3 +211,121 @@ ExChangeRes(char *cmd) + + return EC_OK; + } ++ ++static void ++writeInt(int num) ++{ ++ char buf[10]; ++ (void) sprintf(buf, "%5d ", num); ++ PuWriteStr(TextW, buf); ++} ++ ++static void ++checkMolCyclic(DhMolP molP, void *clientData) ++{ ++ DhResP resP; ++ DSTR resName = DStrNew(); ++ DStrAssignStr(resName, "XXX"); ++ ++ resP = DhResFirst(molP); ++ while (resP != NULL) { ++ if (DStrCmp(resName, DhResGetName(resP)) == 0) { ++ cyclicResidueFound=TRUE; ++ } ++ resP = DhResNext(resP); ++ } ++ ++ if (cyclicResidueFound && !messageWindowCreated) { ++ TextW = PuCreateTextWindow("MakeMolCyclic"); ++ PuWriteStr(TextW, "--------------------------------------------------\n"); ++ messageWindowCreated=TRUE; ++ } ++ if (cyclicResidueFound) { ++ PuWriteStr(TextW, "Error -"); ++ writeInt(DhMolGetNumber(molP) + 1); ++ PuWriteStr(TextW, DStrToStr(DhMolGetName(molP))); ++ PuWriteStr(TextW, " already made cyclic!\n"); ++ } ++} ++ ++static void ++makeMolCyclic(DhMolP molP, void *clientData) ++{ ++ DhResP xResP, yResP; ++ Vec3 firstCoord, lastCoord, midCoord; ++ DhResP firstResP, lastResP; ++ DhAtomP caAtomP; ++ DSTR atomName = DStrNew(); ++ DhResDefP resDefP = (DhResDefP) clientData; ++ ++ DStrAssignStr(atomName, "CA"); ++ ++ xResP = DhResNewCyclic(molP, resDefP, SP_FIRST); ++ DhResInit(xResP); ++ yResP = DhResNewCyclic(molP, resDefP, SP_LAST); ++ DhResInit(yResP); ++ ++ xResP = DhResFirst(molP); ++ ++ firstResP = DhResNext(xResP); ++ caAtomP = NULL; ++ while (caAtomP == NULL && firstResP != NULL) { ++ caAtomP = DhAtomFindName(firstResP, atomName, FALSE); ++ firstResP = DhResNext(firstResP); ++ } ++ if (caAtomP == NULL) { ++ return; ++ } ++ DhAtomGetCoord(caAtomP, firstCoord); ++ ++ yResP = DhResLast(molP); ++ lastResP = DhResPrev(yResP); ++ caAtomP = NULL; ++ while (caAtomP == NULL && lastResP != NULL) { ++ caAtomP = DhAtomFindName(lastResP, atomName, FALSE); ++ lastResP = DhResPrev(lastResP); ++ } ++ if (caAtomP == NULL) { ++ return; ++ } ++ ++ DhAtomGetCoord(caAtomP, lastCoord); ++ ++ midCoord[0] = (firstCoord[0]+lastCoord[0])/2; ++ midCoord[1] = (firstCoord[1]+lastCoord[1])/2; ++ midCoord[2] = (firstCoord[2]+lastCoord[2])/2; ++ ++ DhAtomSetCoord(DhResGetAtomA(xResP), midCoord); ++ DhAtomSetCoord(DhResGetAtomA(yResP), midCoord); ++} ++ ++ErrCode ++ExMakeMolCyclic(char *cmd) ++{ ++ int ind=0; ++ DhResDefP resDefP; ++ DSTR resName = DStrNew(); ++ ++ messageWindowCreated=FALSE; ++ cyclicResidueFound=FALSE; ++ DhApplyMol(PropGetRef(PROP_SELECTED, FALSE), checkMolCyclic, NULL); ++ if (cyclicResidueFound) { ++ DSTR msg = DStrNew(); ++ DStrAssignStr(msg, "Error cyclic molecules selected"); ++ PuSetTextField(PU_TF_STATUS, DStrToStr(msg)); ++ DStrFree(msg); ++ return EC_OK; ++ } ++ ++ DStrAssignStr(resName, "XXX"); ++ resDefP = DhResDefGet(resName); ++ if (resDefP == NULL) { ++ CipSetError("error cyclic marker residue 'XXX' not found in residue library"); ++ return EC_ERROR; ++ } ++ ++ DhApplyMol(PropGetRef(PROP_SELECTED, FALSE), makeMolCyclic, resDefP); ++ GraphMolChanged(PROP_SELECTED); ++ GraphRedrawNeeded(); ++ return EC_OK; ++} +diff --git a/src/data/DataHand.c b/src/data/DataHand.c +index 368aad3..d020c20 100644 +--- a/src/data/DataHand.c ++++ b/src/data/DataHand.c +@@ -994,9 +994,11 @@ BOOL + DhResDestroy(DhResP resP) + { + /* can only destroy first or last residue of molecule! */ ++ DhMolP molP; + if (resP == ListFirst(resP->molP->resL)) { ++ molP = resP->molP; + ListRemove(resP->molP->resL, resP); +- setEquivI(ListFirst(resP->molP->resL), NULL); ++ setEquivI((DhResP)ListFirst(molP->resL), NULL); + return TRUE; + } else if (resP == ListLast(resP->molP->resL)) { + ListRemove(resP->molP->resL, resP); +@@ -2842,6 +2844,18 @@ DhResGetName(DhResP resP) + return resP->defP->name; + } + ++DhAtomP ++DhResGetAtomA(DhResP resP) ++{ ++ return resP->atomA; ++} ++ ++DhResDefP ++DhResGetDefP(DhResP resP) ++{ ++ return resP->defP; ++} ++ + int + DhResGetNumber(DhResP resP) + { +@@ -3313,3 +3327,101 @@ DhAltCoordListGet(void) + { + return AltCoordList; + } ++ ++static void ++initResCyclic(DhResP resP) ++{ ++ DhResDefP defP; ++ DhResP prevResP, nextResP; ++ DhAtomP atomP, equivAtomP; ++ int i; ++ ++ defP = resP->defP; ++ ++ resP->neighLeftP = NULL; ++ resP->neighRightP = NULL; ++ ++ resP->atomA = malloc(defP->atomNo * sizeof(*resP->atomA)); ++ resP->bondA = malloc(defP->bondNo * sizeof(*resP->bondA)); ++ resP->angleA = malloc(defP->angleNo * sizeof(*resP->angleA)); ++ ++ for (i = 0; i < defP->atomNo; i++) ++ initAtom(resP->atomA + i, resP); ++ ++ for (i = defP->firstBondI; i <= defP->lastBondI; i++) ++ initBond(resP->bondA + i, resP); ++ ++ for (i = 0; i < defP->angleNo; i++) { ++ resP->angleA[i].resP = resP; ++ resP->angleA[i].val = 0.0f; ++ resP->angleA[i].minVal = DH_ANGLE_MIN; ++ resP->angleA[i].maxVal = DH_ANGLE_MAX; ++ resP->angleA[i].changed = FALSE; ++ resP->angleA[i].propTab = PropNewTab(FALSE); ++ } ++ ++ resP->propTab = PropNewTab(FALSE); ++ ++ for (i = 0; i < EQUIV_NO; i++) { ++ resP->equivI[i] = -1; ++ } ++ ++ prevResP = ListPrev(resP->molP->resL, resP); ++ nextResP = ListNext(resP->molP->resL, resP); ++} ++ ++DhResP ++DhResNewCyclic(DhMolP molP, DhResDefP defP, DhSeqPos pos) ++{ ++ struct DhResS resS; ++ DhResP resP, prevResP, nextResP; ++ ++ resS.molP = molP; ++ resS.defP = defP; ++ ++ if (pos == SP_FIRST) { ++ nextResP = ListFirst(molP->resL); ++ if (nextResP == NULL) ++ resS.num = 1; ++ else ++ resS.num = nextResP->num - 1; ++ ++ resP = ListInsertFirst(molP->resL, &resS); ++ } else { ++ prevResP = ListLast(molP->resL); ++ if (prevResP == NULL) ++ resS.num = 1; ++ else ++ resS.num = prevResP->num + 1; ++ ++ resP = ListInsertLast(molP->resL, &resS); ++ } ++ ++ initResCyclic(resP); ++ ++ return resP; ++} ++ ++DhResP ++DhResPrev(DhResP resP) ++{ ++ return (DhResP) ListPrev(resP->molP->resL, resP); ++} ++ ++DhResP ++DhResNext(DhResP resP) ++{ ++ return (DhResP) ListNext(resP->molP->resL, resP); ++} ++ ++DhResP ++DhResFirst(DhMolP molP) ++{ ++ return (DhResP) ListFirst(molP->resL); ++} ++ ++DhResP ++DhResLast(DhMolP molP) ++{ ++ return (DhResP) ListLast(molP->resL); ++} +diff --git a/src/iodev/IODev.c b/src/iodev/IODev.c +index aa4f9a7..9c04ce8 100644 +--- a/src/iodev/IODev.c ++++ b/src/iodev/IODev.c +@@ -44,6 +44,7 @@ extern void IOMotifGLDSetDev(void); + #endif + #ifdef IO_DEV_MOTIF_OGL + extern void IOMotifOGLSetDev(void); ++extern void IOMotifOGLDSetDev(void); + #endif + #ifdef IO_DEV_MOTIF_XGL + extern void IOMotifXGLSetDev(void); +@@ -75,6 +76,7 @@ static DevListEntry DevList[] = { + #endif + #ifdef IO_DEV_MOTIF_OGL + {"Motif/OpenGL", IOMotifOGLSetDev}, ++ {"Motif/OpenGLD", IOMotifOGLDSetDev}, + #endif + #ifdef IO_DEV_MOTIF_XGL + {"Motif/XGL", IOMotifXGLSetDev}, +diff --git a/src/main/MolInit.c b/src/main/MolInit.c +index a7c467a..fccccd3 100644 +--- a/src/main/MolInit.c ++++ b/src/main/MolInit.c +@@ -313,8 +313,9 @@ MolInit(char *defaultDev, int argc, char *argv[], char *macroName) + + SgSetDoubleBuffer(TRUE); + +- ProgDirSet("MOLMOLHOME", "/usr/molmol"); ++ ProgDirSet("MOLMOLHOME", argv[0]); + SetupSetDir("setup"); ++ CurrDirSet(getenv("HOME")); +- UserFileSetDir(CurrDirGet(), "molmol"); ++ UserFileSetDir(CurrDirGet(), ".molmol"); + GFileSetErrorHandler(handleFileError); + +@@ -326,7 +327,7 @@ MolInit(char *defaultDev, int argc, char *argv[], char *macroName) + IOSetErrorHandler(handleIOError); + + PuSetTextField(PU_TF_TITLE, +- "MOLMOL - MOLecule analysis and MOLecule display"); ++ "MOLMOL - MOLecule analysis and MOLecule display - JCU V1.0.8"); + + gf = UserFileOpenRead("par"); + if (gf != NULL) { +diff --git a/src/main/MolMol.c b/src/main/MolMol.c +index 6f825e8..902b50a 100644 +--- a/src/main/MolMol.c ++++ b/src/main/MolMol.c +@@ -30,5 +30,5 @@ + int + main(int argc, char *argv[]) + { +- return MolInit("Motif/X11", argc, argv, NULL); ++ return MolInit("Motif/OpenGL", argc, argv, NULL); + } +diff --git a/src/motif/MotifDial.c b/src/motif/MotifDial.c +index 6e3bfd7..8fe0c5a 100644 +--- a/src/motif/MotifDial.c ++++ b/src/motif/MotifDial.c +@@ -1115,26 +1115,24 @@ PuMotifSetStr(PuGizmo gizmo, PuStrChoice choice, char *val) + void + PuMotifSetColor(PuGizmo gizmo, float r, float g, float b) + { +- Display *dpy; +- int screen; +- Pixel pix; +- XColor col; ++ Display *display; ++ Pixel pixel; ++ XColor color; ++ Colormap colormap; + +- dpy = XtDisplay(gizmo); +- screen = DefaultScreen(dpy); +- XtVaGetValues(gizmo, +- XmNbackground, &pix, +- NULL); ++ display = XtDisplay(gizmo); ++ XtVaGetValues(gizmo, XmNbackground, &pixel, NULL); ++ colormap = DefaultColormapOfScreen(XtScreen(gizmo)); + +- if (pix == BlackPixel(dpy, screen)) +- return; ++ color.pixel = pixel; ++ color.red = FLOAT2SHORT(r); ++ color.green = FLOAT2SHORT(g); ++ color.blue = FLOAT2SHORT(b); ++ color.flags = DoRed | DoGreen | DoBlue; + +- col.pixel = pix; +- col.red = FLOAT2SHORT(r); +- col.green = FLOAT2SHORT(g); +- col.blue = FLOAT2SHORT(b); +- col.flags = DoRed | DoGreen | DoBlue; +- XStoreColor(dpy, DefaultColormap(dpy, screen), &col); ++ XFreeColors(display, colormap, &pixel, 1, 0); ++ XAllocColor(display, colormap, &color); ++ XtVaSetValues(gizmo, XmNbackground, color.pixel, NULL); + } + + void +diff --git a/src/motogl/MotOGLDump.c b/src/motogl/MotOGLDump.c +index 54a4222..3bc25cc 100644 +--- a/src/motogl/MotOGLDump.c ++++ b/src/motogl/MotOGLDump.c +@@ -302,7 +302,7 @@ writeImg(void) + TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8); + + if (Quality < 100) +- TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_PACKBITS); ++ TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_LZW); + else + TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE); + +diff --git a/src/os/CurrDir.c b/src/os/CurrDir.c +index edee778..7d2b242 100644 +--- a/src/os/CurrDir.c ++++ b/src/os/CurrDir.c +@@ -26,9 +26,9 @@ + #include <curr_dir.h> + + #include <stdlib.h> +-#ifdef WIN32 +-#include <direct.h> + #include <string.h> ++#ifdef WIN32 ++#include <direct.h> + #else + #include <unistd.h> + #include <errno.h> +@@ -36,43 +36,15 @@ + + static char *CurrDir = NULL; + ++void ++CurrDirSet(char *dir) ++{ ++ CurrDir = malloc(strlen(dir) + 1); ++ (void) strcpy(CurrDir, dir); ++} ++ + char * + CurrDirGet(void) + { +-#ifdef WIN32 +- int len, i; +-#else +- int size = 10; +-#endif +- +- if (CurrDir != NULL) +- return CurrDir; +- +-#ifdef WIN32 +- CurrDir = _getcwd(NULL, 0); +- if (CurrDir != NULL) { +- len = strlen(CurrDir); +- for (i = 0; i < len; i++) +- if (CurrDir[i] == '\\') +- CurrDir[i] = '/'; +- return CurrDir; +- } +-#else +- CurrDir = malloc(size); +- for (;;) { +- if (getcwd(CurrDir, size) != NULL) +- return CurrDir; +- if (errno != ERANGE) +- break; +- size *= 2; +- CurrDir = realloc(CurrDir, size); +- } +-#endif +- +- /* cannot get current directory, return root directory */ +- CurrDir = realloc(CurrDir, 2); +- CurrDir[0] = '/'; +- CurrDir[1] = '\0'; +- + return CurrDir; + } +diff --git a/src/os/ProgDir.c b/src/os/ProgDir.c +index 7abb08d..79ede45 100644 +--- a/src/os/ProgDir.c ++++ b/src/os/ProgDir.c +@@ -45,10 +45,6 @@ ProgDirSet(char *envVar, char *defVal) + dir = getenv(envVar); + if (dir == NULL) { + len = GetModuleFileName(NULL, exePath, sizeof(exePath)); +- if (len == 0) { +- ProgDir = defVal; +- return; +- } + len--; + while (len > 0 && exePath[len] != '\\') + len--; +@@ -65,9 +61,24 @@ ProgDirSet(char *envVar, char *defVal) + if (ProgDir[i] == '\\') + ProgDir[i] = '/'; + #else +- ProgDir = getenv(envVar); +- if (ProgDir == NULL) +- ProgDir = defVal; ++ char *dir; ++ char *exePath; ++ int len; ++ dir = getenv(envVar); ++ if (dir == NULL) { ++ exePath = defVal; ++ len = strlen(exePath); ++ len--; ++ while (len > 0 && exePath[len] != '/') ++ len--; ++ dir = exePath; ++ } else { ++ len = strlen(dir); ++ } ++ ++ ProgDir = malloc(len + 1); ++ (void) strncpy(ProgDir, dir, len); ++ + #endif + } + +diff --git a/src/win/WinDial.c b/src/win/WinDial.c +index 61d6432..e880559 100644 +--- a/src/win/WinDial.c ++++ b/src/win/WinDial.c +@@ -1072,148 +1072,143 @@ dialProc(HWND w, UINT msgKind, WPARAM wParam, LPARAM lParam) + childP = (GizmoInfo *) GetWindowLong(childW, GWL_USERDATA); + + switch (notifyCode) { +- case BN_CLICKED: +- if (childId < infoP->u.dial.childNo) { ++ case BN_CLICKED: ++ if (childId < infoP->u.dial.childNo) { + childP = (GizmoInfo *) GetWindowLong(GetFocus(), GWL_USERDATA); +- if (childP->type == GIZMO_TOGGLE) { +- boxP = childP->u.toggle.boxP; +- if (boxP->type == GIZMO_RADIO_BOX) { +- for (i = 0; i < infoP->u.dial.childNo; i++) { +- cP = infoP->u.dial.childPA[i]; +- if (cP->type != GIZMO_TOGGLE) +- continue; +- if (cP->u.toggle.boxP != boxP) +- continue; +- onOff = SendMessage(cP->w, BM_GETCHECK, 0, 0); +- if (onOff && cP != childP) { +- cP->u.toggle.onOff = FALSE; +- SendMessage(cP->w, BM_SETCHECK, FALSE, 0); +- selectStruc.onOff = FALSE; +- callCB(boxP, PU_CT_SELECT, cP->name, &selectStruc); +- break; +- } +- } +- if (cP != childP) { +- childP->u.toggle.onOff = TRUE; +- SendMessage(childP->w, BM_SETCHECK, TRUE, 0); +- selectStruc.onOff = TRUE; +- callCB(boxP, PU_CT_SELECT, childP->name, &selectStruc); +- } +- } else { +- onOff = ! SendMessage(childP->w, BM_GETCHECK, 0, 0); +- childP->u.toggle.onOff = onOff; +- SendMessage(childP->w, BM_SETCHECK, onOff, 0); +- selectStruc.onOff = onOff; +- callCB(boxP, PU_CT_SELECT, childP->name, &selectStruc); +- } +- } else { +- callCB(childP, PU_CT_ACTIVATE, childP->name, NULL); +- if (childP->type == GIZMO_TEXT_FIELD && +- childP->u.text.historySize > 0) +- childP->u.text.firstMod = TRUE; +- } +- } else { +- buttonI = childId - infoP->u.dial.childNo; +- callCB(infoP, BUTTON_FIRST + buttonI, ButtonLabelA[buttonI], NULL); +- } ++ if (childP->type == GIZMO_TOGGLE) { ++ boxP = childP->u.toggle.boxP; ++ if (boxP->type == GIZMO_RADIO_BOX) { ++ for (i = 0; i < infoP->u.dial.childNo; i++) { ++ cP = infoP->u.dial.childPA[i]; ++ if (cP->type != GIZMO_TOGGLE) continue; ++ if (cP->u.toggle.boxP != boxP) continue; ++ onOff = SendMessage(cP->w, BM_GETCHECK, 0, 0); ++ if (onOff && cP != childP) { ++ cP->u.toggle.onOff = FALSE; ++ SendMessage(cP->w, BM_SETCHECK, FALSE, 0); ++ selectStruc.onOff = FALSE; ++ callCB(boxP, PU_CT_SELECT, cP->name, &selectStruc); ++ break; ++ } ++ } ++ if (cP != childP) { ++ childP->u.toggle.onOff = TRUE; ++ SendMessage(childP->w, BM_SETCHECK, TRUE, 0); ++ selectStruc.onOff = TRUE; ++ callCB(boxP, PU_CT_SELECT, childP->name, &selectStruc); ++ } ++ } else { ++ onOff = ! SendMessage(childP->w, BM_GETCHECK, 0, 0); ++ childP->u.toggle.onOff = onOff; ++ SendMessage(childP->w, BM_SETCHECK, onOff, 0); ++ selectStruc.onOff = onOff; ++ callCB(boxP, PU_CT_SELECT, childP->name, &selectStruc); ++ } ++ } else { ++ callCB(childP, PU_CT_ACTIVATE, childP->name, NULL); ++ if (childP->type == GIZMO_TEXT_FIELD && childP->u.text.historySize > 0) childP->u.text.firstMod = TRUE; ++ } ++ } else { ++ buttonI = childId - infoP->u.dial.childNo; ++ callCB(infoP, BUTTON_FIRST + buttonI, ButtonLabelA[buttonI], NULL); ++ } + return TRUE; +- case EN_UPDATE: +- textEdit(childP); +- return TRUE; +- case LBN_SELCHANGE: +- for (i = 0; i < childP->u.list.entryNo; i++) +- if (SendMessage(childW, LB_GETSEL, i, 0) != +- childP->u.list.entryA[i].onOff) +- lastI = i; + +- for (i = 0; i < childP->u.list.entryNo; i++) { +- onOff = SendMessage(childW, LB_GETSEL, i, 0); +- if (onOff != childP->u.list.entryA[i].onOff) { +- if (! childP->u.list.autoDesel) ++ case EN_UPDATE: ++ textEdit(childP); ++ return TRUE; ++ ++ case LBN_SELCHANGE: ++ for (i = 0; i < childP->u.list.entryNo; i++) ++ if (SendMessage(childW, LB_GETSEL, i, 0) != childP->u.list.entryA[i].onOff) ++ lastI = i; ++ ++ for (i = 0; i < childP->u.list.entryNo; i++) { ++ onOff = SendMessage(childW, LB_GETSEL, i, 0); ++ if (onOff != childP->u.list.entryA[i].onOff) { ++ if (! childP->u.list.autoDesel) + childP->u.list.entryA[i].onOff = onOff; +- selectStruc.onOff = onOff; +- selectStruc.last = (i == lastI); +- callCB(childP, PU_CT_SELECT, +- childP->u.list.entryA[i].str, &selectStruc); +- } +- } +- +- if (childP->u.list.autoDesel) +- SendMessage(childW, LB_SETCURSEL, -1, 0); +- +- return TRUE; ++ selectStruc.onOff = onOff; ++ selectStruc.last = (i == lastI); ++ callCB(childP, PU_CT_SELECT, ++ childP->u.list.entryA[i].str, &selectStruc); ++ } ++ } ++ if (childP->u.list.autoDesel) ++ SendMessage(childW, LB_SETCURSEL, -1, 0); ++ return TRUE; + } ++ break; + +- break; +- case WM_VSCROLL: +- childW = (HWND) lParam; +- childP = (GizmoInfo *) GetWindowLong(childW, GWL_USERDATA); +- scrollCode = LOWORD(wParam); ++ case WM_VSCROLL: ++ childW = (HWND) lParam; ++ childP = (GizmoInfo *) GetWindowLong(childW, GWL_USERDATA); ++ scrollCode = LOWORD(wParam); + +- if (scrollCode == SB_LINEUP) { +- upHistory(childP->u.scroll.textP); +- } else if (scrollCode == SB_LINEDOWN) { +- downHistory(childP->u.scroll.textP); +- } else { +- return FALSE; +- } +- return TRUE; +- case WM_HSCROLL: +- scrollCode = LOWORD(wParam); +- if (scrollCode != SB_THUMBPOSITION && scrollCode != SB_THUMBTRACK) +- return FALSE; ++ if (scrollCode == SB_LINEUP) { ++ upHistory(childP->u.scroll.textP); ++ } else if (scrollCode == SB_LINEDOWN) { ++ downHistory(childP->u.scroll.textP); ++ } else { ++ return FALSE; ++ } ++ return TRUE; ++ case WM_HSCROLL: ++ scrollCode = LOWORD(wParam); ++ if (scrollCode != SB_THUMBPOSITION && scrollCode != SB_THUMBTRACK) ++ return FALSE; + +- scrollPos = (int)(short)HIWORD(wParam); +- childW = (HWND) lParam; +- childP = (GizmoInfo *) GetWindowLong(childW, GWL_USERDATA); ++ scrollPos = (int)(short)HIWORD(wParam); ++ childW = (HWND) lParam; ++ childP = (GizmoInfo *) GetWindowLong(childW, GWL_USERDATA); + +- floatStruc.oldVal = childP->u.slider.val; +- childP->u.slider.val = scrollPos / childP->u.slider.factor; +- SetScrollPos(childW, SB_CTL, +- (int) (childP->u.slider.val * childP->u.slider.factor), +- TRUE); ++ floatStruc.oldVal = childP->u.slider.val; ++ childP->u.slider.val = scrollPos / childP->u.slider.factor; ++ SetScrollPos(childW, SB_CTL, ++ (int) (childP->u.slider.val * childP->u.slider.factor), TRUE); + +- if (childP->u.slider.valuatorCB == NULL) { +- floatStruc.newVal = childP->u.slider.val; +- callCB(childP, PU_CT_MODIFY, childP->name, &floatStruc); +- } else { +- valStruc.act = PU_MA_ACTIVATE; +- valStruc.name = childP->name; +- valStruc.val = childP->u.slider.val; +- childP->u.slider.valuatorCB(childP, childP->u.slider.clientData, &valStruc); +- } ++ if (childP->u.slider.valuatorCB == NULL) { ++ floatStruc.newVal = childP->u.slider.val; ++ callCB(childP, PU_CT_MODIFY, childP->name, &floatStruc); ++ } else { ++ valStruc.act = PU_MA_ACTIVATE; ++ valStruc.name = childP->name; ++ valStruc.val = childP->u.slider.val; ++ childP->u.slider.valuatorCB(childP, childP->u.slider.clientData, &valStruc); ++ } ++ return TRUE; + +- return TRUE; +- case WM_PAINT: +- for (childId = 0; childId < infoP->u.dial.childNo; childId++) { +- childP = infoP->u.dial.childPA[childId]; +- if (childP->type == GIZMO_COLOR_FIELD) +- paintColor(childP->w, +- childP->u.color.r, childP->u.color.g, childP->u.color.b); +- } +- break; +- case WM_MOVE: +- if (infoP->u.dial.outside) { +- WinPlaceChanged(infoP->w); +- return TRUE; +- } +- break; +- case WM_CLOSE: +- buttonNo = 0; +- for (i = 0; i < BUTTON_NO; i++) +- if (infoP->u.dial.buttonSwitchA[i]) +- buttonNo++; +- if (buttonNo == 0) +- ShowWindow(infoP->w, SW_HIDE); +- return TRUE; +- case WM_DESTROY: +- WinRemoveDialog(w); +- for (childId = 0; childId < infoP->u.dial.childNo; childId++) +- freeInfo(infoP->u.dial.childPA[childId]); +- freeInfo(infoP); +- return TRUE; +- } ++ case WM_PAINT: ++ for (childId = 0; childId < infoP->u.dial.childNo; childId++) { ++ childP = infoP->u.dial.childPA[childId]; ++ if (childP->type == GIZMO_COLOR_FIELD) ++ paintColor(childP->w, ++ childP->u.color.r, childP->u.color.g, childP->u.color.b); ++ } ++ break; + ++ case WM_MOVE: ++ if (infoP->u.dial.outside) { ++ WinPlaceChanged(infoP->w); ++ return TRUE; ++ } ++ break; ++ case WM_CLOSE: ++ buttonNo = 0; ++ for (i = 0; i < BUTTON_NO; i++) { ++ if (infoP->u.dial.buttonSwitchA[i]) buttonNo++; ++ if (buttonNo == 0) { ++ ShowWindow(infoP->w, SW_HIDE); ++ } ++ } ++ return TRUE; ++ case WM_DESTROY: ++ WinRemoveDialog(w); ++ for (childId = 0; childId < infoP->u.dial.childNo; childId++) ++ freeInfo(infoP->u.dial.childPA[childId]); ++ freeInfo(infoP); ++ return TRUE; ++ } + return FALSE; + } + +diff --git a/src/winogl/WinOGLDump.c b/src/winogl/WinOGLDump.c +index 0a7d61a..a8ce850 100644 +--- a/src/winogl/WinOGLDump.c ++++ b/src/winogl/WinOGLDump.c +@@ -44,6 +44,7 @@ + #endif + #ifdef PNG_SUPPORT + #include <png.h> ++#include <pngpriv.h> + #endif + + #include "winogl_int.h" +@@ -251,7 +252,7 @@ static void + pngErrHand(png_structp pngStrucP, char *errMsg) + { + IORaiseError(errMsg); +- longjmp(pngStrucP->jmpbuf, 1); ++ longjmp(pngStrucP->longjmp_buffer, 1); + } + #endif + +@@ -314,7 +315,7 @@ writeImg(void) + TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8); + + if (Quality < 100) +- TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_PACKBITS); ++ TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_LZW); + else + TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE); + +@@ -369,7 +370,7 @@ writeImg(void) + return IO_RES_ERR; + } + +- if (setjmp(pngStrucP->jmpbuf)) { ++ if (setjmp(pngStrucP->longjmp_buffer)) { + if (cBuf != NULL) + free(cBuf); + if (fBuf != NULL) diff --git a/sci-chemistry/molmol/molmol-2k_p2-r5.ebuild b/sci-chemistry/molmol/molmol-2k_p2-r5.ebuild new file mode 100644 index 000000000000..eff1d99fd425 --- /dev/null +++ b/sci-chemistry/molmol/molmol-2k_p2-r5.ebuild @@ -0,0 +1,88 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/molmol/molmol-2k_p2-r5.ebuild,v 1.1 2014/07/22 16:49:36 jlec Exp $ + +EAPI=5 + +inherit eutils multilib prefix toolchain-funcs + +MY_PV="${PV/_p/.}.0" +MY_P="${PN}-${MY_PV}" + +DESCRIPTION="Publication-quality molecular visualization package" +HOMEPAGE="http://hugin.ethz.ch/wuthrich/software/molmol/index.html" +SRC_URI=" + ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-src.tar.gz + ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-doc.tar.gz" + +LICENSE="molmol" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux" +IUSE="" + +DEPEND=" + || ( + ( media-libs/mesa + x11-libs/libGLw ) + media-libs/mesa[motif] ) + media-libs/libpng:0 + media-libs/tiff:0 + sys-libs/zlib + virtual/glu + virtual/jpeg + x11-libs/libXpm + x11-libs/motif:0 + x11-apps/xdpyinfo" +RDEPEND="${DEPEND}" + +S="${WORKDIR}" + +MAKEOPTS="${MAKEOPTS} -j1" + +pkg_setup() { + MMDIR="/usr/$(get_libdir)/molmol" +} + +src_prepare() { + rm -rf tiff* + # Patch from http://pjf.net/science/molmol.html, where src.rpm is provided + epatch "${FILESDIR}"/pjf_RH9_molmol2k2.diff + + epatch "${FILESDIR}"/prefix.patch + eprefixify molmol + + epatch "${FILESDIR}"/ldflags.patch + epatch "${FILESDIR}"/opengl.patch + + ln -s makedef.lnx "${S}"/makedef || die + + sed \ + -e "s:ksh:sh:" \ + -e "s:^MOLMOLHOME.*:MOLMOLHOME=${EPREFIX}/${MMDIR};MOLMOLDEV=\"Motif/OpenGL\":" \ + -i "${S}"/molmol || die + sed \ + -e "s:^MCFLAGS.*:MCFLAGS = ${CFLAGS}:" \ + -e "s:^CC.*:CC = $(tc-getCC):" \ + -i "${S}"/makedef || die + + epatch "${FILESDIR}"/cast.patch + epatch "${FILESDIR}"/libpng15.patch + + # patch from fink + # fixes numerous bad bracings and hopefully the OGL bug 429974 + epatch "${FILESDIR}"/${P}-fink.patch + + epatch "${FILESDIR}"/wild.patch + tc-export AR +} + +src_install() { + dobin molmol + + exeinto ${MMDIR} + doexe src/main/molmol + insinto ${MMDIR} + doins -r auxil help macros man setup tips + + dodoc HISTORY README +} |