18 Commits

Author SHA1 Message Date
9dc1d20d6c Bump version, update NEWS 2021-11-03 07:18:35 +01:00
66a3b3e259 CMakeLists.txt: fix macOS build
GTK+ doesn't seem to be working much on macOS/brew/M1, though.
2021-11-02 16:29:30 +01:00
3ff0f117f9 Make note of an alternative export approach 2021-11-02 11:43:49 +01:00
de291ffddb Reset view position on opening a file 2021-11-02 11:28:48 +01:00
baaca4c58f Add all opened files to the recent list
The GTK+ file open/save dialog has already been adding them,
but opening files from the command line would circumvent that path.
2021-11-02 11:24:40 +01:00
7499f92811 Close symbol paths where appropriate
Removes some ugliness in PDF exports, stemming from line thickness.
2021-11-02 10:36:17 +01:00
deceafb4f4 CMakeFiles.txt: remove a confused comment
The process is not executed from a Makefile, the concern is void.
2021-11-01 13:04:26 +01:00
3465557a5b Use GResources for the UI file and the LICENSE
- The About dialog now displays the licence.
 - The main UI file is now integrated into the binary.

The project needed some of its ugly CMake code back.
2021-11-01 12:20:16 +01:00
082f1aa41c CMakeLists.txt: shuffle things around 2021-11-01 11:57:01 +01:00
8950a533b4 Don't generate marshallers in the source tree
This is much cleaner.  I'm unsure of the original motivations,
perhaps I just wanted to have all source files next to each other.
There is no functional issue with the build directory, though.
2021-11-01 10:14:19 +01:00
79d2fc78ea Win64Depends.sh: describe a more precise fix 2021-11-01 09:26:48 +01:00
1d118d5406 CMakeLists.txt: remove pointless targets
The win32-depends target only makes sense /before/ running CMake.

Let the builder do it by hand rather than invoking it automatically,
which would be another sensible solution.
2021-11-01 07:52:41 +01:00
d5ea2e2b4d Move GSettings schema checking to tests 2021-11-01 07:40:32 +01:00
0cec1b4bad CMakeLists.txt: slightly modernize
Before version 3.12, we still need to set CPACK_PACKAGE_VERSION
manually, and the subversions are actually wrongly defaulting to 0.1.1
(but we don't particularly care).

FindIntl has been there since CMake 3.2.
2021-10-31 04:18:44 +01:00
a40b281078 Improve clang-format configuration 2021-10-30 03:01:11 +02:00
dd48af42eb Stop stuttering in CMake scripts 2021-10-29 04:56:56 +02:00
ed6d34159e Win32Depends.cmake: make a note about cURL 2021-10-29 04:30:35 +02:00
ff03060efa Win32Depends.cmake: reflect mingw-get's existence
But let's keep Lua in the downloader, to make cross-compiling easier.
2021-10-29 04:11:03 +02:00
19 changed files with 186 additions and 178 deletions

View File

@@ -16,6 +16,7 @@ AlignOperands: DontAlign
AlignConsecutiveMacros: Consecutive
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
IndentGotoLabels: false
Cpp11BracedListStyle: true
MaxEmptyLinesToKeep: 2

1
.gitignore vendored
View File

@@ -1,4 +1,3 @@
/build
/win32-depends
/liblogdiag/ld-marshal.[ch]
/CMakeLists.txt.user

View File

@@ -1,6 +1,6 @@
# The last version with Windows XP support is 3.13, we want to keep that
cmake_minimum_required (VERSION 3.10)
project (logdiag VERSION 0.2.1 LANGUAGES C)
project (logdiag VERSION 0.3.0 DESCRIPTION "Schematic editor" LANGUAGES C)
# Options
option (OPTION_CLANG_TIDY "Enable use of clang-tidy" OFF)
@@ -23,19 +23,13 @@ if (WIN32)
if (CMAKE_CROSSCOMPILING)
list (APPEND CMAKE_FIND_ROOT_PATH ${WIN32_DEPENDS_PATH})
endif (CMAKE_CROSSCOMPILING)
endif ()
set (PKG_CONFIG_USE_CMAKE_PREFIX_PATH FALSE)
# Seems like there is a regression setting this to two paths in one,
# setting the path manually
set (ENV{PKG_CONFIG_PATH} "${WIN32_DEPENDS_PATH}/lib/pkgconfig")
add_custom_target (win32-depends COMMAND ${CMAKE_COMMAND} -P
${PROJECT_SOURCE_DIR}/Win32Depends.cmake
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
add_custom_target (win32-depends-clean COMMAND ${CMAKE_COMMAND} -E
remove_directory ${WIN32_DEPENDS_PATH})
endif (WIN32)
endif ()
# Generate icons
find_program (CONVERT_EXECUTABLE convert)
@@ -62,35 +56,34 @@ if (CONVERT_EXECUTABLE AND NOT WIN32)
DEPENDS ${icon_svg} VERBATIM)
set_source_files_properties (${icon_symbolic}
PROPERTIES SYMBOLIC TRUE)
endforeach (icon_size)
endforeach ()
set (icon_ico ${PROJECT_SOURCE_DIR}/share/logdiag.ico)
add_custom_target (${PROJECT_NAME}_icons
DEPENDS ${icon_symbolic_list}
COMMAND ${CONVERT_EXECUTABLE} ${icon_png_list} ${icon_ico}
COMMENT "Generating logdiag.ico" VERBATIM)
endif (CONVERT_EXECUTABLE AND NOT WIN32)
endif ()
# Dependencies
find_package (PkgConfig REQUIRED)
pkg_check_modules (GTK3 REQUIRED gtk+-3.0 json-glib-1.0)
link_directories (${GTK3_LIBRARY_DIRS})
if (NOT WIN32)
pkg_search_module (Lua REQUIRED lua>=5.2 lua5.3 lua-5.3 lua5.2 lua-5.2)
else (NOT WIN32)
link_directories (${Lua_LIBRARY_DIRS})
else ()
# For whatever reason this now seems to be required
set (LUA_INCLUDE_DIR "${WIN32_DEPENDS_PATH}/include")
find_package (Lua REQUIRED)
if (LUA_VERSION_STRING VERSION_LESS "5.2")
message (FATAL_ERROR "Lua 5.2 not found")
endif (LUA_VERSION_STRING VERSION_LESS "5.2")
endif ()
set (Lua_LIBRARIES ${LUA_LIBRARIES})
set (Lua_INCLUDE_DIRS ${LUA_INCLUDE_DIR})
endif (NOT WIN32)
# This actually fucks up MinGW cross-compilation if omitted
link_directories (${GTK3_LIBRARY_DIRS})
endif ()
# Localization
find_package (Gettext REQUIRED)
@@ -102,11 +95,11 @@ GETTEXT_CREATE_TRANSLATIONS (
foreach (file ${project_PO_FILES})
get_filename_component (translation "${file}" NAME_WE)
list (APPEND project_TRANSLATIONS "${translation}")
endforeach (file)
endforeach ()
# Project source files
set (liblogdiag_SOURCES
liblogdiag/ld-marshal.c
${PROJECT_BINARY_DIR}/ld-marshal.c
liblogdiag/ld-types.c
liblogdiag/ld-undo-action.c
liblogdiag/ld-diagram.c
@@ -123,9 +116,9 @@ set (liblogdiag_SOURCES
liblogdiag/ld-lua.c
liblogdiag/ld-lua-symbol.c)
set (liblogdiag_HEADERS
${PROJECT_BINARY_DIR}/ld-marshal.h
${PROJECT_BINARY_DIR}/config.h
liblogdiag/liblogdiag.h
liblogdiag/ld-marshal.h
liblogdiag/ld-types.h
liblogdiag/ld-undo-action.h
liblogdiag/ld-diagram.h
@@ -149,6 +142,7 @@ set (logdiag_TESTS
diagram)
set (logdiag_SOURCES
${PROJECT_BINARY_DIR}/gresource.c
src/ld-window-main.c
src/logdiag.c)
set (logdiag_HEADERS
@@ -159,60 +153,82 @@ set (logdiag_HEADERS
if (WIN32)
# The file isn't scanned for dependencies, but they will only rarely change
list (APPEND logdiag_SOURCES share/logdiag.rc)
endif (WIN32)
endif ()
# Generate marshallers
function (glib_genmarshal listfile prefix)
find_program (GLIB_GENMARSHAL_EXECUTABLE glib-genmarshal)
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}")
add_custom_command (OUTPUT ${_basename}.c ${_basename}.h
COMMAND ${_command_base} --body > ${_basename}.c
COMMAND ${_command_base} --header > ${_basename}.h
DEPENDS "${listfile}"
COMMENT "Generating marshallers source files" VERBATIM)
endfunction ()
glib_genmarshal (${PROJECT_SOURCE_DIR}/liblogdiag/ld-marshal.list ld_marshal)
# Generate resources
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 (${PROJECT_SOURCE_DIR}/config.h.in
${PROJECT_BINARY_DIR}/config.h)
include_directories (${PROJECT_BINARY_DIR})
configure_file (config.h.in ${PROJECT_BINARY_DIR}/config.h)
# Generate marshallers
find_program (GLIB_GENMARSHAL_EXECUTABLE glib-genmarshal)
if (NOT GLIB_GENMARSHAL_EXECUTABLE)
message (FATAL_ERROR "glib-genmarshal not found")
endif (NOT GLIB_GENMARSHAL_EXECUTABLE)
function (glib_genmarshal base prefix)
get_filename_component (base_path "${base}" PATH)
get_filename_component (base_name "${base}" NAME)
set (command_base ${GLIB_GENMARSHAL_EXECUTABLE}
--prefix ${prefix} "${base_name}.list")
# 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: && ...
if (WIN32 AND "${base_path}" MATCHES "^.:[/\\\\]")
string (SUBSTRING "${base_path}" 0 2 base_drive)
set (command_base "${base_drive}" && "${command_base}")
endif (WIN32 AND "${base_path}" MATCHES "^.:[/\\\\]")
# NOTE: VERBATIM would cause problems, so it is not used here
add_custom_command (OUTPUT ${base}.c
COMMAND ${command_base} --body > "${base_name}.c"
DEPENDS "${base}.list"
WORKING_DIRECTORY "${base_path}"
COMMENT "Generating marshallers source file")
add_custom_command (OUTPUT ${base}.h
COMMAND ${command_base} --header > "${base_name}.h"
DEPENDS "${base}.list"
WORKING_DIRECTORY "${base_path}"
COMMENT "Generating marshallers header file")
endfunction (glib_genmarshal)
glib_genmarshal (${PROJECT_SOURCE_DIR}/liblogdiag/ld-marshal
ld_marshal)
include_directories (${PROJECT_SOURCE_DIR})
include_directories (${GTK3_INCLUDE_DIRS} ${Lua_INCLUDE_DIRS})
include_directories (${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR}
${GTK3_INCLUDE_DIRS} ${Lua_INCLUDE_DIRS})
set (logdiag_LIBS ${GTK3_LIBRARIES} ${Lua_LIBRARIES} m)
if (WIN32)
find_package (LibIntl REQUIRED)
list (APPEND logdiag_LIBS ${LIBINTL_LIBRARIES} shell32)
endif (WIN32)
find_package (Intl REQUIRED)
list (APPEND logdiag_LIBS ${Intl_LIBRARIES} shell32)
endif ()
# Build the library
add_library (liblogdiag STATIC ${liblogdiag_SOURCES} ${liblogdiag_HEADERS})
@@ -222,21 +238,44 @@ set_target_properties (liblogdiag PROPERTIES OUTPUT_NAME logdiag)
add_executable (logdiag WIN32 ${logdiag_SOURCES} ${logdiag_HEADERS})
target_link_libraries (logdiag liblogdiag ${logdiag_LIBS})
# GSettings
find_program (GLIB_COMPILE_SCHEMAS_EXECUTABLE glib-compile-schemas)
if (NOT GLIB_COMPILE_SCHEMAS_EXECUTABLE)
message (FATAL_ERROR "glib-compile-schemas not found")
endif ()
set (GSETTINGS_DIR "${PROJECT_SOURCE_DIR}/share")
set (GSETTINGS_SCHEMAS "${GSETTINGS_DIR}/org.logdiag.gschema.xml")
if (OPTION_NOINSTALL)
set (GSETTINGS_COMPILED_SCHEMA "${PROJECT_BINARY_DIR}/gschemas.compiled")
add_custom_command (OUTPUT "${GSETTINGS_COMPILED_SCHEMA}"
COMMAND ${GLIB_COMPILE_SCHEMAS_EXECUTABLE}
"--targetdir=${PROJECT_BINARY_DIR}" "${GSETTINGS_DIR}"
DEPENDS "${GSETTINGS_SCHEMAS}"
COMMENT "Compiling GSettings schema files" VERBATIM)
add_custom_target (${PROJECT_NAME}-gschema ALL
DEPENDS "${GSETTINGS_COMPILED_SCHEMA}")
endif ()
# Testing
if (BUILD_TESTING)
enable_testing ()
add_test (NAME test-gschema-${PROJECT_NAME}
COMMAND ${GLIB_COMPILE_SCHEMAS_EXECUTABLE} --dry-run "${GSETTINGS_DIR}")
foreach (name ${logdiag_TESTS})
add_executable (test-${name} tests/${name}.c)
target_link_libraries (test-${name} liblogdiag ${logdiag_LIBS})
add_test (NAME test-${name} COMMAND test-${name})
list (APPEND logdiag_TEST_TARGETS test-${name})
endforeach (name)
endforeach ()
if (WIN32 AND NOT CMAKE_CROSSCOMPILING)
set_tests_properties (${logdiag_TEST_TARGETS}
PROPERTIES ENVIRONMENT "PATH=${WIN32_DEPENDS_PATH}/bin")
endif ()
endif (BUILD_TESTING)
endif ()
# Generate documentation
if (OPTION_GTKDOC)
@@ -299,32 +338,6 @@ if (OPTION_CLANG_TIDY)
USES_TERMINAL WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
endif ()
# GSettings
find_program (GLIB_COMPILE_SCHEMAS_EXECUTABLE glib-compile-schemas)
if (NOT GLIB_COMPILE_SCHEMAS_EXECUTABLE)
message (FATAL_ERROR "glib-compile-schemas not found")
endif (NOT GLIB_COMPILE_SCHEMAS_EXECUTABLE)
set (GSETTINGS_DIR "${PROJECT_SOURCE_DIR}/share")
set (GSETTINGS_SCHEMAS "${GSETTINGS_DIR}/org.logdiag.gschema.xml")
add_custom_target (${PROJECT_NAME}_gschema_check
COMMAND ${GLIB_COMPILE_SCHEMAS_EXECUTABLE} --dry-run "${GSETTINGS_DIR}"
DEPENDS "${GSETTINGS_SCHEMAS}"
COMMENT "Checking GSettings schema files" VERBATIM)
if (OPTION_NOINSTALL)
set (GSETTINGS_COMPILED_SCHEMA "${PROJECT_BINARY_DIR}/gschemas.compiled")
add_custom_command (OUTPUT "${GSETTINGS_COMPILED_SCHEMA}"
COMMAND ${GLIB_COMPILE_SCHEMAS_EXECUTABLE}
"--targetdir=${PROJECT_BINARY_DIR}" "${GSETTINGS_DIR}"
DEPENDS "${GSETTINGS_SCHEMAS}"
COMMENT "Compiling GSettings schema files" VERBATIM)
add_custom_target (${PROJECT_NAME}_gschema ALL
DEPENDS "${GSETTINGS_COMPILED_SCHEMA}")
endif (OPTION_NOINSTALL)
# Installation
if (WIN32)
install (TARGETS logdiag DESTINATION .)
@@ -361,11 +374,11 @@ if (WIN32)
install (DIRECTORY
${WIN32_DEPENDS_PATH}/share/locale/${translation}
DESTINATION share/locale)
endif (translation_found GREATER -1)
endforeach (locale)
endif ()
endforeach ()
install (SCRIPT Win32Cleanup.cmake)
else (WIN32)
else ()
install (TARGETS logdiag DESTINATION bin)
install (FILES share/logdiag.desktop DESTINATION share/applications)
install (FILES share/logdiag.xml DESTINATION share/mime/packages)
@@ -374,10 +387,10 @@ else (WIN32)
# install (DIRECTORY "${project_DOC_DIR}/html/"
# DESTINATION share/gtk-doc/html/${PROJECT_NAME})
install (FILES LICENSE NEWS DESTINATION share/doc/${PROJECT_NAME})
endif (WIN32)
endif ()
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 (CODE " # DESTDIR is not in use on Windows (WIN32 is only native here!)
if (WIN32 OR \"\$ENV{DESTDIR}\" STREQUAL \"\")
@@ -386,7 +399,6 @@ install (CODE " # DESTDIR is not in use on Windows (WIN32 is only native here!)
endif ()")
# CPack
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Schematic editor")
set (CPACK_PACKAGE_VENDOR "Premysl Eric Janouch")
set (CPACK_PACKAGE_CONTACT "Přemysl Eric Janouch <p@janouch.name>")
set (CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
@@ -394,10 +406,10 @@ set (CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
if (WIN32)
set (CPACK_GENERATOR "NSIS;ZIP")
else (WIN32)
else ()
set (CPACK_GENERATOR "TGZ;ZIP")
set (CPACK_SET_DESTDIR TRUE)
endif (WIN32)
endif ()
set (CPACK_PACKAGE_FILE_NAME
"${PROJECT_NAME}-${PROJECT_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
@@ -438,7 +450,7 @@ set (CPACK_RPM_PACKAGE_LICENSE "ISC")
set (CPACK_RPM_PACKAGE_URL "${project_URL}")
set (CPACK_SOURCE_GENERATOR "TGZ;ZIP")
set (CPACK_SOURCE_IGNORE_FILES "/\\\\.git;/build;/CMakeLists.txt.user;/win32-depends;/liblogdiag/ld-marshal.[ch]")
set (CPACK_SOURCE_IGNORE_FILES "/\\\\.git;/build;/CMakeLists.txt.user;/win32-depends")
set (CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}")
include (CPack)

11
NEWS
View File

@@ -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
- Set up grounds for 64-bit Windows builds using the latest GTK+ 3.
- Made the Windows installer ask to uninstall previous versions first.

View File

@@ -57,10 +57,10 @@ Build from source on Windows
_Note that using the current method we're stuck with GTK+ 3.8.2, which works
worse on Windows 10, but better on XP and under WINE._
First, install CMake and MinGW. Add both to your system path. If you want
to build an installation package, also install NSIS. If you want to build
within a path containing spaces,
https://gitlab.kitware.com/cmake/cmake/-/issues/22396[fix] your CMake's
First, install CMake and MinGW (mingw32-base-bin, mingw32-gettext-dev).
Ensure they're both in your system path. If you want to build an installation
package, also install NSIS. If you want to build within a path containing
spaces, https://gitlab.kitware.com/cmake/cmake/-/issues/22396[fix] your CMake's
FindPkgConfig.cmake module to say:
separate_arguments(_pkgconfig_invoke_result UNIX_COMMAND "${_pkgconfig_invoke_result}")

View File

@@ -15,32 +15,27 @@ file (GLOB files ${working_dir}/*)
list (REMOVE_ITEM files ${pkg_dir})
if (files)
file (REMOVE_RECURSE ${files})
endif (files)
endif ()
# Packages
set (pkg_list "gtk" "gtkalt" "winlibs" "mingw_lua")
set (pkg_gtk_root "http://ftp.gnome.org/pub/gnome/binaries/win32")
set (pkg_gtk_urls
"${pkg_gtk_root}/dependencies/gettext-tools-0.17.zip"
"${pkg_gtk_root}/dependencies/gettext-runtime-0.17-1.zip")
set (pkg_gtk_md5
"09baff956ebd1c391c7f71e9bd768edd"
"110394b4b1e0a50cd440f1e8729d159c")
set (pkg_list "geany" "winlibs" "mingw_lua")
# https://sourceforge.net/projects/urlget/files
# /GTK%2B%203%20binary%20for%20Windows/GTK%2B%203.16.6/
# contains a binary bundle that may be more or less simply transplanted over,
# due to ABI compatibility, however something is wrong with icons,
# and it looks alien on Windows XP (use themes) for close to no improvement.
set (pkg_gtkalt_root "https://download.geany.org/contrib/gtk")
set (pkg_gtkalt_urls "${pkg_gtkalt_root}/gtk+-bundle_3.8.2-20131001_win32.zip")
set (pkg_gtkalt_md5 "3f9b159207edf44937f209b4a5e6bb63")
set (pkg_geany_root "https://download.geany.org/contrib/gtk")
set (pkg_geany_urls "${pkg_geany_root}/gtk+-bundle_3.8.2-20131001_win32.zip")
set (pkg_geany_md5 "3f9b159207edf44937f209b4a5e6bb63")
set (pkg_winlibs_root "http://sourceforge.net/projects/winlibs/files")
set (pkg_winlibs_urls "${pkg_winlibs_root}/GTK+/libjson-glib-1.0-1-mingw32.7z")
set (pkg_winlibs_md5 "f06e42c5998dae5fb6245fecc96a403e")
# With luabinaries MinGW-W64 builds the .dll/.a need to be moved to bin/lib
# manually, and note that CMake 3.10.0 FindLua.cmake can't find Lua 5.4;
# in any case there is no pkg-config file
set (pkg_mingw_lua_root "http://sourceforge.net/projects/mingw/files/MinGW/Extension")
set (pkg_mingw_lua_urls
"${pkg_mingw_lua_root}/lua/lua-5.2.0-1/lua-5.2.0-1-mingw32-dll-52.tar.xz"
@@ -69,6 +64,8 @@ foreach (pkg_set ${pkg_list})
if (NOT EXISTS ${filename})
message (STATUS "Downloading ${url}...")
# TODO: on Windows XP, we can't download https://curl.se/windows/
# but it would be somewhat nice to be able to detect it in PATH
file (DOWNLOAD ${url} ${filename} STATUS status ${pkg_md5_param})
list (GET status 0 status_errno)
@@ -76,16 +73,16 @@ foreach (pkg_set ${pkg_list})
if (status_errno)
file (REMOVE ${filename})
message (FATAL_ERROR "Download failed: ${status_msg}")
endif (status_errno)
endif ()
elseif (pkg_md5_sum)
execute_process (COMMAND ${CMAKE_COMMAND} -E md5sum ${filename}
OUTPUT_VARIABLE output)
if (NOT output MATCHES "^${pkg_md5_sum}")
message (FATAL_ERROR "MD5 mismatch for ${basename}")
endif (NOT output MATCHES "^${pkg_md5_sum}")
endif ()
endif ()
endforeach (url)
endforeach (pkg_set)
endforeach ()
endforeach ()
# Stage 2: extract the rest of packages
foreach (pkg_set ${pkg_list})
@@ -100,8 +97,8 @@ foreach (pkg_set ${pkg_list})
if (status)
message (FATAL_ERROR "Extraction failed: ${status}")
endif ()
endforeach (url)
endforeach (pkg_set)
endforeach ()
endforeach ()
# Stage 3: final touches
# We have to fix the prefix path as it is completely wrong everywhere
@@ -112,4 +109,4 @@ foreach (file ${files})
string (REGEX REPLACE "prefix=[^\r\n]*(.*)" "prefix=${working_dir}\\1"
file_content_fixed "${file_content}")
file (WRITE ${file} "${file_content_fixed}")
endforeach (file)
endforeach ()

View File

@@ -71,4 +71,4 @@ configure
status Success
# XXX: Why is this override needed to run some GLib-based things under wine64?
export XDG_DATA_DIRS=$(pwd)/share
unset XDG_DATA_DIRS

View File

@@ -1,38 +0,0 @@
# - Find libintl
# This module looks for libintl.
# This module defines the following values:
# LIBINTL_FOUND
# LIBINTL_LIBRARIES
#=============================================================================
# Copyright 2011 Přemysl Eric Janouch
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
# OF SUCH DAMAGE.
#=============================================================================
find_library (LIBINTL_LIBRARIES intl)
include (FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS (LibIntl DEFAULT_MSG LIBINTL_LIBRARIES)
mark_as_advanced (LIBINTL_LIBRARIES)

View File

@@ -16,7 +16,7 @@ q:lang(cs):after { content: "“"; }
<p class="details">
<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="revnumber">verze 0.2.2,</span>
<span id="revnumber">verze 0.3.0,</span>
<span id="revdate">2021-10-28</span>
<p class="figure"><img src="logdiag-cs.png" alt="Okno programu logdiag">

View File

@@ -16,7 +16,7 @@ q:lang(en):after { content: ""; }
<p class="details">
<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="revnumber">version 0.2.2,</span>
<span id="revnumber">version 0.3.0,</span>
<span id="revdate">2021-10-28</span>
<p class="figure"><img src="logdiag-en.png" alt="logdiag program window">

View File

@@ -3002,6 +3002,9 @@ ld_diagram_view_get_export_bounds (LdDiagramView *self, LdRectangle *rect)
{
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);
ld_diagram_view_diagram_to_widget_coords_rect (self, &intermediate, rect);
return ld_diagram_view_get_scale_in_px (self);

View File

@@ -6,7 +6,7 @@
#, fuzzy
msgid ""
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"
"POT-Creation-Date: 2021-10-28 20:07+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"

View File

@@ -23,6 +23,7 @@ local render = function (cr)
cr:curve_to (3, 0, 2, 2, 0, 2)
cr:line_to (-2, 2)
cr:curve_to (-1, 1, -1, -1, -2, -2)
cr:close_path ()
cr:stroke ()
-- The terminals

View File

@@ -21,8 +21,7 @@ local render = function (cr)
cr:line_to (-1, 0)
-- The terminals
cr:move_to (-2, 0)
cr:line_to (-1, 0)
cr:line_to (-2, 0)
cr:move_to (1, 0)
cr:line_to (2, 0)

View File

@@ -48,7 +48,7 @@ local render = function (cr)
cr:move_to (-1, -1)
cr:line_to (1, 0)
cr:line_to (-1, 1)
cr:line_to (-1, -1)
cr:close_path ()
-- The vertical line
cr:move_to (1, 1)

View File

@@ -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:close_path ()
-- The terminals
cr:move_to (-2, 0)

View 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>

View File

@@ -274,8 +274,8 @@ ld_window_main_init (LdWindowMain *self)
priv->action_group, 0);
error = NULL;
gtk_ui_manager_add_ui_from_file
(priv->ui_manager, PROJECT_SHARE_DIR "gui/window-main.ui", &error);
gtk_ui_manager_add_ui_from_resource
(priv->ui_manager, "/logdiag/logdiag.ui", &error);
if (error)
{
g_message ("building UI failed: %s", error->message);
@@ -712,9 +712,10 @@ diagram_save (LdWindowMain *self, GtkWindow *dialog_parent,
static gboolean
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);
if (error)
{
@@ -748,8 +749,17 @@ diagram_open (LdWindowMain *self, const gchar *filename)
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);
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;
}
@@ -1153,6 +1163,10 @@ static void
on_action_about (GtkAction *action, LdWindowMain *self)
{
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,
"program-name", PROJECT_NAME,
@@ -1160,9 +1174,11 @@ on_action_about (GtkAction *action, LdWindowMain *self)
"version", PROJECT_VERSION,
"translator-credits", _("translator-credits"),
"copyright", "Copyright 2010 - 2021 Přemysl Eric Janouch",
"license", g_bytes_get_data (license, NULL),
"website", PROJECT_URL,
NULL);
g_bytes_unref (license);
g_signal_connect (about_dialog, "activate-link",
G_CALLBACK (on_action_about_activate_link), self);