summaryrefslogtreecommitdiff
path: root/plugins/GmailNotifier/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-18 23:04:26 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-18 23:04:26 +0300
commitabf8cd813bb0ac4f4f5451d2af929279d816abac (patch)
tree4fb7451f2f99fac23a9f891c1aa9dc9fe6e0f8c6 /plugins/GmailNotifier/src
parent9ffe3c7ba4eb7011279e14ff1c5b5357bf874114 (diff)
core changes:
- PROTOCOLDESCRIPTOR's implementation hidden inside mir_app; - Proto_RegisterModule now doesn't need a PROTOCOLDESCRIPTOR structure; - PROTOTYPE_PROTOWITHACCS type added for protos that work with accounts
Diffstat (limited to 'plugins/GmailNotifier/src')
-rw-r--r--plugins/GmailNotifier/src/main.cpp35
-rw-r--r--plugins/GmailNotifier/src/options.cpp2
-rw-r--r--plugins/GmailNotifier/src/stdafx.h11
3 files changed, 25 insertions, 23 deletions
diff --git a/plugins/GmailNotifier/src/main.cpp b/plugins/GmailNotifier/src/main.cpp
index 945ab5984d..c3add00af0 100644
--- a/plugins/GmailNotifier/src/main.cpp
+++ b/plugins/GmailNotifier/src/main.cpp
@@ -11,7 +11,6 @@ There is no warranty.
#include "version.h"
CLIST_INTERFACE *pcli;
-HINSTANCE g_hInstance;
int hLangpack;
UINT hTimer;
HANDLE hMirandaStarted, hOptionsInitial;
@@ -37,6 +36,19 @@ static PLUGININFOEX pluginInfoEx =
{ 0x243955e0, 0x75d9, 0x4cc3, { 0x9b, 0x28, 0x6f, 0x9c, 0x5a, 0xf4, 0x53, 0x2d } }
};
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
+{
+ return &pluginInfoEx;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+CMPlugin g_plugin;
+
+extern "C" _pfnCrtInit _pRawDllMain = &CMPlugin::RawDllMain;
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
INT_PTR GetCaps(WPARAM wParam, LPARAM)
{
if (wParam == PFLAGNUM_2 && opt.ShowCustomIcon)
@@ -75,11 +87,6 @@ static int OnMirandaStart(WPARAM, LPARAM)
return 0;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
-{
- return &pluginInfoEx;
-}
-
extern "C" int __declspec(dllexport) Load()
{
mir_getLP(&pluginInfoEx);
@@ -146,6 +153,8 @@ extern "C" int __declspec(dllexport) Load()
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Unload(void)
{
if (hTimer)
@@ -161,17 +170,3 @@ extern "C" int __declspec(dllexport) Unload(void)
UnhookEvent(hOptionsInitial);
return 0;
}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-struct CMPlugin : public PLUGIN<CMPlugin>
-{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE_NAME)
- {
- RegisterProtocol(PROTOTYPE_VIRTUAL);
- }
-}
- g_plugin;
-
-extern "C" _pfnCrtInit _pRawDllMain = &CMPlugin::RawDllMain;
diff --git a/plugins/GmailNotifier/src/options.cpp b/plugins/GmailNotifier/src/options.cpp
index 4aafb314f6..9d15fbe1ac 100644
--- a/plugins/GmailNotifier/src/options.cpp
+++ b/plugins/GmailNotifier/src/options.cpp
@@ -272,7 +272,7 @@ int OptInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.position = -790000000;
- odp.hInstance = g_hInstance;
+ odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT);
odp.szTitle.a = LPGEN("GmailNotifier");
odp.szGroup.a = LPGEN("Network");
diff --git a/plugins/GmailNotifier/src/stdafx.h b/plugins/GmailNotifier/src/stdafx.h
index c098816cef..f5cedab022 100644
--- a/plugins/GmailNotifier/src/stdafx.h
+++ b/plugins/GmailNotifier/src/stdafx.h
@@ -20,7 +20,6 @@
#include "m_clc.h"
#include "m_popup.h"
#include "m_netlib.h"
-#include <m_plugin.h>
#define WM_SHELLNOTIFY WM_USER+5
#define IDI_TRAY WM_USER+6
@@ -73,7 +72,6 @@ struct optionSettings
extern OBJLIST<Account> g_accs;
extern optionSettings opt;
-extern HINSTANCE g_hInstance;
extern HNETLIBUSER hNetlibUser;
extern UINT hTimer;
extern short ID_STATUS_NONEW;
@@ -93,3 +91,12 @@ void DeleteResults(resultLink *);
void BuildList(void);
Account* GetAccountByContact(MCONTACT hContact);
+
+struct CMPlugin : public PLUGIN<CMPlugin>
+{
+ CMPlugin() :
+ PLUGIN<CMPlugin>(MODULE_NAME)
+ {
+ RegisterProtocol(PROTOTYPE_VIRTUAL);
+ }
+};