dot_SOURCES = dot.c args.c plugins.c
-if ENABLE_GVRENDER
+if DISABLE_GVRENDER
+dot_LDADD = \
+ $(top_builddir)/lib/common/libcommon.la \
+ $(top_builddir)/lib/gvc/libgvc.la
+else
dot_LDADD = \
$(top_builddir)/lib/common/libcommon.la \
$(top_builddir)/lib/gvc/libgvc.la \
$(top_builddir)/plugin/gd/libgvplugin_gd.la \
$(top_builddir)/plugin/text/libgvplugin_text.la \
$(top_builddir)/plugin/layout/libgvplugin_layout.la @CAIRO_LIBS@
-else
-dot_LDADD = \
- $(top_builddir)/lib/common/libcommon.la \
- $(top_builddir)/lib/gvc/libgvc.la
endif
install-data-hook:
#include <fdp.h>
#include <circo.h>
-/* FIXME - these shouldn't be needed */
-#ifndef ENABLE_CODEGENS
-#define ENABLE_CODEGENS 1
-#endif
-#ifndef GD_RENDER
-#define GD_RENDER 1
-#endif
-
#ifdef __cplusplus
extern "C" {
#endif
AC_TYPE_UID_T
dnl -----------------------------------
-dnl dynagraph requires C++ support beyond RedHat 7.2
+dnl old codegens
-AC_ARG_ENABLE(dynagraph,
- [AC_HELP_STRING([--enable-dynagraph],
- [build dynagraph code])])
-AM_CONDITIONAL(ENABLE_DYNAGRAPH, [test "x$enable_dynagraph" = "xyes"])
+AC_ARG_ENABLE(codegens,
+ [AC_HELP_STRING([--disable-codegens], [don't build old codegens])])
+if test "x$enable_codegens" = "xno"; then
+ AC_DEFINE(DISABLE_CODEGENS,1,[Define if you don't want the old codegens])
+fi
+AM_CONDITIONAL(DISABLE_CODEGENS, [test "x$enable_codegens" = "xno"])
dnl -----------------------------------
dnl gvrender plugins
AC_ARG_ENABLE(gvrender,
- [AC_HELP_STRING([--enable-gvrender],
- [build gvrender plugins (EXPERIMENTAL)])])
-if test "x$enable_gvrender" = "xyes"; then
- AC_DEFINE(ENABLE_GVRENDER,1,[Set to 1 if you want the new gvrender codegens])
-else
- AC_DEFINE(ENABLE_GVRENDER,0,[Set to 1 if you want the new gvrender codegens])
-fi
-AM_CONDITIONAL(ENABLE_GVRENDER, [test "x$enable_gvrender" = "xyes"])
-
-dnl -----------------------------------
-dnl gd_render - currently unconditionally true
-
-AC_DEFINE(GD_RENDER,1,[Define if you want the gd renderers (png, gif, etc )])
-
-dnl -----------------------------------
-dnl old codegens
-
-AC_ARG_ENABLE(codegens,
- [AC_HELP_STRING([--disable-codegens],
- [don't build old codegens])])
-if test "x$enable_codegens" = "xno"; then
- AC_DEFINE(ENABLE_CODEGENS,0,[Set to 0 if you don't want the old codegens])
-else
- AC_DEFINE(ENABLE_CODEGENS,1,[Set to 0 if you don't want the old codegens])
+ [AC_HELP_STRING([--disable-gvrender], [don't build gvrender plugins])])
+if test "x$enable_gvrender" = "xno"; then
+ AC_DEFINE(DISABLE_GVRENDER,1,[Define if you don't want the new gvrender codegens])
fi
-AM_CONDITIONAL(ENABLE_CODEGENS, [test "x$enable_codegens" != "xno"])
+AM_CONDITIONAL(DISABLE_GVRENDER, [test "x$enable_gvrender" = "xno"])
dnl -----------------------------------
dnl ElectricFence support for debugging
dnl -----------------------------------
dnl INCLUDES and LIBS for cairo
-if [ test "x$enable_gvrender" = "xyes" ]; then
+if [ test "x$enable_gvrender" != "xno" ]; then
PKG_CHECK_MODULES(CAIRO, cairo >= 0.1.3,
[AC_DEFINE_UNQUOTED(HAVE_CAIRO,1,
[Define if you have the cairo library [EXPERIMENTAL]])],
pkglib_LTLIBRARIES = libcommon.la
pkgconfig_DATA = libcommon.pc
-if ENABLE_CODEGENS
+if !DISABLE_CODEGENS
CODEGENS = diagen.c figgen.c gdgen.c hpglgen.c mapgen.c mifgen.c mpgen.c \
picgen.c psgen.c svggen.c vrmlgen.c vtxgen.c ps.txt color_names
endif
static char *Layerdelims;
static attrsym_t *G_peripheries;
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
static char *lang_name(int langID);
#endif
if (gvrender_features(gvc) & GVRENDER_DOES_LAYERS) {
Nlayers = parse_layers(g, p);
}
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
agerr(AGWARN, "layers not supported in %s output\n",
lang_name(Output_lang));
return parse;
}
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
static codegen_info_t cg[MAX_CODEGENS] = {
{&PS_CodeGen, "ps", POSTSCRIPT},
{&PS_CodeGen, "ps2", PDF},
void config_codegen_builtins(GVC_t * gvc)
{
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
codegen_info_t *p;
for (p = cg; p->name; ++p)
char *lang_name(int langID)
{
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
codegen_info_t *p;
for (p = first_codegen(); p->name; p = next_codegen(p)) {
if (p->id == langID)
0.5999, 0.5999, 0.5999, 0.5999, 0.5999, 0.5999, 0.5999, 0.5999, /* øùúû */
};
-#if ENABLE_CODEGENS && !defined(HAVE_GD_FREETYPE)
+#if !defined(DISABLE_CODEGENS) && !defined(HAVE_GD_FREETYPE)
extern codegen_t *Output_codegen;
double _dpi;
textline->width = 0.0;
textline->xshow = NULL;
-#if ENABLE_CODEGENS && !defined(HAVE_GD_FREETYPE)
+#if !defined(DISABLE_CODEGENS) && !defined(HAVE_GD_FREETYPE)
if (Output_codegen == &GD_CodeGen) {
int cwidth;
double fsize = (fontsz * _dpi) / POINTS_PER_INCH; /* in pixels */
extern gdFontPtr gdFontTiny, gdFontSmall, gdFontMediumBold, gdFontLarge,
gdFontGiant;
-#if ENABLE_CODEGENS && !defined(HAVE_GD_FREETYPE)
-
+#if !defined(DISABLE_CODEGENS) && !defined(HAVE_GD_FREETYPE)
/* builtinFont:
* Map fontsz in pixels to builtin font.
*/
external char *Gvfilepath; /* Path of files allowed in 'shapefile' attrib (also ps libs) */
external int y_invert; /* invert y in dot & plain output */
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
external int Output_lang; /* POSTSCRIPT, DOT, etc. */
external FILE *Output_file;
external int Obj;
#include "htmltable.h"
#include <ctype.h>
-#if ENABLE_CODEGENS && !defined(HAVE_GD_FREETYPE)
+#if !defined(DISABLE_CODEGENS) && !defined(HAVE_GD_FREETYPE)
codegen_t *Output_codegen;
#endif
gvplugin_builtins(gvc);
gvconfig(gvc, CONFIG);
-#if ENABLE_CODEGENS && !defined(HAVE_GD_FREETYPE)
+#if !defined(DISABLE_CODEGENS) && !defined(HAVE_GD_FREETYPE)
Output_codegen = gvc->codegen;
#endif
void graph_init(graph_t * g)
{
-#if ENABLE_CODEGENS && !defined(HAVE_GD_FREETYPE)
+#if !defined(DISABLE_CODEGENS) && !defined(HAVE_GD_FREETYPE)
initDPI(g);
#endif
/* initialize the graph */
if (lp->dimen.x < width)
lp->dimen.x = width;
/* recalculate total height */
-#if ENABLE_CODEGENS && !defined(HAVE_GD_FREETYPE)
+#if !defined(DISABLE_CODEGENS) && !defined(HAVE_GD_FREETYPE)
if (Output_codegen == &GD_CodeGen)
lp->dimen.y = textheight(lp->u.txt.nlines, lp->fontsize);
else
#include "gvrender.h"
#include "agxbuf.h"
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
FILE *Output_file;
int Output_lang;
#endif
int flags;
if (NOT(gvrender_features(gvc) & GVRENDER_DOES_MULTIGRAPH_OUTPUT_FILES)
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
/* FIXME - bad hack until feaures supported in codegens */
&& gvc->codegen != &PS_CodeGen
#ifdef QUARTZ_RENDER
}
job->output_lang = lang_select(gvc, job->output_langname, 1);
}
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
Output_file = job->output_file;
Output_lang = job->output_lang;
#endif
static attrsym_t *g_draw;
static attrsym_t *g_l_draw;
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
static void xd_textline(point p, textline_t * line)
{
scale = late_double(e, E_arrowsz, 1.0, 0.0);
for (i = 0; i < ED_spl(e)->size; i++) {
bz = ED_spl(e)->list[i];
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
/* FIXME - why is this here? */
xd_bezier(bz.list, bz.size, FALSE, FALSE);
#endif
extern void toggle(int);
extern int test_toggle();
-#if ENABLE_CODEGENS && !defined(HAVE_GD_FREETYPE)
+#ifndef DISABLE_CODEGENS
+#ifndef HAVE_GD_FREETYPE
extern void initDPI(graph_t *);
extern double textheight(int nlines, double fontsz);
extern int builtinFontHt(double fontsz);
extern int builtinFontWd(double fontsz);
#endif
-
-#if ENABLE_CODEGENS
extern codegen_info_t *first_codegen();
extern codegen_info_t *next_codegen();
#endif
if (ND_shape(n) == point_desc) {
color = "black";
}
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
color = (Output_lang == MIF ? "black" : DEFAULT_FILL);
}
xsize = (16.0 * (ND_lw_i(n) + ND_rw_i(n)) / POINTS(ND_width(n)));
ysize = (16.0 * ND_ht_i(n) / POINTS(ND_height(n)));
-#if ENABLE_CODEGENS
-#ifdef HAVE_GD_PNG
+#if !defined(DISABLE_CODEGENS) && defined(HAVE_GD_PNG)
/* this is bad, but it's because of how the VRML driver works */
if ((gvc->codegen == &VRML_CodeGen) && (peripheries == 0)) {
peripheries = 1;
}
-#endif
#endif
if (ND_shape(n) == point_desc) {
boolean usershape;
} shape_desc;
-#if ENABLE_CODEGENS
-
+#ifndef DISABLE_CODEGENS
typedef struct codegen_t {
void (*reset) (void);
void (*begin_job) (FILE * ofp, graph_t * g, char **lib, char *user,
{
gv_plugin_t *plugin;
gvplugin_type_t *typeptr;
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
codegen_info_t *cg_info;
#endif
plugin = gvplugin_load(gvc, API_render, str);
if (plugin) {
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
if (strcmp(plugin->path, "cg") == 0) {
cg_info = (codegen_info_t *) (plugin->typeptr);
gvc->codegen = cg_info->cg;
(gvrender_features_t *) (typeptr->features);
gvc->render_id = typeptr->id;
return GVRENDER_PLUGIN;
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
}
#endif
}
if (gvre) {
features = gvc->render_features->flags;
}
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
void gvrender_reset(GVC_t * gvc)
{
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
gvrender_engine_t *gvre = gvc->render_engine;
if (!gvre) {
if (gvre && gvre->begin_job)
// gvre->begin_job(gvc, agget(g, "stylesheet"));
gvre->begin_job(gvc);
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
if (gvre && gvre->end_job)
gvre->end_job(gvc);
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
gvc->style->fill = PEN_NONE;
gvc->style->penwidth = PENWIDTH_NORMAL;
}
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
if (gvre && gvre->end_graph)
gvre->end_graph(gvc);
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
gvc->page_number = page.x + page.y * gvc->pages.x + 1;
if (gvre && gvre->begin_page)
gvre->begin_page(gvc, gvc->g->name);
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
if (gvre && gvre->end_page)
gvre->end_page(gvc);
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
gvc->nLayers = nLayers;
if (gvre && gvre->begin_layer)
gvre->begin_layer(gvc, layername);
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
if (gvre && gvre->end_layer)
gvre->end_layer(gvc);
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
if (gvre && gvre->begin_cluster)
gvre->begin_cluster(gvc, sg->name, sg->meta_node->id);
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
if (gvre && gvre->end_cluster)
gvre->end_cluster(gvc);
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
if (gvre && gvre->begin_nodes)
gvre->begin_nodes(gvc);
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
if (gvre && gvre->end_nodes)
gvre->end_nodes(gvc);
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
if (gvre && gvre->begin_edges)
gvre->begin_edges(gvc);
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
if (gvre && gvre->end_edges)
gvre->end_edges(gvc);
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
if (gvre && gvre->begin_node)
gvre->begin_node(gvc, n->name, n->id);
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
if (gvre && gvre->end_node)
gvre->end_node(gvc);
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
gvre->begin_edge(gvc, e->tail->name,
e->tail->graph->root->kind & AGFLAG_DIRECTED,
e->head->name, e->id);
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
if (gvre && gvre->end_edge)
gvre->end_edge(gvc);
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
(gvc->styles)[gvc->SP] = (gvc->styles)[(gvc->SP) - 1];
gvc->style = &((gvc->styles)[gvc->SP]);
}
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
assert(gvc->SP >= 0);
gvc->style = &(gvc->styles[gvc->SP]);
}
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
if (gvre && gvre->begin_anchor)
gvre->begin_anchor(gvc, href, tooltip, target);
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
if (gvre && gvre->end_anchor)
gvre->end_anchor(gvc);
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
gvc->style->fontfam = fontname;
gvc->style->fontsz = fontsize;
}
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
gvre->textline(gvc, gvrender_ptf(gvc, p), line);
}
}
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
point P;
if (gvre->resolve_color)
gvre->resolve_color(gvc, color);
}
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
if (gvre->resolve_color)
gvre->resolve_color(gvc, color);
}
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
}
}
}
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
gvre->ellipse(gvc, AF, filled);
}
}
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
gvre->polygon(gvc, AF, n, filled);
}
}
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
gvre->beziercurve(gvc, AF2, n, arrow_at_start, arrow_at_end);
}
}
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
/* hack for old codegen int API */
gvre->polyline(gvc, AF, n);
}
}
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
if (sym)
gvre->comment(gvc, agxget(obj, sym->index));
}
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
if (gvre && gvre->user_shape)
gvre->user_shape(gvc, name, AF, n, filled);
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
else {
codegen_t *cg = gvc->codegen;
gvrender_engine_t *render_engine; /* current render engine */
gvrender_features_t *render_features; /* features of current render */
int render_id; /* internal id of current render */
-#if ENABLE_CODEGENS
+#ifndef DISABLE_CODEGENS
codegen_t *codegen;
#endif