mirror of
https://github.com/sudoxnym/open-hyperion.git
synced 2026-04-14 19:46:39 +00:00
Update to match finalized interface
This commit is contained in:
parent
a5fdc4f12b
commit
1d70b9b490
3 changed files with 38 additions and 31 deletions
|
|
@ -1,34 +1,33 @@
|
|||
#include "ORGBExamplePlugin.h"
|
||||
#include "Dependencies/ResourceManager.h"
|
||||
|
||||
bool ORGBPlugin::HasCustomIcon()
|
||||
PluginInfo ORGBPlugin::DefineNeeded()
|
||||
{
|
||||
return false;
|
||||
ORGBPlugin::PInfo.PluginName = "Example";
|
||||
ORGBPlugin::PInfo.PluginDesc = "An example Plugin for OpenRGB";
|
||||
ORGBPlugin::PInfo.PluginLoca = "InfoTab";
|
||||
|
||||
ORGBPlugin::PInfo.HasCustom = false;
|
||||
ORGBPlugin::PInfo.SettingName = "";
|
||||
|
||||
return ORGBPlugin::PInfo;
|
||||
}
|
||||
|
||||
QLabel* ORGBPlugin::TabLabel()
|
||||
QLabel* TabLabel()
|
||||
{
|
||||
QLabel *TLabel = new QLabel();
|
||||
TLabel->setText("Example");
|
||||
return TLabel;
|
||||
}
|
||||
|
||||
std::string ORGBPlugin::PluginName()
|
||||
PluginInfo ORGBPlugin::init(json Settings, bool DarkTheme)
|
||||
{
|
||||
return "ExamplePlugin";
|
||||
ORGBPlugin::PInfo.PluginLabel = TabLabel();
|
||||
|
||||
return ORGBPlugin::PInfo;
|
||||
}
|
||||
|
||||
std::string ORGBPlugin::PluginDesc()
|
||||
{
|
||||
return "This is an Example plugin for OpenRGB";
|
||||
}
|
||||
|
||||
std::string ORGBPlugin::PluginLocal()
|
||||
{
|
||||
return "InfoTab";
|
||||
}
|
||||
|
||||
QWidget* ORGBPlugin::CreateGUI(QWidget *Parent, ResourceManager *RM)
|
||||
QWidget* ORGBPlugin::CreateGUI(QWidget *Parent)
|
||||
{
|
||||
QWidget *ORGBExamplePage = new QWidget(Parent);
|
||||
QLabel *ORGBExampleLabel = new QLabel(ORGBExamplePage);
|
||||
|
|
|
|||
|
|
@ -19,17 +19,15 @@ class ORGBPlugin : public QObject, public ORGBPluginInterface
|
|||
Q_INTERFACES(ORGBPluginInterface)
|
||||
|
||||
public:
|
||||
~ORGBPlugin() override {}
|
||||
virtual ~ORGBPlugin() {};
|
||||
|
||||
bool HasCustomIcon() override;
|
||||
QLabel* TabLabel() override;
|
||||
PluginInfo PInfo;
|
||||
|
||||
std::string PluginName() override;
|
||||
std::string PluginDesc() override;
|
||||
std::string PluginLocal() override;
|
||||
virtual PluginInfo DefineNeeded() override;
|
||||
|
||||
QWidget* CreateGUI(QWidget *Parent, ResourceManager *RM = nullptr) override;
|
||||
virtual PluginInfo init(json Settings , bool DarkTheme) override;
|
||||
|
||||
virtual QWidget *CreateGUI(QWidget *Parent) override;
|
||||
private slots:
|
||||
void on_ExampleButton_clicked();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,22 +4,32 @@
|
|||
#include <QLabel>
|
||||
#include "Dependencies/ResourceManager.h"
|
||||
|
||||
class QString;
|
||||
#define ORGBPluginInterface_IID "com.ORGBPluginInterface"
|
||||
|
||||
struct PluginInfo
|
||||
{
|
||||
std::string PluginName;
|
||||
std::string PluginDesc;
|
||||
std::string PluginLoca;
|
||||
|
||||
bool HasCustom;
|
||||
QLabel *PluginLabel;
|
||||
|
||||
std::string SettingName;
|
||||
};
|
||||
|
||||
class ORGBPluginInterface
|
||||
{
|
||||
public:
|
||||
virtual ~ORGBPluginInterface() {}
|
||||
virtual ~ORGBPluginInterface() {}
|
||||
|
||||
virtual bool HasCustomIcon() = 0;
|
||||
virtual QLabel* TabLabel() = 0;
|
||||
PluginInfo PInfo;
|
||||
|
||||
virtual std::string PluginName() = 0;
|
||||
virtual std::string PluginDesc() = 0;
|
||||
virtual std::string PluginLocal() = 0;
|
||||
virtual PluginInfo DefineNeeded() = 0;
|
||||
|
||||
virtual QWidget* CreateGUI(QWidget *Parent, ResourceManager *RM = nullptr) = 0;
|
||||
virtual PluginInfo init(json Settings , bool DarkTheme) = 0;
|
||||
|
||||
virtual QWidget *CreateGUI(QWidget *Parent) = 0;
|
||||
};
|
||||
|
||||
Q_DECLARE_INTERFACE(ORGBPluginInterface, ORGBPluginInterface_IID)
|
||||
|
|
|
|||
Loading…
Reference in a new issue