2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2011-02-22 12:08:19 +01:00
|
|
|
|
2010-11-24 14:52:06 +01:00
|
|
|
#include "nodeinstanceserverinterface.h"
|
|
|
|
|
#include <qmetatype.h>
|
|
|
|
|
|
2020-05-19 13:18:43 +02:00
|
|
|
#include "addimportcontainer.h"
|
2020-07-27 18:14:33 +02:00
|
|
|
#include "captureddatacommand.h"
|
2011-06-08 17:02:03 +02:00
|
|
|
#include "changeauxiliarycommand.h"
|
2020-05-19 13:18:43 +02:00
|
|
|
#include "changebindingscommand.h"
|
2010-11-24 14:52:06 +01:00
|
|
|
#include "changefileurlcommand.h"
|
|
|
|
|
#include "changeidscommand.h"
|
2020-05-19 13:18:43 +02:00
|
|
|
#include "changelanguagecommand.h"
|
2011-06-08 17:02:03 +02:00
|
|
|
#include "changenodesourcecommand.h"
|
2020-07-27 18:14:33 +02:00
|
|
|
#include "changepreviewimagesizecommand.h"
|
2019-10-17 13:51:57 +02:00
|
|
|
#include "changeselectioncommand.h"
|
2020-05-19 13:18:43 +02:00
|
|
|
#include "changestatecommand.h"
|
|
|
|
|
#include "changevaluescommand.h"
|
2010-11-30 17:46:57 +01:00
|
|
|
#include "childrenchangedcommand.h"
|
2020-05-19 13:18:43 +02:00
|
|
|
#include "clearscenecommand.h"
|
|
|
|
|
#include "completecomponentcommand.h"
|
2010-12-09 16:09:37 +01:00
|
|
|
#include "componentcompletedcommand.h"
|
2020-05-19 13:18:43 +02:00
|
|
|
#include "createinstancescommand.h"
|
|
|
|
|
#include "createscenecommand.h"
|
2012-11-05 16:42:31 +01:00
|
|
|
#include "debugoutputcommand.h"
|
2020-05-19 13:18:43 +02:00
|
|
|
#include "endpuppetcommand.h"
|
|
|
|
|
#include "imagecontainer.h"
|
|
|
|
|
#include "informationchangedcommand.h"
|
|
|
|
|
#include "inputeventcommand.h"
|
|
|
|
|
#include "instancecontainer.h"
|
2021-10-12 12:07:44 +02:00
|
|
|
#include "nanotracecommand.h"
|
2020-05-19 13:18:43 +02:00
|
|
|
#include "pixmapchangedcommand.h"
|
|
|
|
|
#include "propertyabstractcontainer.h"
|
|
|
|
|
#include "propertybindingcontainer.h"
|
|
|
|
|
#include "propertyvaluecontainer.h"
|
2014-06-18 11:17:59 +02:00
|
|
|
#include "puppetalivecommand.h"
|
2020-01-02 11:58:33 +02:00
|
|
|
#include "puppettocreatorcommand.h"
|
2020-05-19 13:18:43 +02:00
|
|
|
#include "removeinstancescommand.h"
|
|
|
|
|
#include "removepropertiescommand.h"
|
|
|
|
|
#include "removesharedmemorycommand.h"
|
|
|
|
|
#include "reparentinstancescommand.h"
|
2020-09-03 13:48:13 +02:00
|
|
|
#include "scenecreatedcommand.h"
|
2020-05-19 13:18:43 +02:00
|
|
|
#include "statepreviewimagechangedcommand.h"
|
|
|
|
|
#include "synchronizecommand.h"
|
|
|
|
|
#include "tokencommand.h"
|
|
|
|
|
#include "update3dviewstatecommand.h"
|
|
|
|
|
#include "valueschangedcommand.h"
|
|
|
|
|
#include "view3dactioncommand.h"
|
2020-09-10 16:02:31 +03:00
|
|
|
#include "requestmodelnodepreviewimagecommand.h"
|
2010-11-24 14:52:06 +01:00
|
|
|
|
2013-12-16 12:50:32 +01:00
|
|
|
#include <enumeration.h>
|
|
|
|
|
|
2010-11-24 14:52:06 +01:00
|
|
|
namespace QmlDesigner {
|
|
|
|
|
|
2019-12-16 22:23:19 +02:00
|
|
|
static bool isRegistered = false;
|
2010-11-24 14:52:06 +01:00
|
|
|
|
|
|
|
|
NodeInstanceServerInterface::NodeInstanceServerInterface(QObject *parent) :
|
|
|
|
|
QObject(parent)
|
|
|
|
|
{
|
|
|
|
|
registerCommands();
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-05 15:33:30 +02:00
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-24 14:52:06 +01:00
|
|
|
void NodeInstanceServerInterface::registerCommands()
|
|
|
|
|
{
|
|
|
|
|
if (isRegistered)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
isRegistered = true;
|
|
|
|
|
|
2020-10-05 15:33:30 +02:00
|
|
|
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");
|
2022-05-31 16:19:29 +03:00
|
|
|
registerCommand<QList<QColor>>("QColorList");
|
2020-10-05 15:33:30 +02:00
|
|
|
registerCommand<ChangeLanguageCommand>("ChangeLanguageCommand");
|
|
|
|
|
registerCommand<ChangePreviewImageSizeCommand>("ChangePreviewImageSizeCommand");
|
|
|
|
|
registerCommand<CapturedDataCommand>("CapturedDataCommand");
|
|
|
|
|
registerCommand<SceneCreatedCommand>("SceneCreatedCommand");
|
2021-10-12 12:07:44 +02:00
|
|
|
registerCommand<StartNanotraceCommand>("StartNanotraceCommand");
|
|
|
|
|
registerCommand<EndNanotraceCommand>("EndNanotraceCommand");
|
|
|
|
|
registerCommand<SyncNanotraceCommand>("SyncNanotraceCommand");
|
2010-11-24 14:52:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|