Skip to content

Commit

Permalink
Merge pull request #1 from Pelagicore/master
Browse files Browse the repository at this point in the history
update the fork
  • Loading branch information
idleroamer authored Sep 14, 2020
2 parents 4f9709a + 13c2967 commit 3c8f9ad
Show file tree
Hide file tree
Showing 57 changed files with 470 additions and 2,892 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ option(FACELIFT_ENABLE_DBUS_IPC "Force DBus IPC support (no autodetection)" OFF)
option(FACELIFT_DISABLE_DBUS_IPC "Force disable DBus IPC support (no autodetection)" OFF)
option(FACELIFT_BUILD_EXAMPLES "Enable build of examples" ON)
option(FACELIFT_BUILD_TESTS "Enable build of tests" OFF)
option(FACELIFT_ENABLE_DESKTOP_DEV_TOOLS "Enable desktop development tools" OFF)
option(BUILD_SHARED_LIBS "Build shared libraries. If set to off, static libraries are built instead" ON)
option(FACELIFT_DISABLE_GTEST "Disable GTest-based unit tests" OFF)

Expand Down
10 changes: 0 additions & 10 deletions cmake/faceliftMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -293,16 +293,6 @@ function(facelift_add_interface TARGET_NAME)
PUBLIC_HEADER_BASE_PATH ${TYPES_OUTPUT_PATH}
)

if(TARGET FaceliftDesktopDevTools)
list(APPEND ARGS
SOURCES_GLOB_RECURSE ${DEVTOOLS_OUTPUT_PATH}/*.cpp
HEADERS_GLOB_RECURSE ${DEVTOOLS_OUTPUT_PATH}/*.h
LINK_LIBRARIES FaceliftDesktopDevTools
PUBLIC_HEADER_BASE_PATH ${DEVTOOLS_OUTPUT_PATH}
)
list(APPEND MODULE_COMPILE_DEFINITIONS ENABLE_DESKTOP_TOOLS)
endif()

if(TARGET FaceliftIPCLib)

if(TARGET FaceliftIPCLibDBus)
Expand Down
5 changes: 0 additions & 5 deletions codegen/facelift/facelift-codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,6 @@ def run_generation(input, output, dependency, libraryName, all):
generateFile(generator, 'module/{{path}}/Module.cpp', 'Module.template.cpp', ctx, libraryName, "")
generateFile(generator, 'ipc/{{path}}/ModuleIPC.h', 'ModuleIPC.template.h', ctx, libraryName, "")
generateFile(generator, 'ipc/{{path}}/ModuleIPC.cpp', 'ModuleIPC.template.cpp', ctx, libraryName, "")
generateFile(generator, 'devtools/{{path}}/ModuleMonitor.h', 'ModuleMonitor.template.h', ctx, libraryName, "")
generateFile(generator, 'devtools/{{path}}/ModuleMonitor.cpp', 'ModuleMonitor.template.cpp', ctx, libraryName, "")
generateFile(generator, 'devtools/{{path}}/ModuleDummy.h', 'DummyModule.template.h', ctx, libraryName, "")
for interface in module.interfaces:
log.debug('process interface %s' % interface)
ctx.update({'interface': interface})
Expand All @@ -382,8 +379,6 @@ def run_generation(input, output, dependency, libraryName, all):
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, "")
generateFile(generator, 'devtools/{{path}}/{{interface}}Dummy.h', 'DummyService.template.h', ctx, libraryName, "")
generateFile(generator, 'devtools/{{path}}/{{interface}}Monitor.h', 'ServiceMonitor.template.h', ctx, libraryName, "")

if isQMLImplementationEnabled(interface):
generateFile(generator, 'types/{{path}}/{{interface}}ImplementationBaseQML.h', 'ImplementationBaseQML.template.h', ctx, libraryName, "")
Expand Down
69 changes: 0 additions & 69 deletions codegen/facelift/templates/DummyModule.template.h

This file was deleted.

176 changes: 0 additions & 176 deletions codegen/facelift/templates/DummyService.template.h

This file was deleted.

4 changes: 3 additions & 1 deletion codegen/facelift/templates/IPCAdapter.template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "{{module.fullyQualifiedPath}}/{{interfaceName}}IPCAdapter.h"
#include "IPCServiceAdapterBase.h"
#include <array>
#include "InterfaceManager.h"

#ifdef DBUS_IPC_ENABLED
#include "{{module.fullyQualifiedPath}}/{{interfaceName}}IPCDBusAdapter.h"
Expand Down Expand Up @@ -76,7 +77,8 @@ struct {{interfaceName}}IPCAdapter::Impl {
};


{{interfaceName}}IPCAdapter::{{interfaceName}}IPCAdapter(QObject* parent) : BaseType(parent)
{{interfaceName}}IPCAdapter::{{interfaceName}}IPCAdapter(QObject* parent) :
BaseType(facelift::InterfaceManager::instance(), parent)
{
}

Expand Down
83 changes: 82 additions & 1 deletion codegen/facelift/templates/IPCDBusServiceAdapter.template.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,89 @@
****************************************************************************/
{% set baseClass = "::facelift::dbus::IPCDBusServiceAdapter<" + interfaceName + ">" %}
{% set proxyTypeNameSuffix = "IPCDBusAdapter" %}
{% set className = interfaceName + proxyTypeNameSuffix %}

#pragma once

{{classExportDefines}}

#include "FaceliftUtils.h"
#include "IPCDBusServiceAdapter.h"
#include "IPCAdapterModelPropertyHandler.h"
#include "DBusManager.h"

#include "{{module.fullyQualifiedPath}}/{{interfaceName}}.h"
#include "{{module.fullyQualifiedPath}}/{{interfaceName}}QMLAdapter.h"
#include "{{module.fullyQualifiedPath}}/{{interfaceName}}IPCCommon.h"

//// Sub interfaces
{% for property in interface.referencedInterfaceTypes %}
#include "{{property.fullyQualifiedPath}}{% if generateAsyncProxy %}Async{% endif %}{{proxyTypeNameSuffix}}.h"
{% endfor %}

{{module.namespaceCppOpen}}

class {{interfaceName}}IPCQMLAdapterType;

class {{classExport}} {{className}}: public {{baseClass}}
{
Q_OBJECT

public:

using ServiceType = {{interfaceName}};
using BaseType = {{baseClass}};
using ThisType = {{className}};
using SignalID = {{interface}}IPCCommon::SignalID;
using MethodID = {{interface}}IPCCommon::MethodID;

{{className}}(QObject* parent = nullptr) :
BaseType(facelift::dbus::DBusManager::instance(), parent)
{% for property in interface.properties %}
{% if property.type.is_model %}
, m_{{property.name}}Handler(*this)
{% endif %}
{% endfor %}
{
}

void appendDBUSIntrospectionData(QTextStream &s) const override;

::facelift::IPCHandlingResult handleMethodCallMessage(InputIPCMessage &requestMessage,
OutputIPCMessage &replyMessage) override;

void connectSignals() override;

void serializePropertyValues(OutputIPCMessage& msg, bool isCompleteSnapshot) override;

{% for event in interface.signals %}
void {{event}}(
{%- set comma = joiner(", ") -%}
{%- for parameter in event.parameters -%}
{{ comma() }}{{parameter.interfaceCppType}} {{parameter.name}}
{%- endfor -%} )
{
sendSignal(SignalID::{{event}}
{%- for parameter in event.parameters -%}
, {{parameter.name}}
{%- endfor -%} );
}
{% endfor %}

private:
{% for property in interface.properties %}
{% if property.type.is_model %}
::facelift::IPCAdapterModelPropertyHandler<ThisType, {{property.nestedType.interfaceCppType}}> m_{{property.name}}Handler;
{% elif property.type.is_interface %}
QString m_previous{{property.name}}ObjectPath;
{% else %}
{{property.interfaceCppType}} m_previous{{property.name}} {};
{% endif %}
{% if property.type.is_interface %}
InterfacePropertyIPCAdapterHandler<{{property.cppType}}, {{property.cppType}}{{proxyTypeNameSuffix}}> m_{{property.name}};
{% endif %}
{% endfor %}
};

{% include "IPCServiceAdapter.template.h" %}
{{module.namespaceCppClose}}

Loading

0 comments on commit 3c8f9ad

Please sign in to comment.