aboutsummaryrefslogtreecommitdiff
path: root/generic/Tabular.c
diff options
context:
space:
mode:
authorlecoanet2002-05-16 09:38:22 +0000
committerlecoanet2002-05-16 09:38:22 +0000
commitfc5443fb490fcb2c4eafc084db91000a08068c71 (patch)
tree1a0ed9ebc880436b90e301d900f8d62ceb9bd39d /generic/Tabular.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/Tabular.c')
-rw-r--r--generic/Tabular.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/generic/Tabular.c b/generic/Tabular.c
index eed5c41..fa04be7 100644
--- a/generic/Tabular.c
+++ b/generic/Tabular.c
@@ -64,6 +64,9 @@ typedef struct _TabularItemStruct {
static ZnAttrConfig tabular_attrs[] = {
{ ZN_CONFIG_ANCHOR, "-anchor", NULL,
Tk_Offset(TabularItemStruct, anchor), 0, ZN_COORDS_FLAG, False },
+ { ZN_CONFIG_BOOL, "-composealpha", NULL,
+ Tk_Offset(TabularItemStruct, header.flags), COMPOSE_ALPHA_BIT,
+ ZN_DRAW_FLAG, False },
{ ZN_CONFIG_BOOL, "-composerotation", NULL,
Tk_Offset(TabularItemStruct, header.flags), COMPOSE_ROTATION_BIT,
ZN_COORDS_FLAG, False },
@@ -88,7 +91,7 @@ static ZnAttrConfig tabular_attrs[] = {
{ ZN_CONFIG_BOOL, "-sensitive", NULL,
Tk_Offset(TabularItemStruct, header.flags), SENSITIVE_BIT,
ZN_REPICK_FLAG, False },
- { ZN_CONFIG_TAGS, "-tags", NULL,
+ { ZN_CONFIG_TAG_LIST, "-tags", NULL,
Tk_Offset(TabularItemStruct, header.tags), 0, 0, False },
{ ZN_CONFIG_BOOL, "-visible", NULL,
Tk_Offset(TabularItemStruct, header.flags), VISIBLE_BIT,
@@ -118,6 +121,7 @@ Init(Item item,
SET(item->flags, VISIBLE_BIT);
SET(item->flags, SENSITIVE_BIT);
+ SET(item->flags, COMPOSE_ALPHA_BIT);
SET(item->flags, COMPOSE_SCALE_BIT);
SET(item->flags, COMPOSE_ROTATION_BIT);
@@ -159,7 +163,10 @@ Init(Item item,
static void
Clone(Item item)
{
- FIELD.CloneFields(&((TabularItem) item)->field_set);
+ FieldSet fs = &((TabularItem) item)->field_set;
+
+ FIELD.CloneFields(fs);
+ fs->item = item;
}
@@ -253,7 +260,7 @@ ComputeCoordinates(Item item,
ZnDim width, height;
ResetBBox(&item->item_bounding_box);
- if (field_set->label_format) {
+ if (field_set->label_format && field_set->num_fields) {
FIELD.GetLabelBBox(field_set, &width, &height);
/*
@@ -299,12 +306,9 @@ ComputeCoordinates(Item item,
*/
static int
ToArea(Item item,
- ZnBBox *area,
- Tk_Uid tag_uid,
- int enclosed,
- ZnBool report)
+ ZnToArea ta)
{
- return FIELD.FieldsToArea(&((TabularItem) item)->field_set, area);
+ return FIELD.FieldsToArea(&((TabularItem) item)->field_set, ta->area);
}
@@ -370,23 +374,19 @@ IsSensitive(Item item,
*/
static double
Pick(Item item,
- ZnPoint *p,
- Item start_item,
- int aperture,
- Item *a_item,
- int *part)
+ ZnPick ps)
{
int best_part;
double dist;
- dist = FIELD.FieldsPick(&((TabularItem) item)->field_set, p, &best_part);
+ dist = FIELD.FieldsPick(&((TabularItem) item)->field_set, ps->point, &best_part);
/*printf("tabular %d reporting part %d, distance %lf\n",
item->id, best_part, dist);*/
if (dist <= 0.0) {
dist = 0.0;
}
- *part = best_part;
+ ps->a_part = best_part;
return dist;
}
@@ -667,7 +667,6 @@ Selection(Item item,
*/
static ItemClassStruct TABULAR_ITEM_CLASS = {
sizeof(TabularItemStruct),
- True, /* has_fields */
0, /* num_parts */
True, /* has_anchors */
"tabular",