|
| 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) |
|
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.
◆ GDS_RENDER_TYPE_OUTPUT_RENDERER
#define GDS_RENDER_TYPE_OUTPUT_RENDERER (gds_output_renderer_get_type()) |
◆ anonymous enum
◆ anonymous enum
◆ 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.
◆ 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 |
◆ gds_output_renderer_async_wrapper()
static void gds_output_renderer_async_wrapper |
( |
GTask * |
task, |
|
|
gpointer |
source_object, |
|
|
gpointer |
task_data, |
|
|
GCancellable * |
cancellable |
|
) |
| |
|
static |
◆ gds_output_renderer_class_init()
static void gds_output_renderer_class_init |
( |
GdsOutputRendererClass * |
klass | ) |
|
|
static |
◆ gds_output_renderer_dispose()
static void gds_output_renderer_dispose |
( |
GObject * |
self_obj | ) |
|
|
static |
◆ 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
-
- Returns
- Layer settings object
Definition at line 255 of file gds-output-renderer.c.
◆ 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
-
- Returns
- Output file path. This must not be freed
Definition at line 247 of file gds-output-renderer.c.
◆ gds_output_renderer_get_property()
static void gds_output_renderer_get_property |
( |
GObject * |
obj, |
|
|
guint |
property_id, |
|
|
GValue * |
value, |
|
|
GParamSpec * |
pspec |
|
) |
| |
|
static |
◆ gds_output_renderer_init()
void gds_output_renderer_init |
( |
GdsOutputRenderer * |
self | ) |
|
◆ gds_output_renderer_new()
GdsOutputRenderer * gds_output_renderer_new |
( |
| ) |
|
◆ 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_file | Output file of the renderer |
layer_settings | Layer 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 |
◆ 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
-
renderer | Renderer object |
cell | Cell to render |
scale | scale value. The output is scaled down by this value |
- Returns
- 0 if successful
Definition at line 281 of file gds-output-renderer.c.
◆ 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
-
renderer | Output renderer |
cell | Cell to render |
scale | Scale |
- Returns
- 0 if successful. In case no thread can be spawned < 0
Definition at line 363 of file gds-output-renderer.c.
◆ 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
-
renderer | Renderer |
settings | LayerSettings object |
Definition at line 274 of file gds-output-renderer.c.
◆ 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
-
renderer | Renderer object |
file_name | Output file path |
Definition at line 237 of file gds-output-renderer.c.
◆ gds_output_renderer_set_property()
static void gds_output_renderer_set_property |
( |
GObject * |
obj, |
|
|
guint |
property_id, |
|
|
const GValue * |
value, |
|
|
GParamSpec * |
pspec |
|
) |
| |
|
static |
◆ 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
-
renderer | GdsOutputrenderer object |
status | Status to supply to signal emission |
Definition at line 422 of file gds-output-renderer.c.
◆ idle_event_processor_callback()
static gboolean idle_event_processor_callback |
( |
gpointer |
user_data | ) |
|
|
static |
◆ gds_output_renderer_properties
GParamSpec* gds_output_renderer_properties[N_PROPERTIES] = {NULL} |
|
static |
◆ gds_output_renderer_signals