summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/MirLua/src/Modules/m_icolib.cpp4
-rw-r--r--plugins/MirLua/src/icons.cpp18
-rw-r--r--plugins/MirLua/src/options.cpp10
-rw-r--r--plugins/MirLua/src/stdafx.h2
-rw-r--r--plugins/StartupSilence/src/main.cpp24
-rw-r--r--plugins/StartupSilence/src/stdafx.h11
-rw-r--r--protocols/CloudFile/src/Services/dropbox_service.cpp2
-rw-r--r--protocols/CloudFile/src/Services/google_service.cpp2
-rw-r--r--protocols/CloudFile/src/Services/microsoft_service.cpp2
-rw-r--r--protocols/CloudFile/src/Services/yandex_service.cpp2
-rw-r--r--protocols/CloudFile/src/icons.cpp34
-rw-r--r--protocols/CloudFile/src/menus.cpp4
-rw-r--r--protocols/CloudFile/src/srmm.cpp2
-rw-r--r--protocols/CloudFile/src/stdafx.h3
-rw-r--r--protocols/MinecraftDynmap/src/dialogs.cpp47
-rw-r--r--protocols/MinecraftDynmap/src/dialogs.h2
-rw-r--r--protocols/Omegle/src/communication.cpp8
-rw-r--r--protocols/Omegle/src/theme.cpp9
-rw-r--r--protocols/Omegle/src/theme.h1
-rw-r--r--protocols/Sametime/src/conference.cpp4
-rw-r--r--protocols/Sametime/src/sametime.cpp22
-rw-r--r--protocols/Sametime/src/sametime.h4
-rw-r--r--protocols/Sametime/src/sametime_session.cpp2
-rw-r--r--protocols/Sametime/src/utils.cpp8
-rw-r--r--protocols/SkypeWeb/src/skype_events.cpp4
-rw-r--r--protocols/SkypeWeb/src/skype_icons.cpp16
-rw-r--r--protocols/SkypeWeb/src/skype_menus.cpp8
-rw-r--r--protocols/SkypeWeb/src/skype_popups.cpp6
-rw-r--r--protocols/SkypeWeb/src/skype_proto.h4
-rw-r--r--protocols/SkypeWeb/src/skype_trouter.cpp2
-rw-r--r--protocols/Tox/src/tox_icons.cpp16
-rw-r--r--protocols/Tox/src/tox_messages.cpp2
-rw-r--r--protocols/Tox/src/tox_proto.h4
33 files changed, 69 insertions, 220 deletions
diff --git a/plugins/MirLua/src/Modules/m_icolib.cpp b/plugins/MirLua/src/Modules/m_icolib.cpp
index 3f94e26894..97fa50ccb3 100644
--- a/plugins/MirLua/src/Modules/m_icolib.cpp
+++ b/plugins/MirLua/src/Modules/m_icolib.cpp
@@ -57,7 +57,7 @@ static int lua_AddIcon(lua_State *L)
sid.description.w = mir_utf8decodeW(luaL_checkstring(L, 2));
sid.section.w = mir_utf8decodeW(luaL_optstring(L, 3, MODULENAME));
sid.defaultFile.w = mir_utf8decodeW(lua_tostring(L, 4));
- sid.hDefaultIcon = GetIcon(IDI_SCRIPT);
+ sid.hDefaultIcon = g_plugin.getIcon(IDI_SCRIPT);
if (sid.defaultFile.w == nullptr) {
sid.defaultFile.w = (wchar_t*)mir_calloc(MAX_PATH + 1);
@@ -133,7 +133,7 @@ static int lua_RemoveIcon(lua_State *L)
static luaL_Reg icolibApi[] =
{
{ "AddIcon", lua_AddIcon },
- { "GetIcon", lua_GetIcon },
+ { "g_plugin.getIcon", lua_GetIcon },
{ "GetHandle", lua_GetIconHandle },
{ "GetIconHandle", lua_GetIconHandle },
{ "RemoveIcon", lua_RemoveIcon },
diff --git a/plugins/MirLua/src/icons.cpp b/plugins/MirLua/src/icons.cpp
index 52940084f3..74e4d28136 100644
--- a/plugins/MirLua/src/icons.cpp
+++ b/plugins/MirLua/src/icons.cpp
@@ -14,21 +14,3 @@ void LoadIcons()
{
g_plugin.registerIcon(MODULENAME, Icons, MODULENAME);
}
-
-HICON GetIcon(int iconId)
-{
- for (auto &it : Icons)
- if (it.defIconID == iconId)
- return IcoLib_GetIconByHandle(it.hIcolib);
-
- return nullptr;
-}
-
-HANDLE GetIconHandle(int iconId)
-{
- for (auto &it : Icons)
- if (it.defIconID == iconId)
- return it.hIcolib;
-
- return nullptr;
-} \ No newline at end of file
diff --git a/plugins/MirLua/src/options.cpp b/plugins/MirLua/src/options.cpp
index 83a8b9d7c8..f96a4a15a3 100644
--- a/plugins/MirLua/src/options.cpp
+++ b/plugins/MirLua/src/options.cpp
@@ -50,11 +50,11 @@ bool CMLuaOptionsMain::OnInitDialog()
m_scriptsList.SetExtendedListViewStyle(LVS_EX_SUBITEMIMAGES | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES | LVS_EX_INFOTIP);
HIMAGELIST hImageList = m_scriptsList.CreateImageList(LVSIL_SMALL);
- ImageList_AddIcon(hImageList, GetIcon(IDI_LOADED));
- ImageList_AddIcon(hImageList, GetIcon(IDI_FAILED));
- ImageList_AddIcon(hImageList, GetIcon(IDI_OPEN));
- ImageList_AddIcon(hImageList, GetIcon(IDI_RELOAD));
- ImageList_AddIcon(hImageList, GetIcon(IDI_COMPILE));
+ ImageList_AddIcon(hImageList, g_plugin.getIcon(IDI_LOADED));
+ ImageList_AddIcon(hImageList, g_plugin.getIcon(IDI_FAILED));
+ ImageList_AddIcon(hImageList, g_plugin.getIcon(IDI_OPEN));
+ ImageList_AddIcon(hImageList, g_plugin.getIcon(IDI_RELOAD));
+ ImageList_AddIcon(hImageList, g_plugin.getIcon(IDI_COMPILE));
wchar_t scriptDir[MAX_PATH];
FoldersGetCustomPathT(g_hScriptsFolder, scriptDir, _countof(scriptDir), VARSW(MIRLUA_PATHT));
diff --git a/plugins/MirLua/src/stdafx.h b/plugins/MirLua/src/stdafx.h
index cd4873de17..9c88b62ad4 100644
--- a/plugins/MirLua/src/stdafx.h
+++ b/plugins/MirLua/src/stdafx.h
@@ -72,8 +72,6 @@ void LoadNetlib();
void UnloadNetlib();
void LoadIcons();
-HICON GetIcon(int iconId);
-HANDLE GetIconHandle(int iconId);
/* utils */
diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp
index e2f8ab22be..5a2241f494 100644
--- a/plugins/StartupSilence/src/main.cpp
+++ b/plugins/StartupSilence/src/main.cpp
@@ -27,7 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
CMPlugin g_plugin;
HGENMENU hSSMenuToggleOnOff;
-HANDLE GetIconHandle(char *szIcon);
HANDLE hOptionsInitialize;
HANDLE hTTBarloaded = nullptr;
HANDLE Buttons = nullptr;
@@ -93,7 +92,7 @@ static void __cdecl AdvSt(void*)
if (PopUp == 1) {
lpwzText = NonStatusAllow == 1 ? ALL_DISABLED_FLT : ALL_DISABLED;
- ppd.lchIcon = IcoLib_GetIconByHandle((NonStatusAllow == 1) ? GetIconHandle(ALL_ENABLED_FLT) : GetIconHandle(MENU_NAME));
+ ppd.lchIcon = IcoLib_GetIconByHandle((NonStatusAllow == 1) ? g_plugin.getIconHandle(IDI_SSFILTEREDON) : g_plugin.getIconHandle(IDI_SSICON));
ppd.lchContact = NULL;
ppd.iSeconds = PopUpTime;
wcsncpy_s(ppd.lpwzText, lpwzText, _TRUNCATE);
@@ -108,7 +107,7 @@ static void __cdecl AdvSt(void*)
if (PopUp == 1) {
lpwzText = (DefEnabled == 1 && DefPopup == 1) ? TranslateT(ALL_ENABLED_FLT) : ALL_ENABLED;
- ppd.lchIcon = IcoLib_GetIconByHandle((DefEnabled == 1 && DefPopup == 1) ? GetIconHandle(ALL_ENABLED_FLT) : GetIconHandle(MENU_NAME));
+ ppd.lchIcon = IcoLib_GetIconByHandle((DefEnabled == 1 && DefPopup == 1) ? g_plugin.getIconHandle(IDI_SSFILTEREDON) : g_plugin.getIconHandle(IDI_SSICON));
wcsncpy_s(ppd.lpwzText, lpwzText, _TRUNCATE);
PUAddPopupW(&ppd);
}
@@ -213,7 +212,7 @@ static INT_PTR StartupSilenceEnabled(WPARAM, LPARAM)
if (PopUp == 1) {
wchar_t * lpwzText = Enabled == 1 ? S_MODE_CHANGEDON : S_MODE_CHANGEDOFF;
POPUPDATAW ppd;
- ppd.lchIcon = IcoLib_GetIconByHandle((Enabled == 1) ? GetIconHandle(ENABLE_SILENCE) : GetIconHandle(DISABLE_SILENCE));
+ ppd.lchIcon = IcoLib_GetIconByHandle((Enabled == 1) ? g_plugin.getIconHandle(IDI_SSENABLE) : g_plugin.getIconHandle(IDI_SSDISABLE));
ppd.lchContact = NULL;
ppd.iSeconds = PopUpTime;
wcsncpy_s(ppd.lpwzText, lpwzText, _TRUNCATE);
@@ -237,7 +236,7 @@ static INT_PTR InitMenu()
CMenuItem mi(&g_plugin);
SET_UID(mi, 0x9100c881, 0x6f76, 0x4cb5, 0x97, 0x66, 0xeb, 0xf5, 0xc5, 0x22, 0x46, 0x1f);
mi.position = 100000000;
- mi.hIcolibItem = GetIconHandle(MENU_NAME);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_SSICON);
mi.name.a = MENU_NAME;
mi.pszService = SS_SERVICE_NAME;
hSSMenuToggleOnOff = Menu_AddMainMenuItem(&mi);
@@ -248,9 +247,9 @@ static INT_PTR InitMenu()
void UpdateMenu()
{
if (Enabled == 1)
- Menu_ModifyItem(hSSMenuToggleOnOff, _A2W(DISABLE_SILENCE), GetIconHandle(DISABLE_SILENCE));
+ Menu_ModifyItem(hSSMenuToggleOnOff, _A2W(DISABLE_SILENCE), g_plugin.getIconHandle(IDI_SSDISABLE));
else
- Menu_ModifyItem(hSSMenuToggleOnOff, _A2W(ENABLE_SILENCE), GetIconHandle(ENABLE_SILENCE));
+ Menu_ModifyItem(hSSMenuToggleOnOff, _A2W(ENABLE_SILENCE), g_plugin.getIconHandle(IDI_SSENABLE));
UpdateTTB();
}
@@ -266,8 +265,8 @@ static int CreateTTButtons(WPARAM, LPARAM)
TTBButton ttb = {};
ttb.dwFlags = (Enabled == 1 ? 0 : TTBBF_PUSHED) | TTBBF_VISIBLE | TTBBF_ASPUSHBUTTON;
ttb.pszService = SS_SERVICE_NAME;
- ttb.hIconHandleDn = GetIconHandle(DISABLE_SILENCETTB);
- ttb.hIconHandleUp = GetIconHandle(ENABLE_SILENCETTB);
+ ttb.hIconHandleDn = g_plugin.getIconHandle(IDI_SSDISABLETTB);
+ ttb.hIconHandleUp = g_plugin.getIconHandle(IDI_SSENABLETTB);
ttb.name = TTBNAME;
ttb.pszTooltipUp = SS_IS_ON;
ttb.pszTooltipDn = SS_IS_OFF;
@@ -284,13 +283,6 @@ void RemoveTTButtons()
ttbButtons.destroy();
}
-HANDLE GetIconHandle(char *szIcon)
-{
- char szSettingName[64];
- mir_snprintf(szSettingName, "%s_%s", MENU_NAME, szIcon);
- return IcoLib_GetIconHandle(szSettingName);
-}
-
static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
diff --git a/plugins/StartupSilence/src/stdafx.h b/plugins/StartupSilence/src/stdafx.h
index 0eff5b5fce..97a37291c3 100644
--- a/plugins/StartupSilence/src/stdafx.h
+++ b/plugins/StartupSilence/src/stdafx.h
@@ -67,11 +67,12 @@ struct CMPlugin : public PLUGIN<CMPlugin>
#define NEEDTTBMOD TranslateT("You have to install TopToolBar plugin to use this option.")
#define NEEDPOPUP TranslateT("You have to install popup plugin to use this option.")
-static IconItem iconList[] = {
- { MENU_NAME, MENU_NAME, IDI_SSICON},
- { ALL_ENABLED_FLT, ALL_ENABLED_FLT, IDI_SSFILTEREDON},
- { DISABLE_SILENCE, DISABLE_SILENCE, IDI_SSDISABLE},
- { ENABLE_SILENCE, ENABLE_SILENCE, IDI_SSENABLE}
+static IconItem iconList[] =
+{
+ { MENU_NAME, MENU_NAME, IDI_SSICON },
+ { ALL_ENABLED_FLT, ALL_ENABLED_FLT, IDI_SSFILTEREDON },
+ { DISABLE_SILENCE, DISABLE_SILENCE, IDI_SSDISABLE },
+ { ENABLE_SILENCE, ENABLE_SILENCE, IDI_SSENABLE }
};
static IconItem iconttbList[] = {
diff --git a/protocols/CloudFile/src/Services/dropbox_service.cpp b/protocols/CloudFile/src/Services/dropbox_service.cpp
index a2cfa5a2e5..f4b9a22b3d 100644
--- a/protocols/CloudFile/src/Services/dropbox_service.cpp
+++ b/protocols/CloudFile/src/Services/dropbox_service.cpp
@@ -18,7 +18,7 @@ g_pluginDropbox;
CDropboxService::CDropboxService(const char *protoName, const wchar_t *userName) :
CCloudService(protoName, userName, &g_pluginDropbox)
{
- m_hProtoIcon = GetIconHandle(IDI_DROPBOX);
+ m_hProtoIcon = g_plugin.getIconHandle(IDI_DROPBOX);
}
CDropboxService* CDropboxService::Init(const char *moduleName, const wchar_t *userName)
diff --git a/protocols/CloudFile/src/Services/google_service.cpp b/protocols/CloudFile/src/Services/google_service.cpp
index 536d2ff65e..db4cfc1cbd 100644
--- a/protocols/CloudFile/src/Services/google_service.cpp
+++ b/protocols/CloudFile/src/Services/google_service.cpp
@@ -19,7 +19,7 @@ g_pluginGoogle;
CGDriveService::CGDriveService(const char *protoName, const wchar_t *userName) :
CCloudService(protoName, userName, &g_pluginGoogle)
{
- m_hProtoIcon = GetIconHandle(IDI_GDRIVE);
+ m_hProtoIcon = g_plugin.getIconHandle(IDI_GDRIVE);
}
CGDriveService* CGDriveService::Init(const char *moduleName, const wchar_t *userName)
diff --git a/protocols/CloudFile/src/Services/microsoft_service.cpp b/protocols/CloudFile/src/Services/microsoft_service.cpp
index 992312e2a8..27ec0df7fb 100644
--- a/protocols/CloudFile/src/Services/microsoft_service.cpp
+++ b/protocols/CloudFile/src/Services/microsoft_service.cpp
@@ -18,7 +18,7 @@ g_pluginOnedrive;
COneDriveService::COneDriveService(const char *protoName, const wchar_t *userName) :
CCloudService(protoName, userName, &g_pluginOnedrive)
{
- m_hProtoIcon = GetIconHandle(IDI_ONEDRIVE);
+ m_hProtoIcon = g_plugin.getIconHandle(IDI_ONEDRIVE);
}
COneDriveService* COneDriveService::Init(const char *moduleName, const wchar_t *userName)
diff --git a/protocols/CloudFile/src/Services/yandex_service.cpp b/protocols/CloudFile/src/Services/yandex_service.cpp
index 4bd0210ca1..816e6ea5e4 100644
--- a/protocols/CloudFile/src/Services/yandex_service.cpp
+++ b/protocols/CloudFile/src/Services/yandex_service.cpp
@@ -18,7 +18,7 @@ g_pluginYandex;
CYandexService::CYandexService(const char *protoName, const wchar_t *userName) :
CCloudService(protoName, userName, &g_pluginYandex)
{
- m_hProtoIcon = GetIconHandle(IDI_YADISK);
+ m_hProtoIcon = g_plugin.getIconHandle(IDI_YADISK);
}
CYandexService* CYandexService::Init(const char *moduleName, const wchar_t *userName)
diff --git a/protocols/CloudFile/src/icons.cpp b/protocols/CloudFile/src/icons.cpp
index 001df50240..0b42ad77fc 100644
--- a/protocols/CloudFile/src/icons.cpp
+++ b/protocols/CloudFile/src/icons.cpp
@@ -2,38 +2,14 @@
static IconItem iconList[] =
{
- { LPGEN("Upload file(s)"), "upload", IDI_UPLOAD },
- { LPGEN("Dropbox"), "dropbox", IDI_DROPBOX },
- { LPGEN("Google Drive"), "gdrive", IDI_GDRIVE },
- { LPGEN("OneDrive"), "onedrive", IDI_ONEDRIVE },
- { LPGEN("Yandex.Disk"), "yadisk", IDI_YADISK }
+ { LPGEN("Upload file(s)"), "upload", IDI_UPLOAD },
+ { LPGEN("Dropbox"), "dropbox", IDI_DROPBOX },
+ { LPGEN("Google Drive"), "gdrive", IDI_GDRIVE },
+ { LPGEN("OneDrive"), "onedrive", IDI_ONEDRIVE },
+ { LPGEN("Yandex.Disk"), "yadisk", IDI_YADISK }
};
void InitializeIcons()
{
g_plugin.registerIcon("Protocols/" MODULENAME, iconList, MODULENAME);
}
-
-HANDLE GetIconHandle(int iconId)
-{
- for (auto &it : iconList)
- if (it.defIconID == iconId)
- return it.hIcolib;
- return nullptr;
-}
-
-HANDLE GetIconHandle(const char *name)
-{
- for (auto &it : iconList)
- if (mir_strcmpi(it.szName, name) == 0)
- return it.hIcolib;
- return nullptr;
-}
-
-HICON LoadIconEx(int iconId, bool big)
-{
- for (auto &it : iconList)
- if (it.defIconID == iconId)
- return IcoLib_GetIconByHandle(it.hIcolib, big);
- return nullptr;
-} \ No newline at end of file
diff --git a/protocols/CloudFile/src/menus.cpp b/protocols/CloudFile/src/menus.cpp
index 3ca1b085b9..33fe369406 100644
--- a/protocols/CloudFile/src/menus.cpp
+++ b/protocols/CloudFile/src/menus.cpp
@@ -26,7 +26,7 @@ void InitializeMenus()
}
mi.position = -2000019999;
- mi.hIcon = LoadIconEx(IDI_UPLOAD);
+ mi.hIcon = g_plugin.getIcon(IDI_UPLOAD);
hContactMenu = Menu_AddContactMenuItem(&mi);
}
@@ -39,7 +39,7 @@ void CCloudService::OnModulesLoaded()
mi.flags = CMIF_SYSTEM | CMIF_UNICODE;
mi.name.w = (wchar_t*)GetUserName();
mi.position = Services.getCount();
- mi.hIcolibItem = GetIconHandle(GetIconId());
+ mi.hIcolibItem = g_plugin.getIconHandle(GetIconId());
Menu_AddContactMenuItem(&mi);
CreateServiceFunctionObj(mi.pszService, UploadMenuCommand, this);
diff --git a/protocols/CloudFile/src/srmm.cpp b/protocols/CloudFile/src/srmm.cpp
index b4d44c9fdd..161ddfffd0 100644
--- a/protocols/CloudFile/src/srmm.cpp
+++ b/protocols/CloudFile/src/srmm.cpp
@@ -8,7 +8,7 @@ int OnSrmmToolbarLoaded(WPARAM, LPARAM)
CMStringW tooltip(FORMAT, TranslateT("Upload files to..."));
bbd.pwszTooltip = tooltip;
- bbd.hIcon = GetIconHandle(IDI_UPLOAD);
+ bbd.hIcon = g_plugin.getIconHandle(IDI_UPLOAD);
bbd.dwButtonID = BBB_ID_FILE_SEND;
bbd.dwDefPos = 100 + bbd.dwButtonID;
Srmm_AddButton(&bbd, &g_plugin);
diff --git a/protocols/CloudFile/src/stdafx.h b/protocols/CloudFile/src/stdafx.h
index 58801c4a34..c0bb92b713 100644
--- a/protocols/CloudFile/src/stdafx.h
+++ b/protocols/CloudFile/src/stdafx.h
@@ -81,9 +81,6 @@ int OnModulesLoaded(WPARAM, LPARAM);
// icons
void InitializeIcons();
-HANDLE GetIconHandle(int iconId);
-HANDLE GetIconHandle(const char *name);
-HICON LoadIconEx(int iconId, bool big = false);
// menus
extern HGENMENU hContactMenu;
diff --git a/protocols/MinecraftDynmap/src/dialogs.cpp b/protocols/MinecraftDynmap/src/dialogs.cpp
index 3639e3cc6b..b74debb644 100644
--- a/protocols/MinecraftDynmap/src/dialogs.cpp
+++ b/protocols/MinecraftDynmap/src/dialogs.cpp
@@ -24,26 +24,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Icons
-static IconItem iconList[] = {
+static IconItem iconList[] =
+{
{ "proto", LPGEN("Protocol icon"), IDI_PROTO },
};
static HANDLE hIconLibItem[_countof(iconList)];
-void InitIcons(void) {
+void InitIcons(void)
+{
g_plugin.registerIcon("Protocols/MinecraftDynmap", iconList, "MinecraftDynmap");
}
-HANDLE GetIconHandle(const char* name) {
- for (size_t i = 0; i < _countof(iconList); i++) {
- if (strcmp(iconList[i].szName, name) == 0) {
- return hIconLibItem[i];
- }
- }
- return nullptr;
-}
-
-
// Dialogs
static void LoadDBText(MinecraftDynmapProto* ppro, HWND hwnd, int idCtrl, const char* szSetting)
@@ -55,14 +47,13 @@ static void LoadDBText(MinecraftDynmapProto* ppro, HWND hwnd, int idCtrl, const
static void StoreDBText(MinecraftDynmapProto* ppro, HWND hwnd, int idCtrl, const char* szSetting)
{
- wchar_t tstr[250+1];
+ wchar_t tstr[250 + 1];
GetDlgItemText(hwnd, idCtrl, tstr, _countof(tstr));
- if (tstr[0] != '\0') {
+ if (tstr[0] != '\0')
db_set_ws(0, ppro->m_szModuleName, szSetting, tstr);
- } else {
+ else
db_unset(0, ppro->m_szModuleName, szSetting);
- }
}
@@ -70,36 +61,31 @@ INT_PTR CALLBACK MinecraftDynmapAccountProc(HWND hwnd, UINT message, WPARAM wpar
{
MinecraftDynmapProto *proto;
- switch (message)
- {
-
+ switch (message) {
case WM_INITDIALOG:
TranslateDialogDefault(hwnd);
proto = reinterpret_cast<MinecraftDynmapProto*>(lparam);
- SetWindowLongPtr(hwnd,GWLP_USERDATA,lparam);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, lparam);
LoadDBText(proto, hwnd, IDC_SERVER, MINECRAFTDYNMAP_KEY_SERVER);
LoadDBText(proto, hwnd, IDC_NAME, MINECRAFTDYNMAP_KEY_NAME);
-
return TRUE;
case WM_COMMAND:
switch (LOWORD(wparam)) {
- case IDC_NAME: {
- if (HIWORD(wparam) != EN_CHANGE || (HWND)lparam != GetFocus()) {
- return TRUE;
- } else {
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- break;
- }
+ case IDC_NAME:
+ if (HIWORD(wparam) != EN_CHANGE || (HWND)lparam != GetFocus())
+ return TRUE;
+
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
}
break;
case WM_NOTIFY:
if (reinterpret_cast<NMHDR*>(lparam)->code == PSN_APPLY) {
- proto = reinterpret_cast<MinecraftDynmapProto*>(GetWindowLongPtr(hwnd,GWLP_USERDATA));
+ proto = reinterpret_cast<MinecraftDynmapProto*>(GetWindowLongPtr(hwnd, GWLP_USERDATA));
StoreDBText(proto, hwnd, IDC_SERVER, MINECRAFTDYNMAP_KEY_SERVER);
StoreDBText(proto, hwnd, IDC_NAME, MINECRAFTDYNMAP_KEY_NAME);
@@ -107,7 +93,6 @@ INT_PTR CALLBACK MinecraftDynmapAccountProc(HWND hwnd, UINT message, WPARAM wpar
return TRUE;
}
break;
-
}
return FALSE;
}
diff --git a/protocols/MinecraftDynmap/src/dialogs.h b/protocols/MinecraftDynmap/src/dialogs.h
index d80024c8cf..b7f2dd5be7 100644
--- a/protocols/MinecraftDynmap/src/dialogs.h
+++ b/protocols/MinecraftDynmap/src/dialogs.h
@@ -23,7 +23,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
void InitIcons(void);
-HANDLE GetIconHandle(const char *name);
INT_PTR CALLBACK MinecraftDynmapAccountProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
-INT_PTR CALLBACK MinecraftDynmapOptionsProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
diff --git a/protocols/Omegle/src/communication.cpp b/protocols/Omegle/src/communication.cpp
index 7741802cd4..a7b6c7960b 100644
--- a/protocols/Omegle/src/communication.cpp
+++ b/protocols/Omegle/src/communication.cpp
@@ -558,18 +558,14 @@ bool Omegle_client::events()
Skin_PlaySound("StrangerTyp");
ptrW who(name == "spyTyping" ? json_as_string(json_at(item, 1)) : mir_wstrdup(L"Stranger"));
- Srmm_SetStatusText(parent->GetChatHandle(),
- CMStringW(FORMAT, TranslateT("%s is typing."), TranslateW(who)),
- IcoLib_GetIconByHandle(GetIconHandle("typing_on")));
+ Srmm_SetStatusText(parent->GetChatHandle(), CMStringW(FORMAT, TranslateT("%s is typing."), TranslateW(who)), g_plugin.getIcon(IDI_TYPING_ON));
}
else if (name == "stoppedTyping" || name == "spyStoppedTyping") {
// Stranger stopped typing, not supported by chat module yet
Skin_PlaySound("StrangerTypStop");
ptrW who(name == "spyTyping" ? json_as_string(json_at(item, 1)) : mir_wstrdup(L"Stranger"));
- Srmm_SetStatusText(parent->GetChatHandle(),
- CMStringW(FORMAT, TranslateT("%s stopped typing."), TranslateW(who)),
- IcoLib_GetIconByHandle(GetIconHandle("typing_off")));
+ Srmm_SetStatusText(parent->GetChatHandle(), CMStringW(FORMAT, TranslateT("%s stopped typing."), TranslateW(who)), g_plugin.getIcon(IDI_TYPING_OFF));
}
else if (name == "gotMessage") {
Srmm_SetStatusText(parent->GetChatHandle(), nullptr);
diff --git a/protocols/Omegle/src/theme.cpp b/protocols/Omegle/src/theme.cpp
index 7473c69c3b..d76b4f6eb5 100644
--- a/protocols/Omegle/src/theme.cpp
+++ b/protocols/Omegle/src/theme.cpp
@@ -33,12 +33,3 @@ void InitIcons(void)
{
g_plugin.registerIcon("Protocols/Omegle", iconList, "Omegle");
}
-
-HANDLE GetIconHandle(const char* name)
-{
- for (auto &it : iconList)
- if (mir_strcmp(it.szName, name) == 0)
- return it.hIcolib;
-
- return nullptr;
-}
diff --git a/protocols/Omegle/src/theme.h b/protocols/Omegle/src/theme.h
index 9d3116e5eb..af39882941 100644
--- a/protocols/Omegle/src/theme.h
+++ b/protocols/Omegle/src/theme.h
@@ -23,4 +23,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
void InitIcons(void);
-HANDLE GetIconHandle(const char *name);
diff --git a/protocols/Sametime/src/conference.cpp b/protocols/Sametime/src/conference.cpp
index 19cfa0cc16..dcba8b5dd6 100644
--- a/protocols/Sametime/src/conference.cpp
+++ b/protocols/Sametime/src/conference.cpp
@@ -455,13 +455,13 @@ void CSametimeProto::InitConferenceMenu()
SET_UID(mi, 0x98cf8a8c, 0x75ba, 0x46f2, 0xa3, 0x35, 0x65, 0x46, 0x4a, 0x38, 0x20, 0x7d);
mi.name.w = LPGENW("Leave conference");
mi.pszService = MS_SAMETIME_MENULEAVECHAT;
- mi.hIcolibItem = GetIconHandle(IDI_ICON_LEAVE);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_ICON_LEAVE);
hLeaveChatMenuItem = Menu_AddContactMenuItem(&mi, m_szModuleName);
SET_UID(mi, 0x45501e10, 0x2914, 0x4daa, 0xb4, 0xcf, 0x83, 0x8a, 0x6a, 0x14, 0xd, 0x7);
mi.name.w = LPGENW("Start conference");
mi.pszService = MS_SAMETIME_MENUCREATECHAT;
- mi.hIcolibItem = GetIconHandle(IDI_ICON_INVITE);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_ICON_INVITE);
hCreateChatMenuItem = Menu_AddContactMenuItem(&mi, m_szModuleName);
HookProtoEvent(ME_CLIST_PREBUILDCONTACTMENU, &CSametimeProto::PrebuildContactMenu);
diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp
index ab7dce7818..189e877a66 100644
--- a/protocols/Sametime/src/sametime.cpp
+++ b/protocols/Sametime/src/sametime.cpp
@@ -86,28 +86,6 @@ void SametimeInitIcons(void)
g_plugin.registerIcon("Protocols/Sametime", iconList, "SAMETIME");
}
-HANDLE GetIconHandle(int iconId)
-{
- for (int i = 0; i < _countof(iconList); i++)
- if (iconList[i].defIconID == iconId)
- return iconList[i].hIcolib;
- return nullptr;
-}
-
-HICON LoadIconEx(const char* name, bool big)
-{
- char szSettingName[100];
- mir_snprintf(szSettingName, "%s_%s", "SAMETIME", name);
- return IcoLib_GetIcon(szSettingName, big);
-}
-
-void ReleaseIconEx(const char* name, bool big)
-{
- char szSettingName[100];
- mir_snprintf(szSettingName, "%s_%s", "SAMETIME", name);
- IcoLib_Release(szSettingName, big);
-}
-
// Copied from MSN plugin - sent acks need to be from different thread
void __cdecl sttFakeAckInfoSuccessThread(TFakeAckParams* tParam)
{
diff --git a/protocols/Sametime/src/sametime.h b/protocols/Sametime/src/sametime.h
index ca84829906..2714779be2 100644
--- a/protocols/Sametime/src/sametime.h
+++ b/protocols/Sametime/src/sametime.h
@@ -41,10 +41,6 @@ INT_PTR CALLBACK CALLBACK SearchDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam
void mwResolve_handler_callback(mwServiceResolve* srvc, guint32 id, guint32 code, GList* results, gpointer data);
void SametimeInitIcons(void);
-HANDLE GetIconHandle(int iconId);
-HICON LoadIconEx(const char* name, bool big);
-void ReleaseIconEx(const char* name, bool big);
-
// services (async thread functions)
struct TFakeAckParams
diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp
index 4634782034..79dfa47224 100644
--- a/protocols/Sametime/src/sametime_session.cpp
+++ b/protocols/Sametime/src/sametime_session.cpp
@@ -567,6 +567,6 @@ void CSametimeProto::InitSessionMenu()
mi.position = 2000060000;
mi.name.w = LPGENW("Send announcement...");
mi.pszService = MS_SAMETIME_MENUANNOUNCESESSION;
- mi.hIcolibItem = GetIconHandle(IDI_ICON_ANNOUNCE);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_ICON_ANNOUNCE);
Menu_AddContactMenuItem(&mi, m_szModuleName);
}
diff --git a/protocols/Sametime/src/utils.cpp b/protocols/Sametime/src/utils.cpp
index 368a9cc093..5644c72342 100644
--- a/protocols/Sametime/src/utils.cpp
+++ b/protocols/Sametime/src/utils.cpp
@@ -42,8 +42,8 @@ void CSametimeProto::RegisterPopups()
mir_snprintf(szName, "%s_%s", m_szModuleName, "Notify");
mir_snwprintf(szDescr, L"%s/%s", m_tszUserName, TranslateT("Notifications"));
- puc.hIcon = CopyIcon(LoadIconEx("notify", FALSE));
- ReleaseIconEx("notify", FALSE);
+ puc.hIcon = CopyIcon(g_plugin.getIcon(IDI_ICON_NOTIFY));
+ g_plugin.releaseIcon(IDI_ICON_NOTIFY);
puc.iSeconds = 8;
puc.colorBack = GetSysColor(COLOR_BTNFACE);
puc.colorText = GetSysColor(COLOR_WINDOWTEXT);
@@ -51,8 +51,8 @@ void CSametimeProto::RegisterPopups()
mir_snprintf(szName, "%s_%s", m_szModuleName, "Error");
mir_snwprintf(szDescr, L"%s/%s", m_tszUserName, TranslateT("Errors"));
- puc.hIcon = CopyIcon(LoadIconEx("error", FALSE));
- ReleaseIconEx("error", FALSE);
+ puc.hIcon = CopyIcon(g_plugin.getIcon(IDI_ICON_ERROR, FALSE));
+ g_plugin.releaseIcon(IDI_ICON_ERROR);
puc.iSeconds = 10;
puc.colorBack = GetSysColor(COLOR_BTNFACE);
puc.colorText = GetSysColor(COLOR_WINDOWTEXT);
diff --git a/protocols/SkypeWeb/src/skype_events.cpp b/protocols/SkypeWeb/src/skype_events.cpp
index f5124b96da..60e51ce522 100644
--- a/protocols/SkypeWeb/src/skype_events.cpp
+++ b/protocols/SkypeWeb/src/skype_events.cpp
@@ -130,11 +130,11 @@ INT_PTR CSkypeProto::EventGetIcon(WPARAM flags, LPARAM pEvent)
switch (dbei->eventType) {
case SKYPE_DB_EVENT_TYPE_CALL_INFO:
case SKYPE_DB_EVENT_TYPE_INCOMING_CALL:
- icon = GetIcon(IDI_CALL);
+ icon = g_plugin.getIcon(IDI_CALL);
break;
case SKYPE_DB_EVENT_TYPE_ACTION:
- icon = GetIcon(IDI_ACTION_ME);
+ icon = g_plugin.getIcon(IDI_ACTION_ME);
break;
case SKYPE_DB_EVENT_TYPE_FILETRANSFER_INFO:
diff --git a/protocols/SkypeWeb/src/skype_icons.cpp b/protocols/SkypeWeb/src/skype_icons.cpp
index 31024801f0..dcbeec6f64 100644
--- a/protocols/SkypeWeb/src/skype_icons.cpp
+++ b/protocols/SkypeWeb/src/skype_icons.cpp
@@ -34,19 +34,3 @@ void CSkypeProto::InitIcons()
{
g_plugin.registerIcon(LPGEN("Protocols") "/" MODULE, iconList, MODULE);
}
-
-HICON CSkypeProto::GetIcon(int iconId)
-{
- for (auto &it : iconList)
- if (it.defIconID == iconId)
- return IcoLib_GetIconByHandle(it.hIcolib);
- return nullptr;
-}
-
-HANDLE CSkypeProto::GetIconHandle(int iconId)
-{
- for (auto &it : iconList)
- if (it.defIconID == iconId)
- return it.hIcolib;
- return nullptr;
-}
diff --git a/protocols/SkypeWeb/src/skype_menus.cpp b/protocols/SkypeWeb/src/skype_menus.cpp
index 9f9a3975bc..04ad6194d4 100644
--- a/protocols/SkypeWeb/src/skype_menus.cpp
+++ b/protocols/SkypeWeb/src/skype_menus.cpp
@@ -64,7 +64,7 @@ void CSkypeProto::InitMenus()
mi.pszService = MODULE"/GetHistory";
mi.name.w = LPGENW("Get server history");
mi.position = CMI_POSITION + CMI_GETSERVERHISTORY;
- mi.hIcolibItem = GetIconHandle(IDI_SYNCHISTORY);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_SYNCHISTORY);
SET_UID(mi, 0xc9a64e98, 0x9257, 0x4b52, 0x98, 0xdd, 0x7f, 0x56, 0xb3, 0x90, 0xe3, 0xde);
ContactMenuItems[CMI_GETSERVERHISTORY] = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::GetContactHistory>);
@@ -72,7 +72,7 @@ void CSkypeProto::InitMenus()
mi.pszService = MODULE"/BlockContact";
mi.name.w = LPGENW("Block contact");
mi.position = CMI_POSITION + CMI_BLOCK;
- mi.hIcolibItem = GetIconHandle(IDI_BLOCKUSER);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_BLOCKUSER);
SET_UID(mi, 0xc6169b8f, 0x53ab, 0x4242, 0xbe, 0x90, 0xe2, 0x4a, 0xa5, 0x73, 0x88, 0x32);
ContactMenuItems[CMI_BLOCK] = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::BlockContact>);
@@ -80,7 +80,7 @@ void CSkypeProto::InitMenus()
mi.pszService = MODULE"/UnblockContact";
mi.name.w = LPGENW("Unblock contact");
mi.position = CMI_POSITION + CMI_UNBLOCK;
- mi.hIcolibItem = GetIconHandle(IDI_UNBLOCKUSER);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_UNBLOCKUSER);
SET_UID(mi, 0x88542f43, 0x7448, 0x48d0, 0x81, 0xa3, 0x26, 0x0, 0x4f, 0x37, 0xee, 0xe0);
ContactMenuItems[CMI_UNBLOCK] = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::UnblockContact>);
@@ -95,6 +95,6 @@ void CSkypeProto::OnBuildProtoMenu()
CreateProtoService(mi.pszService, &CSkypeProto::SvcCreateChat);
mi.name.a = LPGEN("Create new chat");
mi.position = SMI_POSITION + SMI_CREATECHAT;
- mi.hIcolibItem = GetIconHandle(IDI_CONFERENCE);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_CONFERENCE);
Menu_AddProtoMenuItem(&mi, m_szModuleName);
}
diff --git a/protocols/SkypeWeb/src/skype_popups.cpp b/protocols/SkypeWeb/src/skype_popups.cpp
index f279a936b5..e147cd3936 100644
--- a/protocols/SkypeWeb/src/skype_popups.cpp
+++ b/protocols/SkypeWeb/src/skype_popups.cpp
@@ -12,7 +12,7 @@ void CSkypeProto::InitPopups()
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Notifications"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Notification");
- ppc.hIcon = GetIcon(IDI_NOTIFY);
+ ppc.hIcon = g_plugin.getIcon(IDI_NOTIFY);
ppc.colorBack = RGB(255, 255, 255);
ppc.colorText = RGB(0, 0, 0);
ppc.iSeconds = 5;
@@ -20,7 +20,7 @@ void CSkypeProto::InitPopups()
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Errors"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Error");
- ppc.hIcon = GetIcon(IDI_ERRORICON);
+ ppc.hIcon = g_plugin.getIcon(IDI_ERRORICON);
ppc.colorBack = RGB(255, 255, 255);
ppc.colorText = RGB(0, 0, 0);
ppc.iSeconds = -1;
@@ -28,7 +28,7 @@ void CSkypeProto::InitPopups()
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Calls"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Call");
- ppc.hIcon = GetIcon(IDI_CALL);
+ ppc.hIcon = g_plugin.getIcon(IDI_CALL);
ppc.colorBack = RGB(255, 255, 255);
ppc.colorText = RGB(0, 0, 0);
ppc.iSeconds = 30;
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h
index 7a15904c76..1414d38855 100644
--- a/protocols/SkypeWeb/src/skype_proto.h
+++ b/protocols/SkypeWeb/src/skype_proto.h
@@ -195,10 +195,6 @@ private:
requestQueue->Send(request, SkypeHttpResponse, delegate);
}
- // icons
- static HICON GetIcon(int iconId);
- static HANDLE GetIconHandle(int iconId);
-
// menus
static HGENMENU ContactMenuItems[CMI_MAX];
int OnPrebuildContactMenu(WPARAM hContact, LPARAM);
diff --git a/protocols/SkypeWeb/src/skype_trouter.cpp b/protocols/SkypeWeb/src/skype_trouter.cpp
index b88dbe1c5d..1207beec23 100644
--- a/protocols/SkypeWeb/src/skype_trouter.cpp
+++ b/protocols/SkypeWeb/src/skype_trouter.cpp
@@ -194,7 +194,7 @@ void CSkypeProto::OnTrouterEvent(const JSONNode &body, const JSONNode &)
cle.hContact = hContact;
cle.hDbEvent = hEvent;
cle.lParam = SKYPE_DB_EVENT_TYPE_INCOMING_CALL;
- cle.hIcon = GetIcon(IDI_CALL);
+ cle.hIcon = g_plugin.getIcon(IDI_CALL);
CMStringA service(FORMAT, "%s/IncomingCallCLE", GetContactProto(hContact));
cle.pszService = service.GetBuffer();
diff --git a/protocols/Tox/src/tox_icons.cpp b/protocols/Tox/src/tox_icons.cpp
index 83c8f10f2b..50d11f5303 100644
--- a/protocols/Tox/src/tox_icons.cpp
+++ b/protocols/Tox/src/tox_icons.cpp
@@ -11,19 +11,3 @@ void CToxProto::InitIcons()
{
g_plugin.registerIcon(LPGEN("Protocols") "/" MODULE, iconList, MODULE);
}
-
-HANDLE CToxProto::GetIconHandle(int iconId)
-{
- for (auto &it : iconList)
- if (it.defIconID == iconId)
- return it.hIcolib;
- return nullptr;
-}
-
-HICON CToxProto::GetIcon(int iconId)
-{
- for (auto &it : iconList)
- if (it.defIconID == iconId)
- return IcoLib_GetIconByHandle(it.hIcolib);
- return nullptr;
-}
diff --git a/protocols/Tox/src/tox_messages.cpp b/protocols/Tox/src/tox_messages.cpp
index ef75bfaf38..cd327a7146 100644
--- a/protocols/Tox/src/tox_messages.cpp
+++ b/protocols/Tox/src/tox_messages.cpp
@@ -18,7 +18,7 @@ INT_PTR CToxProto::EventGetIcon(WPARAM wParam, LPARAM lParam)
switch (dbei->eventType) {
case DB_EVENT_ACTION:
- icon = GetIcon(IDI_ME);
+ icon = g_plugin.getIcon(IDI_ME);
break;
default:
diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h
index bcd95434c0..62ecf196e8 100644
--- a/protocols/Tox/src/tox_proto.h
+++ b/protocols/Tox/src/tox_proto.h
@@ -122,10 +122,6 @@ private:
// netlib
void InitNetlib();
- // icons
- static HANDLE GetIconHandle(int iconId);
- static HICON GetIcon(int iconId);
-
// menus
static HGENMENU ContactMenuItems[CMI_MAX];
int __cdecl OnPrebuildContactMenu(WPARAM hContact, LPARAM);