Compare commits
47 Commits
v1.1
...
d107954859
Author | SHA1 | Date | |
---|---|---|---|
d107954859 | |||
5c994f892a | |||
96f1347b2c | |||
2d2ca67c48 | |||
d9282d8e5a | |||
d5f1b2edf4 | |||
f224b28613 | |||
7b10d41160 | |||
302d462cda | |||
c146bcd094 | |||
e6abaddcd1 | |||
a35231b9ec | |||
24b70eec48 | |||
022d9561db | |||
f5f8509b91 | |||
61f607ac94 | |||
ee1b55120f | |||
b04788b7d4 | |||
3c05b50bc7 | |||
dfadaa241e | |||
5729ef0db8 | |||
88cd834d13 | |||
f625d2daba | |||
e42aa36520 | |||
2ffa09d104 | |||
feb69b6d60 | |||
20ec6bd41b | |||
eef012fc4d | |||
e847e691bd | |||
0d6b2c7a36 | |||
583f01faae | |||
795d496949 | |||
6ebd05007e | |||
906225f47f | |||
dadafa43a3 | |||
2d3241d8b7 | |||
0ecc60d2a1 | |||
9b0f268bbd | |||
6ae316f459 | |||
082a823575 | |||
1f7f3118fa | |||
5cfd93c18d | |||
6818357f64 | |||
b0fdb261e0 | |||
de8d6967c6 | |||
493f787fd1 | |||
a7b7ba71e5 |
@@ -6,7 +6,7 @@ pkg_search_module(GLIB REQUIRED glib-2.0)
|
||||
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
|
||||
pkg_check_modules(CAIRO REQUIRED cairo)
|
||||
|
||||
add_subdirectory(glade)
|
||||
add_subdirectory(resources)
|
||||
add_subdirectory(doxygen)
|
||||
add_subdirectory(version)
|
||||
|
||||
@@ -15,31 +15,29 @@ link_directories(${GLIB_LINK_DIRS} ${GTK3_LINK_DIRS} ${CAIRO_LINK_DIRS})
|
||||
add_definitions(${GLIB2_CFLAGS_OTHER})
|
||||
|
||||
aux_source_directory("widgets" LAYER_SOURCES)
|
||||
aux_source_directory("tree-renderer" RENDERER_SOURCES)
|
||||
aux_source_directory("cell-selector" CELL_SELECTOR_SOURCES)
|
||||
aux_source_directory("gds-utils" GDS_SOURCES)
|
||||
aux_source_directory("latex-renderer" LATEX_SOURCES)
|
||||
aux_source_directory("cairo-renderer" CAIRO_SOURCES)
|
||||
aux_source_directory("output-renderers" OUTPUT_RENDERER_SOURCES)
|
||||
aux_source_directory("geometric" GEOMETRIC_SOURCES)
|
||||
aux_source_directory("layer" LAYER_SELECTOR_SOURCES)
|
||||
set(SOURCE "main.c" "command-line.c" "gds-render-gui.c" "external-renderer.c")
|
||||
set(SOURCE "main.c" "command-line.c" "gds-render-gui.c")
|
||||
|
||||
set(SOURCE
|
||||
${SOURCE}
|
||||
${LAYER_SOURCES}
|
||||
${RENDERER_SOURCES}
|
||||
${CELL_SELECTOR_SOURCES}
|
||||
${GDS_SOURCES}
|
||||
${LATEX_SOURCES}
|
||||
${CAIRO_SOURCES}
|
||||
${OUTPUT_RENDERER_SOURCES}
|
||||
${GEOMETRIC_SOURCES}
|
||||
${LAYER_SELECTOR_SOURCES}
|
||||
)
|
||||
|
||||
add_compile_options(-Wall)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/glade/resources.c)
|
||||
add_executable(${PROJECT_NAME} ${SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/resources/resources.c)
|
||||
add_dependencies(${PROJECT_NAME} glib-resources)
|
||||
add_dependencies(${PROJECT_NAME} version)
|
||||
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/glade/resources.c PROPERTIES GENERATED 1)
|
||||
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/resources/resources.c PROPERTIES GENERATED 1)
|
||||
target_link_libraries(${PROJECT_NAME} ${GLIB_LDFLAGS} ${GTK3_LDFLAGS} ${CAIRO_LDFLAGS} m version ${CMAKE_DL_LIBS})
|
||||
install (TARGETS ${PROJECT_NAME} DESTINATION bin)
|
||||
|
||||
|
@@ -28,16 +28,16 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <gds-render/tree-renderer/lib-cell-renderer.h>
|
||||
#include <gds-render/cell-selector/lib-cell-renderer.h>
|
||||
#include <gds-render/gds-utils/gds-types.h>
|
||||
|
||||
G_DEFINE_TYPE(LibCellRenderer, lib_cell_renderer, GTK_TYPE_CELL_RENDERER_TEXT)
|
||||
|
||||
enum {
|
||||
PROP_LIB = 1,
|
||||
PROP_CELL,
|
||||
PROP_ERROR_LEVEL,
|
||||
PROP_COUNT
|
||||
PROP_LIB = 1, /**< @brief Library to display the name of */
|
||||
PROP_CELL, /**< @brief Cell to display the name of */
|
||||
PROP_ERROR_LEVEL, /**< @brief Error level of cell/library for coloring */
|
||||
PROP_COUNT /**< @brief Sentinel */
|
||||
};
|
||||
|
||||
void lib_cell_renderer_init(LibCellRenderer *self)
|
@@ -28,8 +28,8 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <gds-render/tree-renderer/tree-store.h>
|
||||
#include <gds-render/tree-renderer/lib-cell-renderer.h>
|
||||
#include <gds-render/cell-selector/tree-store.h>
|
||||
#include <gds-render/cell-selector/lib-cell-renderer.h>
|
||||
#include <gds-render/gds-utils/gds-types.h>
|
||||
|
||||
/**
|
@@ -34,9 +34,9 @@
|
||||
#include <gds-render/gds-utils/gds-parser.h>
|
||||
#include <gds-render/layer/mapping-parser.h>
|
||||
#include <gds-render/layer/layer-info.h>
|
||||
#include <gds-render/cairo-renderer/cairo-output.h>
|
||||
#include <gds-render/latex-renderer/latex-output.h>
|
||||
#include <gds-render/external-renderer.h>
|
||||
#include <gds-render/output-renderers/cairo-renderer.h>
|
||||
#include <gds-render/output-renderers/latex-renderer.h>
|
||||
#include <gds-render/output-renderers/external-renderer.h>
|
||||
#include <gds-render/gds-utils/gds-tree-checker.h>
|
||||
|
||||
/**
|
||||
@@ -55,12 +55,10 @@ static void delete_layer_info_with_name(struct layer_info *info)
|
||||
}
|
||||
}
|
||||
|
||||
void command_line_convert_gds(char *gds_name, char *pdf_name, char *tex_name, gboolean pdf, gboolean tex,
|
||||
char *layer_file, char *cell_name, double scale, gboolean pdf_layers,
|
||||
gboolean pdf_standalone, gboolean svg, char *svg_name, char *so_name, char *so_out_file)
|
||||
void command_line_convert_gds(const char *gds_name, const char *cell_name, const char *output_file_name, const char *layer_file, const char *so_path,
|
||||
enum command_line_renderer renderer, enum cmd_options options, double scale)
|
||||
{
|
||||
GList *libs = NULL;
|
||||
FILE *tex_file;
|
||||
int res;
|
||||
GFile *file;
|
||||
int i;
|
||||
@@ -75,10 +73,11 @@ void command_line_convert_gds(char *gds_name, char *pdf_name, char *tex_name, gb
|
||||
struct layer_info *linfo_temp;
|
||||
struct gds_library *first_lib;
|
||||
struct gds_cell *toplevel_cell = NULL, *temp_cell;
|
||||
|
||||
GdsOutputRenderer *output_renderer;
|
||||
gboolean tex_layers = FALSE, tex_standalone = FALSE;
|
||||
|
||||
/* Check if parameters are valid */
|
||||
if (!gds_name || (!pdf_name && pdf) || (!tex_name && tex) || !layer_file || !cell_name) {
|
||||
if (!gds_name || !cell_name || !output_file_name || !layer_file) {
|
||||
printf("Probably missing argument. Check --help option\n");
|
||||
return;
|
||||
}
|
||||
@@ -165,30 +164,43 @@ void command_line_convert_gds(char *gds_name, char *pdf_name, char *tex_name, gb
|
||||
* Deal with it.
|
||||
*/
|
||||
|
||||
/* Render outputs */
|
||||
if (pdf == TRUE || svg == TRUE) {
|
||||
cairo_render_cell_to_vector_file(toplevel_cell, layer_info_list, (pdf == TRUE ? pdf_name : NULL),
|
||||
(svg == TRUE ? svg_name : NULL), scale);
|
||||
|
||||
/* Render */
|
||||
|
||||
if (options & CMD_OPT_LATEX_LAYERS)
|
||||
tex_layers = TRUE;
|
||||
if (options & CMD_OPT_LATEX_STANDALONE)
|
||||
tex_standalone = TRUE;
|
||||
|
||||
switch (renderer) {
|
||||
case CMD_CAIRO_SVG:
|
||||
output_renderer = GDS_RENDER_OUTPUT_RENDERER(cairo_renderer_new_svg());
|
||||
break;
|
||||
case CMD_LATEX:
|
||||
output_renderer = GDS_RENDER_OUTPUT_RENDERER(latex_renderer_new_with_options(tex_layers, tex_standalone));
|
||||
break;
|
||||
case CMD_CAIRO_PDF:
|
||||
output_renderer = GDS_RENDER_OUTPUT_RENDERER(cairo_renderer_new_pdf());
|
||||
break;
|
||||
case CMD_EXTERNAL:
|
||||
output_renderer = GDS_RENDER_OUTPUT_RENDERER(external_renderer_new_with_so(so_path));
|
||||
break;
|
||||
case CMD_NONE:
|
||||
/* Do nothing */
|
||||
output_renderer = NULL;
|
||||
break;
|
||||
default:
|
||||
output_renderer = NULL;
|
||||
fprintf(stderr, "Invalid renderer supplied");
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if (tex == TRUE) {
|
||||
tex_file = fopen(tex_name, "w");
|
||||
if (!tex_file)
|
||||
goto ret_clear_layer_list;
|
||||
latex_render_cell_to_code(toplevel_cell, layer_info_list, tex_file, scale, pdf_layers, pdf_standalone);
|
||||
fclose(tex_file);
|
||||
if (output_renderer) {
|
||||
gds_output_renderer_render_output(output_renderer, toplevel_cell, layer_info_list, output_file_name, scale);
|
||||
g_object_unref(output_renderer);
|
||||
}
|
||||
|
||||
if (so_name && so_out_file) {
|
||||
if (strlen(so_name) == 0 || strlen(so_out_file) == 0)
|
||||
goto ret_clear_layer_list;
|
||||
|
||||
/* Render output using external renderer */
|
||||
printf("Invoking external renderer!\n");
|
||||
external_renderer_render_cell(toplevel_cell, layer_info_list, so_out_file, so_name);
|
||||
printf("External renderer finished!\n");
|
||||
}
|
||||
|
||||
/* Render end */
|
||||
ret_clear_layer_list:
|
||||
g_list_free_full(layer_info_list, (GDestroyNotify)delete_layer_info_with_name);
|
||||
|
||||
|
@@ -234,7 +234,7 @@ SEPARATE_MEMBER_PAGES = NO
|
||||
# uses this value to replace tabs by spaces in code fragments.
|
||||
# Minimum value: 1, maximum value: 16, default value: 4.
|
||||
|
||||
TAB_SIZE = 4
|
||||
TAB_SIZE = 8
|
||||
|
||||
# This tag can be used to specify a number of aliases that act as commands in
|
||||
# the documentation. An alias has the form:
|
||||
@@ -2417,7 +2417,7 @@ DIRECTORY_GRAPH = YES
|
||||
# The default value is: png.
|
||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DOT_IMAGE_FORMAT = svg
|
||||
|
||||
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
|
||||
# enable generation of interactive SVG images that allow zooming and panning.
|
||||
@@ -2429,7 +2429,7 @@ DOT_IMAGE_FORMAT = png
|
||||
# The default value is: NO.
|
||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||
|
||||
INTERACTIVE_SVG = NO
|
||||
INTERACTIVE_SVG = YES
|
||||
|
||||
# The DOT_PATH tag can be used to specify the path where the dot tool can be
|
||||
# found. If left blank, it is assumed the dot tool can be found in the path.
|
||||
|
6
doxygen/activity-bar.dox
Normal file
6
doxygen/activity-bar.dox
Normal file
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* @defgroup ActivityBar Activity Bar
|
||||
* @ingroup Widgets
|
||||
*
|
||||
* Activity Status Bar
|
||||
*/
|
@@ -31,6 +31,6 @@ In tabular form: *v1.0-rc4-41-gaa41373-dirty*
|
||||
| 1.0-rc4 | 41 | aa41373 | yes |
|
||||
|
||||
|
||||
This git-based version number is automatically put into the application and this doxumentation during the application's compilation / the documentation's generation. For this *git* is needed. Therefore, it is highly recommended to have 'git' installed for compilation although it is no build dependency. In case of a missing git installation, the string "! version not set !" is compiled into the application.
|
||||
This git-based version number is automatically put into the application and this documentation during the application's compilation / the documentation's generation. For this *git* is needed. Therefore, it is highly recommended to have 'git' installed for compilation although it is no build dependency. In case of a missing git installation, the string "! version not set !" is compiled into the application.
|
||||
|
||||
**/
|
||||
|
@@ -1,72 +0,0 @@
|
||||
/*
|
||||
* GDSII-Converter
|
||||
* Copyright (C) 2018 Mario Hüttel <mario.huettel@gmx.net>
|
||||
*
|
||||
* This file is part of GDSII-Converter.
|
||||
*
|
||||
* GDSII-Converter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* GDSII-Converter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GDSII-Converter. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file external-renderer.c
|
||||
* @brief This file implements the dynamic library loading for the external rendering feature
|
||||
* @author Mario Hüttel <mario.huettel@gmx.net>
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup external-renderer
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <gds-render/external-renderer.h>
|
||||
|
||||
int external_renderer_render_cell(struct gds_cell *toplevel_cell, GList *layer_info_list,
|
||||
char *output_file, char *so_path)
|
||||
{
|
||||
int (*so_render_func)(struct gds_cell *, GList *, char *) = NULL;
|
||||
void *so_handle = NULL;
|
||||
char *error_msg;
|
||||
int ret = 0;
|
||||
|
||||
/* Check parameter sanity */
|
||||
if (!output_file || !so_path || !toplevel_cell || !layer_info_list)
|
||||
return -3000;
|
||||
|
||||
/* Load shared object */
|
||||
so_handle = dlopen(so_path, RTLD_LAZY);
|
||||
if (!so_handle) {
|
||||
printf("Could not load external library '%s'\nDetailed error is:\n%s\n", so_path, dlerror());
|
||||
return -2000;
|
||||
}
|
||||
|
||||
/* Load symbol from library */
|
||||
so_render_func = (int (*)(struct gds_cell *, GList *, char *))dlsym(so_handle, EXTERNAL_LIBRARY_FUNCTION);
|
||||
error_msg = dlerror();
|
||||
if (error_msg != NULL) {
|
||||
printf("Rendering function not found in library:\n%s\n", error_msg);
|
||||
goto ret_close_so_handle;
|
||||
}
|
||||
|
||||
/* Execute */
|
||||
if (so_render_func)
|
||||
so_render_func(toplevel_cell, layer_info_list, output_file);
|
||||
|
||||
ret_close_so_handle:
|
||||
dlclose(so_handle);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/** @} */
|
@@ -34,10 +34,11 @@
|
||||
#include <gds-render/gds-utils/gds-parser.h>
|
||||
#include <gds-render/gds-utils/gds-tree-checker.h>
|
||||
#include <gds-render/layer/layer-selector.h>
|
||||
#include <gds-render/tree-renderer/tree-store.h>
|
||||
#include <gds-render/tree-renderer/lib-cell-renderer.h>
|
||||
#include <gds-render/latex-renderer/latex-output.h>
|
||||
#include <gds-render/cairo-renderer/cairo-output.h>
|
||||
#include <gds-render/widgets/activity-bar.h>
|
||||
#include <gds-render/cell-selector/tree-store.h>
|
||||
#include <gds-render/cell-selector/lib-cell-renderer.h>
|
||||
#include <gds-render/output-renderers/latex-output.h>
|
||||
#include <gds-render/output-renderers/cairo-output.h>
|
||||
#include <gds-render/widgets/conv-settings-dialog.h>
|
||||
#include <gds-render/geometric/cell-geometrics.h>
|
||||
#include <gds-render/version.h>
|
||||
@@ -58,7 +59,9 @@ struct _GdsRenderGui {
|
||||
LayerSelector *layer_selector;
|
||||
GtkTreeView *cell_tree_view;
|
||||
GList *gds_libraries;
|
||||
ActivityBar *activity_status_bar;
|
||||
struct render_settings render_dialog_settings;
|
||||
ColorPalette *palette;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE(GdsRenderGui, gds_render_gui, G_TYPE_OBJECT)
|
||||
@@ -237,6 +240,20 @@ end_destroy:
|
||||
gtk_widget_destroy(open_dialog);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Callback for auto coloring button
|
||||
* @param button
|
||||
* @param user
|
||||
*/
|
||||
static void on_auto_color_clicked(gpointer button, gpointer user)
|
||||
{
|
||||
GdsRenderGui *self;
|
||||
(void)button;
|
||||
|
||||
self = RENDERER_GUI(user);
|
||||
layer_selector_auto_color_layers(self->layer_selector, self->palette, 1.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Convert button callback
|
||||
* @param button
|
||||
@@ -442,6 +459,8 @@ static void gds_render_gui_dispose(GObject *gobject)
|
||||
g_clear_object(&self->layer_selector);
|
||||
g_clear_object(&self->cell_tree_store);
|
||||
g_clear_object(&self->cell_search_entry);
|
||||
g_clear_object(&self->activity_status_bar);
|
||||
g_clear_object(&self->palette);
|
||||
|
||||
if (self->main_window) {
|
||||
g_signal_handlers_destroy(self->main_window);
|
||||
@@ -484,8 +503,10 @@ static void gds_render_gui_init(GdsRenderGui *self)
|
||||
struct tree_stores *cell_selector_stores;
|
||||
GtkWidget *sort_up_button;
|
||||
GtkWidget *sort_down_button;
|
||||
GtkWidget *activity_bar_box;
|
||||
GtkWidget *auto_color_button;
|
||||
|
||||
main_builder = gtk_builder_new_from_resource("/main.glade");
|
||||
main_builder = gtk_builder_new_from_resource("/gui/main.glade");
|
||||
|
||||
self->cell_tree_view = GTK_TREE_VIEW(gtk_builder_get_object(main_builder, "cell-tree"));
|
||||
self->cell_search_entry = GTK_WIDGET(gtk_builder_get_object(main_builder, "cell-search"));
|
||||
@@ -505,6 +526,7 @@ static void gds_render_gui_init(GdsRenderGui *self)
|
||||
/* Create layer selector */
|
||||
self->layer_selector = layer_selector_new(GTK_LIST_BOX(listbox));
|
||||
|
||||
activity_bar_box = GTK_WIDGET(gtk_builder_get_object(main_builder, "activity-bar"));
|
||||
|
||||
/* Callback for selection change of cell selector */
|
||||
g_signal_connect(G_OBJECT(gtk_tree_view_get_selection(self->cell_tree_view)), "changed",
|
||||
@@ -533,7 +555,16 @@ static void gds_render_gui_init(GdsRenderGui *self)
|
||||
g_signal_connect(GTK_WIDGET(self->main_window), "delete-event",
|
||||
G_CALLBACK(on_window_close), self);
|
||||
|
||||
g_object_unref(main_builder);
|
||||
/* Create and apply ActivityBar */
|
||||
self->activity_status_bar = activity_bar_new();
|
||||
gtk_container_add(GTK_CONTAINER(activity_bar_box), GTK_WIDGET(self->activity_status_bar));
|
||||
gtk_widget_show(GTK_WIDGET(self->activity_status_bar));
|
||||
|
||||
/* Create color palette */
|
||||
self->palette = color_palette_new_from_resource("/data/color-palette.txt");
|
||||
auto_color_button = GTK_WIDGET(gtk_builder_get_object(main_builder, "auto-color-button"));
|
||||
g_signal_connect(auto_color_button, "clicked", G_CALLBACK(on_auto_color_clicked), self);
|
||||
|
||||
|
||||
/* Set default conversion/rendering settings */
|
||||
self->render_dialog_settings.scale = 1000;
|
||||
@@ -541,14 +572,17 @@ static void gds_render_gui_init(GdsRenderGui *self)
|
||||
self->render_dialog_settings.tex_pdf_layers = FALSE;
|
||||
self->render_dialog_settings.tex_standalone = FALSE;
|
||||
|
||||
g_object_unref(main_builder);
|
||||
|
||||
/* Reference all objects referenced by this object */
|
||||
g_object_ref(self->activity_status_bar);
|
||||
g_object_ref(self->main_window);
|
||||
g_object_ref(self->cell_tree_view);
|
||||
g_object_ref(self->convert_button);
|
||||
g_object_ref(self->layer_selector);
|
||||
g_object_ref(self->cell_tree_store);
|
||||
g_object_ref(self->cell_search_entry);
|
||||
g_object_ref(self->palette);
|
||||
}
|
||||
|
||||
GdsRenderGui *gds_render_gui_new()
|
||||
|
@@ -53,7 +53,8 @@
|
||||
#define GDS_WARN(fmt, ...) printf("[PARSE_WARNING] " fmt "\n", ##__VA_ARGS__) /**< @brief Print GDS warning */
|
||||
|
||||
#if GDS_PRINT_DEBUG_INFOS
|
||||
#define GDS_INF(fmt, ...) printf(fmt, ##__VA_ARGS__) /**< @brief standard printf. But can be disabled in code */
|
||||
/**< @brief standard printf. But can be disabled in code. */
|
||||
#define GDS_INF(fmt, ...) printf(fmt, ##__VA_ARGS__)
|
||||
#else
|
||||
#define GDS_INF(fmt, ...)
|
||||
#endif
|
||||
@@ -979,7 +980,7 @@ int parse_gds_from_file(const char *filename, GList **library_list)
|
||||
} else if (current_a_reference) {
|
||||
name_array_cell_ref(current_a_reference, (unsigned int)read, workbuff);
|
||||
} else {
|
||||
GDS_ERROR("reference name set outside of cell reference.\n");
|
||||
GDS_ERROR("Reference name set outside of cell reference");
|
||||
}
|
||||
break;
|
||||
case WIDTH:
|
||||
|
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<gresources>
|
||||
<gresource prefix="/">
|
||||
<file compressed="true">main.glade</file>
|
||||
<file compressed="true">about.glade</file>
|
||||
<file>layer-widget.glade</file>
|
||||
<file>dialog.glade</file>
|
||||
<file compressed="true" alias="logo.svg">../icon/gds-render.svg</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
||||
|
@@ -33,28 +33,32 @@
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
enum command_line_renderer {
|
||||
CMD_NONE = 0,
|
||||
CMD_EXTERNAL,
|
||||
CMD_CAIRO_SVG,
|
||||
CMD_CAIRO_PDF,
|
||||
CMD_LATEX,
|
||||
};
|
||||
|
||||
enum cmd_options {
|
||||
CMD_OPT_NONE = 0U,
|
||||
CMD_OPT_LATEX_STANDALONE = (1U<<0),
|
||||
CMD_OPT_LATEX_LAYERS = (1U<<1),
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Convert GDS according to supplied parameters
|
||||
* @param gds_name GDS File path
|
||||
* @param pdf_name Cairo-PDF path
|
||||
* @param tex_name TeX/TikZ path
|
||||
* @param pdf Render Cairo
|
||||
* @param tex Render LaTeX
|
||||
* @param layer_file Layer mapping file
|
||||
* @param cell_name Cell name to render
|
||||
* @param scale Scale image down by this value
|
||||
* @param pdf_layers TikZ creates OCG layers
|
||||
* @param pdf_standalone LaTeX document is standalone7
|
||||
* @param svg Render to SVG file
|
||||
* @param so_name Path to shared object of custom renderer
|
||||
* @param so_out_file Output file path for custom renderer
|
||||
* @param svg_name SVG file name
|
||||
*
|
||||
* @note This function is pretty damn retarded (Lots of parameters). Will be reworked when generating GObjects for renderers.
|
||||
* @brief render output file according to command line parameters
|
||||
* @param gds_name Name of GDS file
|
||||
* @param cell_name Name of cell to render
|
||||
* @param output_file_name Output file name
|
||||
* @param so_file Shared object file to search external rendering function
|
||||
* @param renderer Type of output renderer
|
||||
* @param options Additional options for output renderer
|
||||
* @param scale Scale value
|
||||
*/
|
||||
void command_line_convert_gds(char *gds_name, char *pdf_name, char *tex_name, gboolean pdf, gboolean tex,
|
||||
char *layer_file, char *cell_name, double scale, gboolean pdf_layers,
|
||||
gboolean pdf_standalone, gboolean svg, char *svg_name, char *so_name, char *so_out_file);
|
||||
void command_line_convert_gds(const char *gds_name, const char *cell_name, const char *output_file_name, const char *layer_file,
|
||||
const char *so_file, enum command_line_renderer renderer, enum cmd_options options, double scale);
|
||||
|
||||
#endif /* _COMMAND_LINE_H_ */
|
||||
|
||||
|
@@ -37,7 +37,21 @@
|
||||
|
||||
#define GDS_PRINT_DEBUG_INFOS (0) /**< @brief 1: Print infos, 0: Don't print */
|
||||
|
||||
/**
|
||||
* @brief Parse a GDS file
|
||||
*
|
||||
* This function parses a GDS File and creates a list of libraries,
|
||||
* which then contain the different cells.
|
||||
*
|
||||
* The function appends The detected libraries to the \p library_array list.
|
||||
* The library array may be empty, meaning *library_list may be NULL.
|
||||
*
|
||||
* @param[in] filename Path to the GDS file
|
||||
* @param[in,out] library_array GList Pointer.
|
||||
* @return 0 if successful
|
||||
*/
|
||||
int parse_gds_from_file(const char *filename, GList **library_array);
|
||||
|
||||
/**
|
||||
* @brief Deletes all libraries including cells, references etc.
|
||||
* @param library_list Pointer to a list of #gds_library. Is set to NULL after completion.
|
||||
|
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* GDSII-Converter
|
||||
* Copyright (C) 2018 Mario Hüttel <mario.huettel@gmx.net>
|
||||
*
|
||||
* This file is part of GDSII-Converter.
|
||||
*
|
||||
* GDSII-Converter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* GDSII-Converter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GDSII-Converter. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file latex-output.h
|
||||
* @brief LaTeX output renderer
|
||||
* @author Mario Hüttel <mario.huettel@gmx.net>
|
||||
*/
|
||||
|
||||
#ifndef __LATEX_OUTPUT_H__
|
||||
#define __LATEX_OUTPUT_H__
|
||||
|
||||
/**
|
||||
* @addtogroup LaTeX-Renderer
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "gds-render/layer/layer-info.h"
|
||||
#include <gds-render/gds-utils/gds-types.h>
|
||||
|
||||
#define LATEX_LINE_BUFFER_KB (10) /**< @brief Buffer for LaTeX Code line in KiB */
|
||||
|
||||
/**
|
||||
* @brief Render \p cell to LateX/TikZ code
|
||||
* @param cell Cell to render
|
||||
* @param layer_infos Layer information
|
||||
* @param tex_file Already opened file to write data in
|
||||
* @param scale Scale image down by this value
|
||||
* @param create_pdf_layers Optional content groups used
|
||||
* @param standalone_document document can be compiled standalone
|
||||
*/
|
||||
void latex_render_cell_to_code(struct gds_cell *cell, GList *layer_infos, FILE *tex_file, double scale,
|
||||
gboolean create_pdf_layers, gboolean standalone_document);
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif /* __LATEX_OUTPUT_H__ */
|
70
include/gds-render/layer/color-palette.h
Normal file
70
include/gds-render/layer/color-palette.h
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* GDSII-Converter
|
||||
* Copyright (C) 2019 Mario Hüttel <mario.huettel@gmx.net>
|
||||
*
|
||||
* This file is part of GDSII-Converter.
|
||||
*
|
||||
* GDSII-Converter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* GDSII-Converter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GDSII-Converter. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file color-palette.h
|
||||
* @brief Class representing a color palette
|
||||
* @author Mario Hüttel <mario.huettel@gmx.net>
|
||||
*/
|
||||
|
||||
#ifndef _COLOR_PALETTE_H_
|
||||
#define _COLOR_PALETTE_H_
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_DECLARE_FINAL_TYPE(ColorPalette, color_palette, GDS_RENDER, COLOR_PALETTE, GObject);
|
||||
|
||||
#define TYPE_GDS_RENDER_COLOR_PALETTE (color_palette_get_type())
|
||||
|
||||
/**
|
||||
* @brief Create a new object with from a resource containing the html hex color scheme
|
||||
* @param resource_name Name of the resource
|
||||
* @return New object
|
||||
*/
|
||||
ColorPalette *color_palette_new_from_resource(char *resource_name);
|
||||
|
||||
/**
|
||||
* @brief Get the n-th color in the palette identified by the index.
|
||||
*
|
||||
* This function fills the nth color into the supplied \p color.
|
||||
* \p color is returned.
|
||||
*
|
||||
* If \p color is NULL, a new GdkRGBA is created and returned.
|
||||
* This element must be freed afterwards.
|
||||
*
|
||||
* @param palette Color palette
|
||||
* @param color GdkRGBA struct to fill data in. May be NULL.
|
||||
* @param index Index of color. Starts at 0
|
||||
* @return GdkRGBA color. If \p color is NULL, the returned color must be freed afterwards
|
||||
*/
|
||||
GdkRGBA *color_palette_get_color(ColorPalette *palette, GdkRGBA *color, unsigned int index);
|
||||
|
||||
/**
|
||||
* @brief Return amount of stored colors in \p palette
|
||||
* @param palette Color palette
|
||||
* @return Count of colors
|
||||
*/
|
||||
unsigned int color_palette_get_color_count(ColorPalette *palette);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _COLOR_PALETTE_H_ */
|
@@ -33,6 +33,7 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib.h>
|
||||
#include <gds-render/layer/color-palette.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -90,6 +91,14 @@ GList *layer_selector_export_rendered_layer_info(LayerSelector *selector);
|
||||
*/
|
||||
void layer_selector_force_sort(LayerSelector *selector, enum layer_selector_sort_algo sort_function);
|
||||
|
||||
/**
|
||||
* @brief Apply colors from palette to all layers. Aditionally set alpha
|
||||
* @param layer_selector LayerSelector object
|
||||
* @param palette Color palette to use
|
||||
* @param global_alpha Additional alpha value that is applied to all layers
|
||||
*/
|
||||
void layer_selector_auto_color_layers(LayerSelector *layer_selector, ColorPalette *palette, double global_alpha);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __LAYER_SELECTOR_H__ */
|
||||
|
@@ -26,23 +26,36 @@
|
||||
|
||||
#include <gds-render/gds-utils/gds-types.h>
|
||||
#include <gds-render/layer/layer-info.h>
|
||||
#include <gds-render/output-renderers/gds-output-renderer.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
/** @addtogroup Cairo-Renderer
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/** @addtogroup CairoRenderer
|
||||
* @{
|
||||
*/
|
||||
|
||||
G_DECLARE_FINAL_TYPE(CairoRenderer, cairo_renderer, GDS_RENDER, CAIRO_RENDERER, GdsOutputRenderer)
|
||||
|
||||
#define GDS_RENDER_TYPE_CAIRO_RENDERER (cairo_renderer_get_type())
|
||||
|
||||
#define MAX_LAYERS (300) /**< \brief Maximum layer count the output renderer can process. Typically GDS only specifies up to 255 layers.*/
|
||||
|
||||
/**
|
||||
* @brief Render \p cell to a PDF file specified by \p pdf_file
|
||||
* @param cell Toplevel cell to @ref Cairo-Renderer
|
||||
* @param layer_infos List of layer information. Specifies color and layer stacking
|
||||
* @param pdf_file PDF output file. Set to NULL if no PDF file has to be generated
|
||||
* @param svg_file SVG output file. Set to NULL if no SVG file has to be generated
|
||||
* @param scale Scale the output image down by \p scale
|
||||
* @brief Create new CairoRenderer for SVG output
|
||||
* @return New object
|
||||
*/
|
||||
void cairo_render_cell_to_vector_file(struct gds_cell *cell, GList *layer_infos, char *pdf_file, char *svg_file, double scale);
|
||||
CairoRenderer *cairo_renderer_new_svg();
|
||||
|
||||
|
||||
/**
|
||||
* @brief Create new CairoRenderer for PDF output
|
||||
* @return New object
|
||||
*/
|
||||
CairoRenderer *cairo_renderer_new_pdf();
|
||||
|
||||
/** @} */
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _CAIRO_OUTPUT_H_ */
|
@@ -24,35 +24,46 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup external-renderer
|
||||
* @addtogroup ExternalRenderer
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef _EXTERNAL_RENDERER_H_
|
||||
#define _EXTERNAL_RENDERER_H_
|
||||
|
||||
#include <gds-render/output-renderers/gds-output-renderer.h>
|
||||
#include <gds-render/gds-utils/gds-types.h>
|
||||
#include <glib.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDS_RENDER_TYPE_EXTERNAL_RENDERER (external_renderer_get_type())
|
||||
|
||||
G_DECLARE_FINAL_TYPE(ExternalRenderer, external_renderer, GDS_RENDER, EXTERNAL_RENDERER, GdsOutputRenderer)
|
||||
|
||||
/**
|
||||
* @brief function name expected to be found in external library.
|
||||
*
|
||||
* The function has to be defined as follows:
|
||||
* @code
|
||||
* int function_name(gds_cell *toplevel, GList *layer_info_list, char *output_file_name)
|
||||
* int EXTERNAL_LIBRARY_FUNCTION(gds_cell *toplevel, GList *layer_info_list, const char *output_file_name, double scale)
|
||||
* @endcode
|
||||
*/
|
||||
#define EXTERNAL_LIBRARY_FUNCTION "render_cell_to_file"
|
||||
|
||||
/**
|
||||
* @brief external_renderer_render_cell
|
||||
* @param toplevel_cell The toplevel cell to render
|
||||
* @param layer_info_list The layer information. Contains #layer_info elements
|
||||
* @param output_file Output file
|
||||
* @param so_path Path to the shared object file containing #EXTERNAL_LIBRARY_FUNCTION
|
||||
* @return 0 on success
|
||||
* @brief Create new ExternalRenderer object
|
||||
* @return New object
|
||||
*/
|
||||
int external_renderer_render_cell(struct gds_cell *toplevel_cell, GList *layer_info_list, char *output_file, char *so_path);
|
||||
ExternalRenderer *external_renderer_new();
|
||||
|
||||
/**
|
||||
* @brief Create new ExternalRenderer object with specified shared object path
|
||||
* @param so_path Path to shared object, the rendering function is searched in
|
||||
* @return New object.
|
||||
*/
|
||||
ExternalRenderer *external_renderer_new_with_so(const char *so_path);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _EXTERNAL_RENDERER_H_ */
|
||||
|
92
include/gds-render/output-renderers/gds-output-renderer.h
Normal file
92
include/gds-render/output-renderers/gds-output-renderer.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* GDSII-Converter
|
||||
* Copyright (C) 2018 Mario Hüttel <mario.huettel@gmx.net>
|
||||
*
|
||||
* This file is part of GDSII-Converter.
|
||||
*
|
||||
* GDSII-Converter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* GDSII-Converter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GDSII-Converter. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file gds-output-renderer.h
|
||||
* @brief Header for output renderer base class
|
||||
* @author Mario Hüttel <mario.huettel@gmx.net>
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup GdsOutputRenderer
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef _GDS_OUTPUT_RENDERER_H_
|
||||
#define _GDS_OUTPUT_RENDERER_H_
|
||||
|
||||
#include <gds-render/gds-utils/gds-types.h>
|
||||
#include <glib-object.h>
|
||||
#include <glib.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDS_RENDER_TYPE_OUTPUT_RENDERER (gds_output_renderer_get_type())
|
||||
|
||||
G_DECLARE_DERIVABLE_TYPE(GdsOutputRenderer, gds_output_renderer, GDS_RENDER, OUTPUT_RENDERER, GObject);
|
||||
|
||||
/**
|
||||
* @brief Base output renderer class structure.
|
||||
* @note This structure is only used for internal inheritance of GObjects. Do not use in code outside of these classes.
|
||||
*/
|
||||
struct _GdsOutputRendererClass {
|
||||
GObjectClass parent_class;
|
||||
|
||||
/**
|
||||
* @brief Virtual render output function. Overwritten by final class implementation
|
||||
*/
|
||||
int (*render_output)(GdsOutputRenderer *renderer,
|
||||
struct gds_cell *cell,
|
||||
GList *layer_infos,
|
||||
const char *output_file,
|
||||
double scale);
|
||||
gpointer padding[4];
|
||||
};
|
||||
|
||||
enum {
|
||||
GDS_OUTPUT_RENDERER_GEN_ERR = -100, /**< @brief Error set by the _GdsOutputRendererClass::render_output virtual function, if renderer is invalid. */
|
||||
GDS_OUTPUT_RENDERER_PARAM_ERR = -200 /**< @brief Error set by the _GdsOutputRendererClass::render_output virtual function, if parameters are faulty. */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Create a new GdsOutputRenderer GObject.
|
||||
* @return New object
|
||||
*/
|
||||
GdsOutputRenderer *gds_output_renderer_new();
|
||||
|
||||
/**
|
||||
* @brief gds_output_renderer_render_output
|
||||
* @param renderer Renderer object
|
||||
* @param cell Cell to render
|
||||
* @param layer_infos List of Layer information (@ref layer_info)
|
||||
* @param output_file Output file name
|
||||
* @param scale scale value. The output is scaled *down* by this value
|
||||
* @return 0 if successful
|
||||
*/
|
||||
int gds_output_renderer_render_output(GdsOutputRenderer *renderer,
|
||||
struct gds_cell *cell,
|
||||
GList *layer_infos,
|
||||
const char *output_file,
|
||||
double scale);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _GDS_OUTPUT_RENDERER_H_ */
|
||||
|
||||
/** @} */
|
74
include/gds-render/output-renderers/latex-renderer.h
Normal file
74
include/gds-render/output-renderers/latex-renderer.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* GDSII-Converter
|
||||
* Copyright (C) 2018 Mario Hüttel <mario.huettel@gmx.net>
|
||||
*
|
||||
* This file is part of GDSII-Converter.
|
||||
*
|
||||
* GDSII-Converter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* GDSII-Converter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GDSII-Converter. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file latex-output.h
|
||||
* @brief LaTeX output renderer
|
||||
* @author Mario Hüttel <mario.huettel@gmx.net>
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup LaTeX-Renderer
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef _LATEX_OUTPUT_H_
|
||||
#define _LATEX_OUTPUT_H_
|
||||
|
||||
#include <gds-render/output-renderers/gds-output-renderer.h>
|
||||
#include <gds-render/gds-utils/gds-types.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_DECLARE_FINAL_TYPE(LatexRenderer, latex_renderer, GDS_RENDER, LATEX_RENDERER, GdsOutputRenderer)
|
||||
|
||||
#define GDS_RENDER_TYPE_LATEX_RENDERER (latex_renderer_get_type())
|
||||
|
||||
/**
|
||||
* @brief Buffer for LaTeX Code line in KiB
|
||||
*/
|
||||
#define LATEX_LINE_BUFFER_KB (10)
|
||||
|
||||
/**
|
||||
* @brief Create new LatexRenderer object
|
||||
* @return New object
|
||||
*/
|
||||
LatexRenderer *latex_renderer_new();
|
||||
|
||||
/**
|
||||
* @brief Create new LatexRenderer object
|
||||
*
|
||||
* This function sets the 'pdf-layers' and 'standalone'
|
||||
* properties for the newly created object.
|
||||
*
|
||||
* They can later be changes by modifying the properties again.
|
||||
* On top of that, The options can be changed in the resulting
|
||||
* LaTeX output file if needed.
|
||||
*
|
||||
* @param pdf_layers If PDF OCR layers should be enabled
|
||||
* @param standalone If output TeX file should be standalone compilable
|
||||
* @return New object
|
||||
*/
|
||||
LatexRenderer *latex_renderer_new_with_options(gboolean pdf_layers, gboolean standalone);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _LATEX_OUTPUT_H_ */
|
||||
|
||||
/** @} */
|
60
include/gds-render/widgets/activity-bar.h
Normal file
60
include/gds-render/widgets/activity-bar.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* GDSII-Converter
|
||||
* Copyright (C) 2019 Mario Hüttel <mario.huettel@gmx.net>
|
||||
*
|
||||
* This file is part of GDSII-Converter.
|
||||
*
|
||||
* GDSII-Converter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* GDSII-Converter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GDSII-Converter. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file activity-bar.h
|
||||
* @brief Header file for activity bar widget
|
||||
* @author Mario Hüttel <mario.huettel@gmx.net>
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup ActivityBar
|
||||
* @ingroup Widgets
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef __LAYER_ELEMENT_H__
|
||||
#define __LAYER_ELEMENT_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* Creates Class structure etc */
|
||||
G_DECLARE_FINAL_TYPE(ActivityBar, activity_bar, ACTIVITY, BAR, GtkBox)
|
||||
|
||||
#define TYPE_ACTIVITY_BAR (activity_bar_get_type())
|
||||
|
||||
/**
|
||||
* @brief Create new Object ActivityBar
|
||||
* @return New object. In case of error: NULL.
|
||||
*/
|
||||
ActivityBar *activity_bar_new();
|
||||
|
||||
/**
|
||||
* @brief Deletes all applied tasks and sets bar to "Ready".
|
||||
* @param[in] bar AcitivityBar object.
|
||||
*/
|
||||
void activity_bar_set_ready(ActivityBar *bar);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __LAYER_ELEMENT_H__ */
|
||||
|
||||
/** @} */
|
@@ -19,7 +19,7 @@
|
||||
|
||||
/**
|
||||
* @file layer-element.h
|
||||
* @brief Omplementation of the layer element used for configuring layer colors etc.
|
||||
* @brief Implementation of the layer element used for configuring layer colors etc.
|
||||
* @author Mario Hüttel <mario.huettel@gmx.net>
|
||||
*/
|
||||
|
||||
|
241
layer/color-palette.c
Normal file
241
layer/color-palette.c
Normal file
@@ -0,0 +1,241 @@
|
||||
/*
|
||||
* GDSII-Converter
|
||||
* Copyright (C) 2019 Mario Hüttel <mario.huettel@gmx.net>
|
||||
*
|
||||
* This file is part of GDSII-Converter.
|
||||
*
|
||||
* GDSII-Converter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* GDSII-Converter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GDSII-Converter. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file color-palette.c
|
||||
* @brief Class representing a color palette
|
||||
* @author Mario Hüttel <mario.huettel@gmx.net>
|
||||
*/
|
||||
|
||||
#include <gds-render/layer/color-palette.h>
|
||||
|
||||
struct _ColorPalette {
|
||||
/* Inheritance */
|
||||
GObject parent;
|
||||
|
||||
/* Custom fields */
|
||||
/** @brief The internal array to store the colors */
|
||||
GdkRGBA *color_array;
|
||||
/** @brief The length of the _ColorPalette::color_array array */
|
||||
unsigned int color_array_length;
|
||||
|
||||
gpointer dummy[4];
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE(ColorPalette, color_palette, G_TYPE_OBJECT)
|
||||
|
||||
/**
|
||||
* @brief Return the number of non empty lines in array
|
||||
*
|
||||
* This function returns the number of non empty lines in an
|
||||
* array. The scanning is either terminated by the given length
|
||||
* or if a \0 terminator is found.
|
||||
*
|
||||
* @param[in] data Array to count lines in
|
||||
* @param[in] length Length of \p data
|
||||
* @return < 0: Error, >=0: Lines
|
||||
*/
|
||||
static int count_non_empty_lines_in_array(const char *data, size_t length)
|
||||
{
|
||||
unsigned int idx;
|
||||
int non_empty_lines;
|
||||
char last_char = '\n';
|
||||
|
||||
if (!data)
|
||||
return -1;
|
||||
|
||||
/* Count each '\n' as a new line if it is not directly preceded by another '\n' */
|
||||
for (idx = 0; idx < length && data[idx]; idx++) {
|
||||
if (data[idx] == '\n' && last_char != '\n')
|
||||
non_empty_lines++;
|
||||
last_char = data[idx];
|
||||
}
|
||||
|
||||
/* Count the last line in case the data does not end with a '\n' */
|
||||
if (data[idx-1] != '\n')
|
||||
non_empty_lines++;
|
||||
|
||||
return non_empty_lines;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief color_palette_fill_with_resource
|
||||
* @param palette
|
||||
* @param resource_name
|
||||
* @return 0 if successful
|
||||
*/
|
||||
static int color_palette_fill_with_resource(ColorPalette *palette, char *resource_name)
|
||||
{
|
||||
GBytes *data;
|
||||
char line[10];
|
||||
int line_idx;
|
||||
unsigned int color_idx;
|
||||
int idx;
|
||||
const char *char_array;
|
||||
gsize byte_count;
|
||||
int lines;
|
||||
GRegex *regex;
|
||||
GMatchInfo *mi;
|
||||
char *match;
|
||||
|
||||
if (!palette || !resource_name)
|
||||
return -1;
|
||||
|
||||
data = g_resources_lookup_data(resource_name, 0, NULL);
|
||||
|
||||
if (!data)
|
||||
return -2;
|
||||
|
||||
char_array = (const char *)g_bytes_get_data(data, &byte_count);
|
||||
|
||||
if (!char_array || !byte_count)
|
||||
goto ret_unref;
|
||||
|
||||
/* Get maximum lenght of color palette, assuming all entries are valid */
|
||||
lines = count_non_empty_lines_in_array(char_array, byte_count);
|
||||
|
||||
if (lines <= 0)
|
||||
goto ret_unref;
|
||||
|
||||
palette->color_array = (GdkRGBA *)malloc(sizeof(GdkRGBA) * (unsigned int)lines);
|
||||
|
||||
/* Setup regex for hexadecimal RGB colors like 'A0CB3F' */
|
||||
regex = g_regex_new("^(?<red>[0-9A-Fa-f][0-9A-Fa-f])(?<green>[0-9A-Fa-f][0-9A-Fa-f])(?<blue>[0-9A-Fa-f][0-9A-Fa-f])$", 0, 0, NULL);
|
||||
|
||||
|
||||
/* Reset line */
|
||||
line_idx = 0;
|
||||
line[0] = '\0';
|
||||
|
||||
/* Set color index */
|
||||
color_idx = 0;
|
||||
|
||||
/* interate over lines and match */
|
||||
for (idx = 0 ; idx < byte_count; idx++) {
|
||||
/* Fillup line. */
|
||||
line[line_idx] = char_array[idx];
|
||||
|
||||
|
||||
/* If end of line/string is reached, process */
|
||||
if (line[line_idx] == '\n' || line[line_idx] == '\0') {
|
||||
line[line_idx] = '\0';
|
||||
|
||||
/* Match the line */
|
||||
g_regex_match(regex, line, 0, &mi);
|
||||
if (g_match_info_matches(mi) && color_idx < lines) {
|
||||
match = g_match_info_fetch_named(mi, "red");
|
||||
palette->color_array[color_idx].red = (double)g_ascii_strtoll(match, NULL, 16) / 255.0;
|
||||
g_free(match);
|
||||
match = g_match_info_fetch_named(mi, "green");
|
||||
palette->color_array[color_idx].green = (double)g_ascii_strtoll(match, NULL, 16) / 255.0;
|
||||
g_free(match);
|
||||
match = g_match_info_fetch_named(mi, "blue");
|
||||
palette->color_array[color_idx].blue = (double)g_ascii_strtoll(match, NULL, 16) / 255.0;
|
||||
g_free(match);
|
||||
|
||||
/* Only RGB supported so far. Fix alpha channel to 1.0 */
|
||||
palette->color_array[color_idx].alpha = 1.0;
|
||||
|
||||
color_idx++;
|
||||
}
|
||||
|
||||
g_match_info_free(mi);
|
||||
|
||||
/* End of string */
|
||||
if (char_array[idx] == '\0')
|
||||
break;
|
||||
|
||||
line_idx = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* increment line index. If end is reached write all bytes to the line end
|
||||
* line is longer than required for parsing. This ensures, that everything works as expected
|
||||
*/
|
||||
line_idx += (line_idx < sizeof(line)-1 ? 1 : 0);
|
||||
}
|
||||
|
||||
/* Data read; Shrink array in case of invalid lines */
|
||||
palette->color_array = realloc(palette->color_array, (size_t)color_idx * sizeof(GdkRGBA));
|
||||
palette->color_array_length = color_idx;
|
||||
|
||||
g_regex_unref(regex);
|
||||
ret_unref:
|
||||
g_bytes_unref(data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
ColorPalette *color_palette_new_from_resource(char *resource_name)
|
||||
{
|
||||
ColorPalette *palette;
|
||||
|
||||
palette = GDS_RENDER_COLOR_PALETTE(g_object_new(TYPE_GDS_RENDER_COLOR_PALETTE, NULL));
|
||||
if (palette)
|
||||
(void)color_palette_fill_with_resource(palette, resource_name);
|
||||
|
||||
return palette;
|
||||
}
|
||||
|
||||
GdkRGBA *color_palette_get_color(ColorPalette *palette, GdkRGBA *color, unsigned int index)
|
||||
{
|
||||
GdkRGBA *c = NULL;
|
||||
|
||||
if (!palette)
|
||||
goto ret_c;
|
||||
|
||||
if (index >= palette->color_array_length)
|
||||
goto ret_c;
|
||||
|
||||
if (color)
|
||||
c = color;
|
||||
else
|
||||
c = (GdkRGBA *)malloc(sizeof(GdkRGBA));
|
||||
|
||||
/* Copy color */
|
||||
c->red = palette->color_array[index].red;
|
||||
c->green = palette->color_array[index].green;
|
||||
c->blue = palette->color_array[index].blue;
|
||||
c->alpha = palette->color_array[index].alpha;
|
||||
ret_c:
|
||||
return c;
|
||||
}
|
||||
|
||||
unsigned int color_palette_get_color_count(ColorPalette *palette)
|
||||
{
|
||||
unsigned int return_val = 0;
|
||||
|
||||
if (palette)
|
||||
return_val = palette->color_array_length;
|
||||
|
||||
return return_val;
|
||||
}
|
||||
|
||||
static void color_palette_class_init(ColorPaletteClass *klass)
|
||||
{
|
||||
(void)klass;
|
||||
/* Nothing to do for now */
|
||||
return;
|
||||
}
|
||||
|
||||
static void color_palette_init(ColorPalette *self)
|
||||
{
|
||||
self->color_array = NULL;
|
||||
self->color_array_length = 0;
|
||||
}
|
@@ -781,4 +781,44 @@ void layer_selector_force_sort(LayerSelector *selector, enum layer_selector_sort
|
||||
gtk_list_box_set_sort_func(box, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
void layer_selector_auto_color_layers(LayerSelector *layer_selector, ColorPalette *palette, double global_alpha)
|
||||
{
|
||||
GList *le_list;
|
||||
GList *le_list_ptr;
|
||||
LayerElement *le;
|
||||
unsigned int color_index = 0;
|
||||
unsigned int color_count;
|
||||
GdkRGBA color;
|
||||
|
||||
if (GDS_RENDER_IS_COLOR_PALETTE(palette) == FALSE || LAYER_IS_SELECTOR(layer_selector) == FALSE)
|
||||
return;
|
||||
if (global_alpha <= 0)
|
||||
return;
|
||||
if (GTK_IS_LIST_BOX(layer_selector->list_box) == FALSE)
|
||||
return;
|
||||
|
||||
le_list = gtk_container_get_children(GTK_CONTAINER(layer_selector->list_box));
|
||||
|
||||
/* iterate over layer elements and fill colors */
|
||||
color_index = 0;
|
||||
color_count = color_palette_get_color_count(palette);
|
||||
if (color_count == 0)
|
||||
goto ret_free_le_list;
|
||||
|
||||
for (le_list_ptr = le_list; le_list_ptr != NULL; le_list_ptr = le_list_ptr->next) {
|
||||
le = LAYER_ELEMENT(le_list_ptr->data);
|
||||
if (le) {
|
||||
color_palette_get_color(palette, &color, color_index++);
|
||||
color.alpha *= global_alpha;
|
||||
layer_element_set_color(le, &color);
|
||||
|
||||
if (color_index >= color_count)
|
||||
color_index = 0;
|
||||
}
|
||||
}
|
||||
|
||||
ret_free_le_list:
|
||||
g_list_free(le_list);
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
78
main.c
78
main.c
@@ -29,7 +29,7 @@
|
||||
|
||||
#include <gds-render/gds-render-gui.h>
|
||||
#include <gds-render/command-line.h>
|
||||
#include <gds-render/external-renderer.h>
|
||||
#include <gds-render/output-renderers/external-renderer.h>
|
||||
#include <gds-render/version.h>
|
||||
|
||||
/**
|
||||
@@ -90,13 +90,13 @@ static void app_about(GSimpleAction *action, GVariant *parameter, gpointer user_
|
||||
(void)action;
|
||||
(void)parameter;
|
||||
|
||||
builder = gtk_builder_new_from_resource("/about.glade");
|
||||
builder = gtk_builder_new_from_resource("/gui/about.glade");
|
||||
dialog = GTK_DIALOG(gtk_builder_get_object(builder, "about-dialog"));
|
||||
gtk_window_set_transient_for(GTK_WINDOW(dialog), NULL);
|
||||
gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(dialog), _app_version_string);
|
||||
|
||||
/* Load icon from resource */
|
||||
logo_buf = gdk_pixbuf_new_from_resource_at_scale("/logo.svg", 100, 100, TRUE, &error);
|
||||
logo_buf = gdk_pixbuf_new_from_resource_at_scale("/images/logo.svg", 100, 100, TRUE, &error);
|
||||
if (logo_buf) {
|
||||
/* Set logo */
|
||||
gtk_about_dialog_set_logo(GTK_ABOUT_DIALOG(dialog), logo_buf);
|
||||
@@ -241,29 +241,25 @@ int main(int argc, char **argv)
|
||||
GOptionContext *context;
|
||||
gchar *gds_name;
|
||||
gchar *basename;
|
||||
gchar *pdfname = NULL, *texname = NULL, *mappingname = NULL, *cellname = NULL, *svgname = NULL;
|
||||
gboolean tikz = FALSE, pdf = FALSE, pdf_layers = FALSE, pdf_standalone = FALSE, svg = FALSE;
|
||||
gboolean version = FALSE;
|
||||
gchar *output_path = NULL, *mappingname = NULL, *cellname = NULL;
|
||||
gchar *renderer_arg = NULL;
|
||||
gboolean version = FALSE, pdf_standalone = FALSE, pdf_layers = FALSE;
|
||||
gchar *custom_library_path = NULL;
|
||||
gchar *custom_library_file_name = NULL;
|
||||
int scale = 1000;
|
||||
int app_status = 0;
|
||||
enum command_line_renderer renderer = CMD_NONE;
|
||||
enum cmd_options opt = CMD_OPT_NONE;
|
||||
|
||||
GOptionEntry entries[] = {
|
||||
{"version", 'v', 0, G_OPTION_ARG_NONE, &version, "Print version", NULL},
|
||||
{"tikz", 't', 0, G_OPTION_ARG_NONE, &tikz, "Output TikZ code", NULL },
|
||||
{"pdf", 'p', 0, G_OPTION_ARG_NONE, &pdf, "Output PDF document", NULL },
|
||||
//{"svg", 'S', 0, G_OPTION_ARG_NONE, &svg, "Output SVG image", NULL },
|
||||
{"renderer", 'r', 0, G_OPTION_ARG_STRING, &renderer_arg, "Renderer to use", "pdf|svg|tikz|ext"},
|
||||
{"scale", 's', 0, G_OPTION_ARG_INT, &scale, "Divide output coordinates by <SCALE>", "<SCALE>" },
|
||||
{"tex-output", 'o', 0, G_OPTION_ARG_FILENAME, &texname, "Optional path for TeX file", "PATH" },
|
||||
{"pdf-output", 'O', 0, G_OPTION_ARG_FILENAME, &pdfname, "Optional path for PDF file", "PATH" },
|
||||
//{"svg-output", 0, 0, G_OPTION_ARG_FILENAME, &svgname, "Optional path for PDF file", "PATH"},
|
||||
{"output-file", 'o', 0, G_OPTION_ARG_FILENAME, &output_path, "Output file path", "PATH" },
|
||||
{"mapping", 'm', 0, G_OPTION_ARG_FILENAME, &mappingname, "Path for Layer Mapping File", "PATH" },
|
||||
{"cell", 'c', 0, G_OPTION_ARG_STRING, &cellname, "Cell to render", "NAME" },
|
||||
{"tex-standalone", 'a', 0, G_OPTION_ARG_NONE, &pdf_standalone, "Create standalone PDF", NULL },
|
||||
{"tex-layers", 'l', 0, G_OPTION_ARG_NONE, &pdf_layers, "Create PDF Layers (OCG)", NULL },
|
||||
{"custom-render-lib", 'P', 0, G_OPTION_ARG_FILENAME, &custom_library_path, "Path to a custom shared object, that implements the " EXTERNAL_LIBRARY_FUNCTION " function", "PATH"},
|
||||
{"external-lib-output", 'e', 0, G_OPTION_ARG_FILENAME, &custom_library_file_name, "Output path for external render library", "PATH"},
|
||||
{NULL}
|
||||
};
|
||||
|
||||
@@ -287,9 +283,6 @@ int main(int argc, char **argv)
|
||||
scale = 1;
|
||||
}
|
||||
|
||||
/* No format selected */
|
||||
if (!(tikz || pdf || svg))
|
||||
tikz = TRUE;
|
||||
|
||||
/* Get gds name */
|
||||
gds_name = argv[1];
|
||||
@@ -302,29 +295,50 @@ int main(int argc, char **argv)
|
||||
/* Check if PDF/TeX names are supplied. if not generate */
|
||||
basename = g_path_get_basename(gds_name);
|
||||
|
||||
if (!texname)
|
||||
texname = g_strdup_printf("./%s.tex", basename);
|
||||
if (!strcmp(renderer_arg, "pdf")) {
|
||||
renderer = CMD_CAIRO_PDF;
|
||||
if (!output_path)
|
||||
output_path = g_strdup_printf("./%s.pdf", basename);
|
||||
}
|
||||
else if (!strcmp(renderer_arg, "svg")) {
|
||||
renderer = CMD_NONE; // To buggy atm CMD_CAIRO_SVG;
|
||||
if (!output_path)
|
||||
output_path = g_strdup_printf("./%s.svg", basename);
|
||||
} else if (!strcmp(renderer_arg, "tikz")) {
|
||||
renderer = CMD_LATEX;
|
||||
if (pdf_layers)
|
||||
opt |= CMD_OPT_LATEX_LAYERS;
|
||||
if (pdf_standalone)
|
||||
opt |= CMD_OPT_LATEX_STANDALONE;
|
||||
if (!output_path)
|
||||
output_path = g_strdup_printf("./%s.tex", basename);
|
||||
} else if (!strcmp(renderer_arg, "ext")) {
|
||||
renderer = CMD_EXTERNAL;
|
||||
} else {
|
||||
fprintf(stderr, "No valid renderer specified\n");
|
||||
}
|
||||
|
||||
if (!pdfname)
|
||||
pdfname = g_strdup_printf("./%s.pdf", basename);
|
||||
if (basename)
|
||||
g_free(basename);
|
||||
|
||||
if (!svgname)
|
||||
svgname = g_strdup_printf("./%s.svg", basename);
|
||||
if (!output_path || strlen(output_path) == 0) {
|
||||
app_status = -2;
|
||||
goto ret_free_renderer;
|
||||
}
|
||||
|
||||
command_line_convert_gds(gds_name, pdfname, texname, pdf, tikz,
|
||||
mappingname, cellname, (double)scale,
|
||||
pdf_layers, pdf_standalone, svg, svgname,
|
||||
custom_library_path, custom_library_file_name);
|
||||
command_line_convert_gds(gds_name, cellname, output_path, mappingname, custom_library_path, renderer, opt, scale);
|
||||
/* Clean up */
|
||||
g_free(pdfname);
|
||||
g_free(texname);
|
||||
g_free(svgname);
|
||||
g_free(basename);
|
||||
app_status = 0;
|
||||
|
||||
ret_free_renderer:
|
||||
if (output_path)
|
||||
g_free(output_path);
|
||||
if (renderer_arg)
|
||||
g_free(renderer_arg);
|
||||
if (mappingname)
|
||||
g_free(mappingname);
|
||||
if (cellname)
|
||||
g_free(cellname);
|
||||
app_status = 0;
|
||||
} else {
|
||||
app_status = start_gui(argc, argv);
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@
|
||||
* @author Mario Hüttel <mario.huettel@gmx.net>
|
||||
*/
|
||||
|
||||
/** @addtogroup Cairo-Renderer
|
||||
/** @addtogroup CairoRenderer
|
||||
* @{
|
||||
*/
|
||||
|
||||
@@ -32,7 +32,16 @@
|
||||
#include <cairo-pdf.h>
|
||||
#include <cairo-svg.h>
|
||||
|
||||
#include <gds-render/cairo-renderer/cairo-output.h>
|
||||
#include <gds-render/output-renderers/cairo-renderer.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
|
||||
struct _CairoRenderer {
|
||||
GdsOutputRenderer parent;
|
||||
gboolean svg; /**< @brief TRUE: SVG output, FALSE: PDF output */
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE(CairoRenderer, cairo_renderer, GDS_RENDER_TYPE_OUTPUT_RENDERER)
|
||||
|
||||
/**
|
||||
* @brief The cairo_layer struct
|
||||
@@ -179,10 +188,20 @@ static void render_cell(struct gds_cell *cell, struct cairo_layer *layers, doubl
|
||||
|
||||
}
|
||||
|
||||
void cairo_render_cell_to_vector_file(struct gds_cell *cell, GList *layer_infos, char *pdf_file, char *svg_file, double scale)
|
||||
/**
|
||||
* @brief Render \p cell to a PDF file specified by \p pdf_file
|
||||
* @param cell Toplevel cell to @ref Cairo-Renderer
|
||||
* @param layer_infos List of layer information. Specifies color and layer stacking
|
||||
* @param pdf_file PDF output file. Set to NULL if no PDF file has to be generated
|
||||
* @param svg_file SVG output file. Set to NULL if no SVG file has to be generated
|
||||
* @param scale Scale the output image down by \p scale
|
||||
* @return Error
|
||||
*/
|
||||
static int cairo_renderer_render_cell_to_vector_file(struct gds_cell *cell, GList *layer_infos, const char *pdf_file,
|
||||
const char *svg_file, double scale)
|
||||
{
|
||||
cairo_surface_t *pdf_surface, *svg_surface;
|
||||
cairo_t *pdf_cr, *svg_cr;
|
||||
cairo_surface_t *pdf_surface = NULL, *svg_surface = NULL;
|
||||
cairo_t *pdf_cr = NULL, *svg_cr = NULL;
|
||||
struct layer_info *linfo;
|
||||
struct cairo_layer *layers;
|
||||
struct cairo_layer *lay;
|
||||
@@ -190,10 +209,24 @@ void cairo_render_cell_to_vector_file(struct gds_cell *cell, GList *layer_infos,
|
||||
int i;
|
||||
double rec_x0, rec_y0, rec_width, rec_height;
|
||||
double xmin = INT32_MAX, xmax = INT32_MIN, ymin = INT32_MAX, ymax = INT32_MIN;
|
||||
pid_t process_id;
|
||||
|
||||
if (pdf_file == NULL && svg_file == NULL) {
|
||||
/* No output specified */
|
||||
return;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Fork to a new child process. This ensures the memory leaks (see issue #16) in Cairo don't
|
||||
* brick everything.
|
||||
*
|
||||
* And by the way: This now bricks all Windows compatibility. Deal with it.
|
||||
*/
|
||||
process_id = fork();
|
||||
if (process_id < 0) {
|
||||
/* Well... shit... We have to run it in our process. */
|
||||
} else if (process_id > 0) {
|
||||
/* Woohoo... Successfully dumped the shitty code to an unknowing victim */
|
||||
goto ret_parent;
|
||||
}
|
||||
|
||||
layers = (struct cairo_layer *)calloc(MAX_LAYERS, sizeof(struct cairo_layer));
|
||||
@@ -276,16 +309,15 @@ void cairo_render_cell_to_vector_file(struct gds_cell *cell, GList *layer_infos,
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pdf_file) {
|
||||
if (pdf_file && pdf_cr) {
|
||||
cairo_set_source_surface(pdf_cr, layers[linfo->layer].rec, -xmin, -ymin);
|
||||
cairo_paint_with_alpha(pdf_cr, linfo->color.alpha);
|
||||
}
|
||||
|
||||
if (svg_file) {
|
||||
if (svg_file && svg_cr) {
|
||||
cairo_set_source_surface(svg_cr, layers[linfo->layer].rec, -xmin, -ymin);
|
||||
cairo_paint_with_alpha(svg_cr, linfo->color.alpha);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (pdf_file) {
|
||||
@@ -310,7 +342,71 @@ ret_clear_layers:
|
||||
}
|
||||
free(layers);
|
||||
|
||||
printf("cairo export finished. It might still be buggy!\n");
|
||||
printf("Cairo export finished. It might still be buggy!\n");
|
||||
|
||||
/* If forked, suspend process */
|
||||
if (process_id == 0)
|
||||
exit(0);
|
||||
|
||||
/* Fork didn't work. Just return here */
|
||||
return 0;
|
||||
ret_parent:
|
||||
waitpid(process_id, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void cairo_renderer_init(CairoRenderer *self)
|
||||
{
|
||||
/* PDF default */
|
||||
self->svg = FALSE;
|
||||
}
|
||||
|
||||
static int cairo_renderer_render_output(GdsOutputRenderer *renderer,
|
||||
struct gds_cell *cell,
|
||||
GList *layer_infos,
|
||||
const char *output_file,
|
||||
double scale)
|
||||
{
|
||||
CairoRenderer *c_renderer = GDS_RENDER_CAIRO_RENDERER(renderer);
|
||||
const char *pdf_file = NULL;
|
||||
const char *svg_file = NULL;
|
||||
|
||||
if (!c_renderer)
|
||||
return -2000;
|
||||
|
||||
if (c_renderer->svg == TRUE)
|
||||
svg_file = output_file;
|
||||
else
|
||||
pdf_file = output_file;
|
||||
|
||||
return cairo_renderer_render_cell_to_vector_file(cell, layer_infos, pdf_file, svg_file, scale);
|
||||
}
|
||||
|
||||
static void cairo_renderer_class_init(CairoRendererClass *klass)
|
||||
{
|
||||
GdsOutputRendererClass *renderer_class = GDS_RENDER_OUTPUT_RENDERER_CLASS(klass);
|
||||
|
||||
renderer_class->render_output = cairo_renderer_render_output;
|
||||
}
|
||||
|
||||
CairoRenderer *cairo_renderer_new_pdf()
|
||||
{
|
||||
CairoRenderer *renderer;
|
||||
|
||||
renderer = GDS_RENDER_CAIRO_RENDERER(g_object_new(GDS_RENDER_TYPE_CAIRO_RENDERER, NULL));
|
||||
renderer->svg = FALSE;
|
||||
|
||||
return renderer;
|
||||
}
|
||||
|
||||
CairoRenderer *cairo_renderer_new_svg()
|
||||
{
|
||||
CairoRenderer *renderer;
|
||||
|
||||
renderer = GDS_RENDER_CAIRO_RENDERER(g_object_new(GDS_RENDER_TYPE_CAIRO_RENDERER, NULL));
|
||||
renderer->svg = TRUE;
|
||||
|
||||
return renderer;
|
||||
}
|
||||
|
||||
/** @} */
|
200
output-renderers/external-renderer.c
Normal file
200
output-renderers/external-renderer.c
Normal file
@@ -0,0 +1,200 @@
|
||||
/*
|
||||
* GDSII-Converter
|
||||
* Copyright (C) 2018 Mario Hüttel <mario.huettel@gmx.net>
|
||||
*
|
||||
* This file is part of GDSII-Converter.
|
||||
*
|
||||
* GDSII-Converter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* GDSII-Converter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GDSII-Converter. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file external-renderer.c
|
||||
* @brief This file implements the dynamic library loading for the external rendering feature
|
||||
* @author Mario Hüttel <mario.huettel@gmx.net>
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup ExternalRenderer
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <gds-render/output-renderers/external-renderer.h>
|
||||
|
||||
struct _ExternalRenderer {
|
||||
GdsOutputRenderer parent;
|
||||
char *shared_object_path;
|
||||
};
|
||||
|
||||
enum {
|
||||
PROP_SO_PATH = 1, /**< @brief Shared object path property */
|
||||
N_PROPERTIES /**< @brief Used to get property count */
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE(ExternalRenderer, external_renderer, GDS_RENDER_TYPE_OUTPUT_RENDERER)
|
||||
|
||||
/**
|
||||
* @brief Execute render function in shared object to render the supplied cell
|
||||
* @param toplevel_cell Cell to render
|
||||
* @param layer_info_list Layer information (Color etc.)
|
||||
* @param output_file Destination file
|
||||
* @param so_path Path to shared object
|
||||
* @return 0 if successful
|
||||
*/
|
||||
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)
|
||||
{
|
||||
int (*so_render_func)(struct gds_cell *, GList *, const char *, double) = NULL;
|
||||
void *so_handle = NULL;
|
||||
char *error_msg;
|
||||
int ret = 0;
|
||||
|
||||
if (!so_path) {
|
||||
g_error("Path to shared object not set!");
|
||||
return -3000;
|
||||
}
|
||||
|
||||
/* Check parameter sanity */
|
||||
if (!output_file || !toplevel_cell || !layer_info_list)
|
||||
return -3000;
|
||||
|
||||
/* Load shared object */
|
||||
so_handle = dlopen(so_path, RTLD_LAZY);
|
||||
if (!so_handle) {
|
||||
g_error("Could not load external library '%s'\nDetailed error is:\n%s", so_path, dlerror());
|
||||
return -2000;
|
||||
}
|
||||
|
||||
/* Load symbol from library */
|
||||
so_render_func = (int (*)(struct gds_cell *, GList *, const char *, double))dlsym(so_handle, EXTERNAL_LIBRARY_FUNCTION);
|
||||
error_msg = dlerror();
|
||||
if (error_msg != NULL) {
|
||||
g_error("Rendering function not found in library:\n%s\n", error_msg);
|
||||
goto ret_close_so_handle;
|
||||
}
|
||||
|
||||
/* Execute */
|
||||
if (so_render_func) {
|
||||
g_message("Calling external renderer.");
|
||||
ret = so_render_func(toplevel_cell, layer_info_list, output_file, scale);
|
||||
g_message("External renderer finished.");
|
||||
}
|
||||
|
||||
ret_close_so_handle:
|
||||
dlclose(so_handle);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int external_renderer_render_output(GdsOutputRenderer *renderer,
|
||||
struct gds_cell *cell,
|
||||
GList *layer_infos,
|
||||
const char *output_file,
|
||||
double scale)
|
||||
{
|
||||
ExternalRenderer *ext_renderer = GDS_RENDER_EXTERNAL_RENDERER(renderer);
|
||||
|
||||
return external_renderer_render_cell(cell, layer_infos, output_file, scale, ext_renderer->shared_object_path);
|
||||
}
|
||||
|
||||
static void external_renderer_get_property(GObject *obj, guint property_id, GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
ExternalRenderer *self;
|
||||
|
||||
self = GDS_RENDER_EXTERNAL_RENDERER(obj);
|
||||
|
||||
switch (property_id) {
|
||||
case PROP_SO_PATH:
|
||||
g_value_set_string(value, self->shared_object_path);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, property_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void external_renderer_set_property(GObject *obj, guint property_id, const GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
ExternalRenderer *self;
|
||||
|
||||
self = GDS_RENDER_EXTERNAL_RENDERER(obj);
|
||||
|
||||
switch (property_id) {
|
||||
case PROP_SO_PATH:
|
||||
if (self->shared_object_path)
|
||||
g_free(self->shared_object_path);
|
||||
self->shared_object_path = g_value_dup_string(value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, property_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void external_renderer_dispose(GObject *self_obj)
|
||||
{
|
||||
ExternalRenderer *self = GDS_RENDER_EXTERNAL_RENDERER(self_obj);
|
||||
|
||||
if (self->shared_object_path) {
|
||||
g_free(self->shared_object_path);
|
||||
self->shared_object_path = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS(external_renderer_parent_class)->dispose(G_OBJECT(self));
|
||||
}
|
||||
|
||||
static GParamSpec *external_renderer_properties[N_PROPERTIES] = {NULL};
|
||||
|
||||
static void external_renderer_class_init(ExternalRendererClass *klass)
|
||||
{
|
||||
GdsOutputRendererClass *inherited_parent_class;
|
||||
GObjectClass *oclass;
|
||||
|
||||
inherited_parent_class = GDS_RENDER_OUTPUT_RENDERER_CLASS(klass);
|
||||
oclass = G_OBJECT_CLASS(klass);
|
||||
|
||||
/* Override virtual function */
|
||||
inherited_parent_class->render_output = external_renderer_render_output;
|
||||
|
||||
/* Setup Gobject callbacks */
|
||||
oclass->set_property = external_renderer_set_property;
|
||||
oclass->get_property = external_renderer_get_property;
|
||||
oclass->dispose = external_renderer_dispose;
|
||||
|
||||
/* Setup properties */
|
||||
external_renderer_properties[PROP_SO_PATH] =
|
||||
g_param_spec_string("shared-object-path",
|
||||
"Shared object file path",
|
||||
"Path to the shared object to search rendering function in.",
|
||||
NULL,
|
||||
G_PARAM_READWRITE);
|
||||
g_object_class_install_properties(oclass, N_PROPERTIES, external_renderer_properties);
|
||||
}
|
||||
|
||||
static void external_renderer_init(ExternalRenderer *self)
|
||||
{
|
||||
self->shared_object_path = NULL;
|
||||
}
|
||||
|
||||
ExternalRenderer *external_renderer_new()
|
||||
{
|
||||
return g_object_new(GDS_RENDER_TYPE_EXTERNAL_RENDERER, NULL);
|
||||
}
|
||||
|
||||
ExternalRenderer *external_renderer_new_with_so(const char *so_path)
|
||||
{
|
||||
return g_object_new(GDS_RENDER_TYPE_EXTERNAL_RENDERER, "shared-object-path", so_path, NULL);
|
||||
}
|
||||
|
||||
/** @} */
|
98
output-renderers/gds-output-renderer.c
Normal file
98
output-renderers/gds-output-renderer.c
Normal file
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* GDSII-Converter
|
||||
* Copyright (C) 2019 Mario Hüttel <mario.huettel@gmx.net>
|
||||
*
|
||||
* This file is part of GDSII-Converter.
|
||||
*
|
||||
* GDSII-Converter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* GDSII-Converter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GDSII-Converter. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file gds-output-renderer.c
|
||||
* @brief Base GObject class for output renderers
|
||||
*
|
||||
* All output renderers are derived from this class
|
||||
*
|
||||
* @author Mario Hüttel <mario.huettel@gmx.net>
|
||||
*/
|
||||
|
||||
/** @addtogroup GdsOutputRenderer
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <gds-render/output-renderers/gds-output-renderer.h>
|
||||
|
||||
typedef struct {
|
||||
gpointer padding[12];
|
||||
} GdsOutputRendererPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GdsOutputRenderer, gds_output_renderer, G_TYPE_OBJECT)
|
||||
|
||||
static int gds_output_renderer_render_dummy(GdsOutputRenderer *renderer,
|
||||
struct gds_cell *cell,
|
||||
GList *layer_infos,
|
||||
const char *output_file,
|
||||
double scale)
|
||||
{
|
||||
(void)renderer;
|
||||
(void)cell;
|
||||
(void)layer_infos;
|
||||
(void)output_file;
|
||||
(void)scale;
|
||||
|
||||
g_warning("Output renderer does not define a render_output function!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void gds_output_renderer_class_init(GdsOutputRendererClass *klass)
|
||||
{
|
||||
klass->render_output = gds_output_renderer_render_dummy;
|
||||
}
|
||||
|
||||
void gds_output_renderer_init(GdsOutputRenderer *self)
|
||||
{
|
||||
(void)self;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
GdsOutputRenderer *gds_output_renderer_new()
|
||||
{
|
||||
return GDS_RENDER_OUTPUT_RENDERER(g_object_new(GDS_RENDER_TYPE_OUTPUT_RENDERER, NULL));
|
||||
}
|
||||
|
||||
int gds_output_renderer_render_output(GdsOutputRenderer *renderer, struct gds_cell *cell, GList *layer_infos, const char *output_file, double scale)
|
||||
{
|
||||
GdsOutputRendererClass *klass;
|
||||
|
||||
if (GDS_RENDER_IS_OUTPUT_RENDERER(renderer) == FALSE) {
|
||||
g_error("Output Renderer not valid.");
|
||||
return GDS_OUTPUT_RENDERER_GEN_ERR;
|
||||
}
|
||||
|
||||
if (!cell || !layer_infos || !output_file) {
|
||||
g_error("Output renderer called with insufficient parameters.");
|
||||
return GDS_OUTPUT_RENDERER_PARAM_ERR;
|
||||
}
|
||||
|
||||
klass = GDS_RENDER_OUTPUT_RENDERER_GET_CLASS(renderer);
|
||||
if (klass->render_output == NULL) {
|
||||
g_critical("Output Renderer: Rendering function broken. This is a bug.");
|
||||
return GDS_OUTPUT_RENDERER_GEN_ERR;
|
||||
}
|
||||
|
||||
return klass->render_output(renderer, cell, layer_infos, output_file, scale);
|
||||
}
|
||||
|
||||
|
||||
/** @} */
|
@@ -24,15 +24,33 @@
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include <gds-render/latex-renderer/latex-output.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <gds-render/output-renderers/latex-renderer.h>
|
||||
#include <gdk/gdk.h>
|
||||
#include <gds-render/layer/layer-info.h>
|
||||
/**
|
||||
* @addtogroup LaTeX-Renderer
|
||||
* @addtogroup LatexRenderer
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @brief Writes a GString \p buffer to the fixed file tex_file */
|
||||
struct _LatexRenderer {
|
||||
GdsOutputRenderer parent;
|
||||
gboolean tex_standalone;
|
||||
gboolean pdf_layers;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE(LatexRenderer, latex_renderer, GDS_RENDER_TYPE_OUTPUT_RENDERER)
|
||||
|
||||
enum {
|
||||
PROP_STANDALONE = 1,
|
||||
PROP_PDF_LAYERS,
|
||||
N_PROPERTIES
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Writes a GString \p buffer to the fixed file tex_file
|
||||
* @note This is a convinience macro. Do not use this anywhere else. It might change behavior in futurtre releases
|
||||
*/
|
||||
#define WRITEOUT_BUFFER(buff) fwrite((buff)->str, sizeof(char), (buff)->len, tex_file)
|
||||
|
||||
/**
|
||||
@@ -249,14 +267,14 @@ static void render_cell(struct gds_cell *cell, GList *layer_infos, FILE *tex_fil
|
||||
|
||||
}
|
||||
|
||||
void latex_render_cell_to_code(struct gds_cell *cell, GList *layer_infos, FILE *tex_file, double scale,
|
||||
static int latex_render_cell_to_code(struct gds_cell *cell, GList *layer_infos, FILE *tex_file, double scale,
|
||||
gboolean create_pdf_layers, gboolean standalone_document)
|
||||
{
|
||||
GString *working_line;
|
||||
|
||||
|
||||
if (!tex_file || !layer_infos || !cell)
|
||||
return;
|
||||
return -1;
|
||||
|
||||
/* 10 kB Line working buffer should be enough */
|
||||
working_line = g_string_new_len(NULL, LATEX_LINE_BUFFER_KB*1024);
|
||||
@@ -298,6 +316,111 @@ void latex_render_cell_to_code(struct gds_cell *cell, GList *layer_infos, FILE *
|
||||
|
||||
fflush(tex_file);
|
||||
g_string_free(working_line, TRUE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int latex_renderer_render_output(GdsOutputRenderer *renderer,
|
||||
struct gds_cell *cell,
|
||||
GList *layer_infos,
|
||||
const char *output_file,
|
||||
double scale)
|
||||
{
|
||||
LatexRenderer *l_renderer = GDS_RENDER_LATEX_RENDERER(renderer);
|
||||
FILE *tex_file;
|
||||
int ret = -2;
|
||||
|
||||
tex_file = fopen(output_file, "w");
|
||||
if (tex_file) {
|
||||
ret = latex_render_cell_to_code(cell, layer_infos, tex_file, scale,
|
||||
l_renderer->pdf_layers, l_renderer->tex_standalone);
|
||||
fclose(tex_file);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void latex_renderer_init(LatexRenderer *self)
|
||||
{
|
||||
self->pdf_layers = FALSE;
|
||||
self->tex_standalone = FALSE;
|
||||
}
|
||||
|
||||
static void latex_renderer_get_property(GObject *obj, guint property_id, GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
LatexRenderer *self = GDS_RENDER_LATEX_RENDERER(obj);
|
||||
|
||||
switch (property_id) {
|
||||
case PROP_STANDALONE:
|
||||
g_value_set_boolean(value, self->tex_standalone);
|
||||
break;
|
||||
case PROP_PDF_LAYERS:
|
||||
g_value_set_boolean(value, self->pdf_layers);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, property_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void latex_renderer_set_property(GObject *obj, guint property_id, const GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
LatexRenderer *self = GDS_RENDER_LATEX_RENDERER(obj);
|
||||
|
||||
switch (property_id) {
|
||||
case PROP_STANDALONE:
|
||||
self->tex_standalone = g_value_get_boolean(value);
|
||||
break;
|
||||
case PROP_PDF_LAYERS:
|
||||
self->pdf_layers = g_value_get_boolean(value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, property_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static GParamSpec *latex_renderer_properties[N_PROPERTIES] = {NULL};
|
||||
|
||||
static void latex_renderer_class_init(LatexRendererClass *klass)
|
||||
{
|
||||
GdsOutputRendererClass *render_class = GDS_RENDER_OUTPUT_RENDERER_CLASS(klass);
|
||||
GObjectClass *oclass = G_OBJECT_CLASS(klass);
|
||||
|
||||
/* Overwrite virtual function */
|
||||
render_class->render_output = latex_renderer_render_output;
|
||||
|
||||
/* Property stuff */
|
||||
oclass->get_property = latex_renderer_get_property;
|
||||
oclass->set_property = latex_renderer_set_property;
|
||||
|
||||
latex_renderer_properties[PROP_STANDALONE] =
|
||||
g_param_spec_boolean("standalone",
|
||||
"Standalone TeX file",
|
||||
"Generate a standalone LaTeX file.",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE);
|
||||
latex_renderer_properties[PROP_PDF_LAYERS] =
|
||||
g_param_spec_boolean("pdf-layers",
|
||||
"PDF OCR layers",
|
||||
"Generate OCR layers",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
g_object_class_install_properties(oclass, N_PROPERTIES, latex_renderer_properties);
|
||||
}
|
||||
|
||||
LatexRenderer *latex_renderer_new()
|
||||
{
|
||||
return GDS_RENDER_LATEX_RENDERER(g_object_new(GDS_RENDER_TYPE_LATEX_RENDERER, NULL));
|
||||
}
|
||||
|
||||
LatexRenderer *latex_renderer_new_with_options(gboolean pdf_layers, gboolean standalone)
|
||||
{
|
||||
GObject *obj;
|
||||
|
||||
obj = g_object_new(GDS_RENDER_TYPE_LATEX_RENDERER, "standalone", standalone, "pdf-layers", pdf_layers, NULL);
|
||||
return GDS_RENDER_LATEX_RENDERER(obj);
|
||||
}
|
||||
|
||||
/** @} */
|
@@ -2,6 +2,7 @@ add_custom_target(glib-resources DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/resources.c
|
||||
add_custom_command(DEPENDS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/*.glade
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/resources.xml
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/color-palette.txt
|
||||
OUTPUT
|
||||
${CMAKE_CURRENT_BINARY_DIR}/resources.c
|
||||
COMMAND
|
255
resources/color-palette.txt
Normal file
255
resources/color-palette.txt
Normal file
@@ -0,0 +1,255 @@
|
||||
800000
|
||||
008000
|
||||
808000
|
||||
000080
|
||||
800080
|
||||
008080
|
||||
c0c0c0
|
||||
808080
|
||||
ff0000
|
||||
00ff00
|
||||
ffff00
|
||||
0000ff
|
||||
ff00ff
|
||||
00ffff
|
||||
f105f5
|
||||
000000
|
||||
00005f
|
||||
000087
|
||||
0000af
|
||||
0000d7
|
||||
0000ff
|
||||
005f00
|
||||
005f5f
|
||||
005f87
|
||||
005faf
|
||||
005fd7
|
||||
005fff
|
||||
008700
|
||||
00875f
|
||||
008787
|
||||
0087af
|
||||
0087d7
|
||||
0087ff
|
||||
00af00
|
||||
00af5f
|
||||
00af87
|
||||
00afaf
|
||||
00afd7
|
||||
00afff
|
||||
00d700
|
||||
00d75f
|
||||
00d787
|
||||
00d7af
|
||||
00d7d7
|
||||
00d7ff
|
||||
00ff00
|
||||
00ff5f
|
||||
00ff87
|
||||
00ffaf
|
||||
00ffd7
|
||||
00ffff
|
||||
5f0000
|
||||
5f005f
|
||||
5f0087
|
||||
5f00af
|
||||
5f00d7
|
||||
5f00ff
|
||||
5f5f00
|
||||
5f5f5f
|
||||
5f5f87
|
||||
5f5faf
|
||||
5f5fd7
|
||||
5f5fff
|
||||
5f8700
|
||||
5f875f
|
||||
5f8787
|
||||
5f87af
|
||||
5f87d7
|
||||
5f87ff
|
||||
5faf00
|
||||
5faf5f
|
||||
5faf87
|
||||
5fafaf
|
||||
5fafd7
|
||||
5fafff
|
||||
5fd700
|
||||
5fd75f
|
||||
5fd787
|
||||
5fd7af
|
||||
5fd7d7
|
||||
5fd7ff
|
||||
5fff00
|
||||
5fff5f
|
||||
5fff87
|
||||
5fffaf
|
||||
5fffd7
|
||||
5fffff
|
||||
870000
|
||||
87005f
|
||||
870087
|
||||
8700af
|
||||
8700d7
|
||||
8700ff
|
||||
875f00
|
||||
875f5f
|
||||
875f87
|
||||
875faf
|
||||
875fd7
|
||||
875fff
|
||||
878700
|
||||
87875f
|
||||
878787
|
||||
8787af
|
||||
8787d7
|
||||
8787ff
|
||||
87af00
|
||||
87af5f
|
||||
87af87
|
||||
87afaf
|
||||
87afd7
|
||||
87afff
|
||||
87d700
|
||||
87d75f
|
||||
87d787
|
||||
87d7af
|
||||
87d7d7
|
||||
87d7ff
|
||||
87ff00
|
||||
87ff5f
|
||||
87ff87
|
||||
87ffaf
|
||||
87ffd7
|
||||
87ffff
|
||||
af0000
|
||||
af005f
|
||||
af0087
|
||||
af00af
|
||||
af00d7
|
||||
af00ff
|
||||
af5f00
|
||||
af5f5f
|
||||
af5f87
|
||||
af5faf
|
||||
af5fd7
|
||||
af5fff
|
||||
af8700
|
||||
af875f
|
||||
af8787
|
||||
af87af
|
||||
af87d7
|
||||
af87ff
|
||||
afaf00
|
||||
afaf5f
|
||||
afaf87
|
||||
afafaf
|
||||
afafd7
|
||||
afafff
|
||||
afd700
|
||||
afd75f
|
||||
afd787
|
||||
afd7af
|
||||
afd7d7
|
||||
afd7ff
|
||||
afff00
|
||||
afff5f
|
||||
afff87
|
||||
afffaf
|
||||
afffd7
|
||||
afffff
|
||||
d70000
|
||||
d7005f
|
||||
d70087
|
||||
d700af
|
||||
d700d7
|
||||
d700ff
|
||||
d75f00
|
||||
d75f5f
|
||||
d75f87
|
||||
d75faf
|
||||
d75fd7
|
||||
d75fff
|
||||
d78700
|
||||
d7875f
|
||||
d78787
|
||||
d787af
|
||||
d787d7
|
||||
d787ff
|
||||
d7af00
|
||||
d7af5f
|
||||
d7af87
|
||||
d7afaf
|
||||
d7afd7
|
||||
d7afff
|
||||
d7d700
|
||||
d7d75f
|
||||
d7d787
|
||||
d7d7af
|
||||
d7d7d7
|
||||
d7d7ff
|
||||
d7ff00
|
||||
d7ff5f
|
||||
d7ff87
|
||||
d7ffaf
|
||||
d7ffd7
|
||||
d7ffff
|
||||
ff0000
|
||||
ff005f
|
||||
ff0087
|
||||
ff00af
|
||||
ff00d7
|
||||
ff00ff
|
||||
ff5f00
|
||||
ff5f5f
|
||||
ff5f87
|
||||
ff5faf
|
||||
ff5fd7
|
||||
ff5fff
|
||||
ff8700
|
||||
ff875f
|
||||
ff8787
|
||||
ff87af
|
||||
ff87d7
|
||||
ff87ff
|
||||
ffaf00
|
||||
ffaf5f
|
||||
ffaf87
|
||||
ffafaf
|
||||
ffafd7
|
||||
ffafff
|
||||
ffd700
|
||||
ffd75f
|
||||
ffd787
|
||||
ffd7af
|
||||
ffd7d7
|
||||
ffd7ff
|
||||
ffff00
|
||||
ffff5f
|
||||
ffff87
|
||||
ffffaf
|
||||
ffffd7
|
||||
ffffff
|
||||
080808
|
||||
121212
|
||||
1c1c1c
|
||||
262626
|
||||
303030
|
||||
3a3a3a
|
||||
444444
|
||||
4e4e4e
|
||||
585858
|
||||
626262
|
||||
6c6c6c
|
||||
767676
|
||||
808080
|
||||
8a8a8a
|
||||
949494
|
||||
9e9e9e
|
||||
a8a8a8
|
||||
b2b2b2
|
||||
bcbcbc
|
||||
c6c6c6
|
||||
d0d0d0
|
||||
dadada
|
||||
e4e4e4
|
||||
eeeeee
|
@@ -2,15 +2,20 @@
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.20"/>
|
||||
<object class="GtkImage" id="image1">
|
||||
<object class="GtkImage" id="color-img">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="stock">gtk-go-up</property>
|
||||
<property name="stock">gtk-select-color</property>
|
||||
</object>
|
||||
<object class="GtkImage" id="image2">
|
||||
<object class="GtkImage" id="load-mapping-img">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="stock">gtk-go-down</property>
|
||||
<property name="stock">gtk-open</property>
|
||||
</object>
|
||||
<object class="GtkImage" id="save-mapping-img">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="stock">gtk-save-as</property>
|
||||
</object>
|
||||
<object class="GtkWindow" id="main-window">
|
||||
<property name="height_request">250</property>
|
||||
@@ -43,6 +48,8 @@
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="image">load-mapping-img</property>
|
||||
<property name="always_show_image">True</property>
|
||||
<style>
|
||||
<class name="suggested-action"/>
|
||||
</style>
|
||||
@@ -58,6 +65,8 @@
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="image">save-mapping-img</property>
|
||||
<property name="always_show_image">True</property>
|
||||
<style>
|
||||
<class name="suggested-action"/>
|
||||
</style>
|
||||
@@ -90,42 +99,144 @@
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkSearchEntry" id="cell-search">
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="primary_icon_name">edit-find-symbolic</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkSearchEntry" id="cell-search">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="primary_icon_name">edit-find-symbolic</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">never</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="cell-tree">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="enable_search">False</property>
|
||||
<property name="enable_grid_lines">both</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection"/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">never</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="cell-tree">
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="headers_clickable">False</property>
|
||||
<property name="enable_search">False</property>
|
||||
<property name="enable_grid_lines">both</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection"/>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button-up-sort">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="image">sort-up-img</property>
|
||||
<property name="always_show_image">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button-down-sort">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="image">sort-down-img</property>
|
||||
<property name="always_show_image">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="auto-color-button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="image">color-img</property>
|
||||
<property name="always_show_image">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">never</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GtkViewport">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkListBox" id="layer-list">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="selection_mode">none</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -142,83 +253,31 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<object class="GtkBox" id="activity-bar">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button-up-sort">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="image">image1</property>
|
||||
<property name="always_show_image">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button-down-sort">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="image">image2</property>
|
||||
<property name="always_show_image">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">never</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GtkViewport">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkListBox" id="layer-list">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="selection_mode">none</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkImage" id="sort-down-img">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="stock">gtk-sort-ascending</property>
|
||||
</object>
|
||||
<object class="GtkImage" id="sort-up-img">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="stock">gtk-sort-descending</property>
|
||||
</object>
|
||||
</interface>
|
17
resources/resources.xml
Normal file
17
resources/resources.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<gresources>
|
||||
<gresource prefix="/gui">
|
||||
<file compressed="true">main.glade</file>
|
||||
<file compressed="true">about.glade</file>
|
||||
<file>layer-widget.glade</file>
|
||||
<file>dialog.glade</file>
|
||||
</gresource>
|
||||
<gresource prefix="/data">
|
||||
<file compressed="true">color-palette.txt</file>
|
||||
</gresource>
|
||||
<gresource prefix="/images">
|
||||
<file compressed="true" alias="logo.svg">../icon/gds-render.svg</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
||||
|
109
widgets/activity-bar.c
Normal file
109
widgets/activity-bar.c
Normal file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* GDSII-Converter
|
||||
* Copyright (C) 2019 Mario Hüttel <mario.huettel@gmx.net>
|
||||
*
|
||||
* This file is part of GDSII-Converter.
|
||||
*
|
||||
* GDSII-Converter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* GDSII-Converter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GDSII-Converter. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The drag and drop implementation is adapted from
|
||||
* https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-22/tests/testlist3.c
|
||||
*
|
||||
* Thanks to the GTK3 people for creating these examples.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file activity-bar.c
|
||||
* @brief Status bar indicating activity of the program
|
||||
* @author Mario Hüttel <mario.huettel@gmx.net>
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup ActivityBar
|
||||
* @ingroup Widgets
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <gds-render/widgets/activity-bar.h>
|
||||
|
||||
/** @brief Opaque ActivityBar object. Not viewable outside this source file. */
|
||||
struct _ActivityBar {
|
||||
GtkBox super;
|
||||
/* Private stuff */
|
||||
GtkWidget *spinner;
|
||||
GtkWidget *label;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE(ActivityBar, activity_bar, GTK_TYPE_BOX)
|
||||
|
||||
static void activity_bar_dispose(GObject *obj)
|
||||
{
|
||||
ActivityBar *bar;
|
||||
|
||||
bar = ACTIVITY_BAR(obj);
|
||||
|
||||
/* Clear references on owned objects */
|
||||
g_clear_object(&bar->label);
|
||||
g_clear_object(&bar->spinner);
|
||||
|
||||
/* Chain up */
|
||||
G_OBJECT_CLASS(activity_bar_parent_class)->dispose(obj);
|
||||
}
|
||||
|
||||
static void activity_bar_class_init(ActivityBarClass *klass)
|
||||
{
|
||||
GObjectClass *oclass = G_OBJECT_CLASS(klass);
|
||||
|
||||
oclass->dispose = activity_bar_dispose;
|
||||
}
|
||||
|
||||
static void activity_bar_init(ActivityBar *self)
|
||||
{
|
||||
GtkContainer *box = GTK_CONTAINER(self);
|
||||
|
||||
/* Create Widgets */
|
||||
self->label = gtk_label_new("");
|
||||
self->spinner = gtk_spinner_new();
|
||||
|
||||
/* Add to this widget and show */
|
||||
gtk_container_add(box, self->spinner);
|
||||
gtk_container_add(box, self->label);
|
||||
gtk_widget_show(self->label);
|
||||
gtk_widget_show(self->spinner);
|
||||
|
||||
g_object_ref(self->spinner);
|
||||
g_object_ref(self->label);
|
||||
}
|
||||
|
||||
ActivityBar *activity_bar_new()
|
||||
{
|
||||
ActivityBar *bar;
|
||||
|
||||
bar = ACTIVITY_BAR(g_object_new(TYPE_ACTIVITY_BAR, "orientation", GTK_ORIENTATION_HORIZONTAL, NULL));
|
||||
if (bar)
|
||||
activity_bar_set_ready(bar);
|
||||
|
||||
return bar;
|
||||
}
|
||||
|
||||
/* TODO: Complete this once the task list is fully implemented */
|
||||
void activity_bar_set_ready(ActivityBar *bar)
|
||||
{
|
||||
gtk_label_set_text(GTK_LABEL(bar->label), "Ready");
|
||||
gtk_spinner_stop(GTK_SPINNER(bar->spinner));
|
||||
}
|
||||
|
||||
|
||||
/** @} */
|
@@ -270,7 +270,7 @@ static void renderer_settings_dialog_init(RendererSettingsDialog *self)
|
||||
|
||||
dialog = &self->parent;
|
||||
|
||||
builder = gtk_builder_new_from_resource("/dialog.glade");
|
||||
builder = gtk_builder_new_from_resource("/gui/dialog.glade");
|
||||
box = GTK_WIDGET(gtk_builder_get_object(builder, "dialog-box"));
|
||||
self->radio_latex = GTK_WIDGET(gtk_builder_get_object(builder, "latex-radio"));
|
||||
self->radio_cairo_pdf = GTK_WIDGET(gtk_builder_get_object(builder, "cairo-pdf-radio"));
|
||||
|
@@ -62,7 +62,7 @@ static void layer_element_init(LayerElement *self)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GtkWidget *glade_box;
|
||||
builder = gtk_builder_new_from_resource("/layer-widget.glade");
|
||||
builder = gtk_builder_new_from_resource("/gui/layer-widget.glade");
|
||||
glade_box = GTK_WIDGET(gtk_builder_get_object(builder, "box"));
|
||||
gtk_container_add(GTK_CONTAINER(self), glade_box);
|
||||
|
||||
|
Reference in New Issue
Block a user