Compare commits
No commits in common. "1ec0f9b297522dfde1a6d296efdc2ed9f01384bc" and "bbf08a4d6e44768d831f8a07f5a985323731f54b" have entirely different histories.
1ec0f9b297
...
bbf08a4d6e
@ -8,7 +8,6 @@ pkg_check_modules(CAIRO REQUIRED cairo)
|
||||
|
||||
add_subdirectory(glade)
|
||||
add_subdirectory(doxygen)
|
||||
add_subdirectory(version)
|
||||
|
||||
include_directories(${GLIB_INCLUDE_DIRS} ${GTK3_INCLUDE_DIRS} ${CAIRO_INCLUDE_DIRS})
|
||||
link_directories(${GLIB_LINK_DIRS} ${GTK3_LINK_DIRS} ${CAIRO_LINK_DIRS})
|
||||
@ -36,8 +35,7 @@ add_compile_options(-Wall)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/glade/resources.c)
|
||||
add_dependencies(${PROJECT_NAME} glib-resources)
|
||||
add_dependencies(${PROJECT_NAME} version)
|
||||
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/glade/resources.c PROPERTIES GENERATED 1)
|
||||
target_link_libraries(${PROJECT_NAME} ${GLIB_LDFLAGS} ${GTK3_LDFLAGS} ${CAIRO_LDFLAGS} m version ${CMAKE_DL_LIBS})
|
||||
target_link_libraries(${PROJECT_NAME} ${GLIB_LDFLAGS} ${GTK3_LDFLAGS} ${CAIRO_LDFLAGS} m ${CMAKE_DL_LIBS})
|
||||
install (TARGETS ${PROJECT_NAME} DESTINATION bin)
|
||||
|
||||
|
@ -7,11 +7,12 @@
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">gds-render</property>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar" id="header-bar">
|
||||
<object class="GtkHeaderBar">
|
||||
<property name="name">header</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="title" translatable="yes">GDS Renderer</property>
|
||||
<property name="subtitle" translatable="yes">GDSII to PDF/TikZ Converter</property>
|
||||
<property name="show_close_button">True</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button-load-gds">
|
||||
|
@ -37,7 +37,6 @@
|
||||
#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-parser/gds-tree-checker.h"
|
||||
|
||||
@ -372,7 +371,6 @@ GtkWindow *create_main_window()
|
||||
GtkWidget *listbox;
|
||||
GtkWidget *conv_button;
|
||||
GtkWidget *search_entry;
|
||||
GtkHeaderBar *header_bar;
|
||||
static GList *gds_libs;
|
||||
static struct open_button_data open_data;
|
||||
static struct convert_button_data conv_data;
|
||||
@ -416,10 +414,6 @@ GtkWindow *create_main_window()
|
||||
g_signal_connect(G_OBJECT(gtk_tree_view_get_selection(cell_tree)), "changed",
|
||||
G_CALLBACK(cell_selection_changed), conv_button);
|
||||
|
||||
/* Set version in main window subtitle */
|
||||
header_bar = GTK_HEADER_BAR(gtk_builder_get_object(main_builder, "header-bar"));
|
||||
gtk_header_bar_set_subtitle(header_bar, _app_version_string);
|
||||
|
||||
g_object_unref(main_builder);
|
||||
|
||||
return conv_data.main_window;
|
||||
|
17
main.c
17
main.c
@ -23,7 +23,6 @@
|
||||
#include "main-window.h"
|
||||
#include "command-line.h"
|
||||
#include "external-renderer.h"
|
||||
#include "version/version.h"
|
||||
|
||||
struct application_data {
|
||||
GtkApplication *app;
|
||||
@ -107,12 +106,6 @@ static int start_gui(int argc, char **argv)
|
||||
return app_status;
|
||||
}
|
||||
|
||||
static void print_version()
|
||||
{
|
||||
printf("This is gds-render, version: %s\n\nFor a list of supported commands execute with --help option.\n",
|
||||
_app_version_string);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GError *error = NULL;
|
||||
@ -121,14 +114,12 @@ int main(int argc, char **argv)
|
||||
gchar *basename;
|
||||
gchar *pdfname = NULL, *texname = NULL, *mappingname = NULL, *cellname = NULL, *svgname = NULL;
|
||||
gboolean tikz = FALSE, pdf = FALSE, pdf_layers = FALSE, pdf_standalone = FALSE, svg = FALSE;
|
||||
gboolean version = FALSE;
|
||||
gchar *custom_library_path = NULL;
|
||||
gchar *custom_library_file_name = NULL;
|
||||
int scale = 1000;
|
||||
int app_status = 0;
|
||||
int app_status;
|
||||
|
||||
GOptionEntry entries[] = {
|
||||
{"version", 'v', 0, G_OPTION_ARG_NONE, &version, "Print version", NULL},
|
||||
{"tikz", 't', 0, G_OPTION_ARG_NONE, &tikz, "Output TikZ code", NULL },
|
||||
{"pdf", 'p', 0, G_OPTION_ARG_NONE, &pdf, "Output PDF document", NULL },
|
||||
//{"svg", 'S', 0, G_OPTION_ARG_NONE, &svg, "Output SVG image", NULL },
|
||||
@ -154,11 +145,6 @@ int main(int argc, char **argv)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (version) {
|
||||
print_version();
|
||||
goto ret_status;
|
||||
}
|
||||
|
||||
if (argc >= 2) {
|
||||
if (scale < 1) {
|
||||
printf("Scale < 1 not allowed. Setting to 1\n");
|
||||
@ -202,6 +188,5 @@ int main(int argc, char **argv)
|
||||
app_status = start_gui(argc, argv);
|
||||
}
|
||||
|
||||
ret_status:
|
||||
return app_status;
|
||||
}
|
||||
|
@ -1,5 +0,0 @@
|
||||
add_library(version STATIC "version.c")
|
||||
execute_process(COMMAND bash ./generate-version-string.sh
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_VER)
|
||||
target_compile_definitions(version PUBLIC PROJECT_GIT_VERSION=${GIT_VER})
|
@ -1 +0,0 @@
|
||||
git describe --tags
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* GDSII-Converter
|
||||
* Copyright (C) 2018 Mario Hüttel <mario.huettel@gmx.net>
|
||||
*
|
||||
* This file is part of GDSII-Converter.
|
||||
*
|
||||
* GDSII-Converter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* GDSII-Converter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GDSII-Converter. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup MainApplication
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef PROJECT_GIT_VERSION
|
||||
|
||||
#define xstr(a) str(a)
|
||||
#define str(a) #a
|
||||
const char *_app_version_string = xstr(PROJECT_GIT_VERSION);
|
||||
#else
|
||||
const char *_app_version_string = "! version not set !";
|
||||
#endif
|
||||
|
||||
/** @} */
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* GDSII-Converter
|
||||
* Copyright (C) 2018 Mario Hüttel <mario.huettel@gmx.net>
|
||||
*
|
||||
* This file is part of GDSII-Converter.
|
||||
*
|
||||
* GDSII-Converter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* GDSII-Converter is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GDSII-Converter. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup MainApplication
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @brief This string holds the 'git describe' version of the app */
|
||||
extern char *_app_version_string;
|
||||
|
||||
/** @} */
|
Loading…
Reference in New Issue
Block a user