From: Marc Autret Date: Sun, 26 Aug 2001 23:48:50 +0000 (+0000) Subject: * src/vcg.h (struct infoname_s): New. X-Git-Tag: BISON-1_28d~18 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/3e4c37cf7b03801299f0f02d2993bbd6b710cb8a * src/vcg.h (struct infoname_s): New. (struct colorentry_s): New. (graph_s): New fields {vertical,horizontal}_order in structure. Add `infoname' field. Add `colorentry' field; * src/vcg_defaults.h (G_VERTICAL_ORDER): New. (G_HORIZONTAL_ORDER): New. (G_INFONAME): New. (G_COLORENTRY): New. * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order. Add output of `infoname'. Add output of `colorentry'. --- diff --git a/ChangeLog b/ChangeLog index d496cc37..8609b7e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2001-08-27 Marc Autret + + * src/vcg.h (struct infoname_s): New. + (struct colorentry_s): New. + (graph_s): New fields {vertical,horizontal}_order in structure. + Add `infoname' field. + Add `colorentry' field; + * src/vcg_defaults.h (G_VERTICAL_ORDER): New. + (G_HORIZONTAL_ORDER): New. + (G_INFONAME): New. + (G_COLORENTRY): New. + * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order. + Add output of `infoname'. + Add output of `colorentry'. + 2001-08-27 Marc Autret * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'. diff --git a/src/vcg.c b/src/vcg.c index 89aa50ad..b5ed817b 100644 --- a/src/vcg.c +++ b/src/vcg.c @@ -49,6 +49,9 @@ new_graph (graph_t *g) g->textmode = G_TEXTMODE; g->shape = G_SHAPE; + g->vertical_order = G_VERTICAL_ORDER; + g->horizontal_order = G_HORIZONTAL_ORDER; + g->xmax = G_XMAX; /* Not output. */ g->ymax = G_YMAX; /* Not output. */ @@ -667,6 +670,11 @@ output_graph (graph_t *graph, struct obstack *os) if (graph->shape != G_SHAPE) obstack_fgrow1 (os, "\tshape:\t%s\n", get_shape_str (graph->shape)); + + if (graph->vertical_order != G_VERTICAL_ORDER) + obstack_fgrow1 (os, "\tvertical_order:\t%d\n", graph->vertical_order); + if (graph->horizontal_order != G_HORIZONTAL_ORDER) + obstack_fgrow1 (os, "\thorizontal_order:\t%d\n", graph->horizontal_order); if (graph->xmax != G_XMAX) obstack_fgrow1 (os, "\txmax:\t%d\n", graph->xmax); @@ -703,6 +711,30 @@ output_graph (graph_t *graph, struct obstack *os) obstack_fgrow2 (os, "\tclassname %d :\t%s\n", ite->no, ite->name); } + if (graph->infoname != G_INFONAME) + { + struct infoname_s *ite; + + for (ite = graph->infoname; ite; ite = ite->next) + obstack_fgrow2 (os, "\tinfoname %d :\t%s\n", ite->integer, ite->string); + } + + if (graph->colorentry != G_COLORENTRY) + { + struct colorentry_s *ite; + char buff[64]; + + for (ite = graph->colorentry; ite; ite = ite->next) + { + sprintf (buff, "\tcolorentry %d :\t%d %d %d\n", + ite->color_index, + ite->red_cp, + ite->green_cp, + ite->blue_cp); + obstack_sgrow (os, buff); + } + } + if (graph->layoutalgorithm != G_LAYOUTALGORITHM) obstack_fgrow1 (os, "\tlayoutalgorithm:\t%s\n", get_layoutalgorithm_str(graph->layoutalgorithm)); diff --git a/src/vcg.h b/src/vcg.h index d92559a1..2df5e4e4 100644 --- a/src/vcg.h +++ b/src/vcg.h @@ -75,6 +75,16 @@ enum shape_e triangle }; +/* Structure for colorentries. */ +struct colorentry_s +{ + int color_index; + int red_cp; + int green_cp; + int blue_cp; + struct colorentry_s *next; +}; + /* Structure to construct lists of classnames. */ struct classname_s { @@ -83,6 +93,14 @@ struct classname_s struct classname_s *next; /* next name class association. */ }; +/* Structure is in infoname. */ +struct infoname_s +{ + int integer; + char *string; + struct infoname_s *next; +}; + /* Layout Algorithms which can be found in VCG. Details about each algoithm can be found below. */ enum layoutalgorithm_e @@ -559,7 +577,22 @@ struct graph_s Defalut is box, other: rhomb, ellipse, triangle. */ enum shape_e shape; - /* FIXME {vertival,horizontal}_order */ + /* Vertical order is the level position (rank) of the summary node of an + inner subgraph, if this subgraph is folded. We can also specify + level: int. The level is only recognized, if an automatical layout is + calculated. */ + int vertical_order; + + /* Horizontal order is the horizontal position of the summary node within + a level. The nodes which are specified with horizontal positions are + ordered according to these positions within the levels. The nodes which + do not have this attribute are inserted into this ordering by the + crossing reduction mechanism. Note that connected components are + handled separately, thus it is not possible to intermix such components + by specifying a horizontal order. If the algorithm for downward laid + out trees is used, the horizontal order influences only the order of + the child nodes at a node, but not the order of the whole level. */ + int horizontal_order; /* xmax, ymax specify the maximal size of the virtual window that is used to display the graph. This is usually larger than the displayed @@ -630,8 +663,19 @@ struct graph_s By default, no class names. */ struct classname_s *classname; - /* FIXME : infoname. */ - /* FIXME : colorentry. */ + /* Infoname allows to introduce names for the additional text labels. + The names are used in the menus. + Infoname is given by an integer and a string. + The default value is NULL. */ + struct infoname_s *infoname; + + /* Colorentry allows to fill the color map. A color is a triplet of integer + values for the red/green/blue-part. Each integer is between 0 (off) and + 255 (on), e.g., 0 0 0 is black and 255 255 255 is white. For instance + colorentry 75 : 70 130 180 sets the map entry 75 to steel blue. This + color can be used by specifying just the number 75. + Default id NULL. */ + struct colorentry_s *colorentry; /* layoutalgorithm chooses different graph layout algorithms Possibilities are maxdepth, mindepth, maxdepthslow, mindepthslow, diff --git a/src/vcg_defaults.h b/src/vcg_defaults.h index d40acf43..61a60b84 100644 --- a/src/vcg_defaults.h +++ b/src/vcg_defaults.h @@ -47,8 +47,11 @@ # define G_TEXTMODE centered # define G_SHAPE box -# define G_XMAX 90 /* Not output */ -# define G_YMAX 90 /* Not output */ +# define G_VERTICAL_ORDER 0 /* Unspecified for subgraphs. */ +# define G_HORIZONTAL_ORDER 0 /* Unspecified for subgraphs. */ + +# define G_XMAX 90 /* Not output */ +# define G_YMAX 90 /* Not output */ # define G_XBASE 5 # define G_YBASE 5 @@ -61,9 +64,12 @@ # define G_YRASTER 1 # define G_XLRASTER 1 -# define G_HIDDEN -1 /* No default value. */ +# define G_HIDDEN -1 /* No default value. */ + +# define G_CLASSNAME NULL /* No class name association */ +# define G_INFONAME NULL +# define G_COLORENTRY NULL -# define G_CLASSNAME NULL /* No class name association */ # define G_LAYOUTALGORITHM normal # define G_LAYOUT_DOWNFACTOR 1 # define G_LAYOUT_UPFACTOR 1