graph functions so that plugins have dependencies on graph libraries.
Clean up header inclusions.
* AT&T Research, Florham Park NJ *
**********************************************************/
-#ifndef GVRENDER_PLUGIN_H
-#define GVRENDER_PLUGIN_H
+#ifndef GVPLUGIN_RENDER_H
+#define GVPLUGIN_RENDER_H
+#include "types.h"
#include "gvplugin.h"
#include "gvcjob.h"
-#include "textpara.h"
-#include "usershape.h"
#ifdef __cplusplus
extern "C" {
#ifdef __cplusplus
}
#endif
-#endif /* GVRENDER_PLUGIN_H */
+#endif /* GVPLUGIN_RENDER_H */
* AT&T Research, Florham Park NJ *
**********************************************************/
-#ifndef GVTEXTLAYOUT_PLUGIN_H
-#define GVTEXTLAYOUT_PLUGIN_H
+#ifndef GVPLUGIN_TEXTLAYOUT_H
+#define GVPLUGIN_TEXTLAYOUT_H
+#include "types.h"
#include "gvplugin.h"
#include "gvcjob.h"
-#include "textpara.h"
#ifdef __cplusplus
extern "C" {
#ifdef __cplusplus
}
#endif
-#endif /* GVTEXTLAYOUT_PLUGIN_H */
+#endif /* GVPLUGIN_TEXTLAYOUT_H */
#include <string.h>
#include "memory.h"
#include "const.h"
-#include "types.h"
#include "macros.h"
+#include "gvplugin_render.h"
#include "globals.h"
#include "graph.h"
-#include "gvplugin_render.h"
#include "gvcint.h"
#include "colorprocs.h"
#include "gvcproc.h"
sx = job->width / (job->zoom * 2.);
sy = job->height / (job->zoom * 2.);
- gvc->sg = g; /* current subgraph/cluster */
job->common->objtype = "graph";
- job->common->graph_name = g->name;
+ job->g = g; /* current graph */
job->compscale.x = job->zoom * job->dpi.x / POINTS_PER_INCH;
job->compscale.y = job->zoom * job->dpi.y / POINTS_PER_INCH;
job->compscale.y *= (job->flags & GVRENDER_Y_GOES_DOWN) ? -1. : 1.;
cg->end_graph();
}
#endif
- job->gvc->sg = NULL;
+ job->sg = NULL;
}
void gvrender_begin_page(GVJ_t * job)
{
gvrender_engine_t *gvre = job->render.engine;
- job->gvc->sg = sg; /* set current cluster graph object */
+ job->sg = sg; /* set current cluster graph object */
#ifdef WITH_CODEGENS
Obj = CLST;
#endif
job->common->objtype = "cluster";
- job->common->cluster_name = sg->name;
- job->common->cluster_id = sg->meta_node->id;
if (gvre && gvre->begin_cluster)
gvre->begin_cluster(job);
#ifdef WITH_CODEGENS
}
Obj = NONE;
#endif
- job->gvc->sg = g; /* reset current cluster to parent graph or cluster */
+ job->sg = g; /* reset current cluster to parent graph or cluster */
}
void gvrender_begin_nodes(GVJ_t * job)
Obj = NODE;
#endif
job->common->objtype = "node";
- job->common->node_name = n->name;
- job->common->node_id = n->id;
- job->gvc->n = n; /* set current node */
+ job->n = n; /* set current node */
if (gvre && gvre->begin_node)
gvre->begin_node(job);
#ifdef WITH_CODEGENS
}
Obj = NONE;
#endif
- job->gvc->n = NULL; /* clear current node */
+ job->n = NULL; /* clear current node */
}
void gvrender_begin_edge(GVJ_t * job, edge_t * e)
Obj = EDGE;
#endif
job->common->objtype = "edge";
- job->common->edge_tailname = e->tail->name;
- job->common->edge_tailid = e->tail->id;
- job->common->edge_headname = e->head->name;
- job->common->edge_headid = e->head->id;
- job->common->edge_directed = e->tail->graph->root->kind & AGFLAG_DIRECTED;
- job->common->edge_id = e->id;
- job->gvc->e = e; /* set current edge */
+ job->e = e; /* set current edge */
if (gvre && gvre->begin_edge)
gvre->begin_edge(job);
#ifdef WITH_CODEGENS
}
Obj = NONE;
#endif
- job->gvc->e = NULL; /* clear current edge */
+ job->e = NULL; /* clear current edge */
}
void gvrender_begin_context(GVJ_t * job)
#endif
#include "const.h"
-#include "types.h"
#include "gvplugin_textlayout.h"
#include "gvcint.h"
#include "gvcproc.h"
#endif
#include <stddef.h>
-#include <stdlib.h>
#include <string.h>
#include "types.h"
#include "gvplugin.h"
-//extern gvplugin_installed_t gvrender_core_ps_types;
+extern gvplugin_installed_t gvrender_core_ps_types;
extern gvplugin_installed_t gvrender_core_svg_types;
static gvplugin_api_t apis[] = {
-// {API_render, &gvrender_core_ps_types},
+ {API_render, &gvrender_core_ps_types},
{API_render, &gvrender_core_svg_types},
{(api_t)0, 0},
};
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
-#include <assert.h>
#ifdef HAVE_LIBZ
#include <zlib.h>
#undef HAVE_LIBGD
#include "gvplugin_render.h"
+#include "graph.h"
+#if 0
+/* FIXME - gv_ps_txt collides in multiple ps renderers */
#include "gv_ps.h"
-#include "const.h"
-#include "macros.h"
+#endif
#ifdef HAVE_LIBGD
#include "gd.h"
#endif
setupLatin1 = FALSE;
if (job->common->viewNum == 0) {
- fprintf(job->output_file, "%%%%Title: %s\n", job->common->graphname);
+ fprintf(job->output_file, "%%%%Title: %s\n", job->g->name);
fprintf(job->output_file, "%%%%Pages: (atend)\n");
if (job->common->show_boxes == NULL)
fprintf(job->output_file, "%%%%BoundingBox: (atend)\n");
fprintf(job->output_file, "%%%%EndComments\nsave\n");
+#if 0
+/* FIXME - gv_ps_txt collides in multiple ps renderers */
cat_libfile(job->output_file, job->common->lib, gv_ps_txt);
+#endif
epsf_define(job->output_file);
}
#ifdef FIXME
fprintf(job->output_file, "%%%%EndPage: %d\n", job->common->viewNum);
}
-static void psgen_begin_cluster(GVJ_t * job, char *clustername, long id)
+static void psgen_begin_cluster(GVJ_t * job)
{
- fprintf(job->output_file, "%% %s\n", clustername);
+ fprintf(job->output_file, "%% %s\n", job->sg->name);
#if 0
/* Embed information for Distiller to generate hyperlinked PDF */
#endif
}
-static void psgen_begin_anchor(GVJ_t * job, char *href, char *tooltip, char *target)
+static void
+psgen_begin_anchor(GVJ_t * job, char *href, char *tooltip, char *target)
{
#if 0
if (href && href[0])
|| last_color.u.HSV[1] != color->u.HSV[1]
|| last_color.u.HSV[2] != color->u.HSV[2]) {
fprintf(job->output_file, "%.3f %.3f %.3f %scolor\n",
- color->u.HSV[0], color->u.HSV[1], color->u.HSV[2], job->objname);
+ color->u.HSV[0], color->u.HSV[1], color->u.HSV[2], job->common->objtype);
last_color.u.HSV[0] = color->u.HSV[0];
last_color.u.HSV[1] = color->u.HSV[1];
last_color.u.HSV[2] = color->u.HSV[2];
static gvrender_features_t psgen_features = {
GVRENDER_DOES_MULTIGRAPH_OUTPUT_FILES
| GVRENDER_DOES_TRANSFORM,
- DEFAULT_PRINT_MARGIN, /* default margin - points */
+ 36, /* default margin - points */
{72.,72.}, /* default dpi */
NULL, /* knowncolors */
0, /* sizeof knowncolors */
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
-#include <assert.h>
#ifdef HAVE_LIBZ
#include <zlib.h>
#include "const.h"
#include "gvplugin_render.h"
+#include "graph.h"
typedef enum { FORMAT_SVG, FORMAT_SVGZ, } format_type;
static void svggen_begin_graph(GVJ_t * job)
{
svggen_fputs(job, "<!--");
- if (job->common->graph_name[0]) {
+ if (job->g->name[0]) {
svggen_fputs(job, " Title: ");
- svggen_fputs(job, xml_string(job->common->graph_name));
+ svggen_fputs(job, xml_string(job->g->name));
}
svggen_printf(job, " Pages: %d -->\n", job->pagesArraySize.x * job->pagesArraySize.y);
svggen_fputs(job, " style=\"font-family:");
svggen_fputs(job, job->style->fontfam);
svggen_printf(job, ";font-size:%.2f;\">\n", job->style->fontsz);
- if (job->common->graph_name[0]) {
+ if (job->g->name[0]) {
svggen_fputs(job, "<title>");
- svggen_fputs(job, xml_string(job->common->graph_name));
+ svggen_fputs(job, xml_string(job->g->name));
svggen_fputs(job, "</title>\n");
}
}
static void svggen_begin_cluster(GVJ_t * job)
{
- svggen_printf(job, "<g id=\"cluster%ld\" class=\"cluster\">", job->common->cluster_id);
+ svggen_printf(job, "<g id=\"cluster%ld\" class=\"cluster\">",
+ job->sg->meta_node->id);
svggen_fputs(job, "<title>");
- svggen_fputs(job, xml_string(job->common->cluster_name));
+ svggen_fputs(job, xml_string(job->sg->name));
svggen_fputs(job, "</title>\n");
}
static void svggen_begin_node(GVJ_t * job)
{
- svggen_printf(job, "<g id=\"node%ld\" class=\"node\">", job->common->node_id);
+ svggen_printf(job, "<g id=\"node%ld\" class=\"node\">", job->n->id);
svggen_fputs(job, "<title>");
- svggen_fputs(job, xml_string(job->common->node_name));
+ svggen_fputs(job, xml_string(job->n->name));
svggen_fputs(job, "</title>\n");
}
{
char *edgeop;
- svggen_printf(job, "<g id=\"edge%ld\" class=\"edge\">", job->common->edge_id);
- if (job->common->edge_directed)
+ svggen_printf(job, "<g id=\"edge%ld\" class=\"edge\">", job->e->id);
+ if (job->e->tail->graph->root->kind & AGFLAG_DIRECTED)
edgeop = "->";
else
edgeop = "--";
svggen_fputs(job, "<title>");
- svggen_fputs(job, xml_string(job->common->edge_tailname));
+ svggen_fputs(job, xml_string(job->e->tail->name));
svggen_fputs(job, edgeop);
/* can't do this in single svggen_printf because
* xml_string's buffer gets reused. */
- svggen_fputs(job, xml_string(job->common->edge_headname));
+ svggen_fputs(job, xml_string(job->e->head->name));
svggen_fputs(job, "</title>\n");
}
}
static void
-svggen_usershape(GVJ_t * job, usershape_t *us, boxf b, int filled)
+svggen_usershape(GVJ_t * job, usershape_t *us, boxf b, bool filled)
{
if (job->style->pen == PEN_NONE) {
/* its invisible, don't draw */