for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
ND_state(n) = 0;
}
-
- /* reset renderer */
- gvrender_reset(gvc);
}
static void emit_background(GVC_t * gvc, graph_t *g, boxf pageBox)
init_layering(gvc, g);
- gvc->job->gvc = gvc;
- gvc->job->g = g;
-
init_job_flags(gvc->job, g);
init_job_margin(gvc);
void emit_jobs (GVC_t * gvc, graph_t * g)
{
gvrender_job_t *job;
+ char *prev_langname = NULL;
for (job = gvrender_first_job(gvc); job; job = gvrender_next_job(gvc)) {
if (!job->output_file) { /* if not yet opened */
} else {
job->output_file = file_select(job->output_filename);
}
+ }
+ if (job->output_langname != prev_langname) {
+ prev_langname = job->output_langname;
job->output_lang = gvrender_select(gvc, job->output_langname);
assert(job->output_lang != NO_SUPPORT); /* should have been verified already */
- }
+ gvrender_initialize(gvc);
+ }
+
+ job->gvc = gvc;
+ job->g = g;
+
emit_job(gvc, g);
+
+ if (!job->next || job->next->output_langname != prev_langname)
+ gvrender_finalize(gvc);
}
}
pkginclude_HEADERS = gvc.h gvcint.h gvplugin.h \
gvplugin_render.h gvplugin_layout.h \
- gvplugin_text.h gvplugin_display.h
+ gvplugin_text.h
pkglib_LTLIBRARIES = libgvc.la
-libgvc_la_SOURCES = gvrender.c gvlayout.c gvdisplay.c gvtext.c gvcontext.c \
+libgvc_la_SOURCES = gvrender.c gvlayout.c gvtext.c gvcontext.c \
gvjobs.c gvevent.c gvemit.c gvplugin.c gvconfig.c
EXTRA_DIST = Makefile.old
gvplugin_layout.h gvplugin.h
OBJS = gvrender.o gvlayout.o gvcontext.o gvjobs.o \
- gvemit.o gvplugin.o gvconfig.o gvdisplay.o gvevent.o gvtext.o
+ gvemit.o gvplugin.o gvconfig.o gvevent.o gvtext.o
libgvc.a : $(OBJS)
$(RM) libgvc.a
char *fontname, double fontsize,
char *fontpath);
-/* display */
-
- extern int gvdisplay_select(GVC_t * gvc, char *display);
- extern void gvdisplay_init(GVC_t *gvc);
- extern void gvdisplay_process(GVC_t *gvc);
- extern void gvdisplay_deinit(GVC_t *gvc);
-
/* render */
extern int gvrender_select(GVC_t * gvc, char *lang);
extern int gvrender_features(GVC_t * gvc);
- extern void gvrender_reset(GVC_t * gvc);
+ extern void gvrender_initialize(GVC_t * gvc);
+ extern void gvrender_finalize(GVC_t * gvc);
extern void gvrender_begin_job(GVC_t * gvc);
extern void gvrender_end_job(GVC_t * gvc);
extern void gvrender_begin_graph(GVC_t * gvc, graph_t * g);
+++ /dev/null
-/* $Id$ $Revision$ */
-/* vim:set shiftwidth=4 ts=8: */
-
-/**********************************************************
-* This software is part of the graphviz package *
-* http://www.graphviz.org/ *
-* *
-* Copyright (c) 1994-2004 AT&T Corp. *
-* and is licensed under the *
-* Common Public License, Version 1.0 *
-* by AT&T Corp. *
-* *
-* Information and Software Systems Research *
-* AT&T Research, Florham Park NJ *
-**********************************************************/
-
-/*
- * display engine wrapper
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-
-#include "const.h"
-#include "types.h"
-#include "macros.h"
-
-#include "gvplugin_display.h"
-#include "gvc.h"
-
-int gvdisplay_select(GVC_t * gvc, char *display)
-{
- gv_plugin_t *plugin;
- gvplugin_type_t *typeptr;
-
- plugin = gvplugin_load(gvc, API_display, display);
- if (plugin) {
- typeptr = plugin->typeptr;
- gvc->display_engine = (gvdisplay_engine_t *) (typeptr->engine);
- return GVRENDER_PLUGIN; /* FIXME - need more suitable success code */
- }
- return NO_SUPPORT;
-}
-
-void gvdisplay_init(GVC_t *gvc)
-{
- gvdisplay_engine_t *gvde = gvc->display_engine;
-
- if (gvde && gvde->init) {
- gvde->init(gvc);
- }
-}
-
-void gvdisplay_process(GVC_t *gvc)
-{
- gvdisplay_engine_t *gvde = gvc->display_engine;
-
- if (gvde && gvde->process) {
- gvde->process(gvc);
- }
-}
-
-void gvdisplay_deinit(GVC_t *gvc)
-{
- gvdisplay_engine_t *gvde = gvc->display_engine;
-
- if (gvde && gvde->deinit) {
- gvde->deinit(gvc);
- }
-}
+++ /dev/null
-/* $Id$ $Revision$ */
-/* vim:set shiftwidth=4 ts=8: */
-
-/**********************************************************
-* This software is part of the graphviz package *
-* http://www.graphviz.org/ *
-* *
-* Copyright (c) 1994-2004 AT&T Corp. *
-* and is licensed under the *
-* Common Public License, Version 1.0 *
-* by AT&T Corp. *
-* *
-* Information and Software Systems Research *
-* AT&T Research, Florham Park NJ *
-**********************************************************/
-
-#ifndef GVDISPLAY_PLUGIN_H
-#define GVDISPLAY_PLUGIN_H
-
-#include "gvplugin.h"
-#include "gvcint.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
- struct gvdisplay_engine_s {
- void (*init) (GVC_t * gvc);
- void (*process) (GVC_t * gvc);
- void (*deinit) (GVC_t * gvc);
- };
-
-/* event callbacks in gvevent.c */
-
- extern void gvevent_refresh(gvrender_job_t * job);
-#if 0
- extern void gvevent_button_press(gvrender_job_t * job, int button, double x, double y);
- extern void gvevent_motion(gvrender_job_t * job, double x, double y);
- extern void gvevent_button_release(gvrender_job_t *job, int button, double x,
-double y);
- extern int gvevent_key_press(gvrender_job_t * job, int key);
- extern void gvevent_reconfigure_normal(gvrender_job_t * job, unsigned int width, unsigned int height);
- extern void gvevent_reconfigure_fit_mode(gvrender_job_t * job, unsigned int width, unsigned int height);
-
- extern void gvevent_configure(gvrender_job_t * job, XConfigureEvent * cev);
- extern void gvevent_expose(gvrender_job_t * job, XExposeEvent * eev);
- extern void gvevent_client_message(gvrender_job_t * job, XClientMessageEvent * cmev);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* GVDISPLAY_PLUGIN_H */
#endif
struct gvrender_engine_s {
+ void (*initialize) (GVC_t * gvc);
+ void (*finalize) (GVC_t * gvc);
void (*begin_job) (gvrender_job_t * job);
void (*end_job) (gvrender_job_t * job);
void (*begin_graph) (gvrender_job_t * job, char *graphname);
return features;
}
-void gvrender_reset(GVC_t * gvc)
+void gvrender_initialize(GVC_t * gvc)
{
+ gvrender_job_t *job = gvc->job;
+ gvrender_engine_t *gvre = job->render_engine;
+
+ if (gvre) {
+ if (gvre->initialize)
+ gvre->initialize(gvc);
+ }
+#if 0
+/* codegens don't have this entry point */
#ifndef DISABLE_CODEGENS
+ else {
+ codegen_t *cg = job->codegen;
+
+ if (cg && cg->init)
+ cg->init();
+ }
+#endif
+#endif
+}
+
+void gvrender_finalize(GVC_t * gvc)
+{
gvrender_job_t *job = gvc->job;
gvrender_engine_t *gvre = job->render_engine;
- if (!gvre) {
+ if (gvre) {
+ if (gvre->finalize)
+ gvre->finalize(gvc);
+ }
+#ifndef DISABLE_CODEGENS
+ else {
codegen_t *cg = job->codegen;
if (cg && cg->reset)