--- /dev/null
+/* $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_COLOR_H
+#define GV_COLOR_H
+
+#include "arith.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct hsbcolor_t {
+ char *name;
+ unsigned char h, s, b;
+} hsbcolor_t;
+
+/* possible representations of color in color_t */
+typedef enum { HSV_DOUBLE, RGBA_BYTE, RGBA_WORD, CMYK_BYTE,
+ RGBA_DOUBLE, COLOR_STRING, COLOR_INDEX } color_type_t;
+
+/* color_t can hold a color spec in a choice or representations */
+typedef struct color_s {
+ union {
+ double RGBA[4];
+ double HSV[3];
+ unsigned char rgba[4];
+ unsigned char cmyk[4];
+ int rrggbbaa[4];
+ char *string;
+ int index;
+ } u;
+ color_type_t type;
+} color_t;
+
+#define COLOR_MALLOC_FAIL -1
+#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
+#endif
#include "geom.h"
#include "pathplan.h"
#include "color.h"
+#include "gvcext.h"
#ifdef __cplusplus
extern "C" {
typedef struct Agedge_t edge_t;
typedef struct Agsym_t attrsym_t;
- typedef struct GVC_s GVC_t;
- typedef struct GVJ_s GVJ_t;
- typedef struct gvdevice_engine_s gvdevice_engine_t;
- typedef struct gvrender_engine_s gvrender_engine_t;
- typedef struct gvlayout_engine_s gvlayout_engine_t;
- typedef struct gvtextlayout_engine_s gvtextlayout_engine_t;
- typedef struct gvusershape_engine_s gvusershape_engine_t;
-
typedef struct htmllabel_t htmllabel_t;
typedef union inside_t {
} shape_desc;
#ifndef DISABLE_CODEGENS
- typedef struct codegen_t {
+ struct codegen_s {
void (*reset) (void);
void (*begin_job) (FILE * ofp, graph_t * g, char **lib, char *user,
char *info[], point pages);
void (*textsize) (void); /* not used */
void (*user_shape) (char *name, point * A, int sides, int filled);
void (*usershapesize) (void); /* not used */
- } codegen_t;
+ };
- typedef struct codegen_info_t {
+ struct codegen_info_s {
codegen_t *cg; /* discovered codegen */
char *name; /* output format, null for sentinel */
int id; /* id of output format */
void *info; /* additional info provided by discovery routine */
/* Quartz uses this to store the Quicktime Component */
- } codegen_info_t;
+ };
#endif
b.x = bz.list[j].x;
b.y = bz.list[j].y;
- d2 = dist2(b, pt);
+ d2 = DIST2(b, pt);
if ((bestj == -1) || (d2 < bestdist2)) {
besti = i;
bestj = j;
}
low = 0.0;
high = 1.0;
- dlow2 = dist2(c[0], pt);
- dhigh2 = dist2(c[3], pt);
+ dlow2 = DIST2(c[0], pt);
+ dhigh2 = DIST2(c[3], pt);
do {
t = (low + high) / 2.0;
pt2 = Bezier(c, 3, t, NULL, NULL);
break;
if (dlow2 < dhigh2) {
high = t;
- dhigh2 = dist2(pt2, pt);
+ dhigh2 = DIST2(pt2, pt);
} else {
low = t;
- dlow2 = dist2(pt2, pt);
+ dlow2 = DIST2(pt2, pt);
}
} while (1);
PF2P(pt2, rv);
LIBS = $(LIBLTDL) $(SOCKET_LIBS)
-pkginclude_HEADERS = gvc.h gvcint.h gvplugin.h gvcproc.h gvplugin_render.h \
- gvplugin_layout.h gvplugin_textlayout.h gvplugin_device.h \
- gvplugin_usershape.h
+pkginclude_HEADERS = gvc.h gvcint.h gvcext.h gvplugin.h gvcproc.h \
+ gvplugin_render.h gvplugin_layout.h gvplugin_textlayout.h \
+ gvplugin_device.h gvplugin_usershape.h
pkglib_LTLIBRARIES = libgvc.la
pkgconfig_DATA = libgvc.pc
DEFINES = -DHAVE_CONFIG_H -DGVLIBDIR=\"$(LIBDIR)\"
-HDRS = gvc.h gvcint.h gvcproc.h gvplugin_render.h gvplugin_device.h \
+HDRS = gvc.h gvcint.h gvcext.h gvcproc.h gvplugin_render.h gvplugin_device.h \
gvplugin_layout.h gvplugin_textlayout.h \
gvplugin_usershape.h gvplugin.h
--- /dev/null
+/* $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 *
+**********************************************************/
+
+/* Common header used by both clients and plugins */
+
+#ifndef GVCEXT_H
+#define GVCEXT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ typedef struct gvdevice_engine_s gvdevice_engine_t;
+ typedef struct gvrender_engine_s gvrender_engine_t;
+ typedef struct gvlayout_engine_s gvlayout_engine_t;
+ typedef struct gvtextlayout_engine_s gvtextlayout_engine_t;
+ typedef struct gvusershape_engine_s gvusershape_engine_t;
+
+ typedef struct GVJ_s GVJ_t;
+ typedef struct GVC_s GVC_t;
+
+#ifndef DISABLE_CODEGENS
+ typedef struct codegen_s codegen_t;
+ typedef struct codegen_info_s codegen_info_t;
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
#ifndef GVPLUGIN_H
#define GVPLUGIN_H
+#include "gvcext.h"
+
#ifdef __cplusplus
extern "C" {
#endif
#define GVDEVICE_PLUGIN_H
#include "gvplugin.h"
+#include "geom.h"
+#include "color.h"
#include "gvcint.h"
#ifdef __cplusplus
#define GVLAYOUT_PLUGIN_H
#include "gvplugin.h"
+#include "geom.h"
+#include "color.h"
#include "gvcint.h"
#ifdef __cplusplus
#define GVRENDER_PLUGIN_H
#include "gvplugin.h"
+#include "geom.h"
+#include "color.h"
#include "gvcint.h"
#ifdef __cplusplus
#define GVTEXTLAYOUT_PLUGIN_H
#include "gvplugin.h"
+#include "geom.h"
+#include "color.h"
#include "gvcint.h"
#ifdef __cplusplus
#define GVUSERSHAPE_PLUGIN_H
#include "gvplugin.h"
+#include "geom.h"
+#include "color.h"
#include "gvcint.h"
#ifdef __cplusplus