diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-28 14:29:31 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-28 14:29:31 +0300 |
commit | a905c9c3f92fd54f37a5466649ac378db69e7cb0 (patch) | |
tree | 87a60dadfbf9fd8d916ea9100c26b6e314293242 /protocols/MRA/src/Mra.cpp | |
parent | d75fed3bfc9c252f5d20b889e0bec95fb0a4527e (diff) |
all protocols rewritten to CMPluginBase
Diffstat (limited to 'protocols/MRA/src/Mra.cpp')
-rw-r--r-- | protocols/MRA/src/Mra.cpp | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/protocols/MRA/src/Mra.cpp b/protocols/MRA/src/Mra.cpp index 0c863e3c3a..49eded7d0a 100644 --- a/protocols/MRA/src/Mra.cpp +++ b/protocols/MRA/src/Mra.cpp @@ -50,22 +50,6 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) ///////////////////////////////////////////////////////////////////////////////
-static CMraProto* mraProtoInit(const char* pszProtoName, const wchar_t* tszUserName)
-{
- CMraProto *ppro = new CMraProto(pszProtoName, tszUserName);
- g_Instances.insert(ppro);
- return ppro;
-}
-
-static int mraProtoUninit(CMraProto *ppro)
-{
- g_Instances.remove(ppro);
- delete ppro;
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
static int __cdecl OnPreShutdown(WPARAM, LPARAM)
{
g_bShutdown = true;
@@ -81,14 +65,6 @@ extern "C" __declspec(dllexport) int Load(void) InitXStatusIcons();
HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
-
- PROTOCOLDESCRIPTOR pd = { 0 };
- pd.cbSize = sizeof(pd);
- pd.szName = "MRA";
- pd.type = PROTOTYPE_PROTOCOL;
- pd.fnInit = (pfnInitProto)mraProtoInit;
- pd.fnUninit = (pfnUninitProto)mraProtoUninit;
- Proto_RegisterModule(&pd);
return 0;
}
@@ -102,3 +78,29 @@ extern "C" __declspec(dllexport) int Unload(void) return 0;
}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static PROTO_INTERFACE* mraProtoInit(const char* pszProtoName, const wchar_t* tszUserName)
+{
+ CMraProto *ppro = new CMraProto(pszProtoName, tszUserName);
+ g_Instances.insert(ppro);
+ return ppro;
+}
+
+static int mraProtoUninit(PROTO_INTERFACE *ppro)
+{
+ g_Instances.remove((CMraProto*)ppro);
+ delete (CMraProto*)ppro;
+ return 0;
+}
+
+struct CMPlugin : public CMPluginBase
+{
+ CMPlugin() :
+ CMPluginBase("MRA")
+ {
+ RegisterProtocol(PROTOTYPE_PROTOCOL, mraProtoInit, mraProtoUninit);
+ }
+}
+ g_plugin;
|