aboutsummaryrefslogtreecommitdiff
path: root/generic/Reticle.c
diff options
context:
space:
mode:
authorlecoanet2002-05-16 09:42:02 +0000
committerlecoanet2002-05-16 09:42:02 +0000
commit2b4565b7494d839819f723409cfc9668c9419ccc (patch)
treef9a7d64ae7932c0ca47c29b574fc7f6bd2bfe25f /generic/Reticle.c
parentf8c4a63cf27597af47f88363b45abfc0f869e660 (diff)
downloadtkzinc-2b4565b7494d839819f723409cfc9668c9419ccc.zip
tkzinc-2b4565b7494d839819f723409cfc9668c9419ccc.tar.gz
tkzinc-2b4565b7494d839819f723409cfc9668c9419ccc.tar.bz2
tkzinc-2b4565b7494d839819f723409cfc9668c9419ccc.tar.xz
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
Diffstat (limited to 'generic/Reticle.c')
-rw-r--r--generic/Reticle.c28
1 files 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",