aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt3
-rw-r--r--cmake/LibraryRegistry.cmake77
-rw-r--r--cmake/ModuleRegistry.cmake61
-rw-r--r--src/CMakeLists.txt163
-rw-r--r--src/GpgFrontendContext.h4
-rw-r--r--src/core/CMakeLists.txt47
-rw-r--r--src/core/GpgCoreInit.h11
-rw-r--r--src/core/GpgFrontendCore.h6
-rw-r--r--src/core/function/ArchiveFileOperator.h2
-rw-r--r--src/core/function/CacheManager.h6
-rw-r--r--src/core/function/CoreSignalStation.h4
-rw-r--r--src/core/function/DataObjectOperator.h2
-rw-r--r--src/core/function/GlobalSettingStation.h4
-rw-r--r--src/core/function/KeyPackageOperator.h6
-rw-r--r--src/core/function/PassphraseGenerator.h2
-rw-r--r--src/core/function/SecureMemoryAllocator.h4
-rw-r--r--src/core/function/basic/ChannelObject.h2
-rw-r--r--src/core/function/basic/GpgFunctionObject.h11
-rw-r--r--src/core/function/basic/SingletonStorage.h6
-rw-r--r--src/core/function/basic/SingletonStorageCollection.h2
-rw-r--r--src/core/function/gpg/GpgAbstractKeyGetter.h2
-rw-r--r--src/core/function/gpg/GpgAdvancedOperator.h2
-rw-r--r--src/core/function/gpg/GpgAssuanHelper.h2
-rw-r--r--src/core/function/gpg/GpgAutomatonHandler.h6
-rw-r--r--src/core/function/gpg/GpgBasicOperator.h18
-rw-r--r--src/core/function/gpg/GpgCommandExecutor.h4
-rw-r--r--src/core/function/gpg/GpgComponentManager.h2
-rw-r--r--src/core/function/gpg/GpgContext.h3
-rw-r--r--src/core/function/gpg/GpgFileOpera.h9
-rw-r--r--src/core/function/gpg/GpgKeyGetter.h6
-rw-r--r--src/core/function/gpg/GpgKeyGroupGetter.h2
-rw-r--r--src/core/function/gpg/GpgKeyImportExporter.h9
-rw-r--r--src/core/function/gpg/GpgKeyManager.h10
-rw-r--r--src/core/function/gpg/GpgKeyOpera.h7
-rw-r--r--src/core/function/gpg/GpgSmartCardManager.h10
-rw-r--r--src/core/function/gpg/GpgUIDOperator.h2
-rw-r--r--src/core/function/result_analyse/GpgDecryptResultAnalyse.h3
-rw-r--r--src/core/function/result_analyse/GpgEncryptResultAnalyse.h3
-rw-r--r--src/core/function/result_analyse/GpgResultAnalyse.h6
-rw-r--r--src/core/function/result_analyse/GpgSignResultAnalyse.h2
-rw-r--r--src/core/function/result_analyse/GpgVerifyResultAnalyse.h2
-rw-r--r--src/core/model/CacheObject.h4
-rw-r--r--src/core/model/CommonStruct.h5
-rw-r--r--src/core/model/DataObject.h3
-rw-r--r--src/core/model/GFBuffer.h3
-rw-r--r--src/core/model/GpgData.h3
-rw-r--r--src/core/model/GpgDecryptResult.h2
-rw-r--r--src/core/model/GpgEncryptResult.h2
-rw-r--r--src/core/model/GpgGenerateKeyResult.h3
-rw-r--r--src/core/model/GpgImportInformation.h4
-rw-r--r--src/core/model/GpgKey.h2
-rw-r--r--src/core/model/GpgKeyGenerateInfo.h5
-rw-r--r--src/core/model/GpgKeyGroup.h2
-rw-r--r--src/core/model/GpgKeySignature.h2
-rw-r--r--src/core/model/GpgKeyTableModel.h44
-rw-r--r--src/core/model/GpgKeyTreeModel.h40
-rw-r--r--src/core/model/GpgOpenPGPCard.h2
-rw-r--r--src/core/model/GpgPassphraseContext.h4
-rw-r--r--src/core/model/GpgRecipient.h3
-rw-r--r--src/core/model/GpgSignResult.h3
-rw-r--r--src/core/model/GpgSignature.h2
-rw-r--r--src/core/model/GpgSubKey.h3
-rw-r--r--src/core/model/GpgTOFUInfo.h4
-rw-r--r--src/core/model/GpgUID.h2
-rw-r--r--src/core/model/GpgVerifyResult.h3
-rw-r--r--src/core/model/SettingsObject.h4
-rw-r--r--src/core/module/Event.cpp1
-rw-r--r--src/core/module/Event.h5
-rw-r--r--src/core/module/GlobalModuleContext.h2
-rw-r--r--src/core/module/GlobalRegisterTableTreeModel.h7
-rw-r--r--src/core/module/Module.cpp2
-rw-r--r--src/core/module/Module.h2
-rw-r--r--src/core/module/ModuleInit.h6
-rw-r--r--src/core/module/ModuleManager.cpp18
-rw-r--r--src/core/module/ModuleManager.h27
-rw-r--r--src/core/thread/FileReadTask.h2
-rw-r--r--src/core/thread/Task.h2
-rw-r--r--src/core/thread/TaskRunner.h6
-rw-r--r--src/core/thread/TaskRunnerGetter.h2
-rw-r--r--src/core/utils/AsyncUtils.h32
-rw-r--r--src/core/utils/BuildInfoUtils.cpp2
-rw-r--r--src/core/utils/BuildInfoUtils.h28
-rw-r--r--src/core/utils/CacheUtils.h8
-rw-r--r--src/core/utils/CommonUtils.cpp9
-rw-r--r--src/core/utils/CommonUtils.h25
-rw-r--r--src/core/utils/FilesystemUtils.h18
-rw-r--r--src/core/utils/GpgUtils.cpp39
-rw-r--r--src/core/utils/GpgUtils.h71
-rw-r--r--src/core/utils/IOUtils.h35
-rw-r--r--src/core/utils/LocalizedUtils.h6
-rw-r--r--src/core/utils/MemoryUtils.h7
-rw-r--r--src/core/utils/aes/aes_ssl.h2
-rw-r--r--src/sdk/CMakeLists.txt28
-rw-r--r--src/sdk/GFSDK.h12
-rw-r--r--src/sdk/GFSDKBasic.cpp14
-rw-r--r--src/sdk/GFSDKBasic.h63
-rw-r--r--src/sdk/GFSDKBasicModel.h51
-rw-r--r--src/sdk/GFSDKExtra.h8
-rw-r--r--src/sdk/GFSDKGpg.cpp29
-rw-r--r--src/sdk/GFSDKGpg.h32
-rw-r--r--src/sdk/GFSDKLog.h12
-rw-r--r--src/sdk/GFSDKModule.h76
-rw-r--r--src/sdk/GFSDKModuleModel.h70
-rw-r--r--src/sdk/GFSDKUI.cpp14
-rw-r--r--src/sdk/GFSDKUI.h26
-rw-r--r--src/sdk/GFSDKUIModel.h (renamed from src/signal.cpp)12
-rw-r--r--src/test/CMakeLists.txt25
-rw-r--r--src/test/GpgFrontendTest.h8
-rw-r--r--src/ui/CMakeLists.txt40
-rw-r--r--src/ui/GpgFrontendApplication.h2
-rw-r--r--src/ui/GpgFrontendUI.h6
-rw-r--r--src/ui/GpgFrontendUIInit.cpp2
-rw-r--r--src/ui/GpgFrontendUIInit.h12
-rw-r--r--src/ui/UIModuleManager.h12
114 files changed, 846 insertions, 759 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 67767e89..14e6a507 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -361,6 +361,8 @@ endif()
# binary and libraries output path
if(XCODE_BUILD)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE})
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE})
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE})
elseif(MINGW)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/artifacts/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/artifacts/bin)
@@ -394,6 +396,7 @@ else()
endif()
if(BUILD_MODULES)
+ include(${CMAKE_SOURCE_DIR}/cmake/ModuleRegistry.cmake)
add_subdirectory(modules)
endif()
diff --git a/cmake/LibraryRegistry.cmake b/cmake/LibraryRegistry.cmake
new file mode 100644
index 00000000..fc7522c2
--- /dev/null
+++ b/cmake/LibraryRegistry.cmake
@@ -0,0 +1,77 @@
+# Copyright (C) 2021-2024 Saturneric <[email protected]>
+#
+# This file is part of GpgFrontend.
+#
+# GpgFrontend is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# GpgFrontend is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GpgFrontend. If not, see <https://www.gnu.org/licenses/>.
+#
+# The initial version of the source code is inherited from
+# the gpg4usb project, which is under GPL-3.0-or-later.
+#
+# All the source code of GpgFrontend was modified and released by
+# Saturneric <[email protected]> starting on May 12, 2021.
+#
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+function(register_library name out_var)
+ if(NOT ARGN)
+ message(FATAL_ERROR "register_library(${name} ...) requires at least one source file")
+ endif()
+
+ set(target_name "gf_${name}")
+
+ add_library(${target_name} SHARED ${ARGN})
+
+ set_target_properties(${target_name} PROPERTIES
+ POSITION_INDEPENDENT_CODE ON
+ CXX_VISIBILITY_PRESET hidden
+ VISIBILITY_INLINES_HIDDEN 1)
+
+ # generate private macro
+ string(TOUPPER ${name} upper_name)
+ set(private_define "GF_${upper_name}_PRIVATE")
+ target_compile_definitions(${target_name} PRIVATE ${private_define})
+
+ # auto generate export header
+ include(GenerateExportHeader)
+ string(SUBSTRING ${name} 0 1 first_char)
+ string(SUBSTRING ${name} 1 -1 rest_chars)
+ string(TOUPPER ${first_char} first_char_upper)
+ set(capitalized_name "${first_char_upper}${rest_chars}")
+ set(export_file "${CMAKE_CURRENT_BINARY_DIR}/GF${capitalized_name}Export.h")
+ generate_export_header(${target_name} EXPORT_FILE_NAME "${export_file}")
+
+ target_precompile_headers(${target_name}
+ PUBLIC ${CMAKE_SOURCE_DIR}/src/GpgFrontend.h
+ PUBLIC ${export_file})
+
+ target_include_directories(${target_name} PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
+ )
+
+ target_compile_features(${target_name} PRIVATE cxx_std_17)
+
+ # skip install
+ if(XCODE_BUILD)
+ set_target_properties(${target_name} PROPERTIES
+ XCODE_ATTRIBUTE_SKIP_INSTALL "Yes"
+ XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${GPGFRONTEND_XCODE_CODE_SIGN_IDENTITY}")
+ endif()
+
+ set(current "${GPGFRONTEND_LIBRARY_TARGETS}")
+ list(APPEND current "${target_name}")
+ list(REMOVE_DUPLICATES current)
+ set(GPGFRONTEND_LIBRARY_TARGETS "${current}" CACHE INTERNAL "All libraries" FORCE)
+
+ set(${out_var} "${target_name}" PARENT_SCOPE)
+endfunction() \ No newline at end of file
diff --git a/cmake/ModuleRegistry.cmake b/cmake/ModuleRegistry.cmake
new file mode 100644
index 00000000..c07e9a02
--- /dev/null
+++ b/cmake/ModuleRegistry.cmake
@@ -0,0 +1,61 @@
+# Copyright (C) 2021-2024 Saturneric <[email protected]>
+#
+# This file is part of GpgFrontend.
+#
+# GpgFrontend is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# GpgFrontend is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GpgFrontend. If not, see <https://www.gnu.org/licenses/>.
+#
+# The initial version of the source code is inherited from
+# the gpg4usb project, which is under GPL-3.0-or-later.
+#
+# All the source code of GpgFrontend was modified and released by
+# Saturneric <[email protected]> starting on May 12, 2021.
+#
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+function(register_module name out_var)
+ if(NOT ARGN)
+ message(FATAL_ERROR "register_module(${name} ...) requires at least one source file")
+ endif()
+
+ set(target_name "gf_mod_${name}")
+
+ add_library(${target_name} SHARED ${ARGN})
+
+ set_target_properties(${target_name} PROPERTIES POSITION_INDEPENDENT_CODE ON)
+
+ target_compile_features(${target_name} PRIVATE cxx_std_17)
+
+ target_link_libraries(${target_name} PRIVATE gf_sdk)
+
+ # skip install
+ if(XCODE_BUILD)
+ set_target_properties(${target_name} PROPERTIES
+ XCODE_ATTRIBUTE_SKIP_INSTALL "Yes"
+ XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${GPGFRONTEND_XCODE_CODE_SIGN_IDENTITY}")
+ endif()
+
+ # install paths
+ install(TARGETS ${target_name}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+ )
+
+ set(current "${GPGFRONTEND_MODULE_TARGETS}")
+ list(APPEND current "${target_name}")
+ list(REMOVE_DUPLICATES current)
+ set(GPGFRONTEND_MODULE_TARGETS "${current}" CACHE INTERNAL "All modules" FORCE)
+
+ set(${out_var} "${target_name}" PARENT_SCOPE)
+endfunction() \ No newline at end of file
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4d3e89ee..5eb01927 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -55,6 +55,8 @@ endif()
find_package(OpenSSL REQUIRED)
+# add libraries
+include(${CMAKE_SOURCE_DIR}/cmake/LibraryRegistry.cmake)
add_subdirectory(core)
add_subdirectory(ui)
add_subdirectory(sdk)
@@ -68,54 +70,67 @@ set(APP_ICON_RESOURCE_WINDOWS "${CMAKE_SOURCE_DIR}/gpgfrontend.rc")
set_property(SOURCE gpgfrontend.rc APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_SOURCE_DIR}/gpgfrontend.ico)
set(RESOURCE_FILES ${CMAKE_SOURCE_DIR}/gpgfrontend.qrc ${APP_ICON_RESOURCE_WINDOWS} ${QON_QM_FILES})
-# rpath
-set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
-set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
-
-if(${CMAKE_BUILD_TYPE} STREQUAL "Release")
- if(MINGW)
- add_executable(${APP_NAME} WIN32 ${APP_SOURCE} ${RESOURCE_FILES})
- elseif(APPLE AND XCODE_BUILD)
- # standard app bundle packing
- add_executable(${APP_NAME} MACOSX_BUNDLE ${GPGFRONTEND_MACOS_ICON} ${APP_SOURCE} ${RESOURCE_FILES})
+# Set Resource Output Path
+if(XCODE_BUILD)
+ set(RESOURCE_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Resources)
+else()
+ set(RESOURCE_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
+endif()
- set_target_properties(${APP_NAME} PROPERTIES
- BUNDLE True
- MACOSX_BUNDLE_GUI_IDENTIFIER com.bktus.gpgfrontend
- MACOSX_BUNDLE_BUNDLE_NAME ${APP_NAME}
- MACOSX_BUNDLE_LONG_VERSION_STRING ${BUILD_VERSION}
- MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION}
- MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
- MACOSX_BUNDLE_COPYRIGHT "GPL-3.0"
- MACOSX_BUNDLE_INFO_STRING "An OpenPGP Crypto Tool"
- MACOSX_BUNDLE_ICON_FILE "gpgfrontend.icns"
- MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/resource/plist/MacOSXBundleInfo.plist.in)
-
- # option for sandbox mode, still under test
- if(GPGFRONTEND_XCODE_ENABLE_SANDBOX)
- message(STATUS "Build Application With App Sandbox")
- set(CUSTOM_ATTRIBUTE_ENABLE_APP_SANDBOX "Yes")
- add_custom_command(TARGET ${APP_NAME} POST_BUILD
- COMMAND /bin/cp -rf ${CMAKE_SOURCE_DIR}/resource/lfs/macOS/GnuPG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${APP_NAME}.app/Contents/
- WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
- COMMENT "Copying Bundle GnuPG into App Bundle Resource")
- set_target_properties(${APP_NAME} PROPERTIES
- XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_SOURCE_DIR}/resource/entitlements/GpgFrontend.entitlements")
- else()
- message(STATUS "Build Application Without App Sandbox")
- set(CUSTOM_ATTRIBUTE_ENABLE_APP_SANDBOX "No")
- endif()
+# rpath
+if(XCODE_BUILD)
+ set(CMAKE_MACOSX_RPATH TRUE)
+ set(CMAKE_INSTALL_RPATH "@executable_path/../Frameworks")
+else()
+ set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
+ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+endif()
+if(MINGW)
+ add_executable(${APP_NAME} WIN32 ${APP_SOURCE} ${RESOURCE_FILES})
+elseif(XCODE_BUILD)
+ # macOS bundle icon
+ set(GPGFRONTEND_MACOS_ICON ${CMAKE_SOURCE_DIR}/gpgfrontend.icns)
+ set_source_files_properties(${GPGFRONTEND_MACOS_ICON} PROPERTIES
+ MACOSX_PACKAGE_LOCATION "Resources")
+
+ # standard app bundle packing
+ add_executable(${APP_NAME} MACOSX_BUNDLE ${GPGFRONTEND_MACOS_ICON} ${APP_SOURCE} ${RESOURCE_FILES})
+
+ set_target_properties(${APP_NAME} PROPERTIES
+ BUNDLE True
+ MACOSX_BUNDLE_GUI_IDENTIFIER com.bktus.gpgfrontend
+ MACOSX_BUNDLE_BUNDLE_NAME ${APP_NAME}
+ MACOSX_BUNDLE_LONG_VERSION_STRING ${BUILD_VERSION}
+ MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION}
+ MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
+ MACOSX_BUNDLE_COPYRIGHT "GPL-3.0"
+ MACOSX_BUNDLE_INFO_STRING "An OpenPGP Crypto Tool"
+ MACOSX_BUNDLE_ICON_FILE "gpgfrontend.icns"
+ MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/resource/plist/MacOSXBundleInfo.plist.in)
+
+ # option for sandbox mode, still under test
+ if(GPGFRONTEND_XCODE_ENABLE_SANDBOX)
+ message(STATUS "Build Application With App Sandbox")
+ set(CUSTOM_ATTRIBUTE_ENABLE_APP_SANDBOX "Yes")
+ add_custom_command(TARGET ${APP_NAME} POST_BUILD
+ COMMAND /bin/cp -rf ${CMAKE_SOURCE_DIR}/resource/lfs/macOS/GnuPG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${APP_NAME}.app/Contents/
+ WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+ COMMENT "Copying Bundle GnuPG into App Bundle Resource")
set_target_properties(${APP_NAME} PROPERTIES
- XCODE_ATTRIBUTE_INSTALL_PATH "$(LOCAL_APPS_DIR)"
- XCODE_ATTRIBUTE_SKIP_INSTALL "No"
- XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "--deep --entitlements ${CMAKE_SOURCE_DIR}/resource/plist/entitlement.plist"
- XCODE_ATTRIBUTE_ENABLE_APP_SANDBOX "${CUSTOM_ATTRIBUTE_ENABLE_APP_SANDBOX}"
- XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME "Yes"
- XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${GPGFRONTEND_XCODE_CODE_SIGN_IDENTITY}")
+ XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_SOURCE_DIR}/resource/entitlements/GpgFrontend.entitlements")
else()
- add_executable(${APP_NAME} ${APP_SOURCE} ${RESOURCE_FILES})
+ message(STATUS "Build Application Without App Sandbox")
+ set(CUSTOM_ATTRIBUTE_ENABLE_APP_SANDBOX "No")
endif()
+
+ set_target_properties(${APP_NAME} PROPERTIES
+ XCODE_ATTRIBUTE_INSTALL_PATH "$(LOCAL_APPS_DIR)"
+ XCODE_ATTRIBUTE_SKIP_INSTALL "No"
+ XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "--deep --entitlements ${CMAKE_SOURCE_DIR}/resource/plist/entitlement.plist"
+ XCODE_ATTRIBUTE_ENABLE_APP_SANDBOX "${CUSTOM_ATTRIBUTE_ENABLE_APP_SANDBOX}"
+ XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME "Yes"
+ XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${GPGFRONTEND_XCODE_CODE_SIGN_IDENTITY}")
else()
add_executable(${APP_NAME} ${APP_SOURCE} ${RESOURCE_FILES})
endif()
@@ -123,20 +138,6 @@ endif()
# using c++ standard 17
target_compile_features(${APP_NAME} PUBLIC cxx_std_17)
-# Set Resource Output Path
-if(${CMAKE_BUILD_TYPE} STREQUAL "Release")
- if(APPLE)
- set(RESOURCE_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Resources)
- set(GPGFRONTEND_MACOS_ICON ${CMAKE_SOURCE_DIR}/gpgfrontend.icns)
- set_source_files_properties(${GPGFRONTEND_MACOS_ICON} PROPERTIES
- MACOSX_PACKAGE_LOCATION "Resources")
- else()
- set(RESOURCE_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
- endif()
-else()
- set(RESOURCE_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
-endif()
-
if(MINGW)
message(STATUS "Copying Dependent DLL For Windows Runtime Env")
@@ -320,7 +321,7 @@ if(MINGW)
endif()
# link options for GpgFrontend
-target_link_libraries(${APP_NAME} gpgfrontend_core gpgfrontend_ui gpgfrontend_test)
+target_link_libraries(${APP_NAME} gf_core gf_ui gf_test)
if(MINGW)
message(STATUS "Link Application Library For MINGW")
@@ -410,17 +411,25 @@ configure_file(${CMAKE_SOURCE_DIR}/src/GpgFrontendBuildInstallInfo.h.in ${CMAKE_
#
# Install generated libraries and application
#
-set(GPGFRONTEND_INSTALL_LIBRARIES
- gpgfrontend_core
- gpgfrontend_ui
- gpgfrontend_test
- gpgfrontend_module_sdk)
-
-install(TARGETS ${APP_NAME} ${GPGFRONTEND_INSTALL_LIBRARIES}
- EXPORT GpgFrontendTargets
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+message(STATUS "Registered libraries: ${GPGFRONTEND_LIBRARY_TARGETS}")
+message(STATUS "Registered modules: ${GPGFRONTEND_MODULE_TARGETS}")
+
+if(XCODE_BUILD)
+ install(TARGETS ${APP_NAME}
+ EXPORT GpgFrontendTargets
+ BUNDLE DESTINATION /Applications
+ )
+ set_target_properties(${APP_NAME} PROPERTIES
+ XCODE_EMBED_FRAMEWORKS "${GPGFRONTEND_LIBRARY_TARGETS}"
+ XCODE_EMBED_PLUGINS "${GPGFRONTEND_MODULE_TARGETS}"
+ )
+else()
+ install(TARGETS ${APP_NAME} ${GPGFRONTEND_LIBRARY_TARGETS}
+ EXPORT GpgFrontendTargets
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+endif()
#
# Install resources and translation
@@ -479,7 +488,7 @@ if(BUILD_APP_FOR_PACKAGE)
set(CPACK_PACKAGE_HOMEPAGE_URL "https://gpgfrontend.bktus.com")
set(CPACK_PACKAGE_FILE_NAME "${APP_NAME_LOWER}-v${PROJECT_VERSION}")
- set(CPACK_GENERATOR "RPM;DEB")
+ set(CPACK_GENERATOR "RPM;DEB;Bundle")
#
# RPM Settings
@@ -514,6 +523,20 @@ if(BUILD_APP_FOR_PACKAGE)
set(CPACK_DEBIAN_PACKAGE_LICENSE "GPLv3")
#
+ # macOS Bundle Settings
+ #
+ set(CPACK_BUNDLE_NAME "${APP_NAME}")
+ set(CPACK_BUNDLE_PLIST "${CMAKE_SOURCE_DIR}/resource/plist/MacOSXBundleInfo.plist.in")
+ set(CPACK_BUNDLE_ICON "${CMAKE_SOURCE_DIR}/resource/lfs/icns/GpgFrontend.icns")
+
+ if(GPGFRONTEND_XCODE_ENABLE_SANDBOX)
+ message(STATUS "Build Application With App Sandbox")
+ set(CPACK_BUNDLE_APPLE_ENTITLEMENTS "${CMAKE_SOURCE_DIR}/resource/entitlements/GpgFrontend.entitlements")
+ endif()
+
+ set(CPACK_BUNDLE_APPLE_CERT_APP "${GPGFRONTEND_XCODE_CODE_SIGN_IDENTITY}")
+
+ #
# Install scripts
#
configure_file("${CMAKE_SOURCE_DIR}/cmake/rpm/post-install.sh"
diff --git a/src/GpgFrontendContext.h b/src/GpgFrontendContext.h
index af29af73..06a637bd 100644
--- a/src/GpgFrontendContext.h
+++ b/src/GpgFrontendContext.h
@@ -28,9 +28,7 @@
#pragma once
-#include <qapplication.h>
-
-#include <memory>
+#include <QApplication>
#include "core/GpgConstants.h"
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 1aeb33f3..5694b117 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -37,32 +37,22 @@ aux_source_directory(./utils/aes CORE_SOURCE)
aux_source_directory(./utils CORE_SOURCE)
aux_source_directory(. CORE_SOURCE)
-# define libgpgfrontend_core
-set(CMAKE_CXX_VISIBILITY_PRESET hidden)
-set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
-
-add_library(gpgfrontend_core SHARED ${CORE_SOURCE})
-
-# generate headers
-set(_export_file "${CMAKE_CURRENT_SOURCE_DIR}/GpgFrontendCoreExport.h")
-generate_export_header(gpgfrontend_core EXPORT_FILE_NAME "${_export_file}")
-
-# compile definitions
-target_compile_definitions(gpgfrontend_core PRIVATE GF_CORE_PRIVATE)
+# register core
+register_library(core LIBRARY_TARGET ${CORE_SOURCE})
# qt-aes
-target_sources(gpgfrontend_core PRIVATE
+target_sources(${LIBRARY_TARGET} PRIVATE
${CMAKE_SOURCE_DIR}/third_party/qt-aes/qaesencryption.cpp)
# link gnupg libraries
-target_link_libraries(gpgfrontend_core PUBLIC gpgme assuan gpg-error)
+target_link_libraries(${LIBRARY_TARGET} PUBLIC gpgme assuan gpg-error)
# link openssl
-target_link_libraries(gpgfrontend_core PUBLIC OpenSSL::SSL OpenSSL::Crypto)
+target_link_libraries(${LIBRARY_TARGET} PUBLIC OpenSSL::SSL OpenSSL::Crypto)
if(MINGW)
# for uuid ability in mingw
- target_link_libraries(gpgfrontend_core PUBLIC bcrypt)
+ target_link_libraries(${LIBRARY_TARGET} PUBLIC bcrypt)
endif()
# configure libarchive
@@ -75,41 +65,28 @@ if(APPLE)
endif()
find_package(LibArchive REQUIRED)
-target_include_directories(gpgfrontend_core PRIVATE ${LibArchive_INCLUDE_DIR})
+target_include_directories(${LIBRARY_TARGET} PRIVATE ${LibArchive_INCLUDE_DIR})
# link libarchive
-target_link_libraries(gpgfrontend_core PRIVATE archive)
+target_link_libraries(${LIBRARY_TARGET} PRIVATE archive)
# link qt
-target_link_libraries(gpgfrontend_core PUBLIC Qt::Core Qt::Gui)
+target_link_libraries(${LIBRARY_TARGET} PUBLIC Qt::Core Qt::Gui)
# set up pch
-target_precompile_headers(gpgfrontend_core
+target_precompile_headers(${LIBRARY_TARGET}
PUBLIC ${CMAKE_SOURCE_DIR}/src/GpgFrontend.h
PUBLIC GpgFrontendCore.h
PUBLIC GpgConstants.h)
-# using std c++ 17
-target_compile_features(gpgfrontend_core PUBLIC cxx_std_17)
-
# link for different platforms
if(MINGW)
message(STATUS "Link GPG Static Library For MINGW")
- target_link_libraries(gpgfrontend_core PUBLIC wsock32)
+ target_link_libraries(${LIBRARY_TARGET} PUBLIC wsock32)
elseif(APPLE)
message(STATUS "Link GPG Static Library For macOS")
-
- if(XCODE_BUILD)
- set_target_properties(gpgfrontend_core
- PROPERTIES
- ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
- LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
- LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
- XCODE_ATTRIBUTE_SKIP_INSTALL "Yes"
- XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${GPGFRONTEND_XCODE_CODE_SIGN_IDENTITY}")
- endif()
else()
# linux
message(STATUS "Link GPG Static Library For Unix")
- target_link_libraries(gpgfrontend_core PUBLIC pthread dl)
+ target_link_libraries(${LIBRARY_TARGET} PUBLIC pthread dl)
endif()
diff --git a/src/core/GpgCoreInit.h b/src/core/GpgCoreInit.h
index 0a35d6d1..937bbc88 100644
--- a/src/core/GpgCoreInit.h
+++ b/src/core/GpgCoreInit.h
@@ -28,7 +28,6 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
#include "core/model/KeyDatabaseInfo.h"
namespace GpgFrontend {
@@ -42,19 +41,19 @@ struct CoreInitArgs {
* @brief
*
*/
-void GPGFRONTEND_CORE_EXPORT DestroyGpgFrontendCore();
+void GF_CORE_EXPORT DestroyGpgFrontendCore();
/**
* @brief
*
*/
-auto GPGFRONTEND_CORE_EXPORT InitGpgFrontendCore(CoreInitArgs) -> int;
+auto GF_CORE_EXPORT InitGpgFrontendCore(CoreInitArgs) -> int;
/**
* @brief
*
*/
-void GPGFRONTEND_CORE_EXPORT StartMonitorCoreInitializationStatus();
+void GF_CORE_EXPORT StartMonitorCoreInitializationStatus();
/**
* @brief
@@ -62,7 +61,7 @@ void GPGFRONTEND_CORE_EXPORT StartMonitorCoreInitializationStatus();
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT InitGpgME() -> bool;
+auto GF_CORE_EXPORT InitGpgME() -> bool;
/**
* @brief
@@ -70,6 +69,6 @@ auto GPGFRONTEND_CORE_EXPORT InitGpgME() -> bool;
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT InitBasicPath() -> bool;
+auto GF_CORE_EXPORT InitBasicPath() -> bool;
} // namespace GpgFrontend
diff --git a/src/core/GpgFrontendCore.h b/src/core/GpgFrontendCore.h
index ab46d45c..4db8a777 100644
--- a/src/core/GpgFrontendCore.h
+++ b/src/core/GpgFrontendCore.h
@@ -28,12 +28,6 @@
#pragma once
-// project base header
-#include "GpgFrontend.h"
-
-// symbol exports header
-#include "core/GpgFrontendCoreExport.h"
-
// qt
#include <QtCore>
diff --git a/src/core/function/ArchiveFileOperator.h b/src/core/function/ArchiveFileOperator.h
index eedbeca6..49ecb1c3 100644
--- a/src/core/function/ArchiveFileOperator.h
+++ b/src/core/function/ArchiveFileOperator.h
@@ -35,7 +35,7 @@
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT ArchiveFileOperator {
+class GF_CORE_EXPORT ArchiveFileOperator {
public:
/**
* @brief
diff --git a/src/core/function/CacheManager.h b/src/core/function/CacheManager.h
index 6a466b60..af054d98 100644
--- a/src/core/function/CacheManager.h
+++ b/src/core/function/CacheManager.h
@@ -32,7 +32,7 @@
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT CacheManager
+class GF_CORE_EXPORT CacheManager
: public SingletonFunctionObject<CacheManager> {
public:
/**
@@ -90,8 +90,8 @@ class GPGFRONTEND_CORE_EXPORT CacheManager
* @param default_value
* @return QJsonDocument
*/
- auto LoadDurableCache(const QString& key,
- QJsonDocument default_value) -> QJsonDocument;
+ auto LoadDurableCache(const QString& key, QJsonDocument default_value)
+ -> QJsonDocument;
/**
* @brief
diff --git a/src/core/function/CoreSignalStation.h b/src/core/function/CoreSignalStation.h
index a5bea44a..ddc8fa19 100644
--- a/src/core/function/CoreSignalStation.h
+++ b/src/core/function/CoreSignalStation.h
@@ -28,8 +28,6 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend {
class GpgPassphraseContext;
@@ -38,7 +36,7 @@ class GpgPassphraseContext;
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT CoreSignalStation : public QObject {
+class GF_CORE_EXPORT CoreSignalStation : public QObject {
Q_OBJECT
static std::unique_ptr<CoreSignalStation> instance;
diff --git a/src/core/function/DataObjectOperator.h b/src/core/function/DataObjectOperator.h
index fca93fc5..eac64d7a 100644
--- a/src/core/function/DataObjectOperator.h
+++ b/src/core/function/DataObjectOperator.h
@@ -35,7 +35,7 @@
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT DataObjectOperator
+class GF_CORE_EXPORT DataObjectOperator
: public SingletonFunctionObject<DataObjectOperator> {
public:
/**
diff --git a/src/core/function/GlobalSettingStation.h b/src/core/function/GlobalSettingStation.h
index 9ef29792..82223261 100644
--- a/src/core/function/GlobalSettingStation.h
+++ b/src/core/function/GlobalSettingStation.h
@@ -41,7 +41,7 @@ namespace GpgFrontend {
* This class handles reading and writing of global settings, as well as
* managing application directories and resource paths.
*/
-class GPGFRONTEND_CORE_EXPORT GlobalSettingStation
+class GF_CORE_EXPORT GlobalSettingStation
: public SingletonFunctionObject<GlobalSettingStation> {
public:
/**
@@ -144,6 +144,6 @@ class GPGFRONTEND_CORE_EXPORT GlobalSettingStation
SecureUniquePtr<Impl> p_;
};
-auto GPGFRONTEND_CORE_EXPORT GetSettings() -> QSettings;
+auto GF_CORE_EXPORT GetSettings() -> QSettings;
} // namespace GpgFrontend
diff --git a/src/core/function/KeyPackageOperator.h b/src/core/function/KeyPackageOperator.h
index d8c87dd1..da1e904c 100644
--- a/src/core/function/KeyPackageOperator.h
+++ b/src/core/function/KeyPackageOperator.h
@@ -37,7 +37,7 @@ namespace GpgFrontend {
* @brief give the possibility to import or export a key package
*
*/
-class GPGFRONTEND_CORE_EXPORT KeyPackageOperator {
+class GF_CORE_EXPORT KeyPackageOperator {
public:
/**
* @brief generate passphrase for key package and save it to file
@@ -47,8 +47,8 @@ class GPGFRONTEND_CORE_EXPORT KeyPackageOperator {
* @return true if passphrase was generated and saved
* @return false if passphrase was not generated and saved
*/
- static auto GeneratePassphrase(const QString &phrase_path,
- QString &phrase) -> bool;
+ static auto GeneratePassphrase(const QString &phrase_path, QString &phrase)
+ -> bool;
/**
* @brief generate the name of the key package
diff --git a/src/core/function/PassphraseGenerator.h b/src/core/function/PassphraseGenerator.h
index 8fa7cc92..8b9afc9b 100644
--- a/src/core/function/PassphraseGenerator.h
+++ b/src/core/function/PassphraseGenerator.h
@@ -37,7 +37,7 @@ namespace GpgFrontend {
*
* This class is used to generate a passphrase.
*/
-class GPGFRONTEND_CORE_EXPORT PassphraseGenerator
+class GF_CORE_EXPORT PassphraseGenerator
: public SingletonFunctionObject<PassphraseGenerator> {
public:
/**
diff --git a/src/core/function/SecureMemoryAllocator.h b/src/core/function/SecureMemoryAllocator.h
index 9b98e0e4..1d683fbd 100644
--- a/src/core/function/SecureMemoryAllocator.h
+++ b/src/core/function/SecureMemoryAllocator.h
@@ -28,11 +28,9 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT SecureMemoryAllocator {
+class GF_CORE_EXPORT SecureMemoryAllocator {
public:
static auto Allocate(std::size_t) -> void *;
diff --git a/src/core/function/basic/ChannelObject.h b/src/core/function/basic/ChannelObject.h
index 66c60511..752837e9 100644
--- a/src/core/function/basic/ChannelObject.h
+++ b/src/core/function/basic/ChannelObject.h
@@ -36,7 +36,7 @@ namespace GpgFrontend {
* @brief object which in channel system is called "channel"
*
*/
-class GPGFRONTEND_CORE_EXPORT ChannelObject {
+class GF_CORE_EXPORT ChannelObject {
public:
/**
* @brief Construct a new Default Channel Object object
diff --git a/src/core/function/basic/GpgFunctionObject.h b/src/core/function/basic/GpgFunctionObject.h
index fea400aa..b9cb2581 100644
--- a/src/core/function/basic/GpgFunctionObject.h
+++ b/src/core/function/basic/GpgFunctionObject.h
@@ -30,7 +30,6 @@
#include <mutex>
-#include "core/GpgFrontendCoreExport.h"
#include "core/function/basic/ChannelObject.h"
#include "core/function/basic/SingletonStorage.h"
#include "core/function/basic/SingletonStorageCollection.h"
@@ -39,15 +38,15 @@
namespace GpgFrontend {
-auto GPGFRONTEND_CORE_EXPORT GetChannelObjectInstance(
- const std::type_info& type, int channel) -> ChannelObject*;
+auto GF_CORE_EXPORT GetChannelObjectInstance(const std::type_info& type,
+ int channel) -> ChannelObject*;
-auto GPGFRONTEND_CORE_EXPORT CreateChannelObjectInstance(
+auto GF_CORE_EXPORT CreateChannelObjectInstance(
const std::type_info& type, int channel,
SecureUniquePtr<ChannelObject> channel_object) -> ChannelObject*;
-auto GPGFRONTEND_CORE_EXPORT
-GetGlobalFunctionObjectTypeLock(const std::type_info& type) -> std::mutex&;
+auto GF_CORE_EXPORT GetGlobalFunctionObjectTypeLock(const std::type_info& type)
+ -> std::mutex&;
/**
* @brief
diff --git a/src/core/function/basic/SingletonStorage.h b/src/core/function/basic/SingletonStorage.h
index 574a16ec..867fe7e0 100644
--- a/src/core/function/basic/SingletonStorage.h
+++ b/src/core/function/basic/SingletonStorage.h
@@ -37,7 +37,7 @@ class ChannelObject;
using ChannelObjectPtr = SecureUniquePtr<ChannelObject>;
-class GPGFRONTEND_CORE_EXPORT SingletonStorage {
+class GF_CORE_EXPORT SingletonStorage {
public:
/**
* @brief
@@ -80,8 +80,8 @@ class GPGFRONTEND_CORE_EXPORT SingletonStorage {
* @param p_obj
* @return T*
*/
- auto SetObjectInChannel(int channel,
- ChannelObjectPtr p_obj) -> ChannelObject*;
+ auto SetObjectInChannel(int channel, ChannelObjectPtr p_obj)
+ -> ChannelObject*;
private:
class Impl;
diff --git a/src/core/function/basic/SingletonStorageCollection.h b/src/core/function/basic/SingletonStorageCollection.h
index 42dd8515..24f84eec 100644
--- a/src/core/function/basic/SingletonStorageCollection.h
+++ b/src/core/function/basic/SingletonStorageCollection.h
@@ -36,7 +36,7 @@ class SingletonStorage;
using SingletonStoragePtr =
std::unique_ptr<SingletonStorage, SecureObjectDeleter<SingletonStorage>>;
-class GPGFRONTEND_CORE_EXPORT SingletonStorageCollection {
+class GF_CORE_EXPORT SingletonStorageCollection {
public:
/**
* @brief
diff --git a/src/core/function/gpg/GpgAbstractKeyGetter.h b/src/core/function/gpg/GpgAbstractKeyGetter.h
index 571121a9..6e74506f 100644
--- a/src/core/function/gpg/GpgAbstractKeyGetter.h
+++ b/src/core/function/gpg/GpgAbstractKeyGetter.h
@@ -41,7 +41,7 @@ class GpgKeyTableModel;
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgAbstractKeyGetter
+class GF_CORE_EXPORT GpgAbstractKeyGetter
: public SingletonFunctionObject<GpgAbstractKeyGetter> {
public:
/**
diff --git a/src/core/function/gpg/GpgAdvancedOperator.h b/src/core/function/gpg/GpgAdvancedOperator.h
index 48a2d755..0c4fc998 100644
--- a/src/core/function/gpg/GpgAdvancedOperator.h
+++ b/src/core/function/gpg/GpgAdvancedOperator.h
@@ -39,7 +39,7 @@
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GpgAdvancedOperator
+class GF_CORE_EXPORT GpgAdvancedOperator
: public SingletonFunctionObject<GpgAdvancedOperator> {
public:
/**
diff --git a/src/core/function/gpg/GpgAssuanHelper.h b/src/core/function/gpg/GpgAssuanHelper.h
index b2a7f2b7..75f565cd 100644
--- a/src/core/function/gpg/GpgAssuanHelper.h
+++ b/src/core/function/gpg/GpgAssuanHelper.h
@@ -32,7 +32,7 @@
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GpgAssuanHelper
+class GF_CORE_EXPORT GpgAssuanHelper
: public SingletonFunctionObject<GpgAssuanHelper> {
public:
struct AssuanCallbackContext;
diff --git a/src/core/function/gpg/GpgAutomatonHandler.h b/src/core/function/gpg/GpgAutomatonHandler.h
index 34c23455..0c334602 100644
--- a/src/core/function/gpg/GpgAutomatonHandler.h
+++ b/src/core/function/gpg/GpgAutomatonHandler.h
@@ -34,7 +34,7 @@
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GpgAutomatonHandler
+class GF_CORE_EXPORT GpgAutomatonHandler
: public SingletonFunctionObject<GpgAutomatonHandler> {
public:
using Command = QString;
@@ -109,8 +109,8 @@ class GPGFRONTEND_CORE_EXPORT GpgAutomatonHandler
*/
auto DoInteract(const GpgKeyPtr& key,
AutomatonNextStateHandler next_state_handler,
- AutomatonActionHandler action_handler,
- int flags = 0) -> std::tuple<GpgError, bool>;
+ AutomatonActionHandler action_handler, int flags = 0)
+ -> std::tuple<GpgError, bool>;
/**
* @brief
diff --git a/src/core/function/gpg/GpgBasicOperator.h b/src/core/function/gpg/GpgBasicOperator.h
index ac6908f4..cfd91227 100644
--- a/src/core/function/gpg/GpgBasicOperator.h
+++ b/src/core/function/gpg/GpgBasicOperator.h
@@ -41,7 +41,7 @@ namespace GpgFrontend {
* @brief Basic operation collection
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgBasicOperator
+class GF_CORE_EXPORT GpgBasicOperator
: public SingletonFunctionObject<GpgBasicOperator> {
public:
/**
@@ -63,8 +63,8 @@ class GPGFRONTEND_CORE_EXPORT GpgBasicOperator
* @brief
*
*/
- auto EncryptSync(const GpgAbstractKeyPtrList&, const GFBuffer&,
- bool) -> std::tuple<GpgError, DataObjectPtr>;
+ auto EncryptSync(const GpgAbstractKeyPtrList&, const GFBuffer&, bool)
+ -> std::tuple<GpgError, DataObjectPtr>;
/**
* @brief Call the interface provided by GPGME to symmetrical encryption
@@ -85,8 +85,8 @@ class GPGFRONTEND_CORE_EXPORT GpgBasicOperator
* @param cb
* @return std::tuple<GpgError, DataObjectPtr>
*/
- auto EncryptSymmetricSync(const GFBuffer& in_buffer,
- bool ascii) -> std::tuple<GpgError, DataObjectPtr>;
+ auto EncryptSymmetricSync(const GFBuffer& in_buffer, bool ascii)
+ -> std::tuple<GpgError, DataObjectPtr>;
/**
*
@@ -115,8 +115,8 @@ class GPGFRONTEND_CORE_EXPORT GpgBasicOperator
*/
auto EncryptSignSync(const GpgAbstractKeyPtrList& keys,
const GpgAbstractKeyPtrList& signers,
- const GFBuffer& in_buffer,
- bool ascii) -> std::tuple<GpgError, DataObjectPtr>;
+ const GFBuffer& in_buffer, bool ascii)
+ -> std::tuple<GpgError, DataObjectPtr>;
/**
* @brief Call the interface provided by gpgme for decryption operation
@@ -212,8 +212,8 @@ class GPGFRONTEND_CORE_EXPORT GpgBasicOperator
* @return std::tuple<GpgError, DataObjectPtr>
*/
auto SignSync(const GpgAbstractKeyPtrList& signers, const GFBuffer& in_buffer,
- GpgSignMode mode,
- bool ascii) -> std::tuple<GpgError, DataObjectPtr>;
+ GpgSignMode mode, bool ascii)
+ -> std::tuple<GpgError, DataObjectPtr>;
/**
* @brief Set the private key for signatures, this operation is a global
diff --git a/src/core/function/gpg/GpgCommandExecutor.h b/src/core/function/gpg/GpgCommandExecutor.h
index 046b61e4..e565f03b 100644
--- a/src/core/function/gpg/GpgCommandExecutor.h
+++ b/src/core/function/gpg/GpgCommandExecutor.h
@@ -41,10 +41,10 @@ using GpgCommandExecutorInterator = std::function<void(QProcess *)>;
* @brief Extra commands related to GPG
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgCommandExecutor
+class GF_CORE_EXPORT GpgCommandExecutor
: public SingletonFunctionObject<GpgCommandExecutor> {
public:
- struct GPGFRONTEND_CORE_EXPORT ExecuteContext {
+ struct GF_CORE_EXPORT ExecuteContext {
QString cmd;
QStringList arguments;
GpgCommandExecutorCallback cb_func;
diff --git a/src/core/function/gpg/GpgComponentManager.h b/src/core/function/gpg/GpgComponentManager.h
index 1048793f..15828004 100644
--- a/src/core/function/gpg/GpgComponentManager.h
+++ b/src/core/function/gpg/GpgComponentManager.h
@@ -33,7 +33,7 @@
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GpgComponentManager
+class GF_CORE_EXPORT GpgComponentManager
: public SingletonFunctionObject<GpgComponentManager> {
public:
/**
diff --git a/src/core/function/gpg/GpgContext.h b/src/core/function/gpg/GpgContext.h
index 57df610c..09fe0aea 100644
--- a/src/core/function/gpg/GpgContext.h
+++ b/src/core/function/gpg/GpgContext.h
@@ -56,8 +56,7 @@ enum class GpgComponentType { kGPG_AGENT, kDIRMNGR, kKEYBOXD, kGPG_AGENT_SSH };
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgContext
- : public SingletonFunctionObject<GpgContext> {
+class GF_CORE_EXPORT GpgContext : public SingletonFunctionObject<GpgContext> {
public:
explicit GpgContext(int channel);
diff --git a/src/core/function/gpg/GpgFileOpera.h b/src/core/function/gpg/GpgFileOpera.h
index 4cbe70d2..ed544da2 100644
--- a/src/core/function/gpg/GpgFileOpera.h
+++ b/src/core/function/gpg/GpgFileOpera.h
@@ -40,7 +40,7 @@ namespace GpgFrontend {
*
* @class class: GpgBasicOperator
*/
-class GPGFRONTEND_CORE_EXPORT GpgFileOpera
+class GF_CORE_EXPORT GpgFileOpera
: public SingletonFunctionObject<GpgFileOpera> {
public:
/**
@@ -74,9 +74,10 @@ class GPGFRONTEND_CORE_EXPORT GpgFileOpera
* @param out_path
* @return std::tuple<GpgError, DataObjectPtr>
*/
- auto EncryptFileSync(
- const GpgAbstractKeyPtrList& keys, const QString& in_path, bool ascii,
- const QString& out_path) -> std::tuple<GpgError, DataObjectPtr>;
+ auto EncryptFileSync(const GpgAbstractKeyPtrList& keys,
+ const QString& in_path, bool ascii,
+ const QString& out_path)
+ -> std::tuple<GpgError, DataObjectPtr>;
/**
* @brief
diff --git a/src/core/function/gpg/GpgKeyGetter.h b/src/core/function/gpg/GpgKeyGetter.h
index 1fe4aeb7..35790c98 100644
--- a/src/core/function/gpg/GpgKeyGetter.h
+++ b/src/core/function/gpg/GpgKeyGetter.h
@@ -38,7 +38,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgKeyGetter
+class GF_CORE_EXPORT GpgKeyGetter
: public SingletonFunctionObject<GpgKeyGetter> {
public:
/**
@@ -69,8 +69,8 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyGetter
* @param use_cache
* @return QSharedPointer<GpgKey>
*/
- auto GetKeyPtr(const QString& key_id,
- bool use_cache = true) -> QSharedPointer<GpgKey>;
+ auto GetKeyPtr(const QString& key_id, bool use_cache = true)
+ -> QSharedPointer<GpgKey>;
/**
* @brief Get the Pubkey object
diff --git a/src/core/function/gpg/GpgKeyGroupGetter.h b/src/core/function/gpg/GpgKeyGroupGetter.h
index 823fe338..f9b6dbdc 100644
--- a/src/core/function/gpg/GpgKeyGroupGetter.h
+++ b/src/core/function/gpg/GpgKeyGroupGetter.h
@@ -116,7 +116,7 @@ struct GpgKeyGroupTreeNode {
[[nodiscard]] auto KeyIds() const -> QStringList;
};
-class GPGFRONTEND_CORE_EXPORT GpgKeyGroupGetter
+class GF_CORE_EXPORT GpgKeyGroupGetter
: public SingletonFunctionObject<GpgKeyGroupGetter> {
public:
/**
diff --git a/src/core/function/gpg/GpgKeyImportExporter.h b/src/core/function/gpg/GpgKeyImportExporter.h
index dcadec36..12578a08 100644
--- a/src/core/function/gpg/GpgKeyImportExporter.h
+++ b/src/core/function/gpg/GpgKeyImportExporter.h
@@ -41,7 +41,7 @@ class GpgImportInformation;
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgKeyImportExporter
+class GF_CORE_EXPORT GpgKeyImportExporter
: public SingletonFunctionObject<GpgKeyImportExporter> {
public:
/**
@@ -68,9 +68,10 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyImportExporter
* @param ascii
* @return std::tuple<GpgError, GFBuffer>
*/
- [[nodiscard]] auto ExportKey(
- const GpgAbstractKeyPtr& key, bool secret, bool ascii, bool shortest,
- bool ssh_mode = false) const -> std::tuple<GpgError, GFBuffer>;
+ [[nodiscard]] auto ExportKey(const GpgAbstractKeyPtr& key, bool secret,
+ bool ascii, bool shortest,
+ bool ssh_mode = false) const
+ -> std::tuple<GpgError, GFBuffer>;
/**
* @brief
diff --git a/src/core/function/gpg/GpgKeyManager.h b/src/core/function/gpg/GpgKeyManager.h
index 384319f8..d698de98 100644
--- a/src/core/function/gpg/GpgKeyManager.h
+++ b/src/core/function/gpg/GpgKeyManager.h
@@ -39,7 +39,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgKeyManager
+class GF_CORE_EXPORT GpgKeyManager
: public SingletonFunctionObject<GpgKeyManager> {
public:
/**
@@ -58,8 +58,8 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyManager
* @return if successful
*/
auto SignKey(const GpgKeyPtr& key, const GpgAbstractKeyPtrList& keys,
- const QString& uid,
- const std::unique_ptr<QDateTime>& expires) -> bool;
+ const QString& uid, const std::unique_ptr<QDateTime>& expires)
+ -> bool;
/**
* @brief
@@ -69,8 +69,8 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyManager
* @return true
* @return false
*/
- auto RevSign(const GpgKeyPtr& key,
- const SignIdArgsList& signature_id) -> bool;
+ auto RevSign(const GpgKeyPtr& key, const SignIdArgsList& signature_id)
+ -> bool;
/**
* @brief Set the Expire object
diff --git a/src/core/function/gpg/GpgKeyOpera.h b/src/core/function/gpg/GpgKeyOpera.h
index 0b91f88a..dac81757 100644
--- a/src/core/function/gpg/GpgKeyOpera.h
+++ b/src/core/function/gpg/GpgKeyOpera.h
@@ -45,8 +45,7 @@ class KeyGenerateInfo;
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgKeyOpera
- : public SingletonFunctionObject<GpgKeyOpera> {
+class GF_CORE_EXPORT GpgKeyOpera : public SingletonFunctionObject<GpgKeyOpera> {
public:
/**
* @brief Construct a new Gpg Key Opera object
@@ -106,8 +105,8 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyOpera
* @param tofu_policy
* @return GpgFrontend::GpgError
*/
- auto ModifyTOFUPolicy(const GpgKeyPtr& key,
- gpgme_tofu_policy_t tofu_policy) -> GpgError;
+ auto ModifyTOFUPolicy(const GpgKeyPtr& key, gpgme_tofu_policy_t tofu_policy)
+ -> GpgError;
/**
* @brief
*
diff --git a/src/core/function/gpg/GpgSmartCardManager.h b/src/core/function/gpg/GpgSmartCardManager.h
index 95fcd7c7..5c21e243 100644
--- a/src/core/function/gpg/GpgSmartCardManager.h
+++ b/src/core/function/gpg/GpgSmartCardManager.h
@@ -40,7 +40,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgSmartCardManager
+class GF_CORE_EXPORT GpgSmartCardManager
: public SingletonFunctionObject<GpgSmartCardManager> {
public:
/**
@@ -89,8 +89,8 @@ class GPGFRONTEND_CORE_EXPORT GpgSmartCardManager
*
* @return std::tuple<bool, QString>
*/
- auto ModifyAttr(const QString& attr,
- const QString& value) -> std::tuple<GpgError, QString>;
+ auto ModifyAttr(const QString& attr, const QString& value)
+ -> std::tuple<GpgError, QString>;
/**
* @brief
@@ -107,8 +107,8 @@ class GPGFRONTEND_CORE_EXPORT GpgSmartCardManager
*/
auto GenerateKey(const QString& serial_number, const QString& name,
const QString& email, const QString& comment,
- const QDateTime& expire,
- bool non_expire) -> std::tuple<GpgError, QString>;
+ const QDateTime& expire, bool non_expire)
+ -> std::tuple<GpgError, QString>;
/**
* @brief
diff --git a/src/core/function/gpg/GpgUIDOperator.h b/src/core/function/gpg/GpgUIDOperator.h
index 0e222388..1f99a55f 100644
--- a/src/core/function/gpg/GpgUIDOperator.h
+++ b/src/core/function/gpg/GpgUIDOperator.h
@@ -37,7 +37,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgUIDOperator
+class GF_CORE_EXPORT GpgUIDOperator
: public SingletonFunctionObject<GpgUIDOperator> {
public:
/**
diff --git a/src/core/function/result_analyse/GpgDecryptResultAnalyse.h b/src/core/function/result_analyse/GpgDecryptResultAnalyse.h
index cb3eee02..b07a8904 100644
--- a/src/core/function/result_analyse/GpgDecryptResultAnalyse.h
+++ b/src/core/function/result_analyse/GpgDecryptResultAnalyse.h
@@ -37,8 +37,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgDecryptResultAnalyse
- : public GpgResultAnalyse {
+class GF_CORE_EXPORT GpgDecryptResultAnalyse : public GpgResultAnalyse {
Q_OBJECT
public:
/**
diff --git a/src/core/function/result_analyse/GpgEncryptResultAnalyse.h b/src/core/function/result_analyse/GpgEncryptResultAnalyse.h
index 26c7cf9a..c7062ad4 100644
--- a/src/core/function/result_analyse/GpgEncryptResultAnalyse.h
+++ b/src/core/function/result_analyse/GpgEncryptResultAnalyse.h
@@ -36,8 +36,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgEncryptResultAnalyse
- : public GpgResultAnalyse {
+class GF_CORE_EXPORT GpgEncryptResultAnalyse : public GpgResultAnalyse {
Q_OBJECT
public:
/**
diff --git a/src/core/function/result_analyse/GpgResultAnalyse.h b/src/core/function/result_analyse/GpgResultAnalyse.h
index fa84ddb4..99e28b2c 100644
--- a/src/core/function/result_analyse/GpgResultAnalyse.h
+++ b/src/core/function/result_analyse/GpgResultAnalyse.h
@@ -27,9 +27,11 @@
*/
#pragma once
+#include "GFCoreExport.h"
+
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GpgResultAnalyse : public QObject {
+class GF_CORE_EXPORT GpgResultAnalyse : public QObject {
Q_OBJECT
public:
/**
@@ -37,7 +39,7 @@ class GPGFRONTEND_CORE_EXPORT GpgResultAnalyse : public QObject {
*
*/
explicit GpgResultAnalyse(int channel)
- : current_gpg_context_channel_(channel){};
+ : current_gpg_context_channel_(channel) {};
/**
* @brief Get the Result Report object
diff --git a/src/core/function/result_analyse/GpgSignResultAnalyse.h b/src/core/function/result_analyse/GpgSignResultAnalyse.h
index c004086f..080f8411 100644
--- a/src/core/function/result_analyse/GpgSignResultAnalyse.h
+++ b/src/core/function/result_analyse/GpgSignResultAnalyse.h
@@ -37,7 +37,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgSignResultAnalyse : public GpgResultAnalyse {
+class GF_CORE_EXPORT GpgSignResultAnalyse : public GpgResultAnalyse {
Q_OBJECT
public:
/**
diff --git a/src/core/function/result_analyse/GpgVerifyResultAnalyse.h b/src/core/function/result_analyse/GpgVerifyResultAnalyse.h
index 7166ae4d..53b79351 100644
--- a/src/core/function/result_analyse/GpgVerifyResultAnalyse.h
+++ b/src/core/function/result_analyse/GpgVerifyResultAnalyse.h
@@ -37,7 +37,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgVerifyResultAnalyse : public GpgResultAnalyse {
+class GF_CORE_EXPORT GpgVerifyResultAnalyse : public GpgResultAnalyse {
Q_OBJECT
public:
/**
diff --git a/src/core/model/CacheObject.h b/src/core/model/CacheObject.h
index 0c8708f5..bf0a8325 100644
--- a/src/core/model/CacheObject.h
+++ b/src/core/model/CacheObject.h
@@ -28,11 +28,9 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT CacheObject : public QJsonDocument {
+class GF_CORE_EXPORT CacheObject : public QJsonDocument {
public:
/**
* @brief Construct a new Cache Object object
diff --git a/src/core/model/CommonStruct.h b/src/core/model/CommonStruct.h
index afdcacf0..e548f7be 100644
--- a/src/core/model/CommonStruct.h
+++ b/src/core/model/CommonStruct.h
@@ -35,8 +35,9 @@ namespace GpgFrontend {
*
*/
template <typename T>
-struct GPGFRONTEND_CORE_EXPORT RefDeleter {
- void operator()(T* _key) { gpgme_unre }
+struct GF_CORE_EXPORT RefDeleter {
+ void
+ operator()(T* _key){gpgme_unre}
};
template <typename T>
diff --git a/src/core/model/DataObject.h b/src/core/model/DataObject.h
index ea8fc4c4..a80370a2 100644
--- a/src/core/model/DataObject.h
+++ b/src/core/model/DataObject.h
@@ -32,13 +32,12 @@
#include <typeindex>
#include <typeinfo>
-#include "core/GpgFrontendCoreExport.h"
#include "core/typedef/CoreTypedef.h"
#include "core/utils/MemoryUtils.h"
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT DataObject {
+class GF_CORE_EXPORT DataObject {
public:
DataObject();
diff --git a/src/core/model/GFBuffer.h b/src/core/model/GFBuffer.h
index 405c75b0..33b013a4 100644
--- a/src/core/model/GFBuffer.h
+++ b/src/core/model/GFBuffer.h
@@ -28,12 +28,11 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
#include "core/utils/MemoryUtils.h"
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GFBuffer {
+class GF_CORE_EXPORT GFBuffer {
public:
GFBuffer();
diff --git a/src/core/model/GpgData.h b/src/core/model/GpgData.h
index 7f1d74c4..83eeb625 100644
--- a/src/core/model/GpgData.h
+++ b/src/core/model/GpgData.h
@@ -30,7 +30,6 @@
#include <gpgme.h>
-#include "core/GpgFrontendCoreExport.h"
#include "core/model/GFBuffer.h"
#include "core/typedef/CoreTypedef.h"
@@ -42,7 +41,7 @@ class GFDataExchanger;
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgData {
+class GF_CORE_EXPORT GpgData {
public:
/**
* @brief Construct a new Gpg Data object
diff --git a/src/core/model/GpgDecryptResult.h b/src/core/model/GpgDecryptResult.h
index 772b24cb..40abb64a 100644
--- a/src/core/model/GpgDecryptResult.h
+++ b/src/core/model/GpgDecryptResult.h
@@ -33,7 +33,7 @@
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GpgDecryptResult {
+class GF_CORE_EXPORT GpgDecryptResult {
public:
auto IsGood() -> bool;
diff --git a/src/core/model/GpgEncryptResult.h b/src/core/model/GpgEncryptResult.h
index 9167f28d..e0418fc5 100644
--- a/src/core/model/GpgEncryptResult.h
+++ b/src/core/model/GpgEncryptResult.h
@@ -32,7 +32,7 @@
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GpgEncryptResult {
+class GF_CORE_EXPORT GpgEncryptResult {
public:
auto IsGood() -> bool;
diff --git a/src/core/model/GpgGenerateKeyResult.h b/src/core/model/GpgGenerateKeyResult.h
index 80e49a38..f9457a8b 100644
--- a/src/core/model/GpgGenerateKeyResult.h
+++ b/src/core/model/GpgGenerateKeyResult.h
@@ -31,11 +31,10 @@
#include <gpgme.h>
#include "core/GpgFrontendCore.h"
-#include "core/GpgFrontendCoreExport.h"
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GpgGenerateKeyResult {
+class GF_CORE_EXPORT GpgGenerateKeyResult {
public:
auto IsGood() -> bool;
diff --git a/src/core/model/GpgImportInformation.h b/src/core/model/GpgImportInformation.h
index 9c027aca..1fed813f 100644
--- a/src/core/model/GpgImportInformation.h
+++ b/src/core/model/GpgImportInformation.h
@@ -30,15 +30,13 @@
#include <gpgme.h>
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend {
/**
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgImportInformation {
+class GF_CORE_EXPORT GpgImportInformation {
public:
/**
* @brief
diff --git a/src/core/model/GpgKey.h b/src/core/model/GpgKey.h
index 43410acd..2b4679a8 100644
--- a/src/core/model/GpgKey.h
+++ b/src/core/model/GpgKey.h
@@ -37,7 +37,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgKey : public GpgAbstractKey {
+class GF_CORE_EXPORT GpgKey : public GpgAbstractKey {
Q_DECLARE_TR_FUNCTIONS(GpgKey)
public:
/**
diff --git a/src/core/model/GpgKeyGenerateInfo.h b/src/core/model/GpgKeyGenerateInfo.h
index b3f3b2c7..00624667 100644
--- a/src/core/model/GpgKeyGenerateInfo.h
+++ b/src/core/model/GpgKeyGenerateInfo.h
@@ -28,12 +28,11 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
#include "core/typedef/CoreTypedef.h"
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT KeyAlgo {
+class GF_CORE_EXPORT KeyAlgo {
public:
KeyAlgo() = default;
@@ -76,7 +75,7 @@ class GPGFRONTEND_CORE_EXPORT KeyAlgo {
QString supported_version_;
};
-class GPGFRONTEND_CORE_EXPORT KeyGenerateInfo : public QObject {
+class GF_CORE_EXPORT KeyGenerateInfo : public QObject {
Q_OBJECT
public:
static const KeyAlgo kNoneAlgo;
diff --git a/src/core/model/GpgKeyGroup.h b/src/core/model/GpgKeyGroup.h
index 887fd13f..5754ce53 100644
--- a/src/core/model/GpgKeyGroup.h
+++ b/src/core/model/GpgKeyGroup.h
@@ -39,7 +39,7 @@ class GpgKeyGroupGetter;
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgKeyGroup : public GpgAbstractKey {
+class GF_CORE_EXPORT GpgKeyGroup : public GpgAbstractKey {
public:
/**
* @brief Construct a new Gpg Key object
diff --git a/src/core/model/GpgKeySignature.h b/src/core/model/GpgKeySignature.h
index 94870e0f..af8031c3 100644
--- a/src/core/model/GpgKeySignature.h
+++ b/src/core/model/GpgKeySignature.h
@@ -39,7 +39,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgKeySignature {
+class GF_CORE_EXPORT GpgKeySignature {
public:
/**
* @brief
diff --git a/src/core/model/GpgKeyTableModel.h b/src/core/model/GpgKeyTableModel.h
index 60410a79..04e68c2b 100644
--- a/src/core/model/GpgKeyTableModel.h
+++ b/src/core/model/GpgKeyTableModel.h
@@ -54,28 +54,28 @@ enum class GpgKeyTableColumn : unsigned int {
kALL = ~0U
};
-inline auto operator|(GpgKeyTableColumn lhs,
- GpgKeyTableColumn rhs) -> GpgKeyTableColumn {
+inline auto operator|(GpgKeyTableColumn lhs, GpgKeyTableColumn rhs)
+ -> GpgKeyTableColumn {
using T = std::underlying_type_t<GpgKeyTableColumn>;
return static_cast<GpgKeyTableColumn>(static_cast<T>(lhs) |
static_cast<T>(rhs));
}
-inline auto operator|=(GpgKeyTableColumn &lhs,
- GpgKeyTableColumn rhs) -> GpgKeyTableColumn & {
+inline auto operator|=(GpgKeyTableColumn &lhs, GpgKeyTableColumn rhs)
+ -> GpgKeyTableColumn & {
lhs = lhs | rhs;
return lhs;
}
-inline auto operator&(GpgKeyTableColumn lhs,
- GpgKeyTableColumn rhs) -> GpgKeyTableColumn {
+inline auto operator&(GpgKeyTableColumn lhs, GpgKeyTableColumn rhs)
+ -> GpgKeyTableColumn {
using T = std::underlying_type_t<GpgKeyTableColumn>;
return static_cast<GpgKeyTableColumn>(static_cast<T>(lhs) &
static_cast<T>(rhs));
}
-inline auto operator&=(GpgKeyTableColumn &lhs,
- GpgKeyTableColumn rhs) -> GpgKeyTableColumn & {
+inline auto operator&=(GpgKeyTableColumn &lhs, GpgKeyTableColumn rhs)
+ -> GpgKeyTableColumn & {
lhs = lhs & rhs;
return lhs;
}
@@ -93,26 +93,26 @@ enum class GpgKeyTableDisplayMode : unsigned int {
kALL = ~0U
};
-inline auto operator|(GpgKeyTableDisplayMode lhs,
- GpgKeyTableDisplayMode rhs) -> GpgKeyTableDisplayMode {
+inline auto operator|(GpgKeyTableDisplayMode lhs, GpgKeyTableDisplayMode rhs)
+ -> GpgKeyTableDisplayMode {
using T = std::underlying_type_t<GpgKeyTableDisplayMode>;
return static_cast<GpgKeyTableDisplayMode>(static_cast<T>(lhs) |
static_cast<T>(rhs));
}
-inline auto operator|=(GpgKeyTableDisplayMode &lhs,
- GpgKeyTableDisplayMode rhs) -> GpgKeyTableDisplayMode & {
+inline auto operator|=(GpgKeyTableDisplayMode &lhs, GpgKeyTableDisplayMode rhs)
+ -> GpgKeyTableDisplayMode & {
lhs = lhs | rhs;
return lhs;
}
-inline auto operator&(GpgKeyTableDisplayMode lhs,
- GpgKeyTableDisplayMode rhs) -> bool {
+inline auto operator&(GpgKeyTableDisplayMode lhs, GpgKeyTableDisplayMode rhs)
+ -> bool {
using T = std::underlying_type_t<GpgKeyTableDisplayMode>;
return (static_cast<T>(lhs) & static_cast<T>(rhs)) != 0;
}
-class GPGFRONTEND_CORE_EXPORT GpgKeyTableItem {
+class GF_CORE_EXPORT GpgKeyTableItem {
public:
GpgKeyTableItem() = default;
@@ -154,7 +154,7 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyTableItem {
bool checked_ = false;
};
-class GPGFRONTEND_CORE_EXPORT GpgKeyTableModel : public QAbstractTableModel {
+class GF_CORE_EXPORT GpgKeyTableModel : public QAbstractTableModel {
Q_OBJECT
public:
/**
@@ -201,8 +201,8 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyTableModel : public QAbstractTableModel {
* @param role
* @return QVariant
*/
- [[nodiscard]] auto data(const QModelIndex &index,
- int role) const -> QVariant override;
+ [[nodiscard]] auto data(const QModelIndex &index, int role) const
+ -> QVariant override;
/**
* @brief
@@ -224,8 +224,8 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyTableModel : public QAbstractTableModel {
* @return true
* @return false
*/
- auto setData(const QModelIndex &index, const QVariant &value,
- int role) -> bool override;
+ auto setData(const QModelIndex &index, const QVariant &value, int role)
+ -> bool override;
/**
* @brief
@@ -257,8 +257,8 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyTableModel : public QAbstractTableModel {
auto table_tooltip_by_gpg_key(const QModelIndex &index,
const GpgKey *key) const -> QVariant;
- static auto table_data_by_gpg_key(const QModelIndex &index,
- const GpgKey *key) -> QVariant;
+ static auto table_data_by_gpg_key(const QModelIndex &index, const GpgKey *key)
+ -> QVariant;
static auto table_data_by_gpg_key_group(const QModelIndex &index,
const GpgKeyGroup *kg) -> QVariant;
diff --git a/src/core/model/GpgKeyTreeModel.h b/src/core/model/GpgKeyTreeModel.h
index a23ae921..b2c05f54 100644
--- a/src/core/model/GpgKeyTreeModel.h
+++ b/src/core/model/GpgKeyTreeModel.h
@@ -50,28 +50,28 @@ enum class GpgKeyTreeColumn : unsigned int {
kALL = ~0U
};
-inline auto operator|(GpgKeyTreeColumn lhs,
- GpgKeyTreeColumn rhs) -> GpgKeyTreeColumn {
+inline auto operator|(GpgKeyTreeColumn lhs, GpgKeyTreeColumn rhs)
+ -> GpgKeyTreeColumn {
using T = std::underlying_type_t<GpgKeyTreeColumn>;
return static_cast<GpgKeyTreeColumn>(static_cast<T>(lhs) |
static_cast<T>(rhs));
}
-inline auto operator|=(GpgKeyTreeColumn &lhs,
- GpgKeyTreeColumn rhs) -> GpgKeyTreeColumn & {
+inline auto operator|=(GpgKeyTreeColumn &lhs, GpgKeyTreeColumn rhs)
+ -> GpgKeyTreeColumn & {
lhs = lhs | rhs;
return lhs;
}
-inline auto operator&(GpgKeyTreeColumn lhs,
- GpgKeyTreeColumn rhs) -> GpgKeyTreeColumn {
+inline auto operator&(GpgKeyTreeColumn lhs, GpgKeyTreeColumn rhs)
+ -> GpgKeyTreeColumn {
using T = std::underlying_type_t<GpgKeyTreeColumn>;
return static_cast<GpgKeyTreeColumn>(static_cast<T>(lhs) &
static_cast<T>(rhs));
}
-inline auto operator&=(GpgKeyTreeColumn &lhs,
- GpgKeyTreeColumn rhs) -> GpgKeyTreeColumn & {
+inline auto operator&=(GpgKeyTreeColumn &lhs, GpgKeyTreeColumn rhs)
+ -> GpgKeyTreeColumn & {
lhs = lhs & rhs;
return lhs;
}
@@ -89,26 +89,26 @@ enum class GpgKeyTreeDisplayMode : unsigned int {
kALL = ~0U
};
-inline auto operator|(GpgKeyTreeDisplayMode lhs,
- GpgKeyTreeDisplayMode rhs) -> GpgKeyTreeDisplayMode {
+inline auto operator|(GpgKeyTreeDisplayMode lhs, GpgKeyTreeDisplayMode rhs)
+ -> GpgKeyTreeDisplayMode {
using T = std::underlying_type_t<GpgKeyTreeDisplayMode>;
return static_cast<GpgKeyTreeDisplayMode>(static_cast<T>(lhs) |
static_cast<T>(rhs));
}
-inline auto operator|=(GpgKeyTreeDisplayMode &lhs,
- GpgKeyTreeDisplayMode rhs) -> GpgKeyTreeDisplayMode & {
+inline auto operator|=(GpgKeyTreeDisplayMode &lhs, GpgKeyTreeDisplayMode rhs)
+ -> GpgKeyTreeDisplayMode & {
lhs = lhs | rhs;
return lhs;
}
-inline auto operator&(GpgKeyTreeDisplayMode lhs,
- GpgKeyTreeDisplayMode rhs) -> bool {
+inline auto operator&(GpgKeyTreeDisplayMode lhs, GpgKeyTreeDisplayMode rhs)
+ -> bool {
using T = std::underlying_type_t<GpgKeyTreeDisplayMode>;
return (static_cast<T>(lhs) & static_cast<T>(rhs)) != 0;
}
-class GPGFRONTEND_CORE_EXPORT GpgKeyTreeItem {
+class GF_CORE_EXPORT GpgKeyTreeItem {
public:
GpgKeyTreeItem() = default;
@@ -238,7 +238,7 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyTreeItem {
GpgKeyTreeItem *parent_ = nullptr;
};
-class GPGFRONTEND_CORE_EXPORT GpgKeyTreeModel : public QAbstractItemModel {
+class GF_CORE_EXPORT GpgKeyTreeModel : public QAbstractItemModel {
Q_OBJECT
public:
using Detector = std::function<bool(GpgAbstractKey *)>;
@@ -287,8 +287,8 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyTreeModel : public QAbstractItemModel {
* @param role
* @return QVariant
*/
- [[nodiscard]] auto data(const QModelIndex &index,
- int role) const -> QVariant override;
+ [[nodiscard]] auto data(const QModelIndex &index, int role) const
+ -> QVariant override;
/**
* @brief
@@ -310,8 +310,8 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyTreeModel : public QAbstractItemModel {
* @return true
* @return false
*/
- auto setData(const QModelIndex &index, const QVariant &value,
- int role) -> bool override;
+ auto setData(const QModelIndex &index, const QVariant &value, int role)
+ -> bool override;
/**
* @brief
diff --git a/src/core/model/GpgOpenPGPCard.h b/src/core/model/GpgOpenPGPCard.h
index 818c8c8c..a02ae167 100644
--- a/src/core/model/GpgOpenPGPCard.h
+++ b/src/core/model/GpgOpenPGPCard.h
@@ -30,7 +30,7 @@
namespace GpgFrontend {
-struct GPGFRONTEND_CORE_EXPORT GpgOpenPGPCard {
+struct GF_CORE_EXPORT GpgOpenPGPCard {
public:
QString reader;
QString serial_number;
diff --git a/src/core/model/GpgPassphraseContext.h b/src/core/model/GpgPassphraseContext.h
index c130ea66..a269a9a5 100644
--- a/src/core/model/GpgPassphraseContext.h
+++ b/src/core/model/GpgPassphraseContext.h
@@ -30,11 +30,9 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GpgPassphraseContext : public QObject {
+class GF_CORE_EXPORT GpgPassphraseContext : public QObject {
Q_OBJECT
public:
GpgPassphraseContext(const QString& uids_info, const QString& passphrase_info,
diff --git a/src/core/model/GpgRecipient.h b/src/core/model/GpgRecipient.h
index af16a004..a2cb2b24 100644
--- a/src/core/model/GpgRecipient.h
+++ b/src/core/model/GpgRecipient.h
@@ -28,12 +28,11 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
#include "core/typedef/GpgTypedef.h"
namespace GpgFrontend {
-struct GPGFRONTEND_CORE_EXPORT GpgRecipient {
+struct GF_CORE_EXPORT GpgRecipient {
/* The key ID of key for which the text was encrypted. */
QString keyid;
diff --git a/src/core/model/GpgSignResult.h b/src/core/model/GpgSignResult.h
index 434a590e..71485664 100644
--- a/src/core/model/GpgSignResult.h
+++ b/src/core/model/GpgSignResult.h
@@ -28,12 +28,11 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
#include "core/typedef/GpgTypedef.h"
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GpgSignResult {
+class GF_CORE_EXPORT GpgSignResult {
public:
auto IsGood() -> bool;
diff --git a/src/core/model/GpgSignature.h b/src/core/model/GpgSignature.h
index aa977d55..1d434abb 100644
--- a/src/core/model/GpgSignature.h
+++ b/src/core/model/GpgSignature.h
@@ -36,7 +36,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgSignature {
+class GF_CORE_EXPORT GpgSignature {
public:
/**
* @brief
diff --git a/src/core/model/GpgSubKey.h b/src/core/model/GpgSubKey.h
index 920f42e8..a9d6486f 100644
--- a/src/core/model/GpgSubKey.h
+++ b/src/core/model/GpgSubKey.h
@@ -30,7 +30,6 @@
#include <gpgme.h>
-#include "core/GpgFrontendCoreExport.h"
#include "core/model/GpgAbstractKey.h"
namespace GpgFrontend {
@@ -41,7 +40,7 @@ class GpgKey;
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgSubKey : public GpgAbstractKey {
+class GF_CORE_EXPORT GpgSubKey : public GpgAbstractKey {
public:
/**
* @brief Construct a new Gpg Sub Key object
diff --git a/src/core/model/GpgTOFUInfo.h b/src/core/model/GpgTOFUInfo.h
index 816680ce..086fef9f 100644
--- a/src/core/model/GpgTOFUInfo.h
+++ b/src/core/model/GpgTOFUInfo.h
@@ -30,14 +30,12 @@
#include <gpgme.h>
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend {
/**
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgTOFUInfo {
+class GF_CORE_EXPORT GpgTOFUInfo {
public:
/**
* @brief
diff --git a/src/core/model/GpgUID.h b/src/core/model/GpgUID.h
index 6cc44b57..28dd0ca0 100644
--- a/src/core/model/GpgUID.h
+++ b/src/core/model/GpgUID.h
@@ -37,7 +37,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgUID {
+class GF_CORE_EXPORT GpgUID {
public:
/**
* @brief
diff --git a/src/core/model/GpgVerifyResult.h b/src/core/model/GpgVerifyResult.h
index b928d2ca..cb40bb94 100644
--- a/src/core/model/GpgVerifyResult.h
+++ b/src/core/model/GpgVerifyResult.h
@@ -28,12 +28,11 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
#include "core/model/GpgSignature.h"
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GpgVerifyResult {
+class GF_CORE_EXPORT GpgVerifyResult {
public:
[[nodiscard]] auto IsGood() const -> bool;
diff --git a/src/core/model/SettingsObject.h b/src/core/model/SettingsObject.h
index 21686898..ee075aaf 100644
--- a/src/core/model/SettingsObject.h
+++ b/src/core/model/SettingsObject.h
@@ -28,8 +28,6 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend {
/**
@@ -37,7 +35,7 @@ namespace GpgFrontend {
* This class is used to store data for the application securely.
*
*/
-class GPGFRONTEND_CORE_EXPORT SettingsObject : public QJsonObject {
+class GF_CORE_EXPORT SettingsObject : public QJsonObject {
public:
/**
* @brief Construct a new Settings Object object
diff --git a/src/core/module/Event.cpp b/src/core/module/Event.cpp
index 56f45261..fd293184 100644
--- a/src/core/module/Event.cpp
+++ b/src/core/module/Event.cpp
@@ -29,6 +29,7 @@
#include "Event.h"
#include "core/utils/CommonUtils.h"
+#include "sdk/GFSDKModuleModel.h"
namespace GpgFrontend::Module {
diff --git a/src/core/module/Event.h b/src/core/module/Event.h
index a6660266..17c08d84 100644
--- a/src/core/module/Event.h
+++ b/src/core/module/Event.h
@@ -34,7 +34,8 @@
#include "core/GpgFrontendCore.h"
#include "core/model/DataObject.h"
-#include "sdk/GFSDKModule.h"
+
+struct GFModuleEvent;
namespace GpgFrontend::Module {
@@ -45,7 +46,7 @@ using EventIdentifier = QString;
using EventTriggerIdentifier = QString;
using Evnets = QContainer<Event>;
-class GPGFRONTEND_CORE_EXPORT Event {
+class GF_CORE_EXPORT Event {
public:
using ParameterValue = std::any;
using EventIdentifier = QString;
diff --git a/src/core/module/GlobalModuleContext.h b/src/core/module/GlobalModuleContext.h
index 611926b1..d980e23f 100644
--- a/src/core/module/GlobalModuleContext.h
+++ b/src/core/module/GlobalModuleContext.h
@@ -51,7 +51,7 @@ using GRTPtr = QSharedPointer<GlobalRegisterTable>;
using TaskRunnerPtr = QSharedPointer<Thread::TaskRunner>;
-class GPGFRONTEND_CORE_EXPORT GlobalModuleContext : public QObject {
+class GF_CORE_EXPORT GlobalModuleContext : public QObject {
Q_OBJECT
public:
explicit GlobalModuleContext();
diff --git a/src/core/module/GlobalRegisterTableTreeModel.h b/src/core/module/GlobalRegisterTableTreeModel.h
index 1d7ead77..8e44dba8 100644
--- a/src/core/module/GlobalRegisterTableTreeModel.h
+++ b/src/core/module/GlobalRegisterTableTreeModel.h
@@ -31,8 +31,7 @@
#include "core/module/GlobalRegisterTable.h"
namespace GpgFrontend::Module {
-class GPGFRONTEND_CORE_EXPORT GlobalRegisterTableTreeModel
- : public QAbstractItemModel {
+class GF_CORE_EXPORT GlobalRegisterTableTreeModel : public QAbstractItemModel {
public:
explicit GlobalRegisterTableTreeModel(GlobalRegisterTable *grt,
QObject *parent);
@@ -42,8 +41,8 @@ class GPGFRONTEND_CORE_EXPORT GlobalRegisterTableTreeModel
[[nodiscard]] auto columnCount(const QModelIndex &parent) const
-> int override;
- [[nodiscard]] auto data(const QModelIndex &index,
- int role) const -> QVariant override;
+ [[nodiscard]] auto data(const QModelIndex &index, int role) const
+ -> QVariant override;
[[nodiscard]] auto index(int row, int column, const QModelIndex &parent) const
-> QModelIndex override;
diff --git a/src/core/module/Module.cpp b/src/core/module/Module.cpp
index a77b974d..316058dc 100644
--- a/src/core/module/Module.cpp
+++ b/src/core/module/Module.cpp
@@ -31,7 +31,7 @@
#include "core/module/GlobalModuleContext.h"
#include "core/utils/CommonUtils.h"
#include "core/utils/IOUtils.h"
-#include "sdk/GFSDKModule.h"
+#include "sdk/GFSDKModuleModel.h"
#include "utils/BuildInfoUtils.h"
namespace GpgFrontend::Module {
diff --git a/src/core/module/Module.h b/src/core/module/Module.h
index 19c86be4..1999b352 100644
--- a/src/core/module/Module.h
+++ b/src/core/module/Module.h
@@ -44,7 +44,7 @@ using ModulePtr = QSharedPointer<Module>;
using TaskRunnerPtr = QSharedPointer<Thread::TaskRunner>;
-class GPGFRONTEND_CORE_EXPORT Module : public QObject {
+class GF_CORE_EXPORT Module : public QObject {
Q_OBJECT
public:
Module(ModuleIdentifier, ModuleVersion, const ModuleMetaData &);
diff --git a/src/core/module/ModuleInit.h b/src/core/module/ModuleInit.h
index c6e4b82b..2b9d42e4 100644
--- a/src/core/module/ModuleInit.h
+++ b/src/core/module/ModuleInit.h
@@ -28,8 +28,6 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend::Module {
struct ModuleInitArgs {};
@@ -38,12 +36,12 @@ struct ModuleInitArgs {};
* @brief init the module library
*
*/
-void GPGFRONTEND_CORE_EXPORT LoadGpgFrontendModules(ModuleInitArgs args);
+void GF_CORE_EXPORT LoadGpgFrontendModules(ModuleInitArgs args);
/**
* @brief shutdown the module library
*
*/
-void GPGFRONTEND_CORE_EXPORT ShutdownGpgFrontendModules();
+void GF_CORE_EXPORT ShutdownGpgFrontendModules();
}; // namespace GpgFrontend::Module
diff --git a/src/core/module/ModuleManager.cpp b/src/core/module/ModuleManager.cpp
index 10c39eb6..fe22fcde 100644
--- a/src/core/module/ModuleManager.cpp
+++ b/src/core/module/ModuleManager.cpp
@@ -252,7 +252,7 @@ auto IsModuleActivate(ModuleIdentifier id) -> bool {
return ModuleManager::GetInstance().IsModuleActivated(id);
}
-auto GPGFRONTEND_CORE_EXPORT IsModuleExists(ModuleIdentifier id) -> bool {
+auto GF_CORE_EXPORT IsModuleExists(ModuleIdentifier id) -> bool {
auto module = ModuleManager::GetInstance().SearchModule(id);
return module != nullptr && module->IsGood();
}
@@ -263,13 +263,13 @@ auto UpsertRTValue(const QString& namespace_, const QString& key,
std::any(value));
}
-auto ListenRTPublishEvent(QObject* o, Namespace n, Key k,
- LPCallback c) -> bool {
+auto ListenRTPublishEvent(QObject* o, Namespace n, Key k, LPCallback c)
+ -> bool {
return ModuleManager::GetInstance().ListenRTPublish(o, n, k, c);
}
-auto ListRTChildKeys(const QString& namespace_,
- const QString& key) -> QContainer<Key> {
+auto ListRTChildKeys(const QString& namespace_, const QString& key)
+ -> QContainer<Key> {
return ModuleManager::GetInstance().ListRTChildKeys(namespace_, key);
}
@@ -328,8 +328,8 @@ auto ModuleManager::UpsertRTValue(Namespace n, Key k, std::any v) -> bool {
return p_->UpsertRTValue(n, k, v);
}
-auto ModuleManager::RetrieveRTValue(Namespace n,
- Key k) -> std::optional<std::any> {
+auto ModuleManager::RetrieveRTValue(Namespace n, Key k)
+ -> std::optional<std::any> {
return p_->RetrieveRTValue(n, k);
}
@@ -338,8 +338,8 @@ auto ModuleManager::ListenRTPublish(QObject* o, Namespace n, Key k,
return p_->ListenPublish(o, n, k, c);
}
-auto ModuleManager::ListRTChildKeys(const QString& n,
- const QString& k) -> QContainer<Key> {
+auto ModuleManager::ListRTChildKeys(const QString& n, const QString& k)
+ -> QContainer<Key> {
return p_->ListRTChildKeys(n, k);
}
diff --git a/src/core/module/ModuleManager.h b/src/core/module/ModuleManager.h
index 2c7d3bee..6adc7810 100644
--- a/src/core/module/ModuleManager.h
+++ b/src/core/module/ModuleManager.h
@@ -58,7 +58,7 @@ using Namespace = QString;
using Key = QString;
using LPCallback = std::function<void(Namespace, Key, int, std::any)>;
-class GPGFRONTEND_CORE_EXPORT ModuleManager
+class GF_CORE_EXPORT ModuleManager
: public SingletonFunctionObject<ModuleManager> {
public:
explicit ModuleManager(int channel);
@@ -138,7 +138,7 @@ void TriggerEvent(const EventIdentifier& event_id,
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT IsModuleActivate(ModuleIdentifier) -> bool;
+auto GF_CORE_EXPORT IsModuleActivate(ModuleIdentifier) -> bool;
/**
* @brief
@@ -146,7 +146,7 @@ auto GPGFRONTEND_CORE_EXPORT IsModuleActivate(ModuleIdentifier) -> bool;
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT IsModuleExists(ModuleIdentifier) -> bool;
+auto GF_CORE_EXPORT IsModuleExists(ModuleIdentifier) -> bool;
/**
* @brief
@@ -157,9 +157,8 @@ auto GPGFRONTEND_CORE_EXPORT IsModuleExists(ModuleIdentifier) -> bool;
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT UpsertRTValue(const QString& namespace_,
- const QString& key,
- const std::any& value) -> bool;
+auto GF_CORE_EXPORT UpsertRTValue(const QString& namespace_, const QString& key,
+ const std::any& value) -> bool;
/**
* @brief
@@ -167,8 +166,8 @@ auto GPGFRONTEND_CORE_EXPORT UpsertRTValue(const QString& namespace_,
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT ListenRTPublishEvent(QObject*, Namespace, Key,
- LPCallback) -> bool;
+auto GF_CORE_EXPORT ListenRTPublishEvent(QObject*, Namespace, Key, LPCallback)
+ -> bool;
/**
* @brief
@@ -177,12 +176,12 @@ auto GPGFRONTEND_CORE_EXPORT ListenRTPublishEvent(QObject*, Namespace, Key,
* @param key
* @return QContainer<Key>
*/
-auto GPGFRONTEND_CORE_EXPORT ListRTChildKeys(
- const QString& namespace_, const QString& key) -> QContainer<Key>;
+auto GF_CORE_EXPORT ListRTChildKeys(const QString& namespace_,
+ const QString& key) -> QContainer<Key>;
template <typename T>
-auto RetrieveRTValueTyped(const QString& namespace_,
- const QString& key) -> std::optional<T> {
+auto RetrieveRTValueTyped(const QString& namespace_, const QString& key)
+ -> std::optional<T> {
auto any_value =
ModuleManager::GetInstance().RetrieveRTValue(namespace_, key);
if (any_value && any_value->type() == typeid(T)) {
@@ -193,8 +192,8 @@ auto RetrieveRTValueTyped(const QString& namespace_,
template <typename T>
auto RetrieveRTValueTypedOrDefault(const QString& namespace_,
- const QString& key,
- const T& defaultValue) -> T {
+ const QString& key, const T& defaultValue)
+ -> T {
auto any_value =
ModuleManager::GetInstance().RetrieveRTValue(namespace_, key);
if (any_value && any_value->type() == typeid(T)) {
diff --git a/src/core/thread/FileReadTask.h b/src/core/thread/FileReadTask.h
index 6a0dd2fd..a44b206a 100644
--- a/src/core/thread/FileReadTask.h
+++ b/src/core/thread/FileReadTask.h
@@ -37,7 +37,7 @@ namespace GpgFrontend::UI {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT FileReadTask : public GpgFrontend::Thread::Task {
+class GF_CORE_EXPORT FileReadTask : public GpgFrontend::Thread::Task {
Q_OBJECT
public:
explicit FileReadTask(QString path);
diff --git a/src/core/thread/Task.h b/src/core/thread/Task.h
index 0a9b0c84..b0fdc791 100644
--- a/src/core/thread/Task.h
+++ b/src/core/thread/Task.h
@@ -36,7 +36,7 @@ namespace GpgFrontend::Thread {
class TaskRunner;
-class GPGFRONTEND_CORE_EXPORT Task : public QObject, public QRunnable {
+class GF_CORE_EXPORT Task : public QObject, public QRunnable {
Q_OBJECT
public:
friend class TaskRunner;
diff --git a/src/core/thread/TaskRunner.h b/src/core/thread/TaskRunner.h
index 10f7f995..59279876 100644
--- a/src/core/thread/TaskRunner.h
+++ b/src/core/thread/TaskRunner.h
@@ -34,7 +34,7 @@
namespace GpgFrontend::Thread {
-class GPGFRONTEND_CORE_EXPORT TaskRunner : public QObject {
+class GF_CORE_EXPORT TaskRunner : public QObject {
Q_OBJECT
public:
/**
@@ -98,8 +98,8 @@ class GPGFRONTEND_CORE_EXPORT TaskRunner : public QObject {
* @return std::tuple<QPointer<Task>, TaskTrigger>
*/
auto RegisterTask(const QString&, const Task::TaskRunnable&,
- const Task::TaskCallback&,
- DataObjectPtr) -> Task::TaskHandler;
+ const Task::TaskCallback&, DataObjectPtr)
+ -> Task::TaskHandler;
/**
* @brief
diff --git a/src/core/thread/TaskRunnerGetter.h b/src/core/thread/TaskRunnerGetter.h
index dd69c888..ba7a004a 100644
--- a/src/core/thread/TaskRunnerGetter.h
+++ b/src/core/thread/TaskRunnerGetter.h
@@ -38,7 +38,7 @@ namespace GpgFrontend::Thread {
using TaskRunnerPtr = QSharedPointer<TaskRunner>;
-class GPGFRONTEND_CORE_EXPORT TaskRunnerGetter
+class GF_CORE_EXPORT TaskRunnerGetter
: public GpgFrontend::SingletonFunctionObject<TaskRunnerGetter> {
public:
enum TaskRunnerType {
diff --git a/src/core/utils/AsyncUtils.h b/src/core/utils/AsyncUtils.h
index 5be3b230..0dce9c30 100644
--- a/src/core/utils/AsyncUtils.h
+++ b/src/core/utils/AsyncUtils.h
@@ -43,10 +43,12 @@ namespace GpgFrontend {
* @param operation
* @param minimal_version
*/
-auto GPGFRONTEND_CORE_EXPORT
-RunGpgOperaAsync(int channel, const GpgOperaRunnable& runnable,
- const GpgOperationCallback& callback, const QString& operation,
- const QString& minimal_version) -> Thread::Task::TaskHandler;
+auto GF_CORE_EXPORT RunGpgOperaAsync(int channel,
+ const GpgOperaRunnable& runnable,
+ const GpgOperationCallback& callback,
+ const QString& operation,
+ const QString& minimal_version)
+ -> Thread::Task::TaskHandler;
/**
* @brief
@@ -56,9 +58,11 @@ RunGpgOperaAsync(int channel, const GpgOperaRunnable& runnable,
* @param minimal_version
* @return std::tuple<GpgError, DataObjectPtr>
*/
-auto GPGFRONTEND_CORE_EXPORT RunGpgOperaSync(
- int channel, const GpgOperaRunnable& runnable, const QString& operation,
- const QString& minimal_version) -> std::tuple<GpgError, DataObjectPtr>;
+auto GF_CORE_EXPORT RunGpgOperaSync(int channel,
+ const GpgOperaRunnable& runnable,
+ const QString& operation,
+ const QString& minimal_version)
+ -> std::tuple<GpgError, DataObjectPtr>;
/**
* @brief
@@ -67,9 +71,10 @@ auto GPGFRONTEND_CORE_EXPORT RunGpgOperaSync(
* @param callback
* @param operation
*/
-auto GPGFRONTEND_CORE_EXPORT RunIOOperaAsync(
- const OperaRunnable& runnable, const OperationCallback& callback,
- const QString& operation) -> Thread::Task::TaskHandler;
+auto GF_CORE_EXPORT RunIOOperaAsync(const OperaRunnable& runnable,
+ const OperationCallback& callback,
+ const QString& operation)
+ -> Thread::Task::TaskHandler;
/**
* @brief
@@ -79,7 +84,8 @@ auto GPGFRONTEND_CORE_EXPORT RunIOOperaAsync(
* @param operation
* @return Thread::Task::TaskHandler
*/
-auto GPGFRONTEND_CORE_EXPORT
-RunOperaAsync(const OperaRunnable& runnable, const OperationCallback& callback,
- const QString& operation) -> Thread::Task::TaskHandler;
+auto GF_CORE_EXPORT RunOperaAsync(const OperaRunnable& runnable,
+ const OperationCallback& callback,
+ const QString& operation)
+ -> Thread::Task::TaskHandler;
} // namespace GpgFrontend \ No newline at end of file
diff --git a/src/core/utils/BuildInfoUtils.cpp b/src/core/utils/BuildInfoUtils.cpp
index 3632a92a..75f1feb4 100644
--- a/src/core/utils/BuildInfoUtils.cpp
+++ b/src/core/utils/BuildInfoUtils.cpp
@@ -68,7 +68,7 @@ auto GetProjectLibarchiveVersion() -> QString {
auto GetHttpRequestUserAgent() -> QString { return HTTP_REQUEST_USER_AGENT; }
-auto GPGFRONTEND_CORE_EXPORT IsCheckReleaseCommitHash() -> bool {
+auto GF_CORE_EXPORT IsCheckReleaseCommitHash() -> bool {
return QString::fromLatin1(CHECK_RELEASE_COMMIT_HASH).toInt() == 1;
}
}; // namespace GpgFrontend \ No newline at end of file
diff --git a/src/core/utils/BuildInfoUtils.h b/src/core/utils/BuildInfoUtils.h
index 8d7f1af2..879b8ec8 100644
--- a/src/core/utils/BuildInfoUtils.h
+++ b/src/core/utils/BuildInfoUtils.h
@@ -28,8 +28,6 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend {
/**
@@ -37,84 +35,84 @@ namespace GpgFrontend {
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetProjectName() -> QString;
+auto GF_CORE_EXPORT GetProjectName() -> QString;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetProjectVersion() -> QString;
+auto GF_CORE_EXPORT GetProjectVersion() -> QString;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetProjectBuildVersion() -> QString;
+auto GF_CORE_EXPORT GetProjectBuildVersion() -> QString;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetProjectBuildTimestamp() -> QDateTime;
+auto GF_CORE_EXPORT GetProjectBuildTimestamp() -> QDateTime;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetProjectBuildGitBranchName() -> QString;
+auto GF_CORE_EXPORT GetProjectBuildGitBranchName() -> QString;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetProjectBuildGitCommitHash() -> QString;
+auto GF_CORE_EXPORT GetProjectBuildGitCommitHash() -> QString;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetProjectBuildGitVersion() -> QString;
+auto GF_CORE_EXPORT GetProjectBuildGitVersion() -> QString;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetProjectQtVersion() -> QString;
+auto GF_CORE_EXPORT GetProjectQtVersion() -> QString;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetProjectOpenSSLVersion() -> QString;
+auto GF_CORE_EXPORT GetProjectOpenSSLVersion() -> QString;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetProjectLibarchiveVersion() -> QString;
+auto GF_CORE_EXPORT GetProjectLibarchiveVersion() -> QString;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetProjectGpgMEVersion() -> QString;
+auto GF_CORE_EXPORT GetProjectGpgMEVersion() -> QString;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetHttpRequestUserAgent() -> QString;
+auto GF_CORE_EXPORT GetHttpRequestUserAgent() -> QString;
/**
* @brief
@@ -122,6 +120,6 @@ auto GPGFRONTEND_CORE_EXPORT GetHttpRequestUserAgent() -> QString;
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT IsCheckReleaseCommitHash() -> bool;
+auto GF_CORE_EXPORT IsCheckReleaseCommitHash() -> bool;
} // namespace GpgFrontend \ No newline at end of file
diff --git a/src/core/utils/CacheUtils.h b/src/core/utils/CacheUtils.h
index 7e546678..fbe67a10 100644
--- a/src/core/utils/CacheUtils.h
+++ b/src/core/utils/CacheUtils.h
@@ -28,15 +28,13 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend {
/**
* @brief set a temp cache under a certain key
*
*/
-void GPGFRONTEND_CORE_EXPORT SetCacheValue(const QString &key, QString value);
+void GF_CORE_EXPORT SetCacheValue(const QString &key, QString value);
/**
* @brief after get the temp cache, its value will be imediately ease in
@@ -44,13 +42,13 @@ void GPGFRONTEND_CORE_EXPORT SetCacheValue(const QString &key, QString value);
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetCacheValue(const QString &key) -> QString;
+auto GF_CORE_EXPORT GetCacheValue(const QString &key) -> QString;
/**
* @brief imediately ease temp cache in storage
*
* @return QString
*/
-void GPGFRONTEND_CORE_EXPORT ResetCacheValue(const QString &);
+void GF_CORE_EXPORT ResetCacheValue(const QString &);
} // namespace GpgFrontend
diff --git a/src/core/utils/CommonUtils.cpp b/src/core/utils/CommonUtils.cpp
index 569d79e1..fc5af6c8 100644
--- a/src/core/utils/CommonUtils.cpp
+++ b/src/core/utils/CommonUtils.cpp
@@ -100,16 +100,15 @@ auto GFUnStrDup(const char* s) -> QString {
return GFUnStrDup(const_cast<char*>(s));
}
-auto GPGFRONTEND_CORE_EXPORT IsFlatpakENV() -> bool {
+auto GF_CORE_EXPORT IsFlatpakENV() -> bool {
return QString::fromLocal8Bit(qgetenv("container")) == "flatpak";
}
-auto GPGFRONTEND_CORE_EXPORT IsAppImageENV() -> bool {
+auto GF_CORE_EXPORT IsAppImageENV() -> bool {
return !QString::fromLocal8Bit(qgetenv("APPIMAGE")).isEmpty();
}
-auto GPGFRONTEND_CORE_EXPORT ParseHexEncodedVersionTuple(const QString& s)
- -> int {
+auto GF_CORE_EXPORT ParseHexEncodedVersionTuple(const QString& s) -> int {
// s is a hex-encoded, unsigned int-packed version tuple,
// i.e. each byte represents one part of the version tuple
bool ok;
@@ -120,7 +119,7 @@ auto GPGFRONTEND_CORE_EXPORT ParseHexEncodedVersionTuple(const QString& s)
const auto kReEmail = QRegularExpression{
R"((?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\]))"};
-auto GPGFRONTEND_CORE_EXPORT IsEmailAddress(const QString& str) -> bool {
+auto GF_CORE_EXPORT IsEmailAddress(const QString& str) -> bool {
return kReEmail.match(str).hasMatch();
}
} // namespace GpgFrontend \ No newline at end of file
diff --git a/src/core/utils/CommonUtils.h b/src/core/utils/CommonUtils.h
index 3c56bfe5..7e875bbe 100644
--- a/src/core/utils/CommonUtils.h
+++ b/src/core/utils/CommonUtils.h
@@ -38,8 +38,7 @@ namespace GpgFrontend {
* @param fingerprint
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT BeautifyFingerprint(QString fingerprint)
- -> QString;
+auto GF_CORE_EXPORT BeautifyFingerprint(QString fingerprint) -> QString;
/**
* @brief
@@ -48,22 +47,22 @@ auto GPGFRONTEND_CORE_EXPORT BeautifyFingerprint(QString fingerprint)
* @param b
* @return int
*/
-auto GPGFRONTEND_CORE_EXPORT GFCompareSoftwareVersion(const QString &a,
- const QString &b) -> int;
+auto GF_CORE_EXPORT GFCompareSoftwareVersion(const QString &a, const QString &b)
+ -> int;
/**
* @brief
*
* @return char*
*/
-auto GPGFRONTEND_CORE_EXPORT GFStrDup(const QString &) -> char *;
+auto GF_CORE_EXPORT GFStrDup(const QString &) -> char *;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GFUnStrDup(const char *) -> QString;
+auto GF_CORE_EXPORT GFUnStrDup(const char *) -> QString;
/**
* @brief
@@ -71,7 +70,7 @@ auto GPGFRONTEND_CORE_EXPORT GFUnStrDup(const char *) -> QString;
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT IsFlatpakENV() -> bool;
+auto GF_CORE_EXPORT IsFlatpakENV() -> bool;
/**
* @brief
@@ -79,7 +78,7 @@ auto GPGFRONTEND_CORE_EXPORT IsFlatpakENV() -> bool;
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT IsAppImageENV() -> bool;
+auto GF_CORE_EXPORT IsAppImageENV() -> bool;
/**
* @brief
@@ -87,8 +86,7 @@ auto GPGFRONTEND_CORE_EXPORT IsAppImageENV() -> bool;
* @param s
* @return int
*/
-auto GPGFRONTEND_CORE_EXPORT ParseHexEncodedVersionTuple(const QString &s)
- -> int;
+auto GF_CORE_EXPORT ParseHexEncodedVersionTuple(const QString &s) -> int;
/**
* @brief
@@ -96,7 +94,7 @@ auto GPGFRONTEND_CORE_EXPORT ParseHexEncodedVersionTuple(const QString &s)
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT IsEmailAddress(const QString &) -> bool;
+auto GF_CORE_EXPORT IsEmailAddress(const QString &) -> bool;
/**
* @brief if a > b
@@ -105,7 +103,6 @@ auto GPGFRONTEND_CORE_EXPORT IsEmailAddress(const QString &) -> bool;
* @param b
* @return auto
*/
-auto GPGFRONTEND_CORE_EXPORT GFSoftwareVersionGreaterThan(const QString &a,
- const QString &b)
- -> bool;
+auto GF_CORE_EXPORT GFSoftwareVersionGreaterThan(const QString &a,
+ const QString &b) -> bool;
} // namespace GpgFrontend \ No newline at end of file
diff --git a/src/core/utils/FilesystemUtils.h b/src/core/utils/FilesystemUtils.h
index 6ab2d970..d424bd97 100644
--- a/src/core/utils/FilesystemUtils.h
+++ b/src/core/utils/FilesystemUtils.h
@@ -28,8 +28,6 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend {
/**
@@ -38,7 +36,7 @@ namespace GpgFrontend {
* @param path
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetFileExtension(const QString& path) -> QString;
+auto GF_CORE_EXPORT GetFileExtension(const QString& path) -> QString;
/**
* @brief Get the only file name with path object
@@ -46,8 +44,7 @@ auto GPGFRONTEND_CORE_EXPORT GetFileExtension(const QString& path) -> QString;
* @param path
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetOnlyFileNameWithPath(const QString& path)
- -> QString;
+auto GF_CORE_EXPORT GetOnlyFileNameWithPath(const QString& path) -> QString;
/**
* @brief Get the File Size By Path object
@@ -56,8 +53,9 @@ auto GPGFRONTEND_CORE_EXPORT GetOnlyFileNameWithPath(const QString& path)
* @param filename_pattern The pattern of the file name, e.g. "*.txt"
* @return int64_t
*/
-auto GPGFRONTEND_CORE_EXPORT GetFileSizeByPath(
- const QString& path, const QString& filename_pattern) -> int64_t;
+auto GF_CORE_EXPORT GetFileSizeByPath(const QString& path,
+ const QString& filename_pattern)
+ -> int64_t;
/**
* @brief Get the Human Readable File Size object
@@ -65,7 +63,7 @@ auto GPGFRONTEND_CORE_EXPORT GetFileSizeByPath(
* @param size
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetHumanFriendlyFileSize(int64_t size) -> QString;
+auto GF_CORE_EXPORT GetHumanFriendlyFileSize(int64_t size) -> QString;
/**
* @brief
@@ -73,7 +71,7 @@ auto GPGFRONTEND_CORE_EXPORT GetHumanFriendlyFileSize(int64_t size) -> QString;
* @param path
* @param filename_pattern
*/
-void GPGFRONTEND_CORE_EXPORT
-DeleteAllFilesByPattern(const QString& path, const QString& filename_pattern);
+void GF_CORE_EXPORT DeleteAllFilesByPattern(const QString& path,
+ const QString& filename_pattern);
} // namespace GpgFrontend \ No newline at end of file
diff --git a/src/core/utils/GpgUtils.cpp b/src/core/utils/GpgUtils.cpp
index aecfad10..ec52088d 100644
--- a/src/core/utils/GpgUtils.cpp
+++ b/src/core/utils/GpgUtils.cpp
@@ -182,8 +182,7 @@ auto SetExtensionOfOutputFileForArchive(const QString& path, GpgOperation opera,
static QContainer<KeyDatabaseInfo> gpg_key_database_info_cache;
-auto GPGFRONTEND_CORE_EXPORT GetGpgKeyDatabaseInfos()
- -> QContainer<KeyDatabaseInfo> {
+auto GF_CORE_EXPORT GetGpgKeyDatabaseInfos() -> QContainer<KeyDatabaseInfo> {
if (!gpg_key_database_info_cache.empty()) return gpg_key_database_info_cache;
auto context_index_list = Module::ListRTChildKeys("core", "gpgme.ctx.list");
@@ -221,7 +220,7 @@ auto GPGFRONTEND_CORE_EXPORT GetGpgKeyDatabaseInfos()
return gpg_key_database_info_cache;
}
-auto GPGFRONTEND_CORE_EXPORT GetGpgKeyDatabaseName(int channel) -> QString {
+auto GF_CORE_EXPORT GetGpgKeyDatabaseName(int channel) -> QString {
auto info = GetGpgKeyDatabaseInfos();
if (channel >= info.size()) return {};
return info[channel].name;
@@ -283,8 +282,8 @@ auto SearchKeyDatabasePath(const QStringList& candidate_paths) -> QString {
return {};
}
-auto GetCanonicalKeyDatabasePath(const QDir& app_path,
- const QString& path) -> QString {
+auto GetCanonicalKeyDatabasePath(const QDir& app_path, const QString& path)
+ -> QString {
auto target_path = path;
if (!QDir::isAbsolutePath(target_path)) {
target_path = app_path.absoluteFilePath(target_path);
@@ -344,8 +343,9 @@ auto GetKeyDatabaseInfoBySettings() -> QContainer<KeyDatabaseInfo> {
return key_db_infos;
}
-auto GPGFRONTEND_CORE_EXPORT ConvertKey2GpgKeyIdList(
- int channel, const GpgAbstractKeyPtrList& keys) -> KeyIdArgsList {
+auto GF_CORE_EXPORT ConvertKey2GpgKeyIdList(int channel,
+ const GpgAbstractKeyPtrList& keys)
+ -> KeyIdArgsList {
KeyIdArgsList ret;
for (const auto& key : ConvertKey2GpgKeyList(channel, keys)) {
ret.push_back(key->ID());
@@ -353,8 +353,9 @@ auto GPGFRONTEND_CORE_EXPORT ConvertKey2GpgKeyIdList(
return ret;
}
-auto GPGFRONTEND_CORE_EXPORT ConvertKey2GpgKeyList(
- int channel, const GpgAbstractKeyPtrList& keys) -> GpgKeyPtrList {
+auto GF_CORE_EXPORT ConvertKey2GpgKeyList(int channel,
+ const GpgAbstractKeyPtrList& keys)
+ -> GpgKeyPtrList {
GpgKeyPtrList recipients;
QSet<QString> s;
@@ -378,8 +379,9 @@ auto GPGFRONTEND_CORE_EXPORT ConvertKey2GpgKeyList(
return recipients;
}
-auto GPGFRONTEND_CORE_EXPORT Convert2RawGpgMEKeyList(
- int channel, const GpgAbstractKeyPtrList& keys) -> QContainer<gpgme_key_t> {
+auto GF_CORE_EXPORT Convert2RawGpgMEKeyList(int channel,
+ const GpgAbstractKeyPtrList& keys)
+ -> QContainer<gpgme_key_t> {
QContainer<gpgme_key_t> recipients;
auto g_keys = ConvertKey2GpgKeyList(channel, keys);
@@ -392,7 +394,7 @@ auto GPGFRONTEND_CORE_EXPORT Convert2RawGpgMEKeyList(
return recipients;
}
-auto GPGFRONTEND_CORE_EXPORT GetUsagesByAbstractKey(const GpgAbstractKey* key)
+auto GF_CORE_EXPORT GetUsagesByAbstractKey(const GpgAbstractKey* key)
-> QString {
QString usages;
if (key->IsHasCertCap()) usages += "C";
@@ -406,7 +408,7 @@ auto GPGFRONTEND_CORE_EXPORT GetUsagesByAbstractKey(const GpgAbstractKey* key)
return usages;
}
-auto GPGFRONTEND_CORE_EXPORT GetGpgKeyByGpgAbstractKey(GpgAbstractKey* ab_key)
+auto GF_CORE_EXPORT GetGpgKeyByGpgAbstractKey(GpgAbstractKey* ab_key)
-> GpgKey {
if (!ab_key->IsGood()) return {};
@@ -423,18 +425,17 @@ auto GPGFRONTEND_CORE_EXPORT GetGpgKeyByGpgAbstractKey(GpgAbstractKey* ab_key)
return *key;
}
-auto GPGFRONTEND_CORE_EXPORT IsKeyGroupID(const KeyId& id) -> bool {
+auto GF_CORE_EXPORT IsKeyGroupID(const KeyId& id) -> bool {
return id.startsWith("#&");
}
-auto GPGFRONTEND_CORE_EXPORT
-GpgAgentVersionGreaterThan(int channel, const QString& v) -> bool {
+auto GF_CORE_EXPORT GpgAgentVersionGreaterThan(int channel, const QString& v)
+ -> bool {
return GFSoftwareVersionGreaterThan(
GpgComponentManager::GetInstance(channel).GetGpgAgentVersion(), v);
}
-auto GPGFRONTEND_CORE_EXPORT CheckGpgVersion(int channel,
- const QString& v) -> bool {
+auto GF_CORE_EXPORT CheckGpgVersion(int channel, const QString& v) -> bool {
const auto ver =
GpgComponentManager::GetInstance(channel).GetGpgAgentVersion();
@@ -457,7 +458,7 @@ auto GPGFRONTEND_CORE_EXPORT CheckGpgVersion(int channel,
return true;
}
-auto GPGFRONTEND_CORE_EXPORT DecidePinentry() -> QString {
+auto GF_CORE_EXPORT DecidePinentry() -> QString {
#ifdef __linux__
QStringList preferred_list = {"pinentry-gnome3",
"pinentry-qt"
diff --git a/src/core/utils/GpgUtils.h b/src/core/utils/GpgUtils.h
index f005bbfc..3ba8c793 100644
--- a/src/core/utils/GpgUtils.h
+++ b/src/core/utils/GpgUtils.h
@@ -44,7 +44,7 @@ namespace GpgFrontend {
* @param err
* @return GpgError
*/
-auto GPGFRONTEND_CORE_EXPORT CheckGpgError(GpgError err) -> GpgError;
+auto GF_CORE_EXPORT CheckGpgError(GpgError err) -> GpgError;
/**
* @brief
@@ -53,8 +53,8 @@ auto GPGFRONTEND_CORE_EXPORT CheckGpgError(GpgError err) -> GpgError;
* @param comment
* @return GpgError
*/
-auto GPGFRONTEND_CORE_EXPORT CheckGpgError(GpgError gpgmeError,
- const QString& comment) -> GpgError;
+auto GF_CORE_EXPORT CheckGpgError(GpgError gpgmeError, const QString& comment)
+ -> GpgError;
/**
* @brief
@@ -63,9 +63,9 @@ auto GPGFRONTEND_CORE_EXPORT CheckGpgError(GpgError gpgmeError,
* @param predict
* @return gpg_err_code_t
*/
-auto GPGFRONTEND_CORE_EXPORT CheckGpgError2ErrCode(
- gpgme_error_t err,
- gpgme_error_t predict = GPG_ERR_NO_ERROR) -> gpg_err_code_t;
+auto GF_CORE_EXPORT CheckGpgError2ErrCode(
+ gpgme_error_t err, gpgme_error_t predict = GPG_ERR_NO_ERROR)
+ -> gpg_err_code_t;
/**
* @brief
@@ -73,7 +73,7 @@ auto GPGFRONTEND_CORE_EXPORT CheckGpgError2ErrCode(
* @param err
* @return GpgErrorDesc
*/
-auto GPGFRONTEND_CORE_EXPORT DescribeGpgErrCode(GpgError err) -> GpgErrorDesc;
+auto GF_CORE_EXPORT DescribeGpgErrCode(GpgError err) -> GpgErrorDesc;
// Check
@@ -83,7 +83,7 @@ auto GPGFRONTEND_CORE_EXPORT DescribeGpgErrCode(GpgError err) -> GpgErrorDesc;
* @param text
* @return int
*/
-auto GPGFRONTEND_CORE_EXPORT TextIsSigned(BypeArrayRef text) -> int;
+auto GF_CORE_EXPORT TextIsSigned(BypeArrayRef text) -> int;
/**
* @brief
@@ -92,9 +92,9 @@ auto GPGFRONTEND_CORE_EXPORT TextIsSigned(BypeArrayRef text) -> int;
* @param ascii
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT SetExtensionOfOutputFile(const QString& path,
- GpgOperation opera,
- bool ascii) -> QString;
+auto GF_CORE_EXPORT SetExtensionOfOutputFile(const QString& path,
+ GpgOperation opera, bool ascii)
+ -> QString;
/**
* @brief
@@ -104,8 +104,9 @@ auto GPGFRONTEND_CORE_EXPORT SetExtensionOfOutputFile(const QString& path,
* @param ascii
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT SetExtensionOfOutputFileForArchive(
- const QString& path, GpgOperation opera, bool ascii) -> QString;
+auto GF_CORE_EXPORT SetExtensionOfOutputFileForArchive(const QString& path,
+ GpgOperation opera,
+ bool ascii) -> QString;
/**
* @brief
@@ -114,15 +115,15 @@ auto GPGFRONTEND_CORE_EXPORT SetExtensionOfOutputFileForArchive(
* @param path
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetCanonicalKeyDatabasePath(
- const QDir& app_path, const QString& path) -> QString;
+auto GF_CORE_EXPORT GetCanonicalKeyDatabasePath(const QDir& app_path,
+ const QString& path) -> QString;
/**
* @brief Get the Key Databases By Settings object
*
* @return QContainer<KeyDatabaseItemSO>
*/
-auto GPGFRONTEND_CORE_EXPORT GetKeyDatabasesBySettings()
+auto GF_CORE_EXPORT GetKeyDatabasesBySettings()
-> QContainer<KeyDatabaseItemSO>;
/**
@@ -130,7 +131,7 @@ auto GPGFRONTEND_CORE_EXPORT GetKeyDatabasesBySettings()
*
* @return QContainer<KeyDatabaseInfo>
*/
-auto GPGFRONTEND_CORE_EXPORT GetKeyDatabaseInfoBySettings()
+auto GF_CORE_EXPORT GetKeyDatabaseInfoBySettings()
-> QContainer<KeyDatabaseInfo>;
/**
@@ -138,15 +139,14 @@ auto GPGFRONTEND_CORE_EXPORT GetKeyDatabaseInfoBySettings()
*
* @return QContainer<KeyDatabaseItemSO>
*/
-auto GPGFRONTEND_CORE_EXPORT GetGpgKeyDatabaseInfos()
- -> QContainer<KeyDatabaseInfo>;
+auto GF_CORE_EXPORT GetGpgKeyDatabaseInfos() -> QContainer<KeyDatabaseInfo>;
/**
* @brief
*
* @return QContainer<KeyDatabaseItemSO>
*/
-auto GPGFRONTEND_CORE_EXPORT GetGpgKeyDatabaseName(int channel) -> QString;
+auto GF_CORE_EXPORT GetGpgKeyDatabaseName(int channel) -> QString;
/**
* @brief
@@ -155,8 +155,9 @@ auto GPGFRONTEND_CORE_EXPORT GetGpgKeyDatabaseName(int channel) -> QString;
* @param keys
* @return KeyIdArgsList
*/
-auto GPGFRONTEND_CORE_EXPORT ConvertKey2GpgKeyIdList(
- int channel, const GpgAbstractKeyPtrList& keys) -> KeyIdArgsList;
+auto GF_CORE_EXPORT ConvertKey2GpgKeyIdList(int channel,
+ const GpgAbstractKeyPtrList& keys)
+ -> KeyIdArgsList;
/**
* @brief
@@ -165,8 +166,9 @@ auto GPGFRONTEND_CORE_EXPORT ConvertKey2GpgKeyIdList(
* @param keys
* @return GpgKeyPtrList
*/
-auto GPGFRONTEND_CORE_EXPORT ConvertKey2GpgKeyList(
- int channel, const GpgAbstractKeyPtrList& keys) -> GpgKeyPtrList;
+auto GF_CORE_EXPORT ConvertKey2GpgKeyList(int channel,
+ const GpgAbstractKeyPtrList& keys)
+ -> GpgKeyPtrList;
/**
* @brief
@@ -174,8 +176,9 @@ auto GPGFRONTEND_CORE_EXPORT ConvertKey2GpgKeyList(
* @param keys
* @return QContainer<gpgme_key_t>
*/
-auto GPGFRONTEND_CORE_EXPORT Convert2RawGpgMEKeyList(
- int channel, const GpgAbstractKeyPtrList& keys) -> QContainer<gpgme_key_t>;
+auto GF_CORE_EXPORT Convert2RawGpgMEKeyList(int channel,
+ const GpgAbstractKeyPtrList& keys)
+ -> QContainer<gpgme_key_t>;
/**
* @brief
@@ -183,7 +186,7 @@ auto GPGFRONTEND_CORE_EXPORT Convert2RawGpgMEKeyList(
* @param key
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetUsagesByAbstractKey(const GpgAbstractKey* key)
+auto GF_CORE_EXPORT GetUsagesByAbstractKey(const GpgAbstractKey* key)
-> QString;
/**
@@ -191,8 +194,7 @@ auto GPGFRONTEND_CORE_EXPORT GetUsagesByAbstractKey(const GpgAbstractKey* key)
*
* @return GpgKey
*/
-auto GPGFRONTEND_CORE_EXPORT GetGpgKeyByGpgAbstractKey(GpgAbstractKey*)
- -> GpgKey;
+auto GF_CORE_EXPORT GetGpgKeyByGpgAbstractKey(GpgAbstractKey*) -> GpgKey;
/**
* @brief
@@ -201,15 +203,15 @@ auto GPGFRONTEND_CORE_EXPORT GetGpgKeyByGpgAbstractKey(GpgAbstractKey*)
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT IsKeyGroupID(const KeyId& id) -> bool;
+auto GF_CORE_EXPORT IsKeyGroupID(const KeyId& id) -> bool;
/**
* @brief
*
* @return bool
*/
-auto GPGFRONTEND_CORE_EXPORT GpgAgentVersionGreaterThan(int channel,
- const QString&) -> bool;
+auto GF_CORE_EXPORT GpgAgentVersionGreaterThan(int channel, const QString&)
+ -> bool;
/**
* @brief
@@ -218,13 +220,12 @@ auto GPGFRONTEND_CORE_EXPORT GpgAgentVersionGreaterThan(int channel,
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT CheckGpgVersion(int channel,
- const QString&) -> bool;
+auto GF_CORE_EXPORT CheckGpgVersion(int channel, const QString&) -> bool;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT DecidePinentry() -> QString;
+auto GF_CORE_EXPORT DecidePinentry() -> QString;
} // namespace GpgFrontend \ No newline at end of file
diff --git a/src/core/utils/IOUtils.h b/src/core/utils/IOUtils.h
index 47aa034f..8ac0da76 100644
--- a/src/core/utils/IOUtils.h
+++ b/src/core/utils/IOUtils.h
@@ -38,7 +38,7 @@ namespace GpgFrontend {
* @param file_name
* @return GFBuffer
*/
-auto GPGFRONTEND_CORE_EXPORT ReadFileGFBuffer(const QString &file_name)
+auto GF_CORE_EXPORT ReadFileGFBuffer(const QString &file_name)
-> std::tuple<bool, GFBuffer>;
/**
@@ -49,8 +49,8 @@ auto GPGFRONTEND_CORE_EXPORT ReadFileGFBuffer(const QString &file_name)
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT WriteFileGFBuffer(const QString &file_name,
- GFBuffer data) -> bool;
+auto GF_CORE_EXPORT WriteFileGFBuffer(const QString &file_name, GFBuffer data)
+ -> bool;
/**
* @brief read file content
@@ -60,8 +60,8 @@ auto GPGFRONTEND_CORE_EXPORT WriteFileGFBuffer(const QString &file_name,
* @return true if success
* @return false if failed
*/
-auto GPGFRONTEND_CORE_EXPORT ReadFile(const QString &file_name,
- QByteArray &data) -> bool;
+auto GF_CORE_EXPORT ReadFile(const QString &file_name, QByteArray &data)
+ -> bool;
/**
* @brief write file content
@@ -71,15 +71,15 @@ auto GPGFRONTEND_CORE_EXPORT ReadFile(const QString &file_name,
* @return true if success
* @return false if failed
*/
-auto GPGFRONTEND_CORE_EXPORT WriteFile(const QString &file_name,
- const QByteArray &data) -> bool;
+auto GF_CORE_EXPORT WriteFile(const QString &file_name, const QByteArray &data)
+ -> bool;
/**
* calculate the hash of a file
* @param file_path
* @return
*/
-auto GPGFRONTEND_CORE_EXPORT CalculateHash(const QString &file_path) -> QString;
+auto GF_CORE_EXPORT CalculateHash(const QString &file_path) -> QString;
/**
* @brief
@@ -87,8 +87,7 @@ auto GPGFRONTEND_CORE_EXPORT CalculateHash(const QString &file_path) -> QString;
* @param path
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT CalculateBinaryChacksum(const QString &path)
- -> QString;
+auto GF_CORE_EXPORT CalculateBinaryChacksum(const QString &path) -> QString;
/**
* @brief
@@ -98,15 +97,15 @@ auto GPGFRONTEND_CORE_EXPORT CalculateBinaryChacksum(const QString &path)
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT
-WriteBufferToFile(const QString &path, const QString &out_buffer) -> bool;
+auto GF_CORE_EXPORT WriteBufferToFile(const QString &path,
+ const QString &out_buffer) -> bool;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetTempFilePath() -> QString;
+auto GF_CORE_EXPORT GetTempFilePath() -> QString;
/**
* @brief
@@ -114,8 +113,7 @@ auto GPGFRONTEND_CORE_EXPORT GetTempFilePath() -> QString;
* @param data
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT CreateTempFileAndWriteData(const QString &data)
- -> QString;
+auto GF_CORE_EXPORT CreateTempFileAndWriteData(const QString &data) -> QString;
/**
* @brief
@@ -123,8 +121,7 @@ auto GPGFRONTEND_CORE_EXPORT CreateTempFileAndWriteData(const QString &data)
* @param data
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT CreateTempFileAndWriteData(const GFBuffer &data)
- -> QString;
+auto GF_CORE_EXPORT CreateTempFileAndWriteData(const GFBuffer &data) -> QString;
/**
* @brief
@@ -133,7 +130,7 @@ auto GPGFRONTEND_CORE_EXPORT CreateTempFileAndWriteData(const GFBuffer &data)
* @param read
* @return std::tuple<bool, QString>
*/
-auto GPGFRONTEND_CORE_EXPORT TargetFilePreCheck(const QString &path, bool read)
+auto GF_CORE_EXPORT TargetFilePreCheck(const QString &path, bool read)
-> std::tuple<bool, QString>;
/**
@@ -142,6 +139,6 @@ auto GPGFRONTEND_CORE_EXPORT TargetFilePreCheck(const QString &path, bool read)
* @param path
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetFullExtension(QString path) -> QString;
+auto GF_CORE_EXPORT GetFullExtension(QString path) -> QString;
} // namespace GpgFrontend
diff --git a/src/core/utils/LocalizedUtils.h b/src/core/utils/LocalizedUtils.h
index 882fcfb3..7419e5a5 100644
--- a/src/core/utils/LocalizedUtils.h
+++ b/src/core/utils/LocalizedUtils.h
@@ -28,12 +28,10 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend {
-auto GPGFRONTEND_CORE_EXPORT GetLocalizedDateByTimestamp(time_t) -> QString;
+auto GF_CORE_EXPORT GetLocalizedDateByTimestamp(time_t) -> QString;
-auto GPGFRONTEND_CORE_EXPORT GetUTCDateByTimestamp(time_t) -> QString;
+auto GF_CORE_EXPORT GetUTCDateByTimestamp(time_t) -> QString;
} // namespace GpgFrontend \ No newline at end of file
diff --git a/src/core/utils/MemoryUtils.h b/src/core/utils/MemoryUtils.h
index 6c2bb69f..d83c80a5 100644
--- a/src/core/utils/MemoryUtils.h
+++ b/src/core/utils/MemoryUtils.h
@@ -28,7 +28,6 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
#include "core/function/SecureMemoryAllocator.h"
/* To avoid that a compiler optimizes certain memset calls away, these
@@ -70,14 +69,14 @@ class PointerConverter {
*
* @return void*
*/
-auto GPGFRONTEND_CORE_EXPORT SecureMalloc(std::size_t) -> void *;
+auto GF_CORE_EXPORT SecureMalloc(std::size_t) -> void *;
/**
* @brief
*
* @return void*
*/
-auto GPGFRONTEND_CORE_EXPORT SecureRealloc(void *, std::size_t) -> void *;
+auto GF_CORE_EXPORT SecureRealloc(void *, std::size_t) -> void *;
/**
* @brief
@@ -105,7 +104,7 @@ auto SecureReallocAsType(T *ptr, std::size_t size) -> T * {
* @brief
*
*/
-void GPGFRONTEND_CORE_EXPORT SecureFree(void *);
+void GF_CORE_EXPORT SecureFree(void *);
template <typename T, typename... Args>
static auto SecureCreateObject(Args &&...args) -> T * {
diff --git a/src/core/utils/aes/aes_ssl.h b/src/core/utils/aes/aes_ssl.h
index 3d027af3..83f5818d 100644
--- a/src/core/utils/aes/aes_ssl.h
+++ b/src/core/utils/aes/aes_ssl.h
@@ -31,8 +31,6 @@
#include <openssl/aes.h>
#include <openssl/evp.h>
-#include "GpgFrontend.h"
-
namespace GpgFrontend::RawAPI {
/**
diff --git a/src/sdk/CMakeLists.txt b/src/sdk/CMakeLists.txt
index 55df8fe7..56bbb825 100644
--- a/src/sdk/CMakeLists.txt
+++ b/src/sdk/CMakeLists.txt
@@ -23,30 +23,16 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
-set(CMAKE_CXX_VISIBILITY_PRESET hidden)
-set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
-
-# define libgpgfrontend_module_sdk
aux_source_directory(. MODULE_SDK_SOURCE)
aux_source_directory(private MODULE_SDK_SOURCE)
-add_library(gpgfrontend_module_sdk SHARED ${MODULE_SDK_SOURCE})
-set(_export_file_sdk "${CMAKE_CURRENT_SOURCE_DIR}/GFSDKExport.h")
-generate_export_header(gpgfrontend_module_sdk EXPORT_FILE_NAME "${_export_file_sdk}")
-target_include_directories(gpgfrontend_module_sdk PRIVATE
- ${CMAKE_CURRENT_BINARY_DIR}/gpgfrontend_module_sdk_autogen/include)
+# define sdk
+register_library(sdk LIBRARY_TARGET ${MODULE_SDK_SOURCE})
+target_include_directories(${LIBRARY_TARGET} PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR}/${LIBRARY_TARGET}_autogen/include)
-target_include_directories(gpgfrontend_module_sdk PUBLIC sdk)
+# headers
+target_include_directories(${LIBRARY_TARGET} PUBLIC sdk)
# link module system
-target_link_libraries(gpgfrontend_module_sdk PRIVATE gpgfrontend_core gpgfrontend_ui)
-
-if(XCODE_BUILD)
- set_target_properties(gpgfrontend_module_sdk
- PROPERTIES
- ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
- LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
- LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
- XCODE_ATTRIBUTE_SKIP_INSTALL "Yes"
- XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${GPGFRONTEND_XCODE_CODE_SIGN_IDENTITY}")
-endif() \ No newline at end of file
+target_link_libraries(${LIBRARY_TARGET} PRIVATE gf_core gf_ui) \ No newline at end of file
diff --git a/src/sdk/GFSDK.h b/src/sdk/GFSDK.h
index 37719afb..f21dc334 100644
--- a/src/sdk/GFSDK.h
+++ b/src/sdk/GFSDK.h
@@ -28,17 +28,15 @@
#pragma once
-#include "GFSDKExport.h"
-
extern "C" {
-void GPGFRONTEND_MODULE_SDK_EXPORT GFModuleLogTrace(const char*);
+void GF_SDK_EXPORT GFModuleLogTrace(const char*);
-void GPGFRONTEND_MODULE_SDK_EXPORT GFModuleLogDebug(const char*);
+void GF_SDK_EXPORT GFModuleLogDebug(const char*);
-void GPGFRONTEND_MODULE_SDK_EXPORT GFModuleLogInfo(const char*);
+void GF_SDK_EXPORT GFModuleLogInfo(const char*);
-void GPGFRONTEND_MODULE_SDK_EXPORT GFModuleLogWarn(const char*);
+void GF_SDK_EXPORT GFModuleLogWarn(const char*);
-void GPGFRONTEND_MODULE_SDK_EXPORT GFModuleLogError(const char*);
+void GF_SDK_EXPORT GFModuleLogError(const char*);
} \ No newline at end of file
diff --git a/src/sdk/GFSDKBasic.cpp b/src/sdk/GFSDKBasic.cpp
index 316ddd7b..21f36b59 100644
--- a/src/sdk/GFSDKBasic.cpp
+++ b/src/sdk/GFSDKBasic.cpp
@@ -112,31 +112,29 @@ auto GFAppRegisterTranslatorReader(const char* id,
: -1;
}
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFCacheSave(const char* key,
- const char* value) -> int {
+auto GF_SDK_EXPORT GFCacheSave(const char* key, const char* value) -> int {
GpgFrontend::CacheManager::GetInstance().SaveCache(GFUnStrDup(key),
GFUnStrDup(value));
return 0;
}
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFCacheGet(const char* key) -> const char* {
+auto GF_SDK_EXPORT GFCacheGet(const char* key) -> const char* {
auto value =
GpgFrontend::CacheManager::GetInstance().LoadCache(GFUnStrDup(key));
return GFStrDup(value);
}
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFCacheSaveWithTTL(const char* key,
- const char* value,
- int ttl) -> int {
+auto GF_SDK_EXPORT GFCacheSaveWithTTL(const char* key, const char* value,
+ int ttl) -> int {
GpgFrontend::CacheManager::GetInstance().SaveCache(GFUnStrDup(key),
GFUnStrDup(value), ttl);
return 0;
}
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFProjectGitCommitHash() -> const char* {
+auto GF_SDK_EXPORT GFProjectGitCommitHash() -> const char* {
return GFStrDup(GpgFrontend::GetProjectBuildGitCommitHash());
}
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFIsFlatpakENV() -> bool {
+auto GF_SDK_EXPORT GFIsFlatpakENV() -> bool {
return GpgFrontend::IsFlatpakENV();
}
diff --git a/src/sdk/GFSDKBasic.h b/src/sdk/GFSDKBasic.h
index da83b157..425f16ba 100644
--- a/src/sdk/GFSDKBasic.h
+++ b/src/sdk/GFSDKBasic.h
@@ -31,33 +31,17 @@
#include <cstddef>
#include <cstdint>
-#include "GFSDKExport.h"
+#include "GFSDKBasicModel.h"
extern "C" {
-// MAX STRLEN -> 64 MB
-constexpr int32_t kGfStrlenMax = static_cast<const int32_t>(1024 * 1024 * 32);
-
-using GFCommandExecuteCallback = void (*)(void* data, int errcode,
- const char* out, const char* err);
-
-using GFCommandExecuteContext = struct {
- char* cmd;
- int32_t argc;
- char** argv;
- GFCommandExecuteCallback cb;
- void* data; ///< must free by user
-};
-
-using GFTranslatorDataReader = int (*)(const char* locale, char** data);
-
/**
* @brief
*
* @param size
* @return void*
*/
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFAllocateMemory(uint32_t size) -> void*;
+auto GF_SDK_EXPORT GFAllocateMemory(uint32_t size) -> void*;
/**
* @brief
@@ -66,35 +50,34 @@ auto GPGFRONTEND_MODULE_SDK_EXPORT GFAllocateMemory(uint32_t size) -> void*;
* @param size
* @return void*
*/
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFReallocateMemory(void* ptr,
- uint32_t size) -> void*;
+auto GF_SDK_EXPORT GFReallocateMemory(void* ptr, uint32_t size) -> void*;
/**
* @brief
*
* @return const char*
*/
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFProjectVersion() -> const char*;
+auto GF_SDK_EXPORT GFProjectVersion() -> const char*;
/**
* @brief
*
* @return const char*
*/
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFProjectGitCommitHash() -> const char*;
+auto GF_SDK_EXPORT GFProjectGitCommitHash() -> const char*;
/**
* @brief
*
* @return const char*
*/
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFQtEnvVersion() -> const char*;
+auto GF_SDK_EXPORT GFQtEnvVersion() -> const char*;
/**
* @brief
*
*/
-void GPGFRONTEND_MODULE_SDK_EXPORT GFFreeMemory(void*);
+void GF_SDK_EXPORT GFFreeMemory(void*);
/**
* @brief
@@ -105,9 +88,10 @@ void GPGFRONTEND_MODULE_SDK_EXPORT GFFreeMemory(void*);
* @param cb
* @param data
*/
-void GPGFRONTEND_MODULE_SDK_EXPORT
-GFExecuteCommandSync(const char* cmd, int32_t argc, char** argv,
- GFCommandExecuteCallback cb, void* data);
+void GF_SDK_EXPORT GFExecuteCommandSync(const char* cmd, int32_t argc,
+ char** argv,
+ GFCommandExecuteCallback cb,
+ void* data);
/**
* @brief
@@ -115,22 +99,22 @@ GFExecuteCommandSync(const char* cmd, int32_t argc, char** argv,
* @param context_size
* @param context
*/
-void GPGFRONTEND_MODULE_SDK_EXPORT GFExecuteCommandBatchSync(
- GFCommandExecuteContext** contexts, int32_t contexts_size);
+void GF_SDK_EXPORT GFExecuteCommandBatchSync(GFCommandExecuteContext** contexts,
+ int32_t contexts_size);
/**
* @brief
*
* @return char*
*/
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFModuleStrDup(const char*) -> char*;
+auto GF_SDK_EXPORT GFModuleStrDup(const char*) -> char*;
/**
* @brief
*
* @return char*
*/
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFAppActiveLocale() -> char*;
+auto GF_SDK_EXPORT GFAppActiveLocale() -> char*;
/**
* @brief
@@ -139,8 +123,9 @@ auto GPGFRONTEND_MODULE_SDK_EXPORT GFAppActiveLocale() -> char*;
* @param size
* @return auto
*/
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFAppRegisterTranslatorReader(
- const char* id, GFTranslatorDataReader reader) -> int;
+auto GF_SDK_EXPORT GFAppRegisterTranslatorReader(const char* id,
+ GFTranslatorDataReader reader)
+ -> int;
/**
* @brief
@@ -149,8 +134,7 @@ auto GPGFRONTEND_MODULE_SDK_EXPORT GFAppRegisterTranslatorReader(
* @param value
* @return auto
*/
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFCacheSave(const char* key,
- const char* value) -> int;
+auto GF_SDK_EXPORT GFCacheSave(const char* key, const char* value) -> int;
/**
* @brief
@@ -159,9 +143,8 @@ auto GPGFRONTEND_MODULE_SDK_EXPORT GFCacheSave(const char* key,
* @param value
* @return auto
*/
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFCacheSaveWithTTL(const char* key,
- const char* value,
- int ttl) -> int;
+auto GF_SDK_EXPORT GFCacheSaveWithTTL(const char* key, const char* value,
+ int ttl) -> int;
/**
* @brief
@@ -169,7 +152,7 @@ auto GPGFRONTEND_MODULE_SDK_EXPORT GFCacheSaveWithTTL(const char* key,
* @param key
* @return const char*
*/
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFCacheGet(const char* key) -> const char*;
+auto GF_SDK_EXPORT GFCacheGet(const char* key) -> const char*;
/**
* @brief
@@ -177,5 +160,5 @@ auto GPGFRONTEND_MODULE_SDK_EXPORT GFCacheGet(const char* key) -> const char*;
* @return true
* @return false
*/
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFIsFlatpakENV() -> bool;
+auto GF_SDK_EXPORT GFIsFlatpakENV() -> bool;
} \ No newline at end of file
diff --git a/src/sdk/GFSDKBasicModel.h b/src/sdk/GFSDKBasicModel.h
new file mode 100644
index 00000000..59a00fb6
--- /dev/null
+++ b/src/sdk/GFSDKBasicModel.h
@@ -0,0 +1,51 @@
+/**
+ * Copyright (C) 2021-2024 Saturneric <[email protected]>
+ *
+ * This file is part of GpgFrontend.
+ *
+ * GpgFrontend is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GpgFrontend is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GpgFrontend. If not, see <https://www.gnu.org/licenses/>.
+ *
+ * The initial version of the source code is inherited from
+ * the gpg4usb project, which is under GPL-3.0-or-later.
+ *
+ * All the source code of GpgFrontend was modified and released by
+ * Saturneric <[email protected]> starting on May 12, 2021.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *
+ */
+
+#pragma once
+
+#include <cstddef>
+#include <cstdint>
+
+extern "C" {
+
+// MAX STRLEN -> 64 MB
+constexpr int32_t kGfStrlenMax = static_cast<const int32_t>(1024 * 1024 * 32);
+
+using GFCommandExecuteCallback = void (*)(void* data, int errcode,
+ const char* out, const char* err);
+
+using GFCommandExecuteContext = struct {
+ char* cmd;
+ int32_t argc;
+ char** argv;
+ GFCommandExecuteCallback cb;
+ void* data; ///< must free by user
+};
+
+using GFTranslatorDataReader = int (*)(const char* locale, char** data);
+} \ No newline at end of file
diff --git a/src/sdk/GFSDKExtra.h b/src/sdk/GFSDKExtra.h
index 26ab7b92..2662c7f2 100644
--- a/src/sdk/GFSDKExtra.h
+++ b/src/sdk/GFSDKExtra.h
@@ -28,12 +28,10 @@
#pragma once
-#include "GFSDKExport.h"
-
extern "C" {
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFCompareSoftwareVersion(
- const char *current_version, const char *latest_version) -> int;
+auto GF_SDK_EXPORT GFCompareSoftwareVersion(const char *current_version,
+ const char *latest_version) -> int;
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFHttpRequestUserAgent() -> const char *;
+auto GF_SDK_EXPORT GFHttpRequestUserAgent() -> const char *;
} \ No newline at end of file
diff --git a/src/sdk/GFSDKGpg.cpp b/src/sdk/GFSDKGpg.cpp
index 8ee1a4d6..9ed2aa03 100644
--- a/src/sdk/GFSDKGpg.cpp
+++ b/src/sdk/GFSDKGpg.cpp
@@ -47,10 +47,9 @@
//
#include "private/GFSDKPrivat.h"
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFGpgSignData(int channel, char** key_ids,
- int key_ids_size, char* data,
- int sign_mode, int ascii,
- GFGpgSignResult** ps) -> int {
+auto GF_SDK_EXPORT GFGpgSignData(int channel, char** key_ids, int key_ids_size,
+ char* data, int sign_mode, int ascii,
+ GFGpgSignResult** ps) -> int {
void* mem = GFAllocateMemory(sizeof(GFGpgSignResult));
if (mem == nullptr) {
*ps = nullptr;
@@ -101,8 +100,8 @@ auto GPGFRONTEND_MODULE_SDK_EXPORT GFGpgSignData(int channel, char** key_ids,
return 0;
}
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFGpgPublicKey(int channel, char* key_id,
- int ascii) -> char* {
+auto GF_SDK_EXPORT GFGpgPublicKey(int channel, char* key_id, int ascii)
+ -> char* {
auto key = GpgFrontend::GpgKeyGetter::GetInstance(channel).GetKeyPtr(
GFUnStrDup(key_id));
if (key == nullptr) return nullptr;
@@ -116,8 +115,8 @@ auto GPGFRONTEND_MODULE_SDK_EXPORT GFGpgPublicKey(int channel, char* key_id,
return GFStrDup(buffer.ConvertToQByteArray());
}
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFGpgKeyPrimaryUID(int channel, char* key_id,
- GFGpgKeyUID** ps) -> int {
+auto GF_SDK_EXPORT GFGpgKeyPrimaryUID(int channel, char* key_id,
+ GFGpgKeyUID** ps) -> int {
auto key = GpgFrontend::GpgKeyGetter::GetInstance(channel).GetKey(
GFUnStrDup(key_id));
@@ -135,9 +134,9 @@ auto GPGFRONTEND_MODULE_SDK_EXPORT GFGpgKeyPrimaryUID(int channel, char* key_id,
return 0;
}
-auto GPGFRONTEND_MODULE_SDK_EXPORT
-GFGpgEncryptData(int channel, char** key_ids, int key_ids_size, char* data,
- int ascii, GFGpgEncryptionResult** ps) -> int {
+auto GF_SDK_EXPORT GFGpgEncryptData(int channel, char** key_ids,
+ int key_ids_size, char* data, int ascii,
+ GFGpgEncryptionResult** ps) -> int {
void* mem = GFAllocateMemory(sizeof(GFGpgEncryptionResult));
if (mem == nullptr) {
*ps = nullptr;
@@ -184,8 +183,8 @@ GFGpgEncryptData(int channel, char** key_ids, int key_ids_size, char* data,
return 0;
}
-auto GPGFRONTEND_MODULE_SDK_EXPORT
-GFGpgDecryptData(int channel, char* data, GFGpgDecryptResult** ps) -> int {
+auto GF_SDK_EXPORT GFGpgDecryptData(int channel, char* data,
+ GFGpgDecryptResult** ps) -> int {
void* mem = GFAllocateMemory(sizeof(GFGpgDecryptResult));
if (mem == nullptr) {
*ps = nullptr;
@@ -221,8 +220,8 @@ GFGpgDecryptData(int channel, char* data, GFGpgDecryptResult** ps) -> int {
return 0;
}
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFGpgVerifyData(
- int channel, char* data, char* signature, GFGpgVerifyResult** ps) -> int {
+auto GF_SDK_EXPORT GFGpgVerifyData(int channel, char* data, char* signature,
+ GFGpgVerifyResult** ps) -> int {
void* mem = GFAllocateMemory(sizeof(GFGpgVerifyResult));
if (mem == nullptr) {
*ps = nullptr;
diff --git a/src/sdk/GFSDKGpg.h b/src/sdk/GFSDKGpg.h
index 8977a975..8c2c02ce 100644
--- a/src/sdk/GFSDKGpg.h
+++ b/src/sdk/GFSDKGpg.h
@@ -28,8 +28,6 @@
#pragma once
-#include "GFSDKExport.h"
-
extern "C" {
struct GFGpgSignResult {
@@ -70,10 +68,9 @@ struct GFGpgKeyUID {
* @param mode
* @return const char*
*/
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFGpgSignData(int channel, char** key_ids,
- int key_ids_size, char* data,
- int sign_mode, int ascii,
- GFGpgSignResult**) -> int;
+auto GF_SDK_EXPORT GFGpgSignData(int channel, char** key_ids, int key_ids_size,
+ char* data, int sign_mode, int ascii,
+ GFGpgSignResult**) -> int;
/**
* @brief
@@ -85,9 +82,9 @@ auto GPGFRONTEND_MODULE_SDK_EXPORT GFGpgSignData(int channel, char** key_ids,
* @param ascii
* @return int
*/
-auto GPGFRONTEND_MODULE_SDK_EXPORT
-GFGpgEncryptData(int channel, char** key_ids, int key_ids_size, char* data,
- int ascii, GFGpgEncryptionResult**) -> int;
+auto GF_SDK_EXPORT GFGpgEncryptData(int channel, char** key_ids,
+ int key_ids_size, char* data, int ascii,
+ GFGpgEncryptionResult**) -> int;
/**
* @brief
@@ -97,8 +94,8 @@ GFGpgEncryptData(int channel, char** key_ids, int key_ids_size, char* data,
* @param mode
* @return const char*
*/
-auto GPGFRONTEND_MODULE_SDK_EXPORT
-GFGpgDecryptData(int channel, char* data, GFGpgDecryptResult**) -> int;
+auto GF_SDK_EXPORT GFGpgDecryptData(int channel, char* data,
+ GFGpgDecryptResult**) -> int;
/**
* @brief
@@ -108,9 +105,8 @@ GFGpgDecryptData(int channel, char* data, GFGpgDecryptResult**) -> int;
* @param mode
* @return const char*
*/
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFGpgVerifyData(int channel, char* data,
- char* signature,
- GFGpgVerifyResult**) -> int;
+auto GF_SDK_EXPORT GFGpgVerifyData(int channel, char* data, char* signature,
+ GFGpgVerifyResult**) -> int;
/**
* @brief
@@ -120,8 +116,8 @@ auto GPGFRONTEND_MODULE_SDK_EXPORT GFGpgVerifyData(int channel, char* data,
* @param mode
* @return const char*
*/
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFGpgPublicKey(int channel, char* key_id,
- int ascii) -> char*;
+auto GF_SDK_EXPORT GFGpgPublicKey(int channel, char* key_id, int ascii)
+ -> char*;
/**
* @brief
@@ -130,6 +126,6 @@ auto GPGFRONTEND_MODULE_SDK_EXPORT GFGpgPublicKey(int channel, char* key_id,
* @param key_id
* @return GpgKeyUID
*/
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFGpgKeyPrimaryUID(int channel, char* key_id,
- GFGpgKeyUID**) -> int;
+auto GF_SDK_EXPORT GFGpgKeyPrimaryUID(int channel, char* key_id, GFGpgKeyUID**)
+ -> int;
} \ No newline at end of file
diff --git a/src/sdk/GFSDKLog.h b/src/sdk/GFSDKLog.h
index 37719afb..f21dc334 100644
--- a/src/sdk/GFSDKLog.h
+++ b/src/sdk/GFSDKLog.h
@@ -28,17 +28,15 @@
#pragma once
-#include "GFSDKExport.h"
-
extern "C" {
-void GPGFRONTEND_MODULE_SDK_EXPORT GFModuleLogTrace(const char*);
+void GF_SDK_EXPORT GFModuleLogTrace(const char*);
-void GPGFRONTEND_MODULE_SDK_EXPORT GFModuleLogDebug(const char*);
+void GF_SDK_EXPORT GFModuleLogDebug(const char*);
-void GPGFRONTEND_MODULE_SDK_EXPORT GFModuleLogInfo(const char*);
+void GF_SDK_EXPORT GFModuleLogInfo(const char*);
-void GPGFRONTEND_MODULE_SDK_EXPORT GFModuleLogWarn(const char*);
+void GF_SDK_EXPORT GFModuleLogWarn(const char*);
-void GPGFRONTEND_MODULE_SDK_EXPORT GFModuleLogError(const char*);
+void GF_SDK_EXPORT GFModuleLogError(const char*);
} \ No newline at end of file
diff --git a/src/sdk/GFSDKModule.h b/src/sdk/GFSDKModule.h
index 5d5e4d74..5e89000c 100644
--- a/src/sdk/GFSDKModule.h
+++ b/src/sdk/GFSDKModule.h
@@ -28,70 +28,36 @@
#pragma once
-#include "GFSDKExport.h"
+#include "GFSDKModuleModel.h"
extern "C" {
#include <stdint.h>
-struct GFModuleMetaData {
- const char *key;
- const char *value;
- GFModuleMetaData *next;
-};
+void GF_SDK_EXPORT GFModuleListenEvent(const char *module_id,
+ const char *event_id);
-struct GFModuleEventParam {
- const char *name;
- const char *value;
- GFModuleEventParam *next;
-};
+auto GF_SDK_EXPORT GFModuleRetrieveRTValueOrDefault(const char *namespace_,
+ const char *key,
+ const char *default_value)
+ -> const char *;
-struct GFModuleEvent {
- const char *id;
- const char *trigger_id;
- GFModuleEventParam *params;
-};
+auto GF_SDK_EXPORT GFModuleRetrieveRTValueOrDefaultBool(const char *namespace_,
+ const char *key,
+ int default_value)
+ -> const int;
-using GFModuleAPIGetModuleGFSDKVersion = auto (*)() -> const char *;
+void GF_SDK_EXPORT GFModuleUpsertRTValue(const char *namespace_,
+ const char *key, const char *vaule);
-using GFModuleAPIGetModuleQtEnvVersion = auto (*)() -> const char *;
+void GF_SDK_EXPORT GFModuleUpsertRTValueBool(const char *namespace_,
+ const char *key, int value);
-using GFModuleAPIGetModuleID = auto (*)() -> const char *;
+auto GF_SDK_EXPORT GFModuleListRTChildKeys(const char *namespace_,
+ const char *key, char ***child_keys)
+ -> int32_t;
-using GFModuleAPIGetModuleVersion = auto (*)() -> const char *;
-
-using GFModuleAPIGetModuleMetaData = auto (*)() -> GFModuleMetaData *;
-
-using GFModuleAPIRegisterModule = auto (*)() -> int;
-
-using GFModuleAPIActivateModule = auto (*)() -> int;
-
-using GFModuleAPIExecuteModule = auto (*)(GFModuleEvent *) -> int;
-
-using GFModuleAPIDeactivateModule = auto (*)() -> int;
-
-using GFModuleAPIUnregisterModule = auto (*)() -> int;
-
-void GPGFRONTEND_MODULE_SDK_EXPORT GFModuleListenEvent(const char *module_id,
- const char *event_id);
-
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFModuleRetrieveRTValueOrDefault(
- const char *namespace_, const char *key, const char *default_value) -> const
- char *;
-
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFModuleRetrieveRTValueOrDefaultBool(
- const char *namespace_, const char *key, int default_value) -> const int;
-
-void GPGFRONTEND_MODULE_SDK_EXPORT GFModuleUpsertRTValue(const char *namespace_,
- const char *key,
- const char *vaule);
-
-void GPGFRONTEND_MODULE_SDK_EXPORT
-GFModuleUpsertRTValueBool(const char *namespace_, const char *key, int value);
-
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFModuleListRTChildKeys(
- const char *namespace_, const char *key, char ***child_keys) -> int32_t;
-
-void GPGFRONTEND_MODULE_SDK_EXPORT GFModuleTriggerModuleEventCallback(
- GFModuleEvent *event, const char *module_id, GFModuleEventParam *argv);
+void GF_SDK_EXPORT GFModuleTriggerModuleEventCallback(GFModuleEvent *event,
+ const char *module_id,
+ GFModuleEventParam *argv);
}; \ No newline at end of file
diff --git a/src/sdk/GFSDKModuleModel.h b/src/sdk/GFSDKModuleModel.h
new file mode 100644
index 00000000..4ce4b6f3
--- /dev/null
+++ b/src/sdk/GFSDKModuleModel.h
@@ -0,0 +1,70 @@
+/**
+ * Copyright (C) 2021-2024 Saturneric <[email protected]>
+ *
+ * This file is part of GpgFrontend.
+ *
+ * GpgFrontend is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GpgFrontend is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GpgFrontend. If not, see <https://www.gnu.org/licenses/>.
+ *
+ * The initial version of the source code is inherited from
+ * the gpg4usb project, which is under GPL-3.0-or-later.
+ *
+ * All the source code of GpgFrontend was modified and released by
+ * Saturneric <[email protected]> starting on May 12, 2021.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *
+ */
+
+#pragma once
+
+extern "C" {
+
+struct GFModuleMetaData {
+ const char *key;
+ const char *value;
+ GFModuleMetaData *next;
+};
+
+struct GFModuleEventParam {
+ const char *name;
+ const char *value;
+ GFModuleEventParam *next;
+};
+
+struct GFModuleEvent {
+ const char *id;
+ const char *trigger_id;
+ GFModuleEventParam *params;
+};
+
+using GFModuleAPIGetModuleGFSDKVersion = auto (*)() -> const char *;
+
+using GFModuleAPIGetModuleQtEnvVersion = auto (*)() -> const char *;
+
+using GFModuleAPIGetModuleID = auto (*)() -> const char *;
+
+using GFModuleAPIGetModuleVersion = auto (*)() -> const char *;
+
+using GFModuleAPIGetModuleMetaData = auto (*)() -> GFModuleMetaData *;
+
+using GFModuleAPIRegisterModule = auto (*)() -> int;
+
+using GFModuleAPIActivateModule = auto (*)() -> int;
+
+using GFModuleAPIExecuteModule = auto (*)(GFModuleEvent *) -> int;
+
+using GFModuleAPIDeactivateModule = auto (*)() -> int;
+
+using GFModuleAPIUnregisterModule = auto (*)() -> int;
+}; \ No newline at end of file
diff --git a/src/sdk/GFSDKUI.cpp b/src/sdk/GFSDKUI.cpp
index cc08705c..2c1d02a2 100644
--- a/src/sdk/GFSDKUI.cpp
+++ b/src/sdk/GFSDKUI.cpp
@@ -37,8 +37,8 @@
#include "private/GFSDKPrivat.h"
#include "ui/UIModuleManager.h"
-auto MetaDataArrayToQMap(MetaData** meta_data_array,
- int size) -> QMap<QString, QString> {
+auto MetaDataArrayToQMap(MetaData** meta_data_array, int size)
+ -> QMap<QString, QString> {
QMap<QString, QString> map;
for (int i = 0; i < size; ++i) {
@@ -71,13 +71,13 @@ auto GFUIMountEntry(const char* id, MetaData** meta_data_array,
return 0;
}
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFUIMainWindowPtr() -> void* {
+auto GF_SDK_EXPORT GFUIMainWindowPtr() -> void* {
return GpgFrontend::UI::UIModuleManager::GetInstance().GetQObject(
"main_window");
}
-auto GPGFRONTEND_MODULE_SDK_EXPORT
-GFUIShowDialog(void* dialog_raw_ptr, void* parent_raw_ptr) -> bool {
+auto GF_SDK_EXPORT GFUIShowDialog(void* dialog_raw_ptr, void* parent_raw_ptr)
+ -> bool {
if (dialog_raw_ptr == nullptr) {
LOG_E() << "dialog raw ptr is nullptr";
return false;
@@ -127,8 +127,8 @@ GFUIShowDialog(void* dialog_raw_ptr, void* parent_raw_ptr) -> bool {
return true;
}
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFUICreateGUIObject(QObjectFactory factory,
- void* data) -> void* {
+auto GF_SDK_EXPORT GFUICreateGUIObject(QObjectFactory factory, void* data)
+ -> void* {
QEventLoop loop;
void* object = nullptr;
diff --git a/src/sdk/GFSDKUI.h b/src/sdk/GFSDKUI.h
index f9307cee..f10882de 100644
--- a/src/sdk/GFSDKUI.h
+++ b/src/sdk/GFSDKUI.h
@@ -28,28 +28,20 @@
#pragma once
-#include "GFSDKExport.h"
+#include "GFSDKUIModel.h"
extern "C" {
-using QObjectFactory = void* (*)(void*);
+auto GF_SDK_EXPORT GFUIMountEntry(const char* id, MetaData** meta_data_array,
+ int meta_data_array_size,
+ QObjectFactory factory) -> int;
-struct MetaData {
- const char* key;
- const char* value;
-};
+auto GF_SDK_EXPORT GFUICreateGUIObject(QObjectFactory factory, void* data)
+ -> void*;
-auto GPGFRONTEND_MODULE_SDK_EXPORT
-GFUIMountEntry(const char* id, MetaData** meta_data_array,
- int meta_data_array_size, QObjectFactory factory) -> int;
+auto GF_SDK_EXPORT GFUIMainWindowPtr() -> void*;
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFUICreateGUIObject(QObjectFactory factory,
- void* data) -> void*;
+auto GF_SDK_EXPORT GFUIActiveWindowPtr() -> void*;
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFUIMainWindowPtr() -> void*;
-
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFUIActiveWindowPtr() -> void*;
-
-auto GPGFRONTEND_MODULE_SDK_EXPORT GFUIShowDialog(void* dialog,
- void* parent) -> bool;
+auto GF_SDK_EXPORT GFUIShowDialog(void* dialog, void* parent) -> bool;
} \ No newline at end of file
diff --git a/src/signal.cpp b/src/sdk/GFSDKUIModel.h
index 17852dcd..0cc3366b 100644
--- a/src/signal.cpp
+++ b/src/sdk/GFSDKUIModel.h
@@ -26,4 +26,14 @@
*
*/
-#include "GpgFrontend.h"
+#pragma once
+
+extern "C" {
+
+using QObjectFactory = void* (*)(void*);
+
+struct MetaData {
+ const char* key;
+ const char* value;
+};
+} \ No newline at end of file
diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt
index 52ad9c07..7b413283 100644
--- a/src/test/CMakeLists.txt
+++ b/src/test/CMakeLists.txt
@@ -32,27 +32,10 @@ aux_source_directory(./core TEST_SOURCE)
aux_source_directory(. TEST_SOURCE)
# define test library
-add_library(gpgfrontend_test SHARED ${TEST_SOURCE})
-
-# generate headers
-set(_export_file "${CMAKE_CURRENT_SOURCE_DIR}/GpgFrontendTestExport.h")
-generate_export_header(gpgfrontend_test EXPORT_FILE_NAME "${_export_file}")
-
-# compile definitions
-target_compile_definitions(gpgfrontend_test PRIVATE GF_TEST_PRIVATE)
+register_library(test LIBRARY_TARGET ${TEST_SOURCE})
# link options
-target_link_libraries(gpgfrontend_test PRIVATE GTest::gtest)
-target_link_libraries(gpgfrontend_test PRIVATE gpgfrontend_core)
-
-if(XCODE_BUILD)
- set_target_properties(gpgfrontend_test
- PROPERTIES
- ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
- LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
- LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
- XCODE_ATTRIBUTE_SKIP_INSTALL "Yes"
- XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${GPGFRONTEND_XCODE_CODE_SIGN_IDENTITY}")
-endif()
+target_link_libraries(${LIBRARY_TARGET} PRIVATE GTest::gtest)
+target_link_libraries(${LIBRARY_TARGET} PRIVATE gf_core)
-add_test(AllTestsInGpgFrontend gpgfrontend_test)
+add_test(AllTestsInGpgFrontend ${LIBRARY_TARGET})
diff --git a/src/test/GpgFrontendTest.h b/src/test/GpgFrontendTest.h
index 16534656..fa9e4da1 100644
--- a/src/test/GpgFrontendTest.h
+++ b/src/test/GpgFrontendTest.h
@@ -28,12 +28,6 @@
#pragma once
-// project base header
-#include "GpgFrontend.h"
-
-// symbol exports header
-#include "test/GpgFrontendTestExport.h"
-
// private declare area of test
#ifdef GF_TEST_PRIVATE
@@ -71,6 +65,6 @@ struct GpgFrontendContext {
char **argv;
};
-auto GPGFRONTEND_TEST_EXPORT ExecuteAllTestCase(GpgFrontendContext args) -> int;
+auto GF_TEST_EXPORT ExecuteAllTestCase(GpgFrontendContext args) -> int;
} // namespace GpgFrontend::Test
diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt
index e8862bd0..40b006b8 100644
--- a/src/ui/CMakeLists.txt
+++ b/src/ui/CMakeLists.txt
@@ -40,45 +40,19 @@ aux_source_directory(dialog UI_SOURCE)
aux_source_directory(function UI_SOURCE)
aux_source_directory(model UI_SOURCE)
-# define libgpgfrontend_ui
-set(CMAKE_CXX_VISIBILITY_PRESET hidden)
-set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
-
-add_library(gpgfrontend_ui SHARED ${UI_SOURCE})
-
-# generate headers
-set(_export_file "${CMAKE_CURRENT_SOURCE_DIR}/GpgFrontendUIExport.h")
-generate_export_header(gpgfrontend_ui EXPORT_FILE_NAME "${_export_file}")
-
-# compile definitions
-target_compile_definitions(gpgfrontend_ui PRIVATE GF_UI_PRIVATE)
+# register module
+register_library(ui LIBRARY_TARGET ${UI_SOURCE})
# link qt
-target_link_libraries(gpgfrontend_ui
+target_link_libraries(${LIBRARY_TARGET}
Qt::Core Qt::Widgets Qt::Network Qt::PrintSupport)
# link gpgfrontend_core
-target_link_libraries(gpgfrontend_ui gpgfrontend_core)
+target_link_libraries(${LIBRARY_TARGET} gf_core)
# set up pch
-target_precompile_headers(gpgfrontend_ui PUBLIC GpgFrontendUI.h)
+target_precompile_headers(${LIBRARY_TARGET} PUBLIC GpgFrontendUI.h)
# add ui generator include path
-target_include_directories(gpgfrontend_ui PUBLIC
- ${CMAKE_CURRENT_BINARY_DIR}/gpgfrontend_ui_autogen/include)
-
-# using std c++ 17
-target_compile_features(gpgfrontend_ui PUBLIC cxx_std_17)
-
-# for xcode archive build
-if(XCODE_BUILD)
- set_target_properties(gpgfrontend_ui
- PROPERTIES
- ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
- LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
- LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
- XCODE_ATTRIBUTE_SKIP_INSTALL "Yes"
- XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${GPGFRONTEND_XCODE_CODE_SIGN_IDENTITY}")
-endif()
-
-target_compile_features(gpgfrontend_ui PUBLIC cxx_std_17) \ No newline at end of file
+target_include_directories(${LIBRARY_TARGET} PUBLIC
+ ${CMAKE_CURRENT_BINARY_DIR}/${LIBRARY_TARGET}_autogen/include)
diff --git a/src/ui/GpgFrontendApplication.h b/src/ui/GpgFrontendApplication.h
index a48d636b..f2850c96 100644
--- a/src/ui/GpgFrontendApplication.h
+++ b/src/ui/GpgFrontendApplication.h
@@ -32,7 +32,7 @@
namespace GpgFrontend::UI {
-class GPGFRONTEND_UI_EXPORT GpgFrontendApplication : public QApplication {
+class GF_UI_EXPORT GpgFrontendApplication : public QApplication {
Q_OBJECT
public:
/**
diff --git a/src/ui/GpgFrontendUI.h b/src/ui/GpgFrontendUI.h
index 6eac6b16..d8097b08 100644
--- a/src/ui/GpgFrontendUI.h
+++ b/src/ui/GpgFrontendUI.h
@@ -28,15 +28,9 @@
#pragma once
-// project base header
-#include "GpgFrontend.h"
-
// qt
#include <QtWidgets>
-// ui symbol exports macro
-#include "ui/GpgFrontendUIExport.h"
-
// private declare area of ui
#ifdef GF_UI_PRIVATE
diff --git a/src/ui/GpgFrontendUIInit.cpp b/src/ui/GpgFrontendUIInit.cpp
index 498640c5..cf7a589f 100644
--- a/src/ui/GpgFrontendUIInit.cpp
+++ b/src/ui/GpgFrontendUIInit.cpp
@@ -272,7 +272,7 @@ auto RunGpgFrontendUI(QApplication* app) -> int {
return QApplication::exec();
}
-void GPGFRONTEND_UI_EXPORT DestroyGpgFrontendUI() {}
+void GF_UI_EXPORT DestroyGpgFrontendUI() {}
/**
* @brief setup the locale and load the translations
diff --git a/src/ui/GpgFrontendUIInit.h b/src/ui/GpgFrontendUIInit.h
index afdbc2ab..7c139c1a 100644
--- a/src/ui/GpgFrontendUIInit.h
+++ b/src/ui/GpgFrontendUIInit.h
@@ -36,35 +36,35 @@ namespace GpgFrontend::UI {
* @brief
*
*/
-void GPGFRONTEND_UI_EXPORT PreInitGpgFrontendUI();
+void GF_UI_EXPORT PreInitGpgFrontendUI();
/**
* @brief init the UI library
*
*/
-void GPGFRONTEND_UI_EXPORT InitGpgFrontendUI(QApplication *);
+void GF_UI_EXPORT InitGpgFrontendUI(QApplication *);
/**
* @brief
*
*/
-void GPGFRONTEND_UI_EXPORT WaitingAllInitializationFinished();
+void GF_UI_EXPORT WaitingAllInitializationFinished();
/**
* @brief init the UI library
*
*/
-void GPGFRONTEND_UI_EXPORT DestroyGpgFrontendUI();
+void GF_UI_EXPORT DestroyGpgFrontendUI();
/**
* @brief run main window
*/
-auto GPGFRONTEND_UI_EXPORT RunGpgFrontendUI(QApplication *) -> int;
+auto GF_UI_EXPORT RunGpgFrontendUI(QApplication *) -> int;
/**
* @brief
*
*/
-void GPGFRONTEND_UI_EXPORT InitModulesTranslations();
+void GF_UI_EXPORT InitModulesTranslations();
}; // namespace GpgFrontend::UI
diff --git a/src/ui/UIModuleManager.h b/src/ui/UIModuleManager.h
index fbe9fae2..97a2068f 100644
--- a/src/ui/UIModuleManager.h
+++ b/src/ui/UIModuleManager.h
@@ -28,11 +28,10 @@
#pragma once
-#include "GpgFrontendUIExport.h"
#include "core/function/basic/GpgFunctionObject.h"
#include "core/module/Module.h"
-#include "sdk/GFSDKBasic.h"
-#include "sdk/GFSDKUI.h"
+#include "sdk/GFSDKBasicModel.h"
+#include "sdk/GFSDKUIModel.h"
#include "ui/struct/UIMountPoint.h"
namespace GpgFrontend::UI {
@@ -47,15 +46,16 @@ struct MountedUIEntry {
[[nodiscard]] auto GetWidget() const -> QWidget*;
- [[nodiscard]] auto GetMetaDataByDefault(
- const QString& key, QString default_value) const -> QString;
+ [[nodiscard]] auto GetMetaDataByDefault(const QString& key,
+ QString default_value) const
+ -> QString;
};
struct ModuleTranslatorInfo {
GFTranslatorDataReader reader_;
};
-class GPGFRONTEND_UI_EXPORT UIModuleManager
+class GF_UI_EXPORT UIModuleManager
: public SingletonFunctionObject<UIModuleManager> {
public:
/**