From e8c7f78af4532d7ee2e709f7bbeef310285d25d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Tue, 26 Mar 2019 19:57:19 +0100 Subject: [PATCH] Update include file hierarchy: Move include file to central include tree --- CMakeLists.txt | 12 ++--- .../cairo-output.c | 3 +- command-line.c | 17 ++++--- doxygen/{trigonometric.dox => geometric.dox} | 4 +- external-renderer.c | 3 +- gds-render-gui.c | 23 +++++---- gds-utils/gds-parser.c | 4 +- gds-utils/gds-tree-checker.c | 3 +- {trigonometric => geometric}/bounding-box.c | 5 +- .../cell-geometrics.c | 7 +-- .../vector-operations.c | 5 +- .../gds-render/cairo-renderer}/cairo-output.h | 10 ++-- .../gds-render/command-line.h | 3 ++ .../gds-render/external-renderer.h | 2 +- .../gds-render/gds-render-gui.h | 0 .../gds-render/gds-utils}/gds-parser.h | 9 ++-- .../gds-render/gds-utils}/gds-tree-checker.h | 2 +- .../gds-render/gds-utils}/gds-types.h | 0 .../gds-render/geometric}/bounding-box.h | 5 +- .../gds-render/geometric/cell-geometrics.h | 8 +-- .../gds-render/geometric}/vector-operations.h | 2 +- .../gds-render/latex-renderer}/latex-output.h | 5 +- include/gds-render/layer/layer-info.h | 51 +++++++++++++++++++ .../gds-render/layer}/layer-selector.h | 0 .../gds-render/layer/mapping-parser.h | 5 +- .../tree-renderer}/lib-cell-renderer.h | 0 .../gds-render/tree-renderer}/tree-store.h | 0 {version => include/gds-render}/version.h | 0 .../widgets}/conv-settings-dialog.h | 0 .../gds-render/widgets}/layer-element.h | 0 .../latex-output.c | 3 +- layer/layer-info.c | 32 +++++++++++- layer/layer-info.h | 26 ---------- layer/layer-selector.c | 12 ++--- mapping-parser.c => layer/mapping-parser.c | 2 +- main.c | 13 +++-- tree-renderer/lib-cell-renderer.c | 4 +- tree-renderer/tree-store.c | 6 +-- version/version.c | 1 - widgets/conv-settings-dialog.c | 2 +- widgets/layer-element.c | 2 +- 41 files changed, 182 insertions(+), 109 deletions(-) rename {cairo-output => cairo-renderer}/cairo-output.c (99%) rename doxygen/{trigonometric.dox => geometric.dox} (52%) rename {trigonometric => geometric}/bounding-box.c (98%) rename trigonometric/cell-trigonometrics.c => geometric/cell-geometrics.c (97%) rename {trigonometric => geometric}/vector-operations.c (97%) rename {cairo-output => include/gds-render/cairo-renderer}/cairo-output.h (90%) rename command-line.h => include/gds-render/command-line.h (93%) rename external-renderer.h => include/gds-render/external-renderer.h (97%) rename gds-render-gui.h => include/gds-render/gds-render-gui.h (100%) rename {gds-utils => include/gds-render/gds-utils}/gds-parser.h (91%) rename {gds-utils => include/gds-render/gds-utils}/gds-tree-checker.h (97%) rename {gds-utils => include/gds-render/gds-utils}/gds-types.h (100%) rename {trigonometric => include/gds-render/geometric}/bounding-box.h (96%) rename trigonometric/cell-trigonometrics.h => include/gds-render/geometric/cell-geometrics.h (87%) rename {trigonometric => include/gds-render/geometric}/vector-operations.h (98%) rename {latex-output => include/gds-render/latex-renderer}/latex-output.h (94%) create mode 100644 include/gds-render/layer/layer-info.h rename {layer => include/gds-render/layer}/layer-selector.h (100%) rename mapping-parser.h => include/gds-render/layer/mapping-parser.h (96%) rename {tree-renderer => include/gds-render/tree-renderer}/lib-cell-renderer.h (100%) rename {tree-renderer => include/gds-render/tree-renderer}/tree-store.h (100%) rename {version => include/gds-render}/version.h (100%) rename {widgets => include/gds-render/widgets}/conv-settings-dialog.h (100%) rename {widgets => include/gds-render/widgets}/layer-element.h (100%) rename {latex-output => latex-renderer}/latex-output.c (99%) delete mode 100644 layer/layer-info.h rename mapping-parser.c => layer/mapping-parser.c (98%) diff --git a/CMakeLists.txt b/CMakeLists.txt index e866adc..f8d4a5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,18 +10,18 @@ add_subdirectory(glade) add_subdirectory(doxygen) add_subdirectory(version) -include_directories(${GLIB_INCLUDE_DIRS} ${GTK3_INCLUDE_DIRS} ${CAIRO_INCLUDE_DIRS}) +include_directories(${GLIB_INCLUDE_DIRS} ${GTK3_INCLUDE_DIRS} ${CAIRO_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/include) 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("gds-utils" GDS_SOURCES) -aux_source_directory("latex-output" LATEX_SOURCES) -aux_source_directory("cairo-output" CAIRO_SOURCES) -aux_source_directory("trigonometric" TRIG_SOURCES) +aux_source_directory("latex-renderer" LATEX_SOURCES) +aux_source_directory("cairo-renderer" CAIRO_SOURCES) +aux_source_directory("geometric" GEOMETRIC_SOURCES) aux_source_directory("layer" LAYER_SELECTOR_SOURCES) -set(SOURCE "main.c" "mapping-parser.c" "command-line.c" "gds-render-gui.c" "external-renderer.c") +set(SOURCE "main.c" "command-line.c" "gds-render-gui.c" "external-renderer.c") set(SOURCE ${SOURCE} @@ -30,7 +30,7 @@ set(SOURCE ${GDS_SOURCES} ${LATEX_SOURCES} ${CAIRO_SOURCES} - ${TRIG_SOURCES} + ${GEOMETRIC_SOURCES} ${LAYER_SELECTOR_SOURCES} ) diff --git a/cairo-output/cairo-output.c b/cairo-renderer/cairo-output.c similarity index 99% rename from cairo-output/cairo-output.c rename to cairo-renderer/cairo-output.c index 5d66557..1f25051 100644 --- a/cairo-output/cairo-output.c +++ b/cairo-renderer/cairo-output.c @@ -26,13 +26,14 @@ * @{ */ -#include "cairo-output.h" #include #include #include #include #include +#include + /** * @brief The cairo_layer struct * Each rendered layer is represented by this struct. diff --git a/command-line.c b/command-line.c index 03caa08..9585692 100644 --- a/command-line.c +++ b/command-line.c @@ -29,14 +29,15 @@ */ #include -#include "command-line.h" -#include "gds-utils/gds-parser.h" -#include "mapping-parser.h" -#include "layer/layer-info.h" -#include "cairo-output/cairo-output.h" -#include "latex-output/latex-output.h" -#include "external-renderer.h" -#include "gds-utils/gds-tree-checker.h" + +#include +#include +#include +#include +#include +#include +#include +#include /** * @brief Delete layer_info and free nem element. diff --git a/doxygen/trigonometric.dox b/doxygen/geometric.dox similarity index 52% rename from doxygen/trigonometric.dox rename to doxygen/geometric.dox index 3fc3863..f325349 100644 --- a/doxygen/trigonometric.dox +++ b/doxygen/geometric.dox @@ -1,8 +1,8 @@ /* This file only contains help information for doxygen */ /** - * @defgroup trigonometric Trigonometric Helper Functions + * @defgroup geometric Geometric Helper Functions * - * The trigonometric helper function are used to calculate bounding boxes + * The geometric helper function are used to calculate bounding boxes * @warning Code is incomplete. Please double check for functionality! */ diff --git a/external-renderer.c b/external-renderer.c index 5474b16..c30d897 100644 --- a/external-renderer.c +++ b/external-renderer.c @@ -28,10 +28,11 @@ * @{ */ -#include "external-renderer.h" #include #include +#include + int external_renderer_render_cell(struct gds_cell *toplevel_cell, GList *layer_info_list, char *output_file, char *so_path) { diff --git a/gds-render-gui.c b/gds-render-gui.c index 6f68fc0..e6789c3 100644 --- a/gds-render-gui.c +++ b/gds-render-gui.c @@ -27,19 +27,20 @@ * @{ */ -#include "gds-render-gui.h" #include -#include "gds-utils/gds-parser.h" #include -#include "layer/layer-selector.h" -#include "tree-renderer/tree-store.h" -#include "latex-output/latex-output.h" -#include "widgets/conv-settings-dialog.h" -#include "cairo-output/cairo-output.h" -#include "trigonometric/cell-trigonometrics.h" -#include "version/version.h" -#include "tree-renderer/lib-cell-renderer.h" -#include "gds-utils/gds-tree-checker.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include enum gds_render_gui_signal_sig_ids {SIGNAL_WINDOW_CLOSED = 0, SIGNAL_COUNT}; diff --git a/gds-utils/gds-parser.c b/gds-utils/gds-parser.c index 185c6b4..b808d94 100644 --- a/gds-utils/gds-parser.c +++ b/gds-utils/gds-parser.c @@ -34,8 +34,6 @@ * @{ */ - -#include "gds-parser.h" #include #include #include @@ -43,6 +41,8 @@ #include #include +#include + /** * @brief Default units assumed for library. * @note This value is usually overwritten with the value defined in the library. diff --git a/gds-utils/gds-tree-checker.c b/gds-utils/gds-tree-checker.c index 3d067fb..bb571d6 100644 --- a/gds-utils/gds-tree-checker.c +++ b/gds-utils/gds-tree-checker.c @@ -33,9 +33,10 @@ * @{ */ -#include "gds-tree-checker.h" #include +#include + int gds_tree_check_cell_references(struct gds_library *lib) { GList *cell_iter; diff --git a/trigonometric/bounding-box.c b/geometric/bounding-box.c similarity index 98% rename from trigonometric/bounding-box.c rename to geometric/bounding-box.c index c30541d..9a800b7 100644 --- a/trigonometric/bounding-box.c +++ b/geometric/bounding-box.c @@ -24,14 +24,15 @@ */ /** - * @addtogroup trigonometric + * @addtogroup geometric * @{ */ #include -#include "bounding-box.h" #include +#include + #define MIN(a,b) (((a) < (b)) ? (a) : (b)) /**< @brief Return smaller number */ #define MAX(a,b) (((a) > (b)) ? (a) : (b)) /**< @brief Return bigger number */ #define ABS_DBL(a) ((a) < 0 ? -(a) : (a)) diff --git a/trigonometric/cell-trigonometrics.c b/geometric/cell-geometrics.c similarity index 97% rename from trigonometric/cell-trigonometrics.c rename to geometric/cell-geometrics.c index 4789a46..0d7ac71 100644 --- a/trigonometric/cell-trigonometrics.c +++ b/geometric/cell-geometrics.c @@ -18,16 +18,17 @@ */ /** - * @file cell-trigonometrics.c + * @file cell-geometrics.c * @brief Calculation of gds_cell trigonometrics * @author Mario Hüttel */ -#include "cell-trigonometrics.h" #include +#include + /** - * @addtogroup trigonometric + * @addtogroup geometric * @{ */ diff --git a/trigonometric/vector-operations.c b/geometric/vector-operations.c similarity index 97% rename from trigonometric/vector-operations.c rename to geometric/vector-operations.c index 0666056..e383cbd 100644 --- a/trigonometric/vector-operations.c +++ b/geometric/vector-operations.c @@ -24,14 +24,15 @@ */ /** - * @addtogroup trigonometric + * @addtogroup geometric * @{ */ -#include "vector-operations.h" #include #include +#include + #define ABS_DBL(a) ((a) < 0 ? -(a) : (a)) double vector_2d_scalar_multipy(struct vector_2d *a, struct vector_2d *b) diff --git a/cairo-output/cairo-output.h b/include/gds-render/cairo-renderer/cairo-output.h similarity index 90% rename from cairo-output/cairo-output.h rename to include/gds-render/cairo-renderer/cairo-output.h index 32038ee..072ebf2 100644 --- a/cairo-output/cairo-output.h +++ b/include/gds-render/cairo-renderer/cairo-output.h @@ -21,11 +21,11 @@ * @brief Header File for Cairo output renderer * @author Mario Hüttel */ -#ifndef __CAIRO_OUTPUT_H__ -#define __CAIRO_OUTPUT_H__ +#ifndef _CAIRO_OUTPUT_H_ +#define _CAIRO_OUTPUT_H_ -#include "../layer/layer-info.h" -#include "../gds-utils/gds-types.h" +#include +#include /** @addtogroup Cairo-Renderer * @{ @@ -45,4 +45,4 @@ void cairo_render_cell_to_vector_file(struct gds_cell *cell, GList *layer_infos, /** @} */ -#endif /* __CAIRO_OUTPUT_H__ */ +#endif /* _CAIRO_OUTPUT_H_ */ diff --git a/command-line.h b/include/gds-render/command-line.h similarity index 93% rename from command-line.h rename to include/gds-render/command-line.h index 2908209..a0f5ee5 100644 --- a/command-line.h +++ b/include/gds-render/command-line.h @@ -30,6 +30,7 @@ #ifndef _COMMAND_LINE_H_ #define _COMMAND_LINE_H_ + #include /** @@ -48,6 +49,8 @@ * @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. */ 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, diff --git a/external-renderer.h b/include/gds-render/external-renderer.h similarity index 97% rename from external-renderer.h rename to include/gds-render/external-renderer.h index 63f5077..a648775 100644 --- a/external-renderer.h +++ b/include/gds-render/external-renderer.h @@ -31,7 +31,7 @@ #ifndef _EXTERNAL_RENDERER_H_ #define _EXTERNAL_RENDERER_H_ -#include "gds-utils/gds-types.h" +#include #include /** diff --git a/gds-render-gui.h b/include/gds-render/gds-render-gui.h similarity index 100% rename from gds-render-gui.h rename to include/gds-render/gds-render-gui.h diff --git a/gds-utils/gds-parser.h b/include/gds-render/gds-utils/gds-parser.h similarity index 91% rename from gds-utils/gds-parser.h rename to include/gds-render/gds-utils/gds-parser.h index ce745e4..331e734 100644 --- a/gds-utils/gds-parser.h +++ b/include/gds-render/gds-utils/gds-parser.h @@ -28,11 +28,12 @@ * @{ */ -#ifndef __GDSPARSE_H__ -#define __GDSPARSE_H__ +#ifndef _GDSPARSER_H_ +#define _GDSPARSER_H_ #include -#include "gds-types.h" + +#include #define GDS_PRINT_DEBUG_INFOS (0) /**< @brief 1: Print infos, 0: Don't print */ @@ -46,4 +47,4 @@ int clear_lib_list(GList **library_list); /** @} */ -#endif /* __GDSPARSE_H__ */ +#endif /* _GDSPARSE_H_ */ diff --git a/gds-utils/gds-tree-checker.h b/include/gds-render/gds-utils/gds-tree-checker.h similarity index 97% rename from gds-utils/gds-tree-checker.h rename to include/gds-render/gds-utils/gds-tree-checker.h index 199ace5..ff3af9d 100644 --- a/gds-utils/gds-tree-checker.h +++ b/include/gds-render/gds-utils/gds-tree-checker.h @@ -31,7 +31,7 @@ #ifndef _GDS_TREE_CHECKER_H_ #define _GDS_TREE_CHECKER_H_ -#include "gds-types.h" +#include /** * @brief gds_tree_check_cell_references checks if all child cell references can be resolved in the given library diff --git a/gds-utils/gds-types.h b/include/gds-render/gds-utils/gds-types.h similarity index 100% rename from gds-utils/gds-types.h rename to include/gds-render/gds-utils/gds-types.h diff --git a/trigonometric/bounding-box.h b/include/gds-render/geometric/bounding-box.h similarity index 96% rename from trigonometric/bounding-box.h rename to include/gds-render/geometric/bounding-box.h index 12f883d..b68bec7 100644 --- a/trigonometric/bounding-box.h +++ b/include/gds-render/geometric/bounding-box.h @@ -24,14 +24,15 @@ */ /** - * @addtogroup trigonometric + * @addtogroup geometric * @{ */ #ifndef _BOUNDING_BOX_H_ #define _BOUNDING_BOX_H_ + #include -#include "vector-operations.h" +#include #include union bounding_box { diff --git a/trigonometric/cell-trigonometrics.h b/include/gds-render/geometric/cell-geometrics.h similarity index 87% rename from trigonometric/cell-trigonometrics.h rename to include/gds-render/geometric/cell-geometrics.h index 6136bb2..9b49903 100644 --- a/trigonometric/cell-trigonometrics.h +++ b/include/gds-render/geometric/cell-geometrics.h @@ -24,21 +24,21 @@ */ /** - * @addtogroup trigonometric + * @addtogroup geometric * @{ */ #ifndef _CELL_TRIGONOMETRICS_H_ #define _CELL_TRIGONOMETRICS_H_ -#include "bounding-box.h" -#include "../gds-utils/gds-types.h" +#include +#include /** * @brief calculate_cell_bounding_box Calculate bounding box of gds cell * @param box Resulting boundig box. Will be uüdated and not overwritten * @param cell toplevel cell - * @warning Path handling not yet implemented correctly + * @warning Path handling not yet implemented correctly. */ void calculate_cell_bounding_box(union bounding_box *box, struct gds_cell *cell); diff --git a/trigonometric/vector-operations.h b/include/gds-render/geometric/vector-operations.h similarity index 98% rename from trigonometric/vector-operations.h rename to include/gds-render/geometric/vector-operations.h index e4b04b7..38ecc7a 100644 --- a/trigonometric/vector-operations.h +++ b/include/gds-render/geometric/vector-operations.h @@ -24,7 +24,7 @@ */ /** - * @addtogroup trigonometric + * @addtogroup geometric * @{ */ diff --git a/latex-output/latex-output.h b/include/gds-render/latex-renderer/latex-output.h similarity index 94% rename from latex-output/latex-output.h rename to include/gds-render/latex-renderer/latex-output.h index f20c543..dae0c65 100644 --- a/latex-output/latex-output.h +++ b/include/gds-render/latex-renderer/latex-output.h @@ -31,10 +31,11 @@ * @{ */ -#include "../gds-utils/gds-types.h" #include #include -#include "../layer/layer-info.h" + +#include "gds-render/layer/layer-info.h" +#include #define LATEX_LINE_BUFFER_KB (10) /**< @brief Buffer for LaTeX Code line in KiB */ diff --git a/include/gds-render/layer/layer-info.h b/include/gds-render/layer/layer-info.h new file mode 100644 index 0000000..1cb9c67 --- /dev/null +++ b/include/gds-render/layer/layer-info.h @@ -0,0 +1,51 @@ +/* + * GDSII-Converter + * Copyright (C) 2019 Mario Hüttel + * + * 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 . + */ + +/** + * @file layer-info.c + * @brief Helper functions and definition of layer info struct + * @author Mario Hüttel + */ + +#ifndef _LAYER_INFO_H_ +#define _LAYER_INFO_H_ + +#include + +/** + * @brief Layer information. + * + * This structs contains information on how to render a layer + */ +struct layer_info +{ + int layer; /**< @brief Layer number */ + char *name; /**< @brief Layer name */ + int stacked_position; ///< @brief Position of layer in output @warning This parameter is not used by any renderer so far @note Lower is bottom, higher is top + GdkRGBA color; /**< @brief RGBA color used to render this layer */ +}; + +/** + * @brief Delete a layer_info struct + * @param info Struct to be deleted. + * @note The layer_info::name Element has to be freed manually + */ +void layer_info_delete_struct(struct layer_info *info); + +#endif // _LAYER_INFO_H_ diff --git a/layer/layer-selector.h b/include/gds-render/layer/layer-selector.h similarity index 100% rename from layer/layer-selector.h rename to include/gds-render/layer/layer-selector.h diff --git a/mapping-parser.h b/include/gds-render/layer/mapping-parser.h similarity index 96% rename from mapping-parser.h rename to include/gds-render/layer/mapping-parser.h index dec10a4..3afa5c1 100644 --- a/mapping-parser.h +++ b/include/gds-render/layer/mapping-parser.h @@ -31,8 +31,9 @@ * @{ */ -#include -#include "widgets/layer-element.h" +#include + +#include /** * @brief Load a line from \p stream and parse try to parse it as layer information diff --git a/tree-renderer/lib-cell-renderer.h b/include/gds-render/tree-renderer/lib-cell-renderer.h similarity index 100% rename from tree-renderer/lib-cell-renderer.h rename to include/gds-render/tree-renderer/lib-cell-renderer.h diff --git a/tree-renderer/tree-store.h b/include/gds-render/tree-renderer/tree-store.h similarity index 100% rename from tree-renderer/tree-store.h rename to include/gds-render/tree-renderer/tree-store.h diff --git a/version/version.h b/include/gds-render/version.h similarity index 100% rename from version/version.h rename to include/gds-render/version.h diff --git a/widgets/conv-settings-dialog.h b/include/gds-render/widgets/conv-settings-dialog.h similarity index 100% rename from widgets/conv-settings-dialog.h rename to include/gds-render/widgets/conv-settings-dialog.h diff --git a/widgets/layer-element.h b/include/gds-render/widgets/layer-element.h similarity index 100% rename from widgets/layer-element.h rename to include/gds-render/widgets/layer-element.h diff --git a/latex-output/latex-output.c b/latex-renderer/latex-output.c similarity index 99% rename from latex-output/latex-output.c rename to latex-renderer/latex-output.c index 2180e25..a47ff6f 100644 --- a/latex-output/latex-output.c +++ b/latex-renderer/latex-output.c @@ -23,9 +23,10 @@ * @author Mario Hüttel */ -#include "latex-output.h" #include +#include + /** * @addtogroup LaTeX-Renderer * @{ diff --git a/layer/layer-info.c b/layer/layer-info.c index a91b76f..d9796bb 100644 --- a/layer/layer-info.c +++ b/layer/layer-info.c @@ -1,9 +1,39 @@ +/* + * GDSII-Converter + * Copyright (C) 2019 Mario Hüttel + * + * 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 . + */ +/** + * @file layer-info.c + * @brief Helper functions for layer info struct + * @author Mario Hüttel + */ -#include "layer-info.h" +/** + * @addtogroup MainApplication + * @{ + */ + +#include void layer_info_delete_struct(struct layer_info *info) { if (info) free(info); } + +/** @} */ diff --git a/layer/layer-info.h b/layer/layer-info.h deleted file mode 100644 index 0da51b2..0000000 --- a/layer/layer-info.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef _LAYER_INFO_H_ -#define _LAYER_INFO_H_ - -#include - -/** - * @brief Layer information. - * - * This structs contains information on how to render a layer - */ -struct layer_info -{ - int layer; /**< @brief Layer number */ - char *name; /**< @brief Layer name */ - int stacked_position; ///< @brief Position of layer in output @warning This parameter is not used by any renderer so far @note Lower is bottom, higher is top - GdkRGBA color; /**< @brief RGBA color used to render this layer */ -}; - -/** - * @brief Delete a layer_info struct - * @param info Struct to be deleted. - * @note The layer_info::name Element has to be freed manually - */ -void layer_info_delete_struct(struct layer_info *info); - -#endif // _LAYER_INFO_H_ diff --git a/layer/layer-selector.c b/layer/layer-selector.c index b23dc2f..b3c4566 100644 --- a/layer/layer-selector.c +++ b/layer/layer-selector.c @@ -28,16 +28,17 @@ * @{ */ -#include "layer-selector.h" -#include "layer-info.h" -#include "../gds-utils/gds-parser.h" -#include "../widgets/layer-element.h" -#include "../mapping-parser.h" #include #include #include #include +#include +#include +#include +#include +#include + struct _LayerSelector { /* Parent */ GObject parent; @@ -55,7 +56,6 @@ struct _LayerSelector { G_DEFINE_TYPE(LayerSelector, layer_selector, G_TYPE_OBJECT) - /* Drag and drop code * Original code from https://blog.gtk.org/2017/06/01/drag-and-drop-in-lists-revisited/ */ diff --git a/mapping-parser.c b/layer/mapping-parser.c similarity index 98% rename from mapping-parser.c rename to layer/mapping-parser.c index e5fad1b..5d3c96b 100644 --- a/mapping-parser.c +++ b/layer/mapping-parser.c @@ -29,7 +29,7 @@ * @{ */ -#include "mapping-parser.h" +#include int mapping_parser_load_line(GDataInputStream *stream, gboolean *export, char **name, int *layer, GdkRGBA *color) { diff --git a/main.c b/main.c index 5d6de63..494c248 100644 --- a/main.c +++ b/main.c @@ -20,10 +20,11 @@ #include #include #include -#include "gds-render-gui.h" -#include "command-line.h" -#include "external-renderer.h" -#include "version/version.h" + +#include +#include +#include +#include struct application_data { GtkApplication *app; @@ -119,7 +120,9 @@ static int start_gui(int argc, char **argv) GtkApplication *gapp; int app_status; - static struct application_data appdata = {.gui_list = NULL}; + static struct application_data appdata = { + .gui_list = NULL + }; GMenu *menu; GMenu *m_quit; GMenu *m_about; diff --git a/tree-renderer/lib-cell-renderer.c b/tree-renderer/lib-cell-renderer.c index 6af5512..357c21e 100644 --- a/tree-renderer/lib-cell-renderer.c +++ b/tree-renderer/lib-cell-renderer.c @@ -17,8 +17,8 @@ * along with GDSII-Converter. If not, see . */ -#include "lib-cell-renderer.h" -#include "../gds-utils/gds-types.h" +#include +#include G_DEFINE_TYPE(LibCellRenderer, lib_cell_renderer, GTK_TYPE_CELL_RENDERER_TEXT) diff --git a/tree-renderer/tree-store.c b/tree-renderer/tree-store.c index de4194c..36dd97c 100644 --- a/tree-renderer/tree-store.c +++ b/tree-renderer/tree-store.c @@ -28,9 +28,9 @@ * @{ */ -#include "tree-store.h" -#include "lib-cell-renderer.h" -#include "../gds-utils/gds-types.h" +#include +#include +#include /** * @brief this function olny allows cells to be selected diff --git a/version/version.c b/version/version.c index b25a2d7..961817a 100644 --- a/version/version.c +++ b/version/version.c @@ -23,7 +23,6 @@ */ #ifdef PROJECT_GIT_VERSION - #define xstr(a) str(a) #define str(a) #a const char *_app_version_string = xstr(PROJECT_GIT_VERSION); diff --git a/widgets/conv-settings-dialog.c b/widgets/conv-settings-dialog.c index 79533d4..ddd033c 100644 --- a/widgets/conv-settings-dialog.c +++ b/widgets/conv-settings-dialog.c @@ -28,7 +28,7 @@ * @{ */ -#include "conv-settings-dialog.h" +#include struct _RendererSettingsDialog { GtkDialog parent; diff --git a/widgets/layer-element.c b/widgets/layer-element.c index d9257b2..89443fb 100644 --- a/widgets/layer-element.c +++ b/widgets/layer-element.c @@ -35,7 +35,7 @@ * @{ */ -#include "layer-element.h" +#include G_DEFINE_TYPE(LayerElement, layer_element, GTK_TYPE_LIST_BOX_ROW)