-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOpenRGBHidioPlugin.cpp
More file actions
79 lines (58 loc) · 1.97 KB
/
OpenRGBHidioPlugin.cpp
File metadata and controls
79 lines (58 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#include "OpenRGBHidioPlugin.h"
#include <QHBoxLayout>
bool OpenRGBHidioPlugin::DarkTheme = false;
ResourceManager* OpenRGBHidioPlugin::RMPointer = nullptr;
OpenRGBPluginInfo OpenRGBHidioPlugin::GetPluginInfo()
{
printf("[OpenRGBHidioPlugin] Loading plugin info.\n");
OpenRGBPluginInfo info;
info.Name = "HID-IO";
info.Description = "The hid-io plugin uses the Cap'n'Proto API interface to communicate with hid-io supported input devices.";
info.Version = VERSION_STRING;
info.Commit = GIT_COMMIT_ID;
info.URL = "https://github.com/hid-io/OpenRGBHidioPlugin";
info.Icon.load(":/OpenRGBHidioPlugin.png");
info.Location = OPENRGB_PLUGIN_LOCATION_TOP;
info.Label = "HID-IO";
info.TabIconString = "HID-IO";
info.TabIcon.load(":/OpenRGBHidioPlugin.png");
return info;
}
unsigned int OpenRGBHidioPlugin::GetPluginAPIVersion()
{
printf("[OpenRGBHidioPlugin] Loading plugin API version.\n");
return OPENRGB_PLUGIN_API_VERSION;
}
void OpenRGBHidioPlugin::Load(bool dark_theme, ResourceManager* resource_manager_ptr)
{
printf("[OpenRGBHidioPlugin] Loading plugin.\n");
RMPointer = resource_manager_ptr;
DarkTheme = dark_theme;
}
QWidget* OpenRGBHidioPlugin::GetWidget()
{
printf("[OpenRGBHidioPlugin] Creating widget.\n");
QWidget* widget = new QWidget(nullptr);
QHBoxLayout* layout = new QHBoxLayout();
widget->setLayout(layout);
layout->addWidget(new QLabel("Allo, allo?"));
return widget;
}
QMenu* OpenRGBHidioPlugin::GetTrayMenu()
{
printf("[OpenRGBHidioPlugin] Creating tray menu.\n");
QMenu* menu = new QMenu("Sample plugin");
return menu;
}
void OpenRGBHidioPlugin::Unload()
{
printf("[OpenRGBHidioPlugin] Time to call some cleaning stuff.\n");
}
OpenRGBHidioPlugin::OpenRGBHidioPlugin()
{
printf("[OpenRGBHidioPlugin] Constructor.\n");
}
OpenRGBHidioPlugin::~OpenRGBHidioPlugin()
{
printf("[OpenRGBHidioPlugin] Time to free some memory.\n");
}