Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-chemistry/molmol/files/, sci-chemistry/molmol/
Date: Sun, 29 Oct 2017 23:20:49
Message-Id: 1509319228.36b43ceb873e20cc36cf55b6a2e09c3d01306e49.soap@gentoo
1 commit: 36b43ceb873e20cc36cf55b6a2e09c3d01306e49
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Mon Oct 16 04:59:29 2017 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 29 23:20:28 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=36b43ceb
7
8 sci-chemistry/molmol: Move patches to dist tarball
9
10 Package-Manager: Portage-2.3.11, Repoman-2.3.3
11
12 sci-chemistry/molmol/Manifest | 1 +
13 sci-chemistry/molmol/files/cast.patch | 21 -
14 sci-chemistry/molmol/files/ldflags.patch | 13 -
15 sci-chemistry/molmol/files/libpng15.patch | 32 -
16 sci-chemistry/molmol/files/molmol-2k_p2-fink.patch | 356 ----
17 sci-chemistry/molmol/files/opengl.patch | 96 -
18 sci-chemistry/molmol/files/pjf_RH9_molmol2k2.diff | 103 --
19 sci-chemistry/molmol/files/prefix.patch | 22 -
20 sci-chemistry/molmol/files/wild.patch | 1866 --------------------
21 sci-chemistry/molmol/molmol-2k_p2-r2.ebuild | 15 +-
22 sci-chemistry/molmol/molmol-2k_p2-r3.ebuild | 17 +-
23 sci-chemistry/molmol/molmol-2k_p2-r4.ebuild | 17 +-
24 sci-chemistry/molmol/molmol-2k_p2-r5.ebuild | 17 +-
25 13 files changed, 36 insertions(+), 2540 deletions(-)
26
27 diff --git a/sci-chemistry/molmol/Manifest b/sci-chemistry/molmol/Manifest
28 index 3b9280e4b83..aed5ea92035 100644
29 --- a/sci-chemistry/molmol/Manifest
30 +++ b/sci-chemistry/molmol/Manifest
31 @@ -1,2 +1,3 @@
32 DIST molmol-2k.2.0-doc.tar.gz 1062297 SHA256 07e1c3fd04ffe7c9e9d91eaefa0bf72e6d0913a981eec3bf0879bfc65537a6be SHA512 131f747a5762859398ebe9b676a07df56c82c8864ecc035ec914f1dea74dafcd67f87993421dfe5899c640470c7e1e1ef03ae262b04a9b360ae329eb19a331fe WHIRLPOOL b74f47149c4dce8199722075fda17c9cbe22263eec57b647ef543b15386d53b267ee85d5a2c44a4fda7e533fd6ccdafb82fbbbd71e671ec4e1fd58e07363677c
33 DIST molmol-2k.2.0-src.tar.gz 1088805 SHA256 1104dcb1b2517581c7d6b1695ff2e92f4076ad34afc48dd896eec38e5acf2287 SHA512 6ab01a6fd3d19752634a2cf22919a20e43d195768bd4bdacd5f0bbe016c3058c94915bad4c7fa64dcd86576be39cad0ae112cb62f5e69ffb10041518101e7a9b WHIRLPOOL e258ede83ac4a8fe9b4a9274588ced7e1294415d864c909ed83e3e56d36512e1388e6f77e45da614bc19992a265d32b739c54aace7faa28971c61a01bba27541
34 +DIST molmol-patches.tbz2 17528 SHA256 5c3b867762e563c91583e3c965c956e4004edc5532e84a33dce244e0140f596c SHA512 bd94baf0a378f40f854f396963edd9b9e4afc5c56462ee6f8b68889290afdb4c5d9b10878aa5619d0a70153453fe6ee8e7540064522c6db0291ae9162bba9287 WHIRLPOOL 6ebe6ee4142e9c10c5960a0defd3d3b4a7841281b42f865e7777d5f28d878202500442e6afa21e3bd64e691d4ed903712baffe5488abd8dcdec99cb616004380
35
36 diff --git a/sci-chemistry/molmol/files/cast.patch b/sci-chemistry/molmol/files/cast.patch
37 deleted file mode 100644
38 index 16ac411c76e..00000000000
39 --- a/sci-chemistry/molmol/files/cast.patch
40 +++ /dev/null
41 @@ -1,21 +0,0 @@
42 -diff --git a/src/data/DataDist.c b/src/data/DataDist.c
43 -index 7f7121f..18eef33 100644
44 ---- a/src/data/DataDist.c
45 -+++ b/src/data/DataDist.c
46 -@@ -27,6 +27,7 @@
47 -
48 - #include <stdio.h>
49 - #include <stdlib.h>
50 -+#include <stdint.h>
51 -
52 - #include <hashtab.h>
53 -
54 -@@ -89,7 +90,7 @@ hashInter(void *p, unsigned size)
55 - {
56 - TabEntryInter *entryP = p;
57 -
58 -- return ((unsigned) entryP->atom1P + (unsigned) entryP->atom2P) % size;
59 -+ return ((unsigned)(uintptr_t) entryP->atom1P + (unsigned)(uintptr_t) entryP->atom2P) % size;
60 - }
61 -
62 - static int
63
64 diff --git a/sci-chemistry/molmol/files/ldflags.patch b/sci-chemistry/molmol/files/ldflags.patch
65 deleted file mode 100644
66 index ff6e06ef490..00000000000
67 --- a/sci-chemistry/molmol/files/ldflags.patch
68 +++ /dev/null
69 @@ -1,13 +0,0 @@
70 -diff --git a/src/main/Makefile b/src/main/Makefile
71 -index 74530fa..102d1b7 100644
72 ---- a/src/main/Makefile
73 -+++ b/src/main/Makefile
74 -@@ -22,7 +22,7 @@ SRC = $(OBJ:.o=.c)
75 - default: $(PROGRAM)
76 -
77 - $(PROGRAM): $(OBJ) $(LIBS) $(SGLIB) $(TOOLSLIB)
78 -- $(CC) -o $@ $(CFLAGS) $(OBJ) $(LIBS) $(SGLIB) $(TOOLSLIB) $(SYSLIB)
79 -+ $(CC) $(CFLAGS) ${LDFLAGS} -o $@ $(OBJ) $(LIBS) $(SGLIB) $(TOOLSLIB) $(SYSLIB)
80 -
81 - clean:
82 - rm -f $(OBJ) $(PROGRAM) core *.ps
83
84 diff --git a/sci-chemistry/molmol/files/libpng15.patch b/sci-chemistry/molmol/files/libpng15.patch
85 deleted file mode 100644
86 index cd27e490660..00000000000
87 --- a/sci-chemistry/molmol/files/libpng15.patch
88 +++ /dev/null
89 @@ -1,32 +0,0 @@
90 ---- src/motogl/MotOGLDump.c
91 -+++ src/motogl/MotOGLDump.c
92 -@@ -248,7 +248,7 @@
93 - pngErrHand(png_structp pngStrucP, char *errMsg)
94 - {
95 - IORaiseError(errMsg);
96 -- longjmp(pngStrucP->jmpbuf, 1);
97 -+ longjmp(png_jmpbuf(pngStrucP), 1);
98 - }
99 - #endif
100 -
101 -@@ -357,7 +357,7 @@
102 - return IO_RES_ERR;
103 - }
104 -
105 -- if (setjmp(pngStrucP->jmpbuf)) {
106 -+ if (setjmp(png_jmpbuf(pngStrucP))) {
107 - if (cBuf != NULL)
108 - free(cBuf);
109 - if (fBuf != NULL)
110 -@@ -368,10 +368,7 @@
111 -
112 - png_init_io(pngStrucP, ImgFileP);
113 -
114 -- pngInfoP->width = imgW;
115 -- pngInfoP->height = imgH;
116 -- pngInfoP->bit_depth = 8;
117 -- pngInfoP->color_type = PNG_COLOR_TYPE_RGB;
118 -+ png_set_IHDR(pngStrucP, pngInfoP, imgW, imgH, 8, PNG_COLOR_TYPE_RGB, 0, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
119 - png_write_info(pngStrucP, pngInfoP);
120 - }
121 - #endif
122
123 diff --git a/sci-chemistry/molmol/files/molmol-2k_p2-fink.patch b/sci-chemistry/molmol/files/molmol-2k_p2-fink.patch
124 deleted file mode 100644
125 index 14cc83b63e9..00000000000
126 --- a/sci-chemistry/molmol/files/molmol-2k_p2-fink.patch
127 +++ /dev/null
128 @@ -1,356 +0,0 @@
129 - src/calc/CalcRmsd.c | 8 ++++----
130 - src/cmdfig/FigUtil.c | 46 +++++++++++++++++++++++-----------------------
131 - src/cmdio/ExWriteSec.c | 6 +++---
132 - src/data/DataDist.c | 2 +-
133 - src/data/DataHand.c | 8 ++++----
134 - src/expr/ExprScan.c | 2 +-
135 - src/iodev/IODev.c | 2 --
136 - src/motif/MotifDial.c | 2 +-
137 - src/motif/MotifMainW.c | 4 ++--
138 - src/os/GFile.c | 2 +-
139 - src/prim/PrimDraw.c | 2 +-
140 - src/prim/RibbonCalc.c | 12 ++++++------
141 - src/pudev/PuMainW.c | 2 +-
142 - src/tty/TTY.c | 2 +-
143 - tools/src/IsoSurface.c | 22 +++++++++++-----------
144 - 15 files changed, 60 insertions(+), 62 deletions(-)
145 -
146 -diff --git a/src/calc/CalcRmsd.c b/src/calc/CalcRmsd.c
147 -index 0e4629e..ed99e76 100644
148 ---- a/src/calc/CalcRmsd.c
149 -+++ b/src/calc/CalcRmsd.c
150 -@@ -1025,10 +1025,10 @@ CalcRmsd(BOOL fitPairs, char *range, char *glob1, char *glob2,
151 - }
152 -
153 - for (propI = 0; propI < 2; propI++) {
154 -- if (groupNo == 0 || propI == 0 && ! calc1)
155 -+ if (groupNo == 0 || (propI == 0 && ! calc1))
156 - continue;
157 -
158 -- if (groupNo == 0 || propI == 1 && ! calc2)
159 -+ if (groupNo == 0 || (propI == 1 && ! calc2))
160 - continue;
161 -
162 - Report("\nAverage RMSD, dev., min. and max of ");
163 -@@ -1052,8 +1052,8 @@ CalcRmsd(BOOL fitPairs, char *range, char *glob1, char *glob2,
164 - Report(" ");
165 -
166 - for (groupI2 = 0; groupI2 < groupNo; groupI2++) {
167 -- if (groupI1 < groupI2 &&
168 -- groupInfoP[groupI1].membNo != groupInfoP[groupI2].membNo ||
169 -+ if (((groupI1 < groupI2) &&
170 -+ (groupInfoP[groupI1].membNo != groupInfoP[groupI2].membNo)) ||
171 - groupInfoP[groupI1].membNo == 0 ||
172 - groupInfoP[groupI2].membNo == 0) {
173 - groupInfoP[groupI2].stat.avg = 0.0f;
174 -diff --git a/src/cmdfig/FigUtil.c b/src/cmdfig/FigUtil.c
175 -index 20d403a..b8dc3a6 100644
176 ---- a/src/cmdfig/FigUtil.c
177 -+++ b/src/cmdfig/FigUtil.c
178 -@@ -44,29 +44,29 @@ typedef struct {
179 - } TabEntry;
180 -
181 - static TabEntry GreekTab[] = {
182 -- "ALPHA", 'a',
183 -- "BETA", 'b',
184 -- "CHI", 'c',
185 -- "DELTA", 'd',
186 -- "EPSILON", 'e',
187 -- "PHI" , 'f',
188 -- "GAMMA", 'g',
189 -- "ETA", 'h',
190 -- "IOTA", 'i',
191 -- "KAPPA", 'k',
192 -- "LAMBDA", 'l',
193 -- "MU", 'm',
194 -- "NU", 'n',
195 -- "PI", 'p',
196 -- "THETA", 'q',
197 -- "RHO", 'r',
198 -- "SIGMA", 's',
199 -- "TAU", 't',
200 -- "UPSILON", 'u',
201 -- "OMEGA", 'w',
202 -- "XI", 'x',
203 -- "PSI", 'y',
204 -- "ZETA", 'z'
205 -+ {"ALPHA", 'a'},
206 -+ {"BETA", 'b'},
207 -+ {"CHI", 'c'},
208 -+ {"DELTA", 'd'},
209 -+ {"EPSILON", 'e'},
210 -+ {"PHI" , 'f'},
211 -+ {"GAMMA", 'g'},
212 -+ {"ETA", 'h'},
213 -+ {"IOTA", 'i'},
214 -+ {"KAPPA", 'k'},
215 -+ {"LAMBDA", 'l'},
216 -+ {"MU", 'm'},
217 -+ {"NU", 'n'},
218 -+ {"PI", 'p'},
219 -+ {"THETA", 'q'},
220 -+ {"RHO", 'r'},
221 -+ {"SIGMA", 's'},
222 -+ {"TAU", 't'},
223 -+ {"UPSILON", 'u'},
224 -+ {"OMEGA", 'w'},
225 -+ {"XI", 'x'},
226 -+ {"PSI", 'y'},
227 -+ {"ZETA", 'z'}
228 - };
229 -
230 - int
231 -diff --git a/src/cmdio/ExWriteSec.c b/src/cmdio/ExWriteSec.c
232 -index 7f705d4..8da8336 100644
233 ---- a/src/cmdio/ExWriteSec.c
234 -+++ b/src/cmdio/ExWriteSec.c
235 -@@ -250,9 +250,9 @@ writeSecondary(DhResP *resPA, int resNo)
236 -
237 - if (neighLStart != NO_RES) {
238 - if (num != neighLEnd + 1 ||
239 -- neighNum != neighREnd + 1 && neighNum != neighREnd - 1 ||
240 -- neighREnd > neighRStart && neighNum != neighREnd + 1 ||
241 -- neighREnd < neighRStart && neighNum != neighREnd - 1) {
242 -+ (neighNum != neighREnd + 1 && neighNum != neighREnd - 1) ||
243 -+ (neighREnd > neighRStart && neighNum != neighREnd + 1) ||
244 -+ (neighREnd < neighRStart && neighNum != neighREnd - 1)) {
245 - writeNeigh(neighLStart, neighLEnd, neighRStart, neighREnd);
246 - neighLStart = NO_RES;
247 - } else {
248 -diff --git a/src/data/DataDist.c b/src/data/DataDist.c
249 -index 18eef33..c683f9e 100644
250 ---- a/src/data/DataDist.c
251 -+++ b/src/data/DataDist.c
252 -@@ -117,7 +117,7 @@ fillIntra(TabEntryIntra *entryP, DhAtomP atom1P, DhAtomP atom2P)
253 - entryP->atom2I = DhAtomGetNumber(atom2P);
254 -
255 - if (entryP->res1I > entryP->res2I ||
256 -- entryP->res1I == entryP->res2I && entryP->atom1I > entryP->atom2I) {
257 -+ (entryP->res1I == entryP->res2I && entryP->atom1I > entryP->atom2I)) {
258 - t = entryP->res1I;
259 - entryP->res1I = entryP->res2I;
260 - entryP->res2I = t;
261 -diff --git a/src/data/DataHand.c b/src/data/DataHand.c
262 -index b20e29c..368aad3 100644
263 ---- a/src/data/DataHand.c
264 -+++ b/src/data/DataHand.c
265 -@@ -2043,8 +2043,8 @@ applyBondList(PropRefP refP, LINLIST bondL, int groupNum,
266 - groupNum1 = getGroupNum(bondAddP->res1P->molP);
267 - groupNum2 = getGroupNum(bondAddP->res2P->molP);
268 - if (atom1P->state == AS_VALID && atom2P->state == AS_VALID &&
269 -- (groupNum1 == groupNum && groupNum2 == groupNum ||
270 -- groupNum < 0 && groupNum1 != groupNum2))
271 -+ ((groupNum1 == groupNum && groupNum2 == groupNum) ||
272 -+ (groupNum < 0 && groupNum1 != groupNum2)))
273 - applyF(bondP, atom1P, atom2P, clientData);
274 - }
275 - bondAddP = nextBondAddP;
276 -@@ -2367,8 +2367,8 @@ callDistApply(PropRefP refP, DhDistP distP, int groupNum,
277 - groupNum1 = getGroupNum(distP->res1P->molP);
278 - groupNum2 = getGroupNum(distP->res2P->molP);
279 - if (atom1P->state == AS_VALID && atom2P->state == AS_VALID &&
280 -- (groupNum1 == groupNum && groupNum2 == groupNum ||
281 -- groupNum < 0 && groupNum1 != groupNum2))
282 -+ ((groupNum1 == groupNum && groupNum2 == groupNum) ||
283 -+ (groupNum < 0 && groupNum1 != groupNum2)))
284 - applyF(distP, atom1P, atom2P, clientData);
285 - }
286 - }
287 -diff --git a/src/expr/ExprScan.c b/src/expr/ExprScan.c
288 -index dcef69e..6266b4d 100644
289 ---- a/src/expr/ExprScan.c
290 -+++ b/src/expr/ExprScan.c
291 -@@ -221,7 +221,7 @@ ExprScanGetSym(void)
292 - for (;;) {
293 - if (isdigit(ch)) {
294 - DStrAppChar(StrVal, ch);
295 -- } else if (ch == '.' && ExprStr[1] != '.' ||
296 -+ } else if ((ch == '.' && ExprStr[1] != '.') ||
297 - ch == 'e' || ch == 'E') {
298 - DStrAppChar(StrVal, ch);
299 - isFloat = TRUE;
300 -diff --git a/src/iodev/IODev.c b/src/iodev/IODev.c
301 -index 9c04ce8..aa4f9a7 100644
302 ---- a/src/iodev/IODev.c
303 -+++ b/src/iodev/IODev.c
304 -@@ -44,7 +44,6 @@ extern void IOMotifGLDSetDev(void);
305 - #endif
306 - #ifdef IO_DEV_MOTIF_OGL
307 - extern void IOMotifOGLSetDev(void);
308 --extern void IOMotifOGLDSetDev(void);
309 - #endif
310 - #ifdef IO_DEV_MOTIF_XGL
311 - extern void IOMotifXGLSetDev(void);
312 -@@ -76,7 +75,6 @@ static DevListEntry DevList[] = {
313 - #endif
314 - #ifdef IO_DEV_MOTIF_OGL
315 - {"Motif/OpenGL", IOMotifOGLSetDev},
316 -- {"Motif/OpenGLD", IOMotifOGLDSetDev},
317 - #endif
318 - #ifdef IO_DEV_MOTIF_XGL
319 - {"Motif/XGL", IOMotifXGLSetDev},
320 -diff --git a/src/motif/MotifDial.c b/src/motif/MotifDial.c
321 -index 2514549..6e3bfd7 100644
322 ---- a/src/motif/MotifDial.c
323 -+++ b/src/motif/MotifDial.c
324 -@@ -1323,7 +1323,7 @@ PuMotifAddGizmoCB(PuGizmo gizmo, PuGizmoCBType type,
325 -
326 - switch (type) {
327 - case PU_CT_ACTIVATE:
328 -- if (gType == GIZMO_TEXT_FIELD || GIZMO_TEXT)
329 -+ if (gType == (GIZMO_TEXT_FIELD | GIZMO_TEXT))
330 - XtAddCallback(gizmo, XmNactivateCallback, textActivateCB, infoP);
331 - else if (gType == GIZMO_BUTTON)
332 - XtAddCallback(gizmo, XmNactivateCallback, gizmoGenCB, infoP);
333 -diff --git a/src/motif/MotifMainW.c b/src/motif/MotifMainW.c
334 -index abbb444..77ce8fd 100644
335 ---- a/src/motif/MotifMainW.c
336 -+++ b/src/motif/MotifMainW.c
337 -@@ -80,8 +80,8 @@ checkPressOrExpose(Display *dpy, XEvent *eventP, XPointer arg)
338 - {
339 - Window *winP = (Window *) arg;
340 -
341 -- return eventP->type == ButtonPress && eventP->xbutton.window == *winP ||
342 -- eventP->type == Expose && eventP->xexpose.window == *winP;
343 -+ return (eventP->type == ButtonPress && eventP->xbutton.window == *winP) ||
344 -+ (eventP->type == Expose && eventP->xexpose.window == *winP);
345 - }
346 -
347 - static void
348 -diff --git a/src/os/GFile.c b/src/os/GFile.c
349 -index d0d63b6..08d48c7 100644
350 ---- a/src/os/GFile.c
351 -+++ b/src/os/GFile.c
352 -@@ -385,7 +385,7 @@ GFileEOF(GFile gf)
353 - {
354 - if (gf->format == GF_FORMAT_MEMORY)
355 - return gf->currP == NULL ||
356 -- gf->currP->nextP == NULL && gf->currPos == gf->currP->len;
357 -+ (gf->currP->nextP == NULL && gf->currPos == gf->currP->len);
358 - else
359 - return feof(gf->fp);
360 - }
361 -diff --git a/src/prim/PrimDraw.c b/src/prim/PrimDraw.c
362 -index 32bd593..ba89c57 100644
363 ---- a/src/prim/PrimDraw.c
364 -+++ b/src/prim/PrimDraw.c
365 -@@ -461,7 +461,7 @@ drawRibbon(PrimObjP primP)
366 - }
367 -
368 - if (partP->paint == RP_ATOM ||
369 -- partP->paint == RP_ATOM_SMOOTH && partP->polyNo > 0)
370 -+ (partP->paint == RP_ATOM_SMOOTH && partP->polyNo > 0))
371 - SgSetColor(attrP->colR, attrP->colG, attrP->colB);
372 -
373 - if (partP->paint == RP_ATOM_SMOOTH)
374 -diff --git a/src/prim/RibbonCalc.c b/src/prim/RibbonCalc.c
375 -index 09874cf..0849d03 100644
376 ---- a/src/prim/RibbonCalc.c
377 -+++ b/src/prim/RibbonCalc.c
378 -@@ -907,7 +907,7 @@ calcStrips(PrimObjP primP, PrimObjP prevP)
379 - getSplinePoints(partP, ribbonP, ePar, partP->endPar, ePNo + 1,
380 - parA + sPNo + mPNo - 1, xA + sPNo + mPNo - 1, dzA + sPNo + mPNo - 1);
381 -
382 -- if (partP->style == RS_ROUND && partP->midRad == 0.0f ||
383 -+ if ((partP->style == RS_ROUND && partP->midRad == 0.0f) ||
384 - BreakInterrupted()) {
385 - /* draw only one line */
386 - partP->traceNo = 1;
387 -@@ -1128,15 +1128,15 @@ calcStrips(PrimObjP primP, PrimObjP prevP)
388 - Vec3Copy(partP->traceA[traceI].nvA[pointI], nv);
389 - }
390 -
391 -- if (pointI == 0 && partP->startStyle == RE_SHARP ||
392 -- pointI == pointNo - ePNo && partP->endStyle == RE_ARROW)
393 -+ if ((pointI == 0 && partP->startStyle == RE_SHARP) ||
394 -+ (pointI == pointNo - ePNo && partP->endStyle == RE_ARROW))
395 - Vec3Copy(partP->polyA[polyI].xA[traceNo - 1 - traceI], x);
396 - else if (pointI == pointNo - 1 && partP->endStyle == RE_SHARP)
397 - Vec3Copy(partP->polyA[polyI].xA[traceI], x);
398 - }
399 -
400 -- if (pointI == 0 && partP->startStyle == RE_SHARP ||
401 -- pointI == pointNo - ePNo && partP->endStyle == RE_ARROW) {
402 -+ if ((pointI == 0 && partP->startStyle == RE_SHARP) ||
403 -+ (pointI == pointNo - ePNo && partP->endStyle == RE_ARROW)) {
404 - Vec3Copy(x, dy);
405 - Vec3Cross(x, dx);
406 - Vec3Copy(partP->polyA[polyI].nv, x);
407 -@@ -1327,7 +1327,7 @@ RibbonCalc(PrimObjP primP)
408 -
409 - if (! partP->pointValid || prec != partP->prec ||
410 - startRad != partP->startRad ||
411 -- partP->style == RS_ROUND && midRad != partP->midRad ||
412 -+ (partP->style == RS_ROUND && midRad != partP->midRad) ||
413 - endRad != partP->endRad || radChanged) {
414 - for (i = 0; i < partP->traceNo; i++) {
415 - free(partP->traceA[i].xA);
416 -diff --git a/src/pudev/PuMainW.c b/src/pudev/PuMainW.c
417 -index 73d183b..d287345 100644
418 ---- a/src/pudev/PuMainW.c
419 -+++ b/src/pudev/PuMainW.c
420 -@@ -57,7 +57,7 @@ PuSetTextField(PuTextFieldChoice fieldChoice, char *text)
421 - if (text[0] != LOCK_CHAR)
422 - return;
423 - text++;
424 -- if (text[0] == '\0' || text[0] == ' ' && text[1] == '\0') {
425 -+ if (text[0] == '\0' || (text[0] == ' ' && text[1] == '\0')) {
426 - StatusLocked = FALSE;
427 - text = " ";
428 - }
429 -diff --git a/src/tty/TTY.c b/src/tty/TTY.c
430 -index 0090f75..22adfef 100644
431 ---- a/src/tty/TTY.c
432 -+++ b/src/tty/TTY.c
433 -@@ -164,7 +164,7 @@ PuTTYSwitchFullscreen(BOOL onOff)
434 - void
435 - PuTTYSetTextField(PuTextFieldChoice fieldChoice, char *text)
436 - {
437 -- if (text[0] == '\0' || text[0] == ' ' && text[1] == '\0')
438 -+ if (text[0] == '\0' || (text[0] == ' ' && text[1] == '\0'))
439 - return;
440 -
441 - switch (fieldChoice) {
442 -diff --git a/tools/src/IsoSurface.c b/tools/src/IsoSurface.c
443 -index 5e11a98..09f89d0 100644
444 ---- a/tools/src/IsoSurface.c
445 -+++ b/tools/src/IsoSurface.c
446 -@@ -104,19 +104,19 @@ typedef struct {
447 - } Strip;
448 -
449 - static CubeDesc CubeEven = {
450 -- 0, 3, 5, 6, {{D_0, 1}, {D_0, 2}, {D_0, 3}, {D_0, 4}},
451 -- 3, 0, 5, 1, {{D_0, 0}, {D_MZ, 4}, {D_MY, 1}, {D_PX, 2}},
452 -- 0, 3, 6, 2, {{D_0, 0}, {D_MZ, 3}, {D_PY, 2}, {D_MX, 1}},
453 -- 3, 5, 6, 7, {{D_0, 0}, {D_PX, 3}, {D_PZ, 1}, {D_PY, 4}},
454 -- 5, 0, 6, 4, {{D_0, 0}, {D_MY, 3}, {D_MX, 4}, {D_PZ, 2}}
455 -+ {{0, 3, 5, 6, {{D_0, 1}, {D_0, 2}, {D_0, 3}, {D_0, 4}}},
456 -+ {3, 0, 5, 1, {{D_0, 0}, {D_MZ, 4}, {D_MY, 1}, {D_PX, 2}}},
457 -+ {0, 3, 6, 2, {{D_0, 0}, {D_MZ, 3}, {D_PY, 2}, {D_MX, 1}}},
458 -+ {3, 5, 6, 7, {{D_0, 0}, {D_PX, 3}, {D_PZ, 1}, {D_PY, 4}}},
459 -+ {5, 0, 6, 4, {{D_0, 0}, {D_MY, 3}, {D_MX, 4}, {D_PZ, 2}}}}
460 - };
461 -
462 - static CubeDesc CubeOdd = {
463 -- 1, 2, 7, 4, {{D_0, 1}, {D_0, 2}, {D_0, 3}, {D_0, 4}},
464 -- 2, 1, 7, 3, {{D_0, 0}, {D_MZ, 3}, {D_PX, 2}, {D_PY, 1}},
465 -- 1, 2, 4, 0, {{D_0, 0}, {D_MZ, 4}, {D_MX, 1}, {D_MY, 2}},
466 -- 2, 7, 4, 6, {{D_0, 0}, {D_PY, 4}, {D_PZ, 2}, {D_MX, 3}},
467 -- 7, 1, 4, 5, {{D_0, 0}, {D_PX, 4}, {D_MY, 3}, {D_PZ, 1}}
468 -+ {{1, 2, 7, 4, {{D_0, 1}, {D_0, 2}, {D_0, 3}, {D_0, 4}}},
469 -+ {2, 1, 7, 3, {{D_0, 0}, {D_MZ, 3}, {D_PX, 2}, {D_PY, 1}}},
470 -+ {1, 2, 4, 0, {{D_0, 0}, {D_MZ, 4}, {D_MX, 1}, {D_MY, 2}}},
471 -+ {2, 7, 4, 6, {{D_0, 0}, {D_PY, 4}, {D_PZ, 2}, {D_MX, 3}}},
472 -+ {7, 1, 4, 5, {{D_0, 0}, {D_PX, 4}, {D_MY, 3}, {D_PZ, 1}}}}
473 - };
474 -
475 - static BOOL Initialized = FALSE;
476 -@@ -158,7 +158,7 @@ fillFaces(TetDesc *tetP)
477 - static BOOL
478 - equalPair(int i00, int i01, int i10, int i11)
479 - {
480 -- return i00 == i10 && i01 == i11 || i00 == i11 && i01 == i10;
481 -+ return (i00 == i10 && i01 == i11) || (i00 == i11 && i01 == i10);
482 - }
483 -
484 - static int
485
486 diff --git a/sci-chemistry/molmol/files/opengl.patch b/sci-chemistry/molmol/files/opengl.patch
487 deleted file mode 100644
488 index c1db35d9013..00000000000
489 --- a/sci-chemistry/molmol/files/opengl.patch
490 +++ /dev/null
491 @@ -1,96 +0,0 @@
492 - molmol | 65 +++++++++--------------------------------------------------------
493 - 1 file changed, 9 insertions(+), 56 deletions(-)
494 -
495 -diff --git a/molmol b/molmol
496 -index 7863225..b6c75ce 100755
497 ---- a/molmol
498 -+++ b/molmol
499 -@@ -11,55 +11,8 @@ ostype=`uname`
500 - osrel=`uname -r`
501 - osmaj=`echo $osrel | awk -F. '{print $1}'`
502 - osmin=`echo $osrel | awk -F. '{print $2}'`
503 --localdev=
504 --glxdev=
505 --
506 --if [ $ostype = "IRIX" -o $ostype = "IRIX64" ]; then
507 -- if [ $osmaj -eq 6 -a $osmin -ge 2 -o $osmaj -gt 6 ]; then
508 -- arch=sgi6
509 -- localdev=Motif/OpenGL
510 -- glxdev=Motif/OpenGL
511 -- elif [ $osmaj -eq 5 -a $osmin -ge 3 -o $osmaj -gt 5 ]; then
512 -- arch=sgi5
513 -- localdev=Motif/OpenGL
514 -- glxdev=Motif/OpenGL
515 -- else
516 -- arch=sgi4
517 -- localdev=Motif/GL
518 -- fi
519 -- MONITOR=72HZ; export MONITOR
520 --elif [ $ostype = "AIX" ]; then
521 -- arch=aix
522 -- localdev=Motif/OpenGL
523 --elif [ $ostype = "HP-UX" ]; then
524 -- arch=hp
525 -- localdev=Motif/OpenGL
526 -- glxdev=Motif/OpenGL
527 --elif [ $ostype = "OSF1" ]; then
528 -- arch=dec
529 -- localdev=Motif/OpenGL
530 --elif [ $ostype = "Linux" ]; then
531 -- arch=lnx
532 -- localdev=Motif/OpenGL
533 --elif [ $ostype = "SunOS" ]; then
534 -- if [ $osmaj -eq 5 -a $osmin -ge 4 -o $osmaj -gt 5 ]; then
535 -- arch=sol
536 -- localdev=Motif/OpenGL
537 -- else
538 -- arch=sun
539 -- fi
540 --else
541 -- arch=unknown
542 --fi
543 --
544 --if [ $ostype = "SunOS" ]; then
545 -- xdpy=/usr/openwin/bin/xdpyinfo
546 --elif [ $ostype = "HP-UX" ]; then
547 -- xdpy=/usr/contrib/bin/X11/xdpyinfo
548 --else
549 -- xdpy=/usr/bin/X11/xdpyinfo
550 --fi
551 --
552 -+localdev=Motif/OpenGL
553 -+glxdev=Motif/OpenGL
554 - printUsage () {
555 - echo "Usage: molmol -ht2as [-o dev] [-r range] [-f macro] files"
556 - echo ""
557 -@@ -121,15 +74,15 @@ done
558 -
559 - magictmp=/tmp/molmol_magic$$
560 -
561 --if [ ! -d $HOME/molmol ]; then
562 -- mkdir $HOME/molmol
563 -+if [ ! -d $HOME/.molmol ]; then
564 -+ mkdir $HOME/.molmol
565 - fi
566 --startmacro=$HOME/molmol/options.mac
567 -+startmacro=$HOME/.molmol/options.mac
568 - cp /dev/null $startmacro
569 -
570 - if [ -n "$*" ]; then
571 -- if [ -f $HOME/molmol/dump ]; then
572 -- mv -f $HOME/molmol/dump $HOME/molmol/dump.old
573 -+ if [ -f $HOME/.molmol/dump ]; then
574 -+ mv -f $HOME/.molmol/dump $HOME/.molmol/dump.old
575 - fi
576 - echo "0 long 0x3b7a12f9 MOLMOL" > $magictmp
577 - echo "0 long 0xf9127a3b MOLMOL" >> $magictmp
578 -@@ -209,7 +162,7 @@ elif [ -x $xdpy ]; then
579 - fi
580 -
581 - if [ "$input" = "-" -o -n "$nograph" ]; then
582 -- $MOLMOLHOME/molmol.$arch $xopt
583 -+ $MOLMOLHOME/molmol $xopt
584 - else
585 -- $MOLMOLHOME/molmol.$arch $xopt < /dev/null
586 -+ $MOLMOLHOME/molmol $xopt < /dev/null
587 - fi
588
589 diff --git a/sci-chemistry/molmol/files/pjf_RH9_molmol2k2.diff b/sci-chemistry/molmol/files/pjf_RH9_molmol2k2.diff
590 deleted file mode 100644
591 index 0ad57d93e10..00000000000
592 --- a/sci-chemistry/molmol/files/pjf_RH9_molmol2k2.diff
593 +++ /dev/null
594 @@ -1,103 +0,0 @@
595 -Only in molmol_rh9: makedef
596 -diff -ru molmol_rh9_unpatched/makedef.lnx molmol_rh9/makedef.lnx
597 ---- molmol_rh9_unpatched/makedef.lnx 2003-01-20 16:10:18.000000000 -0500
598 -+++ molmol_rh9/makedef.lnx 2003-05-06 10:40:08.000000000 -0400
599 -@@ -1,31 +1,38 @@
600 - # definitions for Linux
601 -
602 --MISSFUNC = -Dsqrtf=sqrt -Dexpf=exp -Dlogf=log -Dpowf=pow \
603 -- -Dsinf=sin -Dcosf=cos -Dtanf=tan \
604 -- -Dasinf=asin -Dacosf=acos -Datanf=atan -Datan2f=atan2 \
605 -- -Dfabsf=fabs -Dceilf=ceil
606 --MCPPFLAGS = $(MISSFUNC)
607 --MCFLAGS = -O2
608 --
609 --RANLIB = /bin/true
610 --WAIT = /usr/bin/sleep 2
611 --SHELL = /bin/sh
612 --CPP = /lib/cpp
613 --CC = /usr/bin/gcc
614 -+#TIFFDIR = $(TOP)/tiff-v3.4/libtiff
615 -+#JPEGDIR = $(TOP)/../libjpeg/jpeg-6a
616 -+#PNGDIR = $(TOP)/../libpng/libpng-0.89c
617 -+#ZLIBDIR = $(TOP)/../libpng/zlib-1.0.2
618 -+
619 -+IMGDEF = -DTIFF_SUPPORT -DJPEG_SUPPORT -DPNG_SUPPORT
620 -+IMGLIB = -ltiff -ljpeg -lpng -lz
621 -+IMGINCL = # -I$(TIFFDIR) -I$(JPEGDIR) -I$(PNGDIR) -I$(ZLIBDIR)
622 -+
623 -+XINCL = -I/usr/X11R6/include
624 -+
625 -+CC=gcc
626 -+MCPPFLAGS =
627 -+MCFLAGS =-pipe -O3 -ffast-math -march=i686 -mcpu=i686
628 -+
629 -+RANLIB = /bin/true
630 -+WAIT = sleep 2
631 -+SHELL = /bin/sh
632 -+CPP = /lib/cpp
633 -
634 --SGDEVDIR = x11 no pov rib vrml1 vrml2 ps fm
635 --
636 --SGDEVDEF = -DSG_DEV_X11 -DSG_DEV_NO -DSG_DEV_POV -DSG_DEV_RIB -DSG_DEV_VRML1 -DSG_DEV_VRML2 -DSG_DEV_PS -DSG_DEV_CPS -DSG_DEV_FM3 -DSG_DEV_FM4
637 -+SGDEVDIR = ogl x11 no pov rib vrml1 vrml2 ps fm
638 -+SGDEVDEF = -DSG_DEV_OGL -DSG_DEV_X11 -DSG_DEV_NO -DSG_DEV_POV -DSG_DEV_RIB -DSG_DEV_VRML1 -DSG_DEV_VRML2 -DSG_DEV_PS -DSG_DEV_CPS -DSG_DEV_FM3 -DSG_DEV_FM4
639 -
640 - PUDEVDIR = motif tty
641 - PUDEVDEF = -DPU_DEV_MOTIF -DPU_DEV_TTY
642 -
643 --IODEVDIR = motx11 ttyno
644 --IODEVDEF = -DIO_DEV_MOTIF_X11 -DIO_DEV_TTY_NO
645 -+IODEVDIR = motogl motx11 ttyno
646 -+IODEVDEF = -DIO_DEV_MOTIF_OGL -DIO_DEV_MOTIF_X11 -DIO_DEV_TTY_NO
647 -
648 -+OPENGLDEF = -DOPENGL_SGI_STEREO
649 - MOTIFDEF = -DFUNCPROTO
650 -
651 --SYSLIB = -L/usr/X11R6/lib -lXm -lXt -lXpm -lX11 -lm -lc -lieee
652 -+SYSLIB = -lGLw -lGLU -lGL -lXm -lXpm -lXt -lXext -lX11 -lm
653 -
654 - TOOLSDIR = $(TOP)/tools
655 --SGDIR = $(TOP)/sg
656 -+SGDIR = $(TOP)/sg
657 -diff -ru molmol_rh9_unpatched/src/motogl/MotOGL.c molmol_rh9/src/motogl/MotOGL.c
658 ---- molmol_rh9_unpatched/src/motogl/MotOGL.c 2000-05-29 12:31:51.000000000 -0400
659 -+++ molmol_rh9/src/motogl/MotOGL.c 2003-05-06 11:51:05.000000000 -0400
660 -@@ -31,7 +31,7 @@
661 - #include <Xm/XmStrDefs.h>
662 -
663 - #define BOOL MOTIF_BOOL /* hack to avoid naming conflict */
664 --#include <X11/GLw/GLwMDrawA.h>
665 -+#include <GL/GLwMDrawA.h>
666 - #undef BOOL
667 -
668 - #include <sg.h>
669 -diff -ru molmol_rh9_unpatched/src/os/GFile.c molmol_rh9/src/os/GFile.c
670 ---- molmol_rh9_unpatched/src/os/GFile.c 2001-06-17 14:59:17.000000000 -0400
671 -+++ molmol_rh9/src/os/GFile.c 2003-05-06 12:34:34.000000000 -0400
672 -@@ -30,6 +30,7 @@
673 - #include <string.h>
674 - #include <memory.h>
675 - #include <ctype.h>
676 -+#include <errno.h>
677 -
678 - #include <linlist.h>
679 -
680 -@@ -38,7 +39,7 @@
681 - const INT32 GFMagic = 0x3b7a12f9;
682 -
683 - #ifndef __linux__
684 --extern char *sys_errlist[];
685 -+extern char *strerror();
686 - #endif
687 - extern int errno;
688 -
689 -@@ -81,7 +82,7 @@
690 - {
691 - if (msg == NULL) {
692 - if (NextMsg == NULL)
693 -- msg = sys_errlist[errno];
694 -+ msg = strerror(errno);
695 - else
696 - msg = NextMsg;
697 - }
698
699 diff --git a/sci-chemistry/molmol/files/prefix.patch b/sci-chemistry/molmol/files/prefix.patch
700 deleted file mode 100644
701 index 89f17b2e984..00000000000
702 --- a/sci-chemistry/molmol/files/prefix.patch
703 +++ /dev/null
704 @@ -1,22 +0,0 @@
705 -diff --git a/molmol b/molmol
706 -index e774abf..9f10558 100755
707 ---- a/molmol
708 -+++ b/molmol
709 -@@ -57,7 +57,7 @@ if [ $ostype = "SunOS" ]; then
710 - elif [ $ostype = "HP-UX" ]; then
711 - xdpy=/usr/contrib/bin/X11/xdpyinfo
712 - else
713 -- xdpy=/usr/bin/X11/xdpyinfo
714 -+ xdpy=@GENTOO_PORTAGE_EPREFIX@/usr/bin/xdpyinfo
715 - fi
716 -
717 - printUsage () {
718 -@@ -119,7 +119,7 @@ while [ -n "$*" ]; do
719 - esac
720 - done
721 -
722 --magictmp=/tmp/molmol_magic$$
723 -+magictmp=@GENTOO_PORTAGE_EPREFIX@/tmp/molmol_magic$$
724 -
725 - if [ ! -d $HOME/molmol ]; then
726 - mkdir $HOME/molmol
727
728 diff --git a/sci-chemistry/molmol/files/wild.patch b/sci-chemistry/molmol/files/wild.patch
729 deleted file mode 100644
730 index 8be9baf9220..00000000000
731 --- a/sci-chemistry/molmol/files/wild.patch
732 +++ /dev/null
733 @@ -1,1866 +0,0 @@
734 - include/cmd_dial.h | 1 +
735 - include/cmd_io.h | 7 +-
736 - include/cmd_struc.h | 1 +
737 - include/curr_dir.h | 1 +
738 - include/data_hand.h | 6 +
739 - src/cip/cmd_tab.h | 3 +
740 - src/cmddial/ExDialColor.c | 314 +++++++++++++++++++++++++++++++-----------
741 - src/cmddial/ExDialRes.c | 340 ++++++++++++++++++++++++++++++++++++++++++++++
742 - src/cmddial/Makefile | 2 +-
743 - src/cmdio/ExPdb.c | 70 +++++++++-
744 - src/cmdstruc/ExBuild.c | 123 +++++++++++++++++
745 - src/data/DataHand.c | 114 +++++++++++++++-
746 - src/iodev/IODev.c | 2 +
747 - src/main/MolInit.c | 5 +-
748 - src/main/MolMol.c | 2 +-
749 - src/motif/MotifDial.c | 32 ++---
750 - src/motogl/MotOGLDump.c | 2 +-
751 - src/os/CurrDir.c | 46 ++-----
752 - src/os/ProgDir.c | 25 +++-
753 - src/win/WinDial.c | 255 +++++++++++++++++-----------------
754 - src/winogl/WinOGLDump.c | 7 +-
755 - 21 files changed, 1073 insertions(+), 285 deletions(-)
756 -
757 -diff --git a/include/cmd_dial.h b/include/cmd_dial.h
758 -index f60e918..47fb8f8 100644
759 ---- a/include/cmd_dial.h
760 -+++ b/include/cmd_dial.h
761 -@@ -29,6 +29,7 @@ extern ErrCode ExUserInterface(char *);
762 -
763 - extern ErrCode ExDialColor(char *);
764 - extern ErrCode ExDialMol(char *);
765 -+extern ErrCode ExDialRes(char *);
766 - extern ErrCode ExDialMeasure(char *);
767 - extern ErrCode ExDialRmsd(char *);
768 - extern ErrCode ExDialSelect(char *);
769 -diff --git a/include/cmd_io.h b/include/cmd_io.h
770 -index 79b173c..9a7b12c 100644
771 ---- a/include/cmd_io.h
772 -+++ b/include/cmd_io.h
773 -@@ -30,15 +30,16 @@ extern ErrCode ExReadAng(char *);
774 - extern ErrCode ExReadDg(char *);
775 - extern ErrCode ExReadDump(char *);
776 - extern ErrCode ExReadLib(char *);
777 --extern ErrCode ExReadPdb(char *);
778 --extern ErrCode ExReadSeq(char *);
779 --extern ErrCode ExReadShift(char *);
780 - extern ErrCode ExReadLimit(char *);
781 - extern ErrCode ExReadListAng(char *);
782 - extern ErrCode ExReadListDg(char *);
783 - extern ErrCode ExReadListPdb(char *);
784 -+extern ErrCode ExReadOldPdb(char *);
785 - extern ErrCode ExReadOmap(char *);
786 -+extern ErrCode ExReadPdb(char *);
787 - extern ErrCode ExReadPot(char *);
788 -+extern ErrCode ExReadSeq(char *);
789 -+extern ErrCode ExReadShift(char *);
790 - extern ErrCode ExReadSybyl(char *);
791 - extern ErrCode ExReadXyz(char *);
792 - extern ErrCode ExWriteAng(char *);
793 -diff --git a/include/cmd_struc.h b/include/cmd_struc.h
794 -index e0d729f..f4950b9 100644
795 ---- a/include/cmd_struc.h
796 -+++ b/include/cmd_struc.h
797 -@@ -33,6 +33,7 @@ extern ErrCode ExAddDist(char *);
798 - extern ErrCode ExAddLimit(char *);
799 - extern ErrCode ExAddPseudo(char *);
800 - extern ErrCode ExAddRes(char *);
801 -+extern ErrCode ExMakeMolCyclic(char *);
802 - extern ErrCode ExChangeRes(char *);
803 - extern ErrCode ExFirstMol(char *);
804 - extern ErrCode ExFlipAtom(char *);
805 -diff --git a/include/curr_dir.h b/include/curr_dir.h
806 -index c7895c4..04e404d 100644
807 ---- a/include/curr_dir.h
808 -+++ b/include/curr_dir.h
809 -@@ -26,6 +26,7 @@
810 - #ifndef _CURR_DIR_H_
811 - #define _CURR_DIR_H_
812 -
813 -+extern void CurrDirSet(char *dir);
814 - extern char *CurrDirGet(void);
815 -
816 - #endif /* _CURR_DIR_H_ */
817 -diff --git a/include/data_hand.h b/include/data_hand.h
818 -index 4462328..74a716a 100644
819 ---- a/include/data_hand.h
820 -+++ b/include/data_hand.h
821 -@@ -112,6 +112,7 @@ extern void DhMolMoveFirst(DhMolP);
822 - extern void DhMolDestroy(DhMolP);
823 -
824 - extern DhResP DhResNew(DhMolP, DhResDefP, DhSeqPos);
825 -+extern DhResP DhResNewCyclic(DhMolP, DhResDefP, DhSeqPos);
826 - extern void DhResMutate(DhResP, DhResDefP, DhMutationKind);
827 - extern void DhResSetNeigh(DhResP, DhNeighChoice, DhResP);
828 - extern BOOL DhResDestroy(DhResP);
829 -@@ -287,6 +288,7 @@ extern void DhMolGetTransVect(DhMolP, Vec3);
830 - extern MolAttrP DhMolGetAttr(DhMolP);
831 -
832 - extern DSTR DhResGetName(DhResP);
833 -+extern DhAtomP DhResGetAtomA(DhResP);
834 - extern int DhResGetNumber(DhResP);
835 -
836 - extern DSTR DhAtomGetName(DhAtomP);
837 -@@ -335,6 +337,10 @@ extern void DhResAnglesChanged(DhResP);
838 - extern void DhResDockPrev(DhResP);
839 - extern void DhResDockNext(DhResP);
840 - extern void DhResCalcAtom(DhResP, DSTR);
841 -+extern DhResP DhResPrev(DhResP resP);
842 -+extern DhResP DhResNext(DhResP resP);
843 -+extern DhResP DhResFirst(DhMolP molP);
844 -+extern DhResP DhResLast(DhMolP molP);
845 -
846 - /* dump/undump */
847 -
848 -diff --git a/src/cip/cmd_tab.h b/src/cip/cmd_tab.h
849 -index 0b73f65..cf7bc2a 100644
850 ---- a/src/cip/cmd_tab.h
851 -+++ b/src/cip/cmd_tab.h
852 -@@ -108,6 +108,7 @@ static CmdTabEntry BuiltinCmdTab[] = {
853 - {"DialColor", ExDialColor, US_NONE},
854 - {"DialMeasure", ExDialMeasure, US_NONE},
855 - {"DialMol", ExDialMol, US_NONE},
856 -+ {"DialRes", ExDialRes, US_NONE},
857 - {"DialRmsd", ExDialRmsd, US_NONE},
858 - {"DialSelect", ExDialSelect, US_NONE},
859 - {"DialStyle", ExDialStyle, US_NONE},
860 -@@ -164,6 +165,7 @@ static CmdTabEntry BuiltinCmdTab[] = {
861 - {"ListSelectedDist", ExListSelected, US_NONE},
862 - {"ListSelectedMol", ExListSelected, US_NONE},
863 - {"ListSelectedRes", ExListSelected, US_NONE},
864 -+ {"MakeMolCyclic", ExMakeMolCyclic, US_ALL},
865 - {"MaterialAtom", ExMaterial, US_ALL},
866 - {"MaterialBond", ExMaterial, US_ALL},
867 - {"MaterialDist", ExMaterial, US_ALL},
868 -@@ -213,6 +215,7 @@ static CmdTabEntry BuiltinCmdTab[] = {
869 - {"ReadListDg", ExReadListDg, US_ALL},
870 - {"ReadListPdb", ExReadListPdb, US_ALL},
871 - {"ReadLol", ExReadLimit, US_ALL},
872 -+ {"ReadOldPdb", ExReadOldPdb, US_ALL},
873 - {"ReadOmap", ExReadOmap, US_ALL},
874 - {"ReadPdb", ExReadPdb, US_ALL},
875 - {"ReadPot", ExReadPot, US_ALL},
876 -diff --git a/src/cmddial/ExDialColor.c b/src/cmddial/ExDialColor.c
877 -index f960e1d..e827c4f 100644
878 ---- a/src/cmddial/ExDialColor.c
879 -+++ b/src/cmddial/ExDialColor.c
880 -@@ -43,6 +43,9 @@
881 - #define NAME_LEN 100
882 - #define NUM_LEN 6
883 - #define CMD_NO 7
884 -+#define MAXRGBVALUE 255
885 -+#define ICOLOR(c) (int) ((float)c * (float)MAXRGBVALUE)
886 -+#define FCOLOR(c) (float) ((float)c / (float)MAXRGBVALUE)
887 -
888 - #define EPS ((float) 1.0e-5)
889 -
890 -@@ -56,8 +59,8 @@ typedef struct {
891 - static ColorDesc *ColorList;
892 - static int ColorNo = 0;
893 - static BOOL DialOn = FALSE;
894 --static PuGizmo DialGizmo = NULL, NameGizmo, RGizmo, GGizmo, BGizmo, ColGizmo;
895 --static DSTR NameStr = NULL, RStr, GStr, BStr;
896 -+static PuGizmo DialGizmo = NULL, NameGizmo, RGizmo, GGizmo, BGizmo, ColGizmo, rGizmo, gGizmo, bGizmo;
897 -+static DSTR NameStr = NULL, RStr, GStr, BStr, rStr, gStr, bStr;
898 -
899 - static char *LabelList[] = {
900 - "Back",
901 -@@ -136,22 +139,50 @@ editCB(PuGizmo g, char *name, void *clientData, void *callData)
902 - char *field = clientData;
903 - PuTextCBStruc *callP = callData;
904 -
905 -- if (field[0] == 'N')
906 -+ if (field[0] == 'N') {
907 - DStrAssignStr(NameStr, callP->newText);
908 -- else if (field[0] == 'R')
909 -+ }
910 -+ else if (field[0] == 'R') {
911 - DStrAssignStr(RStr, callP->newText);
912 -- else if (field[0] == 'G')
913 -+ }
914 -+ else if (field[0] == 'G') {
915 - DStrAssignStr(GStr, callP->newText);
916 -- else
917 -+ }
918 -+ else if (field[0] == 'B') {
919 - DStrAssignStr(BStr, callP->newText);
920 -+ }
921 -+ else if (field[0] == 'r') {
922 -+ DStrAssignStr(rStr, callP->newText);
923 -+ }
924 -+ else if (field[0] == 'g') {
925 -+ DStrAssignStr(gStr, callP->newText);
926 -+ }
927 -+ else if (field[0] == 'b') {
928 -+ DStrAssignStr(bStr, callP->newText);
929 -+ }
930 - }
931 -
932 - static void
933 - updateFields(int colorI)
934 - {
935 -+ char buf[10];
936 -+ float f;
937 -+
938 - PuSetStr(RGizmo, PU_SC_TEXT, ColorList[colorI].r);
939 - PuSetStr(GGizmo, PU_SC_TEXT, ColorList[colorI].g);
940 - PuSetStr(BGizmo, PU_SC_TEXT, ColorList[colorI].b);
941 -+
942 -+ f = atof(ColorList[colorI].r);
943 -+ (void) sprintf(buf, "%i", ICOLOR(f));
944 -+ PuSetStr(rGizmo, PU_SC_TEXT, buf);
945 -+
946 -+ f = atof(ColorList[colorI].g);
947 -+ (void) sprintf(buf, "%i", ICOLOR(f));
948 -+ PuSetStr(gGizmo, PU_SC_TEXT, buf);
949 -+
950 -+ f = atof(ColorList[colorI].b);
951 -+ (void) sprintf(buf, "%i", ICOLOR(f));
952 -+ PuSetStr(bGizmo, PU_SC_TEXT, buf);
953 - }
954 -
955 - static void
956 -@@ -190,17 +221,96 @@ activateCB(PuGizmo g, char *name, void *clientData, void *callData)
957 - {
958 - char *field = clientData;
959 - int i;
960 -+ float f;
961 -+ char buf[10];
962 -
963 - if (field[0] == 'N') {
964 - for (i = 0; i < ColorNo; i++)
965 - if (strcmp(ColorList[i].name, DStrToStr(NameStr)) == 0) {
966 -- updateFields(i);
967 -- break;
968 -+ updateFields(i);
969 -+ break;
970 - }
971 - } else {
972 -+ if (field[0] == 'R') {
973 -+ f = atof(DStrToStr(RStr));
974 -+ if (f>1.0) {
975 -+ f=1.0;
976 -+ i=MAXRGBVALUE;
977 -+ sprintf(buf,"%1.3f", FCOLOR(i));
978 -+ DStrAssignStr(RStr, buf);
979 -+ PuSetStr(RGizmo, PU_SC_TEXT, buf);
980 -+ }
981 -+ sprintf(buf,"%i", ICOLOR(f));
982 -+ DStrAssignStr(rStr, buf);
983 -+ PuSetStr(rGizmo, PU_SC_TEXT, buf);
984 -+ }
985 -+ else if (field[0] == 'G') {
986 -+ f = atof(DStrToStr(GStr));
987 -+ if (f>1.0) {
988 -+ f=1.0;
989 -+ i=MAXRGBVALUE;
990 -+ sprintf(buf,"%1.3f", FCOLOR(i));
991 -+ DStrAssignStr(GStr, buf);
992 -+ PuSetStr(GGizmo, PU_SC_TEXT, buf);
993 -+ }
994 -+ sprintf(buf,"%i", ICOLOR(f));
995 -+ DStrAssignStr(gStr, buf);
996 -+ PuSetStr(gGizmo, PU_SC_TEXT, buf);
997 -+ }
998 -+ else if (field[0] == 'B') {
999 -+ f = atof(DStrToStr(BStr));
1000 -+ if (f>1.0) {
1001 -+ f=1.0;
1002 -+ i=MAXRGBVALUE;
1003 -+ sprintf(buf,"%1.3f", FCOLOR(i));
1004 -+ DStrAssignStr(BStr, buf);
1005 -+ PuSetStr(BGizmo, PU_SC_TEXT, buf);
1006 -+ }
1007 -+ sprintf(buf,"%i", ICOLOR(f));
1008 -+ DStrAssignStr(bStr, buf);
1009 -+ PuSetStr(bGizmo, PU_SC_TEXT, buf);
1010 -+ }
1011 -+ else if (field[0] == 'r') {
1012 -+ i = atoi(DStrToStr(rStr));
1013 -+ if (i>MAXRGBVALUE) {
1014 -+ f=1.0;
1015 -+ i=MAXRGBVALUE;
1016 -+ sprintf(buf,"%i", ICOLOR(f));
1017 -+ DStrAssignStr(rStr, buf);
1018 -+ PuSetStr(rGizmo, PU_SC_TEXT, buf);
1019 -+ }
1020 -+ sprintf(buf,"%1.3f", FCOLOR(i));
1021 -+ DStrAssignStr(RStr, buf);
1022 -+ PuSetStr(RGizmo, PU_SC_TEXT, buf);
1023 -+ }
1024 -+ else if (field[0] == 'g') {
1025 -+ i = atoi(DStrToStr(gStr));
1026 -+ if (i>MAXRGBVALUE) {
1027 -+ f=1.0;
1028 -+ i=MAXRGBVALUE;
1029 -+ sprintf(buf,"%i", ICOLOR(f));
1030 -+ DStrAssignStr(gStr, buf);
1031 -+ PuSetStr(gGizmo, PU_SC_TEXT, buf);
1032 -+ }
1033 -+ sprintf(buf,"%1.3f", FCOLOR(i));
1034 -+ DStrAssignStr(GStr, buf);
1035 -+ PuSetStr(GGizmo, PU_SC_TEXT, buf);
1036 -+ }
1037 -+ else if (field[0] == 'b') {
1038 -+ i = atoi(DStrToStr(bStr));
1039 -+ if (i>MAXRGBVALUE) {
1040 -+ f=1.0;
1041 -+ i=MAXRGBVALUE;
1042 -+ sprintf(buf,"%i", ICOLOR(f));
1043 -+ DStrAssignStr(bStr, buf);
1044 -+ PuSetStr(bGizmo, PU_SC_TEXT, buf);
1045 -+ }
1046 -+ sprintf(buf,"%1.3f", FCOLOR(i));
1047 -+ DStrAssignStr(BStr, buf);
1048 -+ PuSetStr(BGizmo, PU_SC_TEXT, buf);
1049 -+ }
1050 - showName();
1051 - }
1052 --
1053 - showColor();
1054 - }
1055 -
1056 -@@ -258,13 +368,20 @@ showAttr(AttrP attrP)
1057 - {
1058 - char buf[10];
1059 -
1060 -- (void) sprintf(buf, "%5.3f", attrP->colR);
1061 -+ (void) sprintf(buf, "%1.3f", attrP->colR);
1062 - PuSetStr(RGizmo, PU_SC_TEXT, buf);
1063 -- (void) sprintf(buf, "%5.3f", attrP->colG);
1064 -+ (void) sprintf(buf, "%1.3f", attrP->colG);
1065 - PuSetStr(GGizmo, PU_SC_TEXT, buf);
1066 -- (void) sprintf(buf, "%5.3f", attrP->colB);
1067 -+ (void) sprintf(buf, "%1.3f", attrP->colB);
1068 - PuSetStr(BGizmo, PU_SC_TEXT, buf);
1069 -
1070 -+ (void) sprintf(buf, "%i", ICOLOR(attrP->colR));
1071 -+ PuSetStr(rGizmo, PU_SC_TEXT, buf);
1072 -+ (void) sprintf(buf, "%i", ICOLOR(attrP->colG));
1073 -+ PuSetStr(gGizmo, PU_SC_TEXT, buf);
1074 -+ (void) sprintf(buf, "%i", ICOLOR(attrP->colB));
1075 -+ PuSetStr(bGizmo, PU_SC_TEXT, buf);
1076 -+
1077 - showName();
1078 - showColor();
1079 - }
1080 -@@ -315,107 +432,152 @@ buildDial(void)
1081 - PuGizmo g;
1082 - PuConstraints con;
1083 - int i;
1084 --
1085 -- DialGizmo = PuCreateDialog("Color Dialog", 7, 5);
1086 -- PuSetBool(DialGizmo, PU_BC_PLACE_OUTSIDE, TRUE);
1087 --
1088 -- con.x = 0;
1089 -- con.w = 1;
1090 -- con.h = 1;
1091 --
1092 -- g = PuCreateLabel(DialGizmo, "Name");
1093 -- con.y = 0;
1094 -- PuSetConstraints(g, con);
1095 -- PuSwitchGizmo(g, TRUE);
1096 --
1097 -- g = PuCreateLabel(DialGizmo, "Red");
1098 -- con.y = 1;
1099 -- PuSetConstraints(g, con);
1100 -- PuSwitchGizmo(g, TRUE);
1101 --
1102 -- g = PuCreateLabel(DialGizmo, "Green");
1103 -- con.y = 2;
1104 -- PuSetConstraints(g, con);
1105 -- PuSwitchGizmo(g, TRUE);
1106 --
1107 -- g = PuCreateLabel(DialGizmo, "Blue");
1108 -- con.y = 3;
1109 -- PuSetConstraints(g, con);
1110 -- PuSwitchGizmo(g, TRUE);
1111 --
1112 -- con.x = 1;
1113 -- con.w = 2;
1114 -- con.h = 1;
1115 --
1116 - NameStr = DStrNew();
1117 -+
1118 - RStr = DStrNew();
1119 - GStr = DStrNew();
1120 - BStr = DStrNew();
1121 -+ rStr = DStrNew();
1122 -+ gStr = DStrNew();
1123 -+ bStr = DStrNew();
1124 -+
1125 - DStrAssignStr(RStr, "0.0");
1126 - DStrAssignStr(GStr, "0.0");
1127 - DStrAssignStr(BStr, "0.0");
1128 -+ DStrAssignStr(rStr, "0");
1129 -+ DStrAssignStr(gStr, "0");
1130 -+ DStrAssignStr(bStr, "0");
1131 -
1132 -+ DialGizmo = PuCreateDialog("Color Dialog", 3, 20);
1133 -+ PuSetBool(DialGizmo, PU_BC_PLACE_OUTSIDE, TRUE);
1134 -+
1135 -+ con.x = 1;
1136 -+ con.y = 0;
1137 -+ con.w = 2;
1138 -+ con.h = 3;
1139 -+ ColGizmo = PuCreateColorField(DialGizmo, "Color");
1140 -+ PuSetConstraints(ColGizmo, con);
1141 -+ PuSetConstraints(ColGizmo, con);
1142 -+ showColor();
1143 -+ PuSwitchGizmo(ColGizmo, TRUE);
1144 -+
1145 -+ con.x = 0;
1146 -+ con.y = 4;
1147 -+ con.w = 1;
1148 -+ con.h = 1;
1149 -+ g = PuCreateLabel(DialGizmo, "Name");
1150 -+ PuSetConstraints(g, con);
1151 -+ PuSwitchGizmo(g, TRUE);
1152 -+ con.x = 1;
1153 -+ con.w = 2;
1154 -+ con.h = 1;
1155 - NameGizmo = PuCreateTextField(DialGizmo, "Name", DStrToStr(NameStr));
1156 -- con.y = 0;
1157 - PuSetConstraints(NameGizmo, con);
1158 -- PuSetInt(NameGizmo, PU_IC_TEXT_WIDTH, 13);
1159 -+ PuSetInt(NameGizmo, PU_IC_TEXT_WIDTH, 10);
1160 - PuAddGizmoCB(NameGizmo, PU_CT_MODIFY, editCB, "N", NULL);
1161 - PuAddGizmoCB(NameGizmo, PU_CT_ACTIVATE, activateCB, "N", NULL);
1162 - showName();
1163 - PuSwitchGizmo(NameGizmo, TRUE);
1164 -
1165 -- RGizmo = PuCreateTextField(DialGizmo, "Red", DStrToStr(RStr));
1166 -- con.y = 1;
1167 -+ con.x = 1;
1168 -+ con.y = 5;
1169 -+ con.w = 2;
1170 -+ con.h = 5;
1171 -+ g = PuCreateList(DialGizmo, "Color List");
1172 -+ for (i = 0; i < ColorNo; i++)
1173 -+ PuAddListEntry(g, ColorList[i].name, FALSE);
1174 -+ PuSetConstraints(g, con);
1175 -+ PuSetBool(g, PU_BC_AUTO_DESEL, TRUE);
1176 -+ PuAddGizmoCB(g, PU_CT_SELECT, selectCB, NULL, NULL);
1177 -+ PuSwitchGizmo(g, TRUE);
1178 -+
1179 -+ con.x = 1;
1180 -+ con.y = 11;
1181 -+ con.w = 1;
1182 -+ con.h = 1;
1183 -+ g = PuCreateLabel(DialGizmo, "Float");
1184 -+ PuSetConstraints(g, con);
1185 -+ PuSwitchGizmo(g, TRUE);
1186 -+ con.x = 2;
1187 -+ con.y = 11;
1188 -+ g = PuCreateLabel(DialGizmo, "RGB");
1189 -+ PuSetConstraints(g, con);
1190 -+ PuSwitchGizmo(g, TRUE);
1191 -+
1192 -+ con.x = 0;
1193 -+ con.y = 12;
1194 -+ con.w = 1;
1195 -+ con.h = 1;
1196 -+ g = PuCreateLabel(DialGizmo, "Red");
1197 -+ PuSetConstraints(g, con);
1198 -+ PuSwitchGizmo(g, TRUE);
1199 -+ con.x = 1;
1200 -+ RGizmo = PuCreateTextField(DialGizmo, "RED", DStrToStr(RStr));
1201 - PuSetConstraints(RGizmo, con);
1202 - PuSetInt(RGizmo, PU_IC_TEXT_WIDTH, NUM_LEN);
1203 - PuAddGizmoCB(RGizmo, PU_CT_MODIFY, editCB, "R", NULL);
1204 - PuAddGizmoCB(RGizmo, PU_CT_ACTIVATE, activateCB, "R", NULL);
1205 - PuSwitchGizmo(RGizmo, TRUE);
1206 -+ con.x = 2;
1207 -+ rGizmo = PuCreateTextField(DialGizmo, "red", DStrToStr(rStr));
1208 -+ PuSetConstraints(rGizmo, con);
1209 -+ PuSetInt(rGizmo, PU_IC_TEXT_WIDTH, NUM_LEN);
1210 -+ PuAddGizmoCB(rGizmo, PU_CT_MODIFY, editCB, "r", NULL);
1211 -+ PuAddGizmoCB(rGizmo, PU_CT_ACTIVATE, activateCB, "r", NULL);
1212 -+ PuSwitchGizmo(rGizmo, TRUE);
1213 -
1214 -- GGizmo = PuCreateTextField(DialGizmo, "Green", DStrToStr(GStr));
1215 -- con.y = 2;
1216 -+ con.x = 0;
1217 -+ con.y = 13;
1218 -+ con.w = 1;
1219 -+ con.h = 1;
1220 -+ g = PuCreateLabel(DialGizmo, "Green");
1221 -+ PuSetConstraints(g, con);
1222 -+ PuSwitchGizmo(g, TRUE);
1223 -+ con.x = 1;
1224 -+ GGizmo = PuCreateTextField(DialGizmo, "GREEN", DStrToStr(GStr));
1225 - PuSetConstraints(GGizmo, con);
1226 - PuSetInt(GGizmo, PU_IC_TEXT_WIDTH, NUM_LEN);
1227 - PuAddGizmoCB(GGizmo, PU_CT_MODIFY, editCB, "G", NULL);
1228 - PuAddGizmoCB(GGizmo, PU_CT_ACTIVATE, activateCB, "G", NULL);
1229 - PuSwitchGizmo(GGizmo, TRUE);
1230 -+ con.x = 2;
1231 -+ gGizmo = PuCreateTextField(DialGizmo, "green", DStrToStr(gStr));
1232 -+ PuSetConstraints(gGizmo, con);
1233 -+ PuSetInt(gGizmo, PU_IC_TEXT_WIDTH, NUM_LEN);
1234 -+ PuAddGizmoCB(gGizmo, PU_CT_MODIFY, editCB, "g", NULL);
1235 -+ PuAddGizmoCB(gGizmo, PU_CT_ACTIVATE, activateCB, "g", NULL);
1236 -+ PuSwitchGizmo(gGizmo, TRUE);
1237 -
1238 -- BGizmo = PuCreateTextField(DialGizmo, "Blue", DStrToStr(BStr));
1239 -- con.y = 3;
1240 -+ con.x = 0;
1241 -+ con.y = 14;
1242 -+ con.w = 1;
1243 -+ con.h = 1;
1244 -+ g = PuCreateLabel(DialGizmo, "Blue");
1245 -+ PuSetConstraints(g, con);
1246 -+ PuSwitchGizmo(g, TRUE);
1247 -+ con.x = 1;
1248 -+ BGizmo = PuCreateTextField(DialGizmo, "BLUE", DStrToStr(BStr));
1249 - PuSetConstraints(BGizmo, con);
1250 - PuSetInt(BGizmo, PU_IC_TEXT_WIDTH, NUM_LEN);
1251 - PuAddGizmoCB(BGizmo, PU_CT_MODIFY, editCB, "B", NULL);
1252 - PuAddGizmoCB(BGizmo, PU_CT_ACTIVATE, activateCB, "B", NULL);
1253 - PuSwitchGizmo(BGizmo, TRUE);
1254 -+ con.x = 2;
1255 -+ bGizmo = PuCreateTextField(DialGizmo, "blue", DStrToStr(bStr));
1256 -+ PuSetConstraints(bGizmo, con);
1257 -+ PuSetInt(bGizmo, PU_IC_TEXT_WIDTH, NUM_LEN);
1258 -+ PuAddGizmoCB(bGizmo, PU_CT_MODIFY, editCB, "b", NULL);
1259 -+ PuAddGizmoCB(bGizmo, PU_CT_ACTIVATE, activateCB, "b", NULL);
1260 -+ PuSwitchGizmo(bGizmo, TRUE);
1261 -
1262 -- ColGizmo = PuCreateColorField(DialGizmo, "Color");
1263 -- con.x = 3;
1264 -- con.y = 0;
1265 -- con.w = 2;
1266 -- con.h = 4;
1267 -- PuSetConstraints(ColGizmo, con);
1268 -- showColor();
1269 -- PuSwitchGizmo(ColGizmo, TRUE);
1270 --
1271 -- g = PuCreateList(DialGizmo, "Color List");
1272 -- for (i = 0; i < ColorNo; i++)
1273 -- PuAddListEntry(g, ColorList[i].name, FALSE);
1274 -- con.x = 5;
1275 -- con.y = 0;
1276 -- con.w = 2;
1277 -- con.h = 4;
1278 -- PuSetConstraints(g, con);
1279 -- PuSetBool(g, PU_BC_AUTO_DESEL, TRUE);
1280 -- PuAddGizmoCB(g, PU_CT_SELECT, selectCB, NULL, NULL);
1281 -- PuSwitchGizmo(g, TRUE);
1282 --
1283 -- con.y = 4;
1284 -+ con.x = 0;
1285 -+ con.y = 15;
1286 - con.w = 1;
1287 - con.h = 1;
1288 --
1289 - for (i = 0; i < CMD_NO; i++) {
1290 - g = PuCreateButton(DialGizmo, LabelList[i]);
1291 -- con.x = i;
1292 -+ con.x = i%3;
1293 -+ if (i%3 == 0) con.y++;
1294 - PuSetConstraints(g, con);
1295 - PuAddGizmoCB(g, PU_CT_ACTIVATE, cmdCB, NULL, NULL);
1296 - PuSwitchGizmo(g, TRUE);
1297 -diff --git a/src/cmddial/ExDialRes.c b/src/cmddial/ExDialRes.c
1298 -new file mode 100644
1299 -index 0000000..06925ff
1300 ---- /dev/null
1301 -+++ b/src/cmddial/ExDialRes.c
1302 -@@ -0,0 +1,340 @@
1303 -+/*
1304 -+************************************************************************
1305 -+*
1306 -+* ExDialMol.c - DialMol command
1307 -+*
1308 -+* Copyright (c) 1994-98
1309 -+*
1310 -+* ETH Zuerich
1311 -+* Institut fuer Molekularbiologie und Biophysik
1312 -+* ETH-Hoenggerberg
1313 -+* CH-8093 Zuerich
1314 -+*
1315 -+* SPECTROSPIN AG
1316 -+* Industriestr. 26
1317 -+* CH-8117 Faellanden
1318 -+*
1319 -+* All Rights Reserved
1320 -+*
1321 -+* Date of last modification : 98/08/17
1322 -+* Pathname of SCCS file : /tmp_mnt/net/sn/homeb/rkoradi/molmol-master/src/cmddial/SCCS/s.ExDialMol.c
1323 -+* SCCS identification : 1.10
1324 -+*
1325 -+************************************************************************
1326 -+*/
1327 -+
1328 -+#include <cmd_dial.h>
1329 -+
1330 -+#include <stdio.h>
1331 -+#include <string.h>
1332 -+#include <stdlib.h>
1333 -+
1334 -+#include <break.h>
1335 -+#include <pu.h>
1336 -+#include <arg.h>
1337 -+#include <cip.h>
1338 -+#include <data_hand.h>
1339 -+
1340 -+#define PROP_NO 3
1341 -+
1342 -+typedef struct {
1343 -+ char *label;
1344 -+ char *propName;
1345 -+ char *cmd;
1346 -+} PropDesc;
1347 -+typedef struct {
1348 -+ char *name;
1349 -+ BOOL active;
1350 -+} Residue;
1351 -+
1352 -+static BOOL DialOn = FALSE;
1353 -+static PuGizmo DialGizmo = NULL, ListGizmo;
1354 -+static int CurrProp;
1355 -+static PropRefP CurrRefP;
1356 -+static int MolNo, MolI;
1357 -+static BOOL *MolStateA;
1358 -+static BOOL SuppressUpdate = FALSE;
1359 -+static PropDesc PropTab[] = {
1360 -+ {"sel", PROP_SELECTED, "SelectRes"},
1361 -+ {"disp", PROP_DISPLAYED, "DefPropRes 'displayed'"},
1362 -+ {"move", PROP_MOVABLE, "DefProRes 'movable'"}
1363 -+};
1364 -+static Residue ResidueTab[] = {
1365 -+ {"ARG", FALSE},
1366 -+ {"CYS", FALSE},
1367 -+ {"PRO", FALSE},
1368 -+ {"ASP", FALSE},
1369 -+ {"PHE", FALSE},
1370 -+ {"LEU", FALSE},
1371 -+ {"GLU", FALSE},
1372 -+ {"PRO", FALSE},
1373 -+ {"TYR", FALSE},
1374 -+ {"GLY", FALSE},
1375 -+ {"ASN", FALSE},
1376 -+ {"ALA", FALSE},
1377 -+ {"SER", FALSE},
1378 -+ {"THR", FALSE},
1379 -+ {"LYS", FALSE},
1380 -+ {"ILE", FALSE}
1381 -+};
1382 -+
1383 -+static void
1384 -+countMol(DhResP molP, void *clientData)
1385 -+{
1386 -+ MolNo++;
1387 -+}
1388 -+
1389 -+
1390 -+
1391 -+static void
1392 -+addMol(DhResP molP, void *clientData)
1393 -+{
1394 -+
1395 -+
1396 -+ DSTR name;
1397 -+ DSTR residue;
1398 -+ char buf[10];
1399 -+ char buf2[5];
1400 -+ BOOL propVal;
1401 -+ int j;
1402 -+ name = DStrNew();
1403 -+ residue = DStrNew();
1404 -+
1405 -+
1406 -+ j= DhResGetNumber(molP);
1407 -+ (void) sprintf(buf, "%5d " , j);
1408 -+
1409 -+ DStrAssignStr(name, buf);
1410 -+ DStrAssignStr(residue, buf2);
1411 -+ DStrAppStr(name, " ");
1412 -+
1413 -+ DStrAppDStr(residue, DhResGetName(molP));
1414 -+ DStrAppDStr(name, DhResGetName(molP));
1415 -+ propVal = DhResGetProp(CurrRefP, molP);
1416 -+
1417 -+
1418 -+
1419 -+ if (! BreakCheck(10)){
1420 -+ PuAddListEntry(ListGizmo, DStrToStr(name), propVal);
1421 -+
1422 -+ }
1423 -+
1424 -+
1425 -+
1426 -+ MolStateA[MolI] = propVal;
1427 -+
1428 -+ DStrFree(name);
1429 -+
1430 -+ MolI++;
1431 -+}
1432 -+
1433 -+static void
1434 -+selectMolCB(PuGizmo g, char *name, void *clientData, void *callData)
1435 -+{
1436 -+ PuSelectCBStruc *callP = callData;
1437 -+ DSTR cmd;
1438 -+ BOOL isFirst;
1439 -+ char buf[10];
1440 -+ int num, startI, i;
1441 -+
1442 -+ (void) sscanf(name, "%d", &num);
1443 -+ MolStateA[num - 1] = callP->onOff;
1444 -+
1445 -+ if (! callP->last)
1446 -+ return;
1447 -+
1448 -+ cmd = DStrNew();
1449 -+ DStrAssignStr(cmd, PropTab[CurrProp].cmd);
1450 -+ isFirst = TRUE;
1451 -+
1452 -+ for (i = 0; i < MolNo; i++) {
1453 -+ if (i == 0 || ! MolStateA[i - 1])
1454 -+ startI = i;
1455 -+ if (MolStateA[i] && (i == MolNo - 1 || ! MolStateA[i + 1])) {
1456 -+ if (isFirst)
1457 -+ DStrAppStr(cmd, " 'num = ");
1458 -+ else
1459 -+ DStrAppStr(cmd, ",");
1460 -+ (void) sprintf(buf, "%d", startI + 1);
1461 -+ DStrAppStr(cmd, buf);
1462 -+ if (i > startI) {
1463 -+ DStrAppStr(cmd, "..");
1464 -+ (void) sprintf(buf, "%d", i + 1);
1465 -+ DStrAppStr(cmd, buf);
1466 -+ }
1467 -+
1468 -+ isFirst = FALSE;
1469 -+ }
1470 -+ }
1471 -+
1472 -+ if (isFirst)
1473 -+ DStrAppStr(cmd, " '0'");
1474 -+ else
1475 -+ DStrAppStr(cmd, "'");
1476 -+
1477 -+ SuppressUpdate = TRUE;
1478 -+ CipExecCmd(DStrToStr(cmd));
1479 -+ SuppressUpdate = FALSE;
1480 -+
1481 -+ DStrFree(cmd);
1482 -+}
1483 -+
1484 -+static void
1485 -+buildList(void)
1486 -+{
1487 -+ int lineNo;
1488 -+
1489 -+ MolNo = 0;
1490 -+ DhApplyRes(PropGetRef(PROP_ALL, FALSE), countMol, NULL);
1491 -+ if (MolNo > 0) {
1492 -+ if (MolStateA == NULL)
1493 -+ MolStateA = malloc(MolNo * sizeof(*MolStateA));
1494 -+ else
1495 -+ MolStateA = realloc(MolStateA, MolNo * sizeof(*MolStateA));
1496 -+ lineNo = MolNo;
1497 -+ if (lineNo > 40)
1498 -+ lineNo = 40;
1499 -+ } else {
1500 -+ lineNo = 1;
1501 -+ }
1502 -+
1503 -+ PuSetInt(ListGizmo, PU_IC_ENTRY_NO, lineNo);
1504 -+
1505 -+ MolI = 0;
1506 -+ BreakActivate(TRUE);
1507 -+ DhApplyRes(PropGetRef(PROP_ALL, FALSE), addMol, NULL);
1508 -+ BreakActivate(FALSE);
1509 -+
1510 -+ PuSwitchGizmo(ListGizmo, TRUE);
1511 -+}
1512 -+
1513 -+static void
1514 -+updateList(void)
1515 -+{
1516 -+ if (SuppressUpdate)
1517 -+ return;
1518 -+
1519 -+ PuSwitchGizmo(ListGizmo, FALSE);
1520 -+ PuRemoveListEntries(ListGizmo, 0, MolNo);
1521 -+ buildList();
1522 -+}
1523 -+
1524 -+static void
1525 -+selectPropCB(PuGizmo g, char *name, void *clientData, void *callData)
1526 -+{
1527 -+ PuSelectCBStruc *callP = callData;
1528 -+ PropRefP newPropP;
1529 -+ int i;
1530 -+
1531 -+ if (! callP->onOff)
1532 -+ return;
1533 -+
1534 -+ for (i = 0; i < PROP_NO; i++)
1535 -+ if (strcmp(name, PropTab[i].label) == 0)
1536 -+ break;
1537 -+
1538 -+ newPropP = PropGetRef(PropTab[i].propName, FALSE);
1539 -+
1540 -+ if (newPropP != CurrRefP) {
1541 -+ CurrRefP = newPropP;
1542 -+ CurrProp = i;
1543 -+ updateList();
1544 -+ }
1545 -+}
1546 -+
1547 -+static void
1548 -+popdownCB(PuGizmo g, char *name, void *clientData, void *callData)
1549 -+{
1550 -+ PuSwitchGizmo(DialGizmo, FALSE);
1551 -+ DialOn = FALSE;
1552 -+}
1553 -+
1554 -+static void
1555 -+listCB(void *clientData)
1556 -+{
1557 -+ updateList();
1558 -+}
1559 -+
1560 -+static void
1561 -+helpCB(PuGizmo g, char *name, void *clientData, void *callData)
1562 -+{
1563 -+ CipShowHelpFile(DialGizmo, "DialMol");
1564 -+}
1565 -+
1566 -+static void
1567 -+buildDial(void)
1568 -+{
1569 -+
1570 -+ PuGizmo g;
1571 -+ int i;
1572 -+
1573 -+ CurrProp = 0;
1574 -+ CurrRefP = PropGetRef(PropTab[CurrProp].propName, FALSE);
1575 -+
1576 -+ DialGizmo = PuCreateDialog("Residue Dialog", 0, 0);
1577 -+ PuSetBool(DialGizmo, PU_BC_PLACE_OUTSIDE, TRUE);
1578 -+
1579 -+ g = PuCreateRadioBox(DialGizmo, "Property");
1580 -+ for (i = 0; i < PROP_NO; i++)
1581 -+ PuAddToggle(g, PropTab[i].label, i == 0);
1582 -+ PuAddGizmoCB(g, PU_CT_SELECT, selectPropCB, NULL, NULL);
1583 -+ PuSwitchGizmo(g, TRUE);
1584 -+
1585 -+ ListGizmo = PuCreateList(DialGizmo, "Molecules");
1586 -+ PuAddGizmoCB(ListGizmo, PU_CT_SELECT, selectMolCB, NULL, NULL);
1587 -+ PuSetBool(ListGizmo, PU_BC_MULT_SEL, TRUE);
1588 -+ buildList();
1589 -+
1590 -+ PuAddGizmoCB(DialGizmo, PU_CT_CLOSE, popdownCB, NULL, NULL);
1591 -+ PuAddGizmoCB(DialGizmo, PU_CT_HELP, helpCB, NULL, NULL);
1592 -+
1593 -+}
1594 -+
1595 -+ErrCode
1596 -+ExDialRes(char *cmd)
1597 -+{
1598 -+ ArgDescr arg;
1599 -+ EnumEntryDescr enumEntry[2];
1600 -+ ErrCode errCode;
1601 -+
1602 -+ arg.type = AT_ENUM;
1603 -+
1604 -+ ArgInit(&arg, 1);
1605 -+
1606 -+ arg.prompt = "Residue Dialog";
1607 -+ arg.u.enumD.entryP = enumEntry;
1608 -+ arg.u.enumD.n = 2;
1609 -+
1610 -+ enumEntry[0].str = "off";
1611 -+ enumEntry[1].str = "on";
1612 -+
1613 -+ enumEntry[0].onOff = DialOn;
1614 -+ enumEntry[1].onOff = ! DialOn;
1615 -+ if (DialOn)
1616 -+ arg.v.intVal = 0;
1617 -+ else
1618 -+ arg.v.intVal = 1;
1619 -+
1620 -+ errCode = ArgGet(&arg, 1);
1621 -+ if (errCode != EC_OK) {
1622 -+ ArgCleanup(&arg, 1);
1623 -+ return errCode;
1624 -+ }
1625 -+
1626 -+ DialOn = (arg.v.intVal == 1);
1627 -+
1628 -+ ArgCleanup(&arg, 1);
1629 -+
1630 -+ if (DialOn) {
1631 -+ if (DialGizmo == NULL) {
1632 -+ buildDial();
1633 -+ DhAddMolListCB(listCB, NULL);
1634 -+ }
1635 -+ PuSwitchGizmo(DialGizmo, TRUE);
1636 -+ } else {
1637 -+ if (DialGizmo != NULL)
1638 -+ PuSwitchGizmo(DialGizmo, FALSE);
1639 -+ }
1640 -+
1641 -+ return EC_OK;
1642 -+}
1643 -\ No newline at end of file
1644 -diff --git a/src/cmddial/Makefile b/src/cmddial/Makefile
1645 -index d94609d..66fdea9 100644
1646 ---- a/src/cmddial/Makefile
1647 -+++ b/src/cmddial/Makefile
1648 -@@ -8,7 +8,7 @@ CPPFLAGS = $(INCLUDES) $(MCPPFLAGS)
1649 - CFLAGS = $(CPPFLAGS) $(MCFLAGS)
1650 -
1651 - OBJ = ExDialColor.o ExDialSelect.o ExDialStyle.o ExDialMol.o ExDialMeas.o \
1652 -- ExDialRmsd.o ExUserInterf.o ExRecordMac.o
1653 -+ ExDialRes.o ExDialRmsd.o ExUserInterf.o ExRecordMac.o
1654 - SRC = $(OBJ:.o=.c)
1655 -
1656 - default: $(LIBDIR)/libcmd.a
1657 -diff --git a/src/cmdio/ExPdb.c b/src/cmdio/ExPdb.c
1658 -index 8447c4c..fde9c73 100644
1659 ---- a/src/cmdio/ExPdb.c
1660 -+++ b/src/cmdio/ExPdb.c
1661 -@@ -1,7 +1,7 @@
1662 - /*
1663 - ************************************************************************
1664 - *
1665 --* ExPdb.c - ReadPdb, ReadListPdb and WritePdb commands
1666 -+* ExPdb.c - ReadPdb, ReadOldPdb, ReadListPdb and WritePdb commands
1667 - *
1668 - * Copyright (c) 1994-98
1669 - *
1670 -@@ -105,7 +105,7 @@ compFunc(void *p1, void *p2)
1671 - }
1672 -
1673 - static void
1674 --readTransTab(BOOL pdbToIntern)
1675 -+readTransTab(BOOL pdbToIntern, BOOL isNewNomenclature)
1676 - {
1677 - GFile gf;
1678 - GFileRes res;
1679 -@@ -114,7 +114,7 @@ readTransTab(BOOL pdbToIntern)
1680 -
1681 - TransTab = TreeOpen(sizeof(TransTabEntry), compFunc);
1682 - gf = SetupOpen(PN_PDB_ATOMS, "PdbAtoms", FALSE);
1683 -- if (gf == NULL)
1684 -+ if (gf == NULL || isNewNomenclature)
1685 - return;
1686 -
1687 - if (pdbToIntern) {
1688 -@@ -675,7 +675,7 @@ ExReadPdb(char *cmd)
1689 - return errCode;
1690 - }
1691 -
1692 -- readTransTab(TRUE);
1693 -+ readTransTab(TRUE, TRUE);
1694 - UnknownErrInit();
1695 -
1696 - if (replace) {
1697 -@@ -755,7 +755,7 @@ ExReadListPdb(char *cmd)
1698 -
1699 - FileNamePath(fileName);
1700 -
1701 -- readTransTab(TRUE);
1702 -+ readTransTab(TRUE,TRUE);
1703 - UnknownErrInit();
1704 - inName = DStrNew();
1705 - pdbName = DStrNew();
1706 -@@ -932,7 +932,7 @@ ExWritePdb(char *cmd)
1707 - if (gf == NULL)
1708 - return EC_ERROR;
1709 -
1710 -- readTransTab(FALSE);
1711 -+ readTransTab(FALSE,TRUE);
1712 -
1713 - CHECK_RES(GFileWriteStr(gf, "HEADER Structure from"));
1714 - CHECK_RES(GFileWriteStr(gf, PROG_NAME));
1715 -@@ -987,3 +987,61 @@ ExWritePdb(char *cmd)
1716 -
1717 - return EC_OK;
1718 - }
1719 -+
1720 -+ErrCode
1721 -+ExReadOldPdb(char *cmd)
1722 -+{
1723 -+ BOOL replace;
1724 -+ DSTR name;
1725 -+ int molNo, readNo;
1726 -+ DhMolP *molPA;
1727 -+ ErrCode errCode;
1728 -+ DSTR errStr;
1729 -+
1730 -+ replace = (strncmp(cmd, "Replace", 7) == 0);
1731 -+
1732 -+ name = DStrNew();
1733 -+ errCode = ArgGetFilename(name, CurrDirGet(), "*.pdb", TRUE);
1734 -+ if (errCode != EC_OK) {
1735 -+ DStrFree(name);
1736 -+ return errCode;
1737 -+ }
1738 -+
1739 -+ readTransTab(TRUE, FALSE);
1740 -+ UnknownErrInit();
1741 -+
1742 -+ if (replace) {
1743 -+ molNo = SelMolGet(NULL, 0);
1744 -+ if (molNo > 0) {
1745 -+ molPA = malloc(molNo * sizeof(*molPA));
1746 -+ (void) SelMolGet(molPA, molNo);
1747 -+ }
1748 -+ } else {
1749 -+ molNo = 0;
1750 -+ molPA = NULL;
1751 -+ }
1752 -+
1753 -+ BreakActivate(TRUE);
1754 -+ errCode = readFile(molPA, molNo, name, &readNo);
1755 -+ BreakActivate(FALSE);
1756 -+
1757 -+ DStrFree(name);
1758 -+ TreeClose(TransTab);
1759 -+ if (molNo > 0)
1760 -+ free(molPA);
1761 -+
1762 -+ if (errCode != EC_OK)
1763 -+ return EC_ERROR;
1764 -+
1765 -+ if (replace)
1766 -+ GraphMolChanged(PROP_SELECTED);
1767 -+
1768 -+ errStr = UnknownErrGet();
1769 -+ if (errStr != NULL) {
1770 -+ CipSetError(DStrToStr(errStr));
1771 -+ DStrFree(errStr);
1772 -+ return EC_WARNING;
1773 -+ }
1774 -+
1775 -+ return EC_OK;
1776 -+}
1777 -diff --git a/src/cmdstruc/ExBuild.c b/src/cmdstruc/ExBuild.c
1778 -index 32bc650..7f003b2 100644
1779 ---- a/src/cmdstruc/ExBuild.c
1780 -+++ b/src/cmdstruc/ExBuild.c
1781 -@@ -31,11 +31,16 @@
1782 - #include <data_hand.h>
1783 - #include <data_sel.h>
1784 - #include <graph_draw.h>
1785 -+#include <pu.h>
1786 -
1787 - #define ARG_NUM 1
1788 -
1789 - static int CurrPos = 1;
1790 - static int CurrKind = 0;
1791 -+static PuTextWindow TextW;
1792 -+static DhMolP LastMolP=NULL;
1793 -+static BOOL messageWindowCreated=FALSE;
1794 -+static BOOL cyclicResidueFound=FALSE;
1795 -
1796 - ErrCode
1797 - ExNewMol(char *cmd)
1798 -@@ -206,3 +211,121 @@ ExChangeRes(char *cmd)
1799 -
1800 - return EC_OK;
1801 - }
1802 -+
1803 -+static void
1804 -+writeInt(int num)
1805 -+{
1806 -+ char buf[10];
1807 -+ (void) sprintf(buf, "%5d ", num);
1808 -+ PuWriteStr(TextW, buf);
1809 -+}
1810 -+
1811 -+static void
1812 -+checkMolCyclic(DhMolP molP, void *clientData)
1813 -+{
1814 -+ DhResP resP;
1815 -+ DSTR resName = DStrNew();
1816 -+ DStrAssignStr(resName, "XXX");
1817 -+
1818 -+ resP = DhResFirst(molP);
1819 -+ while (resP != NULL) {
1820 -+ if (DStrCmp(resName, DhResGetName(resP)) == 0) {
1821 -+ cyclicResidueFound=TRUE;
1822 -+ }
1823 -+ resP = DhResNext(resP);
1824 -+ }
1825 -+
1826 -+ if (cyclicResidueFound && !messageWindowCreated) {
1827 -+ TextW = PuCreateTextWindow("MakeMolCyclic");
1828 -+ PuWriteStr(TextW, "--------------------------------------------------\n");
1829 -+ messageWindowCreated=TRUE;
1830 -+ }
1831 -+ if (cyclicResidueFound) {
1832 -+ PuWriteStr(TextW, "Error -");
1833 -+ writeInt(DhMolGetNumber(molP) + 1);
1834 -+ PuWriteStr(TextW, DStrToStr(DhMolGetName(molP)));
1835 -+ PuWriteStr(TextW, " already made cyclic!\n");
1836 -+ }
1837 -+}
1838 -+
1839 -+static void
1840 -+makeMolCyclic(DhMolP molP, void *clientData)
1841 -+{
1842 -+ DhResP xResP, yResP;
1843 -+ Vec3 firstCoord, lastCoord, midCoord;
1844 -+ DhResP firstResP, lastResP;
1845 -+ DhAtomP caAtomP;
1846 -+ DSTR atomName = DStrNew();
1847 -+ DhResDefP resDefP = (DhResDefP) clientData;
1848 -+
1849 -+ DStrAssignStr(atomName, "CA");
1850 -+
1851 -+ xResP = DhResNewCyclic(molP, resDefP, SP_FIRST);
1852 -+ DhResInit(xResP);
1853 -+ yResP = DhResNewCyclic(molP, resDefP, SP_LAST);
1854 -+ DhResInit(yResP);
1855 -+
1856 -+ xResP = DhResFirst(molP);
1857 -+
1858 -+ firstResP = DhResNext(xResP);
1859 -+ caAtomP = NULL;
1860 -+ while (caAtomP == NULL && firstResP != NULL) {
1861 -+ caAtomP = DhAtomFindName(firstResP, atomName, FALSE);
1862 -+ firstResP = DhResNext(firstResP);
1863 -+ }
1864 -+ if (caAtomP == NULL) {
1865 -+ return;
1866 -+ }
1867 -+ DhAtomGetCoord(caAtomP, firstCoord);
1868 -+
1869 -+ yResP = DhResLast(molP);
1870 -+ lastResP = DhResPrev(yResP);
1871 -+ caAtomP = NULL;
1872 -+ while (caAtomP == NULL && lastResP != NULL) {
1873 -+ caAtomP = DhAtomFindName(lastResP, atomName, FALSE);
1874 -+ lastResP = DhResPrev(lastResP);
1875 -+ }
1876 -+ if (caAtomP == NULL) {
1877 -+ return;
1878 -+ }
1879 -+
1880 -+ DhAtomGetCoord(caAtomP, lastCoord);
1881 -+
1882 -+ midCoord[0] = (firstCoord[0]+lastCoord[0])/2;
1883 -+ midCoord[1] = (firstCoord[1]+lastCoord[1])/2;
1884 -+ midCoord[2] = (firstCoord[2]+lastCoord[2])/2;
1885 -+
1886 -+ DhAtomSetCoord(DhResGetAtomA(xResP), midCoord);
1887 -+ DhAtomSetCoord(DhResGetAtomA(yResP), midCoord);
1888 -+}
1889 -+
1890 -+ErrCode
1891 -+ExMakeMolCyclic(char *cmd)
1892 -+{
1893 -+ int ind=0;
1894 -+ DhResDefP resDefP;
1895 -+ DSTR resName = DStrNew();
1896 -+
1897 -+ messageWindowCreated=FALSE;
1898 -+ cyclicResidueFound=FALSE;
1899 -+ DhApplyMol(PropGetRef(PROP_SELECTED, FALSE), checkMolCyclic, NULL);
1900 -+ if (cyclicResidueFound) {
1901 -+ DSTR msg = DStrNew();
1902 -+ DStrAssignStr(msg, "Error cyclic molecules selected");
1903 -+ PuSetTextField(PU_TF_STATUS, DStrToStr(msg));
1904 -+ DStrFree(msg);
1905 -+ return EC_OK;
1906 -+ }
1907 -+
1908 -+ DStrAssignStr(resName, "XXX");
1909 -+ resDefP = DhResDefGet(resName);
1910 -+ if (resDefP == NULL) {
1911 -+ CipSetError("error cyclic marker residue 'XXX' not found in residue library");
1912 -+ return EC_ERROR;
1913 -+ }
1914 -+
1915 -+ DhApplyMol(PropGetRef(PROP_SELECTED, FALSE), makeMolCyclic, resDefP);
1916 -+ GraphMolChanged(PROP_SELECTED);
1917 -+ GraphRedrawNeeded();
1918 -+ return EC_OK;
1919 -+}
1920 -diff --git a/src/data/DataHand.c b/src/data/DataHand.c
1921 -index 368aad3..d020c20 100644
1922 ---- a/src/data/DataHand.c
1923 -+++ b/src/data/DataHand.c
1924 -@@ -994,9 +994,11 @@ BOOL
1925 - DhResDestroy(DhResP resP)
1926 - {
1927 - /* can only destroy first or last residue of molecule! */
1928 -+ DhMolP molP;
1929 - if (resP == ListFirst(resP->molP->resL)) {
1930 -+ molP = resP->molP;
1931 - ListRemove(resP->molP->resL, resP);
1932 -- setEquivI(ListFirst(resP->molP->resL), NULL);
1933 -+ setEquivI((DhResP)ListFirst(molP->resL), NULL);
1934 - return TRUE;
1935 - } else if (resP == ListLast(resP->molP->resL)) {
1936 - ListRemove(resP->molP->resL, resP);
1937 -@@ -2842,6 +2844,18 @@ DhResGetName(DhResP resP)
1938 - return resP->defP->name;
1939 - }
1940 -
1941 -+DhAtomP
1942 -+DhResGetAtomA(DhResP resP)
1943 -+{
1944 -+ return resP->atomA;
1945 -+}
1946 -+
1947 -+DhResDefP
1948 -+DhResGetDefP(DhResP resP)
1949 -+{
1950 -+ return resP->defP;
1951 -+}
1952 -+
1953 - int
1954 - DhResGetNumber(DhResP resP)
1955 - {
1956 -@@ -3313,3 +3327,101 @@ DhAltCoordListGet(void)
1957 - {
1958 - return AltCoordList;
1959 - }
1960 -+
1961 -+static void
1962 -+initResCyclic(DhResP resP)
1963 -+{
1964 -+ DhResDefP defP;
1965 -+ DhResP prevResP, nextResP;
1966 -+ DhAtomP atomP, equivAtomP;
1967 -+ int i;
1968 -+
1969 -+ defP = resP->defP;
1970 -+
1971 -+ resP->neighLeftP = NULL;
1972 -+ resP->neighRightP = NULL;
1973 -+
1974 -+ resP->atomA = malloc(defP->atomNo * sizeof(*resP->atomA));
1975 -+ resP->bondA = malloc(defP->bondNo * sizeof(*resP->bondA));
1976 -+ resP->angleA = malloc(defP->angleNo * sizeof(*resP->angleA));
1977 -+
1978 -+ for (i = 0; i < defP->atomNo; i++)
1979 -+ initAtom(resP->atomA + i, resP);
1980 -+
1981 -+ for (i = defP->firstBondI; i <= defP->lastBondI; i++)
1982 -+ initBond(resP->bondA + i, resP);
1983 -+
1984 -+ for (i = 0; i < defP->angleNo; i++) {
1985 -+ resP->angleA[i].resP = resP;
1986 -+ resP->angleA[i].val = 0.0f;
1987 -+ resP->angleA[i].minVal = DH_ANGLE_MIN;
1988 -+ resP->angleA[i].maxVal = DH_ANGLE_MAX;
1989 -+ resP->angleA[i].changed = FALSE;
1990 -+ resP->angleA[i].propTab = PropNewTab(FALSE);
1991 -+ }
1992 -+
1993 -+ resP->propTab = PropNewTab(FALSE);
1994 -+
1995 -+ for (i = 0; i < EQUIV_NO; i++) {
1996 -+ resP->equivI[i] = -1;
1997 -+ }
1998 -+
1999 -+ prevResP = ListPrev(resP->molP->resL, resP);
2000 -+ nextResP = ListNext(resP->molP->resL, resP);
2001 -+}
2002 -+
2003 -+DhResP
2004 -+DhResNewCyclic(DhMolP molP, DhResDefP defP, DhSeqPos pos)
2005 -+{
2006 -+ struct DhResS resS;
2007 -+ DhResP resP, prevResP, nextResP;
2008 -+
2009 -+ resS.molP = molP;
2010 -+ resS.defP = defP;
2011 -+
2012 -+ if (pos == SP_FIRST) {
2013 -+ nextResP = ListFirst(molP->resL);
2014 -+ if (nextResP == NULL)
2015 -+ resS.num = 1;
2016 -+ else
2017 -+ resS.num = nextResP->num - 1;
2018 -+
2019 -+ resP = ListInsertFirst(molP->resL, &resS);
2020 -+ } else {
2021 -+ prevResP = ListLast(molP->resL);
2022 -+ if (prevResP == NULL)
2023 -+ resS.num = 1;
2024 -+ else
2025 -+ resS.num = prevResP->num + 1;
2026 -+
2027 -+ resP = ListInsertLast(molP->resL, &resS);
2028 -+ }
2029 -+
2030 -+ initResCyclic(resP);
2031 -+
2032 -+ return resP;
2033 -+}
2034 -+
2035 -+DhResP
2036 -+DhResPrev(DhResP resP)
2037 -+{
2038 -+ return (DhResP) ListPrev(resP->molP->resL, resP);
2039 -+}
2040 -+
2041 -+DhResP
2042 -+DhResNext(DhResP resP)
2043 -+{
2044 -+ return (DhResP) ListNext(resP->molP->resL, resP);
2045 -+}
2046 -+
2047 -+DhResP
2048 -+DhResFirst(DhMolP molP)
2049 -+{
2050 -+ return (DhResP) ListFirst(molP->resL);
2051 -+}
2052 -+
2053 -+DhResP
2054 -+DhResLast(DhMolP molP)
2055 -+{
2056 -+ return (DhResP) ListLast(molP->resL);
2057 -+}
2058 -diff --git a/src/iodev/IODev.c b/src/iodev/IODev.c
2059 -index aa4f9a7..9c04ce8 100644
2060 ---- a/src/iodev/IODev.c
2061 -+++ b/src/iodev/IODev.c
2062 -@@ -44,6 +44,7 @@ extern void IOMotifGLDSetDev(void);
2063 - #endif
2064 - #ifdef IO_DEV_MOTIF_OGL
2065 - extern void IOMotifOGLSetDev(void);
2066 -+extern void IOMotifOGLDSetDev(void);
2067 - #endif
2068 - #ifdef IO_DEV_MOTIF_XGL
2069 - extern void IOMotifXGLSetDev(void);
2070 -@@ -75,6 +76,7 @@ static DevListEntry DevList[] = {
2071 - #endif
2072 - #ifdef IO_DEV_MOTIF_OGL
2073 - {"Motif/OpenGL", IOMotifOGLSetDev},
2074 -+ {"Motif/OpenGLD", IOMotifOGLDSetDev},
2075 - #endif
2076 - #ifdef IO_DEV_MOTIF_XGL
2077 - {"Motif/XGL", IOMotifXGLSetDev},
2078 -diff --git a/src/main/MolInit.c b/src/main/MolInit.c
2079 -index a7c467a..fccccd3 100644
2080 ---- a/src/main/MolInit.c
2081 -+++ b/src/main/MolInit.c
2082 -@@ -313,8 +313,9 @@ MolInit(char *defaultDev, int argc, char *argv[], char *macroName)
2083 -
2084 - SgSetDoubleBuffer(TRUE);
2085 -
2086 -- ProgDirSet("MOLMOLHOME", "/usr/molmol");
2087 -+ ProgDirSet("MOLMOLHOME", argv[0]);
2088 - SetupSetDir("setup");
2089 -+ CurrDirSet(getenv("HOME"));
2090 -- UserFileSetDir(CurrDirGet(), "molmol");
2091 -+ UserFileSetDir(CurrDirGet(), ".molmol");
2092 - GFileSetErrorHandler(handleFileError);
2093 -
2094 -@@ -326,7 +327,7 @@ MolInit(char *defaultDev, int argc, char *argv[], char *macroName)
2095 - IOSetErrorHandler(handleIOError);
2096 -
2097 - PuSetTextField(PU_TF_TITLE,
2098 -- "MOLMOL - MOLecule analysis and MOLecule display");
2099 -+ "MOLMOL - MOLecule analysis and MOLecule display - JCU V1.0.8");
2100 -
2101 - gf = UserFileOpenRead("par");
2102 - if (gf != NULL) {
2103 -diff --git a/src/main/MolMol.c b/src/main/MolMol.c
2104 -index 6f825e8..902b50a 100644
2105 ---- a/src/main/MolMol.c
2106 -+++ b/src/main/MolMol.c
2107 -@@ -30,5 +30,5 @@
2108 - int
2109 - main(int argc, char *argv[])
2110 - {
2111 -- return MolInit("Motif/X11", argc, argv, NULL);
2112 -+ return MolInit("Motif/OpenGL", argc, argv, NULL);
2113 - }
2114 -diff --git a/src/motif/MotifDial.c b/src/motif/MotifDial.c
2115 -index 6e3bfd7..8fe0c5a 100644
2116 ---- a/src/motif/MotifDial.c
2117 -+++ b/src/motif/MotifDial.c
2118 -@@ -1115,26 +1115,24 @@ PuMotifSetStr(PuGizmo gizmo, PuStrChoice choice, char *val)
2119 - void
2120 - PuMotifSetColor(PuGizmo gizmo, float r, float g, float b)
2121 - {
2122 -- Display *dpy;
2123 -- int screen;
2124 -- Pixel pix;
2125 -- XColor col;
2126 -+ Display *display;
2127 -+ Pixel pixel;
2128 -+ XColor color;
2129 -+ Colormap colormap;
2130 -
2131 -- dpy = XtDisplay(gizmo);
2132 -- screen = DefaultScreen(dpy);
2133 -- XtVaGetValues(gizmo,
2134 -- XmNbackground, &pix,
2135 -- NULL);
2136 -+ display = XtDisplay(gizmo);
2137 -+ XtVaGetValues(gizmo, XmNbackground, &pixel, NULL);
2138 -+ colormap = DefaultColormapOfScreen(XtScreen(gizmo));
2139 -
2140 -- if (pix == BlackPixel(dpy, screen))
2141 -- return;
2142 -+ color.pixel = pixel;
2143 -+ color.red = FLOAT2SHORT(r);
2144 -+ color.green = FLOAT2SHORT(g);
2145 -+ color.blue = FLOAT2SHORT(b);
2146 -+ color.flags = DoRed | DoGreen | DoBlue;
2147 -
2148 -- col.pixel = pix;
2149 -- col.red = FLOAT2SHORT(r);
2150 -- col.green = FLOAT2SHORT(g);
2151 -- col.blue = FLOAT2SHORT(b);
2152 -- col.flags = DoRed | DoGreen | DoBlue;
2153 -- XStoreColor(dpy, DefaultColormap(dpy, screen), &col);
2154 -+ XFreeColors(display, colormap, &pixel, 1, 0);
2155 -+ XAllocColor(display, colormap, &color);
2156 -+ XtVaSetValues(gizmo, XmNbackground, color.pixel, NULL);
2157 - }
2158 -
2159 - void
2160 -diff --git a/src/motogl/MotOGLDump.c b/src/motogl/MotOGLDump.c
2161 -index 54a4222..3bc25cc 100644
2162 ---- a/src/motogl/MotOGLDump.c
2163 -+++ b/src/motogl/MotOGLDump.c
2164 -@@ -302,7 +302,7 @@ writeImg(void)
2165 - TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8);
2166 -
2167 - if (Quality < 100)
2168 -- TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_PACKBITS);
2169 -+ TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_LZW);
2170 - else
2171 - TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE);
2172 -
2173 -diff --git a/src/os/CurrDir.c b/src/os/CurrDir.c
2174 -index edee778..7d2b242 100644
2175 ---- a/src/os/CurrDir.c
2176 -+++ b/src/os/CurrDir.c
2177 -@@ -26,9 +26,9 @@
2178 - #include <curr_dir.h>
2179 -
2180 - #include <stdlib.h>
2181 --#ifdef WIN32
2182 --#include <direct.h>
2183 - #include <string.h>
2184 -+#ifdef WIN32
2185 -+#include <direct.h>
2186 - #else
2187 - #include <unistd.h>
2188 - #include <errno.h>
2189 -@@ -36,43 +36,15 @@
2190 -
2191 - static char *CurrDir = NULL;
2192 -
2193 -+void
2194 -+CurrDirSet(char *dir)
2195 -+{
2196 -+ CurrDir = malloc(strlen(dir) + 1);
2197 -+ (void) strcpy(CurrDir, dir);
2198 -+}
2199 -+
2200 - char *
2201 - CurrDirGet(void)
2202 - {
2203 --#ifdef WIN32
2204 -- int len, i;
2205 --#else
2206 -- int size = 10;
2207 --#endif
2208 --
2209 -- if (CurrDir != NULL)
2210 -- return CurrDir;
2211 --
2212 --#ifdef WIN32
2213 -- CurrDir = _getcwd(NULL, 0);
2214 -- if (CurrDir != NULL) {
2215 -- len = strlen(CurrDir);
2216 -- for (i = 0; i < len; i++)
2217 -- if (CurrDir[i] == '\\')
2218 -- CurrDir[i] = '/';
2219 -- return CurrDir;
2220 -- }
2221 --#else
2222 -- CurrDir = malloc(size);
2223 -- for (;;) {
2224 -- if (getcwd(CurrDir, size) != NULL)
2225 -- return CurrDir;
2226 -- if (errno != ERANGE)
2227 -- break;
2228 -- size *= 2;
2229 -- CurrDir = realloc(CurrDir, size);
2230 -- }
2231 --#endif
2232 --
2233 -- /* cannot get current directory, return root directory */
2234 -- CurrDir = realloc(CurrDir, 2);
2235 -- CurrDir[0] = '/';
2236 -- CurrDir[1] = '\0';
2237 --
2238 - return CurrDir;
2239 - }
2240 -diff --git a/src/os/ProgDir.c b/src/os/ProgDir.c
2241 -index 7abb08d..79ede45 100644
2242 ---- a/src/os/ProgDir.c
2243 -+++ b/src/os/ProgDir.c
2244 -@@ -45,10 +45,6 @@ ProgDirSet(char *envVar, char *defVal)
2245 - dir = getenv(envVar);
2246 - if (dir == NULL) {
2247 - len = GetModuleFileName(NULL, exePath, sizeof(exePath));
2248 -- if (len == 0) {
2249 -- ProgDir = defVal;
2250 -- return;
2251 -- }
2252 - len--;
2253 - while (len > 0 && exePath[len] != '\\')
2254 - len--;
2255 -@@ -65,9 +61,24 @@ ProgDirSet(char *envVar, char *defVal)
2256 - if (ProgDir[i] == '\\')
2257 - ProgDir[i] = '/';
2258 - #else
2259 -- ProgDir = getenv(envVar);
2260 -- if (ProgDir == NULL)
2261 -- ProgDir = defVal;
2262 -+ char *dir;
2263 -+ char *exePath;
2264 -+ int len;
2265 -+ dir = getenv(envVar);
2266 -+ if (dir == NULL) {
2267 -+ exePath = defVal;
2268 -+ len = strlen(exePath);
2269 -+ len--;
2270 -+ while (len > 0 && exePath[len] != '/')
2271 -+ len--;
2272 -+ dir = exePath;
2273 -+ } else {
2274 -+ len = strlen(dir);
2275 -+ }
2276 -+
2277 -+ ProgDir = malloc(len + 1);
2278 -+ (void) strncpy(ProgDir, dir, len);
2279 -+
2280 - #endif
2281 - }
2282 -
2283 -diff --git a/src/win/WinDial.c b/src/win/WinDial.c
2284 -index 61d6432..e880559 100644
2285 ---- a/src/win/WinDial.c
2286 -+++ b/src/win/WinDial.c
2287 -@@ -1072,148 +1072,143 @@ dialProc(HWND w, UINT msgKind, WPARAM wParam, LPARAM lParam)
2288 - childP = (GizmoInfo *) GetWindowLong(childW, GWL_USERDATA);
2289 -
2290 - switch (notifyCode) {
2291 -- case BN_CLICKED:
2292 -- if (childId < infoP->u.dial.childNo) {
2293 -+ case BN_CLICKED:
2294 -+ if (childId < infoP->u.dial.childNo) {
2295 - childP = (GizmoInfo *) GetWindowLong(GetFocus(), GWL_USERDATA);
2296 -- if (childP->type == GIZMO_TOGGLE) {
2297 -- boxP = childP->u.toggle.boxP;
2298 -- if (boxP->type == GIZMO_RADIO_BOX) {
2299 -- for (i = 0; i < infoP->u.dial.childNo; i++) {
2300 -- cP = infoP->u.dial.childPA[i];
2301 -- if (cP->type != GIZMO_TOGGLE)
2302 -- continue;
2303 -- if (cP->u.toggle.boxP != boxP)
2304 -- continue;
2305 -- onOff = SendMessage(cP->w, BM_GETCHECK, 0, 0);
2306 -- if (onOff && cP != childP) {
2307 -- cP->u.toggle.onOff = FALSE;
2308 -- SendMessage(cP->w, BM_SETCHECK, FALSE, 0);
2309 -- selectStruc.onOff = FALSE;
2310 -- callCB(boxP, PU_CT_SELECT, cP->name, &selectStruc);
2311 -- break;
2312 -- }
2313 -- }
2314 -- if (cP != childP) {
2315 -- childP->u.toggle.onOff = TRUE;
2316 -- SendMessage(childP->w, BM_SETCHECK, TRUE, 0);
2317 -- selectStruc.onOff = TRUE;
2318 -- callCB(boxP, PU_CT_SELECT, childP->name, &selectStruc);
2319 -- }
2320 -- } else {
2321 -- onOff = ! SendMessage(childP->w, BM_GETCHECK, 0, 0);
2322 -- childP->u.toggle.onOff = onOff;
2323 -- SendMessage(childP->w, BM_SETCHECK, onOff, 0);
2324 -- selectStruc.onOff = onOff;
2325 -- callCB(boxP, PU_CT_SELECT, childP->name, &selectStruc);
2326 -- }
2327 -- } else {
2328 -- callCB(childP, PU_CT_ACTIVATE, childP->name, NULL);
2329 -- if (childP->type == GIZMO_TEXT_FIELD &&
2330 -- childP->u.text.historySize > 0)
2331 -- childP->u.text.firstMod = TRUE;
2332 -- }
2333 -- } else {
2334 -- buttonI = childId - infoP->u.dial.childNo;
2335 -- callCB(infoP, BUTTON_FIRST + buttonI, ButtonLabelA[buttonI], NULL);
2336 -- }
2337 -+ if (childP->type == GIZMO_TOGGLE) {
2338 -+ boxP = childP->u.toggle.boxP;
2339 -+ if (boxP->type == GIZMO_RADIO_BOX) {
2340 -+ for (i = 0; i < infoP->u.dial.childNo; i++) {
2341 -+ cP = infoP->u.dial.childPA[i];
2342 -+ if (cP->type != GIZMO_TOGGLE) continue;
2343 -+ if (cP->u.toggle.boxP != boxP) continue;
2344 -+ onOff = SendMessage(cP->w, BM_GETCHECK, 0, 0);
2345 -+ if (onOff && cP != childP) {
2346 -+ cP->u.toggle.onOff = FALSE;
2347 -+ SendMessage(cP->w, BM_SETCHECK, FALSE, 0);
2348 -+ selectStruc.onOff = FALSE;
2349 -+ callCB(boxP, PU_CT_SELECT, cP->name, &selectStruc);
2350 -+ break;
2351 -+ }
2352 -+ }
2353 -+ if (cP != childP) {
2354 -+ childP->u.toggle.onOff = TRUE;
2355 -+ SendMessage(childP->w, BM_SETCHECK, TRUE, 0);
2356 -+ selectStruc.onOff = TRUE;
2357 -+ callCB(boxP, PU_CT_SELECT, childP->name, &selectStruc);
2358 -+ }
2359 -+ } else {
2360 -+ onOff = ! SendMessage(childP->w, BM_GETCHECK, 0, 0);
2361 -+ childP->u.toggle.onOff = onOff;
2362 -+ SendMessage(childP->w, BM_SETCHECK, onOff, 0);
2363 -+ selectStruc.onOff = onOff;
2364 -+ callCB(boxP, PU_CT_SELECT, childP->name, &selectStruc);
2365 -+ }
2366 -+ } else {
2367 -+ callCB(childP, PU_CT_ACTIVATE, childP->name, NULL);
2368 -+ if (childP->type == GIZMO_TEXT_FIELD && childP->u.text.historySize > 0) childP->u.text.firstMod = TRUE;
2369 -+ }
2370 -+ } else {
2371 -+ buttonI = childId - infoP->u.dial.childNo;
2372 -+ callCB(infoP, BUTTON_FIRST + buttonI, ButtonLabelA[buttonI], NULL);
2373 -+ }
2374 - return TRUE;
2375 -- case EN_UPDATE:
2376 -- textEdit(childP);
2377 -- return TRUE;
2378 -- case LBN_SELCHANGE:
2379 -- for (i = 0; i < childP->u.list.entryNo; i++)
2380 -- if (SendMessage(childW, LB_GETSEL, i, 0) !=
2381 -- childP->u.list.entryA[i].onOff)
2382 -- lastI = i;
2383 -
2384 -- for (i = 0; i < childP->u.list.entryNo; i++) {
2385 -- onOff = SendMessage(childW, LB_GETSEL, i, 0);
2386 -- if (onOff != childP->u.list.entryA[i].onOff) {
2387 -- if (! childP->u.list.autoDesel)
2388 -+ case EN_UPDATE:
2389 -+ textEdit(childP);
2390 -+ return TRUE;
2391 -+
2392 -+ case LBN_SELCHANGE:
2393 -+ for (i = 0; i < childP->u.list.entryNo; i++)
2394 -+ if (SendMessage(childW, LB_GETSEL, i, 0) != childP->u.list.entryA[i].onOff)
2395 -+ lastI = i;
2396 -+
2397 -+ for (i = 0; i < childP->u.list.entryNo; i++) {
2398 -+ onOff = SendMessage(childW, LB_GETSEL, i, 0);
2399 -+ if (onOff != childP->u.list.entryA[i].onOff) {
2400 -+ if (! childP->u.list.autoDesel)
2401 - childP->u.list.entryA[i].onOff = onOff;
2402 -- selectStruc.onOff = onOff;
2403 -- selectStruc.last = (i == lastI);
2404 -- callCB(childP, PU_CT_SELECT,
2405 -- childP->u.list.entryA[i].str, &selectStruc);
2406 -- }
2407 -- }
2408 --
2409 -- if (childP->u.list.autoDesel)
2410 -- SendMessage(childW, LB_SETCURSEL, -1, 0);
2411 --
2412 -- return TRUE;
2413 -+ selectStruc.onOff = onOff;
2414 -+ selectStruc.last = (i == lastI);
2415 -+ callCB(childP, PU_CT_SELECT,
2416 -+ childP->u.list.entryA[i].str, &selectStruc);
2417 -+ }
2418 -+ }
2419 -+ if (childP->u.list.autoDesel)
2420 -+ SendMessage(childW, LB_SETCURSEL, -1, 0);
2421 -+ return TRUE;
2422 - }
2423 -+ break;
2424 -
2425 -- break;
2426 -- case WM_VSCROLL:
2427 -- childW = (HWND) lParam;
2428 -- childP = (GizmoInfo *) GetWindowLong(childW, GWL_USERDATA);
2429 -- scrollCode = LOWORD(wParam);
2430 -+ case WM_VSCROLL:
2431 -+ childW = (HWND) lParam;
2432 -+ childP = (GizmoInfo *) GetWindowLong(childW, GWL_USERDATA);
2433 -+ scrollCode = LOWORD(wParam);
2434 -
2435 -- if (scrollCode == SB_LINEUP) {
2436 -- upHistory(childP->u.scroll.textP);
2437 -- } else if (scrollCode == SB_LINEDOWN) {
2438 -- downHistory(childP->u.scroll.textP);
2439 -- } else {
2440 -- return FALSE;
2441 -- }
2442 -- return TRUE;
2443 -- case WM_HSCROLL:
2444 -- scrollCode = LOWORD(wParam);
2445 -- if (scrollCode != SB_THUMBPOSITION && scrollCode != SB_THUMBTRACK)
2446 -- return FALSE;
2447 -+ if (scrollCode == SB_LINEUP) {
2448 -+ upHistory(childP->u.scroll.textP);
2449 -+ } else if (scrollCode == SB_LINEDOWN) {
2450 -+ downHistory(childP->u.scroll.textP);
2451 -+ } else {
2452 -+ return FALSE;
2453 -+ }
2454 -+ return TRUE;
2455 -+ case WM_HSCROLL:
2456 -+ scrollCode = LOWORD(wParam);
2457 -+ if (scrollCode != SB_THUMBPOSITION && scrollCode != SB_THUMBTRACK)
2458 -+ return FALSE;
2459 -
2460 -- scrollPos = (int)(short)HIWORD(wParam);
2461 -- childW = (HWND) lParam;
2462 -- childP = (GizmoInfo *) GetWindowLong(childW, GWL_USERDATA);
2463 -+ scrollPos = (int)(short)HIWORD(wParam);
2464 -+ childW = (HWND) lParam;
2465 -+ childP = (GizmoInfo *) GetWindowLong(childW, GWL_USERDATA);
2466 -
2467 -- floatStruc.oldVal = childP->u.slider.val;
2468 -- childP->u.slider.val = scrollPos / childP->u.slider.factor;
2469 -- SetScrollPos(childW, SB_CTL,
2470 -- (int) (childP->u.slider.val * childP->u.slider.factor),
2471 -- TRUE);
2472 -+ floatStruc.oldVal = childP->u.slider.val;
2473 -+ childP->u.slider.val = scrollPos / childP->u.slider.factor;
2474 -+ SetScrollPos(childW, SB_CTL,
2475 -+ (int) (childP->u.slider.val * childP->u.slider.factor), TRUE);
2476 -
2477 -- if (childP->u.slider.valuatorCB == NULL) {
2478 -- floatStruc.newVal = childP->u.slider.val;
2479 -- callCB(childP, PU_CT_MODIFY, childP->name, &floatStruc);
2480 -- } else {
2481 -- valStruc.act = PU_MA_ACTIVATE;
2482 -- valStruc.name = childP->name;
2483 -- valStruc.val = childP->u.slider.val;
2484 -- childP->u.slider.valuatorCB(childP, childP->u.slider.clientData, &valStruc);
2485 -- }
2486 -+ if (childP->u.slider.valuatorCB == NULL) {
2487 -+ floatStruc.newVal = childP->u.slider.val;
2488 -+ callCB(childP, PU_CT_MODIFY, childP->name, &floatStruc);
2489 -+ } else {
2490 -+ valStruc.act = PU_MA_ACTIVATE;
2491 -+ valStruc.name = childP->name;
2492 -+ valStruc.val = childP->u.slider.val;
2493 -+ childP->u.slider.valuatorCB(childP, childP->u.slider.clientData, &valStruc);
2494 -+ }
2495 -+ return TRUE;
2496 -
2497 -- return TRUE;
2498 -- case WM_PAINT:
2499 -- for (childId = 0; childId < infoP->u.dial.childNo; childId++) {
2500 -- childP = infoP->u.dial.childPA[childId];
2501 -- if (childP->type == GIZMO_COLOR_FIELD)
2502 -- paintColor(childP->w,
2503 -- childP->u.color.r, childP->u.color.g, childP->u.color.b);
2504 -- }
2505 -- break;
2506 -- case WM_MOVE:
2507 -- if (infoP->u.dial.outside) {
2508 -- WinPlaceChanged(infoP->w);
2509 -- return TRUE;
2510 -- }
2511 -- break;
2512 -- case WM_CLOSE:
2513 -- buttonNo = 0;
2514 -- for (i = 0; i < BUTTON_NO; i++)
2515 -- if (infoP->u.dial.buttonSwitchA[i])
2516 -- buttonNo++;
2517 -- if (buttonNo == 0)
2518 -- ShowWindow(infoP->w, SW_HIDE);
2519 -- return TRUE;
2520 -- case WM_DESTROY:
2521 -- WinRemoveDialog(w);
2522 -- for (childId = 0; childId < infoP->u.dial.childNo; childId++)
2523 -- freeInfo(infoP->u.dial.childPA[childId]);
2524 -- freeInfo(infoP);
2525 -- return TRUE;
2526 -- }
2527 -+ case WM_PAINT:
2528 -+ for (childId = 0; childId < infoP->u.dial.childNo; childId++) {
2529 -+ childP = infoP->u.dial.childPA[childId];
2530 -+ if (childP->type == GIZMO_COLOR_FIELD)
2531 -+ paintColor(childP->w,
2532 -+ childP->u.color.r, childP->u.color.g, childP->u.color.b);
2533 -+ }
2534 -+ break;
2535 -
2536 -+ case WM_MOVE:
2537 -+ if (infoP->u.dial.outside) {
2538 -+ WinPlaceChanged(infoP->w);
2539 -+ return TRUE;
2540 -+ }
2541 -+ break;
2542 -+ case WM_CLOSE:
2543 -+ buttonNo = 0;
2544 -+ for (i = 0; i < BUTTON_NO; i++) {
2545 -+ if (infoP->u.dial.buttonSwitchA[i]) buttonNo++;
2546 -+ if (buttonNo == 0) {
2547 -+ ShowWindow(infoP->w, SW_HIDE);
2548 -+ }
2549 -+ }
2550 -+ return TRUE;
2551 -+ case WM_DESTROY:
2552 -+ WinRemoveDialog(w);
2553 -+ for (childId = 0; childId < infoP->u.dial.childNo; childId++)
2554 -+ freeInfo(infoP->u.dial.childPA[childId]);
2555 -+ freeInfo(infoP);
2556 -+ return TRUE;
2557 -+ }
2558 - return FALSE;
2559 - }
2560 -
2561 -diff --git a/src/winogl/WinOGLDump.c b/src/winogl/WinOGLDump.c
2562 -index 0a7d61a..a8ce850 100644
2563 ---- a/src/winogl/WinOGLDump.c
2564 -+++ b/src/winogl/WinOGLDump.c
2565 -@@ -44,6 +44,7 @@
2566 - #endif
2567 - #ifdef PNG_SUPPORT
2568 - #include <png.h>
2569 -+#include <pngpriv.h>
2570 - #endif
2571 -
2572 - #include "winogl_int.h"
2573 -@@ -251,7 +252,7 @@ static void
2574 - pngErrHand(png_structp pngStrucP, char *errMsg)
2575 - {
2576 - IORaiseError(errMsg);
2577 -- longjmp(pngStrucP->jmpbuf, 1);
2578 -+ longjmp(pngStrucP->longjmp_buffer, 1);
2579 - }
2580 - #endif
2581 -
2582 -@@ -314,7 +315,7 @@ writeImg(void)
2583 - TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8);
2584 -
2585 - if (Quality < 100)
2586 -- TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_PACKBITS);
2587 -+ TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_LZW);
2588 - else
2589 - TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE);
2590 -
2591 -@@ -369,7 +370,7 @@ writeImg(void)
2592 - return IO_RES_ERR;
2593 - }
2594 -
2595 -- if (setjmp(pngStrucP->jmpbuf)) {
2596 -+ if (setjmp(pngStrucP->longjmp_buffer)) {
2597 - if (cBuf != NULL)
2598 - free(cBuf);
2599 - if (fBuf != NULL)
2600
2601 diff --git a/sci-chemistry/molmol/molmol-2k_p2-r2.ebuild b/sci-chemistry/molmol/molmol-2k_p2-r2.ebuild
2602 index 9fafb28a9e9..888c738d4f1 100644
2603 --- a/sci-chemistry/molmol/molmol-2k_p2-r2.ebuild
2604 +++ b/sci-chemistry/molmol/molmol-2k_p2-r2.ebuild
2605 @@ -1,4 +1,4 @@
2606 -# Copyright 1999-2013 Gentoo Foundation
2607 +# Copyright 1999-2017 Gentoo Foundation
2608 # Distributed under the terms of the GNU General Public License v2
2609
2610 EAPI=4
2611 @@ -12,7 +12,8 @@ DESCRIPTION="Publication-quality molecular visualization package"
2612 HOMEPAGE="http://hugin.ethz.ch/wuthrich/software/molmol/index.html"
2613 SRC_URI="
2614 ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-src.tar.gz
2615 - ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-doc.tar.gz"
2616 + ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-doc.tar.gz
2617 + https://dev.gentoo.org/~soap/distfiles/${PN}-patches.tbz2"
2618
2619 LICENSE="molmol"
2620 SLOT="0"
2621 @@ -45,12 +46,12 @@ pkg_setup() {
2622 src_prepare() {
2623 rm -rf tiff*
2624 # Patch from http://pjf.net/science/molmol.html, where src.rpm is provided
2625 - epatch "${FILESDIR}"/pjf_RH9_molmol2k2.diff
2626 + epatch "${WORKDIR}"/patches/pjf_RH9_molmol2k2.diff
2627
2628 - epatch "${FILESDIR}"/prefix.patch
2629 + epatch "${WORKDIR}"/patches/prefix.patch
2630 eprefixify molmol
2631
2632 - epatch "${FILESDIR}"/ldflags.patch
2633 + epatch "${WORKDIR}"/patches/ldflags.patch
2634
2635 ln -s makedef.lnx "${S}"/makedef || die
2636
2637 @@ -63,8 +64,8 @@ src_prepare() {
2638 -e "s:^CC.*:CC = $(tc-getCC):" \
2639 -i "${S}"/makedef || die
2640
2641 - epatch "${FILESDIR}"/cast.patch
2642 - epatch "${FILESDIR}"/libpng15.patch
2643 + epatch "${WORKDIR}"/patches/cast.patch
2644 + epatch "${WORKDIR}"/patches/libpng15.patch
2645 }
2646
2647 src_install() {
2648
2649 diff --git a/sci-chemistry/molmol/molmol-2k_p2-r3.ebuild b/sci-chemistry/molmol/molmol-2k_p2-r3.ebuild
2650 index 318269562f2..22f3e6a03bd 100644
2651 --- a/sci-chemistry/molmol/molmol-2k_p2-r3.ebuild
2652 +++ b/sci-chemistry/molmol/molmol-2k_p2-r3.ebuild
2653 @@ -1,4 +1,4 @@
2654 -# Copyright 1999-2013 Gentoo Foundation
2655 +# Copyright 1999-2017 Gentoo Foundation
2656 # Distributed under the terms of the GNU General Public License v2
2657
2658 EAPI=4
2659 @@ -12,7 +12,8 @@ DESCRIPTION="Publication-quality molecular visualization package"
2660 HOMEPAGE="http://hugin.ethz.ch/wuthrich/software/molmol/index.html"
2661 SRC_URI="
2662 ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-src.tar.gz
2663 - ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-doc.tar.gz"
2664 + ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-doc.tar.gz
2665 + https://dev.gentoo.org/~soap/distfiles/${PN}-patches.tbz2"
2666
2667 LICENSE="molmol"
2668 SLOT="0"
2669 @@ -45,12 +46,12 @@ pkg_setup() {
2670 src_prepare() {
2671 rm -rf tiff*
2672 # Patch from http://pjf.net/science/molmol.html, where src.rpm is provided
2673 - epatch "${FILESDIR}"/pjf_RH9_molmol2k2.diff
2674 + epatch "${WORKDIR}"/patches/pjf_RH9_molmol2k2.diff
2675
2676 - epatch "${FILESDIR}"/prefix.patch
2677 + epatch "${WORKDIR}"/patches/prefix.patch
2678 eprefixify molmol
2679
2680 - epatch "${FILESDIR}"/ldflags.patch
2681 + epatch "${WORKDIR}"/patches/ldflags.patch
2682
2683 ln -s makedef.lnx "${S}"/makedef || die
2684
2685 @@ -63,12 +64,12 @@ src_prepare() {
2686 -e "s:^CC.*:CC = $(tc-getCC):" \
2687 -i "${S}"/makedef || die
2688
2689 - epatch "${FILESDIR}"/cast.patch
2690 - epatch "${FILESDIR}"/libpng15.patch
2691 + epatch "${WORKDIR}"/patches/cast.patch
2692 + epatch "${WORKDIR}"/patches/libpng15.patch
2693
2694 # patch from fink
2695 # fixes numerous bad bracings and hopefully the OGL bug 429974
2696 - epatch "${FILESDIR}"/${P}-fink.patch
2697 + epatch "${WORKDIR}"/patches/${P}-fink.patch
2698 }
2699
2700 src_install() {
2701
2702 diff --git a/sci-chemistry/molmol/molmol-2k_p2-r4.ebuild b/sci-chemistry/molmol/molmol-2k_p2-r4.ebuild
2703 index d4034a9d63c..26a29492218 100644
2704 --- a/sci-chemistry/molmol/molmol-2k_p2-r4.ebuild
2705 +++ b/sci-chemistry/molmol/molmol-2k_p2-r4.ebuild
2706 @@ -1,4 +1,4 @@
2707 -# Copyright 1999-2016 Gentoo Foundation
2708 +# Copyright 1999-2017 Gentoo Foundation
2709 # Distributed under the terms of the GNU General Public License v2
2710
2711 EAPI=5
2712 @@ -12,7 +12,8 @@ DESCRIPTION="Publication-quality molecular visualization package"
2713 HOMEPAGE="http://hugin.ethz.ch/wuthrich/software/molmol/index.html"
2714 SRC_URI="
2715 ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-src.tar.gz
2716 - ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-doc.tar.gz"
2717 + ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-doc.tar.gz
2718 + https://dev.gentoo.org/~soap/distfiles/${PN}-patches.tbz2"
2719
2720 LICENSE="molmol"
2721 SLOT="0"
2722 @@ -45,12 +46,12 @@ pkg_setup() {
2723 src_prepare() {
2724 rm -rf tiff*
2725 # Patch from http://pjf.net/science/molmol.html, where src.rpm is provided
2726 - epatch "${FILESDIR}"/pjf_RH9_molmol2k2.diff
2727 + epatch "${WORKDIR}"/patches/pjf_RH9_molmol2k2.diff
2728
2729 - epatch "${FILESDIR}"/prefix.patch
2730 + epatch "${WORKDIR}"/patches/prefix.patch
2731 eprefixify molmol
2732
2733 - epatch "${FILESDIR}"/ldflags.patch
2734 + epatch "${WORKDIR}"/patches/ldflags.patch
2735
2736 ln -s makedef.lnx "${S}"/makedef || die
2737
2738 @@ -63,12 +64,12 @@ src_prepare() {
2739 -e "s:^CC.*:CC = $(tc-getCC):" \
2740 -i "${S}"/makedef || die
2741
2742 - epatch "${FILESDIR}"/cast.patch
2743 - epatch "${FILESDIR}"/libpng15.patch
2744 + epatch "${WORKDIR}"/patches/cast.patch
2745 + epatch "${WORKDIR}"/patches/libpng15.patch
2746
2747 # patch from fink
2748 # fixes numerous bad bracings and hopefully the OGL bug 429974
2749 - epatch "${FILESDIR}"/${P}-fink.patch
2750 + epatch "${WORKDIR}"/patches/${P}-fink.patch
2751
2752 tc-export AR
2753 }
2754
2755 diff --git a/sci-chemistry/molmol/molmol-2k_p2-r5.ebuild b/sci-chemistry/molmol/molmol-2k_p2-r5.ebuild
2756 index 16e8b855360..d788caa2005 100644
2757 --- a/sci-chemistry/molmol/molmol-2k_p2-r5.ebuild
2758 +++ b/sci-chemistry/molmol/molmol-2k_p2-r5.ebuild
2759 @@ -12,7 +12,8 @@ DESCRIPTION="Publication-quality molecular visualization package"
2760 HOMEPAGE="http://hugin.ethz.ch/wuthrich/software/molmol/index.html"
2761 SRC_URI="
2762 ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-src.tar.gz
2763 - ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-doc.tar.gz"
2764 + ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-doc.tar.gz
2765 + https://dev.gentoo.org/~soap/distfiles/${PN}-patches.tbz2"
2766
2767 LICENSE="molmol"
2768 SLOT="0"
2769 @@ -45,10 +46,10 @@ pkg_setup() {
2770 src_prepare() {
2771 rm -rf tiff*
2772 # Patch from http://pjf.net/science/molmol.html, where src.rpm is provided
2773 - epatch "${FILESDIR}"/pjf_RH9_molmol2k2.diff
2774 + epatch "${WORKDIR}"/patches/pjf_RH9_molmol2k2.diff
2775
2776 - epatch "${FILESDIR}"/ldflags.patch
2777 - epatch "${FILESDIR}"/opengl.patch
2778 + epatch "${WORKDIR}"/patches/ldflags.patch
2779 + epatch "${WORKDIR}"/patches/opengl.patch
2780
2781 ln -s makedef.lnx "${S}"/makedef || die
2782
2783 @@ -61,14 +62,14 @@ src_prepare() {
2784 -e "s:^CC.*:CC = $(tc-getCC):" \
2785 -i "${S}"/makedef || die
2786
2787 - epatch "${FILESDIR}"/cast.patch
2788 - epatch "${FILESDIR}"/libpng15.patch
2789 + epatch "${WORKDIR}"/patches/cast.patch
2790 + epatch "${WORKDIR}"/patches/libpng15.patch
2791
2792 # patch from fink
2793 # fixes numerous bad bracings and hopefully the OGL bug 429974
2794 - epatch "${FILESDIR}"/${P}-fink.patch
2795 + epatch "${WORKDIR}"/patches/${P}-fink.patch
2796
2797 - epatch "${FILESDIR}"/wild.patch
2798 + epatch "${WORKDIR}"/patches/wild.patch
2799 tc-export AR
2800 }