From 8a74e7495ce5ad39de4f5c25121a84d35df90c36 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 20 May 2018 15:08:48 +0300 Subject: CMPlugin to receive a reference to PLUGININFOEX --- plugins/Console/src/init.cpp | 36 ++++++++++++++++++++++-------------- plugins/Console/src/stdafx.h | 4 +--- 2 files changed, 23 insertions(+), 17 deletions(-) (limited to 'plugins/Console/src') diff --git a/plugins/Console/src/init.cpp b/plugins/Console/src/init.cpp index 6737e5a506..9c98057c69 100644 --- a/plugins/Console/src/init.cpp +++ b/plugins/Console/src/init.cpp @@ -28,6 +28,22 @@ DWORD mirandaVer; CMPlugin g_plugin; int &hLangpack(g_plugin.m_hLang); +static IconItem iconList[] = +{ + { "Show", "Console_Up", IDI_BTN_UP }, + { "Hide", "Console_Down", IDI_BTN_DN }, +}; + +HANDLE LoadIcon(int iIconID) +{ + for (int i = 0; i < _countof(iconList); i++) + if (iconList[i].defIconID == iIconID) + return iconList[i].hIcolib; + return nullptr; +} + +///////////////////////////////////////////////////////////////////////////////////////// + PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -38,27 +54,19 @@ PLUGININFOEX pluginInfoEx = { __AUTHORWEB, UNICODE_AWARE, // {23D4F302-D513-45B7-9027-445F29557311} - { 0x23d4f302, 0xd513, 0x45b7, { 0x90, 0x27, 0x44, 0x5f, 0x29, 0x55, 0x73, 0x11 } } +{ 0x23d4f302, 0xd513, 0x45b7,{ 0x90, 0x27, 0x44, 0x5f, 0x29, 0x55, 0x73, 0x11 } } }; +CMPlugin::CMPlugin() : + PLUGIN("Console", pluginInfoEx) +{} + extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { return &pluginInfoEx; } -static IconItem iconList[] = -{ - { "Show", "Console_Up", IDI_BTN_UP }, - { "Hide", "Console_Down", IDI_BTN_DN }, -}; - -HANDLE LoadIcon(int iIconID) -{ - for (int i = 0; i < _countof(iconList); i++) - if (iconList[i].defIconID == iIconID) - return iconList[i].hIcolib; - return nullptr; -} +///////////////////////////////////////////////////////////////////////////////////////// extern "C" __declspec(dllexport) int Load(void) { diff --git a/plugins/Console/src/stdafx.h b/plugins/Console/src/stdafx.h index 5465616407..064c40b5ff 100644 --- a/plugins/Console/src/stdafx.h +++ b/plugins/Console/src/stdafx.h @@ -46,9 +46,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct CMPlugin : public PLUGIN { - CMPlugin() : - PLUGIN("Console") - {} + CMPlugin(); }; void InitConsole(); -- cgit v1.2.3