]> granicus.if.org Git - graphviz/commitdiff
simplify device plugin api to single "finalize" entry point
authorellson <devnull@localhost>
Wed, 22 Jun 2005 15:27:34 +0000 (15:27 +0000)
committerellson <devnull@localhost>
Wed, 22 Jun 2005 15:27:34 +0000 (15:27 +0000)
lib/common/emit.c
lib/gvc/gvcint.h
lib/gvc/gvdevice.c
lib/gvc/gvplugin_device.h

index 6e10e3989d5cc4f4ec1d527f1cd674e15b7ef34c..de775ba8d788888cae4ecd3f8d35f766475eb18a 100644 (file)
@@ -1337,7 +1337,6 @@ void emit_jobs_eof(GVC_t * gvc)
         if (job->output_file) {
            if (gvc->viewNum > 0) {
                gvrender_end_job(job);
-               gvdevice_end_job(job);
                emit_once_reset();
                gvc->viewNum = 0;
            }
@@ -1615,7 +1614,6 @@ static void emit_job(GVJ_t * job, graph_t * g)
     init_job_viewport(job, g);
     init_job_pagination(job, g);
 
-    gvdevice_begin_job(job);
     gvrender_begin_job(job);
 
     switch (job->output_lang) {
@@ -1747,6 +1745,9 @@ static void init_bb(graph_t *g)
        init_bb_node(g, n);
 }
 
+extern gvevent_key_binding_t gvevent_key_binding[];
+extern int gvevent_key_binding_size;
+
 void emit_jobs (GVC_t * gvc, graph_t * g)
 {
     GVJ_t *job;
@@ -1755,6 +1756,9 @@ void emit_jobs (GVC_t * gvc, graph_t * g)
     init_layering(gvc, g);
     init_bb(g);
 
+    gvc->keybindings = gvevent_key_binding;
+    gvc->numkeys = gvevent_key_binding_size;
+
 /*     gvc->active_jobs = NULL;  acive job sets can straddle multiple input graphs */
     for (job = gvrender_first_job(gvc); job; job = gvrender_next_job(gvc)) {
        job->g = g;
@@ -1779,8 +1783,6 @@ void emit_jobs (GVC_t * gvc, graph_t * g)
            /* clear active list */
            gvc->active_jobs = NULL;
         }
-       if (! gvc->active_jobs)
-           gvdevice_initialize(gvc);
 
        /* insert job in active list */
        job->next_active = gvc->active_jobs;
index e2927a2ec19c3ca1e4a84044f9701fa927259e8d..ca05cf76e91294de6b755d880258456777dd29e5 100644 (file)
@@ -188,8 +188,6 @@ extern "C" {
        gv_plugin_t *api[ APIS ];  /* array of current plugins per api */
 #undef ELEM
 
-       void *display;          /* display-specific data for gvdisplay plugin */
-
        gvtextlayout_engine_t *textlayout_engine;       /* current text_layout engine */
 
        /* gvrender_begin_job() */
@@ -229,6 +227,11 @@ extern "C" {
 
        /* render defaults set from graph */
        color_t bgcolor;        /* background color */
+
+       /* keybindings for keyboard events */
+       gvevent_key_binding_t *keybindings;
+       int numkeys;
+       void *keycodes;
     };
 
 #ifdef __cplusplus
index 1c56c59c2986197ec4dc7623f81473c4c57895e6..12245b3ff606dd2e2ef0e32fa195d54f842f0cdc 100644 (file)
@@ -75,18 +75,6 @@ int gvdevice_features(GVJ_t * job)
     return features;
 }
 
-extern gvevent_key_binding_t gvevent_key_binding[];
-extern int gvevent_key_binding_size;
-
-void gvdevice_initialize(GVC_t * gvc)
-{
-    GVJ_t *job = gvc->job;
-    gvdevice_engine_t *gvde = job->device_engine;
-
-    if (gvde && gvde->initialize)
-           gvde->initialize(gvc, gvevent_key_binding, gvevent_key_binding_size);
-}
-
 void gvdevice_finalize(GVC_t * gvc)
 {
     GVJ_t *job = gvc->active_jobs;
@@ -105,43 +93,3 @@ void gvdevice_finalize(GVC_t * gvc)
     }
 #endif
 }
-
-void gvdevice_begin_job(GVJ_t * job)
-{
-    gvdevice_engine_t *gvde = job->device_engine;
-
-    if (gvde) {
-        if (gvde->begin_job)
-            gvde->begin_job(job);
-    }
-#if 0
-#ifndef DISABLE_CODEGENS
-    else {
-        codegen_t *cg = job->codegen;
-
-        if (cg && cg->begin_job)
-            cg->begin_job(job->output_file, job->g, job->gvc->lib, job->gvc->user,
-                          job->gvc->info, job->pagesArraySize);
-    }
-#endif
-#endif
-}
-
-void gvdevice_end_job(GVJ_t * job)
-{
-    gvdevice_engine_t *gvde = job->device_engine;
-
-    if (gvde && gvde->end_job)
-        gvde->end_job(job);
-#if 0
-#ifndef DISABLE_CODEGENS
-    else {
-        codegen_t *cg = job->codegen;
-
-        if (cg && cg->end_job)
-            cg->end_job();
-    }
-#endif
-#endif
-    job->gvc->lib = NULL;
-}
index ae2e1416ef394ff70ab5b722d4ba055422618a56..6131e9bfd64c5f5aabc4ab719f0db214ba699181 100644 (file)
@@ -25,10 +25,7 @@ extern "C" {
 #endif
 
     struct gvdevice_engine_s {
-       void (*initialize) (GVC_t * gvc, gvevent_key_binding_t *keybindings, int numkeys);
        void (*finalize) (GVC_t * gvc);
-       void (*begin_job) (GVJ_t * job);
-        void (*end_job) (GVJ_t * job);
     };
 
 /* callbacks */