Graphviz 13.0.0~dev.20250424.1043
Loading...
Searching...
No Matches
gvloadimage_gs.c File Reference
#include "config.h"
#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdint.h>
#include <sys/stat.h>
#include <util/agxbuf.h>
#include <gvc/gvplugin_loadimage.h>
#include <ghostscript/iapi.h>
#include <ghostscript/ierrors.h>
#include <cairo/cairo.h>
Include dependency graph for gvloadimage_gs.c:

Go to the source code of this file.

Data Structures

struct  gs_s
 

Macros

#define e_VMerror   gs_error_VMerror
 
#define e_unregistered   gs_error_unregistered
 
#define e_invalidid   gs_error_invalidid
 
#define GS_ARGC   sizeof(gs_args)/sizeof(gs_args[0])
 
#define GSAPI_REVISION_REQUIRED   863
 

Typedefs

typedef struct gs_s gs_t
 

Enumerations

enum  { FORMAT_PS_CAIRO , FORMAT_EPS_CAIRO }
 

Functions

static void gvloadimage_gs_free (usershape_t *us)
 
static int gs_writer (void *caller_handle, const char *str, int len)
 
static void gs_error (GVJ_t *job, const char *name, const char *funstr, int err)
 
static int gvloadimage_process_file (GVJ_t *job, usershape_t *us, void *instance)
 
static int gvloadimage_process_surface (GVJ_t *job, usershape_t *us, gs_t *gs, void *instance)
 
static cairo_pattern_t * gvloadimage_gs_load (GVJ_t *job, usershape_t *us)
 
static void gvloadimage_gs_cairo (GVJ_t *job, usershape_t *us, boxf b, bool filled)
 

Variables

static gvloadimage_engine_t engine_cairo
 
gvplugin_installed_t gvloadimage_gs_types []
 

Macro Definition Documentation

◆ e_invalidid

#define e_invalidid   gs_error_invalidid

Definition at line 40 of file gvloadimage_gs.c.

◆ e_unregistered

#define e_unregistered   gs_error_unregistered

Definition at line 36 of file gvloadimage_gs.c.

◆ e_VMerror

#define e_VMerror   gs_error_VMerror

Ensure compatibility with Ghostscipt versions newer than 9.18 while maintaining compatibility with the older versions.

Definition at line 32 of file gvloadimage_gs.c.

◆ GS_ARGC

#define GS_ARGC   sizeof(gs_args)/sizeof(gs_args[0])

◆ GSAPI_REVISION_REQUIRED

#define GSAPI_REVISION_REQUIRED   863

Typedef Documentation

◆ gs_t

typedef struct gs_s gs_t

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FORMAT_PS_CAIRO 
FORMAT_EPS_CAIRO 

Definition at line 43 of file gvloadimage_gs.c.

Function Documentation

◆ gs_error()

static void gs_error ( GVJ_t job,
const char *  name,
const char *  funstr,
int  err 
)
static

Definition at line 73 of file gvloadimage_gs.c.

References GVJ_s::common, e_invalidid, e_unregistered, e_VMerror, err, and GVCOMMON_s::errorfn.

Referenced by gvloadimage_gs_load(), gvloadimage_process_file(), and gvloadimage_process_surface().

Here is the caller graph for this function:

◆ gs_writer()

static int gs_writer ( void *  caller_handle,
const char *  str,
int  len 
)
static

Definition at line 62 of file gvloadimage_gs.c.

References GVJ_s::common, len(), str, and GVCOMMON_s::verbose.

Referenced by gvloadimage_gs_load().

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

◆ gvloadimage_gs_cairo()

static void gvloadimage_gs_cairo ( GVJ_t job,
usershape_t us,
boxf  b,
bool  filled 
)
static

Definition at line 231 of file gvloadimage_gs.c.

References GVJ_s::context, gvloadimage_gs_load(), usershape_s::h, boxf::LL, boxf::UR, usershape_s::w, pointf_s::x, usershape_s::x, and pointf_s::y.

Here is the call graph for this function:

◆ gvloadimage_gs_free()

static void gvloadimage_gs_free ( usershape_t us)
static

Definition at line 53 of file gvloadimage_gs.c.

References usershape_s::data, free(), gs_s::pattern, and gs_s::surface.

Referenced by gvloadimage_gs_load().

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

◆ gvloadimage_gs_load()

static cairo_pattern_t * gvloadimage_gs_load ( GVJ_t job,
usershape_t us 
)
static

Definition at line 170 of file gvloadimage_gs.c.

References GVJ_s::common, GVJ_s::context, gs_s::cr, usershape_s::data, usershape_s::datafree, GVCOMMON_s::errorfn, gs_error(), gs_writer(), GSAPI_REVISION_REQUIRED, gvloadimage_gs_free(), gvloadimage_process_surface(), malloc(), usershape_s::name, NULL, gs_s::pattern, and gs_s::surface.

Referenced by gvloadimage_gs_cairo().

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

◆ gvloadimage_process_file()

static int gvloadimage_process_file ( GVJ_t job,
usershape_t us,
void *  instance 
)
static

Definition at line 92 of file gvloadimage_gs.c.

References GVJ_s::common, GVCOMMON_s::errorfn, gs_error(), gvusershape_file_access(), gvusershape_file_release(), and usershape_s::name.

Referenced by gvloadimage_process_surface().

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

◆ gvloadimage_process_surface()

static int gvloadimage_process_surface ( GVJ_t job,
usershape_t us,
gs_t gs,
void *  instance 
)
static

Definition at line 108 of file gvloadimage_gs.c.

References agxbfree(), agxbprint(), agxbuse(), gs_s::cr, usershape_s::dpi, GS_ARGC, gs_error(), gvloadimage_process_file(), usershape_s::h, usershape_s::name, NULL, gs_s::pattern, gs_s::surface, usershape_s::w, usershape_s::x, and usershape_s::y.

Referenced by gvloadimage_gs_load().

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

Variable Documentation

◆ engine_cairo

gvloadimage_engine_t engine_cairo
static
Initial value:
= {
}
static void gvloadimage_gs_cairo(GVJ_t *job, usershape_t *us, boxf b, bool filled)

Definition at line 248 of file gvloadimage_gs.c.

◆ gvloadimage_gs_types

gvplugin_installed_t gvloadimage_gs_types[]
Initial value:
= {
{FORMAT_PS_CAIRO, "ps:cairo", 1, &engine_cairo, NULL},
{FORMAT_EPS_CAIRO, "eps:cairo", 1, &engine_cairo, NULL},
{0, NULL, 0, NULL, NULL}
}
node NULL
Definition grammar.y:163
static gvloadimage_engine_t engine_cairo
@ FORMAT_EPS_CAIRO
@ FORMAT_PS_CAIRO

Definition at line 252 of file gvloadimage_gs.c.