From 64089dca388f5a9a8235a94b4372763875132219 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Wed, 2 Feb 2000 14:01:15 +0000 Subject: Passage en Zinc --- generic/Group.c | 309 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 154 insertions(+), 155 deletions(-) (limited to 'generic/Group.c') diff --git a/generic/Group.c b/generic/Group.c index 9e68486..8d5523d 100644 --- a/generic/Group.c +++ b/generic/Group.c @@ -31,7 +31,7 @@ #include "WidgetInfo.h" #include "Item.h" #include "Geo.h" -#include "tkRadar.h" +#include "tkZinc.h" #include #include @@ -47,32 +47,32 @@ static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ " * ********************************************************************************** */ -static RadarAttrConfig group_attrs[] = { - { RADAR_CONFIG_BOOL, "-atomic", NULL, +static ZnAttrConfig group_attrs[] = { + { ZN_CONFIG_BOOL, "-atomic", NULL, Tk_Offset(GroupItemStruct, header.flags), ATOMIC_BIT, - RADAR_REPICK_FLAG, False }, - { RADAR_CONFIG_ITEM, "-clip", NULL, + ZN_REPICK_FLAG, False }, + { ZN_CONFIG_ITEM, "-clip", NULL, Tk_Offset(GroupItemStruct, clip), 0, - RADAR_COORDS_FLAG|RADAR_ITEM_FLAG, False }, - { RADAR_CONFIG_BOOL, "-composerotation", NULL, + ZN_COORDS_FLAG|ZN_ITEM_FLAG, False }, + { ZN_CONFIG_BOOL, "-composerotation", NULL, Tk_Offset(GroupItemStruct, header.flags), COMPOSE_ROTATION_BIT, - RADAR_TRANSFO_FLAG, False }, - { RADAR_CONFIG_BOOL, "-composescale", NULL, + ZN_TRANSFO_FLAG, False }, + { ZN_CONFIG_BOOL, "-composescale", NULL, Tk_Offset(GroupItemStruct, header.flags), COMPOSE_SCALE_BIT, - RADAR_TRANSFO_FLAG, False }, - { RADAR_CONFIG_PRI, "-priority", NULL, + ZN_TRANSFO_FLAG, False }, + { ZN_CONFIG_PRI, "-priority", NULL, Tk_Offset(GroupItemStruct, header.priority), 0, - RADAR_DRAW_FLAG|RADAR_REPICK_FLAG, False }, - { RADAR_CONFIG_BOOL, "-sensitive", NULL, + ZN_DRAW_FLAG|ZN_REPICK_FLAG, False }, + { ZN_CONFIG_BOOL, "-sensitive", NULL, Tk_Offset(GroupItemStruct, header.flags), SENSITIVE_BIT, - RADAR_REPICK_FLAG, False }, - { RADAR_CONFIG_TAGS, "-tags", NULL, + ZN_REPICK_FLAG, False }, + { ZN_CONFIG_TAGS, "-tags", NULL, Tk_Offset(GroupItemStruct, header.tags), 0, 0, False }, - { RADAR_CONFIG_BOOL, "-visible", NULL, + { ZN_CONFIG_BOOL, "-visible", NULL, Tk_Offset(GroupItemStruct, header.flags), VISIBLE_BIT, - RADAR_DRAW_FLAG|RADAR_REPICK_FLAG|RADAR_VIS_FLAG, False }, + ZN_DRAW_FLAG|ZN_REPICK_FLAG|ZN_VIS_FLAG, False }, - { RADAR_CONFIG_END, NULL, NULL, 0, 0, 0 } + { ZN_CONFIG_END, NULL, NULL, 0, 0, 0 } }; @@ -90,9 +90,9 @@ Init(Item item, { GroupItem group = (GroupItem) item; - group->head = RADAR_NO_ITEM; - group->tail = RADAR_NO_ITEM; - group->clip = RADAR_NO_ITEM; + group->head = ZN_NO_ITEM; + group->tail = ZN_NO_ITEM; + group->clip = ZN_NO_ITEM; group->dependents = NULL; SET(item->flags, VISIBLE_BIT); SET(item->flags, SENSITIVE_BIT); @@ -104,7 +104,7 @@ Init(Item item, group->call_om = False; #endif - return RADAR_OK; + return ZN_OK; } @@ -119,7 +119,7 @@ static void Clone(Item item) { GroupItem group = (GroupItem) item; - RadarList dependents; + ZnList dependents; Item connected, current_item, new_item; Item *items; Tcl_HashTable mapping; @@ -127,7 +127,7 @@ Clone(Item item) int new, num_items, i; current_item = group->head; - group->head = group->tail = RADAR_NO_ITEM; + group->head = group->tail = ZN_NO_ITEM; #ifdef OM group->call_om = False; #endif @@ -140,11 +140,11 @@ Clone(Item item) * First clone all the children, and build a mapping * table if there is some attachments to relink. */ - while (current_item != RADAR_NO_ITEM) { + while (current_item != ZN_NO_ITEM) { connected = current_item->connected_item; new_item = ITEM.CloneItem(current_item); new_item->connected_item = connected; - ITEM.InsertItem(new_item, item, RADAR_NO_ITEM, True); + ITEM.InsertItem(new_item, item, ZN_NO_ITEM, True); if (dependents) { entry = Tcl_CreateHashEntry(&mapping, (char *) current_item, &new); @@ -163,12 +163,12 @@ Clone(Item item) if (dependents) { printf("rebuilding dependents\n"); group->dependents = NULL; - items = (Item *) RadarListArray(dependents); - num_items = RadarListSize(dependents); + items = (Item *) ZnListArray(dependents); + num_items = ZnListSize(dependents); for (i = 0; i < num_items; i++, items++) { entry = Tcl_FindHashEntry(&mapping, (char *) *items); if (entry == NULL) { - RadarWarning("Can't find item correspondance in Group Clone"); + ZnWarning("Can't find item correspondance in Group Clone"); abort(); } else { @@ -176,7 +176,7 @@ Clone(Item item) } entry = Tcl_FindHashEntry(&mapping, (char *) current_item->connected_item); if (entry == NULL) { - RadarWarning("Can't found item correspondance in Group Clone"); + ZnWarning("Can't found item correspondance in Group Clone"); abort(); } else { @@ -205,13 +205,13 @@ Destroy(Item item) Item current_item, next_item; current_item = group->head; - while (current_item != RADAR_NO_ITEM) { + while (current_item != ZN_NO_ITEM) { next_item = current_item->next; ITEM.DestroyItem(current_item); current_item = next_item; } if (group->dependents) { - RadarListFree(group->dependents); + ZnListFree(group->dependents); } } @@ -230,10 +230,10 @@ SetXShape(Item grp) WidgetInfo *wi = grp->wi; Item clip = ((GroupItem) grp)->clip; int i, num_pts; - RadarPos min_x, min_y, max_x, max_y; - RadarPoint *pts, *p; - RadarBool simple; - RadarDim width, height; + ZnPos min_x, min_y, max_x, max_y; + ZnPoint *pts, *p; + ZnBool simple; + ZnDim width, height; XPoint *xpts, *xp; Region reg; @@ -241,12 +241,12 @@ SetXShape(Item grp) return; } - if ((clip == RADAR_NO_ITEM) || !wi->reshape) { + if ((clip == ZN_NO_ITEM) || !wi->reshape) { /* * Reset both clip just to be sure (the application can have * changed wi->full_reshape while resetting wi->reshape). */ - XShapeCombineMask(wi->dpy, RadarWindowId(wi->win), ShapeBounding, + XShapeCombineMask(wi->dpy, ZnWindowId(wi->win), ShapeBounding, 0, 0, None, ShapeSet); XShapeCombineMask(wi->dpy, wi->real_top, ShapeBounding, 0, 0, None, ShapeSet); @@ -262,7 +262,7 @@ SetXShape(Item grp) * fit exactly the window. We may test here if a shape is currently * active and reset the mask only in this case (need a flag in wi). */ - XShapeCombineMask(wi->dpy, RadarWindowId(wi->win), ShapeBounding, + XShapeCombineMask(wi->dpy, ZnWindowId(wi->win), ShapeBounding, 0, 0, None, ShapeSet); XShapeCombineMask(wi->dpy, wi->real_top, ShapeBounding, 0, 0, None, ShapeSet); @@ -304,7 +304,7 @@ SetXShape(Item grp) } width = wi->width + 2*wi->border_width; height = wi->height + 2*wi->border_width; - xpts = (XPoint *) RadarMalloc(num_pts * sizeof(XPoint)); + xpts = (XPoint *) ZnMalloc(num_pts * sizeof(XPoint)); for (p = &pts[0], xp = xpts, i = 0; i < num_pts; i++, p++, xp++) { xp->x = (short) (p->x * width / max_x); xp->y = (short) (p->y * height / max_y); @@ -313,12 +313,12 @@ SetXShape(Item grp) * Translate it in a region and apply this region to the window. */ reg = XPolygonRegion(xpts, num_pts, EvenOddRule); - XShapeCombineMask(wi->dpy, wi->full_reshape ? RadarWindowId(wi->win) : wi->real_top, + XShapeCombineMask(wi->dpy, wi->full_reshape ? ZnWindowId(wi->win) : wi->real_top, ShapeBounding, 0, 0, None, ShapeSet); - XShapeCombineRegion(wi->dpy, wi->full_reshape ? wi->real_top : RadarWindowId(wi->win), + XShapeCombineRegion(wi->dpy, wi->full_reshape ? wi->real_top : ZnWindowId(wi->win), ShapeBounding, 0, 0, reg, ShapeSet); XDestroyRegion(reg); - RadarFree(xpts); + ZnFree(xpts); } } #endif @@ -335,34 +335,34 @@ SetXShape(Item grp) static int Configure(Item item, int argc, - RadarAttrList argv, + ZnAttrList argv, int *flags) { GroupItem group = (GroupItem) item; WidgetInfo *wi = item->wi; - if (ITEM_P.ConfigureAttributes((char *) item, -1, argc, argv, flags) == RADAR_ERROR) { - return RADAR_ERROR; + if (ITEM_P.ConfigureAttributes((char *) item, -1, argc, argv, flags) == ZN_ERROR) { + return ZN_ERROR; } /* * If the clip item changed, check if it is a legal * item type that is inside this group. */ - if (ISSET(*flags, RADAR_ITEM_FLAG)) { + if (ISSET(*flags, ZN_ITEM_FLAG)) { if (group->clip && (!group->clip->class->GetClipVertices || (group->clip->parent != item))) { - group->clip = RADAR_NO_ITEM; + group->clip = ZN_NO_ITEM; Tcl_AppendResult(wi->interp, " clip item must be a child of the group", NULL); - return RADAR_ERROR; + return ZN_ERROR; } if (!group->clip && (item == wi->top_group)) { SetXShape(item); } } - return RADAR_OK; + return ZN_OK; } @@ -376,13 +376,13 @@ Configure(Item item, static int Query(Item item, int argc, - RadarAttrList argv) + ZnAttrList argv) { - if (ITEM_P.QueryAttribute((char *) item, -1, argv[0]) == RADAR_ERROR) { - return RADAR_ERROR; + if (ITEM_P.QueryAttribute((char *) item, -1, argv[0]) == ZN_ERROR) { + return ZN_ERROR; } - return RADAR_OK; + return ZN_OK; } @@ -399,30 +399,30 @@ Query(Item item, */ static void PushClip(GroupItem group, - RadarBool set_gc) + ZnBool set_gc) { WidgetInfo *wi = ((Item) group)->wi; int i, num_c, num_pts; - RadarPoint *pts; - RadarBool simple, has_clip=False; + ZnPoint *pts; + ZnBool simple, has_clip=False; ClipState *previous_clip=NULL; Region reg; XRectangle rect; XPoint *xpts; - if ((group->clip != RADAR_NO_ITEM) && + if ((group->clip != ZN_NO_ITEM) && ((((Item) group) != wi->top_group) || !wi->reshape)) { simple = group->clip->class->GetClipVertices(group->clip, &pts, &num_pts); if (num_pts != 0) { has_clip = True; - num_c = RadarListSize(wi->clip_stack); + num_c = ZnListSize(wi->clip_stack); if (num_c != 0) { - previous_clip = (ClipState *) RadarListAt(wi->clip_stack, RadarListTail); + previous_clip = (ClipState *) ZnListAt(wi->clip_stack, ZnListTail); } - RadarListAssertSize(wi->clip_stack, num_c+1); - wi->current_clip = (ClipState *) RadarListAt(wi->clip_stack, RadarListTail); + ZnListAssertSize(wi->clip_stack, num_c+1); + wi->current_clip = (ClipState *) ZnListAt(wi->clip_stack, ZnListTail); wi->current_clip->simple = simple; /* @@ -439,13 +439,13 @@ PushClip(GroupItem group, rect.x, rect.y, rect.width, rect.height);*/ } else { - xpts = (XPoint *) RadarMalloc(num_pts * sizeof(XPoint)); + xpts = (XPoint *) ZnMalloc(num_pts * sizeof(XPoint)); for (i = 0; i < num_pts; i++) { xpts[i].x = pts[i].x; xpts[i].y = pts[i].y; } reg = XPolygonRegion(xpts, num_pts, EvenOddRule); - RadarFree(xpts); + ZnFree(xpts); } /* * Combine with previous region if any. @@ -499,16 +499,16 @@ PushClip(GroupItem group, */ static void PopClip(GroupItem group, - RadarBool set_gc) + ZnBool set_gc) { WidgetInfo *wi = ((Item) group)->wi; - if ((group->clip != RADAR_NO_ITEM) && + if ((group->clip != ZN_NO_ITEM) && ((((Item) group) != wi->top_group) || !wi->reshape)) { XDestroyRegion(wi->current_clip->region); - RadarListDelete(wi->clip_stack, RadarListTail); - if (RadarListSize(wi->clip_stack) != 0) { - wi->current_clip = (ClipState *) RadarListAt(wi->clip_stack, RadarListTail); + ZnListDelete(wi->clip_stack, ZnListTail); + if (ZnListSize(wi->clip_stack) != 0) { + wi->current_clip = (ClipState *) ZnListAt(wi->clip_stack, ZnListTail); } else { wi->current_clip = NULL; @@ -547,7 +547,7 @@ static void PushTransform(Item item) { WidgetInfo *wi; - RadarTransfo *next_t; + ZnTransfo *next_t; int num_t; if (!item->transfo && @@ -561,13 +561,13 @@ PushTransform(Item item) * combination flags. */ wi = item->wi; - num_t = RadarListSize(wi->transfo_stack); - RadarListAssertSize(wi->transfo_stack, num_t+1); - next_t = (RadarTransfo *) RadarListAt(wi->transfo_stack, num_t); + num_t = ZnListSize(wi->transfo_stack); + ZnListAssertSize(wi->transfo_stack, num_t+1); + next_t = (ZnTransfo *) ZnListAt(wi->transfo_stack, num_t); ITEM.ComposeItemTransform(item, wi->current_transfo, next_t); wi->current_transfo = next_t; /*printf("Pushing transfo for item: %d\n;", item->id); - RadarPrintTransfo(wi->current_transfo);*/ + ZnPrintTransfo(wi->current_transfo);*/ } @@ -594,11 +594,10 @@ PopTransform(Item item) * Restore the previous transform. */ wi = item->wi; - RadarListDelete(wi->transfo_stack, RadarListTail); - wi->current_transfo = (RadarTransfo *) RadarListAt(wi->transfo_stack, - RadarListTail); + ZnListDelete(wi->transfo_stack, ZnListTail); + wi->current_transfo = (ZnTransfo *) ZnListAt(wi->transfo_stack, ZnListTail); /*printf("Popping transfo for item: %d\n", item->id); - RadarPrintTransfo(wi->current_transfo);*/ + ZnPrintTransfo(wi->current_transfo);*/ } @@ -628,14 +627,14 @@ CallRegularCC(Item item) PushTransform(item); /*printf("calling cc on regular item %d\n", item->id);*/ - /*RadarPrintTransfo(wi->current_transfo);*/ + /*ZnPrintTransfo(wi->current_transfo);*/ item->class->ComputeCoordinates(item, False); /* * If a current clipbox exists adjust the item * bounding box accordingly. */ if (wi->current_clip) { - RadarBBox inter; + ZnBBox inter; IntersectBBox(&item->item_bounding_box, &wi->current_clip->clip_box, &inter); item->item_bounding_box = inter; @@ -643,10 +642,10 @@ CallRegularCC(Item item) /* * Do some generic post-work in behalf of the (regular) children. */ - if (ISSET(item->inv_flags, RADAR_REPICK_FLAG)) { + if (ISSET(item->inv_flags, ZN_REPICK_FLAG)) { SET(wi->events_flags, INTERNAL_NEED_REPICK); } - if (ISSET(item->inv_flags, RADAR_COORDS_FLAG) && + if (ISSET(item->inv_flags, ZN_COORDS_FLAG) && (ISSET(item->flags, SENSITIVE_BIT) || ISSET(item->flags, VISIBLE_BIT))) { SET(wi->events_flags, INTERNAL_NEED_REPICK); @@ -666,7 +665,7 @@ CallRegularCC(Item item) static void ComputeCoordinates(Item item, - RadarBool force) + ZnBool force) { GroupItem group = (GroupItem) item; Item current_item; @@ -675,24 +674,24 @@ ComputeCoordinates(Item item, PushTransform(item); /* printf("Group.c\n"); - RadarPrintTransfo(item->wi->current_transfo); + ZnPrintTransfo(item->wi->current_transfo); printf("\n");*/ - force |= ISSET(item->inv_flags, RADAR_TRANSFO_FLAG); + force |= ISSET(item->inv_flags, ZN_TRANSFO_FLAG); /* * Clip shape is computed in the group's local * coordinates. */ - if (group->clip != RADAR_NO_ITEM) { + if (group->clip != ZN_NO_ITEM) { /* * Update the geometry of the clip item if needed. * Its bounding box will be clipped by the current * clipbox (i.e the clipbox of the group's parent). */ if (force || - ISSET(group->clip->inv_flags, RADAR_COORDS_FLAG) || - ISSET(group->clip->inv_flags, RADAR_TRANSFO_FLAG)) { + ISSET(group->clip->inv_flags, ZN_COORDS_FLAG) || + ISSET(group->clip->inv_flags, ZN_TRANSFO_FLAG)) { /*printf("calling cc on clip item %d for group %d\n", group->clip->id, item->id);*/ CallRegularCC(group->clip); @@ -709,7 +708,7 @@ ComputeCoordinates(Item item, PushClip(group, False); - for (current_item = group->head; current_item != RADAR_NO_ITEM; + for (current_item = group->head; current_item != ZN_NO_ITEM; current_item = current_item->next) { /* * Skip the clip item, it has been already updated. @@ -717,13 +716,13 @@ ComputeCoordinates(Item item, * be updated later. */ if ((current_item == group->clip) || - (current_item->connected_item != RADAR_NO_ITEM)) { + (current_item->connected_item != ZN_NO_ITEM)) { continue; } if (force || - ISSET(current_item->inv_flags, RADAR_COORDS_FLAG) || - ISSET(current_item->inv_flags, RADAR_TRANSFO_FLAG)) { - if (current_item->class != RadarGroup) { + ISSET(current_item->inv_flags, ZN_COORDS_FLAG) || + ISSET(current_item->inv_flags, ZN_TRANSFO_FLAG)) { + if (current_item->class != ZnGroup) { /*printf("calling cc on item %d\n", current_item->id);*/ CallRegularCC(current_item); } @@ -739,13 +738,13 @@ ComputeCoordinates(Item item, * items can be concerned. */ if (group->dependents) { - num_deps = RadarListSize(group->dependents); - deps = (Item *) RadarListArray(group->dependents); + num_deps = ZnListSize(group->dependents); + deps = (Item *) ZnListArray(group->dependents); for (i = 0; i < num_deps; i++) { current_item = deps[i]; if (force || - ISSET(current_item->inv_flags, RADAR_COORDS_FLAG) || - ISSET(current_item->inv_flags, RADAR_TRANSFO_FLAG) || + ISSET(current_item->inv_flags, ZN_COORDS_FLAG) || + ISSET(current_item->inv_flags, ZN_TRANSFO_FLAG) || ISSET(current_item->connected_item->flags, UPDATE_DEPENDENT_BIT)) { /*printf("Updating dependent: %d\n", current_item->id);*/ CallRegularCC(current_item); @@ -764,7 +763,7 @@ ComputeCoordinates(Item item, */ ResetBBox(&item->item_bounding_box); current_item = group->head; - while (current_item != RADAR_NO_ITEM) { + while (current_item != ZN_NO_ITEM) { AddBBoxToBBox(&item->item_bounding_box, ¤t_item->item_bounding_box); current_item = current_item->next; } @@ -785,18 +784,18 @@ ComputeCoordinates(Item item, ********************************************************************************** */ static int -ToArea(Item item, - RadarBBox *area, - Tk_Uid tag_uid, - int enclosed, - RadarBool report) +ToArea(Item item, + ZnBBox *area, + Tk_Uid tag_uid, + int enclosed, + ZnBool report) { GroupItem group = (GroupItem) item; Item current_item; - RadarBBox enclosing, inter; + ZnBBox enclosing, inter; int result; - RadarBool outside = True; - RadarBool atomic = ISSET(item->flags, ATOMIC_BIT); + ZnBool outside = True; + ZnBool atomic = ISSET(item->flags, ATOMIC_BIT); PushTransform(item); @@ -806,7 +805,7 @@ ToArea(Item item, enclosing.corner.y = area->corner.y + 1; current_item = group->head; - while (current_item != RADAR_NO_ITEM) { + while (current_item != ZN_NO_ITEM) { if (ISCLEAR(current_item->flags, VISIBLE_BIT) && ISCLEAR(current_item->flags, SENSITIVE_BIT)) { goto cont_ta; @@ -815,7 +814,7 @@ ToArea(Item item, if (IsEmptyBBox(&inter)) { goto cont_ta; } - if (current_item->class != RadarGroup) { + if (current_item->class != ZnGroup) { PushTransform(current_item); } @@ -844,10 +843,10 @@ ToArea(Item item, } } if (!atomic && (result >= enclosed)) { - DoItem(item->wi->interp, current_item, RADAR_NO_PART, tag_uid); + DoItem(item->wi->interp, current_item, ZN_NO_PART, tag_uid); } - if (current_item->class != RadarGroup) { + if (current_item->class != ZnGroup) { PopTransform(current_item); } cont_ta: @@ -883,32 +882,32 @@ Draw(Item item) GroupItem group = (GroupItem) item; WidgetInfo *wi = item->wi; Item current_item; - RadarBBox bbox; - RadarBBox old_damaged_area; + ZnBBox bbox; + ZnBBox old_damaged_area; PushTransform(item); PushClip(group, True); - if ((group->clip != RADAR_NO_ITEM) && wi->current_clip) { + if ((group->clip != ZN_NO_ITEM) && wi->current_clip) { old_damaged_area = wi->damaged_area; IntersectBBox(&wi->damaged_area, &wi->current_clip->clip_box, &bbox); wi->damaged_area = bbox; } current_item = group->tail; - while (current_item != RADAR_NO_ITEM) { + while (current_item != ZN_NO_ITEM) { if (ISSET(current_item->flags, VISIBLE_BIT)) { IntersectBBox(&wi->damaged_area, ¤t_item->item_bounding_box, &bbox); if (!IsEmptyBBox(&bbox)) { - if (current_item->class != RadarGroup) { + if (current_item->class != ZnGroup) { PushTransform(current_item); } current_item->class->Draw(current_item); if (wi->draw_bboxes) { XGCValues values; - values.foreground = RadarPixel(wi->bbox_color); + values.foreground = ZnPixel(wi->bbox_color); values.fill_style = FillSolid; values.line_width = 1; - values.line_style = (current_item->class==RadarGroup)?LineOnOffDash:LineSolid; + values.line_style = (current_item->class==ZnGroup)?LineOnOffDash:LineSolid; XChangeGC(wi->dpy, wi->gc, GCForeground|GCLineStyle|GCLineWidth|GCFillStyle, &values); XDrawRectangle(wi->dpy, wi->draw_buffer, wi->gc, @@ -919,7 +918,7 @@ Draw(Item item) current_item->item_bounding_box.corner.y - current_item->item_bounding_box.orig.y); } - if (current_item->class != RadarGroup) { + if (current_item->class != ZnGroup) { PopTransform(current_item); } } @@ -927,7 +926,7 @@ Draw(Item item) current_item = current_item->previous; } - if ((group->clip != RADAR_NO_ITEM) && wi->current_clip) { + if ((group->clip != ZN_NO_ITEM) && wi->current_clip) { wi->damaged_area = old_damaged_area; } PopClip(group, True); @@ -942,14 +941,14 @@ Draw(Item item) * ********************************************************************************** */ -static RadarBool +static ZnBool IsSensitive(Item item, int item_part) { - RadarBool sensitive = ISSET(item->flags, SENSITIVE_BIT); + ZnBool sensitive = ISSET(item->flags, SENSITIVE_BIT); Item parent = item->parent; - while (sensitive && (parent != RADAR_NO_ITEM)) { + while (sensitive && (parent != ZN_NO_ITEM)) { sensitive &= ISSET(item->flags, SENSITIVE_BIT); parent = parent->parent; } @@ -969,7 +968,7 @@ IsSensitive(Item item, * Results: * The return value is the distance of the picked item/part if one * has been found or a really big distance if not. a_item and a_part - * are set to point the picked item/part or to RADAR_NO_ITEM/RADAR_NO_PART. + * are set to point the picked item/part or to ZN_NO_ITEM/ZN_NO_PART. * If the group is ATOMIC, a_item points the group instead of the * actual item. * @@ -980,24 +979,24 @@ IsSensitive(Item item, */ static double Pick(Item item, - RadarPoint *p, + ZnPoint *p, Item start_item, int aperture, Item *a_item, int *a_part) { - GroupItem group = (GroupItem) item; - Item p_item, current_item; - WidgetInfo *wi = item->wi; - int p_part; - double dist, best = 1e10; - RadarBBox bbox, inter; - RadarBool in_depth; + GroupItem group = (GroupItem) item; + Item p_item, current_item; + WidgetInfo *wi = item->wi; + int p_part; + double dist, best = 1e10; + ZnBBox bbox, inter; + ZnBool in_depth; - *a_item= RADAR_NO_ITEM; - *a_part = RADAR_NO_PART; + *a_item= ZN_NO_ITEM; + *a_part = ZN_NO_PART; - if (group->head == RADAR_NO_ITEM) { + if (group->head == ZN_NO_ITEM) { return best; } @@ -1016,13 +1015,13 @@ Pick(Item item, } } - if ((start_item == RADAR_NO_ITEM) || (start_item->parent == item)) { + if ((start_item == ZN_NO_ITEM) || (start_item->parent == item)) { in_depth = False; } else { in_depth = True; } - if ((start_item == RADAR_NO_ITEM) || (start_item->parent != item)) { + if ((start_item == ZN_NO_ITEM) || (start_item->parent != item)) { current_item = group->head; } else { @@ -1038,13 +1037,13 @@ Pick(Item item, if (IsEmptyBBox(&inter)) { goto cont; } - if (current_item->class != RadarGroup) { + if (current_item->class != ZnGroup) { if (in_depth) { goto cont; } PushTransform(current_item); p_item = current_item; - p_part = RADAR_NO_PART; + p_part = ZN_NO_PART; dist = current_item->class->Pick(current_item, p, NULL, aperture, &p_item, &p_part); PopTransform(current_item); @@ -1071,7 +1070,7 @@ Pick(Item item, } cont: current_item = current_item->next; - } while (current_item != RADAR_NO_ITEM); + } while (current_item != ZN_NO_ITEM); out: PopClip(group, False); @@ -1091,39 +1090,39 @@ Pick(Item item, ********************************************************************************** */ static int -Coords(Item item, - int index, - int cmd, - RadarPoint **pts, - int *num_pts) +Coords(Item item, + int index, + int cmd, + ZnPoint **pts, + int *num_pts) { if ((cmd == COORDS_ADD) || (cmd == COORDS_ADD_LAST) || (cmd == COORDS_REMOVE)) { Tcl_AppendResult(item->wi->interp, " groups can't add or remove vertices", NULL); - return RADAR_ERROR; + return ZN_ERROR; } else if ((cmd == COORDS_REPLACE) || (cmd == COORDS_REPLACE_ALL)) { if (*num_pts == 0) { Tcl_AppendResult(item->wi->interp, " coords command need 1 point on groups", NULL); - return RADAR_ERROR; + return ZN_ERROR; } if (!item->transfo) { - item->transfo = RadarTransfoNew(); + item->transfo = ZnTransfoNew(); } - RadarSetTranslation(item->transfo, (*pts)[0].x, (*pts)[0].y); - ITEM.Invalidate(item, RADAR_TRANSFO_FLAG); + ZnSetTranslation(item->transfo, (*pts)[0].x, (*pts)[0].y); + ITEM.Invalidate(item, ZN_TRANSFO_FLAG); } else if ((cmd == COORDS_READ) || (cmd == COORDS_READ_ALL)) { - RadarPoint *p; + ZnPoint *p; - RadarListAssertSize(item->wi->work_pts, 1); - p = (RadarPoint *) RadarListArray(item->wi->work_pts); - RadarTransfoDecompose(item->transfo, NULL, p, NULL, NULL); + ZnListAssertSize(item->wi->work_pts, 1); + p = (ZnPoint *) ZnListArray(item->wi->work_pts); + ZnTransfoDecompose(item->transfo, NULL, p, NULL, NULL); *num_pts = 1; *pts = p; } - return RADAR_OK; + return ZN_OK; } @@ -1172,4 +1171,4 @@ static ItemClassStruct GROUP_ITEM_CLASS = { PostScript }; -RadarItemClassId RadarGroup = (RadarItemClassId) &GROUP_ITEM_CLASS; +ZnItemClassId ZnGroup = (ZnItemClassId) &GROUP_ITEM_CLASS; -- cgit v1.1