From 2b4565b7494d839819f723409cfc9668c9419ccc Mon Sep 17 00:00:00 2001 From: lecoanet Date: Thu, 16 May 2002 09:42:02 +0000 Subject: Correction des param�tres angulaires de GetCirclePoints. 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/Reticle.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/generic/Reticle.c b/generic/Reticle.c index a256588..7414e8f 100644 --- a/generic/Reticle.c +++ b/generic/Reticle.c @@ -74,6 +74,9 @@ static ZnAttrConfig reticle_attrs[] = { Tk_Offset(ReticleItemStruct, bright_line_color), 0, ZN_DRAW_FLAG, False }, { ZN_CONFIG_LINE_STYLE, "-brightlinestyle", NULL, Tk_Offset(ReticleItemStruct, bright_line_style), 0, ZN_DRAW_FLAG, False }, + { ZN_CONFIG_BOOL, "-composealpha", NULL, + Tk_Offset(ReticleItemStruct, header.flags), COMPOSE_ALPHA_BIT, + ZN_DRAW_FLAG, False }, { ZN_CONFIG_BOOL, "-composerotation", NULL, Tk_Offset(ReticleItemStruct, header.flags), COMPOSE_ROTATION_BIT, ZN_COORDS_FLAG, False }, @@ -104,7 +107,7 @@ static ZnAttrConfig reticle_attrs[] = { { ZN_CONFIG_BOOL, "-sensitive", NULL, Tk_Offset(ReticleItemStruct, header.flags), SENSITIVE_BIT, ZN_REPICK_FLAG, False }, - { ZN_CONFIG_TAGS, "-tags", NULL, + { ZN_CONFIG_TAG_LIST, "-tags", NULL, Tk_Offset(ReticleItemStruct, header.tags), 0, 0, False }, { ZN_CONFIG_BOOL, "-visible", NULL, Tk_Offset(ReticleItemStruct, header.flags), VISIBLE_BIT, @@ -131,6 +134,7 @@ Init(Item item, SET(item->flags, VISIBLE_BIT); CLEAR(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_RETICLE_PRIORITY; @@ -291,10 +295,7 @@ ComputeCoordinates(Item item, */ static int ToArea(Item item, - ZnBBox *area, - Tk_Uid tag_uid, - int enclosed, - ZnBool report) + ZnToArea ta) { return -1; } @@ -336,7 +337,7 @@ Draw(Item item) } while (radius <= radius_max_dev) { - SetLineStyle(wi, reticle->line_style); + ZnSetLineStyle(wi, reticle->line_style); values.foreground = ZnPixel(ZnGetGradientColor(reticle->line_color, 0, NULL)); values.line_width = 0; values.fill_style = FillSolid; @@ -359,7 +360,7 @@ Draw(Item item) (reticle->dev.x <= wi->damaged_area.corner.x + radius) && (reticle->dev.y >= wi->damaged_area.orig.y - radius) && (reticle->dev.y <= wi->damaged_area.corner.y + radius)) { - SetLineStyle(wi, reticle->bright_line_style); + ZnSetLineStyle(wi, reticle->bright_line_style); values.foreground = ZnPixel(ZnGetGradientColor(reticle->bright_line_color, 0, NULL)); values.line_width = 0; values.fill_style = FillSolid; @@ -430,10 +431,10 @@ Render(Item item) (reticle->num_circles - 1) * reticle->step_size_dev); } - genarc = GetCirclePoints(3, ZN_CIRCLE_FINEST, 0, 360, &num_p, NULL); + genarc = GetCirclePoints(3, ZN_CIRCLE_FINEST, 0, 2*M_PI, &num_p, NULL); glLineWidth(1); while (radius <= radius_max_dev) { - SetLineStyle(wi, reticle->line_style); + ZnSetLineStyle(wi, reticle->line_style); color = ZnGetGradientColor(reticle->line_color, 0, &alpha); alpha = ZnComposeAlpha(alpha, wi->alpha); glColor4us(color->red, color->green, color->blue, alpha); @@ -457,7 +458,7 @@ Render(Item item) (xo <= wi->damaged_area.corner.x + radius) && (yo >= wi->damaged_area.orig.y - radius) && (yo <= wi->damaged_area.corner.y + radius)) { - SetLineStyle(wi, reticle->bright_line_style); + ZnSetLineStyle(wi, reticle->bright_line_style); color = ZnGetGradientColor(reticle->bright_line_color, 0, &alpha); alpha = ZnComposeAlpha(alpha, wi->alpha); glColor4us(color->red, color->green, color->blue, alpha); @@ -502,11 +503,7 @@ IsSensitive(Item item, */ static double Pick(Item item, - ZnPoint *p, - Item start_item, - int aperture, - Item *a_item, - int *part) + ZnPick ps) { return 1e40; } @@ -575,7 +572,6 @@ PostScript(Item item, */ static ItemClassStruct RETICLE_ITEM_CLASS = { sizeof(ReticleItemStruct), - False, /* has_fields */ 0, /* num_parts */ False, /* has_anchors */ "reticle", -- cgit v1.1