From 02a55a36dce433844639033b1a9ba827cdb32797 Mon Sep 17 00:00:00 2001 From: theAdib Date: Wed, 4 Nov 2020 00:13:49 +0100 Subject: [PATCH] review copyright and example wording --- include/JsonRPCPlugin.h | 36 +++++------------------------------- info.json | 4 ++-- src/JsonRPCPlugin.cpp | 2 +- 3 files changed, 8 insertions(+), 34 deletions(-) diff --git a/include/JsonRPCPlugin.h b/include/JsonRPCPlugin.h index 403ac4f..6670cf9 100644 --- a/include/JsonRPCPlugin.h +++ b/include/JsonRPCPlugin.h @@ -1,6 +1,6 @@ //########################################################################## //# # -//# CLOUDCOMPARE PLUGIN: ExamplePlugin # +//# CLOUDCOMPARE PLUGIN: JsonRPCPlugin # //# # //# This program is free software; you can redistribute it and/or modify # //# it under the terms of the GNU General Public License as published by # @@ -11,42 +11,21 @@ //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # //# GNU General Public License for more details. # //# # -//# COPYRIGHT: XXX # +//# COPYRIGHT: theAdib, 2020 # //# # //########################################################################## #pragma once #include "ccStdPluginInterface.h" -//#include #include "jsonrpcserver.h" -//! Example qCC plugin -/** Replace 'ExamplePlugin' by your own plugin class name throughout and then - check 'ExamplePlugin.cpp' for more directions. - - Each plugin requires an info.json file to provide information about itself - - the name, authors, maintainers, icon, etc.. - - The one method you are required to implement is 'getActions'. This should - return all actions (QAction objects) for the plugin. CloudCompare will - automatically add these with their icons in the plugin toolbar and to the - plugin menu. If your plugin returns several actions, CC will create a - dedicated toolbar and a sub-menu for your plugin. You are responsible for - connecting these actions to methods in your plugin. - - Use the ccStdPluginInterface::m_app variable for access to most of the CC - components (database, 3D views, console, etc.) - see the ccMainAppInterface - class in ccMainAppInterface.h. -**/ +//! Json RPC Plugin class JsonRPCPlugin : public QObject, public ccStdPluginInterface { Q_OBJECT Q_INTERFACES( ccPluginInterface ccStdPluginInterface ) - // Replace "Example" by your plugin name (IID should be unique - let's hope your plugin name is unique ;) - // The info.json file provides information about the plugin to the loading system and - // it is displayed in the plugin information dialog. Q_PLUGIN_METADATA( IID "cccorp.cloudcompare.plugin.JsonRPC" FILE "../info.json" ) public: @@ -57,18 +36,13 @@ public: QList getActions() override; public slots: void triggered(bool checked); + /// slot for execution JsonRPCResult execute(QString method, QMap params); private: //! Default action - /** You can add as many actions as you want in a plugin. - Each action will correspond to an icon in the dedicated - toolbar and an entry in the plugin menu. - **/ QAction* m_action{nullptr}; protected: - //jcon::JsonRpcTcpServer rpc_server; - // QTcpServer rpc_server; - // QWebSocketServer wsrpc_server(QStringLiteral("CloudCompare"), QWebSocketServer::NonSecureMode); + /// server that emit the execute signals JsonRPCServer rpc_server; }; diff --git a/info.json b/info.json index 44cf5ac..c74a81a 100644 --- a/info.json +++ b/info.json @@ -17,8 +17,8 @@ ], "references" : [ { - "text" : "Sword swallowing and its side effects", - "url" : "http://www.bmj.com/content/333/7582/1285" + "text" : "", + "url" : "" } ] } diff --git a/src/JsonRPCPlugin.cpp b/src/JsonRPCPlugin.cpp index dff7d6b..563d13e 100644 --- a/src/JsonRPCPlugin.cpp +++ b/src/JsonRPCPlugin.cpp @@ -11,7 +11,7 @@ //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # //# GNU General Public License for more details. # //# # -//# COPYRIGHT: XXX # +//# COPYRIGHT: theAdib, 2020 # //# # //##########################################################################