commit 6675733e7e8172f79f556d9633fca0d158cd4127 Author: silas Date: Fri Dec 11 17:53:32 2020 -0600 ORGB Plugins Example diff --git a/ORGBExamplePlugin.cpp b/ORGBExamplePlugin.cpp new file mode 100644 index 0000000..6f63306 --- /dev/null +++ b/ORGBExamplePlugin.cpp @@ -0,0 +1,9 @@ +#include "ORGBExamplePlugin.h" + +#include + +std::string ORGBPlugin::PluginName() const +{ + return "ExamplePlugin"; +} + diff --git a/ORGBExamplePlugin.h b/ORGBExamplePlugin.h new file mode 100644 index 0000000..497ffa2 --- /dev/null +++ b/ORGBExamplePlugin.h @@ -0,0 +1,19 @@ +#pragma once + +#include "ORGBExamplePluginInterface.h" + +#include +#include +#include + +class ORGBPlugin : public QObject, public ORGBPluginInterface +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID ORGBPluginInterface_IID) + Q_INTERFACES(ORGBPluginInterface) + +public: + ~ORGBPlugin() override {} + + std::string PluginName() const override; +}; diff --git a/ORGBExamplePlugin.pro b/ORGBExamplePlugin.pro new file mode 100644 index 0000000..66cf699 --- /dev/null +++ b/ORGBExamplePlugin.pro @@ -0,0 +1,23 @@ +QT -= gui + +TEMPLATE = lib +DEFINES += ORGBEXAMPLEPLUGIN_LIBRARY + +CONFIG += c++11 + +# You can make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +SOURCES += \ + ORGBExamplePlugin.cpp + +HEADERS += \ + ORGBExamplePluginInterface.h \ + ORGBExamplePlugin.h + +# Default rules for deployment. +unix { + target.path = /usr/lib +} +!isEmpty(target.path): INSTALLS += target diff --git a/ORGBExamplePlugin.pro.user b/ORGBExamplePlugin.pro.user new file mode 100644 index 0000000..ca8bee6 --- /dev/null +++ b/ORGBExamplePlugin.pro.user @@ -0,0 +1,332 @@ + + + + + + EnvironmentId + {a9f886a9-a27f-40ea-90f1-a5ecc7e77297} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + *.md, *.MD, Makefile + false + true + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop Qt 5.15.1 MSVC2019 64bit + Desktop Qt 5.15.1 MSVC2019 64bit + qt.qt5.5151.win64_msvc2019_64_kit + 0 + 0 + 0 + + true + 0 + C:\Users\heros\OneDrive\Documents\Code\OpenRGB related\Plugin\build-ORGBExamplePlugin-Desktop_Qt_5_15_1_MSVC2019_64bit-Debug + C:/Users/heros/OneDrive/Documents/Code/OpenRGB related/Plugin/build-ORGBExamplePlugin-Desktop_Qt_5_15_1_MSVC2019_64bit-Debug + + + true + QtProjectManager.QMakeBuildStep + + false + + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + 2 + 2 + + + true + 2 + C:\Users\heros\OneDrive\Documents\Code\OpenRGB related\Plugin\build-ORGBExamplePlugin-Desktop_Qt_5_15_1_MSVC2019_64bit-Release + C:/Users/heros/OneDrive/Documents/Code/OpenRGB related/Plugin/build-ORGBExamplePlugin-Desktop_Qt_5_15_1_MSVC2019_64bit-Release + + + true + QtProjectManager.QMakeBuildStep + + false + + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + 2 + + + true + 0 + C:\Users\heros\OneDrive\Documents\Code\OpenRGB related\Plugin\build-ORGBExamplePlugin-Desktop_Qt_5_15_1_MSVC2019_64bit-Profile + C:/Users/heros/OneDrive/Documents/Code/OpenRGB related/Plugin/build-ORGBExamplePlugin-Desktop_Qt_5_15_1_MSVC2019_64bit-Profile + + + true + QtProjectManager.QMakeBuildStep + + false + + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/ORGBExamplePluginInterface.h b/ORGBExamplePluginInterface.h new file mode 100644 index 0000000..d6de721 --- /dev/null +++ b/ORGBExamplePluginInterface.h @@ -0,0 +1,16 @@ +#pragma once + +#include + +class QString; +#define ORGBPluginInterface_IID "com.ORGBPluginInterface" + +class ORGBPluginInterface +{ +public: + virtual ~ORGBPluginInterface() {} + + virtual std::string PluginName() const = 0; +}; + +Q_DECLARE_INTERFACE(ORGBPluginInterface, ORGBPluginInterface_IID)