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/Dummy/res/resource.apsbin3608 -> 0 bytes
-rw-r--r--protocols/FacebookRM/src/captcha.cpp2
-rw-r--r--protocols/FacebookRM/src/dialogs.cpp4
-rw-r--r--protocols/FacebookRM/src/process.cpp2
-rw-r--r--protocols/FacebookRM/src/proto.cpp20
-rw-r--r--protocols/FacebookRM/src/theme.cpp27
-rw-r--r--protocols/FacebookRM/src/theme.h2
-rw-r--r--protocols/Gadu-Gadu/src/core.cpp4
-rw-r--r--protocols/Gadu-Gadu/src/gg.h3
-rw-r--r--protocols/Gadu-Gadu/src/groupchat.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/icolib.cpp24
-rw-r--r--protocols/Gadu-Gadu/src/image.cpp18
-rw-r--r--protocols/Gadu-Gadu/src/popups.cpp3
-rw-r--r--protocols/Gadu-Gadu/src/sessions.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/userutils.cpp2
-rw-r--r--protocols/ICQ-WIM/src/ignore.cpp2
-rw-r--r--protocols/IRCG/src/clist.cpp2
-rw-r--r--protocols/IRCG/src/ircproto.cpp2
-rw-r--r--protocols/IRCG/src/options.cpp36
-rw-r--r--protocols/IRCG/src/services.cpp18
-rw-r--r--protocols/IRCG/src/stdafx.h2
-rw-r--r--protocols/IRCG/src/windows.cpp22
-rw-r--r--protocols/JabberG/jabber_xstatus/res/JABBER_XSTATUS.rc324
-rwxr-xr-xprotocols/JabberG/src/jabber.cpp4
-rw-r--r--protocols/JabberG/src/jabber_adhoc.cpp10
-rw-r--r--protocols/JabberG/src/jabber_api.cpp11
-rw-r--r--protocols/JabberG/src/jabber_bookmarks.cpp6
-rw-r--r--protocols/JabberG/src/jabber_byte.cpp13
-rwxr-xr-xprotocols/JabberG/src/jabber_caps.cpp6
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp6
-rw-r--r--protocols/JabberG/src/jabber_console.cpp32
-rw-r--r--protocols/JabberG/src/jabber_disco.cpp129
-rw-r--r--protocols/JabberG/src/jabber_frame.cpp2
-rw-r--r--protocols/JabberG/src/jabber_ft.cpp14
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp16
-rw-r--r--protocols/JabberG/src/jabber_ibb.cpp4
-rw-r--r--protocols/JabberG/src/jabber_icolib.cpp63
-rw-r--r--protocols/JabberG/src/jabber_iq.cpp7
-rw-r--r--protocols/JabberG/src/jabber_iq.h4
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp2
-rwxr-xr-xprotocols/JabberG/src/jabber_iqid.cpp24
-rw-r--r--protocols/JabberG/src/jabber_iqid_muc.cpp12
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp52
-rwxr-xr-xprotocols/JabberG/src/jabber_misc.cpp2
-rw-r--r--protocols/JabberG/src/jabber_notes.cpp6
-rwxr-xr-xprotocols/JabberG/src/jabber_omemo.cpp2
-rw-r--r--protocols/JabberG/src/jabber_opttree.cpp14
-rw-r--r--protocols/JabberG/src/jabber_password.cpp2
-rw-r--r--protocols/JabberG/src/jabber_privacy.cpp83
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.cpp29
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.h8
-rw-r--r--protocols/JabberG/src/jabber_roster.cpp2
-rw-r--r--protocols/JabberG/src/jabber_svc.cpp2
-rwxr-xr-xprotocols/JabberG/src/jabber_thread.cpp11
-rw-r--r--protocols/JabberG/src/jabber_treelist.cpp6
-rwxr-xr-xprotocols/JabberG/src/jabber_userinfo.cpp20
-rwxr-xr-xprotocols/JabberG/src/jabber_util.cpp17
-rw-r--r--protocols/JabberG/src/jabber_vcard.cpp10
-rw-r--r--protocols/JabberG/src/jabber_xml.cpp5
-rw-r--r--protocols/JabberG/src/jabber_xml.h1
-rw-r--r--protocols/JabberG/src/jabber_xstatus.cpp4
-rwxr-xr-xprotocols/JabberG/src/stdafx.h14
-rw-r--r--protocols/MSN/src/msn_lists.cpp23
-rw-r--r--protocols/MSN/src/msn_menu.cpp12
-rw-r--r--protocols/MSN/src/msn_misc.cpp2
-rw-r--r--protocols/MSN/src/msn_opts.cpp27
-rw-r--r--protocols/MSN/src/stdafx.h4
-rw-r--r--protocols/MinecraftDynmap/src/dialogs.cpp47
-rw-r--r--protocols/MinecraftDynmap/src/dialogs.h2
-rw-r--r--protocols/NewsAggregator/Res/Resource.rc1
-rw-r--r--protocols/NewsAggregator/Src/Icons.cpp18
-rw-r--r--protocols/NewsAggregator/Src/Menus.cpp12
-rw-r--r--protocols/NewsAggregator/Src/Services.cpp10
-rw-r--r--protocols/NewsAggregator/Src/resource.h1
-rw-r--r--protocols/NewsAggregator/Src/stdafx.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
-rw-r--r--protocols/VKontakte/src/misc.cpp11
-rw-r--r--protocols/VKontakte/src/vk.h1
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp14
-rw-r--r--protocols/VKontakte/src/vk_dialogs.cpp4
-rw-r--r--protocols/VKontakte/src/vk_feed.cpp2
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp50
-rw-r--r--protocols/Weather/src/stdafx.h3
-rw-r--r--protocols/Weather/src/weather.cpp4
-rw-r--r--protocols/Weather/src/weather_icons.cpp23
-rw-r--r--protocols/Weather/src/weather_ini.cpp2
-rw-r--r--protocols/Weather/src/weather_mwin.cpp2
-rw-r--r--protocols/Weather/src/weather_svcs.cpp32
-rw-r--r--protocols/YAMN/src/browser/badconnect.cpp6
-rw-r--r--protocols/YAMN/src/browser/mailbrowser.cpp18
-rw-r--r--protocols/YAMN/src/main.cpp18
-rw-r--r--protocols/YAMN/src/proto/pop3/pop3opt.cpp57
-rw-r--r--protocols/YAMN/src/services.cpp4
-rw-r--r--protocols/YAMN/src/stdafx.h3
118 files changed, 700 insertions, 1064 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/Dummy/res/resource.aps b/protocols/Dummy/res/resource.aps
deleted file mode 100644
index 10cecfb374..0000000000
--- a/protocols/Dummy/res/resource.aps
+++ /dev/null
Binary files differ
diff --git a/protocols/FacebookRM/src/captcha.cpp b/protocols/FacebookRM/src/captcha.cpp
index 367a03bb66..6c9d2335a6 100644
--- a/protocols/FacebookRM/src/captcha.cpp
+++ b/protocols/FacebookRM/src/captcha.cpp
@@ -39,7 +39,7 @@ static INT_PTR CALLBACK CaptchaFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- Window_SetIcon_IcoLib(hwndDlg, GetIconHandle("key"));
+ Window_SetIcon_IcoLib(hwndDlg, g_plugin.getIconHandle(IDI_KEYS));
params = (CAPTCHA_FORM_PARAMS*)lParam;
SetDlgItemText(hwndDlg, IDC_INSTRUCTION, TranslateT("Enter the text you see"));
diff --git a/protocols/FacebookRM/src/dialogs.cpp b/protocols/FacebookRM/src/dialogs.cpp
index d29d84b1b9..0c7c9616dd 100644
--- a/protocols/FacebookRM/src/dialogs.cpp
+++ b/protocols/FacebookRM/src/dialogs.cpp
@@ -212,7 +212,7 @@ INT_PTR CALLBACK FBMindProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpara
{
TranslateDialogDefault(hwnd);
- Window_SetIcon_IcoLib(hwnd, GetIconHandle("mind"));
+ Window_SetIcon_IcoLib(hwnd, g_plugin.getIconHandle(IDI_MIND));
data = reinterpret_cast<post_status_data*>(lparam);
@@ -634,7 +634,7 @@ CFacebookGuardDialog::CFacebookGuardDialog(FacebookProto *proto, const char *fb_
bool CFacebookGuardDialog::OnInitDialog()
{
- Window_SetIcon_IcoLib(m_hwnd, GetIconHandle("facebook"));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_FACEBOOK));
SendMessage(m_text.GetHwnd(), EM_LIMITTEXT, 6, 0);
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp
index b63006bea3..29c1fac120 100644
--- a/protocols/FacebookRM/src/process.cpp
+++ b/protocols/FacebookRM/src/process.cpp
@@ -324,7 +324,7 @@ void FacebookProto::LoadHistory(void *pParam)
POPUPDATAW ppd;
ppd.iSeconds = 5;
ppd.lchContact = hContact;
- ppd.lchIcon = IcoLib_GetIconByHandle(GetIconHandle("conversation")); // TODO: Use better icon
+ ppd.lchIcon = IcoLib_GetIconByHandle(g_plugin.getIconHandle(IDI_CONVERSATION)); // TODO: Use better icon
wcsncpy(ppd.lpwzContactName, m_tszUserName, MAX_CONTACTNAME);
wcsncpy(ppd.lpwzText, TranslateT("Loading history started."), MAX_SECONDLINE);
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index fef127544d..d2221ae899 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -104,7 +104,7 @@ FacebookProto::FacebookProto(const char* proto_name, const wchar_t* username) :
evtype.module = m_szModuleName;
evtype.eventType = FACEBOOK_EVENTTYPE_CALL;
evtype.descr = LPGEN("Video call");
- evtype.eventIcon = GetIconHandle("facebook");
+ evtype.eventIcon = g_plugin.getIconHandle(IDI_FACEBOOK);
evtype.flags = DETF_HISTORY | DETF_MSGWINDOW;
DbEvent_RegisterType(&evtype);
}
@@ -454,7 +454,7 @@ int FacebookProto::OnToolbarInit(WPARAM, LPARAM)
ttb.pszService = service;
ttb.pszTooltipUp = ttb.name = LPGEN("Share status...");
- ttb.hIconHandleUp = IcoLib_GetIconByHandle(GetIconHandle("mind"));
+ ttb.hIconHandleUp = g_plugin.getIconHandle(IDI_MIND);
g_plugin.addTTB(&ttb);
return 0;
@@ -926,7 +926,7 @@ void FacebookProto::InitPopups()
// Client
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Client errors"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Client");
- ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("facebook"));
+ ppc.hIcon = g_plugin.getIcon(IDI_FACEBOOK);
ppc.colorBack = RGB(191, 0, 0); // red
ppc.colorText = RGB(255, 255, 255); // white
popupClasses.push_back(Popup_RegisterClass(&ppc));
@@ -934,7 +934,7 @@ void FacebookProto::InitPopups()
// Newsfeeds
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Wall posts"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Newsfeed");
- ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("newsfeed"));
+ ppc.hIcon = g_plugin.getIcon(IDI_NEWSFEED);
ppc.colorBack = RGB(255, 255, 255); // white
ppc.colorText = RGB(0, 0, 0); // black
popupClasses.push_back(Popup_RegisterClass(&ppc));
@@ -942,7 +942,7 @@ void FacebookProto::InitPopups()
// Notifications
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Notifications"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Notification");
- ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("notification"));
+ ppc.hIcon = g_plugin.getIcon(IDI_NOTIFICATION);
ppc.colorBack = RGB(59, 89, 152); // Facebook's blue
ppc.colorText = RGB(255, 255, 255); // white
popupClasses.push_back(Popup_RegisterClass(&ppc));
@@ -950,7 +950,7 @@ void FacebookProto::InitPopups()
// Others
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Other events"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Other");
- ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("facebook"));
+ ppc.hIcon = g_plugin.getIcon(IDI_FACEBOOK);
ppc.colorBack = RGB(255, 255, 255); // white
ppc.colorText = RGB(0, 0, 0); // black
popupClasses.push_back(Popup_RegisterClass(&ppc));
@@ -958,7 +958,7 @@ void FacebookProto::InitPopups()
// Friendship changes
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Friendship events"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Friendship");
- ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("friendship"));
+ ppc.hIcon = g_plugin.getIcon(IDI_FRIENDS);
ppc.colorBack = RGB(47, 71, 122); // Facebook's darker blue
ppc.colorText = RGB(255, 255, 255); // white
popupClasses.push_back(Popup_RegisterClass(&ppc));
@@ -966,7 +966,7 @@ void FacebookProto::InitPopups()
// Ticker
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Real-time friends activity"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Ticker");
- ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("newsfeed"));
+ ppc.hIcon = g_plugin.getIcon(IDI_NEWSFEED);
ppc.colorBack = RGB(255, 255, 255); // white
ppc.colorText = RGB(0, 0, 0); // black
popupClasses.push_back(Popup_RegisterClass(&ppc));
@@ -974,7 +974,7 @@ void FacebookProto::InitPopups()
// On this day (memories)
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Memories"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Memories");
- ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("memories"));
+ ppc.hIcon = g_plugin.getIcon(IDI_MEMORIES);
ppc.colorBack = RGB(255, 255, 255); // white
ppc.colorText = RGB(0, 0, 0); // black
popupClasses.push_back(Popup_RegisterClass(&ppc));
@@ -1039,7 +1039,7 @@ void FacebookProto::MessageRead(MCONTACT hContact)
wchar_t ttime[64];
wcsftime(ttime, _countof(ttime), L"%X", localtime(&time));
- HICON hIcon = IcoLib_GetIconByHandle(GetIconHandle("read"));
+ HICON hIcon = g_plugin.getIcon(IDI_READ);
if (isChatRoom(hContact)) {
// Load readers names
diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp
index 9fd5413896..be9a232bc1 100644
--- a/protocols/FacebookRM/src/theme.cpp
+++ b/protocols/FacebookRM/src/theme.cpp
@@ -57,15 +57,6 @@ void InitIcons(void)
g_plugin.registerIcon("Protocols/Facebook", icons, "Facebook");
}
-HANDLE GetIconHandle(const char* name)
-{
- for (auto &it : icons)
- if (mir_strcmp(it.szName, name) == 0)
- return it.hIcolib;
-
- return nullptr;
-}
-
// Helper functions
template<INT_PTR(__cdecl FacebookProto::*Fcn)(WPARAM, LPARAM)>
INT_PTR GlobalService(WPARAM wParam, LPARAM lParam)
@@ -107,7 +98,7 @@ void InitContactMenus()
SET_UID(mi, 0x1e9d0534, 0xc319, 0x42a2, 0xbe, 0xd5, 0x1e, 0xae, 0xe1, 0x54, 0xd, 0x89);
mi.position = -2000006001;
- mi.hIcolibItem = GetIconHandle("friendship");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_FRIENDS);
mi.name.a = LPGEN("Visit friendship details");
mi.pszService = "FacebookProto/VisitFriendship";
CreateServiceFunction(mi.pszService, GlobalService<&FacebookProto::VisitFriendship>);
@@ -115,7 +106,7 @@ void InitContactMenus()
SET_UID(mi, 0xd3bfd7d6, 0x43c3, 0x4b05, 0x81, 0x40, 0xc8, 0xbe, 0x81, 0xd9, 0x95, 0xff);
mi.position = -2000006002;
- mi.hIcolibItem = GetIconHandle("conversation");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_CONVERSATION);
mi.name.a = LPGEN("Visit conversation");
mi.pszService = "FacebookProto/VisitConversation";
CreateServiceFunction(mi.pszService, GlobalService<&FacebookProto::VisitConversation>);
@@ -123,7 +114,7 @@ void InitContactMenus()
SET_UID(mi, 0xc631b2ea, 0xa133, 0x4cc9, 0x81, 0x1e, 0xad, 0x8f, 0x36, 0x5c, 0x74, 0xbf);
mi.position = -2000006003;
- mi.hIcolibItem = GetIconHandle("mind");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_MIND);
mi.name.a = LPGEN("Share status...");
mi.pszService = "FacebookProto/Mind";
CreateServiceFunction(mi.pszService, GlobalService<&FacebookProto::OnMind>);
@@ -131,7 +122,7 @@ void InitContactMenus()
SET_UID(mi, 0x10ce2dbf, 0x8acf, 0x4f51, 0x89, 0x76, 0xd9, 0x67, 0xef, 0x69, 0x1d, 0x9d);
mi.position = -2000006004;
- mi.hIcolibItem = GetIconHandle("poke");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_POKE);
mi.name.a = LPGEN("Poke");
mi.pszService = "FacebookProto/Poke";
CreateServiceFunction(mi.pszService, GlobalService<&FacebookProto::Poke>);
@@ -139,7 +130,7 @@ void InitContactMenus()
SET_UID(mi, 0x58e75db0, 0xb9e0, 0x4aa8, 0xbb, 0x42, 0x8d, 0x7d, 0xd1, 0xf6, 0x8e, 0x99);
mi.position = -2000006005;
- mi.hIcolibItem = GetIconHandle("conversation"); // TODO: Use better icon
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_CONVERSATION); // TODO: Use better icon
mi.name.a = LPGEN("Load history");
mi.pszService = "FacebookProto/LoadHistory";
CreateServiceFunction(mi.pszService, GlobalService<&FacebookProto::LoadHistory>);
@@ -200,7 +191,7 @@ void FacebookProto::OnBuildProtoMenu()
mi.pszService = "/Mind";
CreateProtoService(mi.pszService, &FacebookProto::OnMind);
mi.name.a = LPGEN("Share status...");
- mi.hIcolibItem = GetIconHandle("mind");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_MIND);
m_hStatusMind = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = "/VisitProfile";
@@ -229,19 +220,19 @@ void FacebookProto::OnBuildProtoMenu()
mi.pszService = "/CheckNewsfeeds";
CreateProtoService(mi.pszService, &FacebookProto::CheckNewsfeeds);
mi.name.a = LPGEN("Check newsfeeds");
- mi.hIcolibItem = GetIconHandle("newsfeed");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_NEWSFEED);
Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = "/CheckMemories";
CreateProtoService(mi.pszService, &FacebookProto::CheckMemories);
mi.name.a = LPGEN("Check memories");
- mi.hIcolibItem = GetIconHandle("memories");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_MEMORIES);
Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = "/CheckNotifications";
CreateProtoService(mi.pszService, &FacebookProto::CheckNotifications);
mi.name.a = LPGEN("Check notifications");
- mi.hIcolibItem = GetIconHandle("notification");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_NOTIFICATION);
Menu_AddProtoMenuItem(&mi, m_szModuleName);
}
diff --git a/protocols/FacebookRM/src/theme.h b/protocols/FacebookRM/src/theme.h
index 71dfff4ffb..550816f565 100644
--- a/protocols/FacebookRM/src/theme.h
+++ b/protocols/FacebookRM/src/theme.h
@@ -23,6 +23,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
void InitIcons(void);
-HANDLE GetIconHandle(const char *name);
-
void InitContactMenus(void);
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp
index 4807733917..7653d48e17 100644
--- a/protocols/Gadu-Gadu/src/core.cpp
+++ b/protocols/Gadu-Gadu/src/core.cpp
@@ -993,14 +993,14 @@ retry:
CLISTEVENT cle = { 0 };
cle.hContact = hContact;
- cle.hIcon = LoadIconEx("image", FALSE);
+ cle.hIcon = g_plugin.getIcon(IDI_IMAGE);
cle.flags = CLEF_URGENT;
cle.hDbEvent = -98;
cle.lParam = (LPARAM)img;
cle.pszService = service;
cle.szTooltip.a = Translate("Incoming image");
g_clistApi.pfnAddEvent(&cle);
- ReleaseIconEx("image", FALSE);
+ g_plugin.releaseIcon(IDI_IMAGE);
}
}
break;
diff --git a/protocols/Gadu-Gadu/src/gg.h b/protocols/Gadu-Gadu/src/gg.h
index 5ffd8c2d0a..5f88e07527 100644
--- a/protocols/Gadu-Gadu/src/gg.h
+++ b/protocols/Gadu-Gadu/src/gg.h
@@ -283,9 +283,6 @@ char *gg_avatarhash(char *param);
/* IcoLib functions */
void gg_icolib_init();
-HICON LoadIconEx(const char* name, bool big);
-HANDLE GetIconHandle(int iconId);
-void ReleaseIconEx(const char* name, bool big);
/* URI parser functions */
void gg_links_instancemenu_init();
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp
index 648bb662a0..693216babe 100644
--- a/protocols/Gadu-Gadu/src/groupchat.cpp
+++ b/protocols/Gadu-Gadu/src/groupchat.cpp
@@ -415,7 +415,7 @@ static INT_PTR CALLBACK gg_gc_openconfdlg(HWND hwndDlg, UINT message, WPARAM wPa
{
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)lParam);
TranslateDialogDefault(hwndDlg);
- Window_SetIcon_IcoLib(hwndDlg, GetIconHandle(IDI_CONFERENCE));
+ Window_SetIcon_IcoLib(hwndDlg, g_plugin.getIconHandle(IDI_CONFERENCE));
gg_gc_resetclistopts(GetDlgItem(hwndDlg, IDC_CLIST));
// Hook MetaContacts event (if available)
diff --git a/protocols/Gadu-Gadu/src/icolib.cpp b/protocols/Gadu-Gadu/src/icolib.cpp
index 23189ef17c..db210254ed 100644
--- a/protocols/Gadu-Gadu/src/icolib.cpp
+++ b/protocols/Gadu-Gadu/src/icolib.cpp
@@ -45,27 +45,3 @@ void gg_icolib_init()
{
g_plugin.registerIcon("Protocols/" GGDEF_PROTO, iconList, GGDEF_PROTO);
}
-
-HICON LoadIconEx(const char* name, bool big)
-{
- char szSettingName[100];
- mir_snprintf(szSettingName, "%s_%s", GGDEF_PROTO, name);
-
- return IcoLib_GetIcon(szSettingName, big);
-}
-
-HANDLE GetIconHandle(int iconId)
-{
- for (const auto &icon : iconList)
- if (icon.defIconID == iconId)
- return icon.hIcolib;
-
- return nullptr;
-}
-
-void ReleaseIconEx(const char* name, bool big)
-{
- char szSettingName[100];
- mir_snprintf(szSettingName, "%s_%s", GGDEF_PROTO, name);
- IcoLib_Release(szSettingName, big);
-}
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp
index 2585155bcd..787cb69c56 100644
--- a/protocols/Gadu-Gadu/src/image.cpp
+++ b/protocols/Gadu-Gadu/src/image.cpp
@@ -405,23 +405,23 @@ static INT_PTR CALLBACK gg_img_dlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
// Making buttons flat
SendDlgItemMessage(hwndDlg, IDC_IMG_PREV, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_IMG_PREV, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx("previous", FALSE));
+ SendDlgItemMessage(hwndDlg, IDC_IMG_PREV, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_PREV));
SendDlgItemMessage(hwndDlg, IDC_IMG_PREV, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Previous image"), BATF_UNICODE);
SendDlgItemMessage(hwndDlg, IDC_IMG_NEXT, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_IMG_NEXT, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx("next", FALSE));
+ SendDlgItemMessage(hwndDlg, IDC_IMG_NEXT, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_NEXT));
SendDlgItemMessage(hwndDlg, IDC_IMG_NEXT, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Next image"), BATF_UNICODE);
SendDlgItemMessage(hwndDlg, IDC_IMG_SAVE, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_IMG_SAVE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx("save", FALSE));
+ SendDlgItemMessage(hwndDlg, IDC_IMG_SAVE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_SAVE));
SendDlgItemMessage(hwndDlg, IDC_IMG_SAVE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Save image to disk"), BATF_UNICODE);
SendDlgItemMessage(hwndDlg, IDC_IMG_DELETE, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_IMG_DELETE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx("delete", FALSE));
+ SendDlgItemMessage(hwndDlg, IDC_IMG_DELETE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_DELETE));
SendDlgItemMessage(hwndDlg, IDC_IMG_DELETE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Delete image from the list"), BATF_UNICODE);
// Set main window image
- Window_SetIcon_IcoLib(hwndDlg, GetIconHandle(IDI_IMAGE));
+ Window_SetIcon_IcoLib(hwndDlg, g_plugin.getIconHandle(IDI_IMAGE));
wchar_t *szName = Clist_GetContactDisplayName(dat->hContact), szTitle[128];
if (dat->bReceiving)
@@ -522,10 +522,10 @@ static INT_PTR CALLBACK gg_img_dlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
img = img->lpNext;
gg_img_releasepicture(temp);
}
- ReleaseIconEx("previous", FALSE);
- ReleaseIconEx("next", FALSE);
- ReleaseIconEx("delete", FALSE);
- ReleaseIconEx("save", FALSE);
+ g_plugin.releaseIcon(IDI_PREV);
+ g_plugin.releaseIcon(IDI_NEXT);
+ g_plugin.releaseIcon(IDI_DELETE);
+ g_plugin.releaseIcon(IDI_SAVE);
Window_FreeIcon_IcoLib(hwndDlg);
gg->gg_EnterCriticalSection(&gg->img_mutex, "gg_img_dlgproc", 58, "img_mutex", 1);
list_remove(&gg->imagedlgs, dat, 1);
diff --git a/protocols/Gadu-Gadu/src/popups.cpp b/protocols/Gadu-Gadu/src/popups.cpp
index 8fcf1a00ff..8d6d96e7f9 100644
--- a/protocols/Gadu-Gadu/src/popups.cpp
+++ b/protocols/Gadu-Gadu/src/popups.cpp
@@ -86,8 +86,7 @@ void GaduProto::initpopups()
mir_snwprintf(szDescr, L"%s/%s", m_tszUserName, TranslateT("Notifications"));
puc.colorBack = RGB(173, 206, 247);
puc.colorText = GetSysColor(COLOR_WINDOWTEXT);
- puc.hIcon = CopyIcon(LoadIconEx("main", FALSE));
- ReleaseIconEx("main", FALSE);
+ puc.hIcon = g_plugin.getIcon(IDI_GG);
puc.iSeconds = 4;
hPopupNotify = Popup_RegisterClass(&puc);
diff --git a/protocols/Gadu-Gadu/src/sessions.cpp b/protocols/Gadu-Gadu/src/sessions.cpp
index 6d7ae4893e..6c71aeab95 100644
--- a/protocols/Gadu-Gadu/src/sessions.cpp
+++ b/protocols/Gadu-Gadu/src/sessions.cpp
@@ -169,7 +169,7 @@ static INT_PTR CALLBACK gg_sessions_viewdlg(HWND hwndDlg, UINT message, WPARAM w
GetWindowText(hwndDlg, oldTitle, _countof(oldTitle));
mir_snwprintf(newTitle, oldTitle, gg->m_tszUserName);
SetWindowText(hwndDlg, newTitle);
- Window_SetIcon_IcoLib(hwndDlg, GetIconHandle(IDI_SESSIONS));
+ Window_SetIcon_IcoLib(hwndDlg, g_plugin.getIconHandle(IDI_SESSIONS));
if (hHandCursor == nullptr)
hHandCursor = LoadCursor(nullptr, IDC_HAND);
diff --git a/protocols/Gadu-Gadu/src/userutils.cpp b/protocols/Gadu-Gadu/src/userutils.cpp
index dd3a8d5d7f..8b51ba24b1 100644
--- a/protocols/Gadu-Gadu/src/userutils.cpp
+++ b/protocols/Gadu-Gadu/src/userutils.cpp
@@ -213,7 +213,7 @@ INT_PTR CALLBACK gg_userutildlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
{
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- Window_SetIcon_IcoLib(hwndDlg, GetIconHandle(IDI_SETTINGS));
+ Window_SetIcon_IcoLib(hwndDlg, g_plugin.getIconHandle(IDI_SETTINGS));
dat = (GGUSERUTILDLGDATA *)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
if (dat) SetDlgItemTextA(hwndDlg, IDC_EMAIL, dat->email); // Readup email
diff --git a/protocols/ICQ-WIM/src/ignore.cpp b/protocols/ICQ-WIM/src/ignore.cpp
index 63bcc48d72..66501858df 100644
--- a/protocols/ICQ-WIM/src/ignore.cpp
+++ b/protocols/ICQ-WIM/src/ignore.cpp
@@ -38,7 +38,7 @@ public:
bool OnInitDialog() override
{
HIMAGELIST hImageList = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 2, 0);
- ImageList_AddIcon(hImageList, IcoLib_GetIcon(Skin_GetIconName(SKINICON_OTHER_DELETE)));
+ ImageList_AddIcon(hImageList, Skin_LoadIcon(SKINICON_OTHER_DELETE));
m_list.SetImageList(hImageList, LVSIL_SMALL);
m_list.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_SUBITEMIMAGES | LVS_EX_GRIDLINES);
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp
index 4cffc5dd14..02739d42e0 100644
--- a/protocols/IRCG/src/clist.cpp
+++ b/protocols/IRCG/src/clist.cpp
@@ -66,7 +66,7 @@ BOOL CIrcProto::CList_AddDCCChat(const CMStringW& name, const CMStringW& hostmas
cle.hContact = hContact;
cle.hDbEvent = -100;
cle.flags = CLEF_UNICODE;
- cle.hIcon = LoadIconEx(IDI_DCC);
+ cle.hIcon = g_plugin.getIcon(IDI_DCC);
mir_snprintf(szService, "%s/DblClickEvent", m_szModuleName);
cle.pszService = szService;
mir_snwprintf(szNick, TranslateT("CTCP chat request from %s"), name.c_str());
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp
index 83225e0699..d05c5a5027 100644
--- a/protocols/IRCG/src/ircproto.cpp
+++ b/protocols/IRCG/src/ircproto.cpp
@@ -706,7 +706,7 @@ int CIrcProto::SetStatusInternal(int iNewStatus, bool bIsInternal)
SetWindowTextA(hwnd, "Miranda IRC");
SetDlgItemText(hwnd, IDC_TEXT, TranslateT("Please choose an IRC-network to go online. This network will be the default."));
SetDlgItemText(hwnd, IDC_CAPTION, TranslateT("Default network"));
- Window_SetIcon_IcoLib(hwnd, GetIconHandle(IDI_MAIN));
+ Window_SetIcon_IcoLib(hwnd, g_plugin.getIconHandle(IDI_MAIN));
ShowWindow(hwnd, SW_SHOW);
SetActiveWindow(hwnd);
}
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp
index accfb1ac39..1ce7754a22 100644
--- a/protocols/IRCG/src/options.cpp
+++ b/protocols/IRCG/src/options.cpp
@@ -212,24 +212,6 @@ void InitIcons(void)
g_plugin.registerIcon("Protocols/IRC", iconList, "IRC");
}
-HICON LoadIconEx(int iconId, bool big)
-{
- for (auto &it : iconList)
- if (it.defIconID == iconId)
- return IcoLib_GetIconByHandle(it.hIcolib, big);
-
- return nullptr;
-}
-
-HANDLE GetIconHandle(int iconId)
-{
- for (auto &it : iconList)
- if (it.defIconID == iconId)
- return it.hIcolib;
-
- return nullptr;
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
// code page handler
@@ -437,16 +419,16 @@ static TDbSetting ConnectSettings[] =
{ FIELD_OFFSET(CIrcProto, m_autoOnlineNotification), "AutoOnlineNotification", DBVT_BYTE },
};
-CConnectPrefsDlg::CConnectPrefsDlg(CIrcProto* _pro)
+CConnectPrefsDlg::CConnectPrefsDlg(CIrcProto *_pro)
: CProtoDlgBase<CIrcProto>(_pro, IDD_PREFS_CONNECT),
m_serverCombo(this, IDC_SERVERCOMBO),
m_server(this, IDC_SERVER),
m_port(this, IDC_PORT),
m_port2(this, IDC_PORT2),
m_pass(this, IDC_PASS),
- m_add(this, IDC_ADDSERVER, LoadIconEx(IDI_ADD), LPGEN("Add a new network")),
- m_edit(this, IDC_EDITSERVER, LoadIconEx(IDI_EDIT), LPGEN("Edit this network")),
- m_del(this, IDC_DELETESERVER, LoadIconEx(IDI_DELETE), LPGEN("Delete this network")),
+ m_add(this, IDC_ADDSERVER, g_plugin.getIcon(IDI_ADD), LPGEN("Add a new network")),
+ m_edit(this, IDC_EDITSERVER, g_plugin.getIcon(IDI_EDIT), LPGEN("Edit this network")),
+ m_del(this, IDC_DELETESERVER, g_plugin.getIcon(IDI_DELETE), LPGEN("Delete this network")),
m_nick(this, IDC_NICK),
m_nick2(this, IDC_NICK2),
m_name(this, IDC_NAME),
@@ -989,8 +971,8 @@ COtherPrefsDlg::COtherPrefsDlg(CIrcProto *_pro) :
m_autodetect(this, IDC_UTF_AUTODETECT),
m_quitMessage(this, IDC_QUITMESSAGE),
m_alias(this, IDC_ALIASEDIT),
- m_add(this, IDC_ADD, LoadIconEx(IDI_ADD), LPGEN("Click to set commands that will be performed for this event")),
- m_delete(this, IDC_DELETE, LoadIconEx(IDI_DELETE), LPGEN("Click to delete the commands for this event")),
+ m_add(this, IDC_ADD, g_plugin.getIcon(IDI_ADD), LPGEN("Click to set commands that will be performed for this event")),
+ m_delete(this, IDC_DELETE, g_plugin.getIcon(IDI_DELETE), LPGEN("Click to delete the commands for this event")),
m_performlistModified(false)
{
m_performCombo.OnChange = Callback(this, &COtherPrefsDlg::OnPerformCombo);
@@ -1395,9 +1377,9 @@ void CIrcProto::RewriteIgnoreSettings(void)
CIgnorePrefsDlg::CIgnorePrefsDlg(CIrcProto* _pro)
: CProtoDlgBase<CIrcProto>(_pro, IDD_PREFS_IGNORE),
m_list(this, IDC_LIST),
- m_add(this, IDC_ADD, LoadIconEx(IDI_ADD), LPGEN("Add new ignore")),
- m_edit(this, IDC_EDIT, LoadIconEx(IDI_EDIT), LPGEN("Edit this ignore")),
- m_del(this, IDC_DELETE, LoadIconEx(IDI_DELETE), LPGEN("Delete this ignore")),
+ m_add(this, IDC_ADD, g_plugin.getIcon(IDI_ADD), LPGEN("Add new ignore")),
+ m_edit(this, IDC_EDIT, g_plugin.getIcon(IDI_EDIT), LPGEN("Edit this ignore")),
+ m_del(this, IDC_DELETE, g_plugin.getIcon(IDI_DELETE), LPGEN("Delete this ignore")),
m_enable(this, IDC_ENABLEIGNORE),
m_ignoreChat(this, IDC_IGNORECHAT),
m_ignoreFile(this, IDC_IGNOREFILE),
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp
index fe3908b465..8b91562f6f 100644
--- a/protocols/IRCG/src/services.cpp
+++ b/protocols/IRCG/src/services.cpp
@@ -27,7 +27,7 @@ void CIrcProto::OnBuildProtoMenu()
mi.root = Menu_GetProtocolRoot(this);
mi.name.a = LPGEN("&Quick connect");
- mi.hIcolibItem = GetIconHandle(IDI_QUICK);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_QUICK);
mi.pszService = IRC_QUICKCONNECT;
mi.position = 201001;
hMenuQuick = Menu_AddProtoMenuItem(&mi, m_szModuleName);
@@ -41,20 +41,20 @@ void CIrcProto::OnBuildProtoMenu()
hMenuJoin = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.name.a = LPGEN("&Change your nickname");
- mi.hIcolibItem = GetIconHandle(IDI_RENAME);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_RENAME);
mi.pszService = IRC_CHANGENICK;
mi.position = 201003;
hMenuNick = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.name.a = LPGEN("Show the &list of available channels");
- mi.hIcolibItem = GetIconHandle(IDI_LIST);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_LIST);
mi.pszService = IRC_SHOWLIST;
mi.position = 201004;
hMenuList = Menu_AddProtoMenuItem(&mi, m_szModuleName);
if (m_useServer) mi.flags &= ~CMIF_GRAYED;
mi.name.a = LPGEN("&Show the server window");
- mi.hIcolibItem = GetIconHandle(IDI_SERVER);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_SERVER);
mi.pszService = IRC_SHOWSERVER;
mi.position = 201005;
hMenuServer = Menu_AddProtoMenuItem(&mi, m_szModuleName);
@@ -109,7 +109,7 @@ void InitContactMenus(void)
SET_UID(mi, 0x5f01196f, 0xfbcd, 0x4034, 0xbd, 0x90, 0x12, 0xa0, 0x20, 0x68, 0x15, 0xc0);
mi.name.a = LPGEN("Channel &settings");
- mi.hIcolibItem = GetIconHandle(IDI_MANAGER);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_MANAGER);
mir_strcpy(d, IRC_UM_CHANSETTINGS);
mi.position = 500090002;
hUMenuChanSettings = Menu_AddContactMenuItem(&mi);
@@ -117,7 +117,7 @@ void InitContactMenus(void)
SET_UID(mi, 0x778eb1f6, 0x73c4, 0x4951, 0xb2, 0xca, 0xa1, 0x69, 0x94, 0x7b, 0xb7, 0x87);
mi.name.a = LPGEN("&WhoIs info");
- mi.hIcolibItem = GetIconHandle(IDI_WHOIS);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_WHOIS);
mir_strcpy(d, IRC_UM_WHOIS);
mi.position = 500090001;
hUMenuWhois = Menu_AddContactMenuItem(&mi);
@@ -125,7 +125,7 @@ void InitContactMenus(void)
SET_UID(mi, 0x1c51ae05, 0x9eee, 0x4887, 0x88, 0x96, 0x55, 0xd2, 0xdd, 0xf9, 0x25, 0x6f);
mi.name.a = LPGEN("Di&sconnect");
- mi.hIcolibItem = GetIconHandle(IDI_DELETE);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_DELETE);
mir_strcpy(d, IRC_UM_DISCONNECT);
mi.position = 500090001;
hUMenuDisconnect = Menu_AddContactMenuItem(&mi);
@@ -133,7 +133,7 @@ void InitContactMenus(void)
SET_UID(mi, 0xc6169b8f, 0x53ab, 0x4242, 0xbe, 0x90, 0xe2, 0x4a, 0xa5, 0x73, 0x88, 0x32);
mi.name.a = LPGEN("&Add to ignore list");
- mi.hIcolibItem = GetIconHandle(IDI_BLOCK);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_BLOCK);
mir_strcpy(d, IRC_UM_IGNORE);
mi.position = 500090002;
hUMenuIgnore = Menu_AddContactMenuItem(&mi);
@@ -324,7 +324,7 @@ INT_PTR __cdecl CIrcProto::OnQuickConnectMenuCommand(WPARAM, LPARAM)
SetWindowText(m_quickDlg->GetHwnd(), TranslateT("Quick connect"));
SetDlgItemText(m_quickDlg->GetHwnd(), IDC_TEXT, TranslateT("Please select IRC network and enter the password if needed"));
SetDlgItemText(m_quickDlg->GetHwnd(), IDC_CAPTION, TranslateT("Quick connect"));
- Window_SetIcon_IcoLib(m_quickDlg->GetHwnd(), GetIconHandle(IDI_QUICK));
+ Window_SetIcon_IcoLib(m_quickDlg->GetHwnd(), g_plugin.getIconHandle(IDI_QUICK));
}
ShowWindow(m_quickDlg->GetHwnd(), SW_SHOW);
diff --git a/protocols/IRCG/src/stdafx.h b/protocols/IRCG/src/stdafx.h
index 37343328b9..4f79b0249a 100644
--- a/protocols/IRCG/src/stdafx.h
+++ b/protocols/IRCG/src/stdafx.h
@@ -219,8 +219,6 @@ void InitContactMenus(void);
void UninitContactMenus(void);
void InitIcons(void);
-HICON LoadIconEx(int iIndex, bool big = false);
-HANDLE GetIconHandle(int iconId);
// tools.cpp
int __stdcall WCCmp(const wchar_t* wild, const wchar_t* string);
diff --git a/protocols/IRCG/src/windows.cpp b/protocols/IRCG/src/windows.cpp
index 252417b914..c1f4aa254b 100644
--- a/protocols/IRCG/src/windows.cpp
+++ b/protocols/IRCG/src/windows.cpp
@@ -87,7 +87,7 @@ bool CWhoisDlg::OnInitDialog()
CCoolIrcDlg::OnInitDialog();
- Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_WHOIS));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_WHOIS));
return true;
}
@@ -210,7 +210,7 @@ CNickDlg::CNickDlg(CIrcProto *_pro)
bool CNickDlg::OnInitDialog()
{
CCoolIrcDlg::OnInitDialog();
- Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_RENAME));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_RENAME));
DBVARIANT dbv;
if (!m_proto->getWString("RecentNicks", &dbv)) {
@@ -296,7 +296,7 @@ bool CListDlg::OnInitDialog()
m_list.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT);
m_list2.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT);
- Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_LIST));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_LIST));
m_status.SetText(TranslateT("Please wait..."));
return true;
}
@@ -724,7 +724,7 @@ bool CQuestionDlg::OnInitDialog()
{
CCoolIrcDlg::OnInitDialog();
- Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_IRCQUESTION));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_IRCQUESTION));
return true;
}
@@ -808,11 +808,11 @@ CManagerDlg::CManagerDlg(CIrcProto *_pro)
m_limit(this, IDC_LIMIT),
m_topic(this, IDC_TOPIC),
- m_add(this, IDC_ADD, LoadIconEx(IDI_ADD), LPGEN("Add ban/invite/exception")),
- m_edit(this, IDC_EDIT, LoadIconEx(IDI_EDIT), LPGEN("Edit selected ban/invite/exception")),
- m_remove(this, IDC_REMOVE, LoadIconEx(IDI_DELETE), LPGEN("Delete selected ban/invite/exception")),
- m_applyModes(this, IDC_APPLYMODES, LoadIconEx(IDI_APPLY), LPGEN("Set these modes for the channel")),
- m_applyTopic(this, IDC_APPLYTOPIC, LoadIconEx(IDI_APPLY), LPGEN("Set this topic for the channel")),
+ m_add(this, IDC_ADD, g_plugin.getIcon(IDI_ADD), LPGEN("Add ban/invite/exception")),
+ m_edit(this, IDC_EDIT, g_plugin.getIcon(IDI_EDIT), LPGEN("Edit selected ban/invite/exception")),
+ m_remove(this, IDC_REMOVE, g_plugin.getIcon(IDI_DELETE), LPGEN("Delete selected ban/invite/exception")),
+ m_applyModes(this, IDC_APPLYMODES, g_plugin.getIcon(IDI_APPLY), LPGEN("Set these modes for the channel")),
+ m_applyTopic(this, IDC_APPLYTOPIC, g_plugin.getIcon(IDI_APPLY), LPGEN("Set this topic for the channel")),
m_radio1(this, IDC_RADIO1),
m_radio2(this, IDC_RADIO2),
@@ -885,7 +885,7 @@ bool CManagerDlg::OnInitDialog()
HWND hwndEdit = ChildWindowFromPoint(m_topic.GetHwnd(), pt);
mir_subclassWindow(hwndEdit, MgrEditSubclassProc);
- Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_MANAGER));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_MANAGER));
m_list.SendMsg(LB_SETHORIZONTALEXTENT, 750, NULL);
m_radio1.SetState(true);
@@ -1398,7 +1398,7 @@ bool CCoolIrcDlg::OnInitDialog()
hFont = CreateFontIndirect(&lf);
SendDlgItemMessage(m_hwnd, IDC_CAPTION, WM_SETFONT, (WPARAM)hFont, 0);
- SendDlgItemMessage(m_hwnd, IDC_LOGO, STM_SETICON, (LPARAM)(HICON)LoadIconEx(IDI_LOGO), 0);
+ SendDlgItemMessage(m_hwnd, IDC_LOGO, STM_SETICON, (LPARAM)(HICON)g_plugin.getIcon(IDI_LOGO), 0);
return true;
}
diff --git a/protocols/JabberG/jabber_xstatus/res/JABBER_XSTATUS.rc b/protocols/JabberG/jabber_xstatus/res/JABBER_XSTATUS.rc
index 40eb3e2084..5e3f300d2c 100644
--- a/protocols/JabberG/jabber_xstatus/res/JABBER_XSTATUS.rc
+++ b/protocols/JabberG/jabber_xstatus/res/JABBER_XSTATUS.rc
@@ -26,170 +26,170 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
-201 ICON "moods/afraid.ico"
-202 ICON "moods/amazed.ico"
-203 ICON "moods/amorous.ico"
-204 ICON "moods/angry.ico"
-205 ICON "moods/annoyed.ico"
-206 ICON "moods/anxious.ico"
-207 ICON "moods/aroused.ico"
-208 ICON "moods/ashamed.ico"
-209 ICON "moods/bored.ico"
-210 ICON "moods/brave.ico"
-211 ICON "moods/calm.ico"
-212 ICON "moods/cautious.ico"
-213 ICON "moods/cold.ico"
-214 ICON "moods/confident.ico"
-215 ICON "moods/confused.ico"
-216 ICON "moods/contemplative.ico"
-217 ICON "moods/contented.ico"
-218 ICON "moods/cranky.ico"
-219 ICON "moods/crazy.ico"
-220 ICON "moods/creative.ico"
-221 ICON "moods/curious.ico"
-222 ICON "moods/dejected.ico"
-223 ICON "moods/depressed.ico"
-224 ICON "moods/disappointed.ico"
-225 ICON "moods/disgusted.ico"
-226 ICON "moods/dismayed.ico"
-227 ICON "moods/distracted.ico"
-228 ICON "moods/embarrassed.ico"
-229 ICON "moods/envious.ico"
-230 ICON "moods/excited.ico"
-231 ICON "moods/flirtatious.ico"
-232 ICON "moods/frustrated.ico"
-233 ICON "moods/grateful.ico"
-234 ICON "moods/grieving.ico"
-235 ICON "moods/grumpy.ico"
-236 ICON "moods/guilty.ico"
-237 ICON "moods/happy.ico"
-238 ICON "moods/hopeful.ico"
-239 ICON "moods/hot.ico"
-240 ICON "moods/humbled.ico"
-241 ICON "moods/humiliated.ico"
-242 ICON "moods/hungry.ico"
-243 ICON "moods/hurt.ico"
-244 ICON "moods/impressed.ico"
-245 ICON "moods/in_awe.ico"
-246 ICON "moods/in_love.ico"
-247 ICON "moods/indignant.ico"
-248 ICON "moods/interested.ico"
-249 ICON "moods/intoxicated.ico"
-250 ICON "moods/invincible.ico"
-251 ICON "moods/jealous.ico"
-252 ICON "moods/lonely.ico"
-253 ICON "moods/lost.ico"
-254 ICON "moods/lucky.ico"
-255 ICON "moods/mean.ico"
-256 ICON "moods/moody.ico"
-257 ICON "moods/nervous.ico"
-258 ICON "moods/neutral.ico"
-259 ICON "moods/offended.ico"
-260 ICON "moods/outraged.ico"
-261 ICON "moods/playful.ico"
-262 ICON "moods/proud.ico"
-263 ICON "moods/relaxed.ico"
-264 ICON "moods/relieved.ico"
-265 ICON "moods/remorseful.ico"
-266 ICON "moods/restless.ico"
-267 ICON "moods/sad.ico"
-268 ICON "moods/sarcastic.ico"
-269 ICON "moods/satisfied.ico"
-270 ICON "moods/serious.ico"
-271 ICON "moods/shocked.ico"
-272 ICON "moods/shy.ico"
-273 ICON "moods/sick.ico"
-274 ICON "moods/sleepy.ico"
-275 ICON "moods/spontaneous.ico"
-276 ICON "moods/stressed.ico"
-277 ICON "moods/strong.ico"
-278 ICON "moods/surprised.ico"
-279 ICON "moods/thankful.ico"
-280 ICON "moods/thirsty.ico"
-281 ICON "moods/tired.ico"
-282 ICON "moods/undefined.ico"
-283 ICON "moods/weak.ico"
-284 ICON "moods/worried.ico"
+1201 ICON "moods/afraid.ico"
+1202 ICON "moods/amazed.ico"
+1203 ICON "moods/amorous.ico"
+1204 ICON "moods/angry.ico"
+1205 ICON "moods/annoyed.ico"
+1206 ICON "moods/anxious.ico"
+1207 ICON "moods/aroused.ico"
+1208 ICON "moods/ashamed.ico"
+1209 ICON "moods/bored.ico"
+1210 ICON "moods/brave.ico"
+1211 ICON "moods/calm.ico"
+1212 ICON "moods/cautious.ico"
+1213 ICON "moods/cold.ico"
+1214 ICON "moods/confident.ico"
+1215 ICON "moods/confused.ico"
+1216 ICON "moods/contemplative.ico"
+1217 ICON "moods/contented.ico"
+1218 ICON "moods/cranky.ico"
+1219 ICON "moods/crazy.ico"
+1220 ICON "moods/creative.ico"
+1221 ICON "moods/curious.ico"
+1222 ICON "moods/dejected.ico"
+1223 ICON "moods/depressed.ico"
+1224 ICON "moods/disappointed.ico"
+1225 ICON "moods/disgusted.ico"
+1226 ICON "moods/dismayed.ico"
+1227 ICON "moods/distracted.ico"
+1228 ICON "moods/embarrassed.ico"
+1229 ICON "moods/envious.ico"
+1230 ICON "moods/excited.ico"
+1231 ICON "moods/flirtatious.ico"
+1232 ICON "moods/frustrated.ico"
+1233 ICON "moods/grateful.ico"
+1234 ICON "moods/grieving.ico"
+1235 ICON "moods/grumpy.ico"
+1236 ICON "moods/guilty.ico"
+1237 ICON "moods/happy.ico"
+1238 ICON "moods/hopeful.ico"
+1239 ICON "moods/hot.ico"
+1240 ICON "moods/humbled.ico"
+1241 ICON "moods/humiliated.ico"
+1242 ICON "moods/hungry.ico"
+1243 ICON "moods/hurt.ico"
+1244 ICON "moods/impressed.ico"
+1245 ICON "moods/in_awe.ico"
+1246 ICON "moods/in_love.ico"
+1247 ICON "moods/indignant.ico"
+1248 ICON "moods/interested.ico"
+1249 ICON "moods/intoxicated.ico"
+1250 ICON "moods/invincible.ico"
+1251 ICON "moods/jealous.ico"
+1252 ICON "moods/lonely.ico"
+1253 ICON "moods/lost.ico"
+1254 ICON "moods/lucky.ico"
+1255 ICON "moods/mean.ico"
+1256 ICON "moods/moody.ico"
+1257 ICON "moods/nervous.ico"
+1258 ICON "moods/neutral.ico"
+1259 ICON "moods/offended.ico"
+1260 ICON "moods/outraged.ico"
+1261 ICON "moods/playful.ico"
+1262 ICON "moods/proud.ico"
+1263 ICON "moods/relaxed.ico"
+1264 ICON "moods/relieved.ico"
+1265 ICON "moods/remorseful.ico"
+1266 ICON "moods/restless.ico"
+1267 ICON "moods/sad.ico"
+1268 ICON "moods/sarcastic.ico"
+1269 ICON "moods/satisfied.ico"
+1270 ICON "moods/serious.ico"
+1271 ICON "moods/shocked.ico"
+1272 ICON "moods/shy.ico"
+1273 ICON "moods/sick.ico"
+1274 ICON "moods/sleepy.ico"
+1275 ICON "moods/spontaneous.ico"
+1276 ICON "moods/stressed.ico"
+1277 ICON "moods/strong.ico"
+1278 ICON "moods/surprised.ico"
+1279 ICON "moods/thankful.ico"
+1280 ICON "moods/thirsty.ico"
+1281 ICON "moods/tired.ico"
+1282 ICON "moods/undefined.ico"
+1283 ICON "moods/weak.ico"
+1284 ICON "moods/worried.ico"
-300 ICON "activities/doing_chores.ico"
-301 ICON "activities/buying_groceries.ico"
-302 ICON "activities/cleaning.ico"
-303 ICON "activities/cooking.ico"
-304 ICON "activities/doing_maintenance.ico"
-305 ICON "activities/doing_the_dishes.ico"
-306 ICON "activities/doing_the_laundry.ico"
-307 ICON "activities/gardening.ico"
-308 ICON "activities/running_an_errand.ico"
-309 ICON "activities/walking_the_dog.ico"
-320 ICON "activities/drinking.ico"
-321 ICON "activities/having_a_beer.ico"
-322 ICON "activities/having_coffee.ico"
-323 ICON "activities/having_tea.ico"
-340 ICON "activities/eating.ico"
-341 ICON "activities/having_a_snack.ico"
-342 ICON "activities/having_breakfast.ico"
-343 ICON "activities/having_dinner.ico"
-344 ICON "activities/having_lunch.ico"
-360 ICON "activities/exercising.ico"
-361 ICON "activities/cycling.ico"
-362 ICON "activities/dancing.ico"
-363 ICON "activities/hiking.ico"
-364 ICON "activities/jogging.ico"
-365 ICON "activities/playing_sports.ico"
-366 ICON "activities/running.ico"
-367 ICON "activities/skiing.ico"
-368 ICON "activities/swimming.ico"
-369 ICON "activities/working_out.ico"
-380 ICON "activities/grooming.ico"
-381 ICON "activities/at_the_spa.ico"
-382 ICON "activities/brushing_teeth.ico"
-383 ICON "activities/getting_a_haircut.ico"
-384 ICON "activities/shaving.ico"
-385 ICON "activities/taking_a_bath.ico"
-386 ICON "activities/taking_a_shower.ico"
-400 ICON "activities/having_appointment.ico"
-420 ICON "activities/inactive.ico"
-421 ICON "activities/day_off.ico"
-422 ICON "activities/hanging_out.ico"
-423 ICON "activities/hiding.ico"
-424 ICON "activities/on_vacation.ico"
-425 ICON "activities/praying.ico"
-426 ICON "activities/scheduled_holiday.ico"
-427 ICON "activities/sleeping.ico"
-428 ICON "activities/thinking.ico"
-440 ICON "activities/relaxing.ico"
-441 ICON "activities/fishing.ico"
-442 ICON "activities/gaming.ico"
-443 ICON "activities/going_out.ico"
-444 ICON "activities/partying.ico"
-445 ICON "activities/reading.ico"
-446 ICON "activities/rehearsing.ico"
-447 ICON "activities/shopping.ico"
-448 ICON "activities/smoking.ico"
-449 ICON "activities/socializing.ico"
-450 ICON "activities/sunbathing.ico"
-451 ICON "activities/watching_tv.ico"
-452 ICON "activities/watching_a_movie.ico"
-460 ICON "activities/talking.ico"
-461 ICON "activities/in_real_life.ico"
-462 ICON "activities/on_the_phone.ico"
-463 ICON "activities/on_video_phone.ico"
-480 ICON "activities/traveling.ico"
-481 ICON "activities/commuting.ico"
-482 ICON "activities/cycling.ico"
-483 ICON "activities/driving.ico"
-484 ICON "activities/in_a_car.ico"
-485 ICON "activities/on_a_bus.ico"
-486 ICON "activities/on_a_plane.ico"
-487 ICON "activities/on_a_train.ico"
-488 ICON "activities/on_a_trip.ico"
-489 ICON "activities/walking.ico"
-500 ICON "activities/working.ico"
-501 ICON "activities/coding.ico"
-502 ICON "activities/in_a_meeting.ico"
-503 ICON "activities/studying.ico"
-504 ICON "activities/writing.ico"
+1300 ICON "activities/doing_chores.ico"
+1301 ICON "activities/buying_groceries.ico"
+1302 ICON "activities/cleaning.ico"
+1303 ICON "activities/cooking.ico"
+1304 ICON "activities/doing_maintenance.ico"
+1305 ICON "activities/doing_the_dishes.ico"
+1306 ICON "activities/doing_the_laundry.ico"
+1307 ICON "activities/gardening.ico"
+1308 ICON "activities/running_an_errand.ico"
+1309 ICON "activities/walking_the_dog.ico"
+1320 ICON "activities/drinking.ico"
+1321 ICON "activities/having_a_beer.ico"
+1322 ICON "activities/having_coffee.ico"
+1323 ICON "activities/having_tea.ico"
+1340 ICON "activities/eating.ico"
+1341 ICON "activities/having_a_snack.ico"
+1342 ICON "activities/having_breakfast.ico"
+1343 ICON "activities/having_dinner.ico"
+1344 ICON "activities/having_lunch.ico"
+1360 ICON "activities/exercising.ico"
+1361 ICON "activities/cycling.ico"
+1362 ICON "activities/dancing.ico"
+1363 ICON "activities/hiking.ico"
+1364 ICON "activities/jogging.ico"
+1365 ICON "activities/playing_sports.ico"
+1366 ICON "activities/running.ico"
+1367 ICON "activities/skiing.ico"
+1368 ICON "activities/swimming.ico"
+1369 ICON "activities/working_out.ico"
+1380 ICON "activities/grooming.ico"
+1381 ICON "activities/at_the_spa.ico"
+1382 ICON "activities/brushing_teeth.ico"
+1383 ICON "activities/getting_a_haircut.ico"
+1384 ICON "activities/shaving.ico"
+1385 ICON "activities/taking_a_bath.ico"
+1386 ICON "activities/taking_a_shower.ico"
+1400 ICON "activities/having_appointment.ico"
+1420 ICON "activities/inactive.ico"
+1421 ICON "activities/day_off.ico"
+1422 ICON "activities/hanging_out.ico"
+1423 ICON "activities/hiding.ico"
+1424 ICON "activities/on_vacation.ico"
+1425 ICON "activities/praying.ico"
+1426 ICON "activities/scheduled_holiday.ico"
+1427 ICON "activities/sleeping.ico"
+1428 ICON "activities/thinking.ico"
+1440 ICON "activities/relaxing.ico"
+1441 ICON "activities/fishing.ico"
+1442 ICON "activities/gaming.ico"
+1443 ICON "activities/going_out.ico"
+1444 ICON "activities/partying.ico"
+1445 ICON "activities/reading.ico"
+1446 ICON "activities/rehearsing.ico"
+1447 ICON "activities/shopping.ico"
+1448 ICON "activities/smoking.ico"
+1449 ICON "activities/socializing.ico"
+1450 ICON "activities/sunbathing.ico"
+1451 ICON "activities/watching_tv.ico"
+1452 ICON "activities/watching_a_movie.ico"
+1460 ICON "activities/talking.ico"
+1461 ICON "activities/in_real_life.ico"
+1462 ICON "activities/on_the_phone.ico"
+1463 ICON "activities/on_video_phone.ico"
+1480 ICON "activities/traveling.ico"
+1481 ICON "activities/commuting.ico"
+1482 ICON "activities/cycling.ico"
+1483 ICON "activities/driving.ico"
+1484 ICON "activities/in_a_car.ico"
+1485 ICON "activities/on_a_bus.ico"
+1486 ICON "activities/on_a_plane.ico"
+1487 ICON "activities/on_a_train.ico"
+1488 ICON "activities/on_a_trip.ico"
+1489 ICON "activities/walking.ico"
+1500 ICON "activities/working.ico"
+1501 ICON "activities/coding.ico"
+1502 ICON "activities/in_a_meeting.ico"
+1503 ICON "activities/studying.ico"
+1504 ICON "activities/writing.ico"
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp
index 2317ee00e8..854d565e1f 100755
--- a/protocols/JabberG/src/jabber.cpp
+++ b/protocols/JabberG/src/jabber.cpp
@@ -156,6 +156,10 @@ int CMPlugin::Load()
bPlatform = 0;
#endif
+ char tmp[8];
+ Utils_GetRandom(tmp, sizeof(tmp));
+ bin2hex(tmp, sizeof(tmp), szRandom);
+
Miranda_GetVersionText(szCoreVersion, _countof(szCoreVersion));
CallService(MS_UTILS_GETCOUNTRYLIST, (WPARAM)&g_cbCountries, (LPARAM)&g_countries);
diff --git a/protocols/JabberG/src/jabber_adhoc.cpp b/protocols/JabberG/src/jabber_adhoc.cpp
index 66a0ac71ef..4685038a02 100644
--- a/protocols/JabberG/src/jabber_adhoc.cpp
+++ b/protocols/JabberG/src/jabber_adhoc.cpp
@@ -103,7 +103,7 @@ void CJabberProto::OnIqResult_CommandExecution(const TiXmlElement *iqNode, CJabb
void CJabberProto::AdHoc_RequestListOfCommands(char *szResponder, HWND hwndDlg)
{
- m_ThreadInfo->send(XmlNodeIq(AddIQ(&CJabberProto::OnIqResult_ListOfCommands, JABBER_IQ_TYPE_GET, szResponder, 0, -1, hwndDlg))
+ m_ThreadInfo->send(XmlNodeIq(AddIQ(&CJabberProto::OnIqResult_ListOfCommands, JABBER_IQ_TYPE_GET, szResponder, hwndDlg))
<< XQUERY(JABBER_FEAT_DISCO_ITEMS) << XATTR("node", JABBER_FEAT_COMMANDS));
}
@@ -118,7 +118,7 @@ int CJabberProto::AdHoc_ExecuteCommand(HWND hwndDlg, char*, JabberAdHocData *dat
if (node) {
const char *jid2 = XmlGetAttr(itemNode, "jid");
m_ThreadInfo->send(
- XmlNodeIq(AddIQ(&CJabberProto::OnIqResult_CommandExecution, JABBER_IQ_TYPE_SET, jid2, 0, -1, hwndDlg))
+ XmlNodeIq(AddIQ(&CJabberProto::OnIqResult_CommandExecution, JABBER_IQ_TYPE_SET, jid2, hwndDlg))
<< XCHILDNS("command", JABBER_FEAT_COMMANDS) << XATTR("node", node) << XATTR("action", "execute"));
EnableDlgItem(hwndDlg, IDC_SUBMIT, FALSE);
@@ -279,7 +279,7 @@ int CJabberProto::AdHoc_SubmitCommandForm(HWND hwndDlg, JabberAdHocData *dat, ch
auto *xNode = XmlFirstChild(commandNode, "x");
const char *jid2 = XmlGetAttr(dat->AdHocNode, "from");
- XmlNodeIq iq(AddIQ(&CJabberProto::OnIqResult_CommandExecution, JABBER_IQ_TYPE_SET, jid2, 0, -1, hwndDlg));
+ XmlNodeIq iq(AddIQ(&CJabberProto::OnIqResult_CommandExecution, JABBER_IQ_TYPE_SET, jid2, hwndDlg));
TiXmlElement *command = iq << XCHILDNS("command", JABBER_FEAT_COMMANDS);
const char *sessionId = XmlGetAttr(commandNode, "sessionid");
@@ -341,7 +341,7 @@ static INT_PTR CALLBACK JabberAdHoc_CommandDlgProc(HWND hwndDlg, UINT msg, WPARA
dat->proto = pStartupParams->m_pProto;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
- Window_SetIcon_IcoLib(hwndDlg, g_GetIconHandle(IDI_COMMAND));
+ Window_SetIcon_IcoLib(hwndDlg, g_plugin.getIconHandle(IDI_GROUP));
dat->proto->m_hwndCommandWindow = hwndDlg;
TranslateDialogDefault(hwndDlg);
@@ -371,7 +371,7 @@ static INT_PTR CALLBACK JabberAdHoc_CommandDlgProc(HWND hwndDlg, UINT msg, WPARA
}
else {
dat->proto->m_ThreadInfo->send(
- XmlNodeIq(dat->proto->AddIQ(&CJabberProto::OnIqResult_CommandExecution, JABBER_IQ_TYPE_SET, pStartupParams->m_szJid, 0, -1, hwndDlg))
+ XmlNodeIq(dat->proto->AddIQ(&CJabberProto::OnIqResult_CommandExecution, JABBER_IQ_TYPE_SET, pStartupParams->m_szJid, hwndDlg))
<< XCHILDNS("command", JABBER_FEAT_COMMANDS)
<< XATTR("node", pStartupParams->m_szNode) << XATTR("action", "execute"));
diff --git a/protocols/JabberG/src/jabber_api.cpp b/protocols/JabberG/src/jabber_api.cpp
index 4d52cfa41b..42c91b1ce8 100644
--- a/protocols/JabberG/src/jabber_api.cpp
+++ b/protocols/JabberG/src/jabber_api.cpp
@@ -163,17 +163,6 @@ HJHANDLER CJabberProto::AddIqHandler(JABBER_HANDLER_FUNC Func, int iIqTypes, con
return (HJHANDLER)m_iqManager.AddPermanentHandler(&CJabberProto::ExternalIqHandler, iIqTypes, 0, szXmlns, FALSE, szTag, d, free, iPriority);
}
-HJHANDLER CJabberProto::AddTemporaryIqHandler(JABBER_HANDLER_FUNC Func, int iIqTypes, int iIqId, void *pUserData, DWORD dwTimeout, int iPriority)
-{
- sHandlerData *d = (sHandlerData*)malloc(sizeof(sHandlerData));
- d->Func = Func;
- d->pUserData = pUserData;
- CJabberIqInfo *pInfo = AddIQ(&CJabberProto::ExternalTempIqHandler, iIqTypes, nullptr, 0, iIqId, d, iPriority);
- if (pInfo && dwTimeout > 0)
- pInfo->SetTimeout(dwTimeout);
- return (HJHANDLER)pInfo;
-}
-
HJHANDLER CJabberProto::AddSendHandler(JABBER_HANDLER_FUNC Func, void *pUserData, int iPriority)
{
sHandlerData *d = (sHandlerData*)malloc(sizeof(sHandlerData));
diff --git a/protocols/JabberG/src/jabber_bookmarks.cpp b/protocols/JabberG/src/jabber_bookmarks.cpp
index 87ac8971f8..b3d8e0e791 100644
--- a/protocols/JabberG/src/jabber_bookmarks.cpp
+++ b/protocols/JabberG/src/jabber_bookmarks.cpp
@@ -186,7 +186,7 @@ public:
{
CSuper::OnInitDialog();
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_BOOKMARKS));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_BOOKMARKS));
m_btnAdd.Disable();
m_btnEdit.Disable();
@@ -195,8 +195,8 @@ public:
m_lvBookmarks.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_HEADERDRAGDROP | LVS_EX_DOUBLEBUFFER);
HIMAGELIST hIml = m_lvBookmarks.CreateImageList(LVSIL_SMALL);
- ImageList_AddIcon_Icolib(hIml, m_proto->LoadIconEx("group"));
- ImageList_AddIcon_Icolib(hIml, Skin_LoadIcon(SKINICON_EVENT_URL));
+ g_plugin.addImgListIcon(hIml, IDI_GROUP);
+ ImageList_AddSkinIcon(hIml, SKINICON_EVENT_URL);
m_lvBookmarks.AddColumn(0, TranslateT("Bookmark Name"), m_proto->getWord("bookmarksWnd_cx0", 120));
m_lvBookmarks.AddColumn(1, TranslateT("Address (JID or URL)"), m_proto->getWord("bookmarksWnd_cx1", 210));
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp
index 5d89502c94..c72ebaaea6 100644
--- a/protocols/JabberG/src/jabber_byte.cpp
+++ b/protocols/JabberG/src/jabber_byte.cpp
@@ -161,7 +161,7 @@ void CJabberProto::ByteSendThread(JABBER_BYTE_TRANSFER *jbt)
jbt->szProxyJid = nullptr;
jbt->hProxyEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);
- CJabberIqInfo *pInfo = AddIQ(&CJabberProto::IqResultProxyDiscovery, JABBER_IQ_TYPE_GET, proxyJid, 0, -1, jbt);
+ CJabberIqInfo *pInfo = AddIQ(&CJabberProto::IqResultProxyDiscovery, JABBER_IQ_TYPE_GET, proxyJid, jbt);
nIqId = pInfo->GetIqId();
XmlNodeIq iq(pInfo);
iq << XQUERY(JABBER_FEAT_BYTESTREAMS);
@@ -184,7 +184,7 @@ void CJabberProto::ByteSendThread(JABBER_BYTE_TRANSFER *jbt)
}
}
- CJabberIqInfo *pInfo = AddIQ(&CJabberProto::ByteInitiateResult, JABBER_IQ_TYPE_SET, jbt->dstJID, 0, -1, jbt);
+ CJabberIqInfo *pInfo = AddIQ(&CJabberProto::ByteInitiateResult, JABBER_IQ_TYPE_SET, jbt->dstJID, jbt);
nIqId = pInfo->GetIqId();
char szPort[8];
{
@@ -538,18 +538,15 @@ int CJabberProto::ByteSendProxyParse(HNETLIBCONN hConn, JABBER_BYTE_TRANSFER *jb
jbt->hProxyEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);
jbt->bStreamActivated = FALSE;
- int iqId = SerialNext();
+ auto *pIq = AddIQ(&CJabberProto::IqResultStreamActivate, JABBER_IQ_TYPE_SET, jbt->streamhostJID);
char listJid[256];
- mir_snprintf(listJid, "ftproxy_%d", iqId);
+ mir_snprintf(listJid, "ftproxy_%d", pIq->GetIqId());
JABBER_LIST_ITEM *item = ListAdd(LIST_FTIQID, listJid);
item->jbt = jbt;
- m_ThreadInfo->send(
- XmlNodeIq(AddIQ(&CJabberProto::IqResultStreamActivate, JABBER_IQ_TYPE_SET, jbt->streamhostJID, 0, iqId))
- << XQUERY(JABBER_FEAT_BYTESTREAMS) << XATTR("sid", jbt->sid) << XCHILD("activate", jbt->dstJID));
-
+ m_ThreadInfo->send(XmlNodeIq(pIq) << XQUERY(JABBER_FEAT_BYTESTREAMS) << XATTR("sid", jbt->sid) << XCHILD("activate", jbt->dstJID));
WaitForSingleObject(jbt->hProxyEvent, INFINITE);
CloseHandle(jbt->hProxyEvent);
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp
index 50a94e6204..b4c4ad2923 100755
--- a/protocols/JabberG/src/jabber_caps.cpp
+++ b/protocols/JabberG/src/jabber_caps.cpp
@@ -264,7 +264,8 @@ JabberCapsBits CJabberProto::GetResourceCapabilities(const char *jid, pResourceS
if (jcbMainCaps == JABBER_RESOURCE_CAPS_UNINIT) {
// send disco#info query
- CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnIqResultCapsDiscoInfo, JABBER_IQ_TYPE_GET, jid, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_CHILD_TAG_NODE);
+ CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnIqResultCapsDiscoInfo, JABBER_IQ_TYPE_GET, jid);
+ pInfo->SetParamsToParse(JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_CHILD_TAG_NODE);
pInfo->SetTimeout(JABBER_RESOURCE_CAPS_QUERY_TIMEOUT);
pCaps->SetCaps(JABBER_RESOURCE_CAPS_IN_PROGRESS, pInfo->GetIqId());
r->m_dwDiscoInfoRequestTime = pInfo->GetRequestTime();
@@ -318,7 +319,8 @@ JabberCapsBits CJabberProto::GetResourceCapabilities(const char *jid, pResourceS
void CJabberProto::RequestOldCapsInfo(pResourceStatus &r, const char *fullJid)
{
- CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnIqResultCapsDiscoInfo, JABBER_IQ_TYPE_GET, fullJid, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_CHILD_TAG_NODE);
+ CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnIqResultCapsDiscoInfo, JABBER_IQ_TYPE_GET, fullJid);
+ pInfo->SetParamsToParse(JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_CHILD_TAG_NODE);
pInfo->SetTimeout(JABBER_RESOURCE_CAPS_QUERY_TIMEOUT);
r->m_dwDiscoInfoRequestTime = pInfo->GetRequestTime();
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index 1a70cecb22..9b4dc70a54 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -689,7 +689,7 @@ public:
m_newJids(1),
m_btnInvite(this, IDC_INVITE),
m_txtNewJid(this, IDC_NEWJID),
- m_btnAddJid(this, IDC_ADDJID, ppro->LoadIconEx("addroster"), "Add"),
+ m_btnAddJid(this, IDC_ADDJID, g_plugin.getIcon(IDI_ADDCONTACT), "Add"),
m_txtReason(this, IDC_REASON),
m_clc(this, IDC_CLIST)
{
@@ -713,7 +713,7 @@ public:
CSuper::OnInitDialog();
SetDlgItemText(m_hwnd, IDC_HEADERBAR, CMStringW(FORMAT, TranslateT("Invite Users to\n%s"), m_room));
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_GROUP));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_GROUP));
SetWindowLongPtr(m_clc.GetHwnd(), GWL_STYLE,
GetWindowLongPtr(m_clc.GetHwnd(), GWL_STYLE) | CLS_SHOWHIDDEN | CLS_HIDEOFFLINE | CLS_CHECKBOXES | CLS_HIDEEMPTYGROUPS | CLS_USEGROUPS | CLS_GREYALTERNATE | CLS_GROUPCHECKBOXES);
@@ -819,7 +819,7 @@ static INT_PTR CALLBACK sttUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
dat = (TUserInfoData *)lParam;
- Window_SetIcon_IcoLib(hwndDlg, g_GetIconHandle(IDI_GROUP));
+ Window_SetIcon_IcoLib(hwndDlg, g_plugin.getIconHandle(IDI_GROUP));
{
LOGFONT lf;
GetObject((HFONT)SendDlgItemMessage(hwndDlg, IDC_TXT_NICK, WM_GETFONT, 0, 0), sizeof(lf), &lf);
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp
index 80510be24f..6c1de0b61a 100644
--- a/protocols/JabberG/src/jabber_console.cpp
+++ b/protocols/JabberG/src/jabber_console.cpp
@@ -298,14 +298,14 @@ struct
{
int type;
wchar_t *title;
- char *icon;
+ int icon;
}
static filter_modes[] =
{
- { TFilterInfo::T_JID, L"JID", "main" },
- { TFilterInfo::T_XMLNS, L"xmlns", "xmlconsole" },
- { TFilterInfo::T_ANY, L"all attributes", "sd_filter_apply" },
- { TFilterInfo::T_OFF, L"disabled", "sd_filter_reset" },
+ { TFilterInfo::T_JID, L"JID", IDI_JABBER },
+ { TFilterInfo::T_XMLNS, L"xmlns", IDI_CONSOLE },
+ { TFilterInfo::T_ANY, L"all attributes", IDI_FILTER_APPLY },
+ { TFilterInfo::T_OFF, L"disabled", IDI_FILTER_RESET },
};
class CJabberDlgConsole : public CJabberDlgBase
@@ -321,7 +321,7 @@ public:
{
CSuper::OnInitDialog();
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_CONSOLE));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_CONSOLE));
SendDlgItemMessage(m_hwnd, IDC_CONSOLE, EM_SETEDITSTYLE, SES_EXTENDBACKCOLOR, SES_EXTENDBACKCOLOR);
SendDlgItemMessage(m_hwnd, IDC_CONSOLE, EM_EXLIMITTEXT, 0, 0x80000000);
@@ -342,21 +342,21 @@ public:
{
int idc;
char *title;
- char *icon;
+ int icon;
bool push;
BOOL pushed;
}
static buttons[] =
{
- { IDC_BTN_MSG, "Messages", "pl_msg_allow", true, m_proto->m_filterInfo.msg},
- { IDC_BTN_PRESENCE, "Presences", "pl_prin_allow", true, m_proto->m_filterInfo.presence},
- { IDC_BTN_IQ, "Queries", "pl_iq_allow", true, m_proto->m_filterInfo.iq},
- { IDC_BTN_FILTER, "Filter mode", "sd_filter_apply", true, FALSE},
- { IDC_BTN_FILTER_REFRESH, "Refresh list", "sd_nav_refresh", false, FALSE},
+ { IDC_BTN_MSG, "Messages", IDI_PL_MSG_ALLOW, true, m_proto->m_filterInfo.msg },
+ { IDC_BTN_PRESENCE, "Presences", IDI_PL_PRIN_ALLOW, true, m_proto->m_filterInfo.presence },
+ { IDC_BTN_IQ, "Queries", IDI_PL_QUERY_ALLOW, true, m_proto->m_filterInfo.iq },
+ { IDC_BTN_FILTER, "Filter mode", IDI_FILTER_APPLY, true, false },
+ { IDC_BTN_FILTER_REFRESH, "Refresh list", IDI_NAV_REFRESH, false, false },
};
for (auto &it : buttons) {
- SendDlgItemMessage(m_hwnd, it.idc, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_proto->LoadIconEx(it.icon));
+ SendDlgItemMessage(m_hwnd, it.idc, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(it.icon));
SendDlgItemMessage(m_hwnd, it.idc, BUTTONSETASFLATBTN, TRUE, 0);
SendDlgItemMessage(m_hwnd, it.idc, BUTTONADDTOOLTIP, (WPARAM)it.title, 0);
if (it.push)
@@ -367,8 +367,8 @@ public:
for (auto &it : filter_modes)
if (it.type == m_proto->m_filterInfo.type) {
- IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_proto->LoadIconEx(it.icon)));
- SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_proto->LoadIconEx(it.icon));
+ IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(it.icon)));
+ SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(it.icon));
break;
}
@@ -527,7 +527,7 @@ public:
m_proto->m_filterInfo.type = (TFilterInfo::Type)(res - 1);
for (auto &it : filter_modes) {
if (it.type == m_proto->m_filterInfo.type) {
- IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_proto->LoadIconEx(it.icon)));
+ IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(it.icon)));
break;
}
}
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp
index 30d9ea5519..c299941589 100644
--- a/protocols/JabberG/src/jabber_disco.cpp
+++ b/protocols/JabberG/src/jabber_disco.cpp
@@ -51,57 +51,51 @@ static DWORD sttLastAutoDisco = 0;
enum { SD_OVERLAY_NONE, SD_OVERLAY_FAIL, SD_OVERLAY_PROGRESS, SD_OVERLAY_REGISTERED };
-static struct
+struct
{
char *feature;
char *category;
char *type;
- char *iconName;
+ int iconRes;
int iconIndex;
int listIndex;
-} sttNodeIcons[] =
+}
+static sttNodeIcons[] =
{
// standard identities: http://www.xmpp.org/registrar/disco-categories.html#directory
- {nullptr, "account", nullptr, nullptr, SKINICON_STATUS_ONLINE},
- {nullptr, "auth", nullptr, "key", 0},
- {nullptr, "automation", nullptr, "adhoc", 0},
- {nullptr, "client", nullptr, nullptr, SKINICON_STATUS_ONLINE},
- {nullptr, "collaboration", nullptr, "group", 0},
- {nullptr, "conference", nullptr, "group", 0},
-
- {nullptr, "directory", "chatroom", "group", 0},
- {nullptr, "directory", "group", "group", 0},
- {nullptr, "directory", "user", nullptr, SKINICON_OTHER_FINDUSER},
- {nullptr, "directory", nullptr, nullptr, SKINICON_OTHER_SEARCHALL},
-
- {nullptr, "gateway", "aim", "AIM", SKINICON_STATUS_ONLINE},
- {nullptr, "gateway", "gadu-gadu", "GG", SKINICON_STATUS_ONLINE},
- {nullptr, "gateway", "icq", "ICQ", SKINICON_STATUS_ONLINE},
- {nullptr, "gateway", "msn", "MSN", SKINICON_STATUS_ONLINE},
- {nullptr, "gateway", "qq", "QQ", SKINICON_STATUS_ONLINE},
- {nullptr, "gateway", "tlen", "TLEN", SKINICON_STATUS_ONLINE},
- {nullptr, "gateway", "yahoo", "YAHOO", SKINICON_STATUS_ONLINE},
- {nullptr, "gateway", nullptr, "Agents", 0},
-
- {nullptr, "headline", "rss", "node_rss", 0},
- {nullptr, "headline", "weather", "node_weather", 0},
-
- {nullptr, "proxy", nullptr, nullptr, SKINICON_EVENT_FILE},
-
- {nullptr, "server", nullptr, "node_server", 0},
-
- {nullptr, "store", nullptr, "node_store", 0},
-
- // icons for non-standard identities
- {nullptr, "x-service", "x-rss", "node_rss", 0},
- {nullptr, "application", "x-weather", "node_weather", 0},
- {nullptr, "user", nullptr, nullptr, SKINICON_STATUS_ONLINE},
-
- // icon suggestions based on supported features
- {"jabber:iq:gateway", nullptr, nullptr, "Agents", 0},
- {"jabber:iq:search", nullptr, nullptr, nullptr, SKINICON_OTHER_FINDUSER},
- {JABBER_FEAT_COMMANDS, nullptr, nullptr, "adhoc", 0},
- {JABBER_FEAT_REGISTER, nullptr, nullptr, "key", 0},
+ {nullptr, "account", nullptr, 0, SKINICON_STATUS_ONLINE},
+ {nullptr, "auth", nullptr, IDI_KEYS, 0},
+ {nullptr, "automation", nullptr, IDI_COMMAND, 0},
+ {nullptr, "client", nullptr, 0, SKINICON_STATUS_ONLINE},
+ {nullptr, "collaboration", nullptr, IDI_GROUP, 0},
+ {nullptr, "conference", nullptr, IDI_GROUP, 0},
+
+ {nullptr, "directory", "chatroom", IDI_GROUP, 0},
+ {nullptr, "directory", "group", IDI_GROUP, 0},
+ {nullptr, "directory", "user", 0, SKINICON_OTHER_FINDUSER},
+ {nullptr, "directory", nullptr, 0, SKINICON_OTHER_SEARCHALL},
+
+ {nullptr, "gateway", nullptr, IDI_AGENTS, 0},
+
+ {nullptr, "headline", "rss", IDI_NODE_RSS, 0},
+ {nullptr, "headline", "weather", IDI_NODE_WEATHER, 0},
+
+ {nullptr, "proxy", nullptr, 0, SKINICON_EVENT_FILE},
+
+ {nullptr, "server", nullptr, IDI_NODE_SERVER, 0},
+
+ {nullptr, "store", nullptr, IDI_NODE_STORE, 0},
+
+ // icons for non-standard identities
+ {nullptr, "x-service", "x-rss", IDI_NODE_RSS, 0},
+ {nullptr, "application", "x-weather", IDI_NODE_WEATHER, 0},
+ {nullptr, "user", nullptr, 0, SKINICON_STATUS_ONLINE},
+
+ // icon suggestions based on supported features
+ {"jabber:iq:gateway", nullptr, nullptr, IDI_AGENTS, 0},
+ {"jabber:iq:search", nullptr, nullptr, 0, SKINICON_OTHER_FINDUSER},
+ {JABBER_FEAT_COMMANDS, nullptr, nullptr, IDI_COMMAND, 0},
+ {JABBER_FEAT_REGISTER, nullptr, nullptr, IDI_KEYS, 0},
};
void CJabberProto::OnIqResultServiceDiscoveryInfo(const TiXmlElement *iqNode, CJabberIqInfo *pInfo)
@@ -181,12 +175,12 @@ void CJabberProto::OnIqResultServiceDiscoveryItems(const TiXmlElement *iqNode, C
void CJabberProto::OnIqResultServiceDiscoveryRootInfo(const TiXmlElement *iqNode, CJabberIqInfo *pInfo)
{
- if (!pInfo->m_pUserData) return;
+ if (!pInfo->GetUserData()) return;
mir_cslockfull lck(m_SDManager.cs());
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
for (auto *feature : TiXmlFilter(XmlFirstChild(iqNode, "query"), "feature")) {
- if (!mir_strcmp(XmlGetAttr(feature, "var"), (char*)pInfo->m_pUserData)) {
+ if (!mir_strcmp(XmlGetAttr(feature, "var"), (char*)pInfo->GetUserData())) {
CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(pInfo->GetReceiver(), XmlGetAttr(iqNode, "node"));
SendBothRequests(pNode);
break;
@@ -200,7 +194,7 @@ void CJabberProto::OnIqResultServiceDiscoveryRootInfo(const TiXmlElement *iqNode
void CJabberProto::OnIqResultServiceDiscoveryRootItems(const TiXmlElement *iqNode, CJabberIqInfo *pInfo)
{
- if (!pInfo->m_pUserData)
+ if (!pInfo->GetUserData())
return;
TiXmlDocument packet;
@@ -209,8 +203,7 @@ void CJabberProto::OnIqResultServiceDiscoveryRootItems(const TiXmlElement *iqNod
for (auto *item : TiXmlFilter(XmlFirstChild(iqNode, "query"), "item")) {
const char *szJid = XmlGetAttr(item, "jid");
const char *szNode = XmlGetAttr(item, "node");
- CJabberIqInfo *pNewInfo = AddIQ(&CJabberProto::OnIqResultServiceDiscoveryRootInfo, JABBER_IQ_TYPE_GET, szJid);
- pNewInfo->m_pUserData = pInfo->m_pUserData;
+ CJabberIqInfo *pNewInfo = AddIQ(&CJabberProto::OnIqResultServiceDiscoveryRootInfo, JABBER_IQ_TYPE_GET, szJid, pInfo->GetUserData());
pNewInfo->SetTimeout(30000);
XmlNodeIq iq(pNewInfo);
@@ -341,16 +334,14 @@ void CJabberProto::PerformBrowse(HWND hwndDlg)
}
}
else if (!mir_wstrcmp(szJid, _T(SD_FAKEJID_CONFERENCES))) {
- CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnIqResultServiceDiscoveryRootItems, JABBER_IQ_TYPE_GET, m_ThreadInfo->conn.server);
- pInfo->m_pUserData = (void*)JABBER_FEAT_MUC;
+ CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnIqResultServiceDiscoveryRootItems, JABBER_IQ_TYPE_GET, m_ThreadInfo->conn.server, (void*)JABBER_FEAT_MUC);
pInfo->SetTimeout(30000);
XmlNodeIq iq(pInfo);
iq << XQUERY(JABBER_FEAT_DISCO_ITEMS);
m_ThreadInfo->send(iq);
}
else if (!mir_wstrcmp(szJid, _T(SD_FAKEJID_AGENTS))) {
- CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnIqResultServiceDiscoveryRootItems, JABBER_IQ_TYPE_GET, m_ThreadInfo->conn.server);
- pInfo->m_pUserData = (void*)L"jabber:iq:gateway";
+ CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnIqResultServiceDiscoveryRootItems, JABBER_IQ_TYPE_GET, m_ThreadInfo->conn.server, L"jabber:iq:gateway");
pInfo->SetTimeout(30000);
XmlNodeIq iq(pInfo);
iq << XQUERY(JABBER_FEAT_DISCO_ITEMS);
@@ -423,7 +414,7 @@ void CJabberProto::ApplyNodeIcon(HTREELISTITEM hItem, CJabberSDNode *pNode)
}
for (auto &it : sttNodeIcons) {
- if (!it.iconIndex && !it.iconName)
+ if (!it.iconIndex && !it.iconRes)
continue;
if (it.category) {
@@ -506,12 +497,12 @@ public:
CJabberDlgDiscovery(CJabberProto *proto, char *jid) :
CJabberDlgBase(proto, IDD_SERVICE_DISCOVERY),
m_jid(jid),
- m_btnViewAsTree(this, IDC_BTN_VIEWTREE, proto->LoadIconEx("sd_view_tree"), "View as tree"),
- m_btnViewAsList(this, IDC_BTN_VIEWLIST, proto->LoadIconEx("sd_view_list"), "View as list"),
- m_btnGoHome(this, IDC_BTN_NAVHOME, proto->LoadIconEx("sd_nav_home"), "Navigate home"),
- m_btnBookmarks(this, IDC_BTN_FAVORITE, proto->LoadIconEx("bookmarks"), "Favorites"),
- m_btnRefresh(this, IDC_BTN_REFRESH, proto->LoadIconEx("sd_nav_refresh"), "Refresh node"),
- m_btnBrowse(this, IDC_BUTTON_BROWSE, proto->LoadIconEx("sd_browse"), "Browse"),
+ m_btnViewAsTree(this, IDC_BTN_VIEWTREE, g_plugin.getIcon(IDI_VIEW_TREE), "View as tree"),
+ m_btnViewAsList(this, IDC_BTN_VIEWLIST, g_plugin.getIcon(IDI_VIEW_LIST), "View as list"),
+ m_btnGoHome(this, IDC_BTN_NAVHOME, g_plugin.getIcon(IDI_NAV_HOME), "Navigate home"),
+ m_btnBookmarks(this, IDC_BTN_FAVORITE, g_plugin.getIcon(IDI_BOOKMARKS), "Favorites"),
+ m_btnRefresh(this, IDC_BTN_REFRESH, g_plugin.getIcon(IDI_NAV_REFRESH), "Refresh node"),
+ m_btnBrowse(this, IDC_BUTTON_BROWSE, g_plugin.getIcon(IDI_BROWSE), "Browse"),
m_lstDiscoTree(this, IDC_TREE_DISCO),
m_filter(this, IDC_FILTER)
{
@@ -529,7 +520,7 @@ public:
{
CSuper::OnInitDialog();
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_SERVICE_DISCOVERY));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_SERVICE_DISCOVERY));
if (m_jid) {
SetDlgItemTextUtf(m_hwnd, IDC_COMBO_JID, m_jid);
@@ -572,25 +563,19 @@ public:
ListView_InsertColumn(hwndList, 2, &lvc);
TreeList_Create(hwndList);
- TreeList_AddIcon(hwndList, m_proto->LoadIconEx("main"), 0);
+ TreeList_AddIcon(hwndList, g_plugin.getIcon(IDI_JABBER), 0);
for (auto &it : sttNodeIcons) {
- bool needDestroy = false;
HICON hIcon;
- if ((it.iconIndex == SKINICON_STATUS_ONLINE) && it.iconName) {
- hIcon = (HICON)CallProtoService(it.iconName, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0);
- needDestroy = true;
- }
- else if (it.iconName)
- hIcon = m_proto->LoadIconEx(it.iconName);
+ if (it.iconRes)
+ hIcon = g_plugin.getIcon(it.iconRes);
else if (it.iconIndex)
hIcon = Skin_LoadIcon(it.iconIndex);
else continue;
it.listIndex = TreeList_AddIcon(hwndList, hIcon, 0);
- if (needDestroy) DestroyIcon(hIcon);
}
- TreeList_AddIcon(hwndList, m_proto->LoadIconEx("disco_fail"), SD_OVERLAY_FAIL);
- TreeList_AddIcon(hwndList, m_proto->LoadIconEx("disco_progress"), SD_OVERLAY_PROGRESS);
- TreeList_AddIcon(hwndList, m_proto->LoadIconEx("disco_ok"), SD_OVERLAY_REGISTERED);
+ TreeList_AddIcon(hwndList, g_plugin.getIcon(IDI_DISCO_FAIL), SD_OVERLAY_FAIL);
+ TreeList_AddIcon(hwndList, g_plugin.getIcon(IDI_DISCO_PROGRESS), SD_OVERLAY_PROGRESS);
+ TreeList_AddIcon(hwndList, g_plugin.getIcon(IDI_DISCO_OK), SD_OVERLAY_REGISTERED);
TreeList_SetMode(hwndList, m_proto->getByte("discoWnd_useTree", 1) ? TLM_TREE : TLM_REPORT);
diff --git a/protocols/JabberG/src/jabber_frame.cpp b/protocols/JabberG/src/jabber_frame.cpp
index 4ce01e3396..fcc0d2eed1 100644
--- a/protocols/JabberG/src/jabber_frame.cpp
+++ b/protocols/JabberG/src/jabber_frame.cpp
@@ -102,7 +102,7 @@ CJabberInfoFrame::CJabberInfoFrame(CJabberProto *proto) :
SetWindowPos(m_hwndToolTip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
CreateInfoItem("$", true);
- UpdateInfoItem("$", proto->GetIconHandle(IDI_JABBER), proto->m_tszUserName);
+ UpdateInfoItem("$", proto->m_hProtoIcon, proto->m_tszUserName);
CreateInfoItem("$/JID", true);
UpdateInfoItem("$/JID", Skin_GetIconHandle(SKINICON_OTHER_USERDETAILS), L"Offline");
diff --git a/protocols/JabberG/src/jabber_ft.cpp b/protocols/JabberG/src/jabber_ft.cpp
index c63f50aa96..e832925e2a 100644
--- a/protocols/JabberG/src/jabber_ft.cpp
+++ b/protocols/JabberG/src/jabber_ft.cpp
@@ -97,7 +97,9 @@ void CJabberProto::FtInitiate(char* jid, filetransfer *ft)
if (wchar_t *p = wcsrchr(filename, '\\'))
filename = p + 1;
- XmlNodeIq iq(AddIQ(&CJabberProto::OnFtSiResult, JABBER_IQ_TYPE_SET, MakeJid(jid, rs), JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_TO, -1, ft));
+ auto *pIq = AddIQ(&CJabberProto::OnFtSiResult, JABBER_IQ_TYPE_SET, MakeJid(jid, rs), ft);
+ pIq->SetParamsToParse(JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_TO);
+ XmlNodeIq iq(pIq);
TiXmlElement *si = iq << XCHILDNS("si", JABBER_FEAT_SI) << XATTR("id", sid)
<< XATTR("mime-type", "binary/octet-stream") << XATTR("profile", JABBER_FEAT_SI_FT);
si << XCHILDNS("file", JABBER_FEAT_SI_FT) << XATTR("name", T2Utf(filename))
@@ -124,7 +126,7 @@ void CJabberProto::OnFtSiResult(const TiXmlElement *iqNode, CJabberIqInfo *pInfo
if (!ft)
return;
- if ((pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) && pInfo->m_szFrom && pInfo->m_szTo) {
+ if ((pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) && pInfo->GetFrom() && pInfo->GetTo()) {
if (auto *siNode = XmlFirstChild(iqNode, "si")) {
// fix for very smart clients, like gajim
BOOL bDirect = m_bBsDirect;
@@ -138,8 +140,8 @@ void CJabberProto::OnFtSiResult(const TiXmlElement *iqNode, CJabberIqInfo *pInfo
// Start Bytestream session
JABBER_BYTE_TRANSFER *jbt = new JABBER_BYTE_TRANSFER;
memset(jbt, 0, sizeof(JABBER_BYTE_TRANSFER));
- jbt->srcJID = mir_strdup(pInfo->m_szTo);
- jbt->dstJID = mir_strdup(pInfo->m_szFrom);
+ jbt->srcJID = mir_strdup(pInfo->GetTo());
+ jbt->dstJID = mir_strdup(pInfo->GetFrom());
jbt->sid = mir_strdup(ft->sid);
jbt->pfnSend = &CJabberProto::FtSend;
jbt->pfnFinal = &CJabberProto::FtSendFinal;
@@ -151,8 +153,8 @@ void CJabberProto::OnFtSiResult(const TiXmlElement *iqNode, CJabberIqInfo *pInfo
else if (!mir_strcmp(valueNode->GetText(), JABBER_FEAT_IBB)) {
JABBER_IBB_TRANSFER *jibb = (JABBER_IBB_TRANSFER *)mir_alloc(sizeof(JABBER_IBB_TRANSFER));
memset(jibb, 0, sizeof(JABBER_IBB_TRANSFER));
- jibb->srcJID = mir_strdup(pInfo->m_szTo);
- jibb->dstJID = mir_strdup(pInfo->m_szFrom);
+ jibb->srcJID = mir_strdup(pInfo->GetTo());
+ jibb->dstJID = mir_strdup(pInfo->GetFrom());
jibb->sid = mir_strdup(ft->sid);
jibb->pfnSend = &CJabberProto::FtIbbSend;
jibb->pfnFinal = &CJabberProto::FtSendFinal;
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index 3fba354194..7e18ceae1b 100644
--- a/protocols/JabberG/src/jabber_groupchat.cpp
+++ b/protocols/JabberG/src/jabber_groupchat.cpp
@@ -403,7 +403,7 @@ public:
{
CSuper::OnInitDialog();
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_GROUP));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_GROUP));
JabberGcRecentInfo *pInfo = nullptr;
if (m_jid)
@@ -443,7 +443,7 @@ public:
lf.lfWeight = FW_BOLD;
SendDlgItemMessage(m_hwnd, IDC_TXT_RECENT, WM_SETFONT, (WPARAM)CreateFontIndirect(&lf), TRUE);
- SendDlgItemMessage(m_hwnd, IDC_BOOKMARKS, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_proto->LoadIconEx("bookmarks"));
+ SendDlgItemMessage(m_hwnd, IDC_BOOKMARKS, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_BOOKMARKS));
SendDlgItemMessage(m_hwnd, IDC_BOOKMARKS, BUTTONSETASFLATBTN, TRUE, 0);
SendDlgItemMessage(m_hwnd, IDC_BOOKMARKS, BUTTONADDTOOLTIP, (WPARAM)"Bookmarks", 0);
SendDlgItemMessage(m_hwnd, IDC_BOOKMARKS, BUTTONSETASPUSHBTN, TRUE, 0);
@@ -561,16 +561,16 @@ public:
SetTextColor(lpdis->hDC, clLine2);
DrawText(lpdis->hDC, info->line2, -1, &rc, DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER | DT_WORD_ELLIPSIS);
- DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 1, lpdis->rcItem.top + 1, m_proto->LoadIconEx("group"), 16, 16, 0, nullptr, DI_NORMAL);
+ DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 1, lpdis->rcItem.top + 1, g_plugin.getIcon(IDI_GROUP), 16, 16, 0, nullptr, DI_NORMAL);
switch (info->overlay) {
case RoomInfo::ROOM_WAIT:
- DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 1, lpdis->rcItem.top + 1, m_proto->LoadIconEx("disco_progress"), 16, 16, 0, nullptr, DI_NORMAL);
+ DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 1, lpdis->rcItem.top + 1, g_plugin.getIcon(IDI_DISCO_PROGRESS), 16, 16, 0, nullptr, DI_NORMAL);
break;
case RoomInfo::ROOM_FAIL:
- DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 1, lpdis->rcItem.top + 1, m_proto->LoadIconEx("disco_fail"), 16, 16, 0, nullptr, DI_NORMAL);
+ DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 1, lpdis->rcItem.top + 1, g_plugin.getIcon(IDI_DISCO_FAIL), 16, 16, 0, nullptr, DI_NORMAL);
break;
case RoomInfo::ROOM_BOOKMARK:
- DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 1, lpdis->rcItem.top + 1, m_proto->LoadIconEx("disco_ok"), 16, 16, 0, nullptr, DI_NORMAL);
+ DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 1, lpdis->rcItem.top + 1, g_plugin.getIcon(IDI_DISCO_OK), 16, 16, 0, nullptr, DI_NORMAL);
break;
}
}
@@ -613,7 +613,7 @@ public:
if (*server) {
sttRoomListAppend(GetDlgItem(m_hwnd, IDC_ROOM), RoomInfo::ROOM_WAIT, TranslateT("Loading..."), TranslateT("Please wait for room list to download."), L"");
- CJabberIqInfo *pInfo = m_proto->AddIQ(&CJabberProto::OnIqResultDiscovery, JABBER_IQ_TYPE_GET, T2Utf(server), 0, -1, (void*)GetDlgItem(m_hwnd, IDC_ROOM));
+ CJabberIqInfo *pInfo = m_proto->AddIQ(&CJabberProto::OnIqResultDiscovery, JABBER_IQ_TYPE_GET, T2Utf(server), (void*)GetDlgItem(m_hwnd, IDC_ROOM));
pInfo->SetTimeout(30000);
XmlNodeIq iq(pInfo);
iq << XQUERY(JABBER_FEAT_DISCO_ITEMS);
@@ -1145,7 +1145,7 @@ public:
SetDlgItemTextUtf(m_hwnd, IDC_REASON, m_reason);
SetDlgItemTextUtf(m_hwnd, IDC_NICK, JabberNickFromJID(m_proto->m_szJabberJID));
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_GROUP));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_GROUP));
SetFocus(GetDlgItem(m_hwnd, IDC_NICK));
return true;
diff --git a/protocols/JabberG/src/jabber_ibb.cpp b/protocols/JabberG/src/jabber_ibb.cpp
index c0eadf883e..59edaf6a5f 100644
--- a/protocols/JabberG/src/jabber_ibb.cpp
+++ b/protocols/JabberG/src/jabber_ibb.cpp
@@ -98,7 +98,7 @@ void CJabberProto::IbbSendThread(JABBER_IBB_TRANSFER *jibb)
jibb->state = JIBB_SENDING;
m_ThreadInfo->send(
- XmlNodeIq(AddIQ(&CJabberProto::OnIbbInitiateResult, JABBER_IQ_TYPE_SET, jibb->dstJID, 0, -1, jibb))
+ XmlNodeIq(AddIQ(&CJabberProto::OnIbbInitiateResult, JABBER_IQ_TYPE_SET, jibb->dstJID, jibb))
<< XCHILDNS("open", JABBER_FEAT_IBB) << XATTR("sid", jibb->sid) << XATTRI("block-size", JABBER_IBB_BLOCK_SIZE)
<< XATTR("stanza", "message"));
@@ -115,7 +115,7 @@ void CJabberProto::IbbSendThread(JABBER_IBB_TRANSFER *jibb)
jibb->hEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);
m_ThreadInfo->send(
- XmlNodeIq(AddIQ(&CJabberProto::OnIbbCloseResult, JABBER_IQ_TYPE_SET, jibb->dstJID, 0, -1, jibb))
+ XmlNodeIq(AddIQ(&CJabberProto::OnIbbCloseResult, JABBER_IQ_TYPE_SET, jibb->dstJID, jibb))
<< XCHILDNS("close", JABBER_FEAT_IBB) << XATTR("sid", jibb->sid));
WaitForSingleObject(jibb->hEvent, INFINITE);
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp
index ec8fdfedc8..e3b9b58054 100644
--- a/protocols/JabberG/src/jabber_icolib.cpp
+++ b/protocols/JabberG/src/jabber_icolib.cpp
@@ -172,25 +172,6 @@ void CJabberProto::IconsInit(void)
m_transportProtoTableStartIndex[i] = -1;
}
-HANDLE CJabberProto::GetIconHandle(int iconId)
-{
- if (iconId == IDI_JABBER)
- return m_hProtoIcon;
-
- return g_GetIconHandle(iconId);
-}
-
-HICON CJabberProto::LoadIconEx(const char* name, bool big)
-{
- if (HICON result = g_LoadIconEx(name, big))
- return result;
-
- if (!mir_strcmp(name, "main"))
- return IcoLib_GetIconByHandle(m_hProtoIcon, big);
-
- return nullptr;
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
// internal functions
@@ -456,7 +437,7 @@ void CJabberProto::CheckAllContactsAreTransported()
static IconItem sharedIconList1[] =
{
- { LPGEN("Jabber"), "jabber", IDI_JABBER },
+ { LPGEN("Jabber"), "jabber", IDI_JABBER },
{ LPGEN("Privacy Lists"), "privacylists", IDI_PRIVACY_LISTS },
{ LPGEN("Bookmarks"), "bookmarks", IDI_BOOKMARKS },
{ LPGEN("Notes"), "notes", IDI_NOTES },
@@ -522,42 +503,8 @@ static IconItem sharedIconList4[] =
void g_IconsInit()
{
- g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("Jabber"), sharedIconList1, GLOBAL_SETTING_PREFIX);
- g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("Jabber") "/" LPGEN("Dialogs"), sharedIconList2, GLOBAL_SETTING_PREFIX);
- g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("Jabber") "/" LPGEN("Dialogs") "/" LPGEN("Discovery"), sharedIconList3, GLOBAL_SETTING_PREFIX);
- g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("Jabber") "/" LPGEN("Dialogs") "/" LPGEN("Privacy"), sharedIconList4, GLOBAL_SETTING_PREFIX);
-}
-
-HANDLE g_GetIconHandle(int iconId)
-{
- for (auto &it : sharedIconList1)
- if (it.defIconID == iconId)
- return it.hIcolib;
-
- for (auto &it : sharedIconList2)
- if (it.defIconID == iconId)
- return it.hIcolib;
-
- for (auto &it : sharedIconList3)
- if (it.defIconID == iconId)
- return it.hIcolib;
-
- for (auto &it : sharedIconList4)
- if (it.defIconID == iconId)
- return it.hIcolib;
-
- return nullptr;
-}
-
-HICON g_LoadIconEx(const char* name, bool big)
-{
- char szSettingName[100];
- mir_snprintf(szSettingName, "%s_%s", GLOBAL_SETTING_PREFIX, name);
- return IcoLib_GetIcon(szSettingName, big);
-}
-
-void ImageList_AddIcon_Icolib(HIMAGELIST hIml, HICON hIcon)
-{
- ImageList_AddIcon(hIml, hIcon);
- IcoLib_ReleaseIcon(hIcon);
+ g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("Jabber"), sharedIconList1, GLOBAL_SETTING_MODULE);
+ g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("Jabber") "/" LPGEN("Dialogs"), sharedIconList2, GLOBAL_SETTING_MODULE);
+ g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("Jabber") "/" LPGEN("Dialogs") "/" LPGEN("Discovery"), sharedIconList3, GLOBAL_SETTING_MODULE);
+ g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("Jabber") "/" LPGEN("Dialogs") "/" LPGEN("Privacy"), sharedIconList4, GLOBAL_SETTING_MODULE);
}
diff --git a/protocols/JabberG/src/jabber_iq.cpp b/protocols/JabberG/src/jabber_iq.cpp
index ca1f0b1e17..fc0f50d997 100644
--- a/protocols/JabberG/src/jabber_iq.cpp
+++ b/protocols/JabberG/src/jabber_iq.cpp
@@ -201,15 +201,12 @@ void CJabberIqManager::ExpireAll()
ExpireInfo(pInfo);
}
-CJabberIqInfo* CJabberIqManager::AddHandler(JABBER_IQ_HANDLER pHandler, int nIqType, const char *szReceiver, DWORD dwParamsToParse, int nIqId, void *pUserData, int iPriority)
+CJabberIqInfo* CJabberIqManager::AddHandler(JABBER_IQ_HANDLER pHandler, int nIqType, const char *szReceiver, void *pUserData, int iPriority)
{
CJabberIqInfo *pInfo = new CJabberIqInfo();
pInfo->m_pHandler = pHandler;
- if (nIqId == -1)
- nIqId = ppro->SerialNext();
- pInfo->m_nIqId = nIqId;
+ pInfo->m_nIqId = ppro->SerialNext();
pInfo->m_nIqType = nIqType;
- pInfo->m_dwParamsToParse = dwParamsToParse;
pInfo->m_pUserData = pUserData;
pInfo->m_dwRequestTime = GetTickCount();
pInfo->m_dwTimeout = JABBER_DEFAULT_IQ_REQUEST_TIMEOUT;
diff --git a/protocols/JabberG/src/jabber_iq.h b/protocols/JabberG/src/jabber_iq.h
index f7210f45eb..f457a55496 100644
--- a/protocols/JabberG/src/jabber_iq.h
+++ b/protocols/JabberG/src/jabber_iq.h
@@ -61,8 +61,6 @@ protected:
DWORD m_dwTimeout;
char* m_szReceiver;
int m_iPriority;
-
-public:
void* m_pUserData;
int m_nIqType;
const char* m_szFrom;
@@ -166,7 +164,7 @@ public:
void Shutdown();
// fucking params, maybe just return CJabberIqRequestInfo pointer ?
- CJabberIqInfo* AddHandler(JABBER_IQ_HANDLER pHandler, int nIqType, const char *szReceiver, DWORD dwParamsToParse, int nIqId, void *pUserData, int iPriority);
+ CJabberIqInfo* AddHandler(JABBER_IQ_HANDLER pHandler, int nIqType, const char *szReceiver, void *pUserData, int iPriority);
CJabberIqPermanentInfo* AddPermanentHandler(JABBER_PERMANENT_IQ_HANDLER pHandler, int nIqTypes, DWORD dwParamsToParse, const char *szXmlns, BOOL bAllowPartialNs, const char *szTag, void *pUserData = nullptr, IQ_USER_DATA_FREE_FUNC pUserDataFree = nullptr, int iPriority = JH_PRIORITY_DEFAULT);
// returns TRUE when pInfo found, or FALSE otherwise
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp
index 8686e1f314..bed8949e14 100644
--- a/protocols/JabberG/src/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/src/jabber_iq_handlers.cpp
@@ -431,7 +431,7 @@ BOOL CJabberProto::AddClistHttpAuthEvent(CJabberHttpAuthParams *pParams)
mir_snprintf(szService, "%s%s", m_szModuleName, JS_HTTP_AUTH);
CLISTEVENT cle = {};
- cle.hIcon = (HICON)LoadIconEx("openid");
+ cle.hIcon = g_plugin.getIcon(IDI_HTTP_AUTH);
cle.flags = CLEF_PROTOCOLGLOBAL | CLEF_UNICODE;
cle.hDbEvent = -99;
cle.lParam = (LPARAM)pParams;
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index 5b82a7d45b..e5a231f64c 100755
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -105,7 +105,7 @@ void CJabberProto::OnIqResultNestedRosterGroups(const TiXmlElement *iqNode, CJab
// roster request
char *szUserData = mir_strdup(szGroupDelimiter ? szGroupDelimiter : "\\");
m_ThreadInfo->send(
- XmlNodeIq(AddIQ(&CJabberProto::OnIqResultGetRoster, JABBER_IQ_TYPE_GET, nullptr, 0, -1, (void*)szUserData))
+ XmlNodeIq(AddIQ(&CJabberProto::OnIqResultGetRoster, JABBER_IQ_TYPE_GET, nullptr, szUserData))
<< XCHILDNS("query", JABBER_FEAT_IQ_ROSTER));
}
@@ -1505,12 +1505,12 @@ void CJabberProto::OnIqResultSetBookmarks(const TiXmlElement *iqNode, CJabberIqI
// last activity (XEP-0012) support
void CJabberProto::OnIqResultLastActivity(const TiXmlElement *iqNode, CJabberIqInfo *pInfo)
{
- pResourceStatus r(ResourceInfoFromJID(pInfo->m_szFrom));
+ pResourceStatus r(ResourceInfoFromJID(pInfo->GetFrom()));
if (r == nullptr)
return;
time_t lastActivity = -1;
- if (pInfo->m_nIqType == JABBER_IQ_TYPE_RESULT) {
+ if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
if (auto *xmlLast = XmlGetChildByTag(iqNode, "query", "xmlns", JABBER_FEAT_LAST_ACTIVITY)) {
int nSeconds = xmlLast->IntAttribute("seconds");
lastActivity = (nSeconds == 0) ? 0 : time(0) - nSeconds;
@@ -1528,10 +1528,10 @@ void CJabberProto::OnIqResultLastActivity(const TiXmlElement *iqNode, CJabberIqI
// entity time (XEP-0202) support
void CJabberProto::OnIqResultEntityTime(const TiXmlElement *pIqNode, CJabberIqInfo *pInfo)
{
- if (!pInfo->m_hContact)
+ if (!pInfo->GetHContact())
return;
- if (pInfo->m_nIqType == JABBER_IQ_TYPE_RESULT) {
+ if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
auto *xmlTime = XmlGetChildByTag(pIqNode, "time", "xmlns", JABBER_FEAT_ENTITY_TIME);
if (xmlTime) {
const char *szTzo = XmlGetChildText(xmlTime, "tzo");
@@ -1544,22 +1544,22 @@ void CJabberProto::OnIqResultEntityTime(const TiXmlElement *pIqNode, CJabberIqIn
if (GetTimeZoneInformation(&tzinfo) == TIME_ZONE_ID_DAYLIGHT)
nTz -= tzinfo.DaylightBias / 30;
- setByte(pInfo->m_hContact, "Timezone", (signed char)nTz);
+ setByte(pInfo->GetHContact(), "Timezone", (signed char)nTz);
const char *szTz = XmlGetChildText(xmlTime, "tz");
if (szTz)
- setUString(pInfo->m_hContact, "TzName", szTz);
+ setUString(pInfo->GetHContact(), "TzName", szTz);
else
- delSetting(pInfo->m_hContact, "TzName");
+ delSetting(pInfo->GetHContact(), "TzName");
return;
}
}
}
- else if (pInfo->m_nIqType == JABBER_IQ_TYPE_ERROR) {
- if (getWord(pInfo->m_hContact, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
+ else if (pInfo->GetIqType() == JABBER_IQ_TYPE_ERROR) {
+ if (getWord(pInfo->GetHContact(), "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
return;
}
- delSetting(pInfo->m_hContact, "Timezone");
- delSetting(pInfo->m_hContact, "TzName");
+ delSetting(pInfo->GetHContact(), "Timezone");
+ delSetting(pInfo->GetHContact(), "TzName");
}
diff --git a/protocols/JabberG/src/jabber_iqid_muc.cpp b/protocols/JabberG/src/jabber_iqid_muc.cpp
index 6cc9421c32..3079cfa96a 100644
--- a/protocols/JabberG/src/jabber_iqid_muc.cpp
+++ b/protocols/JabberG/src/jabber_iqid_muc.cpp
@@ -59,13 +59,13 @@ struct
{
int idc;
char *title;
- char *icon;
+ int icon;
bool push;
}
static buttons[] =
{
- { IDC_BTN_FILTERAPPLY, "Apply filter", "sd_filter_apply", false },
- { IDC_BTN_FILTERRESET, "Reset filter", "sd_filter_reset", false },
+ { IDC_BTN_FILTERAPPLY, "Apply filter", IDI_FILTER_APPLY, false },
+ { IDC_BTN_FILTERRESET, "Reset filter", IDI_FILTER_RESET, false },
};
class CJabberMucJidListDlg : public CJabberDlgBase
@@ -180,8 +180,8 @@ public:
bool OnInitDialog() override
{
HIMAGELIST hImageList = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 2, 0);
- ImageList_AddIcon(hImageList, g_LoadIconEx("delete"));
- ImageList_AddIcon(hImageList, g_LoadIconEx("addcontact"));
+ g_plugin.addImgListIcon(hImageList, IDI_DELETE);
+ g_plugin.addImgListIcon(hImageList, IDI_ADDCONTACT);
m_list.SetImageList(hImageList, LVSIL_SMALL);
m_list.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_SUBITEMIMAGES | LVS_EX_GRIDLINES);
@@ -197,7 +197,7 @@ public:
Refresh(m_info);
for (auto &it : buttons) {
- SendDlgItemMessage(m_hwnd, it.idc, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_proto->LoadIconEx(it.icon));
+ SendDlgItemMessage(m_hwnd, it.idc, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(it.icon));
SendDlgItemMessage(m_hwnd, it.idc, BUTTONSETASFLATBTN, TRUE, 0);
SendDlgItemMessage(m_hwnd, it.idc, BUTTONADDTOOLTIP, (WPARAM)it.title, 0);
if (it.push)
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp
index f1cbdcbae9..d0ec3b9dae 100644
--- a/protocols/JabberG/src/jabber_menu.cpp
+++ b/protocols/JabberG/src/jabber_menu.cpp
@@ -170,7 +170,7 @@ void g_MenuInit(void)
mi.pszService = "Jabber/ConvertChatContact";
mi.name.a = LPGEN("Convert");
mi.position = -1999901004;
- mi.hIcolibItem = g_GetIconHandle(IDI_USER2ROOM);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_USER2ROOM);
g_hMenuConvert = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, JabberMenuConvertChatContact);
@@ -188,7 +188,7 @@ void g_MenuInit(void)
mi.pszService = "Jabber/AddToBookmarks";
mi.name.a = LPGEN("Add to Bookmarks");
mi.position = -1999901006;
- mi.hIcolibItem = g_GetIconHandle(IDI_BOOKMARKS);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_BOOKMARKS);
g_hMenuAddBookmark = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, JabberMenuBookmarkAdd);
@@ -197,7 +197,7 @@ void g_MenuInit(void)
mi.pszService = "Jabber/TransportLogin";
mi.name.a = LPGEN("Login/logout");
mi.position = -1999901007;
- mi.hIcolibItem = g_GetIconHandle(IDI_LOGIN);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_LOGIN);
g_hMenuLogin = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, JabberMenuTransportLogin);
@@ -206,7 +206,7 @@ void g_MenuInit(void)
mi.pszService = "Jabber/TransportGetNicks";
mi.name.a = LPGEN("Resolve nicks");
mi.position = -1999901008;
- mi.hIcolibItem = g_GetIconHandle(IDI_REFRESH);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_REFRESH);
g_hMenuRefresh = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, JabberMenuTransportResolve);
@@ -215,7 +215,7 @@ void g_MenuInit(void)
mi.pszService = "Jabber/RunCommands";
mi.name.a = LPGEN("Commands");
mi.position = -1999901009;
- mi.hIcolibItem = g_GetIconHandle(IDI_COMMAND);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_COMMAND);
g_hMenuCommands = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, JabberContactMenuRunCommands);
@@ -224,7 +224,7 @@ void g_MenuInit(void)
mi.pszService = "Jabber/SendNote";
mi.name.a = LPGEN("Send Note");
mi.position = -1999901010;
- mi.hIcolibItem = g_GetIconHandle(IDI_SEND_NOTE);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_SEND_NOTE);
g_hMenuSendNote = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, JabberMenuSendNote);
@@ -235,7 +235,7 @@ void g_MenuInit(void)
mi.pszService = "Jabber/DirectPresenceDummySvc";
mi.name.a = LPGEN("Send Presence");
mi.position = -1999901011;
- mi.hIcolibItem = g_GetIconHandle(IDI_NOTES);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_NOTES);
g_hMenuDirectPresence[0] = Menu_AddContactMenuItem(&mi);
UNSET_UID(mi);
@@ -261,7 +261,7 @@ void g_MenuInit(void)
mi.pszService = "Jabber/ResourceSelectorDummySvc";
mi.name.a = LPGEN("Jabber Resource");
mi.position = -1999901011;
- mi.hIcolibItem = g_GetIconHandle(IDI_JABBER);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_JABBER);
g_hMenuResourcesRoot = Menu_AddContactMenuItem(&mi);
UNSET_UID(mi);
@@ -270,14 +270,14 @@ void g_MenuInit(void)
mi.pszService = "Jabber/UseResource_last";
mi.name.a = LPGEN("Last Active");
mi.position = -1999901000;
- mi.hIcolibItem = g_GetIconHandle(IDI_JABBER);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_JABBER);
g_hMenuResourcesActive = Menu_AddContactMenuItem(&mi);
CreateServiceFunctionParam(mi.pszService, JabberMenuHandleResource, MENUITEM_LASTSEEN);
mi.pszService = "Jabber/UseResource_server";
mi.name.a = LPGEN("Server's Choice");
mi.position = -1999901000;
- mi.hIcolibItem = g_GetIconHandle(IDI_NODE_SERVER);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_NODE_SERVER);
g_hMenuResourcesServer = Menu_AddContactMenuItem(&mi);
CreateServiceFunctionParam(mi.pszService, JabberMenuHandleResource, MENUITEM_SERVER);
}
@@ -541,14 +541,14 @@ void CJabberProto::OnBuildProtoMenu()
CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandleBookmarks);
mi.name.a = LPGEN("Bookmarks");
mi.position = 200001;
- mi.hIcolibItem = GetIconHandle(IDI_BOOKMARKS);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_BOOKMARKS);
m_hMenuBookmarks = Menu_AddProtoMenuItem(&mi, m_szModuleName);
// "Services..."
mi.pszService = nullptr;
mi.name.a = LPGEN("Services...");
mi.position = 200003;
- mi.hIcolibItem = GetIconHandle(IDI_SERVICE_DISCOVERY);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_SERVICE_DISCOVERY);
HGENMENU hMenuServicesRoot = Menu_AddProtoMenuItem(&mi, m_szModuleName);
// "Service Discovery..."
@@ -557,35 +557,35 @@ void CJabberProto::OnBuildProtoMenu()
CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandleServiceDiscovery);
mi.name.a = LPGEN("Service Discovery");
mi.position = 2000050001;
- mi.hIcolibItem = GetIconHandle(IDI_SERVICE_DISCOVERY);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_SERVICE_DISCOVERY);
m_hMenuServiceDiscovery = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = "/SD/MyTransports";
CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandleServiceDiscoveryMyTransports);
mi.name.a = LPGEN("Registered Transports");
mi.position = 2000050003;
- mi.hIcolibItem = GetIconHandle(IDI_TRANSPORTL);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_TRANSPORTL);
m_hMenuSDMyTransports = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = "/SD/Transports";
CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandleServiceDiscoveryTransports);
mi.name.a = LPGEN("Local Server Transports");
mi.position = 2000050004;
- mi.hIcolibItem = GetIconHandle(IDI_TRANSPORT);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_TRANSPORT);
m_hMenuSDTransports = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = "/SD/Conferences";
CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandleServiceDiscoveryConferences);
mi.name.a = LPGEN("Browse chatrooms");
mi.position = 2000050005;
- mi.hIcolibItem = GetIconHandle(IDI_GROUP);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_GROUP);
m_hMenuSDConferences = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = "/Groupchat";
CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandleJoinGroupchat);
mi.name.a = LPGEN("Create/Join group chat");
mi.position = 2000050006;
- mi.hIcolibItem = GetIconHandle(IDI_GROUP);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_GROUP);
m_hMenuGroupchat = Menu_AddProtoMenuItem(&mi, m_szModuleName);
// "Change Password..."
@@ -593,7 +593,7 @@ void CJabberProto::OnBuildProtoMenu()
CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandleChangePassword);
mi.name.a = LPGEN("Change Password");
mi.position = 2000050007;
- mi.hIcolibItem = GetIconHandle(IDI_KEYS);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_KEYS);
m_hMenuChangePassword = Menu_AddProtoMenuItem(&mi, m_szModuleName);
// "Roster editor"
@@ -601,7 +601,7 @@ void CJabberProto::OnBuildProtoMenu()
CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandleRosterControl);
mi.name.a = LPGEN("Roster editor");
mi.position = 2000050009;
- mi.hIcolibItem = GetIconHandle(IDI_AGENTS);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_AGENTS);
m_hMenuRosterControl = Menu_AddProtoMenuItem(&mi, m_szModuleName);
// "XML Console"
@@ -609,14 +609,14 @@ void CJabberProto::OnBuildProtoMenu()
CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandleConsole);
mi.name.a = LPGEN("XML Console");
mi.position = 2000050010;
- mi.hIcolibItem = GetIconHandle(IDI_CONSOLE);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_CONSOLE);
Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = "/Notes";
CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandleNotes);
mi.name.a = LPGEN("Notes");
mi.position = 2000050011;
- mi.hIcolibItem = GetIconHandle(IDI_NOTES);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_NOTES);
m_hMenuNotes = Menu_AddProtoMenuItem(&mi, m_szModuleName);
BuildPrivacyMenu();
@@ -694,11 +694,11 @@ void CJabberProto::BuildPriorityMenu()
mir_snprintf(srvFce, "/menuSetPriority/%d", steps[i]);
if (steps[i] > 0) {
mir_snwprintf(szName, TranslateT("Increase priority by %d"), steps[i]);
- mi.hIcolibItem = GetIconHandle(IDI_ARROW_UP);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_ARROW_UP);
}
else {
mir_snwprintf(szName, TranslateT("Decrease priority by %d"), -steps[i]);
- mi.hIcolibItem = GetIconHandle(IDI_ARROW_DOWN);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_ARROW_DOWN);
}
if (needServices)
@@ -799,19 +799,19 @@ int g_OnToolbarInit(WPARAM, LPARAM)
CreateServiceFunction("JABBER/*/Groupchat", g_ToolbarHandleJoinGroupchat);
ttb.pszService = "JABBER/*/Groupchat";
ttb.pszTooltipUp = ttb.name = LPGEN("Join conference");
- ttb.hIconHandleUp = g_GetIconHandle(IDI_GROUP);
+ ttb.hIconHandleUp = g_plugin.getIconHandle(IDI_GROUP);
g_plugin.addTTB(&ttb);
CreateServiceFunction("JABBER/*/Bookmarks", g_ToolbarHandleBookmarks);
ttb.pszService = "JABBER/*/Bookmarks";
ttb.pszTooltipUp = ttb.name = LPGEN("Open bookmarks");
- ttb.hIconHandleUp = g_GetIconHandle(IDI_BOOKMARKS);
+ ttb.hIconHandleUp = g_plugin.getIconHandle(IDI_BOOKMARKS);
g_plugin.addTTB(&ttb);
CreateServiceFunction("JABBER/*/ServiceDiscovery", g_ToolbarHandleServiceDiscovery);
ttb.pszService = "JABBER/*/ServiceDiscovery";
ttb.pszTooltipUp = ttb.name = LPGEN("Service discovery");
- ttb.hIconHandleUp = g_GetIconHandle(IDI_SERVICE_DISCOVERY);
+ ttb.hIconHandleUp = g_plugin.getIconHandle(IDI_SERVICE_DISCOVERY);
g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index 7f6ccc3d53..434394c7da 100755
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -412,7 +412,7 @@ void CJabberProto::InitPopups(void)
mir_snprintf(name, "%s_%s", m_szModuleName, "Error");
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Errors"));
- ppc.hIcon = LoadIconEx("main");
+ ppc.hIcon = IcoLib_GetIconByHandle(m_hProtoIcon);
ppc.colorBack = RGB(191, 0, 0); //Red
ppc.colorText = RGB(255, 245, 225); //Yellow
ppc.iSeconds = 60;
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp
index 0956b06bfc..11e1f98a54 100644
--- a/protocols/JabberG/src/jabber_notes.cpp
+++ b/protocols/JabberG/src/jabber_notes.cpp
@@ -178,7 +178,7 @@ public:
bool OnInitDialog() override
{
CSuper::OnInitDialog();
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_NOTES));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_NOTES));
if (m_fnProcess) {
CMStringW buf;
@@ -507,7 +507,7 @@ public:
bool OnInitDialog() override
{
CSuper::OnInitDialog();
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_NOTES));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_NOTES));
LOGFONT lf, lfTmp;
m_hfntNormal = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
@@ -723,7 +723,7 @@ bool CJabberProto::OnIncomingNote(const char *szFrom, const TiXmlElement *hXml)
mir_snprintf(szService, "%s%s", m_szModuleName, JS_INCOMING_NOTE_EVENT);
CLISTEVENT cle = {};
- cle.hIcon = (HICON)LoadIconEx("notes");
+ cle.hIcon = g_plugin.getIcon(IDI_NOTES);
cle.flags = CLEF_PROTOCOLGLOBAL | CLEF_UNICODE;
cle.hDbEvent = -99;
cle.lParam = (LPARAM)pItem;
diff --git a/protocols/JabberG/src/jabber_omemo.cpp b/protocols/JabberG/src/jabber_omemo.cpp
index dce6f4cc7e..cab97f697d 100755
--- a/protocols/JabberG/src/jabber_omemo.cpp
+++ b/protocols/JabberG/src/jabber_omemo.cpp
@@ -1934,7 +1934,7 @@ bool CJabberProto::OmemoCheckSession(MCONTACT hContact)
while (id) {
if (!checked) {
pending_check = true;
- XmlNodeIq iq(AddIQ(&CJabberProto::OmemoOnIqResultGetBundle, JABBER_IQ_TYPE_GET, nullptr, 0UL, -1, &id));
+ XmlNodeIq iq(AddIQ(&CJabberProto::OmemoOnIqResultGetBundle, JABBER_IQ_TYPE_GET, nullptr, &id));
char szBareJid[JABBER_MAX_JID_LEN];
iq << XATTR("from", JabberStripJid(m_ThreadInfo->fullJID, szBareJid, _countof_portable(szBareJid)));
diff --git a/protocols/JabberG/src/jabber_opttree.cpp b/protocols/JabberG/src/jabber_opttree.cpp
index c8bda4c769..f8c5ed2379 100644
--- a/protocols/JabberG/src/jabber_opttree.cpp
+++ b/protocols/JabberG/src/jabber_opttree.cpp
@@ -97,13 +97,13 @@ void CCtrlTreeOpts::OnInit()
DeleteAllItems();
hImgLst = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR | ILC_COLOR32 | ILC_MASK, 5, 1);
- ImageList_AddIcon_Icolib(hImgLst, Skin_LoadIcon(SKINICON_OTHER_MIRANDA));
- ImageList_AddIcon_Icolib(hImgLst, Skin_LoadIcon(SKINICON_OTHER_TICK)); // check on
- ImageList_AddIcon_Icolib(hImgLst, Skin_LoadIcon(SKINICON_OTHER_NOTICK)); // check off
- ImageList_AddIcon_Icolib(hImgLst, Skin_LoadIcon(SKINICON_OTHER_TICK)); // radio on
- ImageList_AddIcon_Icolib(hImgLst, Skin_LoadIcon(SKINICON_OTHER_NOTICK)); // radio on
- ImageList_AddIcon_Icolib(hImgLst, Skin_LoadIcon(SKINICON_OTHER_GROUPOPEN));
- ImageList_AddIcon_Icolib(hImgLst, Skin_LoadIcon(SKINICON_OTHER_GROUPSHUT));
+ ImageList_AddSkinIcon(hImgLst, SKINICON_OTHER_MIRANDA);
+ ImageList_AddSkinIcon(hImgLst, SKINICON_OTHER_TICK); // check on
+ ImageList_AddSkinIcon(hImgLst, SKINICON_OTHER_NOTICK); // check off
+ ImageList_AddSkinIcon(hImgLst, SKINICON_OTHER_TICK); // radio on
+ ImageList_AddSkinIcon(hImgLst, SKINICON_OTHER_NOTICK); // radio on
+ ImageList_AddSkinIcon(hImgLst, SKINICON_OTHER_GROUPOPEN);
+ ImageList_AddSkinIcon(hImgLst, SKINICON_OTHER_GROUPSHUT);
SetImageList(hImgLst, TVSIL_NORMAL);
/* build options tree. based on code from IcoLib */
diff --git a/protocols/JabberG/src/jabber_password.cpp b/protocols/JabberG/src/jabber_password.cpp
index 4ad8974619..b80679f565 100644
--- a/protocols/JabberG/src/jabber_password.cpp
+++ b/protocols/JabberG/src/jabber_password.cpp
@@ -41,7 +41,7 @@ public:
bool OnInitDialog() override
{
m_proto->m_hwndJabberChangePassword = m_hwnd;
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_KEYS));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_KEYS));
if (m_proto->m_bJabberOnline && m_proto->m_ThreadInfo != nullptr) {
char text[1024];
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp
index 5cc56e0e84..14508b7c92 100644
--- a/protocols/JabberG/src/jabber_privacy.cpp
+++ b/protocols/JabberG/src/jabber_privacy.cpp
@@ -46,12 +46,11 @@ BOOL CJabberProto::OnIqRequestPrivacyLists(const TiXmlElement*, CJabberIqInfo *p
void CJabberProto::OnIqResultPrivacyListModify(const TiXmlElement*, CJabberIqInfo *pInfo)
{
- if (!pInfo->m_pUserData)
+ CPrivacyListModifyUserParam *pParam = (CPrivacyListModifyUserParam *)pInfo->GetUserData();
+ if (pParam == nullptr)
return;
- CPrivacyListModifyUserParam *pParam = (CPrivacyListModifyUserParam *)pInfo->m_pUserData;
-
- if (pInfo->m_nIqType != JABBER_IQ_TYPE_RESULT)
+ if (pInfo->GetIqType() != JABBER_IQ_TYPE_RESULT)
pParam->m_bAllOk = FALSE;
InterlockedDecrement(&pParam->m_dwCount);
@@ -243,7 +242,7 @@ void CJabberProto::OnIqResultPrivacyListDefault(const TiXmlElement *iqNode, CJab
void CJabberProto::OnIqResultPrivacyLists(const TiXmlElement *iqNode, CJabberIqInfo *pInfo)
{
- if (pInfo->m_nIqType != JABBER_IQ_TYPE_RESULT)
+ if (pInfo->GetIqType() != JABBER_IQ_TYPE_RESULT)
return;
auto *query = XmlFirstChild(iqNode, "query");
@@ -357,10 +356,10 @@ public:
m_proto->m_hwndPrivacyRule = m_hwnd;
- SendDlgItemMessage(m_hwnd, IDC_ICO_MESSAGE, STM_SETICON, (WPARAM)m_proto->LoadIconEx("pl_msg_allow"), 0);
- SendDlgItemMessage(m_hwnd, IDC_ICO_QUERY, STM_SETICON, (WPARAM)m_proto->LoadIconEx("pl_iq_allow"), 0);
- SendDlgItemMessage(m_hwnd, IDC_ICO_PRESENCEIN, STM_SETICON, (WPARAM)m_proto->LoadIconEx("pl_prin_allow"), 0);
- SendDlgItemMessage(m_hwnd, IDC_ICO_PRESENCEOUT, STM_SETICON, (WPARAM)m_proto->LoadIconEx("pl_prout_allow"), 0);
+ SendDlgItemMessage(m_hwnd, IDC_ICO_MESSAGE, STM_SETICON, (WPARAM)g_plugin.getIcon(IDI_PL_MSG_ALLOW), 0);
+ SendDlgItemMessage(m_hwnd, IDC_ICO_QUERY, STM_SETICON, (WPARAM)g_plugin.getIcon(IDI_PL_QUERY_ALLOW), 0);
+ SendDlgItemMessage(m_hwnd, IDC_ICO_PRESENCEIN, STM_SETICON, (WPARAM)g_plugin.getIcon(IDI_PL_PRIN_ALLOW), 0);
+ SendDlgItemMessage(m_hwnd, IDC_ICO_PRESENCEOUT, STM_SETICON, (WPARAM)g_plugin.getIcon(IDI_PL_PROUT_ALLOW), 0);
wchar_t *szTypes[] = { L"JID", L"Group", L"Subscription", L"Any" };
int i, nTypes[] = { Jid, Group, Subscription, Else };
@@ -832,11 +831,11 @@ class CJabberDlgPrivacyLists : public CJabberDlgBase
}
DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 4, (lpdis->rcItem.top + lpdis->rcItem.bottom - 16) / 2,
- m_proto->LoadIconEx("main"), 16, 16, 0, nullptr, DI_NORMAL);
+ IcoLib_GetIconByHandle(m_proto->m_hProtoIcon), 16, 16, 0, nullptr, DI_NORMAL);
if (pRule)
DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 4, (lpdis->rcItem.top + lpdis->rcItem.bottom - 16) / 2,
- m_proto->LoadIconEx(pRule->GetAction() ? "disco_ok" : "disco_fail"),
+ g_plugin.getIcon(pRule->GetAction() ? IDI_DISCO_OK : IDI_DISCO_FAIL),
16, 16, 0, nullptr, DI_NORMAL);
if (lpdis->itemState & ODS_FOCUS) {
@@ -915,12 +914,12 @@ class CJabberDlgPrivacyLists : public CJabberDlgBase
DrawNextRulePart(lpdis->hDC, clLine2, TranslateT(" (default)"), &rc);
DrawIconEx(lpdis->hDC, lpdis->rcItem.right - 16 - 4, (lpdis->rcItem.top + lpdis->rcItem.bottom - 16) / 2,
- m_proto->LoadIconEx(bActive ? "pl_list_active" : "pl_list_any"),
+ g_plugin.getIcon(bActive ? IDI_PL_LIST_ACTIVE : IDI_PL_LIST_ANY),
16, 16, 0, nullptr, DI_NORMAL);
if (bDefault)
DrawIconEx(lpdis->hDC, lpdis->rcItem.right - 16 - 4, (lpdis->rcItem.top + lpdis->rcItem.bottom - 16) / 2,
- m_proto->LoadIconEx("disco_ok"),
+ g_plugin.getIcon(IDI_DISCO_OK),
16, 16, 0, nullptr, DI_NORMAL);
if (hfnt)
@@ -1271,16 +1270,16 @@ lbl_return:
public:
CJabberDlgPrivacyLists(CJabberProto *proto) :
CSuper(proto, IDD_PRIVACY_LISTS),
- m_btnSimple(this, IDC_BTN_SIMPLE, proto->LoadIconEx("group"), LPGEN("Simple mode")),
- m_btnAdvanced(this, IDC_BTN_ADVANCED, proto->LoadIconEx("sd_view_list"), LPGEN("Advanced mode")),
- m_btnAddJid(this, IDC_ADDJID, proto->LoadIconEx("addroster"), LPGEN("Add JID")),
- m_btnActivate(this, IDC_ACTIVATE, proto->LoadIconEx("pl_list_active"), LPGEN("Activate")),
- m_btnSetDefault(this, IDC_SET_DEFAULT, proto->LoadIconEx("pl_list_default"), LPGEN("Set default")),
+ m_btnSimple(this, IDC_BTN_SIMPLE, g_plugin.getIcon(IDI_GROUP), LPGEN("Simple mode")),
+ m_btnAdvanced(this, IDC_BTN_ADVANCED, g_plugin.getIcon(IDI_VIEW_LIST), LPGEN("Advanced mode")),
+ m_btnAddJid(this, IDC_ADDJID, g_plugin.getIcon(IDI_ADDCONTACT), LPGEN("Add JID")),
+ m_btnActivate(this, IDC_ACTIVATE, g_plugin.getIcon(IDI_PL_LIST_ACTIVE), LPGEN("Activate")),
+ m_btnSetDefault(this, IDC_SET_DEFAULT, g_plugin.getIcon(IDI_PL_LIST_DEFAULT), LPGEN("Set default")),
m_btnEditRule(this, IDC_EDIT_RULE, SKINICON_OTHER_RENAME, LPGEN("Edit rule")),
m_btnAddRule(this, IDC_ADD_RULE, SKINICON_OTHER_ADDCONTACT, LPGEN("Add rule")),
m_btnRemoveRule(this, IDC_REMOVE_RULE, SKINICON_OTHER_DELETE, LPGEN("Delete rule")),
- m_btnUpRule(this, IDC_UP_RULE, proto->LoadIconEx("arrow_up"), LPGEN("Move rule up")),
- m_btnDownRule(this, IDC_DOWN_RULE, proto->LoadIconEx("arrow_down"), LPGEN("Move rule down")),
+ m_btnUpRule(this, IDC_UP_RULE, g_plugin.getIcon(IDI_ARROW_UP), LPGEN("Move rule up")),
+ m_btnDownRule(this, IDC_DOWN_RULE, g_plugin.getIcon(IDI_ARROW_DOWN), LPGEN("Move rule down")),
m_btnAddList(this, IDC_ADD_LIST, SKINICON_OTHER_ADDCONTACT, LPGEN("Add list...")),
m_btnRemoveList(this, IDC_REMOVE_LIST, SKINICON_OTHER_DELETE, LPGEN("Remove list")),
m_btnApply(this, IDC_APPLY),
@@ -1318,7 +1317,7 @@ public:
{
CSuper::OnInitDialog();
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_PRIVACY_LISTS));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_PRIVACY_LISTS));
EnableWindow(GetDlgItem(m_hwnd, IDC_ADD_RULE), FALSE);
EnableWindow(GetDlgItem(m_hwnd, IDC_EDIT_RULE), FALSE);
@@ -1340,15 +1339,15 @@ public:
m_clcClist.SetExStyle(CLS_EX_DISABLEDRAGDROP | CLS_EX_TRACKSELECT);
HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 9, 9);
- ImageList_AddIcon_Icolib(hIml, Skin_LoadIcon(SKINICON_OTHER_SMALLDOT));
- ImageList_AddIcon_Icolib(hIml, m_proto->LoadIconEx("pl_msg_allow"));
- ImageList_AddIcon_Icolib(hIml, m_proto->LoadIconEx("pl_msg_deny"));
- ImageList_AddIcon_Icolib(hIml, m_proto->LoadIconEx("pl_prin_allow"));
- ImageList_AddIcon_Icolib(hIml, m_proto->LoadIconEx("pl_prin_deny"));
- ImageList_AddIcon_Icolib(hIml, m_proto->LoadIconEx("pl_prout_allow"));
- ImageList_AddIcon_Icolib(hIml, m_proto->LoadIconEx("pl_prout_deny"));
- ImageList_AddIcon_Icolib(hIml, m_proto->LoadIconEx("pl_iq_allow"));
- ImageList_AddIcon_Icolib(hIml, m_proto->LoadIconEx("pl_iq_deny"));
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_SMALLDOT);
+ g_plugin.addImgListIcon(hIml, IDI_PL_MSG_ALLOW);
+ g_plugin.addImgListIcon(hIml, IDI_PL_MSG_DENY);
+ g_plugin.addImgListIcon(hIml, IDI_PL_PRIN_ALLOW);
+ g_plugin.addImgListIcon(hIml, IDI_PL_PRIN_DENY);
+ g_plugin.addImgListIcon(hIml, IDI_PL_PROUT_ALLOW);
+ g_plugin.addImgListIcon(hIml, IDI_PL_PROUT_DENY);
+ g_plugin.addImgListIcon(hIml, IDI_PL_QUERY_ALLOW);
+ g_plugin.addImgListIcon(hIml, IDI_PL_QUERY_DENY);
m_clcClist.SetExtraImageList(hIml);
m_clcClist.SetExtraColumns(4);
@@ -1530,15 +1529,15 @@ public:
struct
{
wchar_t *textEng;
- char *icon;
+ int icon;
wchar_t *text;
}
static drawItems[] =
{
- { LPGENW("Message"), "pl_msg_allow" },
- { LPGENW("Presence (in)"), "pl_prin_allow" },
- { LPGENW("Presence (out)"), "pl_prout_allow" },
- { LPGENW("Query"), "pl_iq_allow" }
+ { LPGENW("Message"), IDI_PL_MSG_ALLOW },
+ { LPGENW("Presence (in)"), IDI_PL_PRIN_ALLOW },
+ { LPGENW("Presence (out)"), IDI_PL_PROUT_ALLOW },
+ { LPGENW("Query"), IDI_PL_QUERY_ALLOW }
};
LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT)lParam;
@@ -1561,7 +1560,7 @@ public:
rc.left = (rc.left + rc.right - totalWidth) / 2;
for (auto &it : drawItems) {
- DrawIconEx(lpdis->hDC, rc.left, (rc.top + rc.bottom - 16) / 2, m_proto->LoadIconEx(it.icon),
+ DrawIconEx(lpdis->hDC, rc.left, (rc.top + rc.bottom - 16) / 2, g_plugin.getIcon(it.icon),
16, 16, 0, nullptr, DI_NORMAL);
rc.left += 18;
DrawNextRulePart(lpdis->hDC, clText, it.text, &rc);
@@ -1621,7 +1620,7 @@ public:
}
EnableWindow(GetDlgItem(m_hwnd, IDC_ACTIVATE), FALSE);
SetWindowLongPtr(GetDlgItem(m_hwnd, IDC_ACTIVATE), GWLP_USERDATA, (LONG_PTR)pList);
- XmlNodeIq iq(m_proto->AddIQ(&CJabberProto::OnIqResultPrivacyListActive, JABBER_IQ_TYPE_SET, nullptr, 0, -1, pList));
+ XmlNodeIq iq(m_proto->AddIQ(&CJabberProto::OnIqResultPrivacyListActive, JABBER_IQ_TYPE_SET, nullptr, pList));
TiXmlElement *query = iq << XQUERY(JABBER_FEAT_PRIVACY_LISTS);
TiXmlElement *active = query << XCHILD("active");
if (pList)
@@ -1648,7 +1647,7 @@ public:
EnableWindow(GetDlgItem(m_hwnd, IDC_SET_DEFAULT), FALSE);
SetWindowLongPtr(GetDlgItem(m_hwnd, IDC_SET_DEFAULT), GWLP_USERDATA, (LONG_PTR)pList);
- XmlNodeIq iq(m_proto->AddIQ(&CJabberProto::OnIqResultPrivacyListDefault, JABBER_IQ_TYPE_SET, nullptr, 0, -1, pList));
+ XmlNodeIq iq(m_proto->AddIQ(&CJabberProto::OnIqResultPrivacyListDefault, JABBER_IQ_TYPE_SET, nullptr, pList));
TiXmlElement *query = iq << XQUERY(JABBER_FEAT_PRIVACY_LISTS);
TiXmlElement *defaultTag = query << XCHILD("default");
if (pList)
@@ -1878,7 +1877,7 @@ public:
pUserData->m_dwCount++;
- XmlNodeIq iq(m_proto->AddIQ(&CJabberProto::OnIqResultPrivacyListModify, JABBER_IQ_TYPE_SET, nullptr, 0, -1, pUserData));
+ XmlNodeIq iq(m_proto->AddIQ(&CJabberProto::OnIqResultPrivacyListModify, JABBER_IQ_TYPE_SET, nullptr, pUserData));
TiXmlElement *query = iq << XQUERY(JABBER_FEAT_PRIVACY_LISTS);
TiXmlElement *listTag = query << XCHILD("list") << XATTR("name", pList->GetListName());
@@ -2006,7 +2005,7 @@ INT_PTR __cdecl CJabberProto::menuSetPrivacyList(WPARAM, LPARAM, LPARAM iList)
pList = pList->GetNext();
}
- XmlNodeIq iq(AddIQ(&CJabberProto::OnIqResultPrivacyListActive, JABBER_IQ_TYPE_SET, nullptr, 0, -1, pList));
+ XmlNodeIq iq(AddIQ(&CJabberProto::OnIqResultPrivacyListActive, JABBER_IQ_TYPE_SET, nullptr, pList));
TiXmlElement *query = iq << XQUERY(JABBER_FEAT_PRIVACY_LISTS);
TiXmlElement *active = query << XCHILD("active");
if (pList)
@@ -2024,7 +2023,7 @@ void CJabberProto::BuildPrivacyMenu()
{
CMenuItem mi(&g_plugin);
mi.position = 200005;
- mi.hIcolibItem = GetIconHandle(IDI_AGENTS);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_AGENTS);
mi.flags = CMIF_UNMOVABLE | CMIF_HIDDEN;
mi.name.a = LPGEN("Privacy Lists");
mi.root = m_hMenuRoot;
@@ -2034,7 +2033,7 @@ void CJabberProto::BuildPrivacyMenu()
CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandlePrivacyLists);
mi.position = 3000040000;
mi.flags = CMIF_UNMOVABLE | CMIF_UNICODE;
- mi.hIcolibItem = GetIconHandle(IDI_PRIVACY_LISTS);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_PRIVACY_LISTS);
mi.name.w = LPGENW("List Editor...");
mi.root = m_hPrivacyMenuRoot;
Menu_AddProtoMenuItem(&mi, m_szModuleName);
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 005311104f..ec65a52654 100755
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -281,7 +281,7 @@ void CJabberProto::OnModulesLoaded()
StatusIconData sid = {};
sid.szModule = m_szModuleName;
- sid.hIcon = LoadIconEx("main");
+ sid.hIcon = IcoLib_GetIconByHandle(m_hProtoIcon);
sid.flags = MBF_HIDDEN;
sid.szTooltip.a = LPGEN("Jabber Resource");
Srmm_AddIcon(&sid, &g_plugin);
@@ -613,12 +613,14 @@ int CJabberProto::GetInfo(MCONTACT hContact, int /*infoType*/)
JabberStripJid(jid, szBareJid, _countof(szBareJid));
if (m_ThreadInfo) {
- m_ThreadInfo->send(
- XmlNodeIq(AddIQ(&CJabberProto::OnIqResultEntityTime, JABBER_IQ_TYPE_GET, jid, JABBER_IQ_PARSE_HCONTACT))
- << XCHILDNS("time", JABBER_FEAT_ENTITY_TIME));
+ auto *pInfo = AddIQ(&CJabberProto::OnIqResultEntityTime, JABBER_IQ_TYPE_GET, jid);
+ pInfo->SetParamsToParse(JABBER_IQ_PARSE_HCONTACT);
+ m_ThreadInfo->send(XmlNodeIq(pInfo) << XCHILDNS("time", JABBER_FEAT_ENTITY_TIME));
// XEP-0012, last logoff time
- m_ThreadInfo->send(XmlNodeIq(AddIQ(&CJabberProto::OnIqResultLastActivity, JABBER_IQ_TYPE_GET, jid, JABBER_IQ_PARSE_FROM)) << XQUERY(JABBER_FEAT_LAST_ACTIVITY));
+ pInfo = AddIQ(&CJabberProto::OnIqResultLastActivity, JABBER_IQ_TYPE_GET, jid);
+ pInfo->SetParamsToParse(JABBER_IQ_PARSE_FROM);
+ m_ThreadInfo->send(XmlNodeIq(pInfo) << XQUERY(JABBER_FEAT_LAST_ACTIVITY));
JABBER_LIST_ITEM *item = nullptr;
if ((item = ListGetItemPtr(LIST_VCARD_TEMP, jid)) == nullptr)
@@ -643,14 +645,17 @@ int CJabberProto::GetInfo(MCONTACT hContact, int /*infoType*/)
pResourceStatus r(it);
CMStringA tmp(MakeJid(szBareJid, r->m_szResourceName));
- if (r->m_jcbCachedCaps & JABBER_CAPS_DISCO_INFO)
- m_ThreadInfo->send(
- XmlNodeIq(AddIQ(&CJabberProto::OnIqResultCapsDiscoInfo, JABBER_IQ_TYPE_GET, tmp, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_CHILD_TAG_NODE | JABBER_IQ_PARSE_HCONTACT))
- << XQUERY(JABBER_FEAT_DISCO_INFO));
+ if (r->m_jcbCachedCaps & JABBER_CAPS_DISCO_INFO) {
+ pInfo = AddIQ(&CJabberProto::OnIqResultCapsDiscoInfo, JABBER_IQ_TYPE_GET, tmp);
+ pInfo->SetParamsToParse(JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_CHILD_TAG_NODE | JABBER_IQ_PARSE_HCONTACT);
+ m_ThreadInfo->send(XmlNodeIq(pInfo) << XQUERY(JABBER_FEAT_DISCO_INFO));
+ }
- if (mir_strcmp(tmp, jid)) // skip current resource, we've already sent this iq to it
- m_ThreadInfo->send(
- XmlNodeIq(AddIQ(&CJabberProto::OnIqResultLastActivity, JABBER_IQ_TYPE_GET, tmp, JABBER_IQ_PARSE_FROM)) << XQUERY(JABBER_FEAT_LAST_ACTIVITY));
+ if (mir_strcmp(tmp, jid)) { // skip current resource, we've already sent this iq to it
+ pInfo = AddIQ(&CJabberProto::OnIqResultLastActivity, JABBER_IQ_TYPE_GET, tmp);
+ pInfo->SetParamsToParse(JABBER_IQ_PARSE_FROM);
+ m_ThreadInfo->send(XmlNodeIq(pInfo) << XQUERY(JABBER_FEAT_LAST_ACTIVITY));
+ }
}
}
}
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h
index 40227f952c..d91582c5eb 100755
--- a/protocols/JabberG/src/jabber_proto.h
+++ b/protocols/JabberG/src/jabber_proto.h
@@ -482,8 +482,6 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
int* m_transportProtoTableStartIndex;
void IconsInit(void);
- HANDLE GetIconHandle(int iconId);
- HICON LoadIconEx(const char* name, bool big = false);
int LoadAdvancedIcons(int iID);
int GetTransportProtoID(char* TransportDomain);
int GetTransportStatusIconIndex(int iID, int Status);
@@ -493,9 +491,9 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
//---- jabber_iq.c -------------------------------------------------------------------
- __forceinline CJabberIqInfo* AddIQ(JABBER_IQ_HANDLER pHandler, int nIqType = JABBER_IQ_TYPE_GET, const char *szReceiver = nullptr, DWORD dwParamsToParse = 0, int nIqId = -1, void *pUserData = nullptr, int iPriority = JH_PRIORITY_DEFAULT)
+ __forceinline CJabberIqInfo* AddIQ(JABBER_IQ_HANDLER pHandler, int nIqType = JABBER_IQ_TYPE_GET, const char *szReceiver = nullptr, void *pUserData = nullptr, int iPriority = JH_PRIORITY_DEFAULT)
{
- return m_iqManager.AddHandler(pHandler, nIqType, szReceiver, dwParamsToParse, nIqId, pUserData, iPriority);
+ return m_iqManager.AddHandler(pHandler, nIqType, szReceiver, pUserData, iPriority);
}
void __cdecl ExpirerThread(void*);
@@ -837,7 +835,6 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
//---- jabber_xml.c ------------------------------------------------------------------
- int OnXmlParse(char* buffer);
void OnConsoleProcessXml(const TiXmlElement *node, DWORD flags);
//---- jabber_xmlns.c ----------------------------------------------------------------
@@ -905,7 +902,6 @@ public:
HJHANDLER STDMETHODCALLTYPE AddPresenceHandler(JABBER_HANDLER_FUNC Func, void *pUserData, int iPriority) override;
HJHANDLER STDMETHODCALLTYPE AddMessageHandler(JABBER_HANDLER_FUNC Func, int iMsgTypes, const char *szXmlns, const char *szTag, void *pUserData, int iPriority) override;
HJHANDLER STDMETHODCALLTYPE AddIqHandler(JABBER_HANDLER_FUNC Func, int iIqTypes, const char *szXmlns, const char *szTag, void *pUserData, int iPriority) override;
- HJHANDLER STDMETHODCALLTYPE AddTemporaryIqHandler(JABBER_HANDLER_FUNC Func, int iIqTypes, int iIqId, void *pUserData, DWORD dwTimeout, int iPriority) override;
HJHANDLER STDMETHODCALLTYPE AddSendHandler(JABBER_HANDLER_FUNC Func, void *pUserData, int iPriority) override;
int STDMETHODCALLTYPE RemoveHandler(HJHANDLER hHandler) override;
diff --git a/protocols/JabberG/src/jabber_roster.cpp b/protocols/JabberG/src/jabber_roster.cpp
index 727f77ea9a..c248722229 100644
--- a/protocols/JabberG/src/jabber_roster.cpp
+++ b/protocols/JabberG/src/jabber_roster.cpp
@@ -236,7 +236,7 @@ public:
bool OnInitDialog() override
{
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_AGENTS));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_AGENTS));
Utils_RestoreWindowPosition(m_hwnd, 0, m_proto->m_szModuleName, "rosterCtrlWnd_");
diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp
index 8ac857be1b..15061de69d 100644
--- a/protocols/JabberG/src/jabber_svc.cpp
+++ b/protocols/JabberG/src/jabber_svc.cpp
@@ -583,7 +583,7 @@ public:
{
CSuper::OnInitDialog();
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_OPEN));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_OPEN));
SetDlgItemTextUtf(m_hwnd, IDC_TXT_URL, m_pParams->m_szUrl);
SetDlgItemTextUtf(m_hwnd, IDC_TXT_FROM, m_pParams->m_szFrom);
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index 486fd6fbcc..880e6eb0f9 100755
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -424,13 +424,13 @@ LBL_FatalError:
else if (nSelRes == 0) {
if (m_bSendKeepAlive) {
if (info.jabberServerCaps & JABBER_CAPS_PING) {
- CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnPingReply, JABBER_IQ_TYPE_GET, nullptr, 0, -1, this);
+ CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnPingReply, JABBER_IQ_TYPE_GET, nullptr, this);
pInfo->SetTimeout(m_iConnectionKeepAliveTimeout);
info.send(XmlNodeIq(pInfo) << XATTR("from", info.fullJID) << XCHILDNS("ping", JABBER_FEAT_PING));
}
}
- else
- info.send(" \t "); //TODO: why do we need this ?
+ else info.send(" \t ");
+
if (m_bEnableStreamMgmt)
m_StrmMgmt.RequestAck();
}
@@ -1298,9 +1298,8 @@ void CJabberProto::OnProcessMessage(const TiXmlElement *node, ThreadData *info)
auto *idNode = XmlFirstChild(xNode, "id");
if (XmlFirstChild(xNode, "delivered") != nullptr || XmlFirstChild(xNode, "offline") != nullptr) {
int id = -1;
- if (idNode != nullptr && idNode->GetText() != nullptr)
- if (!strncmp(idNode->GetText(), JABBER_IQID, mir_strlen(JABBER_IQID)))
- id = atoi((idNode->GetText()) + mir_strlen(JABBER_IQID));
+ if (idNode != nullptr)
+ id = JabberGetPacketID(idNode->GetText());
if (id != -1)
ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)id, 0);
diff --git a/protocols/JabberG/src/jabber_treelist.cpp b/protocols/JabberG/src/jabber_treelist.cpp
index c228169c17..b8588ef601 100644
--- a/protocols/JabberG/src/jabber_treelist.cpp
+++ b/protocols/JabberG/src/jabber_treelist.cpp
@@ -138,9 +138,9 @@ void TreeList_Create(HWND hwnd)
ListView_SetImageList(hwnd, hIml, LVSIL_SMALL);
hIml = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 2, 1);
- ImageList_AddIcon_Icolib(hIml, Skin_LoadIcon(SKINICON_OTHER_GROUPOPEN));
- ImageList_AddIcon_Icolib(hIml, Skin_LoadIcon(SKINICON_OTHER_GROUPSHUT));
- ImageList_AddIcon_Icolib(hIml, Skin_LoadIcon(SKINICON_OTHER_DOWNARROW));
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_GROUPOPEN);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_GROUPSHUT);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_DOWNARROW);
ListView_SetImageList(hwnd, hIml, LVSIL_STATE);
}
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp
index 16a0097a95..0488052609 100755
--- a/protocols/JabberG/src/jabber_userinfo.cpp
+++ b/protocols/JabberG/src/jabber_userinfo.cpp
@@ -233,7 +233,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti
// caps
JabberCapsBits jcb = ppro->GetResourceCapabilities(MakeJid(item->jid, r->m_szResourceName), r);
if (!(jcb & JABBER_RESOURCE_CAPS_ERROR)) {
- HTREEITEM htiCaps = sttFillInfoLine(hwndTree, htiResource, ppro->LoadIconEx("main"), nullptr, TranslateU("Client capabilities"), sttInfoLineId(resource, INFOLINE_CAPS));
+ HTREEITEM htiCaps = sttFillInfoLine(hwndTree, htiResource, IcoLib_GetIconByHandle(ppro->m_hProtoIcon), nullptr, TranslateU("Client capabilities"), sttInfoLineId(resource, INFOLINE_CAPS));
int i;
for (i = 0; i < g_cJabberFeatCapPairs; i++)
if (jcb & g_JabberFeatCapPairs[i].jcbCap) {
@@ -258,7 +258,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti
}
// Software info
- HTREEITEM htiSoftwareInfo = sttFillInfoLine(hwndTree, htiResource, ppro->LoadIconEx("main"), nullptr, TranslateU("Software information"), sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION));
+ HTREEITEM htiSoftwareInfo = sttFillInfoLine(hwndTree, htiResource, IcoLib_GetIconByHandle(ppro->m_hProtoIcon), nullptr, TranslateU("Software information"), sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION));
int nLineId = 0;
if (CJabberClientPartialCaps *pCaps = r->m_pCaps) {
if (pCaps->GetOs())
@@ -300,7 +300,7 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM
sttCleanupInfo(hwndTree, 0);
- HTREEITEM htiRoot = sttFillInfoLine(hwndTree, nullptr, ppro->LoadIconEx("main"), L"JID", item->jid, sttInfoLineId(0, INFOLINE_NAME), true);
+ HTREEITEM htiRoot = sttFillInfoLine(hwndTree, nullptr, IcoLib_GetIconByHandle(ppro->m_hProtoIcon), L"JID", item->jid, sttInfoLineId(0, INFOLINE_NAME), true);
if (MCONTACT hContact = ppro->HContactFromJID(item->jid)) {
sttFillAdvStatusInfo(ppro, hwndTree, htiRoot, sttInfoLineId(0, INFOLINE_MOOD), hContact, TranslateT("Mood"), ADVSTATUS_MOOD);
@@ -403,12 +403,12 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
memset(dat, 0, sizeof(JabberUserInfoDlgData));
dat->resourcesCount = -1;
dat->hContact = lParam;
- {
- GetClientRect(hwndDlg, &rc);
- MoveWindow(GetDlgItem(hwndDlg, IDC_TV_INFO), 5, 5, rc.right - 10, rc.bottom - 10, TRUE);
+ GetClientRect(hwndDlg, &rc);
+ MoveWindow(GetDlgItem(hwndDlg, IDC_TV_INFO), 5, 5, rc.right - 10, rc.bottom - 10, TRUE);
+ {
HIMAGELIST himl = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR | ILC_COLOR32 | ILC_MASK, 5, 1);
- ImageList_AddIcon_Icolib(himl, Skin_LoadIcon(SKINICON_OTHER_SMALLDOT));
+ ImageList_AddSkinIcon(himl, SKINICON_OTHER_SMALLDOT);
TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_TV_INFO), himl, TVSIL_NORMAL);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
@@ -439,8 +439,8 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
if (dat->item == nullptr) {
HWND hwndTree = GetDlgItem(hwndDlg, IDC_TV_INFO);
TreeView_DeleteAllItems(hwndTree);
- HTREEITEM htiRoot = sttFillInfoLine(hwndTree, nullptr, dat->ppro->LoadIconEx("main"), L"JID", jid, sttInfoLineId(0, INFOLINE_NAME), true);
- sttFillInfoLine(hwndTree, htiRoot, dat->ppro->LoadIconEx("vcard"), nullptr, TranslateU("Please switch online to see more details."));
+ HTREEITEM htiRoot = sttFillInfoLine(hwndTree, nullptr, IcoLib_GetIconByHandle(dat->ppro->m_hProtoIcon), L"JID", jid, sttInfoLineId(0, INFOLINE_NAME), true);
+ sttFillInfoLine(hwndTree, htiRoot, g_plugin.getIcon(IDI_VCARD), nullptr, TranslateU("Please switch online to see more details."));
break;
}
}
@@ -570,7 +570,7 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP
photoInfo->ppro = nullptr;
photoInfo->hBitmap = nullptr;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)photoInfo);
- SendDlgItemMessage(hwndDlg, IDC_SAVE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_LoadIconEx("save"));
+ SendDlgItemMessage(hwndDlg, IDC_SAVE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_SAVE));
SendDlgItemMessage(hwndDlg, IDC_SAVE, BUTTONSETASFLATBTN, TRUE, 0);
ShowWindow(GetDlgItem(hwndDlg, IDC_LOAD), SW_HIDE);
ShowWindow(GetDlgItem(hwndDlg, IDC_DELETE), SW_HIDE);
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index 981610f811..b1169e26ab 100755
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -514,12 +514,11 @@ void CJabberProto::SendPresence(int status, bool bSendToAll)
///////////////////////////////////////////////////////////////////////////////
// JabberGetPacketID - converts the xml id attribute into an integer
-int JabberGetPacketID(const TiXmlElement *n)
+int JabberGetPacketID(const char *str)
{
- const char *str = XmlGetAttr(n, "id");
- if (str)
- if (!strncmp(str, JABBER_IQID, _countof(JABBER_IQID) - 1))
- return atoi(str + _countof(JABBER_IQID) - 1);
+ if (mir_strlen(str) >= 20)
+ if (!memcmp(str, "mir", 3) && !memcmp(g_plugin.szRandom, str+3, 16) && str[19] == '_')
+ return atoi(str + 20);
return -1;
}
@@ -527,7 +526,7 @@ int JabberGetPacketID(const TiXmlElement *n)
char* JabberId2string(int id)
{
char text[100];
- mir_snprintf(text, JABBER_IQID "%d", id);
+ mir_snprintf(text, "mir%s_%d", g_plugin.szRandom, id);
return mir_strdup(text);
}
@@ -693,7 +692,7 @@ static VOID CALLBACK sttRebuildInfoFrameApcProc(void* param)
else {
ppro->m_pInfoFrame->RemoveInfoItem("$/PEP/");
ppro->m_pInfoFrame->CreateInfoItem("$/PEP", false);
- ppro->m_pInfoFrame->UpdateInfoItem("$/PEP", ppro->GetIconHandle(IDI_PL_LIST_ANY), TranslateT("Advanced Status"));
+ ppro->m_pInfoFrame->UpdateInfoItem("$/PEP", g_plugin.getIconHandle(IDI_PL_LIST_ANY), TranslateT("Advanced Status"));
ppro->m_pInfoFrame->CreateInfoItem("$/PEP/mood", true);
ppro->m_pInfoFrame->SetInfoItemCallback("$/PEP/mood", &CJabberProto::InfoFrame_OnUserMood);
@@ -706,7 +705,7 @@ static VOID CALLBACK sttRebuildInfoFrameApcProc(void* param)
ppro->m_pInfoFrame->RemoveInfoItem("$/Transports/");
ppro->m_pInfoFrame->CreateInfoItem("$/Transports", false);
- ppro->m_pInfoFrame->UpdateInfoItem("$/Transports", ppro->GetIconHandle(IDI_TRANSPORT), TranslateT("Transports"));
+ ppro->m_pInfoFrame->UpdateInfoItem("$/Transports", g_plugin.getIconHandle(IDI_TRANSPORT), TranslateT("Transports"));
JABBER_LIST_ITEM *item = nullptr;
LISTFOREACH(i, ppro, LIST_ROSTER)
@@ -720,7 +719,7 @@ static VOID CALLBACK sttRebuildInfoFrameApcProc(void* param)
char name[128];
mir_snprintf(name, "$/Transports/%s", item->jid);
ppro->m_pInfoFrame->CreateInfoItem(name, true, hContact);
- ppro->m_pInfoFrame->UpdateInfoItem(name, ppro->GetIconHandle(IDI_TRANSPORTL), (wchar_t *)item->jid);
+ ppro->m_pInfoFrame->UpdateInfoItem(name, g_plugin.getIconHandle(IDI_TRANSPORTL), (wchar_t *)item->jid);
ppro->m_pInfoFrame->SetInfoItemCallback(name, &CJabberProto::InfoFrame_OnTransport);
}
}
diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp
index a8ba50067c..1dc02d045d 100644
--- a/protocols/JabberG/src/jabber_vcard.cpp
+++ b/protocols/JabberG/src/jabber_vcard.cpp
@@ -264,9 +264,9 @@ static INT_PTR CALLBACK PhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
case WM_INITDIALOG:
if (!lParam) break; // Launched from userinfo
TranslateDialogDefault(hwndDlg);
- SendDlgItemMessage(hwndDlg, IDC_LOAD, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_LoadIconEx("open"));
+ SendDlgItemMessage(hwndDlg, IDC_LOAD, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_OPEN));
SendDlgItemMessage(hwndDlg, IDC_LOAD, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_DELETE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_LoadIconEx("delete"));
+ SendDlgItemMessage(hwndDlg, IDC_DELETE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_DELETE));
SendDlgItemMessage(hwndDlg, IDC_DELETE, BUTTONSETASFLATBTN, TRUE, 0);
ShowWindow(GetDlgItem(hwndDlg, IDC_SAVE), SW_HIDE);
{
@@ -804,11 +804,11 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP
ListView_GetSubItemRect(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, LVIR_LABEL, &rc);
if (nm->nmcd.lItemlParam == -1 && nm->iSubItem == 3)
- hIcon = g_LoadIconEx("addcontact");
+ hIcon = g_plugin.getIcon(IDI_ADDCONTACT);
else if (nm->iSubItem == 2 && nm->nmcd.lItemlParam != -1)
- hIcon = g_LoadIconEx("edit");
+ hIcon = g_plugin.getIcon(IDI_EDIT);
else if (nm->iSubItem == 3 && nm->nmcd.lItemlParam != -1)
- hIcon = g_LoadIconEx("delete");
+ hIcon = g_plugin.getIcon(IDI_DELETE);
else break;
DrawIconEx(nm->nmcd.hdc, (rc.left + rc.right - GetSystemMetrics(SM_CXSMICON)) / 2, (rc.top + rc.bottom - GetSystemMetrics(SM_CYSMICON)) / 2, hIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, nullptr, DI_NORMAL);
SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, CDRF_SKIPDEFAULT);
diff --git a/protocols/JabberG/src/jabber_xml.cpp b/protocols/JabberG/src/jabber_xml.cpp
index 6fa1c31610..b981aab7fb 100644
--- a/protocols/JabberG/src/jabber_xml.cpp
+++ b/protocols/JabberG/src/jabber_xml.cpp
@@ -129,8 +129,5 @@ TiXmlElement* __fastcall operator<<(TiXmlElement *node, const XQUERY &child)
void XmlAddAttrID(TiXmlElement *hXml, int id)
{
- char text[100];
- mir_snprintf(text, JABBER_IQID "%d", id);
- hXml->SetAttribute("id", text);
+ hXml->SetAttribute("id", ptrA(JabberId2string(id)).get());
}
-
diff --git a/protocols/JabberG/src/jabber_xml.h b/protocols/JabberG/src/jabber_xml.h
index 230be83e14..d0babbcfb4 100644
--- a/protocols/JabberG/src/jabber_xml.h
+++ b/protocols/JabberG/src/jabber_xml.h
@@ -27,6 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define _JABBER_XML_H_
void XmlAddAttrID(TiXmlElement*, int id);
+
class XmlNode : public TiXmlDocument, private MNonCopyable
{
protected:
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp
index 6f2b8a80fe..af69115cf2 100644
--- a/protocols/JabberG/src/jabber_xstatus.cpp
+++ b/protocols/JabberG/src/jabber_xstatus.cpp
@@ -760,7 +760,7 @@ void CPepMood::UpdateMenuView()
///////////////////////////////////////////////////////////////////////////////
// CPepActivity
-#define ACTIVITY_ICON(section, item) -(300 + (section) * 20 + (item))
+#define ACTIVITY_ICON(section, item) -(1300 + (section) * 20 + (item))
struct
{
@@ -1499,7 +1499,7 @@ void g_XstatusIconsInit()
mir_wstrcpy(szSection, L"Protocols/Jabber/" LPGENW("Moods"));
for (int i = 1; i < _countof(g_arrMoods); i++)
- g_MoodIcons.RegisterIcon(g_arrMoods[i].szTag, szFile, -(200 + i), szSection, TranslateW(g_arrMoods[i].szName));
+ g_MoodIcons.RegisterIcon(g_arrMoods[i].szTag, szFile, -(1200 + i), szSection, TranslateW(g_arrMoods[i].szName));
mir_wstrcpy(szSection, L"Protocols/Jabber/" LPGENW("Activities"));
for (int k = 0; k < _countof(g_arrActivities); k++) {
diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h
index f319bb16d2..d7710f32a6 100755
--- a/protocols/JabberG/src/stdafx.h
+++ b/protocols/JabberG/src/stdafx.h
@@ -116,6 +116,8 @@ struct CJabberProto;
struct CMPlugin : public ACCPROTOPLUGIN<CJabberProto>
{
+ char szRandom[17];
+
CMPlugin();
int Load() override;
@@ -147,11 +149,9 @@ protected:
* Global constants
*******************************************************************/
-#define GLOBAL_SETTING_PREFIX "JABBER"
#define GLOBAL_SETTING_MODULE "JABBER"
#define JABBER_DEFAULT_PORT 5222
-#define JABBER_IQID "mir_"
#define JABBER_MAX_JID_LEN 1024
#define JABBER_GC_MSG_QUIT LPGEN("I'm happy Miranda NG user. Get it at https://miranda-ng.org/.")
@@ -672,10 +672,6 @@ public:
void g_IconsInit();
void g_XstatusIconsInit();
void g_XstatusIconsUninit();
-HANDLE g_GetIconHandle(int iconId);
-HICON g_LoadIconEx(const char* name, bool big = false);
-
-void ImageList_AddIcon_Icolib(HIMAGELIST hIml, HICON hIcon);
//---- jabber_libstr.c ----------------------------------------------
@@ -751,9 +747,13 @@ void JabberHttpUrlDecode(wchar_t *str);
int JabberCombineStatus(int status1, int status2);
time_t JabberIsoToUnixTime(const char *stamp);
char* JabberStripJid(const char *jid, char *dest, size_t destLen);
-int JabberGetPacketID(const TiXmlElement *n);
+int JabberGetPacketID(const char*);
char* JabberId2string(int id);
+__inline int JabberGetPacketID(const TiXmlElement *n)
+{ return JabberGetPacketID(XmlGetAttr(n, "id"));
+}
+
char* time2str(time_t _time, char *buf, size_t bufLen);
time_t str2time(const char*);
diff --git a/protocols/MSN/src/msn_lists.cpp b/protocols/MSN/src/msn_lists.cpp
index c91e7d68ab..841ad32122 100644
--- a/protocols/MSN/src/msn_lists.cpp
+++ b/protocols/MSN/src/msn_lists.cpp
@@ -471,28 +471,25 @@ INT_PTR CALLBACK DlgProcMsnServLists(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK | ILC_COLOR32, 5, 5);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_SMALLDOT);
- HICON hIcon = Skin_LoadIcon(SKINICON_OTHER_SMALLDOT);
- ImageList_AddIcon(hIml, hIcon);
- IcoLib_ReleaseIcon(hIcon);
-
- hIcon = LoadIconEx("list_lc");
+ HICON hIcon = g_plugin.getIcon(IDI_LIST_LC);
ImageList_AddIcon(hIml, hIcon);
SendDlgItemMessage(hwndDlg, IDC_ICON_LC, STM_SETICON, (WPARAM)hIcon, 0);
- hIcon = LoadIconEx("list_fl");
+ hIcon = g_plugin.getIcon(IDI_LIST_FL);
ImageList_AddIcon(hIml, hIcon);
SendDlgItemMessage(hwndDlg, IDC_ICON_FL, STM_SETICON, (WPARAM)hIcon, 0);
- hIcon = LoadIconEx("list_al");
+ hIcon = g_plugin.getIcon(IDI_LIST_AL);
ImageList_AddIcon(hIml, hIcon);
SendDlgItemMessage(hwndDlg, IDC_ICON_AL, STM_SETICON, (WPARAM)hIcon, 0);
- hIcon = LoadIconEx("list_bl");
+ hIcon = g_plugin.getIcon(IDI_LIST_BL);
ImageList_AddIcon(hIml, hIcon);
SendDlgItemMessage(hwndDlg, IDC_ICON_BL, STM_SETICON, (WPARAM)hIcon, 0);
- hIcon = LoadIconEx("list_rl");
+ hIcon = g_plugin.getIcon(IDI_LIST_RL);
ImageList_AddIcon(hIml, hIcon);
SendDlgItemMessage(hwndDlg, IDC_ICON_RL, STM_SETICON, (WPARAM)hIcon, 0);
@@ -568,10 +565,10 @@ INT_PTR CALLBACK DlgProcMsnServLists(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
case WM_DESTROY:
HIMAGELIST hIml = (HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGELIST, 0, 0);
ImageList_Destroy(hIml);
- ReleaseIconEx("list_fl");
- ReleaseIconEx("list_al");
- ReleaseIconEx("list_bl");
- ReleaseIconEx("list_rl");
+ g_plugin.releaseIcon(IDI_LIST_FL);
+ g_plugin.releaseIcon(IDI_LIST_AL);
+ g_plugin.releaseIcon(IDI_LIST_BL);
+ g_plugin.releaseIcon(IDI_LIST_RL);
break;
}
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp
index 70c00d637f..fb55661a93 100644
--- a/protocols/MSN/src/msn_menu.cpp
+++ b/protocols/MSN/src/msn_menu.cpp
@@ -147,28 +147,28 @@ void CMsnProto::OnBuildProtoMenu(void)
mi.pszService = MSN_INVITE;
CreateProtoService(mi.pszService, &CMsnProto::MsnInviteCommand);
mi.position = 201002;
- mi.hIcolibItem = GetIconHandle(IDI_INVITE);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_INVITE);
mi.name.a = LPGEN("Create &Chat");
menuItemsMain[0] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = MS_GOTO_INBOX;
CreateProtoService(mi.pszService, &CMsnProto::MsnGotoInbox);
mi.position = 201003;
- mi.hIcolibItem = GetIconHandle(IDI_INBOX);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_INBOX);
mi.name.a = LPGEN("Display &Hotmail Inbox");
menuItemsMain[1] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = MS_EDIT_PROFILE;
CreateProtoService(mi.pszService, &CMsnProto::MsnEditProfile);
mi.position = 201004;
- mi.hIcolibItem = GetIconHandle(IDI_PROFILE);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_PROFILE);
mi.name.a = LPGEN("View &Profile");
menuItemsMain[2] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = MS_EDIT_ALERTS;
CreateProtoService(mi.pszService, &CMsnProto::MsnSetupAlerts);
mi.position = 201004;
- mi.hIcolibItem = GetIconHandle(IDI_PROFILE);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_PROFILE);
mi.name.a = LPGEN("Setup Live &Alerts");
menuItemsMain[3] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
@@ -232,7 +232,7 @@ void MSN_InitContactMenu(void)
mir_strcpy(tDest, MSN_BLOCK);
CreateServiceFunction(servicefunction, MsnMenuBlockCommand);
mi.position = -500050000;
- mi.hIcolibItem = GetIconHandle(IDI_MSNBLOCK);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_MSNBLOCK);
mi.name.a = LPGEN("&Block");
hBlockMenuItem = Menu_AddContactMenuItem(&mi);
@@ -240,7 +240,7 @@ void MSN_InitContactMenu(void)
mir_strcpy(tDest, MSN_VIEW_PROFILE);
CreateServiceFunction(servicefunction, MsnMenuViewProfile);
mi.position = -500050003;
- mi.hIcolibItem = GetIconHandle(IDI_PROFILE);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_PROFILE);
mi.name.a = LPGEN("View &Profile");
hLiveSpaceMenuItem = Menu_AddContactMenuItem(&mi);
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp
index 8d62b4984d..03f595147f 100644
--- a/protocols/MSN/src/msn_misc.cpp
+++ b/protocols/MSN/src/msn_misc.cpp
@@ -795,7 +795,7 @@ void CMsnProto::InitPopups(void)
POPUPCLASS ppc = { sizeof(ppc) };
ppc.flags = PCF_UNICODE;
ppc.PluginWindowProc = NullWindowProc;
- ppc.hIcon = LoadIconEx("main");
+ ppc.hIcon = g_plugin.getIcon(IDI_MSN);
ppc.pszName = name;
ppc.pszDescription.w = desc;
diff --git a/protocols/MSN/src/msn_opts.cpp b/protocols/MSN/src/msn_opts.cpp
index d348961550..7ee0dfca33 100644
--- a/protocols/MSN/src/msn_opts.cpp
+++ b/protocols/MSN/src/msn_opts.cpp
@@ -50,31 +50,6 @@ void MsnInitIcons(void)
g_plugin.registerIcon("Protocols/MSN", iconList, "MSN");
}
-HICON LoadIconEx(const char* name, bool big)
-{
- char szSettingName[100];
- mir_snprintf(szSettingName, "MSN_%s", name);
- return IcoLib_GetIcon(szSettingName, big);
-}
-
-HANDLE GetIconHandle(int iconId)
-{
- for (auto &it : iconList)
- if (it.defIconID == iconId)
- return it.hIcolib;
-
- return nullptr;
-}
-
-void ReleaseIconEx(const char* name, bool big)
-{
- char szSettingName[100];
- mir_snprintf(szSettingName, "MSN_%s", name);
- IcoLib_Release(szSettingName, big);
-}
-
-INT_PTR CALLBACK DlgProcMsnServLists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-
/////////////////////////////////////////////////////////////////////////////////////////
// MSN Options dialog procedure
@@ -589,6 +564,8 @@ INT_PTR CALLBACK DlgDeleteContactUI(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
/////////////////////////////////////////////////////////////////////////////////////////
// Initialize options pages
+INT_PTR CALLBACK DlgProcMsnServLists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+
int CMsnProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = {};
diff --git a/protocols/MSN/src/stdafx.h b/protocols/MSN/src/stdafx.h
index e4b3b8e4fc..9340fe47c1 100644
--- a/protocols/MSN/src/stdafx.h
+++ b/protocols/MSN/src/stdafx.h
@@ -225,10 +225,6 @@ unsigned MSN_GenRandom(void);
void MSN_InitContactMenu(void);
void MSN_RemoveContactMenus(void);
-HANDLE GetIconHandle(int iconId);
-HICON LoadIconEx(const char* name, bool big = false);
-void ReleaseIconEx(const char* name, bool big = false);
-
void MsnInitIcons(void);
int sttDivideWords(char* parBuffer, int parMinItems, char** parDest);
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/NewsAggregator/Res/Resource.rc b/protocols/NewsAggregator/Res/Resource.rc
index eb7688640f..9b8b50cfaa 100644
--- a/protocols/NewsAggregator/Res/Resource.rc
+++ b/protocols/NewsAggregator/Res/Resource.rc
@@ -28,6 +28,7 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
// remains consistent on all systems.
IDI_ICON ICON "Main.ico"
IDI_CHECKALL ICON "CheckAll.ico"
+IDI_CHECKFEED ICON "CheckAll.ico"
IDI_ADDFEED ICON "AddFeed.ico"
IDI_IMPORTFEEDS ICON "Import.ico"
IDI_EXPORTFEEDS ICON "Export.ico"
diff --git a/protocols/NewsAggregator/Src/Icons.cpp b/protocols/NewsAggregator/Src/Icons.cpp
index b9cdeb6166..f1525282b0 100644
--- a/protocols/NewsAggregator/Src/Icons.cpp
+++ b/protocols/NewsAggregator/Src/Icons.cpp
@@ -26,7 +26,7 @@ static IconItem iconList[] =
{ LPGEN("Add Feed"), "addfeed", IDI_ADDFEED},
{ LPGEN("Import Feeds"), "importfeeds", IDI_IMPORTFEEDS},
{ LPGEN("Export Feeds"), "exportfeeds", IDI_EXPORTFEEDS},
- { LPGEN("Check Feed"), "checkfeed", IDI_CHECKALL},
+ { LPGEN("Check Feed"), "checkfeed", IDI_CHECKFEED},
{ LPGEN("Auto Update Enabled"), "enabled", IDI_ENABLED},
{ LPGEN("Auto Update Disabled"), "disabled", IDI_DISABLED}
};
@@ -35,19 +35,3 @@ void InitIcons()
{
g_plugin.registerIcon(LPGEN("News Aggregator"), iconList, MODULENAME);
}
-
-HICON LoadIconEx(const char *name, bool big)
-{
- char szSettingName[100];
- mir_snprintf(szSettingName, "%s_%s", MODULENAME, name);
- return IcoLib_GetIcon(szSettingName, big);
-}
-
-HANDLE GetIconHandle(const char *name)
-{
- for (int i=0; i < _countof(iconList); i++)
- if ( !mir_strcmp(iconList[i].szName, name))
- return iconList[i].hIcolib;
-
- return nullptr;
-}
diff --git a/protocols/NewsAggregator/Src/Menus.cpp b/protocols/NewsAggregator/Src/Menus.cpp
index 7770e843eb..16bd7163ef 100644
--- a/protocols/NewsAggregator/Src/Menus.cpp
+++ b/protocols/NewsAggregator/Src/Menus.cpp
@@ -34,7 +34,7 @@ void InitMenu()
mi.name.w = LPGENW("Auto Update Enabled");
else
mi.name.w = LPGENW("Auto Update Disabled");
- mi.hIcolibItem = GetIconHandle("main");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_ICON);
mi.pszService = MS_NEWSAGGREGATOR_ENABLED;
hService2[0] = Menu_AddMainMenuItem(&mi);
@@ -46,21 +46,21 @@ void InitMenu()
SET_UID(mi, 0xb876484d, 0x28aa, 0x4e03, 0x9e, 0x98, 0xed, 0xbc, 0xd1, 0xcf, 0x31, 0x80);
mi.position = 20100002;
- mi.hIcolibItem = GetIconHandle("addfeed");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_ADDFEED);
mi.name.w = LPGENW("Add Feed");
mi.pszService = MS_NEWSAGGREGATOR_ADDFEED;
hService2[2] = Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0x600bf2c2, 0xa974, 0x44d3, 0x98, 0xf9, 0xe6, 0x65, 0x7c, 0x1f, 0x63, 0x37);
mi.position = 20100003;
- mi.hIcolibItem = GetIconHandle("importfeeds");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_IMPORTFEEDS);
mi.name.w = LPGENW("Import Feeds");
mi.pszService = MS_NEWSAGGREGATOR_IMPORTFEEDS;
hService2[3] = Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0xc09c8119, 0x64c2, 0x49bd, 0x81, 0xf, 0x54, 0x20, 0x69, 0xd7, 0x30, 0xcf);
mi.position = 20100004;
- mi.hIcolibItem = GetIconHandle("exportfeeds");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_EXPORTFEEDS);
mi.name.w = LPGENW("Export Feeds");
mi.pszService = MS_NEWSAGGREGATOR_EXPORTFEEDS;
hService2[4] = Menu_AddMainMenuItem(&mi);
@@ -69,7 +69,7 @@ void InitMenu()
SET_UID(mi, 0x92be499c, 0x928c, 0x4789, 0x8f, 0x36, 0x28, 0xa2, 0x9f, 0xb7, 0x1a, 0x97);
mi.root = nullptr;
mi.position = -0x7FFFFFFA;
- mi.hIcolibItem = GetIconHandle("checkfeed");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_CHECKFEED);
mi.name.w = LPGENW("Check feed");
mi.pszService = MS_NEWSAGGREGATOR_CHECKFEED;
hService2[5] = Menu_AddContactMenuItem(&mi, MODULENAME);
@@ -79,5 +79,5 @@ void InitMenu()
mi.pszService = MS_NEWSAGGREGATOR_CHANGEFEED;
hService2[6] = Menu_AddContactMenuItem(&mi, MODULENAME);
- Menu_ModifyItem(hService2[0], nullptr, GetIconHandle(g_plugin.getByte("AutoUpdate", 1) ? "enabled" : "disabled"));
+ Menu_ModifyItem(hService2[0], nullptr, g_plugin.getIconHandle(g_plugin.getByte("AutoUpdate", 1) ? IDI_ENABLED : IDI_DISABLED));
}
diff --git a/protocols/NewsAggregator/Src/Services.cpp b/protocols/NewsAggregator/Src/Services.cpp
index b5b8c9f028..9183607841 100644
--- a/protocols/NewsAggregator/Src/Services.cpp
+++ b/protocols/NewsAggregator/Src/Services.cpp
@@ -113,7 +113,7 @@ INT_PTR NewsAggrGetStatus(WPARAM, LPARAM)
INT_PTR NewsAggrLoadIcon(WPARAM wParam, LPARAM)
{
- return (LOWORD(wParam) == PLI_PROTOCOL) ? (INT_PTR)CopyIcon(LoadIconEx("main", FALSE)) : 0;
+ return (LOWORD(wParam) == PLI_PROTOCOL) ? (INT_PTR)CopyIcon(g_plugin.getIcon(IDI_ICON)) : 0;
}
static void __cdecl AckThreadProc(void *param)
@@ -230,9 +230,9 @@ INT_PTR NewsAggrRecvMessage(WPARAM, LPARAM lParam)
void UpdateMenu(bool State)
{
if (!State) // to enable auto-update
- Menu_ModifyItem(hService2[0], LPGENW("Auto Update Enabled"), GetIconHandle("enabled"));
+ Menu_ModifyItem(hService2[0], LPGENW("Auto Update Enabled"), g_plugin.getIconHandle(IDI_ENABLED));
else // to disable auto-update
- Menu_ModifyItem(hService2[0], LPGENW("Auto Update Disabled"), GetIconHandle("disabled"));
+ Menu_ModifyItem(hService2[0], LPGENW("Auto Update Disabled"), g_plugin.getIconHandle(IDI_DISABLED));
CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTBButton, State ? TTBST_PUSHED : 0);
g_plugin.setByte("AutoUpdate", !State);
@@ -253,8 +253,8 @@ int OnToolbarLoaded(WPARAM, LPARAM)
ttb.pszService = MS_NEWSAGGREGATOR_ENABLED;
ttb.pszTooltipUp = LPGEN("Auto Update Enabled");
ttb.pszTooltipDn = LPGEN("Auto Update Disabled");
- ttb.hIconHandleUp = GetIconHandle("enabled");
- ttb.hIconHandleDn = GetIconHandle("disabled");
+ ttb.hIconHandleUp = g_plugin.getIconHandle(IDI_ENABLED);
+ ttb.hIconHandleDn = g_plugin.getIconHandle(IDI_DISABLED);
ttb.dwFlags = (g_plugin.getByte("AutoUpdate", 1) ? 0 : TTBBF_PUSHED) | TTBBF_ASPUSHBUTTON | TTBBF_VISIBLE;
hTBButton = g_plugin.addTTB(&ttb);
return 0;
diff --git a/protocols/NewsAggregator/Src/resource.h b/protocols/NewsAggregator/Src/resource.h
index 131a0844ba..6067cef8bf 100644
--- a/protocols/NewsAggregator/Src/resource.h
+++ b/protocols/NewsAggregator/Src/resource.h
@@ -4,6 +4,7 @@
//
#define IDD_OPTIONS 101
#define IDD_AUTHENTICATION 102
+#define IDI_CHECKFEED 108
#define IDI_ICON 109
#define IDD_ADDFEED 110
#define IDI_CHECKALL 111
diff --git a/protocols/NewsAggregator/Src/stdafx.h b/protocols/NewsAggregator/Src/stdafx.h
index 819e96d69f..e2af12c08c 100644
--- a/protocols/NewsAggregator/Src/stdafx.h
+++ b/protocols/NewsAggregator/Src/stdafx.h
@@ -101,8 +101,6 @@ void NetlibInit();
void NetlibUnInit();
void InitMenu();
void InitIcons();
-HICON LoadIconEx(const char* name, bool big);
-HANDLE GetIconHandle(const char* name);
INT_PTR NewsAggrGetName(WPARAM wParam, LPARAM lParam);
INT_PTR NewsAggrGetCaps(WPARAM wp, LPARAM lp);
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);
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index 0b55ba50a4..6b299829a4 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -82,15 +82,6 @@ void InitIcons()
g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("VKontakte"), iconList, "VKontakte");
}
-HANDLE GetIconHandle(int iCommand)
-{
- for (auto &it : iconList)
- if (it.defIconID == iCommand)
- return it.hIcolib;
-
- return nullptr;
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
char* ExpUrlEncode(const char *szUrl, bool strict)
@@ -765,7 +756,7 @@ void CVkProto::SetSrmmReadStatus(MCONTACT hContact)
_wcsftime_l(ttime, _countof(ttime), L"%X - %x", localtime(&time), locale);
_free_locale(locale);
- Srmm_SetStatusText(hContact, CMStringW(FORMAT, TranslateT("Message read: %s"), ttime), IcoLib_GetIconByHandle(GetIconHandle(IDI_READMSG)));
+ Srmm_SetStatusText(hContact, CMStringW(FORMAT, TranslateT("Message read: %s"), ttime), g_plugin.getIcon(IDI_READMSG));
}
void CVkProto::MarkDialogAsRead(MCONTACT hContact)
diff --git a/protocols/VKontakte/src/vk.h b/protocols/VKontakte/src/vk.h
index acc4ae940f..8c3d8e14d9 100644
--- a/protocols/VKontakte/src/vk.h
+++ b/protocols/VKontakte/src/vk.h
@@ -108,7 +108,6 @@ LPCSTR findHeader(NETLIBHTTPREQUEST *hdr, LPCSTR szField);
bool wlstrstr(wchar_t *_s1, wchar_t *_s2);
void InitIcons(void);
-HANDLE GetIconHandle(int iCommand);
char* ExpUrlEncode(const char *szUrl, bool strict = false);
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp
index 0ade10a53c..ce8afc5a67 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -546,9 +546,12 @@ void CVkProto::LogMenuHook(CVkChatInfo *cc, GCHOOK *gch)
CVkInviteChatForm dlg(this);
if (dlg.DoModal() && dlg.m_hContact != 0) {
LONG uid = getDword(dlg.m_hContact, "ID", VK_INVALID_USER);
- if (uid != VK_INVALID_USER)
+
+ if (uid < 0)
+ MsgPopup(TranslateT("Adding bots to MUC is not supported"), TranslateT("Not supported"));
+ else if (uid != VK_INVALID_USER)
Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/messages.addChatUser.json", true, &CVkProto::OnReceiveSmth)
- << INT_PARAM("user_id", uid < 0 ? 1000000000 - uid : uid)
+ << INT_PARAM("user_id", uid)
<< INT_PARAM("chat_id", cc->m_iChatId));
}
}
@@ -761,9 +764,14 @@ void CVkProto::NickMenuHook(CVkChatInfo *cc, GCHOOK *gch)
if (!IsOnline())
return;
+ if (cu->m_uid < 0) {
+ MsgPopup(TranslateT("Kick bots is not supported"), TranslateT("Not supported"));
+ return;
+ }
+
Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/messages.removeChatUser.json", true, &CVkProto::OnReceiveSmth)
<< INT_PARAM("chat_id", cc->m_iChatId)
- << INT_PARAM("user_id", cu->m_uid < 0 ? 1000000000 - cu->m_uid : cu->m_uid));
+ << INT_PARAM("user_id", cu->m_uid));
cu->m_bUnknown = true;
break;
diff --git a/protocols/VKontakte/src/vk_dialogs.cpp b/protocols/VKontakte/src/vk_dialogs.cpp
index 3ccf89ab6a..8616098d7f 100644
--- a/protocols/VKontakte/src/vk_dialogs.cpp
+++ b/protocols/VKontakte/src/vk_dialogs.cpp
@@ -34,7 +34,7 @@ CVkCaptchaForm::CVkCaptchaForm(CVkProto *proto, CAPTCHA_FORM_PARAMS *param) :
bool CVkCaptchaForm::OnInitDialog()
{
- Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_KEYS));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_KEYS));
m_btnOk.Disable();
m_btnOpenInBrowser.Enable((m_param->bmp != nullptr));
@@ -118,7 +118,7 @@ CVkWallPostForm::CVkWallPostForm(CVkProto *proto, WALLPOST_FORM_PARAMS *param) :
bool CVkWallPostForm::OnInitDialog()
{
- Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_WALL));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_WALL));
CMStringW wszTitle(FORMAT, TranslateT("Wall message for %s"), m_param->pwszNick);
SetCaption(wszTitle);
diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp
index 1489553ef4..9034495659 100644
--- a/protocols/VKontakte/src/vk_feed.cpp
+++ b/protocols/VKontakte/src/vk_feed.cpp
@@ -76,7 +76,7 @@ void CVkProto::AddCListEvent(bool bNews)
MCONTACT hContact = FindUser(VK_FEED_USER, true);
CLISTEVENT cle = {};
- cle.hIcon = IcoLib_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION));
+ cle.hIcon = g_plugin.getIcon(IDI_NOTIFICATION);
cle.pszService = MS_MSG_READMESSAGE;
cle.flags = CLEF_URGENT | CLEF_UNICODE;
cle.hContact = hContact;
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp
index 66b176cae1..a15749e750 100644
--- a/protocols/VKontakte/src/vk_proto.cpp
+++ b/protocols/VKontakte/src/vk_proto.cpp
@@ -160,7 +160,7 @@ void CVkProto::InitMenus()
if (m_vkOptions.bShowProtoMenuItem1) {
mi.pszService = PS_SETSTATUSMSG;
mi.position = 10009 + PMI_SETSTATUSMSG;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_STATUS));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_STATUS);
mi.name.a = LPGEN("Status message");
SET_UID(mi, 0x696bd932, 0xeee4, 0x4c4c, 0xa6, 0xf8, 0xb3, 0x72, 0xdf, 0xc6, 0xfa, 0xd1);
m_hProtoMenuItems[PMI_SETSTATUSMSG] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
@@ -169,7 +169,7 @@ void CVkProto::InitMenus()
if (m_vkOptions.bShowProtoMenuItem2) {
mi.pszService = PS_WALLPOST;
mi.position = 10009 + PMI_WALLPOST;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_WALL));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_WALL);
mi.name.a = LPGEN("Send message to my wall");
SET_UID(mi, 0x50a80044, 0xdddd, 0x47e6, 0x9e, 0x90, 0x32, 0x7b, 0x88, 0x13, 0x21, 0x4e);
m_hProtoMenuItems[PMI_WALLPOST] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
@@ -178,7 +178,7 @@ void CVkProto::InitMenus()
if (m_vkOptions.bShowProtoMenuItem3) {
mi.pszService = PS_LOADVKNEWS;
mi.position = 10009 + PMI_LOADVKNEWS;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_NOTIFICATION);
mi.name.a = LPGEN("Load news from VK");
SET_UID(mi, 0x7c449456, 0xb731, 0x48cc, 0x9c, 0x4e, 0x20, 0xe4, 0x66, 0x7a, 0x16, 0x23);
m_hProtoMenuItems[PMI_LOADVKNEWS] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
@@ -187,7 +187,7 @@ void CVkProto::InitMenus()
if (m_vkOptions.bShowProtoMenuItem4) {
mi.pszService = PS_GETALLSERVERHISTORY;
mi.position = 10009 + PMI_GETALLSERVERHISTORY;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_HISTORY);
mi.name.a = LPGEN("Load history for all contacts from VK");
SET_UID(mi, 0xe5028605, 0x92eb, 0x4956, 0xa0, 0xd0, 0x53, 0xb, 0x11, 0x44, 0x8f, 0x14);
m_hProtoMenuItems[PMI_GETALLSERVERHISTORY] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
@@ -196,7 +196,7 @@ void CVkProto::InitMenus()
if (m_vkOptions.bShowProtoMenuItem5) {
mi.pszService = PS_WIPENONFRIENDS;
mi.position = 10009 + PMI_WIPENONFRIENDS;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_FRIENDDEL));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_FRIENDDEL);
mi.name.a = LPGEN("Wipe contacts missing in friend list");
SET_UID(mi, 0xcfe99159, 0xf237, 0x4546, 0x80, 0x3e, 0x51, 0x88, 0x26, 0x55, 0xdc, 0x5f);
m_hProtoMenuItems[PMI_WIPENONFRIENDS] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
@@ -205,7 +205,7 @@ void CVkProto::InitMenus()
if (m_vkOptions.bShowProtoMenuItem6) {
mi.pszService = PS_VISITPROFILE;
mi.position = 10009 + PMI_VISITPROFILE;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_VISITPROFILE));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_VISITPROFILE);
mi.name.a = LPGEN("Visit profile");
SET_UID(mi, 0x9550515e, 0x2a45, 0x4913, 0x95, 0x1a, 0x1e, 0xfa, 0x7, 0xc6, 0x2d, 0x60);
m_hProtoMenuItems[PMI_VISITPROFILE] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
@@ -217,70 +217,70 @@ void CVkProto::InitMenus()
mi.pszService = PS_VISITPROFILE;
mi.position = -200001000 + CMI_VISITPROFILE;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_VISITPROFILE));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_VISITPROFILE);
mi.name.w = LPGENW("Visit profile");
SET_UID(mi, 0x828cc50e, 0x398d, 0x43a2, 0xbf, 0xd3, 0xa9, 0x96, 0x47, 0x9d, 0x52, 0xff);
m_hContactMenuItems[CMI_VISITPROFILE] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_MARKMESSAGESASREAD;
mi.position = -200001000 + CMI_MARKMESSAGESASREAD;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_MARKMESSAGESASREAD));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_MARKMESSAGESASREAD);
mi.name.w = LPGENW("Mark messages as read");
SET_UID(mi, 0x2587a649, 0xe5d5, 0x4e90, 0x8b, 0x35, 0x81, 0x4c, 0xb1, 0x5, 0x94, 0x7);
m_hContactMenuItems[CMI_MARKMESSAGESASREAD] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_WALLPOST;
mi.position = -200001000 + CMI_WALLPOST;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_WALL));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_WALL);
mi.name.w = LPGENW("Send message to user's wall");
SET_UID(mi, 0xd8841aaf, 0x15f6, 0x4be9, 0x9f, 0x4f, 0x16, 0xa9, 0x47, 0x6a, 0x19, 0x81);
m_hContactMenuItems[CMI_WALLPOST] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_ADDASFRIEND;
mi.position = -200001000 + CMI_ADDASFRIEND;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_FRIENDADD));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_FRIENDADD);
mi.name.w = LPGENW("Add as friend");
SET_UID(mi, 0xf11b9a7f, 0x569, 0x4023, 0xb0, 0xd6, 0xa3, 0x16, 0xf6, 0xd4, 0xfb, 0xb5);
m_hContactMenuItems[CMI_ADDASFRIEND] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_DELETEFRIEND;
mi.position = -200001000 + CMI_DELETEFRIEND;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_FRIENDDEL));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_FRIENDDEL);
mi.name.w = LPGENW("Delete from friend list");
SET_UID(mi, 0x1e26514, 0x854f, 0x4e60, 0x8c, 0xf8, 0xab, 0xaa, 0xe0, 0xc3, 0xa5, 0xa7);
m_hContactMenuItems[CMI_DELETEFRIEND] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_BANUSER;
mi.position = -200001000 + CMI_BANUSER;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_BAN));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_BAN);
mi.name.w = LPGENW("Ban user");
SET_UID(mi, 0x7ba06bab, 0xf770, 0x4938, 0x9c, 0x76, 0xef, 0x40, 0xbc, 0x55, 0x0, 0x9b);
m_hContactMenuItems[CMI_BANUSER] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_REPORTABUSE;
mi.position = -200001000 + CMI_REPORTABUSE;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_ABUSE));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_ABUSE);
mi.name.w = LPGENW("Report abuse");
SET_UID(mi, 0x56454cb9, 0xd80, 0x4050, 0xbe, 0xfc, 0x2c, 0xf6, 0x10, 0x2a, 0x7d, 0x19);
m_hContactMenuItems[CMI_REPORTABUSE] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_DESTROYKICKCHAT;
mi.position = -200001000 + CMI_DESTROYKICKCHAT;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_FRIENDDEL));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_FRIENDDEL);
mi.name.w = LPGENW("Destroy room");
SET_UID(mi, 0x4fa6e75a, 0x30cd, 0x4482, 0xae, 0x8f, 0x0, 0x38, 0xd0, 0x17, 0x33, 0xcd);
m_hContactMenuItems[CMI_DESTROYKICKCHAT] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_OPENBROADCAST;
mi.position = -200001000 + CMI_OPENBROADCAST;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_BROADCAST));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_BROADCAST);
mi.name.w = LPGENW("Open broadcast");
SET_UID(mi, 0x85251a06, 0xf734, 0x4985, 0x8c, 0x36, 0x6f, 0x66, 0x46, 0xf9, 0xa0, 0x10);
m_hContactMenuItems[CMI_OPENBROADCAST] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_LOADVKNEWS;
mi.position = -200001000 + CMI_LOADVKNEWS;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_NOTIFICATION);
mi.name.w = LPGENW("Load news from VK");
SET_UID(mi, 0xe1f6888b, 0x21ae, 0x409f, 0x82, 0xa2, 0x7b, 0x72, 0xef, 0x47, 0x9, 0xc0);
m_hContactMenuItems[CMI_LOADVKNEWS] = Menu_AddContactMenuItem(&mi, m_szModuleName);
@@ -288,7 +288,7 @@ void CVkProto::InitMenus()
// Sync history menu
mi.pszService = PS_GETSERVERHISTORY;
mi.position = -200001000 + CMI_GETSERVERHISTORY;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_HISTORY);
mi.name.w = LPGENW("Reload messages from vk.com...");
SET_UID(mi, 0xc6b59e9f, 0x5250, 0x4146, 0xb6, 0xf3, 0x2d, 0xe1, 0x4, 0x3b, 0x95, 0xf5);
m_hContactMenuItems[CMI_GETSERVERHISTORY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
@@ -297,42 +297,42 @@ void CVkProto::InitMenus()
mi.pszService = PS_GETSERVERHISTORYLAST1DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST1DAY;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_HISTORY);
mi.name.w = LPGENW("for last 1 day");
SET_UID(mi, 0x508dce88, 0x1a9a, 0x4dd7, 0x90, 0xf4, 0x41, 0x35, 0x7b, 0xc3, 0x17, 0xed);
m_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST1DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_GETSERVERHISTORYLAST3DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST3DAY;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_HISTORY);
mi.name.w = LPGENW("for last 3 days");
SET_UID(mi, 0x9a878764, 0x5bbf, 0x433a, 0xbd, 0x50, 0xa9, 0xb9, 0x16, 0x1f, 0x99, 0x29);
m_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST3DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_GETSERVERHISTORYLAST7DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST7DAY;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_HISTORY);
mi.name.w = LPGENW("for last week");
SET_UID(mi, 0xc6482460, 0xd280, 0x4596, 0x97, 0x4b, 0xf7, 0xfa, 0x6d, 0xe, 0xd5, 0xda);
m_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST7DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_GETSERVERHISTORYLAST30DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST30DAY;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_HISTORY);
mi.name.w = LPGENW("for last 30 days");
SET_UID(mi, 0xc48e8a9f, 0x2860, 0x4d5b, 0xa8, 0xdf, 0xb8, 0x3f, 0xdf, 0x7b, 0xa2, 0xba);
m_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST30DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_GETSERVERHISTORYLAST90DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST90DAY;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_HISTORY);
mi.name.w = LPGENW("for last 90 days");
SET_UID(mi, 0xd8e30530, 0xa585, 0x4672, 0xa6, 0x39, 0x18, 0xc9, 0xc9, 0xcb, 0xc7, 0x7d);
m_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST90DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_GETALLSERVERHISTORYFORCONTACT;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETALLSERVERHISTORYFORCONTACT;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_HISTORY);
mi.name.w = LPGENW("for all time");
SET_UID(mi, 0xaee3d02b, 0x3667, 0x47c8, 0x9f, 0x43, 0x14, 0xb7, 0xab, 0x52, 0x14, 0x94);
m_hContactHistoryMenuItems[CHMI_GETALLSERVERHISTORYFORCONTACT] = Menu_AddContactMenuItem(&mi, m_szModuleName);
@@ -424,7 +424,7 @@ void CVkProto::InitPopups(void)
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Notifications"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Notification");
- ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION));
+ ppc.hIcon = g_plugin.getIcon(IDI_NOTIFICATION);
ppc.colorBack = RGB(190, 225, 255); // Blue
ppc.colorText = RGB(255, 255, 255); // White
ppc.iSeconds = 4;
@@ -531,7 +531,7 @@ int CVkProto::AuthRequest(MCONTACT hContact, const wchar_t *message)
return 1;
if (userID < 0)
- userID = 1000000000 - userID;
+ return 1;
wchar_t msg[501] = { 0 };
diff --git a/protocols/Weather/src/stdafx.h b/protocols/Weather/src/stdafx.h
index eee562a9ed..9affd13abb 100644
--- a/protocols/Weather/src/stdafx.h
+++ b/protocols/Weather/src/stdafx.h
@@ -531,9 +531,6 @@ int BriefInfo(WPARAM wParam, LPARAM lParam);
INT_PTR BriefInfoSvc(WPARAM wParam, LPARAM lParam);
void InitIcons(void);
-HICON LoadIconEx(const char* name, bool big);
-HANDLE GetIconHandle(const char* name);
-void ReleaseIconEx(HICON hIcon);
//============ Plugin Class ============
diff --git a/protocols/Weather/src/weather.cpp b/protocols/Weather/src/weather.cpp
index 742f860967..812e0ce26c 100644
--- a/protocols/Weather/src/weather.cpp
+++ b/protocols/Weather/src/weather.cpp
@@ -109,8 +109,8 @@ int OnToolbarLoaded(WPARAM, LPARAM)
ttb.pszService = MS_WEATHER_ENABLED;
ttb.pszTooltipUp = LPGEN("Auto Update Enabled");
ttb.pszTooltipDn = LPGEN("Auto Update Disabled");
- ttb.hIconHandleUp = GetIconHandle("main");
- ttb.hIconHandleDn = GetIconHandle("disabled");
+ ttb.hIconHandleUp = g_plugin.getIconHandle(IDI_ICON);
+ ttb.hIconHandleDn = g_plugin.getIconHandle(IDI_DISABLED);
ttb.dwFlags = (g_plugin.getByte("AutoUpdate", 1) ? 0 : TTBBF_PUSHED) | TTBBF_ASPUSHBUTTON | TTBBF_VISIBLE;
hTBButton = g_plugin.addTTB(&ttb);
return 0;
diff --git a/protocols/Weather/src/weather_icons.cpp b/protocols/Weather/src/weather_icons.cpp
index 3e043d9280..5e993cd443 100644
--- a/protocols/Weather/src/weather_icons.cpp
+++ b/protocols/Weather/src/weather_icons.cpp
@@ -20,8 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-HANDLE hIcoLibIconsChanged = nullptr;
-
static IconItem iconList[] =
{
{ LPGEN("Protocol icon"), "main", IDI_ICON },
@@ -41,24 +39,3 @@ void InitIcons(void)
{
g_plugin.registerIcon(MODULENAME, iconList, MODULENAME);
}
-
-HICON LoadIconEx(const char* name, bool big)
-{
- char szSettingName[100];
- mir_snprintf(szSettingName, "%s_%s", MODULENAME, name);
- return IcoLib_GetIcon(szSettingName, big);
-}
-
-HANDLE GetIconHandle(const char* name)
-{
- for (auto &it : iconList)
- if (mir_strcmp(it.szName, name) == 0)
- return it.hIcolib;
-
- return nullptr;
-}
-
-void ReleaseIconEx(HICON hIcon)
-{
- IcoLib_ReleaseIcon(hIcon);
-}
diff --git a/protocols/Weather/src/weather_ini.cpp b/protocols/Weather/src/weather_ini.cpp
index 000eab1bc9..bd60fcaaa0 100644
--- a/protocols/Weather/src/weather_ini.cpp
+++ b/protocols/Weather/src/weather_ini.cpp
@@ -163,7 +163,7 @@ static INT_PTR CALLBACK DlgProcSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
SendDlgItemMessage(hwndDlg, IDC_STEP4, BUTTONSETASFLATBTN, TRUE, 0);
// set icons
- Window_SetIcon_IcoLib(hwndDlg, GetIconHandle("main"));
+ Window_SetIcon_IcoLib(hwndDlg, g_plugin.getIconHandle(IDI_ICON));
WindowList_Add(hWindowList, hwndDlg);
ShowWindow(hwndDlg, SW_SHOW);
diff --git a/protocols/Weather/src/weather_mwin.cpp b/protocols/Weather/src/weather_mwin.cpp
index a240b01421..1c1a7b7896 100644
--- a/protocols/Weather/src/weather_mwin.cpp
+++ b/protocols/Weather/src/weather_mwin.cpp
@@ -241,7 +241,7 @@ static void addWindow(MCONTACT hContact)
CLISTFrame Frame = { 0 };
Frame.szName.w = winname;
- Frame.hIcon = LoadIconEx("main", FALSE);
+ Frame.hIcon = g_plugin.getIcon(IDI_ICON);
Frame.cbSize = sizeof(Frame);
Frame.hWnd = hWnd;
Frame.align = alBottom;
diff --git a/protocols/Weather/src/weather_svcs.cpp b/protocols/Weather/src/weather_svcs.cpp
index 4119eab464..2ef10fffa9 100644
--- a/protocols/Weather/src/weather_svcs.cpp
+++ b/protocols/Weather/src/weather_svcs.cpp
@@ -99,7 +99,7 @@ INT_PTR WeatherGetStatus(WPARAM, LPARAM)
// protocol service function to get the icon of the protocol
INT_PTR WeatherLoadIcon(WPARAM wParam, LPARAM)
{
- return (LOWORD(wParam) == PLI_PROTOCOL) ? (INT_PTR)CopyIcon(LoadIconEx("main", FALSE)) : 0;
+ return (LOWORD(wParam) == PLI_PROTOCOL) ? (INT_PTR)CopyIcon(g_plugin.getIcon(IDI_ICON)) : 0;
}
static void __cdecl AckThreadProc(HANDLE param)
@@ -220,11 +220,11 @@ void UpdateMenu(BOOL State)
g_plugin.setByte("AutoUpdate", (BYTE)State);
if (State) { // to enable auto-update
- Menu_ModifyItem(hEnableDisableMenu, LPGENW("Auto Update Enabled"), GetIconHandle("main"));
+ Menu_ModifyItem(hEnableDisableMenu, LPGENW("Auto Update Enabled"), g_plugin.getIconHandle(IDI_ICON));
opt.AutoUpdate = 1;
}
else { // to disable auto-update
- Menu_ModifyItem(hEnableDisableMenu, LPGENW("Auto Update Disabled"), GetIconHandle("disabled"));
+ Menu_ModifyItem(hEnableDisableMenu, LPGENW("Auto Update Disabled"), g_plugin.getIconHandle(IDI_DISABLED));
opt.AutoUpdate = 0;
}
@@ -238,9 +238,9 @@ void UpdatePopupMenu(BOOL State)
g_plugin.setByte("UsePopup", (BYTE)opt.UsePopup);
if (State) // to enable popup
- Menu_ModifyItem(hEnableDisablePopupMenu, LPGENW("Disable &weather notification"), GetIconHandle("popup"));
+ Menu_ModifyItem(hEnableDisablePopupMenu, LPGENW("Disable &weather notification"), g_plugin.getIconHandle(IDI_POPUP));
else // to disable popup
- Menu_ModifyItem(hEnableDisablePopupMenu, LPGENW("Enable &weather notification"), GetIconHandle("nopopup"));
+ Menu_ModifyItem(hEnableDisablePopupMenu, LPGENW("Enable &weather notification"), g_plugin.getIconHandle(IDI_NOPOPUP));
}
// update the weather auto-update menu item when click on it
@@ -267,7 +267,7 @@ void AddMenuItems(void)
SET_UID(mi, 0x266ef52b, 0x869a, 0x4cac, 0xa9, 0xf8, 0xea, 0x5b, 0xb8, 0xab, 0xe0, 0x24);
CreateServiceFunction(MS_WEATHER_UPDATE, UpdateSingleStation);
mi.position = -0x7FFFFFFA;
- mi.hIcolibItem = GetIconHandle("update");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_UPDATE);
mi.name.a = LPGEN("Update Weather");
mi.pszService = MS_WEATHER_UPDATE;
Menu_AddContactMenuItem(&mi, MODULENAME);
@@ -275,7 +275,7 @@ void AddMenuItems(void)
SET_UID(mi, 0x45361b4, 0x8de, 0x44b4, 0x8f, 0x11, 0x9b, 0xe9, 0x6e, 0xa8, 0x83, 0x54);
CreateServiceFunction(MS_WEATHER_REFRESH, UpdateSingleRemove);
mi.position = -0x7FFFFFF9;
- mi.hIcolibItem = GetIconHandle("update2");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_UPDATE2);
mi.name.a = LPGEN("Remove Old Data then Update");
mi.pszService = MS_WEATHER_REFRESH;
Menu_AddContactMenuItem(&mi, MODULENAME);
@@ -283,7 +283,7 @@ void AddMenuItems(void)
SET_UID(mi, 0x4232975e, 0xb181, 0x46a5, 0xb7, 0x6e, 0xd2, 0x5f, 0xef, 0xb8, 0xc4, 0x4d);
CreateServiceFunction(MS_WEATHER_BRIEF, BriefInfoSvc);
mi.position = -0x7FFFFFF8;
- mi.hIcolibItem = GetIconHandle("brief");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_S);
mi.name.a = LPGEN("Brief Information");
mi.pszService = MS_WEATHER_BRIEF;
Menu_AddContactMenuItem(&mi, MODULENAME);
@@ -291,7 +291,7 @@ void AddMenuItems(void)
SET_UID(mi, 0x3d6ed729, 0xd49a, 0x4ae9, 0x8e, 0x2, 0x9f, 0xe0, 0xf0, 0x2c, 0xcc, 0xb1);
CreateServiceFunction(MS_WEATHER_COMPLETE, LoadForecast);
mi.position = -0x7FFFFFF7;
- mi.hIcolibItem = GetIconHandle("read");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_READ);
mi.name.a = LPGEN("Read Complete Forecast");
mi.pszService = MS_WEATHER_COMPLETE;
Menu_AddContactMenuItem(&mi, MODULENAME);
@@ -299,7 +299,7 @@ void AddMenuItems(void)
SET_UID(mi, 0xc4b6c5e0, 0x13c3, 0x4e02, 0x8a, 0xeb, 0xeb, 0x8a, 0xe2, 0x66, 0x40, 0xd4);
CreateServiceFunction(MS_WEATHER_MAP, WeatherMap);
mi.position = -0x7FFFFFF6;
- mi.hIcolibItem = GetIconHandle("map");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_MAP);
mi.name.a = LPGEN("Weather Map");
mi.pszService = MS_WEATHER_MAP;
Menu_AddContactMenuItem(&mi, MODULENAME);
@@ -307,7 +307,7 @@ void AddMenuItems(void)
SET_UID(mi, 0xee3ad7f4, 0x3377, 0x4e4c, 0x8f, 0x3c, 0x3b, 0xf5, 0xd4, 0x86, 0x28, 0x25);
CreateServiceFunction(MS_WEATHER_LOG, ViewLog);
mi.position = -0x7FFFFFF5;
- mi.hIcolibItem = GetIconHandle("log");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_LOG);
mi.name.a = LPGEN("View Log");
mi.pszService = MS_WEATHER_LOG;
Menu_AddContactMenuItem(&mi, MODULENAME);
@@ -315,7 +315,7 @@ void AddMenuItems(void)
SET_UID(mi, 0x1b01cd6a, 0xe5ee, 0x42b4, 0xa1, 0x6d, 0x43, 0xb9, 0x4, 0x58, 0x43, 0x2e);
CreateServiceFunction(MS_WEATHER_EDIT, EditSettings);
mi.position = -0x7FFFFFF4;
- mi.hIcolibItem = GetIconHandle("edit");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_EDIT);
mi.name.a = LPGEN("Edit Settings");
mi.pszService = MS_WEATHER_EDIT;
Menu_AddContactMenuItem(&mi, MODULENAME);
@@ -327,7 +327,7 @@ void AddMenuItems(void)
SET_UID(mi, 0x5ad16188, 0xe0a0, 0x4c31, 0x85, 0xc3, 0xe4, 0x85, 0x79, 0x7e, 0x4b, 0x9c);
CreateServiceFunction(MS_WEATHER_ENABLED, EnableDisableCmd);
mi.name.a = LPGEN("Enable/Disable Weather Update");
- mi.hIcolibItem = GetIconHandle("main");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_ICON);
mi.position = 10100001;
mi.pszService = MS_WEATHER_ENABLED;
hEnableDisableMenu = Menu_AddMainMenuItem(&mi);
@@ -336,7 +336,7 @@ void AddMenuItems(void)
SET_UID(mi, 0x2b1c2054, 0x2991, 0x4025, 0x87, 0x73, 0xb6, 0xf7, 0x85, 0xac, 0xc7, 0x37);
CreateServiceFunction(MS_WEATHER_UPDATEALL, UpdateAllInfo);
mi.position = 20100001;
- mi.hIcolibItem = GetIconHandle("update");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_UPDATE);
mi.name.a = LPGEN("Update All Weather");
mi.pszService = MS_WEATHER_UPDATEALL;
Menu_AddMainMenuItem(&mi);
@@ -344,7 +344,7 @@ void AddMenuItems(void)
SET_UID(mi, 0x8234c00e, 0x788e, 0x424f, 0xbc, 0xc4, 0x2, 0xfd, 0x67, 0x58, 0x2d, 0x19);
CreateServiceFunction(MS_WEATHER_REFRESHALL, UpdateAllRemove);
mi.position = 20100002;
- mi.hIcolibItem = GetIconHandle("update2");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_UPDATE2);
mi.name.a = LPGEN("Remove Old Data then Update All");
mi.pszService = MS_WEATHER_REFRESHALL;
Menu_AddMainMenuItem(&mi);
@@ -352,7 +352,7 @@ void AddMenuItems(void)
SET_UID(mi, 0xdc5411cb, 0xb7c7, 0x443b, 0x88, 0x5a, 0x90, 0x24, 0x43, 0xde, 0x54, 0x3e);
CreateServiceFunction(MODULENAME "/PopupMenu", MenuitemNotifyCmd);
mi.name.a = LPGEN("Weather Notification");
- mi.hIcolibItem = GetIconHandle("popup");
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_POPUP);
mi.position = 0;
mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Popups"), 0);
mi.pszService = MODULENAME "/PopupMenu";
diff --git a/protocols/YAMN/src/browser/badconnect.cpp b/protocols/YAMN/src/browser/badconnect.cpp
index 678eb1f337..86e202d2e6 100644
--- a/protocols/YAMN/src/browser/badconnect.cpp
+++ b/protocols/YAMN/src/browser/badconnect.cpp
@@ -109,7 +109,7 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg, UINT msg, WPARAM wParam, LP
ShowIco = ActualAccount->BadConnectN.Flags & YAMN_ACC_ICO;
if (ShowPopup) {
- BadConnectPopup.lchIcon = g_LoadIconEx(3);
+ BadConnectPopup.lchIcon = g_plugin.getIcon(IDI_BADCONNECT);
BadConnectPopup.colorBack = ActualAccount->BadConnectN.Flags & YAMN_ACC_POPC ? ActualAccount->BadConnectN.PopupB : GetSysColor(COLOR_BTNFACE);
BadConnectPopup.colorText = ActualAccount->BadConnectN.Flags & YAMN_ACC_POPC ? ActualAccount->BadConnectN.PopupT : GetSysColor(COLOR_WINDOWTEXT);
BadConnectPopup.iSeconds = ActualAccount->BadConnectN.PopupTime;
@@ -220,7 +220,7 @@ void __cdecl BadConnection(void *Param)
__try {
hBadConnect = CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_DLGBADCONNECT), nullptr, DlgProcYAMNBadConnection, (LPARAM)&MyParam);
- Window_SetIcon_IcoLib(hBadConnect, g_GetIconHandle(3));
+ Window_SetIcon_IcoLib(hBadConnect, g_plugin.getIconHandle(IDI_BADCONNECT));
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "BadConnect:ActualAccountSO-read wait\n");
@@ -244,7 +244,7 @@ void __cdecl BadConnection(void *Param)
NOTIFYICONDATA nid = {};
nid.cbSize = sizeof(nid);
nid.hWnd = hBadConnect;
- nid.hIcon = g_LoadIconEx(3);
+ nid.hIcon = g_plugin.getIcon(IDI_BADCONNECT);
nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
nid.uCallbackMessage = WM_YAMN_NOTIFYICON;
mir_snwprintf(nid.szTip, L"%S%s", ActualAccount->Name, TranslateT(" - connection error"));
diff --git a/protocols/YAMN/src/browser/mailbrowser.cpp b/protocols/YAMN/src/browser/mailbrowser.cpp
index 6321141135..b225516021 100644
--- a/protocols/YAMN/src/browser/mailbrowser.cpp
+++ b/protocols/YAMN/src/browser/mailbrowser.cpp
@@ -497,7 +497,7 @@ int AddNewMailsToListView(HWND hListView, CAccount *ActualAccount, DWORD nflags)
POPUPDATAW NewMailPopup = {};
NewMailPopup.lchContact = (ActualAccount->hContact != NULL) ? ActualAccount->hContact : (UINT_PTR)ActualAccount;
- NewMailPopup.lchIcon = g_LoadIconEx(2);
+ NewMailPopup.lchIcon = g_plugin.getIcon(IDI_NEWMAIL);
if (nflags & YAMN_ACC_POPC) {
NewMailPopup.colorBack = ActualAccount->NewMailN.PopupB;
NewMailPopup.colorText = ActualAccount->NewMailN.PopupT;
@@ -640,7 +640,7 @@ void DoMailActions(HWND hDlg, CAccount *ActualAccount, struct CMailNumbers *MN,
CLISTEVENT evt = {};
evt.flags = CLEF_UNICODE;
evt.hContact = ActualAccount->hContact;
- evt.hIcon = g_LoadIconEx(2);
+ evt.hIcon = g_plugin.getIcon(IDI_NEWMAIL);
evt.hDbEvent = ActualAccount->hContact;
evt.lParam = ActualAccount->hContact;
evt.pszService = MS_YAMN_CLISTDBLCLICK;
@@ -659,7 +659,7 @@ void DoMailActions(HWND hDlg, CAccount *ActualAccount, struct CMailNumbers *MN,
POPUPDATAW NewMailPopup;
NewMailPopup.lchContact = (ActualAccount->hContact != NULL) ? ActualAccount->hContact : (UINT_PTR)ActualAccount;
- NewMailPopup.lchIcon = g_LoadIconEx(2);
+ NewMailPopup.lchIcon = g_plugin.getIcon(IDI_NEWMAIL);
if (nflags & YAMN_ACC_POPC) {
NewMailPopup.colorBack = ActualAccount->NewMailN.PopupB;
NewMailPopup.colorText = ActualAccount->NewMailN.PopupT;
@@ -701,7 +701,7 @@ void DoMailActions(HWND hDlg, CAccount *ActualAccount, struct CMailNumbers *MN,
SendDlgItemMessageW(hDlg, IDC_LISTMAILS, LVM_SCROLL, 0, (LPARAM)0x7ffffff);
if ((nflags & YAMN_ACC_ICO) && (MN->Real.SysTrayUC + MN->Virtual.SysTrayUC)) {
- nid.hIcon = g_LoadIconEx(2);
+ nid.hIcon = g_plugin.getIcon(IDI_NEWMAIL);
nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
nid.uCallbackMessage = WM_YAMN_NOTIFYICON;
mir_snwprintf(nid.szTip, L"%S %s", ActualAccount->Name, TranslateT("- new mail message(s)"));
@@ -747,7 +747,7 @@ void DoMailActions(HWND hDlg, CAccount *ActualAccount, struct CMailNumbers *MN,
POPUPDATAW NoNewMailPopup = {};
NoNewMailPopup.lchContact = (ActualAccount->hContact != NULL) ? ActualAccount->hContact : (UINT_PTR)ActualAccount;
- NoNewMailPopup.lchIcon = g_LoadIconEx(1);
+ NoNewMailPopup.lchIcon = g_plugin.getIcon(IDI_LAUNCHAPP);
if (nflags & YAMN_ACC_POPC) {
NoNewMailPopup.colorBack = ActualAccount->NoNewMailN.PopupB;
NoNewMailPopup.colorText = ActualAccount->NoNewMailN.PopupT;
@@ -1261,7 +1261,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR
HWND hListView = GetDlgItem(hDlg, IDC_LISTHEADERS);
mir_subclassWindow(GetDlgItem(hDlg, IDC_SPLITTER), SplitterSubclassProc);
SetWindowLongPtr(hDlg, DWLP_USER, (LONG_PTR)MailParam);
- Window_SetIcon_IcoLib(hDlg, g_GetIconHandle(2));
+ Window_SetIcon_IcoLib(hDlg, g_plugin.getIconHandle(IDI_NEWMAIL));
ListView_SetUnicodeFormat(hListView, TRUE);
ListView_SetExtendedListViewStyle(hListView, LVS_EX_FULLROWSELECT);
@@ -2083,9 +2083,9 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR
nid.uID = 0;
nid.uFlags = NIF_ICON;
if (mwui->TrayIconState == 0)
- nid.hIcon = g_LoadIconEx(0);
+ nid.hIcon = g_plugin.getIcon(IDI_CHECKMAIL);
else
- nid.hIcon = g_LoadIconEx(2);
+ nid.hIcon = g_plugin.getIcon(IDI_NEWMAIL);
Shell_NotifyIcon(NIM_MODIFY, &nid);
mwui->TrayIconState = !mwui->TrayIconState;
// UpdateWindow(hDlg);
@@ -2320,7 +2320,7 @@ void __cdecl MailBrowser(void *Param)
if ((hMailBrowser == nullptr) && ((MyParam.nflags & YAMN_ACC_MSG) || (MyParam.nflags & YAMN_ACC_ICO) || (MyParam.nnflags & YAMN_ACC_MSG))) {
hMailBrowser = CreateDialogParamW(g_plugin.getInst(), MAKEINTRESOURCEW(IDD_DLGVIEWMESSAGES), nullptr, DlgProcYAMNMailBrowser, (LPARAM)&MyParam);
- Window_SetIcon_IcoLib(hMailBrowser, g_GetIconHandle(2));
+ Window_SetIcon_IcoLib(hMailBrowser, g_plugin.getIconHandle(IDI_NEWMAIL));
MoveWindow(hMailBrowser, PosX, PosY, SizeX, SizeY, TRUE);
}
diff --git a/protocols/YAMN/src/main.cpp b/protocols/YAMN/src/main.cpp
index 9bdbf83504..d214f5e982 100644
--- a/protocols/YAMN/src/main.cpp
+++ b/protocols/YAMN/src/main.cpp
@@ -126,7 +126,7 @@ int SystemModulesLoaded(WPARAM, LPARAM)
SET_UID(mi, 0xa01ff3d9, 0x53cb, 0x4406, 0x85, 0xd9, 0xf1, 0x90, 0x3a, 0x94, 0xed, 0xf4);
mi.position = 0xb0000000;
- mi.hIcolibItem = g_GetIconHandle(0);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_CHECKMAIL);
mi.name.a = LPGEN("Check &mail (All Account)");
mi.pszService = MS_YAMN_FORCECHECK;
hMenuItemMain = Menu_AddMainMenuItem(&mi);
@@ -137,7 +137,7 @@ int SystemModulesLoaded(WPARAM, LPARAM)
hMenuItemCont = Menu_AddContactMenuItem(&mi, YAMN_DBMODULE);
SET_UID(mi, 0x147c7800, 0x12d0, 0x4209, 0xab, 0xcc, 0xfa, 0x64, 0xc6, 0xb0, 0xa6, 0xeb);
- mi.hIcolibItem = g_GetIconHandle(1);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_LAUNCHAPP);
mi.name.a = LPGEN("Launch application");
mi.pszService = MS_YAMN_CLISTCONTEXTAPP;
hMenuItemContApp = Menu_AddContactMenuItem(&mi, YAMN_DBMODULE);
@@ -166,20 +166,6 @@ void LoadIcons()
g_plugin.registerIcon("YAMN", iconList);
}
-HANDLE WINAPI g_GetIconHandle(int idx)
-{
- if (idx >= _countof(iconList))
- return nullptr;
- return iconList[idx].hIcolib;
-}
-
-HICON WINAPI g_LoadIconEx(int idx, bool big)
-{
- if (idx >= _countof(iconList))
- return nullptr;
- return IcoLib_GetIcon(iconList[idx].szName, big);
-}
-
static void LoadPlugins()
{
wchar_t szSearchPath[MAX_PATH];
diff --git a/protocols/YAMN/src/proto/pop3/pop3opt.cpp b/protocols/YAMN/src/proto/pop3/pop3opt.cpp
index 83551a631c..4d4993de70 100644
--- a/protocols/YAMN/src/proto/pop3/pop3opt.cpp
+++ b/protocols/YAMN/src/proto/pop3/pop3opt.cpp
@@ -1248,6 +1248,7 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
case IDC_RADIOPOP1:
Changed = TRUE;
break;
+
case IDC_CPB:
case IDC_CPT:
case IDC_CPFB:
@@ -1256,6 +1257,7 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
case IDC_CPNT:
if (HIWORD(wParam) != CPN_COLOURCHANGED)
break;
+
case IDC_CHECKCOL:
case IDC_CHECKFCOL:
case IDC_CHECKNCOL:
@@ -1269,25 +1271,12 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
break;
case IDC_PREVIEW:
- {
+ if (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED) {
POPUPDATAW Tester = {};
- POPUPDATAW TesterF = {};
- POPUPDATAW TesterN = {};
- BOOL TesterC = (IsDlgButtonChecked(hDlg, IDC_CHECKCOL) == BST_CHECKED);
- BOOL TesterFC = (IsDlgButtonChecked(hDlg, IDC_CHECKFCOL) == BST_CHECKED);
- BOOL TesterNC = (IsDlgButtonChecked(hDlg, IDC_CHECKNCOL) == BST_CHECKED);
-
- Tester.lchIcon = g_LoadIconEx(2);
- TesterF.lchIcon = g_LoadIconEx(3);
- TesterN.lchIcon = g_LoadIconEx(1);
-
+ Tester.lchIcon = g_plugin.getIcon(IDI_NEWMAIL);
mir_wstrncpy(Tester.lpwzContactName, TranslateT("Account Test"), MAX_CONTACTNAME);
- mir_wstrncpy(TesterF.lpwzContactName, TranslateT("Account Test (failed)"), MAX_CONTACTNAME);
- mir_wstrncpy(TesterN.lpwzContactName, TranslateT("Account Test"), MAX_CONTACTNAME);
mir_wstrncpy(Tester.lpwzText, TranslateT("You have N new mail messages"), MAX_SECONDLINE);
- mir_wstrncpy(TesterF.lpwzText, TranslateT("Connection failed message"), MAX_SECONDLINE);
- mir_wstrncpy(TesterN.lpwzText, TranslateT("No new mail message"), MAX_SECONDLINE);
- if (TesterC) {
+ if (IsDlgButtonChecked(hDlg, IDC_CHECKCOL) == BST_CHECKED) {
Tester.colorBack = SendDlgItemMessage(hDlg, IDC_CPB, CPM_GETCOLOUR, 0, 0);
Tester.colorText = SendDlgItemMessage(hDlg, IDC_CPT, CPM_GETCOLOUR, 0, 0);
}
@@ -1295,7 +1284,14 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
Tester.colorBack = GetSysColor(COLOR_BTNFACE);
Tester.colorText = GetSysColor(COLOR_WINDOWTEXT);
}
- if (TesterFC) {
+ PUAddPopupW(&Tester);
+ }
+ if (IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED) {
+ POPUPDATAW TesterF = {};
+ TesterF.lchIcon = g_plugin.getIcon(IDI_BADCONNECT);
+ mir_wstrncpy(TesterF.lpwzContactName, TranslateT("Account Test (failed)"), MAX_CONTACTNAME);
+ mir_wstrncpy(TesterF.lpwzText, TranslateT("Connection failed message"), MAX_SECONDLINE);
+ if (IsDlgButtonChecked(hDlg, IDC_CHECKFCOL) == BST_CHECKED) {
TesterF.colorBack = SendDlgItemMessage(hDlg, IDC_CPFB, CPM_GETCOLOUR, 0, 0);
TesterF.colorText = SendDlgItemMessage(hDlg, IDC_CPFT, CPM_GETCOLOUR, 0, 0);
}
@@ -1303,7 +1299,14 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
TesterF.colorBack = GetSysColor(COLOR_BTNFACE);
TesterF.colorText = GetSysColor(COLOR_WINDOWTEXT);
}
- if (TesterNC) {
+ PUAddPopupW(&TesterF);
+ }
+ if (IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED) {
+ POPUPDATAW TesterN = {};
+ TesterN.lchIcon = g_plugin.getIcon(IDI_LAUNCHAPP);
+ mir_wstrncpy(TesterN.lpwzContactName, TranslateT("Account Test"), MAX_CONTACTNAME);
+ mir_wstrncpy(TesterN.lpwzText, TranslateT("No new mail message"), MAX_SECONDLINE);
+ if (IsDlgButtonChecked(hDlg, IDC_CHECKNCOL) == BST_CHECKED) {
TesterN.colorBack = SendDlgItemMessage(hDlg, IDC_CPNB, CPM_GETCOLOUR, 0, 0);
TesterN.colorText = SendDlgItemMessage(hDlg, IDC_CPNT, CPM_GETCOLOUR, 0, 0);
}
@@ -1311,25 +1314,15 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
TesterN.colorBack = GetSysColor(COLOR_BTNFACE);
TesterN.colorText = GetSysColor(COLOR_WINDOWTEXT);
}
- Tester.PluginWindowProc = nullptr;
- TesterF.PluginWindowProc = nullptr;
- TesterN.PluginWindowProc = nullptr;
- Tester.PluginData = nullptr;
- TesterF.PluginData = nullptr;
- TesterN.PluginData = nullptr;
-
- if (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED)
- PUAddPopupW(&Tester);
- if (IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED)
- PUAddPopupW(&TesterF);
- if (IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED)
- PUAddPopupW(&TesterN);
- Changed = TRUE;
+ PUAddPopupW(&TesterN);
}
+ Changed = TRUE;
break;
+
case IDC_CHECKKBN:
Changed = TRUE;
break;
+
case IDC_CHECKPOP:
Changed = TRUE;
EnableWindow(GetDlgItem(hDlg, IDC_CHECKCOL), IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED);
diff --git a/protocols/YAMN/src/services.cpp b/protocols/YAMN/src/services.cpp
index 3ddae133c6..771367d479 100644
--- a/protocols/YAMN/src/services.cpp
+++ b/protocols/YAMN/src/services.cpp
@@ -44,7 +44,7 @@ static INT_PTR Service_GetName(WPARAM wParam, LPARAM lParam)
static INT_PTR Service_LoadIcon(WPARAM wParam, LPARAM)
{
if (LOWORD(wParam) == PLI_PROTOCOL)
- return (INT_PTR)CopyIcon(g_LoadIconEx(0)); // noone cares about other than PLI_PROTOCOL
+ return (INT_PTR)CopyIcon(g_plugin.getIcon(IDI_CHECKMAIL)); // noone cares about other than PLI_PROTOCOL
return (INT_PTR)(HICON)NULL;
}
@@ -297,7 +297,7 @@ int AddTopToolbarIcon(WPARAM, LPARAM)
TTBButton btn = {};
btn.pszService = MS_YAMN_FORCECHECK;
btn.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
- btn.hIconHandleUp = btn.hIconHandleDn = g_GetIconHandle(0);
+ btn.hIconHandleUp = btn.hIconHandleDn = g_plugin.getIconHandle(IDI_CHECKMAIL);
btn.name = btn.pszTooltipUp = LPGEN("Check mail");
hTTButton = g_plugin.addTTB(&btn);
}
diff --git a/protocols/YAMN/src/stdafx.h b/protocols/YAMN/src/stdafx.h
index f0919e24b8..44bb1037dd 100644
--- a/protocols/YAMN/src/stdafx.h
+++ b/protocols/YAMN/src/stdafx.h
@@ -178,9 +178,6 @@ extern HANDLE hTTButton;
extern HCURSOR hCurSplitNS, hCurSplitWE;
extern UINT SecTimer;
-HANDLE WINAPI g_GetIconHandle(int idx);
-HICON WINAPI g_LoadIconEx(int idx, bool big = false);
-
//From synchro.cpp
void WINAPI DeleteMessagesToEndFcn(CAccount *Account, HYAMNMAIL From);
DWORD WINAPI WaitToWriteFcn(PSWMRG SObject, PSCOUNTER SCounter = nullptr);