mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-10 04:43:03 +00:00
* 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'.
This commit is contained in:
15
ChangeLog
15
ChangeLog
@@ -1,3 +1,18 @@
|
||||
2001-08-27 Marc Autret <autret_m@epita.fr>
|
||||
|
||||
* 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 <autret_m@epita.fr>
|
||||
|
||||
* src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
|
||||
|
||||
32
src/vcg.c
32
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));
|
||||
|
||||
50
src/vcg.h
50
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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user