]> granicus.if.org Git - graphviz/commitdiff
eliminate types.h from device plugin api (no access to graph types or funcs)
authorellson <devnull@localhost>
Tue, 18 Oct 2005 18:47:22 +0000 (18:47 +0000)
committerellson <devnull@localhost>
Tue, 18 Oct 2005 18:47:22 +0000 (18:47 +0000)
lib/gvc/gvcjob.h
lib/gvc/gvdevice.c
lib/gvc/gvplugin_device.h
lib/gvc/gvrender.c

index 2d0fd349a19f0e3a61f6538ef22347c4ed0fb894..fe042962a5ff2e770cf630d178544bdbb418771c 100644 (file)
@@ -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
 }
index 0c95b5272dd509da48f3e9c18dcb7bc0581f6d9e..c78b2d18505bc40197f3176d3741a74f82d951df 100644 (file)
@@ -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();
index a90bbf664b5425952c48a33ac8e7d95fea96cc6f..a073ed0c7700e9ae868d87d81c9bc0a12481be65 100644 (file)
 #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
index 134a9ed3080c09b75b662c498a66a04c2178dac5..8ccb16eee21efd4144ceedca4c7054a4296507ea 100644 (file)
@@ -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);