From 7aee0d0b6816d28142796011b69c0da2adc79da4 Mon Sep 17 00:00:00 2001 From: Oleksandr Kunichik Date: Thu, 15 Oct 2020 19:15:08 +0300 Subject: [PATCH 1/4] Drop Windows OS support (#309) --- .appveyor.yml | 71 ----------- CMakeLists.txt | 7 +- README.md | 1 - ci/appveyor/setup_cmake.bat | 13 -- cmake/faceliftMacros.cmake | 20 +-- codegen/facelift/facelift-codegen.py | 120 +++++++----------- codegen/facelift/templates/Enum.template.h | 4 +- .../facelift/templates/IPCAdapter.template.h | 4 +- .../facelift/templates/IPCCommon.template.h | 4 +- .../IPCDBusServiceAdapter.template.h | 4 +- .../facelift/templates/IPCProxy.template.h | 6 +- .../templates/IPCProxyAdapter.template.h | 4 +- .../templates/IPCServiceAdapter.template.h | 4 +- .../templates/ImplementationBase.template.h | 4 +- .../ImplementationBaseQML.template.h | 6 +- codegen/facelift/templates/Module.template.h | 4 +- .../facelift/templates/ModuleIPC.template.h | 4 +- .../facelift/templates/QMLAdapter.template.h | 4 +- codegen/facelift/templates/Service.template.h | 6 +- .../templates/ServiceMonitor.template.h | 4 +- .../templates/ServiceWrapper.template.h | 4 +- codegen/facelift/templates/Struct.template.h | 4 +- .../templates/StructQObjectWrapper.template.h | 4 +- src/common/CMakeLists.txt | 2 - src/common/FaceliftUtils.cpp | 38 ------ src/common/FaceliftUtils.h | 6 - src/ipc/dbus/CMakeLists.txt | 6 +- src/ipc/dbus/DBusIPCCommon.h | 8 +- src/ipc/dbus/DBusIPCMessage.h | 8 +- src/ipc/dbus/DBusIPCProxy.h | 6 - src/ipc/dbus/DBusIPCProxyBinder.h | 8 +- src/ipc/dbus/DBusManager.h | 8 +- src/ipc/dbus/DBusManagerInterface.h | 8 +- src/ipc/dbus/DBusObjectRegistry.h | 2 +- src/ipc/dbus/DBusRequestHandler.h | 8 +- src/ipc/dbus/IPCDBusServiceAdapter.h | 6 - src/ipc/dbus/IPCDBusServiceAdapterBase.h | 8 +- .../ipc-common/AppendDBUSSignatureFunction.h | 8 +- src/ipc/ipc-common/DBusSignatureHelper.h | 8 +- src/ipc/ipc-common/IPCAdapterFactoryManager.h | 8 +- .../IPCAdapterModelPropertyHandler.h | 6 - .../ipc-common/IPCAttachedPropertyFactory.h | 8 +- src/ipc/ipc-common/IPCProxy.h | 6 - src/ipc/ipc-common/IPCProxyBase.h | 6 - src/ipc/ipc-common/IPCProxyBaseBase.h | 8 +- src/ipc/ipc-common/IPCProxyBinderBase.h | 8 +- src/ipc/ipc-common/IPCProxyModelProperty.h | 6 - src/ipc/ipc-common/IPCProxyNewBase.h | 8 +- src/ipc/ipc-common/IPCServiceAdapter.h | 6 - src/ipc/ipc-common/IPCServiceAdapterBase.h | 8 +- src/ipc/ipc-common/IPCTypeHandler.h | 6 - src/ipc/ipc-common/IPCTypeRegisterHandler.h | 6 - src/ipc/ipc-common/InputPayLoad.h | 8 +- src/ipc/ipc-common/InterfaceManager.h | 8 +- .../ipc-common/InterfaceManagerInterface.h | 8 +- src/ipc/ipc-common/LocalProviderBinder.h | 6 - .../ipc-common/LocalProviderBinderBase.cpp | 6 - src/ipc/ipc-common/LocalProviderBinderBase.h | 6 - src/ipc/ipc-common/ModuleIPCBase.h | 8 +- src/ipc/ipc-common/NewIPCServiceAdapterBase.h | 8 +- src/ipc/ipc-common/NotAvailableImpl.h | 6 - src/ipc/ipc-common/NotAvailableImplBase.h | 8 +- src/ipc/ipc-common/OutputPayLoad.h | 8 +- .../ipc-common/SerializeParameterFunction.h | 6 - src/ipc/ipc-common/StaticArrayReference.h | 6 - src/ipc/ipc-common/ipc-common.h | 8 +- src/ipc/ipc-common/ipc-serialization.h | 6 - src/ipc/local/FaceliftIPCCommon.h | 8 +- src/ipc/local/LocalIPC-serialization.h | 6 - src/ipc/local/LocalIPCMessage.h | 8 +- src/ipc/local/LocalIPCProxy.h | 6 - src/ipc/local/LocalIPCProxyBase.h | 8 +- src/ipc/local/LocalIPCProxyBinder.h | 8 +- src/ipc/local/LocalIPCRegistry.h | 8 +- src/ipc/local/LocalIPCRequestHandler.h | 8 +- src/ipc/local/LocalIPCServiceAdapter.h | 6 - src/ipc/local/LocalIPCServiceAdapterBase.h | 8 +- src/model/AsyncAnswer.h | 6 - src/model/BinarySeralizer.h | 2 +- src/model/FaceliftCommon.h | 10 +- src/model/FaceliftEnum.h | 6 - src/model/FaceliftModel.h | 6 - src/model/InterfaceBase.h | 10 +- src/model/Model.h | 6 - src/model/ModelBase.h | 8 +- src/model/ModelListModelBase.h | 2 +- src/model/ModelPropertyInterface.h | 6 - src/model/ModelQMLImplementationBase.h | 2 +- src/model/ModuleBase.h | 8 +- src/model/PropertyBase.h | 2 +- src/model/PropertyInit.h | 8 +- src/model/PropertyInterface.h | 6 - src/model/QMLAdapterBase.h | 2 +- src/model/QMLImplListProperty.h | 6 - src/model/QMLImplListPropertyBase.h | 8 +- src/model/QMLImplMapProperty.h | 6 - src/model/QMLImplMapPropertyBase.h | 8 +- .../QMLModelImplementationFrontendBase.h | 2 +- src/model/QObjectWrapperPointerBase.h | 2 +- src/model/ServicePropertyInterface.h | 6 - src/model/ServiceWrapperBase.h | 2 +- src/model/StringConversionHandler.h | 2 +- src/model/StructQObjectWrapper.h | 6 - src/model/StructQObjectWrapperBase.h | 8 +- src/model/Structure.h | 6 - src/model/StructureBase.h | 8 +- src/model/StructureFactoryBase.h | 8 +- src/model/TAsyncAnswerMaster.h | 6 - src/model/TQMLImplListProperty.h | 6 - src/model/TQMLImplMapProperty.h | 6 - src/model/TypeHandlerBase.h | 2 +- tests/CMakeLists.txt | 4 +- 112 files changed, 127 insertions(+), 779 deletions(-) delete mode 100644 .appveyor.yml delete mode 100644 ci/appveyor/setup_cmake.bat delete mode 100644 src/common/FaceliftUtils.cpp diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 1e44deda..00000000 --- a/.appveyor.yml +++ /dev/null @@ -1,71 +0,0 @@ -environment: - matrix: - - COMPILER: MSVC_15 - ARCHITECTURE: x64 - BUILD_TESTS: true - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - - COMPILER: MSVC_15 - ARCHITECTURE: x86 - BUILD_TESTS: true - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - - COMPILER: MINGW_73 - ARCHITECTURE: x64 - BUILD_TESTS: true - - COMPILER: MINGW_532 - ARCHITECTURE: x86 - BUILD_TESTS: true - -build: - verbosity: detailed - parallel: true - -install: - - cd %APPVEYOR_BUILD_FOLDER% - - git submodule update --init --recursive - - mkdir C:\projects\deps - - cd C:\projects\deps - - ####################################################################################### - # Install Ninja - ####################################################################################### - - set NINJA_URL="https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip" - - appveyor DownloadFile %NINJA_URL% -FileName ninja.zip - - 7z x ninja.zip -oC:\projects\deps\ninja > nul - - set PATH=C:\projects\deps\ninja;%PATH% - - ninja --version - - ####################################################################################### - # Install doxygen - ####################################################################################### - - ps: >- - If ($env:BUILD_DOCU -Match "true") { - $env:DOXYGEN_URL="http://ftp.stack.nl/pub/users/dimitri/doxygen-1.8.10.windows.bin.zip" - appveyor DownloadFile $env:DOXYGEN_URL -FileName doxygen.zip - 7z x doxygen.zip -oC:/projects/deps/doxygen-1.8.10 > $null - $env:PATH="C:/projects/deps/doxygen-1.8.10;$env:PATH" - doxygen --version - } - - ####################################################################################### - # Update CMake - ####################################################################################### - - cd %APPVEYOR_BUILD_FOLDER% - - cmd: ci\appveyor\setup_cmake.bat - -before_build: - - cmd: cd %APPVEYOR_BUILD_FOLDER% - - cmd: set PATH=C:\Python37-x64;%PATH% - - cmd: python -m pip install antlr4-python3-runtime six pyyaml click typing watchdog path.py jinja2==2.10.3 - - IF "%ARCHITECTURE%" == "x64" IF "%COMPILER%" == "MSVC_15" set PATH=C:\Qt\5.12\msvc2017_64\bin;%PATH% - - IF "%ARCHITECTURE%" == "x64" IF "%COMPILER%" == "MSVC_15" call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\vsdevcmd.bat" -arch=x64 -host_arch=x64 - - IF "%ARCHITECTURE%" == "x86" IF "%COMPILER%" == "MSVC_15" set PATH=C:\Qt\5.12\msvc2017\bin;%PATH% - - IF "%ARCHITECTURE%" == "x86" IF "%COMPILER%" == "MSVC_15" call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\vsdevcmd.bat" -arch=x86 -host_arch=x64 - - IF "%ARCHITECTURE%" == "x64" IF "%COMPILER%" == "MINGW_73" set PATH=C:\Qt\Tools\mingw730_64\bin;C:\Qt\5.12\mingw73_64\bin;%PATH% - - IF "%ARCHITECTURE%" == "x86" IF "%COMPILER%" == "MINGW_532" set PATH=C:\Qt\Tools\mingw530_32\bin;C:\Qt\5.11.3\mingw53_32\bin;%PATH% - -build_script: - - mkdir build - - cd build - - cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DFACELIFT_BUILD_TESTS=%BUILD_TESTS% -DFACELIFT_DISABLE_GTEST=ON - - ninja - # - if "%BUILD_TESTS%" == "true" (ctest) # when you want to run the tests, use this uncomment this line diff --git a/CMakeLists.txt b/CMakeLists.txt index 741e71aa..e3787520 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,14 +93,9 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) function(add_example_script NAME MAIN_QML_FILE) set(QML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${MAIN_QML_FILE}) - if(WIN32) - configure_file(${PROJECT_SOURCE_DIR}/examples/launch-example.bat.in ${PROJECT_BINARY_DIR}/examples/launch-${NAME}.bat @ONLY) - else() - configure_file(${PROJECT_SOURCE_DIR}/examples/launch-example.sh ${PROJECT_BINARY_DIR}/examples/launch-${NAME}.sh @ONLY) - endif() + configure_file(${PROJECT_SOURCE_DIR}/examples/launch-example.sh ${PROJECT_BINARY_DIR}/examples/launch-${NAME}.sh @ONLY) endfunction() - add_subdirectory(src) if(FACELIFT_BUILD_EXAMPLES) diff --git a/README.md b/README.md index de717207..0f00273d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ [![Travis status](https://travis-ci.com/Pelagicore/facelift.svg?branch=master)](https://travis-ci.com/Pelagicore/facelift) -[![Appveyor status](https://ci.appveyor.com/api/projects/status/github/pelagicore/facelift?svg=true&branch=master)](https://ci.appveyor.com/project/weimerb/facelift-vum0d) # Motivation diff --git a/ci/appveyor/setup_cmake.bat b/ci/appveyor/setup_cmake.bat deleted file mode 100644 index 72479455..00000000 --- a/ci/appveyor/setup_cmake.bat +++ /dev/null @@ -1,13 +0,0 @@ -@rem Update CMake (we just delete the old CMake files and copy the new ones) - -@echo off - -cmake --version -cd "C:\Program Files (x86)" -rmdir "CMake" /s /q -set CMAKE_URL="https://cmake.org/files/v3.17/cmake-3.17.2-win32-x86.zip" -appveyor DownloadFile %CMAKE_URL% -FileName cmake.zip -7z x cmake.zip -o. > nul -move cmake-3.17.2-win32-x86 CMake -del cmake.zip /q /f -cmake --version diff --git a/cmake/faceliftMacros.cmake b/cmake/faceliftMacros.cmake index 615c3d0c..c3005c9e 100644 --- a/cmake/faceliftMacros.cmake +++ b/cmake/faceliftMacros.cmake @@ -17,12 +17,6 @@ endif() include(GNUInstallDirs) # for standard installation locations include(CMakePackageConfigHelpers) -# find_package(PythonInterp) causes some issues if another version has been searched before, and it is not needed anyway on non-Win32 platforms -if(WIN32) - find_package(PythonInterp 3.0 REQUIRED) - set(FACELIFT_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE}) -endif() - if(ENABLE_LTO) cmake_minimum_required(VERSION 3.9.0) include(CheckIPOSupported) @@ -203,10 +197,6 @@ function(facelift_generate_code ) list(APPEND BASE_CODEGEN_COMMAND "--dependency" "${IMPORT_FOLDER}") endforeach() - if(ARGUMENT_LIBRARY_NAME) - list(APPEND BASE_CODEGEN_COMMAND "--library" "${ARGUMENT_LIBRARY_NAME}") - endif() - if(ARGUMENT_GENERATE_ALL) list(APPEND BASE_CODEGEN_COMMAND "--all") endif() @@ -267,11 +257,8 @@ function(facelift_add_interface TARGET_NAME) set(GENERATED_HEADERS_INSTALLATION_LOCATION ${FACELIFT_GENERATED_HEADERS_INSTALLATION_LOCATION}/${LIBRARY_NAME}) - if(WIN32) - set(OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/facelift_generated/${LIBRARY_NAME}) # There is a weird issue on Windows related to the MOC if the generated files are outside of ${CMAKE_CURRENT_BINARY_DIR} - else() - set(OUTPUT_PATH ${CMAKE_BINARY_DIR}/facelift_generated/${LIBRARY_NAME}) # Keep generated file folder outside of CMAKE_CURRENT_BINARY_DIR to avoid having the MOC generated file inside the same folder, which would cause unnecessary recompiles - endif() + set(OUTPUT_PATH ${CMAKE_BINARY_DIR}/facelift_generated/${LIBRARY_NAME}) # Keep generated file folder outside of CMAKE_CURRENT_BINARY_DIR to avoid having the MOC generated file inside the same folder, which would cause unnecessary recompiles + set(TYPES_OUTPUT_PATH ${OUTPUT_PATH}/types) set(DEVTOOLS_OUTPUT_PATH ${OUTPUT_PATH}/devtools) @@ -975,8 +962,7 @@ function(facelift_add_qml_plugin PLUGIN_NAME) file(WRITE ${CMAKE_BINARY_DIR}/${INSTALL_PATH}/qmldir "${QMLDIR_CONTENT}") file(WRITE ${CMAKE_BINARY_DIR}/${INSTALL_PATH}/qmldir.installed "${QMLDIR_CONTENT}") - if(NOT CMAKE_CROSSCOMPILING AND NOT WIN32) - # not supported for now on Win32 since the required libraries can't be loaded without setting the PATH variable + if(NOT CMAKE_CROSSCOMPILING) add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/${INSTALL_PATH}/plugins.qmltypes COMMAND ${_qt5Core_install_prefix}/bin/qmlplugindump -noinstantiate ${URI} ${PLUGIN_MAJOR_VERSION}.${PLUGIN_MINOR_VERSION} ${CMAKE_BINARY_DIR}/imports -output ${CMAKE_BINARY_DIR}/${INSTALL_PATH}/plugins.qmltypes || touch ${CMAKE_BINARY_DIR}/${INSTALL_PATH}/plugins.qmltypes diff --git a/codegen/facelift/facelift-codegen.py b/codegen/facelift/facelift-codegen.py index e8711592..3258a215 100755 --- a/codegen/facelift/facelift-codegen.py +++ b/codegen/facelift/facelift-codegen.py @@ -93,17 +93,6 @@ def namespaceCppClose(symbol): ns = '} ' * len(parts) return ns -def classExportDefines(libraryName): - defines = "#if defined(" + libraryName + "_LIBRARY)\n" - defines += "# define " + libraryName + "_EXPORT Q_DECL_EXPORT\n" - defines += "#else\n" - defines += "# define " + libraryName + "_EXPORT Q_DECL_IMPORT\n" - defines += "#endif" - return defines - -def classExport(libraryName): - return libraryName + "_EXPORT" - def cppTypeFromSymbol(type, isInterfaceType): if type.is_void or type.is_primitive: if type.name == 'string': @@ -324,19 +313,7 @@ def hasReturnValue(self): def addFileNameToNoMocList(noMocListFile, filePath, fileName): noMocListFile.write(' ' + os.path.join(filePath, fileName) + '\n') -def generateFile(generator, tmpPath, templatePath, context, libraryName, libraryType): - if libraryName: - name = libraryName - if libraryType: - name = libraryName + "_" + libraryType - context.update({'classExportDefines': classExportDefines(name)}) - context.update({'classExport': classExport(name)}) - else: - context.update({'classExportDefines': ""}) - context.update({'classExport': ""}) - generator.write(tmpPath, templatePath, context) - -def run_generation(input, output, dependency, libraryName, all, noMocFilePath, noMocListFile): +def run_generation(input, output, dependency, all, noMocFilePath, noMocListFile): global generateAsyncProxy global generateAll generateAll = all @@ -365,16 +342,16 @@ def run_generation(input, output, dependency, libraryName, all, noMocFilePath, n module_path = '/'.join(module.name_parts) log.debug('process module %s' % module.module_name) ctx.update({'path': module_path}) - generateFile(generator, 'module/{{path}}/ModulePrivate.h', 'ModulePrivate.template.h', ctx, libraryName, "") + generator.write('module/{{path}}/ModulePrivate.h', 'ModulePrivate.template.h', ctx) if not module.structs: addFileNameToNoMocList(noMocListFile, noMocFilePath, 'module/{}/ModulePrivate.h'.format(module_path)) - generateFile(generator, 'module/{{path}}/Module.h', 'Module.template.h', ctx, libraryName, "") - generateFile(generator, 'module/{{path}}/Module.cpp', 'Module.template.cpp', ctx, libraryName, "") + generator.write('module/{{path}}/Module.h', 'Module.template.h', ctx) + generator.write('module/{{path}}/Module.cpp', 'Module.template.cpp', ctx) addFileNameToNoMocList(noMocListFile, noMocFilePath, 'module/{}/Module.h'.format(module_path)) - generateFile(generator, 'ipc/{{path}}/ModuleIPC.h', 'ModuleIPC.template.h', ctx, libraryName, "") - generateFile(generator, 'ipc/{{path}}/ModuleIPC.cpp', 'ModuleIPC.template.cpp', ctx, libraryName, "") + generator.write('ipc/{{path}}/ModuleIPC.h', 'ModuleIPC.template.h', ctx) + generator.write('ipc/{{path}}/ModuleIPC.cpp', 'ModuleIPC.template.cpp', ctx) addFileNameToNoMocList(noMocListFile, noMocFilePath, 'ipc/{}/ModuleIPC.h'.format(module_path)) for interface in module.interfaces: @@ -383,82 +360,81 @@ def run_generation(input, output, dependency, libraryName, all, noMocFilePath, n ctx.update({'interfaceName': interface.name}) generateAsyncProxy = False ctx.update({'generateAsyncProxy': generateAsyncProxy}) - generateFile(generator, 'types/{{path}}/{{interface}}.h', 'Service.template.h', ctx, libraryName, "") - generateFile(generator, 'types/{{path}}/{{interface}}.cpp', 'Service.template.cpp', ctx, libraryName, "") - generateFile(generator, 'types/{{path}}/{{interface}}ImplementationBase.h', 'ImplementationBase.template.h', ctx, libraryName, "") - generateFile(generator, 'types/{{path}}/{{interface}}ImplementationBase.cpp', 'ImplementationBase.template.cpp', ctx, libraryName, "") - generateFile(generator, 'types/{{path}}/{{interface}}QMLAdapter.h', 'QMLAdapter.template.h', ctx, libraryName, "") - generateFile(generator, 'types/{{path}}/{{interface}}QMLAdapter.cpp', 'QMLAdapter.template.cpp', ctx, libraryName, "") + generator.write('types/{{path}}/{{interface}}.h', 'Service.template.h', ctx) + generator.write('types/{{path}}/{{interface}}.cpp', 'Service.template.cpp', ctx) + generator.write('types/{{path}}/{{interface}}ImplementationBase.h', 'ImplementationBase.template.h', ctx) + generator.write('types/{{path}}/{{interface}}ImplementationBase.cpp', 'ImplementationBase.template.cpp', ctx) + generator.write('types/{{path}}/{{interface}}QMLAdapter.h', 'QMLAdapter.template.h', ctx) + generator.write('types/{{path}}/{{interface}}QMLAdapter.cpp', 'QMLAdapter.template.cpp', ctx) if isQMLImplementationEnabled(interface): - generateFile(generator, 'types/{{path}}/{{interface}}ImplementationBaseQML.h', 'ImplementationBaseQML.template.h', ctx, libraryName, "") + generator.write('types/{{path}}/{{interface}}ImplementationBaseQML.h', 'ImplementationBaseQML.template.h', ctx) if isIPCEnabled(interface): - generateFile(generator, 'ipc/{{path}}/{{interface}}IPCAdapter.h', 'IPCAdapter.template.h', ctx, libraryName, "") - generateFile(generator, 'ipc/{{path}}/{{interface}}IPCAdapter.cpp', 'IPCAdapter.template.cpp', ctx, libraryName, "") + generator.write('ipc/{{path}}/{{interface}}IPCAdapter.h', 'IPCAdapter.template.h', ctx) + generator.write('ipc/{{path}}/{{interface}}IPCAdapter.cpp', 'IPCAdapter.template.cpp', ctx) - generateFile(generator, 'types/{{path}}/{{interface}}IPCCommon.h', 'IPCCommon.template.h', ctx, libraryName, "") + generator.write('types/{{path}}/{{interface}}IPCCommon.h', 'IPCCommon.template.h', ctx) addFileNameToNoMocList(noMocListFile, noMocFilePath, 'types/{}/{}IPCCommon.h'.format(module_path, interface)) - generateFile(generator, 'ipc_dbus/{{path}}/{{interface}}IPCDBusAdapter.h', 'IPCDBusServiceAdapter.template.h', ctx, libraryName, "") - generateFile(generator, 'ipc_dbus/{{path}}/{{interface}}IPCDBusAdapter.cpp', 'IPCDBusServiceAdapter.template.cpp', ctx, libraryName, "") - generateFile(generator, 'ipc/{{path}}/{{interface}}IPCLocalServiceAdapter.h', 'IPCLocalServiceAdapter.template.h', ctx, libraryName, "") - generateFile(generator, 'ipc/{{path}}/{{interface}}IPCLocalServiceAdapter.cpp', 'IPCLocalServiceAdapter.template.cpp', ctx, libraryName, "") + generator.write('ipc_dbus/{{path}}/{{interface}}IPCDBusAdapter.h', 'IPCDBusServiceAdapter.template.h', ctx) + generator.write('ipc_dbus/{{path}}/{{interface}}IPCDBusAdapter.cpp', 'IPCDBusServiceAdapter.template.cpp', ctx) + generator.write('ipc/{{path}}/{{interface}}IPCLocalServiceAdapter.h', 'IPCLocalServiceAdapter.template.h', ctx) + generator.write('ipc/{{path}}/{{interface}}IPCLocalServiceAdapter.cpp', 'IPCLocalServiceAdapter.template.cpp', ctx) if isSynchronousIPCEnabled(interface): - generateFile(generator, 'ipc/{{path}}/{{interface}}IPCProxy.h', 'IPCProxy.template.h', ctx, libraryName, "") - generateFile(generator, 'ipc/{{path}}/{{interface}}IPCProxy.cpp', 'IPCProxy.template.cpp', ctx, libraryName, "") - generateFile(generator, 'ipc/{{path}}/{{interface}}ServiceWrapper.h', 'ServiceWrapper.template.h', ctx, libraryName, "") - generateFile(generator, 'ipc/{{path}}/{{interface}}ServiceWrapper.cpp', 'ServiceWrapper.template.cpp', ctx, libraryName, "") - generateFile(generator, 'ipc/{{path}}/{{interface}}NotAvailableImpl.h', 'ServiceNotAvailableImpl.template.h', ctx, libraryName, "") - generateFile(generator, 'ipc_dbus/{{path}}/{{interface}}IPCDBusProxy.h', 'IPCDBusProxyAdapter.template.h', ctx, libraryName, "") - generateFile(generator, 'ipc_dbus/{{path}}/{{interface}}IPCDBusProxy.cpp', 'IPCDBusProxyAdapter.template.cpp', ctx, libraryName, "") + generator.write('ipc/{{path}}/{{interface}}IPCProxy.h', 'IPCProxy.template.h', ctx) + generator.write('ipc/{{path}}/{{interface}}IPCProxy.cpp', 'IPCProxy.template.cpp', ctx) + generator.write('ipc/{{path}}/{{interface}}ServiceWrapper.h', 'ServiceWrapper.template.h', ctx) + generator.write('ipc/{{path}}/{{interface}}ServiceWrapper.cpp', 'ServiceWrapper.template.cpp', ctx) + generator.write('ipc/{{path}}/{{interface}}NotAvailableImpl.h', 'ServiceNotAvailableImpl.template.h', ctx) + generator.write('ipc_dbus/{{path}}/{{interface}}IPCDBusProxy.h', 'IPCDBusProxyAdapter.template.h', ctx) + generator.write('ipc_dbus/{{path}}/{{interface}}IPCDBusProxy.cpp', 'IPCDBusProxyAdapter.template.cpp', ctx) if isAsynchronousIPCEnabled(interface): generateAsyncProxy = True ctx.update({'generateAsyncProxy': generateAsyncProxy}) ctx.update({'interfaceName': interface.name + interfaceNameSuffix()}) - generateFile(generator, 'types/{{path}}/{{interface}}Async.h', 'Service.template.h', ctx, libraryName, "") - generateFile(generator, 'types/{{path}}/{{interface}}Async.cpp', 'Service.template.cpp', ctx, libraryName, "") - generateFile(generator, 'types/{{path}}/{{interface}}AsyncQMLAdapter.h', 'QMLAdapter.template.h', ctx, libraryName, "") - generateFile(generator, 'types/{{path}}/{{interface}}AsyncQMLAdapter.cpp', 'QMLAdapter.template.cpp', ctx, libraryName, "") - generateFile(generator, 'ipc/{{path}}/{{interface}}AsyncIPCProxy.h', 'IPCProxy.template.h', ctx, libraryName, "") - generateFile(generator, 'ipc/{{path}}/{{interface}}AsyncIPCProxy.cpp', 'IPCProxy.template.cpp', ctx, libraryName, "") - generateFile(generator, 'ipc/{{path}}/{{interface}}AsyncServiceWrapper.h', 'ServiceWrapper.template.h', ctx, libraryName, "") - generateFile(generator, 'ipc/{{path}}/{{interface}}AsyncServiceWrapper.cpp', 'ServiceWrapper.template.cpp', ctx, libraryName, "") - generateFile(generator, 'ipc/{{path}}/{{interface}}AsyncNotAvailableImpl.h', 'ServiceNotAvailableImpl.template.h', ctx, libraryName, "") - generateFile(generator, 'ipc/{{path}}/{{interface}}AsyncIPCLocalProxyAdapter.h', 'IPCLocalProxyAdapter.template.h', ctx, libraryName, "") - generateFile(generator, 'ipc/{{path}}/{{interface}}AsyncIPCLocalProxyAdapter.cpp', 'IPCLocalProxyAdapter.template.cpp', ctx, libraryName, "") - generateFile(generator, 'ipc_dbus/{{path}}/{{interface}}AsyncIPCDBusProxy.h', 'IPCDBusProxyAdapter.template.h', ctx, libraryName, "") - generateFile(generator, 'ipc_dbus/{{path}}/{{interface}}AsyncIPCDBusProxy.cpp', 'IPCDBusProxyAdapter.template.cpp', ctx, libraryName, "") + generator.write('types/{{path}}/{{interface}}Async.h', 'Service.template.h', ctx) + generator.write('types/{{path}}/{{interface}}Async.cpp', 'Service.template.cpp', ctx) + generator.write('types/{{path}}/{{interface}}AsyncQMLAdapter.h', 'QMLAdapter.template.h', ctx) + generator.write('types/{{path}}/{{interface}}AsyncQMLAdapter.cpp', 'QMLAdapter.template.cpp', ctx) + generator.write('ipc/{{path}}/{{interface}}AsyncIPCProxy.h', 'IPCProxy.template.h', ctx) + generator.write('ipc/{{path}}/{{interface}}AsyncIPCProxy.cpp', 'IPCProxy.template.cpp', ctx) + generator.write('ipc/{{path}}/{{interface}}AsyncServiceWrapper.h', 'ServiceWrapper.template.h', ctx) + generator.write('ipc/{{path}}/{{interface}}AsyncServiceWrapper.cpp', 'ServiceWrapper.template.cpp', ctx) + generator.write('ipc/{{path}}/{{interface}}AsyncNotAvailableImpl.h', 'ServiceNotAvailableImpl.template.h', ctx) + generator.write('ipc/{{path}}/{{interface}}AsyncIPCLocalProxyAdapter.h', 'IPCLocalProxyAdapter.template.h', ctx) + generator.write('ipc/{{path}}/{{interface}}AsyncIPCLocalProxyAdapter.cpp', 'IPCLocalProxyAdapter.template.cpp', ctx) + generator.write('ipc_dbus/{{path}}/{{interface}}AsyncIPCDBusProxy.h', 'IPCDBusProxyAdapter.template.h', ctx) + generator.write('ipc_dbus/{{path}}/{{interface}}AsyncIPCDBusProxy.cpp', 'IPCDBusProxyAdapter.template.cpp', ctx) for enum in module.enums: ctx.update({'enum': enum}) - generateFile(generator, 'types/{{path}}/{{enum}}.h', 'Enum.template.h', ctx, libraryName, "") - generateFile(generator, 'types/{{path}}/{{enum}}.cpp', 'Enum.template.cpp', ctx, libraryName, "") + generator.write('types/{{path}}/{{enum}}.h', 'Enum.template.h', ctx) + generator.write('types/{{path}}/{{enum}}.cpp', 'Enum.template.cpp', ctx) for struct in module.structs: ctx.update({'struct': struct}) - generateFile(generator, 'types/{{path}}/{{struct}}.h', 'Struct.template.h', ctx, libraryName, "") - generateFile(generator, 'types/{{path}}/{{struct}}.cpp', 'Struct.template.cpp', ctx, libraryName, "") + generator.write('types/{{path}}/{{struct}}.h', 'Struct.template.h', ctx) + generator.write('types/{{path}}/{{struct}}.cpp', 'Struct.template.cpp', ctx) if isQObjectWrapperEnabled(struct): - generateFile(generator, 'types/{{path}}/{{struct}}QObjectWrapper.h', 'StructQObjectWrapper.template.h', ctx, libraryName, "") - generateFile(generator, 'types/{{path}}/{{struct}}QObjectWrapper.cpp', 'StructQObjectWrapper.template.cpp', ctx, libraryName, "") + generator.write('types/{{path}}/{{struct}}QObjectWrapper.h', 'StructQObjectWrapper.template.h', ctx) + generator.write('types/{{path}}/{{struct}}QObjectWrapper.cpp', 'StructQObjectWrapper.template.cpp', ctx) @click.command() -@click.option('--library', default="") @click.option('--output', default=".") @click.option('--input', '-i', multiple=True) @click.option('--dependency', '-d', multiple=True) @click.option('--all', is_flag=True) @click.option('--no_moc_file_path', default=".") -def generate(input, output, dependency, library, all, no_moc_file_path): +def generate(input, output, dependency, all, no_moc_file_path): """Takes several files or directories as input and generates the code in the given output directory.""" with open('{}/no_moc.cmake'.format(output), 'a+') as noMocListFile: noMocListFile.write('set(HEADERS_NO_MOC_GENERATED\n') - run_generation(input, output, dependency, library, all, no_moc_file_path, noMocListFile) + run_generation(input, output, dependency, all, no_moc_file_path, noMocListFile) noMocListFile.write(')\n') diff --git a/codegen/facelift/templates/Enum.template.h b/codegen/facelift/templates/Enum.template.h index f65b4539..87216979 100644 --- a/codegen/facelift/templates/Enum.template.h +++ b/codegen/facelift/templates/Enum.template.h @@ -35,13 +35,11 @@ #pragma once -{{classExportDefines}} - #include "FaceliftEnum.h" {{module.namespaceCppOpen}} -class {{classExport}} {{enum}}Gadget +class {{enum}}Gadget { Q_GADGET diff --git a/codegen/facelift/templates/IPCAdapter.template.h b/codegen/facelift/templates/IPCAdapter.template.h index 1c9c34b6..3d98640c 100644 --- a/codegen/facelift/templates/IPCAdapter.template.h +++ b/codegen/facelift/templates/IPCAdapter.template.h @@ -35,8 +35,6 @@ #pragma once -{{classExportDefines}} - #include #include "IPCServiceAdapter.h" @@ -58,7 +56,7 @@ {{module.namespaceCppOpen}} -class {{classExport}} {{interfaceName}}IPCAdapter: public ::facelift::IPCServiceAdapter<{{interfaceName}}> +class {{interfaceName}}IPCAdapter: public ::facelift::IPCServiceAdapter<{{interfaceName}}> { Q_OBJECT diff --git a/codegen/facelift/templates/IPCCommon.template.h b/codegen/facelift/templates/IPCCommon.template.h index 345988c0..9266e859 100644 --- a/codegen/facelift/templates/IPCCommon.template.h +++ b/codegen/facelift/templates/IPCCommon.template.h @@ -35,11 +35,9 @@ #pragma once -{{classExportDefines}} - {{module.namespaceCppOpen}} -class {{classExport}} {{interfaceName}}IPCCommon +class {{interfaceName}}IPCCommon { public: enum class MethodID { diff --git a/codegen/facelift/templates/IPCDBusServiceAdapter.template.h b/codegen/facelift/templates/IPCDBusServiceAdapter.template.h index 8441e5c6..b5800895 100644 --- a/codegen/facelift/templates/IPCDBusServiceAdapter.template.h +++ b/codegen/facelift/templates/IPCDBusServiceAdapter.template.h @@ -38,8 +38,6 @@ #pragma once -{{classExportDefines}} - #include "FaceliftUtils.h" #include "IPCDBusServiceAdapter.h" #include "IPCAdapterModelPropertyHandler.h" @@ -58,7 +56,7 @@ class {{interfaceName}}IPCQMLAdapterType; -class {{classExport}} {{className}}: public {{baseClass}} +class {{className}}: public {{baseClass}} { Q_OBJECT diff --git a/codegen/facelift/templates/IPCProxy.template.h b/codegen/facelift/templates/IPCProxy.template.h index 6c132803..21c9fc0a 100644 --- a/codegen/facelift/templates/IPCProxy.template.h +++ b/codegen/facelift/templates/IPCProxy.template.h @@ -33,8 +33,6 @@ ** Do not edit! All changes made to it will be lost. ****************************************************************************/ -{{classExportDefines}} - #pragma once #include "IPCProxy.h" @@ -61,7 +59,7 @@ class {{className}}QMLAdapterType; -class {{classExport}} {{className}} : public facelift::IPCProxy<{{interfaceName}}Wrapper> +class {{className}} : public facelift::IPCProxy<{{interfaceName}}Wrapper> { Q_OBJECT @@ -82,7 +80,7 @@ class {{classExport}} {{className}} : public facelift::IPCProxy<{{interfaceName} }; -class {{classExport}} {{className}}QMLAdapterType : public {{interfaceName}}QMLAdapter +class {{className}}QMLAdapterType : public {{interfaceName}}QMLAdapter { Q_OBJECT diff --git a/codegen/facelift/templates/IPCProxyAdapter.template.h b/codegen/facelift/templates/IPCProxyAdapter.template.h index 8731a5b3..b7d0a793 100644 --- a/codegen/facelift/templates/IPCProxyAdapter.template.h +++ b/codegen/facelift/templates/IPCProxyAdapter.template.h @@ -33,8 +33,6 @@ ** Do not edit! All changes made to it will be lost. ****************************************************************************/ -{{classExportDefines}} - #pragma once #include "IPCProxyModelProperty.h" @@ -52,7 +50,7 @@ class {{className}}QMLAdapterType; -class {{classExport}} {{className}} : public {{baseClass}} +class {{className}} : public {{baseClass}} { Q_OBJECT diff --git a/codegen/facelift/templates/IPCServiceAdapter.template.h b/codegen/facelift/templates/IPCServiceAdapter.template.h index 4551f550..4b1b0442 100644 --- a/codegen/facelift/templates/IPCServiceAdapter.template.h +++ b/codegen/facelift/templates/IPCServiceAdapter.template.h @@ -37,8 +37,6 @@ {% set className = interfaceName + proxyTypeNameSuffix %} -{{classExportDefines}} - #include "FaceliftUtils.h" #include "IPCAdapterModelPropertyHandler.h" @@ -55,7 +53,7 @@ class {{interfaceName}}IPCQMLAdapterType; -class {{classExport}} {{className}}: public {{baseClass}} +class {{className}}: public {{baseClass}} { Q_OBJECT diff --git a/codegen/facelift/templates/ImplementationBase.template.h b/codegen/facelift/templates/ImplementationBase.template.h index 6f9a23e5..ccd8bd9f 100644 --- a/codegen/facelift/templates/ImplementationBase.template.h +++ b/codegen/facelift/templates/ImplementationBase.template.h @@ -35,8 +35,6 @@ #pragma once -{{classExportDefines}} - #include "{{interfaceName}}.h" #include "ModelProperty.h" @@ -45,7 +43,7 @@ /** * A partial implementation of the service interface, using the Property helper class */ -class {{classExport}} {{interfaceName}}ImplementationBase : public {{interfaceName}} +class {{interfaceName}}ImplementationBase : public {{interfaceName}} { Q_OBJECT diff --git a/codegen/facelift/templates/ImplementationBaseQML.template.h b/codegen/facelift/templates/ImplementationBaseQML.template.h index 4516e0f4..8eff5f4d 100644 --- a/codegen/facelift/templates/ImplementationBaseQML.template.h +++ b/codegen/facelift/templates/ImplementationBaseQML.template.h @@ -35,8 +35,6 @@ #pragma once -{{classExportDefines}} - #include "QMLModel.h" #include "{{interface}}ImplementationBase.h" @@ -61,7 +59,7 @@ class {{interface}}ImplementationBaseQML; * This class implements the actual service interface and wraps the object instantiated from QML, which implements * the actual logic */ -class {{classExport}} {{interface}}QMLImplementationProvider : public {{interface}}ImplementationBase, +class {{interface}}QMLImplementationProvider : public {{interface}}ImplementationBase, public facelift::QMLModelImplementationFrontend<{{interface}}ImplementationBaseQML> { Q_OBJECT @@ -109,7 +107,7 @@ class {{classExport}} {{interface}}QMLImplementationProvider : public {{interfac /** * This class defines the QML component which is used when implementing a model using QML */ -class {{classExport}} {{interface}}ImplementationBaseQML : public facelift::ModelQMLImplementation<{{interface}}QMLImplementationProvider> +class {{interface}}ImplementationBaseQML : public facelift::ModelQMLImplementation<{{interface}}QMLImplementationProvider> { Q_OBJECT diff --git a/codegen/facelift/templates/Module.template.h b/codegen/facelift/templates/Module.template.h index 7d3676f8..d44d28a1 100644 --- a/codegen/facelift/templates/Module.template.h +++ b/codegen/facelift/templates/Module.template.h @@ -35,8 +35,6 @@ #pragma once -{{classExportDefines}} - #include "ModuleBase.h" {% for interface in module.interfaces %} @@ -51,7 +49,7 @@ * \inqmlmodule {{module.name}} * This singleton can be used to create instances of the types defined in the {{module.name}} module/package. */ -class {{classExport}} Module : public facelift::ModuleBase +class Module : public facelift::ModuleBase { public: Module(); diff --git a/codegen/facelift/templates/ModuleIPC.template.h b/codegen/facelift/templates/ModuleIPC.template.h index d92214d1..acb8e9fb 100644 --- a/codegen/facelift/templates/ModuleIPC.template.h +++ b/codegen/facelift/templates/ModuleIPC.template.h @@ -37,11 +37,9 @@ #include -{{classExportDefines}} - {{module.namespaceCppOpen}} -class {{classExport}} ModuleIPC +class ModuleIPC { public: static void registerQmlTypes(const char* uri, int majorVersion = {{module.majorVersion}}, int minorVersion = {{module.minorVersion}}); diff --git a/codegen/facelift/templates/QMLAdapter.template.h b/codegen/facelift/templates/QMLAdapter.template.h index e3271aa6..78c108be 100644 --- a/codegen/facelift/templates/QMLAdapter.template.h +++ b/codegen/facelift/templates/QMLAdapter.template.h @@ -42,8 +42,6 @@ #pragma once -{{classExportDefines}} - #include "QMLAdapter.h" #include "{{interfaceName}}.h" @@ -70,7 +68,7 @@ /** * This is the class registered as a QML component for the {{interfaceName}} interface */ -class {{classExport}} {{className}} : public facelift::QMLAdapterBase +class {{className}} : public facelift::QMLAdapterBase { Q_OBJECT diff --git a/codegen/facelift/templates/Service.template.h b/codegen/facelift/templates/Service.template.h index df56e3c3..05e6ce65 100644 --- a/codegen/facelift/templates/Service.template.h +++ b/codegen/facelift/templates/Service.template.h @@ -37,8 +37,6 @@ #pragma once -{{classExportDefines}} - #include "FaceliftModel.h" // Dependencies @@ -58,7 +56,7 @@ class {{interfaceName}}IPCLocalProxyAdapter; class {{interfaceName}}ImplementationBaseQML; {% if hasReadyFlags %} -class {{classExport}} {{interfaceName}}ReadyFlags +class {{interfaceName}}ReadyFlags { Q_GADGET @@ -78,7 +76,7 @@ class {{classExport}} {{interfaceName}}ReadyFlags {% endif %} {{interface.comment}} -class {{classExport}} {{interfaceName}} : public facelift::InterfaceBase +class {{interfaceName}} : public facelift::InterfaceBase { Q_OBJECT diff --git a/codegen/facelift/templates/ServiceMonitor.template.h b/codegen/facelift/templates/ServiceMonitor.template.h index ffff34f2..00df7ca0 100644 --- a/codegen/facelift/templates/ServiceMonitor.template.h +++ b/codegen/facelift/templates/ServiceMonitor.template.h @@ -35,8 +35,6 @@ #pragma once -{{classExportDefines}} - #include "{{interface.fullyQualifiedPath}}.h" #include "ServiceMonitor.h" @@ -45,7 +43,7 @@ /** * Dummy implementation of the {{interface}} API */ -class {{classExport}} {{interface}}Monitor : public facelift::ServiceMonitor<{{interface}}> { +class {{interface}}Monitor : public facelift::ServiceMonitor<{{interface}}> { Q_OBJECT diff --git a/codegen/facelift/templates/ServiceWrapper.template.h b/codegen/facelift/templates/ServiceWrapper.template.h index 82f56e1c..532ffc7f 100644 --- a/codegen/facelift/templates/ServiceWrapper.template.h +++ b/codegen/facelift/templates/ServiceWrapper.template.h @@ -38,8 +38,6 @@ #pragma once -{{classExportDefines}} - #include #include "ServiceWrapper.h" @@ -51,7 +49,7 @@ /** */ -class {{classExport}} {{interfaceName}}Wrapper : public facelift::ServiceWrapper<{{interfaceName}}> { +class {{interfaceName}}Wrapper : public facelift::ServiceWrapper<{{interfaceName}}> { Q_OBJECT diff --git a/codegen/facelift/templates/Struct.template.h b/codegen/facelift/templates/Struct.template.h index 7a141e06..cc69a14c 100644 --- a/codegen/facelift/templates/Struct.template.h +++ b/codegen/facelift/templates/Struct.template.h @@ -37,8 +37,6 @@ #pragma once -{{classExportDefines}} - #include "Structure.h" #include "FaceliftQMLUtils.h" @@ -60,7 +58,7 @@ class {{struct.name}}QObjectWrapper; */ {{struct.comment}} -class {{classExport}} {{struct.name}} : public facelift::Structure< +class {{struct.name}} : public facelift::Structure< {%- for field in struct.fields -%} {{ comma() }}{{field.cppType}} {%- endfor -%} > diff --git a/codegen/facelift/templates/StructQObjectWrapper.template.h b/codegen/facelift/templates/StructQObjectWrapper.template.h index 75e023a5..48b0bcdf 100644 --- a/codegen/facelift/templates/StructQObjectWrapper.template.h +++ b/codegen/facelift/templates/StructQObjectWrapper.template.h @@ -37,8 +37,6 @@ #pragma once -{{classExportDefines}} - #include "{{struct.name}}.h" #include "StructQObjectWrapper.h" @@ -58,7 +56,7 @@ * \ingroup {{struct.module.name|toValidId}} * \inqmlmodule {{struct.module.name}} */ -class {{classExport}} {{struct.name}}QObjectWrapper : public facelift::StructQObjectWrapper<{{struct.name}}> +class {{struct.name}}QObjectWrapper : public facelift::StructQObjectWrapper<{{struct.name}}> { Q_OBJECT diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 54167059..d409fc9c 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -1,6 +1,4 @@ facelift_add_library(FaceliftCommonLib - SOURCES - FaceliftUtils.cpp HEADERS_NO_MOC span.h FaceliftUtils.h diff --git a/src/common/FaceliftUtils.cpp b/src/common/FaceliftUtils.cpp deleted file mode 100644 index 6e563b90..00000000 --- a/src/common/FaceliftUtils.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/********************************************************************** -** -** Copyright (C) 2018 Luxoft Sweden AB -** -** This file is part of the FaceLift project -** -** Permission is hereby granted, free of charge, to any person -** obtaining a copy of this software and associated documentation files -** (the "Software"), to deal in the Software without restriction, -** including without limitation the rights to use, copy, modify, merge, -** publish, distribute, sublicense, and/or sell copies of the Software, -** and to permit persons to whom the Software is furnished to do so, -** subject to the following conditions: -** -** The above copyright notice and this permission notice shall be -** included in all copies or substantial portions of the Software. -** -** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -** BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -** ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -** CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -** SOFTWARE. -** -** SPDX-License-Identifier: MIT -** -**********************************************************************/ -#include "FaceliftUtils.h" - -namespace facelift { - -// this dummy export is necessary for creating a *.lib file with MSVC based compiler -// otherwise no lib file will be created -FaceliftCommonLib_EXPORT int dummy_value_1; - -} diff --git a/src/common/FaceliftUtils.h b/src/common/FaceliftUtils.h index 0e0fe70f..62e76476 100644 --- a/src/common/FaceliftUtils.h +++ b/src/common/FaceliftUtils.h @@ -37,12 +37,6 @@ #include #include -#if defined(FaceliftCommonLib_LIBRARY) -# define FaceliftCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftCommonLib_EXPORT Q_DECL_IMPORT -#endif - template inline QTextStream &operator<<(QTextStream &outStream, const QList &f) { diff --git a/src/ipc/dbus/CMakeLists.txt b/src/ipc/dbus/CMakeLists.txt index 170b6039..1897e1b0 100644 --- a/src/ipc/dbus/CMakeLists.txt +++ b/src/ipc/dbus/CMakeLists.txt @@ -5,11 +5,7 @@ if(Qt5DBus_FOUND) set_target_properties(Qt5::DBus PROPERTIES IMPORTED_GLOBAL TRUE) - if(WIN32) - set(GENERATED_FILE_PATH ${CMAKE_CURRENT_BINARY_DIR}/facelift_generated/FaceliftIPCLibDBus) # There is a weird issue on Windows related to the MOC if the generated files are outside of ${CMAKE_CURRENT_BINARY_DIR} - else() - set(GENERATED_FILE_PATH ${CMAKE_BINARY_DIR}/facelift_generated/FaceliftIPCLibDBus) # Keep generated file folder outside of CMAKE_CURRENT_BINARY_DIR to avoid having the MOC generated file inside the same folder, which would cause unnecessary recompiles - endif() + set(GENERATED_FILE_PATH ${CMAKE_BINARY_DIR}/facelift_generated/FaceliftIPCLibDBus) # Keep generated file folder outside of CMAKE_CURRENT_BINARY_DIR to avoid having the MOC generated file inside the same folder, which would cause unnecessary recompiles facelift_generate_code(INTERFACE_DEFINITION_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/interfaces OUTPUT_PATH ${GENERATED_FILE_PATH}) include_directories(${GENERATED_FILE_PATH}/ipc ${GENERATED_FILE_PATH}/ipc_dbus ${GENERATED_FILE_PATH}/types ${CMAKE_CURRENT_SOURCE_DIR}/..) diff --git a/src/ipc/dbus/DBusIPCCommon.h b/src/ipc/dbus/DBusIPCCommon.h index 9f3280aa..44f02927 100644 --- a/src/ipc/dbus/DBusIPCCommon.h +++ b/src/ipc/dbus/DBusIPCCommon.h @@ -30,17 +30,11 @@ #pragma once -#if defined(FaceliftIPCLibDBus_LIBRARY) -# define FaceliftIPCLibDBus_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCLibDBus_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { namespace dbus { using namespace facelift; -struct FaceliftIPCLibDBus_EXPORT DBusIPCCommon { +struct DBusIPCCommon { static constexpr const char *GET_PROPERTIES_MESSAGE_NAME = "GetAllProperties"; static constexpr const char *PROPERTIES_CHANGED_SIGNAL_NAME = "PropertiesChanged"; static constexpr const char *SIGNAL_TRIGGERED_SIGNAL_NAME = "SignalTriggered"; diff --git a/src/ipc/dbus/DBusIPCMessage.h b/src/ipc/dbus/DBusIPCMessage.h index 0198bd36..d3b5f136 100644 --- a/src/ipc/dbus/DBusIPCMessage.h +++ b/src/ipc/dbus/DBusIPCMessage.h @@ -30,12 +30,6 @@ #pragma once -#if defined(FaceliftIPCLibDBus_LIBRARY) -# define FaceliftIPCLibDBus_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCLibDBus_EXPORT Q_DECL_IMPORT -#endif - #include #include #include @@ -47,7 +41,7 @@ class InputPayLoad; namespace dbus { -class FaceliftIPCLibDBus_EXPORT DBusIPCMessage +class DBusIPCMessage { public: diff --git a/src/ipc/dbus/DBusIPCProxy.h b/src/ipc/dbus/DBusIPCProxy.h index 8111ad4d..770c07e6 100644 --- a/src/ipc/dbus/DBusIPCProxy.h +++ b/src/ipc/dbus/DBusIPCProxy.h @@ -35,12 +35,6 @@ #include "DBusIPCProxyBinder.h" #include "DBusManager.h" -#if defined(FaceliftIPCLibDBus_LIBRARY) -# define FaceliftIPCLibDBus_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCLibDBus_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { namespace dbus { diff --git a/src/ipc/dbus/DBusIPCProxyBinder.h b/src/ipc/dbus/DBusIPCProxyBinder.h index ddbe67ef..3a718f77 100644 --- a/src/ipc/dbus/DBusIPCProxyBinder.h +++ b/src/ipc/dbus/DBusIPCProxyBinder.h @@ -30,12 +30,6 @@ #pragma once -#if defined(FaceliftIPCLibDBus_LIBRARY) -# define FaceliftIPCLibDBus_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCLibDBus_EXPORT Q_DECL_IMPORT -#endif - #include #include "IPCProxyBinderBase.h" #include "DBusIPCMessage.h" @@ -50,7 +44,7 @@ namespace dbus { class DBusRequestHandler; class DBusObjectRegistry; -class FaceliftIPCLibDBus_EXPORT DBusIPCProxyBinder : public IPCProxyBinderBase +class DBusIPCProxyBinder : public IPCProxyBinderBase { Q_OBJECT diff --git a/src/ipc/dbus/DBusManager.h b/src/ipc/dbus/DBusManager.h index 3fffed5f..66e4589e 100644 --- a/src/ipc/dbus/DBusManager.h +++ b/src/ipc/dbus/DBusManager.h @@ -34,12 +34,6 @@ #include "DBusManagerInterface.h" -#if defined(FaceliftIPCLibDBus_LIBRARY) -# define FaceliftIPCLibDBus_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCLibDBus_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { namespace dbus { @@ -47,7 +41,7 @@ class DBusObjectRegistry; using namespace facelift; -class FaceliftIPCLibDBus_EXPORT DBusManager : public DBusManagerInterface +class DBusManager : public DBusManagerInterface { public: DBusManager(const DBusManager&) = delete; diff --git a/src/ipc/dbus/DBusManagerInterface.h b/src/ipc/dbus/DBusManagerInterface.h index 08d761ee..e6adbee1 100644 --- a/src/ipc/dbus/DBusManagerInterface.h +++ b/src/ipc/dbus/DBusManagerInterface.h @@ -30,12 +30,6 @@ #pragma once -#if defined(FaceliftIPCLibDBus_LIBRARY) -# define FaceliftIPCLibDBus_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCLibDBus_EXPORT Q_DECL_IMPORT -#endif - #include #include @@ -44,7 +38,7 @@ namespace dbus { class DBusObjectRegistry; -class FaceliftIPCLibDBus_EXPORT DBusManagerInterface +class DBusManagerInterface { public: virtual ~DBusManagerInterface() = default; diff --git a/src/ipc/dbus/DBusObjectRegistry.h b/src/ipc/dbus/DBusObjectRegistry.h index dabd46c0..f580b952 100644 --- a/src/ipc/dbus/DBusObjectRegistry.h +++ b/src/ipc/dbus/DBusObjectRegistry.h @@ -40,7 +40,7 @@ namespace facelift { namespace dbus { -class FaceliftIPCLibDBus_EXPORT DBusObjectRegistry : public QObject +class DBusObjectRegistry : public QObject { Q_OBJECT static constexpr const int INVALID_REGISTRY_VERSION = 0; diff --git a/src/ipc/dbus/DBusRequestHandler.h b/src/ipc/dbus/DBusRequestHandler.h index 5b450d41..425a2e42 100644 --- a/src/ipc/dbus/DBusRequestHandler.h +++ b/src/ipc/dbus/DBusRequestHandler.h @@ -30,18 +30,12 @@ #pragma once -#if defined(FaceliftIPCLibDBus_LIBRARY) -# define FaceliftIPCLibDBus_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCLibDBus_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { namespace dbus { class DBusIPCMessage; -class FaceliftIPCLibDBus_EXPORT DBusRequestHandler +class DBusRequestHandler { public: diff --git a/src/ipc/dbus/IPCDBusServiceAdapter.h b/src/ipc/dbus/IPCDBusServiceAdapter.h index 9d6eaf7f..25397059 100644 --- a/src/ipc/dbus/IPCDBusServiceAdapter.h +++ b/src/ipc/dbus/IPCDBusServiceAdapter.h @@ -37,12 +37,6 @@ #include "IPCDBusServiceAdapterBase.h" #include "DBusManagerInterface.h" -#if defined(FaceliftIPCLibDBus_LIBRARY) -# define FaceliftIPCLibDBus_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCLibDBus_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { namespace dbus { diff --git a/src/ipc/dbus/IPCDBusServiceAdapterBase.h b/src/ipc/dbus/IPCDBusServiceAdapterBase.h index f6d2f988..b60687d2 100644 --- a/src/ipc/dbus/IPCDBusServiceAdapterBase.h +++ b/src/ipc/dbus/IPCDBusServiceAdapterBase.h @@ -30,12 +30,6 @@ #pragma once -#if defined(FaceliftIPCLibDBus_LIBRARY) -# define FaceliftIPCLibDBus_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCLibDBus_EXPORT Q_DECL_IMPORT -#endif - #include #include "IPCServiceAdapterBase.h" #include "DBusIPCMessage.h" @@ -47,7 +41,7 @@ namespace facelift { namespace dbus { -class FaceliftIPCLibDBus_EXPORT IPCDBusServiceAdapterBase : public IPCServiceAdapterBase +class IPCDBusServiceAdapterBase : public IPCServiceAdapterBase { Q_OBJECT diff --git a/src/ipc/ipc-common/AppendDBUSSignatureFunction.h b/src/ipc/ipc-common/AppendDBUSSignatureFunction.h index c24408df..20bfa801 100644 --- a/src/ipc/ipc-common/AppendDBUSSignatureFunction.h +++ b/src/ipc/ipc-common/AppendDBUSSignatureFunction.h @@ -30,12 +30,6 @@ #pragma once -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - #include @@ -45,7 +39,7 @@ namespace facelift { -struct FaceliftIPCCommonLib_EXPORT AppendDBUSSignatureFunction +struct AppendDBUSSignatureFunction { AppendDBUSSignatureFunction(QTextStream &s) : s(s) diff --git a/src/ipc/ipc-common/DBusSignatureHelper.h b/src/ipc/ipc-common/DBusSignatureHelper.h index 7fa042dc..c8018cdc 100644 --- a/src/ipc/ipc-common/DBusSignatureHelper.h +++ b/src/ipc/ipc-common/DBusSignatureHelper.h @@ -30,18 +30,12 @@ #pragma once -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - #include "IPCTypeHandler.h" #include namespace facelift { -class FaceliftIPCCommonLib_EXPORT DBusSignatureHelper { +class DBusSignatureHelper { public: diff --git a/src/ipc/ipc-common/IPCAdapterFactoryManager.h b/src/ipc/ipc-common/IPCAdapterFactoryManager.h index 907b19ae..0447f016 100644 --- a/src/ipc/ipc-common/IPCAdapterFactoryManager.h +++ b/src/ipc/ipc-common/IPCAdapterFactoryManager.h @@ -33,17 +33,11 @@ #include #include "NewIPCServiceAdapterBase.h" -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { class NewIPCServiceAdapterBase; -class FaceliftIPCCommonLib_EXPORT IPCAdapterFactoryManager +class IPCAdapterFactoryManager { public: typedef NewIPCServiceAdapterBase * (*IPCAdapterFactory)(InterfaceBase *); diff --git a/src/ipc/ipc-common/IPCAdapterModelPropertyHandler.h b/src/ipc/ipc-common/IPCAdapterModelPropertyHandler.h index 72481e98..432ea783 100644 --- a/src/ipc/ipc-common/IPCAdapterModelPropertyHandler.h +++ b/src/ipc/ipc-common/IPCAdapterModelPropertyHandler.h @@ -32,12 +32,6 @@ #include #include "ipc-common.h" -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { diff --git a/src/ipc/ipc-common/IPCAttachedPropertyFactory.h b/src/ipc/ipc-common/IPCAttachedPropertyFactory.h index 404ac404..84200c83 100644 --- a/src/ipc/ipc-common/IPCAttachedPropertyFactory.h +++ b/src/ipc/ipc-common/IPCAttachedPropertyFactory.h @@ -31,17 +31,11 @@ #include "NewIPCServiceAdapterBase.h" -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { class NewIPCServiceAdapterBase; -class FaceliftIPCCommonLib_EXPORT IPCAttachedPropertyFactory : public QObject +class IPCAttachedPropertyFactory : public QObject { Q_OBJECT diff --git a/src/ipc/ipc-common/IPCProxy.h b/src/ipc/ipc-common/IPCProxy.h index 37b8836b..af49a734 100644 --- a/src/ipc/ipc-common/IPCProxy.h +++ b/src/ipc/ipc-common/IPCProxy.h @@ -36,12 +36,6 @@ #include "LocalProviderBinder.h" #include "InterfaceManagerInterface.h" -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { template diff --git a/src/ipc/ipc-common/IPCProxyBase.h b/src/ipc/ipc-common/IPCProxyBase.h index 25701b8d..6e9e80cc 100644 --- a/src/ipc/ipc-common/IPCProxyBase.h +++ b/src/ipc/ipc-common/IPCProxyBase.h @@ -35,12 +35,6 @@ #include "IPCProxyBinderBase.h" -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { template diff --git a/src/ipc/ipc-common/IPCProxyBaseBase.h b/src/ipc/ipc-common/IPCProxyBaseBase.h index d2f63ab3..e4c27991 100644 --- a/src/ipc/ipc-common/IPCProxyBaseBase.h +++ b/src/ipc/ipc-common/IPCProxyBaseBase.h @@ -32,15 +32,9 @@ #include "ipc-common.h" -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { -class FaceliftIPCCommonLib_EXPORT IPCProxyBaseBase { +class IPCProxyBaseBase { public: diff --git a/src/ipc/ipc-common/IPCProxyBinderBase.h b/src/ipc/ipc-common/IPCProxyBinderBase.h index 40244750..e1c867fd 100644 --- a/src/ipc/ipc-common/IPCProxyBinderBase.h +++ b/src/ipc/ipc-common/IPCProxyBinderBase.h @@ -32,15 +32,9 @@ #include #include "ipc-common.h" -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { -class FaceliftIPCCommonLib_EXPORT IPCProxyBinderBase : public QObject +class IPCProxyBinderBase : public QObject { Q_OBJECT diff --git a/src/ipc/ipc-common/IPCProxyModelProperty.h b/src/ipc/ipc-common/IPCProxyModelProperty.h index 28aa5807..9e228d42 100644 --- a/src/ipc/ipc-common/IPCProxyModelProperty.h +++ b/src/ipc/ipc-common/IPCProxyModelProperty.h @@ -31,12 +31,6 @@ #include -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { template diff --git a/src/ipc/ipc-common/IPCProxyNewBase.h b/src/ipc/ipc-common/IPCProxyNewBase.h index afe121fb..2644e7c6 100644 --- a/src/ipc/ipc-common/IPCProxyNewBase.h +++ b/src/ipc/ipc-common/IPCProxyNewBase.h @@ -32,15 +32,9 @@ #include #include "IPCProxyBinderBase.h" -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { -class FaceliftIPCCommonLib_EXPORT IPCProxyNewBase +class IPCProxyNewBase { public: IPCProxyNewBase(InterfaceBase &owner); diff --git a/src/ipc/ipc-common/IPCServiceAdapter.h b/src/ipc/ipc-common/IPCServiceAdapter.h index 178fad10..fe2f5626 100644 --- a/src/ipc/ipc-common/IPCServiceAdapter.h +++ b/src/ipc/ipc-common/IPCServiceAdapter.h @@ -32,12 +32,6 @@ #include "IPCServiceAdapterBase.h" #include "NewIPCServiceAdapterBase.h" -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { class IPCAdapterFactoryManager; diff --git a/src/ipc/ipc-common/IPCServiceAdapterBase.h b/src/ipc/ipc-common/IPCServiceAdapterBase.h index 10fc8012..b1f51b88 100644 --- a/src/ipc/ipc-common/IPCServiceAdapterBase.h +++ b/src/ipc/ipc-common/IPCServiceAdapterBase.h @@ -33,16 +33,10 @@ #include "FaceliftModel.h" -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { -class FaceliftIPCCommonLib_EXPORT IPCServiceAdapterBase : public QObject +class IPCServiceAdapterBase : public QObject { Q_OBJECT diff --git a/src/ipc/ipc-common/IPCTypeHandler.h b/src/ipc/ipc-common/IPCTypeHandler.h index ac1d1169..a1159f61 100644 --- a/src/ipc/ipc-common/IPCTypeHandler.h +++ b/src/ipc/ipc-common/IPCTypeHandler.h @@ -30,12 +30,6 @@ #pragma once -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - #include "ipc-common.h" #include "ModelProperty.h" #include "OutputPayLoad.h" diff --git a/src/ipc/ipc-common/IPCTypeRegisterHandler.h b/src/ipc/ipc-common/IPCTypeRegisterHandler.h index 7e5c3162..105e8d42 100644 --- a/src/ipc/ipc-common/IPCTypeRegisterHandler.h +++ b/src/ipc/ipc-common/IPCTypeRegisterHandler.h @@ -30,12 +30,6 @@ #pragma once -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - #include #include "FaceliftModel.h" diff --git a/src/ipc/ipc-common/InputPayLoad.h b/src/ipc/ipc-common/InputPayLoad.h index 56c637ce..d8a0a035 100644 --- a/src/ipc/ipc-common/InputPayLoad.h +++ b/src/ipc/ipc-common/InputPayLoad.h @@ -29,18 +29,12 @@ **********************************************************************/ #pragma once -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - #include #include namespace facelift { -class FaceliftIPCCommonLib_EXPORT InputPayLoad +class InputPayLoad { public: diff --git a/src/ipc/ipc-common/InterfaceManager.h b/src/ipc/ipc-common/InterfaceManager.h index c09cdaf6..5960afc3 100644 --- a/src/ipc/ipc-common/InterfaceManager.h +++ b/src/ipc/ipc-common/InterfaceManager.h @@ -34,12 +34,6 @@ #include "Registry.h" #include "InterfaceManagerInterface.h" -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { class InterfaceBase; @@ -47,7 +41,7 @@ class InterfaceBase; /** * This class maintains a registry of IPC services registered locally, which enables local proxies to get a direct reference to them */ -class FaceliftIPCCommonLib_EXPORT InterfaceManager : public InterfaceManagerInterface +class InterfaceManager : public InterfaceManagerInterface { Q_OBJECT diff --git a/src/ipc/ipc-common/InterfaceManagerInterface.h b/src/ipc/ipc-common/InterfaceManagerInterface.h index 002a4b5a..5ceb2774 100644 --- a/src/ipc/ipc-common/InterfaceManagerInterface.h +++ b/src/ipc/ipc-common/InterfaceManagerInterface.h @@ -34,17 +34,11 @@ #include #include "Registry.h" -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { class NewIPCServiceAdapterBase; -class FaceliftIPCCommonLib_EXPORT InterfaceManagerInterface : public QObject +class InterfaceManagerInterface : public QObject { Q_OBJECT public: diff --git a/src/ipc/ipc-common/LocalProviderBinder.h b/src/ipc/ipc-common/LocalProviderBinder.h index c2824750..89fb4176 100644 --- a/src/ipc/ipc-common/LocalProviderBinder.h +++ b/src/ipc/ipc-common/LocalProviderBinder.h @@ -35,12 +35,6 @@ #include "InterfaceManagerInterface.h" #include "NewIPCServiceAdapterBase.h" -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { template diff --git a/src/ipc/ipc-common/LocalProviderBinderBase.cpp b/src/ipc/ipc-common/LocalProviderBinderBase.cpp index 3114d144..cba86bb8 100644 --- a/src/ipc/ipc-common/LocalProviderBinderBase.cpp +++ b/src/ipc/ipc-common/LocalProviderBinderBase.cpp @@ -31,12 +31,6 @@ #include "LocalProviderBinderBase.h" -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { LocalProviderBinderBase::LocalProviderBinderBase(InterfaceManagerInterface& interfaceManager, IPCProxyNewBase &proxy) : diff --git a/src/ipc/ipc-common/LocalProviderBinderBase.h b/src/ipc/ipc-common/LocalProviderBinderBase.h index 20065fb9..f137f7e6 100644 --- a/src/ipc/ipc-common/LocalProviderBinderBase.h +++ b/src/ipc/ipc-common/LocalProviderBinderBase.h @@ -33,12 +33,6 @@ #include "InterfaceManagerInterface.h" #include "IPCProxyNewBase.h" -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { class LocalProviderBinderBase : public QObject { diff --git a/src/ipc/ipc-common/ModuleIPCBase.h b/src/ipc/ipc-common/ModuleIPCBase.h index 339fbfbc..9b263abe 100644 --- a/src/ipc/ipc-common/ModuleIPCBase.h +++ b/src/ipc/ipc-common/ModuleIPCBase.h @@ -32,15 +32,9 @@ #include -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { -class FaceliftIPCCommonLib_EXPORT ModuleIPCBase { +class ModuleIPCBase { public: diff --git a/src/ipc/ipc-common/NewIPCServiceAdapterBase.h b/src/ipc/ipc-common/NewIPCServiceAdapterBase.h index 00bd55a4..6f3c2d1e 100644 --- a/src/ipc/ipc-common/NewIPCServiceAdapterBase.h +++ b/src/ipc/ipc-common/NewIPCServiceAdapterBase.h @@ -36,16 +36,10 @@ #include "span.h" #include "InterfaceManagerInterface.h" -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { -class FaceliftIPCCommonLib_EXPORT NewIPCServiceAdapterBase : public QObject +class NewIPCServiceAdapterBase : public QObject { Q_OBJECT diff --git a/src/ipc/ipc-common/NotAvailableImpl.h b/src/ipc/ipc-common/NotAvailableImpl.h index 8f29b7ff..342e6d57 100644 --- a/src/ipc/ipc-common/NotAvailableImpl.h +++ b/src/ipc/ipc-common/NotAvailableImpl.h @@ -32,12 +32,6 @@ #include "FaceliftModel.h" #include "NotAvailableImplBase.h" -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { template diff --git a/src/ipc/ipc-common/NotAvailableImplBase.h b/src/ipc/ipc-common/NotAvailableImplBase.h index ad639a69..5793ce17 100644 --- a/src/ipc/ipc-common/NotAvailableImplBase.h +++ b/src/ipc/ipc-common/NotAvailableImplBase.h @@ -31,15 +31,9 @@ #include "FaceliftModel.h" -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { -class FaceliftIPCCommonLib_EXPORT NotAvailableImplBase +class NotAvailableImplBase { protected: diff --git a/src/ipc/ipc-common/OutputPayLoad.h b/src/ipc/ipc-common/OutputPayLoad.h index 436aca87..443b1d0e 100644 --- a/src/ipc/ipc-common/OutputPayLoad.h +++ b/src/ipc/ipc-common/OutputPayLoad.h @@ -32,15 +32,9 @@ #include #include -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { -class FaceliftIPCCommonLib_EXPORT OutputPayLoad +class OutputPayLoad { public: diff --git a/src/ipc/ipc-common/SerializeParameterFunction.h b/src/ipc/ipc-common/SerializeParameterFunction.h index 89a9c757..21d924a0 100644 --- a/src/ipc/ipc-common/SerializeParameterFunction.h +++ b/src/ipc/ipc-common/SerializeParameterFunction.h @@ -30,12 +30,6 @@ #pragma once -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - #include #include "OutputPayLoad.h" diff --git a/src/ipc/ipc-common/StaticArrayReference.h b/src/ipc/ipc-common/StaticArrayReference.h index 20c7a321..064d5399 100644 --- a/src/ipc/ipc-common/StaticArrayReference.h +++ b/src/ipc/ipc-common/StaticArrayReference.h @@ -31,12 +31,6 @@ #include -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { template diff --git a/src/ipc/ipc-common/ipc-common.h b/src/ipc/ipc-common/ipc-common.h index 81878ff4..3f336d1f 100644 --- a/src/ipc/ipc-common/ipc-common.h +++ b/src/ipc/ipc-common/ipc-common.h @@ -30,12 +30,6 @@ #pragma once -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - #include #include "FaceliftModel.h" @@ -46,7 +40,7 @@ namespace facelift { -FaceliftIPCCommonLib_EXPORT Q_DECLARE_LOGGING_CATEGORY(LogIpc) +Q_DECLARE_LOGGING_CATEGORY(LogIpc) enum class CommonSignalID { readyChanged, diff --git a/src/ipc/ipc-common/ipc-serialization.h b/src/ipc/ipc-common/ipc-serialization.h index 62c269e2..413cedeb 100644 --- a/src/ipc/ipc-common/ipc-serialization.h +++ b/src/ipc/ipc-common/ipc-serialization.h @@ -30,12 +30,6 @@ #pragma once -#if defined(FaceliftIPCCommonLib_LIBRARY) -# define FaceliftIPCCommonLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCCommonLib_EXPORT Q_DECL_IMPORT -#endif - #include #include "ipc-common.h" diff --git a/src/ipc/local/FaceliftIPCCommon.h b/src/ipc/local/FaceliftIPCCommon.h index 8942adc1..4362aad2 100644 --- a/src/ipc/local/FaceliftIPCCommon.h +++ b/src/ipc/local/FaceliftIPCCommon.h @@ -31,16 +31,10 @@ #include "FaceliftUtils.h" -#if defined(FaceliftIPCLocalLib_LIBRARY) -# define FaceliftIPCLocalLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCLocalLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { namespace local { -struct FaceliftIPCLocalLib_EXPORT FaceliftIPCCommon +struct FaceliftIPCCommon { static constexpr const char *GET_PROPERTIES_MESSAGE_NAME = "GetAllProperties"; static constexpr const char *PROPERTIES_CHANGED_SIGNAL_NAME = "PropertiesChanged"; diff --git a/src/ipc/local/LocalIPC-serialization.h b/src/ipc/local/LocalIPC-serialization.h index fdd626d7..35e55e02 100644 --- a/src/ipc/local/LocalIPC-serialization.h +++ b/src/ipc/local/LocalIPC-serialization.h @@ -30,12 +30,6 @@ #pragma once -#if defined(FaceliftIPCLocalLib_LIBRARY) -# define FaceliftIPCLocalLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCLocalLib_EXPORT Q_DECL_IMPORT -#endif - #include "LocalIPCMessage.h" #include "ipc-serialization.h" #include "LocalIPCProxy.h" diff --git a/src/ipc/local/LocalIPCMessage.h b/src/ipc/local/LocalIPCMessage.h index 7d2a68d1..168e08d8 100644 --- a/src/ipc/local/LocalIPCMessage.h +++ b/src/ipc/local/LocalIPCMessage.h @@ -30,12 +30,6 @@ #pragma once -#if defined(FaceliftIPCLocalLib_LIBRARY) -# define FaceliftIPCLocalLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCLocalLib_EXPORT Q_DECL_IMPORT -#endif - #include #include @@ -57,7 +51,7 @@ namespace local { using namespace facelift; -class FaceliftIPCLocalLib_EXPORT LocalIPCMessage +class LocalIPCMessage { enum class MessageType { diff --git a/src/ipc/local/LocalIPCProxy.h b/src/ipc/local/LocalIPCProxy.h index 947f7a3a..bfaf1a7c 100644 --- a/src/ipc/local/LocalIPCProxy.h +++ b/src/ipc/local/LocalIPCProxy.h @@ -34,12 +34,6 @@ #include "IPCProxyBase.h" #include "LocalIPCProxyBase.h" -#if defined(FaceliftIPCLocalLib_LIBRARY) -# define FaceliftIPCLocalLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCLocalLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { namespace local { diff --git a/src/ipc/local/LocalIPCProxyBase.h b/src/ipc/local/LocalIPCProxyBase.h index d8476c6d..10b05b0b 100644 --- a/src/ipc/local/LocalIPCProxyBase.h +++ b/src/ipc/local/LocalIPCProxyBase.h @@ -35,17 +35,11 @@ #include "LocalIPCRequestHandler.h" #include "LocalIPCProxyBinder.h" -#if defined(FaceliftIPCLocalLib_LIBRARY) -# define FaceliftIPCLocalLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCLocalLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { namespace local { -class FaceliftIPCLocalLib_EXPORT LocalIPCProxyBase : protected LocalIPCRequestHandler +class LocalIPCProxyBase : protected LocalIPCRequestHandler { public: LocalIPCProxyBase(LocalIPCProxyBinder &ipcBinder); diff --git a/src/ipc/local/LocalIPCProxyBinder.h b/src/ipc/local/LocalIPCProxyBinder.h index 3818b260..6502e21b 100644 --- a/src/ipc/local/LocalIPCProxyBinder.h +++ b/src/ipc/local/LocalIPCProxyBinder.h @@ -34,12 +34,6 @@ #include "IPCProxyBase.h" #include "LocalIPCRequestHandler.h" -#if defined(FaceliftIPCLocalLib_LIBRARY) -# define FaceliftIPCLocalLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCLocalLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { namespace local { @@ -48,7 +42,7 @@ using namespace facelift; class LocalIPCServiceAdapterBase; -class FaceliftIPCLocalLib_EXPORT LocalIPCProxyBinder : public IPCProxyBinderBase +class LocalIPCProxyBinder : public IPCProxyBinderBase { Q_OBJECT diff --git a/src/ipc/local/LocalIPCRegistry.h b/src/ipc/local/LocalIPCRegistry.h index 4be71e24..48ad9f8e 100644 --- a/src/ipc/local/LocalIPCRegistry.h +++ b/src/ipc/local/LocalIPCRegistry.h @@ -30,12 +30,6 @@ #pragma once -#if defined(FaceliftIPCLocalLib_LIBRARY) -# define FaceliftIPCLocalLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCLocalLib_EXPORT Q_DECL_IMPORT -#endif - #include #include @@ -46,7 +40,7 @@ namespace facelift { namespace local { -class FaceliftIPCLocalLib_EXPORT LocalIPCRegistry : public QObject +class LocalIPCRegistry : public QObject { Q_OBJECT diff --git a/src/ipc/local/LocalIPCRequestHandler.h b/src/ipc/local/LocalIPCRequestHandler.h index c0646123..641173b1 100644 --- a/src/ipc/local/LocalIPCRequestHandler.h +++ b/src/ipc/local/LocalIPCRequestHandler.h @@ -30,12 +30,6 @@ #pragma once -#if defined(FaceliftIPCLocalLib_LIBRARY) -# define FaceliftIPCLocalLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCLocalLib_EXPORT Q_DECL_IMPORT -#endif - #include #include @@ -57,7 +51,7 @@ namespace local { using namespace facelift; -class FaceliftIPCLocalLib_EXPORT LocalIPCRequestHandler +class LocalIPCRequestHandler { public: diff --git a/src/ipc/local/LocalIPCServiceAdapter.h b/src/ipc/local/LocalIPCServiceAdapter.h index 004439d8..3cc34f41 100644 --- a/src/ipc/local/LocalIPCServiceAdapter.h +++ b/src/ipc/local/LocalIPCServiceAdapter.h @@ -34,12 +34,6 @@ #include "IPCServiceAdapterBase.h" #include "LocalIPCServiceAdapterBase.h" -#if defined(FaceliftIPCLocalLib_LIBRARY) -# define FaceliftIPCLocalLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCLocalLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { namespace local { diff --git a/src/ipc/local/LocalIPCServiceAdapterBase.h b/src/ipc/local/LocalIPCServiceAdapterBase.h index 4911cec6..f273a1ab 100644 --- a/src/ipc/local/LocalIPCServiceAdapterBase.h +++ b/src/ipc/local/LocalIPCServiceAdapterBase.h @@ -33,19 +33,13 @@ #include "LocalIPCMessage.h" #include "IPCServiceAdapterBase.h" -#if defined(FaceliftIPCLocalLib_LIBRARY) -# define FaceliftIPCLocalLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftIPCLocalLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { namespace local { using namespace facelift; -class FaceliftIPCLocalLib_EXPORT LocalIPCServiceAdapterBase : public IPCServiceAdapterBase +class LocalIPCServiceAdapterBase : public IPCServiceAdapterBase { Q_OBJECT diff --git a/src/model/AsyncAnswer.h b/src/model/AsyncAnswer.h index 5e66d945..f0ce35d4 100644 --- a/src/model/AsyncAnswer.h +++ b/src/model/AsyncAnswer.h @@ -38,12 +38,6 @@ #include "TAsyncAnswerMaster.h" #include "FaceliftCommon.h" -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { template diff --git a/src/model/BinarySeralizer.h b/src/model/BinarySeralizer.h index 226d43c8..c3c4fb1a 100644 --- a/src/model/BinarySeralizer.h +++ b/src/model/BinarySeralizer.h @@ -34,7 +34,7 @@ namespace facelift { -struct FaceliftModelLib_EXPORT BinarySeralizer +struct BinarySeralizer { BinarySeralizer(QByteArray &array) : stream(&array, QIODevice::WriteOnly) { diff --git a/src/model/FaceliftCommon.h b/src/model/FaceliftCommon.h index 92521409..783be8e8 100644 --- a/src/model/FaceliftCommon.h +++ b/src/model/FaceliftCommon.h @@ -35,12 +35,6 @@ #include #include -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - #define STRINGIFY_(x) # x #define STRINGIFY(x) STRINGIFY_(x) @@ -54,8 +48,8 @@ void M_UNUSED(const Args & ...) namespace facelift { -FaceliftModelLib_EXPORT Q_DECLARE_LOGGING_CATEGORY(LogGeneral) -FaceliftModelLib_EXPORT Q_DECLARE_LOGGING_CATEGORY(LogModel) +Q_DECLARE_LOGGING_CATEGORY(LogGeneral) +Q_DECLARE_LOGGING_CATEGORY(LogModel) typedef int ModelElementID; diff --git a/src/model/FaceliftEnum.h b/src/model/FaceliftEnum.h index df45946d..3d86f899 100644 --- a/src/model/FaceliftEnum.h +++ b/src/model/FaceliftEnum.h @@ -30,12 +30,6 @@ #pragma once -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - #include "FaceliftCommon.h" #include #include diff --git a/src/model/FaceliftModel.h b/src/model/FaceliftModel.h index ac8226f9..f00e7125 100644 --- a/src/model/FaceliftModel.h +++ b/src/model/FaceliftModel.h @@ -47,12 +47,6 @@ #include "PropertyBase.h" #include "StructureFactoryBase.h" -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { diff --git a/src/model/InterfaceBase.h b/src/model/InterfaceBase.h index 161f912b..1770b7cd 100644 --- a/src/model/InterfaceBase.h +++ b/src/model/InterfaceBase.h @@ -34,19 +34,13 @@ #include -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { /** * Base interface which every interface inherits from */ -class FaceliftModelLib_EXPORT InterfaceBase : public QObject +class InterfaceBase : public QObject { Q_OBJECT @@ -106,7 +100,7 @@ class FaceliftModelLib_EXPORT InterfaceBase : public QObject }; -FaceliftModelLib_EXPORT void registerInterfaceImplementationInstance(InterfaceBase&); +void registerInterfaceImplementationInstance(InterfaceBase&); } diff --git a/src/model/Model.h b/src/model/Model.h index e4f9d378..a7e9ffd5 100644 --- a/src/model/Model.h +++ b/src/model/Model.h @@ -32,12 +32,6 @@ #include "ModelBase.h" -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { diff --git a/src/model/ModelBase.h b/src/model/ModelBase.h index ff76167f..b55d51d3 100644 --- a/src/model/ModelBase.h +++ b/src/model/ModelBase.h @@ -31,15 +31,9 @@ #include -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { -class FaceliftModelLib_EXPORT ModelBase : public QObject +class ModelBase : public QObject { Q_OBJECT diff --git a/src/model/ModelListModelBase.h b/src/model/ModelListModelBase.h index 9ea26c93..de44df72 100644 --- a/src/model/ModelListModelBase.h +++ b/src/model/ModelListModelBase.h @@ -40,7 +40,7 @@ namespace facelift { class IPCAttachedPropertyFactory; class IPCServiceAdapterBase; -class FaceliftModelLib_EXPORT ModelListModelBase : public QAbstractListModel +class ModelListModelBase : public QAbstractListModel { Q_OBJECT diff --git a/src/model/ModelPropertyInterface.h b/src/model/ModelPropertyInterface.h index fafb62e5..2860bb91 100644 --- a/src/model/ModelPropertyInterface.h +++ b/src/model/ModelPropertyInterface.h @@ -32,12 +32,6 @@ #include "Model.h" -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { diff --git a/src/model/ModelQMLImplementationBase.h b/src/model/ModelQMLImplementationBase.h index 190a8897..ef4ab819 100644 --- a/src/model/ModelQMLImplementationBase.h +++ b/src/model/ModelQMLImplementationBase.h @@ -38,7 +38,7 @@ namespace facelift { /** * Base class for QML-based interface implementations */ -class FaceliftModelLib_EXPORT ModelQMLImplementationBase : public QObject, public QQmlParserStatus +class ModelQMLImplementationBase : public QObject, public QQmlParserStatus { Q_OBJECT Q_INTERFACES(QQmlParserStatus) diff --git a/src/model/ModuleBase.h b/src/model/ModuleBase.h index b96cff0b..04c323fa 100644 --- a/src/model/ModuleBase.h +++ b/src/model/ModuleBase.h @@ -32,12 +32,6 @@ #include -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { /** @@ -53,7 +47,7 @@ inline int qRegisterMetaType() /** * Base class for all generated Module classes */ -class FaceliftModelLib_EXPORT ModuleBase +class ModuleBase { public: diff --git a/src/model/PropertyBase.h b/src/model/PropertyBase.h index 7477c887..7d330aca 100644 --- a/src/model/PropertyBase.h +++ b/src/model/PropertyBase.h @@ -37,7 +37,7 @@ namespace facelift { -class FaceliftModelLib_EXPORT PropertyBase +class PropertyBase { public: diff --git a/src/model/PropertyInit.h b/src/model/PropertyInit.h index 6df32f75..af768ef0 100644 --- a/src/model/PropertyInit.h +++ b/src/model/PropertyInit.h @@ -33,16 +33,10 @@ #include "FaceliftCommon.h" #include "ModelProperty.h" -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { -struct FaceliftModelLib_EXPORT PropertyInit { +struct PropertyInit { using ChangeSignal = void (QObject::*)(); diff --git a/src/model/PropertyInterface.h b/src/model/PropertyInterface.h index 56f6ed71..ae193411 100644 --- a/src/model/PropertyInterface.h +++ b/src/model/PropertyInterface.h @@ -30,12 +30,6 @@ #pragma once -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { diff --git a/src/model/QMLAdapterBase.h b/src/model/QMLAdapterBase.h index 624637f8..9e9982cc 100644 --- a/src/model/QMLAdapterBase.h +++ b/src/model/QMLAdapterBase.h @@ -42,7 +42,7 @@ namespace facelift { /*! * This is the base class which all QML frontends extend */ -class FaceliftModelLib_EXPORT QMLAdapterBase : public QObject, public QQmlParserStatus +class QMLAdapterBase : public QObject, public QQmlParserStatus { Q_OBJECT Q_INTERFACES(QQmlParserStatus) diff --git a/src/model/QMLImplListProperty.h b/src/model/QMLImplListProperty.h index aa818708..db52eee3 100644 --- a/src/model/QMLImplListProperty.h +++ b/src/model/QMLImplListProperty.h @@ -32,12 +32,6 @@ #include "TQMLImplListProperty.h" -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { template diff --git a/src/model/QMLImplListPropertyBase.h b/src/model/QMLImplListPropertyBase.h index 8b4d5b29..53b76df1 100644 --- a/src/model/QMLImplListPropertyBase.h +++ b/src/model/QMLImplListPropertyBase.h @@ -33,16 +33,10 @@ #include -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { -class FaceliftModelLib_EXPORT QMLImplListPropertyBase : public QObject +class QMLImplListPropertyBase : public QObject { Q_OBJECT diff --git a/src/model/QMLImplMapProperty.h b/src/model/QMLImplMapProperty.h index 30217769..fec5e583 100644 --- a/src/model/QMLImplMapProperty.h +++ b/src/model/QMLImplMapProperty.h @@ -32,12 +32,6 @@ #include "TQMLImplMapProperty.h" -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { template diff --git a/src/model/QMLImplMapPropertyBase.h b/src/model/QMLImplMapPropertyBase.h index e157b7a7..c430683f 100644 --- a/src/model/QMLImplMapPropertyBase.h +++ b/src/model/QMLImplMapPropertyBase.h @@ -33,16 +33,10 @@ #include #include -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { -class FaceliftModelLib_EXPORT QMLImplMapPropertyBase : public QObject +class QMLImplMapPropertyBase : public QObject { Q_OBJECT diff --git a/src/model/QMLModelImplementationFrontendBase.h b/src/model/QMLModelImplementationFrontendBase.h index c2072da5..4cc683e1 100644 --- a/src/model/QMLModelImplementationFrontendBase.h +++ b/src/model/QMLModelImplementationFrontendBase.h @@ -34,7 +34,7 @@ class QQmlEngine; namespace facelift { -class FaceliftModelLib_EXPORT QMLModelImplementationFrontendBase +class QMLModelImplementationFrontendBase { protected: QQmlEngine *qmlEngine(); diff --git a/src/model/QObjectWrapperPointerBase.h b/src/model/QObjectWrapperPointerBase.h index 7e28b358..bf2ba54c 100644 --- a/src/model/QObjectWrapperPointerBase.h +++ b/src/model/QObjectWrapperPointerBase.h @@ -39,7 +39,7 @@ namespace facelift { -class FaceliftModelLib_EXPORT QObjectWrapperPointerBase +class QObjectWrapperPointerBase { public: diff --git a/src/model/ServicePropertyInterface.h b/src/model/ServicePropertyInterface.h index c04ff454..76582603 100644 --- a/src/model/ServicePropertyInterface.h +++ b/src/model/ServicePropertyInterface.h @@ -30,12 +30,6 @@ #pragma once -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { diff --git a/src/model/ServiceWrapperBase.h b/src/model/ServiceWrapperBase.h index 8cfad387..c1b219bd 100644 --- a/src/model/ServiceWrapperBase.h +++ b/src/model/ServiceWrapperBase.h @@ -35,7 +35,7 @@ namespace facelift { -class FaceliftModelLib_EXPORT ServiceWrapperBase +class ServiceWrapperBase { protected: diff --git a/src/model/StringConversionHandler.h b/src/model/StringConversionHandler.h index e4d789ea..9e68f93a 100644 --- a/src/model/StringConversionHandler.h +++ b/src/model/StringConversionHandler.h @@ -65,7 +65,7 @@ struct StringConversionHandler } }; -FaceliftModelLib_EXPORT QString qObjectToString(const QObject *o); +QString qObjectToString(const QObject *o); template struct StringConversionHandler::value>::type> diff --git a/src/model/StructQObjectWrapper.h b/src/model/StructQObjectWrapper.h index d28c2afd..dbce4b69 100644 --- a/src/model/StructQObjectWrapper.h +++ b/src/model/StructQObjectWrapper.h @@ -39,12 +39,6 @@ #include "QMLImplMapProperty.h" -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { template diff --git a/src/model/StructQObjectWrapperBase.h b/src/model/StructQObjectWrapperBase.h index cab31918..9ab1aef5 100644 --- a/src/model/StructQObjectWrapperBase.h +++ b/src/model/StructQObjectWrapperBase.h @@ -32,16 +32,10 @@ #include -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { -class FaceliftModelLib_EXPORT StructQObjectWrapperBase : public QObject +class StructQObjectWrapperBase : public QObject { Q_OBJECT diff --git a/src/model/Structure.h b/src/model/Structure.h index fb54c2ba..3a243416 100644 --- a/src/model/Structure.h +++ b/src/model/Structure.h @@ -36,12 +36,6 @@ #include "StructureBase.h" #include "StringConversionHandler.h" -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { template diff --git a/src/model/StructureBase.h b/src/model/StructureBase.h index 0645411e..56aa7c34 100644 --- a/src/model/StructureBase.h +++ b/src/model/StructureBase.h @@ -34,15 +34,9 @@ #include "FaceliftCommon.h" -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { -class FaceliftModelLib_EXPORT StructureBase +class StructureBase { Q_GADGET diff --git a/src/model/StructureFactoryBase.h b/src/model/StructureFactoryBase.h index 026bf018..3fda13d0 100644 --- a/src/model/StructureFactoryBase.h +++ b/src/model/StructureFactoryBase.h @@ -33,16 +33,10 @@ #include #include -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { -class FaceliftModelLib_EXPORT StructureFactoryBase : public QObject +class StructureFactoryBase : public QObject { Q_OBJECT diff --git a/src/model/TAsyncAnswerMaster.h b/src/model/TAsyncAnswerMaster.h index 32eb9ed2..8aa54bb2 100644 --- a/src/model/TAsyncAnswerMaster.h +++ b/src/model/TAsyncAnswerMaster.h @@ -34,12 +34,6 @@ #include "TAsyncAnswerMasterBase.h" -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { diff --git a/src/model/TQMLImplListProperty.h b/src/model/TQMLImplListProperty.h index c7907554..f29cbbc3 100644 --- a/src/model/TQMLImplListProperty.h +++ b/src/model/TQMLImplListProperty.h @@ -38,12 +38,6 @@ #include "TProperty.h" #include "QMLImplListPropertyBase.h" -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { template diff --git a/src/model/TQMLImplMapProperty.h b/src/model/TQMLImplMapProperty.h index 80f6e21b..a8c75078 100644 --- a/src/model/TQMLImplMapProperty.h +++ b/src/model/TQMLImplMapProperty.h @@ -42,12 +42,6 @@ #include "QMLImplMapPropertyBase.h" -#if defined(FaceliftModelLib_LIBRARY) -# define FaceliftModelLib_EXPORT Q_DECL_EXPORT -#else -# define FaceliftModelLib_EXPORT Q_DECL_IMPORT -#endif - namespace facelift { template diff --git a/src/model/TypeHandlerBase.h b/src/model/TypeHandlerBase.h index 94931c67..8a963b76 100644 --- a/src/model/TypeHandlerBase.h +++ b/src/model/TypeHandlerBase.h @@ -39,7 +39,7 @@ namespace facelift { -struct FaceliftModelLib_EXPORT TypeHandlerBase +struct TypeHandlerBase { template diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 6dafed20..44ffea45 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -8,9 +8,7 @@ else() add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure) endif() -if(NOT WIN32) - add_subdirectory(manual) -endif() +add_subdirectory(manual) add_subdirectory(cmake) From 96846c9923e0b680bca75e13a58e08572e596d5e Mon Sep 17 00:00:00 2001 From: Radoslaw Buczkowski Date: Fri, 16 Oct 2020 07:41:27 +0200 Subject: [PATCH 2/4] Remove FaceliftPlugin lib (#314) Co-authored-by: Radoslaw Buczkowski --- src/CMakeLists.txt | 1 - src/plugin/CMakeLists.txt | 5 ----- src/plugin/FaceliftPlugin.cpp | 36 ------------------------------ src/plugin/FaceliftPlugin.h | 42 ----------------------------------- 4 files changed, 84 deletions(-) delete mode 100644 src/plugin/CMakeLists.txt delete mode 100644 src/plugin/FaceliftPlugin.cpp delete mode 100644 src/plugin/FaceliftPlugin.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c51c7ca1..5ab6f041 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,3 @@ add_subdirectory(common) add_subdirectory(model) add_subdirectory(ipc) -add_subdirectory(plugin) diff --git a/src/plugin/CMakeLists.txt b/src/plugin/CMakeLists.txt deleted file mode 100644 index b865463d..00000000 --- a/src/plugin/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -facelift_add_qml_plugin(FaceliftPlugin - URI facelift - SOURCES FaceliftPlugin.cpp - HEADERS FaceliftPlugin.h -) diff --git a/src/plugin/FaceliftPlugin.cpp b/src/plugin/FaceliftPlugin.cpp deleted file mode 100644 index 11549107..00000000 --- a/src/plugin/FaceliftPlugin.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/********************************************************************** -** -** Copyright (C) 2018 Luxoft Sweden AB -** -** This file is part of the FaceLift project -** -** Permission is hereby granted, free of charge, to any person -** obtaining a copy of this software and associated documentation files -** (the "Software"), to deal in the Software without restriction, -** including without limitation the rights to use, copy, modify, merge, -** publish, distribute, sublicense, and/or sell copies of the Software, -** and to permit persons to whom the Software is furnished to do so, -** subject to the following conditions: -** -** The above copyright notice and this permission notice shall be -** included in all copies or substantial portions of the Software. -** -** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -** BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -** ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -** CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -** SOFTWARE. -** -** SPDX-License-Identifier: MIT -** -**********************************************************************/ - -#include "FaceliftPlugin.h" - -void FaceliftPlugin::registerTypes(const char *uri) -{ - Q_UNUSED(uri); -} diff --git a/src/plugin/FaceliftPlugin.h b/src/plugin/FaceliftPlugin.h deleted file mode 100644 index ee395841..00000000 --- a/src/plugin/FaceliftPlugin.h +++ /dev/null @@ -1,42 +0,0 @@ -/********************************************************************** -** -** Copyright (C) 2018 Luxoft Sweden AB -** -** This file is part of the FaceLift project -** -** Permission is hereby granted, free of charge, to any person -** obtaining a copy of this software and associated documentation files -** (the "Software"), to deal in the Software without restriction, -** including without limitation the rights to use, copy, modify, merge, -** publish, distribute, sublicense, and/or sell copies of the Software, -** and to permit persons to whom the Software is furnished to do so, -** subject to the following conditions: -** -** The above copyright notice and this permission notice shall be -** included in all copies or substantial portions of the Software. -** -** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -** BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -** ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -** CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -** SOFTWARE. -** -** SPDX-License-Identifier: MIT -** -**********************************************************************/ - -#pragma once - -#include - -class FaceliftPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "FaceliftPlugin") - -public: - void registerTypes(const char *uri) override; -}; From 8f4d2e9e3085af7b3b72041d7a237c738b55c304 Mon Sep 17 00:00:00 2001 From: Oleksandr Kunichik Date: Tue, 20 Oct 2020 15:28:16 +0300 Subject: [PATCH 3/4] Code generator: rewrite or create a new no-moc file (#315) --- codegen/facelift/facelift-codegen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen/facelift/facelift-codegen.py b/codegen/facelift/facelift-codegen.py index 3258a215..612c2ab5 100755 --- a/codegen/facelift/facelift-codegen.py +++ b/codegen/facelift/facelift-codegen.py @@ -432,7 +432,7 @@ def run_generation(input, output, dependency, all, noMocFilePath, noMocListFile) def generate(input, output, dependency, all, no_moc_file_path): """Takes several files or directories as input and generates the code in the given output directory.""" - with open('{}/no_moc.cmake'.format(output), 'a+') as noMocListFile: + with open('{}/no_moc.cmake'.format(output), 'w') as noMocListFile: noMocListFile.write('set(HEADERS_NO_MOC_GENERATED\n') run_generation(input, output, dependency, all, no_moc_file_path, noMocListFile) noMocListFile.write(')\n') From 229d7ad81d8c3e361a207251759b4fc9a6f225cb Mon Sep 17 00:00:00 2001 From: abel <62418739+pfagner@users.noreply.github.com> Date: Mon, 26 Oct 2020 18:48:45 +0100 Subject: [PATCH 4/4] Fix heap-use-after-free for FaceliftUtils (#319) --- src/common/FaceliftUtils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/FaceliftUtils.h b/src/common/FaceliftUtils.h index 62e76476..85655723 100644 --- a/src/common/FaceliftUtils.h +++ b/src/common/FaceliftUtils.h @@ -197,8 +197,8 @@ class MostRecentlyUsedCache void remove(const Key &key) { auto it = m_map.find(key); - m_map.erase(key); m_list.erase(it->second); + m_map.erase(key); } void clear()