Graphviz  2.41.20171026.1811
render.h
Go to the documentation of this file.
1 
2 
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  * http://www.eclipse.org/legal/epl-v10.html
9  *
10  * Contributors: See CVS logs. Details at http://www.graphviz.org/
11  *************************************************************************/
12 
13 #ifndef GV_RENDER_H
14 #define GV_RENDER_H
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 #include "config.h"
21 
22 #ifdef HAVE_SYS_TYPES_H
23 #include <sys/types.h>
24 #endif
25 #if !defined(_WIN32) && !defined(DARWIN)
26 #define __USE_GNU
27 #include <stdlib.h>
28 #undef __USE_GNU
29 #else
30 #include <stdlib.h>
31 #endif
32 #include <stddef.h>
33 #ifdef HAVE_STRINGS_H
34 #include <strings.h>
35 #endif
36 #include <string.h>
37 
38 #include <inttypes.h>
39 
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) */
53 
54  typedef struct epsf_s {
55  int macro_id;
57  } epsf_t;
58 
59 /*visual studio*/
60 #ifdef _WIN32
61 #ifndef GVC_EXPORTS
62 #define extern __declspec(dllimport)
63 #endif
64 #endif
65 /*end visual studio*/
66 
67  extern void add_box(path *, boxf);
68  extern void arrow_flags(Agedge_t * e, int *sflag, int *eflag);
69  extern boxf arrow_bb(pointf p, pointf u, double arrowsize, int flag);
70  extern void arrow_gen(GVJ_t * job, emit_state_t emit_state, pointf p, pointf u,
71  double arrowsize, double penwidth, int flag);
72  extern double arrow_length(edge_t * e, int flag);
73  extern int arrowEndClip(edge_t*, pointf*, int, int , bezier*, int eflag);
74  extern int arrowStartClip(edge_t*, pointf* ps, int, int, bezier*, int sflag);
75  extern void arrowOrthoClip(edge_t*, pointf* ps, int, int, bezier*, int sflag, int eflag);
76  extern void beginpath(path *, Agedge_t *, int, pathend_t *, boolean);
77  extern void bezier_clip(inside_t * inside_context,
78  boolean(*insidefn) (inside_t * inside_context,
79  pointf p), pointf * sp,
80  boolean left_inside);
81  extern shape_desc *bind_shape(char *name, node_t *);
82  extern void makeStraightEdge(graph_t * g, edge_t * e, int edgetype, splineInfo * info);
83  extern void makeStraightEdges(graph_t* g, edge_t** edges, int e_cnt, int et, splineInfo* sinfo);
84  extern void clip_and_install(edge_t * fe, node_t * hn,
85  pointf * ps, int pn, splineInfo * info);
86  extern char* charsetToStr (int c);
87  extern pointf coord(node_t * n);
88  extern void do_graph_label(graph_t * sg);
89  extern void graph_init(graph_t * g, boolean use_rankdir);
90  extern void graph_cleanup(graph_t * g);
91  extern int dotneato_args_initialize(GVC_t * gvc, int, char **);
92  extern int dotneato_usage(int);
93  extern void dotneato_postprocess(Agraph_t *);
94  extern void gv_postprocess(Agraph_t *, int);
95  extern void dotneato_set_margins(GVC_t * gvc, Agraph_t *);
96  extern void dotneato_write(GVC_t * gvc, graph_t *g);
97  extern void dotneato_write_one(GVC_t * gvc, graph_t *g);
98  extern Ppolyline_t* ellipticWedge (pointf ctr, double major, double minor, double angle0, double angle1);
99  extern void emit_clusters(GVJ_t * job, Agraph_t * g, int flags);
100  extern char* getObjId (GVJ_t* job, void* obj, agxbuf* xb);
101  /* extern void emit_begin_edge(GVJ_t * job, edge_t * e, char**); */
102  /* extern void emit_end_edge(GVJ_t * job); */
103  extern void emit_graph(GVJ_t * job, graph_t * g);
104  extern void emit_label(GVJ_t * job, emit_state_t emit_state, textlabel_t *);
105  extern int emit_once(char *message);
106  extern void emit_jobs_eof(GVC_t * gvc);
107  extern void emit_map_rect(GVJ_t *job, boxf b);
108  extern void endpath(path *, Agedge_t *, int, pathend_t *, boolean);
109  extern void epsf_init(node_t * n);
110  extern void epsf_free(node_t * n);
111  extern shape_desc *find_user_shape(const char *);
112  extern void free_line(textspan_t *);
113  extern void free_label(textlabel_t *);
114  extern void free_textspan(textspan_t * tl, int);
115  extern void getdouble(graph_t * g, char *name, double *result);
116  extern splines *getsplinepoints(edge_t * e);
117  extern void gv_fixLocale (int set);
118  extern void gv_free_splines(edge_t * e);
119  extern void gv_cleanup_edge(Agedge_t * e);
120  extern void gv_cleanup_node(Agnode_t * n);
121  extern void* init_xdot (Agraph_t* g);
122  extern int initMapData (GVJ_t*, char*, char*, char*, char*, char*, void*);
123  extern boolean isPolygon(node_t *);
124  extern void makeSelfEdge(path * P, edge_t * edges[], int ind, int cnt,
125  double sizex, double sizey, splineInfo * sinfo);
126  extern textlabel_t *make_label(void *obj, char *str, int kind, double fontsize, char *fontname, char *fontcolor);
127  extern bezier *new_spline(edge_t * e, int sz);
128  extern char **parse_style(char *s);
129  extern void place_graph_label(Agraph_t *);
130  extern int place_portlabel(edge_t * e, boolean head_p);
131  extern void makePortLabels(edge_t * e);
132  extern pointf edgeMidpoint(graph_t* g, edge_t * e);
133  extern void addEdgeLabels(graph_t* g, edge_t * e, pointf rp, pointf rq);
134  extern void pop_obj_state(GVJ_t *job);
135  extern obj_state_t* push_obj_state(GVJ_t *job);
136  extern int rank(graph_t * g, int balance, int maxiter);
137  extern port resolvePort(node_t* n, node_t* other, port* oldport);
138  extern void resolvePorts (edge_t* e);
139  extern void round_corners(GVJ_t * job, pointf * AF, int sides, int style, int filled);
140  extern int routesplinesinit(void);
141  extern pointf *routesplines(path *, int *);
142  extern void routesplinesterm(void);
143  extern pointf* simpleSplineRoute (pointf, pointf, Ppoly_t, int*, int);
144  extern pointf *routepolylines(path* pp, int* npoints);
145  extern int selfRightSpace (edge_t* e);
146  extern void setup_graph(GVC_t * gvc, graph_t * g);
147  extern shape_kind shapeOf(node_t *);
148  extern void shape_clip(node_t * n, pointf curve[4]);
149  extern void make_simple_label (GVC_t * gvc, textlabel_t* rv);
150  extern int stripedBox (GVJ_t * job, pointf* AF, char* clrs, int rotate);
151  extern stroke_t* taper (bezier*, double (*radfunc_t)(double,double,double), double initwid, int linejoin, int linecap);
152  extern stroke_t* taper0 (bezier* bez, double initwid);
153  extern pointf textspan_size(GVC_t * gvc, textspan_t * span);
154  extern Dt_t * textfont_dict_open(GVC_t *gvc);
155  extern void textfont_dict_close(GVC_t *gvc);
156  extern void translate_bb(Agraph_t *, int);
157  extern int wedgedEllipse (GVJ_t* job, pointf * pf, char* clrs);
158  extern void update_bb_bz(boxf *bb, pointf *cp);
159  extern void write_attributed_dot(graph_t *g, FILE *f);
160  extern void write_canonical_dot(graph_t *g, FILE *f);
161  extern boxf xdotBB (graph_t* g);
162  extern char *findAttrColor(void *obj, attrsym_t *colorattr, char *dflt);
163 
164 #undef extern
165 
166 #ifdef __cplusplus
167 }
168 #endif
169 
170 #endif
void dotneato_postprocess(Agraph_t *g)
Definition: postproc.c:693
shape_desc * find_user_shape(const char *)
Definition: shapes.c:3803
void free_label(textlabel_t *p)
Definition: labels.c:209
bezier * new_spline(edge_t *e, int sz)
Definition: splines.c:218
pointf * routesplines(path *, int *)
Definition: routespl.c:653
Definition: types.h:67
char ** parse_style(char *s)
Definition: emit.c:3891
pointf edgeMidpoint(graph_t *g, edge_t *e)
Definition: splines.c:1321
double(* radfunc_t)(double, double, double)
Definition: emit.c:2241
void gv_fixLocale(int set)
Definition: emit.c:4070
emit_state_t
Definition: gvcjob.h:182
Dt_t * textfont_dict_open(GVC_t *gvc)
Definition: textspan.c:279
shape_kind shapeOf(node_t *)
Definition: shapes.c:1820
splines * getsplinepoints(edge_t *e)
Definition: splines.c:1478
pointf * routepolylines(path *pp, int *npoints)
Definition: routespl.c:658
int initMapData(GVJ_t *job, char *lbl, char *url, char *tooltip, char *target, char *id, void *gobj)
Definition: emit.c:146
Definition: types.h:117
void beginpath(path *, Agedge_t *, int, pathend_t *, boolean)
Definition: splines.c:393
Definition: render.h:54
Definition: geom.h:28
void makeStraightEdges(graph_t *g, edge_t **edges, int e_cnt, int et, splineInfo *sinfo)
Definition: routespl.c:962
void getdouble(graph_t *g, char *name, double *result)
Definition: input.c:475
void gv_postprocess(Agraph_t *g, int allowTranslation)
Definition: postproc.c:603
void emit_label(GVJ_t *job, emit_state_t emit_state, textlabel_t *lp)
Definition: labels.c:222
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 do_graph_label(graph_t *sg)
Definition: input.c:892
pointf * simpleSplineRoute(pointf, pointf, Ppoly_t, int *, int)
Definition: routespl.c:230
void gv_cleanup_edge(Agedge_t *e)
Definition: utils.c:1947
void arrow_flags(Agedge_t *e, int *sflag, int *eflag)
Definition: arrows.c:198
int arrowEndClip(edge_t *e, pointf *ps, int startp, int endp, bezier *spl, int eflag)
Definition: arrows.c:256
double arrow_length(edge_t *e, int flag)
Definition: arrows.c:229
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)
shape_kind
Definition: types.h:186
struct epsf_s epsf_t
void emit_jobs_eof(GVC_t *gvc)
int routesplinesinit(void)
Definition: routespl.c:288
void translate_bb(graph_t *g, int rankdir)
Definition: postproc.c:121
void addEdgeLabels(graph_t *g, edge_t *e, pointf rp, pointf rq)
Definition: splines.c:1355
void pop_obj_state(GVJ_t *job)
Definition: emit.c:113
void epsf_init(node_t *n)
Definition: psusershape.c:98
void write_canonical_dot(graph_t *g, FILE *f)
void * init_xdot(Agraph_t *g)
Definition: emit.c:44
int rank(graph_t *g, int balance, int maxiter)
Definition: ns.c:866
void textfont_dict_close(GVC_t *gvc)
Definition: textspan.c:286
void routesplinesterm(void)
Definition: routespl.c:313
int emit_once(char *str)
Definition: emit.c:3621
int selfRightSpace(edge_t *e)
Definition: splines.c:1163
void emit_map_rect(GVJ_t *job, boxf b)
Definition: emit.c:671
Definition: gvcint.h:70
int macro_id
Definition: render.h:55
char * findAttrColor(void *obj, attrsym_t *colorattr, char *dflt)
Definition: shapes.c:367
int stripedBox(GVJ_t *job, pointf *AF, char *clrs, int rotate)
Definition: emit.c:625
void epsf_free(node_t *n)
Definition: psusershape.c:121
void update_bb_bz(boxf *bb, pointf *cp)
Definition: emit.c:794
stroke_t * taper(bezier *, double(*radfunc_t)(double, double, double), double initwid, int linejoin, int linecap)
Definition: taper.c:271
void graph_init(graph_t *g, boolean use_rankdir)
Definition: input.c:654
void free_textspan(textspan_t *tl, int cnt)
Definition: labels.c:193
void makePortLabels(edge_t *e)
Definition: splines.c:1237
int dotneato_usage(int exval)
Definition: input.c:71
Definition: grammar.c:79
void emit_clusters(GVJ_t *job, Agraph_t *g, int flags)
Definition: emit.c:3660
boxf xdotBB(Agraph_t *g)
Definition: emit.c:3005
int dotneato_args_initialize(GVC_t *gvc, int argc, char **argv)
Definition: input.c:224
obj_state_t * push_obj_state(GVJ_t *job)
Definition: emit.c:84
int wedgedEllipse(GVJ_t *job, pointf *pf, char *clrs)
Definition: emit.c:574
void gv_free_splines(edge_t *e)
Definition: utils.c:1935
void arrowOrthoClip(edge_t *e, pointf *ps, int startp, int endp, bezier *spl, int sflag, int eflag)
Definition: arrows.c:323
char * getObjId(GVJ_t *job, void *obj, agxbuf *xb)
Definition: emit.c:198
Definition: geom.h:26
boxf arrow_bb(pointf p, pointf u, double arrowsize, int flag)
Definition: arrows.c:691
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:516
GVC_t * gvc
Definition: htmlparse.c:87
void gv_cleanup_node(Agnode_t *n)
Definition: utils.c:1959
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
void dotneato_set_margins(GVC_t *gvc, Agraph_t *)
void free_line(textspan_t *)
Definition: types.h:100
void makeStraightEdge(graph_t *g, edge_t *e, int edgetype, splineInfo *info)
Definition: routespl.c:936
port resolvePort(node_t *n, node_t *other, port *oldport)
Definition: shapes.c:4196
void emit_graph(GVJ_t *job, graph_t *g)
Definition: emit.c:3545
Definition: types.h:56
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:99
void place_graph_label(graph_t *g)
Definition: postproc.c:736
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
agxbuf * str
Definition: htmlparse.c:85
void resolvePorts(edge_t *e)
Definition: shapes.c:4208
int place_portlabel(edge_t *e, boolean head_p)
Definition: splines.c:1425
char * charsetToStr(int c)
Definition: input.c:866
void make_simple_label(GVC_t *gvc, textlabel_t *lp)
Definition: labels.c:51
Definition: agxbuf.h:34
boolean isPolygon(node_t *)
Definition: shapes.c:1840
pointf coord(node_t *n)
Definition: utils.c:202
Ppolyline_t * ellipticWedge(pointf ctr, double xsemi, double ysemi, double angle0, double angle1)
Definition: ellipse.c:565
void graph_cleanup(graph_t *g)
Definition: input.c:847
void dotneato_write(GVC_t *gvc, graph_t *g)
shape_desc * bind_shape(char *name, node_t *)
Definition: shapes.c:3837
Definition: geom.h:35
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
int arrowStartClip(edge_t *e, pointf *ps, int startp, int endp, bezier *spl, int sflag)
Definition: arrows.c:285
textlabel_t * make_label(void *obj, char *str, int kind, double fontsize, char *fontname, char *fontcolor)
Definition: labels.c:115