From fc5443fb490fcb2c4eafc084db91000a08068c71 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Thu, 16 May 2002 09:38:22 +0000 Subject: Ajout de l'attribut -composealpha. Mise en correspondance des types d'attributs avec la doc. Adaptation des prototypes de ToArea et Pick pour accomoder les nouvelles fonctionalit�s des commandes de find/addtag. Suppression de la variable de classe has_fields --- generic/Triangles.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'generic/Triangles.c') diff --git a/generic/Triangles.c b/generic/Triangles.c index 70287f3..796333c 100644 --- a/generic/Triangles.c +++ b/generic/Triangles.c @@ -70,8 +70,11 @@ typedef struct _TrianglesItemStruct { static ZnAttrConfig tr_attrs[] = { - { ZN_CONFIG_GRADIENTS, "-colors", NULL, + { ZN_CONFIG_GRADIENT_LIST, "-colors", NULL, Tk_Offset(TrianglesItemStruct, colors), 0, ZN_DRAW_FLAG, False }, + { ZN_CONFIG_BOOL, "-composealpha", NULL, + Tk_Offset(TrianglesItemStruct, header.flags), COMPOSE_ALPHA_BIT, + ZN_DRAW_FLAG, False }, { ZN_CONFIG_BOOL, "-composerotation", NULL, Tk_Offset(TrianglesItemStruct, header.flags), COMPOSE_ROTATION_BIT, ZN_COORDS_FLAG, False }, @@ -86,7 +89,7 @@ static ZnAttrConfig tr_attrs[] = { { ZN_CONFIG_BOOL, "-sensitive", NULL, Tk_Offset(TrianglesItemStruct, header.flags), SENSITIVE_BIT, ZN_REPICK_FLAG, False }, - { ZN_CONFIG_TAGS, "-tags", NULL, + { ZN_CONFIG_TAG_LIST, "-tags", NULL, Tk_Offset(TrianglesItemStruct, header.tags), 0, 0, False }, { ZN_CONFIG_BOOL, "-visible", NULL, Tk_Offset(TrianglesItemStruct, header.flags), VISIBLE_BIT, @@ -120,6 +123,7 @@ Init(Item item, /* Init attributes */ SET(item->flags, VISIBLE_BIT); SET(item->flags, SENSITIVE_BIT); + SET(item->flags, COMPOSE_ALPHA_BIT); SET(item->flags, COMPOSE_ROTATION_BIT); SET(item->flags, COMPOSE_SCALE_BIT); item->priority = DEFAULT_TRIANGLES_PRIORITY; @@ -339,14 +343,12 @@ ComputeCoordinates(Item item, */ static int ToArea(Item item, - ZnBBox *area, - Tk_Uid tag_uid, - int enclosed, - ZnBool report) + ZnToArea ta) { TrianglesItem tr = (TrianglesItem) item; ZnPoint *points; int i, num_points, result=-1, result2; + ZnBBox *area = ta->area; if (tr->dev_points.num_strips == 0) { return -1; @@ -537,15 +539,11 @@ IsSensitive(Item item, */ static double Pick(Item item, - ZnPoint *p, - Item start_item, - int aperture, - Item *a_item, - int *part) + ZnPick ps) { TrianglesItem tr = (TrianglesItem) item; double dist=1.0e40, new_dist; - ZnPoint *points; + ZnPoint *points, *p = ps->point; int i, num_points; if (tr->dev_points.num_strips == 0) { @@ -864,7 +862,6 @@ PickVertex(Item item, */ static ItemClassStruct TRIANGLES_ITEM_CLASS = { sizeof(TrianglesItemStruct), - False, /* has_fields */ 0, /* num_parts */ False, /* has_anchors */ "triangles", -- cgit v1.1