7 Commits

Author SHA1 Message Date
33deba8ca4 Command line: Fix auto-guessing of SVG file name. 2019-03-15 18:03:29 +01:00
b0c25a4bcf Add version number to about dialog 2019-03-14 21:01:16 +01:00
899c8daf81 Add documentation target, which at the moment is only an alias for the
doxygen target
2019-03-14 19:24:17 +01:00
a9c7b9f61f Gui: Menubar: GActionEntry definition expanded to set unused values to zero, especially pointers 2019-03-14 19:10:06 +01:00
55fd080796 Fix Issue #11
* Set NON_UNIQUE Flag of GApplication. When opening a second program instance, Glib will not try to open a second window inside the first instance, which was the feature, that caused problems
2019-03-14 19:02:17 +01:00
178ef2d5b2 Insert quick fix, that prevents starting multiple instances in GUI mode the same time 2019-03-13 22:54:52 +01:00
6a78e0df15 Fix background color of drag element in Drag and Drop code for the layer
selector.

With this commit Issue #8 is fixed.
2019-03-13 21:01:49 +01:00
4 changed files with 32 additions and 30 deletions

View File

@@ -43,3 +43,4 @@ SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/glade/resources.c PROPER
target_link_libraries(${PROJECT_NAME} ${GLIB_LDFLAGS} ${GTK3_LDFLAGS} ${CAIRO_LDFLAGS} m version ${CMAKE_DL_LIBS})
install (TARGETS ${PROJECT_NAME} DESTINATION bin)
add_custom_target(documentation DEPENDS doxygen)

View File

@@ -1,10 +1,10 @@
find_package(Doxygen)
if (DOXYGEN_FOUND)
add_custom_target(doxygen
COMMAND ./build-doxygen.sh "${PROJECT_BINARY_DIR}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Generating documentation with Doxygen")
else (DOXYGEN_FOUND)
message("Doxygen need to be installed to generate the doxygen documentation")
endif (DOXYGEN_FOUND)

View File

@@ -193,8 +193,8 @@ static const char *dnd_additional_css =
" border-bottom: 1px solid alpha(gray,0.5); "
"}"
".row.drag-icon { "
" background: white; "
" border: 1px solid black; "
" background: #282828; "
" border: 1px solid blue; "
"}"
".row.drag-row { "
" color: gray; "

53
main.c
View File

@@ -26,8 +26,8 @@
#include "version/version.h"
struct application_data {
GtkApplication *app;
GtkWindow *main_window;
GtkApplication *app;
GtkWindow *main_window;
};
static void app_quit(GSimpleAction *action, GVariant *parameter, gpointer user_data)
@@ -50,6 +50,7 @@ static void app_about(GSimpleAction *action, GVariant *parameter, gpointer user_
builder = gtk_builder_new_from_resource("/about.glade");
dialog = GTK_DIALOG(gtk_builder_get_object(builder, "about-dialog"));
gtk_window_set_transient_for(GTK_WINDOW(dialog), appdata->main_window);
gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(dialog), _app_version_string);
gtk_dialog_run(dialog);
gtk_widget_destroy(GTK_WIDGET(dialog));
@@ -57,8 +58,8 @@ static void app_about(GSimpleAction *action, GVariant *parameter, gpointer user_
}
const static GActionEntry app_actions[] = {
{"quit", app_quit},
{"about", app_about}
{"quit", app_quit, NULL, NULL, NULL, {0}},
{"about", app_about, NULL, NULL, NULL, {0}}
};
static void gapp_activate(GApplication *app, gpointer user_data)
@@ -82,7 +83,7 @@ static int start_gui(int argc, char **argv)
GMenu *m_quit;
GMenu *m_about;
gapp = gtk_application_new("de.shimatta.gds-render", G_APPLICATION_FLAGS_NONE);
gapp = gtk_application_new("de.shimatta.gds-render", G_APPLICATION_NON_UNIQUE);
g_application_register(G_APPLICATION(gapp), NULL, NULL);
g_signal_connect(gapp, "activate", G_CALLBACK(gapp_activate), &appdata);
@@ -110,7 +111,7 @@ static int start_gui(int argc, char **argv)
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);
_app_version_string);
}
int main(int argc, char **argv)
@@ -128,21 +129,21 @@ int main(int argc, char **argv)
int app_status = 0;
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 },
{"scale", 's', 0, G_OPTION_ARG_INT, &scale, "Divide output coordinates by <SCALE>", "<SCALE>" },
{"tex-output", 'o', 0, G_OPTION_ARG_FILENAME, &texname, "Optional path for TeX file", "PATH" },
{"pdf-output", 'O', 0, G_OPTION_ARG_FILENAME, &pdfname, "Optional path for PDF file", "PATH" },
//{"svg-output", 0, 0, G_OPTION_ARG_FILENAME, &svgname, "Optional path for PDF file", "PATH"},
{"mapping", 'm', 0, G_OPTION_ARG_FILENAME, &mappingname, "Path for Layer Mapping File", "PATH" },
{"cell", 'c', 0, G_OPTION_ARG_STRING, &cellname, "Cell to render", "NAME" },
{"tex-standalone", 'a', 0, G_OPTION_ARG_NONE, &pdf_standalone, "Create standalone PDF", NULL },
{"tex-layers", 'l', 0, G_OPTION_ARG_NONE, &pdf_layers, "Create PDF Layers (OCG)", NULL },
{"custom-render-lib", 'P', 0, G_OPTION_ARG_FILENAME, &custom_library_path, "Path to a custom shared object, that implements the " EXTERNAL_LIBRARY_FUNCTION " function", "PATH"},
{"external-lib-output", 'e', 0, G_OPTION_ARG_FILENAME, &custom_library_file_name, "Output path for external render library", "PATH"},
{NULL}
{"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 },
{"scale", 's', 0, G_OPTION_ARG_INT, &scale, "Divide output coordinates by <SCALE>", "<SCALE>" },
{"tex-output", 'o', 0, G_OPTION_ARG_FILENAME, &texname, "Optional path for TeX file", "PATH" },
{"pdf-output", 'O', 0, G_OPTION_ARG_FILENAME, &pdfname, "Optional path for PDF file", "PATH" },
//{"svg-output", 0, 0, G_OPTION_ARG_FILENAME, &svgname, "Optional path for PDF file", "PATH"},
{"mapping", 'm', 0, G_OPTION_ARG_FILENAME, &mappingname, "Path for Layer Mapping File", "PATH" },
{"cell", 'c', 0, G_OPTION_ARG_STRING, &cellname, "Cell to render", "NAME" },
{"tex-standalone", 'a', 0, G_OPTION_ARG_NONE, &pdf_standalone, "Create standalone PDF", NULL },
{"tex-layers", 'l', 0, G_OPTION_ARG_NONE, &pdf_layers, "Create PDF Layers (OCG)", NULL },
{"custom-render-lib", 'P', 0, G_OPTION_ARG_FILENAME, &custom_library_path, "Path to a custom shared object, that implements the " EXTERNAL_LIBRARY_FUNCTION " function", "PATH"},
{"external-lib-output", 'e', 0, G_OPTION_ARG_FILENAME, &custom_library_file_name, "Output path for external render library", "PATH"},
{NULL}
};
context = g_option_context_new(" FILE - Convert GDS file <FILE> to graphic");
@@ -181,13 +182,13 @@ int main(int argc, char **argv)
if (!pdfname)
pdfname = g_strdup_printf("./%s.pdf", basename);
if (!pdfname)
pdfname = g_strdup_printf("./%s.svg", basename);
if (!svgname)
svgname = g_strdup_printf("./%s.svg", basename);
command_line_convert_gds(gds_name, pdfname, texname, pdf, tikz,
mappingname, cellname, (double)scale,
pdf_layers, pdf_standalone, svg, svgname,
custom_library_path, custom_library_file_name);
mappingname, cellname, (double)scale,
pdf_layers, pdf_standalone, svg, svgname,
custom_library_path, custom_library_file_name);
/* Clean up */
g_free(pdfname);
g_free(texname);