summaryrefslogtreecommitdiff
path: root/plugins/NewEventNotify
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/NewEventNotify')
-rw-r--r--plugins/NewEventNotify/src/main.cpp12
-rw-r--r--plugins/NewEventNotify/src/options.cpp136
-rw-r--r--plugins/NewEventNotify/src/stdafx.h6
3 files changed, 78 insertions, 76 deletions
diff --git a/plugins/NewEventNotify/src/main.cpp b/plugins/NewEventNotify/src/main.cpp
index 6f2bfe3b7c..295310f3d7 100644
--- a/plugins/NewEventNotify/src/main.cpp
+++ b/plugins/NewEventNotify/src/main.cpp
@@ -37,7 +37,7 @@ int &hLangpack(g_plugin.m_hLang);
/////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -51,9 +51,13 @@ PLUGININFOEX pluginInfo =
{0x3503D584, 0x6234, 0x4BEF, {0xA5, 0x53, 0x6C, 0x1B, 0x9C, 0xD4, 0x71, 0xF2}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -117,7 +121,7 @@ int HookedInit(WPARAM, LPARAM)
HookEvent(ME_DB_EVENT_ADDED, HookedNewEvent);
// Plugin sweeper support
if (ServiceExists("PluginSweeper/Add"))
- CallService("PluginSweeper/Add", (WPARAM)MODULE, (LPARAM)MODULE);
+ CallService("PluginSweeper/Add", (WPARAM)MODULENAME, (LPARAM)MODULENAME);
if (pluginOptions.bMenuitem)
MenuitemInit(!pluginOptions.bDisable);
@@ -138,7 +142,7 @@ extern "C" __declspec(dllexport) int Load(void)
HookEvent(ME_SYSTEM_MODULESLOADED, HookedInit);
HookEvent(ME_OPT_INITIALISE, HookedOptions);
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
OptionsInit(&pluginOptions);
diff --git a/plugins/NewEventNotify/src/options.cpp b/plugins/NewEventNotify/src/options.cpp
index 7e1c92c14a..f943a37a9d 100644
--- a/plugins/NewEventNotify/src/options.cpp
+++ b/plugins/NewEventNotify/src/options.cpp
@@ -29,80 +29,80 @@ BOOL bWmNotify;
int OptionsRead(void)
{
- options->bDisable = db_get_b(NULL, MODULE, OPT_DISABLE, FALSE);
- options->bPreview = db_get_b(NULL, MODULE, OPT_PREVIEW, TRUE);
- options->bMenuitem = db_get_b(NULL, MODULE, OPT_MENUITEM, FALSE);
- options->bDefaultColorMsg = db_get_b(NULL, MODULE, OPT_COLDEFAULT_MESSAGE, FALSE);
- options->bDefaultColorUrl = db_get_b(NULL, MODULE, OPT_COLDEFAULT_URL, FALSE);
- options->bDefaultColorFile = db_get_b(NULL, MODULE, OPT_COLDEFAULT_FILE, FALSE);
- options->bDefaultColorOthers = db_get_b(NULL, MODULE, OPT_COLDEFAULT_OTHERS, FALSE);
- options->colBackMsg = (COLORREF)db_get_dw(NULL, MODULE, OPT_COLBACK_MESSAGE, DEFAULT_COLBACK);
- options->colTextMsg = (COLORREF)db_get_dw(NULL, MODULE, OPT_COLTEXT_MESSAGE, DEFAULT_COLTEXT);
- options->colBackUrl = (COLORREF)db_get_dw(NULL, MODULE, OPT_COLBACK_URL, DEFAULT_COLBACK);
- options->colTextUrl = (COLORREF)db_get_dw(NULL, MODULE, OPT_COLTEXT_URL, DEFAULT_COLTEXT);
- options->colBackFile = (COLORREF)db_get_dw(NULL, MODULE, OPT_COLBACK_FILE, DEFAULT_COLBACK);
- options->colTextFile = (COLORREF)db_get_dw(NULL, MODULE, OPT_COLTEXT_FILE, DEFAULT_COLTEXT);
- options->colBackOthers = (COLORREF)db_get_dw(NULL, MODULE, OPT_COLBACK_OTHERS, DEFAULT_COLBACK);
- options->colTextOthers = (COLORREF)db_get_dw(NULL, MODULE, OPT_COLTEXT_OTHERS, DEFAULT_COLTEXT);
- options->maskNotify = (UINT)db_get_b(NULL, MODULE, OPT_MASKNOTIFY, DEFAULT_MASKNOTIFY);
- options->maskActL = (UINT)db_get_b(NULL, MODULE, OPT_MASKACTL, DEFAULT_MASKACTL);
- options->maskActR = (UINT)db_get_b(NULL, MODULE, OPT_MASKACTR, DEFAULT_MASKACTR);
- options->maskActTE = (UINT)db_get_b(NULL, MODULE, OPT_MASKACTTE, DEFAULT_MASKACTE);
- options->bMsgWindowCheck = db_get_b(NULL, MODULE, OPT_MSGWINDOWCHECK, TRUE);
- options->bMsgReplyWindow = db_get_b(NULL, MODULE, OPT_MSGREPLYWINDOW, FALSE);
- options->bMergePopup = db_get_b(NULL, MODULE, OPT_MERGEPOPUP, TRUE);
- options->iDelayMsg = (int)db_get_dw(NULL, MODULE, OPT_DELAY_MESSAGE, DEFAULT_DELAY);
- options->iDelayUrl = (int)db_get_dw(NULL, MODULE, OPT_DELAY_URL, DEFAULT_DELAY);
- options->iDelayFile = (int)db_get_dw(NULL, MODULE, OPT_DELAY_FILE, DEFAULT_DELAY);
- options->iDelayOthers = (int)db_get_dw(NULL, MODULE, OPT_DELAY_OTHERS, DEFAULT_DELAY);
+ options->bDisable = db_get_b(NULL, MODULENAME, OPT_DISABLE, FALSE);
+ options->bPreview = db_get_b(NULL, MODULENAME, OPT_PREVIEW, TRUE);
+ options->bMenuitem = db_get_b(NULL, MODULENAME, OPT_MENUITEM, FALSE);
+ options->bDefaultColorMsg = db_get_b(NULL, MODULENAME, OPT_COLDEFAULT_MESSAGE, FALSE);
+ options->bDefaultColorUrl = db_get_b(NULL, MODULENAME, OPT_COLDEFAULT_URL, FALSE);
+ options->bDefaultColorFile = db_get_b(NULL, MODULENAME, OPT_COLDEFAULT_FILE, FALSE);
+ options->bDefaultColorOthers = db_get_b(NULL, MODULENAME, OPT_COLDEFAULT_OTHERS, FALSE);
+ options->colBackMsg = (COLORREF)db_get_dw(NULL, MODULENAME, OPT_COLBACK_MESSAGE, DEFAULT_COLBACK);
+ options->colTextMsg = (COLORREF)db_get_dw(NULL, MODULENAME, OPT_COLTEXT_MESSAGE, DEFAULT_COLTEXT);
+ options->colBackUrl = (COLORREF)db_get_dw(NULL, MODULENAME, OPT_COLBACK_URL, DEFAULT_COLBACK);
+ options->colTextUrl = (COLORREF)db_get_dw(NULL, MODULENAME, OPT_COLTEXT_URL, DEFAULT_COLTEXT);
+ options->colBackFile = (COLORREF)db_get_dw(NULL, MODULENAME, OPT_COLBACK_FILE, DEFAULT_COLBACK);
+ options->colTextFile = (COLORREF)db_get_dw(NULL, MODULENAME, OPT_COLTEXT_FILE, DEFAULT_COLTEXT);
+ options->colBackOthers = (COLORREF)db_get_dw(NULL, MODULENAME, OPT_COLBACK_OTHERS, DEFAULT_COLBACK);
+ options->colTextOthers = (COLORREF)db_get_dw(NULL, MODULENAME, OPT_COLTEXT_OTHERS, DEFAULT_COLTEXT);
+ options->maskNotify = (UINT)db_get_b(NULL, MODULENAME, OPT_MASKNOTIFY, DEFAULT_MASKNOTIFY);
+ options->maskActL = (UINT)db_get_b(NULL, MODULENAME, OPT_MASKACTL, DEFAULT_MASKACTL);
+ options->maskActR = (UINT)db_get_b(NULL, MODULENAME, OPT_MASKACTR, DEFAULT_MASKACTR);
+ options->maskActTE = (UINT)db_get_b(NULL, MODULENAME, OPT_MASKACTTE, DEFAULT_MASKACTE);
+ options->bMsgWindowCheck = db_get_b(NULL, MODULENAME, OPT_MSGWINDOWCHECK, TRUE);
+ options->bMsgReplyWindow = db_get_b(NULL, MODULENAME, OPT_MSGREPLYWINDOW, FALSE);
+ options->bMergePopup = db_get_b(NULL, MODULENAME, OPT_MERGEPOPUP, TRUE);
+ options->iDelayMsg = (int)db_get_dw(NULL, MODULENAME, OPT_DELAY_MESSAGE, DEFAULT_DELAY);
+ options->iDelayUrl = (int)db_get_dw(NULL, MODULENAME, OPT_DELAY_URL, DEFAULT_DELAY);
+ options->iDelayFile = (int)db_get_dw(NULL, MODULENAME, OPT_DELAY_FILE, DEFAULT_DELAY);
+ options->iDelayOthers = (int)db_get_dw(NULL, MODULENAME, OPT_DELAY_OTHERS, DEFAULT_DELAY);
options->iDelayDefault = (int)DBGetContactSettingRangedWord(NULL, "Popup", "Seconds", SETTING_LIFETIME_DEFAULT, SETTING_LIFETIME_MIN, SETTING_LIFETIME_MAX);
- options->bShowDate = db_get_b(NULL, MODULE, OPT_SHOW_DATE, TRUE);
- options->bShowTime = db_get_b(NULL, MODULE, OPT_SHOW_TIME, TRUE);
- options->bShowHeaders = db_get_b(NULL, MODULE, OPT_SHOW_HEADERS, TRUE);
- options->iNumberMsg = (BYTE)db_get_b(NULL, MODULE, OPT_NUMBER_MSG, TRUE);
- options->bShowON = db_get_b(NULL, MODULE, OPT_SHOW_ON, TRUE);
- options->bHideSend = db_get_b(NULL, MODULE, OPT_HIDESEND, TRUE);
- options->bNoRSS = db_get_b(NULL, MODULE, OPT_NORSS, FALSE);
- options->bReadCheck = db_get_b(NULL, MODULE, OPT_READCHECK, FALSE);
+ options->bShowDate = db_get_b(NULL, MODULENAME, OPT_SHOW_DATE, TRUE);
+ options->bShowTime = db_get_b(NULL, MODULENAME, OPT_SHOW_TIME, TRUE);
+ options->bShowHeaders = db_get_b(NULL, MODULENAME, OPT_SHOW_HEADERS, TRUE);
+ options->iNumberMsg = (BYTE)db_get_b(NULL, MODULENAME, OPT_NUMBER_MSG, TRUE);
+ options->bShowON = db_get_b(NULL, MODULENAME, OPT_SHOW_ON, TRUE);
+ options->bHideSend = db_get_b(NULL, MODULENAME, OPT_HIDESEND, TRUE);
+ options->bNoRSS = db_get_b(NULL, MODULENAME, OPT_NORSS, FALSE);
+ options->bReadCheck = db_get_b(NULL, MODULENAME, OPT_READCHECK, FALSE);
return 0;
}
int OptionsWrite(void)
{
- db_set_b(NULL, MODULE, OPT_DISABLE, options->bDisable);
- db_set_b(NULL, MODULE, OPT_PREVIEW, options->bPreview);
- db_set_b(NULL, MODULE, OPT_MENUITEM, options->bMenuitem);
- db_set_b(NULL, MODULE, OPT_COLDEFAULT_MESSAGE, options->bDefaultColorMsg);
- db_set_b(NULL, MODULE, OPT_COLDEFAULT_URL, options->bDefaultColorUrl);
- db_set_b(NULL, MODULE, OPT_COLDEFAULT_FILE, options->bDefaultColorFile);
- db_set_b(NULL, MODULE, OPT_COLDEFAULT_OTHERS, options->bDefaultColorOthers);
- db_set_dw(NULL, MODULE, OPT_COLBACK_MESSAGE, (DWORD)options->colBackMsg);
- db_set_dw(NULL, MODULE, OPT_COLTEXT_MESSAGE, (DWORD)options->colTextMsg);
- db_set_dw(NULL, MODULE, OPT_COLBACK_URL, (DWORD)options->colBackUrl);
- db_set_dw(NULL, MODULE, OPT_COLTEXT_URL, (DWORD)options->colTextUrl);
- db_set_dw(NULL, MODULE, OPT_COLBACK_FILE, (DWORD)options->colBackFile);
- db_set_dw(NULL, MODULE, OPT_COLTEXT_FILE, (DWORD)options->colTextFile);
- db_set_dw(NULL, MODULE, OPT_COLBACK_OTHERS, (DWORD)options->colBackOthers);
- db_set_dw(NULL, MODULE, OPT_COLTEXT_OTHERS, (DWORD)options->colTextOthers);
- db_set_b(NULL, MODULE, OPT_MASKNOTIFY, (BYTE)options->maskNotify);
- db_set_b(NULL, MODULE, OPT_MASKACTL, (BYTE)options->maskActL);
- db_set_b(NULL, MODULE, OPT_MASKACTR, (BYTE)options->maskActR);
- db_set_b(NULL, MODULE, OPT_MASKACTTE, (BYTE)options->maskActTE);
- db_set_b(NULL, MODULE, OPT_MSGWINDOWCHECK, options->bMsgWindowCheck);
- db_set_b(NULL, MODULE, OPT_MSGREPLYWINDOW, options->bMsgReplyWindow);
- db_set_b(NULL, MODULE, OPT_MERGEPOPUP, options->bMergePopup);
- db_set_dw(NULL, MODULE, OPT_DELAY_MESSAGE, (DWORD)options->iDelayMsg);
- db_set_dw(NULL, MODULE, OPT_DELAY_URL, (DWORD)options->iDelayUrl);
- db_set_dw(NULL, MODULE, OPT_DELAY_FILE, (DWORD)options->iDelayFile);
- db_set_dw(NULL, MODULE, OPT_DELAY_OTHERS, (DWORD)options->iDelayOthers);
- db_set_b(NULL, MODULE, OPT_SHOW_DATE, options->bShowDate);
- db_set_b(NULL, MODULE, OPT_SHOW_TIME, options->bShowTime);
- db_set_b(NULL, MODULE, OPT_SHOW_HEADERS, options->bShowHeaders);
- db_set_b(NULL, MODULE, OPT_NUMBER_MSG, (BYTE)options->iNumberMsg);
- db_set_b(NULL, MODULE, OPT_SHOW_ON, options->bShowON);
- db_set_b(NULL, MODULE, OPT_HIDESEND, options->bHideSend);
- db_set_b(NULL, MODULE, OPT_NORSS, options->bNoRSS);
- db_set_b(NULL, MODULE, OPT_READCHECK, options->bReadCheck);
+ db_set_b(NULL, MODULENAME, OPT_DISABLE, options->bDisable);
+ db_set_b(NULL, MODULENAME, OPT_PREVIEW, options->bPreview);
+ db_set_b(NULL, MODULENAME, OPT_MENUITEM, options->bMenuitem);
+ db_set_b(NULL, MODULENAME, OPT_COLDEFAULT_MESSAGE, options->bDefaultColorMsg);
+ db_set_b(NULL, MODULENAME, OPT_COLDEFAULT_URL, options->bDefaultColorUrl);
+ db_set_b(NULL, MODULENAME, OPT_COLDEFAULT_FILE, options->bDefaultColorFile);
+ db_set_b(NULL, MODULENAME, OPT_COLDEFAULT_OTHERS, options->bDefaultColorOthers);
+ db_set_dw(NULL, MODULENAME, OPT_COLBACK_MESSAGE, (DWORD)options->colBackMsg);
+ db_set_dw(NULL, MODULENAME, OPT_COLTEXT_MESSAGE, (DWORD)options->colTextMsg);
+ db_set_dw(NULL, MODULENAME, OPT_COLBACK_URL, (DWORD)options->colBackUrl);
+ db_set_dw(NULL, MODULENAME, OPT_COLTEXT_URL, (DWORD)options->colTextUrl);
+ db_set_dw(NULL, MODULENAME, OPT_COLBACK_FILE, (DWORD)options->colBackFile);
+ db_set_dw(NULL, MODULENAME, OPT_COLTEXT_FILE, (DWORD)options->colTextFile);
+ db_set_dw(NULL, MODULENAME, OPT_COLBACK_OTHERS, (DWORD)options->colBackOthers);
+ db_set_dw(NULL, MODULENAME, OPT_COLTEXT_OTHERS, (DWORD)options->colTextOthers);
+ db_set_b(NULL, MODULENAME, OPT_MASKNOTIFY, (BYTE)options->maskNotify);
+ db_set_b(NULL, MODULENAME, OPT_MASKACTL, (BYTE)options->maskActL);
+ db_set_b(NULL, MODULENAME, OPT_MASKACTR, (BYTE)options->maskActR);
+ db_set_b(NULL, MODULENAME, OPT_MASKACTTE, (BYTE)options->maskActTE);
+ db_set_b(NULL, MODULENAME, OPT_MSGWINDOWCHECK, options->bMsgWindowCheck);
+ db_set_b(NULL, MODULENAME, OPT_MSGREPLYWINDOW, options->bMsgReplyWindow);
+ db_set_b(NULL, MODULENAME, OPT_MERGEPOPUP, options->bMergePopup);
+ db_set_dw(NULL, MODULENAME, OPT_DELAY_MESSAGE, (DWORD)options->iDelayMsg);
+ db_set_dw(NULL, MODULENAME, OPT_DELAY_URL, (DWORD)options->iDelayUrl);
+ db_set_dw(NULL, MODULENAME, OPT_DELAY_FILE, (DWORD)options->iDelayFile);
+ db_set_dw(NULL, MODULENAME, OPT_DELAY_OTHERS, (DWORD)options->iDelayOthers);
+ db_set_b(NULL, MODULENAME, OPT_SHOW_DATE, options->bShowDate);
+ db_set_b(NULL, MODULENAME, OPT_SHOW_TIME, options->bShowTime);
+ db_set_b(NULL, MODULENAME, OPT_SHOW_HEADERS, options->bShowHeaders);
+ db_set_b(NULL, MODULENAME, OPT_NUMBER_MSG, (BYTE)options->iNumberMsg);
+ db_set_b(NULL, MODULENAME, OPT_SHOW_ON, options->bShowON);
+ db_set_b(NULL, MODULENAME, OPT_HIDESEND, options->bHideSend);
+ db_set_b(NULL, MODULENAME, OPT_NORSS, options->bNoRSS);
+ db_set_b(NULL, MODULENAME, OPT_READCHECK, options->bReadCheck);
return 0;
}
diff --git a/plugins/NewEventNotify/src/stdafx.h b/plugins/NewEventNotify/src/stdafx.h
index b36d98cf32..434e95f3de 100644
--- a/plugins/NewEventNotify/src/stdafx.h
+++ b/plugins/NewEventNotify/src/stdafx.h
@@ -56,7 +56,7 @@
//---------------------------
//---Definitions
-#define MODULE "NewEventNotify"
+#define MODULENAME "NewEventNotify"
#define MAX_POPUPS 20
#define DEFAULT_COLBACK RGB(255,255,128)
@@ -150,9 +150,7 @@
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE)
- {}
+ CMPlugin();
};
struct PLUGIN_OPTIONS