From f5055178b00ec0a0475be2f67a457c31e5a4449d Mon Sep 17 00:00:00 2001 From: ellson Date: Wed, 5 Jan 2005 22:26:21 +0000 Subject: [PATCH] always need layout plugin even if disable-gvrender eliminate public functions lang_select and file_select --- cmd/dot/Makefile.am | 8 +------- cmd/dot/plugins.c | 6 +++--- cmd/tools/Makefile.am | 11 +++-------- cmd/tools/plugins.c | 6 +++--- lib/common/Makefile.am | 2 +- lib/common/emit.c | 26 +++----------------------- lib/common/output.c | 14 +++++++++++++- lib/common/renderprocs.h | 2 -- tclpkg/tcldot/tcldot.c | 2 +- 9 files changed, 28 insertions(+), 49 deletions(-) diff --git a/cmd/dot/Makefile.am b/cmd/dot/Makefile.am index 11834b935..9cf8e8f0c 100644 --- a/cmd/dot/Makefile.am +++ b/cmd/dot/Makefile.am @@ -40,13 +40,7 @@ if DISABLE_GVRENDER dot_LDADD = \ $(top_builddir)/lib/common/libcommon.la \ $(top_builddir)/lib/gvc/libgvc.la \ - $(top_builddir)/lib/fdpgen/libfdpgen.la \ - $(top_builddir)/lib/twopigen/libtwopigen.la \ - $(top_builddir)/lib/circogen/libcircogen.la \ - $(top_builddir)/lib/neatogen/libneatogen.la \ - $(top_builddir)/lib/dotgen/libdotgen.la \ - $(top_builddir)/lib/pathplan/libpathplan.la \ - $(top_builddir)/lib/graph/libgraph.la + $(top_builddir)/plugin/layout/libgvplugin_layout.la else dot_LDADD = \ $(top_builddir)/lib/common/libcommon.la \ diff --git a/cmd/dot/plugins.c b/cmd/dot/plugins.c index 3d3783ece..bbdb0f9f8 100644 --- a/cmd/dot/plugins.c +++ b/cmd/dot/plugins.c @@ -24,17 +24,17 @@ #ifndef DISABLE_GVRENDER extern gvplugin_t gvplugin_cairo_LTX_plugin, gvplugin_gd_LTX_plugin, - gvplugin_text_LTX_plugin, - gvplugin_layout_LTX_plugin; + gvplugin_text_LTX_plugin; #endif +extern gvplugin_layout_LTX_plugin; gvplugin_t *builtins[] = { #ifndef DISABLE_GVRENDER &gvplugin_cairo_LTX_plugin, &gvplugin_gd_LTX_plugin, &gvplugin_text_LTX_plugin, - &gvplugin_layout_LTX_plugin, #endif + &gvplugin_layout_LTX_plugin, NULL }; diff --git a/cmd/tools/Makefile.am b/cmd/tools/Makefile.am index b7e4f1410..a1a0c85e0 100644 --- a/cmd/tools/Makefile.am +++ b/cmd/tools/Makefile.am @@ -92,20 +92,15 @@ gvpack_SOURCES = gvpack.c plugins.c if DISABLE_GVRENDER gvpack_LDADD = \ - $(top_builddir)/lib/ingraphs/libingraphs.la \ - $(top_builddir)/lib/neatogen/libneatogen.la \ - $(top_builddir)/lib/pack/libpack.la \ $(top_builddir)/lib/common/libcommon.la \ $(top_builddir)/lib/gvc/libgvc.la \ - $(top_builddir)/lib/pathplan/libpathplan.la + $(top_builddir)/lib/ingraphs/libingraphs.la \ + $(top_builddir)/plugin/layout/libgvplugin_layout.la else gvpack_LDADD = \ - $(top_builddir)/lib/ingraphs/libingraphs.la \ - $(top_builddir)/lib/neatogen/libneatogen.la \ - $(top_builddir)/lib/pack/libpack.la \ $(top_builddir)/lib/common/libcommon.la \ $(top_builddir)/lib/gvc/libgvc.la \ - $(top_builddir)/lib/pathplan/libpathplan.la \ + $(top_builddir)/lib/ingraphs/libingraphs.la \ $(top_builddir)/plugin/cairo/libgvplugin_cairo.la \ $(top_builddir)/plugin/gd/libgvplugin_gd.la \ $(top_builddir)/plugin/text/libgvplugin_text.la \ diff --git a/cmd/tools/plugins.c b/cmd/tools/plugins.c index 3d3783ece..bbdb0f9f8 100644 --- a/cmd/tools/plugins.c +++ b/cmd/tools/plugins.c @@ -24,17 +24,17 @@ #ifndef DISABLE_GVRENDER extern gvplugin_t gvplugin_cairo_LTX_plugin, gvplugin_gd_LTX_plugin, - gvplugin_text_LTX_plugin, - gvplugin_layout_LTX_plugin; + gvplugin_text_LTX_plugin; #endif +extern gvplugin_layout_LTX_plugin; gvplugin_t *builtins[] = { #ifndef DISABLE_GVRENDER &gvplugin_cairo_LTX_plugin, &gvplugin_gd_LTX_plugin, &gvplugin_text_LTX_plugin, - &gvplugin_layout_LTX_plugin, #endif + &gvplugin_layout_LTX_plugin, NULL }; diff --git a/lib/common/Makefile.am b/lib/common/Makefile.am index 8aeba644d..b818117fc 100644 --- a/lib/common/Makefile.am +++ b/lib/common/Makefile.am @@ -28,7 +28,7 @@ libcommon_la_SOURCES = arrows.c colxlate.c fontmetrics.c gdtextsize.c \ output.c emit.c $(CODEGENS) libcommon_la_LIBADD = \ - @GD_LIBS@ @EXPAT_LIBS@ @CAIRO_LIBS@ @Z_LIBS@ + @GD_LIBS@ @CAIRO_LIBS@ @EXPAT_LIBS@ @Z_LIBS@ psgen.o psgen.lo : ps.h diff --git a/lib/common/emit.c b/lib/common/emit.c index 0034dd6e9..cc8d3c360 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -684,10 +684,13 @@ void emit_graph(GVC_t * gvc, graph_t * g, int flags) /* FIXME - some of setup_pagination should be in emit_init() */ setup_pagination(gvc, g); +#if 0 +/* FIXME - apparently zoom is not set yet */ gvc->clip.UR.x = ROUND(gvc->focus.x + (gvc->width+1) / (gvc->zoom * 2.)); gvc->clip.UR.y = ROUND(gvc->focus.y + (gvc->height+1) / (gvc->zoom * 2.)); gvc->clip.LL.x = ROUND(gvc->focus.x - (gvc->width+1) / (gvc->zoom * 2.)); gvc->clip.LL.y = ROUND(gvc->focus.y - (gvc->height+1) / (gvc->zoom * 2.)); +#endif gvrender_begin_graph(gvc, g, PB, PFC); if (flags & EMIT_COLORS) { @@ -1425,29 +1428,6 @@ void config_codegen_builtins(GVC_t * gvc) #endif } -int lang_select(GVC_t * gvc, char *str, int warn) -{ - int rv = gvrender_select(gvc, str); - - if (rv == NO_SUPPORT && warn) { - agerr(AGERR, "Renderer type \"%s\" not recognized, use one of:", - str); - agerr(AGPREV, "%s\n", gvplugin_list(gvc, API_render, str)); - } - return rv; -} - -FILE *file_select(char *str) -{ - FILE *rv; - rv = fopen(str, "wb"); - if (rv == NULL) { - perror(str); - exit(1); - } - return rv; -} - void use_library(char *name) { static int cnt = 0; diff --git a/lib/common/output.c b/lib/common/output.c index 73d1e6127..7eac4946f 100644 --- a/lib/common/output.c +++ b/lib/common/output.c @@ -216,6 +216,17 @@ void dotneato_write_one(GVC_t * gvc, graph_t * g) emit_deinit(gvc); } +static FILE *file_select(char *str) +{ + FILE *rv; + rv = fopen(str, "wb"); + if (rv == NULL) { + perror(str); + exit(1); + } + return rv; +} + void dotneato_write(GVC_t * gvc, graph_t * g) { gvrender_job_t *job; @@ -227,7 +238,8 @@ void dotneato_write(GVC_t * gvc, graph_t * g) } else { job->output_file = file_select(job->output_filename); } - job->output_lang = lang_select(gvc, job->output_langname, 1); + job->output_lang = gvrender_select(gvc, job->output_langname); + assert(job->output_lang != NO_SUPPORT); /* should have been verified already */ } #ifndef DISABLE_CODEGENS Output_file = job->output_file; diff --git a/lib/common/renderprocs.h b/lib/common/renderprocs.h index f62106180..5e3974de0 100644 --- a/lib/common/renderprocs.h +++ b/lib/common/renderprocs.h @@ -91,7 +91,6 @@ extern "C" { extern void epsf_init(node_t * n); extern void epsf_free(node_t * n); extern void epsf_gencode(GVC_t * gvc, node_t * n); - extern FILE *file_select(char *); extern shape_desc *find_user_shape(char *); extern box flip_rec_box(box b, point p); extern point flip_pt(point p, int rankdir); @@ -196,7 +195,6 @@ extern "C" { # define extern __EXPORT__ #endif extern point sub_points(point, point); - extern int lang_select(GVC_t * gvc, char *, int); extern void toggle(int); extern int test_toggle(); diff --git a/tclpkg/tcldot/tcldot.c b/tclpkg/tcldot/tcldot.c index 6af266cb9..e6112b51c 100644 --- a/tclpkg/tcldot/tcldot.c +++ b/tclpkg/tcldot/tcldot.c @@ -1114,7 +1114,7 @@ static int graphcmd(ClientData clientData, Tcl_Interp * interp, /* render graph TK canvas commands */ gvc->job->output_lang = - lang_select(gvc, gvc->job->output_langname, 0); + gvrender_select(gvc, gvc->job->output_langname); gvc->job->output_file = (FILE *) & tkgendata; #if ENABLE_CODEGENS Output_lang = gvc->job->output_lang; -- 2.40.0