Graphviz 16.1.1~dev.20261013.0011
Loading...
Searching...
No Matches
htmltable.c File Reference
#include "config.h"
#include <assert.h>
#include <common/render.h>
#include <common/htmltable.h>
#include <common/pointset.h>
#include <cdt/cdt.h>
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <math.h>
#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <util/agxbuf.h>
#include <util/alloc.h>
#include <util/bitarray.h>
#include <util/exit.h>
#include <util/gv_math.h>
#include <util/prisize_t.h>
#include <util/strcasecmp.h>
#include <util/streq.h>
#include <util/unreachable.h>
Include dependency graph for htmltable.c:

Go to the source code of this file.

Data Structures

struct  htmlmap_data_t
 

Macros

#define DEFAULT_BORDER   1
 
#define DEFAULT_CELLPADDING   2
 
#define DEFAULT_CELLSPACING   2
 
#define RESET(fld)    if(obj->fld != save->fld) {free(obj->fld); obj->fld = save->fld;}
 

Functions

static void pushFontInfo (htmlenv_t *env, textfont_t *fp, textfont_t *savp)
 
static void popFontInfo (htmlenv_t *env, textfont_t *savp)
 
static void emit_htextspans (GVJ_t *job, size_t nspans, htextspan_t *spans, pointf p, double halfwidth_x, textfont_t finfo, boxf b, int simple)
 
static void emit_html_txt (GVJ_t *job, htmltxt_t *tp, htmlenv_t *env)
 
static void doSide (GVJ_t *job, pointf p, double wd, double ht)
 
static pointf * mkPts (pointf *AF, boxf b, int border)
 
static void doBorder (GVJ_t *job, htmldata_t *dp, boxf b)
 
static int setFill (GVJ_t *job, char *color, int angle, htmlstyle_t style, char *clrs[2])
 
static int initAnchor (GVJ_t *job, htmlenv_t *env, htmldata_t *data, boxf b, htmlmap_data_t *save)
 
static void endAnchor (GVJ_t *job, htmlmap_data_t *save)
 
static void emit_html_cell (GVJ_t *job, htmlcell_t *cp, htmlenv_t *env)
 
static void emit_html_rules (GVJ_t *job, htmlcell_t *cp, htmlenv_t *env, char *color, htmlcell_t *nextc)
 
static void emit_html_tbl (GVJ_t *job, htmltbl_t *tbl, htmlenv_t *env)
 
static void emit_html_img (GVJ_t *job, htmlimg_t *cp, htmlenv_t *env)
 
static void allocObj (GVJ_t *job)
 
static void freeObj (GVJ_t *job)
 
static double heightOfLbl (htmllabel_t *lp)
 
void emit_html_label (GVJ_t *job, htmllabel_t *lp, textlabel_t *tp)
 
void free_html_data (htmldata_t *dp)
 
void free_html_text (htmltxt_t *t)
 
static void free_html_img (htmlimg_t *ip)
 
static void free_html_cell (htmlcell_t *cp)
 
static void free_html_tbl (htmltbl_t *tbl)
 
void free_html_label (htmllabel_t *lp, int root)
 
static htmldata_t * portToTbl (htmltbl_t *, char *)
 
static htmldata_t * portToCell (htmlcell_t *cp, char *id)
 
boxf * html_port (node_t *n, char *pname, unsigned char *sides)
 
static int size_html_txt (GVC_t *gvc, htmltxt_t *ftxt, htmlenv_t *env)
 
static int size_html_tbl (graph_t *g, htmltbl_t *tbl, htmlcell_t *parent, htmlenv_t *env)
 
static int size_html_img (htmlimg_t *img, htmlenv_t *env)
 
static int size_html_cell (graph_t *g, htmlcell_t *cp, htmltbl_t *parent, htmlenv_t *env)
 
static uint16_t findCol (PointSet *ps, int row, int col, htmlcell_t *cellp)
 
static int processTbl (graph_t *g, htmltbl_t *tbl, htmlenv_t *env)
 
static void set_cell_widths (htmltbl_t *table)
 
static void set_cell_heights (htmltbl_t *table)
 
static void pos_html_tbl (htmltbl_t *, boxf, unsigned char)
 
static void pos_html_img (htmlimg_t *cp, boxf pos)
 
static void pos_html_txt (htmltxt_t *ftxt, char c)
 Set default alignment.
 
static void pos_html_cell (htmlcell_t *cp, boxf pos, unsigned char sides)
 
static char * nameOf (void *obj, agxbuf *xb)
 
static char * getPenColor (void *obj)
 
int make_html_label (void *obj, textlabel_t *lp)
 Return non-zero if problem parsing HTML. In this case, use object name.
 

Macro Definition Documentation

◆ DEFAULT_BORDER

#define DEFAULT_BORDER   1

Definition at line 56 of file htmltable.c.

◆ DEFAULT_CELLPADDING

#define DEFAULT_CELLPADDING   2

Definition at line 57 of file htmltable.c.

◆ DEFAULT_CELLSPACING

#define DEFAULT_CELLSPACING   2

Definition at line 58 of file htmltable.c.

◆ RESET

#define RESET (   fld)     if(obj->fld != save->fld) {free(obj->fld); obj->fld = save->fld;}

Definition at line 419 of file htmltable.c.

Function Documentation

◆ allocObj()

static void allocObj ( GVJ_t *  job)
static

Definition at line 680 of file htmltable.c.

References CLUSTER_OBJTYPE, obj_state_s::e, EDGE_OBJTYPE, obj_state_s::emit_state, obj_state_s::explicit_tooltip, obj_state_s::g, obj_state_s::n, NODE_OBJTYPE, obj_state_s::parent, parent, push_obj_state(), ROOTGRAPH_OBJTYPE, obj_state_s::sg, obj_state_s::target, obj_state_s::tooltip, obj_state_s::type, obj_state_s::u, UNREACHABLE, and obj_state_s::url.

Referenced by emit_html_label().

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

◆ doBorder()

static void doBorder ( GVJ_t *  job,
htmldata_t *  dp,
boxf  b 
)
static

Definition at line 253 of file htmltable.c.

References htmldata_t::border, BORDER_BOTTOM, BORDER_LEFT, BORDER_MASK, BORDER_RIGHT, BORDER_TOP, color(), htmlstyle_t::dashed, DEFAULT_COLOR, GVC_s::defaultlinestyle, delta, htmlstyle_t::dotted, htmldata_t::flags, GVJ_s::gvc, gvrender_box(), gvrender_polyline(), gvrender_set_pencolor(), gvrender_set_penwidth(), gvrender_set_style(), boxf::LL, mkPts(), NULL, htmldata_t::pencolor, round_corners(), htmlstyle_t::rounded, htmldata_t::style, boxf::UR, pointf_s::x, and pointf_s::y.

Referenced by emit_html_cell(), and emit_html_tbl().

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

◆ doSide()

static void doSide ( GVJ_t *  job,
pointf  p,
double  wd,
double  ht 
)
static

Definition at line 214 of file htmltable.c.

References gvrender_box(), boxf::LL, boxf::UR, pointf_s::x, and pointf_s::y.

Referenced by emit_html_rules().

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

◆ emit_htextspans()

static void emit_htextspans ( GVJ_t *  job,
size_t  nspans,
htextspan_t *  spans,
pointf  p,
double  halfwidth_x,
textfont_t  finfo,
boxf  b,
int  simple 
)
static

Definition at line 118 of file htmltable.c.

References textfont_t::color, textfont_t::flags, textspan_t::font, gvrender_begin_label(), gvrender_end_label(), gvrender_set_pencolor(), gvrender_textspan(), htextspan_t::items, textspan_t::just, LABEL_HTML, textspan_t::layout, htextspan_t::lfsize, boxf::LL, textfont_t::name, htextspan_t::nitems, textfont_t::postscript_alias, simple, htextspan_t::size, textfont_t::size, textspan_t::size, textspan_t::str, boxf::UR, pointf_s::x, pointf_s::y, textspan_t::yoffset_centerline, and textspan_t::yoffset_layout.

Referenced by emit_html_txt().

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

◆ emit_html_cell()

static void emit_html_cell ( GVJ_t *  job,
htmlcell_t *  cp,
htmlenv_t *  env 
)
static

Definition at line 622 of file htmltable.c.

References htmldata_t::bgcolor, htmldata_t::border, htmldata_t::box, htmlcell_t::child, htmlcell_t::data, doBorder(), EMIT_CLUSTERS_LAST, emit_html_img(), emit_html_tbl(), emit_html_txt(), endAnchor(), GVJ_s::flags, free(), htmldata_t::gradientangle, gvrender_box(), htmldata_t::href, HTML_IMAGE, HTML_TBL, htmllabel_t::img, initAnchor(), htmlstyle_t::invisible, htmllabel_t::kind, boxf::LL, mkPts(), htmlenv_t::pos, round_corners(), htmlstyle_t::rounded, setFill(), htmldata_t::style, htmldata_t::target, htmllabel_t::tbl, htmldata_t::title, htmllabel_t::txt, htmllabel_t::u, boxf::UR, pointf_s::x, and pointf_s::y.

Referenced by emit_html_tbl().

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

◆ emit_html_img()

static void emit_html_img ( GVJ_t *  job,
htmlimg_t *  cp,
htmlenv_t *  env 
)
static

Definition at line 595 of file htmltable.c.

References A, htmlimg_t::box, gvrender_usershape(), htmlenv_t::imgscale, boxf::LL, htmlenv_t::pos, scale(), htmlimg_t::scale, htmlimg_t::src, boxf::UR, pointf_s::x, and pointf_s::y.

Referenced by emit_html_cell().

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

◆ emit_html_label()

void emit_html_label ( GVJ_t *  job,
htmllabel_t *  lp,
textlabel_t *  tp 
)

Definition at line 743 of file htmltable.c.

References agget(), allocObj(), textfont_t::color, htmltbl_t::data, DEFAULT_COLOR, GVC_s::defaultlinestyle, emit_html_tbl(), emit_html_txt(), htmlenv_t::finfo, textlabel_t::fontcolor, textlabel_t::fontname, textlabel_t::fontsize, free(), freeObj(), GVJ_s::gvc, gvrender_set_pencolor(), gvrender_set_style(), heightOfLbl(), HTML_TBL, obj_state_s::id, htmlenv_t::imgscale, htmllabel_t::kind, obj_state_s::n, textfont_t::name, NULL, GVJ_s::obj, htmlenv_t::objid, htmlenv_t::objid_set, htmldata_t::pencolor, htmlenv_t::pos, textlabel_t::pos, textfont_t::size, textlabel_t::space, htmllabel_t::tbl, htmllabel_t::txt, htmllabel_t::u, obj_state_s::u, textlabel_t::valign, and pointf_s::y.

Referenced by emit_label().

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

◆ emit_html_rules()

static void emit_html_rules ( GVJ_t *  job,
htmlcell_t *  cp,
htmlenv_t *  env,
char *  color,
htmlcell_t *  nextc 
)
static

Definition at line 451 of file htmltable.c.

References htmldata_t::border, htmldata_t::box, htmlcell_t::col, color(), htmlcell_t::colspan, htmltbl_t::column_count, htmltbl_t::data, htmlcell_t::data, DEFAULT_COLOR, doSide(), gvrender_set_fillcolor(), gvrender_set_pencolor(), htmlcell_t::hruled, boxf::LL, htmlcell_t::parent, htmlenv_t::pos, htmlcell_t::row, htmltbl_t::row_count, htmlcell_t::rowspan, htmldata_t::space, boxf::UR, htmlcell_t::vruled, pointf_s::x, and pointf_s::y.

Referenced by emit_html_tbl().

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

◆ emit_html_tbl()

static void emit_html_tbl ( GVJ_t *  job,
htmltbl_t *  tbl,
htmlenv_t *  env 
)
static

Definition at line 517 of file htmltable.c.

References htmldata_t::bgcolor, htmldata_t::border, htmldata_t::box, htmltbl_t::cells, htmltbl_t::data, doBorder(), EMIT_CLUSTERS_LAST, emit_html_cell(), emit_html_rules(), endAnchor(), GVJ_s::flags, htmltbl_t::font, free(), htmldata_t::gradientangle, gvrender_box(), gvrender_set_penwidth(), htmldata_t::href, htmlcell_t::hruled, initAnchor(), htmlstyle_t::invisible, boxf::LL, mkPts(), htmldata_t::pencolor, popFontInfo(), htmlenv_t::pos, pushFontInfo(), round_corners(), htmlstyle_t::rounded, setFill(), htmldata_t::style, htmldata_t::target, htmldata_t::title, boxf::UR, htmlcell_t::vruled, pointf_s::x, and pointf_s::y.

Referenced by emit_html_cell(), and emit_html_label().

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

◆ emit_html_txt()

static void emit_html_txt ( GVJ_t *  job,
htmltxt_t *  tp,
htmlenv_t *  env 
)
static

Definition at line 197 of file htmltable.c.

References htmltxt_t::box, emit_htextspans(), htmlenv_t::finfo, boxf::LL, htmltxt_t::nspans, htmlenv_t::pos, htmltxt_t::simple, htmltxt_t::spans, boxf::UR, pointf_s::x, and pointf_s::y.

Referenced by emit_html_cell(), and emit_html_label().

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

◆ endAnchor()

static void endAnchor ( GVJ_t *  job,
htmlmap_data_t *  save 
)
static

Definition at line 432 of file htmltable.c.

References htmlmap_data_t::explicit_tooltip, obj_state_s::explicit_tooltip, gvrender_end_anchor(), GVJ_s::obj, RESET, and obj_state_s::url.

Referenced by emit_html_cell(), and emit_html_tbl().

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

◆ findCol()

static uint16_t findCol ( PointSet *  ps,
int  row,
int  col,
htmlcell_t *  cellp 
)
static

Definition at line 1156 of file htmltable.c.

References addPS(), htmlcell_t::colspan, isInPS(), row, htmlcell_t::rowspan, and UINT16_MAX.

Referenced by processTbl().

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

◆ free_html_cell()

static void free_html_cell ( htmlcell_t *  cp)
static

Definition at line 826 of file htmltable.c.

References htmlcell_t::child, htmlcell_t::data, free(), free_html_data(), and free_html_label().

Referenced by free_html_tbl().

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

◆ free_html_data()

void free_html_data ( htmldata_t *  dp)

Definition at line 790 of file htmltable.c.

References htmldata_t::bgcolor, free(), htmldata_t::href, htmldata_t::id, htmldata_t::pencolor, htmldata_t::port, htmldata_t::target, and htmldata_t::title.

Referenced by cleanCell(), cleanTbl(), free_html_cell(), and free_html_tbl().

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

◆ free_html_img()

static void free_html_img ( htmlimg_t *  ip)
static

Definition at line 820 of file htmltable.c.

References free(), and htmlimg_t::src.

Referenced by free_html_label().

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

◆ free_html_label()

void free_html_label ( htmllabel_t *  lp,
int  root 
)

Definition at line 859 of file htmltable.c.

References free(), free_html_img(), free_html_tbl(), free_html_text(), HTML_IMAGE, HTML_TBL, htmllabel_t::img, htmllabel_t::kind, htmllabel_t::tbl, htmllabel_t::txt, and htmllabel_t::u.

Referenced by cleanup(), cleanup(), free_html_cell(), and free_label().

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

◆ free_html_tbl()

static void free_html_tbl ( htmltbl_t *  tbl)
static

Definition at line 838 of file htmltable.c.

References htmltbl_t::cells, htmltbl_t::data, free(), free_html_cell(), free_html_data(), htmltbl_t::heights, LIST_FREE, htmltbl_t::row_count, htmltbl_t::rows, SIZE_MAX, and htmltbl_t::widths.

Referenced by free_html_label().

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

◆ free_html_text()

void free_html_text ( htmltxt_t *  t)

Definition at line 801 of file htmltable.c.

References free(), textspan_t::free_layout, htextspan_t::items, layout(), htextspan_t::nitems, htmltxt_t::nspans, htmltxt_t::spans, and str.

Referenced by cleanCell(), and free_html_label().

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

◆ freeObj()

static void freeObj ( GVJ_t *  job)
static

Definition at line 711 of file htmltable.c.

References obj_state_s::id, NULL, GVJ_s::obj, pop_obj_state(), obj_state_s::target, obj_state_s::tooltip, and obj_state_s::url.

Referenced by emit_html_label().

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

◆ getPenColor()

static char * getPenColor ( void *  obj)
static

Definition at line 1841 of file htmltable.c.

References agget(), NULL, and str.

Referenced by make_html_label().

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

◆ heightOfLbl()

static double heightOfLbl ( htmllabel_t *  lp)
static

Definition at line 723 of file htmltable.c.

References htmltxt_t::box, htmlimg_t::box, htmldata_t::box, htmltbl_t::data, HTML_IMAGE, HTML_TBL, HTML_TEXT, htmllabel_t::img, htmllabel_t::kind, boxf::LL, htmllabel_t::tbl, htmllabel_t::txt, htmllabel_t::u, UNREACHABLE, boxf::UR, and pointf_s::y.

Referenced by emit_html_label().

Here is the caller graph for this function:

◆ html_port()

boxf * html_port ( node_t *  n,
char *  pname,
unsigned char *  sides 
)

Definition at line 914 of file htmltable.c.

References htmldata_t::box, HTML_TEXT, htmllabel_t::kind, ND_label, NULL, portToTbl(), htmldata_t::sides, streq(), htmllabel_t::tbl, and htmllabel_t::u.

Referenced by poly_port().

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

◆ initAnchor()

static int initAnchor ( GVJ_t *  job,
htmlenv_t *  env,
htmldata_t *  data,
boxf  b,
htmlmap_data_t *  save 
)
static

Definition at line 381 of file htmltable.c.

References agxbfree(), agxbprint(), agxbuse(), emit_map_rect(), htmlmap_data_t::explicit_tooltip, obj_state_s::explicit_tooltip, obj_state_s::g, getObjId(), gv_strdup(), gvrender_begin_anchor(), htmldata_t::href, id, htmlmap_data_t::id, htmldata_t::id, obj_state_s::id, initMapData(), obj_state_s::n, NULL, GVJ_s::obj, htmlenv_t::objid, htmlenv_t::objid_set, htmlmap_data_t::target, htmldata_t::target, obj_state_s::target, htmldata_t::title, htmlmap_data_t::tooltip, obj_state_s::tooltip, obj_state_s::u, htmlmap_data_t::url, and obj_state_s::url.

Referenced by emit_html_cell(), and emit_html_tbl().

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

◆ make_html_label()

int make_html_label ( void *  obj,
textlabel_t *  lp 
)

◆ mkPts()

static pointf * mkPts ( pointf *  AF,
boxf  b,
int  border 
)
static

Definition at line 229 of file htmltable.c.

References delta, boxf::LL, boxf::UR, pointf_s::x, and pointf_s::y.

Referenced by doBorder(), emit_html_cell(), and emit_html_tbl().

Here is the caller graph for this function:

◆ nameOf()

static char * nameOf ( void *  obj,
agxbuf *  xb 
)
static

Definition at line 1698 of file htmltable.c.

References AGEDGE, aghead, agisdirected(), agnameof(), AGNODE, agobjkind(), AGRAPH, agraphof(), agtail, agxbput(), and agxbuse().

Referenced by make_html_label().

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

◆ popFontInfo()

static void popFontInfo ( htmlenv_t *  env,
textfont_t *  savp 
)
static

Definition at line 107 of file htmltable.c.

References textfont_t::color, htmlenv_t::finfo, textfont_t::name, and textfont_t::size.

Referenced by emit_html_tbl(), and size_html_tbl().

Here is the caller graph for this function:

◆ portToCell()

static htmldata_t * portToCell ( htmlcell_t *  cp,
char *  id 
)
static

Definition at line 873 of file htmltable.c.

References htmlcell_t::child, htmlcell_t::data, HTML_TBL, htmllabel_t::kind, NULL, htmldata_t::port, portToTbl(), htmllabel_t::tbl, and htmllabel_t::u.

Referenced by portToTbl().

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

◆ portToTbl()

static htmldata_t * portToTbl ( htmltbl_t *  tp,
char *  id 
)
static

Definition at line 890 of file htmltable.c.

References htmltbl_t::cells, htmltbl_t::data, NULL, htmldata_t::port, and portToCell().

Referenced by html_port(), and portToCell().

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

◆ pos_html_cell()

static void pos_html_cell ( htmlcell_t *  cp,
boxf  pos,
unsigned char  sides 
)
static

Definition at line 1399 of file htmltable.c.

References BALIGN_LEFT, BALIGN_MASK, BALIGN_RIGHT, htmldata_t::border, htmltxt_t::box, htmlimg_t::box, htmldata_t::box, htmlcell_t::child, htmltbl_t::data, htmlcell_t::data, FIXED_FLAG, htmldata_t::flags, gv_strdup(), HALIGN_LEFT, HALIGN_MASK, HALIGN_RIGHT, HALIGN_TEXT, HTML_IMAGE, HTML_TBL, htmllabel_t::img, htmllabel_t::kind, boxf::LL, htmldata_t::pad, htmlcell_t::parent, htmldata_t::pencolor, pos_html_img(), pos_html_tbl(), pos_html_txt(), htmldata_t::sides, htmllabel_t::tbl, htmllabel_t::txt, htmllabel_t::u, boxf::UR, VALIGN_BOTTOM, VALIGN_MASK, VALIGN_TOP, pointf_s::x, and pointf_s::y.

Referenced by pos_html_tbl().

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

◆ pos_html_img()

static void pos_html_img ( htmlimg_t *  cp,
boxf  pos 
)
static

Definition at line 1385 of file htmltable.c.

References htmlimg_t::box.

Referenced by pos_html_cell().

Here is the caller graph for this function:

◆ pos_html_tbl()

static void pos_html_tbl ( htmltbl_t *  tbl,
boxf  pos,
unsigned char  sides 
)
static

Definition at line 1548 of file htmltable.c.

References htmldata_t::border, BOTTOM, htmldata_t::box, htmltbl_t::cells, htmlcell_t::col, htmlcell_t::colspan, htmltbl_t::column_count, htmltbl_t::data, htmlcell_t::data, FIXED_FLAG, htmldata_t::flags, gv_strdup(), HALIGN_LEFT, HALIGN_MASK, HALIGN_RIGHT, htmltbl_t::heights, LEFT, boxf::LL, htmltbl_t::parent, htmldata_t::pencolor, pos_html_cell(), RIGHT, ROUND, htmlcell_t::row, htmltbl_t::row_count, htmlcell_t::rowspan, htmldata_t::sides, htmldata_t::space, TOP, boxf::UR, VALIGN_BOTTOM, VALIGN_MASK, VALIGN_TOP, htmltbl_t::widths, pointf_s::x, and pointf_s::y.

Referenced by make_html_label(), and pos_html_cell().

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

◆ pos_html_txt()

static void pos_html_txt ( htmltxt_t *  ftxt,
char  c 
)
static

Definition at line 1391 of file htmltable.c.

References htextspan_t::just, htmltxt_t::nspans, htmltxt_t::spans, and UNSET_ALIGN.

Referenced by pos_html_cell().

Here is the caller graph for this function:

◆ processTbl()

static int processTbl ( graph_t *  g,
htmltbl_t *  tbl,
htmlenv_t *  env 
)
static

Definition at line 1187 of file htmltable.c.

References bitarray_get(), bitarray_new(), bitarray_reset(), bitarray_set(), htmltbl_t::cells, cnt(), htmlcell_t::col, htmlcell_t::colspan, htmltbl_t::column_count, findCol(), freePS(), gv_calloc(), htmlcell_t::hruled, LIST_FREE, LIST_GET, LIST_SIZE, MAX, newPS(), htmlcell_t::row, htmltbl_t::row_count, rows, htmltbl_t::rows, htmlcell_t::rowspan, row_t::ruled, size_html_cell(), and UINT16_MAX.

Referenced by size_html_tbl().

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

◆ pushFontInfo()

static void pushFontInfo ( htmlenv_t *  env,
textfont_t *  fp,
textfont_t *  savp 
)
static

Definition at line 79 of file htmltable.c.

References textfont_t::color, htmlenv_t::finfo, textfont_t::name, NULL, and textfont_t::size.

Referenced by emit_html_tbl(), and size_html_tbl().

Here is the caller graph for this function:

◆ set_cell_heights()

static void set_cell_heights ( htmltbl_t *  table)
static

set the heights of HTML table cells

This recapitulates the logic of set_cell_widths on rows.

Parameters
tableTable to update

Definition at line 1326 of file htmltable.c.

References gv_calloc(), NULL, and table.

Referenced by size_html_tbl().

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

◆ set_cell_widths()

static void set_cell_widths ( htmltbl_t *  table)
static

set the widths of HTML table cells

Graphviz HTML tables were implemented prior to HTML standardization, but the subsequent RFC 1942¹ provides some guidance on “Recommended Layout Algorithms.” Following this, the W3C gave a slightly clearer articulation of essentially the same guidance when specifying CSS.² Many features discussed in this algorithm are not present in Graphviz’ variant of HTML (e.g. widths as percentages) or are not relevant (e.g. the derivation of maximum column widths seems only relevant if you are laying out a table within another elastically sized container like a browser window), but the algorithm is useful nonetheless. This function implements an adapted version of the CSS specification algorithm. Comments that include quotes are quoting the CSS specification.

¹ https://www.ietf.org/rfc/rfc1942.txt ² https://www.w3.org/TR/CSS2/tables.html#width-layout

Parameters
tableTable to update

Definition at line 1250 of file htmltable.c.

References gv_calloc(), NULL, and table.

Referenced by size_html_tbl().

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

◆ setFill()

static int setFill ( GVJ_t *  job,
char *  color,
int  angle,
htmlstyle_t  style,
char *  clrs[2] 
)
static

Definition at line 348 of file htmltable.c.

References color(), DEFAULT_COLOR, FILL, findStopColor(), GRADIENT, gvrender_set_fillcolor(), gvrender_set_gradient_vals(), gvrender_set_pencolor(), htmlstyle_t::radial, and RGRADIENT.

Referenced by emit_html_cell(), and emit_html_tbl().

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

◆ size_html_cell()

static int size_html_cell ( graph_t *  g,
htmlcell_t *  cp,
htmltbl_t *  parent,
htmlenv_t *  env 
)
static

Definition at line 1099 of file htmltable.c.

References agwarningf(), htmldata_t::border, BORDER_SET, htmltxt_t::box, htmlimg_t::box, htmldata_t::box, htmlcell_t::child, htmltbl_t::data, htmlcell_t::data, DEFAULT_BORDER, DEFAULT_CELLPADDING, FIXED_FLAG, htmldata_t::flags, GD_gvc, htmldata_t::height, HTML_IMAGE, HTML_TBL, htmllabel_t::img, htmllabel_t::kind, MAX, htmldata_t::pad, PAD_SET, htmlcell_t::parent, parent, size_html_img(), size_html_tbl(), size_html_txt(), htmllabel_t::tbl, htmllabel_t::txt, htmllabel_t::u, boxf::UR, htmldata_t::width, pointf_s::x, and pointf_s::y.

Referenced by processTbl().

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

◆ size_html_img()

static int size_html_img ( htmlimg_t *  img,
htmlenv_t *  env 
)
static

Definition at line 1078 of file htmltable.c.

References agerrorf(), B2BF, htmlimg_t::box, htmlenv_t::g, GD_has_images, gvusershape_size(), box::LL, htmlimg_t::src, box::UR, point::x, and point::y.

Referenced by size_html_cell().

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

◆ size_html_tbl()

static int size_html_tbl ( graph_t *  g,
htmltbl_t *  tbl,
htmlcell_t *  parent,
htmlenv_t *  env 
)
static

Definition at line 1645 of file htmltable.c.

References agwarningf(), htmldata_t::border, BORDER_SET, htmldata_t::box, htmltbl_t::column_count, htmltbl_t::data, DEFAULT_BORDER, DEFAULT_CELLSPACING, FIXED_FLAG, htmldata_t::flags, htmltbl_t::font, htmldata_t::height, htmltbl_t::heights, htmltbl_t::parent, parent, popFontInfo(), processTbl(), pushFontInfo(), htmltbl_t::row_count, set_cell_heights(), set_cell_widths(), htmldata_t::space, SPACE_SET, boxf::UR, htmldata_t::width, htmltbl_t::widths, pointf_s::x, and pointf_s::y.

Referenced by make_html_label(), and size_html_cell().

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

◆ size_html_txt()

static int size_html_txt ( GVC_t *  gvc,
htmltxt_t *  ftxt,
htmlenv_t *  env 
)
static

Definition at line 932 of file htmltable.c.

References htmltxt_t::box, textfont_t::color, dtinsert, htmlenv_t::finfo, textfont_t::flags, textspan_t::font, free(), textspan_t::free_layout, gvc, htextspan_t::items, textspan_t::layout, htextspan_t::lfsize, MAX, textfont_t::name, htextspan_t::nitems, htmltxt_t::nspans, NULL, htmlenv_t::obj, simple, htmltxt_t::simple, htextspan_t::size, textfont_t::size, textspan_t::size, htmltxt_t::spans, textspan_t::str, strdup_and_subst_obj(), GVC_s::textfont_dt, textspan_size(), boxf::UR, pointf_s::x, pointf_s::y, textspan_t::yoffset_centerline, and textspan_t::yoffset_layout.

Referenced by make_html_label(), and size_html_cell().

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