diff options
author | aunsane <aunsane@gmail.com> | 2017-04-16 01:32:19 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2017-04-16 01:32:58 +0300 |
commit | 0b9fa1d90f8d0aff7118837ceb1211b578a5a9c8 (patch) | |
tree | 3b8be7b839a98a3a52a38d713c2d708ada015510 /plugins/CloudFile/src/icons.cpp | |
parent | 008fb731e3e3b587f596afba1cfe7446de7f0cac (diff) |
CloudFile: initial commit
- Dropbox (worked)
- Yandex.Disk (worked)
- GDrive (not worked)
Diffstat (limited to 'plugins/CloudFile/src/icons.cpp')
-rw-r--r-- | plugins/CloudFile/src/icons.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/plugins/CloudFile/src/icons.cpp b/plugins/CloudFile/src/icons.cpp new file mode 100644 index 0000000000..5a3d562e18 --- /dev/null +++ b/plugins/CloudFile/src/icons.cpp @@ -0,0 +1,40 @@ +#include "stdafx.h" + +static IconItem iconList[] = +{ + { LPGEN("Upload file(s)"), "upload", IDI_UPLOAD }, + { LPGEN("Dropbox"), "dropbox", IDI_DROPBOX }, + { LPGEN("GDrive"), "gdrive", IDI_GDRIVE } +}; + +void InitializeIcons() +{ + Icon_Register(hInstance, "Protocols/" MODULE, iconList, _countof(iconList), MODULE); +} + +HANDLE GetIconHandle(int iconId) +{ + for (int i = 0; i < _countof(iconList); i++) + if (iconList[i].defIconID == iconId) + return iconList[i].hIcolib; + + return NULL; +} + +HANDLE GetIconHandle(const char *name) +{ + for (size_t i = 0; i < _countof(iconList); i++) + if (mir_strcmpi(iconList[i].szName, name) == 0) + return iconList[i].hIcolib; + + return NULL; +} + +HICON LoadIconEx(int iconId, bool big) +{ + for (int i = 0; i < _countof(iconList); i++) + if (iconList[i].defIconID == iconId) + return IcoLib_GetIconByHandle(iconList[i].hIcolib, big); + + return NULL; +}
\ No newline at end of file |