From 15b44c5f26591c4a714bd6ca59e920d61aa6ac15 Mon Sep 17 00:00:00 2001 From: ellson Date: Tue, 15 Feb 2005 19:40:31 +0000 Subject: [PATCH] x11 changes - but still buggy --- lib/gvc/gvcint.h | 4 +++- lib/gvc/gvrender.c | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/gvc/gvcint.h b/lib/gvc/gvcint.h index 2aa538945..95bebe562 100644 --- a/lib/gvc/gvcint.h +++ b/lib/gvc/gvcint.h @@ -64,7 +64,8 @@ extern "C" { typedef struct gvrender_job_s gvrender_job_t; struct gvrender_job_s { - gvrender_job_t *next; + gvrender_job_t *next; /* linked list of jobs */ + gvrender_job_t *next_active; /* linked list of active jobs (e.g. multiple windows) */ char *output_filename; char *output_langname; FILE *output_file; @@ -158,6 +159,7 @@ extern "C" { gvlayout_engine_t *layout_engine; /* current layout engine */ int layout_id; /* internal id of current layout */ char *graphname; /* name from graph */ + gvrender_job_t *active_jobs; /* linked list of active jobs */ char **lib; diff --git a/lib/gvc/gvrender.c b/lib/gvc/gvrender.c index b79536de4..cbc95d025 100644 --- a/lib/gvc/gvrender.c +++ b/lib/gvc/gvrender.c @@ -152,6 +152,10 @@ void gvrender_begin_job(GVC_t * gvc) gvrender_job_t *job = gvc->job; gvrender_engine_t *gvre = job->render_engine; + /* insert job in active list */ + job->next_active = gvc->active_jobs; + gvc->active_jobs = job; + if (gvre) { if (gvre->begin_job) gvre->begin_job(job); @@ -169,7 +173,7 @@ void gvrender_begin_job(GVC_t * gvc) void gvrender_end_job(GVC_t * gvc) { - gvrender_job_t *job = gvc->job; + gvrender_job_t **pjob, *job = gvc->job; gvrender_engine_t *gvre = job->render_engine; if (gvre && gvre->end_job) @@ -183,6 +187,15 @@ void gvrender_end_job(GVC_t * gvc) } #endif gvc->lib = NULL; + + /* remove job from active list */ + for (pjob = &(gvc->active_jobs); *pjob; pjob = &((*pjob)->next_active)) { + if (*pjob == job) { + *pjob = job->next_active; + job->next_active = NULL; + break; + } + } } /* font modifiers */ -- 2.40.0