From cb4d31922f0690f5a3c79526245c963bfd118864 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 18 May 2018 21:56:03 +0300 Subject: Icon_Register(g_plugin.getInst() => g_plugin.registerIcon Icon_RegisterT(g_plugin.getInst() => g_plugin.registerIconW --- include/m_core.h | 5 --- include/newpluginapi.h | 12 +++++++ plugins/AddContactPlus/src/main.cpp | 11 +++--- plugins/Alarms/src/icons.cpp | 2 +- plugins/AuthState/src/main.cpp | 2 +- plugins/AutoShutdown/src/main.cpp | 2 +- plugins/AvatarHistory/src/icolib.cpp | 8 ++--- plugins/BASS_interface/src/Main.cpp | 2 +- plugins/BasicHistory/src/BasicHistory.cpp | 2 +- plugins/BossKeyPlus/src/BossKey.cpp | 2 +- plugins/BuddyExpectator/src/BuddyExpectator.cpp | 2 +- plugins/ChangeKeyboardLayout/src/main.cpp | 2 +- plugins/Clist_modern/src/modern_clistmenus.cpp | 2 +- plugins/Clist_modern/src/modern_clui.cpp | 10 +++--- plugins/Clist_nicer/src/clistmenus.cpp | 2 +- plugins/Clist_nicer/src/clui.cpp | 10 +++--- plugins/Clist_nicer/src/groupmenu.cpp | 7 ++-- plugins/CloudFile/src/icons.cpp | 2 +- plugins/Console/src/init.cpp | 2 +- plugins/CrashDumper/src/crshdmp_icons.cpp | 2 +- plugins/Db3x_mmap/src/ui.cpp | 2 +- plugins/DbEditorPP/src/icons.cpp | 2 +- plugins/Db_autobackups/src/main.cpp | 2 +- plugins/Dbx_mdbx/src/ui.cpp | 2 +- plugins/FTPFileYM/src/ftpfile.cpp | 2 +- plugins/FavContacts/src/main.cpp | 2 +- plugins/FileAsMessage/src/main.cpp | 2 +- plugins/FloatingContacts/src/main.cpp | 2 +- plugins/HistorySweeperLight/src/options.cpp | 2 +- plugins/IEView/src/ieview_main.cpp | 2 +- plugins/IgnoreState/src/main.cpp | 2 +- plugins/Import/src/utils.cpp | 2 +- plugins/ListeningTo/src/listeningto.cpp | 2 +- plugins/MenuItemEx/src/main.cpp | 4 +-- plugins/MessageState/src/messagestate.cpp | 2 +- plugins/MirLua/src/mlua_icons.cpp | 2 +- plugins/MirOTR/src/icons.cpp | 2 +- plugins/MobileState/src/main.cpp | 7 ++-- plugins/MyDetails/src/mydetails.cpp | 5 +-- plugins/NewAwaySysMod/src/AwaySys.cpp | 2 +- plugins/NewXstatusNotify/src/main.cpp | 2 +- plugins/New_GPG/src/icons.cpp | 2 +- plugins/NewsAggregator/Src/Icons.cpp | 2 +- plugins/NoHistory/src/icons.cpp | 2 +- plugins/Non-IM Contact/src/main.cpp | 6 ++-- plugins/Non-IM Contact/src/services.cpp | 4 +-- plugins/Non-IM Contact/src/stdafx.h | 2 +- plugins/NotesAndReminders/src/main.cpp | 2 +- plugins/Nudge/src/main.cpp | 2 +- plugins/OpenFolder/src/openFolder.cpp | 11 +++--- plugins/PackUpdater/Src/Utils.cpp | 2 +- plugins/PasteIt/src/PasteIt.cpp | 11 +++--- plugins/Ping/src/ping.cpp | 2 +- plugins/PluginUpdater/src/Utils.cpp | 10 +++--- plugins/PluginUpdater/src/stdafx.h | 2 +- plugins/Popup/src/icons.cpp | 40 +++++++++++++++++----- plugins/ProfileManager/src/pmanagerEx.cpp | 2 +- plugins/QuickReplies/src/events.cpp | 9 +++-- plugins/Quotes/src/IconLib.cpp | 2 +- plugins/Rate/src/main.cpp | 2 +- plugins/RecentContacts/src/RecentContacts.cpp | 13 ++++--- plugins/Restart/src/restart.cpp | 9 +++-- plugins/Scriver/src/globals.cpp | 30 +++++++++++----- plugins/SendScreenshotPlus/src/Main.cpp | 4 +-- plugins/Sessions/Src/Main.cpp | 2 +- plugins/SimpleAR/src/Main.cpp | 9 +++-- plugins/SimpleAR/src/stdafx.h | 2 +- plugins/SimpleStatusMsg/src/utils.cpp | 2 +- plugins/SmileyAdd/src/main.cpp | 9 +++-- plugins/SpellChecker/src/spellchecker.cpp | 2 +- plugins/StartupSilence/src/main.cpp | 4 +-- .../src/StartupStatus/ss_toolbars.cpp | 2 +- plugins/TabSRMM/src/chat_options.cpp | 8 ++--- plugins/TipperYM/src/tipper.cpp | 2 +- plugins/TopToolBar/src/main.cpp | 2 +- plugins/TranslitSwitcher/src/TranslitSwitcher.cpp | 2 +- plugins/UserInfoEx/src/mir_icolib.cpp | 2 +- plugins/Variables/src/variables.cpp | 7 ++-- plugins/Weather/src/weather_icons.cpp | 2 +- plugins/YAMN/src/main.cpp | 2 +- plugins/YAPP/src/icons.cpp | 11 +++--- protocols/Discord/src/main.cpp | 2 +- protocols/FacebookRM/src/theme.cpp | 2 +- protocols/Gadu-Gadu/src/icolib.cpp | 2 +- protocols/IRCG/src/options.cpp | 2 +- protocols/IcqOscarJ/src/init.cpp | 2 +- protocols/JabberG/src/jabber_icolib.cpp | 8 ++--- protocols/MRA/src/MraIcons.cpp | 8 ++--- protocols/MSN/src/msn_opts.cpp | 2 +- protocols/MinecraftDynmap/src/dialogs.cpp | 10 +++--- protocols/Omegle/src/theme.cpp | 10 +++--- protocols/Sametime/src/sametime.cpp | 2 +- protocols/SkypeWeb/src/skype_icons.cpp | 28 +++++++-------- protocols/SkypeWeb/src/skype_proto.h | 1 - protocols/Tox/src/tox_icons.cpp | 14 ++++---- protocols/Tox/src/tox_proto.h | 1 - protocols/Twitter/src/theme.cpp | 8 ++--- protocols/VKontakte/src/misc.cpp | 2 +- src/core/stdmsg/src/chat_options.cpp | 11 +++--- src/core/stdmsg/src/globals.cpp | 2 +- src/mir_app/src/ei_services.cpp | 2 +- src/mir_app/src/meta_main.cpp | 2 +- 102 files changed, 285 insertions(+), 218 deletions(-) diff --git a/include/m_core.h b/include/m_core.h index 7f01dab6a2..83771c6120 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -172,13 +172,8 @@ typedef struct tagIconItemT } IconItemT; -#if defined( __cplusplus ) -MIR_CORE_DLL(void) Icon_Register(HINSTANCE hInst, const char* szSection, IconItem* pIcons, size_t iCount, const char *prefix = nullptr, int = hLangpack); -MIR_CORE_DLL(void) Icon_RegisterT(HINSTANCE hInst, const wchar_t* szSection, IconItemT* pIcons, size_t iCount, const char *prefix = nullptr, int = hLangpack); -#else MIR_CORE_DLL(void) Icon_Register(HINSTANCE hInst, const char* szSection, IconItem* pIcons, size_t iCount, const char *prefix, int hLangpack); MIR_CORE_DLL(void) Icon_RegisterT(HINSTANCE hInst, const wchar_t* szSection, IconItemT* pIcons, size_t iCount, const char *prefix, int hLangpack); -#endif /////////////////////////////////////////////////////////////////////////////// // language packs support diff --git a/include/newpluginapi.h b/include/newpluginapi.h index b85f489505..859c4e60d0 100644 --- a/include/newpluginapi.h +++ b/include/newpluginapi.h @@ -177,6 +177,18 @@ public: __forceinline HINSTANCE getInst() const { return m_hInst; } __forceinline void setInst(HINSTANCE hInst) { m_hInst = hInst; } + template + __forceinline void registerIcon(const char *szSection, IconItem(&pIcons)[_Size], const char *prefix = nullptr) + { + Icon_Register(m_hInst, szSection, pIcons, _Size, prefix, m_hLang); + } + + template + __forceinline void registerIconW(const wchar_t *szSection, IconItemT(&pIcons)[_Size], const char *prefix = nullptr) + { + Icon_RegisterT(m_hInst, szSection, pIcons, _Size, prefix, m_hLang); + } + __forceinline INT_PTR delSetting(const char *name) { return db_unset(0, m_szModuleName, name); diff --git a/plugins/AddContactPlus/src/main.cpp b/plugins/AddContactPlus/src/main.cpp index fd83d2fd7c..7c26887820 100644 --- a/plugins/AddContactPlus/src/main.cpp +++ b/plugins/AddContactPlus/src/main.cpp @@ -29,7 +29,10 @@ static HANDLE hToolBarItem = nullptr; static HGENMENU hMainMenuItem = nullptr; HWND hAddDlg; -static IconItem icon = { LPGEN("Add contact"), ICON_ADD, IDI_ADDCONTACT }; +static IconItem icon[] = +{ + { LPGEN("Add contact"), ICON_ADD, IDI_ADDCONTACT } +}; ///////////////////////////////////////////////////////////////////////////////////////// @@ -85,7 +88,7 @@ static int OnAccListChanged(WPARAM, LPARAM) SET_UID(mi, 0xb19db907, 0x870e, 0x49fa, 0xa7, 0x1e, 0x43, 0x5e, 0xa8, 0xe5, 0x9b, 0xbd); mi.position = 500020001; mi.flags = CMIF_UNICODE; - mi.hIcolibItem = icon.hIcolib; + mi.hIcolibItem = icon[0].hIcolib; mi.name.w = LPGENW("&Add contact..."); mi.pszService = MS_ADDCONTACTPLUS_SHOW; hMainMenuItem = Menu_AddMainMenuItem(&mi); @@ -108,7 +111,7 @@ static int CreateButton(WPARAM, LPARAM) tbb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP; tbb.pszService = MS_ADDCONTACTPLUS_SHOW; tbb.name = tbb.pszTooltipUp = LPGEN("Add contact"); - tbb.hIconHandleUp = icon.hIcolib; + tbb.hIconHandleUp = icon[0].hIcolib; hToolBarItem = TopToolbar_AddButton(&tbb); return 0; } @@ -138,7 +141,7 @@ extern "C" int __declspec(dllexport) Load(void) INITCOMMONCONTROLSEX icex = { sizeof(icex), ICC_USEREX_CLASSES }; InitCommonControlsEx(&icex); - Icon_Register(g_plugin.getInst(), LPGEN("AddContact+"), &icon, 1); + g_plugin.registerIcon(LPGEN("AddContact+"), icon); HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); HookEvent(ME_PROTO_ACCLISTCHANGED, OnAccListChanged); diff --git a/plugins/Alarms/src/icons.cpp b/plugins/Alarms/src/icons.cpp index 77d0e53e52..f85b12a5f1 100644 --- a/plugins/Alarms/src/icons.cpp +++ b/plugins/Alarms/src/icons.cpp @@ -25,7 +25,7 @@ int ReloadIcons(WPARAM, LPARAM) void InitIcons() { - Icon_Register(g_plugin.getInst(), "Alarms", iconList, _countof(iconList)); + g_plugin.registerIcon("Alarms", iconList); if (!ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) hIconMenuShowHide = IcoLib_GetIcon("alarms_menu_showhide"); diff --git a/plugins/AuthState/src/main.cpp b/plugins/AuthState/src/main.cpp index abfdbbfb3f..9686fc4a4f 100644 --- a/plugins/AuthState/src/main.cpp +++ b/plugins/AuthState/src/main.cpp @@ -179,7 +179,7 @@ extern "C" int __declspec(dllexport) Load(void) hUserMenu = Menu_AddContactMenuItem(&mi); // IcoLib support - Icon_Register(g_plugin.getInst(), LPGEN("Auth state"), iconList, _countof(iconList)); + g_plugin.registerIcon(LPGEN("Auth state"), iconList); return 0; } diff --git a/plugins/AutoShutdown/src/main.cpp b/plugins/AutoShutdown/src/main.cpp index 77668f5284..dfeeb8df16 100644 --- a/plugins/AutoShutdown/src/main.cpp +++ b/plugins/AutoShutdown/src/main.cpp @@ -71,7 +71,7 @@ extern "C" __declspec(dllexport) int Load(void) if (InitFrame()) return 1; /* before icons */ /* shared */ - Icon_Register(g_plugin.getInst(), "Automatic Shutdown", iconList, _countof(iconList)); + g_plugin.registerIcon("Automatic Shutdown", iconList); InitShutdownSvc(); InitWatcher(); /* before InitSettingsDlg() */ diff --git a/plugins/AvatarHistory/src/icolib.cpp b/plugins/AvatarHistory/src/icolib.cpp index 665cb0d867..c7acb20385 100644 --- a/plugins/AvatarHistory/src/icolib.cpp +++ b/plugins/AvatarHistory/src/icolib.cpp @@ -2,13 +2,11 @@ enum IconIndex { - I_HISTORY, I_OVERLAY }; static IconItem iconList[] = { - { LPGEN("History"), "", IDI_AVATARHIST }, { LPGEN("Avatar overlay"), "avh_overlay", IDI_AVATAROVERLAY } }; @@ -37,8 +35,8 @@ int IcoLibIconsChanged(WPARAM, LPARAM) void SetupIcoLib() { - iconList[0].hIcolib = Skin_GetIconHandle(SKINICON_OTHER_HISTORY); - Icon_Register(g_plugin.getInst(), LPGEN("Avatar history"), iconList + 1, _countof(iconList) - 1); + g_plugin.registerIcon(LPGEN("Avatar history"), iconList); + IcoLibUpdateMenus(); } @@ -60,7 +58,7 @@ static HICON getOverlayedIcon(HICON icon, HICON overlay, BOOL big) HICON createDefaultOverlayedIcon(BOOL) { - HICON icon0 = LoadIconEx(I_HISTORY); + HICON icon0 = Skin_LoadIcon(SKINICON_OTHER_HISTORY); HICON icon1 = LoadIconEx(I_OVERLAY); HICON resIcon = getOverlayedIcon(icon0, icon1, FALSE); diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index 87641b5d50..889f9ba55f 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -597,7 +597,7 @@ extern "C" int __declspec(dllexport) Load(void) HookEvent(ME_SYSTEM_SHUTDOWN, OnShutdown); HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnSettingChanged); - Icon_Register(g_plugin.getInst(), ModuleName, iconList, _countof(iconList)); + g_plugin.registerIcon(ModuleName, iconList); return 0; } diff --git a/plugins/BasicHistory/src/BasicHistory.cpp b/plugins/BasicHistory/src/BasicHistory.cpp index e9fb0ff265..5f10890c00 100644 --- a/plugins/BasicHistory/src/BasicHistory.cpp +++ b/plugins/BasicHistory/src/BasicHistory.cpp @@ -251,7 +251,7 @@ extern "C" int __declspec(dllexport) Load(void) HistoryEventList::Init(); - Icon_Register(g_plugin.getInst(), LPGEN("History"), iconList, _countof(iconList)); + g_plugin.registerIcon(LPGEN("History"), iconList); return 0; } diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index 5e6642d5a6..ac96a8c0a8 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -698,7 +698,7 @@ extern "C" int __declspec(dllexport) Load(void) db_set_b(NULL, "Popup", "ModuleIsEnabled", 0); } - Icon_Register(g_plugin.getInst(), "BossKey", iconList, _countof(iconList)); + g_plugin.registerIcon("BossKey", iconList); CreateServiceFunction(MS_BOSSKEY_HIDE, BossKeyHideMiranda); // Create service diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index 81149fcc64..db853ebe9e 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -673,7 +673,7 @@ extern "C" int __declspec(dllexport) Load(void) db_set_dw(hContact, MODULE_NAME, "CreationTime", current_time); } - Icon_Register(g_plugin.getInst(), "BuddyExpectator", iconList, _countof(iconList)); + g_plugin.registerIcon("BuddyExpectator", iconList); HookEvent(ME_SKIN2_ICONSCHANGED, onIconsChanged); diff --git a/plugins/ChangeKeyboardLayout/src/main.cpp b/plugins/ChangeKeyboardLayout/src/main.cpp index 8a2e6a0cbd..d3da1e1fb4 100644 --- a/plugins/ChangeKeyboardLayout/src/main.cpp +++ b/plugins/ChangeKeyboardLayout/src/main.cpp @@ -54,7 +54,7 @@ extern "C" __declspec(dllexport) int Load(void) HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded); // IcoLib support - Icon_Register(g_plugin.getInst(), ModuleName, iconList, _countof(iconList)); + g_plugin.registerIcon(ModuleName, iconList); HookEvent(ME_SKIN2_ICONSCHANGED, OnIconsChanged); diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp index 8811d0b01c..0ba0175fe0 100644 --- a/plugins/Clist_modern/src/modern_clistmenus.cpp +++ b/plugins/Clist_modern/src/modern_clistmenus.cpp @@ -145,7 +145,7 @@ int InitCustomMenus(void) { CreateServiceFunction("CloseAction", CloseAction); - Icon_Register(g_plugin.getInst(), LPGEN("Contact list"), iconList, _countof(iconList)); + g_plugin.registerIcon(LPGEN("Contact list"), iconList); CreateServiceFunction(CLUI_FAVSETRATE, FAV_SetRate); CreateServiceFunction(CLUI_FAVTOGGLESHOWOFFLINE, FAV_ToggleShowOffline); diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 19c70de31d..08e19d6521 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -315,17 +315,17 @@ HRESULT CLUI::LoadDllsRuntime() return S_OK; } -static IconItemT iconItem[] = { - { LPGENW("Show avatar"), "ShowAvatar", IDI_SHOW_AVATAR }, - { LPGENW("Hide avatar"), "HideAvatar", IDI_HIDE_AVATAR } +static IconItem iconItem[] = +{ + { LPGEN("Show avatar"), "ShowAvatar", IDI_SHOW_AVATAR }, + { LPGEN("Hide avatar"), "HideAvatar", IDI_HIDE_AVATAR } }; HRESULT CLUI::RegisterAvatarMenu() { - Icon_RegisterT(g_plugin.getInst(), LPGENW("Contact list"), iconItem, _countof(iconItem)); + g_plugin.registerIcon(LPGEN("Contact list"), iconItem); CMenuItem mi; - SET_UID(mi, 0x1cc99858, 0x40ca, 0x4558, 0xae, 0x10, 0xba, 0x81, 0xaf, 0x4c, 0x67, 0xb5); CreateServiceFunction("CList/ShowContactAvatar", CLUI::Service_Menu_ShowContactAvatar); mi.position = 2000150000; diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp index 402b74f25f..516315d7a9 100644 --- a/plugins/Clist_nicer/src/clistmenus.cpp +++ b/plugins/Clist_nicer/src/clistmenus.cpp @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma hdrstop -extern IconItemT iconItem[]; +extern IconItem iconItem[]; void InitIconLibMenuIcons(); INT_PTR CloseAction(WPARAM, LPARAM) diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index b2738f54d7..fbcb46ddc0 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -250,13 +250,13 @@ static void CacheClientIcons() static void InitIcoLib() { - Icon_Register(g_plugin.getInst(), LPGEN("Contact list") "/" LPGEN("Default"), myIcons, _countof(myIcons)); + g_plugin.registerIcon(LPGEN("Contact list") "/" LPGEN("Default"), myIcons); for (int i = IDI_OVL_OFFLINE; i <= IDI_OVL_OUTTOLUNCH; i++) { char szBuffer[128]; mir_snprintf(szBuffer, "cln_ovl_%d", ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE)); - IconItemT icon = { Clist_GetStatusModeDescription(ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE), 0), szBuffer, i }; - Icon_RegisterT(g_plugin.getInst(), LPGENW("Contact list") L"/" LPGENW("Overlay icons"), &icon, 1); + IconItemT icon[] = { { Clist_GetStatusModeDescription(ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE), 0), szBuffer, i } }; + g_plugin.registerIconW(LPGENW("Contact list") L"/" LPGENW("Overlay icons"), icon); } for (auto &pa : Accounts()) { @@ -265,8 +265,8 @@ static void InitIcoLib() wchar_t szDescr[128]; mir_snwprintf(szDescr, TranslateT("%s connecting"), pa->tszAccountName); - IconItemT icon = { szDescr, "conn", IDI_PROTOCONNECTING }; - Icon_RegisterT(g_plugin.getInst(), LPGENW("Contact list") L"/" LPGENW("Connecting icons"), &icon, 1, pa->szModuleName); + IconItemT icon[] = { { szDescr, "conn", IDI_PROTOCONNECTING } }; + g_plugin.registerIconW(LPGENW("Contact list") L"/" LPGENW("Connecting icons"), icon, pa->szModuleName); } } diff --git a/plugins/Clist_nicer/src/groupmenu.cpp b/plugins/Clist_nicer/src/groupmenu.cpp index fc2d244653..2d9c4fb495 100644 --- a/plugins/Clist_nicer/src/groupmenu.cpp +++ b/plugins/Clist_nicer/src/groupmenu.cpp @@ -79,13 +79,14 @@ static int OnBuildGroupMenu(WPARAM, LPARAM) return 0; } -IconItemT iconItem[] = { - { LPGENW("Contact list"), "clist", IDI_CLIST } +IconItem iconItem[] = +{ + { LPGEN("Contact list"), "clist", IDI_CLIST } }; void InitIconLibMenuIcons(void) { - Icon_RegisterT(g_plugin.getInst(), LPGENW("Contact list"), iconItem, _countof(iconItem)); + g_plugin.registerIcon(LPGEN("Contact list"), iconItem); } void InitGroupMenus(void) diff --git a/plugins/CloudFile/src/icons.cpp b/plugins/CloudFile/src/icons.cpp index 7f012e1815..10ec5cba9f 100644 --- a/plugins/CloudFile/src/icons.cpp +++ b/plugins/CloudFile/src/icons.cpp @@ -11,7 +11,7 @@ static IconItem iconList[] = void InitializeIcons() { - Icon_Register(g_plugin.getInst(), "Protocols/" MODULE, iconList, _countof(iconList), MODULE); + g_plugin.registerIcon("Protocols/" MODULE, iconList, MODULE); } HANDLE GetIconHandle(int iconId) diff --git a/plugins/Console/src/init.cpp b/plugins/Console/src/init.cpp index 063b72992f..6737e5a506 100644 --- a/plugins/Console/src/init.cpp +++ b/plugins/Console/src/init.cpp @@ -64,7 +64,7 @@ extern "C" __declspec(dllexport) int Load(void) { mir_getLP(&pluginInfoEx); - Icon_Register(g_plugin.getInst(), "Console", iconList, _countof(iconList)); + g_plugin.registerIcon("Console", iconList); InitCommonControls(); InitConsole(); diff --git a/plugins/CrashDumper/src/crshdmp_icons.cpp b/plugins/CrashDumper/src/crshdmp_icons.cpp index eec6791409..ae97c49528 100644 --- a/plugins/CrashDumper/src/crshdmp_icons.cpp +++ b/plugins/CrashDumper/src/crshdmp_icons.cpp @@ -30,7 +30,7 @@ static IconItem iconList[] = void InitIcons(void) { - Icon_Register(g_plugin.getInst(), LPGEN("Crash Dumper"), iconList, _countof(iconList), PluginName); + g_plugin.registerIcon(LPGEN("Crash Dumper"), iconList, PluginName); } HICON LoadIconEx(int iconId, bool big) diff --git a/plugins/Db3x_mmap/src/ui.cpp b/plugins/Db3x_mmap/src/ui.cpp index 9a5583e778..d0a328e39b 100644 --- a/plugins/Db3x_mmap/src/ui.cpp +++ b/plugins/Db3x_mmap/src/ui.cpp @@ -325,7 +325,7 @@ static int OnModulesLoaded(PVOID obj, WPARAM, LPARAM) { CDb3Mmap *db = (CDb3Mmap*)obj; - Icon_Register(g_plugin.getInst(), LPGEN("Database"), iconList, _countof(iconList), "mmap"); + g_plugin.registerIcon(LPGEN("Database"), iconList, "mmap"); HookEventObj(ME_OPT_INITIALISE, OnOptionsInit, db); diff --git a/plugins/DbEditorPP/src/icons.cpp b/plugins/DbEditorPP/src/icons.cpp index 7d5a0ec0bf..33e660743d 100644 --- a/plugins/DbEditorPP/src/icons.cpp +++ b/plugins/DbEditorPP/src/icons.cpp @@ -50,7 +50,7 @@ HANDLE GetIcoLibHandle(int icon) void IcoLibRegister(void) { - Icon_Register(g_plugin.getInst(), modFullname, iconList, _countof(iconList)); + g_plugin.registerIcon(modFullname, iconList); } HICON LoadSkinnedDBEIcon(int icon) diff --git a/plugins/Db_autobackups/src/main.cpp b/plugins/Db_autobackups/src/main.cpp index 4131c547a0..2a58bc7140 100644 --- a/plugins/Db_autobackups/src/main.cpp +++ b/plugins/Db_autobackups/src/main.cpp @@ -117,7 +117,7 @@ extern "C" __declspec(dllexport) int Load(void) HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown); HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoad); - Icon_Register(g_plugin.getInst(), LPGEN("Database") "/" LPGEN("Database backups"), iconList, _countof(iconList)); + g_plugin.registerIcon(LPGEN("Database") "/" LPGEN("Database backups"), iconList); CreateServiceFunction(MS_AB_BACKUP, ABService); CreateServiceFunction(MS_AB_SAVEAS, DBSaveAs); diff --git a/plugins/Dbx_mdbx/src/ui.cpp b/plugins/Dbx_mdbx/src/ui.cpp index a7d9566dca..3a24d00c63 100644 --- a/plugins/Dbx_mdbx/src/ui.cpp +++ b/plugins/Dbx_mdbx/src/ui.cpp @@ -182,7 +182,7 @@ static int OnModulesLoaded(PVOID obj, WPARAM, LPARAM) { CDbxMDBX *db = (CDbxMDBX*)obj; - Icon_Register(g_plugin.getInst(), LPGEN("Database"), iconList, _countof(iconList), "mdbx"); + g_plugin.registerIcon(LPGEN("Database"), iconList, "mdbx"); HookEventObj(ME_OPT_INITIALISE, OnOptionsInit, db); diff --git a/plugins/FTPFileYM/src/ftpfile.cpp b/plugins/FTPFileYM/src/ftpfile.cpp index fddf343b26..9324f618ad 100644 --- a/plugins/FTPFileYM/src/ftpfile.cpp +++ b/plugins/FTPFileYM/src/ftpfile.cpp @@ -75,7 +75,7 @@ static IconItem iconList[] = static void InitIcolib() { - Icon_Register(g_plugin.getInst(), LPGEN("FTP File"), iconList, _countof(iconList), MODULE); + g_plugin.registerIcon(LPGEN("FTP File"), iconList, MODULE); } void InitMenuItems() diff --git a/plugins/FavContacts/src/main.cpp b/plugins/FavContacts/src/main.cpp index 2ec9db00a2..bc75a82c0a 100644 --- a/plugins/FavContacts/src/main.cpp +++ b/plugins/FavContacts/src/main.cpp @@ -67,7 +67,7 @@ extern "C" __declspec(dllexport) int Load(void) ///////////////////////////////////////////////////////////////////////////////////// - Icon_Register(g_plugin.getInst(), LPGEN("Favorites"), iconList, _countof(iconList)); + g_plugin.registerIcon(LPGEN("Favorites"), iconList); LoadHttpApi(); return 0; diff --git a/plugins/FileAsMessage/src/main.cpp b/plugins/FileAsMessage/src/main.cpp index 7db2f16fda..f02052c03c 100644 --- a/plugins/FileAsMessage/src/main.cpp +++ b/plugins/FileAsMessage/src/main.cpp @@ -194,7 +194,7 @@ extern "C" __declspec(dllexport) int Load(void) InitCRC32(); - Icon_Register(g_plugin.getInst(), "fileAsMessage", iconList, _countof(iconList)); + g_plugin.registerIcon("fileAsMessage", iconList); hFileList = WindowList_Create(); diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp index a230d42dbf..394eec15ef 100644 --- a/plugins/FloatingContacts/src/main.cpp +++ b/plugins/FloatingContacts/src/main.cpp @@ -905,7 +905,7 @@ extern "C" int __declspec(dllexport) Load() mir_getLP(&pluginInfoEx); pcli = Clist_GetInterface(); - Icon_RegisterT(g_plugin.getInst(), _A2W(MODULE), g_iconList, _countof(g_iconList)); + g_plugin.registerIconW(_A2W(MODULE), g_iconList); LoadMenus(); InitOptions(); diff --git a/plugins/HistorySweeperLight/src/options.cpp b/plugins/HistorySweeperLight/src/options.cpp index af1f911fb9..7a49032bfa 100644 --- a/plugins/HistorySweeperLight/src/options.cpp +++ b/plugins/HistorySweeperLight/src/options.cpp @@ -56,7 +56,7 @@ static HANDLE hIconLibItem[_countof(iconList)]; void InitIcons(void) { - Icon_Register(g_plugin.getInst(), ModuleName, iconList, _countof(iconList), ModuleName); + g_plugin.registerIcon(ModuleName, iconList, ModuleName); } HICON LoadIconEx(const char* name) diff --git a/plugins/IEView/src/ieview_main.cpp b/plugins/IEView/src/ieview_main.cpp index bfb261d087..0cb1d34bbf 100644 --- a/plugins/IEView/src/ieview_main.cpp +++ b/plugins/IEView/src/ieview_main.cpp @@ -78,7 +78,7 @@ extern "C" int __declspec(dllexport) Load(void) CreateServiceFunction(MS_IEVIEW_NAVIGATE, HandleIENavigate); CreateServiceFunction("IEView/ReloadOptions", ReloadOptions); hHookOptionsChanged = CreateHookableEvent(ME_IEVIEW_OPTIONSCHANGED); - Icon_Register(g_plugin.getInst(), ieviewModuleName, iconList, _countof(iconList), ieviewModuleName); + g_plugin.registerIcon(ieviewModuleName, iconList, ieviewModuleName); return 0; } diff --git a/plugins/IgnoreState/src/main.cpp b/plugins/IgnoreState/src/main.cpp index 64835afef1..8d3261ccd3 100644 --- a/plugins/IgnoreState/src/main.cpp +++ b/plugins/IgnoreState/src/main.cpp @@ -159,7 +159,7 @@ extern "C" int __declspec(dllexport) Load(void) HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged); //IcoLib support - Icon_Register(g_plugin.getInst(), LPGEN("Ignore State"), iconList, _countof(iconList)); + g_plugin.registerIcon(LPGEN("Ignore State"), iconList); hExtraIcon = ExtraIcon_RegisterIcolib("ignore", LPGEN("Ignore State"), "ignore_full"); diff --git a/plugins/Import/src/utils.cpp b/plugins/Import/src/utils.cpp index a96fafebd5..7ae0567580 100644 --- a/plugins/Import/src/utils.cpp +++ b/plugins/Import/src/utils.cpp @@ -206,5 +206,5 @@ HANDLE GetIconHandle(int iIconId) void RegisterIcons() { - Icon_Register(g_plugin.getInst(), "Import", iconList, _countof(iconList)); + g_plugin.registerIcon("Import", iconList); } diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index a9c88e09ce..cbfa9574c3 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -894,5 +894,5 @@ void InitServices() HookEvent(ME_DB_CONTACT_SETTINGCHANGED, SettingChanged); // icons - Icon_Register(g_plugin.getInst(), LPGEN("ListeningTo"), iconList, _countof(iconList)); + g_plugin.registerIcon(LPGEN("ListeningTo"), iconList); } diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index 7a65c6b0b7..06bd112ebc 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -1053,8 +1053,8 @@ extern "C" __declspec(dllexport) int Load(void) mir_getLP(&pluginInfoEx); pcli = Clist_GetInterface(); - Icon_Register(g_plugin.getInst(), LPGEN("MenuItemEx"), iconList, _countof(iconList)); - Icon_Register(g_plugin.getInst(), LPGEN("MenuItemEx"), overlayIconList, _countof(overlayIconList)); + g_plugin.registerIcon(LPGEN("MenuItemEx"), iconList); + g_plugin.registerIcon(LPGEN("MenuItemEx"), overlayIconList); CreateServiceFunction(MS_SETINVIS, onSetInvis); CreateServiceFunction(MS_SETVIS, onSetVis); diff --git a/plugins/MessageState/src/messagestate.cpp b/plugins/MessageState/src/messagestate.cpp index d0fa273b89..189d31c317 100644 --- a/plugins/MessageState/src/messagestate.cpp +++ b/plugins/MessageState/src/messagestate.cpp @@ -99,7 +99,7 @@ int OnModulesLoaded(WPARAM, LPARAM) HookEvent(ME_PROTO_ACK, OnProtoAck); HookEvent(ME_DB_EVENT_FILTER_ADD, OnEventFilterAdd); - Icon_Register(g_plugin.getInst(), MODULENAME, Icons, _countof(Icons)); + g_plugin.registerIcon(MODULENAME, Icons); StatusIconData sid = {}; sid.szModule = MODULENAME; diff --git a/plugins/MirLua/src/mlua_icons.cpp b/plugins/MirLua/src/mlua_icons.cpp index 5feb9bc833..835f45d243 100644 --- a/plugins/MirLua/src/mlua_icons.cpp +++ b/plugins/MirLua/src/mlua_icons.cpp @@ -11,7 +11,7 @@ IconItem Icons[] = void InitIcons() { - Icon_Register(g_plugin.getInst(), MODULE, Icons, _countof(Icons), MODULE); + g_plugin.registerIcon(MODULE, Icons, MODULE); } HICON GetIcon(int iconId) diff --git a/plugins/MirOTR/src/icons.cpp b/plugins/MirOTR/src/icons.cpp index 5fa631ecb6..c58cab94a7 100644 --- a/plugins/MirOTR/src/icons.cpp +++ b/plugins/MirOTR/src/icons.cpp @@ -11,5 +11,5 @@ static IconItem iconList[] = { void InitIcons() { - Icon_Register(g_plugin.getInst(), "OTR", iconList, _countof(iconList)); + g_plugin.registerIcon("OTR", iconList); } diff --git a/plugins/MobileState/src/main.cpp b/plugins/MobileState/src/main.cpp index eb52dbba7f..ebb2f68ea1 100644 --- a/plugins/MobileState/src/main.cpp +++ b/plugins/MobileState/src/main.cpp @@ -24,7 +24,10 @@ CMPlugin g_plugin; HANDLE hExtraIcon = nullptr; -static IconItem icon = { LPGEN("Mobile State"), "mobile_icon", IDI_MOBILE }; +static IconItem iconList[] = +{ + { LPGEN("Mobile State"), "mobile_icon", IDI_MOBILE } +}; ///////////////////////////////////////////////////////////////////////////////////////// @@ -112,7 +115,7 @@ extern "C" int __declspec(dllexport) Load(void) HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, ExtraIconsApply); // IcoLib support - Icon_Register(g_plugin.getInst(), "Mobile State", &icon, 1); + g_plugin.registerIcon("Mobile State", iconList); // Extra icons hExtraIcon = ExtraIcon_RegisterIcolib("mobilestate", LPGEN("Mobile State"), "mobile_icon"); diff --git a/plugins/MyDetails/src/mydetails.cpp b/plugins/MyDetails/src/mydetails.cpp index 03de0ef53c..555a623f91 100644 --- a/plugins/MyDetails/src/mydetails.cpp +++ b/plugins/MyDetails/src/mydetails.cpp @@ -144,10 +144,7 @@ extern "C" __declspec(dllexport) int Load() // Options InitOptions(); - if (IcoLib_GetIcon("LISTENING_TO_ICON") == nullptr) - Icon_Register(g_plugin.getInst(), LPGEN("Contact list"), iconList, 1); - - Icon_Register(g_plugin.getInst(), LPGEN("My details"), iconList + 1, _countof(iconList) - 1); + g_plugin.registerIcon(LPGEN("My details"), iconList); // Register services CreateServiceFunction(MS_MYDETAILS_SETMYNICKNAME, PluginCommand_SetMyNickname); diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index 47b12187c0..a36c064cf9 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -709,7 +709,7 @@ extern "C" int __declspec(dllexport) Load(void) HookEvent(ME_SYSTEM_MODULESLOADED, MirandaLoaded); - Icon_Register(g_plugin.getInst(), MOD_NAME, iconList, _countof(iconList), "nas"); + g_plugin.registerIcon(MOD_NAME, iconList, "nas"); InitCommonControls(); InitOptions(); // must be called before we hook CallService diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index d9f7f14b2c..311b419b87 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -1152,7 +1152,7 @@ extern "C" int __declspec(dllexport) Load(void) mir_getLP(&pluginInfoEx); pcli = Clist_GetInterface(); - Icon_Register(g_plugin.getInst(), LPGEN("New Status Notify"), iconList, _countof(iconList), MODULE); + g_plugin.registerIcon(LPGEN("New Status Notify"), iconList, MODULE); //"Service" Hook, used when the DB settings change: we'll monitor the "status" setting. HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ContactSettingChanged); diff --git a/plugins/New_GPG/src/icons.cpp b/plugins/New_GPG/src/icons.cpp index 7a07ff2237..99c0a6891c 100755 --- a/plugins/New_GPG/src/icons.cpp +++ b/plugins/New_GPG/src/icons.cpp @@ -25,7 +25,7 @@ static IconItem iconList[] = void InitIconLib() { - Icon_Register(g_plugin.getInst(), szGPGModuleName, iconList, _countof(iconList)); + g_plugin.registerIcon(szGPGModuleName, iconList); } HANDLE IconLibHookIconsChanged(MIRANDAHOOK hook) diff --git a/plugins/NewsAggregator/Src/Icons.cpp b/plugins/NewsAggregator/Src/Icons.cpp index 7171000a30..2c6ff8d049 100644 --- a/plugins/NewsAggregator/Src/Icons.cpp +++ b/plugins/NewsAggregator/Src/Icons.cpp @@ -33,7 +33,7 @@ static IconItem iconList[] = void InitIcons() { - Icon_Register(g_plugin.getInst(), LPGEN("News Aggregator"), iconList, _countof(iconList), MODULE); + g_plugin.registerIcon(LPGEN("News Aggregator"), iconList, MODULE); } HICON LoadIconEx(const char *name, bool big) diff --git a/plugins/NoHistory/src/icons.cpp b/plugins/NoHistory/src/icons.cpp index d5c504abcc..f9f50f3595 100644 --- a/plugins/NoHistory/src/icons.cpp +++ b/plugins/NoHistory/src/icons.cpp @@ -19,7 +19,7 @@ int ReloadIcons(WPARAM, LPARAM) void InitIcons() { - Icon_Register(g_plugin.getInst(), LPGEN("No History"), iconList, _countof(iconList), MODULE); + g_plugin.registerIcon(LPGEN("No History"), iconList, MODULE); ReloadIcons(0, 0); diff --git a/plugins/Non-IM Contact/src/main.cpp b/plugins/Non-IM Contact/src/main.cpp index 96c9551b92..8666f0ac00 100644 --- a/plugins/Non-IM Contact/src/main.cpp +++ b/plugins/Non-IM Contact/src/main.cpp @@ -110,7 +110,7 @@ int ModulesLoaded(WPARAM, LPARAM) // Description : Called when plugin is loaded into Miranda //===================================================== -IconItem icoList[] = +IconItem iconList[] = { { LPGEN("Main Icon"), MODNAME, IDI_MAIN }, }; @@ -120,7 +120,7 @@ extern "C" __declspec(dllexport) int Load() mir_getLP(&pluginInfoEx); pcli = Clist_GetInterface(); - Icon_Register(g_plugin.getInst(), LPGEN("Non-IM Contact"), icoList, _countof(icoList)); + g_plugin.registerIcon(LPGEN("Non-IM Contact"), iconList); HookEvent(ME_CLIST_DOUBLECLICKED, (MIRANDAHOOK)doubleClick); HookEvent(ME_OPT_INITIALISE, NimcOptInit); @@ -148,7 +148,7 @@ extern "C" __declspec(dllexport) int Load() mi.position = 600090000; mi.name.a = LPGEN("&Add Non-IM Contact"); mi.pszService = "AddLCcontact"; - mi.hIcolibItem = icoList[0].hIcolib; + mi.hIcolibItem = iconList[0].hIcolib; Menu_AddMainMenuItem(&mi); SET_UID(mi, 0xa511c5e, 0x26d2, 0x41b1, 0xbd, 0xb7, 0x3e, 0x62, 0xc8, 0x44, 0x37, 0xc9); diff --git a/plugins/Non-IM Contact/src/services.cpp b/plugins/Non-IM Contact/src/services.cpp index 5396a5af42..395f323c98 100644 --- a/plugins/Non-IM Contact/src/services.cpp +++ b/plugins/Non-IM Contact/src/services.cpp @@ -33,9 +33,9 @@ INT_PTR LoadLCIcon(WPARAM wParam, LPARAM) { if (LOWORD(wParam) == PLI_PROTOCOL) { if (wParam & PLIF_ICOLIBHANDLE) - return (INT_PTR)icoList[0].hIcolib; + return (INT_PTR)iconList[0].hIcolib; - HICON hIcon = IcoLib_GetIconByHandle(icoList[0].hIcolib, (wParam & PLIF_SMALL) == 0); + HICON hIcon = IcoLib_GetIconByHandle(iconList[0].hIcolib, (wParam & PLIF_SMALL) == 0); if (wParam & PLIF_ICOLIB) return (INT_PTR)hIcon; diff --git a/plugins/Non-IM Contact/src/stdafx.h b/plugins/Non-IM Contact/src/stdafx.h index 1497c970df..6d1821d180 100644 --- a/plugins/Non-IM Contact/src/stdafx.h +++ b/plugins/Non-IM Contact/src/stdafx.h @@ -70,7 +70,7 @@ struct DLGTEMPLATEEX // General extern int LCStatus; -extern IconItem icoList[]; +extern IconItem iconList[]; // Services.c INT_PTR GetLCCaps(WPARAM wParam,LPARAM lParam); diff --git a/plugins/NotesAndReminders/src/main.cpp b/plugins/NotesAndReminders/src/main.cpp index e2e859a0a5..7a412c5198 100644 --- a/plugins/NotesAndReminders/src/main.cpp +++ b/plugins/NotesAndReminders/src/main.cpp @@ -118,7 +118,7 @@ IconItem iconList[] = void InitIcons(void) { - Icon_Register(g_plugin.getInst(), LPGEN("Sticky Notes"), iconList, _countof(iconList), MODULENAME); + g_plugin.registerIcon(LPGEN("Sticky Notes"), iconList, MODULENAME); } static int OnOptInitialise(WPARAM w, LPARAM) diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index 0428556e54..aae1e09f51 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -387,7 +387,7 @@ static void LoadProtocols(void) // Load icons void LoadIcons(void) { - Icon_Register(g_plugin.getInst(), LPGEN("Nudge"), iconList, _countof(iconList)); + g_plugin.registerIcon(LPGEN("Nudge"), iconList); } // Nudge support diff --git a/plugins/OpenFolder/src/openFolder.cpp b/plugins/OpenFolder/src/openFolder.cpp index 0695ca0ed1..fa4f9da040 100644 --- a/plugins/OpenFolder/src/openFolder.cpp +++ b/plugins/OpenFolder/src/openFolder.cpp @@ -34,7 +34,10 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) ///////////////////////////////////////////////////////////////////////////////////////// -static IconItem icon = { LPGEN("Open Folder"), "open", IDI_FOLDER }; +static IconItem iconList[] = +{ + { LPGEN("Open Folder"), "open", IDI_FOLDER } +}; static INT_PTR MenuCommand_OpenFolder(WPARAM, LPARAM) { @@ -56,7 +59,7 @@ static INT_PTR MenuCommand_OpenFolder(WPARAM, LPARAM) static int ToptoolBarHook(WPARAM, LPARAM) { TTBButton ttb = {}; - ttb.hIconHandleUp = icon.hIcolib; + ttb.hIconHandleUp = iconList[0].hIcolib; ttb.pszService = MS_OPENFOLDER_OPEN; ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP; ttb.name = LPGEN("Open Folder"); @@ -88,7 +91,7 @@ extern "C" int __declspec(dllexport) Load() HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded); // icolib (0.7+) - Icon_Register(g_plugin.getInst(), LPGEN("Open Folder"), &icon, 1, OPENFOLDER_MODULE_NAME); + g_plugin.registerIcon(LPGEN("Open Folder"), iconList, OPENFOLDER_MODULE_NAME); // hotkeys service (0.8+) HOTKEYDESC hotkey = {}; @@ -104,7 +107,7 @@ extern "C" int __declspec(dllexport) Load() SET_UID(mi, 0xbba6ad01, 0x755a, 0x4d01, 0x94, 0xee, 0x57, 0x84, 0x18, 0x70, 0x77, 0x4f); mi.position = 0x7FFFFFFF; mi.flags = CMIF_UNICODE; - mi.hIcolibItem = icon.hIcolib; + mi.hIcolibItem = iconList[0].hIcolib; mi.name.w = LPGENW("Open Folder"); mi.pszService = MS_OPENFOLDER_OPEN; Menu_AddMainMenuItem(&mi); diff --git a/plugins/PackUpdater/Src/Utils.cpp b/plugins/PackUpdater/Src/Utils.cpp index 36e04c722f..14bd0ad350 100644 --- a/plugins/PackUpdater/Src/Utils.cpp +++ b/plugins/PackUpdater/Src/Utils.cpp @@ -44,7 +44,7 @@ IconItem iconList[] = void IcoLibInit() { - Icon_Register(g_plugin.getInst(), MODULEA, iconList, _countof(iconList)); + g_plugin.registerIcon(MODULEA, iconList); } BOOL NetlibInit() diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp index d6d968a30f..0a3341afe2 100644 --- a/plugins/PasteIt/src/PasteIt.cpp +++ b/plugins/PasteIt/src/PasteIt.cpp @@ -29,7 +29,10 @@ HGENMENU hWebPageMenus[PasteToWeb::pages]; HANDLE hOptionsInit; HANDLE hWindowEvent = nullptr; -static IconItem icon = { LPGEN("Paste It"), "PasteIt_main", IDI_MENU }; +static IconItem iconList[] = +{ + { LPGEN("Paste It"), "PasteIt_main", IDI_MENU } +}; CMPlugin g_plugin; int &hLangpack(g_plugin.m_hLang); @@ -255,7 +258,7 @@ static void InitMenuItems() SET_UID(mi, 0x33ecc112, 0x6, 0x487d, 0xbb, 0x8b, 0x76, 0xb4, 0x17, 0x9b, 0xdb, 0xc5); mi.flags = CMIF_UNICODE; - mi.hIcolibItem = icon.hIcolib; + mi.hIcolibItem = iconList[0].hIcolib; mi.position = 3000090005; mi.name.w = LPGENW("Paste It"); hContactMenu = Menu_AddContactMenuItem(&mi); @@ -306,7 +309,7 @@ static void InitTabsrmmButton() btn.dwButtonID = 1; btn.pszModuleName = MODULE; btn.dwDefPos = 110; - btn.hIcon = icon.hIcolib; + btn.hIcon = iconList[0].hIcolib; btn.bbbFlags = BBBF_ISARROWBUTTON | BBBF_ISIMBUTTON | BBBF_CANBEHIDDEN | BBBF_ISCHATBUTTON; btn.pwszTooltip = TranslateT("Paste It"); Srmm_AddButton(&btn); @@ -351,7 +354,7 @@ extern "C" int __declspec(dllexport) Load(void) mir_getLP(&pluginInfo); pci = Chat_GetInterface(); - Icon_Register(g_plugin.getInst(), LPGEN("Paste It"), &icon, 1); + g_plugin.registerIcon(LPGEN("Paste It"), iconList); NETLIBUSER nlu = {}; nlu.flags = NUF_UNICODE | NUF_OUTGOING | NUF_HTTPCONNS; diff --git a/plugins/Ping/src/ping.cpp b/plugins/Ping/src/ping.cpp index 687068024b..8e2a1be6b2 100644 --- a/plugins/Ping/src/ping.cpp +++ b/plugins/Ping/src/ping.cpp @@ -143,7 +143,7 @@ extern "C" __declspec(dllexport) int Load(void) HookEvent(ME_SYSTEM_PRESHUTDOWN, OnShutdown); HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons); - Icon_Register(g_plugin.getInst(), LPGEN("Ping"), iconList, _countof(iconList)); + g_plugin.registerIcon(LPGEN("Ping"), iconList); return 0; } diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp index 6cc3841083..cb1fd9d618 100644 --- a/plugins/PluginUpdater/src/Utils.cpp +++ b/plugins/PluginUpdater/src/Utils.cpp @@ -41,16 +41,16 @@ void LoadOptions() opts.bChangePlatform = db_get_b(NULL, MODNAME, DB_SETTING_CHANGEPLATFORM, 0); } -IconItemT iconList[] = +IconItem iconList[] = { - { LPGENW("Check for updates"),"check_update", IDI_MENU }, - { LPGENW("Plugin info"), "info", IDI_INFO }, - { LPGENW("Component list"),"plg_list", IDI_PLGLIST } + { LPGEN("Check for updates"),"check_update", IDI_MENU }, + { LPGEN("Plugin info"), "info", IDI_INFO }, + { LPGEN("Component list"),"plg_list", IDI_PLGLIST } }; void InitIcoLib() { - Icon_RegisterT(g_plugin.getInst(), MODULE, iconList, _countof(iconList)); + g_plugin.registerIcon(MODULEA, iconList); } void InitNetlib() diff --git a/plugins/PluginUpdater/src/stdafx.h b/plugins/PluginUpdater/src/stdafx.h index 4e5722de85..0f66b8cfb1 100644 --- a/plugins/PluginUpdater/src/stdafx.h +++ b/plugins/PluginUpdater/src/stdafx.h @@ -155,7 +155,7 @@ extern aPopups PopupsList[POPUPS]; extern HANDLE hPipe; extern HNETLIBUSER hNetlibUser; -extern IconItemT iconList[]; +extern IconItem iconList[]; struct CMPlugin : public PLUGIN { diff --git a/plugins/Popup/src/icons.cpp b/plugins/Popup/src/icons.cpp index 525d5bbef8..77d01cc3a8 100644 --- a/plugins/Popup/src/icons.cpp +++ b/plugins/Popup/src/icons.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" -static IconItem iconList[] = +static IconItem iconList1[] = { // common popup { LPGEN("Popups are enabled"), "enabled", IDI_POPUP }, @@ -35,8 +35,11 @@ static IconItem iconList[] = // notifications { LPGEN("Information"), "info", IDI_MB_INFO }, { LPGEN("Warning"), "warning", IDI_MB_WARN }, - { LPGEN("Error"), "error", IDI_MB_STOP }, + { LPGEN("Error"), "error", IDI_MB_STOP } +}; +static IconItem iconList2[] = +{ // option { LPGEN("Refresh skin list"), "opt_reload", IDI_RELOAD }, { LPGEN("Popup placement"), "opt_resize", IDI_RESIZE }, @@ -46,8 +49,11 @@ static IconItem iconList[] = { LPGEN("Show default"), "opt_default", IDI_ACT_OK }, { LPGEN("Favorite contact"), "opt_favorite", IDI_OPT_FAVORITE }, { LPGEN("Show in fullscreen"), "opt_fullscreen", IDI_OPT_FULLSCREEN }, - { LPGEN("Blocked contact"), "opt_block", IDI_OPT_BLOCK }, + { LPGEN("Blocked contact"), "opt_block", IDI_OPT_BLOCK } +}; +static IconItem iconList3[] = +{ // action { LPGEN("Quick reply"), "act_reply", IDI_ACT_REPLY }, { LPGEN("Pin popup"), "act_pin", IDI_ACT_PIN }, @@ -62,23 +68,39 @@ static IconItem iconList[] = void InitIcons() { - Icon_Register(g_plugin.getInst(), SECT_POPUP, iconList, 8, MODULNAME); - Icon_Register(g_plugin.getInst(), SECT_POPUP SECT_POPUP_OPT, iconList + 8, 9, MODULNAME); - Icon_Register(g_plugin.getInst(), SECT_POPUP SECT_POPUP_ACT, iconList + 17, 9, MODULNAME); + g_plugin.registerIcon(SECT_POPUP, iconList1, MODULNAME); + g_plugin.registerIcon(SECT_POPUP SECT_POPUP_OPT, iconList2, MODULNAME); + g_plugin.registerIcon(SECT_POPUP SECT_POPUP_ACT, iconList3, MODULNAME); } HICON LoadIconEx(int iconId, bool big) { - for (auto &it : iconList) + for (auto &it : iconList1) if (it.defIconID == iconId) return IcoLib_GetIconByHandle(it.hIcolib, big); - + + for (auto &it : iconList2) + if (it.defIconID == iconId) + return IcoLib_GetIconByHandle(it.hIcolib, big); + + for (auto &it : iconList3) + if (it.defIconID == iconId) + return IcoLib_GetIconByHandle(it.hIcolib, big); + return nullptr; } HANDLE GetIconHandle(int iconId) { - for (auto &it : iconList) + for (auto &it : iconList1) + if (it.defIconID == iconId) + return it.hIcolib; + + for (auto &it : iconList2) + if (it.defIconID == iconId) + return it.hIcolib; + + for (auto &it : iconList3) if (it.defIconID == iconId) return it.hIcolib; diff --git a/plugins/ProfileManager/src/pmanagerEx.cpp b/plugins/ProfileManager/src/pmanagerEx.cpp index ceb58fa1aa..b8316ab165 100644 --- a/plugins/ProfileManager/src/pmanagerEx.cpp +++ b/plugins/ProfileManager/src/pmanagerEx.cpp @@ -87,7 +87,7 @@ extern "C" __declspec(dllexport) int Load(void) { mir_getLP(&pluginInfo); - Icon_Register(g_plugin.getInst(), LPGEN("Profile manager"), iconList, _countof(iconList)); + g_plugin.registerIcon(LPGEN("Profile manager"), iconList); CreateServiceFunction(SRV_LOAD_PM, LoadPM); CreateServiceFunction(SRV_CHANGE_PM, ChangePM); diff --git a/plugins/QuickReplies/src/events.cpp b/plugins/QuickReplies/src/events.cpp index 3e5a663eaf..efb7cab324 100644 --- a/plugins/QuickReplies/src/events.cpp +++ b/plugins/QuickReplies/src/events.cpp @@ -21,7 +21,10 @@ Boston, MA 02111-1307, USA. using namespace std; -static IconItem icon = { LPGEN("Button"), "qr_button", IDI_QICON }; +static IconItem iconList[] = +{ + { LPGEN("Button"), "qr_button", IDI_QICON } +}; int iNumber = 0; @@ -30,7 +33,7 @@ int OnModulesLoaded(WPARAM, LPARAM) HookEvent(ME_OPT_INITIALISE, OnOptInitialized); HookEvent(ME_MSG_BUTTONPRESSED, OnButtonPressed); - Icon_Register(g_plugin.getInst(), "TabSRMM/Quick Replies", &icon, 1); + g_plugin.registerIcon("TabSRMM/Quick Replies", iconList); char buttonNameTranslated[32], buttonName[32]; mir_snprintf(buttonNameTranslated, "%s %x", Translate("Button"), iNumber + 1); @@ -40,7 +43,7 @@ int OnModulesLoaded(WPARAM, LPARAM) bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON; bbd.pszModuleName = buttonName; bbd.pwszTooltip = LPGENW("Quick Replies"); - bbd.hIcon = icon.hIcolib; + bbd.hIcon = iconList[0].hIcolib; bbd.dwButtonID = iNumber; bbd.dwDefPos = 220; Srmm_AddButton(&bbd); diff --git a/plugins/Quotes/src/IconLib.cpp b/plugins/Quotes/src/IconLib.cpp index cd2eac896e..d649d4bad3 100644 --- a/plugins/Quotes/src/IconLib.cpp +++ b/plugins/Quotes/src/IconLib.cpp @@ -18,7 +18,7 @@ static IconItem iconList[] = void Quotes_IconsInit() { - ::Icon_Register(g_plugin.getInst(), QUOTES_PROTOCOL_NAME, iconList, _countof(iconList), QUOTES_PROTOCOL_NAME); + ::g_plugin.registerIcon(QUOTES_PROTOCOL_NAME, iconList, QUOTES_PROTOCOL_NAME); } HICON Quotes_LoadIconEx(int iconId, bool bBig /*= false*/) diff --git a/plugins/Rate/src/main.cpp b/plugins/Rate/src/main.cpp index 5cb18e34be..9380b09e68 100644 --- a/plugins/Rate/src/main.cpp +++ b/plugins/Rate/src/main.cpp @@ -126,7 +126,7 @@ extern "C" int __declspec(dllexport) Load(void) HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged); // IcoLib support - Icon_Register(g_plugin.getInst(), LPGEN("Contact rate"), iconList, _countof(iconList)); + g_plugin.registerIcon(LPGEN("Contact rate"), iconList); // Extra icon support hExtraIcon = ExtraIcon_RegisterIcolib("contact_rate", LPGEN("Contact rate"), "rate_high"); diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index ea0d078487..ed1c717a54 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -20,7 +20,10 @@ const INT_PTR boo = 0; LastUCOptions LastUCOpt = {0}; -static IconItem icon = { LPGEN("Main icon"), "recent_main", IDI_SHOWRECENT }; +static IconItem iconList[] = +{ + { LPGEN("Main iconList"), "recent_main", IDI_SHOWRECENT } +}; ///////////////////////////////////////////////////////////////////////////////////////// @@ -428,7 +431,7 @@ static int OnContactSettingChanged(WPARAM hContact, LPARAM lParam) int Create_TopToolbarShowList(WPARAM, LPARAM) { TTBButton ttb = {}; - ttb.hIconHandleUp = icon.hIcolib; + ttb.hIconHandleUp = iconList[0].hIcolib; ttb.pszService = msLastUC_ShowList; ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP; ttb.name = ttb.pszTooltipUp = LPGEN("Recent Contacts"); @@ -440,14 +443,14 @@ int Create_MenuitemShowList(void) { CMenuItem mi; SET_UID(mi, 0xe22ce213, 0x362a, 0x444a, 0xa5, 0x82, 0xc, 0xcf, 0xf5, 0x4b, 0xd1, 0x8e); - mi.hIcolibItem = icon.hIcolib; + mi.hIcolibItem = iconList[0].hIcolib; mi.name.a = LPGEN("Recent Contacts"); mi.pszService = msLastUC_ShowList; Menu_AddMainMenuItem(&mi); SET_UID(mi, 0xe22ce213, 0x362a, 0x444a, 0xa5, 0x82, 0xc, 0xcf, 0xf5, 0x4b, 0xd1, 0x8e); mi.position = 0xFFFFF; - mi.hIcolibItem = icon.hIcolib; + mi.hIcolibItem = iconList[0].hIcolib; mi.name.a = LPGEN("Toggle Ignore"); mi.pszService = V_RECENTCONTACTS_TOGGLE_IGNORE; hMenuItemRemove = Menu_AddContactMenuItem(&mi); @@ -551,7 +554,7 @@ extern "C" __declspec(dllexport) int Load(void) CoInitialize(nullptr); - Icon_Register(g_plugin.getInst(), "Recent Contacts", &icon, 1); + g_plugin.registerIcon("Recent Contacts", iconList); CreateServiceFunction(msLastUC_ShowList, OnMenuCommandShowList); CreateServiceFunction(V_RECENTCONTACTS_TOGGLE_IGNORE, ToggleIgnore); diff --git a/plugins/Restart/src/restart.cpp b/plugins/Restart/src/restart.cpp index c217e6ff41..0616cf01d6 100644 --- a/plugins/Restart/src/restart.cpp +++ b/plugins/Restart/src/restart.cpp @@ -39,21 +39,24 @@ static INT_PTR RestartMe(WPARAM, LPARAM) return 0; } -static IconItem icon = { LPGEN("Restart"), "rst_restart_icon", IDI_RESTARTICON }; +static IconItem iconList[] = +{ + { LPGEN("Restart"), "rst_restart_icon", IDI_RESTARTICON } +}; extern "C" __declspec(dllexport) int Load(void) { mir_getLP( &pluginInfo ); // IcoLib support - Icon_Register(g_plugin.getInst(), LPGEN("Restart Plugin"), &icon, 1); + g_plugin.registerIcon(LPGEN("Restart Plugin"), iconList); hRestartMe = CreateServiceFunction("System/RestartMe", RestartMe); CMenuItem mi; SET_UID(mi, 0x9181059, 0x5316, 0x4be3, 0x96, 0xb7, 0x80, 0x51, 0xa9, 0x3a, 0xd8, 0x49); mi.position = -0x7FFFFFFF; - mi.hIcolibItem = icon.hIcolib; + mi.hIcolibItem = iconList[0].hIcolib; mi.name.a = LPGEN("Restart"); mi.pszService = "System/RestartMe"; Menu_AddMainMenuItem(&mi); diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp index e826a70f63..f1db66c333 100644 --- a/plugins/Scriver/src/globals.cpp +++ b/plugins/Scriver/src/globals.cpp @@ -38,7 +38,7 @@ static const char *chatButtonIcons[] = "chat_settings", "chat_nicklist", "scriver_SEND" }; -static IconItem iconList[] = +static IconItem iconList1[] = { { LPGEN("Add contact"), "scriver_ADD", IDI_ADDCONTACT }, // 1 { LPGEN("User's details"), "scriver_USERDETAILS", IDI_USERDETAILS }, // 2 @@ -54,7 +54,10 @@ static IconItem iconList[] = { LPGEN("Incoming message (10x10)"),"scriver_INCOMING", IDI_INCOMING, 10}, // 12 { LPGEN("Outgoing message (10x10)"),"scriver_OUTGOING", IDI_OUTGOING, 10}, // 13 { LPGEN("Notice (10x10)"), "scriver_NOTICE", IDI_NOTICE, 10}, // 14 +}; +static IconItem iconList2[] = +{ { LPGEN("Window Icon"), "chat_window", IDI_CHANMGR }, // 1 { LPGEN("Text color"), "chat_fgcol", IDI_COLOR }, // 2 { LPGEN("Background color") , "chat_bkgcol", IDI_BKGCOLOR }, // 3 @@ -66,8 +69,8 @@ static IconItem iconList[] = { LPGEN("Room settings"), "chat_settings", IDI_TOPICBUT }, // 9 { LPGEN("Event filter disabled"), "chat_filter", IDI_FILTER }, // 10 { LPGEN("Event filter enabled"), "chat_filter2", IDI_FILTER2 }, // 11 - { LPGEN("Hide nick list"), "chat_nicklist", IDI_NICKLIST }, // 12 - { LPGEN("Show nick list"), "chat_nicklist2", IDI_NICKLIST2 }, // 13 + { LPGEN("Hide nick list"), "chat_nicklist", IDI_NICKLIST }, // 12 + { LPGEN("Show nick list"), "chat_nicklist2", IDI_NICKLIST2 }, // 13 { LPGEN("Icon overlay"), "chat_overlay", IDI_OVERLAY }, // 14 { LPGEN("Status 1 (10x10)"), "chat_status0", IDI_STATUS0, 10}, // 15 { LPGEN("Status 2 (10x10)"), "chat_status1", IDI_STATUS1, 10}, // 16 @@ -75,7 +78,10 @@ static IconItem iconList[] = { LPGEN("Status 4 (10x10)"), "chat_status3", IDI_STATUS3, 10}, // 18 { LPGEN("Status 5 (10x10)"), "chat_status4", IDI_STATUS4, 10}, // 19 { LPGEN("Status 6 (10x10)"), "chat_status5", IDI_STATUS5, 10}, // 20 - +}; + +static IconItem iconList3[] = +{ { LPGEN("Message in (10x10)"), "chat_log_message_in", IDI_INCOMING, 10}, // 1 { LPGEN("Message out (10x10)"), "chat_log_message_out", IDI_OUTGOING, 10}, // 2 { LPGEN("Action (10x10)"), "chat_log_action", IDI_ACTION, 10}, // 3 @@ -96,9 +102,9 @@ void RegisterIcons(void) { HookEvent(ME_SKIN2_ICONSCHANGED, IconsChanged); - Icon_Register(g_plugin.getInst(), LPGEN("Single Messaging"), iconList, 14); - Icon_Register(g_plugin.getInst(), LPGEN("Group chats"), iconList+14, 20); - Icon_Register(g_plugin.getInst(), LPGEN("Single Messaging"), iconList+34, 14); + g_plugin.registerIcon(LPGEN("Single Messaging"), iconList1); + g_plugin.registerIcon(LPGEN("Group chats"), iconList2); + g_plugin.registerIcon(LPGEN("Single Messaging"), iconList3); } ///////////////////////////////////////////////////////////////////////////////////////// @@ -209,7 +215,15 @@ void ReleaseIcons() HICON GetCachedIcon(const char *name) { - for (auto &it : iconList) + for (auto &it : iconList1) + if (!mir_strcmp(it.szName, name)) + return IcoLib_GetIconByHandle(it.hIcolib); + + for (auto &it : iconList2) + if (!mir_strcmp(it.szName, name)) + return IcoLib_GetIconByHandle(it.hIcolib); + + for (auto &it : iconList3) if (!mir_strcmp(it.szName, name)) return IcoLib_GetIconByHandle(it.hIcolib); diff --git a/plugins/SendScreenshotPlus/src/Main.cpp b/plugins/SendScreenshotPlus/src/Main.cpp index a69a317809..f0c42d7093 100644 --- a/plugins/SendScreenshotPlus/src/Main.cpp +++ b/plugins/SendScreenshotPlus/src/Main.cpp @@ -275,8 +275,8 @@ extern "C" __declspec(dllexport) int Load(void) HookEvent(ME_SYSTEM_PRESHUTDOWN, hook_SystemPreShutdown); /// icons - Icon_Register(g_plugin.getInst(), SZ_SENDSS, ICONS, sizeof(ICONS) / sizeof(IconItem), SZ_SENDSS); - Icon_Register(g_plugin.getInst(), SZ_SENDSS "/" LPGEN("Buttons"), ICONS_BTN, sizeof(ICONS_BTN) / sizeof(IconItem), SZ_SENDSS); + g_plugin.registerIcon(SZ_SENDSS, ICONS, SZ_SENDSS); + g_plugin.registerIcon(SZ_SENDSS "/" LPGEN("Buttons"), ICONS_BTN, SZ_SENDSS); /// services #define srv_reg(name) do{\ diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index 2a0a27d213..169a42ab0b 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -852,7 +852,7 @@ extern "C" __declspec(dllexport) int Load(void) HookEvent(ME_SYSTEM_PRESHUTDOWN, SessionPreShutdown); // Icons - Icon_Register(g_plugin.getInst(), MODNAME, iconList, _countof(iconList)); + g_plugin.registerIcon(MODNAME, iconList); return 0; } diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp index 56064ab583..98e99e3200 100644 --- a/plugins/SimpleAR/src/Main.cpp +++ b/plugins/SimpleAR/src/Main.cpp @@ -238,10 +238,10 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) ///////////////////////////////////////////////////////////////////////////////////////// -IconItemT iconList[] = +IconItem iconList[] = { - { LPGENW("Disable Auto&reply"), "Disable Auto&reply", IDI_OFF }, - { LPGENW("Enable Auto&reply"), "Enable Auto&reply", IDI_ON } + { LPGEN("Disable Auto&reply"), "Disable Auto&reply", IDI_OFF }, + { LPGEN("Enable Auto&reply"), "Enable Auto&reply", IDI_ON } }; extern "C" int __declspec(dllexport)Load(void) @@ -271,8 +271,7 @@ extern "C" int __declspec(dllexport)Load(void) HookEvent(ME_DB_EVENT_ADDED, addEvent); HookEvent(ME_SYSTEM_MODULESLOADED, CheckDefaults); - Icon_RegisterT(g_plugin.getInst(), L"Simple Auto Replier", iconList, _countof(iconList)); - + g_plugin.registerIcon("Simple Auto Replier", iconList); return 0; } diff --git a/plugins/SimpleAR/src/stdafx.h b/plugins/SimpleAR/src/stdafx.h index 2ba5c1c970..863bdca124 100644 --- a/plugins/SimpleAR/src/stdafx.h +++ b/plugins/SimpleAR/src/stdafx.h @@ -34,6 +34,6 @@ struct CMPlugin : public PLUGIN extern INT interval; extern wchar_t *ptszDefaultMsg[6]; extern HGENMENU hEnableMenu; -extern IconItemT iconList[]; +extern IconItem iconList[]; extern INT OptInit(WPARAM wParam, LPARAM lParam); diff --git a/plugins/SimpleStatusMsg/src/utils.cpp b/plugins/SimpleStatusMsg/src/utils.cpp index 0c127418ca..aaeaf1eb47 100644 --- a/plugins/SimpleStatusMsg/src/utils.cpp +++ b/plugins/SimpleStatusMsg/src/utils.cpp @@ -36,7 +36,7 @@ static IconItem iconList[] = void IconsInit(void) { - Icon_Register(g_plugin.getInst(), LPGEN("Simple Status Message"), iconList, _countof(iconList), MODULENAME); + g_plugin.registerIcon(LPGEN("Simple Status Message"), iconList, MODULENAME); } HICON LoadIconEx(const char *name) diff --git a/plugins/SmileyAdd/src/main.cpp b/plugins/SmileyAdd/src/main.cpp index a4322180af..44496c2994 100644 --- a/plugins/SmileyAdd/src/main.cpp +++ b/plugins/SmileyAdd/src/main.cpp @@ -49,14 +49,17 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD /* mira ///////////////////////////////////////////////////////////////////////////////////////// -static IconItem icon = { LPGEN("Button smiley"), "SmileyAdd_ButtonSmiley", IDI_SMILINGICON }; +static IconItem iconList[] = +{ + { LPGEN("Button smiley"), "SmileyAdd_ButtonSmiley", IDI_SMILINGICON } +}; static int ModulesLoaded(WPARAM, LPARAM) { CMenuItem mi; SET_UID(mi, 0x5ba238de, 0xe16b, 0x4928, 0xa0, 0x70, 0xff, 0x43, 0xf6, 0x1f, 0x16, 0xd4); mi.position = 2000070050; - mi.hIcolibItem = icon.hIcolib; + mi.hIcolibItem = iconList[0].hIcolib; mi.name.a = LPGEN("Assign smiley category"); hContactMenuItem = Menu_AddContactMenuItem(&mi); @@ -95,7 +98,7 @@ extern "C" __declspec(dllexport) int Load(void) InitImageCache(); - Icon_Register(g_plugin.getInst(), MODULENAME, &icon, 1); + g_plugin.registerIcon(MODULENAME, iconList); g_SmileyCategories.SetSmileyPackStore(&g_SmileyPacks); diff --git a/plugins/SpellChecker/src/spellchecker.cpp b/plugins/SpellChecker/src/spellchecker.cpp index 27d92f30c1..96d535f873 100644 --- a/plugins/SpellChecker/src/spellchecker.cpp +++ b/plugins/SpellChecker/src/spellchecker.cpp @@ -230,7 +230,7 @@ extern "C" int __declspec(dllexport) Load(void) mir_getLP(&pluginInfo); // icons - Icon_Register(g_plugin.getInst(), LPGEN("Spell Checker"), iconList, _countof(iconList)); + g_plugin.registerIcon(LPGEN("Spell Checker"), iconList); // hooks HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded); diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp index 60960e472d..3382ad8a5d 100644 --- a/plugins/StartupSilence/src/main.cpp +++ b/plugins/StartupSilence/src/main.cpp @@ -432,7 +432,7 @@ int ModulesLoaded(WPARAM, LPARAM) HookEvent(ME_POPUP_FILTER, DisablePopup); hTTBarloaded = HookEvent(ME_TTB_MODULELOADED, CreateTTButtons); if (TTBButtons == 1 && hTTBarloaded != nullptr) { - Icon_Register(g_plugin.getInst(), "Toolbar/" MENU_NAME, iconttbList, _countof(iconttbList), MENU_NAME); + g_plugin.registerIcon("Toolbar/" MENU_NAME, iconttbList, MENU_NAME); RemoveTTButtons(); CreateTTButtons(0, 0); } @@ -454,7 +454,7 @@ extern "C" __declspec(dllexport) int Load(void) CreateServiceFunction(SS_SILENCE_CONNECTION, SilenceConnection); if (MenuItem == 1) { - Icon_Register(g_plugin.getInst(), MENU_NAME, iconList, _countof(iconList), MENU_NAME); + g_plugin.registerIcon(MENU_NAME, iconList, MENU_NAME); InitMenu(); } return 0; diff --git a/plugins/StatusManager/src/StartupStatus/ss_toolbars.cpp b/plugins/StatusManager/src/StartupStatus/ss_toolbars.cpp index cdf8b93889..262637468e 100644 --- a/plugins/StatusManager/src/StartupStatus/ss_toolbars.cpp +++ b/plugins/StatusManager/src/StartupStatus/ss_toolbars.cpp @@ -41,7 +41,7 @@ void RemoveTopToolbarButtons() int CreateTopToolbarButtons(WPARAM, LPARAM) { if (iconList[0].hIcolib == nullptr) - Icon_Register(g_plugin.getInst(), "Toolbar/StartupStatus", iconList, _countof(iconList)); + g_plugin.registerIcon("Toolbar/StartupStatus", iconList); int profileCount = CallService(MS_SS_GETPROFILECOUNT, 0, 0); diff --git a/plugins/TabSRMM/src/chat_options.cpp b/plugins/TabSRMM/src/chat_options.cpp index e2524a73d0..1cd74056a4 100644 --- a/plugins/TabSRMM/src/chat_options.cpp +++ b/plugins/TabSRMM/src/chat_options.cpp @@ -348,14 +348,12 @@ static IconItem _logicons[] = // add icons to the skinning module void Chat_AddIcons(void) { - Icon_Register(g_hIconDLL, LPGEN("Message Sessions") "/" LPGEN("Group chat windows"), _icons, _countof(_icons)); - Icon_Register(g_hIconDLL, LPGEN("Message Sessions") "/" LPGEN("Group chat log"), _logicons, _countof(_logicons)); + Icon_Register(g_hIconDLL, LPGEN("Message Sessions") "/" LPGEN("Group chat windows"), _icons, _countof(_icons), 0, g_plugin.m_hLang); + Icon_Register(g_hIconDLL, LPGEN("Message Sessions") "/" LPGEN("Group chat log"), _logicons, _countof(_logicons), 0, g_plugin.m_hLang); pci->MM_IconsChanged(); } -/* - * get icon by name from the core icon library service - */ +// get icon by name from the core icon library service HICON LoadIconEx(char *pszIcoLibName) { char szTemp[256]; diff --git a/plugins/TipperYM/src/tipper.cpp b/plugins/TipperYM/src/tipper.cpp index e2835f04f9..75f0282409 100644 --- a/plugins/TipperYM/src/tipper.cpp +++ b/plugins/TipperYM/src/tipper.cpp @@ -323,7 +323,7 @@ extern "C" int __declspec(dllexport) Load(void) iCodePage = Langpack_GetDefaultCodePage(); - Icon_Register(g_plugin.getInst(), MODULE, iconList, _countof(iconList), MODULE); + g_plugin.registerIcon(MODULE, iconList, MODULE); InitTranslations(); InitMessagePump(); diff --git a/plugins/TopToolBar/src/main.cpp b/plugins/TopToolBar/src/main.cpp index 896e70ad65..2e0913797a 100644 --- a/plugins/TopToolBar/src/main.cpp +++ b/plugins/TopToolBar/src/main.cpp @@ -47,7 +47,7 @@ extern "C" int __declspec(dllexport) Load(void) mir_getLP(&pluginInfo); pcli = Clist_GetInterface(); - Icon_Register(g_plugin.getInst(), TTB_OPTDIR, iconList, _countof(iconList), TTB_OPTDIR); + g_plugin.registerIcon(TTB_OPTDIR, iconList, TTB_OPTDIR); LoadToolbarModule(); return 0; diff --git a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp index defc2903ad..fd21e8ebf8 100644 --- a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp +++ b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp @@ -84,7 +84,7 @@ int OnModulesLoaded(WPARAM, LPARAM) { HookEvent(ME_MSG_BUTTONPRESSED, OnButtonPressed); - Icon_Register(g_plugin.getInst(), "TabSRMM/TranslitSwitcher", iconList, _countof(iconList)); + g_plugin.registerIcon("TabSRMM/TranslitSwitcher", iconList); BBButton bbd = {}; bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON; diff --git a/plugins/UserInfoEx/src/mir_icolib.cpp b/plugins/UserInfoEx/src/mir_icolib.cpp index 1c3aafa8a8..a1742bfde7 100644 --- a/plugins/UserInfoEx/src/mir_icolib.cpp +++ b/plugins/UserInfoEx/src/mir_icolib.cpp @@ -323,7 +323,7 @@ static IconItem common[] = void IcoLib_LoadModule() { - Icon_Register(g_plugin.getInst(), SECT_COMMON, common, 2); + g_plugin.registerIcon(SECT_COMMON, common); LPTSTR szDefaultFile = IcoLib_GetDefaultIconFileName(); IcoLib_CheckIconPackVersion(szDefaultFile); diff --git a/plugins/Variables/src/variables.cpp b/plugins/Variables/src/variables.cpp index fc7ea14a6e..76a6551c73 100644 --- a/plugins/Variables/src/variables.cpp +++ b/plugins/Variables/src/variables.cpp @@ -406,7 +406,10 @@ int setParseOptions(struct ParseOptions *po) return 0; } -static IconItem icon = { LPGEN("Help"), "vars_help", IDI_V }; +static IconItem iconList[] = +{ + { LPGEN("Help"), "vars_help", IDI_V } +}; int LoadVarModule() { @@ -422,7 +425,7 @@ int LoadVarModule() CreateServiceFunction(MS_VARS_SHOWHELP, showHelpService); CreateServiceFunction(MS_VARS_SHOWHELPEX, showHelpExService); - Icon_Register(g_plugin.getInst(), LPGEN("Variables"), &icon, 1); + g_plugin.registerIcon(LPGEN("Variables"), iconList); hIconsChangedHook = HookEvent(ME_SKIN2_ICONSCHANGED, iconsChanged); diff --git a/plugins/Weather/src/weather_icons.cpp b/plugins/Weather/src/weather_icons.cpp index cb11cd0232..aab1c1e562 100644 --- a/plugins/Weather/src/weather_icons.cpp +++ b/plugins/Weather/src/weather_icons.cpp @@ -39,7 +39,7 @@ static IconItem iconList[] = void InitIcons(void) { - Icon_Register(g_plugin.getInst(), WEATHERPROTONAME, iconList, _countof(iconList), WEATHERPROTONAME); + g_plugin.registerIcon(WEATHERPROTONAME, iconList, WEATHERPROTONAME); } HICON LoadIconEx(const char* name, bool big) diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp index ccfb301fc4..150d9e8a55 100644 --- a/plugins/YAMN/src/main.cpp +++ b/plugins/YAMN/src/main.cpp @@ -166,7 +166,7 @@ static IconItem iconList[] = void LoadIcons() { - Icon_Register(g_plugin.getInst(), "YAMN", iconList, _countof(iconList)); + g_plugin.registerIcon("YAMN", iconList); } HANDLE WINAPI g_GetIconHandle(int idx) diff --git a/plugins/YAPP/src/icons.cpp b/plugins/YAPP/src/icons.cpp index 3de365b928..0f0d5de0dd 100644 --- a/plugins/YAPP/src/icons.cpp +++ b/plugins/YAPP/src/icons.cpp @@ -1,11 +1,14 @@ #include "stdafx.h" -static IconItem iconList[] = +static IconItem iconList1[] = { // toolbar { LPGEN("Popups are enabled"), ICO_TB_POPUP_ON, IDI_POPUP }, - { LPGEN("Popups are disabled"), ICO_TB_POPUP_OFF, IDI_NOPOPUP }, + { LPGEN("Popups are disabled"), ICO_TB_POPUP_OFF, IDI_NOPOPUP } +}; +static IconItem iconList2[] = +{ // common { LPGEN("Popups are enabled"), ICO_POPUP_ON, IDI_POPUP }, { LPGEN("Popups are disabled"), ICO_POPUP_OFF, IDI_NOPOPUP }, @@ -14,6 +17,6 @@ static IconItem iconList[] = void InitIcons() { - Icon_Register(g_plugin.getInst(), SECT_TOLBAR, iconList, 2); - Icon_Register(g_plugin.getInst(), SECT_POPUP, iconList+2, 3); + g_plugin.registerIcon(SECT_TOLBAR, iconList1); + g_plugin.registerIcon(SECT_POPUP, iconList2); } diff --git a/protocols/Discord/src/main.cpp b/protocols/Discord/src/main.cpp index b8678f8179..1076f3f503 100644 --- a/protocols/Discord/src/main.cpp +++ b/protocols/Discord/src/main.cpp @@ -64,7 +64,7 @@ extern "C" int __declspec(dllexport) Load(void) g_hwndHeartbeat = CreateWindowEx(0, L"STATIC", nullptr, 0, 0, 0, 0, 0, nullptr, nullptr, nullptr, nullptr); - Icon_Register(g_plugin.getInst(), "Discord", g_iconList, _countof(g_iconList)); + g_plugin.registerIcon("Discord", g_iconList); return 0; } diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp index 1e857200d9..8766622708 100644 --- a/protocols/FacebookRM/src/theme.cpp +++ b/protocols/FacebookRM/src/theme.cpp @@ -54,7 +54,7 @@ static IconItem icons[] = void InitIcons(void) { - Icon_Register(g_plugin.getInst(), "Protocols/Facebook", icons, _countof(icons), "Facebook"); + g_plugin.registerIcon("Protocols/Facebook", icons, "Facebook"); } HANDLE GetIconHandle(const char* name) diff --git a/protocols/Gadu-Gadu/src/icolib.cpp b/protocols/Gadu-Gadu/src/icolib.cpp index 93cd157edc..23189ef17c 100644 --- a/protocols/Gadu-Gadu/src/icolib.cpp +++ b/protocols/Gadu-Gadu/src/icolib.cpp @@ -43,7 +43,7 @@ extern IconItem iconList[] = void gg_icolib_init() { - Icon_Register(g_plugin.getInst(), "Protocols/" GGDEF_PROTO, iconList, _countof(iconList), GGDEF_PROTO); + g_plugin.registerIcon("Protocols/" GGDEF_PROTO, iconList, GGDEF_PROTO); } HICON LoadIconEx(const char* name, bool big) diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index dc4a82a630..6f33f9b9d0 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -204,7 +204,7 @@ static IconItem iconList[] = void InitIcons(void) { - Icon_Register(g_plugin.getInst(), "Protocols/IRC", iconList, _countof(iconList), "IRC"); + g_plugin.registerIcon("Protocols/IRC", iconList, "IRC"); } HICON LoadIconEx(int iconId, bool big) diff --git a/protocols/IcqOscarJ/src/init.cpp b/protocols/IcqOscarJ/src/init.cpp index 81c973136a..bc84d3d8f5 100644 --- a/protocols/IcqOscarJ/src/init.cpp +++ b/protocols/IcqOscarJ/src/init.cpp @@ -94,7 +94,7 @@ extern "C" int __declspec(dllexport) Load(void) hExtraXStatus = ExtraIcon_RegisterIcolib("xstatus", LPGEN("ICQ xStatus"), "icq_xstatus13"); - Icon_Register(g_plugin.getInst(), "ICQ", iconList, _countof(iconList)); + g_plugin.registerIcon("ICQ", iconList); g_MenuInit(); return 0; diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index 05bb6107f4..62ed6e151e 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -522,10 +522,10 @@ static IconItem sharedIconList4[] = void g_IconsInit() { - Icon_Register(g_plugin.getInst(), LPGEN("Protocols") "/" LPGEN("Jabber"), sharedIconList1, _countof(sharedIconList1), GLOBAL_SETTING_PREFIX); - Icon_Register(g_plugin.getInst(), LPGEN("Protocols") "/" LPGEN("Jabber") "/" LPGEN("Dialogs"), sharedIconList2, _countof(sharedIconList2), GLOBAL_SETTING_PREFIX); - Icon_Register(g_plugin.getInst(), LPGEN("Protocols") "/" LPGEN("Dialogs") "/" LPGEN("Discovery"), sharedIconList3, _countof(sharedIconList3), GLOBAL_SETTING_PREFIX); - Icon_Register(g_plugin.getInst(), LPGEN("Protocols") "/" LPGEN("Dialogs") "/" LPGEN("Privacy"), sharedIconList4, _countof(sharedIconList4), GLOBAL_SETTING_PREFIX); + 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("Dialogs") "/" LPGEN("Discovery"), sharedIconList3, GLOBAL_SETTING_PREFIX); + g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("Dialogs") "/" LPGEN("Privacy"), sharedIconList4, GLOBAL_SETTING_PREFIX); } HANDLE g_GetIconHandle(int iconId) diff --git a/protocols/MRA/src/MraIcons.cpp b/protocols/MRA/src/MraIcons.cpp index 4a82300695..7acdd7e366 100644 --- a/protocols/MRA/src/MraIcons.cpp +++ b/protocols/MRA/src/MraIcons.cpp @@ -76,10 +76,10 @@ HICON IconLibGetIconEx(HANDLE hIcon, DWORD dwFlags) void IconsLoad() { - Icon_Register(g_plugin.getInst(), LPGEN("Protocols") "/" LPGEN("MRA"), gdiMainIcon, 1, "MRA_"); - Icon_Register(g_plugin.getInst(), LPGEN("Protocols") "/" LPGEN("MRA") "/" LPGEN("Main Menu"), gdiMenuItems, MAIN_MENU_ITEMS_COUNT, "MRA_"); - Icon_Register(g_plugin.getInst(), LPGEN("Protocols") "/" LPGEN("MRA") "/" LPGEN("Contact Menu"), gdiContactMenuItems, CONTACT_MENU_ITEMS_COUNT, "MRA_"); - Icon_Register(g_plugin.getInst(), LPGEN("Protocols") "/" LPGEN("MRA") "/" LPGEN("Extra status"), gdiExtraStatusIconsItems, ADV_ICON_MAX, "MRA_"); + g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("MRA"), gdiMainIcon, "MRA_"); + g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("MRA") "/" LPGEN("Main Menu"), gdiMenuItems, "MRA_"); + g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("MRA") "/" LPGEN("Contact Menu"), gdiContactMenuItems, "MRA_"); + g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("MRA") "/" LPGEN("Extra status"), gdiExtraStatusIconsItems, "MRA_"); g_hMainIcon = IconLibGetIcon(gdiMainIcon[0].hIcolib); } diff --git a/protocols/MSN/src/msn_opts.cpp b/protocols/MSN/src/msn_opts.cpp index 32b3c54cdc..8705bbf845 100644 --- a/protocols/MSN/src/msn_opts.cpp +++ b/protocols/MSN/src/msn_opts.cpp @@ -47,7 +47,7 @@ static IconItem iconList[] = void MsnInitIcons(void) { - Icon_Register(g_plugin.getInst(), "Protocols/MSN", iconList, _countof(iconList), "MSN"); + g_plugin.registerIcon("Protocols/MSN", iconList, "MSN"); } HICON LoadIconEx(const char* name, bool big) diff --git a/protocols/MinecraftDynmap/src/dialogs.cpp b/protocols/MinecraftDynmap/src/dialogs.cpp index 6bedca6e8b..ebacd9aa60 100644 --- a/protocols/MinecraftDynmap/src/dialogs.cpp +++ b/protocols/MinecraftDynmap/src/dialogs.cpp @@ -24,19 +24,19 @@ along with this program. If not, see . // Icons -static IconItem icons[] = { +static IconItem iconList[] = { { "proto", LPGEN("Protocol icon"), IDI_PROTO }, }; -static HANDLE hIconLibItem[_countof(icons)]; +static HANDLE hIconLibItem[_countof(iconList)]; void InitIcons(void) { - Icon_Register(g_plugin.getInst(), "Protocols/MinecraftDynmap", icons, _countof(icons), "MinecraftDynmap"); + g_plugin.registerIcon("Protocols/MinecraftDynmap", iconList, "MinecraftDynmap"); } HANDLE GetIconHandle(const char* name) { - for (size_t i = 0; i < _countof(icons); i++) { - if (strcmp(icons[i].szName, name) == 0) { + for (size_t i = 0; i < _countof(iconList); i++) { + if (strcmp(iconList[i].szName, name) == 0) { return hIconLibItem[i]; } } diff --git a/protocols/Omegle/src/theme.cpp b/protocols/Omegle/src/theme.cpp index 72af5190f4..fe8e19ca49 100644 --- a/protocols/Omegle/src/theme.cpp +++ b/protocols/Omegle/src/theme.cpp @@ -22,7 +22,7 @@ along with this program. If not, see . #include "stdafx.h" -static IconItem icons[] = +static IconItem iconList[] = { { LPGEN("Omegle Icon"), "omegle", IDI_OMEGLE }, { LPGEN("Stranger is typing"), "typing_on", IDI_TYPING_ON }, @@ -31,14 +31,14 @@ static IconItem icons[] = void InitIcons(void) { - Icon_Register(g_plugin.getInst(), "Protocols/Omegle", icons, _countof(icons), "Omegle"); + g_plugin.registerIcon("Protocols/Omegle", iconList, "Omegle"); } HANDLE GetIconHandle(const char* name) { - for (size_t i = 0; i < _countof(icons); i++) - if (mir_strcmp(icons[i].szName, name) == 0) - return icons[i].hIcolib; + for (auto &it : iconList) + if (mir_strcmp(it.szName, name) == 0) + return it.hIcolib; return nullptr; } diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp index d0214216c4..751bd183d0 100644 --- a/protocols/Sametime/src/sametime.cpp +++ b/protocols/Sametime/src/sametime.cpp @@ -83,7 +83,7 @@ static IconItem iconList[] = void SametimeInitIcons(void) { - Icon_Register(g_plugin.getInst(), "Protocols/Sametime", iconList, _countof(iconList), "SAMETIME"); + g_plugin.registerIcon("Protocols/Sametime", iconList, "SAMETIME"); } HANDLE GetIconHandle(int iconId) diff --git a/protocols/SkypeWeb/src/skype_icons.cpp b/protocols/SkypeWeb/src/skype_icons.cpp index 7aba64a40a..a1a51f2d63 100644 --- a/protocols/SkypeWeb/src/skype_icons.cpp +++ b/protocols/SkypeWeb/src/skype_icons.cpp @@ -17,27 +17,27 @@ along with this program. If not, see . #include "stdafx.h" -IconItemT CSkypeProto::Icons[] = +static IconItem iconList[] = { - { LPGENW("Protocol icon"), "main", IDI_SKYPE }, - { LPGENW("Create new chat icon"), "conference", IDI_CONFERENCE }, - { LPGENW("Sync history icon"), "synchistory", IDI_SYNCHISTORY }, - { LPGENW("Block user icon"), "user_block", IDI_BLOCKUSER }, - { LPGENW("Unblock user icon"), "user_unblock", IDI_UNBLOCKUSER }, - { LPGENW("Incoming call icon"), "inc_call", IDI_CALL }, - { LPGENW("Notification icon"), "notify", IDI_NOTIFY }, - { LPGENW("Error icon"), "error", IDI_ERRORICON }, - { LPGENW("Action icon"), "me_action", IDI_ACTION_ME } + { LPGEN("Protocol icon"), "main", IDI_SKYPE }, + { LPGEN("Create new chat icon"), "conference", IDI_CONFERENCE }, + { LPGEN("Sync history icon"), "synchistory", IDI_SYNCHISTORY }, + { LPGEN("Block user icon"), "user_block", IDI_BLOCKUSER }, + { LPGEN("Unblock user icon"), "user_unblock", IDI_UNBLOCKUSER }, + { LPGEN("Incoming call icon"), "inc_call", IDI_CALL }, + { LPGEN("Notification icon"), "notify", IDI_NOTIFY }, + { LPGEN("Error icon"), "error", IDI_ERRORICON }, + { LPGEN("Action icon"), "me_action", IDI_ACTION_ME } }; void CSkypeProto::InitIcons() { - Icon_RegisterT(g_plugin.getInst(), LPGENW("Protocols") L"/" _A2W(MODULE), Icons, _countof(Icons), MODULE); + g_plugin.registerIcon(LPGEN("Protocols") "/" MODULE, iconList, MODULE); } HICON CSkypeProto::GetIcon(int iconId) { - for (auto &it : Icons) + for (auto &it : iconList) if (it.defIconID == iconId) return IcoLib_GetIconByHandle(it.hIcolib); return nullptr; @@ -45,8 +45,8 @@ HICON CSkypeProto::GetIcon(int iconId) HANDLE CSkypeProto::GetIconHandle(int iconId) { - for (auto &it : Icons) + for (auto &it : iconList) if (it.defIconID == iconId) return it.hIcolib; return nullptr; -} \ No newline at end of file +} diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index bf704b4325..2950141d96 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -200,7 +200,6 @@ private: } // icons - static IconItemT Icons[]; static HICON GetIcon(int iconId); static HANDLE GetIconHandle(int iconId); diff --git a/protocols/Tox/src/tox_icons.cpp b/protocols/Tox/src/tox_icons.cpp index 762266799f..83c8f10f2b 100644 --- a/protocols/Tox/src/tox_icons.cpp +++ b/protocols/Tox/src/tox_icons.cpp @@ -1,20 +1,20 @@ #include "stdafx.h" -IconItemT CToxProto::Icons[] = +static IconItem iconList[] = { - { LPGENW("Protocol icon"), "main", IDI_TOX }, - { LPGENW("Action icon"), "main", IDI_ME }, - { LPGENW("Correction icon"), "edit", IDI_EDIT }, + { LPGEN("Protocol icon"), "main", IDI_TOX }, + { LPGEN("Action icon"), "main", IDI_ME }, + { LPGEN("Correction icon"), "edit", IDI_EDIT }, }; void CToxProto::InitIcons() { - Icon_RegisterT(g_plugin.getInst(), LPGENW("Protocols") L"/" _A2W(MODULE), Icons, _countof(Icons), MODULE); + g_plugin.registerIcon(LPGEN("Protocols") "/" MODULE, iconList, MODULE); } HANDLE CToxProto::GetIconHandle(int iconId) { - for (auto &it : Icons) + for (auto &it : iconList) if (it.defIconID == iconId) return it.hIcolib; return nullptr; @@ -22,7 +22,7 @@ HANDLE CToxProto::GetIconHandle(int iconId) HICON CToxProto::GetIcon(int iconId) { - for (auto &it : Icons) + for (auto &it : iconList) if (it.defIconID == iconId) return IcoLib_GetIconByHandle(it.hIcolib); return nullptr; diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h index 9e1ce07d97..3a67298871 100644 --- a/protocols/Tox/src/tox_proto.h +++ b/protocols/Tox/src/tox_proto.h @@ -125,7 +125,6 @@ private: void UninitNetlib(); // icons - static IconItemT Icons[]; static HANDLE GetIconHandle(int iconId); static HICON GetIcon(int iconId); diff --git a/protocols/Twitter/src/theme.cpp b/protocols/Twitter/src/theme.cpp index e3b967caf3..d30633d1fb 100644 --- a/protocols/Twitter/src/theme.cpp +++ b/protocols/Twitter/src/theme.cpp @@ -20,7 +20,7 @@ along with this program. If not, see . #include "theme.h" #include "proto.h" -static IconItem icons[] = +static IconItem iconList[] = { { LPGEN("Twitter Icon"), "twitter", IDI_TWITTER }, { LPGEN("Tweet"), "tweet", IDI_TWITTER }, @@ -38,13 +38,13 @@ void TwitterInitSounds(void) // TODO: uninit void InitIcons(void) { - Icon_Register(g_plugin.getInst(), "Protocols/Twitter", icons, _countof(icons), "Twitter"); - icons[_countof(icons) - 1].hIcolib = Skin_GetIconHandle(SKINICON_EVENT_URL); + g_plugin.registerIcon("Protocols/Twitter", iconList, "Twitter"); + iconList[_countof(iconList) - 1].hIcolib = Skin_GetIconHandle(SKINICON_EVENT_URL); } HANDLE GetIconHandle(const char *name) { - for (auto &it : icons) + for (auto &it : iconList) if (mir_strcmp(it.szName, name) == 0) return it.hIcolib; diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 79e9066c07..43ff4a5c0d 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -79,7 +79,7 @@ static IconItem iconList[] = void InitIcons() { - Icon_Register(g_plugin.getInst(), LPGEN("Protocols") "/" LPGEN("VKontakte"), iconList, _countof(iconList), "VKontakte"); + g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("VKontakte"), iconList, "VKontakte"); } HANDLE GetIconHandle(int iCommand) diff --git a/src/core/stdmsg/src/chat_options.cpp b/src/core/stdmsg/src/chat_options.cpp index 778d8f1af8..a5f0428519 100644 --- a/src/core/stdmsg/src/chat_options.cpp +++ b/src/core/stdmsg/src/chat_options.cpp @@ -135,7 +135,7 @@ static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM p // add icons to the skinning module -static IconItem iconList[] = +static IconItem iconList1[] = { { LPGEN("Window icon"), "chat_window", IDI_CHANMGR, 0 }, { LPGEN("Text color"), "chat_fgcol", IDI_COLOR, 0 }, @@ -158,8 +158,11 @@ static IconItem iconList[] = { LPGEN("Status 3 (10x10)"), "chat_status2", IDI_STATUS2, 10 }, { LPGEN("Status 4 (10x10)"), "chat_status3", IDI_STATUS3, 10 }, { LPGEN("Status 5 (10x10)"), "chat_status4", IDI_STATUS4, 10 }, - { LPGEN("Status 6 (10x10)"), "chat_status5", IDI_STATUS5, 10 }, + { LPGEN("Status 6 (10x10)"), "chat_status5", IDI_STATUS5, 10 } +}; +static IconItem iconList2[] = +{ { LPGEN("Message in (10x10)"), "chat_log_message_in", IDI_MESSAGE, 10 }, { LPGEN("Message out (10x10)"), "chat_log_message_out", IDI_MESSAGEOUT, 10 }, { LPGEN("Action (10x10)"), "chat_log_action", IDI_ACTION, 10 }, @@ -178,8 +181,8 @@ static IconItem iconList[] = void AddIcons(void) { - Icon_Register(g_plugin.getInst(), LPGEN("Messaging") "/" LPGEN("Group chats"), iconList, 21); - Icon_Register(g_plugin.getInst(), LPGEN("Messaging") "/" LPGEN("Group chats log"), iconList + 21, 14); + g_plugin.registerIcon(LPGEN("Messaging") "/" LPGEN("Group chats"), iconList1); + g_plugin.registerIcon(LPGEN("Messaging") "/" LPGEN("Group chats log"), iconList2); } // load icons from the skinning module if available diff --git a/src/core/stdmsg/src/globals.cpp b/src/core/stdmsg/src/globals.cpp index dd0ab36221..08a91a5d3b 100644 --- a/src/core/stdmsg/src/globals.cpp +++ b/src/core/stdmsg/src/globals.cpp @@ -30,7 +30,7 @@ IconItem iconList[] = static void InitIcons(void) { - Icon_Register(g_plugin.getInst(), LPGEN("Messaging"), iconList, _countof(iconList), "SRMM"); + g_plugin.registerIcon(LPGEN("Messaging"), iconList, "SRMM"); } static int IconsChanged(WPARAM, LPARAM) diff --git a/src/mir_app/src/ei_services.cpp b/src/mir_app/src/ei_services.cpp index 58db24bada..d1a7b7e395 100644 --- a/src/mir_app/src/ei_services.cpp +++ b/src/mir_app/src/ei_services.cpp @@ -487,7 +487,7 @@ void LoadExtraIconsModule() hEventExtraImageListRebuilding = CreateHookableEvent(ME_CLIST_EXTRA_LIST_REBUILD); // Icons - Icon_Register(g_plugin.getInst(), LPGEN("Contact list"), iconList, _countof(iconList)); + g_plugin.registerIcon(LPGEN("Contact list"), iconList); // Hooks HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded); diff --git a/src/mir_app/src/meta_main.cpp b/src/mir_app/src/meta_main.cpp index 06b3249d06..0527101346 100644 --- a/src/mir_app/src/meta_main.cpp +++ b/src/mir_app/src/meta_main.cpp @@ -64,7 +64,7 @@ static int RegisterMeta(WPARAM, LPARAM) int LoadMetacontacts(void) { - Icon_Register(g_plugin.getInst(), LPGEN("MetaContacts"), iconList, _countof(iconList), "mc"); + g_plugin.registerIcon(LPGEN("MetaContacts"), iconList, "mc"); db_set_resident(META_PROTO, "Status"); db_set_resident(META_PROTO, "IdleTS"); -- cgit v1.2.3