diff options
Diffstat (limited to 'generic/Tabular.c')
-rw-r--r-- | generic/Tabular.c | 150 |
1 files changed, 75 insertions, 75 deletions
diff --git a/generic/Tabular.c b/generic/Tabular.c index 9f71c56..0385203 100644 --- a/generic/Tabular.c +++ b/generic/Tabular.c @@ -48,49 +48,49 @@ typedef struct _TabularItemStruct { ItemStruct header; /* Public data */ - RadarPoint pos; - RadarAnchor anchor; - RadarAnchor connection_anchor; + ZnPoint pos; + ZnAnchor anchor; + ZnAnchor connection_anchor; /* Private data */ FieldSetStruct field_set; } TabularItemStruct, *TabularItem; -static RadarAttrConfig tabular_attrs[] = { - { RADAR_CONFIG_ANCHOR, "-anchor", NULL, - Tk_Offset(TabularItemStruct, anchor), 0, RADAR_COORDS_FLAG, False }, - { RADAR_CONFIG_BOOL, "-composerotation", NULL, +static ZnAttrConfig tabular_attrs[] = { + { ZN_CONFIG_ANCHOR, "-anchor", NULL, + Tk_Offset(TabularItemStruct, anchor), 0, ZN_COORDS_FLAG, False }, + { ZN_CONFIG_BOOL, "-composerotation", NULL, Tk_Offset(TabularItemStruct, header.flags), COMPOSE_ROTATION_BIT, - RADAR_COORDS_FLAG, False }, - { RADAR_CONFIG_BOOL, "-composescale", NULL, + ZN_COORDS_FLAG, False }, + { ZN_CONFIG_BOOL, "-composescale", NULL, Tk_Offset(TabularItemStruct, header.flags), COMPOSE_SCALE_BIT, - RADAR_COORDS_FLAG, False }, - { RADAR_CONFIG_ITEM, "-connecteditem", NULL, + ZN_COORDS_FLAG, False }, + { ZN_CONFIG_ITEM, "-connecteditem", NULL, Tk_Offset(TabularItemStruct, header.connected_item), 0, - RADAR_COORDS_FLAG|RADAR_ITEM_FLAG, False }, - { RADAR_CONFIG_ANCHOR, "-connectionanchor", NULL, - Tk_Offset(TabularItemStruct, connection_anchor), 0, RADAR_COORDS_FLAG, False }, - { RADAR_CONFIG_LABEL_FORMAT, "-labelformat", NULL, + ZN_COORDS_FLAG|ZN_ITEM_FLAG, False }, + { ZN_CONFIG_ANCHOR, "-connectionanchor", NULL, + Tk_Offset(TabularItemStruct, connection_anchor), 0, ZN_COORDS_FLAG, False }, + { ZN_CONFIG_LABEL_FORMAT, "-labelformat", NULL, Tk_Offset(TabularItemStruct, field_set.label_format), 0, - RADAR_COORDS_FLAG|RADAR_CLFC_FLAG, False }, - { RADAR_CONFIG_UINT, "-numfields", NULL, + ZN_COORDS_FLAG|ZN_CLFC_FLAG, False }, + { ZN_CONFIG_UINT, "-numfields", NULL, Tk_Offset(TabularItemStruct, field_set.num_fields), 0, 0, True }, - { RADAR_CONFIG_POINT, "-position", NULL, - Tk_Offset(TabularItemStruct, pos), 0, RADAR_COORDS_FLAG, False}, - { RADAR_CONFIG_PRI, "-priority", NULL, + { ZN_CONFIG_POINT, "-position", NULL, + Tk_Offset(TabularItemStruct, pos), 0, ZN_COORDS_FLAG, False}, + { ZN_CONFIG_PRI, "-priority", NULL, Tk_Offset(TabularItemStruct, 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(TabularItemStruct, header.flags), SENSITIVE_BIT, - RADAR_REPICK_FLAG, False }, - { RADAR_CONFIG_TAGS, "-tags", NULL, + ZN_REPICK_FLAG, False }, + { ZN_CONFIG_TAGS, "-tags", NULL, Tk_Offset(TabularItemStruct, header.tags), 0, 0, False }, - { RADAR_CONFIG_BOOL, "-visible", NULL, + { ZN_CONFIG_BOOL, "-visible", NULL, Tk_Offset(TabularItemStruct, 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 } }; @@ -117,8 +117,8 @@ Init(Item item, SET(item->flags, COMPOSE_SCALE_BIT); SET(item->flags, COMPOSE_ROTATION_BIT); - tab->anchor = RadarAnchorNW; - tab->connection_anchor = RadarAnchorSW; + tab->anchor = ZnAnchorNW; + tab->connection_anchor = ZnAnchorSW; tab->pos.x = tab->pos.y = 0.0; field_set->wi = wi; @@ -128,19 +128,19 @@ Init(Item item, * Then try to see if some fields are needed. */ if ((*argc > 0) && (LangString((*args)[0])[0] != '-') && - (Tcl_GetInt(wi->interp, (args[0])[0], &field_set->num_fields) != RADAR_ERROR)) { + (Tcl_GetInt(wi->interp, (args[0])[0], &field_set->num_fields) != ZN_ERROR)) { *args += 1; *argc -= 1; ITEM_P.InitFields(field_set); } else { Tcl_AppendResult(wi->interp, " number of fields expected", NULL); - return RADAR_ERROR; + return ZN_ERROR; } item->part_sensitive = 0; - return RADAR_OK; + return ZN_OK; } @@ -182,21 +182,21 @@ Destroy(Item item) static int Configure(Item item, int argc, - RadarAttrList argv, + ZnAttrList argv, int *flags) { - Item old_connected; + Item old_connected; old_connected = item->connected_item; - 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 (ISSET(*flags, RADAR_ITEM_FLAG)) { + if (ISSET(*flags, ZN_ITEM_FLAG)) { /* * If the new connected item is not appropriate back up * to the old one. */ - if ((item->connected_item == RADAR_NO_ITEM) || + if ((item->connected_item == ZN_NO_ITEM) || (item->connected_item->class->has_anchors && (item->parent == item->connected_item->parent))) { ITEM.UpdateItemDependency(item, old_connected); @@ -206,7 +206,7 @@ Configure(Item item, } } - return RADAR_OK; + return ZN_OK; } @@ -220,13 +220,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; } @@ -239,12 +239,12 @@ Query(Item item, */ static void ComputeCoordinates(Item item, - RadarBool force) + ZnBool force) { TabularItem tab = (TabularItem) item; WidgetInfo *wi = item->wi; FieldSet field_set = &tab->field_set; - RadarDim width, height; + ZnDim width, height; ResetBBox(&item->item_bounding_box); if (field_set->label_format) { @@ -254,13 +254,13 @@ ComputeCoordinates(Item item, * The connected item support anchors, this is checked by * configure. */ - if (item->connected_item != RADAR_NO_ITEM) { + if (item->connected_item != ZN_NO_ITEM) { item->connected_item->class->GetAnchor(item->connected_item, tab->connection_anchor, &field_set->label_pos); } else { - RadarTransformPoint(wi->current_transfo, &tab->pos, + ZnTransformPoint(wi->current_transfo, &tab->pos, &field_set->label_pos); } @@ -292,11 +292,11 @@ 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) { return ITEM_P.FieldsToArea(&((TabularItem) item)->field_set, area); } @@ -323,12 +323,12 @@ Draw(Item item) * ********************************************************************************** */ -static RadarBool +static ZnBool IsSensitive(Item item, int item_part) { if (ISCLEAR(item->flags, SENSITIVE_BIT) || - !item->parent->class->IsSensitive(item->parent, RADAR_NO_PART)) { + !item->parent->class->IsSensitive(item->parent, ZN_NO_PART)) { return False; } return ITEM_P.IsFieldSensitive(&((TabularItem) item)->field_set, item_part); @@ -345,7 +345,7 @@ IsSensitive(Item item, */ static double Pick(Item item, - RadarPoint *p, + ZnPoint *p, Item start_item, int aperture, Item *a_item, @@ -400,11 +400,11 @@ GetFieldSet(Item item) */ static void GetAnchor(Item item, - RadarAnchor anchor, - RadarPoint *p) + ZnAnchor anchor, + ZnPoint *p) { FieldSet field_set = &((TabularItem) item)->field_set; - RadarDim width, height; + ZnDim width, height; if (field_set->label_format) { ITEM_P.GetLabelBBox(field_set, &width, &height); @@ -424,21 +424,21 @@ GetAnchor(Item item, * ********************************************************************************** */ -static RadarBool -GetClipVertices(Item item, - RadarPoint **points, - int *num_points) +static ZnBool +GetClipVertices(Item item, + ZnPoint **points, + int *num_points) { FieldSet field_set = &((TabularItem) item)->field_set; - RadarDim width, height; + ZnDim width, height; *points = NULL; *num_points = 0; if (field_set->label_format) { ITEM_P.GetLabelBBox(field_set, &width, &height); - RadarListAssertSize(item->wi->work_pts, 2); - *points = (RadarPoint *) RadarListArray(item->wi->work_pts); + ZnListAssertSize(item->wi->work_pts, 2); + *points = (ZnPoint *) ZnListArray(item->wi->work_pts); *num_points = 2; (*points)[0] = field_set->label_pos; (*points)[1].x = field_set->label_pos.x + width; @@ -460,33 +460,33 @@ GetClipVertices(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) { TabularItem tabular = (TabularItem) item; if ((cmd == COORDS_ADD) || (cmd == COORDS_ADD_LAST) || (cmd == COORDS_REMOVE)) { Tcl_AppendResult(item->wi->interp, " tabulars 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 tabulars", NULL); - return RADAR_ERROR; + return ZN_ERROR; } tabular->pos = (*pts)[0]; - ITEM.Invalidate(item, RADAR_COORDS_FLAG); + ITEM.Invalidate(item, ZN_COORDS_FLAG); } else if ((cmd == COORDS_READ) || (cmd == COORDS_READ_ALL)) { *num_pts = 1; *pts = &tabular->pos; } - return RADAR_OK; + return ZN_OK; } @@ -521,4 +521,4 @@ static ItemClassStruct TABULAR_ITEM_CLASS = { PostScript }; -RadarItemClassId RadarTabular = (RadarItemClassId) &TABULAR_ITEM_CLASS; +ZnItemClassId ZnTabular = (ZnItemClassId) &TABULAR_ITEM_CLASS; |