aboutsummaryrefslogtreecommitdiff
path: root/generic/Map.c
diff options
context:
space:
mode:
authorlecoanet2004-04-30 14:30:39 +0000
committerlecoanet2004-04-30 14:30:39 +0000
commitc0954ffdeaa238c9e1b9c8d2f663b924aa915f7a (patch)
tree01e630ca471150e741ffd071b6390020b28bd5a7 /generic/Map.c
parent6af3a9f6836908d3b57405fa20fcc711482766ea (diff)
downloadtkzinc-c0954ffdeaa238c9e1b9c8d2f663b924aa915f7a.zip
tkzinc-c0954ffdeaa238c9e1b9c8d2f663b924aa915f7a.tar.gz
tkzinc-c0954ffdeaa238c9e1b9c8d2f663b924aa915f7a.tar.bz2
tkzinc-c0954ffdeaa238c9e1b9c8d2f663b924aa915f7a.tar.xz
Modification of the ZnQueryAttribute signature.
Reworking of the class structure. Adaptation to use the new global variables. Casts for Windows compile. Suppressed the Coords method. Now the Coords command in tkZinc.c handle the lack of the Coords method in an item.
Diffstat (limited to 'generic/Map.c')
-rw-r--r--generic/Map.c52
1 files changed, 15 insertions, 37 deletions
diff --git a/generic/Map.c b/generic/Map.c
index 2db552b..2640ae7 100644
--- a/generic/Map.c
+++ b/generic/Map.c
@@ -440,7 +440,7 @@ Query(ZnItem item,
int argc __unused,
Tcl_Obj *CONST argv[])
{
- if (ZnQueryAttribute(item->wi, item, map_attrs, argv[0]) == TCL_ERROR) {
+ if (ZnQueryAttribute(item->wi->interp, item, map_attrs, argv[0]) == TCL_ERROR) {
return TCL_ERROR;
}
@@ -803,8 +803,8 @@ ComputeCoordinates(ZnItem item,
arc.y = (int) (center.y - radius);
arc.width = 2 * radius;
arc.height = arc.width;
- arc.angle1 = start_angle*64;
- arc.angle2 = extend*64;
+ arc.angle1 = ((unsigned short) start_angle) * 64;
+ arc.angle2 = ((unsigned short) extend) * 64;
switch (line_style) {
case ZnMapInfoLineSimple:
@@ -1031,8 +1031,8 @@ Draw(ZnItem item)
cnt = ZnListSize(map->vectors);
if (cnt) {
- ZnListAssertSize(wi->work_xpts, cnt);
- xpoints = (XPoint *) ZnListArray(wi->work_xpts);
+ ZnListAssertSize(ZnWorkXPoints, cnt);
+ xpoints = (XPoint *) ZnListArray(ZnWorkXPoints);
points = (ZnPoint *) ZnListArray(map->vectors);
for (i = 0; i < cnt; i++) {
xpoints[i].x = (int) points[i].x;
@@ -1328,7 +1328,8 @@ Render(ZnItem item)
unsigned int i, cnt;
int w, h;
XColor *color;
- ZnDim line_width, new_width;
+ GLfloat line_width;
+ ZnDim new_width;
unsigned short alpha;
if (!map->map_info) {
@@ -1364,7 +1365,7 @@ Render(ZnItem item)
ZnMapInfoGetLine(map_info, i/2, NULL, NULL, &new_width, NULL,
NULL, NULL, NULL);
if (new_width != line_width) {
- line_width = new_width;
+ line_width = (GLfloat)new_width;
glLineWidth(line_width);
}
glVertex2d(points[i].x, points[i].y);
@@ -1385,7 +1386,7 @@ Render(ZnItem item)
ZnMapInfoGetLine(map_info, i/2, NULL, NULL, &new_width, NULL,
NULL, NULL, NULL);
if (new_width != line_width) {
- line_width = new_width;
+ line_width = (GLfloat)new_width;
glLineWidth(line_width);
}
glVertex2d(points[i].x, points[i].y);
@@ -1407,7 +1408,7 @@ Render(ZnItem item)
ZnMapInfoGetLine(map_info, i/2, NULL, NULL, &new_width, NULL,
NULL, NULL, NULL);
if (new_width != line_width) {
- line_width = new_width;
+ line_width = (GLfloat)new_width;
glLineWidth(line_width);
}
glVertex2d(points[i].x, points[i].y);
@@ -1429,7 +1430,7 @@ Render(ZnItem item)
ZnMapInfoGetLine(map_info, i/2, NULL, NULL, &new_width, NULL,
NULL, NULL, NULL);
if (new_width != line_width) {
- line_width = new_width;
+ line_width = (GLfloat)new_width;
glLineWidth(line_width);
}
glVertex2d(points[i].x, points[i].y);
@@ -1563,29 +1564,6 @@ Pick(ZnItem item __unused,
/*
**********************************************************************************
*
- * Coords --
- * Nothing to do for maps (or too complex anyway).
- *
- **********************************************************************************
- */
-static int
-Coords(ZnItem item,
- int contour __unused,
- int index __unused,
- int cmd __unused,
- ZnPoint **pts __unused,
- char **controls __unused,
- unsigned int *num_pts __unused)
-{
- Tcl_AppendResult(item->wi->interp,
- " maps doesn't support the coords command", NULL);
- return TCL_ERROR;
-}
-
-
-/*
- **********************************************************************************
- *
* PostScript --
*
**********************************************************************************
@@ -1606,11 +1584,11 @@ PostScript(ZnItem item __unused,
*/
static ZnItemClassStruct MAP_ITEM_CLASS = {
- sizeof(MapItemStruct),
- 0, /* num_parts */
- False, /* has_anchors */
"map",
+ sizeof(MapItemStruct),
map_attrs,
+ 0, /* num_parts */
+ 0, /* flags */
-1,
Init,
Clone,
@@ -1621,7 +1599,7 @@ static ZnItemClassStruct MAP_ITEM_CLASS = {
NULL, /* GetAnchor */
NULL, /* GetClipVertices */
NULL, /* GetContours */
- Coords,
+ NULL,
NULL, /* InsertChars */
NULL, /* DeleteChars */
NULL, /* Cursor */