aboutsummaryrefslogtreecommitdiff
path: root/generic/Icon.c
diff options
context:
space:
mode:
authorlecoanet2000-05-11 13:58:17 +0000
committerlecoanet2000-05-11 13:58:17 +0000
commitf0ebc4f3affbac34920f7be557312927e6cf8a81 (patch)
tree99f96d06ee7a903c1df7793802fcf337c14d45c5 /generic/Icon.c
parent9663a916b72352db78f2d17d5268c1018904f967 (diff)
downloadtkzinc-f0ebc4f3affbac34920f7be557312927e6cf8a81.zip
tkzinc-f0ebc4f3affbac34920f7be557312927e6cf8a81.tar.gz
tkzinc-f0ebc4f3affbac34920f7be557312927e6cf8a81.tar.bz2
tkzinc-f0ebc4f3affbac34920f7be557312927e6cf8a81.tar.xz
Adaptation suite � la r�alisation des polygones multi-contours.
Diffstat (limited to 'generic/Icon.c')
-rw-r--r--generic/Icon.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/generic/Icon.c b/generic/Icon.c
index bd8c7e1..7a89753 100644
--- a/generic/Icon.c
+++ b/generic/Icon.c
@@ -669,24 +669,24 @@ GetAnchor(Item item,
*/
static ZnBool
GetClipVertices(Item item,
- ZnPoint **points,
- int *num_points)
+ ZnPoly *poly)
{
IconItem icon = (IconItem) item;
int w=0, h=0;
-
+ ZnPoint *points;
+
ZnListAssertSize(item->wi->work_pts, 2);
- *points = (ZnPoint *) ZnListArray(item->wi->work_pts);
- *num_points = 2;
if (icon->image != ZnUnspecifiedImage) {
Tk_SizeOfImage(icon->image, &w, &h);
}
else {
Tk_SizeOfBitmap(item->wi->dpy, icon->mask, &w, &h);
}
- (*points)[0] = icon->pos_dev;
- (*points)[1].x = icon->pos_dev.x + w;
- (*points)[1].y = icon->pos_dev.y + h;
+ points = (ZnPoint *) ZnListArray(item->wi->work_pts);
+ POLY_CONTOUR1(poly, points, 2);
+ points[0] = icon->pos_dev;
+ points[1].x = points[0].x + w;
+ points[1].y = points[0].y + h;
return True;
}
@@ -704,6 +704,7 @@ GetClipVertices(Item item,
*/
static int
Coords(Item item,
+ int contour,
int index,
int cmd,
ZnPoint **pts,
@@ -742,9 +743,9 @@ Coords(Item item,
*/
static ItemClassStruct ICON_ITEM_CLASS = {
sizeof(IconItemStruct),
- False,
- False,
- True,
+ False, /* has_fields */
+ False, /* has_parts */
+ True, /* has_anchors */
"icon",
icon_attrs,
Init,
@@ -752,15 +753,17 @@ static ItemClassStruct ICON_ITEM_CLASS = {
Destroy,
Configure,
Query,
- NULL,
+ NULL, /* GetFieldSet */
GetAnchor,
GetClipVertices,
Coords,
+ NULL, /* Contour */
ComputeCoordinates,
ToArea,
Draw,
IsSensitive,
Pick,
+ NULL, /* PickVertex */
PostScript
};