summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/newpluginapi.h1
-rw-r--r--libs/win32/mir_app.libbin167958 -> 168304 bytes
-rw-r--r--libs/win64/mir_app.libbin163142 -> 163502 bytes
-rw-r--r--plugins/AddContactPlus/src/main.cpp2
-rw-r--r--plugins/Alarms/src/alarms.cpp2
-rw-r--r--plugins/AutoShutdown/src/settingsdlg.cpp2
-rw-r--r--plugins/BasicHistory/src/BasicHistory.cpp2
-rw-r--r--plugins/BossKeyPlus/src/BossKey.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_toolbar.cpp2
-rw-r--r--plugins/Clist_nicer/src/CLCButton.cpp2
-rw-r--r--plugins/Console/src/Console.cpp2
-rw-r--r--plugins/CrashDumper/src/crshdmp.cpp8
-rw-r--r--plugins/DbEditorPP/src/main.cpp2
-rw-r--r--plugins/ExternalAPI/m_toptoolbar.h4
-rw-r--r--plugins/FavContacts/src/services.cpp2
-rw-r--r--plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp2
-rw-r--r--plugins/ListeningTo/src/listeningto.cpp2
-rw-r--r--plugins/NewAwaySysMod/src/AwaySys.cpp2
-rw-r--r--plugins/NewXstatusNotify/src/main.cpp2
-rw-r--r--plugins/NewsAggregator/Src/Services.cpp2
-rw-r--r--plugins/NotesAndReminders/src/main.cpp4
-rw-r--r--plugins/OpenFolder/src/openFolder.cpp2
-rw-r--r--plugins/Popup/src/main.cpp2
-rw-r--r--plugins/Quotes/src/Forex.cpp4
-rw-r--r--plugins/RecentContacts/src/RecentContacts.cpp2
-rw-r--r--plugins/Sessions/Src/Main.cpp8
-rw-r--r--plugins/SimpleStatusMsg/src/main.cpp2
-rw-r--r--plugins/StartupSilence/src/main.cpp2
-rw-r--r--plugins/StatusManager/src/StartupStatus/ss_toolbars.cpp2
-rw-r--r--plugins/TabSRMM/src/globals.cpp4
-rw-r--r--plugins/TopToolBar/src/InternalButtons.cpp22
-rw-r--r--plugins/TopToolBar/src/toolbar.cpp2
-rw-r--r--plugins/UserInfoEx/src/dlg_anniversarylist.cpp2
-rw-r--r--plugins/UserInfoEx/src/svc_reminder.cpp2
-rw-r--r--plugins/Weather/src/weather.cpp2
-rw-r--r--plugins/WhenWasIt/src/hooked_events.cpp2
-rw-r--r--plugins/WhoUsesMyFiles/src/wumfplug.cpp2
-rw-r--r--plugins/YAMN/src/services.cpp2
-rw-r--r--plugins/YAPP/src/yapp.cpp2
-rw-r--r--protocols/FacebookRM/src/proto.cpp2
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp6
-rw-r--r--src/mir_app/src/CMPluginBase.cpp5
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
-rw-r--r--src/mir_app/src/stdafx.h1
45 files changed, 68 insertions, 61 deletions
diff --git a/include/newpluginapi.h b/include/newpluginapi.h
index 50ce94b720..dfbadd3cb1 100644
--- a/include/newpluginapi.h
+++ b/include/newpluginapi.h
@@ -202,6 +202,7 @@ public:
void openOptionsPage(const wchar_t *pszGroup, const wchar_t *pszPage = 0, const wchar_t *pszTab = 0);
HANDLE addIcon(const struct SKINICONDESC*);
+ HANDLE addTTB(const struct TTBButton*);
HGENMENU addRootMenu(int hMenuObject, LPCWSTR ptszName, int position, HANDLE hIcoLib = nullptr);
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib
index 4ac19ab691..a72867ee63 100644
--- a/libs/win32/mir_app.lib
+++ b/libs/win32/mir_app.lib
Binary files differ
diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib
index d0f643e582..bfd5549310 100644
--- a/libs/win64/mir_app.lib
+++ b/libs/win64/mir_app.lib
Binary files differ
diff --git a/plugins/AddContactPlus/src/main.cpp b/plugins/AddContactPlus/src/main.cpp
index 511b7acdd3..977ef6d80a 100644
--- a/plugins/AddContactPlus/src/main.cpp
+++ b/plugins/AddContactPlus/src/main.cpp
@@ -116,7 +116,7 @@ static int CreateButton(WPARAM, LPARAM)
tbb.pszService = MS_ADDCONTACTPLUS_SHOW;
tbb.name = tbb.pszTooltipUp = LPGEN("Add contact");
tbb.hIconHandleUp = icon[0].hIcolib;
- hToolBarItem = TopToolbar_AddButton(&tbb);
+ hToolBarItem = g_plugin.addTTB(&tbb);
return 0;
}
diff --git a/plugins/Alarms/src/alarms.cpp b/plugins/Alarms/src/alarms.cpp
index b879feb9f1..205fffe53e 100644
--- a/plugins/Alarms/src/alarms.cpp
+++ b/plugins/Alarms/src/alarms.cpp
@@ -130,7 +130,7 @@ static int InitTopToolbarButton(WPARAM, LPARAM)
ttb.pszService = MODULENAME "/NewAlarm";
ttb.dwFlags = TTBBF_VISIBLE;
ttb.name = ttb.pszTooltipUp = LPGEN("Set alarm");
- hTopToolbarButton = TopToolbar_AddButton(&ttb);
+ hTopToolbarButton = g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp
index c9faec75f4..f209b13bad 100644
--- a/plugins/AutoShutdown/src/settingsdlg.cpp
+++ b/plugins/AutoShutdown/src/settingsdlg.cpp
@@ -416,7 +416,7 @@ int ToolbarLoaded(WPARAM, LPARAM)
ttb.name = LPGEN("Start/Stop automatic shutdown");
ttb.pszTooltipUp = LPGEN("Start automatic shutdown");
ttb.pszTooltipDn = LPGEN("Stop automatic shutdown");
- hToolbarButton = TopToolbar_AddButton(&ttb);
+ hToolbarButton = g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/plugins/BasicHistory/src/BasicHistory.cpp b/plugins/BasicHistory/src/BasicHistory.cpp
index feda8d28bd..e462a13ed0 100644
--- a/plugins/BasicHistory/src/BasicHistory.cpp
+++ b/plugins/BasicHistory/src/BasicHistory.cpp
@@ -89,7 +89,7 @@ int ToolbarModuleLoaded(WPARAM, LPARAM)
ttb.name = ttb.pszTooltipUp = LPGEN("Open History");
ttb.dwFlags = TTBBF_SHOWTOOLTIP;
ttb.hIconHandleUp = Skin_GetIconHandle(SKINICON_OTHER_HISTORY);
- hToolbarButton = TopToolbar_AddButton(&ttb);
+ hToolbarButton = g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp
index 16623446f8..96c42f0dcd 100644
--- a/plugins/BossKeyPlus/src/BossKey.cpp
+++ b/plugins/BossKeyPlus/src/BossKey.cpp
@@ -567,7 +567,7 @@ static int TopToolbarInit(WPARAM, LPARAM)
ttb.pszTooltipUp = ttb.name = LPGEN("Hide Miranda NG");
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
ttb.hIconHandleUp = iconList[0].hIcolib;
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp
index fd130ab68b..6df8c36016 100644
--- a/plugins/Clist_modern/src/modern_toolbar.cpp
+++ b/plugins/Clist_modern/src/modern_toolbar.cpp
@@ -82,7 +82,7 @@ void Modern_InitButtons()
else tbb.dwFlags |= TTBBF_ISSEPARATOR;
tbb.dwFlags |= (BTNS[i].bVisByDefault ? TTBBF_VISIBLE : 0);
- BTNS[i].hButton = TopToolbar_AddButton(&tbb);
+ BTNS[i].hButton = g_plugin.addTTB(&tbb);
}
SetButtonPressed(3, db_get_b(0, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT));
diff --git a/plugins/Clist_nicer/src/CLCButton.cpp b/plugins/Clist_nicer/src/CLCButton.cpp
index e22b9c53b0..e49c935939 100644
--- a/plugins/Clist_nicer/src/CLCButton.cpp
+++ b/plugins/Clist_nicer/src/CLCButton.cpp
@@ -61,7 +61,7 @@ static void InitDefaultButtons()
else tbb.dwFlags |= TTBBF_ISSEPARATOR;
tbb.dwFlags |= (BTNS[i].isVis ? TTBBF_VISIBLE : 0);
- BTNS[i].hButton = TopToolbar_AddButton(&tbb);
+ BTNS[i].hButton = g_plugin.addTTB(&tbb);
}
g_index = -1;
diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp
index 0d317a5615..17c1be2363 100644
--- a/plugins/Console/src/Console.cpp
+++ b/plugins/Console/src/Console.cpp
@@ -127,7 +127,7 @@ static int OnTTBLoaded(WPARAM, LPARAM)
ttb.name = LPGEN("Show/Hide Console");
ttb.pszTooltipDn = LPGEN("Hide Console");
ttb.pszTooltipUp = LPGEN("Show Console");
- hTTBButt = TopToolbar_AddButton(&ttb);
+ hTTBButt = g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/plugins/CrashDumper/src/crshdmp.cpp b/plugins/CrashDumper/src/crshdmp.cpp
index 82113cd663..726eae0d5a 100644
--- a/plugins/CrashDumper/src/crshdmp.cpp
+++ b/plugins/CrashDumper/src/crshdmp.cpp
@@ -224,23 +224,23 @@ static int ToolbarModulesLoaded(WPARAM, LPARAM)
ttb.name = ttb.pszTooltipUp = LPGEN("Version Information To Clipboard");
ttb.hIconHandleUp = GetIconHandle(IDI_VITOCLIP);
ttb.dwFlags = TTBBF_VISIBLE;
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
ttb.pszService = MS_CRASHDUMPER_STORETOFILE;
ttb.name = ttb.pszTooltipUp = LPGEN("Version Information To File");
ttb.hIconHandleUp = GetIconHandle(IDI_VITOFILE);
ttb.dwFlags = 0;
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
ttb.pszService = MS_CRASHDUMPER_VIEWINFO;
ttb.name = ttb.pszTooltipUp = LPGEN("Show Version Information");
ttb.hIconHandleUp = GetIconHandle(IDI_VISHOW);
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
ttb.pszService = MS_CRASHDUMPER_UPLOAD;
ttb.name = ttb.pszTooltipUp = LPGEN("Upload Version Information");
ttb.hIconHandleUp = GetIconHandle(IDI_VIUPLOAD);
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp
index 8a154fd2b7..d06526d0c3 100644
--- a/plugins/DbEditorPP/src/main.cpp
+++ b/plugins/DbEditorPP/src/main.cpp
@@ -98,7 +98,7 @@ static int OnTTBLoaded(WPARAM, LPARAM)
ttb.name = LPGEN("Database Editor++");
ttb.hIconHandleUp = GetIcoLibHandle(ICO_DBE_BUTT);
ttb.pszTooltipUp = LPGEN("Open Database Editor");
- hTTBButt = TopToolbar_AddButton(&ttb);
+ hTTBButt = g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/plugins/ExternalAPI/m_toptoolbar.h b/plugins/ExternalAPI/m_toptoolbar.h
index cf0d90c609..64aea6c305 100644
--- a/plugins/ExternalAPI/m_toptoolbar.h
+++ b/plugins/ExternalAPI/m_toptoolbar.h
@@ -62,9 +62,7 @@ lparam = hLangpack
returns: hTTBButton - handle of added button on success, -1 on failure.
*/
-__forceinline HANDLE TopToolbar_AddButton(TTBButton *pButton)
-{ return (HANDLE)CallService("TopToolBar/AddButton", (WPARAM)pButton, hLangpack);
-}
+#define MS_TTB_ADDBUTTON "TopToolBar/AddButton"
/*
toptoolbar/removebutton service
diff --git a/plugins/FavContacts/src/services.cpp b/plugins/FavContacts/src/services.cpp
index 1d989d81f4..a6959164c1 100644
--- a/plugins/FavContacts/src/services.cpp
+++ b/plugins/FavContacts/src/services.cpp
@@ -117,7 +117,7 @@ int ProcessTBLoaded(WPARAM, LPARAM)
ttb.pszService = MS_FAVCONTACTS_SHOWMENU;
ttb.dwFlags = TTBBF_SHOWTOOLTIP | TTBBF_VISIBLE;
ttb.hIconHandleUp = iconList[0].hIcolib;
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp b/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp
index 589264af6b..130bcb8e5d 100644
--- a/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp
+++ b/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp
@@ -126,7 +126,7 @@ int initializeOptions(WPARAM wParam, LPARAM)
OptDlgPg.szGroup.w = LPGENW("Customize");
OptDlgPg.szTitle.w = LPGENW("Hardware HotKeys");
OptDlgPg.pfnDlgProc = OptDlgProc;
- OptDlgPg.langId = hLangpack;
+ OptDlgPg.langId = g_plugin.m_hLang;
g_plugin.addOptions(wParam, &OptDlgPg);
return 0;
}
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp
index 52015e80de..f65198e41e 100644
--- a/plugins/ListeningTo/src/listeningto.cpp
+++ b/plugins/ListeningTo/src/listeningto.cpp
@@ -353,7 +353,7 @@ int TopToolBarLoaded(WPARAM, LPARAM)
ttb.name = LPGEN("Enable/Disable sending Listening To info (to all protocols)");
ttb.pszTooltipDn = LPGEN("Disable ListeningTo (to all protocols)");
ttb.pszTooltipUp = LPGEN("Enable ListeningTo (to all protocols)");
- hTTB = TopToolbar_AddButton(&ttb);
+ hTTB = g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp
index 04a1d980e4..022598fbec 100644
--- a/plugins/NewAwaySysMod/src/AwaySys.cpp
+++ b/plugins/NewAwaySysMod/src/AwaySys.cpp
@@ -435,7 +435,7 @@ static int Create_TopToolbar(WPARAM, LPARAM)
ttbb.dwFlags = TTBBF_SHOWTOOLTIP | TTBBF_ASPUSHBUTTON | TTBBF_VISIBLE;
ttbb.pszTooltipDn = LPGEN("Toggle autoreply off");
ttbb.pszTooltipUp = LPGEN("Toggle autoreply on");
- g_hTopToolbarbutton = TopToolbar_AddButton(&ttbb);
+ g_hTopToolbarbutton = g_plugin.addTTB(&ttbb);
CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)g_hTopToolbarbutton, SendOnEvent ? TTBST_PUSHED : 0);
}
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp
index 7b262ccaf3..833cb39c98 100644
--- a/plugins/NewXstatusNotify/src/main.cpp
+++ b/plugins/NewXstatusNotify/src/main.cpp
@@ -1119,7 +1119,7 @@ static int InitTopToolbar(WPARAM, LPARAM)
tbb.hIconHandleDn = iconList[4].hIcolib;
tbb.pszTooltipUp = LPGEN("Enable status notification");
tbb.pszTooltipDn = LPGEN("Disable status notification");
- hToolbarButton = TopToolbar_AddButton(&tbb);
+ hToolbarButton = g_plugin.addTTB(&tbb);
return 0;
}
diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp
index 4341b57672..852f316517 100644
--- a/plugins/NewsAggregator/Src/Services.cpp
+++ b/plugins/NewsAggregator/Src/Services.cpp
@@ -260,6 +260,6 @@ int OnToolbarLoaded(WPARAM, LPARAM)
ttb.hIconHandleUp = GetIconHandle("enabled");
ttb.hIconHandleDn = GetIconHandle("disabled");
ttb.dwFlags = (db_get_b(NULL, MODULENAME, "AutoUpdate", 1) ? 0 : TTBBF_PUSHED) | TTBBF_ASPUSHBUTTON | TTBBF_VISIBLE;
- hTBButton = TopToolbar_AddButton(&ttb);
+ hTBButton = g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/plugins/NotesAndReminders/src/main.cpp b/plugins/NotesAndReminders/src/main.cpp
index 008ffc7728..4920585a30 100644
--- a/plugins/NotesAndReminders/src/main.cpp
+++ b/plugins/NotesAndReminders/src/main.cpp
@@ -146,12 +146,12 @@ int OnTopToolBarInit(WPARAM, LPARAM)
ttb.hIconHandleUp = iconList[14].hIcolib;
ttb.pszService = MODULENAME"/MenuCommandAddNew";
ttb.name = ttb.pszTooltipUp = LPGEN("Add New Note");
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
ttb.hIconHandleUp = iconList[15].hIcolib;
ttb.pszService = MODULENAME"/MenuCommandNewReminder";
ttb.name = ttb.pszTooltipUp = LPGEN("Add New Reminder");
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
UnhookEvent(hkTopToolbarInit);
return 0;
diff --git a/plugins/OpenFolder/src/openFolder.cpp b/plugins/OpenFolder/src/openFolder.cpp
index af4305c31b..0e59b6e0f1 100644
--- a/plugins/OpenFolder/src/openFolder.cpp
+++ b/plugins/OpenFolder/src/openFolder.cpp
@@ -65,7 +65,7 @@ static int ToptoolBarHook(WPARAM, LPARAM)
ttb.pszService = MS_OPENFOLDER_OPEN;
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
ttb.name = LPGEN("Open Folder");
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp
index b50b1a1025..f2078009ff 100644
--- a/plugins/Popup/src/main.cpp
+++ b/plugins/Popup/src/main.cpp
@@ -135,7 +135,7 @@ static int TTBLoaded(WPARAM, LPARAM)
ttb.hIconHandleDn = GetIconHandle(IDI_POPUP);
ttb.pszTooltipUp = LPGEN("Enable Popups");
ttb.pszTooltipDn = LPGEN("Disable Popups");
- hTTButton = TopToolbar_AddButton(&ttb);
+ hTTButton = g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp
index 43a1bea703..74d8350ff4 100644
--- a/plugins/Quotes/src/Forex.cpp
+++ b/plugins/Quotes/src/Forex.cpp
@@ -161,7 +161,7 @@ int Quotes_OnToolbarLoaded(WPARAM, LPARAM)
ttb.hIconHandleUp = Quotes_GetIconHandle(IDI_ICON_MAIN);
ttb.hIconHandleDn = Quotes_GetIconHandle(IDI_ICON_DISABLED);
ttb.dwFlags = ((g_bAutoUpdate) ? 0 : TTBBF_PUSHED) | TTBBF_ASPUSHBUTTON | TTBBF_VISIBLE;
- g_hTBButton = TopToolbar_AddButton(&ttb);
+ g_hTBButton = g_plugin.addTTB(&ttb);
ttb.name = LPGEN("Currency Converter");
ttb.pszService = g_pszCurrencyConverter;
@@ -170,7 +170,7 @@ int Quotes_OnToolbarLoaded(WPARAM, LPARAM)
ttb.hIconHandleUp = Quotes_GetIconHandle(IDI_ICON_CURRENCY_CONVERTER);
ttb.hIconHandleDn = Quotes_GetIconHandle(IDI_ICON_CURRENCY_CONVERTER);
ttb.dwFlags = TTBBF_VISIBLE;
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp
index 8e657293a8..bcc97730bb 100644
--- a/plugins/RecentContacts/src/RecentContacts.cpp
+++ b/plugins/RecentContacts/src/RecentContacts.cpp
@@ -439,7 +439,7 @@ int Create_TopToolbarShowList(WPARAM, LPARAM)
ttb.pszService = msLastUC_ShowList;
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
ttb.name = ttb.pszTooltipUp = LPGEN("Recent Contacts");
- hTopToolbarButtonShowList = TopToolbar_AddButton(&ttb);
+ hTopToolbarButtonShowList = g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp
index d7167fd294..f71d304ec8 100644
--- a/plugins/Sessions/Src/Main.cpp
+++ b/plugins/Sessions/Src/Main.cpp
@@ -716,22 +716,22 @@ static int CreateButtons(WPARAM, LPARAM)
ttb.pszService = MS_SESSIONS_OPENMANAGER;
ttb.pszTooltipUp = ttb.name = LPGEN("Open Sessions Manager");
ttb.hIconHandleUp = iconList[3].hIcolib;
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
ttb.pszService = MS_SESSIONS_SAVEUSERSESSION;
ttb.pszTooltipUp = ttb.name = LPGEN("Save Session");
ttb.hIconHandleUp = iconList[4].hIcolib;
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
ttb.pszService = MS_SESSIONS_RESTORELASTSESSION;
ttb.pszTooltipUp = ttb.name = LPGEN("Restore Last Session");
ttb.hIconHandleUp = iconList[5].hIcolib;
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
ttb.pszService = MS_SESSIONS_SHOWFAVORITESMENU;
ttb.pszTooltipUp = ttb.name = LPGEN("Show Favorite Sessions Menu");
ttb.hIconHandleUp = iconList[1].hIcolib;
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp
index ea68d2db5b..e38795f6a5 100644
--- a/plugins/SimpleStatusMsg/src/main.cpp
+++ b/plugins/SimpleStatusMsg/src/main.cpp
@@ -1235,7 +1235,7 @@ static int AddTopToolbarButton(WPARAM, LPARAM)
tbb.pszService = MS_SIMPLESTATUSMSG_SHOWDIALOGINT;
tbb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
tbb.name = tbb.pszTooltipUp = LPGEN("Change status message");
- hTTBButton = TopToolbar_AddButton(&tbb);
+ hTTBButton = g_plugin.addTTB(&tbb);
ReleaseIconEx("csmsg");
return 0;
diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp
index fd5523e304..48b121d72c 100644
--- a/plugins/StartupSilence/src/main.cpp
+++ b/plugins/StartupSilence/src/main.cpp
@@ -283,7 +283,7 @@ static int CreateTTButtons(WPARAM, LPARAM)
ttb.name = TTBNAME;
ttb.pszTooltipUp = SS_IS_ON;
ttb.pszTooltipDn = SS_IS_OFF;
- Buttons = TopToolbar_AddButton(&ttb);
+ Buttons = g_plugin.addTTB(&ttb);
if (Buttons)
ttbButtons.insert(Buttons);
return 0;
diff --git a/plugins/StatusManager/src/StartupStatus/ss_toolbars.cpp b/plugins/StatusManager/src/StartupStatus/ss_toolbars.cpp
index 262637468e..af1091a023 100644
--- a/plugins/StatusManager/src/StartupStatus/ss_toolbars.cpp
+++ b/plugins/StatusManager/src/StartupStatus/ss_toolbars.cpp
@@ -63,7 +63,7 @@ int CreateTopToolbarButtons(WPARAM, LPARAM)
ttb.hIconHandleUp = iconList[1].hIcolib;
ttb.wParamDown = ttb.wParamUp = i;
ttb.name = ttb.pszTooltipUp = dbv.pszVal;
- HANDLE ttbAddResult = TopToolbar_AddButton(&ttb);
+ HANDLE ttbAddResult = g_plugin.addTTB(&ttb);
if (ttbAddResult)
ttbButtons.insert(ttbAddResult);
db_free(&dbv);
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index 21f06355c8..b581b21121 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -253,13 +253,13 @@ int CGlobals::TopToolbarLoaded(WPARAM, LPARAM)
ttb.name = "TabSRMM session list";
ttb.pszTooltipUp = LPGEN("TabSRMM session list");
ttb.hIconHandleUp = IcoLib_GetIcon("tabSRMM_sb_slist");
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
ttb.name = "TabSRMM Menu";
ttb.pszTooltipUp = LPGEN("TabSRMM menu");
ttb.lParamUp = ttb.lParamDown = 1;
ttb.hIconHandleUp = IcoLib_GetIcon("tabSRMM_container");
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/plugins/TopToolBar/src/InternalButtons.cpp b/plugins/TopToolBar/src/InternalButtons.cpp
index c4171d781d..56c3714919 100644
--- a/plugins/TopToolBar/src/InternalButtons.cpp
+++ b/plugins/TopToolBar/src/InternalButtons.cpp
@@ -74,7 +74,7 @@ void InitInternalButtons()
ttb.pszTooltipUp = LPGEN("Show main menu");
ttb.hIconHandleUp = Skin_GetIconHandle(SKINICON_OTHER_MAINMENU);
ttb.wParamUp = 1;
- hMainMenu = TopToolbar_AddButton(&ttb);
+ hMainMenu = g_plugin.addTTB(&ttb);
ttb.name = LPGEN("Show options page");
ttb.pszService = "Options/OptionsCommand";
@@ -82,28 +82,28 @@ void InitInternalButtons()
ttb.pszTooltipUp = LPGEN("Show options page");
ttb.hIconHandleUp = Skin_GetIconHandle(SKINICON_OTHER_OPTIONS);
ttb.wParamUp = 0;
- hOptions = TopToolbar_AddButton(&ttb);
+ hOptions = g_plugin.addTTB(&ttb);
ttb.name = LPGEN("Show accounts manager");
ttb.pszService = "Protos/ShowAccountManager";
ttb.dwFlags = TTBBF_INTERNAL;
ttb.pszTooltipUp = LPGEN("Show accounts manager");
ttb.hIconHandleUp = Skin_GetIconHandle(SKINICON_OTHER_ACCMGR);
- hAccManager = TopToolbar_AddButton(&ttb);
+ hAccManager = g_plugin.addTTB(&ttb);
ttb.name = LPGEN("Find/add contacts");
ttb.pszService = MS_FINDADD_FINDADD;
ttb.dwFlags = TTBBF_INTERNAL | TTBBF_VISIBLE;
ttb.pszTooltipUp = LPGEN("Find/add contacts");
ttb.hIconHandleUp = Skin_GetIconHandle(SKINICON_OTHER_FINDUSER);
- hFindAdd = TopToolbar_AddButton(&ttb);
+ hFindAdd = g_plugin.addTTB(&ttb);
ttb.name = LPGEN("Show status menu");
ttb.pszService = TTBI_STATUSMENUBUTT;
ttb.dwFlags = TTBBF_INTERNAL;
ttb.pszTooltipUp = LPGEN("Show status menu");
ttb.hIconHandleUp = Skin_GetIconHandle(SKINICON_OTHER_STATUS);
- hStatusMenu = TopToolbar_AddButton(&ttb);
+ hStatusMenu = g_plugin.addTTB(&ttb);
ttb.name = LPGEN("Show/hide offline contacts");
ttb.pszService = MS_CLIST_TOGGLEHIDEOFFLINE;
@@ -113,7 +113,7 @@ void InitInternalButtons()
ttb.hIconHandleDn = ttb.hIconHandleUp = nullptr;
ttb.hIconUp = IcoLib_GetIconByHandle(iconList[1].hIcolib);
ttb.hIconDn = IcoLib_GetIconByHandle(iconList[2].hIcolib);
- hShowHideOffline = TopToolbar_AddButton(&ttb);
+ hShowHideOffline = g_plugin.addTTB(&ttb);
ttb.name = LPGEN("Enable/disable metacontacts");
ttb.pszService = "MetaContacts/OnOff";
@@ -122,7 +122,7 @@ void InitInternalButtons()
ttb.pszTooltipUp = LPGEN("Disable metacontacts");
ttb.hIconUp = IcoLib_GetIconByHandle(iconList[7].hIcolib);
ttb.hIconDn = IcoLib_GetIconByHandle(iconList[8].hIcolib);
- hMetaContacts = TopToolbar_AddButton(&ttb);
+ hMetaContacts = g_plugin.addTTB(&ttb);
ttb.name = LPGEN("Enable/disable groups");
ttb.pszService = MS_CLIST_TOGGLEGROUPS;
@@ -131,7 +131,7 @@ void InitInternalButtons()
ttb.pszTooltipUp = LPGEN("Enable groups");
ttb.hIconUp = IcoLib_GetIconByHandle(iconList[3].hIcolib);
ttb.hIconDn = IcoLib_GetIconByHandle(iconList[4].hIcolib);
- hGroups = TopToolbar_AddButton(&ttb);
+ hGroups = g_plugin.addTTB(&ttb);
ttb.name = LPGEN("Enable/disable sounds");
ttb.pszService = TTBI_SOUNDSONOFF;
@@ -140,7 +140,7 @@ void InitInternalButtons()
ttb.pszTooltipUp = LPGEN("Disable sounds");
ttb.hIconUp = IcoLib_GetIconByHandle(iconList[5].hIcolib);
ttb.hIconDn = IcoLib_GetIconByHandle(iconList[6].hIcolib);
- hSounds = TopToolbar_AddButton(&ttb);
+ hSounds = g_plugin.addTTB(&ttb);
ttb.name = LPGEN("Minimize contact list");
ttb.pszService = "Clist/ShowHide";
@@ -149,14 +149,14 @@ void InitInternalButtons()
ttb.hIconHandleUp = Skin_GetIconHandle(SKINICON_OTHER_SHOWHIDE);
ttb.pszTooltipDn = nullptr;
ttb.hIconUp = ttb.hIconDn = nullptr;
- hMinimize = TopToolbar_AddButton(&ttb);
+ hMinimize = g_plugin.addTTB(&ttb);
ttb.name = LPGEN("Exit");
ttb.pszService = "CloseAction";
ttb.dwFlags = TTBBF_INTERNAL;
ttb.pszTooltipUp = LPGEN("Exit");
ttb.hIconHandleUp = Skin_GetIconHandle(SKINICON_OTHER_EXIT);
- hExit = TopToolbar_AddButton(&ttb);
+ hExit = g_plugin.addTTB(&ttb);
CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hShowHideOffline,
db_get_b(NULL, "CList", "HideOffline", 0) ? 0 : TTBST_PUSHED);
diff --git a/plugins/TopToolBar/src/toolbar.cpp b/plugins/TopToolBar/src/toolbar.cpp
index 5fab8accab..195d0e5f05 100644
--- a/plugins/TopToolBar/src/toolbar.cpp
+++ b/plugins/TopToolBar/src/toolbar.cpp
@@ -650,7 +650,7 @@ int LoadToolbarModule()
hTTBModuleLoaded = CreateHookableEvent(ME_TTB_MODULELOADED);
- CreateServiceFunction("TopToolBar/AddButton", TTBAddButton);
+ CreateServiceFunction(MS_TTB_ADDBUTTON, TTBAddButton);
CreateServiceFunction(MS_TTB_REMOVEBUTTON, TTBRemoveButton);
CreateServiceFunction(MS_TTB_SETBUTTONSTATE, TTBSetState);
diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp
index d2a3ba0439..d784a00ee8 100644
--- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp
+++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp
@@ -963,7 +963,7 @@ void DlgAnniversaryListOnTopToolBarLoaded()
ttb.pszService = MS_USERINFO_REMINDER_LIST;
ttb.hIconHandleUp = IcoLib_GetIconHandle(ICO_COMMON_ANNIVERSARY);
ttb.name = ttb.pszTooltipUp = LPGEN("Anniversary list");
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
}
/**
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp
index 2da0ae3ff6..9b1b7a9f8b 100644
--- a/plugins/UserInfoEx/src/svc_reminder.cpp
+++ b/plugins/UserInfoEx/src/svc_reminder.cpp
@@ -683,7 +683,7 @@ void SvcReminderOnTopToolBarLoaded()
ttb.pszService = MS_USERINFO_REMINDER_CHECK;
ttb.name = ttb.pszTooltipUp = LPGEN("Check anniversaries");
ttb.hIconHandleUp = IcoLib_GetIconHandle(ICO_COMMON_BIRTHDAY);
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
}
/***********************************************************************************************************
diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp
index bcd9f118aa..e3877ebd95 100644
--- a/plugins/Weather/src/weather.cpp
+++ b/plugins/Weather/src/weather.cpp
@@ -121,7 +121,7 @@ int OnToolbarLoaded(WPARAM, LPARAM)
ttb.hIconHandleUp = GetIconHandle("main");
ttb.hIconHandleDn = GetIconHandle("disabled");
ttb.dwFlags = (db_get_b(NULL, WEATHERPROTONAME, "AutoUpdate", 1) ? 0 : TTBBF_PUSHED) | TTBBF_ASPUSHBUTTON | TTBBF_VISIBLE;
- hTBButton = TopToolbar_AddButton(&ttb);
+ hTBButton = g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/plugins/WhenWasIt/src/hooked_events.cpp b/plugins/WhenWasIt/src/hooked_events.cpp
index 2c15367319..3d3065c969 100644
--- a/plugins/WhenWasIt/src/hooked_events.cpp
+++ b/plugins/WhenWasIt/src/hooked_events.cpp
@@ -36,7 +36,7 @@ static int OnTopToolBarModuleLoaded(WPARAM, LPARAM)
ttb.pszService = MS_WWI_CHECK_BIRTHDAYS;
ttb.hIconHandleUp = hCheckMenu;
ttb.name = ttb.pszTooltipUp = LPGEN("Check for birthdays");
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp
index 8259d85c45..cfe8daf6b4 100644
--- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp
+++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp
@@ -216,7 +216,7 @@ int InitTopToolbar(WPARAM, LPARAM)
ttb.pszService = MS_WUMF_CONNECTIONSSHOW;
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
ttb.name = ttb.pszTooltipUp = LPGEN("Show connections list");
- hWumfBut = TopToolbar_AddButton(&ttb);
+ hWumfBut = g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/plugins/YAMN/src/services.cpp b/plugins/YAMN/src/services.cpp
index d6d4cb6a9e..51534dd388 100644
--- a/plugins/YAMN/src/services.cpp
+++ b/plugins/YAMN/src/services.cpp
@@ -301,7 +301,7 @@ int AddTopToolbarIcon(WPARAM,LPARAM)
btn.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
btn.hIconHandleUp = btn.hIconHandleDn = g_GetIconHandle(0);
btn.name = btn.pszTooltipUp = LPGEN("Check mail");
- hTTButton = TopToolbar_AddButton(&btn);
+ hTTButton = g_plugin.addTTB(&btn);
}
}
else {
diff --git a/plugins/YAPP/src/yapp.cpp b/plugins/YAPP/src/yapp.cpp
index b999307da6..eee3e74e4a 100644
--- a/plugins/YAPP/src/yapp.cpp
+++ b/plugins/YAPP/src/yapp.cpp
@@ -88,7 +88,7 @@ static int TTBLoaded(WPARAM, LPARAM)
ttb.hIconHandleDn = IcoLib_GetIconHandle(ICO_TB_POPUP_ON);
ttb.pszTooltipUp = LPGEN("Enable Popups");
ttb.pszTooltipDn = LPGEN("Disable Popups");
- hTTButton = TopToolbar_AddButton(&ttb);
+ hTTButton = g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index 633e9274ac..87e5980b7d 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -458,7 +458,7 @@ int FacebookProto::OnToolbarInit(WPARAM, LPARAM)
ttb.pszService = service;
ttb.pszTooltipUp = ttb.name = LPGEN("Share status...");
ttb.hIconHandleUp = IcoLib_GetIconByHandle(GetIconHandle("mind"));
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp
index 3b8f9c0fac..308c215d20 100644
--- a/protocols/JabberG/src/jabber_menu.cpp
+++ b/protocols/JabberG/src/jabber_menu.cpp
@@ -798,19 +798,19 @@ int g_OnToolbarInit(WPARAM, LPARAM)
ttb.pszService = "JABBER/*/Groupchat";
ttb.pszTooltipUp = ttb.name = LPGEN("Join conference");
ttb.hIconHandleUp = g_GetIconHandle(IDI_GROUP);
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
CreateServiceFunction("JABBER/*/Bookmarks", g_ToolbarHandleBookmarks);
ttb.pszService = "JABBER/*/Bookmarks";
ttb.pszTooltipUp = ttb.name = LPGEN("Open bookmarks");
ttb.hIconHandleUp = g_GetIconHandle(IDI_BOOKMARKS);
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
CreateServiceFunction("JABBER/*/ServiceDiscovery", g_ToolbarHandleServiceDiscovery);
ttb.pszService = "JABBER/*/ServiceDiscovery";
ttb.pszTooltipUp = ttb.name = LPGEN("Service discovery");
ttb.hIconHandleUp = g_GetIconHandle(IDI_SERVICE_DISCOVERY);
- TopToolbar_AddButton(&ttb);
+ g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/src/mir_app/src/CMPluginBase.cpp b/src/mir_app/src/CMPluginBase.cpp
index 8f3001e2b0..91f3e952c8 100644
--- a/src/mir_app/src/CMPluginBase.cpp
+++ b/src/mir_app/src/CMPluginBase.cpp
@@ -212,6 +212,11 @@ HGENMENU CMPluginBase::addRootMenu(int hMenuObject, LPCWSTR ptszName, int positi
return Menu_CreateRoot(hMenuObject, ptszName, position, hIcoLib, m_hLang);
}
+HANDLE CMPluginBase::addTTB(const struct TTBButton *pButton)
+{
+ return (HANDLE)CallService(MS_TTB_ADDBUTTON, (WPARAM)pButton, m_hLang);
+}
+
int CMPluginBase::addUserInfo(WPARAM wParam, OPTIONSDIALOGPAGE *odp)
{
odp->langId = m_hLang;
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index caf575ca95..bd5c9da1c5 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -611,3 +611,4 @@ UnregisterPlugin @633
?addEffect@CMPluginBase@@QAEHPAUEffectIDW@@@Z @640 NONAME
?addFont@CMPluginBase@@QAEHPAUFontID@@@Z @641 NONAME
?addFont@CMPluginBase@@QAEHPAUFontIDW@@@Z @642 NONAME
+?addTTB@CMPluginBase@@QAEPAXPBUTTBButton@@@Z @643 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index 328d898c37..b7ca7c0fa4 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -611,3 +611,4 @@ UnregisterPlugin @633
?addEffect@CMPluginBase@@QEAAHPEAUEffectIDW@@@Z @640 NONAME
?addFont@CMPluginBase@@QEAAHPEAUFontID@@@Z @641 NONAME
?addFont@CMPluginBase@@QEAAHPEAUFontIDW@@@Z @642 NONAME
+?addTTB@CMPluginBase@@QEAAPEAXPEBUTTBButton@@@Z @643 NONAME
diff --git a/src/mir_app/src/stdafx.h b/src/mir_app/src/stdafx.h
index 5622b60d72..c9b5e8fa10 100644
--- a/src/mir_app/src/stdafx.h
+++ b/src/mir_app/src/stdafx.h
@@ -93,6 +93,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_gui.h>
#include <m_srmm_int.h>
#include <m_imgsrvc.h>
+#include <m_toptoolbar.h>
#include <m_version.h>
#include "miranda.h"