Graphviz  2.39.20150520.1950
Go to the documentation of this file.
3 /*************************************************************************
4  * Copyright (c) 2011 AT&T Intellectual Property
5  * All rights reserved. This program and the accompanying materials
6  * are made available under the terms of the Eclipse Public License v1.0
7  * which accompanies this distribution, and is available at
8  *
9  *
10  * Contributors: See CVS logs. Details at
11  *************************************************************************/
13 #ifndef GV_RENDER_H
14 #define GV_RENDER_H
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
20 #ifdef HAVE_CONFIG_H
21 #include "config.h"
22 #endif
24 #ifdef HAVE_SYS_TYPES_H
25 #include <sys/types.h>
26 #endif
27 #ifdef HAVE_STDLIB_H
28 #include <stdlib.h>
29 #endif
30 #ifdef HAVE_STDDEF_H
31 #include <stddef.h>
32 #endif
33 #ifdef HAVE_STRINGS_H
34 #include <strings.h>
35 #endif
36 #ifdef HAVE_STRING_H
37 #include <string.h>
38 #endif
40 #include "types.h"
41 #include "macros.h"
42 #include "const.h"
43 #include "globals.h"
44 #include "memory.h"
45 #include "colorprocs.h" /* must collow color.h (in types.h) */
46 #include "geomprocs.h" /* must follow geom.h (in types.h) */
47 #include "agxbuf.h"
48 #include "utils.h" /* must follow types.h and agxbuf.h */
49 #include "gvplugin.h" /* must follow gvcext.h (in types.h) */
50 #include "gvcjob.h" /* must follow gvcext.h (in types.h) */
51 #include "gvcint.h" /* must follow gvcext.h (in types.h) */
52 #include "gvcproc.h" /* must follow gvcext.h (in types.h) */
54  typedef struct epsf_s {
55  int macro_id;
57  } epsf_t;
59  typedef void (*nodesizefn_t) (Agnode_t *, boolean);
61 /*visual studio*/
62 #ifdef WIN32
63 #ifndef GVC_EXPORTS
64 #define extern __declspec(dllimport)
65 #endif
66 #endif
67 /*end visual studio*/
69  extern void add_box(path *, boxf);
70  extern void arrow_flags(Agedge_t * e, int *sflag, int *eflag);
71  extern boxf arrow_bb(pointf p, pointf u, double arrowsize, int flag);
72  extern void arrow_gen(GVJ_t * job, emit_state_t emit_state, pointf p, pointf u,
73  double arrowsize, double penwidth, int flag);
74  extern double arrow_length(edge_t * e, int flag);
75  extern int arrowEndClip(edge_t*, pointf*, int, int , bezier*, int eflag);
76  extern int arrowStartClip(edge_t*, pointf* ps, int, int, bezier*, int sflag);
77  extern void arrowOrthoClip(edge_t*, pointf* ps, int, int, bezier*, int sflag, int eflag);
78  extern void beginpath(path *, Agedge_t *, int, pathend_t *, boolean);
79  extern void bezier_clip(inside_t * inside_context,
80  boolean(*insidefn) (inside_t * inside_context,
81  pointf p), pointf * sp,
82  boolean left_inside);
83  extern shape_desc *bind_shape(char *name, node_t *);
84  extern void makeStraightEdge(graph_t * g, edge_t * e, int edgetype, splineInfo * info);
85  extern void makeStraightEdges(graph_t* g, edge_t** edges, int e_cnt, int et, splineInfo* sinfo);
86  extern void clip_and_install(edge_t * fe, node_t * hn,
87  pointf * ps, int pn, splineInfo * info);
88  extern char* charsetToStr (int c);
89  extern pointf coord(node_t * n);
90  extern void do_graph_label(graph_t * sg);
91  extern void graph_init(graph_t * g, boolean use_rankdir);
92  extern void graph_cleanup(graph_t * g);
93  extern int dotneato_args_initialize(GVC_t * gvc, int, char **);
94  extern int dotneato_usage(int);
95  extern void dotneato_postprocess(Agraph_t *);
96  extern void gv_postprocess(Agraph_t *, int);
97  extern void dotneato_set_margins(GVC_t * gvc, Agraph_t *);
98  extern void dotneato_write(GVC_t * gvc, graph_t *g);
99  extern void dotneato_write_one(GVC_t * gvc, graph_t *g);
100  extern Ppolyline_t* ellipticWedge (pointf ctr, double major, double minor, double angle0, double angle1);
101  extern void emit_clusters(GVJ_t * job, Agraph_t * g, int flags);
102  extern char* getObjId (GVJ_t* job, void* obj, agxbuf* xb);
103  /* extern void emit_begin_edge(GVJ_t * job, edge_t * e, char**); */
104  /* extern void emit_end_edge(GVJ_t * job); */
105  extern void emit_graph(GVJ_t * job, graph_t * g);
106  extern void emit_label(GVJ_t * job, emit_state_t emit_state, textlabel_t *);
107  extern int emit_once(char *message);
108  extern void emit_jobs_eof(GVC_t * gvc);
109  extern void emit_map_rect(GVJ_t *job, boxf b);
110  extern void enqueue_neighbors(nodequeue *, Agnode_t *, int);
111  extern void endpath(path *, Agedge_t *, int, pathend_t *, boolean);
112  extern void epsf_init(node_t * n);
113  extern void epsf_free(node_t * n);
114  extern shape_desc *find_user_shape(const char *);
115  extern void free_line(textspan_t *);
116  extern void free_label(textlabel_t *);
117  extern void free_textspan(textspan_t * tl, int);
118  extern void getdouble(graph_t * g, char *name, double *result);
119  extern splines *getsplinepoints(edge_t * e);
120  extern void gv_fixLocale (int set);
121  extern void gv_free_splines(edge_t * e);
122  extern void gv_cleanup_edge(Agedge_t * e);
123  extern void gv_cleanup_node(Agnode_t * n);
124  extern void* init_xdot (Agraph_t* g);
125  extern int initMapData (GVJ_t*, char*, char*, char*, char*, char*, void*);
126  extern boolean isPolygon(node_t *);
127  extern void makeSelfEdge(path * P, edge_t * edges[], int ind, int cnt,
128  double sizex, double sizey, splineInfo * sinfo);
129  extern textlabel_t *make_label(void *obj, char *str, int kind, double fontsize, char *fontname, char *fontcolor);
130  extern bezier *new_spline(edge_t * e, int sz);
131  extern char **parse_style(char *s);
132  extern void place_graph_label(Agraph_t *);
133  extern int place_portlabel(edge_t * e, boolean head_p);
134  extern void makePortLabels(edge_t * e);
135  extern pointf edgeMidpoint(graph_t* g, edge_t * e);
136  extern void addEdgeLabels(graph_t* g, edge_t * e, pointf rp, pointf rq);
137  extern void pop_obj_state(GVJ_t *job);
138  extern obj_state_t* push_obj_state(GVJ_t *job);
139  extern int rank(graph_t * g, int balance, int maxiter);
140  extern port resolvePort(node_t* n, node_t* other, port* oldport);
141  extern void resolvePorts (edge_t* e);
142  extern void round_corners(GVJ_t * job, pointf * AF, int sides, int style, int filled);
143  extern int routesplinesinit(void);
144  extern pointf *routesplines(path *, int *);
145  extern void routesplinesterm(void);
146  extern pointf* simpleSplineRoute (pointf, pointf, Ppoly_t, int*, int);
147  extern pointf *routepolylines(path* pp, int* npoints);
148  extern int selfRightSpace (edge_t* e);
149  extern void setup_graph(GVC_t * gvc, graph_t * g);
150  extern shape_kind shapeOf(node_t *);
151  extern void shape_clip(node_t * n, pointf curve[4]);
152  extern void make_simple_label (GVC_t * gvc, textlabel_t* rv);
153  extern int stripedBox (GVJ_t * job, pointf* AF, char* clrs, int rotate);
154  extern stroke_t* taper (bezier*, double (*radfunc_t)(double,double,double), double initwid, int linejoin, int linecap);
155  extern stroke_t* taper0 (bezier* bez, double initwid);
156  extern pointf textspan_size(GVC_t * gvc, textspan_t * span);
157  extern Dt_t * textfont_dict_open(GVC_t *gvc);
158  extern void textfont_dict_close(GVC_t *gvc);
159  extern void translate_bb(Agraph_t *, int);
160  extern int wedgedEllipse (GVJ_t* job, pointf * pf, char* clrs);
161  extern void update_bb_bz(boxf *bb, pointf *cp);
162  extern void write_attributed_dot(graph_t *g, FILE *f);
163  extern void write_canonical_dot(graph_t *g, FILE *f);
164  extern boxf xdotBB (graph_t* g);
165  extern char *findAttrColor(void *obj, attrsym_t *colorattr, char *dflt);
167 #undef extern
169 #ifdef __cplusplus
170 }
171 #endif
173 #endif
char * charsetToStr(int c)
Definition: input.c:864
shape_desc * find_user_shape(const char *)
Definition: shapes.c:3766
void place_graph_label(Agraph_t *)
Definition: postproc.c:736
int dotneato_usage(int)
Definition: input.c:71
bezier * new_spline(edge_t *e, int sz)
Definition: splines.c:218
pointf * routesplines(path *, int *)
Definition: routespl.c:653
Definition: types.h:68
double arrow_length(edge_t *e, int flag)
Definition: arrows.c:229
void free_label(textlabel_t *)
Definition: labels.c:209
pointf edgeMidpoint(graph_t *g, edge_t *e)
Definition: splines.c:1321
double(* radfunc_t)(double, double, double)
Definition: emit.c:2170
void enqueue_neighbors(nodequeue *, Agnode_t *, int)
Definition: mincross.c:1440
unsigned char boolean
Definition: types.h:25
Definition: gvcjob.h:182
Dt_t * textfont_dict_open(GVC_t *gvc)
Definition: textspan.c:279
shape_kind shapeOf(node_t *)
Definition: shapes.c:1797
splines * getsplinepoints(edge_t *e)
Definition: splines.c:1478
pointf * routepolylines(path *pp, int *npoints)
Definition: routespl.c:658
int rank(graph_t *g, int balance, int maxiter)
Definition: ns.c:681
Definition: types.h:115
char * getObjId(GVJ_t *job, void *obj, agxbuf *xb)
Definition: emit.c:200
void beginpath(path *, Agedge_t *, int, pathend_t *, boolean)
Definition: splines.c:393
Definition: render.h:54
Definition: geom.h:30
void emit_label(GVJ_t *job, emit_state_t emit_state, textlabel_t *)
Definition: labels.c:222
void free_textspan(textspan_t *tl, int)
Definition: labels.c:193
void arrowOrthoClip(edge_t *, pointf *ps, int, int, bezier *, int sflag, int eflag)
Definition: arrows.c:323
int wedgedEllipse(GVJ_t *job, pointf *pf, char *clrs)
Definition: emit.c:503
void emit_map_rect(GVJ_t *job, boxf b)
Definition: emit.c:600
void makeStraightEdges(graph_t *g, edge_t **edges, int e_cnt, int et, splineInfo *sinfo)
Definition: routespl.c:962
void epsf_init(node_t *n)
Definition: psusershape.c:98
void endpath(path *, Agedge_t *, int, pathend_t *, boolean)
Definition: splines.c:588
void clip_and_install(edge_t *fe, node_t *hn, pointf *ps, int pn, splineInfo *info)
Definition: splines.c:241
void arrow_flags(Agedge_t *e, int *sflag, int *eflag)
Definition: arrows.c:198
void epsf_free(node_t *n)
Definition: psusershape.c:121
pointf * simpleSplineRoute(pointf, pointf, Ppoly_t, int *, int)
Definition: routespl.c:230
void gv_cleanup_edge(Agedge_t *e)
Definition: utils.c:1907
void add_box(path *, boxf)
Definition: splines.c:352
Definition: gvcjob.h:271
void write_attributed_dot(graph_t *g, FILE *f)
void dotneato_write_one(GVC_t *gvc, graph_t *g)
void update_bb_bz(boxf *bb, pointf *cp)
Definition: emit.c:723
Definition: types.h:182
struct epsf_s epsf_t
void emit_jobs_eof(GVC_t *gvc)
int routesplinesinit(void)
Definition: routespl.c:288
void addEdgeLabels(graph_t *g, edge_t *e, pointf rp, pointf rq)
Definition: splines.c:1355
void gv_fixLocale(int set)
Definition: emit.c:3991
void * init_xdot(Agraph_t *g)
Definition: emit.c:46
boxf xdotBB(graph_t *g)
Definition: emit.c:2926
void translate_bb(Agraph_t *, int)
Definition: postproc.c:121
void do_graph_label(graph_t *sg)
Definition: input.c:890
void write_canonical_dot(graph_t *g, FILE *f)
void textfont_dict_close(GVC_t *gvc)
Definition: textspan.c:286
void routesplinesterm(void)
Definition: routespl.c:313
int selfRightSpace(edge_t *e)
Definition: splines.c:1163
Definition: gvcint.h:70
void getdouble(graph_t *g, char *name, double *result)
Definition: input.c:474
int macro_id
Definition: render.h:55
void dotneato_postprocess(Agraph_t *)
Definition: postproc.c:693
char * findAttrColor(void *obj, attrsym_t *colorattr, char *dflt)
Definition: shapes.c:348
void make_simple_label(GVC_t *gvc, textlabel_t *rv)
Definition: labels.c:51
stroke_t * taper(bezier *, double(*radfunc_t)(double, double, double), double initwid, int linejoin, int linecap)
Definition: taper.c:271
void makePortLabels(edge_t *e)
Definition: splines.c:1237
void arrow_gen(GVJ_t *job, emit_state_t emit_state, pointf p, pointf u, double arrowsize, double penwidth, int flag)
Definition: arrows.c:729
Definition: grammar.c:79
void graph_cleanup(graph_t *g)
Definition: input.c:845
int initMapData(GVJ_t *, char *, char *, char *, char *, char *, void *)
Definition: emit.c:148
void gv_free_splines(edge_t *e)
Definition: utils.c:1895
textlabel_t * make_label(void *obj, char *str, int kind, double fontsize, char *fontname, char *fontcolor)
Definition: labels.c:115
Definition: geom.h:28
void shape_clip(node_t *n, pointf curve[4])
Definition: splines.c:195
void round_corners(GVJ_t *job, pointf *AF, int sides, int style, int filled)
Definition: shapes.c:497
GVC_t * gvc
Definition: htmlparse.c:87
void gv_cleanup_node(Agnode_t *n)
Definition: utils.c:1919
void makeSelfEdge(path *P, edge_t *edges[], int ind, int cnt, double sizex, double sizey, splineInfo *sinfo)
Definition: splines.c:1191
Definition: types.h:108
char * result
Definition: gvdevice.c:445
void dotneato_set_margins(GVC_t *gvc, Agraph_t *)
void free_line(textspan_t *)
void emit_clusters(GVJ_t *job, Agraph_t *g, int flags)
Definition: emit.c:3581
Definition: types.h:101
int dotneato_args_initialize(GVC_t *gvc, int, char **)
Definition: input.c:223
void makeStraightEdge(graph_t *g, edge_t *e, int edgetype, splineInfo *info)
Definition: routespl.c:936
int arrowEndClip(edge_t *, pointf *, int, int, bezier *, int eflag)
Definition: arrows.c:256
void gv_postprocess(Agraph_t *, int)
Definition: postproc.c:603
void pop_obj_state(GVJ_t *job)
Definition: emit.c:115
int arrowStartClip(edge_t *, pointf *ps, int, int, bezier *, int sflag)
Definition: arrows.c:285
port resolvePort(node_t *n, node_t *other, port *oldport)
Definition: shapes.c:4068
Definition: types.h:57
void(* pf)(char *, void *)
Definition: xdot.c:501
pointf textspan_size(GVC_t *gvc, textspan_t *span)
Definition: textspan.c:198
void setup_graph(GVC_t *gvc, graph_t *g)
Definition: cdt.h:120
agxbuf * str
Definition: htmlparse.c:85
void resolvePorts(edge_t *e)
Definition: shapes.c:4080
int place_portlabel(edge_t *e, boolean head_p)
Definition: splines.c:1425
boxf arrow_bb(pointf p, pointf u, double arrowsize, int flag)
Definition: arrows.c:691
void graph_init(graph_t *g, boolean use_rankdir)
Definition: input.c:653
Definition: agxbuf.h:24
boolean isPolygon(node_t *)
Definition: shapes.c:1817
pointf coord(node_t *n)
Definition: utils.c:200
obj_state_t * push_obj_state(GVJ_t *job)
Definition: emit.c:86
Ppolyline_t * ellipticWedge(pointf ctr, double major, double minor, double angle0, double angle1)
Definition: ellipse.c:565
int stripedBox(GVJ_t *job, pointf *AF, char *clrs, int rotate)
Definition: emit.c:554
int emit_once(char *message)
Definition: emit.c:3542
void dotneato_write(GVC_t *gvc, graph_t *g)
shape_desc * bind_shape(char *name, node_t *)
Definition: shapes.c:3800
Definition: geom.h:37
char ** parse_style(char *s)
Definition: emit.c:3812
point offset
Definition: render.h:56
void bezier_clip(inside_t *inside_context, boolean(*insidefn)(inside_t *inside_context, pointf p), pointf *sp, boolean left_inside)
Definition: splines.c:106
stroke_t * taper0(bezier *bez, double initwid)
Definition: taper.c:423
void(* nodesizefn_t)(Agnode_t *, boolean)
Definition: render.h:59
void emit_graph(GVJ_t *job, graph_t *g)
Definition: emit.c:3466