2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-02-22 12:08:19 +01:00
|
|
|
**
|
2016-01-15 14:59:14 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2011-02-22 12:08:19 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-02-22 12:08:19 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:59:14 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2011-02-22 12:08:19 +01:00
|
|
|
**
|
2015-09-18 11:34:48 +02:00
|
|
|
** GNU General Public License Usage
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
2016-01-15 14:59:14 +01:00
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2011-02-22 12:08:19 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
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"
|
|
|
|
#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");
|
|
|
|
registerCommand<ChangeLanguageCommand>("ChangeLanguageCommand");
|
|
|
|
registerCommand<ChangePreviewImageSizeCommand>("ChangePreviewImageSizeCommand");
|
|
|
|
registerCommand<CapturedDataCommand>("CapturedDataCommand");
|
|
|
|
registerCommand<SceneCreatedCommand>("SceneCreatedCommand");
|
2010-11-24 14:52:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|