summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/CloudFile/src/Services/dropbox_service.cpp2
-rw-r--r--protocols/CloudFile/src/Services/google_service.cpp2
-rw-r--r--protocols/CloudFile/src/Services/microsoft_service.cpp2
-rw-r--r--protocols/CloudFile/src/Services/yandex_service.cpp2
-rw-r--r--protocols/CloudFile/src/icons.cpp34
-rw-r--r--protocols/CloudFile/src/menus.cpp4
-rw-r--r--protocols/CloudFile/src/srmm.cpp2
-rw-r--r--protocols/CloudFile/src/stdafx.h3
-rw-r--r--protocols/MinecraftDynmap/src/dialogs.cpp47
-rw-r--r--protocols/MinecraftDynmap/src/dialogs.h2
-rw-r--r--protocols/Omegle/src/communication.cpp8
-rw-r--r--protocols/Omegle/src/theme.cpp9
-rw-r--r--protocols/Omegle/src/theme.h1
-rw-r--r--protocols/Sametime/src/conference.cpp4
-rw-r--r--protocols/Sametime/src/sametime.cpp22
-rw-r--r--protocols/Sametime/src/sametime.h4
-rw-r--r--protocols/Sametime/src/sametime_session.cpp2
-rw-r--r--protocols/Sametime/src/utils.cpp8
-rw-r--r--protocols/SkypeWeb/src/skype_events.cpp4
-rw-r--r--protocols/SkypeWeb/src/skype_icons.cpp16
-rw-r--r--protocols/SkypeWeb/src/skype_menus.cpp8
-rw-r--r--protocols/SkypeWeb/src/skype_popups.cpp6
-rw-r--r--protocols/SkypeWeb/src/skype_proto.h4
-rw-r--r--protocols/SkypeWeb/src/skype_trouter.cpp2
-rw-r--r--protocols/Tox/src/tox_icons.cpp16
-rw-r--r--protocols/Tox/src/tox_messages.cpp2
-rw-r--r--protocols/Tox/src/tox_proto.h4
27 files changed, 48 insertions, 172 deletions
diff --git a/protocols/CloudFile/src/Services/dropbox_service.cpp b/protocols/CloudFile/src/Services/dropbox_service.cpp
index a2cfa5a2e5..f4b9a22b3d 100644
--- a/protocols/CloudFile/src/Services/dropbox_service.cpp
+++ b/protocols/CloudFile/src/Services/dropbox_service.cpp
@@ -18,7 +18,7 @@ g_pluginDropbox;
CDropboxService::CDropboxService(const char *protoName, const wchar_t *userName) :
CCloudService(protoName, userName, &g_pluginDropbox)
{
- m_hProtoIcon = GetIconHandle(IDI_DROPBOX);
+ m_hProtoIcon = g_plugin.getIconHandle(IDI_DROPBOX);
}
CDropboxService* CDropboxService::Init(const char *moduleName, const wchar_t *userName)
diff --git a/protocols/CloudFile/src/Services/google_service.cpp b/protocols/CloudFile/src/Services/google_service.cpp
index 536d2ff65e..db4cfc1cbd 100644
--- a/protocols/CloudFile/src/Services/google_service.cpp
+++ b/protocols/CloudFile/src/Services/google_service.cpp
@@ -19,7 +19,7 @@ g_pluginGoogle;
CGDriveService::CGDriveService(const char *protoName, const wchar_t *userName) :
CCloudService(protoName, userName, &g_pluginGoogle)
{
- m_hProtoIcon = GetIconHandle(IDI_GDRIVE);
+ m_hProtoIcon = g_plugin.getIconHandle(IDI_GDRIVE);
}
CGDriveService* CGDriveService::Init(const char *moduleName, const wchar_t *userName)
diff --git a/protocols/CloudFile/src/Services/microsoft_service.cpp b/protocols/CloudFile/src/Services/microsoft_service.cpp
index 992312e2a8..27ec0df7fb 100644
--- a/protocols/CloudFile/src/Services/microsoft_service.cpp
+++ b/protocols/CloudFile/src/Services/microsoft_service.cpp
@@ -18,7 +18,7 @@ g_pluginOnedrive;
COneDriveService::COneDriveService(const char *protoName, const wchar_t *userName) :
CCloudService(protoName, userName, &g_pluginOnedrive)
{
- m_hProtoIcon = GetIconHandle(IDI_ONEDRIVE);
+ m_hProtoIcon = g_plugin.getIconHandle(IDI_ONEDRIVE);
}
COneDriveService* COneDriveService::Init(const char *moduleName, const wchar_t *userName)
diff --git a/protocols/CloudFile/src/Services/yandex_service.cpp b/protocols/CloudFile/src/Services/yandex_service.cpp
index 4bd0210ca1..816e6ea5e4 100644
--- a/protocols/CloudFile/src/Services/yandex_service.cpp
+++ b/protocols/CloudFile/src/Services/yandex_service.cpp
@@ -18,7 +18,7 @@ g_pluginYandex;
CYandexService::CYandexService(const char *protoName, const wchar_t *userName) :
CCloudService(protoName, userName, &g_pluginYandex)
{
- m_hProtoIcon = GetIconHandle(IDI_YADISK);
+ m_hProtoIcon = g_plugin.getIconHandle(IDI_YADISK);
}
CYandexService* CYandexService::Init(const char *moduleName, const wchar_t *userName)
diff --git a/protocols/CloudFile/src/icons.cpp b/protocols/CloudFile/src/icons.cpp
index 001df50240..0b42ad77fc 100644
--- a/protocols/CloudFile/src/icons.cpp
+++ b/protocols/CloudFile/src/icons.cpp
@@ -2,38 +2,14 @@
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 }
+ { 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
diff --git a/protocols/CloudFile/src/menus.cpp b/protocols/CloudFile/src/menus.cpp
index 3ca1b085b9..33fe369406 100644
--- a/protocols/CloudFile/src/menus.cpp
+++ b/protocols/CloudFile/src/menus.cpp
@@ -26,7 +26,7 @@ void InitializeMenus()
}
mi.position = -2000019999;
- mi.hIcon = LoadIconEx(IDI_UPLOAD);
+ mi.hIcon = g_plugin.getIcon(IDI_UPLOAD);
hContactMenu = Menu_AddContactMenuItem(&mi);
}
@@ -39,7 +39,7 @@ void CCloudService::OnModulesLoaded()
mi.flags = CMIF_SYSTEM | CMIF_UNICODE;
mi.name.w = (wchar_t*)GetUserName();
mi.position = Services.getCount();
- mi.hIcolibItem = GetIconHandle(GetIconId());
+ mi.hIcolibItem = g_plugin.getIconHandle(GetIconId());
Menu_AddContactMenuItem(&mi);
CreateServiceFunctionObj(mi.pszService, UploadMenuCommand, this);
diff --git a/protocols/CloudFile/src/srmm.cpp b/protocols/CloudFile/src/srmm.cpp
index b4d44c9fdd..161ddfffd0 100644
--- a/protocols/CloudFile/src/srmm.cpp
+++ b/protocols/CloudFile/src/srmm.cpp
@@ -8,7 +8,7 @@ int OnSrmmToolbarLoaded(WPARAM, LPARAM)
CMStringW tooltip(FORMAT, TranslateT("Upload files to..."));
bbd.pwszTooltip = tooltip;
- bbd.hIcon = GetIconHandle(IDI_UPLOAD);
+ bbd.hIcon = g_plugin.getIconHandle(IDI_UPLOAD);
bbd.dwButtonID = BBB_ID_FILE_SEND;
bbd.dwDefPos = 100 + bbd.dwButtonID;
Srmm_AddButton(&bbd, &g_plugin);
diff --git a/protocols/CloudFile/src/stdafx.h b/protocols/CloudFile/src/stdafx.h
index 58801c4a34..c0bb92b713 100644
--- a/protocols/CloudFile/src/stdafx.h
+++ b/protocols/CloudFile/src/stdafx.h
@@ -81,9 +81,6 @@ int OnModulesLoaded(WPARAM, LPARAM);
// icons
void InitializeIcons();
-HANDLE GetIconHandle(int iconId);
-HANDLE GetIconHandle(const char *name);
-HICON LoadIconEx(int iconId, bool big = false);
// menus
extern HGENMENU hContactMenu;
diff --git a/protocols/MinecraftDynmap/src/dialogs.cpp b/protocols/MinecraftDynmap/src/dialogs.cpp
index 3639e3cc6b..b74debb644 100644
--- a/protocols/MinecraftDynmap/src/dialogs.cpp
+++ b/protocols/MinecraftDynmap/src/dialogs.cpp
@@ -24,26 +24,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Icons
-static IconItem iconList[] = {
+static IconItem iconList[] =
+{
{ "proto", LPGEN("Protocol icon"), IDI_PROTO },
};
static HANDLE hIconLibItem[_countof(iconList)];
-void InitIcons(void) {
+void InitIcons(void)
+{
g_plugin.registerIcon("Protocols/MinecraftDynmap", iconList, "MinecraftDynmap");
}
-HANDLE GetIconHandle(const char* name) {
- for (size_t i = 0; i < _countof(iconList); i++) {
- if (strcmp(iconList[i].szName, name) == 0) {
- return hIconLibItem[i];
- }
- }
- return nullptr;
-}
-
-
// Dialogs
static void LoadDBText(MinecraftDynmapProto* ppro, HWND hwnd, int idCtrl, const char* szSetting)
@@ -55,14 +47,13 @@ static void LoadDBText(MinecraftDynmapProto* ppro, HWND hwnd, int idCtrl, const
static void StoreDBText(MinecraftDynmapProto* ppro, HWND hwnd, int idCtrl, const char* szSetting)
{
- wchar_t tstr[250+1];
+ wchar_t tstr[250 + 1];
GetDlgItemText(hwnd, idCtrl, tstr, _countof(tstr));
- if (tstr[0] != '\0') {
+ if (tstr[0] != '\0')
db_set_ws(0, ppro->m_szModuleName, szSetting, tstr);
- } else {
+ else
db_unset(0, ppro->m_szModuleName, szSetting);
- }
}
@@ -70,36 +61,31 @@ INT_PTR CALLBACK MinecraftDynmapAccountProc(HWND hwnd, UINT message, WPARAM wpar
{
MinecraftDynmapProto *proto;
- switch (message)
- {
-
+ switch (message) {
case WM_INITDIALOG:
TranslateDialogDefault(hwnd);
proto = reinterpret_cast<MinecraftDynmapProto*>(lparam);
- SetWindowLongPtr(hwnd,GWLP_USERDATA,lparam);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, lparam);
LoadDBText(proto, hwnd, IDC_SERVER, MINECRAFTDYNMAP_KEY_SERVER);
LoadDBText(proto, hwnd, IDC_NAME, MINECRAFTDYNMAP_KEY_NAME);
-
return TRUE;
case WM_COMMAND:
switch (LOWORD(wparam)) {
- case IDC_NAME: {
- if (HIWORD(wparam) != EN_CHANGE || (HWND)lparam != GetFocus()) {
- return TRUE;
- } else {
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- break;
- }
+ case IDC_NAME:
+ if (HIWORD(wparam) != EN_CHANGE || (HWND)lparam != GetFocus())
+ return TRUE;
+
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
}
break;
case WM_NOTIFY:
if (reinterpret_cast<NMHDR*>(lparam)->code == PSN_APPLY) {
- proto = reinterpret_cast<MinecraftDynmapProto*>(GetWindowLongPtr(hwnd,GWLP_USERDATA));
+ proto = reinterpret_cast<MinecraftDynmapProto*>(GetWindowLongPtr(hwnd, GWLP_USERDATA));
StoreDBText(proto, hwnd, IDC_SERVER, MINECRAFTDYNMAP_KEY_SERVER);
StoreDBText(proto, hwnd, IDC_NAME, MINECRAFTDYNMAP_KEY_NAME);
@@ -107,7 +93,6 @@ INT_PTR CALLBACK MinecraftDynmapAccountProc(HWND hwnd, UINT message, WPARAM wpar
return TRUE;
}
break;
-
}
return FALSE;
}
diff --git a/protocols/MinecraftDynmap/src/dialogs.h b/protocols/MinecraftDynmap/src/dialogs.h
index d80024c8cf..b7f2dd5be7 100644
--- a/protocols/MinecraftDynmap/src/dialogs.h
+++ b/protocols/MinecraftDynmap/src/dialogs.h
@@ -23,7 +23,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
void InitIcons(void);
-HANDLE GetIconHandle(const char *name);
INT_PTR CALLBACK MinecraftDynmapAccountProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
-INT_PTR CALLBACK MinecraftDynmapOptionsProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
diff --git a/protocols/Omegle/src/communication.cpp b/protocols/Omegle/src/communication.cpp
index 7741802cd4..a7b6c7960b 100644
--- a/protocols/Omegle/src/communication.cpp
+++ b/protocols/Omegle/src/communication.cpp
@@ -558,18 +558,14 @@ bool Omegle_client::events()
Skin_PlaySound("StrangerTyp");
ptrW who(name == "spyTyping" ? json_as_string(json_at(item, 1)) : mir_wstrdup(L"Stranger"));
- Srmm_SetStatusText(parent->GetChatHandle(),
- CMStringW(FORMAT, TranslateT("%s is typing."), TranslateW(who)),
- IcoLib_GetIconByHandle(GetIconHandle("typing_on")));
+ Srmm_SetStatusText(parent->GetChatHandle(), CMStringW(FORMAT, TranslateT("%s is typing."), TranslateW(who)), g_plugin.getIcon(IDI_TYPING_ON));
}
else if (name == "stoppedTyping" || name == "spyStoppedTyping") {
// Stranger stopped typing, not supported by chat module yet
Skin_PlaySound("StrangerTypStop");
ptrW who(name == "spyTyping" ? json_as_string(json_at(item, 1)) : mir_wstrdup(L"Stranger"));
- Srmm_SetStatusText(parent->GetChatHandle(),
- CMStringW(FORMAT, TranslateT("%s stopped typing."), TranslateW(who)),
- IcoLib_GetIconByHandle(GetIconHandle("typing_off")));
+ Srmm_SetStatusText(parent->GetChatHandle(), CMStringW(FORMAT, TranslateT("%s stopped typing."), TranslateW(who)), g_plugin.getIcon(IDI_TYPING_OFF));
}
else if (name == "gotMessage") {
Srmm_SetStatusText(parent->GetChatHandle(), nullptr);
diff --git a/protocols/Omegle/src/theme.cpp b/protocols/Omegle/src/theme.cpp
index 7473c69c3b..d76b4f6eb5 100644
--- a/protocols/Omegle/src/theme.cpp
+++ b/protocols/Omegle/src/theme.cpp
@@ -33,12 +33,3 @@ void InitIcons(void)
{
g_plugin.registerIcon("Protocols/Omegle", iconList, "Omegle");
}
-
-HANDLE GetIconHandle(const char* name)
-{
- for (auto &it : iconList)
- if (mir_strcmp(it.szName, name) == 0)
- return it.hIcolib;
-
- return nullptr;
-}
diff --git a/protocols/Omegle/src/theme.h b/protocols/Omegle/src/theme.h
index 9d3116e5eb..af39882941 100644
--- a/protocols/Omegle/src/theme.h
+++ b/protocols/Omegle/src/theme.h
@@ -23,4 +23,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
void InitIcons(void);
-HANDLE GetIconHandle(const char *name);
diff --git a/protocols/Sametime/src/conference.cpp b/protocols/Sametime/src/conference.cpp
index 19cfa0cc16..dcba8b5dd6 100644
--- a/protocols/Sametime/src/conference.cpp
+++ b/protocols/Sametime/src/conference.cpp
@@ -455,13 +455,13 @@ void CSametimeProto::InitConferenceMenu()
SET_UID(mi, 0x98cf8a8c, 0x75ba, 0x46f2, 0xa3, 0x35, 0x65, 0x46, 0x4a, 0x38, 0x20, 0x7d);
mi.name.w = LPGENW("Leave conference");
mi.pszService = MS_SAMETIME_MENULEAVECHAT;
- mi.hIcolibItem = GetIconHandle(IDI_ICON_LEAVE);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_ICON_LEAVE);
hLeaveChatMenuItem = Menu_AddContactMenuItem(&mi, m_szModuleName);
SET_UID(mi, 0x45501e10, 0x2914, 0x4daa, 0xb4, 0xcf, 0x83, 0x8a, 0x6a, 0x14, 0xd, 0x7);
mi.name.w = LPGENW("Start conference");
mi.pszService = MS_SAMETIME_MENUCREATECHAT;
- mi.hIcolibItem = GetIconHandle(IDI_ICON_INVITE);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_ICON_INVITE);
hCreateChatMenuItem = Menu_AddContactMenuItem(&mi, m_szModuleName);
HookProtoEvent(ME_CLIST_PREBUILDCONTACTMENU, &CSametimeProto::PrebuildContactMenu);
diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp
index ab7dce7818..189e877a66 100644
--- a/protocols/Sametime/src/sametime.cpp
+++ b/protocols/Sametime/src/sametime.cpp
@@ -86,28 +86,6 @@ void SametimeInitIcons(void)
g_plugin.registerIcon("Protocols/Sametime", iconList, "SAMETIME");
}
-HANDLE GetIconHandle(int iconId)
-{
- for (int i = 0; i < _countof(iconList); i++)
- if (iconList[i].defIconID == iconId)
- return iconList[i].hIcolib;
- return nullptr;
-}
-
-HICON LoadIconEx(const char* name, bool big)
-{
- char szSettingName[100];
- mir_snprintf(szSettingName, "%s_%s", "SAMETIME", name);
- return IcoLib_GetIcon(szSettingName, big);
-}
-
-void ReleaseIconEx(const char* name, bool big)
-{
- char szSettingName[100];
- mir_snprintf(szSettingName, "%s_%s", "SAMETIME", name);
- IcoLib_Release(szSettingName, big);
-}
-
// Copied from MSN plugin - sent acks need to be from different thread
void __cdecl sttFakeAckInfoSuccessThread(TFakeAckParams* tParam)
{
diff --git a/protocols/Sametime/src/sametime.h b/protocols/Sametime/src/sametime.h
index ca84829906..2714779be2 100644
--- a/protocols/Sametime/src/sametime.h
+++ b/protocols/Sametime/src/sametime.h
@@ -41,10 +41,6 @@ INT_PTR CALLBACK CALLBACK SearchDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam
void mwResolve_handler_callback(mwServiceResolve* srvc, guint32 id, guint32 code, GList* results, gpointer data);
void SametimeInitIcons(void);
-HANDLE GetIconHandle(int iconId);
-HICON LoadIconEx(const char* name, bool big);
-void ReleaseIconEx(const char* name, bool big);
-
// services (async thread functions)
struct TFakeAckParams
diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp
index 4634782034..79dfa47224 100644
--- a/protocols/Sametime/src/sametime_session.cpp
+++ b/protocols/Sametime/src/sametime_session.cpp
@@ -567,6 +567,6 @@ void CSametimeProto::InitSessionMenu()
mi.position = 2000060000;
mi.name.w = LPGENW("Send announcement...");
mi.pszService = MS_SAMETIME_MENUANNOUNCESESSION;
- mi.hIcolibItem = GetIconHandle(IDI_ICON_ANNOUNCE);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_ICON_ANNOUNCE);
Menu_AddContactMenuItem(&mi, m_szModuleName);
}
diff --git a/protocols/Sametime/src/utils.cpp b/protocols/Sametime/src/utils.cpp
index 368a9cc093..5644c72342 100644
--- a/protocols/Sametime/src/utils.cpp
+++ b/protocols/Sametime/src/utils.cpp
@@ -42,8 +42,8 @@ void CSametimeProto::RegisterPopups()
mir_snprintf(szName, "%s_%s", m_szModuleName, "Notify");
mir_snwprintf(szDescr, L"%s/%s", m_tszUserName, TranslateT("Notifications"));
- puc.hIcon = CopyIcon(LoadIconEx("notify", FALSE));
- ReleaseIconEx("notify", FALSE);
+ puc.hIcon = CopyIcon(g_plugin.getIcon(IDI_ICON_NOTIFY));
+ g_plugin.releaseIcon(IDI_ICON_NOTIFY);
puc.iSeconds = 8;
puc.colorBack = GetSysColor(COLOR_BTNFACE);
puc.colorText = GetSysColor(COLOR_WINDOWTEXT);
@@ -51,8 +51,8 @@ void CSametimeProto::RegisterPopups()
mir_snprintf(szName, "%s_%s", m_szModuleName, "Error");
mir_snwprintf(szDescr, L"%s/%s", m_tszUserName, TranslateT("Errors"));
- puc.hIcon = CopyIcon(LoadIconEx("error", FALSE));
- ReleaseIconEx("error", FALSE);
+ puc.hIcon = CopyIcon(g_plugin.getIcon(IDI_ICON_ERROR, FALSE));
+ g_plugin.releaseIcon(IDI_ICON_ERROR);
puc.iSeconds = 10;
puc.colorBack = GetSysColor(COLOR_BTNFACE);
puc.colorText = GetSysColor(COLOR_WINDOWTEXT);
diff --git a/protocols/SkypeWeb/src/skype_events.cpp b/protocols/SkypeWeb/src/skype_events.cpp
index f5124b96da..60e51ce522 100644
--- a/protocols/SkypeWeb/src/skype_events.cpp
+++ b/protocols/SkypeWeb/src/skype_events.cpp
@@ -130,11 +130,11 @@ INT_PTR CSkypeProto::EventGetIcon(WPARAM flags, LPARAM pEvent)
switch (dbei->eventType) {
case SKYPE_DB_EVENT_TYPE_CALL_INFO:
case SKYPE_DB_EVENT_TYPE_INCOMING_CALL:
- icon = GetIcon(IDI_CALL);
+ icon = g_plugin.getIcon(IDI_CALL);
break;
case SKYPE_DB_EVENT_TYPE_ACTION:
- icon = GetIcon(IDI_ACTION_ME);
+ icon = g_plugin.getIcon(IDI_ACTION_ME);
break;
case SKYPE_DB_EVENT_TYPE_FILETRANSFER_INFO:
diff --git a/protocols/SkypeWeb/src/skype_icons.cpp b/protocols/SkypeWeb/src/skype_icons.cpp
index 31024801f0..dcbeec6f64 100644
--- a/protocols/SkypeWeb/src/skype_icons.cpp
+++ b/protocols/SkypeWeb/src/skype_icons.cpp
@@ -34,19 +34,3 @@ void CSkypeProto::InitIcons()
{
g_plugin.registerIcon(LPGEN("Protocols") "/" MODULE, iconList, MODULE);
}
-
-HICON CSkypeProto::GetIcon(int iconId)
-{
- for (auto &it : iconList)
- if (it.defIconID == iconId)
- return IcoLib_GetIconByHandle(it.hIcolib);
- return nullptr;
-}
-
-HANDLE CSkypeProto::GetIconHandle(int iconId)
-{
- for (auto &it : iconList)
- if (it.defIconID == iconId)
- return it.hIcolib;
- return nullptr;
-}
diff --git a/protocols/SkypeWeb/src/skype_menus.cpp b/protocols/SkypeWeb/src/skype_menus.cpp
index 9f9a3975bc..04ad6194d4 100644
--- a/protocols/SkypeWeb/src/skype_menus.cpp
+++ b/protocols/SkypeWeb/src/skype_menus.cpp
@@ -64,7 +64,7 @@ void CSkypeProto::InitMenus()
mi.pszService = MODULE"/GetHistory";
mi.name.w = LPGENW("Get server history");
mi.position = CMI_POSITION + CMI_GETSERVERHISTORY;
- mi.hIcolibItem = GetIconHandle(IDI_SYNCHISTORY);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_SYNCHISTORY);
SET_UID(mi, 0xc9a64e98, 0x9257, 0x4b52, 0x98, 0xdd, 0x7f, 0x56, 0xb3, 0x90, 0xe3, 0xde);
ContactMenuItems[CMI_GETSERVERHISTORY] = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::GetContactHistory>);
@@ -72,7 +72,7 @@ void CSkypeProto::InitMenus()
mi.pszService = MODULE"/BlockContact";
mi.name.w = LPGENW("Block contact");
mi.position = CMI_POSITION + CMI_BLOCK;
- mi.hIcolibItem = GetIconHandle(IDI_BLOCKUSER);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_BLOCKUSER);
SET_UID(mi, 0xc6169b8f, 0x53ab, 0x4242, 0xbe, 0x90, 0xe2, 0x4a, 0xa5, 0x73, 0x88, 0x32);
ContactMenuItems[CMI_BLOCK] = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::BlockContact>);
@@ -80,7 +80,7 @@ void CSkypeProto::InitMenus()
mi.pszService = MODULE"/UnblockContact";
mi.name.w = LPGENW("Unblock contact");
mi.position = CMI_POSITION + CMI_UNBLOCK;
- mi.hIcolibItem = GetIconHandle(IDI_UNBLOCKUSER);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_UNBLOCKUSER);
SET_UID(mi, 0x88542f43, 0x7448, 0x48d0, 0x81, 0xa3, 0x26, 0x0, 0x4f, 0x37, 0xee, 0xe0);
ContactMenuItems[CMI_UNBLOCK] = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::UnblockContact>);
@@ -95,6 +95,6 @@ void CSkypeProto::OnBuildProtoMenu()
CreateProtoService(mi.pszService, &CSkypeProto::SvcCreateChat);
mi.name.a = LPGEN("Create new chat");
mi.position = SMI_POSITION + SMI_CREATECHAT;
- mi.hIcolibItem = GetIconHandle(IDI_CONFERENCE);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_CONFERENCE);
Menu_AddProtoMenuItem(&mi, m_szModuleName);
}
diff --git a/protocols/SkypeWeb/src/skype_popups.cpp b/protocols/SkypeWeb/src/skype_popups.cpp
index f279a936b5..e147cd3936 100644
--- a/protocols/SkypeWeb/src/skype_popups.cpp
+++ b/protocols/SkypeWeb/src/skype_popups.cpp
@@ -12,7 +12,7 @@ void CSkypeProto::InitPopups()
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Notifications"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Notification");
- ppc.hIcon = GetIcon(IDI_NOTIFY);
+ ppc.hIcon = g_plugin.getIcon(IDI_NOTIFY);
ppc.colorBack = RGB(255, 255, 255);
ppc.colorText = RGB(0, 0, 0);
ppc.iSeconds = 5;
@@ -20,7 +20,7 @@ void CSkypeProto::InitPopups()
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Errors"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Error");
- ppc.hIcon = GetIcon(IDI_ERRORICON);
+ ppc.hIcon = g_plugin.getIcon(IDI_ERRORICON);
ppc.colorBack = RGB(255, 255, 255);
ppc.colorText = RGB(0, 0, 0);
ppc.iSeconds = -1;
@@ -28,7 +28,7 @@ void CSkypeProto::InitPopups()
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Calls"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Call");
- ppc.hIcon = GetIcon(IDI_CALL);
+ ppc.hIcon = g_plugin.getIcon(IDI_CALL);
ppc.colorBack = RGB(255, 255, 255);
ppc.colorText = RGB(0, 0, 0);
ppc.iSeconds = 30;
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h
index 7a15904c76..1414d38855 100644
--- a/protocols/SkypeWeb/src/skype_proto.h
+++ b/protocols/SkypeWeb/src/skype_proto.h
@@ -195,10 +195,6 @@ private:
requestQueue->Send(request, SkypeHttpResponse, delegate);
}
- // icons
- static HICON GetIcon(int iconId);
- static HANDLE GetIconHandle(int iconId);
-
// menus
static HGENMENU ContactMenuItems[CMI_MAX];
int OnPrebuildContactMenu(WPARAM hContact, LPARAM);
diff --git a/protocols/SkypeWeb/src/skype_trouter.cpp b/protocols/SkypeWeb/src/skype_trouter.cpp
index b88dbe1c5d..1207beec23 100644
--- a/protocols/SkypeWeb/src/skype_trouter.cpp
+++ b/protocols/SkypeWeb/src/skype_trouter.cpp
@@ -194,7 +194,7 @@ void CSkypeProto::OnTrouterEvent(const JSONNode &body, const JSONNode &)
cle.hContact = hContact;
cle.hDbEvent = hEvent;
cle.lParam = SKYPE_DB_EVENT_TYPE_INCOMING_CALL;
- cle.hIcon = GetIcon(IDI_CALL);
+ cle.hIcon = g_plugin.getIcon(IDI_CALL);
CMStringA service(FORMAT, "%s/IncomingCallCLE", GetContactProto(hContact));
cle.pszService = service.GetBuffer();
diff --git a/protocols/Tox/src/tox_icons.cpp b/protocols/Tox/src/tox_icons.cpp
index 83c8f10f2b..50d11f5303 100644
--- a/protocols/Tox/src/tox_icons.cpp
+++ b/protocols/Tox/src/tox_icons.cpp
@@ -11,19 +11,3 @@ void CToxProto::InitIcons()
{
g_plugin.registerIcon(LPGEN("Protocols") "/" MODULE, iconList, MODULE);
}
-
-HANDLE CToxProto::GetIconHandle(int iconId)
-{
- for (auto &it : iconList)
- if (it.defIconID == iconId)
- return it.hIcolib;
- return nullptr;
-}
-
-HICON CToxProto::GetIcon(int iconId)
-{
- for (auto &it : iconList)
- if (it.defIconID == iconId)
- return IcoLib_GetIconByHandle(it.hIcolib);
- return nullptr;
-}
diff --git a/protocols/Tox/src/tox_messages.cpp b/protocols/Tox/src/tox_messages.cpp
index ef75bfaf38..cd327a7146 100644
--- a/protocols/Tox/src/tox_messages.cpp
+++ b/protocols/Tox/src/tox_messages.cpp
@@ -18,7 +18,7 @@ INT_PTR CToxProto::EventGetIcon(WPARAM wParam, LPARAM lParam)
switch (dbei->eventType) {
case DB_EVENT_ACTION:
- icon = GetIcon(IDI_ME);
+ icon = g_plugin.getIcon(IDI_ME);
break;
default:
diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h
index bcd95434c0..62ecf196e8 100644
--- a/protocols/Tox/src/tox_proto.h
+++ b/protocols/Tox/src/tox_proto.h
@@ -122,10 +122,6 @@ private:
// netlib
void InitNetlib();
- // icons
- static HANDLE GetIconHandle(int iconId);
- static HICON GetIcon(int iconId);
-
// menus
static HGENMENU ContactMenuItems[CMI_MAX];
int __cdecl OnPrebuildContactMenu(WPARAM hContact, LPARAM);