Lines Matching defs:polyPtr

75 			    PolygonItem *polyPtr));
169 PolygonItem *polyPtr = (PolygonItem *) itemPtr;
185 polyPtr->numPoints = 0;
186 polyPtr->pointsAllocated = 0;
187 polyPtr->coordPtr = NULL;
188 polyPtr->width = 1;
189 polyPtr->outlineColor = NULL;
190 polyPtr->outlineGC = None;
191 polyPtr->fillColor = NULL;
192 polyPtr->fillStipple = None;
193 polyPtr->fillGC = None;
194 polyPtr->smooth = 0;
195 polyPtr->splineSteps = 12;
253 PolygonItem *polyPtr = (PolygonItem *) itemPtr;
258 for (i = 0; i < 2*polyPtr->numPoints; i++) {
259 Tcl_PrintDouble(interp, polyPtr->coordPtr[i], buffer);
274 if (polyPtr->pointsAllocated <= numPoints) {
275 if (polyPtr->coordPtr != NULL) {
276 ckfree((char *) polyPtr->coordPtr);
284 polyPtr->coordPtr = (double *) ckalloc((unsigned)
286 polyPtr->pointsAllocated = numPoints+1;
290 &polyPtr->coordPtr[i]) != TCL_OK) {
294 polyPtr->numPoints = numPoints;
300 if ((polyPtr->coordPtr[argc-2] != polyPtr->coordPtr[0])
301 || (polyPtr->coordPtr[argc-1] != polyPtr->coordPtr[1])) {
302 polyPtr->numPoints++;
303 polyPtr->coordPtr[argc] = polyPtr->coordPtr[0];
304 polyPtr->coordPtr[argc+1] = polyPtr->coordPtr[1];
306 ComputePolygonBbox(canvas, polyPtr);
340 PolygonItem *polyPtr = (PolygonItem *) itemPtr;
348 (char *) polyPtr, flags) != TCL_OK) {
357 if (polyPtr->width < 1) {
358 polyPtr->width = 1;
360 if (polyPtr->outlineColor == NULL) {
363 gcValues.foreground = polyPtr->outlineColor->pixel;
364 gcValues.line_width = polyPtr->width;
370 if (polyPtr->outlineGC != None) {
371 Tk_FreeGC(Tk_Display(tkwin), polyPtr->outlineGC);
373 polyPtr->outlineGC = newGC;
375 if (polyPtr->fillColor == NULL) {
378 gcValues.foreground = polyPtr->fillColor->pixel;
380 if (polyPtr->fillStipple != None) {
381 gcValues.stipple = polyPtr->fillStipple;
387 if (polyPtr->fillGC != None) {
388 Tk_FreeGC(Tk_Display(tkwin), polyPtr->fillGC);
390 polyPtr->fillGC = newGC;
396 if (polyPtr->splineSteps < 1) {
397 polyPtr->splineSteps = 1;
398 } else if (polyPtr->splineSteps > 100) {
399 polyPtr->splineSteps = 100;
402 ComputePolygonBbox(canvas, polyPtr);
431 PolygonItem *polyPtr = (PolygonItem *) itemPtr;
433 if (polyPtr->coordPtr != NULL) {
434 ckfree((char *) polyPtr->coordPtr);
436 if (polyPtr->fillColor != NULL) {
437 Tk_FreeColor(polyPtr->fillColor);
439 if (polyPtr->fillStipple != None) {
440 Tk_FreeBitmap(display, polyPtr->fillStipple);
442 if (polyPtr->outlineColor != NULL) {
443 Tk_FreeColor(polyPtr->outlineColor);
445 if (polyPtr->outlineGC != None) {
446 Tk_FreeGC(display, polyPtr->outlineGC);
448 if (polyPtr->fillGC != None) {
449 Tk_FreeGC(display, polyPtr->fillGC);
473 ComputePolygonBbox(canvas, polyPtr)
475 PolygonItem *polyPtr; /* Item whose bbox is to be
481 coordPtr = polyPtr->coordPtr;
482 polyPtr->header.x1 = polyPtr->header.x2 = *coordPtr;
483 polyPtr->header.y1 = polyPtr->header.y2 = coordPtr[1];
485 for (i = 1, coordPtr = polyPtr->coordPtr+2; i < polyPtr->numPoints;
487 TkIncludePoint((Tk_Item *) polyPtr, coordPtr);
496 i = (polyPtr->width+1)/2 + 1;
497 polyPtr->header.x1 -= i;
498 polyPtr->header.x2 += i;
499 polyPtr->header.y1 -= i;
500 polyPtr->header.y2 += i;
607 PolygonItem *polyPtr = (PolygonItem *) itemPtr;
609 if ((polyPtr->fillGC == None) && (polyPtr->outlineGC == None)) {
619 if ((polyPtr->fillStipple != None) && (polyPtr->fillGC != None)) {
620 Tk_CanvasSetStippleOrigin(canvas, polyPtr->fillGC);
623 if (!polyPtr->smooth) {
624 TkFillPolygon(canvas, polyPtr->coordPtr, polyPtr->numPoints,
625 display, drawable, polyPtr->fillGC, polyPtr->outlineGC);
636 numPoints = 1 + polyPtr->numPoints*polyPtr->splineSteps;
643 numPoints = TkMakeBezierCurve(canvas, polyPtr->coordPtr,
644 polyPtr->numPoints, polyPtr->splineSteps, pointPtr,
646 if (polyPtr->fillGC != None) {
647 XFillPolygon(display, drawable, polyPtr->fillGC, pointPtr,
650 if (polyPtr->outlineGC != None) {
651 XDrawLines(display, drawable, polyPtr->outlineGC, pointPtr,
658 if ((polyPtr->fillStipple != None) && (polyPtr->fillGC != None)) {
659 XSetTSOrigin(display, polyPtr->fillGC, 0, 0);
691 PolygonItem *polyPtr = (PolygonItem *) itemPtr;
696 if (!polyPtr->smooth) {
697 distance = TkPolygonToPoint(polyPtr->coordPtr, polyPtr->numPoints,
705 numPoints = 1 + polyPtr->numPoints*polyPtr->splineSteps;
712 numPoints = TkMakeBezierCurve(canvas, polyPtr->coordPtr,
713 polyPtr->numPoints, polyPtr->splineSteps, (XPoint *) NULL,
720 if (polyPtr->outlineColor != NULL) {
721 distance -= polyPtr->width/2.0;
759 PolygonItem *polyPtr = (PolygonItem *) itemPtr;
769 if (polyPtr->smooth) {
770 numPoints = 1 + polyPtr->numPoints*polyPtr->splineSteps;
777 numPoints = TkMakeBezierCurve(canvas, polyPtr->coordPtr,
778 polyPtr->numPoints, polyPtr->splineSteps, (XPoint *) NULL,
781 numPoints = polyPtr->numPoints;
782 coordPtr = polyPtr->coordPtr;
785 if (polyPtr->width <= 1) {
799 (double) polyPtr->width, CapRound, JoinRound, rectPtr);
812 halfWidth = polyPtr->width/2.0;
825 if ((coordPtr != staticSpace) && (coordPtr != polyPtr->coordPtr)) {
860 PolygonItem *polyPtr = (PolygonItem *) itemPtr;
864 for (i = 0, coordPtr = polyPtr->coordPtr; i < polyPtr->numPoints;
869 ComputePolygonBbox(canvas, polyPtr);
899 PolygonItem *polyPtr = (PolygonItem *) itemPtr;
903 for (i = 0, coordPtr = polyPtr->coordPtr; i < polyPtr->numPoints;
908 ComputePolygonBbox(canvas, polyPtr);
945 PolygonItem *polyPtr = (PolygonItem *) itemPtr;
951 if (polyPtr->fillColor != NULL) {
952 if (!polyPtr->smooth) {
953 Tk_CanvasPsPath(interp, canvas, polyPtr->coordPtr,
954 polyPtr->numPoints);
956 TkMakeBezierPostscript(interp, canvas, polyPtr->coordPtr,
957 polyPtr->numPoints);
959 if (Tk_CanvasPsColor(interp, canvas, polyPtr->fillColor) != TCL_OK) {
962 if (polyPtr->fillStipple != None) {
964 if (Tk_CanvasPsStipple(interp, canvas, polyPtr->fillStipple)
968 if (polyPtr->outlineColor != NULL) {
980 if (polyPtr->outlineColor != NULL) {
981 if (!polyPtr->smooth) {
982 Tk_CanvasPsPath(interp, canvas, polyPtr->coordPtr,
983 polyPtr->numPoints);
985 TkMakeBezierPostscript(interp, canvas, polyPtr->coordPtr,
986 polyPtr->numPoints);
989 sprintf(string, "%d setlinewidth\n", polyPtr->width);
992 if (Tk_CanvasPsColor(interp, canvas, polyPtr->outlineColor)