Graphviz 12.0.1~dev.20240715.2254
Loading...
Searching...
No Matches
labels.c File Reference
#include <cgraph/agxbuf.h>
#include <cgraph/alloc.h>
#include <common/render.h>
#include <common/htmltable.h>
#include <limits.h>
#include <stdbool.h>
#include <stddef.h>
Include dependency graph for labels.c:

Go to the source code of this file.

Functions

static char * strdup_and_subst_obj0 (char *str, void *obj, int escBackslash)
 
static void storeline (GVC_t *gvc, textlabel_t *lp, char *line, char terminator)
 
void make_simple_label (GVC_t *gvc, textlabel_t *lp)
 
textlabel_tmake_label (void *obj, char *str, int kind, double fontsize, char *fontname, char *fontcolor)
 
void free_textspan (textspan_t *tl, size_t cnt)
 
void free_label (textlabel_t *p)
 
void emit_label (GVJ_t *job, emit_state_t emit_state, textlabel_t *lp)
 
char * strdup_and_subst_obj (char *str, void *obj)
 

Function Documentation

◆ emit_label()

void emit_label ( GVJ_t job,
emit_state_t  emit_state,
textlabel_t lp 
)

Definition at line 212 of file labels.c.

References textlabel_t::dimen, emit_html_label(), obj_state_s::emit_state, textlabel_t::fontcolor, textlabel_t::fontsize, gvrender_begin_label(), gvrender_end_label(), gvrender_set_pencolor(), gvrender_textspan(), textlabel_t::html, textspan_t::just, LABEL_PLAIN, obj_state_s::labeledgealigned, textlabel_t::nspans, GVJ_s::obj, textlabel_t::pos, textspan_t::size, textlabel_t::space, textlabel_t::span, textlabel_t::txt, textlabel_t::u, textlabel_t::valign, pointf_s::x, and pointf_s::y.

Referenced by emit_clusters(), emit_edge_label(), emit_node(), emit_page(), epsf_gencode(), gen_fields(), and poly_gencode().

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

◆ free_label()

void free_label ( textlabel_t p)

Definition at line 199 of file labels.c.

References free(), free_html_label(), free_textspan(), textlabel_t::html, textlabel_t::nspans, textlabel_t::span, textlabel_t::text, textlabel_t::txt, and textlabel_t::u.

Referenced by cleanup_graphs(), cleanup_subgs(), dot_cleanup_graph(), dot_cleanup_node(), free_field(), freeEdgeInfo(), graph_cleanup(), gv_cleanup_edge(), and gv_cleanup_node().

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

◆ free_textspan()

void free_textspan ( textspan_t tl,
size_t  cnt 
)

Definition at line 186 of file labels.c.

References cnt(), free(), textspan_t::free_layout, textspan_t::layout, and textspan_t::str.

Referenced by free_label(), and freePara().

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

◆ make_label()

textlabel_t * make_label ( void *  obj,
char *  str,
int  kind,
double  fontsize,
char *  fontname,
char *  fontcolor 
)

Definition at line 108 of file labels.c.

References AGEDGE, agerr(), aghead, agisdirected(), agnameof(), AGNODE, agobjkind(), AGPREV, AGRAPH, agraphof(), agroot(), agtail, CHAR_LATIN1, textlabel_t::charset, textlabel_t::fontcolor, textlabel_t::fontname, textlabel_t::fontsize, free(), GD_charset, GD_gvc, gv_alloc(), gv_strdup(), textlabel_t::html, htmlEntityUTF8(), kind, latin1ToUTF8(), LT_HTML, LT_NONE, LT_RECD, make_html_label(), make_simple_label(), NULL, Agraph_s::root, str, strdup_and_subst_obj0(), and textlabel_t::text.

Referenced by common_init_edge(), common_init_node(), do_graph_label(), and parse_reclbl().

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

◆ make_simple_label()

void make_simple_label ( GVC_t gvc,
textlabel_t lp 
)

Definition at line 54 of file labels.c.

References agxbdisown(), agxbfree(), agxblen(), agxbputc(), CHAR_BIG5, textlabel_t::charset, textlabel_t::dimen, gvc, textlabel_t::space, storeline(), textlabel_t::text, pointf_s::x, and pointf_s::y.

Referenced by make_html_label(), and make_label().

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

◆ storeline()

static void storeline ( GVC_t gvc,
textlabel_t lp,
char *  line,
char  terminator 
)
static

Definition at line 23 of file labels.c.

References textlabel_t::dimen, dtinsert, textspan_t::font, textlabel_t::fontname, textlabel_t::fontsize, gv_recalloc(), gvc, textspan_t::just, LINESPACING, MAX, textfont_t::name, textlabel_t::nspans, textfont_t::size, textspan_t::size, textlabel_t::span, textspan_t::str, GVC_s::textfont_dt, textspan_size(), textlabel_t::txt, textlabel_t::u, pointf_s::x, and pointf_s::y.

Referenced by make_simple_label().

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

◆ strdup_and_subst_obj()

char * strdup_and_subst_obj ( char *  str,
void *  obj 
)

Definition at line 385 of file labels.c.

References str, and strdup_and_subst_obj0().

Referenced by emit_begin_edge(), graph_init(), gv_edge_state(), gv_graph_state(), gv_node_state(), gvevent_enter_obj(), initMapData(), size_html_txt(), and svg_begin_edge().

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

◆ strdup_and_subst_obj0()

static char * strdup_and_subst_obj0 ( char *  str,
void *  obj,
int  escBackslash 
)
static

Definition at line 278 of file labels.c.

References AGEDGE, aghead, agisdirected(), agnameof(), AGNODE, agobjkind(), AGRAPH, agraphof(), agroot(), agtail, agxbdisown(), agxbprint(), agxbput(), agxbputc(), ED_head_port, ED_label, ED_tail_port, GD_label, isEdge(), port::name, ND_label, str, and textlabel_t::text.

Referenced by make_label(), and strdup_and_subst_obj().

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