aboutsummaryrefslogtreecommitdiff
path: root/generic/Triangles.c
diff options
context:
space:
mode:
authorlecoanet2002-05-16 09:38:22 +0000
committerlecoanet2002-05-16 09:38:22 +0000
commitfc5443fb490fcb2c4eafc084db91000a08068c71 (patch)
tree1a0ed9ebc880436b90e301d900f8d62ceb9bd39d /generic/Triangles.c
parent86aca9024949ede1b349e78f21e077679d25b04b (diff)
downloadtkzinc-fc5443fb490fcb2c4eafc084db91000a08068c71.zip
tkzinc-fc5443fb490fcb2c4eafc084db91000a08068c71.tar.gz
tkzinc-fc5443fb490fcb2c4eafc084db91000a08068c71.tar.bz2
tkzinc-fc5443fb490fcb2c4eafc084db91000a08068c71.tar.xz
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
Diffstat (limited to 'generic/Triangles.c')
-rw-r--r--generic/Triangles.c23
1 files changed, 10 insertions, 13 deletions
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",