Compare commits
24 Commits
d6fb6ba6b0
...
v1.1
Author | SHA1 | Date | |
---|---|---|---|
8ffcba830d | |||
4f02854401 | |||
f2b02c0c1f | |||
e739305f46 | |||
7f7b4cc7bf | |||
d08cd3626d | |||
ef180f3ea2 | |||
74ecde9807 | |||
cd2cf8c5c7 | |||
63eb65a3c4 | |||
aa413732f1 | |||
54165a8475 | |||
c3c4636334 | |||
f4de9c4402 | |||
a016a18587 | |||
a3626e7b33 | |||
4dcafeed3f | |||
03e2b15571 | |||
e278ad6d94 | |||
8d8af8d211 | |||
4bed016f01 | |||
e8c7f78af4 | |||
60e20f45cc | |||
cd55137951 |
@@ -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}
|
||||
)
|
||||
|
||||
|
@@ -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.
|
||||
|
@@ -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.
|
@@ -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.
|
||||
|
@@ -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"
|
||||
|
4
doxygen/cairo-renderer.dox
Normal file
4
doxygen/cairo-renderer.dox
Normal file
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* @defgroup Cairo-Renderer Cairo Renderer
|
||||
* @ingroup renderers
|
||||
*/
|
3
doxygen/command-line.dox
Normal file
3
doxygen/command-line.dox
Normal file
@@ -0,0 +1,3 @@
|
||||
/**
|
||||
* @defgroup cmdline Command Line Interface
|
||||
*/
|
67
doxygen/compilation.dox
Normal file
67
doxygen/compilation.dox
Normal 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. |
|
||||
*/
|
4
doxygen/external-renderer.dox
Normal file
4
doxygen/external-renderer.dox
Normal file
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* @defgroup external-renderer External Shared Object Renderer
|
||||
* @ingroup renderers
|
||||
*/
|
@@ -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!
|
||||
*/
|
@@ -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
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 |
4
doxygen/latex-renderer.dox
Normal file
4
doxygen/latex-renderer.dox
Normal file
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* @defgroup LaTeX-Renderer LaTeX/TikZ Renderer
|
||||
* @ingroup renderers
|
||||
*/
|
7
doxygen/layer-selector.dox
Normal file
7
doxygen/layer-selector.dox
Normal 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.
|
||||
*/
|
18
doxygen/lib-cell-renderer.dox
Normal file
18
doxygen/lib-cell-renderer.dox
Normal 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.
|
||||
*
|
||||
*/
|
@@ -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
9
doxygen/renderers.dox
Normal 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.
|
||||
*/
|
@@ -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
36
doxygen/versioning.dox
Normal 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.
|
||||
|
||||
**/
|
@@ -2,5 +2,5 @@
|
||||
|
||||
/**
|
||||
* @defgroup Widgets Custom GTK Widgets
|
||||
*
|
||||
* @ingroup GUI
|
||||
*/
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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) {
|
||||
|
@@ -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.
|
||||
@@ -79,7 +79,26 @@ enum gds_record {
|
||||
BOX = 0x2D00,
|
||||
LAYER = 0x0D02,
|
||||
WIDTH = 0x0F03,
|
||||
PATHTYPE = 0x2102
|
||||
PATHTYPE = 0x2102,
|
||||
COLROW = 0x1302,
|
||||
AREF = 0x0B00
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Struct representing an array instantiation.
|
||||
*
|
||||
* This struct is defined locally because it is not exposed to the outside of the
|
||||
* parser. Array references are internally converted to a bunch of standard @ref gds_cell_instance elements.
|
||||
*/
|
||||
struct gds_cell_array_instance {
|
||||
char ref_name[CELL_NAME_MAX]; /**< @brief Name of referenced cell */
|
||||
struct gds_cell *cell_ref; /**< @brief Referenced gds_cell structure */
|
||||
struct gds_point control_points[3]; /**< @brief The three control points */
|
||||
int flipped; /**< @brief Mirror each instance on x-axis before rotation */
|
||||
double angle; /**< @brief Angle of rotation for each instance (counter clockwise) in degrees */
|
||||
double magnification; /**< @brief Magnification of each instance */
|
||||
int columns; /**< @brief Column count */
|
||||
int rows; /**< @brief Row count */
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -112,6 +131,36 @@ static int name_cell_ref(struct gds_cell_instance *cell_inst,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Name cell reference
|
||||
* @param cell_inst Cell reference
|
||||
* @param bytes Length of name
|
||||
* @param data Name
|
||||
* @return 0 if successful
|
||||
*/
|
||||
static int name_array_cell_ref(struct gds_cell_array_instance *cell_inst,
|
||||
unsigned int bytes, char *data)
|
||||
{
|
||||
int len;
|
||||
|
||||
if (cell_inst == NULL) {
|
||||
GDS_ERROR("Naming array cell ref with no opened cell ref");
|
||||
return -1;
|
||||
}
|
||||
data[bytes] = 0; // Append '0'
|
||||
len = (int)strlen(data);
|
||||
if (len > CELL_NAME_MAX-1) {
|
||||
GDS_ERROR("Cell name '%s' too long: %d\n", data, len);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* else: */
|
||||
strcpy(cell_inst->ref_name, data);
|
||||
GDS_INF("\tCell referenced: %s\n", cell_inst->ref_name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Convert GDS 8-byte real to double
|
||||
* @param data 8 Byte GDS real
|
||||
@@ -133,7 +182,7 @@ static double gds_convert_double(const char *data)
|
||||
if (data[i] != 0)
|
||||
break;
|
||||
if (i == 7) {
|
||||
/* 7 bytes all 0 */
|
||||
/* All 8 bytes are 0 */
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
@@ -327,9 +376,9 @@ static GList *append_cell_ref(GList *curr_list, struct gds_cell_instance **insta
|
||||
if (inst) {
|
||||
inst->cell_ref = NULL;
|
||||
inst->ref_name[0] = 0;
|
||||
inst->magnification = 1;
|
||||
inst->magnification = 1.0;
|
||||
inst->flipped = 0;
|
||||
inst->angle = 0;
|
||||
inst->angle = 0.0;
|
||||
} else
|
||||
return NULL;
|
||||
|
||||
@@ -509,6 +558,62 @@ static void gds_parse_date(const char *buffer, int length, struct gds_time_field
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Convert AREF to a bunch of SREFs and append them to \p container_cell
|
||||
*
|
||||
* This function converts a single array reference (\p aref) to gds_cell_array_instance::rows * gds_cell_array_instance::columns
|
||||
* single references (SREFs). See @ref gds_cell_instance.
|
||||
*
|
||||
* Both gds_cell_array_instance::rows and gds_cell_array_instance::columns must be larger than zero.
|
||||
*
|
||||
* @param[in] aref Array reference to parse
|
||||
* @param[in] container_cell cell to add the converted single references to.
|
||||
*/
|
||||
static void convert_aref_to_sref(struct gds_cell_array_instance *aref, struct gds_cell *container_cell)
|
||||
{
|
||||
struct gds_point origin;
|
||||
struct gds_point row_shift_vector;
|
||||
struct gds_point col_shift_vector;
|
||||
struct gds_cell_instance *sref_inst;
|
||||
int col;
|
||||
int row;
|
||||
|
||||
if (!aref || !container_cell)
|
||||
return;
|
||||
|
||||
if (aref->columns == 0 || aref->rows == 0) {
|
||||
GDS_ERROR("Conversion of array instance aborted. No rows / columns.");
|
||||
return;
|
||||
}
|
||||
origin.x = aref->control_points[0].x;
|
||||
origin.y = aref->control_points[0].y;
|
||||
|
||||
row_shift_vector.x = (aref->control_points[2].x - origin.x) / aref->rows;
|
||||
row_shift_vector.y = (aref->control_points[2].y - origin.y) / aref->rows;
|
||||
col_shift_vector.x = (aref->control_points[1].x - origin.x) / aref->columns;
|
||||
col_shift_vector.y = (aref->control_points[1].y - origin.y) / aref->columns;
|
||||
|
||||
/* Iterate over columns and rows */
|
||||
for (col = 0; col < aref->columns; col++) {
|
||||
for (row = 0; row < aref->rows; row++) {
|
||||
/* Create new instance for this row/column and aconfigure data */
|
||||
container_cell->child_cells = append_cell_ref(container_cell->child_cells, &sref_inst);
|
||||
if (!sref_inst) {
|
||||
GDS_ERROR("Appending cell ref failed!");
|
||||
continue;
|
||||
}
|
||||
|
||||
sref_inst->angle = aref->angle;
|
||||
sref_inst->magnification = aref->magnification;
|
||||
sref_inst->flipped = aref->flipped;
|
||||
strncpy(sref_inst->ref_name, aref->ref_name, CELL_NAME_MAX);
|
||||
sref_inst->origin.x = origin.x + row_shift_vector.x * row + col_shift_vector.x * col;
|
||||
sref_inst->origin.y = origin.y + row_shift_vector.y * row + col_shift_vector.y * col;
|
||||
}
|
||||
}
|
||||
GDS_INF("Converted AREF to SREFs\n");
|
||||
}
|
||||
|
||||
int parse_gds_from_file(const char *filename, GList **library_list)
|
||||
{
|
||||
char *workbuff;
|
||||
@@ -522,6 +627,8 @@ int parse_gds_from_file(const char *filename, GList **library_list)
|
||||
struct gds_cell *current_cell = NULL;
|
||||
struct gds_graphics *current_graphics = NULL;
|
||||
struct gds_cell_instance *current_s_reference = NULL;
|
||||
struct gds_cell_array_instance *current_a_reference = NULL;
|
||||
struct gds_cell_array_instance temp_a_reference;
|
||||
int x, y;
|
||||
////////////
|
||||
GList *lib_list;
|
||||
@@ -583,6 +690,7 @@ int parse_gds_from_file(const char *filename, GList **library_list)
|
||||
}
|
||||
rec_type = gds_convert_unsigend_int16(workbuff);
|
||||
|
||||
|
||||
/* if begin: Allocate structures */
|
||||
switch (rec_type) {
|
||||
case BGNLIB:
|
||||
@@ -626,7 +734,7 @@ int parse_gds_from_file(const char *filename, GList **library_list)
|
||||
|
||||
current_cell->parent_library = current_lib;
|
||||
|
||||
GDS_INF("Entering Cell\n");
|
||||
GDS_INF("Entering cell\n");
|
||||
break;
|
||||
case ENDSTR:
|
||||
if (current_cell == NULL) {
|
||||
@@ -693,7 +801,6 @@ int parse_gds_from_file(const char *filename, GList **library_list)
|
||||
break;
|
||||
case ENDEL:
|
||||
if (current_graphics != NULL) {
|
||||
|
||||
GDS_INF("\tLeaving %s\n", (current_graphics->gfx_type == GRAPHIC_POLYGON ? "boundary" : "path"));
|
||||
current_graphics = NULL;
|
||||
}
|
||||
@@ -701,6 +808,12 @@ int parse_gds_from_file(const char *filename, GList **library_list)
|
||||
GDS_INF("\tLeaving Reference\n");
|
||||
current_s_reference = NULL;
|
||||
}
|
||||
if (current_a_reference != NULL) {
|
||||
GDS_INF("\tLeaving Array Reference\n");
|
||||
convert_aref_to_sref(current_a_reference, current_cell);
|
||||
current_a_reference = NULL;
|
||||
}
|
||||
|
||||
break;
|
||||
case XY:
|
||||
if (current_graphics) {
|
||||
@@ -709,24 +822,51 @@ int parse_gds_from_file(const char *filename, GList **library_list)
|
||||
if (rec_data_length != 8) {
|
||||
GDS_WARN("Instance has weird coordinates. Rendered output might be screwed!");
|
||||
}
|
||||
} else if (current_a_reference) {
|
||||
if (rec_data_length != (3*(4+4)))
|
||||
GDS_WARN("Array instance has weird coordinates. Rendered output might be screwed!");
|
||||
}
|
||||
break;
|
||||
case AREF:
|
||||
if (current_cell == NULL) {
|
||||
GDS_ERROR("Cell array reference outside of cell");
|
||||
run = -3;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
if (current_a_reference != NULL) {
|
||||
GDS_ERROR("Recursive cell array reference");
|
||||
run = -3;
|
||||
break;
|
||||
}
|
||||
|
||||
GDS_INF("Entering Array Reference\n");
|
||||
|
||||
/* Array references are coverted after fully declared. Therefore,
|
||||
* only a static buffer is needed
|
||||
*/
|
||||
current_a_reference = &temp_a_reference;
|
||||
current_a_reference->ref_name[0] = '\0';
|
||||
current_a_reference->angle = 0.0;
|
||||
current_a_reference->magnification = 1.0;
|
||||
current_a_reference->flipped = 0;
|
||||
current_a_reference->rows = 0;
|
||||
current_a_reference->columns = 0;
|
||||
break;
|
||||
case COLROW:
|
||||
case MAG:
|
||||
break;
|
||||
case ANGLE:
|
||||
break;
|
||||
case STRANS:
|
||||
break;
|
||||
case WIDTH:
|
||||
break;
|
||||
case PATHTYPE:
|
||||
break;
|
||||
case UNITS:
|
||||
case LIBNAME:
|
||||
case SNAME:
|
||||
case LAYER:
|
||||
case STRNAME:
|
||||
break;
|
||||
default:
|
||||
//GDS_WARN("Record: %04x, len: %u", (unsigned int)rec_type, (unsigned int)rec_data_length);
|
||||
GDS_INF("Unhandled Record: %04x, len: %u\n", (unsigned int)rec_type, (unsigned int)rec_data_length);
|
||||
break;
|
||||
} /* switch(rec_type) */
|
||||
|
||||
@@ -744,7 +884,7 @@ int parse_gds_from_file(const char *filename, GList **library_list)
|
||||
}
|
||||
|
||||
switch (rec_type) {
|
||||
|
||||
case AREF:
|
||||
case HEADER:
|
||||
case ENDLIB:
|
||||
case ENDSTR:
|
||||
@@ -756,6 +896,20 @@ int parse_gds_from_file(const char *filename, GList **library_list)
|
||||
case INVALID:
|
||||
break;
|
||||
|
||||
case COLROW:
|
||||
if (!current_a_reference) {
|
||||
GDS_ERROR("COLROW record defined outside of array instance");
|
||||
break;
|
||||
}
|
||||
if (rec_data_length != 4 || read != 4) {
|
||||
GDS_ERROR("COLUMN/ROW count record contains too few data. Won't set column and row counts (%d, %d)",
|
||||
rec_data_length, read);
|
||||
break;
|
||||
}
|
||||
current_a_reference->columns = (int)gds_convert_signed_int16(&workbuff[0]);
|
||||
current_a_reference->rows = (int)gds_convert_signed_int16(&workbuff[2]);
|
||||
GDS_INF("\tRows: %d\n\tColumns: %d\n", current_a_reference->rows, current_a_reference->columns);
|
||||
break;
|
||||
case UNITS:
|
||||
if (!current_lib) {
|
||||
GDS_WARN("Units defined outside of library!\n");
|
||||
@@ -799,19 +953,31 @@ int parse_gds_from_file(const char *filename, GList **library_list)
|
||||
GDS_INF("\t\tSet coordinate: %d/%d\n", x, y);
|
||||
|
||||
}
|
||||
} else if (current_a_reference) {
|
||||
for (i = 0; i < 3; i++) {
|
||||
x = gds_convert_signed_int(&workbuff[i*8]);
|
||||
y = gds_convert_signed_int(&workbuff[i*8+4]);
|
||||
current_a_reference->control_points[i].x = x;
|
||||
current_a_reference->control_points[i].y = y;
|
||||
GDS_INF("\tSet control point %d: %d/%d\n", i, x, y);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case STRANS:
|
||||
if (!current_s_reference) {
|
||||
if (current_s_reference) {
|
||||
current_s_reference->flipped = ((workbuff[0] & 0x80) ? 1 : 0);
|
||||
} else if (current_a_reference) {
|
||||
current_a_reference->flipped = ((workbuff[0] & 0x80) ? 1 : 0);
|
||||
} else {
|
||||
GDS_ERROR("Transformation defined outside of instance");
|
||||
break;
|
||||
}
|
||||
current_s_reference->flipped = ((workbuff[0] & 0x80) ? 1 : 0);
|
||||
break;
|
||||
|
||||
case SNAME:
|
||||
if (current_s_reference) {
|
||||
name_cell_ref(current_s_reference, (unsigned int)read, workbuff);
|
||||
} 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");
|
||||
}
|
||||
@@ -846,12 +1012,16 @@ int parse_gds_from_file(const char *filename, GList **library_list)
|
||||
current_s_reference->magnification = gds_convert_double(workbuff);
|
||||
GDS_INF("\t\tMagnification defined: %lf\n", current_s_reference->magnification);
|
||||
}
|
||||
if (current_a_reference != NULL) {
|
||||
current_a_reference->magnification = gds_convert_double(workbuff);
|
||||
GDS_INF("\t\tMagnification defined: %lf\n", current_a_reference->magnification);
|
||||
}
|
||||
break;
|
||||
case ANGLE:
|
||||
if (rec_data_length != 8) {
|
||||
GDS_WARN("Angle is not an 8 byte real. Results may be wrong");
|
||||
}
|
||||
if (current_graphics != NULL && current_s_reference != NULL) {
|
||||
if (current_graphics != NULL && current_s_reference != NULL && current_a_reference != NULL) {
|
||||
GDS_ERROR("Open Graphics and Cell Reference\n\tMissing ENDEL?");
|
||||
run = -6;
|
||||
break;
|
||||
@@ -860,6 +1030,10 @@ int parse_gds_from_file(const char *filename, GList **library_list)
|
||||
current_s_reference->angle = gds_convert_double(workbuff);
|
||||
GDS_INF("\t\tAngle defined: %lf\n", current_s_reference->angle);
|
||||
}
|
||||
if (current_a_reference != NULL) {
|
||||
current_a_reference->angle = gds_convert_double(workbuff);
|
||||
GDS_INF("\t\tAngle defined: %lf\n", current_a_reference->angle);
|
||||
}
|
||||
break;
|
||||
case PATHTYPE:
|
||||
if (current_graphics == NULL) {
|
||||
|
@@ -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,17 @@ 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);
|
||||
visited_cells = NULL;
|
||||
}
|
||||
|
||||
if (res < 0) {
|
||||
/* Error */
|
||||
return res;
|
||||
@@ -189,10 +201,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;
|
||||
}
|
||||
|
@@ -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))
|
@@ -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
|
||||
* @{
|
||||
*/
|
||||
|
@@ -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)
|
@@ -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_ */
|
@@ -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,
|
@@ -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>
|
||||
|
||||
/**
|
@@ -27,7 +27,7 @@
|
||||
#define _GDS_RENDER_GUI_
|
||||
|
||||
/**
|
||||
* @addtogroup MainApplication
|
||||
* @addtogroup GUI
|
||||
* @{
|
||||
*/
|
||||
|
@@ -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_ */
|
@@ -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
|
@@ -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!
|
@@ -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 {
|
@@ -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_ */
|
||||
|
||||
/** @} */
|
@@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup trigonometric
|
||||
* @addtogroup geometric
|
||||
* @{
|
||||
*/
|
||||
|
@@ -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 */
|
||||
|
51
include/gds-render/layer/layer-info.h
Normal file
51
include/gds-render/layer/layer-info.h
Normal 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_
|
@@ -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__ */
|
||||
|
||||
/** @} */
|
@@ -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
|
@@ -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__ */
|
||||
|
||||
/** @} */
|
@@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup MainApplication
|
||||
* @addtogroup GUI
|
||||
* @{
|
||||
*/
|
||||
|
@@ -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;
|
||||
|
||||
/** @} */
|
@@ -24,7 +24,8 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup Widgets
|
||||
* @addtogroup RendererSettingsDialog
|
||||
* @ingroup Widgets
|
||||
* @{
|
||||
*/
|
||||
|
@@ -24,7 +24,8 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup Widgets
|
||||
* @addtogroup LayerElement
|
||||
* @ingroup Widgets
|
||||
* @{
|
||||
*/
|
||||
|
@@ -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
|
||||
* @{
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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_
|
@@ -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)));
|
||||
|
@@ -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
83
main.c
@@ -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;
|
||||
|
@@ -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));
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
@@ -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
|
||||
|
@@ -1 +1 @@
|
||||
git describe --tags
|
||||
git describe --tags --dirty
|
||||
|
@@ -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);
|
||||
|
@@ -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]) {
|
||||
|
@@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user