]> granicus.if.org Git - graphviz/commitdiff
split colorprocs.h from color.h so that plugins can use color types without
authorellson <devnull@localhost>
Tue, 18 Oct 2005 18:48:08 +0000 (18:48 +0000)
committerellson <devnull@localhost>
Tue, 18 Oct 2005 18:48:08 +0000 (18:48 +0000)
functions

lib/common/Makefile.am
lib/common/Makefile.old
lib/common/color.h
lib/common/colorprocs.h [new file with mode: 0644]
lib/common/colxlate.c
lib/common/emit.c
lib/common/render.h
lib/gvc/gvcjob.h
lib/gvc/gvrender.c

index e4a1fe2647e7a97dd6ae560adf6d1bfe4001b537..da7ef971d8fc6572954ca827b838183aa86215ff 100644 (file)
@@ -9,7 +9,8 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/lib/graph \
        -I$(top_srcdir)/lib/cdt  @GD_INCLUDES@ @EXPAT_INCLUDES@ @Z_INCLUDES@
 
-pkginclude_HEADERS = logic.h arith.h geom.h geomprocs.h color.h colortbl.h \
+pkginclude_HEADERS = logic.h arith.h geom.h geomprocs.h \
+       color.h colorprocs.h colortbl.h \
        const.h macros.h types.h globals.h utils.h memory.h \
        htmllex.h htmltable.h pointset.h render.h
 noinst_LTLIBRARIES = libcommon.la
index 1c49bfc9ee72cd832993bcd6ef0585082e9614ee..5d074b7072ebd09ddaf6094d05a105054927196e 100644 (file)
@@ -19,7 +19,8 @@ DEFINES = -DHAVE_CONFIG_H
 AWKDIR = $(ROOT)/awk
 
 INST_HDRS = const.h globals.h macros.h render.h \
-       types.h utils.h geom.h geomprocs.h logic.h color.h arith.h memory.h
+       types.h utils.h geom.h geomprocs.h logic.h \
+       color.h colorprocs.h arith.h memory.h
 
 NOINST_HDRS = colortbl.h ps.h htmltable.h htmlparse.h htmllex.h
 
index 2185270d93e0d121e5dd72be402c948fb6143b8d..d69b5f069f56f4ff56256aef35200a32d6b69eb9 100644 (file)
@@ -50,9 +50,6 @@ typedef struct color_s {
 #define COLOR_UNKNOWN 1
 #define COLOR_OK 0
 
-extern int colorxlate(char *str, color_t * color, color_type_t target_type);
-extern char *canontoken(char *str);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/common/colorprocs.h b/lib/common/colorprocs.h
new file mode 100644 (file)
index 0000000..bd75146
--- /dev/null
@@ -0,0 +1,30 @@
+/* $Id$ $Revision$ */
+/* vim:set shiftwidth=4 ts=8: */
+
+/**********************************************************
+*      This software is part of the graphviz package      *
+*                http://www.graphviz.org/                 *
+*                                                         *
+*            Copyright (c) 1994-2004 AT&T Corp.           *
+*                and is licensed under the                *
+*            Common Public License, Version 1.0           *
+*                      by AT&T Corp.                      *
+*                                                         *
+*        Information and Software Systems Research        *
+*              AT&T Research, Florham Park NJ             *
+**********************************************************/
+
+#ifndef GV_COLORPROCS_H
+#define GV_COLORPROCS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int colorxlate(char *str, color_t * color, color_type_t target_type);
+extern char *canontoken(char *str);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
index c12a6feaf851aae5c3a57c49e0c79d6160a4af59..266f9ed4ad1265bde9d9f027a10a10d68c8e4122 100644 (file)
@@ -20,6 +20,7 @@
 #include <ctype.h>
 
 #include "color.h"
+#include "colorprocs.h"
 #include "colortbl.h"
 
 static void hsv2rgb(double h, double s, double v,
index 35ac33063c0a8b939bff21723e00a5b9ebe09e8a..7e1b91f101d4638883cbeed71111ca4090cd070c 100644 (file)
@@ -789,6 +789,18 @@ void emit_edge_graphics(GVJ_t * job, edge_t * e)
            color = late_nnstring(e, E_activefillcolor, DEFAULT_ACTIVEFILLCOLOR);
            gvrender_set_fillcolor(job, color);
        }
+       else if (ED_deleted(e)) {
+           color = late_nnstring(e, E_deletedpencolor, DEFAULT_DELETEDPENCOLOR);
+           gvrender_set_pencolor(job, color);
+           color = late_nnstring(e, E_deletedfillcolor, DEFAULT_DELETEDFILLCOLOR);
+           gvrender_set_fillcolor(job, color);
+       }
+       else if (ED_visited(e)) {
+           color = late_nnstring(e, E_visitedpencolor, DEFAULT_VISITEDPENCOLOR);
+           gvrender_set_pencolor(job, color);
+           color = late_nnstring(e, E_visitedfillcolor, DEFAULT_VISITEDFILLCOLOR);
+           gvrender_set_fillcolor(job, color);
+       }
        /* if more than one color - then generate parallel beziers, one per color */
        if (numc) {
            /* calculate and save offset vector spline and initialize first offset spline */
@@ -1409,6 +1421,18 @@ void emit_clusters(GVJ_t * job, Agraph_t * g, int flags)
            color = late_nnstring(sg, G_activefillcolor, DEFAULT_ACTIVEFILLCOLOR);
            gvrender_set_fillcolor(job, color);
        }
+       else if (GD_deleted(sg)) {
+           color = late_nnstring(sg, G_deletedpencolor, DEFAULT_DELETEDPENCOLOR);
+           gvrender_set_pencolor(job, color);
+           color = late_nnstring(sg, G_deletedfillcolor, DEFAULT_DELETEDFILLCOLOR);
+           gvrender_set_fillcolor(job, color);
+       }
+       else if (GD_visited(sg)) {
+           color = late_nnstring(sg, G_visitedpencolor, DEFAULT_VISITEDPENCOLOR);
+           gvrender_set_pencolor(job, color);
+           color = late_nnstring(sg, G_visitedfillcolor, DEFAULT_VISITEDFILLCOLOR);
+           gvrender_set_fillcolor(job, color);
+       }
        else {
            if (((color = agget(sg, "pencolor")) != 0) && color[0])
                gvrender_set_pencolor(job, color);
index c075bdfcd40ddc799172c9b53ce686c49e73b3b8..e8a0e841b0ba37074e2cfa4956d0f2124d19ac5a 100644 (file)
@@ -57,6 +57,7 @@ extern "C" {
 #include "types.h"
 #include "globals.h"
 #include "memory.h"
+#include "colorprocs.h"                /* must collow color.h (in types.h) */
 #include "geomprocs.h"         /* must follow geom.h (in types.h) */
 #include "graph.h"             /* must follow types.h */
 #include "utils.h"             /* must follow types.h */
index fe042962a5ff2e770cf630d178544bdbb418771c..f4dbfeaa9e2bf9727940dc3d0365956fffb4f923 100644 (file)
@@ -112,13 +112,6 @@ 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 */
@@ -160,13 +153,11 @@ 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 */
@@ -195,13 +186,15 @@ extern "C" {
                                /* e.g. "color" "red" "style" "filled" */
 
        void *window;           /* display-specific data for gvrender plugin */
-
-        /* keybindings for keyboard events */
-       gvevent_key_binding_t *keybindings;
-       int numkeys;
-       void *keycodes;
     };
 
+    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;
+
 #ifdef __cplusplus
 }
 #endif
index 8ccb16eee21efd4144ceedca4c7054a4296507ea..64ef91939ab479effad839b218093432498615e7 100644 (file)
@@ -126,7 +126,6 @@ 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);