GDS-Render v1.2.1
External Shared Object Renderer
Collaboration diagram for External Shared Object Renderer:

Data Structures

struct  _ExternalRenderer
 

Macros

#define EXPORT_FUNC   __attribute__((visibility("default")))
 This define is used to export a function from a shared object. More...
 
#define EXTERNAL_LIBRARY_RENDER_FUNCTION   exported_render_cell_to_file
 Function name expected to be found in external library for rendering. More...
 
#define EXTERNAL_LIBRARY_INIT_FUNCTION   exported_init
 Function name expected to be found in external library for initialization. More...
 
#define EXTERNAL_LIBRARY_FORK_REQUEST   exported_fork_request
 Global integer specified by an external renderer to signal, that the init and render functions shall be executed in a subprocess. More...
 
#define EXPORTED_FUNC_DECL(FUNC)   EXPORT_FUNC FUNC
 Define for declaring the exported functions. More...
 
#define GDS_RENDER_TYPE_EXTERNAL_RENDERER   (external_renderer_get_type())
 
#define FORCE_FORK   0U
 if != 0, then forking is forced regardless of the shared object's settings More...
 

Enumerations

enum  { PROP_SO_PATH = 1 , PROP_PARAM_STRING , N_PROPERTIES }
 

Functions

ExternalRenderer * external_renderer_new ()
 Create new ExternalRenderer object. More...
 
ExternalRenderer * external_renderer_new_with_so_and_param (const char *so_path, const char *param_string)
 Create new ExternalRenderer object with specified shared object path. More...
 
static int external_renderer_render_cell (struct gds_cell *toplevel_cell, GList *layer_info_list, const char *output_file, double scale, const char *so_path, const char *params)
 Execute render function in shared object to render the supplied cell. More...
 
static int external_renderer_render_output (GdsOutputRenderer *renderer, struct gds_cell *cell, double scale)
 
static void external_renderer_get_property (GObject *obj, guint property_id, GValue *value, GParamSpec *pspec)
 
static void external_renderer_set_property (GObject *obj, guint property_id, const GValue *value, GParamSpec *pspec)
 
static void external_renderer_dispose (GObject *self_obj)
 
static void external_renderer_class_init (ExternalRendererClass *klass)
 
static void external_renderer_init (ExternalRenderer *self)
 

Variables

static GParamSpec * external_renderer_properties [N_PROPERTIES] = {NULL}
 

Detailed Description

Properties

This class inherits all properties from its parent GDS Output Renderer base class. In addition to that, it implements the following properties:

Property Name Description
shared-object-path Path to the shared object used for rendering
param-string Command line parameters passed to external renderer's init function

All these properties have to be set for rendering.

Necessary Functions

The following functions and variables are necessary for an external renderer to implement:

Code Define Prototype Description
EXTERNAL_LIBRARY_RENDER_FUNCTION int EXTERNAL_LIBRARY_RENDER_FUNCTION(struct gds_cell *toplevel, GList *layer_info_list, const char *output_file_name, double scale) Render cell to output file
EXTERNAL_LIBRARY_INIT_FUNCTION int EXTERNAL_LIBRARY_INIT_FUNCTION(const char *option_string, const char *version_string) Init function. Executed before rendering. This is given the command line parameters specified for the external renderer and the version string of the currently running gds-render program.
EXTERNAL_LIBRARY_FORK_REQUEST int EXTERNAL_LIBRARY_FORK_REQUEST; The pure presence of this integer results in the execution inside a subprocess of hte whole shared object's code

Macro Definition Documentation

◆ EXPORT_FUNC

#define EXPORT_FUNC   __attribute__((visibility("default")))

This define is used to export a function from a shared object.

Definition at line 38 of file external-renderer-interfaces.h.

◆ EXPORTED_FUNC_DECL

#define EXPORTED_FUNC_DECL (   FUNC)    EXPORT_FUNC FUNC

Define for declaring the exported functions.

This not only helps with the declaration but also makes the symbols visible, so they can be called form outside the library

Definition at line 72 of file external-renderer-interfaces.h.

◆ EXTERNAL_LIBRARY_FORK_REQUEST

#define EXTERNAL_LIBRARY_FORK_REQUEST   exported_fork_request

Global integer specified by an external renderer to signal, that the init and render functions shall be executed in a subprocess.

The pure presence of this symbol name causes forking. The content of this variable is don't care.

Note
Use this if you mess with the internal structures of gds-render

Definition at line 65 of file external-renderer-interfaces.h.

◆ EXTERNAL_LIBRARY_INIT_FUNCTION

#define EXTERNAL_LIBRARY_INIT_FUNCTION   exported_init

Function name expected to be found in external library for initialization.

int EXTERNAL_LIBRARY_INIT_FUNCTION(const char *option_string, const char *version_string);
int EXPORTED_FUNC_DECL() EXTERNAL_LIBRARY_INIT_FUNCTION(const char *params, const char *version)
Definition: plugin-main.c:43

Definition at line 57 of file external-renderer-interfaces.h.

◆ EXTERNAL_LIBRARY_RENDER_FUNCTION

#define EXTERNAL_LIBRARY_RENDER_FUNCTION   exported_render_cell_to_file

Function name expected to be found in external library for rendering.

The function has to be defined as follows:

int EXTERNAL_LIBRARY_RENDER_FUNCTION(struct gds_cell *toplevel, GList *layer_info_list, const char *output_file_name, double scale);
int EXPORTED_FUNC_DECL() EXTERNAL_LIBRARY_RENDER_FUNCTION(struct gds_cell *toplevel, GList *layer_info_list, const char *output_file_name, double scale)
Definition: plugin-main.c:34
A Cell inside a gds_library.
Definition: gds-types.h:122

Definition at line 48 of file external-renderer-interfaces.h.

◆ FORCE_FORK

#define FORCE_FORK   0U

if != 0, then forking is forced regardless of the shared object's settings

Definition at line 39 of file external-renderer.c.

◆ GDS_RENDER_TYPE_EXTERNAL_RENDERER

#define GDS_RENDER_TYPE_EXTERNAL_RENDERER   (external_renderer_get_type())

Definition at line 40 of file external-renderer.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
PROP_SO_PATH 

Shared object path property.

PROP_PARAM_STRING 
N_PROPERTIES 

Shared object renderer parameter string from CLI.

Used to get property count

Definition at line 47 of file external-renderer.c.

Function Documentation

◆ external_renderer_class_init()

static void external_renderer_class_init ( ExternalRendererClass *  klass)
static

Definition at line 232 of file external-renderer.c.

Here is the call graph for this function:

◆ external_renderer_dispose()

static void external_renderer_dispose ( GObject *  self_obj)
static

Definition at line 216 of file external-renderer.c.

Here is the caller graph for this function:

◆ external_renderer_get_property()

static void external_renderer_get_property ( GObject *  obj,
guint  property_id,
GValue *  value,
GParamSpec *  pspec 
)
static

Definition at line 174 of file external-renderer.c.

Here is the caller graph for this function:

◆ external_renderer_init()

static void external_renderer_init ( ExternalRenderer *  self)
static

Definition at line 264 of file external-renderer.c.

◆ external_renderer_new()

ExternalRenderer * external_renderer_new ( )

Create new ExternalRenderer object.

Returns
New object

Definition at line 270 of file external-renderer.c.

◆ external_renderer_new_with_so_and_param()

ExternalRenderer * external_renderer_new_with_so_and_param ( const char *  so_path,
const char *  param_string 
)

Create new ExternalRenderer object with specified shared object path.

Parameters
so_pathPath to shared object, the rendering function is searched in
param_stringCommand line parameter string passed to external renderer
Returns
New object.

Definition at line 275 of file external-renderer.c.

Here is the caller graph for this function:

◆ external_renderer_render_cell()

static int external_renderer_render_cell ( struct gds_cell toplevel_cell,
GList *  layer_info_list,
const char *  output_file,
double  scale,
const char *  so_path,
const char *  params 
)
static

Execute render function in shared object to render the supplied cell.

Parameters
toplevel_cellCell to render
layer_info_listLayer information (Color etc.)
output_fileDestination file
scalethe scaling value to scale the output cell down by.
so_pathPath to shared object
paramsParameters passed to EXTERNAL_LIBRARY_INIT_FUNCTION
Returns
0 if successful

Definition at line 65 of file external-renderer.c.

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

◆ external_renderer_render_output()

static int external_renderer_render_output ( GdsOutputRenderer *  renderer,
struct gds_cell cell,
double  scale 
)
static

Definition at line 149 of file external-renderer.c.

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

◆ external_renderer_set_property()

static void external_renderer_set_property ( GObject *  obj,
guint  property_id,
const GValue *  value,
GParamSpec *  pspec 
)
static

Definition at line 193 of file external-renderer.c.

Here is the caller graph for this function:

Variable Documentation

◆ external_renderer_properties

GParamSpec* external_renderer_properties[N_PROPERTIES] = {NULL}
static

Definition at line 230 of file external-renderer.c.