summaryrefslogtreecommitdiff
path: root/protocols/CloudFile/src/icons.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/CloudFile/src/icons.cpp')
-rw-r--r--protocols/CloudFile/src/icons.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/protocols/CloudFile/src/icons.cpp b/protocols/CloudFile/src/icons.cpp
new file mode 100644
index 0000000000..001df50240
--- /dev/null
+++ b/protocols/CloudFile/src/icons.cpp
@@ -0,0 +1,39 @@
+#include "stdafx.h"
+
+static IconItem iconList[] =
+{
+ { LPGEN("Upload file(s)"), "upload", IDI_UPLOAD },
+ { LPGEN("Dropbox"), "dropbox", IDI_DROPBOX },
+ { LPGEN("Google Drive"), "gdrive", IDI_GDRIVE },
+ { LPGEN("OneDrive"), "onedrive", IDI_ONEDRIVE },
+ { LPGEN("Yandex.Disk"), "yadisk", IDI_YADISK }
+};
+
+void InitializeIcons()
+{
+ g_plugin.registerIcon("Protocols/" MODULENAME, iconList, MODULENAME);
+}
+
+HANDLE GetIconHandle(int iconId)
+{
+ for (auto &it : iconList)
+ if (it.defIconID == iconId)
+ return it.hIcolib;
+ return nullptr;
+}
+
+HANDLE GetIconHandle(const char *name)
+{
+ for (auto &it : iconList)
+ if (mir_strcmpi(it.szName, name) == 0)
+ return it.hIcolib;
+ return nullptr;
+}
+
+HICON LoadIconEx(int iconId, bool big)
+{
+ for (auto &it : iconList)
+ if (it.defIconID == iconId)
+ return IcoLib_GetIconByHandle(it.hIcolib, big);
+ return nullptr;
+} \ No newline at end of file