Compare commits
9 Commits
8950a533b4
...
v0.3.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
9dc1d20d6c
|
|||
|
66a3b3e259
|
|||
|
3ff0f117f9
|
|||
|
de291ffddb
|
|||
|
baaca4c58f
|
|||
|
7499f92811
|
|||
|
deceafb4f4
|
|||
|
3465557a5b
|
|||
|
082f1aa41c
|
@@ -1,6 +1,6 @@
|
|||||||
# The last version with Windows XP support is 3.13, we want to keep that
|
# The last version with Windows XP support is 3.13, we want to keep that
|
||||||
cmake_minimum_required (VERSION 3.10)
|
cmake_minimum_required (VERSION 3.10)
|
||||||
project (logdiag VERSION 0.2.1 DESCRIPTION "Schematic editor" LANGUAGES C)
|
project (logdiag VERSION 0.3.0 DESCRIPTION "Schematic editor" LANGUAGES C)
|
||||||
|
|
||||||
# Options
|
# Options
|
||||||
option (OPTION_CLANG_TIDY "Enable use of clang-tidy" OFF)
|
option (OPTION_CLANG_TIDY "Enable use of clang-tidy" OFF)
|
||||||
@@ -68,9 +68,11 @@ endif ()
|
|||||||
# Dependencies
|
# Dependencies
|
||||||
find_package (PkgConfig REQUIRED)
|
find_package (PkgConfig REQUIRED)
|
||||||
pkg_check_modules (GTK3 REQUIRED gtk+-3.0 json-glib-1.0)
|
pkg_check_modules (GTK3 REQUIRED gtk+-3.0 json-glib-1.0)
|
||||||
|
link_directories (${GTK3_LIBRARY_DIRS})
|
||||||
|
|
||||||
if (NOT WIN32)
|
if (NOT WIN32)
|
||||||
pkg_search_module (Lua REQUIRED lua>=5.2 lua5.3 lua-5.3 lua5.2 lua-5.2)
|
pkg_search_module (Lua REQUIRED lua>=5.2 lua5.3 lua-5.3 lua5.2 lua-5.2)
|
||||||
|
link_directories (${Lua_LIBRARY_DIRS})
|
||||||
else ()
|
else ()
|
||||||
# For whatever reason this now seems to be required
|
# For whatever reason this now seems to be required
|
||||||
set (LUA_INCLUDE_DIR "${WIN32_DEPENDS_PATH}/include")
|
set (LUA_INCLUDE_DIR "${WIN32_DEPENDS_PATH}/include")
|
||||||
@@ -83,9 +85,6 @@ else ()
|
|||||||
set (Lua_INCLUDE_DIRS ${LUA_INCLUDE_DIR})
|
set (Lua_INCLUDE_DIRS ${LUA_INCLUDE_DIR})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# This actually fucks up MinGW cross-compilation if omitted
|
|
||||||
link_directories (${GTK3_LIBRARY_DIRS})
|
|
||||||
|
|
||||||
# Localization
|
# Localization
|
||||||
find_package (Gettext REQUIRED)
|
find_package (Gettext REQUIRED)
|
||||||
file (GLOB project_PO_FILES ${PROJECT_SOURCE_DIR}/po/*.po)
|
file (GLOB project_PO_FILES ${PROJECT_SOURCE_DIR}/po/*.po)
|
||||||
@@ -143,6 +142,7 @@ set (logdiag_TESTS
|
|||||||
diagram)
|
diagram)
|
||||||
|
|
||||||
set (logdiag_SOURCES
|
set (logdiag_SOURCES
|
||||||
|
${PROJECT_BINARY_DIR}/gresource.c
|
||||||
src/ld-window-main.c
|
src/ld-window-main.c
|
||||||
src/logdiag.c)
|
src/logdiag.c)
|
||||||
set (logdiag_HEADERS
|
set (logdiag_HEADERS
|
||||||
@@ -155,34 +155,74 @@ if (WIN32)
|
|||||||
list (APPEND logdiag_SOURCES share/logdiag.rc)
|
list (APPEND logdiag_SOURCES share/logdiag.rc)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# Generate a configure file
|
|
||||||
add_definitions (-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36)
|
|
||||||
add_definitions (-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36)
|
|
||||||
configure_file (config.h.in ${PROJECT_BINARY_DIR}/config.h)
|
|
||||||
include_directories (${PROJECT_BINARY_DIR})
|
|
||||||
|
|
||||||
# Generate marshallers
|
# Generate marshallers
|
||||||
find_program (GLIB_GENMARSHAL_EXECUTABLE glib-genmarshal)
|
|
||||||
if (NOT GLIB_GENMARSHAL_EXECUTABLE)
|
|
||||||
message (FATAL_ERROR "glib-genmarshal not found")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
function (glib_genmarshal listfile prefix)
|
function (glib_genmarshal listfile prefix)
|
||||||
get_filename_component (basename "${listfile}" NAME_WE)
|
find_program (GLIB_GENMARSHAL_EXECUTABLE glib-genmarshal)
|
||||||
set (command_base ${GLIB_GENMARSHAL_EXECUTABLE} --prefix ${prefix}
|
if (NOT GLIB_GENMARSHAL_EXECUTABLE)
|
||||||
|
message (FATAL_ERROR "glib-genmarshal not found")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
get_filename_component (_basename "${listfile}" NAME_WE)
|
||||||
|
set (_command_base ${GLIB_GENMARSHAL_EXECUTABLE} --prefix ${prefix}
|
||||||
"${listfile}")
|
"${listfile}")
|
||||||
|
|
||||||
add_custom_command (OUTPUT ${basename}.c ${basename}.h
|
add_custom_command (OUTPUT ${_basename}.c ${_basename}.h
|
||||||
COMMAND ${command_base} --body > ${basename}.c
|
COMMAND ${_command_base} --body > ${_basename}.c
|
||||||
COMMAND ${command_base} --header > ${basename}.h
|
COMMAND ${_command_base} --header > ${_basename}.h
|
||||||
DEPENDS "${listfile}"
|
DEPENDS "${listfile}"
|
||||||
COMMENT "Generating marshallers source files" VERBATIM)
|
COMMENT "Generating marshallers source files" VERBATIM)
|
||||||
endfunction ()
|
endfunction ()
|
||||||
|
|
||||||
glib_genmarshal (${PROJECT_SOURCE_DIR}/liblogdiag/ld-marshal.list ld_marshal)
|
glib_genmarshal (${PROJECT_SOURCE_DIR}/liblogdiag/ld-marshal.list ld_marshal)
|
||||||
|
|
||||||
include_directories (${PROJECT_SOURCE_DIR})
|
# Generate resources
|
||||||
include_directories (${GTK3_INCLUDE_DIRS} ${Lua_INCLUDE_DIRS})
|
function (glib_compile_resources xml target)
|
||||||
|
find_program (GLIB_COMPILE_RESOURCES_EXECUTABLE glib-compile-resources)
|
||||||
|
if (NOT GLIB_COMPILE_RESOURCES_EXECUTABLE)
|
||||||
|
message (FATAL_ERROR "glib-compile-resources not found")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# glib-compile-resources reads paths relative to its working directory
|
||||||
|
get_filename_component (_xml_path "${xml}" PATH)
|
||||||
|
|
||||||
|
# On Windows, the final Makefile may contain:
|
||||||
|
# cd e:\abc && ...
|
||||||
|
# That won't actually change the directory. We have to do:
|
||||||
|
# cd e:\abc && e: && ...
|
||||||
|
set (_prefix)
|
||||||
|
if (WIN32 AND "${_xml_path}" MATCHES "^.:[/\\\\]")
|
||||||
|
string (SUBSTRING "${_xml_path}" 0 2 _xml_drive)
|
||||||
|
set (_prefix ${_xml_drive} &&)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# VERBATIM would cause problems, so it is not used here
|
||||||
|
add_custom_command (OUTPUT ${target}
|
||||||
|
COMMAND ${_prefix} ${GLIB_COMPILE_RESOURCES_EXECUTABLE}
|
||||||
|
--generate-source --target ${target} "${xml}" DEPENDS "${xml}"
|
||||||
|
WORKING_DIRECTORY "${_xml_path}" COMMENT "Compiling resources")
|
||||||
|
|
||||||
|
execute_process (COMMAND ${GLIB_COMPILE_RESOURCES_EXECUTABLE}
|
||||||
|
--generate-dependencies "${xml}"
|
||||||
|
WORKING_DIRECTORY "${_xml_path}" OUTPUT_VARIABLE _deps)
|
||||||
|
string (REPLACE "\n" ";" _deps "${_deps}")
|
||||||
|
foreach (_dep ${_deps})
|
||||||
|
set_property (SOURCE "${target}"
|
||||||
|
APPEND PROPERTY OBJECT_DEPENDS "${_xml_path}/${_dep}")
|
||||||
|
endforeach ()
|
||||||
|
|
||||||
|
configure_file ("${xml}" glib-compile-resources.stamp COPYONLY)
|
||||||
|
endfunction ()
|
||||||
|
|
||||||
|
glib_compile_resources (${PROJECT_SOURCE_DIR}/share/logdiag.gresource.xml
|
||||||
|
${PROJECT_BINARY_DIR}/gresource.c)
|
||||||
|
|
||||||
|
# Generate a configure file
|
||||||
|
add_definitions (-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36)
|
||||||
|
add_definitions (-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36)
|
||||||
|
configure_file (config.h.in ${PROJECT_BINARY_DIR}/config.h)
|
||||||
|
|
||||||
|
include_directories (${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR}
|
||||||
|
${GTK3_INCLUDE_DIRS} ${Lua_INCLUDE_DIRS})
|
||||||
set (logdiag_LIBS ${GTK3_LIBRARIES} ${Lua_LIBRARIES} m)
|
set (logdiag_LIBS ${GTK3_LIBRARIES} ${Lua_LIBRARIES} m)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
@@ -350,7 +390,7 @@ else ()
|
|||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
install (DIRECTORY docs/user-guide DESTINATION share/doc/${PROJECT_NAME})
|
install (DIRECTORY docs/user-guide DESTINATION share/doc/${PROJECT_NAME})
|
||||||
install (DIRECTORY share/gui share/library DESTINATION share/${PROJECT_NAME})
|
install (DIRECTORY share/library DESTINATION share/${PROJECT_NAME})
|
||||||
install (FILES ${GSETTINGS_SCHEMAS} DESTINATION share/glib-2.0/schemas)
|
install (FILES ${GSETTINGS_SCHEMAS} DESTINATION share/glib-2.0/schemas)
|
||||||
install (CODE " # DESTDIR is not in use on Windows (WIN32 is only native here!)
|
install (CODE " # DESTDIR is not in use on Windows (WIN32 is only native here!)
|
||||||
if (WIN32 OR \"\$ENV{DESTDIR}\" STREQUAL \"\")
|
if (WIN32 OR \"\$ENV{DESTDIR}\" STREQUAL \"\")
|
||||||
|
|||||||
11
NEWS
11
NEWS
@@ -1,3 +1,14 @@
|
|||||||
|
Version 0.3.0
|
||||||
|
- Added basic print functionality (lines may have the wrong width).
|
||||||
|
- Fine-tuned rendering of a few symbols.
|
||||||
|
- Bound toggling of the grid to the # key, following Inkscape.
|
||||||
|
- Ensured all opened files are added to the list of recent files.
|
||||||
|
- View position is reset when opening files.
|
||||||
|
- Made the user guide available from the Help menu.
|
||||||
|
- The website link in the About dialog now opens on Windows XP.
|
||||||
|
- Put the project's license in the About dialog.
|
||||||
|
- Made Windows builds considerably slimmer.
|
||||||
|
|
||||||
Version 0.2.1
|
Version 0.2.1
|
||||||
- Set up grounds for 64-bit Windows builds using the latest GTK+ 3.
|
- Set up grounds for 64-bit Windows builds using the latest GTK+ 3.
|
||||||
- Made the Windows installer ask to uninstall previous versions first.
|
- Made the Windows installer ask to uninstall previous versions first.
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ q:lang(cs):after { content: "“"; }
|
|||||||
<p class="details">
|
<p class="details">
|
||||||
<span id="author">Přemysl Eric Janouch</span><br>
|
<span id="author">Přemysl Eric Janouch</span><br>
|
||||||
<span id="email"><a href="mailto:p@janouch.name">p@janouch.name</a></span><br>
|
<span id="email"><a href="mailto:p@janouch.name">p@janouch.name</a></span><br>
|
||||||
<span id="revnumber">verze 0.2.2,</span>
|
<span id="revnumber">verze 0.3.0,</span>
|
||||||
<span id="revdate">2021-10-28</span>
|
<span id="revdate">2021-10-28</span>
|
||||||
|
|
||||||
<p class="figure"><img src="logdiag-cs.png" alt="Okno programu logdiag">
|
<p class="figure"><img src="logdiag-cs.png" alt="Okno programu logdiag">
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ q:lang(en):after { content: "’"; }
|
|||||||
<p class="details">
|
<p class="details">
|
||||||
<span id="author">Přemysl Eric Janouch</span><br>
|
<span id="author">Přemysl Eric Janouch</span><br>
|
||||||
<span id="email"><a href="mailto:p@janouch.name">p@janouch.name</a></span><br>
|
<span id="email"><a href="mailto:p@janouch.name">p@janouch.name</a></span><br>
|
||||||
<span id="revnumber">version 0.2.2,</span>
|
<span id="revnumber">version 0.3.0,</span>
|
||||||
<span id="revdate">2021-10-28</span>
|
<span id="revdate">2021-10-28</span>
|
||||||
|
|
||||||
<p class="figure"><img src="logdiag-en.png" alt="logdiag program window">
|
<p class="figure"><img src="logdiag-en.png" alt="logdiag program window">
|
||||||
|
|||||||
@@ -3002,6 +3002,9 @@ ld_diagram_view_get_export_bounds (LdDiagramView *self, LdRectangle *rect)
|
|||||||
{
|
{
|
||||||
LdRectangle intermediate;
|
LdRectangle intermediate;
|
||||||
|
|
||||||
|
/* Presumably, cairo_recording_surface_ink_extents() could also be used,
|
||||||
|
* though DrawData::exposed_rect currently stands in the way.
|
||||||
|
*/
|
||||||
get_diagram_bounds (self, &intermediate);
|
get_diagram_bounds (self, &intermediate);
|
||||||
ld_diagram_view_diagram_to_widget_coords_rect (self, &intermediate, rect);
|
ld_diagram_view_diagram_to_widget_coords_rect (self, &intermediate, rect);
|
||||||
return ld_diagram_view_get_scale_in_px (self);
|
return ld_diagram_view_get_scale_in_px (self);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: logdiag 0.2.2\n"
|
"Project-Id-Version: logdiag 0.3.0\n"
|
||||||
"Report-Msgid-Bugs-To: https://git.janouch.name/p/logdiag/issues\n"
|
"Report-Msgid-Bugs-To: https://git.janouch.name/p/logdiag/issues\n"
|
||||||
"POT-Creation-Date: 2021-10-28 20:07+0200\n"
|
"POT-Creation-Date: 2021-10-28 20:07+0200\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ local render = function (cr)
|
|||||||
cr:curve_to (3, 0, 2, 2, 0, 2)
|
cr:curve_to (3, 0, 2, 2, 0, 2)
|
||||||
cr:line_to (-2, 2)
|
cr:line_to (-2, 2)
|
||||||
cr:curve_to (-1, 1, -1, -1, -2, -2)
|
cr:curve_to (-1, 1, -1, -1, -2, -2)
|
||||||
|
cr:close_path ()
|
||||||
cr:stroke ()
|
cr:stroke ()
|
||||||
|
|
||||||
-- The terminals
|
-- The terminals
|
||||||
|
|||||||
@@ -21,8 +21,7 @@ local render = function (cr)
|
|||||||
cr:line_to (-1, 0)
|
cr:line_to (-1, 0)
|
||||||
|
|
||||||
-- The terminals
|
-- The terminals
|
||||||
cr:move_to (-2, 0)
|
cr:line_to (-2, 0)
|
||||||
cr:line_to (-1, 0)
|
|
||||||
|
|
||||||
cr:move_to (1, 0)
|
cr:move_to (1, 0)
|
||||||
cr:line_to (2, 0)
|
cr:line_to (2, 0)
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ local render = function (cr)
|
|||||||
cr:move_to (-1, -1)
|
cr:move_to (-1, -1)
|
||||||
cr:line_to (1, 0)
|
cr:line_to (1, 0)
|
||||||
cr:line_to (-1, 1)
|
cr:line_to (-1, 1)
|
||||||
cr:line_to (-1, -1)
|
cr:close_path ()
|
||||||
|
|
||||||
-- The vertical line
|
-- The vertical line
|
||||||
cr:move_to (1, 1)
|
cr:move_to (1, 1)
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ local render = function (cr)
|
|||||||
cr:line_to (1.5, -0.5)
|
cr:line_to (1.5, -0.5)
|
||||||
cr:line_to (1.5, 0.5)
|
cr:line_to (1.5, 0.5)
|
||||||
cr:line_to (-1.5, 0.5)
|
cr:line_to (-1.5, 0.5)
|
||||||
cr:line_to (-1.5, -0.5)
|
cr:close_path ()
|
||||||
|
|
||||||
-- The terminals
|
-- The terminals
|
||||||
cr:move_to (-2, 0)
|
cr:move_to (-2, 0)
|
||||||
|
|||||||
7
share/logdiag.gresource.xml
Normal file
7
share/logdiag.gresource.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<gresources>
|
||||||
|
<gresource prefix="/logdiag">
|
||||||
|
<file>logdiag.ui</file>
|
||||||
|
<file alias="LICENSE">../LICENSE</file>
|
||||||
|
</gresource>
|
||||||
|
</gresources>
|
||||||
@@ -274,8 +274,8 @@ ld_window_main_init (LdWindowMain *self)
|
|||||||
priv->action_group, 0);
|
priv->action_group, 0);
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
gtk_ui_manager_add_ui_from_file
|
gtk_ui_manager_add_ui_from_resource
|
||||||
(priv->ui_manager, PROJECT_SHARE_DIR "gui/window-main.ui", &error);
|
(priv->ui_manager, "/logdiag/logdiag.ui", &error);
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
g_message ("building UI failed: %s", error->message);
|
g_message ("building UI failed: %s", error->message);
|
||||||
@@ -712,9 +712,10 @@ diagram_save (LdWindowMain *self, GtkWindow *dialog_parent,
|
|||||||
static gboolean
|
static gboolean
|
||||||
diagram_open (LdWindowMain *self, const gchar *filename)
|
diagram_open (LdWindowMain *self, const gchar *filename)
|
||||||
{
|
{
|
||||||
GError *error;
|
GError *error = NULL;
|
||||||
|
GFile *file;
|
||||||
|
gchar *uri;
|
||||||
|
|
||||||
error = NULL;
|
|
||||||
ld_diagram_load_from_file (self->priv->diagram, filename, &error);
|
ld_diagram_load_from_file (self->priv->diagram, filename, &error);
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
@@ -748,8 +749,17 @@ diagram_open (LdWindowMain *self, const gchar *filename)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
file = g_file_new_for_path (filename);
|
||||||
|
uri = g_file_get_uri (file);
|
||||||
|
g_object_unref (file);
|
||||||
|
gtk_recent_manager_add_item (gtk_recent_manager_get_default (), uri);
|
||||||
|
g_free (uri);
|
||||||
|
|
||||||
ld_diagram_set_modified (self->priv->diagram, FALSE);
|
ld_diagram_set_modified (self->priv->diagram, FALSE);
|
||||||
diagram_set_filename (self, g_strdup (filename));
|
diagram_set_filename (self, g_strdup (filename));
|
||||||
|
|
||||||
|
ld_diagram_view_set_x (self->priv->view, 0);
|
||||||
|
ld_diagram_view_set_y (self->priv->view, 0);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1153,6 +1163,10 @@ static void
|
|||||||
on_action_about (GtkAction *action, LdWindowMain *self)
|
on_action_about (GtkAction *action, LdWindowMain *self)
|
||||||
{
|
{
|
||||||
GtkWidget *about_dialog;
|
GtkWidget *about_dialog;
|
||||||
|
GBytes *license;
|
||||||
|
|
||||||
|
license = g_resources_lookup_data ("/logdiag/LICENSE",
|
||||||
|
G_RESOURCE_LOOKUP_FLAGS_NONE, NULL);
|
||||||
|
|
||||||
about_dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG,
|
about_dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG,
|
||||||
"program-name", PROJECT_NAME,
|
"program-name", PROJECT_NAME,
|
||||||
@@ -1160,9 +1174,11 @@ on_action_about (GtkAction *action, LdWindowMain *self)
|
|||||||
"version", PROJECT_VERSION,
|
"version", PROJECT_VERSION,
|
||||||
"translator-credits", _("translator-credits"),
|
"translator-credits", _("translator-credits"),
|
||||||
"copyright", "Copyright 2010 - 2021 Přemysl Eric Janouch",
|
"copyright", "Copyright 2010 - 2021 Přemysl Eric Janouch",
|
||||||
|
"license", g_bytes_get_data (license, NULL),
|
||||||
"website", PROJECT_URL,
|
"website", PROJECT_URL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
g_bytes_unref (license);
|
||||||
g_signal_connect (about_dialog, "activate-link",
|
g_signal_connect (about_dialog, "activate-link",
|
||||||
G_CALLBACK (on_action_about_activate_link), self);
|
G_CALLBACK (on_action_about_activate_link), self);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user