From 067a48827e8bae1bc595f3268e18996314843396 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 17 May 2018 20:53:02 +0300 Subject: OpenFolder, PackUpdater, PasteIt, Ping, QuickMessages, QuickReplies, Sessions, TranslitSwitcher => CMPlugin --- plugins/TranslitSwitcher/src/TranslitSwitcher.cpp | 36 +++++++++++++---------- plugins/TranslitSwitcher/src/stdafx.h | 1 - 2 files changed, 21 insertions(+), 16 deletions(-) (limited to 'plugins/TranslitSwitcher/src') diff --git a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp index 7cba65cf85..223bb849e6 100644 --- a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp +++ b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp @@ -19,10 +19,18 @@ Boston, MA 02111-1307, USA. #include "stdafx.h" -HINSTANCE hInst = nullptr; - int hLangpack; +struct CMPlugin : public PLUGIN +{ + CMPlugin() : + PLUGIN(nullptr) + {} +} +g_plugin; + +///////////////////////////////////////////////////////////////////////////////////////// + PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -36,6 +44,13 @@ PLUGININFOEX pluginInfoEx = { { 0x286947d, 0x3140, 0x4222, { 0xb5, 0xad, 0x2c, 0x92, 0x31, 0x5e, 0x1c, 0x1e } } }; +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) +{ + return &pluginInfoEx; +} + +///////////////////////////////////////////////////////////////////////////////////////// + static IconItem iconList[] = { { LPGEN("Switch Layout and Send"), "Switch Layout and Send", IDI_SWITCHSEND }, @@ -43,17 +58,6 @@ static IconItem iconList[] = { LPGEN("Invert Case and Send"), "Invert Case and Send", IDI_INVERTSEND }, }; -bool WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) -{ - hInst = hinstDLL; - return true; -} - -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) -{ - return &pluginInfoEx; -} - //------------------------------------------------------------------------------------------------------- #define MS_TS_SWITCHLAYOUT "TranslitSwitcher/SwitchLayout" INT_PTR ServiceSwitch(WPARAM, LPARAM lParam) @@ -80,7 +84,7 @@ int OnModulesLoaded(WPARAM, LPARAM) { HookEvent(ME_MSG_BUTTONPRESSED, OnButtonPressed); - Icon_Register(hInst, "TabSRMM/TranslitSwitcher", iconList, _countof(iconList)); + Icon_Register(g_plugin.getInst(), "TabSRMM/TranslitSwitcher", iconList, _countof(iconList)); BBButton bbd = {}; bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON; @@ -107,7 +111,7 @@ int OnModulesLoaded(WPARAM, LPARAM) return 0; } -//------------------------------------------------------------------------------------------------------- +///////////////////////////////////////////////////////////////////////////////////////// extern "C" __declspec(dllexport) int Load(void) { @@ -162,6 +166,8 @@ extern "C" __declspec(dllexport) int Load(void) return 0; } +///////////////////////////////////////////////////////////////////////////////////////// + extern "C" __declspec(dllexport) int Unload(void) { return 0; diff --git a/plugins/TranslitSwitcher/src/stdafx.h b/plugins/TranslitSwitcher/src/stdafx.h index 6939fee8c6..fd6e7cd3c7 100644 --- a/plugins/TranslitSwitcher/src/stdafx.h +++ b/plugins/TranslitSwitcher/src/stdafx.h @@ -23,7 +23,6 @@ Boston, MA 02111-1307, USA. #include #include -#define __NO_CMPLUGIN_NEEDED #include #include #include -- cgit v1.2.3