summaryrefslogtreecommitdiff
path: root/plugins/TooltipNotify/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TooltipNotify/src/main.cpp')
-rw-r--r--plugins/TooltipNotify/src/main.cpp99
1 files changed, 36 insertions, 63 deletions
diff --git a/plugins/TooltipNotify/src/main.cpp b/plugins/TooltipNotify/src/main.cpp
index 9b84a68cb5..001fa83d7b 100644
--- a/plugins/TooltipNotify/src/main.cpp
+++ b/plugins/TooltipNotify/src/main.cpp
@@ -4,34 +4,19 @@
#include "stdafx.h"
-static int InitializeOptions(WPARAM wParam,LPARAM lParam);
-static int ModulesLoaded(WPARAM wParam,LPARAM lParam);
-static int ContactSettingChanged(WPARAM wParam,LPARAM lParam);
-static int ProtoAck(WPARAM,LPARAM);
-static int ProtoContactIsTyping(WPARAM wParam,LPARAM lParam);
-
static HANDLE g_hContactSettingChanged = nullptr;
static HANDLE g_hOptionsInitialize = nullptr;
static HANDLE g_hModulesLoaded = nullptr;
static HANDLE g_hProtoAck = nullptr;
static HANDLE g_hProtoContactIsTyping = nullptr;
-HINSTANCE g_hInstDLL = nullptr;
-
// Main global object
static CTooltipNotify *g_pTooltipNotify = nullptr;
int hLangpack;
CLIST_INTERFACE *pcli;
+CMPlugin g_plugin;
-//================================================================================
-// plugin init/deinit routines
-//================================================================================
-
-BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD, LPVOID)
-{
- g_hInstDLL = hInstDLL;
- return TRUE;
-}
+/////////////////////////////////////////////////////////////////////////////////////////
static PLUGININFOEX sPluginInfo =
{
@@ -52,72 +37,60 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
return &sPluginInfo;
}
-extern "C" int __declspec(dllexport) Load(void)
-{
- mir_getLP(&sPluginInfo);
- pcli = Clist_GetInterface();
+/////////////////////////////////////////////////////////////////////////////////////////
- g_pTooltipNotify = new CTooltipNotify();
- assert(g_pTooltipNotify!=nullptr);
-
- g_hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
- return 0;
+static int ProtoContactIsTyping(WPARAM wParam, LPARAM lParam)
+{
+ return CTooltipNotify::GetObjInstance()->ProtoContactIsTyping(wParam, lParam);
}
-extern "C" int __declspec(dllexport) Unload(void)
+static int ProtoAck(WPARAM wParam, LPARAM lParam)
{
- if (g_hContactSettingChanged) UnhookEvent(g_hContactSettingChanged);
- if (g_hProtoContactIsTyping) UnhookEvent(g_hProtoContactIsTyping);
- if (g_hProtoAck) UnhookEvent(g_hProtoAck);
- if (g_hOptionsInitialize) UnhookEvent(g_hOptionsInitialize);
- if (g_hModulesLoaded) UnhookEvent(g_hModulesLoaded);
- delete g_pTooltipNotify;
-
- return 0;
+ return CTooltipNotify::GetObjInstance()->ProtoAck(wParam, lParam);
}
+static int ContactSettingChanged(WPARAM wParam, LPARAM lParam)
+{
+ return CTooltipNotify::GetObjInstance()->ContactSettingChanged(wParam, lParam);
+}
+static int InitializeOptions(WPARAM wParam, LPARAM lParam)
+{
+ return CTooltipNotify::GetObjInstance()->InitializeOptions(wParam, lParam);
+}
-//================================================================================
-//================================================================================
-//================================================================================
-
-
-int ModulesLoaded(WPARAM wParam, LPARAM lParam)
+static int ModulesLoaded(WPARAM wParam, LPARAM lParam)
{
g_hContactSettingChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ContactSettingChanged);
g_hProtoAck = HookEvent(ME_PROTO_ACK, ProtoAck);
g_hProtoContactIsTyping = HookEvent(ME_PROTO_CONTACTISTYPING, ProtoContactIsTyping);
- g_hOptionsInitialize = HookEvent(ME_OPT_INITIALISE, InitializeOptions);
+ g_hOptionsInitialize = HookEvent(ME_OPT_INITIALISE, InitializeOptions);
return CTooltipNotify::GetObjInstance()->ModulesLoaded(wParam, lParam);
}
-
-int ProtoContactIsTyping(WPARAM wParam, LPARAM lParam)
-{
- return CTooltipNotify::GetObjInstance()->ProtoContactIsTyping(wParam, lParam);
-}
-
-
-int ProtoAck(WPARAM wParam, LPARAM lParam)
+extern "C" int __declspec(dllexport) Load(void)
{
- return CTooltipNotify::GetObjInstance()->ProtoAck(wParam, lParam);
-}
-
+ mir_getLP(&sPluginInfo);
+ pcli = Clist_GetInterface();
-int ContactSettingChanged(WPARAM wParam, LPARAM lParam)
-{
- return CTooltipNotify::GetObjInstance()->ContactSettingChanged(wParam, lParam);
+ g_pTooltipNotify = new CTooltipNotify();
+ assert(g_pTooltipNotify!=nullptr);
+
+ g_hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
+ return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
-int InitializeOptions(WPARAM wParam, LPARAM lParam)
+extern "C" int __declspec(dllexport) Unload(void)
{
- return CTooltipNotify::GetObjInstance()->InitializeOptions(wParam, lParam);
-}
-
-
-
-
+ if (g_hContactSettingChanged) UnhookEvent(g_hContactSettingChanged);
+ if (g_hProtoContactIsTyping) UnhookEvent(g_hProtoContactIsTyping);
+ if (g_hProtoAck) UnhookEvent(g_hProtoAck);
+ if (g_hOptionsInitialize) UnhookEvent(g_hOptionsInitialize);
+ if (g_hModulesLoaded) UnhookEvent(g_hModulesLoaded);
+ delete g_pTooltipNotify;
+ return 0;
+}