diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-17 20:53:02 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-17 20:53:02 +0300 |
commit | 067a48827e8bae1bc595f3268e18996314843396 (patch) | |
tree | d51ae1287c40f08f291f5578b2dccf69f902cc97 /plugins/TranslitSwitcher/src | |
parent | 7639f72273189df60566755c0d5f1e4ab7201b67 (diff) |
OpenFolder, PackUpdater, PasteIt, Ping, QuickMessages, QuickReplies, Sessions, TranslitSwitcher => CMPlugin
Diffstat (limited to 'plugins/TranslitSwitcher/src')
-rw-r--r-- | plugins/TranslitSwitcher/src/TranslitSwitcher.cpp | 36 | ||||
-rw-r--r-- | plugins/TranslitSwitcher/src/stdafx.h | 1 |
2 files changed, 21 insertions, 16 deletions
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>
+{
+ CMPlugin() :
+ PLUGIN<CMPlugin>(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 <windows.h>
#include <commctrl.h>
-#define __NO_CMPLUGIN_NEEDED
#include <newpluginapi.h>
#include <m_langpack.h>
#include <m_utils.h>
|