summaryrefslogtreecommitdiff
path: root/plugins/MagneticWindows
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-20 15:08:48 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-05-20 15:08:48 +0300
commit8a74e7495ce5ad39de4f5c25121a84d35df90c36 (patch)
tree03e5b4870f09a3163306740c2eebee47bc15b042 /plugins/MagneticWindows
parentc5bf7d6123dd1c3b82ccb8fdb1b068077e9d56d4 (diff)
CMPlugin to receive a reference to PLUGININFOEX
Diffstat (limited to 'plugins/MagneticWindows')
-rw-r--r--plugins/MagneticWindows/src/MagneticWindows.cpp23
-rw-r--r--plugins/MagneticWindows/src/Options.cpp12
-rw-r--r--plugins/MagneticWindows/src/stdafx.h6
3 files changed, 21 insertions, 20 deletions
diff --git a/plugins/MagneticWindows/src/MagneticWindows.cpp b/plugins/MagneticWindows/src/MagneticWindows.cpp
index e1bc6f5eb0..7e6223081a 100644
--- a/plugins/MagneticWindows/src/MagneticWindows.cpp
+++ b/plugins/MagneticWindows/src/MagneticWindows.cpp
@@ -12,12 +12,15 @@
//
///////////////////////////////////////////////////////////////////////////////////////////////////
+CMPlugin g_plugin;
+int &hLangpack(g_plugin.m_hLang);
+CLIST_INTERFACE *pcli;
///////////////////////////////////////////////////////////////////////////////////////////////////
// Variables
///////////////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo = {
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -30,9 +33,14 @@ PLUGININFOEX pluginInfo = {
{0x8c01613, 0x24c8, 0x486f, { 0xbd, 0xae, 0x2c, 0x3d, 0xdc, 0xaf, 0x93, 0x47 }}
};
-CMPlugin g_plugin;
-int &hLangpack(g_plugin.m_hLang);
-CLIST_INTERFACE *pcli;
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
+{
+ return &pluginInfoEx;
+}
///////////////////////////////////////////////////////////////////////////////////////////////////
// Plugin Functions
@@ -105,14 +113,9 @@ int SnapPluginShutDown(WPARAM, LPARAM)
// Exportet Functions
///////////////////////////////////////////////////////////////////////////////////////////////////
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
-{
- return &pluginInfo;
-}
-
extern "C" int __declspec(dllexport) Load()
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
HookEvent(ME_SYSTEM_MODULESLOADED, SnapPluginStart);
diff --git a/plugins/MagneticWindows/src/Options.cpp b/plugins/MagneticWindows/src/Options.cpp
index 650948fda6..47acc990cb 100644
--- a/plugins/MagneticWindows/src/Options.cpp
+++ b/plugins/MagneticWindows/src/Options.cpp
@@ -64,9 +64,9 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
Options.SnapWidth = SendDlgItemMessage(hwndDlg, IDC_SLIDER_SNAPWIDTH, TBM_GETPOS, 0, 0);
Options.ScriverWorkAround = (IsDlgButtonChecked(hwndDlg, IDC_CHK_SCRIVERWORKAROUND) == TRUE);
- db_set_b(NULL, MODULE_NAME, "DoSnap", Options.DoSnap);
- db_set_b(NULL, MODULE_NAME, "SnapWidth", Options.SnapWidth);
- db_set_b(NULL, MODULE_NAME, "ScriverWorkAround", Options.ScriverWorkAround);
+ db_set_b(NULL, MODULENAME, "DoSnap", Options.DoSnap);
+ db_set_b(NULL, MODULENAME, "SnapWidth", Options.SnapWidth);
+ db_set_b(NULL, MODULENAME, "ScriverWorkAround", Options.ScriverWorkAround);
break;
}
}
@@ -90,7 +90,7 @@ int InitOptions(WPARAM wParam, LPARAM)
void LoadOptions()
{
- Options.DoSnap = db_get_b(NULL, MODULE_NAME, "DoSnap", 1) != 0;
- Options.SnapWidth = db_get_b(NULL, MODULE_NAME, "SnapWidth", cDefaultSnapWidth);
- Options.ScriverWorkAround = db_get_b(NULL, MODULE_NAME, "ScriverWorkAround", 0) != 0;
+ Options.DoSnap = db_get_b(NULL, MODULENAME, "DoSnap", 1) != 0;
+ Options.SnapWidth = db_get_b(NULL, MODULENAME, "SnapWidth", cDefaultSnapWidth);
+ Options.ScriverWorkAround = db_get_b(NULL, MODULENAME, "ScriverWorkAround", 0) != 0;
}
diff --git a/plugins/MagneticWindows/src/stdafx.h b/plugins/MagneticWindows/src/stdafx.h
index 7e4a0df923..962673a6ea 100644
--- a/plugins/MagneticWindows/src/stdafx.h
+++ b/plugins/MagneticWindows/src/stdafx.h
@@ -23,13 +23,11 @@ struct TWorkingVariables
bool SnappedX, SnappedY;
};
-#define MODULE_NAME "MagneticWindows"
+#define MODULENAME "MagneticWindows"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE_NAME)
- {}
+ CMPlugin();
};
void WindowStart();