Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
gvrender_core_ps.c File Reference
#include "config.h"
#include <assert.h>
#include <ctype.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <gvc/gvplugin_render.h>
#include <gvc/gvplugin_device.h>
#include <gvc/gvio.h>
#include <cgraph/agxbuf.h>
#include <cgraph/cgraph.h>
#include <cgraph/gv_ctype.h>
#include <cgraph/prisize_t.h>
#include <common/utils.h>
#include "ps.h"
#include <common/const.h>
Include dependency graph for gvrender_core_ps.c:

Go to the source code of this file.

Macros

#define PDFMAX   14400 /* Maximum size of PDF page */
 

Enumerations

enum  format_type { FORMAT_PS , FORMAT_PS2 , FORMAT_EPS }
 

Functions

static void psgen_begin_job (GVJ_t *job)
 
static void psgen_end_job (GVJ_t *job)
 
static void psgen_begin_graph (GVJ_t *job)
 
static void psgen_begin_layer (GVJ_t *job, char *layername, int layerNum, int numLayers)
 
static void psgen_begin_page (GVJ_t *job)
 
static void psgen_end_page (GVJ_t *job)
 
static void psgen_begin_cluster (GVJ_t *job)
 
static void psgen_end_cluster (GVJ_t *job)
 
static void psgen_begin_node (GVJ_t *job)
 
static void psgen_end_node (GVJ_t *job)
 
static void psgen_begin_edge (GVJ_t *job)
 
static void psgen_end_edge (GVJ_t *job)
 
static void psgen_begin_anchor (GVJ_t *job, char *url, char *tooltip, char *target, char *id)
 
static void ps_set_pen_style (GVJ_t *job)
 
static void ps_set_color (GVJ_t *job, gvcolor_t *color)
 
static void check_fontname (const char *fontname)
 
static void psgen_textspan (GVJ_t *job, pointf p, textspan_t *span)
 
static void psgen_ellipse (GVJ_t *job, pointf *A, int filled)
 
static void psgen_bezier (GVJ_t *job, pointf *A, size_t n, int filled)
 
static void psgen_polygon (GVJ_t *job, pointf *A, size_t n, int filled)
 
static void psgen_polyline (GVJ_t *job, pointf *A, size_t n)
 
static void psgen_comment (GVJ_t *job, char *str)
 
static void psgen_library_shape (GVJ_t *job, char *name, pointf *A, size_t n, int filled)
 

Variables

static int isLatin1
 
static bool setupLatin1
 
static gvrender_engine_t psgen_engine
 
static gvrender_features_t render_features_ps
 
static gvdevice_features_t device_features_ps
 
static gvdevice_features_t device_features_eps
 
gvplugin_installed_t gvrender_ps_types []
 
gvplugin_installed_t gvdevice_ps_types []
 

Macro Definition Documentation

◆ PDFMAX

#define PDFMAX   14400 /* Maximum size of PDF page */

Definition at line 36 of file gvrender_core_ps.c.

Enumeration Type Documentation

◆ format_type

Enumerator
FORMAT_PS 
FORMAT_PS2 
FORMAT_EPS 

Definition at line 38 of file gvrender_core_ps.c.

Function Documentation

◆ check_fontname()

static void check_fontname ( const char *  fontname)
static

check a font name abides by Adobe’s rules

Adobe Technical Note #5088 “Font Naming Issues” §2.2:

For compatibility with the earliest versions of PostScript interpreters and with the file systems in some operating systems, Adobe limits the number of characters in the FontName to 29 characters.

As with any PostScript language name, a valid FontName must not contain spaces, and may only use characters from the standard ASCII character set.

Parameters
fontnameFont name to check

Definition at line 292 of file gvrender_core_ps.c.

References agwarningf(), and gv_iscntrl().

Referenced by psgen_textspan().

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

◆ ps_set_color()

static void ps_set_color ( GVJ_t job,
gvcolor_t color 
)
static

Definition at line 254 of file gvrender_core_ps.c.

References CLUSTER_OBJTYPE, color(), EDGE_OBJTYPE, gvprintf(), NODE_OBJTYPE, GVJ_s::obj, ROOTGRAPH_OBJTYPE, and obj_state_s::type.

Referenced by psgen_bezier(), psgen_ellipse(), psgen_library_shape(), psgen_polygon(), psgen_polyline(), and psgen_textspan().

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

◆ ps_set_pen_style()

static void ps_set_pen_style ( GVJ_t job)
static

Definition at line 228 of file gvrender_core_ps.c.

References gvprintdouble(), gvprintf(), gvputs(), GVJ_s::obj, obj_state_s::penwidth, penwidth, and obj_state_s::rawstyle.

Referenced by psgen_bezier(), psgen_ellipse(), psgen_library_shape(), psgen_polygon(), and psgen_polyline().

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

◆ psgen_begin_anchor()

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

Definition at line 207 of file gvrender_core_ps.c.

References gvprintf(), gvprintpointflist(), gvputs(), isLatin1, GVJ_s::obj, ps_string(), and obj_state_s::url_map_p.

Here is the call graph for this function:

◆ psgen_begin_cluster()

static void psgen_begin_cluster ( GVJ_t job)
static

Definition at line 172 of file gvrender_core_ps.c.

References agnameof(), obj_state_s::g, gvprintf(), gvputs(), GVJ_s::obj, and obj_state_s::u.

Here is the call graph for this function:

◆ psgen_begin_edge()

static void psgen_begin_edge ( GVJ_t job)
static

Definition at line 197 of file gvrender_core_ps.c.

References gvputs().

Here is the call graph for this function:

◆ psgen_begin_graph()

static void psgen_begin_graph ( GVJ_t job)
static

Definition at line 68 of file gvrender_core_ps.c.

References agnameof(), cat_libfile(), CHAR_LATIN1, GVJ_s::common, epsf_define(), FORMAT_EPS, obj_state_s::g, GD_charset, gvprintf(), gvputs(), gvplugin_active_render_s::id, isLatin1, GVCOMMON_s::lib, box::LL, NULL, GVJ_s::obj, GVJ_s::pageBoundingBox, ps_string(), ps_txt, GVJ_s::render, setupLatin1, GVCOMMON_s::show_boxes, obj_state_s::u, box::UR, obj_state_s::url, GVCOMMON_s::viewNum, point::x, and point::y.

Here is the call graph for this function:

◆ psgen_begin_job()

static void psgen_begin_job ( GVJ_t job)
static

Definition at line 43 of file gvrender_core_ps.c.

References GVJ_s::common, FORMAT_EPS, gvprintf(), gvputs(), gvplugin_active_render_s::id, GVCOMMON_s::info, and GVJ_s::render.

Here is the call graph for this function:

◆ psgen_begin_layer()

static void psgen_begin_layer ( GVJ_t job,
char *  layername,
int  layerNum,
int  numLayers 
)
static

Definition at line 117 of file gvrender_core_ps.c.

References gvprintf().

Here is the call graph for this function:

◆ psgen_begin_node()

static void psgen_begin_node ( GVJ_t job)
static

Definition at line 186 of file gvrender_core_ps.c.

References gvputs().

Here is the call graph for this function:

◆ psgen_begin_page()

static void psgen_begin_page ( GVJ_t job)
static

Definition at line 123 of file gvrender_core_ps.c.

References GVJ_s::common, GVCOMMON_s::errorfn, FORMAT_PS2, gvprintf(), gvplugin_active_render_s::id, box::LL, NULL, GVJ_s::numPages, GVJ_s::pageBoundingBox, GVJ_s::pagesArrayElem, PDFMAX, GVJ_s::render, GVJ_s::rotation, GVJ_s::scale, GVCOMMON_s::show_boxes, GVJ_s::translation, box::UR, GVCOMMON_s::viewNum, point::x, pointf_s::x, point::y, and pointf_s::y.

Here is the call graph for this function:

◆ psgen_bezier()

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

Definition at line 365 of file gvrender_core_ps.c.

References A, obj_state_s::fillcolor, gvprintpointf(), gvprintpointflist(), gvputs(), color_s::HSVA, GVJ_s::obj, obj_state_s::pencolor, ps_set_color(), ps_set_pen_style(), and color_s::u.

Here is the call graph for this function:

◆ psgen_comment()

static void psgen_comment ( GVJ_t job,
char *  str 
)
static

Definition at line 432 of file gvrender_core_ps.c.

References gvputs(), and str.

Here is the call graph for this function:

◆ psgen_ellipse()

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

Definition at line 343 of file gvrender_core_ps.c.

References A, obj_state_s::fillcolor, gvprintpointflist(), gvputs(), color_s::HSVA, GVJ_s::obj, obj_state_s::pencolor, ps_set_color(), ps_set_pen_style(), color_s::u, pointf_s::x, and pointf_s::y.

Here is the call graph for this function:

◆ psgen_end_cluster()

static void psgen_end_cluster ( GVJ_t job)
static

Definition at line 181 of file gvrender_core_ps.c.

References gvputs().

Here is the call graph for this function:

◆ psgen_end_edge()

static void psgen_end_edge ( GVJ_t job)
static

Definition at line 202 of file gvrender_core_ps.c.

References gvputs().

Here is the call graph for this function:

◆ psgen_end_job()

static void psgen_end_job ( GVJ_t job)
static

Definition at line 54 of file gvrender_core_ps.c.

References GVJ_s::boundingBox, GVJ_s::common, FORMAT_EPS, gvprintf(), gvputs(), gvplugin_active_render_s::id, box::LL, NULL, GVJ_s::render, GVCOMMON_s::show_boxes, box::UR, GVCOMMON_s::viewNum, point::x, and point::y.

Here is the call graph for this function:

◆ psgen_end_node()

static void psgen_end_node ( GVJ_t job)
static

Definition at line 191 of file gvrender_core_ps.c.

References gvputs().

Here is the call graph for this function:

◆ psgen_end_page()

static void psgen_end_page ( GVJ_t job)
static

Definition at line 158 of file gvrender_core_ps.c.

References cat_libfile(), GVJ_s::common, gvprintf(), gvputs(), NULL, GVCOMMON_s::show_boxes, and GVCOMMON_s::viewNum.

Here is the call graph for this function:

◆ psgen_library_shape()

static void psgen_library_shape ( GVJ_t job,
char *  name,
pointf A,
size_t  n,
int  filled 
)
static

Definition at line 439 of file gvrender_core_ps.c.

References A, obj_state_s::fillcolor, gvprintf(), gvprintpointf(), gvprintpointflist(), gvputs(), color_s::HSVA, GVJ_s::obj, obj_state_s::pencolor, PRISIZE_T, ps_set_color(), ps_set_pen_style(), and color_s::u.

Here is the call graph for this function:

◆ psgen_polygon()

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

Definition at line 391 of file gvrender_core_ps.c.

References A, obj_state_s::fillcolor, gvprintpointf(), gvputs(), color_s::HSVA, GVJ_s::obj, obj_state_s::pencolor, ps_set_color(), ps_set_pen_style(), and color_s::u.

Here is the call graph for this function:

◆ psgen_polyline()

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

Definition at line 417 of file gvrender_core_ps.c.

References A, gvprintpointf(), gvputs(), color_s::HSVA, GVJ_s::obj, obj_state_s::pencolor, ps_set_color(), ps_set_pen_style(), and color_s::u.

Here is the call graph for this function:

◆ psgen_textspan()

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

Definition at line 312 of file gvrender_core_ps.c.

References check_fontname(), textspan_t::font, gvprintdouble(), gvprintf(), gvprintpointf(), gvputs(), color_s::HSVA, isLatin1, textspan_t::just, textfont_t::name, GVJ_s::obj, obj_state_s::pencolor, ps_set_color(), ps_string(), textfont_t::size, textspan_t::size, str, textspan_t::str, color_s::u, pointf_s::x, pointf_s::y, and textspan_t::yoffset_centerline.

Here is the call graph for this function:

Variable Documentation

◆ device_features_eps

gvdevice_features_t device_features_eps
static
Initial value:
= {
0,
{36.,36.},
{612.,792.},
{72.,72.},
}

Definition at line 512 of file gvrender_core_ps.c.

◆ device_features_ps

gvdevice_features_t device_features_ps
static
Initial value:
= {
{36.,36.},
{612.,792.},
{72.,72.},
}
#define GVDEVICE_DOES_PAGES
Definition gvcjob.h:87
#define GVDEVICE_DOES_LAYERS
Definition gvcjob.h:88

Definition at line 504 of file gvrender_core_ps.c.

◆ gvdevice_ps_types

gvplugin_installed_t gvdevice_ps_types[]
Initial value:
= {
{FORMAT_PS, "ps:ps", 1, NULL, &device_features_ps},
{FORMAT_PS2, "ps2:ps", 1, NULL, &device_features_ps},
{FORMAT_EPS, "eps:ps", 1, NULL, &device_features_eps},
{0, NULL, 0, NULL, NULL}
}
node NULL
Definition grammar.y:149
static gvdevice_features_t device_features_eps
static gvdevice_features_t device_features_ps
@ FORMAT_EPS
@ FORMAT_PS2
@ FORMAT_PS

Definition at line 524 of file gvrender_core_ps.c.

◆ gvrender_ps_types

gvplugin_installed_t gvrender_ps_types[]
Initial value:
= {
{0, NULL, 0, NULL, NULL}
}
static gvrender_engine_t psgen_engine
static gvrender_features_t render_features_ps

Definition at line 519 of file gvrender_core_ps.c.

◆ isLatin1

int isLatin1
static

Definition at line 40 of file gvrender_core_ps.c.

Referenced by psgen_begin_anchor(), psgen_begin_graph(), and psgen_textspan().

◆ psgen_engine

gvrender_engine_t psgen_engine
static

Definition at line 460 of file gvrender_core_ps.c.

◆ render_features_ps

gvrender_features_t render_features_ps
static
Initial value:
= {
4.,
NULL,
0,
}
@ HSVA_DOUBLE
Definition color.h:26
#define GVRENDER_NO_WHITE_BG
Definition gvcjob.h:106
#define GVRENDER_DOES_MAPS
Definition gvcjob.h:97
#define GVRENDER_DOES_TRANSFORM
Definition gvcjob.h:95
#define GVRENDER_DOES_MAP_RECTANGLE
Definition gvcjob.h:98

Definition at line 493 of file gvrender_core_ps.c.

◆ setupLatin1

bool setupLatin1
static

Definition at line 41 of file gvrender_core_ps.c.

Referenced by psgen_begin_graph().