diff --git a/command-line.c b/command-line.c index 9585692..66bc9ac 100644 --- a/command-line.c +++ b/command-line.c @@ -24,7 +24,7 @@ */ /** - * @addtogroup MainApplication + * @addtogroup cmdline * @{ */ diff --git a/doxygen/cairo-renderer.dox b/doxygen/cairo-renderer.dox new file mode 100644 index 0000000..e6cafd8 --- /dev/null +++ b/doxygen/cairo-renderer.dox @@ -0,0 +1,4 @@ +/** + * @defgroup Cairo-Renderer Cairo Renderer + * @ingroup renderers + */ diff --git a/doxygen/command-line.dox b/doxygen/command-line.dox new file mode 100644 index 0000000..ef67c92 --- /dev/null +++ b/doxygen/command-line.dox @@ -0,0 +1,3 @@ +/** + * @defgroup cmdline Command Line Interface + */ diff --git a/doxygen/external-renderer.dox b/doxygen/external-renderer.dox new file mode 100644 index 0000000..4d03c51 --- /dev/null +++ b/doxygen/external-renderer.dox @@ -0,0 +1,4 @@ +/** + * @defgroup external-renderer External Shared Object Renderer + * @ingroup renderers + */ diff --git a/doxygen/gui.dox b/doxygen/gui.dox index 34a27fd..4d48c77 100644 --- a/doxygen/gui.dox +++ b/doxygen/gui.dox @@ -2,5 +2,4 @@ /** * @defgroup GUI Graphical User Interface - * @ingroup MainApplication */ diff --git a/doxygen/latex-renderer.dox b/doxygen/latex-renderer.dox new file mode 100644 index 0000000..bafb197 --- /dev/null +++ b/doxygen/latex-renderer.dox @@ -0,0 +1,4 @@ +/** + * @defgroup LaTeX-Renderer LaTeX/TikZ Renderer + * @ingroup renderers + */ diff --git a/doxygen/layer-selector.dox b/doxygen/layer-selector.dox new file mode 100644 index 0000000..504814a --- /dev/null +++ b/doxygen/layer-selector.dox @@ -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. + */ diff --git a/doxygen/lib-cell-renderer.dox b/doxygen/lib-cell-renderer.dox new file mode 100644 index 0000000..ac03f4e --- /dev/null +++ b/doxygen/lib-cell-renderer.dox @@ -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. + * + */ diff --git a/doxygen/main-application.dox b/doxygen/main-application.dox deleted file mode 100644 index 8eccef2..0000000 --- a/doxygen/main-application.dox +++ /dev/null @@ -1,6 +0,0 @@ -/* This file only contains help information for doxygen */ - -/** - * @defgroup MainApplication Main Application - * - */ diff --git a/doxygen/renderers.dox b/doxygen/renderers.dox new file mode 100644 index 0000000..753c7ec --- /dev/null +++ b/doxygen/renderers.dox @@ -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. + */ diff --git a/external-renderer.c b/external-renderer.c index c30d897..c073366 100644 --- a/external-renderer.c +++ b/external-renderer.c @@ -24,7 +24,7 @@ */ /** - * @addtogroup MainApplication + * @addtogroup external-renderer * @{ */ diff --git a/gds-render-gui.c b/gds-render-gui.c index e6789c3..9e84868 100644 --- a/gds-render-gui.c +++ b/gds-render-gui.c @@ -23,7 +23,7 @@ * @author Mario Hüttel */ -/** @addtogroup MainApplication +/** @addtogroup GUI * @{ */ @@ -145,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"); diff --git a/include/gds-render/command-line.h b/include/gds-render/command-line.h index a0f5ee5..aee05b4 100644 --- a/include/gds-render/command-line.h +++ b/include/gds-render/command-line.h @@ -24,7 +24,7 @@ */ /** - * @addtogroup MainApplication + * @addtogroup cmdline * @{ */ diff --git a/include/gds-render/external-renderer.h b/include/gds-render/external-renderer.h index a648775..2ded59c 100644 --- a/include/gds-render/external-renderer.h +++ b/include/gds-render/external-renderer.h @@ -24,7 +24,7 @@ */ /** - * @addtogroup MainApplication + * @addtogroup external-renderer * @{ */ diff --git a/include/gds-render/gds-render-gui.h b/include/gds-render/gds-render-gui.h index 46dd3a2..16680a0 100644 --- a/include/gds-render/gds-render-gui.h +++ b/include/gds-render/gds-render-gui.h @@ -27,7 +27,7 @@ #define _GDS_RENDER_GUI_ /** - * @addtogroup MainApplication + * @addtogroup GUI * @{ */ diff --git a/include/gds-render/layer/layer-info.h b/include/gds-render/layer/layer-info.h index 1cb9c67..3866bb2 100644 --- a/include/gds-render/layer/layer-info.h +++ b/include/gds-render/layer/layer-info.h @@ -18,7 +18,7 @@ */ /** - * @file layer-info.c + * @file layer-info.h * @brief Helper functions and definition of layer info struct * @author Mario Hüttel */ diff --git a/include/gds-render/layer/layer-selector.h b/include/gds-render/layer/layer-selector.h index 2719434..011eca1 100644 --- a/include/gds-render/layer/layer-selector.h +++ b/include/gds-render/layer/layer-selector.h @@ -23,6 +23,11 @@ * @author Mario Hüttel */ +/** + * @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__ */ + +/** @} */ diff --git a/include/gds-render/layer/mapping-parser.h b/include/gds-render/layer/mapping-parser.h index 3afa5c1..85cfb42 100644 --- a/include/gds-render/layer/mapping-parser.h +++ b/include/gds-render/layer/mapping-parser.h @@ -27,7 +27,7 @@ #define __MAPPING_PARSER_H__ /** - * @addtogroup MainApplication + * @addtogroup Mapping-Parser * @{ */ diff --git a/include/gds-render/tree-renderer/lib-cell-renderer.h b/include/gds-render/tree-renderer/lib-cell-renderer.h index b71888a..d1f075e 100644 --- a/include/gds-render/tree-renderer/lib-cell-renderer.h +++ b/include/gds-render/tree-renderer/lib-cell-renderer.h @@ -17,6 +17,17 @@ * along with GDSII-Converter. If not, see . */ +/** + * @file lib-cell-renderer.h + * @brief Header file for the LibCellRenderer GObject Class + * @author Mario Hüttel + */ + +/** + * @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__ */ + +/** @} */ diff --git a/include/gds-render/tree-renderer/tree-store.h b/include/gds-render/tree-renderer/tree-store.h index 02a2ee7..8f0e65e 100644 --- a/include/gds-render/tree-renderer/tree-store.h +++ b/include/gds-render/tree-renderer/tree-store.h @@ -24,7 +24,7 @@ */ /** - * @addtogroup MainApplication + * @addtogroup GUI * @{ */ diff --git a/include/gds-render/version.h b/include/gds-render/version.h index 27b7cc3..67ec6db 100644 --- a/include/gds-render/version.h +++ b/include/gds-render/version.h @@ -18,11 +18,11 @@ */ /** - * @addtogroup MainApplication + * @addtogroup version * @{ */ /** @brief This string holds the 'git describe' version of the app */ -extern char *_app_version_string; +extern const char *_app_version_string; /** @} */ diff --git a/layer/layer-info.c b/layer/layer-info.c index d9796bb..bba5b5e 100644 --- a/layer/layer-info.c +++ b/layer/layer-info.c @@ -23,11 +23,6 @@ * @author Mario Hüttel */ -/** - * @addtogroup MainApplication - * @{ - */ - #include void layer_info_delete_struct(struct layer_info *info) @@ -36,4 +31,3 @@ void layer_info_delete_struct(struct layer_info *info) free(info); } -/** @} */ diff --git a/layer/layer-selector.c b/layer/layer-selector.c index b3c4566..148717f 100644 --- a/layer/layer-selector.c +++ b/layer/layer-selector.c @@ -24,7 +24,7 @@ */ /** - * @addtogroup MainApplication + * @addtogroup layer-selector * @{ */ diff --git a/layer/mapping-parser.c b/layer/mapping-parser.c index 5d3c96b..ad0d1e7 100644 --- a/layer/mapping-parser.c +++ b/layer/mapping-parser.c @@ -25,7 +25,7 @@ */ /** - * @addtogroup MainApplication + * @addtogroup Mapping-Parser * @{ */ diff --git a/main.c b/main.c index 494c248..a206ac5 100644 --- a/main.c +++ b/main.c @@ -17,6 +17,12 @@ * along with GDSII-Converter. If not, see . */ +/** + * @file main.c + * @brief main.c + * @author Mario Hüttel + */ + #include #include #include @@ -26,11 +32,27 @@ #include #include +/** + * @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; @@ -49,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; @@ -83,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 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; @@ -97,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; @@ -115,6 +163,17 @@ 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) { @@ -160,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; diff --git a/tree-renderer/lib-cell-renderer.c b/tree-renderer/lib-cell-renderer.c index 357c21e..c8e078a 100644 --- a/tree-renderer/lib-cell-renderer.c +++ b/tree-renderer/lib-cell-renderer.c @@ -17,6 +17,17 @@ * along with GDSII-Converter. If not, see . */ +/** + * @file lib-cell-renderer.c + * @brief LibCellRenderer GObject Class + * @author Mario Hüttel + */ + +/** + * @addtogroup LibCellRenderer + * @{ + */ + #include #include @@ -132,3 +143,5 @@ GtkCellRenderer *lib_cell_renderer_new() { return GTK_CELL_RENDERER(g_object_new(TYPE_LIB_CELL_RENDERER, NULL)); } + +/** @} */ diff --git a/tree-renderer/tree-store.c b/tree-renderer/tree-store.c index 36dd97c..6b15217 100644 --- a/tree-renderer/tree-store.c +++ b/tree-renderer/tree-store.c @@ -24,7 +24,7 @@ */ /** - * @addtogroup MainApplication + * @addtogroup GUI * @{ */ diff --git a/version/version.c b/version/version.c index 961817a..78af0ae 100644 --- a/version/version.c +++ b/version/version.c @@ -17,8 +17,10 @@ * along with GDSII-Converter. If not, see . */ + /** - * @addtogroup MainApplication + * @defgroup version Git-based Versioning Number + * @addtogroup version * @{ */