Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
gvrender_pango.c File Reference
#include "config.h"
#include <assert.h>
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <common/const.h>
#include <gvc/gvplugin_render.h>
#include <common/utils.h>
#include <gvc/gvplugin_device.h>
#include <gvc/gvio.h>
#include <math.h>
#include <util/agxbuf.h>
#include "gvplugin_pango.h"
#include <pango/pangocairo.h>
Include dependency graph for gvrender_pango.c:

Go to the source code of this file.

Macros

#define ARRAY_SIZE(A)   (sizeof(A)/sizeof(A[0]))
 
#define RMIN   0.01
 

Enumerations

enum  format_type {
  FORMAT_CAIRO , FORMAT_PNG , FORMAT_PS , FORMAT_PDF ,
  FORMAT_SVG , FORMAT_EPS
}
 

Functions

static void cairogen_polyline (GVJ_t *job, pointf *A, size_t n)
 
static void cairogen_set_color (cairo_t *cr, gvcolor_t *color)
 
static void cairogen_add_color_stop_rgba (cairo_pattern_t *pat, double stop, gvcolor_t *color)
 
static cairo_status_t writer (void *closure, const unsigned char *data, unsigned int length)
 
static void cairogen_begin_job (GVJ_t *job)
 
static void cairogen_end_job (GVJ_t *job)
 
static void cairogen_begin_page (GVJ_t *job)
 
static void cairogen_end_page (GVJ_t *job)
 
static void cairogen_begin_anchor (GVJ_t *job, char *url, char *tooltip, char *target, char *id)
 
static void cairogen_textspan (GVJ_t *job, pointf p, textspan_t *span)
 
static void cairogen_set_penstyle (GVJ_t *job, cairo_t *cr)
 
static void cairo_gradient_fill (cairo_t *cr, obj_state_t *obj, int filled, pointf *A, size_t n)
 
static void cairogen_ellipse (GVJ_t *job, pointf *A, int filled)
 
static void cairogen_polygon (GVJ_t *job, pointf *A, size_t n, int filled)
 
static void cairogen_bezier (GVJ_t *job, pointf *A, size_t n, int filled)
 

Variables

static double dashed [] = {6.}
 
static int dashed_len = ARRAY_SIZE(dashed)
 
static double dotted [] = {2., 6.}
 
static int dotted_len = ARRAY_SIZE(dotted)
 
static const double CAIRO_XMAX = 32767
 
static const double CAIRO_YMAX = 32767
 
static gvrender_engine_t cairogen_engine
 
static gvrender_features_t render_features_cairo
 
static gvdevice_features_t device_features_png
 
static gvdevice_features_t device_features_ps
 
static gvdevice_features_t device_features_eps
 
static gvdevice_features_t device_features_pdf
 
static gvdevice_features_t device_features_svg
 
gvplugin_installed_t gvrender_pango_types []
 
gvplugin_installed_t gvdevice_pango_types []
 

Macro Definition Documentation

◆ ARRAY_SIZE

#define ARRAY_SIZE (   A)    (sizeof(A)/sizeof(A[0]))

Definition at line 41 of file gvrender_pango.c.

◆ RMIN

#define RMIN   0.01

Enumeration Type Documentation

◆ format_type

Enumerator
FORMAT_CAIRO 
FORMAT_PNG 
FORMAT_PS 
FORMAT_PDF 
FORMAT_SVG 
FORMAT_EPS 

Definition at line 32 of file gvrender_pango.c.

Function Documentation

◆ cairo_gradient_fill()

static void cairo_gradient_fill ( cairo_t *  cr,
obj_state_t obj,
int  filled,
pointf A,
size_t  n 
)
static

Definition at line 343 of file gvrender_pango.c.

References A, cairogen_add_color_stop_rgba(), obj_state_s::fillcolor, G, get_gradient_points(), GRADIENT, obj_state_s::gradient_angle, obj_state_s::gradient_frac, M_PI, obj_state_s::stopcolor, pointf_s::x, and pointf_s::y.

Referenced by cairogen_bezier(), cairogen_ellipse(), and cairogen_polygon().

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

◆ cairogen_add_color_stop_rgba()

static void cairogen_add_color_stop_rgba ( cairo_pattern_t *  pat,
double  stop,
gvcolor_t color 
)
static

Definition at line 69 of file gvrender_pango.c.

References color().

Referenced by cairo_gradient_fill().

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

◆ cairogen_begin_anchor()

static void cairogen_begin_anchor ( GVJ_t job,
char *  url,
char *  tooltip,
char *  target,
char *  id 
)
static

Definition at line 263 of file gvrender_pango.c.

References agxbfree(), agxbprint(), agxbuse(), GVJ_s::context, GVJ_s::obj, obj_state_s::url_map_p, pointf_s::x, and pointf_s::y.

Here is the call graph for this function:

◆ cairogen_begin_job()

static void cairogen_begin_job ( GVJ_t job)
static

Definition at line 84 of file gvrender_pango.c.

References GVJ_s::context, and GVJ_s::external_context.

◆ cairogen_begin_page()

static void cairogen_begin_page ( GVJ_t job)
static

Definition at line 105 of file gvrender_pango.c.

References CAIRO_XMAX, CAIRO_YMAX, GVJ_s::clip, GVCOMMON_s::cmdname, GVJ_s::common, GVJ_s::context, FORMAT_CAIRO, FORMAT_EPS, FORMAT_PDF, FORMAT_PNG, FORMAT_PS, FORMAT_SVG, GVJ_s::height, gvplugin_active_render_s::id, boxf::LL, M_PI, NULL, GVJ_s::render, GVJ_s::rotation, scale(), GVJ_s::scale, GVJ_s::translation, boxf::UR, GVCOMMON_s::verbose, GVJ_s::width, writer(), pointf_s::x, and pointf_s::y.

Here is the call graph for this function:

◆ cairogen_bezier()

static void cairogen_bezier ( GVJ_t job,
pointf A,
size_t  n,
int  filled 
)
static

Definition at line 438 of file gvrender_pango.c.

References A, cairo_gradient_fill(), cairogen_set_color(), cairogen_set_penstyle(), GVJ_s::context, obj_state_s::fillcolor, GRADIENT, GVJ_s::obj, obj_state_s::pencolor, and RGRADIENT.

Here is the call graph for this function:

◆ cairogen_ellipse()

static void cairogen_ellipse ( GVJ_t job,
pointf A,
int  filled 
)
static

Definition at line 381 of file gvrender_pango.c.

References A, cairo_gradient_fill(), cairogen_set_color(), cairogen_set_penstyle(), GVJ_s::context, obj_state_s::fillcolor, GRADIENT, M_PI, GVJ_s::obj, obj_state_s::pencolor, RGRADIENT, and RMIN.

Here is the call graph for this function:

◆ cairogen_end_job()

static void cairogen_end_job ( GVJ_t job)
static

Definition at line 90 of file gvrender_pango.c.

References GVJ_s::context, GVJ_s::external_context, and NULL.

◆ cairogen_end_page()

static void cairogen_end_page ( GVJ_t job)
static

Definition at line 221 of file gvrender_pango.c.

References GVJ_s::context, FORMAT_CAIRO, FORMAT_PDF, FORMAT_PNG, FORMAT_PS, FORMAT_SVG, gvplugin_active_render_s::id, GVJ_s::imagedata, GVJ_s::render, and writer().

Here is the call graph for this function:

◆ cairogen_polygon()

static void cairogen_polygon ( GVJ_t job,
pointf A,
size_t  n,
int  filled 
)
static

Definition at line 417 of file gvrender_pango.c.

References A, cairo_gradient_fill(), cairogen_set_color(), cairogen_set_penstyle(), GVJ_s::context, obj_state_s::fillcolor, GRADIENT, GVJ_s::obj, obj_state_s::pencolor, and RGRADIENT.

Here is the call graph for this function:

◆ cairogen_polyline()

static void cairogen_polyline ( GVJ_t job,
pointf A,
size_t  n 
)
static

Definition at line 459 of file gvrender_pango.c.

References A, cairogen_set_color(), cairogen_set_penstyle(), GVJ_s::context, GVJ_s::obj, and obj_state_s::pencolor.

Referenced by cairogen_textspan().

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

◆ cairogen_set_color()

static void cairogen_set_color ( cairo_t *  cr,
gvcolor_t color 
)
static

Definition at line 63 of file gvrender_pango.c.

References color().

Referenced by cairogen_bezier(), cairogen_ellipse(), cairogen_polygon(), cairogen_polyline(), and cairogen_textspan().

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

◆ cairogen_set_penstyle()

static void cairogen_set_penstyle ( GVJ_t job,
cairo_t *  cr 
)
static

Definition at line 329 of file gvrender_pango.c.

References dashed, dashed_len, dotted, dotted_len, GVJ_s::obj, obj_state_s::pen, PEN_DASHED, PEN_DOTTED, and obj_state_s::penwidth.

Referenced by cairogen_bezier(), cairogen_ellipse(), cairogen_polygon(), and cairogen_polyline().

Here is the caller graph for this function:

◆ cairogen_textspan()

static void cairogen_textspan ( GVJ_t job,
pointf  p,
textspan_t span 
)
static

Definition at line 292 of file gvrender_pango.c.

References A, cairogen_polyline(), cairogen_set_color(), GVJ_s::context, dashed, textfont_t::flags, textspan_t::font, FONT_DPI, HTML_OL, textspan_t::just, textspan_t::layout, GVJ_s::obj, obj_state_s::pencolor, POINTS_PER_INCH, textspan_t::size, pointf_s::x, pointf_s::y, textspan_t::yoffset_centerline, and textspan_t::yoffset_layout.

Here is the call graph for this function:

◆ writer()

static cairo_status_t writer ( void *  closure,
const unsigned char *  data,
unsigned int  length 
)
static

Definition at line 77 of file gvrender_pango.c.

References gvwrite().

Referenced by cairogen_begin_page(), and cairogen_end_page().

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

Variable Documentation

◆ CAIRO_XMAX

const double CAIRO_XMAX = 32767
static

Definition at line 102 of file gvrender_pango.c.

Referenced by cairogen_begin_page().

◆ CAIRO_YMAX

const double CAIRO_YMAX = 32767
static

Definition at line 103 of file gvrender_pango.c.

Referenced by cairogen_begin_page().

◆ cairogen_engine

gvrender_engine_t cairogen_engine
static

Definition at line 472 of file gvrender_pango.c.

◆ dashed

double dashed[] = {6.}
static

Definition at line 43 of file gvrender_pango.c.

Referenced by cairogen_set_penstyle(), and cairogen_textspan().

◆ dashed_len

int dashed_len = ARRAY_SIZE(dashed)
static

Definition at line 44 of file gvrender_pango.c.

Referenced by cairogen_set_penstyle().

◆ device_features_eps

gvdevice_features_t device_features_eps
static
Initial value:
= {
{36.,36.},
{0.,0.},
{72.,72.},
}
#define GVRENDER_NO_WHITE_BG
Definition gvcjob.h:106
#define GVDEVICE_DOES_TRUECOLOR
Definition gvcjob.h:90

Definition at line 530 of file gvrender_pango.c.

◆ device_features_pdf

gvdevice_features_t device_features_pdf
static
Initial value:
= {
{36.,36.},
{0.,0.},
{72.,72.},
}
#define GVDEVICE_BINARY_FORMAT
Definition gvcjob.h:91
#define GVRENDER_DOES_MAPS
Definition gvcjob.h:97
#define GVRENDER_DOES_MAP_RECTANGLE
Definition gvcjob.h:98

Definition at line 538 of file gvrender_pango.c.

◆ device_features_png

gvdevice_features_t device_features_png
static
Initial value:
= {
{0.,0.},
{0.,0.},
{96.,96.},
}

Definition at line 514 of file gvrender_pango.c.

◆ device_features_ps

gvdevice_features_t device_features_ps
static
Initial value:
= {
{36.,36.},
{0.,0.},
{72.,72.},
}

Definition at line 522 of file gvrender_pango.c.

◆ device_features_svg

gvdevice_features_t device_features_svg
static
Initial value:
= {
{0.,0.},
{0.,0.},
{72.,72.},
}

Definition at line 549 of file gvrender_pango.c.

◆ dotted

double dotted[] = {2., 6.}
static

Definition at line 46 of file gvrender_pango.c.

Referenced by cairogen_set_penstyle().

◆ dotted_len

int dotted_len = ARRAY_SIZE(dotted)
static

Definition at line 47 of file gvrender_pango.c.

Referenced by cairogen_set_penstyle().

◆ gvdevice_pango_types

gvplugin_installed_t gvdevice_pango_types[]
Initial value:
= {
{0, NULL, 0, NULL, NULL}
}
node NULL
Definition grammar.y:163

Definition at line 562 of file gvrender_pango.c.

◆ gvrender_pango_types

gvplugin_installed_t gvrender_pango_types[]
Initial value:
= {
{0, NULL, 0, NULL, NULL}
}
@ FORMAT_CAIRO
static gvrender_engine_t cairogen_engine
static gvrender_features_t render_features_cairo

Definition at line 557 of file gvrender_pango.c.

◆ render_features_cairo

gvrender_features_t render_features_cairo
static
Initial value:
= {
4.,
0,
0,
}
@ RGBA_DOUBLE
Definition color.h:27
#define GVRENDER_DOES_TRANSFORM
Definition gvcjob.h:95
#define GVRENDER_Y_GOES_DOWN
Definition gvcjob.h:94

Definition at line 505 of file gvrender_pango.c.