| 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; |
| 56 | point offset; |
| 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 |
| 171 | |