42 Commits

Author SHA1 Message Date
17d9b3cf4c Win64Depends.sh: improve compatibility
All checks were successful
Arch Linux AUR Success
Alpine 3.19 Success
Alpine 3.20 Success
2024-04-09 19:35:41 +02:00
2aa0a6231c Accept Lua 5.4 specifically
All checks were successful
Arch Linux AUR Success
2024-04-09 18:54:14 +02:00
56a2a58ed6 Enable cross-compiled tests
All checks were successful
Arch Linux AUR Success
test-diagram still fails, however let's make our toolchain files
a good reference.
2024-04-09 13:02:03 +02:00
99834e93c0 README.adoc: update package information
All checks were successful
Arch Linux AUR Success
2023-07-01 21:59:05 +02:00
266c4c7c9f CMakeLists.txt: fix RPM license field 2023-06-28 01:57:50 +02:00
e5e42b63eb Win64Depends.sh: only extract what we need
In case the packages directory has been preloaded or symlinked.
2023-06-26 20:54:38 +02:00
a4532ea322 Add some enlightening comments 2023-06-14 12:29:12 +02:00
4aeaf61c99 Synchronize cross-compilation scripts 2022-08-12 12:39:21 +02:00
d5837555b8 Update README 2022-08-12 12:33:52 +02:00
9003f36ba2 Tidy up GSettings 2022-07-25 13:31:32 +02:00
6df51485d3 Update Windows XP vs. TLS notes 2021-12-28 04:03:54 +01:00
2433b9046f Eliminate a Wayland-specific warning
The handling seems to be a bit convoluted there.
2021-11-17 07:42:37 +01:00
93cd4dc4f9 Remove an unused marshaller
It is no longer used, since the transition to GTK+ 3.
2021-11-14 05:51:07 +01:00
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
9dcef6a14f Make ld_library_find_symbol() easier to read
As well as shorter, strangely.

Symbols may technically exist directly in the root category now.
2021-10-29 01:31:50 +02:00
ee7be81434 Clean up 2021-10-29 00:24:12 +02:00
0c5c680f62 Get rid of broken vera++, integrate clang-tidy 2021-10-29 00:22:43 +02:00
f139efba6d Support Windows XP forever
GTK+ 3 has been almost abandoned, and there is little newer versions
could improve, so keep supporting the old and working 3.8.
2021-10-28 21:36:54 +02:00
83c1e7a491 Update translations 2021-10-28 21:33:09 +02:00
59b5ff7020 Append ellipsis to the Print menu item
It opens a dialog.
2021-10-28 20:05:31 +02:00
2bc9fe4f1d Fix scaling to fit paper 2021-10-28 06:14:21 +02:00
bd12c0502a Update user guides
Now add text labels, and this project is functionally complete.
2021-10-28 06:01:03 +02:00
4f01392de5 Add basic print functionality
Sadly, the line width depends on the widget's DPI, which seems to
even cause uneven lines on Windows, where virtual printers claim
high DPI.  It might also be an unrelated problem.

Similarly, selected objects are exported highlighted.

Other than that, it works quite well.

Add a manifest to make the print dialog look nice with the older
GTK+ bundle we depend upon.

The RC file could theoretically be scanned for /\s+"([^"]+)"\s*$/,
unescaped, and the results configure_file()-stamped.
2021-10-28 05:57:27 +02:00
6cd6ddbd1c ld-window-main.c: clean up 2021-10-28 05:25:57 +02:00
a4a0dd2106 Clean up
It turns out the RC detection snippet is no longer necessary
after the recent CMake version bump.

The "name" argument in the UI file is redundant, implied by "action".
2021-10-28 05:18:03 +02:00
37 changed files with 1073 additions and 748 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

3
.gitmodules vendored
View File

@@ -1,3 +0,0 @@
[submodule "vera++"]
path = vera++
url = https://bitbucket.org/verateam/vera.git

View File

@@ -1,14 +1,15 @@
# 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_USE_VERA "Use vera++ for source code style checks" OFF)
option (OPTION_CLANG_TIDY "Enable use of clang-tidy" OFF)
option (OPTION_NOINSTALL "For developers only--work without installing" OFF)
option (OPTION_GTKDOC "For developers only--enable use of gtk-doc" OFF)
option (BUILD_TESTING "Build tests" OFF)
# Project information
set (project_ID "name.janouch.${PROJECT_NAME}")
set (project_URL "https://git.janouch.name/p/logdiag")
# For custom modules
@@ -23,19 +24,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)
@@ -46,6 +41,7 @@ if (CONVERT_EXECUTABLE AND NOT WIN32)
set (icon_svg ${icon_base}/scalable/apps/logdiag.svg)
set (icon_size_list 16x16 32x32 48x48)
# ImageMagick very oddly outperforms rsvg-convert with our specific SVG
set (icon_png_list)
set (icon_symbolic_list)
foreach (icon_size ${icon_size_list})
@@ -62,35 +58,37 @@ if (CONVERT_EXECUTABLE AND NOT WIN32)
DEPENDS ${icon_svg} VERBATIM)
set_source_files_properties (${icon_symbolic}
PROPERTIES SYMBOLIC TRUE)
endforeach (icon_size)
endforeach ()
# Symbolic targets prevent the icons from being either cleaned,
# or pointlessly regenerated slightly differently
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)
pkg_search_module (Lua REQUIRED lua>=5.2
lua5.4 lua-5.4 lua5.3 lua-5.3 lua5.2 lua-5.2)
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 +100,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 +121,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,79 +147,93 @@ set (logdiag_TESTS
diagram)
set (logdiag_SOURCES
${PROJECT_BINARY_DIR}/gresource.c
src/ld-window-main.c
src/logdiag.c)
set (logdiag_HEADERS
${liblogdiag_HEADERS}
src/ld-window-main.h)
# Resource compilation for MinGW
if (MINGW)
set (CMAKE_RC_COMPILER_INIT windres)
enable_language (RC)
set (CMAKE_RC_FLAGS "-O coff")
set (CMAKE_RC_COMPILE_OBJECT
"<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -o <OBJECT> <SOURCE>")
endif (MINGW)
# Resource compilation for Windows
if (WIN32)
set (logdiag_SOURCES
${logdiag_SOURCES}
share/logdiag.rc)
endif (WIN32)
# The file isn't scanned for dependencies, but they will only rarely change
list (APPEND logdiag_SOURCES share/logdiag.rc)
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})
@@ -231,21 +243,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}/${PROJECT_NAME}.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)
@@ -275,68 +310,38 @@ find_package (CppCheck)
GENERATE_CPPCHECK (SOURCES liblogdiag src tests ENABLE_IDS all
TARGET_NAME ${PROJECT_NAME}_cppcheck INCLUDES ${PROJECT_BINARY_DIR})
if (OPTION_USE_VERA)
# Force this off, we don't need it
option (VERA_LUA "" OFF)
# Various clang-based diagnostics, loads of fake positives and spam
if (OPTION_CLANG_TIDY)
set (clang_tidy_checks
clang-analyzer-* bugprone-* misc-* readability-* performance-*
-bugprone-reserved-identifier # GObject
-performance-no-int-to-ptr # GObject
-bugprone-narrowing-conversions
-bugprone-macro-parentheses # too coarse-grained
-readability-braces-around-statements # fine by me
-readability-isolate-declaration # fine by me
-readability-magic-numbers # too coarse-grained
-misc-unused-parameters) # fine by me
# Make it build within the same build tree
get_directory_property (backup_includes INCLUDE_DIRECTORIES)
set_directory_properties (PROPERTIES INCLUDE_DIRECTORIES "")
set (backup_source_dir "${CMAKE_SOURCE_DIR}")
set (CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}/vera++")
string (REPLACE ";" "," clang_tidy_checks "${clang_tidy_checks}")
set (clang_tidy_config "{
Checks: '${clang_tidy_checks}',
CheckOptions: [{
key: readability-function-cognitive-complexity.Threshold,
value: '30'
}]}")
add_subdirectory ("vera++")
string (REPLACE "\n" " " clang_tidy_config "${clang_tidy_config}")
set_directory_properties (PROPERTIES INCLUDE_DIRECTORIES "${backup_includes}")
set (CMAKE_SOURCE_DIR "${backup_source_dir}")
# Check the sources
# XXX: maybe do it per source file and not all at once
set (vera_srcs ${liblogdiag_SOURCES} ${logdiag_SOURCES} ${logdiag_HEADERS})
set (vera_output ${PROJECT_BINARY_DIR}/vera.log)
add_custom_command (OUTPUT ${vera_output}
COMMAND vera
-R F001 -R L001 -R T001 -R T004 -R T005 -R T006
-R T007 -R T009 -R T010 -R T015 -R T017 -R T018
-R L004 -P max-line-length=80
-R L005 -P max-consecutive-empty-lines=2
--root ${CMAKE_SOURCE_DIR}/vera++
--std-report=-
--std-report=${vera_output}
--warning -s
${vera_srcs}
DEPENDS ${vera_srcs}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Checking style for logdiag")
add_custom_target (logdiag_vera ALL DEPENDS ${vera_output})
endif (OPTION_USE_VERA)
# 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)
set (CMAKE_EXPORT_COMPILE_COMMANDS ON)
set (clang_tidy_sources ${liblogdiag_SOURCES} ${logdiag_SOURCES})
add_custom_target (${PROJECT_NAME}_clang_tidy
COMMAND clang-tidy --quiet -p ${PROJECT_BINARY_DIR}
"--config=${clang_tidy_config}" ${clang_tidy_sources}
| sh -c "cat 1>&2"
DEPENDS ${clang_tidy_sources} VERBATIM
USES_TERMINAL WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
endif ()
# Installation
if (WIN32)
@@ -374,11 +379,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)
@@ -387,11 +392,12 @@ 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 (FILES ${GSETTINGS_SCHEMAS} DESTINATION share/glib-2.0/schemas)
install (DIRECTORY share/library DESTINATION share/${PROJECT_NAME})
install (FILES ${GSETTINGS_SCHEMAS} DESTINATION share/glib-2.0/schemas
RENAME "${project_ID}.gschema.xml")
install (CODE " # DESTDIR is not in use on Windows (WIN32 is only native here!)
if (WIN32 OR \"\$ENV{DESTDIR}\" STREQUAL \"\")
execute_process (COMMAND \"${GLIB_COMPILE_SCHEMAS_EXECUTABLE}\"
@@ -399,7 +405,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")
@@ -407,10 +412,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}")
@@ -447,11 +452,11 @@ set (CPACK_DEBIAN_PACKAGE_HOMEPAGE "${project_URL}")
set (CPACK_RPM_PACKAGE_REQUIRES "gtk3 >= 3.8, json-glib >= 0.10.4, lua = 5.2")
set (CPACK_RPM_PACKAGE_GROUP "Graphics")
set (CPACK_RPM_PACKAGE_LICENSE "ISC")
set (CPACK_RPM_PACKAGE_LICENSE "0BSD")
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)

13
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.
@@ -18,8 +29,6 @@ Version 0.2.0
- Symbol categories are also loaded from user-specific directories.
- Show current zoom in the statusbar.
- Ported to GTK+ 3 and Lua 5.2.
- This is the last version supporting Windows XP (we use an outdated GTK+
bundle, support for this operating system has been dropped in version 3.18).
- Various unimportant fixes and changes.
- Known issues: Windows XP looks ugly with the classic theme, little we can do.

View File

@@ -10,8 +10,10 @@ image::docs/user-guide/logdiag-en.png[align="center"]
Packages
--------
Regular releases are sporadic. git master should be stable enough. You can get
a package with the latest development version from Archlinux's AUR.
Regular releases are sporadic. git master should be stable enough.
You can get a package with the latest development version using Arch Linux's
https://aur.archlinux.org/packages/logdiag-git[AUR],
or as a https://git.janouch.name/p/nixexprs[Nix derivation].
Windows installers can be downloaded from
https://git.janouch.name/p/logdiag/releases[the Releases page on Gitea].
@@ -57,20 +59,23 @@ 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}")
Run the following command in the directory with source files to automatically
fetch and set up all dependencies (note that Windows XP is no longer able to
download from HTTPS sources, you'll have to run this externally):
fetch and set up all dependencies:
> cmake -P Win32Depends.cmake
Note that on Windows XP, CMake will fail to download those files, even with
https://emailarchitect.net/easendmail/sdk/html/object_tls12.htm[updates].
You will have to run the script externally.
Reserve a directory for an out-of-source build and let CMake prepare the build:
> mkdir build
@@ -103,7 +108,7 @@ Just install MinGW-w64 and let automation take care of the rest.
Alternatively, for an unnecessarily bloated MSYS2-based 64-bit build:
$ sh Win64Depends.sh
$ sh -e Win64Depends.sh
$ cmake -DCMAKE_TOOLCHAIN_FILE=ToolchainCrossWin64.cmake \
-DCMAKE_BUILD_TYPE=Release -B build
$ cmake --build build -- package

View File

@@ -5,12 +5,11 @@ set (CMAKE_C_COMPILER "i586-mingw32msvc-gcc")
set (CMAKE_CXX_COMPILER "i586-mingw32msvc-g++")
set (CMAKE_RC_COMPILER "i586-mingw32msvc-windres")
# Not needed to crosscompile an installation package
#set (CMAKE_CROSSCOMPILING_EMULATOR "wine")
# Remember to set WINEPATH for library dependencies
set (CMAKE_CROSSCOMPILING_EMULATOR "wine")
set (CMAKE_FIND_ROOT_PATH "/usr/i586-mingw32msvc")
set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

View File

@@ -5,12 +5,11 @@ set (CMAKE_C_COMPILER "i686-w64-mingw32-gcc")
set (CMAKE_CXX_COMPILER "i686-w64-mingw32-g++")
set (CMAKE_RC_COMPILER "i686-w64-mingw32-windres")
# Not needed to crosscompile an installation package
#set (CMAKE_CROSSCOMPILING_EMULATOR "wine")
# Remember to set WINEPATH for library dependencies
set (CMAKE_CROSSCOMPILING_EMULATOR "wine")
set (CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32")
set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

View File

@@ -5,12 +5,11 @@ set (CMAKE_C_COMPILER "x86_64-w64-mingw32-gcc")
set (CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++")
set (CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres")
# Not needed to crosscompile an installation package
#set (CMAKE_CROSSCOMPILING_EMULATOR "wine64")
# Remember to set WINEPATH for library dependencies
set (CMAKE_CROSSCOMPILING_EMULATOR "wine64")
set (CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32")
set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

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 ()
endforeach (url)
endforeach (pkg_set)
endif ()
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

@@ -1,5 +1,5 @@
#!/bin/sh -e
# Win64Depends.sh: download dependencies from MSYS2 for cross-compilation
# Win64Depends.sh: download dependencies from MSYS2 for cross-compilation.
# Dependencies: AWK, sed, sha256sum, cURL, bsdtar, wine64
repository=https://repo.msys2.org/mingw/mingw64/
@@ -27,7 +27,8 @@ fetch() {
} BEGIN { while ((getline < "db.tsv") > 0) {
filenames[$1] = $2; deps[$1] = ""; for (i = 3; i <= NF; i++) {
gsub(/[<=>].*/, "", $i); deps[$1] = deps[$1] $i FS }
} for (i = 0; i < ARGC; i++) get(ARGV[i]) }' "$@" | while IFS= read -r name
} for (i = 0; i < ARGC; i++) get(ARGV[i]) }' "$@" | tee db.want | \
while IFS= read -r name
do
status Fetching "$name"
[ -f "packages/$name" ] || curl -#o "packages/$name" "$repository/$name"
@@ -44,9 +45,9 @@ extract() {
for subdir in *
do [ -d "$subdir" -a "$subdir" != packages ] && rm -rf -- "$subdir"
done
for i in packages/*
do bsdtar -xf "$i" --strip-components 1 mingw64
done
while IFS= read -r name
do bsdtar -xf "packages/$name" --strip-components 1
done < db.want
}
configure() {
@@ -55,15 +56,16 @@ configure() {
wine64 bin/gdk-pixbuf-query-loaders.exe \
> lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
# pkgconf has a command line option for this, but CMake can't pass it
sed -i "s|^prefix=/mingw64|prefix=$(pwd)|" {share,lib}/pkgconfig/*.pc
# pkgconf has a command line option for this, but CMake can't pass it.
sed -i "s|^prefix=/mingw64|prefix=$(pwd)|" \
share/pkgconfig/*.pc lib/pkgconfig/*.pc
}
mkdir -p win32-depends
cd win32-depends
dbsync
fetch mingw-w64-x86_64-gtk3 mingw-w64-x86_64-lua \
mingw-w64-x86_64-libwinpthread-git # because we don't do "provides"?
mingw-w64-x86_64-libwinpthread-git # Because we don't do "provides"?
verify
extract
configure
@@ -71,4 +73,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

@@ -10,6 +10,7 @@
#define PROJECT_NAME "${PROJECT_NAME}"
#define PROJECT_VERSION "${PROJECT_VERSION}"
#define PROJECT_ID "${project_ID}"
#define PROJECT_URL "${project_URL}"
#cmakedefine OPTION_NOINSTALL

View File

@@ -16,8 +16,8 @@ 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.0,</span>
<span id="revdate">2018-06-27</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">
@@ -118,15 +118,11 @@ a přetáhněte kurzor myši na místo, kde chcete, aby spojení končilo.
Pokud jste nějaký soubor již bez přípony uložili, napravíte to dodatečným
přidáním přípony k jeho názvu.
<h3>Jak můžu diagram vytisknout?</h3>
<p>Současná verze aplikace není schopná přímo tisknout. Pro vytištění
vytvořeného diagramu můžete klávesou PrintScreen sejmout snímek obrazovky,
vložit jej například do aplikace Malování, oříznout požadovanou část
a vytisknout ji z tohoto grafického editoru.
<h3>Schází mi popisky</h3>
<p>Obdobně jako v předchozím případě tato funkcionalita zatím neexistuje,
ale je možné tento nedostatek obejít přes běžný grafický editor.
<p>Tato funkcionalita zatím neexistuje, ale je možné tento nedostatek obejít
buď sejmutím snímku obrazovky klávesou PrintScreen a jeho vložením například
do aplikace Malování, nebo obdobně doplněním vašich textů do <q>vytištěného</q>
PDF souboru.
<script>
var toc = '', all = document.querySelectorAll('h2')

View File

@@ -16,8 +16,8 @@ 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.0,</span>
<span id="revdate">2018-06-27</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">
@@ -110,15 +110,11 @@ want the connection to end.
In case youve already saved a file without an extension, you may fix this
situation by adding the suffix to its name.
<h3>How do I print a diagram?</h3>
<p>The current version of application is not able to print directly. To print
out a created diagram, you may use the PrintScreen key to capture a screenshot,
then insert it to, for example, Paint, and print it from inside the graphics
editor.
<h3>I miss labels</h3>
<p>Similarly to the previous case, this functionality doesnt exist yet, but it
is possible to get around this limitation using a graphics editor.
<p>This functionality doesn't exist yet, but it is possible to get around this
limitation either by using the PrintScreen key to capture a screenshot
and inserting it to, for example, Paint, or similarly by adding your texts
to a <q>printed</q> PDF file.
<script>
var toc = '', all = document.querySelectorAll('h2')

View File

@@ -2,7 +2,7 @@
* ld-diagram-view.c
*
* This file is a part of logdiag.
* Copyright 2010, 2011, 2012, 2015 Přemysl Eric Janouch
* Copyright 2010 - 2021 Přemysl Eric Janouch
*
* See the file LICENSE for licensing information.
*
@@ -335,7 +335,7 @@ static void oper_select_begin (LdDiagramView *self, const LdPoint *point);
static void oper_select_end (LdDiagramView *self);
static void oper_select_get_rectangle (LdDiagramView *self, LdRectangle *rect);
static void oper_select_queue_draw (LdDiagramView *self);
static void oper_select_draw (GtkWidget *widget, DrawData *data);
static void oper_select_draw (DrawData *data);
static void oper_select_motion (LdDiagramView *self, const LdPoint *point);
static void oper_move_selection_begin (LdDiagramView *self,
@@ -374,13 +374,19 @@ static void on_drag_leave (GtkWidget *widget, GdkDragContext *drag_ctx,
guint time, gpointer user_data);
static gboolean on_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data);
static void draw_grid (GtkWidget *widget, DrawData *data);
static void draw_diagram (GtkWidget *widget, DrawData *data);
static void draw_terminal (GtkWidget *widget, DrawData *data);
static void draw_grid (DrawData *data);
static void draw_diagram (DrawData *data);
static void draw_terminal (DrawData *data);
static void draw_object (LdDiagramObject *diagram_object, DrawData *data);
static void draw_symbol (LdDiagramSymbol *diagram_symbol, DrawData *data);
static void draw_connection (LdDiagramConnection *connection, DrawData *data);
/* Export. */
static void get_diagram_bounds (LdDiagramView *self, LdRectangle *rect);
static gboolean get_object_bounds (LdDiagramView *self, LdDiagramObject *object,
LdRectangle *rect);
G_DEFINE_TYPE_WITH_CODE (LdDiagramView, ld_diagram_view, GTK_TYPE_DRAWING_AREA,
G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE,
@@ -1045,6 +1051,27 @@ ld_diagram_view_diagram_to_widget_coords (LdDiagramView *self,
*wy = scale * (dy - self->priv->y) + 0.5 * allocation.height;
}
static void
ld_diagram_view_diagram_to_widget_coords_rect (LdDiagramView *self,
const LdRectangle *area, LdRectangle *rect)
{
gdouble x1, x2, y1, y2;
ld_diagram_view_diagram_to_widget_coords (self,
area->x,
area->y,
&x1, &y1);
ld_diagram_view_diagram_to_widget_coords (self,
area->x + area->width,
area->y + area->height,
&x2, &y2);
rect->x = floor (x1);
rect->y = floor (y1);
rect->width = ceil (x2) - rect->x;
rect->height = ceil (y2) - rect->y;
}
/**
* ld_diagram_view_get_x:
* @self: an #LdDiagramView object.
@@ -1288,7 +1315,7 @@ point_to_line_segment_distance
/* The projection is beyond the line segment. */
if (u < 0.)
return ld_point_distance (point, p1->x, p1->y);
else if (u > 1.)
if (u > 1.)
return ld_point_distance (point, p2->x, p2->y);
/* The projection is on the line segment. */
@@ -1612,14 +1639,12 @@ get_symbol_clip_area (LdDiagramView *self,
}
static gboolean
get_symbol_area (LdDiagramView *self, LdDiagramSymbol *symbol,
get_symbol_area_in_diagram_units (LdDiagramView *self, LdDiagramSymbol *symbol,
LdRectangle *rect)
{
gdouble object_x, object_y;
LdSymbol *library_symbol;
LdRectangle area;
gdouble x1, x2;
gdouble y1, y2;
gint rotation;
g_object_get (symbol, "x", &object_x, "y", &object_y,
@@ -1633,24 +1658,23 @@ get_symbol_area (LdDiagramView *self, LdDiagramSymbol *symbol,
rotate_symbol_area (&area, rotation);
ld_diagram_view_diagram_to_widget_coords (self,
object_x + area.x,
object_y + area.y,
&x1, &y1);
ld_diagram_view_diagram_to_widget_coords (self,
object_x + area.x + area.width,
object_y + area.y + area.height,
&x2, &y2);
rect->x = object_x + area.x;
rect->y = object_y + area.y;
rect->width = (rect->x + area.width) - rect->x;
rect->height = (rect->y + area.height) - rect->y;
return TRUE;
}
x1 = floor (x1);
y1 = floor (y1);
x2 = ceil (x2);
y2 = ceil (y2);
static gboolean
get_symbol_area (LdDiagramView *self, LdDiagramSymbol *symbol,
LdRectangle *rect)
{
LdRectangle intermediate;
rect->x = x1;
rect->y = y1;
rect->width = x2 - x1;
rect->height = y2 - y1;
if (!get_symbol_area_in_diagram_units (self, symbol, &intermediate))
return FALSE;
ld_diagram_view_diagram_to_widget_coords_rect (self, &intermediate, rect);
return TRUE;
}
@@ -1782,7 +1806,7 @@ get_connection_clip_area (LdDiagramView *self,
}
static gboolean
get_connection_area (LdDiagramView *self,
get_connection_area_in_diagram_units (LdDiagramView *self,
LdDiagramConnection *connection, LdRectangle *rect)
{
gdouble x_origin, y_origin;
@@ -1799,20 +1823,13 @@ get_connection_area (LdDiagramView *self,
g_object_get (connection, "x", &x_origin, "y", &y_origin, NULL);
ld_diagram_view_diagram_to_widget_coords (self,
x_origin + points->points[0].x,
y_origin + points->points[0].y,
&x, &y);
x_max = x_min = x;
y_max = y_min = y;
x_max = x_min = x_origin + points->points[0].x;
y_max = y_min = y_origin + points->points[0].y;
for (i = 1; i < points->length; i++)
{
ld_diagram_view_diagram_to_widget_coords (self,
x_origin + points->points[i].x,
y_origin + points->points[i].y,
&x, &y);
x = x_origin + points->points[i].x;
y = y_origin + points->points[i].y;
if (x < x_min)
x_min = x;
@@ -1834,6 +1851,19 @@ get_connection_area (LdDiagramView *self,
return TRUE;
}
static gboolean
get_connection_area (LdDiagramView *self,
LdDiagramConnection *connection, LdRectangle *rect)
{
LdRectangle intermediate;
if (!get_connection_area_in_diagram_units (self, connection, &intermediate))
return FALSE;
ld_diagram_view_diagram_to_widget_coords_rect (self, &intermediate, rect);
return TRUE;
}
/* ===== Operations ======================================================== */
@@ -2101,7 +2131,7 @@ oper_select_queue_draw (LdDiagramView *self)
}
static void
oper_select_draw (GtkWidget *widget, DrawData *data)
oper_select_draw (DrawData *data)
{
static const double dashes[] = {3, 5};
SelectData *select_data;
@@ -2561,6 +2591,8 @@ on_drag_motion (GtkWidget *widget, GdkDragContext *drag_ctx,
/* Discard leftovers from any previous unsuccessful drag. */
if (self->priv->dnd_left)
{
/* The Wayland backend does a leave-drop-leave sequence. */
if (self->priv->dnd_symbol)
g_object_unref (self->priv->dnd_symbol);
self->priv->dnd_symbol = NULL;
self->priv->dnd_left = FALSE;
@@ -2664,19 +2696,19 @@ on_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)
cairo_paint (data.cr);
if (data.self->priv->show_grid)
draw_grid (widget, &data);
draw_grid (&data);
draw_diagram (widget, &data);
draw_terminal (widget, &data);
draw_diagram (&data);
draw_terminal (&data);
if (data.self->priv->operation == OPER_SELECT)
oper_select_draw (widget, &data);
oper_select_draw (&data);
return FALSE;
}
static void
draw_grid (GtkWidget *widget, DrawData *data)
draw_grid (DrawData *data)
{
gdouble grid_step;
gint grid_factor;
@@ -2738,7 +2770,7 @@ draw_grid (GtkWidget *widget, DrawData *data)
}
static void
draw_terminal (GtkWidget *widget, DrawData *data)
draw_terminal (DrawData *data)
{
LdDiagramViewPrivate *priv;
LdPoint widget_coords;
@@ -2760,7 +2792,7 @@ draw_terminal (GtkWidget *widget, DrawData *data)
}
static void
draw_diagram (GtkWidget *widget, DrawData *data)
draw_diagram (DrawData *data)
{
GList *objects, *iter;
@@ -2905,5 +2937,101 @@ draw_connection (LdDiagramConnection *connection, DrawData *data)
draw_connection_end:
ld_point_array_free (points);
return;
}
/* ===== Export ============================================================ */
static void
get_diagram_bounds (LdDiagramView *self, LdRectangle *rect)
{
GList *objects;
gboolean initialized = FALSE;
LdRectangle partial;
gdouble x2, y2;
g_return_if_fail (LD_IS_DIAGRAM_VIEW (self));
g_return_if_fail (rect != NULL);
memset (rect, 0, sizeof *rect);
objects = (GList *) ld_diagram_get_objects (self->priv->diagram);
for (; objects != NULL; objects = objects->next)
{
if (!get_object_bounds (self, objects->data, &partial))
continue;
if (!initialized)
{
*rect = partial;
initialized = TRUE;
continue;
}
x2 = MAX (partial.x + partial.width, rect->x + rect->width);
y2 = MAX (partial.y + partial.height, rect->y + rect->height);
rect->x = MIN (rect->x, partial.x);
rect->y = MIN (rect->y, partial.y);
rect->width = x2 - rect->x;
rect->height = y2 - rect->y;
}
}
static gboolean
get_object_bounds (LdDiagramView *self, LdDiagramObject *object,
LdRectangle *rect)
{
if (LD_IS_DIAGRAM_SYMBOL (object))
return get_symbol_area_in_diagram_units (self,
LD_DIAGRAM_SYMBOL (object), rect);
if (LD_IS_DIAGRAM_CONNECTION (object))
return get_connection_area_in_diagram_units (self,
LD_DIAGRAM_CONNECTION (object), rect);
return FALSE;
}
/**
* ld_diagram_view_get_export_bounds:
* @self: an #LdDiagramView object.
* @rect: (out): diagram boundaries.
*
* Get the smallest rectangular area containing all objects in the diagram.
* The diagram object itself doesn't have any idea of how symbols are rendered.
*
* Return value: export units per diagram unit.
*/
gdouble
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);
}
/**
* ld_diagram_view_export:
* @self: an #LdDiagramView object.
* @cr: Cairo context to draw on.
* @clip: the clip area (the function itself does not clip).
*
* Get the smallest rectangular area containing all objects in the diagram.
* The diagram object itself doesn't have any idea of how symbols are rendered.
*/
void
ld_diagram_view_export (LdDiagramView *self, cairo_t *cr,
const LdRectangle *clip)
{
DrawData data;
data.cr = cr;
data.self = self;
/* FIXME: Various functions call this directly, this export is a hack. */
data.scale = ld_diagram_view_get_scale_in_px (data.self);
data.exposed_rect = *clip;
draw_diagram (&data);
}

View File

@@ -2,7 +2,7 @@
* ld-diagram-view.h
*
* This file is a part of logdiag.
* Copyright 2010, 2011 Přemysl Eric Janouch
* Copyright 2010 - 2021 Přemysl Eric Janouch
*
* See the file LICENSE for licensing information.
*
@@ -96,6 +96,11 @@ void ld_diagram_view_set_show_grid (LdDiagramView *self, gboolean show_grid);
void ld_diagram_view_add_object_begin (LdDiagramView *self,
LdDiagramObject *object);
gdouble ld_diagram_view_get_export_bounds (LdDiagramView *self,
LdRectangle *rect);
void ld_diagram_view_export (LdDiagramView *self,
cairo_t *cr, const LdRectangle *clip);
G_END_DECLS

View File

@@ -49,6 +49,8 @@ static gboolean foreach_dir (const gchar *path,
gboolean (*callback) (const gchar *, const gchar *, gpointer),
gpointer userdata, GError **error);
static LdSymbol *traverse_path (LdCategory *category, gchar **path);
G_DEFINE_TYPE (LdLibrary, ld_library, G_TYPE_OBJECT)
@@ -356,62 +358,51 @@ ld_library_load (LdLibrary *self, const gchar *directory)
LdSymbol *
ld_library_find_symbol (LdLibrary *self, const gchar *identifier)
{
gchar **id_el_start, **id_el;
const GSList *list, *list_el;
LdCategory *cat;
gchar **path;
LdSymbol *symbol = NULL;
g_return_val_if_fail (LD_IS_LIBRARY (self), NULL);
g_return_val_if_fail (identifier != NULL, NULL);
id_el_start = g_strsplit (identifier, LD_LIBRARY_IDENTIFIER_SEPARATOR, 0);
if (!id_el_start)
return NULL;
/* We need at least one category name plus the symbol name. */
id_el = id_el_start;
if (!id_el[0] || !id_el[1])
goto ld_library_find_symbol_error;
/* Find the category where the symbol is in. */
cat = self->priv->root;
while (1)
path = g_strsplit (identifier, LD_LIBRARY_IDENTIFIER_SEPARATOR, 0);
if (path)
{
gboolean found = FALSE;
list = ld_category_get_children (cat);
for (list_el = list; list_el; list_el = g_slist_next (list_el))
{
cat = LD_CATEGORY (list_el->data);
if (!strcmp (*id_el, ld_category_get_name (cat)))
{
found = TRUE;
break;
}
symbol = traverse_path (self->priv->root, path);
g_strfreev (path);
}
return symbol;
}
if (!found)
goto ld_library_find_symbol_error;
if (!(id_el++)[2])
break;
}
/* And then the actual symbol. */
list = ld_category_get_symbols (cat);
for (list_el = list; list_el; list_el = g_slist_next (list_el))
{
static LdSymbol *
traverse_path (LdCategory *category, gchar **path)
{
const GSList *list, *iter;
LdSymbol *symbol;
symbol = LD_SYMBOL (list_el->data);
if (!strcmp (*id_el, ld_symbol_get_name (symbol)))
g_return_val_if_fail (*path != NULL, NULL);
/* Walk the category tree to where the symbol is supposed to be. */
for (; path[1]; path++)
{
g_strfreev (id_el_start);
return symbol;
list = ld_category_get_children (category);
for (iter = list; iter; iter = g_slist_next (iter))
{
category = LD_CATEGORY (iter->data);
if (!strcmp (*path, ld_category_get_name (category)))
break;
}
if (!iter)
return NULL;
}
ld_library_find_symbol_error:
g_strfreev (id_el_start);
/* And look up the actual symbol at the leaf. */
list = ld_category_get_symbols (category);
for (iter = list; iter; iter = g_slist_next (iter))
{
symbol = LD_SYMBOL (iter->data);
if (!strcmp (*path, ld_symbol_get_name (symbol)))
return symbol;
}
return NULL;
}

View File

@@ -250,7 +250,6 @@ ld_lua_alloc (void *ud, void *ptr, size_t osize, size_t nsize)
g_free (ptr);
return NULL;
}
else
return g_try_realloc (ptr, nsize);
}

View File

@@ -1,3 +1,2 @@
VOID:OBJECT,OBJECT
VOID:OBJECT,STRING
VOID:DOUBLE,DOUBLE

134
po/cs.po
View File

@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: logdiag\n"
"Report-Msgid-Bugs-To: https://git.janouch.name/p/logdiag/issues\n"
"POT-Creation-Date: 2021-10-22 22:16+0200\n"
"PO-Revision-Date: 2021-10-22 22:21+0200\n"
"POT-Creation-Date: 2021-10-28 20:07+0200\n"
"PO-Revision-Date: 2021-10-28 20:10+0200\n"
"Last-Translator: Přemysl Eric Janouch <p@janouch.name>\n"
"Language-Team: Czech <cs@li.org>\n"
"Language: cs\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.0\n"
#: ../src/ld-window-main.c:937
#: ../src/ld-window-main.c:968
#, c-format
msgid "%d%%"
msgstr "%d %%"
@@ -26,19 +26,19 @@ msgstr "%d %%"
msgid "- Schematic editor"
msgstr "- Editor schémat"
#: ../src/ld-window-main.c:861
#: ../src/ld-window-main.c:892
msgid "Close _without Saving"
msgstr "Zavřít _bez uložení"
#: ../src/ld-window-main.c:128
#: ../src/ld-window-main.c:141
msgid "Create a new diagram"
msgstr "Vytvoří nový diagram"
#: ../src/ld-window-main.c:161
#: ../src/ld-window-main.c:174
msgid "Delete the contents of the selection"
msgstr "Odstraní obsah výběru"
#: ../src/ld-window-main.c:354
#: ../src/ld-window-main.c:370
msgid "Drag symbols from the library pane to add them to the diagram."
msgstr "Pro přidání symbolů do diagramu je přetáhněte z panelu knihovny."
@@ -46,131 +46,147 @@ msgstr "Pro přidání symbolů do diagramu je přetáhněte z panelu knihovny."
msgid "Empty"
msgstr "Prázdné"
#: ../src/ld-window-main.c:707
#: ../src/ld-window-main.c:1042
msgid "Error"
msgstr "Chyba"
#: ../src/ld-window-main.c:738
#, c-format
msgid "Failed to open file `%s': Invalid contents."
msgstr "Nelze otevřít soubor \"%s\": Neplatný obsah."
#: ../src/ld-window-main.c:698
#: ../src/ld-window-main.c:729
msgid "Failed to open the file"
msgstr "Nelze otevřít soubor"
#: ../src/ld-window-main.c:662
#: ../src/ld-window-main.c:1149
msgid "Failed to open the user guide"
msgstr "Nelze otevřít průvodce uživatele"
#: ../src/ld-window-main.c:693
msgid "Failed to save the diagram"
msgstr "Nelze uložit diagram"
#: ../src/ld-window-main.c:859
#: ../src/ld-window-main.c:890
msgid "If you don't save, changes will be permanently lost."
msgstr "Pokud je neuložíte, budou změny navždy ztraceny."
#: ../src/ld-window-main.c:738
#: ../src/ld-window-main.c:769
msgid "Logdiag Diagrams (*.ldd)"
msgstr "Diagramy logdiag (*.ldd)"
#: ../src/ld-window-main.c:131
#: ../src/ld-window-main.c:144
msgid "Open a diagram"
msgstr "Otevře diagram"
#: ../src/ld-window-main.c:759
#: ../src/ld-window-main.c:193
msgid "Open the manual"
msgstr "Otevře manuál"
#: ../src/ld-window-main.c:790
msgid "Open..."
msgstr "Otevřít..."
#: ../src/ld-window-main.c:145
#: ../src/ld-window-main.c:154
msgid "Print the diagram"
msgstr "Vytiskne diagram"
#: ../src/ld-window-main.c:158
msgid "Quit the application"
msgstr "Ukončí aplikaci"
#: ../src/ld-window-main.c:153
#: ../src/ld-window-main.c:166
msgid "Redo the last undone action"
msgstr "Provede posledně vrácenou akci"
#: ../src/ld-window-main.c:175
#: ../src/ld-window-main.c:188
msgid "Reset zoom level back to the default"
msgstr "Vrátí přiblížení na výchozí hodnotu"
#: ../src/ld-window-main.c:792
#: ../src/ld-window-main.c:823
msgid "Save As..."
msgstr "Uložit jako..."
#: ../src/ld-window-main.c:136
#: ../src/ld-window-main.c:149
msgid "Save _As..."
msgstr "Uložit _jako..."
#: ../src/ld-window-main.c:623
#: ../src/ld-window-main.c:654
#, c-format
msgid "Save the changes to diagram \"%s\" before closing it and creating a new one?"
msgstr "Uložit změny v diagramu \"%s\" před jeho zavřením a vytvořením nového?"
#: ../src/ld-window-main.c:755
#: ../src/ld-window-main.c:786
#, c-format
msgid "Save the changes to diagram \"%s\" before closing it and opening another one?"
msgstr "Uložit změny v diagramu \"%s\" před jeho zavřením a otevřením jiného?"
#: ../src/ld-window-main.c:899
#: ../src/ld-window-main.c:930
#, c-format
msgid "Save the changes to diagram \"%s\" before closing?"
msgstr "Uložit změny v diagramu \"%s\" před jeho zavřením?"
#: ../src/ld-window-main.c:134
#: ../src/ld-window-main.c:147
msgid "Save the current diagram"
msgstr "Uloží stávající diagram"
#: ../src/ld-window-main.c:137
#: ../src/ld-window-main.c:150
msgid "Save the current diagram with another name"
msgstr "Uloží stávající diagram pod jiným jménem"
#: ../src/ld-window-main.c:163
#: ../src/ld-window-main.c:176
msgid "Select _All"
msgstr "Vybrat _vše"
#: ../src/ld-window-main.c:164
#: ../src/ld-window-main.c:177
msgid "Select all objects in the diagram"
msgstr "Vybere všechny objekty v diagramu"
#: ../src/ld-window-main.c:192
#: ../src/ld-window-main.c:208
msgid "Show _Grid"
msgstr "Zobrazit _mřížku"
#: ../src/ld-window-main.c:180
#: ../src/ld-window-main.c:196
msgid "Show a dialog about this application"
msgstr "Zobrazí dialog o této aplikaci"
#: ../src/ld-window-main.c:193
#: ../src/ld-window-main.c:209
msgid "Toggle displaying of the grid"
msgstr "Přepne zobrazování mřížky"
#: ../src/ld-window-main.c:190
#: ../src/ld-window-main.c:206
msgid "Toggle displaying of the library pane"
msgstr "Přepne zobrazování panelu knihovny"
#: ../src/ld-window-main.c:187
#: ../src/ld-window-main.c:203
msgid "Toggle displaying of the main toolbar"
msgstr "Přepne zobrazování hlavního panelu nástrojů"
#: ../src/ld-window-main.c:665
#: ../src/ld-window-main.c:696
msgid "Try again or save it under another name."
msgstr "Zkuste to znova nebo jej uložte pod jiným názvem."
#: ../src/ld-window-main.c:150
#: ../src/ld-window-main.c:163
msgid "Undo the last action"
msgstr "Vrátí poslední akci"
#: ../src/ld-window-main.c:591
#: ../src/ld-window-main.c:622
msgid "Unsaved Diagram"
msgstr "Neuložený diagram"
#: ../src/ld-window-main.c:806
#: ../src/ld-window-main.c:837
msgid "Untitled diagram"
msgstr "Nepojmenovaný diagram"
#: ../src/ld-window-main.c:171
#: ../src/ld-window-main.c:184
msgid "Zoom _Out"
msgstr "_Oddálit"
#: ../src/ld-window-main.c:169
#: ../src/ld-window-main.c:182
msgid "Zoom into the diagram"
msgstr "Přiblíží diagram"
#: ../src/ld-window-main.c:172
#: ../src/ld-window-main.c:185
msgid "Zoom out of the diagram"
msgstr "Oddálí diagram"
@@ -178,71 +194,79 @@ msgstr "Oddálí diagram"
msgid "[FILE...]"
msgstr "[SOUBOR...]"
#: ../src/ld-window-main.c:179
#: ../src/ld-window-main.c:195
msgid "_About"
msgstr "_O programu"
#: ../src/ld-window-main.c:160
#: ../src/ld-window-main.c:173
msgid "_Delete"
msgstr "_Smazat"
#: ../src/ld-window-main.c:148
#: ../src/ld-window-main.c:161
msgid "_Edit"
msgstr "_Úpravy"
#: ../src/ld-window-main.c:126
#: ../src/ld-window-main.c:139
msgid "_File"
msgstr "_Soubor"
#: ../src/ld-window-main.c:178
#: ../src/ld-window-main.c:191
msgid "_Help"
msgstr "_Nápověda"
#: ../src/ld-window-main.c:189
#: ../src/ld-window-main.c:205
msgid "_Library Pane"
msgstr "Panel _knihovny"
#: ../src/ld-window-main.c:186
#: ../src/ld-window-main.c:202
msgid "_Main Toolbar"
msgstr "_Hlavní panel nástrojů"
#: ../src/ld-window-main.c:127
#: ../src/ld-window-main.c:140
msgid "_New"
msgstr "_Nový"
#: ../src/ld-window-main.c:174
#: ../src/ld-window-main.c:187
msgid "_Normal Size"
msgstr "_Normální velikost"
#: ../src/ld-window-main.c:130
#: ../src/ld-window-main.c:143
msgid "_Open..."
msgstr "_Otevřít..."
#: ../src/ld-window-main.c:144
#: ../src/ld-window-main.c:153
msgid "_Print..."
msgstr "_Tisk..."
#: ../src/ld-window-main.c:157
msgid "_Quit"
msgstr "U_končit"
#: ../src/ld-window-main.c:152
#: ../src/ld-window-main.c:165
msgid "_Redo"
msgstr "Z_novu"
#: ../src/ld-window-main.c:133
#: ../src/ld-window-main.c:146
msgid "_Save"
msgstr "_Uložit"
#: ../src/ld-window-main.c:149
#: ../src/ld-window-main.c:162
msgid "_Undo"
msgstr "_Zpět"
#: ../src/ld-window-main.c:167
#: ../src/ld-window-main.c:192
msgid "_User Guide"
msgstr "_Průvodce uživatele"
#: ../src/ld-window-main.c:180
msgid "_View"
msgstr "_Zobrazení"
#: ../src/ld-window-main.c:168
#: ../src/ld-window-main.c:181
msgid "_Zoom In"
msgstr "_Přiblížit"
#: ../src/ld-window-main.c:983
#: ../src/ld-window-main.c:1163
msgid "translator-credits"
msgstr "Přemysl Eric Janouch <p@janouch.name>"

141
po/de.po
View File

@@ -7,17 +7,17 @@ msgid ""
msgstr ""
"Project-Id-Version: logdiag\n"
"Report-Msgid-Bugs-To: https://git.janouch.name/p/logdiag/issues\n"
"POT-Creation-Date: 2021-10-22 22:16+0200\n"
"PO-Revision-Date: 2018-06-25 04:11+0200\n"
"POT-Creation-Date: 2021-10-28 20:07+0200\n"
"PO-Revision-Date: 2021-10-28 21:29+0200\n"
"Last-Translator: Přemysl Eric Janouch <p@janouch.name>\n"
"Language-Team: German <de@li.org>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.8\n"
"X-Generator: Poedit 3.0\n"
#: ../src/ld-window-main.c:937
#: ../src/ld-window-main.c:968
#, c-format
msgid "%d%%"
msgstr "%d %%"
@@ -26,19 +26,19 @@ msgstr "%d %%"
msgid "- Schematic editor"
msgstr "- Schema Editor"
#: ../src/ld-window-main.c:861
#: ../src/ld-window-main.c:892
msgid "Close _without Saving"
msgstr "Schließen _ohne Speichern"
#: ../src/ld-window-main.c:128
#: ../src/ld-window-main.c:141
msgid "Create a new diagram"
msgstr "Neues Diagramm erstellen"
#: ../src/ld-window-main.c:161
#: ../src/ld-window-main.c:174
msgid "Delete the contents of the selection"
msgstr "Inhalt der markierten Einträge löschen"
#: ../src/ld-window-main.c:354
#: ../src/ld-window-main.c:370
msgid "Drag symbols from the library pane to add them to the diagram."
msgstr ""
"Ziehen Sie Symbole aus dem Bibliotheksfenster, um sie dem Diagramm "
@@ -48,62 +48,78 @@ msgstr ""
msgid "Empty"
msgstr "Leere"
#: ../src/ld-window-main.c:707
#: ../src/ld-window-main.c:1042
msgid "Error"
msgstr "Fehler"
#: ../src/ld-window-main.c:738
#, c-format
msgid "Failed to open file `%s': Invalid contents."
msgstr "Fehler beim Öffnen der Datei \"%s\": Ungültiger Inhalt."
#: ../src/ld-window-main.c:698
#: ../src/ld-window-main.c:729
msgid "Failed to open the file"
msgstr "Fehler beim Öffnen der Datei"
#: ../src/ld-window-main.c:662
#: ../src/ld-window-main.c:1149
msgid "Failed to open the user guide"
msgstr "Fehler beim Öffnen des Benutzerhandbuchs"
#: ../src/ld-window-main.c:693
msgid "Failed to save the diagram"
msgstr "Fehler beim Speichern des Diagramms"
#: ../src/ld-window-main.c:859
#: ../src/ld-window-main.c:890
msgid "If you don't save, changes will be permanently lost."
msgstr "Wenn Sie nicht speichern, gehen alle Änderungen verloren."
#: ../src/ld-window-main.c:738
#: ../src/ld-window-main.c:769
msgid "Logdiag Diagrams (*.ldd)"
msgstr "Diagramme logdiag (.ldd)"
#: ../src/ld-window-main.c:131
#: ../src/ld-window-main.c:144
msgid "Open a diagram"
msgstr "Diagramm öffnen"
#: ../src/ld-window-main.c:759
#: ../src/ld-window-main.c:193
msgid "Open the manual"
msgstr "Die Betriebsanleitung öffnen"
#: ../src/ld-window-main.c:790
msgid "Open..."
msgstr "Öffnen..."
#: ../src/ld-window-main.c:145
#: ../src/ld-window-main.c:154
msgid "Print the diagram"
msgstr "Das Diagramm drucken"
#: ../src/ld-window-main.c:158
msgid "Quit the application"
msgstr "Anwendung beenden"
#: ../src/ld-window-main.c:153
#: ../src/ld-window-main.c:166
msgid "Redo the last undone action"
msgstr "Letzte nicht abgeschlossene Aktion wiederholen"
#: ../src/ld-window-main.c:175
#: ../src/ld-window-main.c:188
msgid "Reset zoom level back to the default"
msgstr "Zoom Bereich zurücksetzen"
#: ../src/ld-window-main.c:792
#: ../src/ld-window-main.c:823
msgid "Save As..."
msgstr "Speichern unter..."
#: ../src/ld-window-main.c:136
#: ../src/ld-window-main.c:149
msgid "Save _As..."
msgstr "Speichern _unter..."
#: ../src/ld-window-main.c:623
#: ../src/ld-window-main.c:654
#, c-format
msgid ""
"Save the changes to diagram \"%s\" before closing it and creating a new one?"
msgstr "Änderungen im Diagramm \"%s\" speichern bevor ein Neues geöffnet wird?"
#: ../src/ld-window-main.c:755
#: ../src/ld-window-main.c:786
#, c-format
msgid ""
"Save the changes to diagram \"%s\" before closing it and opening another one?"
@@ -111,73 +127,72 @@ msgstr ""
"Änderungen im Diagramm \"%s\" speichern bevor es beendet und ein Weiteres "
"geöffnet wird?"
#: ../src/ld-window-main.c:899
#: ../src/ld-window-main.c:930
#, c-format
msgid "Save the changes to diagram \"%s\" before closing?"
msgstr "Änderungen im Diagramm \"%s\" vor dem Schließen speichern?"
#: ../src/ld-window-main.c:134
#: ../src/ld-window-main.c:147
msgid "Save the current diagram"
msgstr "Speichern des aktuellen Diagramms"
#: ../src/ld-window-main.c:137
#: ../src/ld-window-main.c:150
msgid "Save the current diagram with another name"
msgstr "Aktuelles Diagramm unter anderem Namen speichern"
#: ../src/ld-window-main.c:163
#: ../src/ld-window-main.c:176
msgid "Select _All"
msgstr "_Alles Auswählen"
#: ../src/ld-window-main.c:164
#: ../src/ld-window-main.c:177
msgid "Select all objects in the diagram"
msgstr "Alle Objekte im Diagramm auswählen"
#: ../src/ld-window-main.c:192
#: ../src/ld-window-main.c:208
msgid "Show _Grid"
msgstr "_Gitter anzeigen"
#: ../src/ld-window-main.c:180
#: ../src/ld-window-main.c:196
msgid "Show a dialog about this application"
msgstr "Zeige einen Dialog über diese Anwendung"
#: ../src/ld-window-main.c:193
#: ../src/ld-window-main.c:209
msgid "Toggle displaying of the grid"
msgstr "Gitter ein-/ausblenden"
#: ../src/ld-window-main.c:190
#: ../src/ld-window-main.c:206
msgid "Toggle displaying of the library pane"
msgstr "Bibliothek ein-/ausblenden"
#: ../src/ld-window-main.c:187
#: ../src/ld-window-main.c:203
msgid "Toggle displaying of the main toolbar"
msgstr "Symbolleiste ein-/ausblenden"
#: ../src/ld-window-main.c:665
#: ../src/ld-window-main.c:696
msgid "Try again or save it under another name."
msgstr "Erneuter Versuch oder unter anderem Namen speichern."
#: ../src/ld-window-main.c:150
#: ../src/ld-window-main.c:163
msgid "Undo the last action"
msgstr "Letzte Aktion rückgangig machen"
#: ../src/ld-window-main.c:591
#: ../src/ld-window-main.c:622
msgid "Unsaved Diagram"
msgstr "Ungespeichertes Diagramm"
#: ../src/ld-window-main.c:806
#, fuzzy
#: ../src/ld-window-main.c:837
msgid "Untitled diagram"
msgstr "Ungespeichertes Diagramm"
msgstr "Unbenanntes Diagramm"
#: ../src/ld-window-main.c:171
#: ../src/ld-window-main.c:184
msgid "Zoom _Out"
msgstr "Zoom _heraus"
#: ../src/ld-window-main.c:169
#: ../src/ld-window-main.c:182
msgid "Zoom into the diagram"
msgstr "In das Diagramm zoomen"
#: ../src/ld-window-main.c:172
#: ../src/ld-window-main.c:185
msgid "Zoom out of the diagram"
msgstr "Aus dem Diagramm zoomen"
@@ -185,71 +200,79 @@ msgstr "Aus dem Diagramm zoomen"
msgid "[FILE...]"
msgstr "[DATEI...]"
#: ../src/ld-window-main.c:179
#: ../src/ld-window-main.c:195
msgid "_About"
msgstr "_Über"
msgstr "_Info"
#: ../src/ld-window-main.c:160
#: ../src/ld-window-main.c:173
msgid "_Delete"
msgstr "_Löschen"
#: ../src/ld-window-main.c:148
#: ../src/ld-window-main.c:161
msgid "_Edit"
msgstr "_Ändern"
#: ../src/ld-window-main.c:126
#: ../src/ld-window-main.c:139
msgid "_File"
msgstr "_Datei"
#: ../src/ld-window-main.c:178
#: ../src/ld-window-main.c:191
msgid "_Help"
msgstr "_Hilfe"
#: ../src/ld-window-main.c:189
#: ../src/ld-window-main.c:205
msgid "_Library Pane"
msgstr "_Bibliothek Menüleiste"
#: ../src/ld-window-main.c:186
#: ../src/ld-window-main.c:202
msgid "_Main Toolbar"
msgstr "_Symbolleiste"
#: ../src/ld-window-main.c:127
#: ../src/ld-window-main.c:140
msgid "_New"
msgstr "_Neu"
#: ../src/ld-window-main.c:174
#: ../src/ld-window-main.c:187
msgid "_Normal Size"
msgstr "_Normale Größe"
#: ../src/ld-window-main.c:130
#: ../src/ld-window-main.c:143
msgid "_Open..."
msgstr "_Öffnen..."
#: ../src/ld-window-main.c:144
#: ../src/ld-window-main.c:153
msgid "_Print..."
msgstr "_Drucken..."
#: ../src/ld-window-main.c:157
msgid "_Quit"
msgstr "_Beenden"
#: ../src/ld-window-main.c:152
#: ../src/ld-window-main.c:165
msgid "_Redo"
msgstr "_Wiederholen"
#: ../src/ld-window-main.c:133
#: ../src/ld-window-main.c:146
msgid "_Save"
msgstr "_Speichern"
#: ../src/ld-window-main.c:149
#: ../src/ld-window-main.c:162
msgid "_Undo"
msgstr "_Rückgängig"
#: ../src/ld-window-main.c:167
#: ../src/ld-window-main.c:192
msgid "_User Guide"
msgstr "_Benutzerhandbuch"
#: ../src/ld-window-main.c:180
msgid "_View"
msgstr "_Ansicht"
#: ../src/ld-window-main.c:168
#: ../src/ld-window-main.c:181
msgid "_Zoom In"
msgstr "_Hineinzoomen"
#: ../src/ld-window-main.c:983
#: ../src/ld-window-main.c:1163
msgid "translator-credits"
msgstr "Andy J."

View File

@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: logdiag 0.2.0\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-22 22:16+0200\n"
"POT-Creation-Date: 2021-10-28 20:07+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,222 +17,246 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../src/ld-window-main.c:126
#: ../src/ld-window-main.c:139
msgid "_File"
msgstr ""
#: ../src/ld-window-main.c:127
#: ../src/ld-window-main.c:140
msgid "_New"
msgstr ""
#: ../src/ld-window-main.c:128
#: ../src/ld-window-main.c:141
msgid "Create a new diagram"
msgstr ""
#: ../src/ld-window-main.c:130
#: ../src/ld-window-main.c:143
msgid "_Open..."
msgstr ""
#: ../src/ld-window-main.c:131
#: ../src/ld-window-main.c:144
msgid "Open a diagram"
msgstr ""
#: ../src/ld-window-main.c:133
#: ../src/ld-window-main.c:146
msgid "_Save"
msgstr ""
#: ../src/ld-window-main.c:134
#: ../src/ld-window-main.c:147
msgid "Save the current diagram"
msgstr ""
#: ../src/ld-window-main.c:136
#: ../src/ld-window-main.c:149
msgid "Save _As..."
msgstr ""
#: ../src/ld-window-main.c:137
#: ../src/ld-window-main.c:150
msgid "Save the current diagram with another name"
msgstr ""
#: ../src/ld-window-main.c:144
#: ../src/ld-window-main.c:153
msgid "_Print..."
msgstr ""
#: ../src/ld-window-main.c:154
msgid "Print the diagram"
msgstr ""
#: ../src/ld-window-main.c:157
msgid "_Quit"
msgstr ""
#: ../src/ld-window-main.c:145
#: ../src/ld-window-main.c:158
msgid "Quit the application"
msgstr ""
#: ../src/ld-window-main.c:148
#: ../src/ld-window-main.c:161
msgid "_Edit"
msgstr ""
#: ../src/ld-window-main.c:149
#: ../src/ld-window-main.c:162
msgid "_Undo"
msgstr ""
#: ../src/ld-window-main.c:150
#: ../src/ld-window-main.c:163
msgid "Undo the last action"
msgstr ""
#: ../src/ld-window-main.c:152
#: ../src/ld-window-main.c:165
msgid "_Redo"
msgstr ""
#: ../src/ld-window-main.c:153
#: ../src/ld-window-main.c:166
msgid "Redo the last undone action"
msgstr ""
#: ../src/ld-window-main.c:160
#: ../src/ld-window-main.c:173
msgid "_Delete"
msgstr ""
#: ../src/ld-window-main.c:161
#: ../src/ld-window-main.c:174
msgid "Delete the contents of the selection"
msgstr ""
#: ../src/ld-window-main.c:163
#: ../src/ld-window-main.c:176
msgid "Select _All"
msgstr ""
#: ../src/ld-window-main.c:164
#: ../src/ld-window-main.c:177
msgid "Select all objects in the diagram"
msgstr ""
#: ../src/ld-window-main.c:167
#: ../src/ld-window-main.c:180
msgid "_View"
msgstr ""
#: ../src/ld-window-main.c:168
#: ../src/ld-window-main.c:181
msgid "_Zoom In"
msgstr ""
#: ../src/ld-window-main.c:169
#: ../src/ld-window-main.c:182
msgid "Zoom into the diagram"
msgstr ""
#: ../src/ld-window-main.c:171
#: ../src/ld-window-main.c:184
msgid "Zoom _Out"
msgstr ""
#: ../src/ld-window-main.c:172
#: ../src/ld-window-main.c:185
msgid "Zoom out of the diagram"
msgstr ""
#: ../src/ld-window-main.c:174
#: ../src/ld-window-main.c:187
msgid "_Normal Size"
msgstr ""
#: ../src/ld-window-main.c:175
#: ../src/ld-window-main.c:188
msgid "Reset zoom level back to the default"
msgstr ""
#: ../src/ld-window-main.c:178
#: ../src/ld-window-main.c:191
msgid "_Help"
msgstr ""
#: ../src/ld-window-main.c:179
msgid "_About"
msgstr ""
#: ../src/ld-window-main.c:180
msgid "Show a dialog about this application"
msgstr ""
#: ../src/ld-window-main.c:186
msgid "_Main Toolbar"
msgstr ""
#: ../src/ld-window-main.c:187
msgid "Toggle displaying of the main toolbar"
msgstr ""
#: ../src/ld-window-main.c:189
msgid "_Library Pane"
msgstr ""
#: ../src/ld-window-main.c:190
msgid "Toggle displaying of the library pane"
msgstr ""
#: ../src/ld-window-main.c:192
msgid "Show _Grid"
msgid "_User Guide"
msgstr ""
#: ../src/ld-window-main.c:193
msgid "Open the manual"
msgstr ""
#: ../src/ld-window-main.c:195
msgid "_About"
msgstr ""
#: ../src/ld-window-main.c:196
msgid "Show a dialog about this application"
msgstr ""
#: ../src/ld-window-main.c:202
msgid "_Main Toolbar"
msgstr ""
#: ../src/ld-window-main.c:203
msgid "Toggle displaying of the main toolbar"
msgstr ""
#: ../src/ld-window-main.c:205
msgid "_Library Pane"
msgstr ""
#: ../src/ld-window-main.c:206
msgid "Toggle displaying of the library pane"
msgstr ""
#: ../src/ld-window-main.c:208
msgid "Show _Grid"
msgstr ""
#: ../src/ld-window-main.c:209
msgid "Toggle displaying of the grid"
msgstr ""
#: ../src/ld-window-main.c:354
#: ../src/ld-window-main.c:370
msgid "Drag symbols from the library pane to add them to the diagram."
msgstr ""
#: ../src/ld-window-main.c:591
#: ../src/ld-window-main.c:622
msgid "Unsaved Diagram"
msgstr ""
#: ../src/ld-window-main.c:623
#: ../src/ld-window-main.c:654
#, c-format
msgid ""
"Save the changes to diagram \"%s\" before closing it and creating a new one?"
msgstr ""
#: ../src/ld-window-main.c:662
#: ../src/ld-window-main.c:693
msgid "Failed to save the diagram"
msgstr ""
#: ../src/ld-window-main.c:665
#: ../src/ld-window-main.c:696
msgid "Try again or save it under another name."
msgstr ""
#: ../src/ld-window-main.c:698
#: ../src/ld-window-main.c:729
msgid "Failed to open the file"
msgstr ""
#: ../src/ld-window-main.c:707
#: ../src/ld-window-main.c:738
#, c-format
msgid "Failed to open file `%s': Invalid contents."
msgstr ""
#: ../src/ld-window-main.c:738
#: ../src/ld-window-main.c:769
msgid "Logdiag Diagrams (*.ldd)"
msgstr ""
#: ../src/ld-window-main.c:755
#: ../src/ld-window-main.c:786
#, c-format
msgid ""
"Save the changes to diagram \"%s\" before closing it and opening another one?"
msgstr ""
#: ../src/ld-window-main.c:759
#: ../src/ld-window-main.c:790
msgid "Open..."
msgstr ""
#: ../src/ld-window-main.c:792
#: ../src/ld-window-main.c:823
msgid "Save As..."
msgstr ""
#: ../src/ld-window-main.c:806
#: ../src/ld-window-main.c:837
msgid "Untitled diagram"
msgstr ""
#: ../src/ld-window-main.c:859
#: ../src/ld-window-main.c:890
msgid "If you don't save, changes will be permanently lost."
msgstr ""
#: ../src/ld-window-main.c:861
#: ../src/ld-window-main.c:892
msgid "Close _without Saving"
msgstr ""
#: ../src/ld-window-main.c:899
#: ../src/ld-window-main.c:930
#, c-format
msgid "Save the changes to diagram \"%s\" before closing?"
msgstr ""
#: ../src/ld-window-main.c:937
#: ../src/ld-window-main.c:968
#, c-format
msgid "%d%%"
msgstr ""
#: ../src/ld-window-main.c:983
#: ../src/ld-window-main.c:1042
msgid "Error"
msgstr ""
#: ../src/ld-window-main.c:1149
msgid "Failed to open the user guide"
msgstr ""
#: ../src/ld-window-main.c:1163
msgid "translator-credits"
msgstr ""

159
po/pl.po
View File

@@ -7,17 +7,17 @@ msgid ""
msgstr ""
"Project-Id-Version: logdiag\n"
"Report-Msgid-Bugs-To: https://git.janouch.name/p/logdiag/issues\n"
"POT-Creation-Date: 2021-10-22 22:16+0200\n"
"PO-Revision-Date: 2018-06-25 04:09+0200\n"
"POT-Creation-Date: 2021-10-28 20:07+0200\n"
"PO-Revision-Date: 2021-10-28 20:38+0200\n"
"Last-Translator: Přemysl Eric Janouch <p@janouch.name>\n"
"Language-Team: Polish <pl@li.org>\n"
"Language: pl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.8\n"
"X-Generator: Poedit 3.0\n"
#: ../src/ld-window-main.c:937
#: ../src/ld-window-main.c:968
#, c-format
msgid "%d%%"
msgstr "%d%%"
@@ -26,19 +26,19 @@ msgstr "%d%%"
msgid "- Schematic editor"
msgstr "- Edytor schematów"
#: ../src/ld-window-main.c:861
#: ../src/ld-window-main.c:892
msgid "Close _without Saving"
msgstr "Zamknąć _bez zapisu"
#: ../src/ld-window-main.c:128
#: ../src/ld-window-main.c:141
msgid "Create a new diagram"
msgstr "Stworzenie nowego wykresu"
#: ../src/ld-window-main.c:161
#: ../src/ld-window-main.c:174
msgid "Delete the contents of the selection"
msgstr "Usuń zawartość wyboru"
#: ../src/ld-window-main.c:354
#: ../src/ld-window-main.c:370
msgid "Drag symbols from the library pane to add them to the diagram."
msgstr "Przeciągnij symbole z panelu biblioteki, aby dodać je do diagramu."
@@ -46,136 +46,147 @@ msgstr "Przeciągnij symbole z panelu biblioteki, aby dodać je do diagramu."
msgid "Empty"
msgstr "Puste"
#: ../src/ld-window-main.c:707
#: ../src/ld-window-main.c:1042
msgid "Error"
msgstr "Błąd"
#: ../src/ld-window-main.c:738
#, c-format
msgid "Failed to open file `%s': Invalid contents."
msgstr "Nie można otworzyć pliku \"%s\": Niepoprawna zawartość."
#: ../src/ld-window-main.c:698
#: ../src/ld-window-main.c:729
msgid "Failed to open the file"
msgstr "Pliku nie da się otworzyć"
#: ../src/ld-window-main.c:662
#: ../src/ld-window-main.c:1149
msgid "Failed to open the user guide"
msgstr "Przewodniku użytkownika nie da się otworzyć"
#: ../src/ld-window-main.c:693
msgid "Failed to save the diagram"
msgstr "Nie udało się zapisać wykresu"
#: ../src/ld-window-main.c:859
#: ../src/ld-window-main.c:890
msgid "If you don't save, changes will be permanently lost."
msgstr "Jeżeli nie zapiszesz zmian, zostaną one trwale utracone"
msgstr "Jeżeli nie zapiszesz zmian, zostaną one trwale utracone."
#: ../src/ld-window-main.c:738
#: ../src/ld-window-main.c:769
msgid "Logdiag Diagrams (*.ldd)"
msgstr "Wykresy logdiag (*.ldd)"
#: ../src/ld-window-main.c:131
#: ../src/ld-window-main.c:144
msgid "Open a diagram"
msgstr "Otwórz wykres"
#: ../src/ld-window-main.c:759
#: ../src/ld-window-main.c:193
msgid "Open the manual"
msgstr "Otworzy podręcznik"
#: ../src/ld-window-main.c:790
msgid "Open..."
msgstr "Otworzyć..."
#: ../src/ld-window-main.c:145
#: ../src/ld-window-main.c:154
msgid "Print the diagram"
msgstr "Wydrukuje wykres"
#: ../src/ld-window-main.c:158
msgid "Quit the application"
msgstr "Zamknie aplikację"
#: ../src/ld-window-main.c:153
#: ../src/ld-window-main.c:166
msgid "Redo the last undone action"
msgstr "Powtórzy ostatnio cofniętą akcję"
#: ../src/ld-window-main.c:175
#: ../src/ld-window-main.c:188
msgid "Reset zoom level back to the default"
msgstr "Przywróci poziom zbliżenia na poziom wyjściowy"
#: ../src/ld-window-main.c:792
#: ../src/ld-window-main.c:823
msgid "Save As..."
msgstr "Zapisz jako..."
#: ../src/ld-window-main.c:136
#: ../src/ld-window-main.c:149
msgid "Save _As..."
msgstr "Zapisz _jako..."
#: ../src/ld-window-main.c:623
#: ../src/ld-window-main.c:654
#, c-format
msgid ""
"Save the changes to diagram \"%s\" before closing it and creating a new one?"
msgstr ""
"Zapisać zmiany w wykresie \"%s\" przed jego zamknięciem i stworzeniem nowego?"
msgid "Save the changes to diagram \"%s\" before closing it and creating a new one?"
msgstr "Zapisać zmiany w wykresie \"%s\" przed jego zamknięciem i stworzeniem nowego?"
#: ../src/ld-window-main.c:755
#: ../src/ld-window-main.c:786
#, c-format
msgid ""
"Save the changes to diagram \"%s\" before closing it and opening another one?"
msgstr ""
"Zapisać zmiany w wykresie \"%s\" przed jego zamknięciem i stworzeniem nowego?"
msgid "Save the changes to diagram \"%s\" before closing it and opening another one?"
msgstr "Zapisać zmiany w wykresie \"%s\" przed jego zamknięciem i stworzeniem nowego?"
#: ../src/ld-window-main.c:899
#: ../src/ld-window-main.c:930
#, c-format
msgid "Save the changes to diagram \"%s\" before closing?"
msgstr "Zapisać zmiany w wykresie \"%s\" przed jego zamknięciem?"
#: ../src/ld-window-main.c:134
#: ../src/ld-window-main.c:147
msgid "Save the current diagram"
msgstr "Zapisz aktywny wykres"
#: ../src/ld-window-main.c:137
#: ../src/ld-window-main.c:150
msgid "Save the current diagram with another name"
msgstr "Zapisać aktywny wykres pod inną nazwą"
#: ../src/ld-window-main.c:163
#: ../src/ld-window-main.c:176
msgid "Select _All"
msgstr "Wybierz _wszystko"
#: ../src/ld-window-main.c:164
#: ../src/ld-window-main.c:177
msgid "Select all objects in the diagram"
msgstr "Wybierze wszystkie obietky w wykresie"
#: ../src/ld-window-main.c:192
#: ../src/ld-window-main.c:208
msgid "Show _Grid"
msgstr "Pokaż _Siatkę"
msgstr "Pokaż _siatkę"
#: ../src/ld-window-main.c:180
#: ../src/ld-window-main.c:196
msgid "Show a dialog about this application"
msgstr "Pokaże informacje o tej aplikacji"
#: ../src/ld-window-main.c:193
#: ../src/ld-window-main.c:209
msgid "Toggle displaying of the grid"
msgstr "Przełączy pokazywanie siatki"
#: ../src/ld-window-main.c:190
#: ../src/ld-window-main.c:206
msgid "Toggle displaying of the library pane"
msgstr "Przełączy pokazywanie panelu biblioteki"
#: ../src/ld-window-main.c:187
#: ../src/ld-window-main.c:203
msgid "Toggle displaying of the main toolbar"
msgstr "Przełączy pokazywanie głównego panelu narzędzi"
#: ../src/ld-window-main.c:665
#: ../src/ld-window-main.c:696
msgid "Try again or save it under another name."
msgstr "Spróbuj ponownie, bądź zapisz pod inną nazwą."
#: ../src/ld-window-main.c:150
#: ../src/ld-window-main.c:163
msgid "Undo the last action"
msgstr "Cofnie ostatnią akcję"
#: ../src/ld-window-main.c:591
#: ../src/ld-window-main.c:622
msgid "Unsaved Diagram"
msgstr "Niezapisany Wykres"
msgstr "Niezapisany wykres"
#: ../src/ld-window-main.c:806
#, fuzzy
#: ../src/ld-window-main.c:837
msgid "Untitled diagram"
msgstr "Niezapisany Wykres"
msgstr "Wykres bez nazwy"
#: ../src/ld-window-main.c:171
#: ../src/ld-window-main.c:184
msgid "Zoom _Out"
msgstr "_Oddalić widok"
#: ../src/ld-window-main.c:169
#: ../src/ld-window-main.c:182
msgid "Zoom into the diagram"
msgstr "Przybliżyć widok"
#: ../src/ld-window-main.c:172
#: ../src/ld-window-main.c:185
msgid "Zoom out of the diagram"
msgstr "Oddalić widok"
@@ -183,71 +194,79 @@ msgstr "Oddalić widok"
msgid "[FILE...]"
msgstr "[PLIK...]"
#: ../src/ld-window-main.c:179
#: ../src/ld-window-main.c:195
msgid "_About"
msgstr "_O programie"
#: ../src/ld-window-main.c:160
#: ../src/ld-window-main.c:173
msgid "_Delete"
msgstr "_Usuń"
#: ../src/ld-window-main.c:148
#: ../src/ld-window-main.c:161
msgid "_Edit"
msgstr "_Edycja"
#: ../src/ld-window-main.c:126
#: ../src/ld-window-main.c:139
msgid "_File"
msgstr "_Plik"
#: ../src/ld-window-main.c:178
#: ../src/ld-window-main.c:191
msgid "_Help"
msgstr "_Pomoc"
#: ../src/ld-window-main.c:189
#: ../src/ld-window-main.c:205
msgid "_Library Pane"
msgstr "Panel _biblioteki"
#: ../src/ld-window-main.c:186
#: ../src/ld-window-main.c:202
msgid "_Main Toolbar"
msgstr "_Główny panel narzędzi"
#: ../src/ld-window-main.c:127
#: ../src/ld-window-main.c:140
msgid "_New"
msgstr "_Nowy"
#: ../src/ld-window-main.c:174
#: ../src/ld-window-main.c:187
msgid "_Normal Size"
msgstr "_Normalna Wielkość"
msgstr "_Normalna wielkość"
#: ../src/ld-window-main.c:130
#: ../src/ld-window-main.c:143
msgid "_Open..."
msgstr "_Otwórz..."
#: ../src/ld-window-main.c:144
#: ../src/ld-window-main.c:153
msgid "_Print..."
msgstr "Wy_drukuj..."
#: ../src/ld-window-main.c:157
msgid "_Quit"
msgstr "_Zakończ"
#: ../src/ld-window-main.c:152
#: ../src/ld-window-main.c:165
msgid "_Redo"
msgstr "_Powtórz"
#: ../src/ld-window-main.c:133
#: ../src/ld-window-main.c:146
msgid "_Save"
msgstr "Z_apisz"
#: ../src/ld-window-main.c:149
#: ../src/ld-window-main.c:162
msgid "_Undo"
msgstr "_Wróć"
#: ../src/ld-window-main.c:167
#: ../src/ld-window-main.c:192
msgid "_User Guide"
msgstr "_Przewodnik użytkownika"
#: ../src/ld-window-main.c:180
msgid "_View"
msgstr "_Widok"
#: ../src/ld-window-main.c:168
#: ../src/ld-window-main.c:181
msgid "_Zoom In"
msgstr "_Przybliżyć"
#: ../src/ld-window-main.c:983
#: ../src/ld-window-main.c:1163
msgid "translator-credits"
msgstr "Robert Svoboda <ravath@gmail.com>"

148
po/sk.po
View File

@@ -7,17 +7,17 @@ msgid ""
msgstr ""
"Project-Id-Version: logdiag\n"
"Report-Msgid-Bugs-To: https://git.janouch.name/p/logdiag/issues\n"
"POT-Creation-Date: 2021-10-22 22:16+0200\n"
"PO-Revision-Date: 2018-06-25 04:05+0200\n"
"POT-Creation-Date: 2021-10-28 20:07+0200\n"
"PO-Revision-Date: 2021-10-28 20:23+0200\n"
"Last-Translator: Přemysl Eric Janouch <p@janouch.name>\n"
"Language-Team: Slovak <sk@li.org>\n"
"Language: sk\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.8\n"
"X-Generator: Poedit 3.0\n"
#: ../src/ld-window-main.c:937
#: ../src/ld-window-main.c:968
#, c-format
msgid "%d%%"
msgstr "%d %%"
@@ -26,19 +26,19 @@ msgstr "%d %%"
msgid "- Schematic editor"
msgstr "- Editor schém"
#: ../src/ld-window-main.c:861
#: ../src/ld-window-main.c:892
msgid "Close _without Saving"
msgstr "Zatvoriť _bez uloženia"
#: ../src/ld-window-main.c:128
#: ../src/ld-window-main.c:141
msgid "Create a new diagram"
msgstr "Vytvorí nový diagram"
#: ../src/ld-window-main.c:161
#: ../src/ld-window-main.c:174
msgid "Delete the contents of the selection"
msgstr "Odstráni obsah výberu"
#: ../src/ld-window-main.c:354
#: ../src/ld-window-main.c:370
msgid "Drag symbols from the library pane to add them to the diagram."
msgstr "Pre pridanie symbolov do diagramu ich pretiahnite z panela knižnice."
@@ -46,135 +46,147 @@ msgstr "Pre pridanie symbolov do diagramu ich pretiahnite z panela knižnice."
msgid "Empty"
msgstr "Prázdne"
#: ../src/ld-window-main.c:707
#: ../src/ld-window-main.c:1042
msgid "Error"
msgstr "Chyba"
#: ../src/ld-window-main.c:738
#, c-format
msgid "Failed to open file `%s': Invalid contents."
msgstr "Nepodarilo sa otvoriť súbor \"%s\": Neplatný obsah."
#: ../src/ld-window-main.c:698
#: ../src/ld-window-main.c:729
msgid "Failed to open the file"
msgstr "Nepodarilo sa otvoriť súbor"
#: ../src/ld-window-main.c:662
#: ../src/ld-window-main.c:1149
msgid "Failed to open the user guide"
msgstr "Nepodarilo sa otvoriť príručku používateľa"
#: ../src/ld-window-main.c:693
msgid "Failed to save the diagram"
msgstr "Nepodarilo sa uložiť diagram"
#: ../src/ld-window-main.c:859
#: ../src/ld-window-main.c:890
msgid "If you don't save, changes will be permanently lost."
msgstr "Ak ich neuložíte, budú zmeny navždy stratené."
#: ../src/ld-window-main.c:738
#: ../src/ld-window-main.c:769
msgid "Logdiag Diagrams (*.ldd)"
msgstr "Diagramy logdiag (*.ldd)"
#: ../src/ld-window-main.c:131
#: ../src/ld-window-main.c:144
msgid "Open a diagram"
msgstr "Otvorí diagram"
#: ../src/ld-window-main.c:759
#: ../src/ld-window-main.c:193
msgid "Open the manual"
msgstr "Otvorí manuál"
#: ../src/ld-window-main.c:790
msgid "Open..."
msgstr "Otvoriť..."
#: ../src/ld-window-main.c:145
#: ../src/ld-window-main.c:154
msgid "Print the diagram"
msgstr "Vytlačí diagram"
#: ../src/ld-window-main.c:158
msgid "Quit the application"
msgstr "Ukončí aplikáciu"
#: ../src/ld-window-main.c:153
#: ../src/ld-window-main.c:166
msgid "Redo the last undone action"
msgstr "Vykoná naposledy vrátenú akciu"
#: ../src/ld-window-main.c:175
#: ../src/ld-window-main.c:188
msgid "Reset zoom level back to the default"
msgstr "Vráti priblíženie na východiskovú hodnotu"
#: ../src/ld-window-main.c:792
#: ../src/ld-window-main.c:823
msgid "Save As..."
msgstr "Uložiť ako..."
#: ../src/ld-window-main.c:136
#: ../src/ld-window-main.c:149
msgid "Save _As..."
msgstr "Uložiť _ako..."
#: ../src/ld-window-main.c:623
#: ../src/ld-window-main.c:654
#, c-format
msgid ""
"Save the changes to diagram \"%s\" before closing it and creating a new one?"
msgstr ""
"Uložiť zmeny v diagrame \"%s\" pred jeho zatvorením a vytvorením nového?"
msgid "Save the changes to diagram \"%s\" before closing it and creating a new one?"
msgstr "Uložiť zmeny v diagrame \"%s\" pred jeho zatvorením a vytvorením nového?"
#: ../src/ld-window-main.c:755
#: ../src/ld-window-main.c:786
#, c-format
msgid ""
"Save the changes to diagram \"%s\" before closing it and opening another one?"
msgid "Save the changes to diagram \"%s\" before closing it and opening another one?"
msgstr "Uložiť zmeny v diagrame \"%s\" pred jeho zatvorením a otvorením iného?"
#: ../src/ld-window-main.c:899
#: ../src/ld-window-main.c:930
#, c-format
msgid "Save the changes to diagram \"%s\" before closing?"
msgstr "Uložiť zmeny v diagrame \"%s\" pred jeho zatvorením?"
#: ../src/ld-window-main.c:134
#: ../src/ld-window-main.c:147
msgid "Save the current diagram"
msgstr "Uloží aktuálny diagram"
#: ../src/ld-window-main.c:137
#: ../src/ld-window-main.c:150
msgid "Save the current diagram with another name"
msgstr "Uloží aktuálny diagram pod iným menom"
#: ../src/ld-window-main.c:163
#: ../src/ld-window-main.c:176
msgid "Select _All"
msgstr "Vybrať _všetko"
#: ../src/ld-window-main.c:164
#: ../src/ld-window-main.c:177
msgid "Select all objects in the diagram"
msgstr "Vyberie všetky objekty v diagrame"
#: ../src/ld-window-main.c:192
#: ../src/ld-window-main.c:208
msgid "Show _Grid"
msgstr "Zobraziť _mriežku"
#: ../src/ld-window-main.c:180
#: ../src/ld-window-main.c:196
msgid "Show a dialog about this application"
msgstr "Zobrazí dialóg o tejto aplikácii"
#: ../src/ld-window-main.c:193
#: ../src/ld-window-main.c:209
msgid "Toggle displaying of the grid"
msgstr "Prepne zobrazovanie mriežky"
#: ../src/ld-window-main.c:190
#: ../src/ld-window-main.c:206
msgid "Toggle displaying of the library pane"
msgstr "Prepne zobrazovanie panelu knižnice"
#: ../src/ld-window-main.c:187
#: ../src/ld-window-main.c:203
msgid "Toggle displaying of the main toolbar"
msgstr "Prepne zobrazovanie hlavného panelu nástrojov"
#: ../src/ld-window-main.c:665
#: ../src/ld-window-main.c:696
msgid "Try again or save it under another name."
msgstr "Skúste to znova alebo ho uložte pod iným názvom."
#: ../src/ld-window-main.c:150
#: ../src/ld-window-main.c:163
msgid "Undo the last action"
msgstr "Vráti poslednú akciu"
#: ../src/ld-window-main.c:591
#: ../src/ld-window-main.c:622
msgid "Unsaved Diagram"
msgstr "Neuložený diagram"
#: ../src/ld-window-main.c:806
#, fuzzy
#: ../src/ld-window-main.c:837
msgid "Untitled diagram"
msgstr "Neuložený diagram"
msgstr "Nepomenovaný diagram"
#: ../src/ld-window-main.c:171
#: ../src/ld-window-main.c:184
msgid "Zoom _Out"
msgstr "_Oddialiť"
#: ../src/ld-window-main.c:169
#: ../src/ld-window-main.c:182
msgid "Zoom into the diagram"
msgstr "Priblíži diagram"
#: ../src/ld-window-main.c:172
#: ../src/ld-window-main.c:185
msgid "Zoom out of the diagram"
msgstr "Oddiali diagram"
@@ -182,71 +194,79 @@ msgstr "Oddiali diagram"
msgid "[FILE...]"
msgstr "[SÚBOR...]"
#: ../src/ld-window-main.c:179
#: ../src/ld-window-main.c:195
msgid "_About"
msgstr "_O programe"
#: ../src/ld-window-main.c:160
#: ../src/ld-window-main.c:173
msgid "_Delete"
msgstr "_Zmazať"
#: ../src/ld-window-main.c:148
#: ../src/ld-window-main.c:161
msgid "_Edit"
msgstr "_Úpravy"
#: ../src/ld-window-main.c:126
#: ../src/ld-window-main.c:139
msgid "_File"
msgstr "_Súbor"
#: ../src/ld-window-main.c:178
#: ../src/ld-window-main.c:191
msgid "_Help"
msgstr "_Nápoveda"
#: ../src/ld-window-main.c:189
#: ../src/ld-window-main.c:205
msgid "_Library Pane"
msgstr "Panel _knižnice"
#: ../src/ld-window-main.c:186
#: ../src/ld-window-main.c:202
msgid "_Main Toolbar"
msgstr "_Hlavný panel nástrojov"
#: ../src/ld-window-main.c:127
#: ../src/ld-window-main.c:140
msgid "_New"
msgstr "_Nový"
#: ../src/ld-window-main.c:174
#: ../src/ld-window-main.c:187
msgid "_Normal Size"
msgstr "_Normálna veľkosť"
#: ../src/ld-window-main.c:130
#: ../src/ld-window-main.c:143
msgid "_Open..."
msgstr "_Otvoriť..."
#: ../src/ld-window-main.c:144
#: ../src/ld-window-main.c:153
msgid "_Print..."
msgstr "_Tlačiť..."
#: ../src/ld-window-main.c:157
msgid "_Quit"
msgstr "U_končiť"
#: ../src/ld-window-main.c:152
#: ../src/ld-window-main.c:165
msgid "_Redo"
msgstr "Z_novu"
#: ../src/ld-window-main.c:133
#: ../src/ld-window-main.c:146
msgid "_Save"
msgstr "_Uložiť"
#: ../src/ld-window-main.c:149
#: ../src/ld-window-main.c:162
msgid "_Undo"
msgstr "_Späť"
#: ../src/ld-window-main.c:167
#: ../src/ld-window-main.c:192
msgid "_User Guide"
msgstr "_Príručka používateľa"
#: ../src/ld-window-main.c:180
msgid "_View"
msgstr "_Zobrazenie"
#: ../src/ld-window-main.c:168
#: ../src/ld-window-main.c:181
msgid "_Zoom In"
msgstr "_Priblížiť"
#: ../src/ld-window-main.c:983
#: ../src/ld-window-main.c:1163
msgid "translator-credits"
msgstr "Miroslav Rigler <itsgoingd@luzer.sk>"

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

@@ -1,5 +1,5 @@
<schemalist>
<schema id="org.logdiag" path="/org/logdiag/" gettext-domain="logdiag">
<schema id="name.janouch.logdiag" path="/name/janouch/logdiag/" gettext-domain="logdiag">
<key name="show-main-toolbar" type="b">
<default>true</default>
<summary>Whether to show the main toolbar</summary>
@@ -14,4 +14,3 @@
</key>
</schema>
</schemalist>

11
share/logdiag.manifest Normal file
View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity name="logdiag" version="1.0.0.0" type="win32" />
<dependency>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Windows.Common-Controls"
version="6.0.0.0" type="win32" processorArchitecture="*"
publicKeyToken="6595b64144ccf1df" language="*" />
</dependentAssembly>
</dependency>
</assembly>

View File

@@ -1 +1,3 @@
#include <windows.h>
LD_ICON ICON "logdiag.ico"
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "logdiag.manifest"

View File

@@ -1,18 +1,16 @@
<ui>
<menubar name="MenuBar">
<menu name="FileMenu" action="FileMenu">
<menu action="FileMenu">
<menuitem action="New" />
<menuitem action="Open" />
<menuitem action="Save" />
<menuitem action="SaveAs" />
<separator />
<!--
<menuitem action="Export" />
<menuitem action="Print" />
<separator />
-->
<menuitem action="Quit" />
</menu>
<menu name="EditMenu" action="EditMenu">
<menu action="EditMenu">
<menuitem action="Undo" />
<menuitem action="Redo" />
<separator />
@@ -25,7 +23,7 @@
<separator />
<menuitem action="SelectAll" />
</menu>
<menu name="ViewMenu" action="ViewMenu">
<menu action="ViewMenu">
<menuitem action="MainToolbar" />
<menuitem action="LibraryPane" />
<separator />
@@ -35,7 +33,7 @@
<menuitem action="ZoomOut" />
<menuitem action="NormalSize" />
</menu>
<menu name="HelpMenu" action="HelpMenu">
<menu action="HelpMenu">
<menuitem action="UserGuide" />
<menuitem action="About" />
</menu>

View File

@@ -56,6 +56,8 @@ struct _LdWindowMainPrivate
static void ld_window_main_finalize (GObject *gobject);
static void load_library_directories (LdLibrary *library);
static void display_and_free_error (LdWindowMain *self, const gchar *title,
GError *error);
static void on_ui_proxy_connected (GtkUIManager *ui, GtkAction *action,
GtkWidget *proxy, LdWindowMain *window);
@@ -104,9 +106,14 @@ static void on_action_new (GtkAction *action, LdWindowMain *self);
static void on_action_open (GtkAction *action, LdWindowMain *self);
static void on_action_save (GtkAction *action, LdWindowMain *self);
static void on_action_save_as (GtkAction *action, LdWindowMain *self);
static void on_action_print (GtkAction *action, LdWindowMain *self);
static void on_action_print_draw_page (GtkPrintOperation *operation,
GtkPrintContext *context, int page_nr, LdWindowMain *self);
static void on_action_quit (GtkAction *action, LdWindowMain *self);
static void on_action_user_guide (GtkAction *action, LdWindowMain *self);
static void on_action_about (GtkAction *action, LdWindowMain *self);
static gboolean on_action_about_activate_link (GtkAboutDialog *dialog,
gchar *uri, LdWindowMain *self);
static void on_action_undo (GtkAction *action, LdWindowMain *self);
static void on_action_redo (GtkAction *action, LdWindowMain *self);
@@ -142,11 +149,11 @@ static GtkActionEntry wm_action_entries[] =
{"SaveAs", GTK_STOCK_SAVE_AS, N_("Save _As..."), "<Shift><Ctrl>S",
N_("Save the current diagram with another name"),
G_CALLBACK (on_action_save_as)},
/*
* {"Export", NULL, N_("_Export"), NULL,
* N_("Export the diagram"),
* NULL},
*/
{"Print", GTK_STOCK_PRINT, N_("_Print..."), "<Ctrl>P",
N_("Print the diagram"),
G_CALLBACK (on_action_print)},
{"Quit", GTK_STOCK_QUIT, N_("_Quit"), "<Ctrl>Q",
N_("Quit the application"),
G_CALLBACK (on_action_quit)},
@@ -267,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);
@@ -382,7 +389,7 @@ ld_window_main_init (LdWindowMain *self)
gtk_widget_show_all (GTK_WIDGET (self));
/* Set up GSettings. */
priv->settings = g_settings_new ("org." PROJECT_NAME);
priv->settings = g_settings_new (PROJECT_ID);
g_settings_bind (priv->settings, "show-main-toolbar",
gtk_action_group_get_action (priv->action_group,
@@ -444,6 +451,21 @@ load_library_directories (LdLibrary *library)
g_free (user_dir);
}
static void
display_and_free_error (LdWindowMain *self, const gchar *title, GError *error)
{
GtkWidget *message_dialog;
message_dialog = gtk_message_dialog_new (GTK_WINDOW (self),
GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", title);
gtk_message_dialog_format_secondary_text
(GTK_MESSAGE_DIALOG (message_dialog), "%s", error->message);
g_error_free (error);
gtk_dialog_run (GTK_DIALOG (message_dialog));
gtk_widget_destroy (message_dialog);
}
/*
* on_delete:
*
@@ -596,7 +618,7 @@ diagram_get_name (LdWindowMain *self)
if (self->priv->filename)
return g_filename_display_basename (self->priv->filename);
else
return g_strdup (_("Unsaved Diagram"));
}
@@ -676,12 +698,10 @@ diagram_save (LdWindowMain *self, GtkWindow *dialog_parent,
gtk_widget_destroy (message_dialog);
return FALSE;
}
else
{
ld_diagram_set_modified (self->priv->diagram, FALSE);
update_title (self);
return TRUE;
}
}
/*
@@ -692,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)
{
@@ -728,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;
}
@@ -975,6 +1005,89 @@ on_action_save_as (GtkAction *action, LdWindowMain *self)
diagram_show_save_as_dialog (self);
}
static void
on_action_print (GtkAction *action, LdWindowMain *self)
{
static GtkPrintSettings *settings = NULL;
GError *error = NULL;
GtkPrintOperation *print;
GtkPrintOperationResult res;
gchar *name;
print = gtk_print_operation_new ();
gtk_print_operation_set_n_pages (print, 1);
gtk_print_operation_set_embed_page_setup (print, TRUE);
gtk_print_operation_set_unit (print, GTK_UNIT_MM);
name = diagram_get_name (self);
gtk_print_operation_set_job_name (print, name);
g_free (name);
if (settings != NULL)
gtk_print_operation_set_print_settings (print, settings);
g_signal_connect (print, "draw-page",
G_CALLBACK (on_action_print_draw_page), self);
/* On Windows, it is not possible to get a print preview from the system
* print dialog. But in Windows XP previews do not work at all--unreadable
* EMFs come out. Windows 10 errors out with "A sharing violation occurred
* while accessing" the temporary EMF file on our first run of
* GtkPrintOperation, and following that it opens the previews up in
* fucking Paint, so there is no point in trying. It lacks a stage
* or controls for setting up page parameters anyway.
*/
res = gtk_print_operation_run (print,
GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
GTK_WINDOW (self), &error);
if (res == GTK_PRINT_OPERATION_RESULT_APPLY)
{
if (settings != NULL)
g_object_unref (settings);
settings
= g_object_ref (gtk_print_operation_get_print_settings (print));
}
if (error)
display_and_free_error (self, _("Error"), error);
g_object_unref (print);
}
static void
on_action_print_draw_page (GtkPrintOperation *operation,
GtkPrintContext *context, int page_nr, LdWindowMain *self)
{
cairo_t *cr;
LdDiagramView *view;
gdouble area_width_mm, area_height_mm;
gdouble diagram_width_mm, diagram_height_mm;
gdouble diagram_to_export_units, scale, width_fit, height_fit;
LdRectangle bounds;
cr = gtk_print_context_get_cairo_context (context);
view = self->priv->view;
area_width_mm = gtk_print_context_get_width (context);
area_height_mm = gtk_print_context_get_height (context);
diagram_to_export_units = ld_diagram_view_get_export_bounds (view, &bounds);
/* Scale for the view's constant, measured in milimetres. */
scale = 1 / diagram_to_export_units * LD_DIAGRAM_VIEW_BASE_UNIT_LENGTH;
diagram_width_mm = bounds.width * scale;
diagram_height_mm = bounds.height * scale;
/* Scale to fit the paper, taking care to not divide by zero. */
width_fit = (area_width_mm < diagram_width_mm)
? area_width_mm / diagram_width_mm : 1;
height_fit = (area_height_mm < diagram_height_mm)
? area_height_mm / diagram_height_mm : 1;
scale *= MIN (width_fit, height_fit);
cairo_scale (cr, scale, scale);
cairo_translate (cr, -bounds.x, -bounds.y);
ld_diagram_view_export (view, cr, &bounds);
}
static void
on_action_quit (GtkAction *action, LdWindowMain *self)
{
@@ -1040,30 +1153,51 @@ on_action_user_guide (GtkAction *action, LdWindowMain *self)
if (!open_file (file, gtk_window_get_screen (GTK_WINDOW (self)), &error))
{
GtkWidget *message_dialog;
message_dialog = gtk_message_dialog_new (GTK_WINDOW (self),
GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
_("Failed to open the user guide"));
gtk_message_dialog_format_secondary_text
(GTK_MESSAGE_DIALOG (message_dialog), "%s", error->message);
g_error_free (error);
gtk_dialog_run (GTK_DIALOG (message_dialog));
gtk_widget_destroy (message_dialog);
display_and_free_error (self,
_("Failed to open the user guide"), error);
}
g_object_unref (file);
}
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,
"logo-icon-name", PROJECT_NAME,
"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);
gtk_window_set_transient_for (GTK_WINDOW (about_dialog), GTK_WINDOW (self));
gtk_window_set_modal (GTK_WINDOW (about_dialog), TRUE);
gtk_window_set_destroy_with_parent (GTK_WINDOW (about_dialog), TRUE);
gtk_dialog_run (GTK_DIALOG (about_dialog));
gtk_widget_destroy (about_dialog);
}
static gboolean
on_action_about_activate_link (GtkAboutDialog *dialog, gchar *uri,
LdWindowMain *self)
{
#ifdef G_OS_WIN32
GdkWindow *window;
window = gtk_widget_get_window (GTK_WIDGET (self));
#ifdef G_OS_WIN32
/* gtk_show_uri() on Windows XP fails, due to trying to establish
* an SSL connection, so let's first try to not do that on Windows.
* `cmd.exe /c start "" ...` would pop up a command line window,
@@ -1080,30 +1214,6 @@ on_action_about_activate_link (GtkAboutDialog *dialog, gchar *uri,
return FALSE;
}
static void
on_action_about (GtkAction *action, LdWindowMain *self)
{
GtkWidget *about_dialog;
about_dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG,
"program-name", PROJECT_NAME,
"logo-icon-name", PROJECT_NAME,
"version", PROJECT_VERSION,
"translator-credits", _("translator-credits"),
"copyright", "Copyright 2010 - 2021 Přemysl Eric Janouch",
"website", PROJECT_URL,
NULL);
g_signal_connect (about_dialog, "activate-link",
G_CALLBACK (on_action_about_activate_link), self);
gtk_window_set_transient_for (GTK_WINDOW (about_dialog), GTK_WINDOW (self));
gtk_window_set_modal (GTK_WINDOW (about_dialog), TRUE);
gtk_window_set_destroy_with_parent (GTK_WINDOW (about_dialog), TRUE);
gtk_dialog_run (GTK_DIALOG (about_dialog));
gtk_widget_destroy (about_dialog);
}
static void
on_action_undo (GtkAction *action, LdWindowMain *self)
{

View File

@@ -127,16 +127,16 @@ main (int argc, char *argv[])
textdomain (GETTEXT_DOMAIN);
#ifdef PROJECT_GSETTINGS_DIR
/* This is enabled when the build is set up for developing, so that the
* application can find its schema. It might also find use when
* installing the application into a location that's missing from
/* This is enabled when the build is set up for development,
* so that the application can find its schema. It might also find use
* when installing the application into a location that's missing from
* g_get_system_data_dirs(), for example /usr/local or ~/.local.
*/
g_setenv ("GSETTINGS_SCHEMA_DIR", PROJECT_GSETTINGS_DIR, 0);
#endif /* PROJECT_GSETTINGS_DIR */
#ifdef _WIN32
/* Don't be unneccessarily limited by the system ANSI codepage. */
/* Don't be unneccessarily limited by the system's ANSI codepage. */
/* g_win32_get_command_line() should replace this code for GLib >= 2.40. */
argv_overriden = get_utf8_args (&argc, &argv);
if (argv_overriden)

1
vera++

Submodule vera++ deleted from 45f3ab870d