/* Perform layout and cleanup */
gvLayoutJobs(Gvc, G); /* take layout engine from command line */
gvFreeLayout(Gvc, G);
-
- /* Delete graph */
- agclose(G);
}
- } else {
+ }
+ else if ((G = gvPluginsGraph(Gvc))) {
+ gvLayoutJobs(Gvc, G); /* take layout engine from command line */
+ gvRenderJobs(Gvc, G);
+ }
+ else {
while ((G = gvNextInputGraph(Gvc))) {
if (prev) {
gvFreeLayout(Gvc, prev);
-lv - Use external library 'v'\n\
-ofile - Write output to 'file'\n\
-O - Automatically generate an output filename based on the input filename with a .'format' appended. (Causes all -ofile options to be ignored.) \n\
+ -P - Internally generate a graph of the current plugins. \n\
-q[l] - Set level of message suppression (=1)\n\
-s[v] - Scale input by 'v' (=72)\n\
-y - Invert y coordinate in output\n";
sym->fixed = 1;
}
+static void gvg_init(GVC_t *gvc, graph_t *g, char *fn, int gidx)
+{
+ GVG_t *gvg;
+
+ gvg = zmalloc(sizeof(GVG_t));
+ if (!gvc->gvgs)
+ gvc->gvgs = gvg;
+ else
+ gvc->gvg->next = gvg;
+ gvc->gvg = gvg;
+ gvg->gvc = gvc;
+ gvg->g = g;
+ gvg->input_filename = fn;
+ gvg->graph_index = gidx;
+}
+
+static graph_t *P_graph;
+
+graph_t *gvPluginsGraph(GVC_t *gvc)
+{
+ gvg_init(gvc, P_graph, "<internal>", 0);
+ return P_graph;
+}
+
void dotneato_args_initialize(GVC_t * gvc, int argc, char **argv)
{
char c;
exit(1);
}
break;
+ case 'P':
+ P_graph = gvplugin_graph(gvc);
+ break;
case 'V':
fprintf(stderr, "%s - %s version %s (%s)\n",
gvc->common.cmdname, gvc->common.info[0],
static char *fn;
static FILE *fp;
static int fidx, gidx;
- GVG_t *gvg;
while (!g) {
if (!fp) {
g = agread(fp);
#endif
if (g) {
- gvg = zmalloc(sizeof(GVG_t));
- if (!gvc->gvgs)
- gvc->gvgs = gvg;
- else
- gvc->gvg->next = gvg;
- gvc->gvg = gvg;
- gvg->gvc = gvc;
- gvg->g = g;
- gvg->input_filename = fn;
- gvg->graph_index = gidx++;
+ gvg_init(gvc, g, fn, gidx++);
break;
}
fp = NULL;
/* parse command line args - minimally argv[0] sets layout engine */
extern int gvParseArgs(GVC_t *gvc, int argc, char **argv);
extern graph_t *gvNextInputGraph(GVC_t *gvc);
+extern graph_t *gvPluginsGraph(GVC_t *gvc);
/* Compute a layout using a specified engine */
extern int gvLayout(GVC_t *gvc, graph_t *g, const char *engine);
extern void gvplugin_write_status(GVC_t * gvc);
extern char *gvplugin_list(GVC_t * gvc, api_t api, const char *str);
+ extern Agraph_t * gvplugin_graph(GVC_t * gvc);
+
/* job */
extern void gvjobs_output_filename(GVC_t * gvc, const char *name);
#include "gvcint.h"
#include "gvcproc.h"
+#include "const.h"
+
extern const int Demand_Loading;
/*
}
}
+
+Agraph_t * gvplugin_graph(GVC_t * gvc)
+{
+ Agraph_t *g;
+ Agnode_t *n;
+
+ aginit();
+ /* set persistent attributes here */
+ agnodeattr(NULL, "label", NODENAME_ESC);
+
+ g = agopen("G", AGDIGRAPH);
+ n = agnode(g, "plugins graph under-construction");
+
+ return g;
+}