source: trunk/kitgen/blt2.4z-patch-2@ 175

Last change on this file since 175 was 175, checked in by demin, 12 years ago

initial commit

File size: 27.9 KB
RevLine 
[175]1diff -cr blt2.4z/src/bltGrAxis.c blt2.4z-new/src/bltGrAxis.c
2*** blt2.4z/src/bltGrAxis.c 2002-09-18 17:30:51.000000000 -0500
3--- blt2.4z-new/src/bltGrAxis.c 2002-12-02 22:39:26.000000000 -0600
4***************
5*** 1424,1482 ****
6 double majorStep, minorStep;
7 int nMajor, nMinor;
8
9! min = (min != 0.0) ? log10(FABS(min)) : 0.0;
10! max = (max != 0.0) ? log10(FABS(max)) : 1.0;
11!
12! tickMin = floor(min);
13! tickMax = ceil(max);
14! range = tickMax - tickMin;
15!
16! if (range > 10) {
17! /* There are too many decades to display a major tick at every
18! * decade. Instead, treat the axis as a linear scale. */
19! range = NiceNum(range, 0);
20! majorStep = NiceNum(range / DEF_NUM_TICKS, 1);
21! tickMin = UFLOOR(tickMin, majorStep);
22! tickMax = UCEIL(tickMax, majorStep);
23! nMajor = (int)((tickMax - tickMin) / majorStep) + 1;
24! minorStep = EXP10(floor(log10(majorStep)));
25! if (minorStep == majorStep) {
26! nMinor = 4, minorStep = 0.2;
27 } else {
28! nMinor = Round(majorStep / minorStep) - 1;
29! }
30! } else {
31! if (tickMin == tickMax) {
32! tickMax++;
33! }
34! majorStep = 1.0;
35! nMajor = (int)(tickMax - tickMin + 1); /* FIXME: Check this. */
36!
37! minorStep = 0.0; /* This is a special hack to pass
38 * information to the GenerateTicks
39 * routine. An interval of 0.0 tells
40 * 1) this is a minor sweep and
41 * 2) the axis is log scale.
42 */
43! nMinor = 10;
44! }
45! if ((axisPtr->looseMin == TICK_RANGE_TIGHT) ||
46! ((axisPtr->looseMin == TICK_RANGE_LOOSE) &&
47! (DEFINED(axisPtr->reqMin)))) {
48! tickMin = min;
49! nMajor++;
50! }
51! if ((axisPtr->looseMax == TICK_RANGE_TIGHT) ||
52! ((axisPtr->looseMax == TICK_RANGE_LOOSE) &&
53! (DEFINED(axisPtr->reqMax)))) {
54! tickMax = max;
55 }
56 axisPtr->majorSweep.step = majorStep;
57 axisPtr->majorSweep.initial = floor(tickMin);
58 axisPtr->majorSweep.nSteps = nMajor;
59 axisPtr->minorSweep.initial = axisPtr->minorSweep.step = minorStep;
60 axisPtr->minorSweep.nSteps = nMinor;
61-
62 SetAxisRange(&axisPtr->axisRange, tickMin, tickMax);
63 }
64
65--- 1424,1485 ----
66 double majorStep, minorStep;
67 int nMajor, nMinor;
68
69! nMajor = nMinor = 0;
70! majorStep = minorStep = 0.0;
71! if (min < max) {
72! min = (min != 0.0) ? log10(FABS(min)) : 0.0;
73! max = (max != 0.0) ? log10(FABS(max)) : 1.0;
74!
75! tickMin = floor(min);
76! tickMax = ceil(max);
77! range = tickMax - tickMin;
78!
79! if (range > 10) {
80! /* There are too many decades to display a major tick at every
81! * decade. Instead, treat the axis as a linear scale. */
82! range = NiceNum(range, 0);
83! majorStep = NiceNum(range / DEF_NUM_TICKS, 1);
84! tickMin = UFLOOR(tickMin, majorStep);
85! tickMax = UCEIL(tickMax, majorStep);
86! nMajor = (int)((tickMax - tickMin) / majorStep) + 1;
87! minorStep = EXP10(floor(log10(majorStep)));
88! if (minorStep == majorStep) {
89! nMinor = 4, minorStep = 0.2;
90! } else {
91! nMinor = Round(majorStep / minorStep) - 1;
92! }
93 } else {
94! if (tickMin == tickMax) {
95! tickMax++;
96! }
97! majorStep = 1.0;
98! nMajor = (int)(tickMax - tickMin + 1); /* FIXME: Check this. */
99!
100! minorStep = 0.0; /* This is a special hack to pass
101 * information to the GenerateTicks
102 * routine. An interval of 0.0 tells
103 * 1) this is a minor sweep and
104 * 2) the axis is log scale.
105 */
106! nMinor = 10;
107! }
108! if ((axisPtr->looseMin == TICK_RANGE_TIGHT) ||
109! ((axisPtr->looseMin == TICK_RANGE_LOOSE) &&
110! (DEFINED(axisPtr->reqMin)))) {
111! tickMin = min;
112! nMajor++;
113! }
114! if ((axisPtr->looseMax == TICK_RANGE_TIGHT) ||
115! ((axisPtr->looseMax == TICK_RANGE_LOOSE) &&
116! (DEFINED(axisPtr->reqMax)))) {
117! tickMax = max;
118! }
119 }
120 axisPtr->majorSweep.step = majorStep;
121 axisPtr->majorSweep.initial = floor(tickMin);
122 axisPtr->majorSweep.nSteps = nMajor;
123 axisPtr->minorSweep.initial = axisPtr->minorSweep.step = minorStep;
124 axisPtr->minorSweep.nSteps = nMinor;
125 SetAxisRange(&axisPtr->axisRange, tickMin, tickMax);
126 }
127
128***************
129*** 1551,1581 ****
130 double axisMin, axisMax;
131 int nTicks;
132
133! range = max - min;
134!
135! /* Calculate the major tick stepping. */
136! if (axisPtr->reqStep > 0.0) {
137! /* An interval was designated by the user. Keep scaling it
138! * until it fits comfortably within the current range of the
139! * axis. */
140! step = axisPtr->reqStep;
141! while ((2 * step) >= range) {
142! step *= 0.5;
143 }
144! } else {
145! range = NiceNum(range, 0);
146! step = NiceNum(range / DEF_NUM_TICKS, 1);
147 }
148-
149- /* Find the outer tick values. Add 0.0 to prevent getting -0.0. */
150- axisMin = tickMin = floor(min / step) * step + 0.0;
151- axisMax = tickMax = ceil(max / step) * step + 0.0;
152-
153- nTicks = Round((tickMax - tickMin) / step) + 1;
154 axisPtr->majorSweep.step = step;
155 axisPtr->majorSweep.initial = tickMin;
156 axisPtr->majorSweep.nSteps = nTicks;
157!
158 /*
159 * The limits of the axis are either the range of the data
160 * ("tight") or at the next outer tick interval ("loose"). The
161--- 1554,1588 ----
162 double axisMin, axisMax;
163 int nTicks;
164
165! nTicks = 0;
166! tickMin = tickMax = 0.0;
167! if (min < max) {
168! range = max - min;
169!
170! /* Calculate the major tick stepping. */
171! if (axisPtr->reqStep > 0.0) {
172! /* An interval was designated by the user. Keep scaling it
173! * until it fits comfortably within the current range of the
174! * axis. */
175! step = axisPtr->reqStep;
176! while ((2 * step) >= range) {
177! step *= 0.5;
178! }
179! } else {
180! range = NiceNum(range, 0);
181! step = NiceNum(range / DEF_NUM_TICKS, 1);
182 }
183!
184! /* Find the outer tick values. Add 0.0 to prevent getting -0.0. */
185! axisMin = tickMin = floor(min / step) * step + 0.0;
186! axisMax = tickMax = ceil(max / step) * step + 0.0;
187!
188! nTicks = Round((tickMax - tickMin) / step) + 1;
189 }
190 axisPtr->majorSweep.step = step;
191 axisPtr->majorSweep.initial = tickMin;
192 axisPtr->majorSweep.nSteps = nTicks;
193!
194 /*
195 * The limits of the axis are either the range of the data
196 * ("tight") or at the next outer tick interval ("loose"). The
197***************
198*** 1596,1604 ****
199 axisMax = max;
200 }
201 SetAxisRange(&axisPtr->axisRange, axisMin, axisMax);
202!
203 /* Now calculate the minor tick step and number. */
204!
205 if ((axisPtr->reqNumMinorTicks > 0) &&
206 ((axisPtr->flags & AXIS_CONFIG_MAJOR) == 0)) {
207 nTicks = axisPtr->reqNumMinorTicks - 1;
208--- 1603,1611 ----
209 axisMax = max;
210 }
211 SetAxisRange(&axisPtr->axisRange, axisMin, axisMax);
212!
213 /* Now calculate the minor tick step and number. */
214!
215 if ((axisPtr->reqNumMinorTicks > 0) &&
216 ((axisPtr->flags & AXIS_CONFIG_MAJOR) == 0)) {
217 nTicks = axisPtr->reqNumMinorTicks - 1;
218***************
219*** 1614,1620 ****
220 axisPtr->minorSweep.nSteps = nTicks;
221 }
222
223-
224 static void
225 SweepTicks(axisPtr)
226 Axis *axisPtr;
227--- 1621,1626 ----
228***************
229*** 1684,1692 ****
230 for (linkPtr = Blt_ChainFirstLink(graphPtr->elements.displayList);
231 linkPtr != NULL; linkPtr = Blt_ChainNextLink(linkPtr)) {
232 elemPtr = Blt_ChainGetValue(linkPtr);
233! (*elemPtr->procsPtr->extentsProc) (elemPtr, &exts);
234! GetDataLimits(elemPtr->axes.x, exts.left, exts.right);
235! GetDataLimits(elemPtr->axes.y, exts.top, exts.bottom);
236 }
237 /*
238 * Step 3: Now that we know the range of data values for each axis,
239--- 1690,1700 ----
240 for (linkPtr = Blt_ChainFirstLink(graphPtr->elements.displayList);
241 linkPtr != NULL; linkPtr = Blt_ChainNextLink(linkPtr)) {
242 elemPtr = Blt_ChainGetValue(linkPtr);
243! if (!elemPtr->hidden) {
244! (*elemPtr->procsPtr->extentsProc) (elemPtr, &exts);
245! GetDataLimits(elemPtr->axes.x, exts.left, exts.right);
246! GetDataLimits(elemPtr->axes.y, exts.top, exts.bottom);
247! }
248 }
249 /*
250 * Step 3: Now that we know the range of data values for each axis,
251diff -cr blt2.4z/src/bltGrElem.c blt2.4z-new/src/bltGrElem.c
252*** blt2.4z/src/bltGrElem.c 2002-09-18 17:30:51.000000000 -0500
253--- blt2.4z-new/src/bltGrElem.c 2002-12-02 22:42:31.000000000 -0600
254***************
255*** 1215,1223 ****
256 {
257 int nNames; /* Number of names found in Tcl name list */
258 char **nameArr; /* Broken out array of element names */
259- Blt_HashSearch cursor;
260 register int i;
261- register Blt_HashEntry *hPtr;
262 Element *elemPtr; /* Element information record */
263
264 if (Tcl_SplitList(graphPtr->interp, newList, &nNames, &nameArr) != TCL_OK) {
265--- 1215,1221 ----
266***************
267*** 1227,1243 ****
268 }
269 /* Clear the display list and mark all elements as hidden. */
270 Blt_ChainReset(graphPtr->elements.displayList);
271- for (hPtr = Blt_FirstHashEntry(&graphPtr->elements.table, &cursor);
272- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
273- elemPtr = (Element *)Blt_GetHashValue(hPtr);
274- elemPtr->hidden = TRUE;
275- }
276
277 /* Rebuild the display list, checking that each name it exists
278 * (currently ignoring invalid element names). */
279 for (i = 0; i < nNames; i++) {
280 if (NameToElement(graphPtr, nameArr[i], &elemPtr) == TCL_OK) {
281- elemPtr->hidden = FALSE;
282 Blt_ChainAppend(graphPtr->elements.displayList, elemPtr);
283 }
284 }
285--- 1225,1235 ----
286***************
287*** 1399,1406 ****
288 /* Comment the PostScript to indicate the start of the element */
289 Blt_FormatToPostScript(psToken, "\n%% Element \"%s\"\n\n",
290 elemPtr->name);
291! (*elemPtr->procsPtr->printNormalProc) (graphPtr, psToken,
292! elemPtr);
293 }
294 }
295 }
296--- 1391,1397 ----
297 /* Comment the PostScript to indicate the start of the element */
298 Blt_FormatToPostScript(psToken, "\n%% Element \"%s\"\n\n",
299 elemPtr->name);
300! (*elemPtr->procsPtr->printNormalProc) (graphPtr, psToken, elemPtr);
301 }
302 }
303 }
304***************
305*** 1426,1433 ****
306 if ((!elemPtr->hidden) && (elemPtr->flags & ELEM_ACTIVE)) {
307 Blt_FormatToPostScript(psToken, "\n%% Active Element \"%s\"\n\n",
308 elemPtr->name);
309! (*elemPtr->procsPtr->printActiveProc) (graphPtr, psToken,
310! elemPtr);
311 }
312 }
313 }
314--- 1417,1423 ----
315 if ((!elemPtr->hidden) && (elemPtr->flags & ELEM_ACTIVE)) {
316 Blt_FormatToPostScript(psToken, "\n%% Active Element \"%s\"\n\n",
317 elemPtr->name);
318! (*elemPtr->procsPtr->printActiveProc) (graphPtr, psToken, elemPtr);
319 }
320 }
321 }
322***************
323*** 1671,1676 ****
324--- 1661,1667 ----
325 ClosestSearch search;
326 int i, x, y;
327 int flags = TCL_LEAVE_ERR_MSG;
328+ int found;
329
330 if (graphPtr->flags & RESET_AXES) {
331 Blt_ResetAxes(graphPtr);
332***************
333*** 1715,1727 ****
334 search.dist = (double)(search.halo + 1);
335
336 if (i < argc) {
337 for ( /* empty */ ; i < argc; i++) {
338 if (NameToElement(graphPtr, argv[i], &elemPtr) != TCL_OK) {
339 return TCL_ERROR; /* Can't find named element */
340 }
341! if (elemPtr->hidden) {
342 Tcl_AppendResult(interp, "element \"", argv[i], "\" is hidden",
343! (char *)NULL);
344 return TCL_ERROR; /* Element isn't visible */
345 }
346 /* Check if the X or Y vectors have notifications pending */
347--- 1706,1728 ----
348 search.dist = (double)(search.halo + 1);
349
350 if (i < argc) {
351+ Blt_ChainLink *linkPtr;
352+
353 for ( /* empty */ ; i < argc; i++) {
354 if (NameToElement(graphPtr, argv[i], &elemPtr) != TCL_OK) {
355 return TCL_ERROR; /* Can't find named element */
356 }
357! found = FALSE;
358! for (linkPtr = Blt_ChainFirstLink(graphPtr->elements.displayList);
359! linkPtr == NULL; linkPtr = Blt_ChainNextLink(linkPtr)) {
360! if (elemPtr == Blt_ChainGetValue(linkPtr)) {
361! found = TRUE;
362! break;
363! }
364! }
365! if ((!found) || (elemPtr->hidden)) {
366 Tcl_AppendResult(interp, "element \"", argv[i], "\" is hidden",
367! (char *)NULL);
368 return TCL_ERROR; /* Element isn't visible */
369 }
370 /* Check if the X or Y vectors have notifications pending */
371***************
372*** 1744,1759 ****
373 for (linkPtr = Blt_ChainLastLink(graphPtr->elements.displayList);
374 linkPtr != NULL; linkPtr = Blt_ChainPrevLink(linkPtr)) {
375 elemPtr = Blt_ChainGetValue(linkPtr);
376-
377 /* Check if the X or Y vectors have notifications pending */
378! if ((elemPtr->flags & MAP_ITEM) ||
379 (Blt_VectorNotifyPending(elemPtr->x.clientId)) ||
380 (Blt_VectorNotifyPending(elemPtr->y.clientId))) {
381 continue;
382 }
383! if (!elemPtr->hidden) {
384! (*elemPtr->procsPtr->closestProc) (graphPtr, elemPtr, &search);
385! }
386 }
387
388 }
389--- 1745,1758 ----
390 for (linkPtr = Blt_ChainLastLink(graphPtr->elements.displayList);
391 linkPtr != NULL; linkPtr = Blt_ChainPrevLink(linkPtr)) {
392 elemPtr = Blt_ChainGetValue(linkPtr);
393 /* Check if the X or Y vectors have notifications pending */
394! if ((elemPtr->hidden) ||
395! (elemPtr->flags & MAP_ITEM) ||
396 (Blt_VectorNotifyPending(elemPtr->x.clientId)) ||
397 (Blt_VectorNotifyPending(elemPtr->y.clientId))) {
398 continue;
399 }
400! (*elemPtr->procsPtr->closestProc)(graphPtr, elemPtr, &search);
401 }
402
403 }
404***************
405*** 1859,1888 ****
406 return TCL_ERROR; /* Failed to configure element */
407 }
408 if (Blt_ConfigModified(elemPtr->specsPtr, "-hide", (char *)NULL)) {
409- Blt_ChainLink *linkPtr;
410-
411- for (linkPtr = Blt_ChainFirstLink(graphPtr->elements.displayList);
412- linkPtr != NULL; linkPtr = Blt_ChainNextLink(linkPtr)) {
413- if (elemPtr == Blt_ChainGetValue(linkPtr)) {
414- break;
415- }
416- }
417- if ((elemPtr->hidden) != (linkPtr == NULL)) {
418-
419- /* The element's "hidden" variable is out of sync with
420- * the display list. [That's what you get for having
421- * two ways to do the same thing.] This affects what
422- * elements are considered for axis ranges and
423- * displayed in the legend. Update the display list by
424- * either by adding or removing the element. */
425-
426- if (linkPtr == NULL) {
427- Blt_ChainPrepend(graphPtr->elements.displayList, elemPtr);
428- } else {
429- Blt_ChainDeleteLink(graphPtr->elements.displayList,
430- linkPtr);
431- }
432- }
433 graphPtr->flags |= RESET_AXES;
434 elemPtr->flags |= MAP_ITEM;
435 }
436--- 1858,1863 ----
437diff -cr blt2.4z/src/bltGrMarker.c blt2.4z-new/src/bltGrMarker.c
438*** blt2.4z/src/bltGrMarker.c 2002-09-18 17:30:51.000000000 -0500
439--- blt2.4z-new/src/bltGrMarker.c 2002-12-11 01:55:27.000000000 -0600
440***************
441*** 29,34 ****
442--- 29,37 ----
443 #include "bltChain.h"
444 #include "bltGrElem.h"
445
446+ #define GETBITMAP(b) \
447+ (((b)->destBitmap == None) ? (b)->srcBitmap : (b)->destBitmap)
448+
449 #define MAX_OUTLINE_POINTS 12
450
451 /* Map graph coordinates to normalized coordinates [0..1] */
452***************
453*** 812,818 ****
454
455 /* Polygon specific attributes and fields */
456
457! Point2D *screenPts;
458
459 ColorPair outline;
460 ColorPair fill;
461--- 815,827 ----
462
463 /* Polygon specific attributes and fields */
464
465! Point2D *screenPts; /* Array of points representing the
466! * polygon in screen coordinates. It's
467! * not used for drawing, but to
468! * generate the outlinePts and fillPts
469! * arrays that are the coordinates of
470! * the possibly clipped outline and
471! * filled polygon. */
472
473 ColorPair outline;
474 ColorPair fill;
475***************
476*** 1563,1571 ****
477 if (bmPtr->srcBitmap == None) {
478 return TCL_OK;
479 }
480- if (bmPtr->destBitmap == None) {
481- bmPtr->destBitmap = bmPtr->srcBitmap;
482- }
483 bmPtr->theta = FMOD(bmPtr->rotate, 360.0);
484 if (bmPtr->theta < 0.0) {
485 bmPtr->theta += 360.0;
486--- 1572,1577 ----
487***************
488*** 1650,1658 ****
489 if (bmPtr->srcBitmap == None) {
490 return;
491 }
492! if (bmPtr->destBitmap != bmPtr->srcBitmap) {
493 Tk_FreePixmap(graphPtr->display, bmPtr->destBitmap);
494! bmPtr->destBitmap = bmPtr->srcBitmap;
495 }
496 /*
497 * Collect the coordinates. The number of coordinates will determine
498--- 1656,1664 ----
499 if (bmPtr->srcBitmap == None) {
500 return;
501 }
502! if (bmPtr->destBitmap != None) {
503 Tk_FreePixmap(graphPtr->display, bmPtr->destBitmap);
504! bmPtr->destBitmap = None;
505 }
506 /*
507 * Collect the coordinates. The number of coordinates will determine
508***************
509*** 1752,1758 ****
510 } else {
511 bmPtr->destWidth = srcWidth;
512 bmPtr->destHeight = srcHeight;
513! bmPtr->destBitmap = bmPtr->srcBitmap;
514 }
515 bmPtr->anchorPos = anchorPos;
516 {
517--- 1758,1764 ----
518 } else {
519 bmPtr->destWidth = srcWidth;
520 bmPtr->destHeight = srcHeight;
521! bmPtr->destBitmap = None;
522 }
523 bmPtr->anchorPos = anchorPos;
524 {
525***************
526*** 1909,1917 ****
527 Graph *graphPtr = markerPtr->graphPtr;
528 BitmapMarker *bmPtr = (BitmapMarker *)markerPtr;
529 double theta;
530
531! if ((bmPtr->destBitmap == None) || (bmPtr->destWidth < 1) ||
532! (bmPtr->destHeight < 1)) {
533 return;
534 }
535 theta = FMOD(bmPtr->theta, (double)90.0);
536--- 1915,1924 ----
537 Graph *graphPtr = markerPtr->graphPtr;
538 BitmapMarker *bmPtr = (BitmapMarker *)markerPtr;
539 double theta;
540+ Pixmap bitmap;
541
542! bitmap = GETBITMAP(bmPtr);
543! if ((bitmap == None) || (bmPtr->destWidth < 1) || (bmPtr->destHeight < 1)) {
544 return;
545 }
546 theta = FMOD(bmPtr->theta, (double)90.0);
547***************
548*** 1934,1947 ****
549 XFillPolygon(graphPtr->display, drawable, bmPtr->fillGC,
550 polygon, bmPtr->nOutlinePts, Convex, CoordModeOrigin);
551 }
552! XSetClipMask(graphPtr->display, bmPtr->gc, bmPtr->destBitmap);
553 XSetClipOrigin(graphPtr->display, bmPtr->gc, (int)bmPtr->anchorPos.x,
554 (int)bmPtr->anchorPos.y);
555 } else {
556 XSetClipMask(graphPtr->display, bmPtr->gc, None);
557 XSetClipOrigin(graphPtr->display, bmPtr->gc, 0, 0);
558 }
559! XCopyPlane(graphPtr->display, bmPtr->destBitmap, drawable, bmPtr->gc, 0, 0,
560 bmPtr->destWidth, bmPtr->destHeight, (int)bmPtr->anchorPos.x,
561 (int)bmPtr->anchorPos.y, 1);
562 }
563--- 1941,1954 ----
564 XFillPolygon(graphPtr->display, drawable, bmPtr->fillGC,
565 polygon, bmPtr->nOutlinePts, Convex, CoordModeOrigin);
566 }
567! XSetClipMask(graphPtr->display, bmPtr->gc, bitmap);
568 XSetClipOrigin(graphPtr->display, bmPtr->gc, (int)bmPtr->anchorPos.x,
569 (int)bmPtr->anchorPos.y);
570 } else {
571 XSetClipMask(graphPtr->display, bmPtr->gc, None);
572 XSetClipOrigin(graphPtr->display, bmPtr->gc, 0, 0);
573 }
574! XCopyPlane(graphPtr->display, bitmap, drawable, bmPtr->gc, 0, 0,
575 bmPtr->destWidth, bmPtr->destHeight, (int)bmPtr->anchorPos.x,
576 (int)bmPtr->anchorPos.y, 1);
577 }
578***************
579*** 1965,1972 ****
580 {
581 Graph *graphPtr = markerPtr->graphPtr;
582 BitmapMarker *bmPtr = (BitmapMarker *)markerPtr;
583
584! if (bmPtr->destBitmap == None) {
585 return;
586 }
587 if (bmPtr->fillColor != NULL) {
588--- 1972,1981 ----
589 {
590 Graph *graphPtr = markerPtr->graphPtr;
591 BitmapMarker *bmPtr = (BitmapMarker *)markerPtr;
592+ Pixmap bitmap;
593
594! bitmap = GETBITMAP(bmPtr);
595! if (bitmap == None) {
596 return;
597 }
598 if (bmPtr->fillColor != NULL) {
599***************
600*** 1982,1988 ****
601 Blt_FormatToPostScript(psToken, " %d %d true [%d 0 0 %d 0 %d] {",
602 bmPtr->destWidth, bmPtr->destHeight, bmPtr->destWidth,
603 -bmPtr->destHeight, bmPtr->destHeight);
604! Blt_BitmapDataToPostScript(psToken, graphPtr->display, bmPtr->destBitmap,
605 bmPtr->destWidth, bmPtr->destHeight);
606 Blt_AppendToPostScript(psToken, " } imagemask\n",
607 "grestore\n", (char *)NULL);
608--- 1991,1997 ----
609 Blt_FormatToPostScript(psToken, " %d %d true [%d 0 0 %d 0 %d] {",
610 bmPtr->destWidth, bmPtr->destHeight, bmPtr->destWidth,
611 -bmPtr->destHeight, bmPtr->destHeight);
612! Blt_BitmapDataToPostScript(psToken, graphPtr->display, bitmap,
613 bmPtr->destWidth, bmPtr->destHeight);
614 Blt_AppendToPostScript(psToken, " } imagemask\n",
615 "grestore\n", (char *)NULL);
616***************
617*** 2018,2024 ****
618 if (bmPtr->fillGC != NULL) {
619 Tk_FreeGC(graphPtr->display, bmPtr->fillGC);
620 }
621! if (bmPtr->destBitmap != bmPtr->srcBitmap) {
622 Tk_FreePixmap(graphPtr->display, bmPtr->destBitmap);
623 }
624 }
625--- 2027,2033 ----
626 if (bmPtr->fillGC != NULL) {
627 Tk_FreeGC(graphPtr->display, bmPtr->fillGC);
628 }
629! if (bmPtr->destBitmap != None) {
630 Tk_FreePixmap(graphPtr->display, bmPtr->destBitmap);
631 }
632 }
633***************
634*** 2127,2134 ****
635 imPtr->tkImage = Tk_GetImage(interp, graphPtr->tkwin,
636 imPtr->imageName, ImageChangedProc, imPtr);
637 if (imPtr->tkImage == NULL) {
638- Tcl_AppendResult(interp, "can't find an image \"",
639- imPtr->imageName, "\"", (char *)NULL);
640 Blt_Free(imPtr->imageName);
641 imPtr->imageName = NULL;
642 return TCL_ERROR;
643--- 2136,2141 ----
644***************
645*** 2494,2499 ****
646--- 2501,2509 ----
647 if (imPtr->srcImage != NULL) {
648 Blt_FreeColorImage(imPtr->srcImage);
649 }
650+ if (imPtr->gc != NULL) {
651+ Tk_FreeGC(graphPtr->display, imPtr->gc);
652+ }
653 }
654
655 /*
656***************
657*** 3747,3757 ****
658 {
659 PolygonMarker *pmPtr = (PolygonMarker *)markerPtr;
660
661! if (pmPtr->nWorldPts < 2) {
662! return FALSE;
663 }
664! return Blt_PointInPolygon(samplePtr, pmPtr->screenPts,
665! pmPtr->nWorldPts + 1);
666 }
667
668 /*
669--- 3757,3767 ----
670 {
671 PolygonMarker *pmPtr = (PolygonMarker *)markerPtr;
672
673! if ((pmPtr->nWorldPts >= 3) && (pmPtr->screenPts != NULL)) {
674! return Blt_PointInPolygon(samplePtr, pmPtr->screenPts,
675! pmPtr->nWorldPts + 1);
676 }
677! return FALSE;
678 }
679
680 /*
681***************
682*** 3769,3775 ****
683 {
684 PolygonMarker *pmPtr = (PolygonMarker *)markerPtr;
685
686! if (pmPtr->nWorldPts >= 3) {
687 return Blt_RegionInPolygon(extsPtr, pmPtr->screenPts, pmPtr->nWorldPts,
688 enclosed);
689 }
690--- 3779,3785 ----
691 {
692 PolygonMarker *pmPtr = (PolygonMarker *)markerPtr;
693
694! if ((pmPtr->nWorldPts >= 3) && (pmPtr->screenPts != NULL)) {
695 return Blt_RegionInPolygon(extsPtr, pmPtr->screenPts, pmPtr->nWorldPts,
696 enclosed);
697 }
698***************
699*** 4036,4041 ****
700--- 4046,4054 ----
701 if (pmPtr->outlinePts != NULL) {
702 Blt_Free(pmPtr->outlinePts);
703 }
704+ if (pmPtr->screenPts != NULL) {
705+ Blt_Free(pmPtr->screenPts);
706+ }
707 Blt_FreeColorPair(&pmPtr->outline);
708 Blt_FreeColorPair(&pmPtr->fill);
709 }
710***************
711*** 4260,4265 ****
712--- 4273,4279 ----
713 int nNames, nOpts;
714 char **options;
715 register int i;
716+ int under;
717
718 /* Figure out where the option value pairs begin */
719 argc -= 3;
720***************
721*** 4289,4294 ****
722--- 4303,4309 ----
723 }
724 /* Save the old marker. */
725 oldName = markerPtr->name;
726+ under = markerPtr->drawUnder;
727 if (Tk_ConfigureWidget(interp, graphPtr->tkwin,
728 markerPtr->classPtr->configSpecs, nOpts, options,
729 (char *)markerPtr, flags) != TCL_OK) {
730***************
731*** 4304,4309 ****
732--- 4319,4327 ----
733 if ((*markerPtr->classPtr->configProc) (markerPtr) != TCL_OK) {
734 return TCL_ERROR;
735 }
736+ if (markerPtr->drawUnder != under) {
737+ graphPtr->flags |= REDRAW_BACKING_STORE;
738+ }
739 }
740 return TCL_OK;
741 }
742***************
743*** 4942,4948 ****
744--- 4960,4973 ----
745 for (linkPtr = Blt_ChainLastLink(graphPtr->markers.displayList);
746 linkPtr != NULL; linkPtr = Blt_ChainPrevLink(linkPtr)) {
747 markerPtr = Blt_ChainGetValue(linkPtr);
748+ /*
749+ * Don't consider markers that are pending to be mapped. Even
750+ * if the marker has already been mapped, the coordinates
751+ * could be invalid now. Better to pick no marker than the
752+ * wrong marker.
753+ */
754 if ((markerPtr->drawUnder == under) && (markerPtr->nWorldPts > 0) &&
755+ ((markerPtr->flags & MAP_ITEM) == 0) &&
756 (!markerPtr->hidden) && (markerPtr->state == STATE_NORMAL)) {
757 if ((*markerPtr->classPtr->pointProc) (markerPtr, &point)) {
758 return markerPtr;
759Only in blt2.4z-new/src: bltHash.h
760diff -cr blt2.4z/src/bltInit.c blt2.4z-new/src/bltInit.c
761*** blt2.4z/src/bltInit.c 2002-09-10 00:12:33.000000000 -0500
762--- blt2.4z-new/src/bltInit.c 2002-12-02 22:25:33.000000000 -0600
763***************
764*** 38,54 ****
765 #endif
766 #endif
767
768 double bltNaN;
769 #if (TCL_MAJOR_VERSION > 7)
770 Tcl_Obj *bltEmptyStringObjPtr;
771 #endif
772
773 static Tcl_MathProc MinMathProc, MaxMathProc;
774- static int tclLoaded = FALSE;
775- #ifndef TCL_ONLY
776- static int tkLoaded = FALSE;
777- #endif
778-
779 static char libPath[1024] =
780 {
781 BLT_LIBRARY
782--- 38,53 ----
783 #endif
784 #endif
785
786+ #define BLT_THREAD_KEY "BLT Initialized"
787+ #define BLT_TCL_CMDS (1<<0)
788+ #define BLT_TK_CMDS (1<<1)
789+
790 double bltNaN;
791 #if (TCL_MAJOR_VERSION > 7)
792 Tcl_Obj *bltEmptyStringObjPtr;
793 #endif
794
795 static Tcl_MathProc MinMathProc, MaxMathProc;
796 static char libPath[1024] =
797 {
798 BLT_LIBRARY
799***************
800*** 404,410 ****
801 Blt_Init(interp)
802 Tcl_Interp *interp; /* Interpreter to add extra commands */
803 {
804! if (!tclLoaded) {
805 register Tcl_AppInitProc **p;
806 Tcl_Namespace *nsPtr;
807 Tcl_ValueType args[2];
808--- 403,412 ----
809 Blt_Init(interp)
810 Tcl_Interp *interp; /* Interpreter to add extra commands */
811 {
812! int flags;
813!
814! flags = (int)Tcl_GetAssocData(interp, BLT_THREAD_KEY, NULL);
815! if ((flags & BLT_TCL_CMDS) == 0) {
816 register Tcl_AppInitProc **p;
817 Tcl_Namespace *nsPtr;
818 Tcl_ValueType args[2];
819***************
820*** 451,460 ****
821 if (Tcl_PkgProvide(interp, "BLT", BLT_VERSION) != TCL_OK) {
822 return TCL_ERROR;
823 }
824! tclLoaded = TRUE;
825 }
826 #ifndef TCL_ONLY
827! if (!tkLoaded) {
828 register Tcl_AppInitProc **p;
829 Tcl_Namespace *nsPtr;
830
831--- 453,463 ----
832 if (Tcl_PkgProvide(interp, "BLT", BLT_VERSION) != TCL_OK) {
833 return TCL_ERROR;
834 }
835! Tcl_SetAssocData(interp, BLT_THREAD_KEY, NULL,
836! (ClientData)(flags | BLT_TCL_CMDS));
837 }
838 #ifndef TCL_ONLY
839! if ((flags & BLT_TK_CMDS) == 0) {
840 register Tcl_AppInitProc **p;
841 Tcl_Namespace *nsPtr;
842
843***************
844*** 486,492 ****
845 }
846 }
847 Blt_InitEpsCanvasItem(interp);
848! tkLoaded = TRUE;
849 }
850 #endif
851 return TCL_OK;
852--- 489,496 ----
853 }
854 }
855 Blt_InitEpsCanvasItem(interp);
856! Tcl_SetAssocData(interp, BLT_THREAD_KEY, NULL,
857! (ClientData)(flags | BLT_TK_CMDS));
858 }
859 #endif
860 return TCL_OK;
861***************
862*** 499,505 ****
863 Blt_Init(interp)
864 Tcl_Interp *interp; /* Interpreter to add extra commands */
865 {
866! if (!tclLoaded) {
867 register Tcl_AppInitProc **p;
868 Tcl_ValueType args[2];
869
870--- 503,512 ----
871 Blt_Init(interp)
872 Tcl_Interp *interp; /* Interpreter to add extra commands */
873 {
874! int flags;
875!
876! flags = (int)Tcl_GetAssocData(interp, BLT_THREAD_KEY, NULL);
877! if ((flags & BLT_TCL_CMDS) == 0) {
878 register Tcl_AppInitProc **p;
879 Tcl_ValueType args[2];
880
881***************
882*** 537,546 ****
883 if (Tcl_PkgProvide(interp, "BLT", BLT_VERSION) != TCL_OK) {
884 return TCL_ERROR;
885 }
886! tclLoaded = TRUE;
887 }
888 #ifndef TCL_ONLY
889! if (!tkLoaded) {
890 register Tcl_AppInitProc **p;
891
892 #if (TCL_VERSION_NUMBER >= _VERSION(8,1,0))
893--- 544,554 ----
894 if (Tcl_PkgProvide(interp, "BLT", BLT_VERSION) != TCL_OK) {
895 return TCL_ERROR;
896 }
897! Tcl_SetAssocData(interp, BLT_THREAD_KEY, NULL,
898! (ClientData)(flags | BLT_TCL_CMDS));
899 }
900 #ifndef TCL_ONLY
901! if ((flags & BLT_TK_CMDS) == 0) {
902 register Tcl_AppInitProc **p;
903
904 #if (TCL_VERSION_NUMBER >= _VERSION(8,1,0))
905***************
906*** 560,566 ****
907 }
908 }
909 Blt_InitEpsCanvasItem(interp);
910! tkLoaded = TRUE;
911 }
912 #endif
913 return TCL_OK;
914--- 568,575 ----
915 }
916 }
917 Blt_InitEpsCanvasItem(interp);
918! Tcl_SetAssocData(interp, BLT_THREAD_KEY, NULL,
919! (ClientData)(flags | BLT_TK_CMDS));
920 }
921 #endif
922 return TCL_OK;
923diff -cr blt2.4z/src/bltTreeView.c blt2.4z-new/src/bltTreeView.c
924*** blt2.4z/src/bltTreeView.c 2002-08-15 23:15:04.000000000 -0500
925--- blt2.4z-new/src/bltTreeView.c 2003-03-04 11:15:34.000000000 -0600
926***************
927*** 3866,3871 ****
928--- 3866,3872 ----
929 assert(tvPtr->visibleArr);
930 }
931 tvPtr->nVisible = 0;
932+ tvPtr->visibleArr[0] = NULL;
933
934 if (tvPtr->rootPtr->flags & ENTRY_HIDDEN) {
935 return TCL_OK; /* Root node is hidden. */
936***************
937*** 4631,4636 ****
938--- 4632,4640 ----
939 int width;
940 int x0, cx, xOffset;
941
942+ if (tvPtr->titleHeight < 1) {
943+ return;
944+ }
945 columnWidth = columnPtr->width;
946 cx = x;
947 if (columnPtr->position == Blt_ChainGetLength(tvPtr->colChainPtr)) {
948Only in blt2.4z/src: pure_api.c
Note: See TracBrowser for help on using the repository browser.