| 1 |
/** |
| 2 |
* @file |
| 3 |
* @ingroup common_render |
| 4 |
*/ |
| 5 |
/************************************************************************* |
| 6 |
* Copyright (c) 2011 AT&T Intellectual Property |
| 7 |
* All rights reserved. This program and the accompanying materials |
| 8 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 9 |
* which accompanies this distribution, and is available at |
| 10 |
* https://www.eclipse.org/legal/epl-v10.html |
| 11 |
* |
| 12 |
* Contributors: Details at https://graphviz.org |
| 13 |
*************************************************************************/ |
| 14 |
|
| 15 |
#pragma once |
| 16 |
|
| 17 |
#include "config.h" |
| 18 |
|
| 19 |
#include <sys/types.h> |
| 20 |
#include <stdbool.h> |
| 21 |
#include <stdint.h> |
| 22 |
#include <stdlib.h> |
| 23 |
#include <string.h> |
| 24 |
#include <util/agxbuf.h> |
| 25 |
|
| 26 |
#include <inttypes.h> |
| 27 |
|
| 28 |
#include "types.h" |
| 29 |
#include "macros.h" |
| 30 |
#include "const.h" |
| 31 |
#include "globals.h" |
| 32 |
#include "colorprocs.h" /* must follow color.h (in types.h) */ |
| 33 |
#include "geomprocs.h" /* must follow geom.h (in types.h) */ |
| 34 |
#include "utils.h" /* must follow types.h and agxbuf.h */ |
| 35 |
#include "gvplugin.h" /* must follow gvcext.h (in types.h) */ |
| 36 |
#include "gvcjob.h" /* must follow gvcext.h (in types.h) */ |
| 37 |
#include "gvcint.h" /* must follow gvcext.h (in types.h) */ |
| 38 |
#include "gvcproc.h" /* must follow gvcext.h (in types.h) */ |
| 39 |
|
| 40 |
#ifdef __cplusplus |
| 41 |
extern "C" { |
| 42 |
#endif |
| 43 |
|
| 44 |
typedef struct epsf_s { |
| 45 |
int macro_id; |
| 46 |
pointf offset; |
| 47 |
} epsf_t; |
| 48 |
|
| 49 |
#ifdef GVDLL |
| 50 |
#ifdef GVC_EXPORTS |
| 51 |
#define RENDER_API __declspec(dllexport) |
| 52 |
#else |
| 53 |
#define RENDER_API __declspec(dllimport) |
| 54 |
#endif |
| 55 |
#endif |
| 56 |
|
| 57 |
#ifndef RENDER_API |
| 58 |
#define RENDER_API /* nothing */ |
| 59 |
#endif |
| 60 |
|
| 61 |
RENDER_API void add_box(path *, boxf); |
| 62 |
RENDER_API void arrow_flags(Agedge_t *e, uint32_t *sflag, uint32_t *eflag); |
| 63 |
RENDER_API boxf arrow_bb(pointf p, pointf u, double arrowsize); |
| 64 |
RENDER_API void arrow_gen(GVJ_t * job, emit_state_t emit_state, pointf p, pointf u, |
| 65 |
double arrowsize, double penwidth, uint32_t flag); |
| 66 |
RENDER_API size_t arrowEndClip(edge_t*, pointf*, size_t, size_t, bezier*, |
| 67 |
uint32_t eflag); |
| 68 |
RENDER_API size_t arrowStartClip(edge_t*, pointf *ps, size_t, size_t, |
| 69 |
bezier*, uint32_t sflag); |
| 70 |
RENDER_API void arrowOrthoClip(edge_t*, pointf *ps, size_t, size_t, bezier*, |
| 71 |
uint32_t sflag, uint32_t eflag); |
| 72 |
RENDER_API void beginpath(path *, Agedge_t *, int, pathend_t *, bool); |
| 73 |
RENDER_API void bezier_clip(inside_t * inside_context, |
| 74 |
bool(*insidefn) (inside_t * inside_context, |
| 75 |
pointf p), pointf * sp, bool left_inside); |
| 76 |
RENDER_API shape_desc *bind_shape(char *name, node_t *); |
| 77 |
RENDER_API void makeStraightEdge(graph_t * g, edge_t * e, int edgetype, splineInfo * info); |
| 78 |
RENDER_API void makeStraightEdges(graph_t *g, edge_t **edges, size_t e_cnt, |
| 79 |
int et, splineInfo* sinfo); |
| 80 |
RENDER_API void clip_and_install(edge_t * fe, node_t * hn, |
| 81 |
pointf *ps, size_t pn, splineInfo *info); |
| 82 |
RENDER_API char* charsetToStr (int c); |
| 83 |
RENDER_API pointf coord(node_t * n); |
| 84 |
RENDER_API void do_graph_label(graph_t * sg); |
| 85 |
RENDER_API void graph_init(graph_t * g, bool use_rankdir); |
| 86 |
RENDER_API void graph_cleanup(graph_t * g); |
| 87 |
RENDER_API int dotneato_args_initialize(GVC_t * gvc, int, char **); |
| 88 |
RENDER_API int dotneato_usage(const char *, int); |
| 89 |
RENDER_API void dotneato_postprocess(Agraph_t *); |
| 90 |
RENDER_API void gv_postprocess(Agraph_t *, int); |
| 91 |
RENDER_API Ppolyline_t* ellipticWedge (pointf ctr, double major, double minor, double angle0, double angle1); |
| 92 |
RENDER_API void emit_clusters(GVJ_t * job, Agraph_t * g, int flags); |
| 93 |
RENDER_API char* getObjId (GVJ_t* job, void* obj, agxbuf* xb); |
| 94 |
RENDER_API void emit_graph(GVJ_t * job, graph_t * g); |
| 95 |
RENDER_API void emit_label(GVJ_t * job, emit_state_t emit_state, textlabel_t *); |
| 96 |
RENDER_API bool emit_once(char *message); |
| 97 |
RENDER_API void emit_once_reset(void); |
| 98 |
RENDER_API void emit_map_rect(GVJ_t *job, boxf b); |
| 99 |
RENDER_API void endpath(path *, Agedge_t *, int, pathend_t *, bool); |
| 100 |
RENDER_API void epsf_init(node_t * n); |
| 101 |
RENDER_API void epsf_free(node_t * n); |
| 102 |
RENDER_API shape_desc *find_user_shape(const char *); |
| 103 |
RENDER_API void free_label(textlabel_t *); |
| 104 |
RENDER_API void free_textspan(textspan_t *tl, size_t); |
| 105 |
RENDER_API void getdouble(graph_t * g, char *name, double *result); |
| 106 |
RENDER_API splines *getsplinepoints(edge_t * e); |
| 107 |
RENDER_API void gv_fixLocale (int set); |
| 108 |
RENDER_API void gv_free_splines(edge_t * e); |
| 109 |
RENDER_API void gv_cleanup_edge(Agedge_t * e); |
| 110 |
RENDER_API void gv_cleanup_node(Agnode_t * n); |
| 111 |
RENDER_API void* init_xdot (Agraph_t* g); |
| 112 |
RENDER_API bool initMapData(GVJ_t *, char *, char *, char *, char *, char *, |
| 113 |
void *); |
| 114 |
RENDER_API bool isPolygon(node_t *); |
| 115 |
RENDER_API void makeSelfEdge(edge_t *edges[], size_t cnt, double sizex, |
| 116 |
double sizey, splineInfo *sinfo); |
| 117 |
|
| 118 |
/// @param is_html Create the label as an HTML label |
| 119 |
/// @param is_record Is this destined for use in a record shape? |
| 120 |
RENDER_API textlabel_t *make_label(void *obj, char *str, bool is_html, |
| 121 |
bool is_record, double fontsize, |
| 122 |
char *fontname, char *fontcolor); |
| 123 |
|
| 124 |
RENDER_API bezier *new_spline(edge_t *e, size_t sz); |
| 125 |
RENDER_API char **parse_style(char *s); |
| 126 |
RENDER_API void place_graph_label(Agraph_t *); |
| 127 |
RENDER_API int place_portlabel(edge_t * e, bool head_p); |
| 128 |
RENDER_API void makePortLabels(edge_t * e); |
| 129 |
RENDER_API pointf edgeMidpoint(graph_t* g, edge_t * e); |
| 130 |
RENDER_API void addEdgeLabels(edge_t *e); |
| 131 |
RENDER_API void pop_obj_state(GVJ_t *job); |
| 132 |
RENDER_API obj_state_t* push_obj_state(GVJ_t *job); |
| 133 |
RENDER_API int rank(graph_t * g, int balance, int maxiter); |
| 134 |
RENDER_API int rank2(graph_t * g, int balance, int maxiter, int search_size); |
| 135 |
RENDER_API port resolvePort(node_t* n, node_t* other, port* oldport); |
| 136 |
RENDER_API void resolvePorts (edge_t* e); |
| 137 |
RENDER_API void round_corners(GVJ_t *job, pointf *AF, size_t sides, |
| 138 |
graphviz_polygon_style_t style, int filled); |
| 139 |
RENDER_API int routesplinesinit(void); |
| 140 |
RENDER_API pointf *routesplines(path *, size_t *); |
| 141 |
RENDER_API void routesplinesterm(void); |
| 142 |
RENDER_API pointf* simpleSplineRoute(pointf, pointf, Ppoly_t, size_t *, int); |
| 143 |
RENDER_API pointf *routepolylines(path* pp, size_t* npoints); |
| 144 |
RENDER_API double selfRightSpace(edge_t *e); |
| 145 |
RENDER_API shape_kind shapeOf(node_t *); |
| 146 |
RENDER_API void shape_clip(node_t * n, pointf curve[4]); |
| 147 |
RENDER_API void make_simple_label (GVC_t * gvc, textlabel_t* rv); |
| 148 |
RENDER_API int stripedBox(GVJ_t *job, pointf *AF, const char *clrs, |
| 149 |
int rotate); |
| 150 |
RENDER_API stroke_t taper (bezier*, double (*radfunc_t)(double,double,double), double initwid); |
| 151 |
RENDER_API pointf textspan_size(GVC_t * gvc, textspan_t * span); |
| 152 |
RENDER_API void textfont_dict_open(GVC_t *gvc); |
| 153 |
RENDER_API void textfont_dict_close(GVC_t *gvc); |
| 154 |
RENDER_API void translate_bb(Agraph_t *, int); |
| 155 |
RENDER_API int wedgedEllipse(GVJ_t *job, pointf *pf, const char *clrs); |
| 156 |
RENDER_API void update_bb_bz(boxf *bb, pointf *cp); |
| 157 |
RENDER_API boxf xdotBB (graph_t* g); |
| 158 |
|
| 159 |
#undef RENDER_API |
| 160 |
|
| 161 |
#ifdef __cplusplus |
| 162 |
} |
| 163 |
#endif |
| 164 |
/** |
| 165 |
* @defgroup common_render rendering |
| 166 |
* @brief rendering for layout engines |
| 167 |
* @ingroup engines |
| 168 |
*/ |