render.h 7.1 KB

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