32#include <glib/gi18n.h>
49 for (count = 0; *string_array; string_array++)
56 char **output_file_names,
58 gboolean tex_standalone,
60 GList **renderer_list,
61 LayerSettings *layer_settings)
64 char *current_renderer;
66 char *current_out_file;
67 int count_render, count_out;
73 if (!renderers || !output_file_names) {
74 fprintf(stderr, _(
"Please specify renderers and file names\n"));
80 if (count_render != count_out) {
81 fprintf(stderr, _(
"Count of renderers %d does not match count of output file names %d\n"),
82 count_render, count_out);
87 for (renderer_iter = renderers, idx = 0; *renderer_iter; renderer_iter++, idx++) {
88 current_renderer = *renderer_iter;
89 current_out_file = output_file_names[idx];
92 if (!current_out_file || !current_out_file[0])
95 if (!strcmp(current_renderer,
"tikz")) {
98 }
else if (!strcmp(current_renderer,
"pdf")) {
100 }
else if (!strcmp(current_renderer,
"svg")) {
102 }
else if (!strcmp(current_renderer,
"ext")) {
104 fprintf(stderr, _(
"Please specify shared object for external renderer. Will ignore this renderer.\n"));
125 struct gds_cell *return_cell = NULL;
128 for (cell_list = lib->
cells; cell_list; cell_list = g_list_next(cell_list)) {
129 temp_cell = (
struct gds_cell *)cell_list->data;
131 return_cell = temp_cell;
139 const char *cell_name,
141 char **output_file_names,
142 const char *layer_file,
144 gboolean tex_standalone,
151 GList *renderer_list = NULL;
154 struct gds_cell *toplevel_cell = NULL;
155 LayerSettings *layer_sett;
156 GdsOutputRenderer *current_renderer;
159 if (!gds_name || !cell_name || !output_file_names || !layer_file || !renderers) {
160 printf(_(
"Probably missing argument. Check --help option\n"));
169 if (
create_renderers(renderers, output_file_names, tex_layers, tex_standalone,
170 ext_param, &renderer_list, layer_sett))
171 goto ret_destroy_layer_mapping;
178 goto ret_destroy_library_list;
182 goto ret_clear_renderers;
186 fprintf(stderr, _(
"No library in library list. This should not happen.\n"));
188 goto ret_destroy_library_list;
194 if (!toplevel_cell) {
195 printf(_(
"Couldn't find cell in first library!\n"));
196 goto ret_destroy_library_list;
202 fprintf(stderr, _(
"Checking library %s failed.\n"), first_lib->
name);
203 goto ret_destroy_library_list;
204 }
else if (res > 0) {
205 fprintf(stderr, _(
"%d reference loops found.\n"), res);
209 fprintf(stderr, _(
"Cell is affected by reference loop. Abort!\n"));
210 goto ret_destroy_library_list;
215 fprintf(stderr, _(
"Cell was not checked. This should not happen. Please report this issue. Will continue either way.\n"));
222 for (list_iter = renderer_list; list_iter; list_iter = list_iter->next) {
223 current_renderer = GDS_RENDER_OUTPUT_RENDERER(list_iter->data);
227ret_destroy_library_list:
230 for (list_iter = renderer_list; list_iter; list_iter = list_iter->next)
231 g_object_unref(list_iter->data);
232ret_destroy_layer_mapping:
233 g_object_unref(layer_sett);
Header File for Cairo output renderer.
Render according to command line parameters.
Render according to command line parameters.
Header file for the GDS-Parser.
Checking functions of a cell tree (Header)
CairoRenderer * cairo_renderer_new_pdf()
Create new CairoRenderer for PDF output.
CairoRenderer * cairo_renderer_new_svg()
Create new CairoRenderer for SVG output.
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.
int gds_tree_check_reference_loops(struct gds_library *lib)
gds_tree_check_reference_loops checks if the given library contains reference loops
int clear_lib_list(GList **library_list)
Deletes all libraries including cells, references etc.
int parse_gds_from_file(const char *filename, GList **library_list)
Parse a GDS file.
#define CELL_NAME_MAX
Maximum length of a gds_cell::name or a gds_library::name.
void gds_output_renderer_set_output_file(GdsOutputRenderer *renderer, const gchar *file_name)
Convenience function for setting the "output-file" property.
int gds_output_renderer_render_output(GdsOutputRenderer *renderer, struct gds_cell *cell, double scale)
gds_output_renderer_render_output
void gds_output_renderer_set_layer_settings(GdsOutputRenderer *renderer, LayerSettings *settings)
Set layer settings.
LatexRenderer * latex_renderer_new_with_options(gboolean pdf_layers, gboolean standalone)
Create new LatexRenderer object.
output_renderer
return type of the RedererSettingsDialog
static int string_array_count(char **string_array)
static struct gds_cell * find_gds_cell_in_lib(struct gds_library *lib, const char *cell_name)
static int create_renderers(char **renderers, char **output_file_names, gboolean tex_layers, gboolean tex_standalone, const struct external_renderer_params *ext_params, GList **renderer_list, LayerSettings *layer_settings)
int command_line_convert_gds(const char *gds_name, const char *cell_name, char **renderers, char **output_file_names, const char *layer_file, struct external_renderer_params *ext_param, gboolean tex_standalone, gboolean tex_layers, double scale)
Convert GDS according to command line parameters.
LayerSettings class header file.
LayerSettings * layer_settings_new()
New LayerSettings object.
int layer_settings_load_from_csv(LayerSettings *settings, const char *path)
Load new layer Settings from CSV.
External renderer paramameters to command line renderer.
char * cli_params
Command line parameters given.
char * so_path
Path to shared object.
int affected_by_reference_loop
1 if the cell is affected by a reference loop and therefore not renderable. Default: GDS_CELL_CHECK_N...
A Cell inside a gds_library.
struct gds_cell_checks checks
Checking results.
struct gds_library * parent_library
Pointer to parent library.