From: ellson Date: Tue, 18 Oct 2005 18:47:22 +0000 (+0000) Subject: eliminate types.h from device plugin api (no access to graph types or funcs) X-Git-Tag: LAST_LIBGRAPH~32^2~7270 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5082cefeb8eec1b5ca6016b7bf9af78d88a280f2;p=graphviz eliminate types.h from device plugin api (no access to graph types or funcs) --- diff --git a/lib/gvc/gvcjob.h b/lib/gvc/gvcjob.h index 2d0fd349a..fe042962a 100644 --- a/lib/gvc/gvcjob.h +++ b/lib/gvc/gvcjob.h @@ -23,6 +23,9 @@ extern "C" { #endif +#include "geom.h" +#include "color.h" + #define ARRAY_SIZE(A) (sizeof(A)/sizeof(A[0])) typedef enum { PEN_NONE, PEN_DASHED, PEN_DOTTED, PEN_SOLID } pen_type; @@ -109,6 +112,13 @@ extern "C" { void (*modify) (GVJ_t * job, char *name, char *value); } gvdevice_callbacks_t; + typedef int (*gvevent_key_callback_t) (GVJ_t * job); + + typedef struct gvevent_key_binding_s { + char *keystring; + gvevent_key_callback_t callback; + } gvevent_key_binding_t; + struct GVJ_s { GVC_t *gvc; /* parent gvc */ GVJ_t *next; /* linked list of jobs */ @@ -150,11 +160,13 @@ extern "C" { unsigned int width; /* device width in device units */ unsigned int height; /* device height in device units */ + box boundingBox; /* drawable region in device units */ int dpi; /* device resolution device-units-per-inch */ + + boxf bb; /* bb in graph units */ double zoom; /* viewport zoom factor */ int rotation; /* viewport rotation 0=portrait, 1=landscape */ pointf focus; /* viewport focus in graph units */ - box boundingBox; /* drawable region in device units */ boxf clip; /* clip region in graph units */ boxf pageBoxClip; /* intersection of clip and pageBox */ @@ -183,14 +195,12 @@ extern "C" { /* e.g. "color" "red" "style" "filled" */ void *window; /* display-specific data for gvrender plugin */ - }; - typedef int (*gvevent_key_callback_t) (GVJ_t * job); - - typedef struct gvevent_key_binding_s { - char *keystring; - gvevent_key_callback_t callback; - } gvevent_key_binding_t; + /* keybindings for keyboard events */ + gvevent_key_binding_t *keybindings; + int numkeys; + void *keycodes; + }; #ifdef __cplusplus } diff --git a/lib/gvc/gvdevice.c b/lib/gvc/gvdevice.c index 0c95b5272..c78b2d185 100644 --- a/lib/gvc/gvdevice.c +++ b/lib/gvc/gvdevice.c @@ -82,18 +82,18 @@ extern gvdevice_callbacks_t gvdevice_callbacks; void gvdevice_finalize(GVC_t * gvc) { - GVJ_t *job = gvc->active_jobs; - gvdevice_engine_t *gvde = job->device.engine; + GVJ_t *firstjob = gvc->active_jobs; + gvdevice_engine_t *gvde = firstjob->device.engine; if (gvde) { if (gvde->finalize) { - job->callbacks = &gvdevice_callbacks; - gvde->finalize(gvc); + firstjob->callbacks = &gvdevice_callbacks; + gvde->finalize(firstjob); } } #ifndef DISABLE_CODEGENS else { - codegen_t *cg = job->codegen; + codegen_t *cg = firstjob->codegen; if (cg && cg->reset) cg->reset(); diff --git a/lib/gvc/gvplugin_device.h b/lib/gvc/gvplugin_device.h index a90bbf664..a073ed0c7 100644 --- a/lib/gvc/gvplugin_device.h +++ b/lib/gvc/gvplugin_device.h @@ -18,16 +18,14 @@ #define GVDEVICE_PLUGIN_H #include "gvplugin.h" -#include "geom.h" -#include "color.h" -#include "gvcint.h" +#include "gvcjob.h" #ifdef __cplusplus extern "C" { #endif struct gvdevice_engine_s { - void (*finalize) (GVC_t * gvc); + void (*finalize) (GVJ_t * firstjob); }; #ifdef __cplusplus diff --git a/lib/gvc/gvrender.c b/lib/gvc/gvrender.c index 134a9ed30..8ccb16eee 100644 --- a/lib/gvc/gvrender.c +++ b/lib/gvc/gvrender.c @@ -33,6 +33,7 @@ #include "memory.h" #include "pathplan.h" #include "color.h" +#include "colorprocs.h" #include "const.h" #include "types.h" #include "macros.h" @@ -125,6 +126,7 @@ void gvrender_begin_job(GVJ_t * job) GVC_t *gvc = job->gvc; gvrender_engine_t *gvre = job->render.engine; + job->bb = gvc->bb; if (gvre) { if (gvre->begin_job) gvre->begin_job(job);