GDS-Render v1.2.1
GDS Output Renderer base class
Collaboration diagram for GDS Output Renderer base class:

Modules

 Cairo Renderer
 
 External Shared Object Renderer
 
 LaTeX / TikZ Renderer
 

Data Structures

struct  _GdsOutputRendererClass
 Base output renderer class structure. More...
 
struct  renderer_params
 
struct  idle_function_params
 
struct  GdsOutputRendererPrivate
 

Macros

#define GDS_RENDER_TYPE_OUTPUT_RENDERER   (gds_output_renderer_get_type())
 

Enumerations

enum  { GDS_OUTPUT_RENDERER_GEN_ERR = -100 , GDS_OUTPUT_RENDERER_PARAM_ERR = -200 }
 
enum  { PROP_OUTPUT_FILE = 1 , PROP_LAYER_SETTINGS , N_PROPERTIES }
 
enum  gds_output_renderer_signal_ids { ASYNC_FINISHED = 0 , ASYNC_PROGRESS_CHANGED , GDS_OUTPUT_RENDERER_SIGNAL_COUNT }
 

Functions

 G_DECLARE_DERIVABLE_TYPE (GdsOutputRenderer, gds_output_renderer, GDS_RENDER, OUTPUT_RENDERER, GObject)
 
GdsOutputRenderer * gds_output_renderer_new ()
 Create a new GdsOutputRenderer GObject. More...
 
GdsOutputRenderer * gds_output_renderer_new_with_props (const char *output_file, LayerSettings *layer_settings)
 Create a new GdsOutputRenderer GObject with its properties. More...
 
int gds_output_renderer_render_output (GdsOutputRenderer *renderer, struct gds_cell *cell, double scale)
 gds_output_renderer_render_output More...
 
void gds_output_renderer_set_output_file (GdsOutputRenderer *renderer, const gchar *file_name)
 Convenience function for setting the "output-file" property. More...
 
const char * gds_output_renderer_get_output_file (GdsOutputRenderer *renderer)
 Convenience function for getting the "output-file" property. More...
 
LayerSettings * gds_output_renderer_get_and_ref_layer_settings (GdsOutputRenderer *renderer)
 Get layer settings. More...
 
void gds_output_renderer_set_layer_settings (GdsOutputRenderer *renderer, LayerSettings *settings)
 Set layer settings. More...
 
int gds_output_renderer_render_output_async (GdsOutputRenderer *renderer, struct gds_cell *cell, double scale)
 Render output asynchronously. More...
 
void gds_output_renderer_update_async_progress (GdsOutputRenderer *renderer, const char *status)
 This function emits the 'progress-changed' in the thread/context that triggered an asynchronous rendering. More...
 
static int gds_output_renderer_render_dummy (GdsOutputRenderer *renderer, struct gds_cell *cell, double scale)
 
static void gds_output_renderer_dispose (GObject *self_obj)
 
static void gds_output_renderer_get_property (GObject *obj, guint property_id, GValue *value, GParamSpec *pspec)
 
static void gds_output_renderer_set_property (GObject *obj, guint property_id, const GValue *value, GParamSpec *pspec)
 
static void gds_output_renderer_class_init (GdsOutputRendererClass *klass)
 
void gds_output_renderer_init (GdsOutputRenderer *self)
 
static void gds_output_renderer_async_wrapper (GTask *task, gpointer source_object, gpointer task_data, GCancellable *cancellable)
 
static void gds_output_renderer_async_finished (GObject *src_obj, GAsyncResult *res, gpointer user_data)
 
static gboolean idle_event_processor_callback (gpointer user_data)
 

Variables

static guint gds_output_renderer_signals [GDS_OUTPUT_RENDERER_SIGNAL_COUNT]
 
static GParamSpec * gds_output_renderer_properties [N_PROPERTIES] = {NULL}
 

Detailed Description

The renderers are used to convert the cell structures read from the GDS layout file into different output formats.

The GdsOutputRenderer base class is used to derive all renderers from.

Warning
Although the GdsOutputRenderer class provides compatibility for asynchronous rendering, the class is not thread safe / re-entrant. Only use it from a signle context. Not even the rendering function called is allowed to modifiy this object.

A allowed function to be called from the async rendering thread is gds_output_renderer_update_async_progress and the get functions for the properties.

Note
The context that owned the renderer has to ensure that only one rendering is active at a time for a single instance of a renderer.

By default this class implements the following features:

Properties

Property Name Description
layer-settings LayerSettings object containing the layer rendering information
output-file Output file name for rendering

All these properties have to be set for rendering.

Signals / Events

Signal Name Description Callback prototype
async-finished The asynchronous rendering is finished void callback(GdsOutputRenderer *src, gpointer user_data)
progress-changed The asynchronous rendering progress changed void callback(GdsOutputRenderer *src, const char *progress, gpointer user_data)
Note
The char *progress supplied to the callback function must not be modified or freed.

Macro Definition Documentation

◆ GDS_RENDER_TYPE_OUTPUT_RENDERER

#define GDS_RENDER_TYPE_OUTPUT_RENDERER   (gds_output_renderer_get_type())

Definition at line 41 of file gds-output-renderer.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
GDS_OUTPUT_RENDERER_GEN_ERR 

Error set by the _GdsOutputRendererClass::render_output virtual function, if renderer is invalid.

GDS_OUTPUT_RENDERER_PARAM_ERR 

Error set by the _GdsOutputRendererClass::render_output virtual function, if parameters are faulty.

Definition at line 61 of file gds-output-renderer.h.

◆ anonymous enum

anonymous enum
Enumerator
PROP_OUTPUT_FILE 
PROP_LAYER_SETTINGS 
N_PROPERTIES 

Definition at line 55 of file gds-output-renderer.c.

◆ gds_output_renderer_signal_ids

Enumerator
ASYNC_FINISHED 
ASYNC_PROGRESS_CHANGED 
GDS_OUTPUT_RENDERER_SIGNAL_COUNT 

Definition at line 63 of file gds-output-renderer.c.

Function Documentation

◆ G_DECLARE_DERIVABLE_TYPE()

G_DECLARE_DERIVABLE_TYPE ( GdsOutputRenderer  ,
gds_output_renderer  ,
GDS_RENDER  ,
OUTPUT_RENDERER  ,
GObject   
)

◆ gds_output_renderer_async_finished()

static void gds_output_renderer_async_finished ( GObject *  src_obj,
GAsyncResult *  res,
gpointer  user_data 
)
static

Definition at line 346 of file gds-output-renderer.c.

Here is the caller graph for this function:

◆ gds_output_renderer_async_wrapper()

static void gds_output_renderer_async_wrapper ( GTask *  task,
gpointer  source_object,
gpointer  task_data,
GCancellable *  cancellable 
)
static

Definition at line 318 of file gds-output-renderer.c.

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

◆ gds_output_renderer_class_init()

static void gds_output_renderer_class_init ( GdsOutputRendererClass *  klass)
static

Definition at line 164 of file gds-output-renderer.c.

Here is the call graph for this function:

◆ gds_output_renderer_dispose()

static void gds_output_renderer_dispose ( GObject *  self_obj)
static

Definition at line 78 of file gds-output-renderer.c.

Here is the caller graph for this function:

◆ gds_output_renderer_get_and_ref_layer_settings()

LayerSettings * gds_output_renderer_get_and_ref_layer_settings ( GdsOutputRenderer *  renderer)

Get layer settings.

This is a convenience function for getting the "layer-settings" property. This also references it. This is to prevent race conditions with another thread that might alter the layer settings before they are read out.

Parameters
rendererRenderer
Returns
Layer settings object

Definition at line 255 of file gds-output-renderer.c.

Here is the caller graph for this function:

◆ gds_output_renderer_get_output_file()

const char * gds_output_renderer_get_output_file ( GdsOutputRenderer *  renderer)

Convenience function for getting the "output-file" property.

Parameters
renderer
Returns
Output file path. This must not be freed

Definition at line 247 of file gds-output-renderer.c.

Here is the caller graph for this function:

◆ gds_output_renderer_get_property()

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

Definition at line 114 of file gds-output-renderer.c.

Here is the caller graph for this function:

◆ gds_output_renderer_init()

void gds_output_renderer_init ( GdsOutputRenderer *  self)

Definition at line 208 of file gds-output-renderer.c.

◆ gds_output_renderer_new()

GdsOutputRenderer * gds_output_renderer_new ( )

Create a new GdsOutputRenderer GObject.

Returns
New object

Definition at line 224 of file gds-output-renderer.c.

◆ gds_output_renderer_new_with_props()

GdsOutputRenderer * gds_output_renderer_new_with_props ( const char *  output_file,
LayerSettings *  layer_settings 
)

Create a new GdsOutputRenderer GObject with its properties.

Parameters
output_fileOutput file of the renderer
layer_settingsLayer settings object
Returns
New object

Definition at line 229 of file gds-output-renderer.c.

◆ gds_output_renderer_render_dummy()

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

Definition at line 66 of file gds-output-renderer.c.

Here is the caller graph for this function:

◆ gds_output_renderer_render_output()

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

gds_output_renderer_render_output

Parameters
rendererRenderer object
cellCell to render
scalescale value. The output is scaled down by this value
Returns
0 if successful

Definition at line 281 of file gds-output-renderer.c.

Here is the caller graph for this function:

◆ gds_output_renderer_render_output_async()

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

Render output asynchronously.

This function will render in a separate thread. To wait for the completion of the rendering process.

Note
A second async thread cannot be spawned.
Parameters
rendererOutput renderer
cellCell to render
scaleScale
Returns
0 if successful. In case no thread can be spawned < 0

Definition at line 363 of file gds-output-renderer.c.

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

◆ gds_output_renderer_set_layer_settings()

void gds_output_renderer_set_layer_settings ( GdsOutputRenderer *  renderer,
LayerSettings *  settings 
)

Set layer settings.

This is a convenience function for setting the "layer-settings" property.

If another Layer settings has previously been supplied, it is unref'd.

Parameters
rendererRenderer
settingsLayerSettings object

Definition at line 274 of file gds-output-renderer.c.

Here is the caller graph for this function:

◆ gds_output_renderer_set_output_file()

void gds_output_renderer_set_output_file ( GdsOutputRenderer *  renderer,
const gchar *  file_name 
)

Convenience function for setting the "output-file" property.

Parameters
rendererRenderer object
file_nameOutput file path

Definition at line 237 of file gds-output-renderer.c.

Here is the caller graph for this function:

◆ gds_output_renderer_set_property()

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

Definition at line 134 of file gds-output-renderer.c.

Here is the caller graph for this function:

◆ gds_output_renderer_update_async_progress()

void gds_output_renderer_update_async_progress ( GdsOutputRenderer *  renderer,
const char *  status 
)

This function emits the 'progress-changed' in the thread/context that triggered an asynchronous rendering.

If the rendering is not asynchronous, this function has no effect.

Parameters
rendererGdsOutputrenderer object
statusStatus to supply to signal emission

Definition at line 422 of file gds-output-renderer.c.

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

◆ idle_event_processor_callback()

static gboolean idle_event_processor_callback ( gpointer  user_data)
static

Definition at line 394 of file gds-output-renderer.c.

Here is the caller graph for this function:

Variable Documentation

◆ gds_output_renderer_properties

GParamSpec* gds_output_renderer_properties[N_PROPERTIES] = {NULL}
static

Definition at line 162 of file gds-output-renderer.c.

◆ gds_output_renderer_signals

guint gds_output_renderer_signals[GDS_OUTPUT_RENDERER_SIGNAL_COUNT]
static

Definition at line 64 of file gds-output-renderer.c.