From: ellson Date: Mon, 17 Jan 2005 03:32:01 +0000 (+0000) Subject: move render_id from GVC_t to gvrender_job_t X-Git-Tag: LAST_LIBGRAPH~32^2~8080 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=834656322021ef7973b05844fd29f0b92a296a8f;p=graphviz move render_id from GVC_t to gvrender_job_t eliminate lots of gvc->job dereferencing --- diff --git a/lib/gvc/gvcint.h b/lib/gvc/gvcint.h index 84f77533d..578b3c25c 100644 --- a/lib/gvc/gvcint.h +++ b/lib/gvc/gvcint.h @@ -36,6 +36,8 @@ extern "C" { FILE *output_file; int output_lang; + int render_id; /* internal id of current render */ + void *surface; /* gd or cairo surface */ boolean external_surface; /* surface belongs to caller */ @@ -139,7 +141,6 @@ extern "C" { /* gvrender_begin_job() */ 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 */ #ifndef DISABLE_CODEGENS codegen_t *codegen; #endif diff --git a/lib/gvc/gvemit.c b/lib/gvc/gvemit.c index be84b0c9c..7ef363229 100644 --- a/lib/gvc/gvemit.c +++ b/lib/gvc/gvemit.c @@ -34,6 +34,7 @@ extern void emit_graph(GVC_t * gvc, graph_t * g, int flags); #define PANFACTOR 10 #define ZOOMFACTOR 1.1 +#define EPSILON .0001 #define ARRAY_SIZE(A) (sizeof(A)/sizeof(A[0])) @@ -298,8 +299,6 @@ static void win_handle_button_press(gvrender_job_t * job, XButtonEvent *bev) job->oldy = bev->y; } -#define EPSILON .0001 - static void win_handle_motion(gvrender_job_t * job, XMotionEvent *mev) { double dx = mev->x - job->oldx; diff --git a/lib/gvc/gvrender.c b/lib/gvc/gvrender.c index 268c39d92..b3e08b0ff 100644 --- a/lib/gvc/gvrender.c +++ b/lib/gvc/gvrender.c @@ -72,7 +72,7 @@ int gvrender_select(GVC_t * gvc, char *str) gvc->render_engine = (gvrender_engine_t *) (typeptr->engine); gvc->render_features = (gvrender_features_t *) (typeptr->features); - gvc->render_id = typeptr->id; + gvc->job->render_id = typeptr->id; return GVRENDER_PLUGIN; #ifndef DISABLE_CODEGENS }