From 4d40cf139d87921385454ba6d9cf01c458481bad Mon Sep 17 00:00:00 2001 From: ellson Date: Tue, 18 Oct 2005 18:43:48 +0000 Subject: [PATCH] separate geomprocs.h so that plugins don't get accidental access to libgvc --- lib/common/geom.c | 1 + lib/common/geom.h | 33 +--------------------- lib/common/geomprocs.h | 62 ++++++++++++++++++++++++++++++++++++++++++ lib/common/render.h | 5 ++-- 4 files changed, 67 insertions(+), 34 deletions(-) create mode 100644 lib/common/geomprocs.h diff --git a/lib/common/geom.c b/lib/common/geom.c index 322f7235d..7d55efe43 100644 --- a/lib/common/geom.c +++ b/lib/common/geom.c @@ -19,6 +19,7 @@ #include #include "geom.h" +#include "geomprocs.h" point pointof(int x, int y) { diff --git a/lib/common/geom.h b/lib/common/geom.h index 4821bfad9..751691398 100644 --- a/lib/common/geom.h +++ b/lib/common/geom.h @@ -14,7 +14,7 @@ * AT&T Research, Florham Park NJ * **********************************************************/ -/* geometric functions (e.g. on points and boxes) with application to, but +/* geometric types and macros (e.g. points and boxes) with application to, but * no specific dependance on graphs */ #include "arith.h" @@ -61,37 +61,6 @@ typedef struct { pointf LL, UR; } boxf; #define B2BF(b, bf) (bf.LL.x = b.LL.x, bf.LL.y = b.LL.y, bf.UR.x = b.UR.x, bf.UR.y = b.UR.y) #define BF2B(bf, b) (b.LL.x = ROUND (bf.LL.x), b.LL.y = ROUND (bf.LL.y), b.UR.x = ROUND (bf.UR.x), b.UR.y = ROUND (bf.UR.y)) -extern point pointof(int, int); -extern pointf cvt2ptf(point); -extern point cvt2pt(pointf); -extern point add_points(point, point); -extern pointf add_pointfs(pointf, pointf); -extern point sub_points(point, point); -extern pointf sub_pointfs(pointf, pointf); -extern point exch_xy(point p); -extern pointf exch_xyf(pointf p); - -extern box boxof(int llx, int lly, int urx, int ury); -extern boxf boxfof(double llx, double lly, double urx, double ury); -extern box mkbox(point, point); -extern boxf mkboxf(pointf, pointf); -extern box box_bb(box, box); -extern boxf boxf_bb(boxf, boxf); -extern box box_intersect(box, box); -extern boxf boxf_intersect(boxf, boxf); -extern bool box_overlap(box, box); -extern bool boxf_overlap(boxf, boxf); -extern bool box_contains(box, box); -extern bool boxf_contains(boxf, boxf); -extern box flip_rec_box(box b, point p); - -extern int lineToBox(pointf p1, pointf p2, boxf b); - -extern point ccwrotatep(point p, int ccwrot); -extern pointf ccwrotatepf(pointf p, int ccwrot); -extern point cwrotatep(point p, int cwrot); -extern pointf cwrotatepf(pointf p, int cwrot); - #ifdef __cplusplus } #endif diff --git a/lib/common/geomprocs.h b/lib/common/geomprocs.h new file mode 100644 index 000000000..1f780a6d3 --- /dev/null +++ b/lib/common/geomprocs.h @@ -0,0 +1,62 @@ +/* $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 * +**********************************************************/ + +/* geometric functions (e.g. on points and boxes) with application to, but + * no specific dependance on graphs */ + +#ifndef GV_GEOMPROCS_H +#define GV_GEOMPROCS_H + +#ifdef __cplusplus +extern "C" { +#endif + +extern point pointof(int, int); +extern pointf cvt2ptf(point); +extern point cvt2pt(pointf); +extern point add_points(point, point); +extern pointf add_pointfs(pointf, pointf); +extern point sub_points(point, point); +extern pointf sub_pointfs(pointf, pointf); +extern point exch_xy(point p); +extern pointf exch_xyf(pointf p); + +extern box boxof(int llx, int lly, int urx, int ury); +extern boxf boxfof(double llx, double lly, double urx, double ury); +extern box mkbox(point, point); +extern boxf mkboxf(pointf, pointf); +extern box box_bb(box, box); +extern boxf boxf_bb(boxf, boxf); +extern box box_intersect(box, box); +extern boxf boxf_intersect(boxf, boxf); +extern bool box_overlap(box, box); +extern bool boxf_overlap(boxf, boxf); +extern bool box_contains(box, box); +extern bool boxf_contains(boxf, boxf); +extern box flip_rec_box(box b, point p); + +extern int lineToBox(pointf p1, pointf p2, boxf b); + +extern point ccwrotatep(point p, int ccwrot); +extern pointf ccwrotatepf(pointf p, int ccwrot); +extern point cwrotatep(point p, int cwrot); +extern pointf cwrotatepf(pointf p, int cwrot); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/lib/common/render.h b/lib/common/render.h index fe983a231..a2a3af302 100644 --- a/lib/common/render.h +++ b/lib/common/render.h @@ -56,10 +56,11 @@ extern "C" { #include "macros.h" #include "const.h" #include "types.h" -#include "graph.h" /* must follow types.h */ #include "globals.h" #include "memory.h" -#include "utils.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 */ typedef struct epsf_s { int macro_id; -- 2.40.0