summaryrefslogtreecommitdiff
path: root/src/libs/qmlpuppetcommunication/interfaces/nodeinstanceserverinterface.cpp
blob: ffdf298aa6570daf944a4f05beb6cbd81f744fdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#include "nodeinstanceserverinterface.h"
#include <qmetatype.h>

#include "addimportcontainer.h"
#include "captureddatacommand.h"
#include "changeauxiliarycommand.h"
#include "changebindingscommand.h"
#include "changefileurlcommand.h"
#include "changeidscommand.h"
#include "changelanguagecommand.h"
#include "changenodesourcecommand.h"
#include "changepreviewimagesizecommand.h"
#include "changeselectioncommand.h"
#include "changestatecommand.h"
#include "changevaluescommand.h"
#include "childrenchangedcommand.h"
#include "clearscenecommand.h"
#include "completecomponentcommand.h"
#include "componentcompletedcommand.h"
#include "createinstancescommand.h"
#include "createscenecommand.h"
#include "debugoutputcommand.h"
#include "endpuppetcommand.h"
#include "imagecontainer.h"
#include "informationchangedcommand.h"
#include "inputeventcommand.h"
#include "instancecontainer.h"
#include "nanotracecommand.h"
#include "pixmapchangedcommand.h"
#include "propertyabstractcontainer.h"
#include "propertybindingcontainer.h"
#include "propertyvaluecontainer.h"
#include "puppetalivecommand.h"
#include "puppettocreatorcommand.h"
#include "removeinstancescommand.h"
#include "removepropertiescommand.h"
#include "removesharedmemorycommand.h"
#include "reparentinstancescommand.h"
#include "scenecreatedcommand.h"
#include "statepreviewimagechangedcommand.h"
#include "synchronizecommand.h"
#include "tokencommand.h"
#include "update3dviewstatecommand.h"
#include "valueschangedcommand.h"
#include "view3dactioncommand.h"
#include "requestmodelnodepreviewimagecommand.h"

#include <enumeration.h>

namespace QmlDesigner {

static bool isRegistered = false;

NodeInstanceServerInterface::NodeInstanceServerInterface(QObject *parent) :
    QObject(parent)
{
    registerCommands();
}

template<typename T>
inline void registerCommand(const char *typeName)
{
    qRegisterMetaType<T>(typeName);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
    qRegisterMetaTypeStreamOperators<T>(typeName);
#endif
}

void NodeInstanceServerInterface::registerCommands()
{
    if (isRegistered)
        return;

    isRegistered = true;

    registerCommand<CreateInstancesCommand>("CreateInstancesCommand");
    registerCommand<ClearSceneCommand>("ClearSceneCommand");
    registerCommand<CreateSceneCommand>("CreateSceneCommand");
    registerCommand<Update3dViewStateCommand>("Update3dViewStateCommand");
    registerCommand<ChangeBindingsCommand>("ChangeBindingsCommand");
    registerCommand<ChangeValuesCommand>("ChangeValuesCommand");
    registerCommand<ChangeFileUrlCommand>("ChangeFileUrlCommand");
    registerCommand<ChangeStateCommand>("ChangeStateCommand");
    registerCommand<RemoveInstancesCommand>("RemoveInstancesCommand");
    registerCommand<ChangeSelectionCommand>("ChangeSelectionCommand");
    registerCommand<RemovePropertiesCommand>("RemovePropertiesCommand");
    registerCommand<ReparentInstancesCommand>("ReparentInstancesCommand");
    registerCommand<ChangeIdsCommand>("ChangeIdsCommand");
    registerCommand<PropertyAbstractContainer>("PropertyAbstractContainer");
    registerCommand<InformationChangedCommand>("InformationChangedCommand");
    registerCommand<ValuesChangedCommand>("ValuesChangedCommand");
    registerCommand<ValuesModifiedCommand>("ValuesModifiedCommand");
    registerCommand<PixmapChangedCommand>("PixmapChangedCommand");
    registerCommand<InformationContainer>("InformationContainer");
    registerCommand<PropertyValueContainer>("PropertyValueContainer");
    registerCommand<PropertyBindingContainer>("PropertyBindingContainer");
    registerCommand<PropertyAbstractContainer>("PropertyAbstractContainer");
    registerCommand<InstanceContainer>("InstanceContainer");
    registerCommand<IdContainer>("IdContainer");
    registerCommand<ChildrenChangedCommand>("ChildrenChangedCommand");
    registerCommand<ImageContainer>("ImageContainer");
    registerCommand<StatePreviewImageChangedCommand>("StatePreviewImageChangedCommand");
    registerCommand<CompleteComponentCommand>("CompleteComponentCommand");
    registerCommand<ComponentCompletedCommand>("ComponentCompletedCommand");
    registerCommand<AddImportContainer>("AddImportContainer");
    registerCommand<SynchronizeCommand>("SynchronizeCommand");
    registerCommand<ChangeNodeSourceCommand>("ChangeNodeSourceCommand");
    registerCommand<ChangeAuxiliaryCommand>("ChangeAuxiliaryCommand");
    registerCommand<TokenCommand>("TokenCommand");
    registerCommand<RemoveSharedMemoryCommand>("RemoveSharedMemoryCommand");
    registerCommand<EndPuppetCommand>("EndPuppetCommand");
    registerCommand<DebugOutputCommand>("DebugOutputCommand");
    registerCommand<Enumeration>("Enumeration");
    registerCommand<PuppetAliveCommand>("PuppetAliveCommand");
    registerCommand<PuppetToCreatorCommand>("PuppetToCreatorCommand");
    registerCommand<InputEventCommand>("InputEventCommand");
    registerCommand<View3DActionCommand>("View3DActionCommand");
    registerCommand<RequestModelNodePreviewImageCommand>("RequestModelNodePreviewImageCommand");
    registerCommand<QPair<int, int>>("QPairIntInt");
    registerCommand<QList<QColor>>("QColorList");
    registerCommand<ChangeLanguageCommand>("ChangeLanguageCommand");
    registerCommand<ChangePreviewImageSizeCommand>("ChangePreviewImageSizeCommand");
    registerCommand<CapturedDataCommand>("CapturedDataCommand");
    registerCommand<SceneCreatedCommand>("SceneCreatedCommand");
    registerCommand<StartNanotraceCommand>("StartNanotraceCommand");
    registerCommand<EndNanotraceCommand>("EndNanotraceCommand");
    registerCommand<SyncNanotraceCommand>("SyncNanotraceCommand");
}

}