Graphviz 12.0.1~dev.20240715.2254
Loading...
Searching...
No Matches
gvrender.c File Reference
#include "config.h"
#include <assert.h>
#include <string.h>
#include <common/const.h>
#include <common/macros.h>
#include <common/colorprocs.h>
#include <gvc/gvplugin_render.h>
#include <cgraph/agxbuf.h>
#include <cgraph/alloc.h>
#include <cgraph/cgraph.h>
#include <gvc/gvcint.h>
#include <common/geom.h>
#include <common/geomprocs.h>
#include <common/render.h>
#include <gvc/gvcproc.h>
#include <cgraph/strcasecmp.h>
#include <cgraph/streq.h>
#include <limits.h>
#include <stdlib.h>
Include dependency graph for gvrender.c:

Go to the source code of this file.

Macros

#define REGULAR   0
 
#define BOLD   1
 
#define ITALIC   2
 

Functions

bool mapbool (const char *s)
 
int gvrender_select (GVJ_t *job, const char *str)
 
int gvrender_features (GVJ_t *job)
 
int gvrender_begin_job (GVJ_t *job)
 
void gvrender_end_job (GVJ_t *job)
 
pointf gvrender_ptf (GVJ_t *job, pointf p)
 
pointfgvrender_ptf_A (GVJ_t *job, pointf *af, pointf *AF, size_t n)
 
static int gvrender_comparestr (const void *s1, const void *s2)
 
static void gvrender_resolve_color (gvrender_features_t *features, char *name, gvcolor_t *color)
 
void gvrender_begin_graph (GVJ_t *job)
 
void gvrender_end_graph (GVJ_t *job)
 
void gvrender_begin_page (GVJ_t *job)
 
void gvrender_end_page (GVJ_t *job)
 
void gvrender_begin_layer (GVJ_t *job)
 
void gvrender_end_layer (GVJ_t *job)
 
void gvrender_begin_cluster (GVJ_t *job)
 
void gvrender_end_cluster (GVJ_t *job)
 
void gvrender_begin_nodes (GVJ_t *job)
 
void gvrender_end_nodes (GVJ_t *job)
 
void gvrender_begin_edges (GVJ_t *job)
 
void gvrender_end_edges (GVJ_t *job)
 
void gvrender_begin_node (GVJ_t *job)
 
void gvrender_end_node (GVJ_t *job)
 
void gvrender_begin_edge (GVJ_t *job)
 
void gvrender_end_edge (GVJ_t *job)
 
void gvrender_begin_anchor (GVJ_t *job, char *href, char *tooltip, char *target, char *id)
 
void gvrender_end_anchor (GVJ_t *job)
 
void gvrender_begin_label (GVJ_t *job, label_type type)
 
void gvrender_end_label (GVJ_t *job)
 
void gvrender_textspan (GVJ_t *job, pointf p, textspan_t *span)
 
void gvrender_set_pencolor (GVJ_t *job, char *name)
 
void gvrender_set_fillcolor (GVJ_t *job, char *name)
 
void gvrender_set_gradient_vals (GVJ_t *job, char *stopcolor, int angle, double frac)
 
void gvrender_set_style (GVJ_t *job, char **s)
 
void gvrender_ellipse (GVJ_t *job, pointf *pf, int filled)
 
void gvrender_polygon (GVJ_t *job, pointf *af, size_t n, int filled)
 
void gvrender_box (GVJ_t *job, boxf B, int filled)
 
void gvrender_beziercurve (GVJ_t *job, pointf *af, size_t n, int filled)
 
void gvrender_polyline (GVJ_t *job, pointf *af, size_t n)
 
void gvrender_comment (GVJ_t *job, char *str)
 
static imagescale_t get_imagescale (char *s)
 
static imagepos_t get_imagepos (char *s)
 
void gvrender_usershape (GVJ_t *job, char *name, pointf *a, size_t n, bool filled, char *imagescale, char *imagepos)
 
void gvrender_set_penwidth (GVJ_t *job, double penwidth)
 

Macro Definition Documentation

◆ BOLD

#define BOLD   1

Definition at line 130 of file gvrender.c.

◆ ITALIC

#define ITALIC   2

Definition at line 131 of file gvrender.c.

◆ REGULAR

#define REGULAR   0

Definition at line 129 of file gvrender.c.

Function Documentation

◆ get_imagepos()

static imagepos_t get_imagepos ( char *  s)
static

Definition at line 644 of file gvrender.c.

References IMAGEPOS_BOTTOM_CENTER, IMAGEPOS_BOTTOM_LEFT, IMAGEPOS_BOTTOM_RIGHT, IMAGEPOS_MIDDLE_CENTER, IMAGEPOS_MIDDLE_LEFT, IMAGEPOS_MIDDLE_RIGHT, IMAGEPOS_TOP_CENTER, IMAGEPOS_TOP_LEFT, and IMAGEPOS_TOP_RIGHT.

Referenced by gvrender_usershape().

Here is the caller graph for this function:

◆ get_imagescale()

static imagescale_t get_imagescale ( char *  s)
static

Definition at line 629 of file gvrender.c.

References IMAGESCALE_BOTH, IMAGESCALE_FALSE, IMAGESCALE_HEIGHT, IMAGESCALE_TRUE, IMAGESCALE_WIDTH, and mapbool().

Referenced by gvrender_usershape().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gvrender_begin_anchor()

void gvrender_begin_anchor ( GVJ_t job,
char *  href,
char *  tooltip,
char *  target,
char *  id 
)

Definition at line 376 of file gvrender.c.

References gvrender_engine_s::begin_anchor, gvplugin_active_render_s::engine, and GVJ_s::render.

Referenced by emit_begin_edge(), emit_clusters(), emit_edge_label(), emit_end_edge(), emit_page(), epsf_gencode(), initAnchor(), point_gencode(), poly_gencode(), and record_gencode().

Here is the caller graph for this function:

◆ gvrender_begin_cluster()

void gvrender_begin_cluster ( GVJ_t job)

Definition at line 280 of file gvrender.c.

References gvrender_engine_s::begin_cluster, gvplugin_active_render_s::engine, and GVJ_s::render.

Referenced by emit_begin_cluster().

Here is the caller graph for this function:

◆ gvrender_begin_edge()

void gvrender_begin_edge ( GVJ_t job)

Definition at line 357 of file gvrender.c.

References gvrender_engine_s::begin_edge, gvplugin_active_render_s::engine, and GVJ_s::render.

Referenced by emit_begin_edge().

Here is the caller graph for this function:

◆ gvrender_begin_edges()

void gvrender_begin_edges ( GVJ_t job)

Definition at line 318 of file gvrender.c.

References gvrender_engine_s::begin_edges, gvplugin_active_render_s::engine, and GVJ_s::render.

Referenced by emit_view().

Here is the caller graph for this function:

◆ gvrender_begin_graph()

void gvrender_begin_graph ( GVJ_t job)

Definition at line 218 of file gvrender.c.

References gvrender_engine_s::begin_graph, gvplugin_active_render_s::engine, and GVJ_s::render.

Referenced by emit_begin_graph().

Here is the caller graph for this function:

◆ gvrender_begin_job()

int gvrender_begin_job ( GVJ_t job)

Definition at line 103 of file gvrender.c.

References gvrender_engine_s::begin_job, gvplugin_active_render_s::engine, gvdevice_initialize(), and GVJ_s::render.

Referenced by gvRenderJobs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gvrender_begin_label()

void gvrender_begin_label ( GVJ_t job,
label_type  type 
)

Definition at line 397 of file gvrender.c.

References gvrender_engine_s::begin_label, gvplugin_active_render_s::engine, GVJ_s::render, and type.

Referenced by emit_htextspans(), and emit_label().

Here is the caller graph for this function:

◆ gvrender_begin_layer()

void gvrender_begin_layer ( GVJ_t job)

Definition at line 259 of file gvrender.c.

References gvrender_engine_s::begin_layer, gvplugin_active_render_s::engine, GVJ_s::gvc, GVC_s::layerIDs, GVJ_s::layerNum, GVJ_s::numLayers, and GVJ_s::render.

Referenced by emit_graph().

Here is the caller graph for this function:

◆ gvrender_begin_node()

void gvrender_begin_node ( GVJ_t job)

Definition at line 338 of file gvrender.c.

References gvrender_engine_s::begin_node, gvplugin_active_render_s::engine, and GVJ_s::render.

Referenced by emit_begin_node().

Here is the caller graph for this function:

◆ gvrender_begin_nodes()

void gvrender_begin_nodes ( GVJ_t job)

Definition at line 298 of file gvrender.c.

References gvrender_engine_s::begin_nodes, gvplugin_active_render_s::engine, and GVJ_s::render.

Referenced by emit_view().

Here is the caller graph for this function:

◆ gvrender_begin_page()

void gvrender_begin_page ( GVJ_t job)

Definition at line 239 of file gvrender.c.

References gvrender_engine_s::begin_page, gvplugin_active_render_s::engine, and GVJ_s::render.

Referenced by emit_page().

Here is the caller graph for this function:

◆ gvrender_beziercurve()

void gvrender_beziercurve ( GVJ_t job,
pointf af,
size_t  n,
int  filled 
)

Definition at line 582 of file gvrender.c.

References gvrender_engine_s::beziercurve, gvplugin_active_render_s::engine, GVJ_s::flags, free(), gv_calloc(), GVRENDER_DOES_TRANSFORM, gvrender_ptf_A(), GVJ_s::obj, obj_state_s::pen, PEN_NONE, and GVJ_s::render.

Referenced by arrow_type_curve(), cylinder_draw(), emit_edge_graphics(), emit_xdot(), multicolor(), rounded_draw(), and wedgedEllipse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gvrender_box()

void gvrender_box ( GVJ_t job,
boxf  B,
int  filled 
)

Definition at line 568 of file gvrender.c.

References A, B, gvrender_polygon(), and pointf_s::x.

Referenced by doBorder(), doSide(), emit_background(), emit_clusters(), emit_html_cell(), emit_html_tbl(), and record_gencode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gvrender_comment()

void gvrender_comment ( GVJ_t job,
char *  str 
)

Definition at line 616 of file gvrender.c.

References gvrender_engine_s::comment, gvplugin_active_render_s::engine, GVJ_s::render, and str.

Referenced by emit_edge(), emit_graph(), and emit_node().

Here is the caller graph for this function:

◆ gvrender_comparestr()

static int gvrender_comparestr ( const void *  s1,
const void *  s2 
)
static

Definition at line 177 of file gvrender.c.

References s1().

Referenced by gvrender_resolve_color().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gvrender_ellipse()

void gvrender_ellipse ( GVJ_t job,
pointf pf,
int  filled 
)

Definition at line 523 of file gvrender.c.

References gvrender_engine_s::ellipse, gvplugin_active_render_s::engine, GVJ_s::flags, GVRENDER_DOES_TRANSFORM, gvrender_ptf_A(), mid_pointf(), GVJ_s::obj, obj_state_s::pen, PEN_NONE, and GVJ_s::render.

Referenced by arrow_type_dot(), emit_xdot(), point_gencode(), and poly_gencode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gvrender_end_anchor()

void gvrender_end_anchor ( GVJ_t job)

Definition at line 387 of file gvrender.c.

References gvrender_engine_s::end_anchor, gvplugin_active_render_s::engine, and GVJ_s::render.

Referenced by emit_clusters(), emit_edge_label(), emit_end_edge(), emit_page(), endAnchor(), epsf_gencode(), point_gencode(), poly_gencode(), and record_gencode().

Here is the caller graph for this function:

◆ gvrender_end_cluster()

void gvrender_end_cluster ( GVJ_t job)

Definition at line 289 of file gvrender.c.

References gvrender_engine_s::end_cluster, gvplugin_active_render_s::engine, and GVJ_s::render.

Referenced by emit_end_cluster().

Here is the caller graph for this function:

◆ gvrender_end_edge()

void gvrender_end_edge ( GVJ_t job)

Definition at line 366 of file gvrender.c.

References gvrender_engine_s::end_edge, gvplugin_active_render_s::engine, and GVJ_s::render.

Referenced by emit_end_edge().

Here is the caller graph for this function:

◆ gvrender_end_edges()

void gvrender_end_edges ( GVJ_t job)

Definition at line 328 of file gvrender.c.

References gvrender_engine_s::end_edges, gvplugin_active_render_s::engine, and GVJ_s::render.

Referenced by emit_view().

Here is the caller graph for this function:

◆ gvrender_end_graph()

void gvrender_end_graph ( GVJ_t job)

Definition at line 228 of file gvrender.c.

References gvrender_engine_s::end_graph, gvplugin_active_render_s::engine, gvdevice_format(), and GVJ_s::render.

Referenced by emit_end_graph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gvrender_end_job()

void gvrender_end_job ( GVJ_t job)

Definition at line 116 of file gvrender.c.

References GVC_s::common, gvrender_engine_s::end_job, gvplugin_active_render_s::engine, GVJ_s::gvc, gvdevice_finalize(), GVCOMMON_s::lib, NULL, and GVJ_s::render.

Referenced by gvFinalize(), gvRender(), gvRenderContext(), gvRenderData(), gvRenderFilename(), and gvRenderJobs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gvrender_end_label()

void gvrender_end_label ( GVJ_t job)

Definition at line 407 of file gvrender.c.

References gvrender_engine_s::end_label, gvplugin_active_render_s::engine, and GVJ_s::render.

Referenced by emit_htextspans(), and emit_label().

Here is the caller graph for this function:

◆ gvrender_end_layer()

void gvrender_end_layer ( GVJ_t job)

Definition at line 270 of file gvrender.c.

References gvrender_engine_s::end_layer, gvplugin_active_render_s::engine, and GVJ_s::render.

Referenced by emit_graph().

Here is the caller graph for this function:

◆ gvrender_end_node()

void gvrender_end_node ( GVJ_t job)

Definition at line 347 of file gvrender.c.

References gvrender_engine_s::end_node, gvplugin_active_render_s::engine, and GVJ_s::render.

Referenced by emit_end_node().

Here is the caller graph for this function:

◆ gvrender_end_nodes()

void gvrender_end_nodes ( GVJ_t job)

Definition at line 308 of file gvrender.c.

References gvrender_engine_s::end_nodes, gvplugin_active_render_s::engine, and GVJ_s::render.

Referenced by emit_view().

Here is the caller graph for this function:

◆ gvrender_end_page()

void gvrender_end_page ( GVJ_t job)

Definition at line 249 of file gvrender.c.

References gvrender_engine_s::end_page, gvplugin_active_render_s::engine, and GVJ_s::render.

Referenced by emit_page().

Here is the caller graph for this function:

◆ gvrender_features()

int gvrender_features ( GVJ_t job)

◆ gvrender_polygon()

void gvrender_polygon ( GVJ_t job,
pointf af,
size_t  n,
int  filled 
)

Definition at line 540 of file gvrender.c.

References gvplugin_active_render_s::engine, obj_state_s::fillcolor, GVJ_s::flags, free(), gv_calloc(), GVRENDER_DOES_TRANSFORM, gvrender_ptf_A(), NO_POLY, GVJ_s::obj, obj_state_s::pen, PEN_NONE, obj_state_s::pencolor, gvrender_engine_s::polygon, and GVJ_s::render.

Referenced by arrow_type_box(), arrow_type_crow(), arrow_type_diamond(), arrow_type_normal(), arrow_type_tee(), diagonals_draw(), emit_edge_graphics(), emit_xdot(), gvrender_box(), poly_gencode(), round_corners(), and stripedBox().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gvrender_polyline()

void gvrender_polyline ( GVJ_t job,
pointf af,
size_t  n 
)

Definition at line 599 of file gvrender.c.

References gvplugin_active_render_s::engine, GVJ_s::flags, free(), gv_calloc(), GVRENDER_DOES_TRANSFORM, gvrender_ptf_A(), GVJ_s::obj, obj_state_s::pen, PEN_NONE, gvrender_engine_s::polyline, and GVJ_s::render.

Referenced by arrow_type_box(), arrow_type_curve(), arrow_type_gap(), arrow_type_tee(), diagonals_draw(), doBorder(), emit_attachment(), emit_xdot(), gen_fields(), Mcircle_hack(), poly_gencode(), and round_corners().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gvrender_ptf()

pointf gvrender_ptf ( GVJ_t job,
pointf  p 
)

Definition at line 133 of file gvrender.c.

References GVJ_s::devscale, GVJ_s::rotation, scale(), GVJ_s::translation, pointf_s::x, pointf_s::y, and GVJ_s::zoom.

Referenced by gvrender_textspan(), and gvrender_usershape().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gvrender_ptf_A()

pointf * gvrender_ptf_A ( GVJ_t job,
pointf af,
pointf AF,
size_t  n 
)

Definition at line 154 of file gvrender.c.

References GVJ_s::devscale, GVJ_s::rotation, scale(), GVJ_s::translation, pointf_s::x, pointf_s::y, and GVJ_s::zoom.

Referenced by emit_begin_edge(), emit_begin_node(), emit_map_rect(), emit_page(), gvrender_beziercurve(), gvrender_ellipse(), gvrender_polygon(), gvrender_polyline(), map_label(), and map_point().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gvrender_resolve_color()

static void gvrender_resolve_color ( gvrender_features_t features,
char *  name,
gvcolor_t color 
)
static

Definition at line 188 of file gvrender.c.

References agerrorf(), agwarningf(), agxbfree(), agxbprint(), agxbuse(), canontoken(), color(), COLOR_OK, COLOR_STRING, gvrender_features_t::color_type, COLOR_UNKNOWN, colorxlate(), emit_once(), free(), gvrender_comparestr(), gvrender_features_t::knowncolors, NULL, gvrender_features_t::sz_knowncolors, and tok().

Referenced by gvrender_set_fillcolor(), gvrender_set_gradient_vals(), and gvrender_set_pencolor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gvrender_select()

int gvrender_select ( GVJ_t job,
const char *  str 
)

◆ gvrender_set_fillcolor()

void gvrender_set_fillcolor ( GVJ_t job,
char *  name 
)

Definition at line 453 of file gvrender.c.

References color(), gvplugin_active_render_s::engine, gvplugin_active_render_s::features, obj_state_s::fillcolor, gvrender_resolve_color(), NULL, GVJ_s::obj, GVJ_s::render, and gvrender_engine_s::resolve_color.

Referenced by emit_background(), emit_cluster_colors(), emit_clusters(), emit_colors(), emit_edge_graphics(), emit_html_rules(), emit_page(), emit_xdot(), multicolor(), point_gencode(), poly_gencode(), record_gencode(), setFill(), stripedBox(), and wedgedEllipse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gvrender_set_gradient_vals()

void gvrender_set_gradient_vals ( GVJ_t job,
char *  stopcolor,
int  angle,
double  frac 
)

Definition at line 470 of file gvrender.c.

References color(), gvplugin_active_render_s::engine, gvplugin_active_render_s::features, obj_state_s::gradient_angle, obj_state_s::gradient_frac, gvrender_resolve_color(), GVJ_s::obj, GVJ_s::render, gvrender_engine_s::resolve_color, and obj_state_s::stopcolor.

Referenced by emit_background(), emit_clusters(), emit_xdot(), poly_gencode(), record_gencode(), and setFill().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gvrender_set_pencolor()

void gvrender_set_pencolor ( GVJ_t job,
char *  name 
)

Definition at line 436 of file gvrender.c.

References color(), gvplugin_active_render_s::engine, gvplugin_active_render_s::features, gvrender_resolve_color(), NULL, GVJ_s::obj, obj_state_s::pencolor, GVJ_s::render, and gvrender_engine_s::resolve_color.

Referenced by doBorder(), emit_attachment(), emit_background(), emit_cluster_colors(), emit_clusters(), emit_colors(), emit_edge_graphics(), emit_htextspans(), emit_html_label(), emit_html_rules(), emit_label(), emit_page(), emit_xdot(), multicolor(), penColor(), point_gencode(), poly_gencode(), and setFill().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gvrender_set_penwidth()

void gvrender_set_penwidth ( GVJ_t job,
double  penwidth 
)

Definition at line 801 of file gvrender.c.

References gvplugin_active_render_s::engine, GVJ_s::obj, obj_state_s::penwidth, penwidth, and GVJ_s::render.

Referenced by arrow_gen(), doBorder(), emit_begin_edge(), emit_clusters(), emit_html_tbl(), point_gencode(), stripedBox(), stylenode(), and wedgedEllipse().

Here is the caller graph for this function:

◆ gvrender_set_style()

void gvrender_set_style ( GVJ_t job,
char **  s 
)

Definition at line 484 of file gvrender.c.

References agwarningf(), gvplugin_active_render_s::engine, obj_state_s::fill, FILL_NONE, FILL_SOLID, GVJ_s::obj, obj_state_s::pen, PEN_DASHED, PEN_DOTTED, PEN_NONE, PEN_SOLID, obj_state_s::penwidth, PENWIDTH_BOLD, obj_state_s::rawstyle, GVJ_s::render, and streq().

Referenced by arrow_gen(), doBorder(), emit_attachment(), emit_begin_edge(), emit_clusters(), emit_edge_graphics(), emit_html_label(), emit_xdot(), multicolor(), point_gencode(), and stylenode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gvrender_textspan()

void gvrender_textspan ( GVJ_t job,
pointf  p,
textspan_t span 
)

Definition at line 417 of file gvrender.c.

References gvplugin_active_render_s::engine, GVJ_s::flags, GVRENDER_DOES_TRANSFORM, gvrender_ptf(), GVJ_s::obj, obj_state_s::pen, PEN_NONE, GVJ_s::render, textspan_t::str, and gvrender_engine_s::textspan.

Referenced by emit_htextspans(), emit_label(), and emit_xdot().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gvrender_usershape()

void gvrender_usershape ( GVJ_t job,
char *  name,
pointf a,
size_t  n,
bool  filled,
char *  imagescale,
char *  imagepos 
)

Definition at line 673 of file gvrender.c.

References GVJ_s::dpi, gvplugin_active_render_s::engine, EXPANDBP, find_user_shape(), GVJ_s::flags, get_imagepos(), get_imagescale(), gvloadimage(), GVRENDER_DOES_TRANSFORM, gvrender_ptf(), gvusershape_find(), gvusershape_size_dpi(), IMAGEPOS_BOTTOM_CENTER, IMAGEPOS_BOTTOM_LEFT, IMAGEPOS_BOTTOM_RIGHT, IMAGEPOS_MIDDLE_LEFT, IMAGEPOS_MIDDLE_RIGHT, IMAGEPOS_TOP_CENTER, IMAGEPOS_TOP_LEFT, IMAGEPOS_TOP_RIGHT, IMAGESCALE_BOTH, IMAGESCALE_FALSE, IMAGESCALE_HEIGHT, IMAGESCALE_TRUE, IMAGESCALE_WIDTH, gvrender_engine_s::library_shape, boxf::LL, GVJ_s::render, gvplugin_active_render_s::type, boxf::UR, point::x, pointf_s::x, point::y, and pointf_s::y.

Referenced by emit_html_img(), and poly_gencode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mapbool()

bool mapbool ( const char *  s)
extern

Definition at line 336 of file utils.c.

Referenced by get_imagescale().

Here is the caller graph for this function: