Import Tk 8.6.11
This commit is contained in:
@@ -406,7 +406,7 @@ LineCoords(
|
||||
|
||||
numPoints = objc/2;
|
||||
if (linePtr->numPoints != numPoints) {
|
||||
coordPtr = ckalloc(sizeof(double) * objc);
|
||||
coordPtr = (double *)ckalloc(sizeof(double) * objc);
|
||||
if (linePtr->coordPtr != NULL) {
|
||||
ckfree(linePtr->coordPtr);
|
||||
}
|
||||
@@ -602,7 +602,7 @@ ConfigureLine(
|
||||
|
||||
static void
|
||||
DeleteLine(
|
||||
Tk_Canvas canvas, /* Info about overall canvas widget. */
|
||||
TCL_UNUSED(Tk_Canvas), /* Info about overall canvas widget. */
|
||||
Tk_Item *itemPtr, /* Item that is being deleted. */
|
||||
Display *display) /* Display containing window for canvas. */
|
||||
{
|
||||
@@ -706,7 +706,7 @@ ComputeLineBbox(
|
||||
|
||||
tsoffset = &linePtr->outline.tsoffset;
|
||||
if (tsoffset->flags & TK_OFFSET_INDEX) {
|
||||
double *coordPtr = linePtr->coordPtr
|
||||
coordPtr = linePtr->coordPtr
|
||||
+ (tsoffset->flags & ~TK_OFFSET_INDEX);
|
||||
|
||||
if (tsoffset->flags <= 0) {
|
||||
@@ -830,9 +830,10 @@ DisplayLine(
|
||||
Tk_Item *itemPtr, /* Item to be displayed. */
|
||||
Display *display, /* Display on which to draw item. */
|
||||
Drawable drawable, /* Pixmap or window in which to draw item. */
|
||||
int x, int y, int width, int height)
|
||||
/* Describes region of canvas that must be
|
||||
* redisplayed (not used). */
|
||||
TCL_UNUSED(int), /* Describes region of canvas that must be */
|
||||
TCL_UNUSED(int), /* redisplayed (not used). */
|
||||
TCL_UNUSED(int),
|
||||
TCL_UNUSED(int))
|
||||
{
|
||||
LineItem *linePtr = (LineItem *) itemPtr;
|
||||
XPoint staticPoints[MAX_STATIC_POINTS*3];
|
||||
@@ -875,7 +876,7 @@ DisplayLine(
|
||||
if (numPoints <= MAX_STATIC_POINTS) {
|
||||
pointPtr = staticPoints;
|
||||
} else {
|
||||
pointPtr = ckalloc(numPoints * 3 * sizeof(XPoint));
|
||||
pointPtr = (XPoint *)ckalloc(numPoints * 3 * sizeof(XPoint));
|
||||
}
|
||||
|
||||
if ((linePtr->smooth) && (linePtr->numPoints > 2)) {
|
||||
@@ -984,7 +985,7 @@ LineInsert(
|
||||
linePtr->coordPtr[length-2] = linePtr->lastArrowPtr[0];
|
||||
linePtr->coordPtr[length-1] = linePtr->lastArrowPtr[1];
|
||||
}
|
||||
newCoordPtr = ckalloc(sizeof(double) * (length + objc));
|
||||
newCoordPtr = (double *)ckalloc(sizeof(double) * (length + objc));
|
||||
for (i=0; i<beforeThis; i++) {
|
||||
newCoordPtr[i] = linePtr->coordPtr[i];
|
||||
}
|
||||
@@ -1319,7 +1320,6 @@ LineDeleteCoords(
|
||||
*--------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* ARGSUSED */
|
||||
static double
|
||||
LineToPoint(
|
||||
Tk_Canvas canvas, /* Canvas containing item. */
|
||||
@@ -1365,7 +1365,7 @@ LineToPoint(
|
||||
if (numPoints <= MAX_STATIC_POINTS) {
|
||||
linePoints = staticSpace;
|
||||
} else {
|
||||
linePoints = ckalloc(2 * numPoints * sizeof(double));
|
||||
linePoints = (double *)ckalloc(2 * numPoints * sizeof(double));
|
||||
}
|
||||
numPoints = linePtr->smooth->coordProc(canvas, linePtr->coordPtr,
|
||||
linePtr->numPoints, linePtr->splineSteps, NULL, linePoints);
|
||||
@@ -1547,7 +1547,6 @@ LineToPoint(
|
||||
*--------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
LineToArea(
|
||||
Tk_Canvas canvas, /* Canvas containing item. */
|
||||
@@ -1600,7 +1599,7 @@ LineToArea(
|
||||
if (numPoints <= MAX_STATIC_POINTS) {
|
||||
linePoints = staticSpace;
|
||||
} else {
|
||||
linePoints = ckalloc(2 * numPoints * sizeof(double));
|
||||
linePoints = (double *)ckalloc(2 * numPoints * sizeof(double));
|
||||
}
|
||||
numPoints = linePtr->smooth->coordProc(canvas, linePtr->coordPtr,
|
||||
linePtr->numPoints, linePtr->splineSteps, NULL, linePoints);
|
||||
@@ -1695,8 +1694,6 @@ ScaleLine(
|
||||
linePtr->firstArrowPtr = NULL;
|
||||
}
|
||||
if (linePtr->lastArrowPtr != NULL) {
|
||||
int i;
|
||||
|
||||
i = 2*(linePtr->numPoints-1);
|
||||
linePtr->coordPtr[i] = linePtr->lastArrowPtr[0];
|
||||
linePtr->coordPtr[i+1] = linePtr->lastArrowPtr[1];
|
||||
@@ -1873,12 +1870,11 @@ TranslateLine(
|
||||
*--------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
ParseArrowShape(
|
||||
ClientData clientData, /* Not used. */
|
||||
TCL_UNUSED(void *), /* Not used. */
|
||||
Tcl_Interp *interp, /* Used for error reporting. */
|
||||
Tk_Window tkwin, /* Not used. */
|
||||
TCL_UNUSED(Tk_Window), /* Not used. */
|
||||
const char *value, /* Textual specification of arrow shape. */
|
||||
char *recordPtr, /* Pointer to item record in which to store
|
||||
* arrow information. */
|
||||
@@ -1942,19 +1938,18 @@ ParseArrowShape(
|
||||
*--------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* ARGSUSED */
|
||||
static const char *
|
||||
PrintArrowShape(
|
||||
ClientData clientData, /* Not used. */
|
||||
Tk_Window tkwin, /* Window associated with linePtr's widget. */
|
||||
TCL_UNUSED(void *), /* Not used. */
|
||||
TCL_UNUSED(Tk_Window), /* Window associated with linePtr's widget. */
|
||||
char *recordPtr, /* Pointer to item record containing current
|
||||
* shape information. */
|
||||
int offset, /* Offset of arrow information in record. */
|
||||
TCL_UNUSED(int), /* Offset of arrow information in record. */
|
||||
Tcl_FreeProc **freeProcPtr) /* Store address of function to call to free
|
||||
* string here. */
|
||||
{
|
||||
LineItem *linePtr = (LineItem *) recordPtr;
|
||||
char *buffer = ckalloc(120);
|
||||
char *buffer = (char *)ckalloc(120);
|
||||
|
||||
sprintf(buffer, "%.5g %.5g %.5g", linePtr->arrowShapeA,
|
||||
linePtr->arrowShapeB, linePtr->arrowShapeC);
|
||||
@@ -1982,17 +1977,16 @@ PrintArrowShape(
|
||||
|
||||
static int
|
||||
ArrowParseProc(
|
||||
ClientData clientData, /* some flags.*/
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Used for reporting errors. */
|
||||
Tk_Window tkwin, /* Window containing canvas widget. */
|
||||
TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */
|
||||
const char *value, /* Value of option. */
|
||||
char *widgRec, /* Pointer to record for item. */
|
||||
int offset) /* Offset into item. */
|
||||
{
|
||||
int c;
|
||||
size_t length;
|
||||
|
||||
register Arrows *arrowPtr = (Arrows *) (widgRec + offset);
|
||||
Arrows *arrowPtr = (Arrows *) (widgRec + offset);
|
||||
|
||||
if (value == NULL || *value == 0) {
|
||||
*arrowPtr = ARROWS_NONE;
|
||||
@@ -2050,15 +2044,15 @@ ArrowParseProc(
|
||||
|
||||
static const char *
|
||||
ArrowPrintProc(
|
||||
ClientData clientData, /* Ignored. */
|
||||
Tk_Window tkwin, /* Window containing canvas widget. */
|
||||
TCL_UNUSED(void *), /* Ignored. */
|
||||
TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */
|
||||
char *widgRec, /* Pointer to record for item. */
|
||||
int offset, /* Offset into item. */
|
||||
Tcl_FreeProc **freeProcPtr) /* Pointer to variable to fill in with
|
||||
TCL_UNUSED(Tcl_FreeProc **)) /* Pointer to variable to fill in with
|
||||
* information about how to reclaim storage
|
||||
* for return string. */
|
||||
{
|
||||
register Arrows *arrowPtr = (Arrows *) (widgRec + offset);
|
||||
Arrows *arrowPtr = (Arrows *) (widgRec + offset);
|
||||
|
||||
switch (*arrowPtr) {
|
||||
case ARROWS_FIRST:
|
||||
@@ -2092,7 +2086,6 @@ ArrowPrintProc(
|
||||
*--------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
ConfigureArrows(
|
||||
Tk_Canvas canvas, /* Canvas in which arrows will be displayed
|
||||
@@ -2153,7 +2146,7 @@ ConfigureArrows(
|
||||
if (linePtr->arrow != ARROWS_LAST) {
|
||||
poly = linePtr->firstArrowPtr;
|
||||
if (poly == NULL) {
|
||||
poly = ckalloc(2 * PTS_IN_ARROW * sizeof(double));
|
||||
poly = (double *)ckalloc(2 * PTS_IN_ARROW * sizeof(double));
|
||||
poly[0] = poly[10] = linePtr->coordPtr[0];
|
||||
poly[1] = poly[11] = linePtr->coordPtr[1];
|
||||
linePtr->firstArrowPtr = poly;
|
||||
@@ -2197,7 +2190,7 @@ ConfigureArrows(
|
||||
coordPtr = linePtr->coordPtr + 2*(linePtr->numPoints-2);
|
||||
poly = linePtr->lastArrowPtr;
|
||||
if (poly == NULL) {
|
||||
poly = ckalloc(2 * PTS_IN_ARROW * sizeof(double));
|
||||
poly = (double *)ckalloc(2 * PTS_IN_ARROW * sizeof(double));
|
||||
poly[0] = poly[10] = coordPtr[2];
|
||||
poly[1] = poly[11] = coordPtr[3];
|
||||
linePtr->lastArrowPtr = poly;
|
||||
@@ -2254,7 +2247,7 @@ LineToPostscript(
|
||||
Tcl_Interp *interp, /* Leave Postscript or error message here. */
|
||||
Tk_Canvas canvas, /* Information about overall canvas. */
|
||||
Tk_Item *itemPtr, /* Item for which Postscript is wanted. */
|
||||
int prepass) /* 1 means this is a prepass to collect font
|
||||
TCL_UNUSED(int)) /* 1 means this is a prepass to collect font
|
||||
* information; 0 means final Postscript is
|
||||
* being created. */
|
||||
{
|
||||
@@ -2366,7 +2359,7 @@ LineToPostscript(
|
||||
linePtr->numPoints, linePtr->splineSteps, NULL, NULL);
|
||||
pointPtr = staticPoints;
|
||||
if (numPoints > MAX_STATIC_POINTS) {
|
||||
pointPtr = ckalloc(numPoints * 2 * sizeof(double));
|
||||
pointPtr = (double *)ckalloc(numPoints * 2 * sizeof(double));
|
||||
}
|
||||
numPoints = linePtr->smooth->coordProc(canvas, linePtr->coordPtr,
|
||||
linePtr->numPoints, linePtr->splineSteps, NULL, pointPtr);
|
||||
|
||||
Reference in New Issue
Block a user