20 Commits

Author SHA1 Message Date
7f7b4cc7bf Fix #17: Reference loop detection fix. This will be part of v1.0-1 2019-06-08 13:32:42 +02:00
d08cd3626d Update Usage page and application screenshot 2019-05-14 19:59:43 +02:00
ef180f3ea2 Add version generation script to doxygen generation script 2019-05-14 19:58:52 +02:00
74ecde9807 Revert "gds-parser: Remove unnecessary code. Fix #13"
Code wasn't unnecessary. Oops.

This reverts commit aa413732f1.
2019-05-14 19:46:17 +02:00
cd2cf8c5c7 Add versioning scheme to documentation 2019-05-14 19:39:29 +02:00
63eb65a3c4 Fix #12: Wrong markdown in usage page. 2019-05-14 19:37:23 +02:00
aa413732f1 gds-parser: Remove unnecessary code. Fix #13 2019-05-14 18:35:40 +02:00
54165a8475 conv-settings-dialog: harden number2eng function against null pointer 2019-05-12 14:16:36 +02:00
c3c4636334 Add cell name to renderer settings dialog title bar 2019-04-08 19:05:07 +02:00
f4de9c4402 Code rework 2019-04-08 18:23:30 +02:00
a016a18587 Improve doxygen 2019-03-30 19:55:47 +01:00
a3626e7b33 Improve doxygen documentation 2019-03-30 19:51:56 +01:00
4dcafeed3f Update doxygen reference 2019-03-28 22:14:11 +01:00
03e2b15571 Add dirty flag to git describe command used for the version string. 2019-03-28 22:02:00 +01:00
e278ad6d94 Move each GTK Widget to its own documentation group 2019-03-26 21:12:37 +01:00
8d8af8d211 Add compiler warnings to documentation 2019-03-26 21:12:05 +01:00
4bed016f01 Update documentation: Add compilation page, fix additional mistake in cell-geometrics.h 2019-03-26 21:00:05 +01:00
e8c7f78af4 Update include file hierarchy: Move include file to central include tree 2019-03-26 19:57:19 +01:00
60e20f45cc Merge branch 'master' into dev 2019-03-25 19:06:26 +01:00
cd55137951 Grouped widgets into GUI group 2019-03-25 19:05:57 +01:00
60 changed files with 579 additions and 2209 deletions

View File

@@ -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}
)

View File

@@ -1,4 +1,4 @@
# GDS-Render
# GDS-Render Readme
This software is a rendering programm for GDS2 layout files.
The GDS2 format is mainly used in integrated circuit development.

View File

@@ -26,13 +26,14 @@
* @{
*/
#include "cairo-output.h"
#include <math.h>
#include <stdlib.h>
#include <cairo.h>
#include <cairo-pdf.h>
#include <cairo-svg.h>
#include <gds-render/cairo-renderer/cairo-output.h>
/**
* @brief The cairo_layer struct
* Each rendered layer is represented by this struct.

View File

@@ -24,19 +24,20 @@
*/
/**
* @addtogroup MainApplication
* @addtogroup cmdline
* @{
*/
#include <stdio.h>
#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 <gds-render/command-line.h>
#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/gds-utils/gds-tree-checker.h>
/**
* @brief Delete layer_info and free nem element.

View File

@@ -9,7 +9,7 @@ done
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null && pwd )"
cd "$DIR"
export PROJECT_NUMBER=`git describe --tags`
export PROJECT_NUMBER=`../version/generate-version-string.sh`
if [ $# != 1 ]; then
export OUTPUT_DIRECTORY="./output"

View File

@@ -0,0 +1,4 @@
/**
* @defgroup Cairo-Renderer Cairo Renderer
* @ingroup renderers
*/

3
doxygen/command-line.dox Normal file
View File

@@ -0,0 +1,3 @@
/**
* @defgroup cmdline Command Line Interface
*/

67
doxygen/compilation.dox Normal file
View File

@@ -0,0 +1,67 @@
/**
@page compilation Compilation
@section Preface
GDS-Render is designed for UNIX-like, especially GNU/Linux based systems.
It was developed under a Linux system. Therefore, best performance is expected using a Linux operating system.
@section depencencies Dependencies
The dependencies of GDS-Render are:
@subsection run-deps Program Dependencies
- GLib2
- GTK3
- Cairographics
@subsection comp-deps Compilation Dependencies
These dependencies are not needed for running the program; just for compilation.
- Build System (GCC + binutils, make, etc...). Most distributions supply a "development" meta-package containing this stuff.
- cmake >= 2.8
- More or less optional: git. Used for extraction of the precise version number. It is strongly recommended to provide git!
- Optional: doxygen for this nice documentation.
The dependency list of GTK3 already includes Cairographics and GLib2. You should be on the safe side with a recent GTK3 version.
Development is done with the following library versions:
| Cairographics | GLib2 | GTK3 |
| ------------- | ---------- | ------ |
| 1.16.0-2 | 2.60.0-1 | 3.24.7 |
@section comp-instr Compilation Instructions
@subsection linux-build General Linux Build Instruction
Go to the build directory you want to compile in. This may be the gds-render project root.
Execute
@code
cmake <Path to gds-render root>
@endcode
Cmake will check the dependencies. Once cmake has finished. Type
@code
make
@endcode
in order to build the program and
@code
make documentation
@endcode
to build the doxygen documentation.
@subsection arch-makepkg Archlinux Package
The subfolder 'AUR' contains a PKGBUILD file to build an Archlinux/Pacman package.
@subsection Compiler Warnings
The compiler will throw the following warnings. Compiled with GCC 8.2.1.
| Warning | Assessment |
| ------- | ---------- |
| warning: calculate_path_miter_points defined but not used [-Wunused-function] | Ignore. Function will be used in later versions. |
*/

View File

@@ -0,0 +1,4 @@
/**
* @defgroup external-renderer External Shared Object Renderer
* @ingroup renderers
*/

View File

@@ -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!
*/

View File

@@ -1,6 +1,5 @@
/* This file only contains help information for doxygen */
/**
* @defgroup MainApplication Main Application
*
* @defgroup GUI Graphical User Interface
*/

Binary file not shown.

BIN
doxygen/images/gui.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 114 KiB

View File

@@ -0,0 +1,4 @@
/**
* @defgroup LaTeX-Renderer LaTeX/TikZ Renderer
* @ingroup renderers
*/

View File

@@ -0,0 +1,7 @@
/**
* @defgroup layer-selector LayerSelector Object
* @ingroup GUI
*
* This objects implements the layer selector and displays the layers in a list box.
* It uses @ref LayerElement objects to display the individual layers inside the list box.
*/

View File

@@ -0,0 +1,18 @@
/**
* @defgroup LibCellRenderer LibCellRenderer GObject
* @ingroup GUI
*
* The LibCellRenderer Object is used to render @ref gds_cell and @ref gds_library elements
* to a GtkTreeView.
*
* The LibCellRenderer class is derived from a GtkCellRendererText and works the same way.
* The additinal features are three new properties:
*
* - *gds-lib*: This property can be used to set a @ref gds_library structure. The renderer will render the name of the library.
* - *gds-cell*: This property can be used to set a @ref gds_cell structure. The renderer will render the name of the cell.
* - *error-level*: Set the error level of the cell/library. This affects the foreground color of hte rendered output.
*
* Internally the class operates by setting the 'text' property, which is inherited form the base class to the library/cell name (gds_library::name and gds_cell::name fields).
* The error level (@ref LIB_CELL_RENDERER_ERROR_WARN and @ref LIB_CELL_RENDERER_ERROR_ERR) is translated to the inherited 'foreground-rgba' property.
*
*/

View File

@@ -6,10 +6,7 @@ This programm converts GDS layout files to
- PDF Files using the @ref Cairo-Renderer
- Latex code (TikZ) using the @ref LaTeX-Renderer
See the @subpage usage page for details
See the @subpage usage page for details and @subpage compilation for building instructions and @subpage versioning for the versioning scheme of this program.

9
doxygen/renderers.dox Normal file
View File

@@ -0,0 +1,9 @@
/**
* @defgroup renderers Output Renderers
*
* The renderers are used to convert the cell structures read from the GDS layout file
* into different output formats.
*
* Currently the renders are statically implemented without the use of GObjects.
* This will probably change in future releases in order to make it easier to integrate new rendering methods.
*/

View File

@@ -1,21 +1,21 @@
/**
@page usage Usage
@section cmd Command Line Interface
To use the application on the command line check 'gds-render --help'.
To use the application on the command line check 'gds-render `--`help'.
Application Options:
- -t, --tikz Output TikZ code
- -p, --pdf Output PDF document
- -s, --scale=SCALE Divide output coordinates by SCALE
- -o, --tex-output=PATH Optional path for TeX file
- -O, --pdf-output=PATH Optional path for PDF file
- -m, --mapping=PATH Path for Layer Mapping File
- -c, --cell=NAME Cell to render
- -a, --tex-standalone Create standalone PDF
- -l, --tex-layers Create PDF Layers (OCG)
- -P, --custom-render-lib=PATH Path to a custom shared object, that implements the render_cell_to_file function
- -e, --external-lib-output=PATH Output path for external render library
- --display=DISPLAY X display to use
- -t, `--`tikz Output TikZ code
- -p, `--`pdf Output PDF document
- -s, `--`scale=SCALE Divide output coordinates by SCALE
- -o, `--`tex-output=PATH Optional path for TeX file
- -O, `--`pdf-output=PATH Optional path for PDF file
- -m, `--`mapping=PATH Path for Layer Mapping File
- -c, `--`cell=NAME Cell to render
- -a, `--`tex-standalone Create standalone PDF
- -l, `--`tex-layers Create PDF Layers (OCG)
- -P, `--`custom-render-lib=PATH Path to a custom shared object, that implements the render_cell_to_file function
- -e, `--`external-lib-output=PATH Output path for external render library
- `--`display=DISPLAY X display to use
@section gui Graphical User Interface
@@ -24,7 +24,11 @@ The graphical user interface (GUI) can be used to open GDS Files, configure the
It is possible to export the layer configurations so they can be used later on. Even in the @ref cmd
@image html gui.svg
@image latex gui.pdf
@image html gui.png
@image latex gui.png
The cell selector on the left shows the GDS Libraries and Cells. The cells are marked green if all references inside the cell could be found. If not all references could be found, the cell is marked orange. This doens't show if child cells have missing childs. Only one level of the hierarchy is checked in order to make it easier to spot an errorneous cell. Cells with missing child cells are still renderable but -- obviously -- faulty. If a cell or any sub-cell contains a reference loop, the cell is marked red. In this case it can't be selected for rendering.
In the above image the cell is green; so everything is okay.
*/

36
doxygen/versioning.dox Normal file
View File

@@ -0,0 +1,36 @@
/**
@page versioning Version Number
@section main-version Main Versioning Scheme
The version number of this application consists of a given version in the format of 'v1.0'.
Where the first number indicates a major release and the second number indicates minor changes.
Versions, including release candidates and path-levels, are tagged in git.
@subsection rc Release Candidates
Release candidates are software versions that seem stable and functional to become a new version but testing is not fully finished. These versions are marked with an '-rcX', where X is the number of the release candidate.
The 3rd release candidate of version 4.2 would be '*v4.2-rc3*'.
Release candidates are in a frozen state. Only bugfixes that are necessary for functionality are applied to these versions before releasing the final version.
@subsection patch-level Patch Levels
If an already released version contains bugs that need to be fixed, the version number is not incremented. Insted a new version number with a patch-level is created. The patch-level is appended with a dash directly after the version number. The fist patch-level of version 3.5 would be: 'v3.5-1'.
@section git-version-num Git Based Version Number
The application and this documentation contain a git-based version number. With this version number not only released versions but all development points of the software can be uniquely identified.
An example for such a version number is: *v1.0-rc4-41-gaa41373-dirty*
It consists of the last @ref main-version (in this case version 1.0 -- Release candidate 4) and some other information from the source code management system. The number after the version tag is the commit count after the given version. In this case the specified version is 41 commits after the last tagged version 'v1.0-rc4'. The next section always starts with a 'g' (for git) and after that contains the first letters of the commit ID. In this case an additional '-dirty' is appended, showing that the software version contains unstaged changes.
In tabular form: *v1.0-rc4-41-gaa41373-dirty*
| Last tagged version | Commits since that version | Start of commit ID | Unstaged changes? |
|---------------------|----------------------------|--------------------|---------------------|
| 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.
**/

View File

@@ -2,5 +2,5 @@
/**
* @defgroup Widgets Custom GTK Widgets
*
* @ingroup GUI
*/

View File

@@ -24,14 +24,15 @@
*/
/**
* @addtogroup MainApplication
* @addtogroup external-renderer
* @{
*/
#include "external-renderer.h"
#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)
{

View File

@@ -23,23 +23,24 @@
* @author Mario Hüttel <mario.huettel@gmx.net>
*/
/** @addtogroup MainApplication
/** @addtogroup GUI
* @{
*/
#include "gds-render-gui.h"
#include <stdio.h>
#include "gds-utils/gds-parser.h"
#include <gtk/gtk.h>
#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 <gds-render/gds-render-gui.h>
#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/conv-settings-dialog.h>
#include <gds-render/geometric/cell-geometrics.h>
#include <gds-render/version.h>
enum gds_render_gui_signal_sig_ids {SIGNAL_WINDOW_CLOSED = 0, SIGNAL_COUNT};
@@ -144,6 +145,7 @@ static void on_load_gds(gpointer button, gpointer user)
"Open GDSII", GTK_RESPONSE_ACCEPT,
NULL);
file_chooser = GTK_FILE_CHOOSER(open_dialog);
/* Add GDS II Filter */
filter = gtk_file_filter_new();
gtk_file_filter_add_pattern(filter, "*.gds");
@@ -296,6 +298,7 @@ static void on_convert_clicked(gpointer button, gpointer user)
renderer_settings_dialog_set_database_unit_scale(settings, cell_to_render->parent_library->unit_in_meters);
renderer_settings_dialog_set_cell_height(settings, height);
renderer_settings_dialog_set_cell_width(settings, width);
g_object_set(G_OBJECT(settings), "cell-name", cell_to_render->name, NULL);
res = gtk_dialog_run(GTK_DIALOG(settings));
if (res == GTK_RESPONSE_OK) {

View File

@@ -34,8 +34,6 @@
* @{
*/
#include "gds-parser.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -43,6 +41,8 @@
#include <math.h>
#include <cairo.h>
#include <gds-render/gds-utils/gds-parser.h>
/**
* @brief Default units assumed for library.
* @note This value is usually overwritten with the value defined in the library.

View File

@@ -33,9 +33,10 @@
* @{
*/
#include "gds-tree-checker.h"
#include <stdio.h>
#include <gds-render/gds-utils/gds-tree-checker.h>
int gds_tree_check_cell_references(struct gds_library *lib)
{
GList *cell_iter;
@@ -175,6 +176,16 @@ int gds_tree_check_reference_loops(struct gds_library *lib)
/* iterate through references and check if loop exists */
res = gds_tree_check_iterate_ref_and_check(cell_to_check, &visited_cells);
if (visited_cells) {
/* If cell contains no loop, print error when list not empty.
* In case of a loop, it is completely normal that the list is not empty,
* due to the instant return from gds_tree_check_iterate_ref_and_check()
*/
if (res == 0)
fprintf(stderr, "Visited cell list should be empty. This is a bug. Please report this.\n");
g_list_free(visited_cells);
}
if (res < 0) {
/* Error */
return res;
@@ -189,10 +200,6 @@ int gds_tree_check_reference_loops(struct gds_library *lib)
}
if (visited_cells) {
fprintf(stderr, "Visited cell list should be empty. This is a bug. Please report this.\n");
g_list_free(visited_cells);
}
return loop_count;
}

View File

@@ -24,14 +24,15 @@
*/
/**
* @addtogroup trigonometric
* @addtogroup geometric
* @{
*/
#include <stdio.h>
#include "bounding-box.h"
#include <math.h>
#include <gds-render/geometric/bounding-box.h>
#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))

View File

@@ -18,16 +18,17 @@
*/
/**
* @file cell-trigonometrics.c
* @file cell-geometrics.c
* @brief Calculation of gds_cell trigonometrics
* @author Mario Hüttel <mario.huettel@gmx.net>
*/
#include "cell-trigonometrics.h"
#include <math.h>
#include <gds-render/geometric/cell-geometrics.h>
/**
* @addtogroup trigonometric
* @addtogroup geometric
* @{
*/

View File

@@ -24,14 +24,15 @@
*/
/**
* @addtogroup trigonometric
* @addtogroup geometric
* @{
*/
#include "vector-operations.h"
#include <math.h>
#include <stdlib.h>
#include <gds-render/geometric/vector-operations.h>
#define ABS_DBL(a) ((a) < 0 ? -(a) : (a))
double vector_2d_scalar_multipy(struct vector_2d *a, struct vector_2d *b)

View File

@@ -21,11 +21,11 @@
* @brief Header File for Cairo output renderer
* @author Mario Hüttel <mario.huettel@gmx.net>
*/
#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 <gds-render/gds-utils/gds-types.h>
#include <gds-render/layer/layer-info.h>
/** @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_ */

View File

@@ -24,12 +24,13 @@
*/
/**
* @addtogroup MainApplication
* @addtogroup cmdline
* @{
*/
#ifndef _COMMAND_LINE_H_
#define _COMMAND_LINE_H_
#include <glib.h>
/**
@@ -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,

View File

@@ -24,14 +24,14 @@
*/
/**
* @addtogroup MainApplication
* @addtogroup external-renderer
* @{
*/
#ifndef _EXTERNAL_RENDERER_H_
#define _EXTERNAL_RENDERER_H_
#include "gds-utils/gds-types.h"
#include <gds-render/gds-utils/gds-types.h>
#include <glib.h>
/**

View File

@@ -27,7 +27,7 @@
#define _GDS_RENDER_GUI_
/**
* @addtogroup MainApplication
* @addtogroup GUI
* @{
*/

View File

@@ -28,11 +28,12 @@
* @{
*/
#ifndef __GDSPARSE_H__
#define __GDSPARSE_H__
#ifndef _GDSPARSER_H_
#define _GDSPARSER_H_
#include <glib.h>
#include "gds-types.h"
#include <gds-render/gds-utils/gds-types.h>
#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_ */

View File

@@ -31,7 +31,7 @@
#ifndef _GDS_TREE_CHECKER_H_
#define _GDS_TREE_CHECKER_H_
#include "gds-types.h"
#include <gds-render/gds-utils/gds-types.h>
/**
* @brief gds_tree_check_cell_references checks if all child cell references can be resolved in the given library

View File

@@ -69,8 +69,8 @@ struct gds_point {
* @brief Stores the result of the cell checks.
*/
struct gds_cell_checks {
int unresolved_child_count; /**< @brief Number of unresolved cell instances inside this cell. Default: GDS_CELL_CHECK_NOT_RUN */
int affected_by_reference_loop; /**< @brief 1 if the cell is affected by a reference loop and therefore not renderable. Default: GDS_CELL_CHECK_NOT_RUN*/
int unresolved_child_count; /**< @brief Number of unresolved cell instances inside this cell. Default: @ref GDS_CELL_CHECK_NOT_RUN */
int affected_by_reference_loop; /**< @brief 1 if the cell is affected by a reference loop and therefore not renderable. Default: @ref GDS_CELL_CHECK_NOT_RUN*/
/**
* @brief For the internal use of the checker.
* @warning Do not use this structure and its contents!

View File

@@ -24,14 +24,15 @@
*/
/**
* @addtogroup trigonometric
* @addtogroup geometric
* @{
*/
#ifndef _BOUNDING_BOX_H_
#define _BOUNDING_BOX_H_
#include <glib.h>
#include "vector-operations.h"
#include <gds-render/geometric/vector-operations.h>
#include <stdbool.h>
union bounding_box {

View File

@@ -18,30 +18,30 @@
*/
/**
* @file cell-trigonometrics.h
* @brief Calculation of gds_cell trigonometrics
* @file cell-geometrics.h
* @brief Calculation of gds_cell geometrics
* @author Mario Hüttel <mario.huettel@gmx.net>
*/
/**
* @addtogroup trigonometric
* @addtogroup geometric
* @{
*/
#ifndef _CELL_TRIGONOMETRICS_H_
#define _CELL_TRIGONOMETRICS_H_
#ifndef _CELL_GEOMETRICS_H_
#define _CELL_GEOMETRICS_H_
#include "bounding-box.h"
#include "../gds-utils/gds-types.h"
#include <gds-render/geometric/bounding-box.h>
#include <gds-render/gds-utils/gds-types.h>
/**
* @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
* @param cell Toplevel cell
* @warning Path handling not yet implemented correctly.
*/
void calculate_cell_bounding_box(union bounding_box *box, struct gds_cell *cell);
#endif /* _CELL_TRIGONOMETRICS_H_ */
#endif /* _CELL_GEOMETRICS_H_ */
/** @} */

View File

@@ -24,7 +24,7 @@
*/
/**
* @addtogroup trigonometric
* @addtogroup geometric
* @{
*/

View File

@@ -31,10 +31,11 @@
* @{
*/
#include "../gds-utils/gds-types.h"
#include <glib.h>
#include <stdio.h>
#include "../layer/layer-info.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 */

View File

@@ -0,0 +1,51 @@
/*
* 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 layer-info.h
* @brief Helper functions and definition of layer info struct
* @author Mario Hüttel <mario.huettel@gmx.net>
*/
#ifndef _LAYER_INFO_H_
#define _LAYER_INFO_H_
#include <gtk/gtk.h>
/**
* @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_

View File

@@ -23,6 +23,11 @@
* @author Mario Hüttel <mario.huettel@gmx.net>
*/
/**
* @addtogroup layer-selector
* @{
*/
#ifndef __LAYER_SELECTOR_H__
#define __LAYER_SELECTOR_H__
@@ -88,3 +93,5 @@ void layer_selector_force_sort(LayerSelector *selector, enum layer_selector_sort
G_END_DECLS
#endif /* __LAYER_SELECTOR_H__ */
/** @} */

View File

@@ -27,12 +27,13 @@
#define __MAPPING_PARSER_H__
/**
* @addtogroup MainApplication
* @addtogroup Mapping-Parser
* @{
*/
#include <gtk/gtk.h>
#include "widgets/layer-element.h"
#include <glib.h>
#include <gds-render/widgets/layer-element.h>
/**
* @brief Load a line from \p stream and parse try to parse it as layer information

View File

@@ -17,6 +17,17 @@
* along with GDSII-Converter. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file lib-cell-renderer.h
* @brief Header file for the LibCellRenderer GObject Class
* @author Mario Hüttel <mario.huettel@gmx.net>
*/
/**
* @addtogroup LibCellRenderer
* @{
*/
#ifndef __LIB_CELL_RENDERER_H__
#define __LIB_CELL_RENDERER_H__
@@ -27,8 +38,12 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE(LibCellRenderer, lib_cell_renderer, LIB_CELL, RENDERER, GtkCellRendererText)
#define TYPE_LIB_CELL_RENDERER (lib_cell_renderer_get_type())
/** @{
* Error levels
*/
#define LIB_CELL_RENDERER_ERROR_WARN (1U<<0)
#define LIB_CELL_RENDERER_ERROR_ERR (1U<<1)
/** @} */
typedef struct _LibCellRenderer {
/* Inheritance */
@@ -36,9 +51,20 @@ typedef struct _LibCellRenderer {
/* Custom Elements */
} LibCellRenderer;
/**
* @brief lib_cell_renderer_get_type
* @return GObject Type
*/
GType lib_cell_renderer_get_type(void);
/**
* @brief Create a new renderer for renderering @ref gds_cell and @ref gds_library elements.
* @return New renderer object
*/
GtkCellRenderer *lib_cell_renderer_new(void);
G_END_DECLS
#endif /* __LIB_CELL_RENDERER_H__ */
/** @} */

View File

@@ -24,7 +24,7 @@
*/
/**
* @addtogroup MainApplication
* @addtogroup GUI
* @{
*/

View File

@@ -18,11 +18,11 @@
*/
/**
* @addtogroup MainApplication
* @addtogroup version
* @{
*/
/** @brief This string holds the 'git describe' version of the app */
extern char *_app_version_string;
/** @brief This string holds the @ref git-version-num of the app */
extern const char *_app_version_string;
/** @} */

View File

@@ -24,7 +24,8 @@
*/
/**
* @addtogroup Widgets
* @addtogroup RendererSettingsDialog
* @ingroup Widgets
* @{
*/

View File

@@ -24,7 +24,8 @@
*/
/**
* @addtogroup Widgets
* @addtogroup LayerElement
* @ingroup Widgets
* @{
*/

View File

@@ -23,9 +23,10 @@
* @author Mario Hüttel <mario.huettel@gmx.net>
*/
#include "latex-output.h"
#include <math.h>
#include <gds-render/latex-renderer/latex-output.h>
/**
* @addtogroup LaTeX-Renderer
* @{

View File

@@ -1,9 +1,33 @@
/*
* 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 layer-info.c
* @brief Helper functions for layer info struct
* @author Mario Hüttel <mario.huettel@gmx.net>
*/
#include "layer-info.h"
#include <gds-render/layer/layer-info.h>
void layer_info_delete_struct(struct layer_info *info)
{
if (info)
free(info);
}

View File

@@ -1,26 +0,0 @@
#ifndef _LAYER_INFO_H_
#define _LAYER_INFO_H_
#include <gtk/gtk.h>
/**
* @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_

View File

@@ -24,20 +24,21 @@
*/
/**
* @addtogroup MainApplication
* @addtogroup layer-selector
* @{
*/
#include "layer-selector.h"
#include "layer-info.h"
#include "../gds-utils/gds-parser.h"
#include "../widgets/layer-element.h"
#include "../mapping-parser.h"
#include <glib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <gds-render/layer/layer-selector.h>
#include <gds-render/layer/layer-info.h>
#include <gds-render/gds-utils/gds-parser.h>
#include <gds-render/widgets/layer-element.h>
#include <gds-render/layer/mapping-parser.h>
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/
*/
@@ -101,8 +101,9 @@ static void sel_layer_element_drag_end(GtkWidget *widget, GdkDragContext *contex
gtk_style_context_remove_class(gtk_widget_get_style_context(row), "drag-hover");
}
static void sel_layer_element_drag_data_get(GtkWidget *widget, GdkDragContext *context, GtkSelectionData *selection_data,
guint info, guint time, gpointer data)
static void sel_layer_element_drag_data_get(GtkWidget *widget, GdkDragContext *context,
GtkSelectionData *selection_data,
guint info, guint time, gpointer data)
{
(void)context;
(void)info;
@@ -216,10 +217,12 @@ static gboolean layer_selector_drag_motion(GtkWidget *widget, GdkDragContext *co
if (y < hover_row_y + hover_row_height/2) {
row_after = row;
row_before = GTK_WIDGET(layer_selector_get_row_before(GTK_LIST_BOX(widget), GTK_LIST_BOX_ROW(row)));
row_before = GTK_WIDGET(layer_selector_get_row_before(GTK_LIST_BOX(widget),
GTK_LIST_BOX_ROW(row)));
} else {
row_before = row;
row_after = GTK_WIDGET(layer_selector_get_row_after(GTK_LIST_BOX(widget), GTK_LIST_BOX_ROW(row)));
row_after = GTK_WIDGET(layer_selector_get_row_after(GTK_LIST_BOX(widget),
GTK_LIST_BOX_ROW(row)));
}
} else {
row_before = GTK_WIDGET(layer_selector_get_last_row(GTK_LIST_BOX(widget)));

View File

@@ -25,11 +25,11 @@
*/
/**
* @addtogroup MainApplication
* @addtogroup Mapping-Parser
* @{
*/
#include "mapping-parser.h"
#include <gds-render/layer/mapping-parser.h>
int mapping_parser_load_line(GDataInputStream *stream, gboolean *export, char **name, int *layer, GdkRGBA *color)
{

83
main.c
View File

@@ -17,19 +17,42 @@
* along with GDSII-Converter. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file main.c
* @brief main.c
* @author Mario Hüttel <mario.huettel@gmx.net>
*/
#include <stdio.h>
#include <gtk/gtk.h>
#include <glib.h>
#include "gds-render-gui.h"
#include "command-line.h"
#include "external-renderer.h"
#include "version/version.h"
#include <gds-render/gds-render-gui.h>
#include <gds-render/command-line.h>
#include <gds-render/external-renderer.h>
#include <gds-render/version.h>
/**
* @brief Structure containing The GtkApplication and a list containing the GdsRenderGui objects.
*/
struct application_data {
GtkApplication *app;
GList *gui_list;
};
/**
* @brief Callback for the menu entry 'Quit'
*
* Destroys all GUIs contained in the application_data structure
* provided by \p user_data.
*
* The complete suspension of all main windows leads to the termination of the
* GApplication.
*
* @param action unused
* @param parameter unused
* @param user_data application_data structure
*/
static void app_quit(GSimpleAction *action, GVariant *parameter, gpointer user_data)
{
struct application_data * const appdata = (struct application_data *)user_data;
@@ -48,6 +71,15 @@ static void app_quit(GSimpleAction *action, GVariant *parameter, gpointer user_d
appdata->gui_list = NULL;
}
/**
* @brief Callback for the 'About' menu entry
*
* This function shows the about dialog.
*
* @param action GSimpleAction, unused
* @param parameter Unused.
* @param user_data Unused
*/
static void app_about(GSimpleAction *action, GVariant *parameter, gpointer user_data)
{
GtkBuilder *builder;
@@ -82,11 +114,23 @@ static void app_about(GSimpleAction *action, GVariant *parameter, gpointer user_
g_object_unref(builder);
}
/**
* @brief Contains the application menu entries
*/
const static GActionEntry app_actions[] = {
{"quit", app_quit, NULL, NULL, NULL, {0}},
{"about", app_about, NULL, NULL, NULL, {0}}
};
/**
* @brief Called when a GUI main window is closed
*
* The GdsRenderGui object associated with the closed main window
* is removed from the list of open GUIs (\p user_data) and unreferenced.
*
* @param gui The GUI instance the closed main window belongs to
* @param user_data List of GUIs
*/
static void gui_window_closed_callback(GdsRenderGui *gui, gpointer user_data)
{
GList **gui_list = (GList **)user_data;
@@ -96,6 +140,11 @@ static void gui_window_closed_callback(GdsRenderGui *gui, gpointer user_data)
g_object_unref(gui);
}
/**
* @brief Activation of the GUI
* @param app The GApplication reference
* @param user_data Used to store the individual GUI instances.
*/
static void gapp_activate(GApplication *app, gpointer user_data)
{
GtkWindow *main_window;
@@ -114,12 +163,25 @@ static void gapp_activate(GApplication *app, gpointer user_data)
gtk_widget_show(GTK_WIDGET(main_window));
}
/**
* @brief Start the graphical interface.
*
* This function starts the GUI. If there's already a
* running instance of this program, a second window will be
* created in that instance and the second one is terminated.
*
* @param argc
* @param argv
* @return
*/
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;
@@ -157,12 +219,21 @@ static int start_gui(int argc, char **argv)
return app_status;
}
static void print_version()
/**
* @brief Print the application version string to stdout
*/
static void print_version(void)
{
printf("This is gds-render, version: %s\n\nFor a list of supported commands execute with --help option.\n",
_app_version_string);
}
/**
* @brief The "entry point" of the application
* @param argc Number of command line parameters
* @param argv Command line parameters
* @return Execution status of the application
*/
int main(int argc, char **argv)
{
int i;

View File

@@ -17,8 +17,19 @@
* along with GDSII-Converter. If not, see <http://www.gnu.org/licenses/>.
*/
#include "lib-cell-renderer.h"
#include "../gds-utils/gds-types.h"
/**
* @file lib-cell-renderer.c
* @brief LibCellRenderer GObject Class
* @author Mario Hüttel <mario.huettel@gmx.net>
*/
/**
* @addtogroup LibCellRenderer
* @{
*/
#include <gds-render/tree-renderer/lib-cell-renderer.h>
#include <gds-render/gds-utils/gds-types.h>
G_DEFINE_TYPE(LibCellRenderer, lib_cell_renderer, GTK_TYPE_CELL_RENDERER_TEXT)
@@ -107,11 +118,12 @@ static void lib_cell_renderer_get_property(GObject *object,
}
}
static GParamSpec *properties [PROP_COUNT];
static GParamSpec *properties[PROP_COUNT];
void lib_cell_renderer_class_init(LibCellRendererClass *klass)
{
GObjectClass *oclass = G_OBJECT_CLASS(klass);
oclass->constructed = lib_cell_renderer_constructed;
oclass->set_property = lib_cell_renderer_set_property;
oclass->get_property = lib_cell_renderer_get_property;
@@ -132,3 +144,5 @@ GtkCellRenderer *lib_cell_renderer_new()
{
return GTK_CELL_RENDERER(g_object_new(TYPE_LIB_CELL_RENDERER, NULL));
}
/** @} */

View File

@@ -24,13 +24,13 @@
*/
/**
* @addtogroup MainApplication
* @addtogroup GUI
* @{
*/
#include "tree-store.h"
#include "lib-cell-renderer.h"
#include "../gds-utils/gds-types.h"
#include <gds-render/tree-renderer/tree-store.h>
#include <gds-render/tree-renderer/lib-cell-renderer.h>
#include <gds-render/gds-utils/gds-types.h>
/**
* @brief this function olny allows cells to be selected

View File

@@ -1 +1 @@
git describe --tags
git describe --tags --dirty

View File

@@ -17,13 +17,15 @@
* along with GDSII-Converter. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @addtogroup MainApplication
* @defgroup version Version Number
* See @ref git-version-num
* @addtogroup version
* @{
*/
#ifdef PROJECT_GIT_VERSION
#define xstr(a) str(a)
#define str(a) #a
const char *_app_version_string = xstr(PROJECT_GIT_VERSION);

View File

@@ -24,11 +24,12 @@
*/
/**
* @addtogroup Widgets
* @addtogroup RendererSettingsDialog
* @ingroup Widgets
* @{
*/
#include "conv-settings-dialog.h"
#include <gds-render/widgets/conv-settings-dialog.h>
struct _RendererSettingsDialog {
GtkDialog parent;
@@ -53,10 +54,60 @@ struct _RendererSettingsDialog {
G_DEFINE_TYPE(RendererSettingsDialog, renderer_settings_dialog, GTK_TYPE_DIALOG)
enum {
PROP_CELL_NAME = 1,
PROP_COUNT
};
static GParamSpec *properties[PROP_COUNT];
static void renderer_settings_dialog_set_property(GObject *object, guint property_id,
const GValue *value, GParamSpec *pspec)
{
const gchar *title = NULL;
switch (property_id) {
case PROP_CELL_NAME:
title = g_value_get_string(value);
if (title)
gtk_window_set_title(GTK_WINDOW(object), title);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
break;
}
}
static void renderer_settings_dialog_get_property(GObject *object, guint property_id,
GValue *value, GParamSpec *pspec)
{
const gchar *title;
switch (property_id) {
case PROP_CELL_NAME:
title = gtk_window_get_title(GTK_WINDOW(object));
g_value_set_string(value, title);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
break;
}
}
static void renderer_settings_dialog_class_init(RendererSettingsDialogClass *klass)
{
/* No special code needed. Child cells are destroyed automatically due to reference counter */
return;
GObjectClass *oclass = G_OBJECT_CLASS(klass);
/* Override virtual functions */
oclass->set_property = renderer_settings_dialog_set_property;
oclass->get_property = renderer_settings_dialog_get_property;
properties[PROP_CELL_NAME] = g_param_spec_string("cell-name",
"cell-name",
"Cell name to be displayed in header bar",
"",
G_PARAM_READWRITE);
g_object_class_install_properties(oclass, PROP_COUNT, properties);
}
static void show_tex_options(RendererSettingsDialog *self)
@@ -140,6 +191,10 @@ static double convert_number_to_engineering(double input, const char **out_prefi
1E2, 1E3, 1E6, 1E9, 1E12, 1E15, 1E18, 1E21, 1E24};
const int prefix_count = (int)(sizeof(prefixes)/sizeof(char *));
/* If pointer is invalid, return NaN */
if (!out_prefix)
return 0.0 / 0.0;
/* Start with the 2nd smallest prefix */
for (idx = 1; idx < prefix_count; idx++) {
if (input < scale[idx]) {

View File

@@ -31,11 +31,12 @@
*/
/**
* @addtogroup Widgets
* @addtogroup LayerElement
* @ingroup Widgets
* @{
*/
#include "layer-element.h"
#include <gds-render/widgets/layer-element.h>
G_DEFINE_TYPE(LayerElement, layer_element, GTK_TYPE_LIST_BOX_ROW)