summaryrefslogtreecommitdiff
path: root/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TranslitSwitcher/src/TranslitSwitcher.cpp')
-rw-r--r--plugins/TranslitSwitcher/src/TranslitSwitcher.cpp36
1 files changed, 21 insertions, 15 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;