diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-20 15:08:48 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-20 15:08:48 +0300 |
commit | 8a74e7495ce5ad39de4f5c25121a84d35df90c36 (patch) | |
tree | 03e5b4870f09a3163306740c2eebee47bc15b042 /plugins | |
parent | c5bf7d6123dd1c3b82ccb8fdb1b068077e9d56d4 (diff) |
CMPlugin to receive a reference to PLUGININFOEX
Diffstat (limited to 'plugins')
525 files changed, 5424 insertions, 5082 deletions
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp index 076f7889c9..8169ab755e 100644 --- a/plugins/AVS/src/main.cpp +++ b/plugins/AVS/src/main.cpp @@ -43,7 +43,7 @@ void InitServices(); /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfoEx =
+static PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -54,9 +54,13 @@ PLUGININFOEX pluginInfoEx = __AUTHORWEB,
UNICODE_AWARE,
// {E00F1643-263C-4599-B84B-053E5C511D29}
-{ 0xe00f1643, 0x263c, 0x4599,{ 0xb8, 0x4b, 0x5, 0x3e, 0x5c, 0x51, 0x1d, 0x29 } }
+ { 0xe00f1643, 0x263c, 0x4599, { 0xb8, 0x4b, 0x5, 0x3e, 0x5c, 0x51, 0x1d, 0x29 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(AVS_MODULE, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
diff --git a/plugins/AVS/src/stdafx.h b/plugins/AVS/src/stdafx.h index 162b642359..c2616efc6e 100644 --- a/plugins/AVS/src/stdafx.h +++ b/plugins/AVS/src/stdafx.h @@ -59,9 +59,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(AVS_MODULE)
- {}
+ CMPlugin();
};
/* most free()'s are invalid when the code is executed from a dll, so this changes
diff --git a/plugins/AddContactPlus/src/addcontact.cpp b/plugins/AddContactPlus/src/addcontact.cpp index 5bb5c3212f..da5163cea8 100644 --- a/plugins/AddContactPlus/src/addcontact.cpp +++ b/plugins/AddContactPlus/src/addcontact.cpp @@ -156,7 +156,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) acs = new AddDialogParam();
SetWindowLongPtr(hdlg, GWLP_USERDATA, (LONG_PTR)acs);
- Utils_RestoreWindowPositionNoSize(hdlg, NULL, "AddContact", "");
+ Utils_RestoreWindowPositionNoSize(hdlg, NULL, MODULENAME, "");
TranslateDialogDefault(hdlg);
Window_SetIcon_IcoLib(hdlg, IcoLib_GetIconHandle(ICON_ADD));
@@ -172,7 +172,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) SendDlgItemMessage(hdlg, IDC_GROUP, CB_INSERTSTRING, 0, (LPARAM)TranslateT("None"));
SendDlgItemMessage(hdlg, IDC_GROUP, CB_SETCURSEL, 0, 0);
{
- ptrA szProto(db_get_sa(NULL, "AddContact", "LastProto"));
+ ptrA szProto(db_get_sa(NULL, MODULENAME, "LastProto"));
if (szProto)
acs->proto = szProto;
}
@@ -317,7 +317,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) Window_FreeIcon_IcoLib(hdlg);
ImageList_Destroy((HIMAGELIST)SendDlgItemMessage(hdlg, IDC_PROTO, CBEM_GETIMAGELIST, 0, 0));
if (acs) {
- db_set_s(NULL, "AddContact", "LastProto", acs->proto);
+ db_set_s(NULL, MODULENAME, "LastProto", acs->proto);
if (acs->psr) {
mir_free(acs->psr->nick.w);
mir_free(acs->psr->firstName.w);
@@ -327,7 +327,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) }
delete acs;
}
- Utils_SaveWindowPosition(hdlg, NULL, "AddContact", "");
+ Utils_SaveWindowPosition(hdlg, NULL, MODULENAME, "");
break;
}
diff --git a/plugins/AddContactPlus/src/main.cpp b/plugins/AddContactPlus/src/main.cpp index 7c26887820..8f0456c7de 100644 --- a/plugins/AddContactPlus/src/main.cpp +++ b/plugins/AddContactPlus/src/main.cpp @@ -36,7 +36,7 @@ static IconItem icon[] = /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -50,9 +50,13 @@ PLUGININFOEX pluginInfo = {0x6471d451, 0x2fe0, 0x4ee2, {0x85, 0xe, 0x9f, 0x84, 0xf3, 0xc0, 0xd1, 0x87}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -135,7 +139,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
INITCOMMONCONTROLSEX icex = { sizeof(icex), ICC_USEREX_CLASSES };
diff --git a/plugins/AddContactPlus/src/stdafx.h b/plugins/AddContactPlus/src/stdafx.h index 8626486757..c8f890020e 100644 --- a/plugins/AddContactPlus/src/stdafx.h +++ b/plugins/AddContactPlus/src/stdafx.h @@ -44,11 +44,11 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "resource.h"
#include "version.h"
+#define MODULENAME "AddContact"
+
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>("AddContact")
- {}
+ CMPlugin();
};
#define ICON_ADD "AddContactPlus_Icon"
diff --git a/plugins/Alarms/src/alarm_win.cpp b/plugins/Alarms/src/alarm_win.cpp index 0379da801b..940f9857a7 100644 --- a/plugins/Alarms/src/alarm_win.cpp +++ b/plugins/Alarms/src/alarm_win.cpp @@ -37,7 +37,7 @@ INT_PTR CALLBACK DlgProcAlarm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- Utils_RestoreWindowPositionNoSize(hwndDlg, 0, MODULE, "Notify");
+ Utils_RestoreWindowPositionNoSize(hwndDlg, 0, MODULENAME, "Notify");
SetFocus(GetDlgItem(hwndDlg, IDC_SNOOZE));
wd = new WindowData;
@@ -52,7 +52,7 @@ INT_PTR CALLBACK DlgProcAlarm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar r.left += 20;
SetWindowPos(hwndDlg, nullptr, r.left, r.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
- Utils_SaveWindowPosition(hwndDlg, 0, MODULE, "Notify");
+ Utils_SaveWindowPosition(hwndDlg, 0, MODULENAME, "Notify");
}
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)wd);
@@ -191,7 +191,7 @@ INT_PTR CALLBACK DlgProcAlarm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar return TRUE;
case WM_MOVE:
- Utils_SaveWindowPosition(hwndDlg, 0, MODULE, "Notify");
+ Utils_SaveWindowPosition(hwndDlg, 0, MODULENAME, "Notify");
break;
case WMU_ADDSNOOZER:
@@ -350,7 +350,7 @@ int AlarmWinModulesLoaded(WPARAM, LPARAM) title_font_id.cbSize = sizeof(FontIDW);
wcsncpy_s(title_font_id.group, LPGENW("Alarms"), _TRUNCATE);
wcsncpy_s(title_font_id.name, LPGENW("Title"), _TRUNCATE);
- strncpy_s(title_font_id.dbSettingsGroup, MODULE, _TRUNCATE);
+ strncpy_s(title_font_id.dbSettingsGroup, MODULENAME, _TRUNCATE);
strncpy_s(title_font_id.prefix, "FontTitle", _TRUNCATE);
wcsncpy_s(title_font_id.backgroundGroup, LPGENW("Alarms"), _TRUNCATE);
wcsncpy_s(title_font_id.backgroundName, LPGENW("Background"), _TRUNCATE);
@@ -361,7 +361,7 @@ int AlarmWinModulesLoaded(WPARAM, LPARAM) window_font_id.cbSize = sizeof(FontIDW);
wcsncpy_s(window_font_id.group, LPGENW("Alarms"), _TRUNCATE);
wcsncpy_s(window_font_id.name, LPGENW("Window"), _TRUNCATE);
- strncpy_s(window_font_id.dbSettingsGroup, MODULE, _TRUNCATE);
+ strncpy_s(window_font_id.dbSettingsGroup, MODULENAME, _TRUNCATE);
strncpy_s(window_font_id.prefix, "FontWindow", _TRUNCATE);
wcsncpy_s(window_font_id.backgroundGroup, LPGENW("Alarms"), _TRUNCATE);
wcsncpy_s(window_font_id.backgroundName, LPGENW("Background"), _TRUNCATE);
@@ -370,7 +370,7 @@ int AlarmWinModulesLoaded(WPARAM, LPARAM) Font_RegisterW(&window_font_id);
bk_colour_id.cbSize = sizeof(ColourIDW);
- strncpy_s(bk_colour_id.dbSettingsGroup, MODULE, _TRUNCATE);
+ strncpy_s(bk_colour_id.dbSettingsGroup, MODULENAME, _TRUNCATE);
wcsncpy_s(bk_colour_id.group, LPGENW("Alarms"), _TRUNCATE);
wcsncpy_s(bk_colour_id.name, LPGENW("Background"), _TRUNCATE);
strncpy_s(bk_colour_id.setting, "BkColour", _TRUNCATE);
diff --git a/plugins/Alarms/src/alarmlist.cpp b/plugins/Alarms/src/alarmlist.cpp index 0cbacdff46..485a02d6e8 100755 --- a/plugins/Alarms/src/alarmlist.cpp +++ b/plugins/Alarms/src/alarmlist.cpp @@ -229,7 +229,7 @@ bool UpdateAlarm(SYSTEMTIME &time, Occurrence occ, int selected_days) void LoadAlarms()
{
- int num_alarms = db_get_w(0, MODULE, "Count", 0);
+ int num_alarms = db_get_w(0, MODULENAME, "Count", 0);
char buff[256];
DBVARIANT dbv;
ALARM alarm;
@@ -243,69 +243,69 @@ void LoadAlarms() memset(&alarm, 0, sizeof(ALARM));
mir_snprintf(buff, "Title%d", i);
- if (!db_get_ws(0, MODULE, buff, &dbv)) {
+ if (!db_get_ws(0, MODULENAME, buff, &dbv)) {
alarm.szTitle = mir_wstrdup(dbv.ptszVal);
db_free(&dbv);
}
mir_snprintf(buff, "Desc%d", i);
- if (!db_get_ws(0, MODULE, buff, &dbv)) {
+ if (!db_get_ws(0, MODULENAME, buff, &dbv)) {
alarm.szDesc = mir_wstrdup(dbv.ptszVal);
db_free(&dbv);
}
mir_snprintf(buff, "Occ%d", i);
- alarm.occurrence = (Occurrence)db_get_w(0, MODULE, buff, 0);
+ alarm.occurrence = (Occurrence)db_get_w(0, MODULENAME, buff, 0);
mir_snprintf(buff, "STHour%d", i);
- alarm.time.wHour = db_get_w(0, MODULE, buff, 0);
+ alarm.time.wHour = db_get_w(0, MODULENAME, buff, 0);
mir_snprintf(buff, "STMinute%d", i);
- alarm.time.wMinute = db_get_w(0, MODULE, buff, 0);
+ alarm.time.wMinute = db_get_w(0, MODULENAME, buff, 0);
mir_snprintf(buff, "STSecond%d", i);
- alarm.time.wSecond = db_get_w(0, MODULE, buff, 0);
+ alarm.time.wSecond = db_get_w(0, MODULENAME, buff, 0);
switch (alarm.occurrence) {
case OC_ONCE:
mir_snprintf(buff, "STYear%d", i);
- alarm.time.wYear = db_get_w(0, MODULE, buff, 0);
+ alarm.time.wYear = db_get_w(0, MODULENAME, buff, 0);
mir_snprintf(buff, "STMonth%d", i);
- alarm.time.wMonth = db_get_w(0, MODULE, buff, 0);
+ alarm.time.wMonth = db_get_w(0, MODULENAME, buff, 0);
mir_snprintf(buff, "STDay%d", i);
- alarm.time.wDay = db_get_w(0, MODULE, buff, 0);
+ alarm.time.wDay = db_get_w(0, MODULENAME, buff, 0);
break;
case OC_WEEKLY:
mir_snprintf(buff, "STDayOfWeek%d", i);
- alarm.time.wDayOfWeek = db_get_w(0, MODULE, buff, 0);
+ alarm.time.wDayOfWeek = db_get_w(0, MODULENAME, buff, 0);
break;
case OC_WEEKDAYS:
break;
case OC_SELECTED_DAYS:
mir_snprintf(buff, "SelectedDays%d", i);
- alarm.day_mask = db_get_dw(0, MODULE, buff, alarm.day_mask);
+ alarm.day_mask = db_get_dw(0, MODULENAME, buff, alarm.day_mask);
break;
case OC_DAILY:
break;
case OC_MONTHLY:
mir_snprintf(buff, "STDay%d", i);
- alarm.time.wDay = db_get_w(0, MODULE, buff, 0);
+ alarm.time.wDay = db_get_w(0, MODULENAME, buff, 0);
break;
case OC_YEARLY:
mir_snprintf(buff, "STMonth%d", i);
- alarm.time.wMonth = db_get_w(0, MODULE, buff, 0);
+ alarm.time.wMonth = db_get_w(0, MODULENAME, buff, 0);
mir_snprintf(buff, "STDay%d", i);
- alarm.time.wDay = db_get_w(0, MODULE, buff, 0);
+ alarm.time.wDay = db_get_w(0, MODULENAME, buff, 0);
break;
}
if (UpdateAlarm(alarm.time, alarm.occurrence, alarm.day_mask)) {
mir_snprintf(buff, "ActionFlags%d", i);
- alarm.action = (unsigned short)db_get_dw(0, MODULE, buff, AAF_POPUP | AAF_SOUND);
+ alarm.action = (unsigned short)db_get_dw(0, MODULENAME, buff, AAF_POPUP | AAF_SOUND);
if (alarm.action & AAF_COMMAND) {
mir_snprintf(buff, "ActionCommand%d", i);
- if (!db_get_ws(0, MODULE, buff, &dbv)) {
+ if (!db_get_ws(0, MODULENAME, buff, &dbv)) {
alarm.szCommand = mir_wstrdup(dbv.ptszVal);
db_free(&dbv);
mir_snprintf(buff, "ActionParams%d", i);
- if (!db_get_ws(0, MODULE, buff, &dbv)) {
+ if (!db_get_ws(0, MODULENAME, buff, &dbv)) {
alarm.szCommandParams = mir_wstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -313,22 +313,22 @@ void LoadAlarms() }
mir_snprintf(buff, "SoundNum%d", i);
- alarm.sound_num = (int)db_get_b(0, MODULE, buff, 1);
+ alarm.sound_num = (int)db_get_b(0, MODULENAME, buff, 1);
mir_snprintf(buff, "Snoozer%d", i);
- alarm.snoozer = db_get_b(0, MODULE, buff, 0) == 1;
+ alarm.snoozer = db_get_b(0, MODULENAME, buff, 0) == 1;
mir_snprintf(buff, "Hidden%d", i);
- alarm.flags |= (db_get_b(0, MODULE, buff, 0) == 1 ? ALF_HIDDEN : 0);
+ alarm.flags |= (db_get_b(0, MODULENAME, buff, 0) == 1 ? ALF_HIDDEN : 0);
mir_snprintf(buff, "Suspended%d", i);
- alarm.flags |= (db_get_b(0, MODULE, buff, 0) == 1 ? ALF_SUSPENDED : 0);
+ alarm.flags |= (db_get_b(0, MODULENAME, buff, 0) == 1 ? ALF_SUSPENDED : 0);
mir_snprintf(buff, "NoStartup%d", i);
- alarm.flags |= (db_get_b(0, MODULE, buff, 0) == 1 ? ALF_NOSTARTUP : 0);
+ alarm.flags |= (db_get_b(0, MODULENAME, buff, 0) == 1 ? ALF_NOSTARTUP : 0);
mir_snprintf(buff, "Flags%d", i);
- alarm.flags = db_get_dw(0, MODULE, buff, alarm.flags);
+ alarm.flags = db_get_dw(0, MODULENAME, buff, alarm.flags);
alarm.id = next_alarm_id++;
alarms.push_back(&alarm);
@@ -391,10 +391,10 @@ void SaveAlarms() //quick and dirty solution, feel free to rewrite
//TODO: this should be done on "delete" button press instead, and for selected alrams only
std::list<char*> settings;
- db_enum_settings(0, &db_enum_settings_sub_cb, MODULE, &settings);
+ db_enum_settings(0, &db_enum_settings_sub_cb, MODULENAME, &settings);
for (std::list<char*>::iterator i = settings.begin(), end = settings.end(); i != end; ++i)
{
- db_unset(0, MODULE, *i);
+ db_unset(0, MODULENAME, *i);
mir_free(*i);
}
}
@@ -403,18 +403,18 @@ void SaveAlarms() ALARM *i;
for (alarms.reset(); i = alarms.current(); alarms.next(), index++) {
mir_snprintf(buff, "Title%d", index);
- db_set_ws(0, MODULE, buff, i->szTitle);
+ db_set_ws(0, MODULENAME, buff, i->szTitle);
mir_snprintf(buff, "Desc%d", index);
- db_set_ws(0, MODULE, buff, i->szDesc);
+ db_set_ws(0, MODULENAME, buff, i->szDesc);
mir_snprintf(buff, "Occ%d", index);
- db_set_w(0, MODULE, buff, i->occurrence);
+ db_set_w(0, MODULENAME, buff, i->occurrence);
mir_snprintf(buff, "STHour%d", index);
- db_set_w(0, MODULE, buff, i->time.wHour);
+ db_set_w(0, MODULENAME, buff, i->time.wHour);
mir_snprintf(buff, "STMinute%d", index);
- db_set_w(0, MODULE, buff, i->time.wMinute);
+ db_set_w(0, MODULENAME, buff, i->time.wMinute);
mir_snprintf(buff, "STSecond%d", index);
- db_set_w(0, MODULE, buff, i->time.wSecond);
+ db_set_w(0, MODULENAME, buff, i->time.wSecond);
switch (i->occurrence) {
case OC_DAILY:
@@ -423,47 +423,47 @@ void SaveAlarms() break;
case OC_SELECTED_DAYS:
mir_snprintf(buff, "SelectedDays%d", index);
- db_set_dw(0, MODULE, buff, i->day_mask);
+ db_set_dw(0, MODULENAME, buff, i->day_mask);
break;
case OC_WEEKLY:
mir_snprintf(buff, "STDayOfWeek%d", index);
- db_set_w(0, MODULE, buff, i->time.wDayOfWeek);
+ db_set_w(0, MODULENAME, buff, i->time.wDayOfWeek);
break;
case OC_ONCE:
mir_snprintf(buff, "STYear%d", index);
- db_set_w(0, MODULE, buff, i->time.wYear);
+ db_set_w(0, MODULENAME, buff, i->time.wYear);
case OC_YEARLY:
mir_snprintf(buff, "STMonth%d", index);
- db_set_w(0, MODULE, buff, i->time.wMonth);
+ db_set_w(0, MODULENAME, buff, i->time.wMonth);
case OC_MONTHLY:
mir_snprintf(buff, "STDay%d", index);
- db_set_w(0, MODULE, buff, i->time.wDay);
+ db_set_w(0, MODULENAME, buff, i->time.wDay);
break;
}
mir_snprintf(buff, "ActionFlags%d", index);
- db_set_dw(0, MODULE, buff, i->action);
+ db_set_dw(0, MODULENAME, buff, i->action);
if (i->action & AAF_COMMAND) {
if (mir_wstrlen(i->szCommand)) {
mir_snprintf(buff, "ActionCommand%d", index);
- db_set_ws(0, MODULE, buff, i->szCommand);
+ db_set_ws(0, MODULENAME, buff, i->szCommand);
if (mir_wstrlen(i->szCommandParams)) {
mir_snprintf(buff, "ActionParams%d", index);
- db_set_ws(0, MODULE, buff, i->szCommandParams);
+ db_set_ws(0, MODULENAME, buff, i->szCommandParams);
}
}
}
mir_snprintf(buff, "SoundNum%d", index);
- db_set_b(0, MODULE, buff, i->sound_num);
+ db_set_b(0, MODULENAME, buff, i->sound_num);
mir_snprintf(buff, "Snoozer%d", index);
- db_set_b(0, MODULE, buff, i->snoozer ? 1 : 0);
+ db_set_b(0, MODULENAME, buff, i->snoozer ? 1 : 0);
mir_snprintf(buff, "Flags%d", index);
- db_set_dw(0, MODULE, buff, i->flags);
+ db_set_dw(0, MODULENAME, buff, i->flags);
}
- db_set_w(0, MODULE, "Count", index);
+ db_set_w(0, MODULENAME, "Count", index);
}
void copy_list(AlarmList ©)
@@ -692,7 +692,7 @@ void DoAlarm(ALARM *alarm) void WriteLastCheckTime()
{
// save last-check time
- db_set_blob(NULL, MODULE, "LastCheck", &last_check, sizeof(SYSTEMTIME));
+ db_set_blob(NULL, MODULENAME, "LastCheck", &last_check, sizeof(SYSTEMTIME));
last_saved_check = last_check;
}
@@ -785,7 +785,7 @@ void InitList() DBVARIANT dbv;
dbv.type = DBVT_BLOB;
dbv.cpbVal = sizeof(SYSTEMTIME);
- if (!db_get(NULL, MODULE, "LastCheck", &dbv)) {
+ if (!db_get(NULL, MODULENAME, "LastCheck", &dbv)) {
memcpy(&last_check, dbv.pbVal, sizeof(SYSTEMTIME));
db_free(&dbv);
}
diff --git a/plugins/Alarms/src/alarms.cpp b/plugins/Alarms/src/alarms.cpp index 76d0a069b5..ae2d88cfde 100644 --- a/plugins/Alarms/src/alarms.cpp +++ b/plugins/Alarms/src/alarms.cpp @@ -23,7 +23,9 @@ int &hLangpack(g_plugin.m_hLang); HANDLE hTopToolbarButton;
-PLUGININFOEX pluginInfo = {
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -36,11 +38,17 @@ PLUGININFOEX pluginInfo = { {0x4dd7762b, 0xd612, 0x4f84, {0xaa, 0x86, 0x6, 0x8f, 0x17, 0x85, 0x9b, 0x6d}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) {
@@ -119,7 +127,7 @@ static int InitTopToolbarButton(WPARAM, LPARAM) TTBButton ttb = {};
ttb.hIconUp = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_TBUP));
ttb.hIconDn = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_TBDN));
- ttb.pszService = MODULE "/NewAlarm";
+ ttb.pszService = MODULENAME "/NewAlarm";
ttb.dwFlags = TTBBF_VISIBLE;
ttb.name = ttb.pszTooltipUp = LPGEN("Set alarm");
hTopToolbarButton = TopToolbar_AddButton(&ttb);
@@ -144,7 +152,7 @@ static int MainDeInit(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
// ensure datetime picker is loaded
@@ -167,6 +175,8 @@ extern "C" int __declspec(dllexport) Load(void) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Unload(void)
{
return 0;
diff --git a/plugins/Alarms/src/frame.cpp b/plugins/Alarms/src/frame.cpp index c23d8e31ea..69759eb1d6 100755 --- a/plugins/Alarms/src/frame.cpp +++ b/plugins/Alarms/src/frame.cpp @@ -46,13 +46,13 @@ LRESULT CALLBACK FrameContainerWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LP case WM_SHOWWINDOW:
if (wParam) {
- db_set_b(0, MODULE, "ReminderFrameVisible", 1);
- Utils_RestoreWindowPosition(hwnd, 0, MODULE, "reminders_window");
+ db_set_b(0, MODULENAME, "ReminderFrameVisible", 1);
+ Utils_RestoreWindowPosition(hwnd, 0, MODULENAME, "reminders_window");
PostMessage(hwnd, WM_SIZE, 0, 0);
}
else {
- db_set_b(0, MODULE, "ReminderFrameVisible", 0);
- Utils_SaveWindowPosition(hwnd, 0, MODULE, "reminders_window");
+ db_set_b(0, MODULENAME, "ReminderFrameVisible", 0);
+ Utils_SaveWindowPosition(hwnd, 0, MODULENAME, "reminders_window");
}
break;
case WM_SIZE:
@@ -68,7 +68,7 @@ LRESULT CALLBACK FrameContainerWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LP break;
case WM_CLOSE:
- Utils_SaveWindowPosition(hwnd, 0, MODULE, "reminders_window");
+ Utils_SaveWindowPosition(hwnd, 0, MODULENAME, "reminders_window");
ShowWindow(hwnd, SW_HIDE);
FixMainMenu();
return TRUE;
@@ -519,7 +519,7 @@ int CreateFrame() ///////////////////////
// create menu item
- CreateServiceFunction(MODULE "/ShowHideReminders", ShowHideMenuFunc);
+ CreateServiceFunction(MODULENAME "/ShowHideReminders", ShowHideMenuFunc);
CMenuItem mi;
mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Alarms"), 0);
@@ -528,7 +528,7 @@ int CreateFrame() SET_UID(mi, 0x27556ea9, 0xfa19, 0x4c2e, 0xb0, 0xc9, 0x48, 0x2, 0x5c, 0x17, 0xba, 0x5);
mi.hIcolibItem = hIconMenuShowHide;
mi.name.a = LPGEN("Show reminders");
- mi.pszService = MODULE "/ShowHideReminders";
+ mi.pszService = MODULENAME "/ShowHideReminders";
mi.position = 500010000;
hMenuShowReminders = Menu_AddMainMenuItem(&mi);
/////////////////////
@@ -542,7 +542,7 @@ int CreateFrame() else ShowWindow(hwnd_frame, SW_HIDE);
}
else {
- if (db_get_b(0, MODULE, "ReminderFrameVisible", 1) == 1) {
+ if (db_get_b(0, MODULENAME, "ReminderFrameVisible", 1) == 1) {
ShowWindow(hwnd_frame, SW_SHOW);
RefreshReminderFrame();
}
@@ -558,13 +558,13 @@ int CreateFrame() font_id.cbSize = sizeof(font_id);
strncpy_s(font_id.group, LPGEN("Frames"), _TRUNCATE);
strncpy_s(font_id.name, LPGEN("Alarm reminders"), _TRUNCATE);
- strncpy_s(font_id.dbSettingsGroup, MODULE, _TRUNCATE);
+ strncpy_s(font_id.dbSettingsGroup, MODULENAME, _TRUNCATE);
strncpy_s(font_id.prefix, "Font", _TRUNCATE);
font_id.order = 0;
Font_Register(&font_id);
framebk_colour_id.cbSize = sizeof(ColourID);
- strncpy_s(framebk_colour_id.dbSettingsGroup, MODULE, _TRUNCATE);
+ strncpy_s(framebk_colour_id.dbSettingsGroup, MODULENAME, _TRUNCATE);
strncpy_s(framebk_colour_id.group, LPGEN("Frames"), _TRUNCATE);
strncpy_s(framebk_colour_id.name, LPGEN("Alarm reminders"), _TRUNCATE);
strncpy_s(framebk_colour_id.setting, "clFrameBack", _TRUNCATE);
diff --git a/plugins/Alarms/src/options.cpp b/plugins/Alarms/src/options.cpp index 91880d9a80..3dc22dccba 100755 --- a/plugins/Alarms/src/options.cpp +++ b/plugins/Alarms/src/options.cpp @@ -68,7 +68,7 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP delete param;
- Utils_RestoreWindowPositionNoSize(hwndDlg, 0, MODULE, "AddEdit");
+ Utils_RestoreWindowPositionNoSize(hwndDlg, 0, MODULENAME, "AddEdit");
if (GetDlgCtrlID((HWND)wParam) != IDC_TITLE) {
SetFocus(GetDlgItem(hwndDlg, IDC_TITLE));
@@ -701,7 +701,7 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
else add_edit_alarm->sound_num = 0;
- Utils_SaveWindowPosition(hwndDlg, 0, MODULE, "AddEdit");
+ Utils_SaveWindowPosition(hwndDlg, 0, MODULENAME, "AddEdit");
// self-add (setting stored in invisible checkbox - see comments in WM_INITDIALOG
if (IsDlgButtonChecked(hwndDlg, IDC_CHK_INVIS)) {
@@ -734,7 +734,7 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP delete add_edit_alarm;
}
- Utils_SaveWindowPosition(hwndDlg, 0, MODULE, "AddEdit");
+ Utils_SaveWindowPosition(hwndDlg, 0, MODULENAME, "AddEdit");
// deal with modal and non-modal modes
PostMessage(hwndDlg, WMU_MYDESTROY, 0, 0);
@@ -820,7 +820,7 @@ void AddMenuItem() SET_UID(mi, 0xd50b94e4, 0x8edd, 0x4083, 0x91, 0x93, 0x7c, 0x6a, 0xb8, 0x1, 0x41, 0xb9);
mi.hIcolibItem = IcoLib_GetIconHandle("alarms_menu_set");
mi.name.a = "Set alarm";
- mi.pszService = MODULE "/NewAlarm";
+ mi.pszService = MODULENAME "/NewAlarm";
mi.position = 500010000;
hMainMenuItem = Menu_AddMainMenuItem(&mi);
}
@@ -830,7 +830,7 @@ void AddMenuItem() int OptionsModulesLoaded(WPARAM, LPARAM)
{
- CreateServiceFunction(MODULE "/NewAlarm", NewAlarmMenuFunc);
+ CreateServiceFunction(MODULENAME "/NewAlarm", NewAlarmMenuFunc);
AddMenuItem();
@@ -1224,36 +1224,36 @@ int OptInit(WPARAM wParam, LPARAM) void LoadOptions()
{
- options.use_popup_module = (db_get_b(0, MODULE, "UsePopupModule", 0) == 1);
- options.snooze_minutes = (int)db_get_dw(0, MODULE, "SnoozeMinutes", 10);
- options.row_height = (int)db_get_dw(0, MODULE, "RowHeight", 20);
- options.indent = (int)db_get_dw(0, MODULE, "Indent", 5);
- options.aw_trans = (int)db_get_b(0, MODULE, "Transparency", 0);
- options.aw_roundcorners = (db_get_b(0, MODULE, "RoundCorners", 1) == 1);
- options.aw_dontstealfocus = (db_get_b(0, MODULE, "DontStealFocus", 1) == 1);
- options.auto_showhide = (db_get_b(0, MODULE, "AutoShowHide", 0) == 1);
- options.hide_with_clist = (db_get_b(0, MODULE, "HideWithClist", 0) == 1);
- options.loop_sound = (db_get_b(0, MODULE, "LoopSound", 1) == 1);
- options.auto_size_vert = (db_get_b(0, MODULE, "AutoSize", 0) == 1);
- options.reminder_period = (int)db_get_dw(0, MODULE, "ReminderPeriod", 8);
+ options.use_popup_module = (db_get_b(0, MODULENAME, "UsePopupModule", 0) == 1);
+ options.snooze_minutes = (int)db_get_dw(0, MODULENAME, "SnoozeMinutes", 10);
+ options.row_height = (int)db_get_dw(0, MODULENAME, "RowHeight", 20);
+ options.indent = (int)db_get_dw(0, MODULENAME, "Indent", 5);
+ options.aw_trans = (int)db_get_b(0, MODULENAME, "Transparency", 0);
+ options.aw_roundcorners = (db_get_b(0, MODULENAME, "RoundCorners", 1) == 1);
+ options.aw_dontstealfocus = (db_get_b(0, MODULENAME, "DontStealFocus", 1) == 1);
+ options.auto_showhide = (db_get_b(0, MODULENAME, "AutoShowHide", 0) == 1);
+ options.hide_with_clist = (db_get_b(0, MODULENAME, "HideWithClist", 0) == 1);
+ options.loop_sound = (db_get_b(0, MODULENAME, "LoopSound", 1) == 1);
+ options.auto_size_vert = (db_get_b(0, MODULENAME, "AutoSize", 0) == 1);
+ options.reminder_period = (int)db_get_dw(0, MODULENAME, "ReminderPeriod", 8);
HookEvent(ME_SYSTEM_MODULESLOADED, OptionsModulesLoaded);
}
void SaveOptions()
{
- db_set_b(0, MODULE, "UsePopupModule", options.use_popup_module ? 1 : 0);
- db_set_dw(0, MODULE, "SnoozeMinutes", options.snooze_minutes);
- db_set_dw(0, MODULE, "RowHeight", options.row_height);
- db_set_dw(0, MODULE, "Indent", options.indent);
- db_set_b(0, MODULE, "Transparency", options.aw_trans);
- db_set_b(0, MODULE, "RoundCorners", options.aw_roundcorners ? 1 : 0);
- db_set_b(0, MODULE, "DontStealFocus", options.aw_dontstealfocus ? 1 : 0);
- db_set_b(0, MODULE, "AutoShowHide", options.auto_showhide ? 1 : 0);
- db_set_b(0, MODULE, "HideWithClist", options.hide_with_clist ? 1 : 0);
- db_set_b(0, MODULE, "LoopSound", options.loop_sound ? 1 : 0);
- db_set_b(0, MODULE, "AutoSize", options.auto_size_vert ? 1 : 0);
- db_set_dw(0, MODULE, "ReminderPeriod", options.reminder_period);
+ db_set_b(0, MODULENAME, "UsePopupModule", options.use_popup_module ? 1 : 0);
+ db_set_dw(0, MODULENAME, "SnoozeMinutes", options.snooze_minutes);
+ db_set_dw(0, MODULENAME, "RowHeight", options.row_height);
+ db_set_dw(0, MODULENAME, "Indent", options.indent);
+ db_set_b(0, MODULENAME, "Transparency", options.aw_trans);
+ db_set_b(0, MODULENAME, "RoundCorners", options.aw_roundcorners ? 1 : 0);
+ db_set_b(0, MODULENAME, "DontStealFocus", options.aw_dontstealfocus ? 1 : 0);
+ db_set_b(0, MODULENAME, "AutoShowHide", options.auto_showhide ? 1 : 0);
+ db_set_b(0, MODULENAME, "HideWithClist", options.hide_with_clist ? 1 : 0);
+ db_set_b(0, MODULENAME, "LoopSound", options.loop_sound ? 1 : 0);
+ db_set_b(0, MODULENAME, "AutoSize", options.auto_size_vert ? 1 : 0);
+ db_set_dw(0, MODULENAME, "ReminderPeriod", options.reminder_period);
}
INT_PTR NewAlarmMenuFunc(WPARAM, LPARAM)
diff --git a/plugins/Alarms/src/stdafx.h b/plugins/Alarms/src/stdafx.h index 26575d45a4..149933f902 100755 --- a/plugins/Alarms/src/stdafx.h +++ b/plugins/Alarms/src/stdafx.h @@ -49,16 +49,13 @@ typedef struct ALARM_tag { #include "alarm_win.h"
#include "time_utils.h"
-#define MODULE "Alarm"
+#define MODULENAME "Alarm"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE)
- {}
+ CMPlugin();
};
extern HANDLE hTopToolbarButton;
-
#endif
diff --git a/plugins/AsSingleWindow/src/AsSingleWindow.cpp b/plugins/AsSingleWindow/src/AsSingleWindow.cpp index 8ab98c8d1a..87496f8e83 100644 --- a/plugins/AsSingleWindow/src/AsSingleWindow.cpp +++ b/plugins/AsSingleWindow/src/AsSingleWindow.cpp @@ -4,11 +4,15 @@ #include "WindowsManager.h" #include "version.h" -CLIST_INTERFACE *pcli; +sPluginVars pluginVars; + CMPlugin g_plugin; +CLIST_INTERFACE *pcli; int &hLangpack(g_plugin.m_hLang); -PLUGININFOEX pluginInfo = { +///////////////////////////////////////////////////////////////////////////////////////// + +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), @@ -20,11 +24,43 @@ PLUGININFOEX pluginInfo = { {0xF6C73B4, 0x2B2B, 0x711D, {0xFB, 0xB6, 0xBB, 0x26, 0x7D, 0xFD, 0x72, 0x08}}, // 0xF6C73B42B2B711DFBB6BB267DFD7208 }; -sPluginVars pluginVars; +CMPlugin::CMPlugin() : + PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx) +{} extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { - return &pluginInfo; + return &pluginInfoEx; +} + +///////////////////////////////////////////////////////////////////////////////////////// + +static int MsgWindowEvent(WPARAM, LPARAM lParam) +{ + MessageWindowEventData* data = (MessageWindowEventData*)lParam; + + if (data == nullptr) + return 0; + + switch (data->uType) { + case MSG_WINDOW_EVT_OPEN: + // Здесь можно отлавливать только открытие окна, + // т.к. закрытие может быть закрытием вкладки + windowAdd(data->hwndWindow, false); + break; + } + + return 0; +} + +static int OnModulesLoaded(WPARAM, LPARAM) +{ + windowAdd(pcli->hwndContactList, true); + + HookEvent(ME_MSG_WINDOWEVENT, MsgWindowEvent); + + optionsLoad(); + return 0; } static int OnShutdown(WPARAM, LPARAM) @@ -36,7 +72,7 @@ static int OnShutdown(WPARAM, LPARAM) extern "C" __declspec(dllexport) int Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); pcli = Clist_GetInterface(); ::InitializeCriticalSection(&pluginVars.m_CS); @@ -47,36 +83,10 @@ extern "C" __declspec(dllexport) int Load(void) return 0; } +///////////////////////////////////////////////////////////////////////////////////////// + extern "C" __declspec(dllexport) int Unload(void) { ::DeleteCriticalSection(&pluginVars.m_CS); return 0; } - -int OnModulesLoaded(WPARAM, LPARAM) -{ - windowAdd(pcli->hwndContactList, true); - - HookEvent(ME_MSG_WINDOWEVENT, MsgWindowEvent); - - optionsLoad(); - return 0; -} - -int MsgWindowEvent(WPARAM, LPARAM lParam) -{ - MessageWindowEventData* data = (MessageWindowEventData*)lParam; - - if (data == nullptr) - return 0; - - switch (data->uType) { - case MSG_WINDOW_EVT_OPEN: - // Здесь можно отлавливать только открытие окна, - // т.к. закрытие может быть закрытием вкладки - windowAdd(data->hwndWindow, false); - break; - } - - return 0; -} diff --git a/plugins/AsSingleWindow/src/AsSingleWindow.h b/plugins/AsSingleWindow/src/AsSingleWindow.h index 035a7697b2..eb00523ec3 100644 --- a/plugins/AsSingleWindow/src/AsSingleWindow.h +++ b/plugins/AsSingleWindow/src/AsSingleWindow.h @@ -29,7 +29,3 @@ struct sPluginVars { }; extern sPluginVars pluginVars; -extern PLUGININFOEX pluginInfo; - -int OnModulesLoaded(WPARAM, LPARAM); -int MsgWindowEvent(WPARAM, LPARAM); diff --git a/plugins/AsSingleWindow/src/Options.cpp b/plugins/AsSingleWindow/src/Options.cpp index 54da7362e4..383e0422d2 100644 --- a/plugins/AsSingleWindow/src/Options.cpp +++ b/plugins/AsSingleWindow/src/Options.cpp @@ -103,8 +103,8 @@ void dlgUpdateControls(HWND hWnd) void optionsLoad() { - pluginVars.Options.DrivenWindowPos = db_get_b(0, SETTINGSNAME, "DrivenWindowPosition", ASW_CLWINDOWPOS_RIGHT); - pluginVars.Options.WindowsMerging = db_get_b(0, SETTINGSNAME, "WindowsMerging", ASW_WINDOWS_MERGEONE); + pluginVars.Options.DrivenWindowPos = db_get_b(0, MODULENAME, "DrivenWindowPosition", ASW_CLWINDOWPOS_RIGHT); + pluginVars.Options.WindowsMerging = db_get_b(0, MODULENAME, "WindowsMerging", ASW_WINDOWS_MERGEONE); } void optionsUpdate(HWND hWnd) @@ -122,6 +122,6 @@ void optionsUpdate(HWND hWnd) void optionsSave() { - db_set_b(0, SETTINGSNAME, "DrivenWindowPosition", pluginVars.Options.DrivenWindowPos); - db_set_b(0, SETTINGSNAME, "WindowsMerging", pluginVars.Options.WindowsMerging); + db_set_b(0, MODULENAME, "DrivenWindowPosition", pluginVars.Options.DrivenWindowPos); + db_set_b(0, MODULENAME, "WindowsMerging", pluginVars.Options.WindowsMerging); } diff --git a/plugins/AsSingleWindow/src/Options.h b/plugins/AsSingleWindow/src/Options.h index 4c0a265793..5a2829dc72 100644 --- a/plugins/AsSingleWindow/src/Options.h +++ b/plugins/AsSingleWindow/src/Options.h @@ -1,6 +1,6 @@ #pragma once -#define SETTINGSNAME "AsSingleWindow" +#define MODULENAME "AsSingleWindow" int InitOptions(WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK cbOptionsDialog(HWND, UINT, WPARAM, LPARAM); diff --git a/plugins/AsSingleWindow/src/stdafx.h b/plugins/AsSingleWindow/src/stdafx.h index 8b7fa46405..206955b5f7 100644 --- a/plugins/AsSingleWindow/src/stdafx.h +++ b/plugins/AsSingleWindow/src/stdafx.h @@ -25,7 +25,5 @@ struct CMPlugin : public PLUGIN<CMPlugin> { - CMPlugin() : - PLUGIN<CMPlugin>(SETTINGSNAME) - {} + CMPlugin(); }; diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp index 43c538eb2c..a71fca6050 100644 --- a/plugins/AssocMgr/src/assoclist.cpp +++ b/plugins/AssocMgr/src/assoclist.cpp @@ -49,7 +49,7 @@ static BOOL IsAssocEnabled(const ASSOCDATA *assoc) {
char szSetting[MAXMODULELABELLENGTH];
mir_snprintf(szSetting, "enabled_%s", assoc->pszClassName);
- return db_get_b(NULL, "AssocMgr", szSetting, (BYTE)!(assoc->flags&FTDF_DEFAULTDISABLED)) != 0;
+ return db_get_b(NULL, MODULENAME, szSetting, (BYTE)!(assoc->flags&FTDF_DEFAULTDISABLED)) != 0;
}
static void SetAssocEnabled(const ASSOCDATA *assoc, BOOL fEnabled)
@@ -57,13 +57,13 @@ static void SetAssocEnabled(const ASSOCDATA *assoc, BOOL fEnabled) char szSetting[MAXMODULELABELLENGTH];
wchar_t szDLL[MAX_PATH], szBuf[MAX_PATH];
mir_snprintf(szSetting, "enabled_%s", assoc->pszClassName);
- db_set_b(NULL, "AssocMgr", szSetting, (BYTE)fEnabled);
+ db_set_b(NULL, MODULENAME, szSetting, (BYTE)fEnabled);
// dll name for uninstall
if (assoc->hInstance != nullptr && assoc->hInstance != g_plugin.getInst() && assoc->hInstance != GetModuleHandle(nullptr))
if (GetModuleFileName(assoc->hInstance, szBuf, _countof(szBuf)))
if (PathToRelativeW(szBuf, szDLL)) {
mir_snprintf(szSetting, "module_%s", assoc->pszClassName);
- db_set_ws(NULL, "AssocMgr", szSetting, szDLL);
+ db_set_ws(NULL, MODULENAME, szSetting, szDLL);
}
}
@@ -71,10 +71,10 @@ static void DeleteAssocEnabledSetting(const ASSOCDATA *assoc) {
char szSetting[MAXMODULELABELLENGTH];
mir_snprintf(szSetting, "enabled_%s", assoc->pszClassName);
- db_unset(NULL, "AssocMgr", szSetting);
+ db_unset(NULL, MODULENAME, szSetting);
// dll name for uninstall
mir_snprintf(szSetting, "module_%s", assoc->pszClassName);
- db_unset(NULL, "AssocMgr", szSetting);
+ db_unset(NULL, MODULENAME, szSetting);
}
void CleanupAssocEnabledSettings(void)
@@ -88,18 +88,18 @@ void CleanupAssocEnabledSettings(void) char szSetting[MAXMODULELABELLENGTH];
// delete old enabled_* settings if associated plugin no longer present
- if (EnumDbPrefixSettings("AssocMgr", "enabled_", &ppszSettings, &nSettingsCount)) {
+ if (EnumDbPrefixSettings(MODULENAME, "enabled_", &ppszSettings, &nSettingsCount)) {
mir_cslock lck(csAssocList);
for (i = 0; i < nSettingsCount; ++i) {
pszSuffix = &ppszSettings[i][8];
mir_snprintf(szSetting, "module_%s", pszSuffix);
- if (!db_get_ws(NULL, "AssocMgr", szSetting, &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, szSetting, &dbv)) {
if (PathToAbsoluteW(dbv.ptszVal, szDLL)) {
// file still exists?
hFile = CreateFile(szDLL, 0, FILE_SHARE_READ, nullptr, OPEN_EXISTING, 0, nullptr);
if (hFile == INVALID_HANDLE_VALUE) {
- db_unset(NULL, "AssocMgr", ppszSettings[i]);
- db_unset(NULL, "AssocMgr", szSetting);
+ db_unset(NULL, MODULENAME, ppszSettings[i]);
+ db_unset(NULL, MODULENAME, szSetting);
}
else CloseHandle(hFile);
}
@@ -117,8 +117,8 @@ static __inline void RememberMimeTypeAdded(const char *pszMimeType, const char * {
char szSetting[MAXMODULELABELLENGTH];
mir_snprintf(szSetting, "mime_%s", pszMimeType);
- if (fAdded) db_set_s(NULL, "AssocMgr", szSetting, pszFileExt);
- else db_unset(NULL, "AssocMgr", szSetting);
+ if (fAdded) db_set_s(NULL, MODULENAME, szSetting, pszFileExt);
+ else db_unset(NULL, MODULENAME, szSetting);
}
static __inline BOOL WasMimeTypeAdded(const char *pszMimeType)
@@ -127,7 +127,7 @@ static __inline BOOL WasMimeTypeAdded(const char *pszMimeType) DBVARIANT dbv;
BOOL fAdded = FALSE;
mir_snprintf(szSetting, "mime_%s", pszMimeType);
- if (!db_get(NULL, "AssocMgr", szSetting, &dbv)) fAdded = TRUE;
+ if (!db_get(NULL, MODULENAME, szSetting, &dbv)) fAdded = TRUE;
else db_free(&dbv);
return fAdded;
}
@@ -140,7 +140,7 @@ void CleanupMimeTypeAddedSettings(void) int i, j;
// delete old mime_* settings and unregister the associated mime type
- if (EnumDbPrefixSettings("AssocMgr", "mime_", &ppszSettings, &nSettingsCount)) {
+ if (EnumDbPrefixSettings(MODULENAME, "mime_", &ppszSettings, &nSettingsCount)) {
mir_cslock lck(csAssocList);
for (i = 0; i < nSettingsCount; ++i) {
pszSuffix = &ppszSettings[i][5];
@@ -148,12 +148,12 @@ void CleanupMimeTypeAddedSettings(void) if (!mir_strcmp(pszSuffix, pAssocList[j].pszMimeType))
break; // mime type in current list
if (j == nAssocListCount) { // mime type not in current list
- if (!db_get(NULL, "AssocMgr", ppszSettings[i], &dbv)) {
+ if (!db_get(NULL, MODULENAME, ppszSettings[i], &dbv)) {
if (dbv.type == DBVT_ASCIIZ)
RemoveRegMimeType(pszSuffix, dbv.pszVal);
db_free(&dbv);
}
- db_unset(NULL, "AssocMgr", ppszSettings[i]);
+ db_unset(NULL, MODULENAME, ppszSettings[i]);
}
mir_free(ppszSettings[i]);
}
@@ -737,7 +737,7 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara ListView_SetItemState(hwndList, lvi.iItem, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
ListView_SetColumnWidth(hwndList, 1, LVSCW_AUTOSIZE_USEHEADER); // size to fit window
// only while running
- CheckDlgButton(hwndDlg, IDC_ONLYWHILERUNNING, (BOOL)db_get_b(NULL, "AssocMgr", "OnlyWhileRunning", SETTING_ONLYWHILERUNNING_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ONLYWHILERUNNING, (BOOL)db_get_b(NULL, MODULENAME, "OnlyWhileRunning", SETTING_ONLYWHILERUNNING_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
// autostart
wchar_t *pszRunCmd = MakeRunCommand(TRUE, TRUE);
@@ -864,7 +864,7 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara BOOL fEnabled, fRegFailed = FALSE;
// only while running
- db_set_b(NULL, "AssocMgr", "OnlyWhileRunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONLYWHILERUNNING) != 0));
+ db_set_b(NULL, MODULENAME, "OnlyWhileRunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONLYWHILERUNNING) != 0));
// save enabled assoc items
HWND hwndList = GetDlgItem(hwndDlg, IDC_ASSOCLIST);
@@ -993,7 +993,7 @@ void UninitAssocList(void) UnhookEvent(hHookOptInit);
// Assoc List
- BYTE fOnlyWhileRunning = db_get_b(NULL, "AssocMgr", "OnlyWhileRunning", SETTING_ONLYWHILERUNNING_DEFAULT);
+ BYTE fOnlyWhileRunning = db_get_b(NULL, MODULENAME, "OnlyWhileRunning", SETTING_ONLYWHILERUNNING_DEFAULT);
for (int i = 0; i < nAssocListCount; ++i) {
ASSOCDATA *assoc = &pAssocList[i];
diff --git a/plugins/AssocMgr/src/main.cpp b/plugins/AssocMgr/src/main.cpp index a998291349..ad2702d0e8 100644 --- a/plugins/AssocMgr/src/main.cpp +++ b/plugins/AssocMgr/src/main.cpp @@ -23,11 +23,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma comment(lib, "delayimp.lib")
-static HANDLE hHookModulesLoaded;
CMPlugin g_plugin;
int &hLangpack(g_plugin.m_hLang);
-PLUGININFOEX pluginInfo = {
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -40,31 +41,32 @@ PLUGININFOEX pluginInfo = { {0x52685cd7, 0xec7, 0x44c1, {0xa1, 0xa6, 0x38, 0x16, 0x12, 0x41, 0x82, 0x2}}
};
-static int AssocMgrModulesLoaded(WPARAM, LPARAM)
-{
- return 0;
-}
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
InitAssocList();
InitDde();
- hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, AssocMgrModulesLoaded);
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) int Unload(void)
{
UninitDde();
UninitAssocList();
- UnhookEvent(hHookModulesLoaded);
return 0;
}
diff --git a/plugins/AssocMgr/src/reg.cpp b/plugins/AssocMgr/src/reg.cpp index ee7f8745b2..eb8db987b2 100644 --- a/plugins/AssocMgr/src/reg.cpp +++ b/plugins/AssocMgr/src/reg.cpp @@ -338,7 +338,7 @@ static void WriteDbBackupData(const char *pszSetting, DWORD dwType, BYTE *pData, if (buf) {
*(DWORD*)buf = dwType;
memcpy(buf + sizeof(DWORD), pData, cbData);
- db_set_blob(NULL, "AssocMgr", pszSetting, buf, (unsigned)cbLen);
+ db_set_blob(NULL, MODULENAME, pszSetting, buf, (unsigned)cbLen);
mir_free(buf);
}
}
@@ -347,7 +347,7 @@ static void WriteDbBackupData(const char *pszSetting, DWORD dwType, BYTE *pData, static BOOL ReadDbBackupData(const char *pszSetting, DWORD *pdwType, BYTE **ppData, DWORD *pcbData)
{
DBVARIANT dbv;
- if (!db_get(0, "AssocMgr", pszSetting, &dbv)) {
+ if (!db_get(0, MODULENAME, pszSetting, &dbv)) {
if (dbv.type == DBVT_BLOB && dbv.cpbVal >= sizeof(DWORD)) {
*pdwType = *(DWORD*)dbv.pbVal;
*ppData = dbv.pbVal;
@@ -454,7 +454,7 @@ static LONG RestoreRegTree(HKEY hKey, const char *pszSubKey, const char *pszDbPr if (pszPrefixWithSubKey != nullptr) {
int nSettingsCount;
char **ppszSettings;
- if (EnumDbPrefixSettings("AssocMgr", pszPrefixWithSubKey, &ppszSettings, &nSettingsCount)) {
+ if (EnumDbPrefixSettings(MODULENAME, pszPrefixWithSubKey, &ppszSettings, &nSettingsCount)) {
for (int i = 0; i < nSettingsCount; ++i) {
char *pszSuffix = &ppszSettings[i][nDbPrefixLen];
// key hierachy
@@ -486,7 +486,7 @@ static LONG RestoreRegTree(HKEY hKey, const char *pszSubKey, const char *pszDbPr }
else res = ERROR_INVALID_DATA;
if (res) break;
- db_unset(NULL, "AssocMgr", ppszSettings[i]);
+ db_unset(NULL, MODULENAME, ppszSettings[i]);
if (hSubKey != hKey) RegCloseKey(hSubKey);
}
mir_free(ppszSettings[i]);
@@ -507,9 +507,9 @@ static void DeleteRegTreeBackup(const char *pszSubKey, const char *pszDbPrefix) if (pszPrefixWithSubKey == nullptr) return;
mir_strcat(mir_strcat(mir_strcpy(pszPrefixWithSubKey, pszDbPrefix), pszSubKey), "\\"); // buffer safe
if (pszPrefixWithSubKey != nullptr) {
- if (EnumDbPrefixSettings("AssocMgr", pszPrefixWithSubKey, &ppszSettings, &nSettingsCount)) {
+ if (EnumDbPrefixSettings(MODULENAME, pszPrefixWithSubKey, &ppszSettings, &nSettingsCount)) {
for (i = 0; i < nSettingsCount; ++i) {
- db_unset(NULL, "AssocMgr", ppszSettings[i]);
+ db_unset(NULL, MODULENAME, ppszSettings[i]);
mir_free(ppszSettings[i]);
}
mir_free(ppszSettings);
@@ -523,7 +523,7 @@ void CleanupRegTreeBackupSettings(void) // delete old bak_* settings and try to restore backups
int nSettingsCount;
char **ppszSettings;
- if (!EnumDbPrefixSettings("AssocMgr", "bak_", &ppszSettings, &nSettingsCount))
+ if (!EnumDbPrefixSettings(MODULENAME, "bak_", &ppszSettings, &nSettingsCount))
return;
for (int i = 0; i < nSettingsCount; ++i) {
diff --git a/plugins/AssocMgr/src/stdafx.h b/plugins/AssocMgr/src/stdafx.h index b68cbfd6db..59108c7499 100644 --- a/plugins/AssocMgr/src/stdafx.h +++ b/plugins/AssocMgr/src/stdafx.h @@ -45,9 +45,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "resource.h"
#include "version.h"
+#define MODULENAME "AssocMgr"
+
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>("AssocMgr")
- {}
-};
\ No newline at end of file + CMPlugin();
+};
diff --git a/plugins/AuthState/src/main.cpp b/plugins/AuthState/src/main.cpp index 9686fc4a4f..c100ac48d2 100644 --- a/plugins/AuthState/src/main.cpp +++ b/plugins/AuthState/src/main.cpp @@ -41,7 +41,9 @@ enum ICON_BOTH
};
-PLUGININFOEX pluginInfo = {
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -51,14 +53,20 @@ PLUGININFOEX pluginInfo = { __AUTHORWEB,
UNICODE_AWARE,
// {DACE7D41-DFA9-4772-89AE-A59A6153E6B2}
- { 0xdace7d41, 0xdfa9, 0x4772, { 0x89, 0xae, 0xa5, 0x9a, 0x61, 0x53, 0xe6, 0xb2 } }
+ {0xdace7d41, 0xdfa9, 0x4772, {0x89, 0xae, 0xa5, 0x9a, 0x61, 0x53, 0xe6, 0xb2}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
INT_PTR getIconToUse(MCONTACT hContact, LPARAM)
{
const char *proto = GetContactProto(hContact);
@@ -162,7 +170,7 @@ int onModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged);
diff --git a/plugins/AuthState/src/stdafx.h b/plugins/AuthState/src/stdafx.h index 57701cd8c1..a101d76aac 100644 --- a/plugins/AuthState/src/stdafx.h +++ b/plugins/AuthState/src/stdafx.h @@ -40,9 +40,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {}
+ CMPlugin();
};
int onOptInitialise(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/AutoRun/src/main.cpp b/plugins/AutoRun/src/main.cpp index 0ecc048e29..73d82e990e 100644 --- a/plugins/AutoRun/src/main.cpp +++ b/plugins/AutoRun/src/main.cpp @@ -4,6 +4,8 @@ CMPlugin g_plugin; int &hLangpack(g_plugin.m_hLang);
HKEY ROOT_KEY = HKEY_CURRENT_USER;
+/////////////////////////////////////////////////////////////////////////////////////////
+
PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -17,6 +19,17 @@ PLUGININFOEX pluginInfoEx = { {0xeb0465e2, 0xceee, 0x11db, {0x83, 0xef, 0xc1, 0xbf, 0x55, 0xd8, 0x95, 0x93}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
+{
+ return &pluginInfoEx;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
void GetProfilePath(wchar_t *res, size_t resLen)
{
wchar_t dbname[MAX_PATH], exename[MAX_PATH];
@@ -99,7 +112,7 @@ static int AutorunOptInitialise(WPARAM wParam, LPARAM) odp.position = 100100000;
odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_AUTORUN);
- odp.szTitle.a = ModuleName;
+ odp.szTitle.a = MODULENAME;
odp.szGroup.a = LPGEN("Services");
odp.pfnDlgProc = DlgProcAutorunOpts;
odp.flags = ODPF_BOLDGROUPS;
@@ -107,11 +120,6 @@ static int AutorunOptInitialise(WPARAM wParam, LPARAM) return 0;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
-{
- return &pluginInfoEx;
-}
-
extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfoEx);
@@ -119,6 +127,8 @@ extern "C" __declspec(dllexport) int Load(void) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) int Unload(void)
{
return 0;
diff --git a/plugins/AutoRun/src/stdafx.h b/plugins/AutoRun/src/stdafx.h index b78b19de2b..1536fb686b 100644 --- a/plugins/AutoRun/src/stdafx.h +++ b/plugins/AutoRun/src/stdafx.h @@ -12,11 +12,10 @@ #include "version.h"
#define SUB_KEY L"Software\\Microsoft\\Windows\\CurrentVersion\\Run"
-#define ModuleName LPGEN("Autorun")
+
+#define MODULENAME LPGEN("Autorun")
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(ModuleName)
- {}
+ CMPlugin();
};
diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp index c8a279189b..ab4baad2b9 100644 --- a/plugins/AutoShutdown/src/frame.cpp +++ b/plugins/AutoShutdown/src/frame.cpp @@ -288,14 +288,14 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP }
case M_SET_COUNTDOWN:
if (dat->fTimeFlags&SDWTF_ST_TIME) {
- dat->settingLastTime = (time_t)db_get_dw(NULL, "AutoShutdown", "TimeStamp", SETTING_TIMESTAMP_DEFAULT);
+ dat->settingLastTime = (time_t)db_get_dw(NULL, MODULENAME, "TimeStamp", SETTING_TIMESTAMP_DEFAULT);
dat->countdown = time(0);
if (dat->settingLastTime > dat->countdown) dat->countdown = dat->settingLastTime - dat->countdown;
else dat->countdown = 0;
}
else if (dat->flags&FWPDF_COUNTDOWNINVALID) {
- dat->countdown = (time_t)db_get_dw(NULL, "AutoShutdown", "Countdown", SETTING_COUNTDOWN_DEFAULT);
- dat->countdown *= (time_t)db_get_dw(NULL, "AutoShutdown", "CountdownUnit", SETTING_COUNTDOWNUNIT_DEFAULT);
+ dat->countdown = (time_t)db_get_dw(NULL, MODULENAME, "Countdown", SETTING_COUNTDOWN_DEFAULT);
+ dat->countdown *= (time_t)db_get_dw(NULL, MODULENAME, "CountdownUnit", SETTING_COUNTDOWNUNIT_DEFAULT);
}
dat->flags &= ~FWPDF_COUNTDOWNINVALID;
/* commctl 4.70+, Win95: 1-100 will work fine (wrap around) */
@@ -499,7 +499,7 @@ void ShowCountdownFrame(WORD fTimeFlags) clf.align = alBottom;
clf.height = GetSystemMetrics(SM_CYICON);
clf.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_SKINNED;
- clf.name = Translate("AutoShutdown");
+ clf.name = Translate(MODULENAME);
clf.TBname = Translate("Automatic shutdown");
clf.hWnd = hwndCountdownFrame;
hFrame = (WORD)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&clf, 0);
@@ -553,13 +553,13 @@ static int FrameModulesLoaded(WPARAM, LPARAM) LOGFONT lf;
/* built-in font module is not available before this hook */
COLORREF clr = GetDefaultColor(FRAMEELEMENT_TEXT);
- FontService_RegisterFont("AutoShutdown", "CountdownFont", LPGENW("Automatic shutdown"), LPGENW("Countdown on frame"), LPGENW("Automatic shutdown"), LPGENW("Background"), 0, FALSE, GetDefaultFont(&lf), clr);
+ FontService_RegisterFont(MODULENAME, "CountdownFont", LPGENW("Automatic shutdown"), LPGENW("Countdown on frame"), LPGENW("Automatic shutdown"), LPGENW("Background"), 0, FALSE, GetDefaultFont(&lf), clr);
clr = GetDefaultColor(FRAMEELEMENT_BKGRND);
- FontService_RegisterColor("AutoShutdown", "BkgColor", LPGENW("Automatic shutdown"), LPGENW("Background"), clr);
+ FontService_RegisterColor(MODULENAME, "BkgColor", LPGENW("Automatic shutdown"), LPGENW("Background"), clr);
if (!IsThemeActive()) {
/* progressbar color can only be changed with classic theme */
clr = GetDefaultColor(FRAMEELEMENT_BAR);
- FontService_RegisterColor("AutoShutdown", "ProgressColor", TranslateT("Automatic shutdown"), TranslateT("Progress bar"), clr);
+ FontService_RegisterColor(MODULENAME, "ProgressColor", TranslateT("Automatic shutdown"), TranslateT("Progress bar"), clr);
}
}
return 0;
diff --git a/plugins/AutoShutdown/src/main.cpp b/plugins/AutoShutdown/src/main.cpp index dfeeb8df16..bffd3d22fd 100644 --- a/plugins/AutoShutdown/src/main.cpp +++ b/plugins/AutoShutdown/src/main.cpp @@ -24,7 +24,16 @@ CLIST_INTERFACE *pcli; CMPlugin g_plugin;
int &hLangpack(g_plugin.m_hLang);
-PLUGININFOEX pluginInfo = {
+IconItem iconList[] =
+{
+ { LPGEN("Header"), "AutoShutdown_Header", IDI_HEADER },
+ { LPGEN("Active"), "AutoShutdown_Active", IDI_ACTIVE },
+ { LPGEN("Inactive"), "AutoShutdown_Inactive", IDI_INACTIVE },
+};
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -37,12 +46,16 @@ PLUGININFOEX pluginInfo = { {0x9de24579, 0x5c5c, 0x49aa, {0x80, 0xe8, 0x4d, 0x38, 0xe4, 0x34, 0x4e, 0x63}}
};
-IconItem iconList[] =
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
+extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- { LPGEN("Header"), "AutoShutdown_Header", IDI_HEADER },
- { LPGEN("Active"), "AutoShutdown_Active", IDI_ACTIVE },
- { LPGEN("Inactive"), "AutoShutdown_Inactive", IDI_INACTIVE },
-};
+ return &pluginInfoEx;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
static int ShutdownModulesLoaded(WPARAM, LPARAM)
{
@@ -53,14 +66,9 @@ static int ShutdownModulesLoaded(WPARAM, LPARAM) return 0;
}
-extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD)
-{
- return &pluginInfo;
-}
-
extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
INITCOMMONCONTROLSEX icc;
diff --git a/plugins/AutoShutdown/src/options.cpp b/plugins/AutoShutdown/src/options.cpp index f0b2255566..df9cc47f9b 100644 --- a/plugins/AutoShutdown/src/options.cpp +++ b/plugins/AutoShutdown/src/options.cpp @@ -36,7 +36,7 @@ static INT_PTR CALLBACK ShutdownOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
- WORD setting = db_get_w(NULL, "AutoShutdown", "ConfirmDlgCountdown", SETTING_CONFIRMDLGCOUNTDOWN_DEFAULT);
+ WORD setting = db_get_w(NULL, MODULENAME, "ConfirmDlgCountdown", SETTING_CONFIRMDLGCOUNTDOWN_DEFAULT);
if (setting < 3)
setting = SETTING_CONFIRMDLGCOUNTDOWN_DEFAULT;
SendDlgItemMessage(hwndDlg, IDC_SPIN_CONFIRMDLGCOUNTDOWN, UDM_SETRANGE, 0, MAKELPARAM(999, 3));
@@ -44,15 +44,15 @@ static INT_PTR CALLBACK ShutdownOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam SendDlgItemMessage(hwndDlg, IDC_SPIN_CONFIRMDLGCOUNTDOWN, UDM_SETPOS, 0, MAKELPARAM(setting, 0));
SetDlgItemInt(hwndDlg, IDC_EDIT_CONFIRMDLGCOUNTDOWN, setting, FALSE);
}
- CheckDlgButton(hwndDlg, IDC_CHECK_SMARTOFFLINECHECK, db_get_b(NULL, "AutoShutdown", "SmartOfflineCheck", SETTING_SMARTOFFLINECHECK_DEFAULT) != 0 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CHECK_REMEMBERONRESTART, db_get_b(NULL, "AutoShutdown", "RememberOnRestart", SETTING_REMEMBERONRESTART_DEFAULT) != 0 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CHECK_SHOWCONFIRMDLG, db_get_b(NULL, "AutoShutdown", "ShowConfirmDlg", SETTING_SHOWCONFIRMDLG_DEFAULT) != 0 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CHECK_SMARTOFFLINECHECK, db_get_b(NULL, MODULENAME, "SmartOfflineCheck", SETTING_SMARTOFFLINECHECK_DEFAULT) != 0 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CHECK_REMEMBERONRESTART, db_get_b(NULL, MODULENAME, "RememberOnRestart", SETTING_REMEMBERONRESTART_DEFAULT) != 0 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CHECK_SHOWCONFIRMDLG, db_get_b(NULL, MODULENAME, "ShowConfirmDlg", SETTING_SHOWCONFIRMDLG_DEFAULT) != 0 ? BST_CHECKED : BST_UNCHECKED);
{
BOOL enabled = ServiceIsTypeEnabled(SDSDT_SHUTDOWN, 0);
if (enabled) {
if (ServiceExists(MS_WEATHER_UPDATE)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_CHECK_WEATHER), TRUE);
- CheckDlgButton(hwndDlg, IDC_CHECK_WEATHER, db_get_b(NULL, "AutoShutdown", "WeatherShutdown", SETTING_WEATHERSHUTDOWN_DEFAULT) != 0 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CHECK_WEATHER, db_get_b(NULL, MODULENAME, "WeatherShutdown", SETTING_WEATHERSHUTDOWN_DEFAULT) != 0 ? BST_CHECKED : BST_UNCHECKED);
}
}
}
@@ -90,12 +90,12 @@ static INT_PTR CALLBACK ShutdownOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam case WM_NOTIFY:
switch (((NMHDR*)lParam)->code) {
case PSN_APPLY:
- db_set_b(NULL, "AutoShutdown", "ShowConfirmDlg", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CHECK_SHOWCONFIRMDLG) != 0));
- db_set_w(NULL, "AutoShutdown", "ConfirmDlgCountdown", (WORD)GetDlgItemInt(hwndDlg, IDC_EDIT_CONFIRMDLGCOUNTDOWN, nullptr, FALSE));
- db_set_b(NULL, "AutoShutdown", "RememberOnRestart", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CHECK_REMEMBERONRESTART) != 0));
- db_set_b(NULL, "AutoShutdown", "SmartOfflineCheck", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CHECK_SMARTOFFLINECHECK) != 0));
+ db_set_b(NULL, MODULENAME, "ShowConfirmDlg", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CHECK_SHOWCONFIRMDLG) != 0));
+ db_set_w(NULL, MODULENAME, "ConfirmDlgCountdown", (WORD)GetDlgItemInt(hwndDlg, IDC_EDIT_CONFIRMDLGCOUNTDOWN, nullptr, FALSE));
+ db_set_b(NULL, MODULENAME, "RememberOnRestart", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CHECK_REMEMBERONRESTART) != 0));
+ db_set_b(NULL, MODULENAME, "SmartOfflineCheck", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CHECK_SMARTOFFLINECHECK) != 0));
if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CHECK_WEATHER)))
- db_set_b(NULL, "AutoShutdown", "WeatherShutdown", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CHECK_WEATHER) != 0));
+ db_set_b(NULL, MODULENAME, "WeatherShutdown", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CHECK_WEATHER) != 0));
return TRUE;
}
break;
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp index 2e7b6003ec..2c82d7d4df 100644 --- a/plugins/AutoShutdown/src/settingsdlg.cpp +++ b/plugins/AutoShutdown/src/settingsdlg.cpp @@ -81,7 +81,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L }
/* read-in watcher flags */
{
- WORD watcherType = db_get_w(NULL, "AutoShutdown", "WatcherFlags", SETTING_WATCHERFLAGS_DEFAULT);
+ WORD watcherType = db_get_w(NULL, MODULENAME, "WatcherFlags", SETTING_WATCHERFLAGS_DEFAULT);
CheckRadioButton(hwndDlg, IDC_RADIO_STTIME, IDC_RADIO_STCOUNTDOWN, (watcherType&SDWTF_ST_TIME) ? IDC_RADIO_STTIME : IDC_RADIO_STCOUNTDOWN);
CheckDlgButton(hwndDlg, IDC_CHECK_SPECIFICTIME, (watcherType&SDWTF_SPECIFICTIME) != 0 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CHECK_MESSAGE, (watcherType&SDWTF_MESSAGE) != 0 ? BST_CHECKED : BST_UNCHECKED);
@@ -93,14 +93,14 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L /* read-in countdown val */
{
SYSTEMTIME st;
- if (!TimeStampToSystemTime((time_t)db_get_dw(NULL, "AutoShutdown", "TimeStamp", SETTING_TIMESTAMP_DEFAULT), &st))
+ if (!TimeStampToSystemTime((time_t)db_get_dw(NULL, MODULENAME, "TimeStamp", SETTING_TIMESTAMP_DEFAULT), &st))
GetLocalTime(&st);
DateTime_SetSystemtime(GetDlgItem(hwndDlg, IDC_TIME_TIMESTAMP), GDT_VALID, &st);
DateTime_SetSystemtime(GetDlgItem(hwndDlg, IDC_DATE_TIMESTAMP), GDT_VALID, &st);
SendMessage(hwndDlg, M_CHECK_DATETIME, 0, 0);
}
{
- DWORD setting = db_get_dw(NULL, "AutoShutdown", "Countdown", SETTING_COUNTDOWN_DEFAULT);
+ DWORD setting = db_get_dw(NULL, MODULENAME, "Countdown", SETTING_COUNTDOWN_DEFAULT);
if (setting < 1) setting = SETTING_COUNTDOWN_DEFAULT;
SendDlgItemMessage(hwndDlg, IDC_SPIN_COUNTDOWN, UDM_SETRANGE, 0, MAKELPARAM(UD_MAXVAL, 1));
SendDlgItemMessage(hwndDlg, IDC_EDIT_COUNTDOWN, EM_SETLIMITTEXT, (WPARAM)10, 0);
@@ -109,7 +109,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L }
{
HWND hwndCombo = GetDlgItem(hwndDlg, IDC_COMBO_COUNTDOWNUNIT);
- DWORD lastUnit = db_get_dw(NULL, "AutoShutdown", "CountdownUnit", SETTING_COUNTDOWNUNIT_DEFAULT);
+ DWORD lastUnit = db_get_dw(NULL, MODULENAME, "CountdownUnit", SETTING_COUNTDOWNUNIT_DEFAULT);
SendMessage(hwndCombo, CB_SETLOCALE, (WPARAM)locale, 0); /* sort order */
SendMessage(hwndCombo, CB_INITSTORAGE, _countof(unitNames), _countof(unitNames) * 16); /* approx. */
for (int i = 0; i < _countof(unitNames); ++i) {
@@ -122,14 +122,14 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L }
{
DBVARIANT dbv;
- if (!db_get_ws(NULL, "AutoShutdown", "Message", &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, "Message", &dbv)) {
SetDlgItemText(hwndDlg, IDC_EDIT_MESSAGE, dbv.ptszVal);
mir_free(dbv.ptszVal);
}
}
/* cpuusage threshold */
{
- BYTE setting = DBGetContactSettingRangedByte(NULL, "AutoShutdown", "CpuUsageThreshold", SETTING_CPUUSAGETHRESHOLD_DEFAULT, 1, 100);
+ BYTE setting = DBGetContactSettingRangedByte(NULL, MODULENAME, "CpuUsageThreshold", SETTING_CPUUSAGETHRESHOLD_DEFAULT, 1, 100);
SendDlgItemMessage(hwndDlg, IDC_SPIN_CPUUSAGE, UDM_SETRANGE, 0, MAKELPARAM(100, 1));
SendDlgItemMessage(hwndDlg, IDC_EDIT_CPUUSAGE, EM_SETLIMITTEXT, (WPARAM)3, 0);
SendDlgItemMessage(hwndDlg, IDC_SPIN_CPUUSAGE, UDM_SETPOS, 0, MAKELPARAM(setting, 0));
@@ -138,7 +138,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L /* shutdown types */
{
HWND hwndCombo = GetDlgItem(hwndDlg, IDC_COMBO_SHUTDOWNTYPE);
- BYTE lastShutdownType = db_get_b(NULL, "AutoShutdown", "ShutdownType", SETTING_SHUTDOWNTYPE_DEFAULT);
+ BYTE lastShutdownType = db_get_b(NULL, MODULENAME, "ShutdownType", SETTING_SHUTDOWNTYPE_DEFAULT);
SendMessage(hwndCombo, CB_SETLOCALE, (WPARAM)locale, 0); /* sort order */
SendMessage(hwndCombo, CB_SETEXTENDEDUI, TRUE, 0);
SendMessage(hwndCombo, CB_INITSTORAGE, SDSDT_MAX, SDSDT_MAX * 32);
@@ -171,11 +171,11 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L }
}
SendMessage(hwndDlg, M_ENABLE_SUBCTLS, 0, 0);
- Utils_RestoreWindowPositionNoSize(hwndDlg, NULL, "AutoShutdown", "SettingsDlg_");
+ Utils_RestoreWindowPositionNoSize(hwndDlg, NULL, MODULENAME, "SettingsDlg_");
return TRUE; /* default focus */
case WM_DESTROY:
- Utils_SaveWindowPosition(hwndDlg, NULL, "AutoShutdown", "SettingsDlg_");
+ Utils_SaveWindowPosition(hwndDlg, NULL, MODULENAME, "SettingsDlg_");
{
HFONT hFont = (HFONT)SendDlgItemMessage(hwndDlg, IDC_TEXT_HEADER, WM_GETFONT, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_TEXT_HEADER, WM_SETFONT, 0, FALSE); /* no return value */
@@ -340,7 +340,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L wchar_t *pszText = (wchar_t*)mir_alloc(len*sizeof(wchar_t));
if (pszText != nullptr && GetWindowText(hwndEdit, pszText, len + 1)) {
TrimString(pszText);
- db_set_ws(NULL, "AutoShutdown", "Message", pszText);
+ db_set_ws(NULL, MODULENAME, "Message", pszText);
}
mir_free(pszText); /* does NULL check */
}
@@ -351,18 +351,18 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L DateTime_GetSystemtime(GetDlgItem(hwndDlg, IDC_TIME_TIMESTAMP), &st); /* time gets synchronized */
if (!SystemTimeToTimeStamp(&st, ×tamp))
timestamp = time(0);
- db_set_dw(NULL, "AutoShutdown", "TimeStamp", (DWORD)timestamp);
+ db_set_dw(NULL, MODULENAME, "TimeStamp", (DWORD)timestamp);
}
/* shutdown type */
{
int index = SendDlgItemMessage(hwndDlg, IDC_COMBO_SHUTDOWNTYPE, CB_GETCURSEL, 0, 0);
if (index != LB_ERR)
- db_set_b(NULL, "AutoShutdown", "ShutdownType", (BYTE)SendDlgItemMessage(hwndDlg, IDC_COMBO_SHUTDOWNTYPE, CB_GETITEMDATA, (WPARAM)index, 0));
+ db_set_b(NULL, MODULENAME, "ShutdownType", (BYTE)SendDlgItemMessage(hwndDlg, IDC_COMBO_SHUTDOWNTYPE, CB_GETITEMDATA, (WPARAM)index, 0));
index = SendDlgItemMessage(hwndDlg, IDC_COMBO_COUNTDOWNUNIT, CB_GETCURSEL, 0, 0);
if (index != LB_ERR)
- db_set_dw(NULL, "AutoShutdown", "CountdownUnit", (DWORD)SendDlgItemMessage(hwndDlg, IDC_COMBO_COUNTDOWNUNIT, CB_GETITEMDATA, (WPARAM)index, 0));
- db_set_dw(NULL, "AutoShutdown", "Countdown", (DWORD)GetDlgItemInt(hwndDlg, IDC_EDIT_COUNTDOWN, nullptr, FALSE));
- db_set_b(NULL, "AutoShutdown", "CpuUsageThreshold", (BYTE)GetDlgItemInt(hwndDlg, IDC_EDIT_CPUUSAGE, nullptr, FALSE));
+ db_set_dw(NULL, MODULENAME, "CountdownUnit", (DWORD)SendDlgItemMessage(hwndDlg, IDC_COMBO_COUNTDOWNUNIT, CB_GETITEMDATA, (WPARAM)index, 0));
+ db_set_dw(NULL, MODULENAME, "Countdown", (DWORD)GetDlgItemInt(hwndDlg, IDC_EDIT_COUNTDOWN, nullptr, FALSE));
+ db_set_b(NULL, MODULENAME, "CpuUsageThreshold", (BYTE)GetDlgItemInt(hwndDlg, IDC_EDIT_CPUUSAGE, nullptr, FALSE));
}
/* watcher type */
{
@@ -373,7 +373,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L if (IsDlgButtonChecked(hwndDlg, IDC_CHECK_IDLE)) watcherType |= SDWTF_IDLE;
if (IsDlgButtonChecked(hwndDlg, IDC_CHECK_STATUS)) watcherType |= SDWTF_STATUS;
if (IsDlgButtonChecked(hwndDlg, IDC_CHECK_CPUUSAGE)) watcherType |= SDWTF_CPUUSAGE;
- db_set_w(NULL, "AutoShutdown", "WatcherFlags", watcherType);
+ db_set_w(NULL, MODULENAME, "WatcherFlags", watcherType);
ServiceStartWatcher(0, watcherType);
}
DestroyWindow(hwndDlg);
diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp index 699820190c..b120727a7a 100644 --- a/plugins/AutoShutdown/src/shutdownsvc.cpp +++ b/plugins/AutoShutdown/src/shutdownsvc.cpp @@ -247,7 +247,7 @@ static DWORD ShutdownNow(BYTE shutdownType) BroadcastEndSession(BSM_APPLICATIONS | BSM_ALLDESKTOPS, ENDSESSION_CLOSEAPP); /* app should close itself */
WinNT_SetPrivilege(SE_TCB_NAME, FALSE);
- if (!InitiateSystemShutdownEx(nullptr, TranslateT("AutoShutdown"), 0, TRUE, shutdownType == SDSDT_REBOOT, SHTDN_REASON_MAJOR_OTHER | SHTDN_REASON_MINOR_OTHER | SHTDN_REASON_FLAG_PLANNED))
+ if (!InitiateSystemShutdownEx(nullptr, TranslateT(MODULENAME), 0, TRUE, shutdownType == SDSDT_REBOOT, SHTDN_REASON_MAJOR_OTHER | SHTDN_REASON_MINOR_OTHER | SHTDN_REASON_FLAG_PLANNED))
dwErrCode = GetLastError();
/* cleanly close Miranda */
@@ -321,7 +321,7 @@ static INT_PTR CALLBACK ShutdownDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TEXT_HEADER), GWLP_USERDATA, (LONG_PTR)hBoldFont);
}
{
- countdown = db_get_w(NULL, "AutoShutdown", "ConfirmDlgCountdown", SETTING_CONFIRMDLGCOUNTDOWN_DEFAULT);
+ countdown = db_get_w(NULL, MODULENAME, "ConfirmDlgCountdown", SETTING_CONFIRMDLGCOUNTDOWN_DEFAULT);
if (countdown < 3)
countdown = SETTING_CONFIRMDLGCOUNTDOWN_DEFAULT;
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TEXT_HEADER), GWLP_USERDATA, countdown);
@@ -331,7 +331,7 @@ static INT_PTR CALLBACK ShutdownDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L if (!SetTimer(hwndDlg, 1, 1000, nullptr))
PostMessage(hwndDlg, M_START_SHUTDOWN, 0, 0);
- Utils_RestoreWindowPositionNoSize(hwndDlg, NULL, "AutoShutdown", "ConfirmDlg_");
+ Utils_RestoreWindowPositionNoSize(hwndDlg, NULL, MODULENAME, "ConfirmDlg_");
/* disallow foreground window changes (WinMe/2000+) */
SetForegroundWindow(hwndDlg);
@@ -346,7 +346,7 @@ static INT_PTR CALLBACK ShutdownDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L ShowWindow(hwndDlg, SW_HIDE);
/* reallow foreground window changes (WinMe/2000+) */
LockSetForegroundWindow(LSFW_UNLOCK);
- Utils_SaveWindowPosition(hwndDlg, NULL, "AutoShutdown", "ConfirmDlg_");
+ Utils_SaveWindowPosition(hwndDlg, NULL, MODULENAME, "ConfirmDlg_");
HFONT hFont = (HFONT)SendDlgItemMessage(hwndDlg, IDC_TEXT_HEADER, WM_GETFONT, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_TEXT_HEADER, WM_SETFONT, 0, FALSE); /* no return value */
if (hFont != nullptr) DeleteObject(hFont);
@@ -416,7 +416,7 @@ static INT_PTR CALLBACK ShutdownDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L INT_PTR ServiceShutdown(WPARAM wParam, LPARAM lParam)
{
/* passing 0 as wParam is only to be used internally, undocumented */
- if (!wParam) wParam = db_get_b(NULL, "AutoShutdown", "ShutdownType", SETTING_SHUTDOWNTYPE_DEFAULT);
+ if (!wParam) wParam = db_get_b(NULL, MODULENAME, "ShutdownType", SETTING_SHUTDOWNTYPE_DEFAULT);
if (!IsShutdownTypeEnabled((BYTE)wParam)) return 1; /* does shutdownType range check */
if ((BOOL)lParam && hwndShutdownDlg != nullptr) return 2;
@@ -428,7 +428,7 @@ INT_PTR ServiceShutdown(WPARAM wParam, LPARAM lParam) /* tell others */
NotifyEventHooks(hEventShutdown, wParam, lParam);
/* show dialog */
- if (lParam && db_get_b(NULL, "AutoShutdown", "ShowConfirmDlg", SETTING_SHOWCONFIRMDLG_DEFAULT))
+ if (lParam && db_get_b(NULL, MODULENAME, "ShowConfirmDlg", SETTING_SHOWCONFIRMDLG_DEFAULT))
if (CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_SHUTDOWNNOW), nullptr, ShutdownDlgProc, (BYTE)wParam) != nullptr)
return 0;
/* show error */
diff --git a/plugins/AutoShutdown/src/stdafx.h b/plugins/AutoShutdown/src/stdafx.h index c0b60f6181..13f1bcd976 100644 --- a/plugins/AutoShutdown/src/stdafx.h +++ b/plugins/AutoShutdown/src/stdafx.h @@ -74,11 +74,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "resource.h"
#include "version.h"
+#define MODULENAME "AutoShutdown"
+
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>("AutoShutdown")
- {}
+ CMPlugin();
};
extern IconItem iconList[];
\ No newline at end of file diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp index 9c55326902..fbd2987e8b 100644 --- a/plugins/AutoShutdown/src/watcher.cpp +++ b/plugins/AutoShutdown/src/watcher.cpp @@ -99,7 +99,7 @@ static int MsgEventAdded(WPARAM, LPARAM hDbEvent) if (!db_event_get(hDbEvent, &dbe))
if (dbe.eventType == EVENTTYPE_MESSAGE && !(dbe.flags & DBEF_SENT)) {
DBVARIANT dbv;
- if (!db_get_ws(NULL, "AutoShutdown", "Message", &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, "Message", &dbv)) {
TrimString(dbv.ptszVal);
wchar_t *pszMsg = GetMessageText(&dbe.pBlob, &dbe.cbBlob);
if (pszMsg != nullptr && wcsstr(pszMsg, dbv.ptszVal) != nullptr)
@@ -175,7 +175,7 @@ static int IdleChanged(WPARAM, LPARAM lParam) static BOOL CheckAllContactsOffline(void)
{
BOOL fSmartCheck, fAllOffline = TRUE; /* tentatively */
- fSmartCheck = db_get_b(NULL, "AutoShutdown", "SmartOfflineCheck", SETTING_SMARTOFFLINECHECK_DEFAULT);
+ fSmartCheck = db_get_b(NULL, MODULENAME, "SmartOfflineCheck", SETTING_SMARTOFFLINECHECK_DEFAULT);
for (auto &hContact : Contacts()) {
char *pszProto = GetContactProto(hContact);
if (pszProto != nullptr && Proto_GetStatus(pszProto) != ID_STATUS_OFFLINE) {
@@ -236,7 +236,7 @@ static int WeatherUpdated(WPARAM wParam, LPARAM lParam) {
char *pszProto = GetContactProto(wParam);
if ((BOOL)lParam && pszProto != nullptr && Proto_GetStatus(pszProto) == THUNDER)
- if (db_get_b(NULL, "AutoShutdown", "WeatherShutdown", SETTING_WEATHERSHUTDOWN_DEFAULT))
+ if (db_get_b(NULL, MODULENAME, "WeatherShutdown", SETTING_WEATHERSHUTDOWN_DEFAULT))
ServiceShutdown(SDSDT_SHUTDOWN, TRUE);
return 0;
}
@@ -247,7 +247,7 @@ INT_PTR ServiceStartWatcher(WPARAM, LPARAM lParam) {
/* passing watcherType as lParam is only to be used internally, undocumented */
if (lParam == 0)
- lParam = (LPARAM)db_get_w(NULL, "AutoShutdown", "WatcherFlags", 0);
+ lParam = (LPARAM)db_get_w(NULL, MODULENAME, "WatcherFlags", 0);
/* invalid flags or empty? */
if (!(lParam&SDWTF_MASK))
@@ -276,7 +276,7 @@ INT_PTR ServiceStartWatcher(WPARAM, LPARAM lParam) ShowCountdownFrame(currentWatcherType); /* after modules loaded */
/* Cpu Shutdown */
if (currentWatcherType&SDWTF_CPUUSAGE)
- idCpuUsageThread = PollCpuUsage(CpuUsageWatcherProc, (LPARAM)DBGetContactSettingRangedByte(NULL, "AutoShutdown", "CpuUsageThreshold", SETTING_CPUUSAGETHRESHOLD_DEFAULT, 1, 100), 1500);
+ idCpuUsageThread = PollCpuUsage(CpuUsageWatcherProc, (LPARAM)DBGetContactSettingRangedByte(NULL, MODULENAME, "CpuUsageThreshold", SETTING_CPUUSAGETHRESHOLD_DEFAULT, 1, 100), 1500);
/* Transfer Shutdown */
if (currentWatcherType&SDWTF_FILETRANSFER && !nTransfersCount)
ShutdownAndStopWatcher();
@@ -317,8 +317,8 @@ void WatcherModulesLoaded(void) hHookWeatherUpdated = HookEvent(ME_WEATHER_UPDATED, WeatherUpdated);
/* restore watcher if it was running on last exit */
- if (db_get_b(NULL, "AutoShutdown", "RememberOnRestart", 0) == SDROR_RUNNING) {
- db_set_b(NULL, "AutoShutdown", "RememberOnRestart", 1);
+ if (db_get_b(NULL, MODULENAME, "RememberOnRestart", 0) == SDROR_RUNNING) {
+ db_set_b(NULL, MODULENAME, "RememberOnRestart", 1);
ServiceStartWatcher(0, 0); /* after modules loaded */
}
}
@@ -350,8 +350,8 @@ void UninitWatcher(void) {
/* remember watcher if running */
if (!ServiceStopWatcher(0, 0))
- if (db_get_b(NULL, "AutoShutdown", "RememberOnRestart", SETTING_REMEMBERONRESTART_DEFAULT))
- db_set_b(NULL, "AutoShutdown", "RememberOnRestart", SDROR_RUNNING);
+ if (db_get_b(NULL, MODULENAME, "RememberOnRestart", SETTING_REMEMBERONRESTART_DEFAULT))
+ db_set_b(NULL, MODULENAME, "RememberOnRestart", SDROR_RUNNING);
/* Message Shutdown */
UnhookEvent(hHookEventAdded);
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index 262d0f60e3..1fee474f87 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -116,7 +116,7 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARA AvatarDialogData *data = (struct AvatarDialogData*) lParam;
SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)createDefaultOverlayedIcon(TRUE));
SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)createDefaultOverlayedIcon(FALSE));
- if (db_get_b(NULL, MODULE_NAME, "LogToHistory", AVH_DEF_LOGTOHISTORY))
+ if (db_get_b(NULL, MODULENAME, "LogToHistory", AVH_DEF_LOGTOHISTORY))
FillAvatarListFromDB(hwndList, data->hContact);
else if (opts.log_store_as_hash)
FillAvatarListFromFolder(hwndList, data->hContact);
@@ -132,11 +132,11 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARA SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)data->hContact);
UpdateAvatarPic(hwnd);
- CheckDlgButton(hwnd, IDC_LOGUSER, (UINT)db_get_b(data->hContact, MODULE_NAME, "LogToDisk", BST_INDETERMINATE));
- CheckDlgButton(hwnd, IDC_POPUPUSER, (UINT)db_get_b(data->hContact, MODULE_NAME, "AvatarPopups", BST_INDETERMINATE));
- CheckDlgButton(hwnd, IDC_HISTORYUSER, (UINT)db_get_b(data->hContact, MODULE_NAME, "LogToHistory", BST_INDETERMINATE));
+ CheckDlgButton(hwnd, IDC_LOGUSER, (UINT)db_get_b(data->hContact, MODULENAME, "LogToDisk", BST_INDETERMINATE));
+ CheckDlgButton(hwnd, IDC_POPUPUSER, (UINT)db_get_b(data->hContact, MODULENAME, "AvatarPopups", BST_INDETERMINATE));
+ CheckDlgButton(hwnd, IDC_HISTORYUSER, (UINT)db_get_b(data->hContact, MODULENAME, "LogToHistory", BST_INDETERMINATE));
ShowWindow(GetDlgItem(hwnd, IDC_OPENFOLDER), opts.log_per_contact_folders ? SW_SHOW : SW_HIDE);
- Utils_RestoreWindowPositionNoSize(hwnd, NULL, MODULE_NAME, "AvatarHistoryDialog");
+ Utils_RestoreWindowPositionNoSize(hwnd, NULL, MODULENAME, "AvatarHistoryDialog");
WindowList_Add(hAvatarWindowsList, hwnd, data->hContact);
TranslateDialogDefault(hwnd);
EnableDisableControls(hwnd);
@@ -151,7 +151,7 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARA return TRUE;
case WM_DESTROY:
- Utils_SaveWindowPosition(hwnd, NULL, MODULE_NAME, "AvatarHistoryDialog");
+ Utils_SaveWindowPosition(hwnd, NULL, MODULENAME, "AvatarHistoryDialog");
WindowList_Remove(hAvatarWindowsList, hwnd);
DestroyIcon((HICON)SendMessage(hwnd, WM_SETICON, ICON_BIG, 0));
DestroyIcon((HICON)SendMessage(hwnd, WM_SETICON, ICON_SMALL, 0));
@@ -287,9 +287,9 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARA case IDOK:
if (HIWORD(wParam) == BN_CLICKED) {
MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- db_set_b(hContact, MODULE_NAME, "AvatarPopups", (BYTE)IsDlgButtonChecked(hwnd, IDC_POPUPUSER));
- db_set_b(hContact, MODULE_NAME, "LogToDisk", (BYTE)IsDlgButtonChecked(hwnd, IDC_LOGUSER));
- db_set_b(hContact, MODULE_NAME, "LogToHistory", (BYTE)IsDlgButtonChecked(hwnd, IDC_HISTORYUSER));
+ db_set_b(hContact, MODULENAME, "AvatarPopups", (BYTE)IsDlgButtonChecked(hwnd, IDC_POPUPUSER));
+ db_set_b(hContact, MODULENAME, "LogToDisk", (BYTE)IsDlgButtonChecked(hwnd, IDC_LOGUSER));
+ db_set_b(hContact, MODULENAME, "LogToHistory", (BYTE)IsDlgButtonChecked(hwnd, IDC_HISTORYUSER));
CleanupAvatarPic(hwnd);
EndDialog(hwnd, 0);
@@ -310,7 +310,7 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARA wchar_t avfolder[MAX_PATH];
MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA);
GetContactFolder(avfolder, hContact);
- ShellExecute(nullptr, db_get_b(NULL, MODULE_NAME, "OpenFolderMethod", 0) ? L"explore" : L"open", avfolder, nullptr, nullptr, SW_SHOWNORMAL);
+ ShellExecute(nullptr, db_get_b(NULL, MODULENAME, "OpenFolderMethod", 0) ? L"explore" : L"open", avfolder, nullptr, nullptr, SW_SHOWNORMAL);
return TRUE;
}
break;
@@ -541,7 +541,7 @@ int ShowSaveDialog(HWND hwnd, wchar_t* fn, MCONTACT hContact) ofn.lpstrDefExt = wcsrchr(fn, '.') + 1;
DBVARIANT dbvInitDir = { 0 };
- if (!db_get_ws(hContact, MODULE_NAME, "SavedAvatarFolder", &dbvInitDir)) {
+ if (!db_get_ws(hContact, MODULENAME, "SavedAvatarFolder", &dbvInitDir)) {
ofn.lpstrInitialDir = dbvInitDir.ptszVal;
db_free(&dbvInitDir);
}
@@ -549,7 +549,7 @@ int ShowSaveDialog(HWND hwnd, wchar_t* fn, MCONTACT hContact) if (GetSaveFileName(&ofn)) {
CopyFile(fn, file, FALSE);
- db_set_ws(hContact, MODULE_NAME, "SavedAvatarFolder", file);
+ db_set_ws(hContact, MODULENAME, "SavedAvatarFolder", file);
}
return 0;
}
diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp index 6c2cd9ff99..6d743ff9e2 100644 --- a/plugins/AvatarHistory/src/AvatarHistory.cpp +++ b/plugins/AvatarHistory/src/AvatarHistory.cpp @@ -41,7 +41,9 @@ wchar_t* GetOldStyleAvatarName(wchar_t *fn, MCONTACT hContact); void InitMenuItem();
-PLUGININFOEX pluginInfo = {
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -54,9 +56,13 @@ PLUGININFOEX pluginInfo = { {0xdbe8c990, 0x7aa0, 0x458d, {0xba, 0xb7, 0x33, 0xeb, 0x7, 0x23, 0x8e, 0x71}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -105,7 +111,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) return 0;
DBVARIANT dbvOldHash = { 0 };
- bool ret = (db_get_ws(hContact, MODULE_NAME, "AvatarHash", &dbvOldHash) == 0);
+ bool ret = (db_get_ws(hContact, MODULENAME, "AvatarHash", &dbvOldHash) == 0);
CONTACTAVATARCHANGEDNOTIFICATION* avatar = (CONTACTAVATARCHANGEDNOTIFICATION*)lParam;
if (avatar == nullptr) {
@@ -119,7 +125,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) Skin_PlaySound("avatar_removed");
// Is a flash avatar or avs could not load it
- db_set_ws(hContact, MODULE_NAME, "AvatarHash", L"-");
+ db_set_ws(hContact, MODULENAME, "AvatarHash", L"-");
if (ContactEnabled(hContact, "AvatarPopups", AVH_DEF_AVPOPUPS) && opts.popup_show_removed)
ShowPopup(hContact, nullptr, opts.popup_removed);
@@ -280,12 +286,12 @@ static INT_PTR CALLBACK FirstRunDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPA extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
CoInitialize(nullptr);
// Is first run?
- if (db_get_b(NULL, MODULE_NAME, "FirstRun", 1)) {
+ if (db_get_b(NULL, MODULENAME, "FirstRun", 1)) {
// Show dialog
int ret = DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_FIRST_RUN), nullptr, FirstRunDlgProc, 0);
if (ret == 0)
@@ -293,29 +299,29 @@ extern "C" __declspec(dllexport) int Load(void) // Write settings
- db_set_b(NULL, MODULE_NAME, "LogToDisk", 1);
+ db_set_b(NULL, MODULENAME, "LogToDisk", 1);
if (ret == IDC_MIR_SAME)
- db_set_b(NULL, MODULE_NAME, "LogKeepSameFolder", 1);
+ db_set_b(NULL, MODULENAME, "LogKeepSameFolder", 1);
else
- db_set_b(NULL, MODULE_NAME, "LogKeepSameFolder", 0);
+ db_set_b(NULL, MODULENAME, "LogKeepSameFolder", 0);
if (ret == IDC_MIR_SHORT || ret == IDC_SHORT || ret == IDC_DUP)
- db_set_b(NULL, MODULE_NAME, "LogPerContactFolders", 1);
+ db_set_b(NULL, MODULENAME, "LogPerContactFolders", 1);
else
- db_set_b(NULL, MODULE_NAME, "LogPerContactFolders", 0);
+ db_set_b(NULL, MODULENAME, "LogPerContactFolders", 0);
if (ret == IDC_DUP)
- db_set_b(NULL, MODULE_NAME, "StoreAsHash", 0);
+ db_set_b(NULL, MODULENAME, "StoreAsHash", 0);
else
- db_set_b(NULL, MODULE_NAME, "StoreAsHash", 1);
+ db_set_b(NULL, MODULENAME, "StoreAsHash", 1);
if (ret == IDC_MIR_SAME || ret == IDC_MIR_PROTO || ret == IDC_MIR_SHORT)
- db_set_b(NULL, MODULE_NAME, "LogToHistory", 1);
+ db_set_b(NULL, MODULENAME, "LogToHistory", 1);
else
- db_set_b(NULL, MODULE_NAME, "LogToHistory", 0);
+ db_set_b(NULL, MODULENAME, "LogToHistory", 0);
- db_set_b(NULL, MODULE_NAME, "FirstRun", 0);
+ db_set_b(NULL, MODULENAME, "FirstRun", 0);
}
LoadOptions();
diff --git a/plugins/AvatarHistory/src/options.cpp b/plugins/AvatarHistory/src/options.cpp index b0272797b6..79caebdbf1 100644 --- a/plugins/AvatarHistory/src/options.cpp +++ b/plugins/AvatarHistory/src/options.cpp @@ -50,7 +50,7 @@ static OptPageControl popupsControls[] = { static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- return SaveOptsDlgProc(optionsControls, _countof(optionsControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
+ return SaveOptsDlgProc(optionsControls, _countof(optionsControls), MODULENAME, hwndDlg, msg, wParam, lParam);
}
// Popup options dialog procedure /////////////////////////////////////////////////////////////////
@@ -100,7 +100,7 @@ static INT_PTR CALLBACK PopupsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA SendDlgItemMessage(hwndDlg, IDC_LEFT_ACTION, CB_ADDSTRING, 0, (LPARAM)TranslateT("Show contact history"));
// Needs to be called here in this case
- SaveOptsDlgProc(popupsControls, _countof(popupsControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
+ SaveOptsDlgProc(popupsControls, _countof(popupsControls), MODULENAME, hwndDlg, msg, wParam, lParam);
PopupsEnableDisableCtrls(hwndDlg);
return TRUE;
@@ -139,7 +139,7 @@ static INT_PTR CALLBACK PopupsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA }
}
- return SaveOptsDlgProc(popupsControls, _countof(popupsControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
+ return SaveOptsDlgProc(popupsControls, _countof(popupsControls), MODULENAME, hwndDlg, msg, wParam, lParam);
}
// Functions //////////////////////////////////////////////////////////////////////////////////////
@@ -168,10 +168,10 @@ int OptInit(WPARAM wParam, LPARAM) void LoadOptions()
{
- LoadOpts(optionsControls, _countof(optionsControls), MODULE_NAME);
- LoadOpts(popupsControls, _countof(popupsControls), MODULE_NAME);
+ LoadOpts(optionsControls, _countof(optionsControls), MODULENAME);
+ LoadOpts(popupsControls, _countof(popupsControls), MODULENAME);
- opts.log_per_contact_folders = db_get_b(NULL, MODULE_NAME, "LogPerContactFolders", 0);
- opts.log_keep_same_folder = db_get_b(NULL, MODULE_NAME, "LogKeepSameFolder", 0);
- opts.log_store_as_hash = db_get_b(NULL, MODULE_NAME, "StoreAsHash", 1);
+ opts.log_per_contact_folders = db_get_b(NULL, MODULENAME, "LogPerContactFolders", 0);
+ opts.log_keep_same_folder = db_get_b(NULL, MODULENAME, "LogKeepSameFolder", 0);
+ opts.log_store_as_hash = db_get_b(NULL, MODULENAME, "StoreAsHash", 1);
}
diff --git a/plugins/AvatarHistory/src/popup.cpp b/plugins/AvatarHistory/src/popup.cpp index 16e52cb53b..ead52b114d 100644 --- a/plugins/AvatarHistory/src/popup.cpp +++ b/plugins/AvatarHistory/src/popup.cpp @@ -41,7 +41,7 @@ static LRESULT CALLBACK DumbPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, void InitPopups()
{
// window needed for popup commands
- hPopupWindow = CreateWindowEx(WS_EX_TOOLWINDOW, L"static", _A2W(MODULE_NAME) L"_PopupWindow",
+ hPopupWindow = CreateWindowEx(WS_EX_TOOLWINDOW, L"static", _A2W(MODULENAME) L"_PopupWindow",
0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP,
nullptr, g_plugin.getInst(), nullptr);
SetWindowLongPtr(hPopupWindow, GWLP_WNDPROC, (LONG_PTR)PopupWndProc);
@@ -56,7 +56,7 @@ void DeInitPopups() // Show an error popup
void ShowErrPopup(const wchar_t *description, const wchar_t *title)
{
- ShowPopupEx(NULL, title == nullptr ? _A2W(MODULE_NAME) L" Error" : title, description,
+ ShowPopupEx(NULL, title == nullptr ? _A2W(MODULENAME) L" Error" : title, description,
nullptr, POPUP_TYPE_ERROR, nullptr);
}
@@ -74,7 +74,7 @@ void ShowPopup(MCONTACT hContact, const wchar_t *title, const wchar_t *descripti void ShowDebugPopup(MCONTACT hContact, const wchar_t *title, const wchar_t *description)
{
- if (db_get_b(NULL, MODULE_NAME, "Debug", 0)) {
+ if (db_get_b(NULL, MODULENAME, "Debug", 0)) {
ShowPopup(hContact, title, description);
}
}
diff --git a/plugins/AvatarHistory/src/stdafx.h b/plugins/AvatarHistory/src/stdafx.h index d865398e6e..cdf31741b7 100644 --- a/plugins/AvatarHistory/src/stdafx.h +++ b/plugins/AvatarHistory/src/stdafx.h @@ -40,13 +40,11 @@ extern Options opts; extern HANDLE hFolder;
extern wchar_t basedir[];
-#define MODULE_NAME "AvatarHistory"
+#define MODULENAME "AvatarHistory"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE_NAME)
- {}
+ CMPlugin();
};
#define AVH_DEF_POPUPFG 0
diff --git a/plugins/AvatarHistory/src/utils.cpp b/plugins/AvatarHistory/src/utils.cpp index f390b3463f..9b70f7f762 100644 --- a/plugins/AvatarHistory/src/utils.cpp +++ b/plugins/AvatarHistory/src/utils.cpp @@ -38,8 +38,8 @@ bool ContactEnabled(MCONTACT hContact, char *setting, int def) if (!ProtocolEnabled(proto))
return false;
- BYTE globpref = db_get_b(NULL, MODULE_NAME, setting, def);
- BYTE userpref = db_get_b(hContact, MODULE_NAME, setting, BST_INDETERMINATE);
+ BYTE globpref = db_get_b(NULL, MODULENAME, setting, def);
+ BYTE userpref = db_get_b(hContact, MODULENAME, setting, BST_INDETERMINATE);
return (globpref && userpref == BST_INDETERMINATE) || userpref == BST_CHECKED;
}
diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index 889f9ba55f..ffacf8fb92 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -34,7 +34,9 @@ CMPlugin g_plugin; int &hLangpack(g_plugin.m_hLang);
CLIST_INTERFACE *pcli;
-PLUGININFOEX pluginInfo = {
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -47,11 +49,17 @@ PLUGININFOEX pluginInfo = { { 0x2f07ea05, 0x05b5, 0x4ff0, { 0x87, 0x5d, 0xc5, 0x90, 0xda, 0x2d, 0xda, 0xc1 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
#define MAXCHAN 5
static wchar_t CurrBassPath[MAX_PATH], tmp[MAX_PATH];
static int sndNSnd = 0, sndLimSnd;
@@ -191,7 +199,7 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara SendDlgItemMessage(hwndDlg, IDC_OUTDEVICE, CB_SETCURSEL, 0, 0);
BASS_DEVICEINFO info;
- ptrW tszDeviceName(db_get_wsa(NULL, ModuleName, OPT_OUTDEVICE));
+ ptrW tszDeviceName(db_get_wsa(NULL, MODULENAME, OPT_OUTDEVICE));
for (int i = 1; BASS_GetDeviceInfo(i + newBass, &info); i++) {
SendDlgItemMessage(hwndDlg, IDC_OUTDEVICE, CB_ADDSTRING, 0, _A2T(info.name));
if (!mir_wstrcmp(tszDeviceName, _A2T(info.name)))
@@ -220,29 +228,29 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara SYSTEMTIME systime = { 0 };
GetDlgItemText(hwndDlg, IDC_OUTDEVICE, tmp, _countof(tmp));
- db_set_ws(NULL, ModuleName, OPT_OUTDEVICE, tmp);
+ db_set_ws(NULL, MODULENAME, OPT_OUTDEVICE, tmp);
Volume = (DWORD)SendDlgItemMessage(hwndDlg, IDC_VOLUME, TBM_GETPOS, 0, 0);
- db_set_b(NULL, ModuleName, OPT_VOLUME, Volume);
+ db_set_b(NULL, MODULENAME, OPT_VOLUME, Volume);
sndLimSnd = SendDlgItemMessage(hwndDlg, IDC_MAXCHANNEL, CB_GETCURSEL, 0, 0) + 1;
if (sndLimSnd > MAXCHAN)
sndLimSnd = MAXCHAN;
- db_set_b(NULL, ModuleName, OPT_MAXCHAN, sndLimSnd);
+ db_set_b(NULL, MODULENAME, OPT_MAXCHAN, sndLimSnd);
QuietTime = IsDlgButtonChecked(hwndDlg, IDC_QUIETTIME) == BST_CHECKED;
- db_set_b(NULL, ModuleName, OPT_QUIETTIME, QuietTime);
+ db_set_b(NULL, MODULENAME, OPT_QUIETTIME, QuietTime);
SendDlgItemMessage(hwndDlg, IDC_TIME1, DTM_GETSYSTEMTIME, 0, (LPARAM)&systime);
TimeWrd1 = MAKEWORD(systime.wMinute, systime.wHour);
- db_set_w(NULL, ModuleName, OPT_TIME1, TimeWrd1);
+ db_set_w(NULL, MODULENAME, OPT_TIME1, TimeWrd1);
SendDlgItemMessage(hwndDlg, IDC_TIME2, DTM_GETSYSTEMTIME, 0, (LPARAM)&systime);
TimeWrd2 = MAKEWORD(systime.wMinute, systime.wHour);
- db_set_w(NULL, ModuleName, OPT_TIME2, TimeWrd2);
+ db_set_w(NULL, MODULENAME, OPT_TIME2, TimeWrd2);
EnPreview = IsDlgButtonChecked(hwndDlg, IDC_PREVIEW) == BST_CHECKED;
- db_set_b(NULL, ModuleName, OPT_PREVIEW, EnPreview);
+ db_set_b(NULL, MODULENAME, OPT_PREVIEW, EnPreview);
StatMask = 0;
for (int i = IDC_CHECKBOX10; i > IDC_CHECKBOX1 - 1; i--) {
@@ -251,7 +259,7 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara StatMask |= 1;
}
- db_set_w(NULL, ModuleName, OPT_STATUS, StatMask);
+ db_set_w(NULL, MODULENAME, OPT_STATUS, StatMask);
device = SendDlgItemMessage(hwndDlg, IDC_OUTDEVICE, CB_GETCURSEL, 0, 0);
if (device == 0)
@@ -310,7 +318,7 @@ int OptionsInit(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.szTitle.a = ModuleName;
+ odp.szTitle.a = MODULENAME;
odp.pfnDlgProc = OptionsProc;
odp.szGroup.a = LPGEN("Sounds");
odp.flags = ODPF_BOLDGROUPS;
@@ -379,7 +387,7 @@ static LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR if (hBass != nullptr)
if (LOWORD(wParam) == SB_ENDSCROLL || LOWORD(wParam) == SB_THUMBTRACK) {
Volume = (DWORD)SendMessage(hwndSlider, TBM_GETPOS, 0, 0);
- db_set_b(NULL, ModuleName, OPT_VOLUME, Volume);
+ db_set_b(NULL, MODULENAME, OPT_VOLUME, Volume);
BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, Volume * 100);
SendMessage(hwndOptSlider, TBM_SETPOS, TRUE, Volume);
Preview = TRUE;
@@ -417,7 +425,7 @@ static LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR int ReloadColors(WPARAM, LPARAM)
{
- clBack = Colour_GetW(_A2W(ModuleName), LPGENW("Frame background"));
+ clBack = Colour_GetW(_A2W(MODULENAME), LPGENW("Frame background"));
if (hBkgBrush)
DeleteObject(hBkgBrush);
@@ -457,10 +465,10 @@ void CreateFrame() ColourIDW colourid = { 0 };
colourid.cbSize = sizeof(ColourIDW);
- strcpy_s(colourid.dbSettingsGroup, ModuleName);
+ strcpy_s(colourid.dbSettingsGroup, MODULENAME);
strcpy_s(colourid.setting, "ColorFrame");
wcscpy_s(colourid.name, LPGENW("Frame background"));
- wcscpy_s(colourid.group, _A2W(ModuleName));
+ wcscpy_s(colourid.group, _A2W(MODULENAME));
colourid.defcolour = GetSysColor(COLOR_3DFACE);
Colour_RegisterW(&colourid);
@@ -488,26 +496,26 @@ void LoadBassLibrary(const wchar_t *ptszPath) DBVARIANT dbv = { 0 };
BASS_DEVICEINFO info;
- if (!db_get_ws(NULL, ModuleName, OPT_OUTDEVICE, &dbv))
+ if (!db_get_ws(NULL, MODULENAME, OPT_OUTDEVICE, &dbv))
for (size_t i = 1; BASS_GetDeviceInfo((DWORD)i, &info); i++)
if (!mir_wstrcmp(dbv.ptszVal, _A2T(info.name)))
device = (int)i;
db_free(&dbv);
- sndLimSnd = db_get_b(NULL, ModuleName, OPT_MAXCHAN, MAXCHAN);
+ sndLimSnd = db_get_b(NULL, MODULENAME, OPT_MAXCHAN, MAXCHAN);
if (sndLimSnd > MAXCHAN)
sndLimSnd = MAXCHAN;
- TimeWrd1 = db_get_w(NULL, ModuleName, OPT_TIME1, 0);
- TimeWrd2 = db_get_w(NULL, ModuleName, OPT_TIME2, 0);
- QuietTime = db_get_b(NULL, ModuleName, OPT_QUIETTIME, 0);
- EnPreview = db_get_b(NULL, ModuleName, OPT_PREVIEW, 0);
- StatMask = db_get_w(NULL, ModuleName, OPT_STATUS, 0x3ff);
+ TimeWrd1 = db_get_w(NULL, MODULENAME, OPT_TIME1, 0);
+ TimeWrd2 = db_get_w(NULL, MODULENAME, OPT_TIME2, 0);
+ QuietTime = db_get_b(NULL, MODULENAME, OPT_QUIETTIME, 0);
+ EnPreview = db_get_b(NULL, MODULENAME, OPT_PREVIEW, 0);
+ StatMask = db_get_w(NULL, MODULENAME, OPT_STATUS, 0x3ff);
BASS_Init(device, 44100, 0, pcli->hwndContactList, nullptr);
- Volume = db_get_b(NULL, ModuleName, OPT_VOLUME, 33);
+ Volume = db_get_b(NULL, MODULENAME, OPT_VOLUME, 33);
BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, Volume * 100);
hPlaySound = HookEvent(ME_SKIN_PLAYINGSOUND, OnPlaySnd);
CreateFrame();
@@ -539,9 +547,9 @@ int OnModulesLoaded(WPARAM, LPARAM) }
else {
DBVARIANT dbv;
- if (db_get_ws(NULL, ModuleName, OPT_BASSPATH, &dbv)) {
+ if (db_get_ws(NULL, MODULENAME, OPT_BASSPATH, &dbv)) {
mir_wstrncpy(CurrBassPath, VARSW(L"Plugins\\BASS\\bass.dll"), _countof(CurrBassPath));
- db_set_ws(NULL, ModuleName, OPT_BASSPATH, CurrBassPath);
+ db_set_ws(NULL, MODULENAME, OPT_BASSPATH, CurrBassPath);
}
else {
mir_wstrcpy(CurrBassPath, dbv.ptszVal);
@@ -582,6 +590,8 @@ int OnShutdown(WPARAM, LPARAM) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
static IconItem iconList[] =
{
{ LPGEN("Sounds enabled"), "BASSSoundOn", IDI_BASSSoundOn },
@@ -590,17 +600,19 @@ static IconItem iconList[] = extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
HookEvent(ME_SYSTEM_SHUTDOWN, OnShutdown);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnSettingChanged);
- g_plugin.registerIcon(ModuleName, iconList);
+ g_plugin.registerIcon(MODULENAME, iconList);
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Unload(void)
{
return 0;
diff --git a/plugins/BASS_interface/src/stdafx.h b/plugins/BASS_interface/src/stdafx.h index 306c6a5a88..1da9396919 100644 --- a/plugins/BASS_interface/src/stdafx.h +++ b/plugins/BASS_interface/src/stdafx.h @@ -25,13 +25,11 @@ Copyright (C) 2010, 2011 tico-tico #include "resource.h"
#include "version.h"
-#define ModuleName LPGEN("BASS Interface")
+#define MODULENAME LPGEN("BASS Interface")
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(ModuleName)
- {}
+ CMPlugin();
};
#define OPT_VOLUME "Volume"
diff --git a/plugins/BasicHistory/src/BasicHistory.cpp b/plugins/BasicHistory/src/BasicHistory.cpp index 5f10890c00..86a5b606c3 100644 --- a/plugins/BasicHistory/src/BasicHistory.cpp +++ b/plugins/BasicHistory/src/BasicHistory.cpp @@ -21,8 +21,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define MS_HISTORY_DELETEALLCONTACTHISTORY "BasicHistory/DeleteAllContactHistory"
#define MS_HISTORY_EXECUTE_TASK "BasicHistory/ExecuteTask"
-HCURSOR hCurSplitNS, hCurSplitWE;
-HANDLE g_hMainThread = nullptr;
+HCURSOR hCurSplitNS, hCurSplitWE;
+HANDLE g_hMainThread = nullptr;
HANDLE *hEventIcons = nullptr;
int iconsNum = 3;
@@ -34,7 +34,12 @@ bool g_SmileyAddAvail = false; char* metaContactProto = nullptr;
const IID IID_ITextDocument = { 0x8CC497C0, 0xA1DF, 0x11ce, {0x80, 0x98, 0x00, 0xAA, 0x00, 0x47, 0xBE, 0x5D} };
-PLUGININFOEX pluginInfo = {
+CMPlugin g_plugin;
+int &hLangpack(g_plugin.m_hLang);
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -47,16 +52,21 @@ PLUGININFOEX pluginInfo = { {0xe25367a2, 0x51ae, 0x4044, {0xbe, 0x28, 0x13, 0x1b, 0xc1, 0x8b, 0x71, 0xa4}}
};
-CMPlugin g_plugin;
-int &hLangpack(g_plugin.m_hLang);
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_UIHISTORY, MIID_LAST };
+/////////////////////////////////////////////////////////////////////////////////////////
+
void InitScheduler();
void DeinitScheduler();
int DoLastTask(WPARAM, LPARAM);
@@ -232,7 +242,7 @@ int ModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
hTaskMainMenu = nullptr;
DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &g_hMainThread, 0, FALSE, DUPLICATE_SAME_ACCESS);
@@ -255,6 +265,8 @@ extern "C" int __declspec(dllexport) Load(void) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Unload(void)
{
if (g_hMainThread)
diff --git a/plugins/BasicHistory/src/HistoryWindow.cpp b/plugins/BasicHistory/src/HistoryWindow.cpp index 1fbde4a55d..d6e8487d23 100644 --- a/plugins/BasicHistory/src/HistoryWindow.cpp +++ b/plugins/BasicHistory/src/HistoryWindow.cpp @@ -1600,22 +1600,22 @@ void HistoryWindow::RestorePos() {
MCONTACT contactToLoad = m_hContact;
if (m_hContact == NULL) {
- Utils_RestoreWindowPosition(m_hWnd, NULL, MODULE, "history_");
+ Utils_RestoreWindowPosition(m_hWnd, NULL, MODULENAME, "history_");
contactToLoad = NULL;
}
- else if (Utils_RestoreWindowPosition(m_hWnd, m_hContact, MODULE, "history_") != 0) {
- Utils_RestoreWindowPosition(m_hWnd, NULL, MODULE, "history_");
+ else if (Utils_RestoreWindowPosition(m_hWnd, m_hContact, MODULENAME, "history_") != 0) {
+ Utils_RestoreWindowPosition(m_hWnd, NULL, MODULENAME, "history_");
contactToLoad = NULL;
}
- if (db_get_b(contactToLoad, MODULE, "history_ismax", 0))
+ if (db_get_b(contactToLoad, MODULENAME, "history_ismax", 0))
ShowWindow(m_hWnd, SW_SHOWMAXIMIZED);
- LONG pos = db_get_dw(contactToLoad, MODULE, "history_splitterv", 0);
+ LONG pos = db_get_dw(contactToLoad, MODULENAME, "history_splitterv", 0);
if (pos > 0)
SplitterMoved(splitterYhWnd, pos, false);
- pos = db_get_dw(contactToLoad, MODULE, "history_splitter", 0);
+ pos = db_get_dw(contactToLoad, MODULENAME, "history_splitter", 0);
if (pos > 0)
SplitterMoved(splitterXhWnd, pos, false);
}
@@ -1625,25 +1625,25 @@ void HistoryWindow::SavePos(bool all) MCONTACT contactToSave = m_hContact;
if (all) {
for (auto &_hContact : Contacts()) {
- db_unset(_hContact, MODULE, "history_x");
- db_unset(_hContact, MODULE, "history_y");
- db_unset(_hContact, MODULE, "history_width");
- db_unset(_hContact, MODULE, "history_height");
- db_unset(_hContact, MODULE, "history_ismax");
- db_unset(_hContact, MODULE, "history_splitterv");
- db_unset(_hContact, MODULE, "history_splitter");
+ db_unset(_hContact, MODULENAME, "history_x");
+ db_unset(_hContact, MODULENAME, "history_y");
+ db_unset(_hContact, MODULENAME, "history_width");
+ db_unset(_hContact, MODULENAME, "history_height");
+ db_unset(_hContact, MODULENAME, "history_ismax");
+ db_unset(_hContact, MODULENAME, "history_splitterv");
+ db_unset(_hContact, MODULENAME, "history_splitter");
}
contactToSave = NULL;
}
- Utils_SaveWindowPosition(m_hWnd, contactToSave, MODULE, "history_");
+ Utils_SaveWindowPosition(m_hWnd, contactToSave, MODULENAME, "history_");
WINDOWPLACEMENT wp;
wp.length = sizeof(wp);
GetWindowPlacement(m_hWnd, &wp);
- db_set_b(contactToSave, MODULE, "history_ismax", wp.showCmd == SW_MAXIMIZE ? 1 : 0);
- db_set_dw(contactToSave, MODULE, "history_splitterv", splitterX);
- db_set_dw(contactToSave, MODULE, "history_splitter", splitterY);
+ db_set_b(contactToSave, MODULENAME, "history_ismax", wp.showCmd == SW_MAXIMIZE ? 1 : 0);
+ db_set_dw(contactToSave, MODULENAME, "history_splitterv", splitterX);
+ db_set_dw(contactToSave, MODULENAME, "history_splitter", splitterY);
}
#define DEF_FILTERS_START 50000
diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp index c0d3b16b94..8e9ed171f4 100644 --- a/plugins/BasicHistory/src/Options.cpp +++ b/plugins/BasicHistory/src/Options.cpp @@ -275,58 +275,58 @@ void Options::Load(void) Hotkey_Register(&hid);
}
- showContacts = db_get_b(0, MODULE, "showContacts", 0) ? true : false;
- showContactGroups = db_get_b(0, MODULE, "showContactGroups", 1) ? true : false;
- noFindBorder = db_get_b(0, MODULE, "noFindBorder", 0) ? true : false;
- groupNewOnTop = db_get_b(0, MODULE, "groupNewOnTop", 1) ? true : false;
- groupShowEvents = db_get_b(0, MODULE, "groupShowEvents", 1) ? true : false;
- groupShowTime = db_get_b(0, MODULE, "groupShowTime", 1) ? true : false;
- groupShowName = db_get_b(0, MODULE, "groupShowName", 0) ? true : false;
- groupShowMessage = db_get_b(0, MODULE, "groupShowMessage", 1) ? true : false;
- groupMessageLen = db_get_dw(0, MODULE, "groupMessageLen", 43);
+ showContacts = db_get_b(0, MODULENAME, "showContacts", 0) ? true : false;
+ showContactGroups = db_get_b(0, MODULENAME, "showContactGroups", 1) ? true : false;
+ noFindBorder = db_get_b(0, MODULENAME, "noFindBorder", 0) ? true : false;
+ groupNewOnTop = db_get_b(0, MODULENAME, "groupNewOnTop", 1) ? true : false;
+ groupShowEvents = db_get_b(0, MODULENAME, "groupShowEvents", 1) ? true : false;
+ groupShowTime = db_get_b(0, MODULENAME, "groupShowTime", 1) ? true : false;
+ groupShowName = db_get_b(0, MODULENAME, "groupShowName", 0) ? true : false;
+ groupShowMessage = db_get_b(0, MODULENAME, "groupShowMessage", 1) ? true : false;
+ groupMessageLen = db_get_dw(0, MODULENAME, "groupMessageLen", 43);
if (groupMessageLen < 5) groupMessageLen = 5;
- groupTime = db_get_dw(0, MODULE, "groupTime", 5);
+ groupTime = db_get_dw(0, MODULENAME, "groupTime", 5);
if (groupTime < 1) groupTime = 1;
- groupMessagesNumber = db_get_dw(0, MODULE, "groupMessagesNumber", 100);
+ groupMessagesNumber = db_get_dw(0, MODULENAME, "groupMessagesNumber", 100);
if (groupMessagesNumber < 1) groupMessagesNumber = 1;
- messagesNewOnTop = db_get_b(0, MODULE, "messagesNewOnTop", 0) ? true : false;
- messagesShowDate = db_get_b(0, MODULE, "messagesShowDate", 0) ? true : false;
- messagesShowSec = db_get_b(0, MODULE, "messagesShowSec", 0) ? true : false;
- messagesShowName = db_get_b(0, MODULE, "messagesShowName", 1) ? true : false;
- messagesShowEvents = db_get_b(0, MODULE, "messagesShowEvents", 0) ? true : false;
- messagesUseSmileys = db_get_b(0, MODULE, "messagesUseSmileys", 1) ? true : false;
- searchForInList = db_get_b(0, MODULE, "searchForInList", 1) ? true : false;
- searchForInMess = db_get_b(0, MODULE, "searchForInMess", 1) ? true : false;
- searchMatchCase = db_get_b(0, MODULE, "searchMatchCase", 0) ? true : false;
- searchMatchWhole = db_get_b(0, MODULE, "searchMatchWhole", 0) ? true : false;
- searchOnlyIn = db_get_b(0, MODULE, "searchOnlyIn", 0) ? true : false;
- searchOnlyOut = db_get_b(0, MODULE, "searchOnlyOut", 0) ? true : false;
- searchOnlyGroup = db_get_b(0, MODULE, "searchOnlyGroup", 0) ? true : false;
- searchAllContacts = db_get_b(0, MODULE, "searchAllContacts", 0) ? true : false;
- schedulerAlerts = db_get_b(0, MODULE, "schedulerAlerts", 1) ? true : false;
- schedulerHistoryAlerts = db_get_b(0, MODULE, "schedulerHistoryAlerts", 1) ? true : false;
-
- defFilter = db_get_b(0, MODULE, "defFilter", defFilter);
- int filtersCount = db_get_dw(0, MODULE, "customFiltersCount", 0);
+ messagesNewOnTop = db_get_b(0, MODULENAME, "messagesNewOnTop", 0) ? true : false;
+ messagesShowDate = db_get_b(0, MODULENAME, "messagesShowDate", 0) ? true : false;
+ messagesShowSec = db_get_b(0, MODULENAME, "messagesShowSec", 0) ? true : false;
+ messagesShowName = db_get_b(0, MODULENAME, "messagesShowName", 1) ? true : false;
+ messagesShowEvents = db_get_b(0, MODULENAME, "messagesShowEvents", 0) ? true : false;
+ messagesUseSmileys = db_get_b(0, MODULENAME, "messagesUseSmileys", 1) ? true : false;
+ searchForInList = db_get_b(0, MODULENAME, "searchForInList", 1) ? true : false;
+ searchForInMess = db_get_b(0, MODULENAME, "searchForInMess", 1) ? true : false;
+ searchMatchCase = db_get_b(0, MODULENAME, "searchMatchCase", 0) ? true : false;
+ searchMatchWhole = db_get_b(0, MODULENAME, "searchMatchWhole", 0) ? true : false;
+ searchOnlyIn = db_get_b(0, MODULENAME, "searchOnlyIn", 0) ? true : false;
+ searchOnlyOut = db_get_b(0, MODULENAME, "searchOnlyOut", 0) ? true : false;
+ searchOnlyGroup = db_get_b(0, MODULENAME, "searchOnlyGroup", 0) ? true : false;
+ searchAllContacts = db_get_b(0, MODULENAME, "searchAllContacts", 0) ? true : false;
+ schedulerAlerts = db_get_b(0, MODULENAME, "schedulerAlerts", 1) ? true : false;
+ schedulerHistoryAlerts = db_get_b(0, MODULENAME, "schedulerHistoryAlerts", 1) ? true : false;
+
+ defFilter = db_get_b(0, MODULENAME, "defFilter", defFilter);
+ int filtersCount = db_get_dw(0, MODULENAME, "customFiltersCount", 0);
for (int i = 0; i < filtersCount; ++i) {
char buf[256];
FilterOptions fo;
mir_snprintf(buf, "filterName_%d", i);
DBVARIANT nameV;
- if (!db_get_ws(0, MODULE, buf, &nameV)) {
+ if (!db_get_ws(0, MODULENAME, buf, &nameV)) {
fo.name = nameV.pwszVal;
db_free(&nameV);
}
else break;
mir_snprintf(buf, "filterInOut_%d", i);
- int inOut = db_get_b(0, MODULE, buf, 0);
+ int inOut = db_get_b(0, MODULENAME, buf, 0);
if (inOut == 1)
fo.onlyIncomming = true;
else if (inOut == 2)
fo.onlyOutgoing = true;
mir_snprintf(buf, "filterEvents_%d", i);
DBVARIANT eventsV;
- if (!db_get_s(0, MODULE, buf, &eventsV)) {
+ if (!db_get_s(0, MODULENAME, buf, &eventsV)) {
int k = 0;
char* id = eventsV.pszVal;
while (eventsV.pszVal[k]) {
@@ -349,7 +349,7 @@ void Options::Load(void) defFilter = 0;
DBVARIANT defFilterStrV;
- if (!db_get_ws(0, MODULE, "defFilterStr", &defFilterStrV)) {
+ if (!db_get_ws(0, MODULENAME, "defFilterStr", &defFilterStrV)) {
std::wstring filterName = defFilterStrV.pwszVal;
for (int i = 0; i < (int)customFilters.size(); ++i) {
if (filterName == customFilters[i].name) {
@@ -361,43 +361,43 @@ void Options::Load(void) }
}
- codepageTxt = db_get_dw(0, MODULE, "codepageTxt", CP_UTF8);
- codepageHtml1 = db_get_dw(0, MODULE, "codepageHtml1", CP_UTF8);
- codepageHtml2 = db_get_dw(0, MODULE, "codepageHtml2", CP_UTF8);
+ codepageTxt = db_get_dw(0, MODULENAME, "codepageTxt", CP_UTF8);
+ codepageHtml1 = db_get_dw(0, MODULENAME, "codepageHtml1", CP_UTF8);
+ codepageHtml2 = db_get_dw(0, MODULENAME, "codepageHtml2", CP_UTF8);
DBVARIANT encodingV;
- if (!db_get_ws(0, MODULE, "encodingTxt", &encodingV)) {
+ if (!db_get_ws(0, MODULENAME, "encodingTxt", &encodingV)) {
encodingTxt = encodingV.pwszVal;
db_free(&encodingV);
}
else encodingTxt = L"UTF-8";
- if (!db_get_ws(0, MODULE, "encodingHtml1", &encodingV)) {
+ if (!db_get_ws(0, MODULENAME, "encodingHtml1", &encodingV)) {
encodingHtml1 = encodingV.pwszVal;
db_free(&encodingV);
}
else encodingHtml1 = L"UTF-8";
- if (!db_get_ws(0, MODULE, "encodingHtml2", &encodingV)) {
+ if (!db_get_ws(0, MODULENAME, "encodingHtml2", &encodingV)) {
encodingHtml2 = encodingV.pwszVal;
db_free(&encodingV);
}
else encodingHtml2 = L"UTF-8";
- exportHtml1ShowDate = db_get_b(0, MODULE, "exportHtml1ShowDate", 1) ? true : false;
- exportHtml2ShowDate = db_get_b(0, MODULE, "exportHtml2ShowDate", 0) ? true : false;
- exportHtml2UseSmileys = db_get_b(0, MODULE, "exportHtml2UseSmileys", 1) ? true : false;
- if (!db_get_ws(0, MODULE, "extCssHtml2", &encodingV)) {
+ exportHtml1ShowDate = db_get_b(0, MODULENAME, "exportHtml1ShowDate", 1) ? true : false;
+ exportHtml2ShowDate = db_get_b(0, MODULENAME, "exportHtml2ShowDate", 0) ? true : false;
+ exportHtml2UseSmileys = db_get_b(0, MODULENAME, "exportHtml2UseSmileys", 1) ? true : false;
+ if (!db_get_ws(0, MODULENAME, "extCssHtml2", &encodingV)) {
extCssHtml2 = encodingV.pwszVal;
db_free(&encodingV);
}
else extCssHtml2 = L"";
- if (!db_get_ws(0, MODULE, "ftpLogPath", &encodingV)) {
+ if (!db_get_ws(0, MODULENAME, "ftpLogPath", &encodingV)) {
ftpLogPath = encodingV.pwszVal;
db_free(&encodingV);
}
- if (!db_get_ws(0, MODULE, "ftpExePath", &encodingV)) {
+ if (!db_get_ws(0, MODULENAME, "ftpExePath", &encodingV)) {
ftpExePath = encodingV.pwszVal;
db_free(&encodingV);
}
@@ -418,51 +418,51 @@ COLORREF Options::GetColor(Colors colorId) void Options::Save()
{
- db_set_b(0, MODULE, "showContacts", showContacts ? 1 : 0);
- db_set_b(0, MODULE, "showContactGroups", showContactGroups ? 1 : 0);
- db_set_b(0, MODULE, "noFindBorder", noFindBorder ? 1 : 0);
- db_set_b(0, MODULE, "groupNewOnTop", groupNewOnTop ? 1 : 0);
- db_set_b(0, MODULE, "groupShowEvents", groupShowEvents ? 1 : 0);
- db_set_b(0, MODULE, "groupShowTime", groupShowTime ? 1 : 0);
- db_set_b(0, MODULE, "groupShowName", groupShowName ? 1 : 0);
- db_set_b(0, MODULE, "groupShowMessage", groupShowMessage ? 1 : 0);
+ db_set_b(0, MODULENAME, "showContacts", showContacts ? 1 : 0);
+ db_set_b(0, MODULENAME, "showContactGroups", showContactGroups ? 1 : 0);
+ db_set_b(0, MODULENAME, "noFindBorder", noFindBorder ? 1 : 0);
+ db_set_b(0, MODULENAME, "groupNewOnTop", groupNewOnTop ? 1 : 0);
+ db_set_b(0, MODULENAME, "groupShowEvents", groupShowEvents ? 1 : 0);
+ db_set_b(0, MODULENAME, "groupShowTime", groupShowTime ? 1 : 0);
+ db_set_b(0, MODULENAME, "groupShowName", groupShowName ? 1 : 0);
+ db_set_b(0, MODULENAME, "groupShowMessage", groupShowMessage ? 1 : 0);
if (groupMessageLen < 5)
groupMessageLen = 5;
- db_set_dw(0, MODULE, "groupMessageLen", groupMessageLen);
+ db_set_dw(0, MODULENAME, "groupMessageLen", groupMessageLen);
if (groupTime < 1)
groupTime = 1;
- db_set_dw(0, MODULE, "groupTime", groupTime);
+ db_set_dw(0, MODULENAME, "groupTime", groupTime);
if (groupMessagesNumber < 1)
groupMessagesNumber = 1;
- db_set_dw(0, MODULE, "groupMessagesNumber", groupMessagesNumber);
- db_set_b(0, MODULE, "messagesNewOnTop", messagesNewOnTop ? 1 : 0);
- db_set_b(0, MODULE, "messagesShowDate", messagesShowDate ? 1 : 0);
- db_set_b(0, MODULE, "messagesShowSec", messagesShowSec ? 1 : 0);
- db_set_b(0, MODULE, "messagesShowName", messagesShowName ? 1 : 0);
- db_set_b(0, MODULE, "messagesShowEvents", messagesShowEvents ? 1 : 0);
- db_set_b(0, MODULE, "messagesUseSmileys", messagesUseSmileys ? 1 : 0);
- db_set_b(0, MODULE, "searchForInList", searchForInList ? 1 : 0);
- db_set_b(0, MODULE, "searchForInMess", searchForInMess ? 1 : 0);
- db_set_b(0, MODULE, "searchMatchCase", searchMatchCase ? 1 : 0);
- db_set_b(0, MODULE, "searchMatchWhole", searchMatchWhole ? 1 : 0);
- db_set_b(0, MODULE, "searchOnlyIn", searchOnlyIn ? 1 : 0);
- db_set_b(0, MODULE, "searchOnlyOut", searchOnlyOut ? 1 : 0);
- db_set_b(0, MODULE, "searchOnlyGroup", searchOnlyGroup ? 1 : 0);
- db_set_b(0, MODULE, "searchAllContacts", searchAllContacts ? 1 : 0);
- db_set_b(0, MODULE, "schedulerAlerts", schedulerAlerts ? 1 : 0);
- db_set_b(0, MODULE, "schedulerHistoryAlerts", schedulerHistoryAlerts ? 1 : 0);
+ db_set_dw(0, MODULENAME, "groupMessagesNumber", groupMessagesNumber);
+ db_set_b(0, MODULENAME, "messagesNewOnTop", messagesNewOnTop ? 1 : 0);
+ db_set_b(0, MODULENAME, "messagesShowDate", messagesShowDate ? 1 : 0);
+ db_set_b(0, MODULENAME, "messagesShowSec", messagesShowSec ? 1 : 0);
+ db_set_b(0, MODULENAME, "messagesShowName", messagesShowName ? 1 : 0);
+ db_set_b(0, MODULENAME, "messagesShowEvents", messagesShowEvents ? 1 : 0);
+ db_set_b(0, MODULENAME, "messagesUseSmileys", messagesUseSmileys ? 1 : 0);
+ db_set_b(0, MODULENAME, "searchForInList", searchForInList ? 1 : 0);
+ db_set_b(0, MODULENAME, "searchForInMess", searchForInMess ? 1 : 0);
+ db_set_b(0, MODULENAME, "searchMatchCase", searchMatchCase ? 1 : 0);
+ db_set_b(0, MODULENAME, "searchMatchWhole", searchMatchWhole ? 1 : 0);
+ db_set_b(0, MODULENAME, "searchOnlyIn", searchOnlyIn ? 1 : 0);
+ db_set_b(0, MODULENAME, "searchOnlyOut", searchOnlyOut ? 1 : 0);
+ db_set_b(0, MODULENAME, "searchOnlyGroup", searchOnlyGroup ? 1 : 0);
+ db_set_b(0, MODULENAME, "searchAllContacts", searchAllContacts ? 1 : 0);
+ db_set_b(0, MODULENAME, "schedulerAlerts", schedulerAlerts ? 1 : 0);
+ db_set_b(0, MODULENAME, "schedulerHistoryAlerts", schedulerHistoryAlerts ? 1 : 0);
if (defFilter < 0 || defFilter - 2 >= (int)customFilters.size())
defFilter = 0;
- db_set_b(0, MODULE, "defFilter", defFilter < 2 ? defFilter : 2);
+ db_set_b(0, MODULENAME, "defFilter", defFilter < 2 ? defFilter : 2);
if (defFilter >= 2)
- db_set_ws(0, MODULE, "defFilterStr", customFilters[defFilter - 2].name.c_str());
- db_set_dw(0, MODULE, "customFiltersCount", (DWORD)customFilters.size());
+ db_set_ws(0, MODULENAME, "defFilterStr", customFilters[defFilter - 2].name.c_str());
+ db_set_dw(0, MODULENAME, "customFiltersCount", (DWORD)customFilters.size());
for (int i = 0; i < (int)customFilters.size(); ++i) {
char buf[256];
mir_snprintf(buf, "filterName_%d", i);
- db_set_ws(0, MODULE, buf, customFilters[i].name.c_str());
+ db_set_ws(0, MODULENAME, buf, customFilters[i].name.c_str());
mir_snprintf(buf, "filterInOut_%d", i);
- db_set_b(0, MODULE, buf, customFilters[i].onlyIncomming ? 1 : (customFilters[i].onlyOutgoing ? 2 : 0));
+ db_set_b(0, MODULENAME, buf, customFilters[i].onlyIncomming ? 1 : (customFilters[i].onlyOutgoing ? 2 : 0));
std::string events;
for (std::vector<int>::iterator it = customFilters[i].events.begin(); it != customFilters[i].events.end(); ++it) {
_itoa_s(*it, buf, 16);
@@ -471,24 +471,24 @@ void Options::Save() }
mir_snprintf(buf, "filterEvents_%d", i);
- db_set_s(0, MODULE, buf, events.c_str());
+ db_set_s(0, MODULENAME, buf, events.c_str());
}
- db_set_dw(0, MODULE, "codepageTxt", codepageTxt);
- db_set_dw(0, MODULE, "codepageHtml1", codepageHtml1);
- db_set_dw(0, MODULE, "codepageHtml2", codepageHtml2);
- db_set_ws(0, MODULE, "encodingTxt", encodingTxt.c_str());
- db_set_ws(0, MODULE, "encodingHtml1", encodingHtml1.c_str());
- db_set_ws(0, MODULE, "encodingHtml2", encodingHtml2.c_str());
- db_set_b(0, MODULE, "exportHtml1ShowDate", exportHtml1ShowDate ? 1 : 0);
- db_set_b(0, MODULE, "exportHtml2ShowDate", exportHtml2ShowDate ? 1 : 0);
- db_set_b(0, MODULE, "exportHtml2UseSmileys", exportHtml2UseSmileys ? 1 : 0);
- db_set_ws(0, MODULE, "extCssHtml2", extCssHtml2.c_str());
- db_set_ws(0, MODULE, "ftpLogPath", ftpLogPath.c_str());
+ db_set_dw(0, MODULENAME, "codepageTxt", codepageTxt);
+ db_set_dw(0, MODULENAME, "codepageHtml1", codepageHtml1);
+ db_set_dw(0, MODULENAME, "codepageHtml2", codepageHtml2);
+ db_set_ws(0, MODULENAME, "encodingTxt", encodingTxt.c_str());
+ db_set_ws(0, MODULENAME, "encodingHtml1", encodingHtml1.c_str());
+ db_set_ws(0, MODULENAME, "encodingHtml2", encodingHtml2.c_str());
+ db_set_b(0, MODULENAME, "exportHtml1ShowDate", exportHtml1ShowDate ? 1 : 0);
+ db_set_b(0, MODULENAME, "exportHtml2ShowDate", exportHtml2ShowDate ? 1 : 0);
+ db_set_b(0, MODULENAME, "exportHtml2UseSmileys", exportHtml2UseSmileys ? 1 : 0);
+ db_set_ws(0, MODULENAME, "extCssHtml2", extCssHtml2.c_str());
+ db_set_ws(0, MODULENAME, "ftpLogPath", ftpLogPath.c_str());
if (ftpExePath != ftpExePathDef)
- db_set_ws(0, MODULE, "ftpExePath", ftpExePath.c_str());
+ db_set_ws(0, MODULENAME, "ftpExePath", ftpExePath.c_str());
else
- db_unset(0, MODULE, "ftpExePath");
+ db_unset(0, MODULENAME, "ftpExePath");
}
void Options::SaveTasks(std::list<TaskOptions>* tasks)
@@ -500,110 +500,110 @@ void Options::SaveTasks(std::list<TaskOptions>* tasks) char buf[256];
for (std::list<TaskOptions>::iterator it = tasks->begin(); it != tasks->end(); ++it) {
mir_snprintf(buf, "Task_compress_%d", i);
- db_set_b(0, MODULE, buf, it->compress);
+ db_set_b(0, MODULENAME, buf, it->compress);
mir_snprintf(buf, "Task_useFtp_%d", i);
- db_set_b(0, MODULE, buf, it->useFtp);
+ db_set_b(0, MODULENAME, buf, it->useFtp);
mir_snprintf(buf, "Task_isSystem_%d", i);
- db_set_b(0, MODULE, buf, it->isSystem);
+ db_set_b(0, MODULENAME, buf, it->isSystem);
mir_snprintf(buf, "Task_active_%d", i);
- db_set_b(0, MODULE, buf, it->active);
+ db_set_b(0, MODULENAME, buf, it->active);
mir_snprintf(buf, "Task_exportImported_%d", i);
- db_set_b(0, MODULE, buf, it->exportImported);
+ db_set_b(0, MODULENAME, buf, it->exportImported);
mir_snprintf(buf, "Task_type_%d", i);
- db_set_b(0, MODULE, buf, it->type);
+ db_set_b(0, MODULENAME, buf, it->type);
mir_snprintf(buf, "Task_eventUnit_%d", i);
- db_set_b(0, MODULE, buf, it->eventUnit);
+ db_set_b(0, MODULENAME, buf, it->eventUnit);
mir_snprintf(buf, "Task_trigerType_%d", i);
- db_set_b(0, MODULE, buf, it->trigerType);
+ db_set_b(0, MODULENAME, buf, it->trigerType);
mir_snprintf(buf, "Task_exportType_%d", i);
- db_set_b(0, MODULE, buf, it->exportType);
+ db_set_b(0, MODULENAME, buf, it->exportType);
mir_snprintf(buf, "Task_importType_%d", i);
- db_set_b(0, MODULE, buf, it->importType);
+ db_set_b(0, MODULENAME, buf, it->importType);
mir_snprintf(buf, "Task_eventDeltaTime_%d", i);
- db_set_dw(0, MODULE, buf, it->eventDeltaTime);
+ db_set_dw(0, MODULENAME, buf, it->eventDeltaTime);
mir_snprintf(buf, "Task_filterId_%d", i);
- db_set_dw(0, MODULE, buf, it->filterId);
+ db_set_dw(0, MODULENAME, buf, it->filterId);
mir_snprintf(buf, "Task_dayTime_%d", i);
- db_set_dw(0, MODULE, buf, it->dayTime);
+ db_set_dw(0, MODULENAME, buf, it->dayTime);
mir_snprintf(buf, "Task_dayOfWeek_%d", i);
- db_set_dw(0, MODULE, buf, it->dayOfWeek);
+ db_set_dw(0, MODULENAME, buf, it->dayOfWeek);
mir_snprintf(buf, "Task_dayOfMonth_%d", i);
- db_set_dw(0, MODULE, buf, it->dayOfMonth);
+ db_set_dw(0, MODULENAME, buf, it->dayOfMonth);
mir_snprintf(buf, "Task_deltaTime_%d", i);
- db_set_dw(0, MODULE, buf, it->deltaTime);
+ db_set_dw(0, MODULENAME, buf, it->deltaTime);
mir_snprintf(buf, "Task_lastExport_low_%d", i);
- db_set_dw(0, MODULE, buf, (int)it->lastExport);
+ db_set_dw(0, MODULENAME, buf, (int)it->lastExport);
mir_snprintf(buf, "Task_lastExport_hi_%d", i);
- db_set_dw(0, MODULE, buf, ((unsigned long long int)it->lastExport) >> 32);
+ db_set_dw(0, MODULENAME, buf, ((unsigned long long int)it->lastExport) >> 32);
mir_snprintf(buf, "Task_ftpName_%d", i);
- db_set_ws(0, MODULE, buf, it->ftpName.c_str());
+ db_set_ws(0, MODULENAME, buf, it->ftpName.c_str());
mir_snprintf(buf, "Task_filterName_%d", i);
- db_set_ws(0, MODULE, buf, it->filterName.c_str());
+ db_set_ws(0, MODULENAME, buf, it->filterName.c_str());
mir_snprintf(buf, "Task_filePath_%d", i);
- db_set_ws(0, MODULE, buf, it->filePath.c_str());
+ db_set_ws(0, MODULENAME, buf, it->filePath.c_str());
mir_snprintf(buf, "Task_taskName_%d", i);
- db_set_ws(0, MODULE, buf, it->taskName.c_str());
+ db_set_ws(0, MODULENAME, buf, it->taskName.c_str());
mir_snprintf(buf, "Task_zipPassword_%d", i);
- db_set_s(0, MODULE, buf, it->zipPassword.c_str());
+ db_set_s(0, MODULENAME, buf, it->zipPassword.c_str());
mir_snprintf(buf, "IsInTask_%d", i);
for (auto &hContact : Contacts())
- db_unset(hContact, MODULE, buf);
+ db_unset(hContact, MODULENAME, buf);
for (size_t j = 0; j < it->contacts.size(); ++j)
- db_set_b(it->contacts[j], MODULE, buf, 1);
+ db_set_b(it->contacts[j], MODULENAME, buf, 1);
it->orderNr = i++;
taskOptions.push_back(*it);
}
- db_set_dw(0, MODULE, "Task_count", i);
+ db_set_dw(0, MODULENAME, "Task_count", i);
for (i = (int)tasks->size(); i < oldTaskNr; ++i) {
mir_snprintf(buf, "Task_compress_%d", i);
- db_unset(NULL, MODULE, buf);
+ db_unset(NULL, MODULENAME, buf);
mir_snprintf(buf, "Task_useFtp_%d", i);
- db_unset(NULL, MODULE, buf);
+ db_unset(NULL, MODULENAME, buf);
mir_snprintf(buf, "Task_isSystem_%d", i);
- db_unset(NULL, MODULE, buf);
+ db_unset(NULL, MODULENAME, buf);
mir_snprintf(buf, "Task_active_%d", i);
- db_unset(NULL, MODULE, buf);
+ db_unset(NULL, MODULENAME, buf);
mir_snprintf(buf, "Task_type_%d", i);
- db_unset(NULL, MODULE, buf);
+ db_unset(NULL, MODULENAME, buf);
mir_snprintf(buf, "Task_eventUnit_%d", i);
- db_unset(NULL, MODULE, buf);
+ db_unset(NULL, MODULENAME, buf);
mir_snprintf(buf, "Task_trigerType_%d", i);
- db_unset(NULL, MODULE, buf);
+ db_unset(NULL, MODULENAME, buf);
mir_snprintf(buf, "Task_exportType_%d", i);
- db_unset(NULL, MODULE, buf);
+ db_unset(NULL, MODULENAME, buf);
mir_snprintf(buf, "Task_eventDeltaTime_%d", i);
- db_unset(NULL, MODULE, buf);
+ db_unset(NULL, MODULENAME, buf);
mir_snprintf(buf, "Task_filterId_%d", i);
- db_unset(NULL, MODULE, buf);
+ db_unset(NULL, MODULENAME, buf);
mir_snprintf(buf, "Task_dayTime_%d", i);
- db_unset(NULL, MODULE, buf);
+ db_unset(NULL, MODULENAME, buf);
mir_snprintf(buf, "Task_dayOfWeek_%d", i);
- db_unset(NULL, MODULE, buf);
+ db_unset(NULL, MODULENAME, buf);
mir_snprintf(buf, "Task_dayOfMonth_%d", i);
- db_unset(NULL, MODULE, buf);
+ db_unset(NULL, MODULENAME, buf);
mir_snprintf(buf, "Task_deltaTime_%d", i);
- db_unset(NULL, MODULE, buf);
+ db_unset(NULL, MODULENAME, buf);
mir_snprintf(buf, "Task_lastExport_low_%d", i);
- db_unset(NULL, MODULE, buf);
+ db_unset(NULL, MODULENAME, buf);
mir_snprintf(buf, "Task_lastExport_hi_%d", i);
- db_unset(NULL, MODULE, buf);
+ db_unset(NULL, MODULENAME, buf);
mir_snprintf(buf, "Task_ftpName_%d", i);
- db_unset(NULL, MODULE, buf);
+ db_unset(NULL, MODULENAME, buf);
mir_snprintf(buf, "Task_filterName_%d", i);
- db_unset(NULL, MODULE, buf);
+ db_unset(NULL, MODULENAME, buf);
mir_snprintf(buf, "Task_filePath_%d", i);
- db_unset(NULL, MODULE, buf);
+ db_unset(NULL, MODULENAME, buf);
mir_snprintf(buf, "Task_taskName_%d", i);
- db_unset(NULL, MODULE, buf);
+ db_unset(NULL, MODULENAME, buf);
mir_snprintf(buf, "IsInTask_%d", i);
for (auto &hContact : Contacts())
- db_unset(hContact, MODULE, buf);
+ db_unset(hContact, MODULENAME, buf);
}
}
@@ -612,84 +612,84 @@ void Options::SaveTaskTime(TaskOptions& to) int i = to.orderNr;
char buf[256];
mir_snprintf(buf, "Task_lastExport_low_%d", i);
- db_set_dw(0, MODULE, buf, (int)to.lastExport);
+ db_set_dw(0, MODULENAME, buf, (int)to.lastExport);
mir_snprintf(buf, "Task_lastExport_hi_%d", i);
- db_set_dw(0, MODULE, buf, ((unsigned long long int)to.lastExport) >> 32);
+ db_set_dw(0, MODULENAME, buf, ((unsigned long long int)to.lastExport) >> 32);
}
void Options::LoadTasks()
{
- int taskCount = db_get_dw(0, MODULE, "Task_count", 0);
+ int taskCount = db_get_dw(0, MODULENAME, "Task_count", 0);
char buf[256];
for (int i = 0; i < taskCount; ++i) {
TaskOptions to;
mir_snprintf(buf, "Task_compress_%d", i);
- to.compress = db_get_b(0, MODULE, buf, to.compress) != 0;
+ to.compress = db_get_b(0, MODULENAME, buf, to.compress) != 0;
mir_snprintf(buf, "Task_useFtp_%d", i);
- to.useFtp = db_get_b(0, MODULE, buf, to.useFtp) != 0;
+ to.useFtp = db_get_b(0, MODULENAME, buf, to.useFtp) != 0;
mir_snprintf(buf, "Task_isSystem_%d", i);
- to.isSystem = db_get_b(0, MODULE, buf, to.isSystem) != 0;
+ to.isSystem = db_get_b(0, MODULENAME, buf, to.isSystem) != 0;
mir_snprintf(buf, "Task_active_%d", i);
- to.active = db_get_b(0, MODULE, buf, to.active) != 0;
+ to.active = db_get_b(0, MODULENAME, buf, to.active) != 0;
mir_snprintf(buf, "Task_exportImported_%d", i);
- to.exportImported = db_get_b(0, MODULE, buf, to.exportImported) != 0;
+ to.exportImported = db_get_b(0, MODULENAME, buf, to.exportImported) != 0;
mir_snprintf(buf, "Task_type_%d", i);
- to.type = (TaskOptions::TaskType)db_get_b(0, MODULE, buf, to.type);
+ to.type = (TaskOptions::TaskType)db_get_b(0, MODULENAME, buf, to.type);
mir_snprintf(buf, "Task_eventUnit_%d", i);
- to.eventUnit = (TaskOptions::EventUnit)db_get_b(0, MODULE, buf, to.eventUnit);
+ to.eventUnit = (TaskOptions::EventUnit)db_get_b(0, MODULENAME, buf, to.eventUnit);
mir_snprintf(buf, "Task_trigerType_%d", i);
- to.trigerType = (TaskOptions::TrigerType)db_get_b(0, MODULE, buf, to.trigerType);
+ to.trigerType = (TaskOptions::TrigerType)db_get_b(0, MODULENAME, buf, to.trigerType);
mir_snprintf(buf, "Task_exportType_%d", i);
- to.exportType = (IExport::ExportType)db_get_b(0, MODULE, buf, to.exportType);
+ to.exportType = (IExport::ExportType)db_get_b(0, MODULENAME, buf, to.exportType);
mir_snprintf(buf, "Task_importType_%d", i);
- to.importType = (IImport::ImportType)db_get_b(0, MODULE, buf, to.importType);
+ to.importType = (IImport::ImportType)db_get_b(0, MODULENAME, buf, to.importType);
mir_snprintf(buf, "Task_eventDeltaTime_%d", i);
- to.eventDeltaTime = db_get_dw(0, MODULE, buf, to.eventDeltaTime);
+ to.eventDeltaTime = db_get_dw(0, MODULENAME, buf, to.eventDeltaTime);
mir_snprintf(buf, "Task_filterId_%d", i);
- to.filterId = db_get_dw(0, MODULE, buf, to.filterId);
+ to.filterId = db_get_dw(0, MODULENAME, buf, to.filterId);
mir_snprintf(buf, "Task_dayTime_%d", i);
- to.dayTime = db_get_dw(0, MODULE, buf, to.dayTime);
+ to.dayTime = db_get_dw(0, MODULENAME, buf, to.dayTime);
mir_snprintf(buf, "Task_dayOfWeek_%d", i);
- to.dayOfWeek = db_get_dw(0, MODULE, buf, to.dayOfWeek);
+ to.dayOfWeek = db_get_dw(0, MODULENAME, buf, to.dayOfWeek);
mir_snprintf(buf, "Task_dayOfMonth_%d", i);
- to.dayOfMonth = db_get_dw(0, MODULE, buf, to.dayOfMonth);
+ to.dayOfMonth = db_get_dw(0, MODULENAME, buf, to.dayOfMonth);
mir_snprintf(buf, "Task_deltaTime_%d", i);
- to.deltaTime = db_get_dw(0, MODULE, buf, to.deltaTime);
+ to.deltaTime = db_get_dw(0, MODULENAME, buf, to.deltaTime);
unsigned long long int le = to.lastExport;
mir_snprintf(buf, "Task_lastExport_low_%d", i);
- to.lastExport = db_get_dw(0, MODULE, buf, (int)le) & 0xffffffff;
+ to.lastExport = db_get_dw(0, MODULENAME, buf, (int)le) & 0xffffffff;
mir_snprintf(buf, "Task_lastExport_hi_%d", i);
- to.lastExport |= ((unsigned long long int)db_get_dw(0, MODULE, buf, le >> 32)) << 32;
+ to.lastExport |= ((unsigned long long int)db_get_dw(0, MODULENAME, buf, le >> 32)) << 32;
mir_snprintf(buf, "Task_ftpName_%d", i);
DBVARIANT var;
- if (!db_get_ws(0, MODULE, buf, &var)) {
+ if (!db_get_ws(0, MODULENAME, buf, &var)) {
to.ftpName = var.ptszVal;
db_free(&var);
}
mir_snprintf(buf, "Task_filterName_%d", i);
- if (!db_get_ws(0, MODULE, buf, &var)) {
+ if (!db_get_ws(0, MODULENAME, buf, &var)) {
to.filterName = var.ptszVal;
db_free(&var);
}
mir_snprintf(buf, "Task_filePath_%d", i);
- if (!db_get_ws(0, MODULE, buf, &var)) {
+ if (!db_get_ws(0, MODULENAME, buf, &var)) {
to.filePath = var.ptszVal;
db_free(&var);
}
mir_snprintf(buf, "Task_taskName_%d", i);
- if (!db_get_ws(0, MODULE, buf, &var)) {
+ if (!db_get_ws(0, MODULENAME, buf, &var)) {
to.taskName = var.ptszVal;
db_free(&var);
}
mir_snprintf(buf, "Task_zipPassword_%d", i);
- if (!db_get_s(0, MODULE, buf, &var)) {
+ if (!db_get_s(0, MODULENAME, buf, &var)) {
to.zipPassword = var.pszVal;
db_free(&var);
}
mir_snprintf(buf, "IsInTask_%d", i);
for (auto &hContact : Contacts())
- if (db_get_b(hContact, MODULE, buf, 0) == 1)
+ if (db_get_b(hContact, MODULENAME, buf, 0) == 1)
to.contacts.push_back(hContact);
to.orderNr = i;
diff --git a/plugins/BasicHistory/src/Scheduler.cpp b/plugins/BasicHistory/src/Scheduler.cpp index f234d55275..26dfcb3fb2 100644 --- a/plugins/BasicHistory/src/Scheduler.cpp +++ b/plugins/BasicHistory/src/Scheduler.cpp @@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "HistoryWindow.h"
// Sorry for plain C implementation
-#define MODULE "BasicHistory"
+#define MODULENAME "BasicHistory"
extern HANDLE g_hMainThread;
bool bPopupsEnabled;
bool DoTask(TaskOptions& to);
@@ -75,7 +75,7 @@ void InitScheduler() test.hIcon = Skin_LoadIcon(SKINICON_OTHER_HISTORY);
test.iSeconds = 10;
test.pwszDescription = TranslateT("History task");
- test.pszName = MODULE;
+ test.pszName = MODULENAME;
if (hPopupClass = Popup_RegisterClass(&test))
HookEvent(ME_SYSTEM_SHUTDOWN, OnShutdown);
@@ -1281,7 +1281,7 @@ void DoError(const TaskOptions& to, const std::wstring _error) error += _error;
DBEVENTINFO dbei = {};
- dbei.szModule = MODULE;
+ dbei.szModule = MODULENAME;
dbei.flags = DBEF_UTF | DBEF_READ;
dbei.timestamp = time(0);
// For now I do not convert event data from string to blob, and event type must be message to handle it properly
@@ -1299,7 +1299,7 @@ void DoError(const TaskOptions& to, const std::wstring _error) return;
if (ServiceExists(MS_POPUP_ADDPOPUPCLASS))
- ShowClassPopupT(MODULE, msg, (wchar_t*)_error.c_str());
+ ShowClassPopupT(MODULENAME, msg, (wchar_t*)_error.c_str());
else if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
POPUPDATAT ppd = { 0 };
ppd.lchIcon = Skin_LoadIcon(SKINICON_OTHER_HISTORY);
diff --git a/plugins/BasicHistory/src/stdafx.h b/plugins/BasicHistory/src/stdafx.h index ef90fecf03..881e94fc82 100644 --- a/plugins/BasicHistory/src/stdafx.h +++ b/plugins/BasicHistory/src/stdafx.h @@ -90,11 +90,9 @@ HICON LoadIconEx(int iconId, bool big = false);
-#define MODULE "BasicHistory"
+#define MODULENAME "BasicHistory"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE)
- {}
+ CMPlugin();
};
\ No newline at end of file diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp index 6f7564d1e3..81b6ef8de6 100644 --- a/plugins/Boltun/src/boltun.cpp +++ b/plugins/Boltun/src/boltun.cpp @@ -32,7 +32,17 @@ BOOL blInit = FALSE; UINT pTimer = 0;
wchar_t tszPath[MAX_PATH];
-PLUGININFOEX pluginInfo = {
+static HGENMENU hMenuItemAutoChat, hMenuItemNotToChat, hMenuItemStartChatting;
+
+#define MIND_DIALOG_FILTER L"%s (*.mindw)\1*.mindw\1%s (*.*)\1*.*\1"
+
+#ifdef DEBUG_LOAD_TIME
+#include <intrin.h>
+#endif
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -42,16 +52,19 @@ PLUGININFOEX pluginInfo = { __AUTHORWEB,
UNICODE_AWARE,
// {488C5C84-56DA-434F-96F1-B18900DEF760}
- { 0x488c5c84, 0x56da, 0x434f, { 0x96, 0xf1, 0xb1, 0x89, 0x0, 0xde, 0xf7, 0x60 } }
+{ 0x488c5c84, 0x56da, 0x434f,{ 0x96, 0xf1, 0xb1, 0x89, 0x0, 0xde, 0xf7, 0x60 } }
};
-static HGENMENU hMenuItemAutoChat, hMenuItemNotToChat, hMenuItemStartChatting;
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(BOLTUN_KEY, pluginInfoEx)
+{}
-#define MIND_DIALOG_FILTER L"%s (*.mindw)\1*.mindw\1%s (*.*)\1*.*\1"
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
+{
+ return &pluginInfoEx;
+}
-#ifdef DEBUG_LOAD_TIME
-#include <intrin.h>
-#endif
+/////////////////////////////////////////////////////////////////////////////////////////
void UpdateEngine()
{
@@ -156,14 +169,6 @@ static bool LoadMind(const wchar_t* filename, int &line) return true;
}
-/*static bool SaveMind(const wchar_t* filename)
-{
-if (!bot)
-return false;
-bot->GetMind().Save(filename);
-return true;
-}*/
-
static bool BoltunAutoChat(MCONTACT hContact)
{
if (db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT
@@ -513,14 +518,9 @@ static int MessagePrebuild(WPARAM hContact, LPARAM) return 0;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
-{
- return &pluginInfo;
-}
-
extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
GetModuleFileName(g_plugin.getInst(), tszPath, _countof(tszPath));
*(wcsrchr(tszPath, '\\') + 1) = '\0';
@@ -568,6 +568,8 @@ extern "C" int __declspec(dllexport) Load(void) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Unload(void)
{
if (pTimer)
diff --git a/plugins/Boltun/src/stdafx.h b/plugins/Boltun/src/stdafx.h index 03f9929561..274b20a185 100644 --- a/plugins/Boltun/src/stdafx.h +++ b/plugins/Boltun/src/stdafx.h @@ -49,13 +49,11 @@ #include "Engine/MyCodeCvt.h"
#include "Engine/Mind.h"
-#define BOLTUN_KEY "Boltun"
+#define BOLTUN_KEY "Boltun"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(BOLTUN_KEY)
- {}
+ CMPlugin();
};
//Service names
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index ac96a8c0a8..359a5a0f5f 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -43,7 +43,9 @@ PFNDwmIsCompositionEnabled dwmIsCompositionEnabled; static void LanguageChanged(HWND hDlg);
-static PLUGININFOEX pluginInfo = {
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -56,11 +58,17 @@ static PLUGININFOEX pluginInfo = { { 0x4fac353d, 0x0a36, 0x44a4, { 0x90, 0x64, 0x67, 0x59, 0xc5, 0x3a, 0xe7, 0x82 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MOD_NAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
static BOOL IsAeroMode()
{
BOOL result;
@@ -614,7 +622,7 @@ static int EnumProtos(WPARAM, LPARAM) return 0;
}
-int MirandaLoaded(WPARAM, LPARAM)
+static int MirandaLoaded(WPARAM, LPARAM)
{
g_wMask = db_get_w(NULL, MOD_NAME, "optsmask", DEFAULTSETTING);
@@ -681,7 +689,7 @@ int MirandaLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
g_wMaskAdv = db_get_w(NULL, MOD_NAME, "optsmaskadv", 0);
@@ -706,6 +714,8 @@ extern "C" int __declspec(dllexport) Load(void) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Unload(void)
{
UninitIdleTimer();
diff --git a/plugins/BossKeyPlus/src/stdafx.h b/plugins/BossKeyPlus/src/stdafx.h index 5694e71e65..86d29173a2 100644 --- a/plugins/BossKeyPlus/src/stdafx.h +++ b/plugins/BossKeyPlus/src/stdafx.h @@ -51,14 +51,12 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MOD_NAME)
- {}
+ CMPlugin();
};
#define KEY_DOWN(key) ((GetAsyncKeyState(key) & 0x8000) ? (true) : (false))
#define MAXPASSLEN 16
-#define DEFAULTSETTING (OPT_SETONLINEBACK | OPT_DISABLESNDS | OPT_ONLINEONLY | OPT_USEDEFMSG)
+#define DEFAULTSETTING (OPT_SETONLINEBACK | OPT_DISABLESNDS | OPT_ONLINEONLY | OPT_USEDEFMSG)
#define OLD_SOUND 1
#define OLD_POPUP 2
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index 4b8d9fab79..44b2c1b7b7 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -38,7 +38,18 @@ POPUPACTION hideactions[2]; extern int UserinfoInit(WPARAM wparam, LPARAM lparam);
-PLUGININFOEX pluginInfo = {
+static IconItem iconList[] =
+{
+ { LPGEN("Tray/popup icon"), "main_icon", IDI_MAINICON },
+ { LPGEN("Enabled"), "enabled_icon", IDI_ENABLED },
+ { LPGEN("Disabled"), "disabled_icon", IDI_DISABLED },
+ { LPGEN("Hide"), "hide_icon", IDI_HIDE },
+ { LPGEN("Never hide"), "neverhide_icon", IDI_NEVERHIDE }
+};
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -48,28 +59,30 @@ PLUGININFOEX pluginInfo = { __AUTHORWEB,
UNICODE_AWARE,
// {DDF8AEC9-7D37-49AF-9D22-BBBC920E6F05}
- { 0xddf8aec9, 0x7d37, 0x49af, { 0x9d, 0x22, 0xbb, 0xbc, 0x92, 0x0e, 0x6f, 0x05 } }
+ {0xddf8aec9, 0x7d37, 0x49af, {0x9d, 0x22, 0xbb, 0xbc, 0x92, 0x0e, 0x6f, 0x05}}
};
-static IconItem iconList[] =
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- { LPGEN("Tray/popup icon"), "main_icon", IDI_MAINICON },
- { LPGEN("Enabled"), "enabled_icon", IDI_ENABLED },
- { LPGEN("Disabled"), "disabled_icon", IDI_DISABLED },
- { LPGEN("Hide"), "hide_icon", IDI_HIDE },
- { LPGEN("Never hide"), "neverhide_icon", IDI_NEVERHIDE }
-};
+ return &pluginInfoEx;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
time_t getLastSeen(MCONTACT hContact)
{
- return db_get_dw(hContact, MODULE_NAME, "LastSeen", db_get_dw(hContact, MODULE_NAME, "CreationTime", (DWORD)-1));
+ return db_get_dw(hContact, MODULENAME, "LastSeen", db_get_dw(hContact, MODULENAME, "CreationTime", (DWORD)-1));
}
void setLastSeen(MCONTACT hContact)
{
- db_set_dw(hContact, MODULE_NAME, "LastSeen", (DWORD)time(0));
- if (db_get_b(hContact, MODULE_NAME, "StillAbsentNotified", 0))
- db_set_b(hContact, MODULE_NAME, "StillAbsentNotified", 0);
+ db_set_dw(hContact, MODULENAME, "LastSeen", (DWORD)time(0));
+ if (db_get_b(hContact, MODULENAME, "StillAbsentNotified", 0))
+ db_set_b(hContact, MODULENAME, "StillAbsentNotified", 0);
}
time_t getLastInputMsg(MCONTACT hContact)
@@ -100,7 +113,7 @@ LRESULT CALLBACK HidePopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM break;
case WM_CONTEXTMENU:
- db_set_b(PUGetContact(hWnd), MODULE_NAME, "NeverHide", 1);
+ db_set_b(PUGetContact(hWnd), MODULENAME, "NeverHide", 1);
PUDeletePopup(hWnd);
break;
@@ -110,7 +123,7 @@ LRESULT CALLBACK HidePopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM PUDeletePopup(hWnd);
}
if (wParam == 3) {
- db_set_b(PUGetContact(hWnd), MODULE_NAME, "NeverHide", 1);
+ db_set_b(PUGetContact(hWnd), MODULENAME, "NeverHide", 1);
PUDeletePopup(hWnd);
}
break;
@@ -127,8 +140,8 @@ LRESULT CALLBACK MissYouPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA case WM_COMMAND:
if (HIWORD(wParam) == STN_CLICKED) {
CallServiceSync("BuddyExpectator/actionMissYou", (WPARAM)PUGetContact(hWnd), 0);
- if (!db_get_b(PUGetContact(hWnd), MODULE_NAME, "MissYouNotifyAlways", 0)) {
- db_set_b(PUGetContact(hWnd), MODULE_NAME, "MissYou", 0);
+ if (!db_get_b(PUGetContact(hWnd), MODULENAME, "MissYouNotifyAlways", 0)) {
+ db_set_b(PUGetContact(hWnd), MODULENAME, "MissYou", 0);
ExtraIcon_Clear(hExtraIcon, PUGetContact(hWnd));
}
PUDeletePopup(hWnd);
@@ -141,7 +154,7 @@ LRESULT CALLBACK MissYouPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA case UM_POPUPACTION:
if (wParam == 1) {
- db_set_b(PUGetContact(hWnd), MODULE_NAME, "MissYou", 0);
+ db_set_b(PUGetContact(hWnd), MODULENAME, "MissYou", 0);
ExtraIcon_Clear(hExtraIcon, PUGetContact(hWnd));
PUDeletePopup(hWnd);
}
@@ -217,7 +230,7 @@ bool isContactGoneFor(MCONTACT hContact, int days) if (options.hideInactive)
if (daysSinceMessage >= options.iSilencePeriod)
- if (!db_get_b(hContact, "CList", "Hidden", 0) && !db_get_b(hContact, MODULE_NAME, "NeverHide", 0)) {
+ if (!db_get_b(hContact, "CList", "Hidden", 0) && !db_get_b(hContact, MODULENAME, "NeverHide", 0)) {
POPUPDATAT_V2 ppd = { 0 };
ppd.cbSize = sizeof(ppd);
ppd.lchContact = hContact;
@@ -405,12 +418,12 @@ int onIconsChanged(WPARAM, LPARAM) */
INT_PTR MenuMissYouClick(WPARAM hContact, LPARAM)
{
- if (db_get_b(hContact, MODULE_NAME, "MissYou", 0)) {
- db_set_b(hContact, MODULE_NAME, "MissYou", 0);
+ if (db_get_b(hContact, MODULENAME, "MissYou", 0)) {
+ db_set_b(hContact, MODULENAME, "MissYou", 0);
ExtraIcon_Clear(hExtraIcon, hContact);
}
else {
- db_set_b(hContact, MODULE_NAME, "MissYou", 1);
+ db_set_b(hContact, MODULENAME, "MissYou", 1);
ExtraIcon_SetIconByName(hExtraIcon, hContact, "enabled_icon");
}
@@ -426,7 +439,7 @@ int onPrebuildContactMenu(WPARAM hContact, LPARAM) if (!proto)
return 0;
- if (db_get_b(hContact, MODULE_NAME, "MissYou", 0))
+ if (db_get_b(hContact, MODULENAME, "MissYou", 0))
Menu_ModifyItem(hContactMenu, LPGENW("Disable Miss You"), iconList[1].hIcolib);
else
Menu_ModifyItem(hContactMenu, LPGENW("Enable Miss You"), iconList[2].hIcolib);
@@ -437,7 +450,7 @@ int onPrebuildContactMenu(WPARAM hContact, LPARAM) int onExtraImageApplying(WPARAM hContact, LPARAM)
{
- if (db_get_b(hContact, MODULE_NAME, "MissYou", 0))
+ if (db_get_b(hContact, MODULENAME, "MissYou", 0))
ExtraIcon_SetIconByName(hExtraIcon, hContact, "enabled_icon");
return 0;
@@ -467,10 +480,10 @@ int SettingChanged(WPARAM hContact, LPARAM lParam) return 0;
// Last status
- db_set_dw(hContact, MODULE_NAME, "LastStatus", prevStatus);
+ db_set_dw(hContact, MODULENAME, "LastStatus", prevStatus);
if (prevStatus == ID_STATUS_OFFLINE) {
- if (db_get_b(hContact, MODULE_NAME, "MissYou", 0)) {
+ if (db_get_b(hContact, MODULENAME, "MissYou", 0)) {
// Display Popup
POPUPDATAT_V2 ppd = { 0 };
ppd.cbSize = sizeof(ppd);
@@ -502,12 +515,12 @@ int SettingChanged(WPARAM hContact, LPARAM lParam) return 0;
}
- if (db_get_dw(hContact, MODULE_NAME, "LastSeen", (DWORD)-1) == (DWORD)-1 && options.notifyFirstOnline) {
+ if (db_get_dw(hContact, MODULENAME, "LastSeen", (DWORD)-1) == (DWORD)-1 && options.notifyFirstOnline) {
ReturnNotify(hContact, TranslateT("has gone online for the first time."));
setLastSeen(hContact);
}
- unsigned int AbsencePeriod = db_get_dw(hContact, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod);
+ unsigned int AbsencePeriod = db_get_dw(hContact, MODULENAME, "iAbsencePeriod", options.iAbsencePeriod);
if (isContactGoneFor(hContact, AbsencePeriod)) {
wchar_t* message = TranslateT("has returned after a long absence.");
wchar_t tmpBuf[251] = { 0 };
@@ -538,9 +551,9 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) {
for (auto &hContact : Contacts()) {
char *proto = GetContactProto(hContact);
- if (proto && (db_get_b(hContact, proto, "ChatRoom", 0) == 0) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND) && isContactGoneFor(hContact, options.iAbsencePeriod2) && (db_get_b(hContact, MODULE_NAME, "StillAbsentNotified", 0) == 0))
+ if (proto && (db_get_b(hContact, proto, "ChatRoom", 0) == 0) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND) && isContactGoneFor(hContact, options.iAbsencePeriod2) && (db_get_b(hContact, MODULENAME, "StillAbsentNotified", 0) == 0))
{
- db_set_b(hContact, MODULE_NAME, "StillAbsentNotified", 1);
+ db_set_b(hContact, MODULENAME, "StillAbsentNotified", 1);
Skin_PlaySound("buddyExpectatorStillAbsent");
wchar_t* message = TranslateT("has not returned after a long absence.");
@@ -627,14 +640,9 @@ int ModulesLoaded(WPARAM, LPARAM) return 0;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
-{
- return &pluginInfo;
-}
-
int ContactAdded(WPARAM hContact, LPARAM)
{
- db_set_dw(hContact, MODULE_NAME, "CreationTime", (DWORD)time(0));
+ db_set_dw(hContact, MODULENAME, "CreationTime", (DWORD)time(0));
return 0;
}
@@ -646,7 +654,7 @@ int onShutdown(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
InitOptions();
@@ -667,10 +675,10 @@ extern "C" int __declspec(dllexport) Load(void) DWORD current_time = (DWORD)time(0);
for (auto &hContact : Contacts()) {
- if (!db_get(hContact, MODULE_NAME, "CreationTime", &dbv))
+ if (!db_get(hContact, MODULENAME, "CreationTime", &dbv))
db_free(&dbv);
else
- db_set_dw(hContact, MODULE_NAME, "CreationTime", current_time);
+ db_set_dw(hContact, MODULENAME, "CreationTime", current_time);
}
g_plugin.registerIcon("BuddyExpectator", iconList);
diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp index 576fabd1dd..34f4b98bf9 100644 --- a/plugins/BuddyExpectator/src/options.cpp +++ b/plugins/BuddyExpectator/src/options.cpp @@ -32,57 +32,57 @@ Options options; void LoadOptions()
{
- options.iAbsencePeriod = db_get_dw(NULL, MODULE_NAME, "iAbsencePeriod", 14);
- options.iAbsencePeriod2 = db_get_dw(NULL, MODULE_NAME, "iAbsencePeriod2", 30 * 3);
- options.iSilencePeriod = db_get_dw(NULL, MODULE_NAME, "iSilencePeriod", 30);
-
- options.iShowPopup = db_get_b(NULL, MODULE_NAME, "iShowPopUp", 1);
- options.iShowEvent = db_get_b(NULL, MODULE_NAME, "iShowEvent", 0);
- options.iShowUDetails = db_get_b(NULL, MODULE_NAME, "iShowUDetails", 0);
- options.iShowMessageWindow = db_get_b(NULL, MODULE_NAME, "iShowMessageWindow", 1);
-
- options.iPopupColorBack = db_get_dw(NULL, MODULE_NAME, "iPopUpColorBack", DEF_COLOR_BACK);
- options.iPopupColorFore = db_get_dw(NULL, MODULE_NAME, "iPopUpColorFore", DEF_COLOR_FORE);
-
- options.iUsePopupColors = db_get_b(NULL, MODULE_NAME, "iUsePopupColors", 0);
- options.iUseWinColors = db_get_b(NULL, MODULE_NAME, "iUseWinColors", 0);
- options.iPopupDelay = db_get_b(NULL, MODULE_NAME, "iPopUpDelay", 0);
-
- options.iShowPopup2 = db_get_b(NULL, MODULE_NAME, "iShowPopUp2", 1);
- options.iShowEvent2 = db_get_b(NULL, MODULE_NAME, "iShowEvent2", 0);
- options.action2 = (GoneContactAction)db_get_b(NULL, MODULE_NAME, "Action2", (BYTE)GCA_NOACTION);
- options.notifyFirstOnline = db_get_b(NULL, MODULE_NAME, "bShowFirstSight", 0) ? true : false;
- options.hideInactive = db_get_b(NULL, MODULE_NAME, "bHideInactive", 0) ? true : false;
- options.enableMissYou = db_get_b(NULL, MODULE_NAME, "bMissYouEnabled", 1) ? true : false;
+ options.iAbsencePeriod = db_get_dw(NULL, MODULENAME, "iAbsencePeriod", 14);
+ options.iAbsencePeriod2 = db_get_dw(NULL, MODULENAME, "iAbsencePeriod2", 30 * 3);
+ options.iSilencePeriod = db_get_dw(NULL, MODULENAME, "iSilencePeriod", 30);
+
+ options.iShowPopup = db_get_b(NULL, MODULENAME, "iShowPopUp", 1);
+ options.iShowEvent = db_get_b(NULL, MODULENAME, "iShowEvent", 0);
+ options.iShowUDetails = db_get_b(NULL, MODULENAME, "iShowUDetails", 0);
+ options.iShowMessageWindow = db_get_b(NULL, MODULENAME, "iShowMessageWindow", 1);
+
+ options.iPopupColorBack = db_get_dw(NULL, MODULENAME, "iPopUpColorBack", DEF_COLOR_BACK);
+ options.iPopupColorFore = db_get_dw(NULL, MODULENAME, "iPopUpColorFore", DEF_COLOR_FORE);
+
+ options.iUsePopupColors = db_get_b(NULL, MODULENAME, "iUsePopupColors", 0);
+ options.iUseWinColors = db_get_b(NULL, MODULENAME, "iUseWinColors", 0);
+ options.iPopupDelay = db_get_b(NULL, MODULENAME, "iPopUpDelay", 0);
+
+ options.iShowPopup2 = db_get_b(NULL, MODULENAME, "iShowPopUp2", 1);
+ options.iShowEvent2 = db_get_b(NULL, MODULENAME, "iShowEvent2", 0);
+ options.action2 = (GoneContactAction)db_get_b(NULL, MODULENAME, "Action2", (BYTE)GCA_NOACTION);
+ options.notifyFirstOnline = db_get_b(NULL, MODULENAME, "bShowFirstSight", 0) ? true : false;
+ options.hideInactive = db_get_b(NULL, MODULENAME, "bHideInactive", 0) ? true : false;
+ options.enableMissYou = db_get_b(NULL, MODULENAME, "bMissYouEnabled", 1) ? true : false;
}
void SaveOptions()
{
- db_set_dw(NULL, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod);
- db_set_dw(NULL, MODULE_NAME, "iAbsencePeriod2", options.iAbsencePeriod2);
- db_set_dw(NULL, MODULE_NAME, "iSilencePeriod", options.iSilencePeriod);
-
- db_set_b(NULL, MODULE_NAME, "iShowPopUp", options.iShowPopup);
- db_set_b(NULL, MODULE_NAME, "iShowEvent", options.iShowEvent);
- db_set_b(NULL, MODULE_NAME, "iShowUDetails", options.iShowUDetails);
- db_set_b(NULL, MODULE_NAME, "iShowMessageWindow", options.iShowMessageWindow);
-
- db_set_b(NULL, MODULE_NAME, "iShowPopUp2", options.iShowPopup2);
- db_set_b(NULL, MODULE_NAME, "iShowEvent2", options.iShowEvent2);
- db_set_b(NULL, MODULE_NAME, "Action2", (BYTE)options.action2);
- db_set_b(NULL, MODULE_NAME, "bShowFirstSight", options.notifyFirstOnline ? 1 : 0);
- db_set_b(NULL, MODULE_NAME, "bHideInactive", options.hideInactive ? 1 : 0);
- db_set_b(NULL, MODULE_NAME, "bMissYouEnabled", options.enableMissYou ? 1 : 0);
+ db_set_dw(NULL, MODULENAME, "iAbsencePeriod", options.iAbsencePeriod);
+ db_set_dw(NULL, MODULENAME, "iAbsencePeriod2", options.iAbsencePeriod2);
+ db_set_dw(NULL, MODULENAME, "iSilencePeriod", options.iSilencePeriod);
+
+ db_set_b(NULL, MODULENAME, "iShowPopUp", options.iShowPopup);
+ db_set_b(NULL, MODULENAME, "iShowEvent", options.iShowEvent);
+ db_set_b(NULL, MODULENAME, "iShowUDetails", options.iShowUDetails);
+ db_set_b(NULL, MODULENAME, "iShowMessageWindow", options.iShowMessageWindow);
+
+ db_set_b(NULL, MODULENAME, "iShowPopUp2", options.iShowPopup2);
+ db_set_b(NULL, MODULENAME, "iShowEvent2", options.iShowEvent2);
+ db_set_b(NULL, MODULENAME, "Action2", (BYTE)options.action2);
+ db_set_b(NULL, MODULENAME, "bShowFirstSight", options.notifyFirstOnline ? 1 : 0);
+ db_set_b(NULL, MODULENAME, "bHideInactive", options.hideInactive ? 1 : 0);
+ db_set_b(NULL, MODULENAME, "bMissYouEnabled", options.enableMissYou ? 1 : 0);
}
void SavePopupOptions()
{
- db_set_dw(NULL, MODULE_NAME, "iPopUpColorBack", options.iPopupColorBack);
- db_set_dw(NULL, MODULE_NAME, "iPopUpColorFore", options.iPopupColorFore);
+ db_set_dw(NULL, MODULENAME, "iPopUpColorBack", options.iPopupColorBack);
+ db_set_dw(NULL, MODULENAME, "iPopUpColorFore", options.iPopupColorFore);
- db_set_b(NULL, MODULE_NAME, "iUsePopupColors", options.iUsePopupColors);
- db_set_b(NULL, MODULE_NAME, "iUseWinColors", options.iUseWinColors);
- db_set_b(NULL, MODULE_NAME, "iPopUpDelay", options.iPopupDelay);
+ db_set_b(NULL, MODULENAME, "iUsePopupColors", options.iUsePopupColors);
+ db_set_b(NULL, MODULENAME, "iUseWinColors", options.iUseWinColors);
+ db_set_b(NULL, MODULENAME, "iPopUpDelay", options.iPopupDelay);
}
/**
@@ -247,8 +247,8 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, // clear all notified settings
for (auto &hContact : Contacts())
- if (db_get_b(hContact, MODULE_NAME, "StillAbsentNotified", 0))
- db_set_b(hContact, MODULE_NAME, "StillAbsentNotified", 0);
+ if (db_get_b(hContact, MODULENAME, "StillAbsentNotified", 0))
+ db_set_b(hContact, MODULENAME, "StillAbsentNotified", 0);
// restart timer & run check
KillTimer(nullptr, timer_id);
@@ -473,7 +473,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar SetDlgItemText(hdlg, IDC_EDIT_LASTINPUT, tmpBuf);
}
- unsigned int AbsencePeriod = db_get_dw((MCONTACT)lparam, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod);
+ unsigned int AbsencePeriod = db_get_dw((MCONTACT)lparam, MODULENAME, "iAbsencePeriod", options.iAbsencePeriod);
SendDlgItemMessage(hdlg, IDC_SPINABSENCE, UDM_SETRANGE, 0, MAKELONG(999, 1));
SetDlgItemInt(hdlg, IDC_EDITABSENCE, AbsencePeriod, FALSE);
@@ -483,9 +483,9 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar else
SetDlgItemText(hdlg, IDC_EDIT_WILLNOTICE, L"");
- CheckDlgButton(hdlg, IDC_CHECK_MISSYOU, db_get_b((MCONTACT)lparam, MODULE_NAME, "MissYou", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hdlg, IDC_CHECK_NOTIFYALWAYS, db_get_b((MCONTACT)lparam, MODULE_NAME, "MissYouNotifyAlways", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hdlg, IDC_CHECK_NEVERHIDE, db_get_b((MCONTACT)lparam, MODULE_NAME, "NeverHide", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hdlg, IDC_CHECK_MISSYOU, db_get_b((MCONTACT)lparam, MODULENAME, "MissYou", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hdlg, IDC_CHECK_NOTIFYALWAYS, db_get_b((MCONTACT)lparam, MODULENAME, "MissYouNotifyAlways", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hdlg, IDC_CHECK_NEVERHIDE, db_get_b((MCONTACT)lparam, MODULENAME, "NeverHide", 0) ? BST_CHECKED : BST_UNCHECKED);
TranslateDialogDefault(hdlg);
return TRUE;
@@ -502,10 +502,10 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar MCONTACT hContact = (MCONTACT)((LPPSHNOTIFY)lparam)->lParam;
if (hContact)
{
- db_set_dw(hContact, MODULE_NAME, "iAbsencePeriod", GetDlgItemInt(hdlg, IDC_EDITABSENCE, nullptr, FALSE));
- db_set_b(hContact, MODULE_NAME, "MissYou", (IsDlgButtonChecked(hdlg, IDC_CHECK_MISSYOU) == BST_CHECKED) ? 1 : 0);
- db_set_b(hContact, MODULE_NAME, "MissYouNotifyAlways", (IsDlgButtonChecked(hdlg, IDC_CHECK_NOTIFYALWAYS) == BST_CHECKED) ? 1 : 0);
- db_set_b(hContact, MODULE_NAME, "NeverHide", (IsDlgButtonChecked(hdlg, IDC_CHECK_NEVERHIDE) == BST_CHECKED) ? 1 : 0);
+ db_set_dw(hContact, MODULENAME, "iAbsencePeriod", GetDlgItemInt(hdlg, IDC_EDITABSENCE, nullptr, FALSE));
+ db_set_b(hContact, MODULENAME, "MissYou", (IsDlgButtonChecked(hdlg, IDC_CHECK_MISSYOU) == BST_CHECKED) ? 1 : 0);
+ db_set_b(hContact, MODULENAME, "MissYouNotifyAlways", (IsDlgButtonChecked(hdlg, IDC_CHECK_NOTIFYALWAYS) == BST_CHECKED) ? 1 : 0);
+ db_set_b(hContact, MODULENAME, "NeverHide", (IsDlgButtonChecked(hdlg, IDC_CHECK_NEVERHIDE) == BST_CHECKED) ? 1 : 0);
}
break;
}
diff --git a/plugins/BuddyExpectator/src/stdafx.h b/plugins/BuddyExpectator/src/stdafx.h index ba7a01892f..73eef9d564 100644 --- a/plugins/BuddyExpectator/src/stdafx.h +++ b/plugins/BuddyExpectator/src/stdafx.h @@ -45,13 +45,11 @@ #include "options.h"
#include "version.h"
-#define MODULE_NAME "BuddyExpectator"
+#define MODULENAME "BuddyExpectator"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE_NAME)
- {}
+ CMPlugin();
};
extern HANDLE hExtraIcon;
diff --git a/plugins/BuddyPounce/src/dialog.cpp b/plugins/BuddyPounce/src/dialog.cpp index 714a392324..727d9107d1 100644 --- a/plugins/BuddyPounce/src/dialog.cpp +++ b/plugins/BuddyPounce/src/dialog.cpp @@ -28,7 +28,7 @@ void populateContacts(MCONTACT BPhContact, HWND hwnd2CB) void saveLastSetting(MCONTACT hContact, HWND hwnd)
{
wchar_t number[8];//, string[1024];//for sending file name
- switch (db_get_b(hContact, modname, "LastSetting", 2)) { // nothing to do
+ switch (db_get_b(hContact, MODULENAME, "LastSetting", 2)) { // nothing to do
case 0: // Send If My Status Is...
break;
case 1: // Send If They Change status to
@@ -38,18 +38,18 @@ void saveLastSetting(MCONTACT hContact, HWND hwnd) break;
case 3: // Reuse Pounce
GetDlgItemText(hwnd, IDC_SETTINGNUMBER, number, _countof(number));
- db_set_b(hContact, modname, "Reuse", (BYTE)_wtoi(number));
+ db_set_b(hContact, MODULENAME, "Reuse", (BYTE)_wtoi(number));
break;
case 4: // Give Up delay
GetDlgItemText(hwnd, IDC_SETTINGNUMBER, number, _countof(number));
- db_set_b(hContact, modname, "GiveUpDays", (BYTE)_wtoi(number));
+ db_set_b(hContact, MODULENAME, "GiveUpDays", (BYTE)_wtoi(number));
{
- db_set_dw(hContact, modname, "GiveUpDate", (DWORD)(_wtoi(number)*SECONDSINADAY));
+ db_set_dw(hContact, MODULENAME, "GiveUpDate", (DWORD)(_wtoi(number)*SECONDSINADAY));
}
break;
case 5: // confirm window
GetDlgItemText(hwnd, IDC_SETTINGNUMBER, number, _countof(number));
- db_set_w(hContact, modname, "ConfirmTimeout", (WORD)_wtoi(number));
+ db_set_w(hContact, MODULENAME, "ConfirmTimeout", (WORD)_wtoi(number));
break;
}
}
@@ -65,11 +65,11 @@ void hideAll(HWND hwnd) void getDefaultMessage(HWND hwnd, UINT control, MCONTACT hContact)
{
DBVARIANT dbv;
- if (!db_get_ws(hContact, modname, "PounceMsg", &dbv)) {
+ if (!db_get_ws(hContact, MODULENAME, "PounceMsg", &dbv)) {
SetDlgItemText(hwnd, control, dbv.ptszVal);
db_free(&dbv);
}
- else if (!db_get_ws(NULL, modname, "PounceMsg", &dbv)) {
+ else if (!db_get_ws(NULL, MODULENAME, "PounceMsg", &dbv)) {
SetDlgItemText(hwnd, control, dbv.ptszVal);
db_free(&dbv);
}
@@ -104,12 +104,12 @@ INT_PTR CALLBACK StatusModesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l if (!mir_wstrcmp(type, L"Any")) {
if (LOWORD(wParam) == IDOK)
- db_set_w(wi->hContact, modname, "SendIfMyStatusIsFLAG", flag);
+ db_set_w(wi->hContact, MODULENAME, "SendIfMyStatusIsFLAG", flag);
wi->SendIfMy = nullptr;
}
else {
if (LOWORD(wParam) == IDOK)
- db_set_w(wi->hContact, modname, "SendIfTheirStatusIsFLAG", flag);
+ db_set_w(wi->hContact, MODULENAME, "SendIfTheirStatusIsFLAG", flag);
wi->SendWhenThey = nullptr;
}
DestroyWindow(hwnd);
@@ -130,7 +130,7 @@ void statusModes(windowInfo *wi, int myStatusMode) // myStatusMode=1 sendIfMySta }
else {
hwnd = wi->SendIfMy = CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_STATUSMODES), nullptr, StatusModesDlgProc, (LPARAM)wi);
- statusFlag = db_get_w(wi->hContact, modname, "SendIfMyStatusIsFLAG", 0);
+ statusFlag = db_get_w(wi->hContact, MODULENAME, "SendIfMyStatusIsFLAG", 0);
SetWindowText(hwnd, TranslateT("Send If My Status Is"));
SetDlgItemText(hwnd, IDC_CHECK1, TranslateT("Any"));
SetDlgItemText(hwnd, IDC_CHECK2, TranslateT("Online"));
@@ -151,7 +151,7 @@ void statusModes(windowInfo *wi, int myStatusMode) // myStatusMode=1 sendIfMySta }
else {
hwnd = wi->SendWhenThey = CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_STATUSMODES), nullptr, StatusModesDlgProc, (LPARAM)wi);
- statusFlag = db_get_w(wi->hContact, modname, "SendIfTheirStatusIsFLAG", 0);
+ statusFlag = db_get_w(wi->hContact, MODULENAME, "SendIfTheirStatusIsFLAG", 0);
SetWindowText(hwnd, TranslateT("Send If Their Status changes"));
SetDlgItemText(hwnd, IDC_CHECK1, TranslateT("From Offline"));
SetDlgItemText(hwnd, IDC_CHECK2, TranslateT("To Online"));
@@ -179,14 +179,14 @@ void statusModes(windowInfo *wi, int myStatusMode) // myStatusMode=1 sendIfMySta void deletePounce(MCONTACT hContact)
{
- db_unset(hContact, modname, "PounceMsg");
- db_unset(hContact, modname, "SendIfMyStatusIsFLAG");
- db_unset(hContact, modname, "SendIfTheirStatusIsFLAG");
- db_unset(hContact, modname, "Reuse");
- db_unset(hContact, modname, "GiveUpDays");
- db_unset(hContact, modname, "GiveUpDate");
- db_unset(hContact, modname, "ConfirmTimeout");
- db_unset(hContact, modname, "FileToSend");
+ db_unset(hContact, MODULENAME, "PounceMsg");
+ db_unset(hContact, MODULENAME, "SendIfMyStatusIsFLAG");
+ db_unset(hContact, MODULENAME, "SendIfTheirStatusIsFLAG");
+ db_unset(hContact, MODULENAME, "Reuse");
+ db_unset(hContact, MODULENAME, "GiveUpDays");
+ db_unset(hContact, MODULENAME, "GiveUpDate");
+ db_unset(hContact, MODULENAME, "ConfirmTimeout");
+ db_unset(hContact, MODULENAME, "FileToSend");
}
INT_PTR CALLBACK BuddyPounceSimpleDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
@@ -224,9 +224,9 @@ INT_PTR CALLBACK BuddyPounceSimpleDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, L if (length > 1) {
wchar_t *text = (wchar_t*)_alloca(length * sizeof(wchar_t));
GetDlgItemText(hwnd, IDC_MESSAGE, text, length);
- db_set_ws(hContact, modname, "PounceMsg", text);
+ db_set_ws(hContact, MODULENAME, "PounceMsg", text);
}
- else db_unset(hContact, modname, "PounceMsg");
+ else db_unset(hContact, MODULENAME, "PounceMsg");
}
// fall through
case IDCANCEL:
@@ -264,7 +264,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM populateSettingsList(GetDlgItem(hwnd, IDC_SETTINGS));
populateContacts(wi->hContact, GetDlgItem(hwnd, IDC_CONTACTS));
SendDlgItemMessage(hwnd, IDC_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG((short)1024, (short)0));
- db_set_b(wi->hContact, modname, "LastSetting", 0);
+ db_set_b(wi->hContact, MODULENAME, "LastSetting", 0);
return FALSE;
case WM_COMMAND:
@@ -289,10 +289,10 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM break;
}
GetDlgItemText(hwnd, IDC_MESSAGE, text, length);
- db_set_ws(hContact, modname, "PounceMsg", text);
+ db_set_ws(hContact, MODULENAME, "PounceMsg", text);
mir_free(text);
}
- else db_unset(hContact, modname, "PounceMsg");
+ else db_unset(hContact, MODULENAME, "PounceMsg");
saveLastSetting(hContact, hwnd);
} // fall through
if (LOWORD(wParam) == IDC_SIMPLE)
@@ -318,12 +318,12 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM mir_snwprintf(msg, TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
SetDlgItemText(hwnd, GRP_MSG, msg);
- db_set_w(wi->hContact, modname, "SendIfMyStatusIsFLAG", (WORD)db_get_w(NULL, modname, "SendIfMyStatusIsFLAG", 0));
- db_set_w(wi->hContact, modname, "SendIfTheirStatusIsFLAG", (WORD)db_get_w(NULL, modname, "SendIfTheirStatusIsFLAG", 0));
- db_set_b(wi->hContact, modname, "Reuse", (BYTE)db_get_b(NULL, modname, "Reuse", 0));
- db_set_b(wi->hContact, modname, "GiveUpDays", (BYTE)db_get_b(NULL, modname, "GiveUpDays", 0));
- db_set_dw(wi->hContact, modname, "GiveUpDate", (DWORD)db_get_dw(NULL, modname, "GiveUpDate", 0));
- db_set_w(wi->hContact, modname, "ConfirmTimeout", (WORD)db_get_w(NULL, modname, "ConfirmTimeout", 0));
+ db_set_w(wi->hContact, MODULENAME, "SendIfMyStatusIsFLAG", (WORD)db_get_w(NULL, MODULENAME, "SendIfMyStatusIsFLAG", 0));
+ db_set_w(wi->hContact, MODULENAME, "SendIfTheirStatusIsFLAG", (WORD)db_get_w(NULL, MODULENAME, "SendIfTheirStatusIsFLAG", 0));
+ db_set_b(wi->hContact, MODULENAME, "Reuse", (BYTE)db_get_b(NULL, MODULENAME, "Reuse", 0));
+ db_set_b(wi->hContact, MODULENAME, "GiveUpDays", (BYTE)db_get_b(NULL, MODULENAME, "GiveUpDays", 0));
+ db_set_dw(wi->hContact, MODULENAME, "GiveUpDate", (DWORD)db_get_dw(NULL, MODULENAME, "GiveUpDate", 0));
+ db_set_w(wi->hContact, MODULENAME, "ConfirmTimeout", (WORD)db_get_w(NULL, MODULENAME, "ConfirmTimeout", 0));
break;
case IDC_SETTINGS:
@@ -344,7 +344,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM SetDlgItemText(hwnd, IDC_SETTINGMSG, TranslateT("Reuse this message? (0 to use it once)"));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGMSG2), SW_SHOW);
SetDlgItemText(hwnd, IDC_SETTINGMSG2, TranslateT("Times"));
- SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_b(wi->hContact, modname, "Reuse", 0), temp, 10));
+ SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_b(wi->hContact, MODULENAME, "Reuse", 0), temp, 10));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGNUMBER), SW_SHOW);
ShowWindow(GetDlgItem(hwnd, IDC_SPIN), SW_SHOW);
break;
@@ -353,7 +353,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM SetDlgItemText(hwnd, IDC_SETTINGMSG, TranslateT("Give up after... (0 to not give up)"));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGMSG2), SW_SHOW);
SetDlgItemText(hwnd, IDC_SETTINGMSG2, TranslateT("Days"));
- SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_b(wi->hContact, modname, "GiveUpDays", 0), temp, 10));
+ SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_b(wi->hContact, MODULENAME, "GiveUpDays", 0), temp, 10));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGNUMBER), SW_SHOW);
ShowWindow(GetDlgItem(hwnd, IDC_SPIN), SW_SHOW);
break;
@@ -362,12 +362,12 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM SetDlgItemText(hwnd, IDC_SETTINGMSG, TranslateT("Show confirmation window? (0 to not Show)"));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGMSG2), SW_SHOW);
SetDlgItemText(hwnd, IDC_SETTINGMSG2, TranslateT("Seconds to wait before sending"));
- SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_w(wi->hContact, modname, "ConfirmTimeout", 0), temp, 10));
+ SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_w(wi->hContact, MODULENAME, "ConfirmTimeout", 0), temp, 10));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGNUMBER), SW_SHOW);
ShowWindow(GetDlgItem(hwnd, IDC_SPIN), SW_SHOW);
break;
}
- db_set_b(wi->hContact, modname, "LastSetting", (BYTE)item);
+ db_set_b(wi->hContact, MODULENAME, "LastSetting", (BYTE)item);
}
}
break;
@@ -394,9 +394,9 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, SetDlgItemText(hwnd, GRP_MSG, msg);
populateSettingsList(GetDlgItem(hwnd, IDC_SETTINGS));
SendDlgItemMessage(hwnd, IDC_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG((short)1024, (short)0));
- CheckDlgButton(hwnd, IDC_USEADVANCED, db_get_b(NULL, modname, "UseAdvanced", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwnd, IDC_SHOWDELIVERYMSGS, db_get_b(NULL, modname, "ShowDeliveryMessages", 1) ? BST_CHECKED : BST_UNCHECKED);
- db_set_b(wi->hContact, modname, "LastSetting", 0);
+ CheckDlgButton(hwnd, IDC_USEADVANCED, db_get_b(NULL, MODULENAME, "UseAdvanced", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwnd, IDC_SHOWDELIVERYMSGS, db_get_b(NULL, MODULENAME, "ShowDeliveryMessages", 1) ? BST_CHECKED : BST_UNCHECKED);
+ db_set_b(wi->hContact, MODULENAME, "LastSetting", 0);
}
return FALSE;
@@ -415,12 +415,12 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, break;
}
GetDlgItemText(hwnd, IDC_MESSAGE, text, length);
- db_set_ws(hContact, modname, "PounceMsg", text);
+ db_set_ws(hContact, MODULENAME, "PounceMsg", text);
mir_free(text);
}
- else db_unset(hContact, modname, "PounceMsg");
- db_set_b(NULL, modname, "UseAdvanced", (BYTE)IsDlgButtonChecked(hwnd, IDC_USEADVANCED));
- db_set_b(NULL, modname, "ShowDeliveryMessages", (BYTE)IsDlgButtonChecked(hwnd, IDC_SHOWDELIVERYMSGS));
+ else db_unset(hContact, MODULENAME, "PounceMsg");
+ db_set_b(NULL, MODULENAME, "UseAdvanced", (BYTE)IsDlgButtonChecked(hwnd, IDC_USEADVANCED));
+ db_set_b(NULL, MODULENAME, "ShowDeliveryMessages", (BYTE)IsDlgButtonChecked(hwnd, IDC_SHOWDELIVERYMSGS));
if (wi->SendIfMy) DestroyWindow(wi->SendIfMy);
if (wi->SendWhenThey) DestroyWindow(wi->SendWhenThey);
@@ -464,7 +464,7 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, SetDlgItemText(hwnd, IDC_SETTINGMSG, TranslateT("Reuse this message? (0 to use it once)"));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGMSG2), SW_SHOW);
SetDlgItemText(hwnd, IDC_SETTINGMSG2, TranslateT("Times"));
- SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_b(wi->hContact, modname, "Reuse", 0), temp, 10));
+ SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_b(wi->hContact, MODULENAME, "Reuse", 0), temp, 10));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGNUMBER), SW_SHOW);
ShowWindow(GetDlgItem(hwnd, IDC_SPIN), SW_SHOW);
break;
@@ -473,7 +473,7 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, SetDlgItemText(hwnd, IDC_SETTINGMSG, TranslateT("Give up after... (0 to not give up)"));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGMSG2), SW_SHOW);
SetDlgItemText(hwnd, IDC_SETTINGMSG2, TranslateT("Days"));
- SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_b(wi->hContact, modname, "GiveUpDays", 0), temp, 10));
+ SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_b(wi->hContact, MODULENAME, "GiveUpDays", 0), temp, 10));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGNUMBER), SW_SHOW);
ShowWindow(GetDlgItem(hwnd, IDC_SPIN), SW_SHOW);
break;
@@ -482,12 +482,12 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, SetDlgItemText(hwnd, IDC_SETTINGMSG, TranslateT("Show confirmation window? (0 to not Show)"));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGMSG2), SW_SHOW);
SetDlgItemText(hwnd, IDC_SETTINGMSG2, TranslateT("Seconds to wait before sending"));
- SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_w(wi->hContact, modname, "ConfirmTimeout", 0), temp, 10));
+ SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_w(wi->hContact, MODULENAME, "ConfirmTimeout", 0), temp, 10));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGNUMBER), SW_SHOW);
ShowWindow(GetDlgItem(hwnd, IDC_SPIN), SW_SHOW);
break;
}
- db_set_b(wi->hContact, modname, "LastSetting", (BYTE)item);
+ db_set_b(wi->hContact, MODULENAME, "LastSetting", (BYTE)item);
}
}
break;
@@ -506,11 +506,11 @@ INT_PTR CALLBACK SendPounceDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP if (!spdps)
DestroyWindow(hwnd);
- spdps->timer = db_get_w(spdps->hContact, modname, "ConfirmTimeout", 0);
+ spdps->timer = db_get_w(spdps->hContact, MODULENAME, "ConfirmTimeout", 0);
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)spdps);
{
DBVARIANT dbv;
- if (db_get_ws(spdps->hContact, modname, "PounceMsg", &dbv))
+ if (db_get_ws(spdps->hContact, MODULENAME, "PounceMsg", &dbv))
DestroyWindow(hwnd);
else {
SetDlgItemText(hwnd, IDC_MESSAGE, dbv.ptszVal);
@@ -567,7 +567,7 @@ INT_PTR CALLBACK PounceSentDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP hContact = lParam;
{
DBVARIANT dbv;
- if (db_get_ws(hContact, modname, "PounceMsg", &dbv))
+ if (db_get_ws(hContact, MODULENAME, "PounceMsg", &dbv))
DestroyWindow(hwnd);
else {
SetDlgItemText(hwnd, IDC_MESSAGE, dbv.ptszVal);
diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp index d7365f0f5a..8719d919b2 100644 --- a/plugins/BuddyPounce/src/main.cpp +++ b/plugins/BuddyPounce/src/main.cpp @@ -4,7 +4,9 @@ CMPlugin g_plugin; int &hLangpack(g_plugin.m_hLang);
MWindowList hWindowList;
-PLUGININFOEX pluginInfo = {
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -17,19 +19,17 @@ PLUGININFOEX pluginInfo = { {0xa9e9c114, 0x84b9, 0x434b, {0xa3, 0xd5, 0x89, 0x92, 0x1d, 0x39, 0xdd, 0xff}}
};
-//========================
-// MirandaPluginInfo
-//========================
-
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
-//===================
+/////////////////////////////////////////////////////////////////////////////////////////
// MainInit
-//===================
int MainInit(WPARAM, LPARAM)
{
@@ -49,14 +49,14 @@ int MsgAck(WPARAM, LPARAM lParam) if (ack && ack->type == ACKTYPE_MESSAGE) {
if (ack->hProcess == (HANDLE)WindowList_Find(hWindowList, ack->hContact)) {
- if (db_get_b(NULL, modname, "ShowDeliveryMessages", 1))
+ if (db_get_b(NULL, MODULENAME, "ShowDeliveryMessages", 1))
CreateMessageAcknowlegedWindow(ack->hContact, ack->result == ACKRESULT_SUCCESS);
if (ack->result == ACKRESULT_SUCCESS) {
// wrtie it to the DB
DBEVENTINFO dbei = {};
DBVARIANT dbv;
- int reuse = db_get_b(ack->hContact, modname, "Reuse", 0);
- if (!db_get_ws(ack->hContact, modname, "PounceMsg", &dbv) && (dbv.ptszVal[0] != '\0')) {
+ int reuse = db_get_b(ack->hContact, MODULENAME, "Reuse", 0);
+ if (!db_get_ws(ack->hContact, MODULENAME, "PounceMsg", &dbv) && (dbv.ptszVal[0] != '\0')) {
T2Utf pszUtf(dbv.ptszVal);
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.flags = DBEF_UTF | DBEF_SENT;
@@ -68,10 +68,10 @@ int MsgAck(WPARAM, LPARAM lParam) }
// check to reuse
if (reuse > 1)
- db_set_b(ack->hContact, modname, "Reuse", (BYTE)(reuse - 1));
+ db_set_b(ack->hContact, MODULENAME, "Reuse", (BYTE)(reuse - 1));
else {
- db_set_b(ack->hContact, modname, "Reuse", 0);
- db_set_ws(ack->hContact, modname, "PounceMsg", L"");
+ db_set_b(ack->hContact, MODULENAME, "Reuse", 0);
+ db_set_ws(ack->hContact, MODULENAME, "PounceMsg", L"");
}
}
WindowList_Remove(hWindowList, (HWND)ack->hProcess);
@@ -123,9 +123,9 @@ int statusCheck(int statusFlag, int status) int CheckDate(MCONTACT hContact)
{
time_t curtime = time(nullptr);
- if (!db_get_b(hContact, modname, "GiveUpDays", 0))
+ if (!db_get_b(hContact, MODULENAME, "GiveUpDays", 0))
return 1;
- if (db_get_b(hContact, modname, "GiveUpDays", 0) && (abs((time_t)db_get_dw(hContact, modname, "GiveUpDate", 0)) > curtime))
+ if (db_get_b(hContact, MODULENAME, "GiveUpDays", 0) && (abs((time_t)db_get_dw(hContact, MODULENAME, "GiveUpDate", 0)) > curtime))
return 1;
return 0;
}
@@ -148,14 +148,14 @@ int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) if (newStatus != oldStatus && hContact != NULL && newStatus != ID_STATUS_OFFLINE) {
DBVARIANT dbv;
- if (!db_get_ws(hContact, modname, "PounceMsg", &dbv) && (dbv.ptszVal[0] != '\0')) {
+ if (!db_get_ws(hContact, MODULENAME, "PounceMsg", &dbv) && (dbv.ptszVal[0] != '\0')) {
// check my status
- if (statusCheck(db_get_w(hContact, modname, "SendIfMyStatusIsFLAG", 0), Proto_GetStatus(szProto))
+ if (statusCheck(db_get_w(hContact, MODULENAME, "SendIfMyStatusIsFLAG", 0), Proto_GetStatus(szProto))
// check the contacts status
- && statusCheck(db_get_w(hContact, modname, "SendIfTheirStatusIsFLAG", 0), newStatus)) {
+ && statusCheck(db_get_w(hContact, MODULENAME, "SendIfTheirStatusIsFLAG", 0), newStatus)) {
// check if we r giving up after x days
if (CheckDate(hContact)) {
- if (db_get_w(hContact, modname, "ConfirmTimeout", 0)) {
+ if (db_get_w(hContact, MODULENAME, "ConfirmTimeout", 0)) {
SendPounceDlgProcStruct *spdps = (SendPounceDlgProcStruct *)mir_alloc(sizeof(SendPounceDlgProcStruct));
wchar_t *message = mir_wstrdup(dbv.ptszVal); // will get free()ed in the send confirm window proc
spdps->hContact = hContact;
@@ -176,7 +176,7 @@ int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) INT_PTR BuddyPounceMenuCommand(WPARAM hContact, LPARAM)
{
- if (db_get_b(NULL, modname, "UseAdvanced", 0) || db_get_b(hContact, modname, "UseAdvanced", 0))
+ if (db_get_b(NULL, MODULENAME, "UseAdvanced", 0) || db_get_b(hContact, MODULENAME, "UseAdvanced", 0))
CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_POUNCE), nullptr, BuddyPounceDlgProc, hContact);
else
CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_POUNCE_SIMPLE), nullptr, BuddyPounceSimpleDlgProc, hContact);
@@ -187,12 +187,12 @@ INT_PTR AddSimpleMessage(WPARAM wParam, LPARAM lParam) {
MCONTACT hContact = wParam;
wchar_t* message = (wchar_t*)lParam;
- db_set_ws(hContact, modname, "PounceMsg", message);
- db_set_w(hContact, modname, "SendIfMyStatusIsFLAG", (WORD)db_get_w(NULL, modname, "SendIfMyStatusIsFLAG", 1));
- db_set_w(hContact, modname, "SendIfTheirStatusIsFLAG", (WORD)db_get_w(NULL, modname, "SendIfTheirStatusIsFLAG", 1));
- db_set_b(hContact, modname, "Reuse", (BYTE)db_get_b(NULL, modname, "Reuse", 0));
- db_set_b(hContact, modname, "GiveUpDays", (BYTE)db_get_b(NULL, modname, "GiveUpDays", 0));
- db_set_dw(hContact, modname, "GiveUpDate", (DWORD)(db_get_b(hContact, modname, "GiveUpDays", 0)*SECONDSINADAY));
+ db_set_ws(hContact, MODULENAME, "PounceMsg", message);
+ db_set_w(hContact, MODULENAME, "SendIfMyStatusIsFLAG", (WORD)db_get_w(NULL, MODULENAME, "SendIfMyStatusIsFLAG", 1));
+ db_set_w(hContact, MODULENAME, "SendIfTheirStatusIsFLAG", (WORD)db_get_w(NULL, MODULENAME, "SendIfTheirStatusIsFLAG", 1));
+ db_set_b(hContact, MODULENAME, "Reuse", (BYTE)db_get_b(NULL, MODULENAME, "Reuse", 0));
+ db_set_b(hContact, MODULENAME, "GiveUpDays", (BYTE)db_get_b(NULL, MODULENAME, "GiveUpDays", 0));
+ db_set_dw(hContact, MODULENAME, "GiveUpDate", (DWORD)(db_get_b(hContact, MODULENAME, "GiveUpDays", 0)*SECONDSINADAY));
return 0;
}
@@ -201,13 +201,13 @@ INT_PTR AddToPounce(WPARAM wParam, LPARAM lParam) MCONTACT hContact = wParam;
wchar_t* message = (wchar_t*)lParam;
DBVARIANT dbv;
- if (!db_get_ws(hContact, modname, "PounceMsg", &dbv))
+ if (!db_get_ws(hContact, MODULENAME, "PounceMsg", &dbv))
{
wchar_t* newPounce = (wchar_t*)mir_alloc(mir_wstrlen(dbv.ptszVal) + mir_wstrlen(message) + 1);
if (!newPounce) return 1;
mir_wstrcpy(newPounce, dbv.ptszVal);
mir_wstrcat(newPounce, message);
- db_set_ws(hContact, modname, "PounceMsg", newPounce);
+ db_set_ws(hContact, MODULENAME, "PounceMsg", newPounce);
mir_free(newPounce);
db_free(&dbv);
}
@@ -215,12 +215,12 @@ INT_PTR AddToPounce(WPARAM wParam, LPARAM lParam) return 0;
}
-//===========================
+/////////////////////////////////////////////////////////////////////////////////////////
// Load (hook ModulesLoaded)
-//===========================
+
extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
HookEvent(ME_SYSTEM_MODULESLOADED, MainInit);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, UserOnlineSettingChanged);
@@ -231,12 +231,13 @@ extern "C" __declspec(dllexport) int Load(void) hWindowList = WindowList_Create();
- /* service funcitons for other devs... */
+ // service funcitons for other devs... */
CreateServiceFunction("BuddyPounce/AddSimplePounce", AddSimpleMessage); // add a simple pounce to a contact
CreateServiceFunction("BuddyPounce/AddToPounce", AddToPounce); // add to the exsisitng pounce, if there isnt 1 then add a new simple pounce.
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
extern "C" __declspec(dllexport) int Unload(void)
{
diff --git a/plugins/BuddyPounce/src/stdafx.h b/plugins/BuddyPounce/src/stdafx.h index 50f8e76057..c72a0f832b 100644 --- a/plugins/BuddyPounce/src/stdafx.h +++ b/plugins/BuddyPounce/src/stdafx.h @@ -23,15 +23,13 @@ //=======================================================
// Definitions
//=======================================================
-#define modname "BuddyPounce"
-#define modFullname "Buddy Pounce"
-#define msg(a,b) MessageBox(0,a,b,MB_OK)
+#define MODULENAME "BuddyPounce"
+#define modFullname "Buddy Pounce"
+#define msg(a,b) MessageBox(0,a,b,MB_OK)
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(modname)
- {}
+ CMPlugin();
};
#define SECONDSINADAY 86400
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index 1b72774fe9..ef6d3f19c6 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -33,7 +33,9 @@ int &hLangpack(g_plugin.m_hLang); static LIST<CSWindow> arWindows(3, HandleKeySortT); -PLUGININFOEX pluginInfoEx = +//====[ PLUGIN INFO ]======================================================== + +static PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -47,14 +49,16 @@ PLUGININFOEX pluginInfoEx = { 0xc8cc7414, 0x6507, 0x4af6, { 0x92, 0x5a, 0x83, 0xc1, 0xd2, 0xf7, 0xbe, 0x8c } } }; -// ====[ PLUGIN INFO ]======================================================== +CMPlugin::CMPlugin() : + PLUGIN<CMPlugin>(MODNAME, pluginInfoEx) +{} extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { return &pluginInfoEx; } -// ====[ LOADER ]============================================================= +//====[ LOADER ]============================================================= static int OnDbChanged(WPARAM hContact, LPARAM lparam) { @@ -139,14 +143,14 @@ extern "C" __declspec(dllexport) int Load() return 0; } -// ====[ UNLOADER ]=========================================================== +//====[ UNLOADER ]=========================================================== extern "C" __declspec(dllexport) int Unload() { return 0; } -// ====[ FUN ]================================================================ +//====[ FUN ]================================================================ void RegisterHotkeys(char buf[200], wchar_t* accName, int Number) { @@ -671,7 +675,7 @@ void CSListView::setFullFocusedSelection(int selection) SetFocus(m_handle); } -// ====[ LIST MANAGEMENT ]==================================================== +//====[ LIST MANAGEMENT ]==================================================== CSItemsList::CSItemsList(char *protoName) { @@ -791,7 +795,7 @@ void CSItemsList::saveItems(char *protoName) } -// ====[ PROCEDURES ]========================================================= +//====[ PROCEDURES ]========================================================= INT_PTR CALLBACK CSWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { diff --git a/plugins/CSList/src/stdafx.h b/plugins/CSList/src/stdafx.h index 810409e9fa..c78a18e600 100644 --- a/plugins/CSList/src/stdafx.h +++ b/plugins/CSList/src/stdafx.h @@ -28,7 +28,7 @@ Offers List of your Custom Statuses. ============================================================================
-// ====[ INCLUDES AND DEFINITIONS ]======================================== */
+//====[ INCLUDES AND DEFINITIONS ]======================================== */
#ifndef __CSLIST_H
#define __CSLIST_H 1
@@ -52,24 +52,22 @@ Offers List of your Custom Statuses. #include "resource.h"
#include "version.h"
-// ====[ BASIC DEFINITIONS ]==================================================
+//====[ BASIC DEFINITIONS ]==================================================
#define MODULENAME LPGENW("Custom Status List")
#define MODNAME "CSList"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODNAME)
- {}
+ CMPlugin();
};
-// ====[ LIMITS ]=============================================================
+//====[ LIMITS ]=============================================================
#define EXTRASTATUS_TITLE_LIMIT 64 // limit of chars for extra status title
#define EXTRASTATUS_MESSAGE_LIMIT 2048 // limit of chars for extra status message
-// ====[ DEFAULT DB VALUES ]==================================================
+//====[ DEFAULT DB VALUES ]==================================================
#define DEFAULT_ICQ_XSTATUS_ENABLED 1
#define DEFAULT_PLUGIN_SHOW_RELNOTES 0
@@ -83,7 +81,7 @@ struct CMPlugin : public PLUGIN<CMPlugin> #define DEFAULT_REMEMBER_WINDOW_POSITION 1
-// ====[ FUNCTION MACROS ]====================================================
+//====[ FUNCTION MACROS ]====================================================
// set which row is selected (cannot be only focused, but fully selected - second param ;))
#define ListView_GetSelectedItemMacro( hwnd ) ListView_GetNextItem( hwnd, -1, LVNI_FOCUSED | LVNI_SELECTED );
@@ -105,7 +103,7 @@ struct CMPlugin : public PLUGIN<CMPlugin> typedef void(__cdecl *pForAllProtosFunc)(char*, void *);
-// ====[ STRUCTURES ]=========================================================
+//====[ STRUCTURES ]=========================================================
struct StatusItem // list item structure
{
@@ -158,7 +156,7 @@ static struct CSForm { // icons + buttons { IDOK, LPGENW("Set custom status to selected one and close"), LPGENW("Set"), "apply", IDI_APPLY }
};
-// ====[ MY BITCHY LIST IMPLEMENTATION x)) ]==================================
+//====[ MY BITCHY LIST IMPLEMENTATION x)) ]==================================
// TODO: Optimize it all x))
template< class T > struct ListItem
@@ -307,7 +305,7 @@ public: };
-// ====[ CLASSING -- FUNNY STUFF :) ]=========================================
+//====[ CLASSING -- FUNNY STUFF :) ]=========================================
struct CSWindow;
struct CSAMWindow;
@@ -404,7 +402,7 @@ void addProtoStatusMenuItem(char *protoName); void RegisterHotkeys(char buf[200], wchar_t* accName, int Number);
void SetStatus(WORD code, StatusItem* item, char *protoName);
-// ====[ PROCEDURES ]=========================================================
+//====[ PROCEDURES ]=========================================================
INT_PTR CALLBACK CSWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
INT_PTR CALLBACK CSAMWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
diff --git a/plugins/ChangeKeyboardLayout/src/hook_events.cpp b/plugins/ChangeKeyboardLayout/src/hook_events.cpp index 22fc9ddc7d..bc339f1435 100644 --- a/plugins/ChangeKeyboardLayout/src/hook_events.cpp +++ b/plugins/ChangeKeyboardLayout/src/hook_events.cpp @@ -22,61 +22,61 @@ INT_PTR APIChangeTextLayout(WPARAM wParam, LPARAM lParam) void ReadMainOptions()
{
- moOptions.dwHotkey_Layout = db_get_dw(NULL, ModuleName, "HotkeyLayout", 119);
- moOptions.dwHotkey_Layout2 = db_get_dw(NULL, ModuleName, "HotkeyLayout2", 120);
- moOptions.dwHotkey_Case = db_get_dw(NULL, ModuleName, "HotkeyCase", 121);
- moOptions.CurrentWordLayout = db_get_b(NULL, ModuleName, "CurrentWordLayout", 0);
- moOptions.CurrentWordLayout2 = db_get_b(NULL, ModuleName, "CurrentWordLayout2", 1);
- moOptions.CurrentWordCase = db_get_b(NULL, ModuleName, "CurrentWordCase", 0);
- moOptions.TwoWay = db_get_b(NULL, ModuleName, "TwoWay", 1);
- moOptions.ChangeSystemLayout = db_get_b(NULL, ModuleName, "ChangeSystemLayout", 1);
- moOptions.CopyToClipboard = db_get_b(NULL, ModuleName, "CopyToClipboard", 0);
- moOptions.ShowPopup = db_get_b(NULL, ModuleName, "ShowPopup", 1);
- moOptions.bCaseOperations = db_get_b(NULL, ModuleName, "CaseOperations", 0);
+ moOptions.dwHotkey_Layout = db_get_dw(NULL, MODULENAME, "HotkeyLayout", 119);
+ moOptions.dwHotkey_Layout2 = db_get_dw(NULL, MODULENAME, "HotkeyLayout2", 120);
+ moOptions.dwHotkey_Case = db_get_dw(NULL, MODULENAME, "HotkeyCase", 121);
+ moOptions.CurrentWordLayout = db_get_b(NULL, MODULENAME, "CurrentWordLayout", 0);
+ moOptions.CurrentWordLayout2 = db_get_b(NULL, MODULENAME, "CurrentWordLayout2", 1);
+ moOptions.CurrentWordCase = db_get_b(NULL, MODULENAME, "CurrentWordCase", 0);
+ moOptions.TwoWay = db_get_b(NULL, MODULENAME, "TwoWay", 1);
+ moOptions.ChangeSystemLayout = db_get_b(NULL, MODULENAME, "ChangeSystemLayout", 1);
+ moOptions.CopyToClipboard = db_get_b(NULL, MODULENAME, "CopyToClipboard", 0);
+ moOptions.ShowPopup = db_get_b(NULL, MODULENAME, "ShowPopup", 1);
+ moOptions.bCaseOperations = db_get_b(NULL, MODULENAME, "CaseOperations", 0);
}
void WriteMainOptions()
{
- db_set_dw(NULL, ModuleName, "HotkeyLayout", moOptions.dwHotkey_Layout);
- db_set_dw(NULL, ModuleName, "HotkeyLayout2", moOptions.dwHotkey_Layout2);
- db_set_dw(NULL, ModuleName, "HotkeyCase", moOptions.dwHotkey_Case);
- db_set_b(NULL, ModuleName, "CurrentWordLayout", moOptions.CurrentWordLayout);
- db_set_b(NULL, ModuleName, "CurrentWordLayout2", moOptions.CurrentWordLayout2);
- db_set_b(NULL, ModuleName, "CurrentWordCase", moOptions.CurrentWordCase);
- db_set_b(NULL, ModuleName, "TwoWay", moOptions.TwoWay);
- db_set_b(NULL, ModuleName, "ChangeSystemLayout", moOptions.ChangeSystemLayout);
- db_set_b(NULL, ModuleName, "CopyToClipboard", moOptions.CopyToClipboard);
- db_set_b(NULL, ModuleName, "ShowPopup", moOptions.ShowPopup);
- db_set_b(NULL, ModuleName, "CaseOperations", moOptions.bCaseOperations);
+ db_set_dw(NULL, MODULENAME, "HotkeyLayout", moOptions.dwHotkey_Layout);
+ db_set_dw(NULL, MODULENAME, "HotkeyLayout2", moOptions.dwHotkey_Layout2);
+ db_set_dw(NULL, MODULENAME, "HotkeyCase", moOptions.dwHotkey_Case);
+ db_set_b(NULL, MODULENAME, "CurrentWordLayout", moOptions.CurrentWordLayout);
+ db_set_b(NULL, MODULENAME, "CurrentWordLayout2", moOptions.CurrentWordLayout2);
+ db_set_b(NULL, MODULENAME, "CurrentWordCase", moOptions.CurrentWordCase);
+ db_set_b(NULL, MODULENAME, "TwoWay", moOptions.TwoWay);
+ db_set_b(NULL, MODULENAME, "ChangeSystemLayout", moOptions.ChangeSystemLayout);
+ db_set_b(NULL, MODULENAME, "CopyToClipboard", moOptions.CopyToClipboard);
+ db_set_b(NULL, MODULENAME, "ShowPopup", moOptions.ShowPopup);
+ db_set_b(NULL, MODULENAME, "CaseOperations", moOptions.bCaseOperations);
}
void ReadPopupOptions()
{
- poOptions.bColourType = db_get_b(NULL, ModuleName, "ColourType", 0);
- poOptions.crBackColour = (COLORREF)db_get_dw(NULL, ModuleName, "BackColor", 0xD2CABF);
- poOptions.crTextColour = (COLORREF)db_get_dw(NULL, ModuleName, "TextColor", 0x000000);
- poOptions.bTimeoutType = db_get_b(NULL, ModuleName, "TimeoutType", 0);
- poOptions.bTimeout = db_get_b(NULL, ModuleName, "Timeout", 10);
- poOptions.bLeftClick = db_get_b(NULL, ModuleName, "LeftClick", 0);
- poOptions.bRightClick = db_get_b(NULL, ModuleName, "RightClick", 1);
+ poOptions.bColourType = db_get_b(NULL, MODULENAME, "ColourType", 0);
+ poOptions.crBackColour = (COLORREF)db_get_dw(NULL, MODULENAME, "BackColor", 0xD2CABF);
+ poOptions.crTextColour = (COLORREF)db_get_dw(NULL, MODULENAME, "TextColor", 0x000000);
+ poOptions.bTimeoutType = db_get_b(NULL, MODULENAME, "TimeoutType", 0);
+ poOptions.bTimeout = db_get_b(NULL, MODULENAME, "Timeout", 10);
+ poOptions.bLeftClick = db_get_b(NULL, MODULENAME, "LeftClick", 0);
+ poOptions.bRightClick = db_get_b(NULL, MODULENAME, "RightClick", 1);
}
void WritePopupOptions()
{
- db_set_b(NULL, ModuleName, "ColourType", poOptions.bColourType);
- db_set_dw(NULL, ModuleName, "BackColor", poOptions.crBackColour);
- db_set_dw(NULL, ModuleName, "TextColor", poOptions.crTextColour);
- db_set_b(NULL, ModuleName, "TimeoutType", poOptions.bTimeoutType);
- db_set_b(NULL, ModuleName, "Timeout", poOptions.bTimeout);
- db_set_b(NULL, ModuleName, "LeftClick", poOptions.bLeftClick);
- db_set_b(NULL, ModuleName, "RightClick", poOptions.bRightClick);
+ db_set_b(NULL, MODULENAME, "ColourType", poOptions.bColourType);
+ db_set_dw(NULL, MODULENAME, "BackColor", poOptions.crBackColour);
+ db_set_dw(NULL, MODULENAME, "TextColor", poOptions.crTextColour);
+ db_set_b(NULL, MODULENAME, "TimeoutType", poOptions.bTimeoutType);
+ db_set_b(NULL, MODULENAME, "Timeout", poOptions.bTimeout);
+ db_set_b(NULL, MODULENAME, "LeftClick", poOptions.bLeftClick);
+ db_set_b(NULL, MODULENAME, "RightClick", poOptions.bRightClick);
}
void RegPopupActions()
{
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
poOptions.paActions[0].cbSize = sizeof(POPUPACTION);
- strncpy_s(poOptions.paActions[0].lpzTitle, ModuleName, _TRUNCATE);
+ strncpy_s(poOptions.paActions[0].lpzTitle, MODULENAME, _TRUNCATE);
strncat_s(poOptions.paActions[0].lpzTitle, _countof(poOptions.paActions[0].lpzTitle), "/Copy to clipboard", _TRUNCATE);
poOptions.paActions[0].flags = PAF_ENABLED;
poOptions.paActions[0].wParam = poOptions.paActions[0].lParam = 0;
@@ -101,7 +101,7 @@ int ModulesLoaded(WPARAM, LPARAM) for (int i = 0; i < bLayNum; i++) {
LPTSTR ptszCurrLayout = GenerateLayoutString(hklLayouts[i]);
LPSTR ptszTemp = GetNameOfLayout(hklLayouts[i]);
- ptrW tszValue(db_get_wsa(NULL, ModuleName, ptszTemp));
+ ptrW tszValue(db_get_wsa(NULL, MODULENAME, ptszTemp));
if (tszValue == 0)
ptszLayStrings[i] = ptszCurrLayout;
else if (!mir_wstrcmp(tszValue, ptszEmptySting))
@@ -109,7 +109,7 @@ int ModulesLoaded(WPARAM, LPARAM) else {
ptszLayStrings[i] = tszValue.detach();
if (!mir_wstrcmp(ptszCurrLayout, ptszLayStrings[i]))
- db_unset(NULL, ModuleName, ptszTemp);
+ db_unset(NULL, MODULENAME, ptszTemp);
mir_free(ptszCurrLayout);
}
mir_free(ptszTemp);
@@ -134,7 +134,7 @@ int ModulesLoaded(WPARAM, LPARAM) RegPopupActions();
- db_set_dw(NULL, ModuleName, "CurrentVer", PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM));
+ db_set_dw(NULL, MODULENAME, "CurrentVer", PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM));
return 0;
}
@@ -143,7 +143,7 @@ int OnOptionsInitialise(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_MAIN_OPTION_FORM);
- odp.szTitle.a = ModuleName;
+ odp.szTitle.a = MODULENAME;
odp.szGroup.a = LPGEN("Message sessions");
odp.flags = ODPF_BOLDGROUPS;
odp.pfnDlgProc = DlgMainProcOptions;
diff --git a/plugins/ChangeKeyboardLayout/src/main.cpp b/plugins/ChangeKeyboardLayout/src/main.cpp index d3da1e1fb4..d80ac7916f 100644 --- a/plugins/ChangeKeyboardLayout/src/main.cpp +++ b/plugins/ChangeKeyboardLayout/src/main.cpp @@ -11,6 +11,21 @@ HHOOK kbHook_All; MainOptions moOptions;
PopupOptions poOptions, poOptionsTemp;
+LPCTSTR ptszKeybEng = L"`1234567890- = \\qwertyuiop[]asdfghjkl;'zxcvbnm,./~!@#$%^&*()_+|QWERTYUIOP{}ASDFGHJKL:\"ZXCVBNM<>?";
+HKL hklEng = (HKL)0x04090409;
+
+LPCTSTR ptszSeparators = L" \t\n\r";
+
+HANDLE hOptionsInitialize;
+
+static IconItem iconList[] =
+{
+ { LPGEN("Popup"), "ckl_popup_icon", IDI_POPUPICON },
+ { LPGEN("Copy to clipboard"), "ckl_copy_icon", IDI_COPYICON }
+};
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -24,23 +39,16 @@ PLUGININFOEX pluginInfoEx = { {0xc5ef53a8, 0x80d4, 0x4ce9, {0xb3, 0x41, 0xec, 0x90, 0xd3, 0xec, 0x91, 0x56}}
};
-LPCTSTR ptszKeybEng = L"`1234567890- = \\qwertyuiop[]asdfghjkl;'zxcvbnm,./~!@#$%^&*()_+|QWERTYUIOP{}ASDFGHJKL:\"ZXCVBNM<>?";
-HKL hklEng = (HKL)0x04090409;
-
-LPCTSTR ptszSeparators = L" \t\n\r";
-
-HANDLE hOptionsInitialize;
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
}
-static IconItem iconList[] =
-{
- { LPGEN("Popup"), "ckl_popup_icon", IDI_POPUPICON },
- { LPGEN("Copy to clipboard"), "ckl_copy_icon", IDI_COPYICON }
-};
+/////////////////////////////////////////////////////////////////////////////////////////
extern "C" __declspec(dllexport) int Load(void)
{
@@ -54,7 +62,7 @@ extern "C" __declspec(dllexport) int Load(void) HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
// IcoLib support
- g_plugin.registerIcon(ModuleName, iconList);
+ g_plugin.registerIcon(MODULENAME, iconList);
HookEvent(ME_SKIN2_ICONSCHANGED, OnIconsChanged);
diff --git a/plugins/ChangeKeyboardLayout/src/options.cpp b/plugins/ChangeKeyboardLayout/src/options.cpp index 1833095662..d70b37048e 100644 --- a/plugins/ChangeKeyboardLayout/src/options.cpp +++ b/plugins/ChangeKeyboardLayout/src/options.cpp @@ -211,9 +211,9 @@ INT_PTR CALLBACK DlgMainProcOptions(HWND hWnd, UINT uiMessage, WPARAM wParam, LP pszNameLay = GetNameOfLayout(hklLayouts[i]);
if (mir_wstrcmp(ptszMemLay, ptszGenLay) != 0)
- db_set_ws(NULL, ModuleName, pszNameLay, ptszMemLay);
+ db_set_ws(NULL, MODULENAME, pszNameLay, ptszMemLay);
else
- db_unset(NULL, ModuleName, pszNameLay);
+ db_unset(NULL, MODULENAME, pszNameLay);
mir_free(pszNameLay);
mir_free(ptszGenLay);
@@ -354,7 +354,7 @@ INT_PTR CALLBACK DlgPopupsProcOptions(HWND hWnd, UINT uiMessage, WPARAM wParam, POPUPDATAT_V2 pdtData = { 0 };
pdtData.cbSize = sizeof(pdtData);
- wcsncpy(pdtData.lptzContactName, TranslateT(ModuleName), MAX_CONTACTNAME);
+ wcsncpy(pdtData.lptzContactName, TranslateT(MODULENAME), MAX_CONTACTNAME);
wcsncpy(pdtData.lptzText, L"Ghbdtn? rfr ltkf&", MAX_SECONDLINE);
switch(poOptionsTemp.bColourType) {
diff --git a/plugins/ChangeKeyboardLayout/src/stdafx.h b/plugins/ChangeKeyboardLayout/src/stdafx.h index fc572a11c8..3b54648181 100644 --- a/plugins/ChangeKeyboardLayout/src/stdafx.h +++ b/plugins/ChangeKeyboardLayout/src/stdafx.h @@ -26,14 +26,12 @@ #include "version.h"
#define MaxTextSize 64000
-#define ModuleName LPGEN("ChangeKeyboardLayout")
+#define MODULENAME LPGEN("ChangeKeyboardLayout")
#define ModuleNameW LPGENW("ChangeKeyboardLayout")
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(ModuleName)
- {}
+ CMPlugin();
};
// History++ API
diff --git a/plugins/ChangeKeyboardLayout/src/text_operations.cpp b/plugins/ChangeKeyboardLayout/src/text_operations.cpp index 678d7116ac..8136933674 100644 --- a/plugins/ChangeKeyboardLayout/src/text_operations.cpp +++ b/plugins/ChangeKeyboardLayout/src/text_operations.cpp @@ -450,7 +450,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) POPUPDATAT_V2 pdtData = { 0 };
pdtData.cbSize = sizeof(pdtData);
- wcsncpy(pdtData.lptzContactName, TranslateT(ModuleName), MAX_CONTACTNAME);
+ wcsncpy(pdtData.lptzContactName, TranslateT(MODULENAME), MAX_CONTACTNAME);
wcsncpy(pdtData.lptzText, ptszPopupText, MAX_SECONDLINE);
switch (poOptions.bColourType) {
@@ -488,7 +488,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) if (CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&pdtData, APF_NEWDATA) < 0) {
mir_free(ptszPopupText);
- MessageBox(nullptr, ptszMBox, TranslateT(ModuleName), MB_ICONINFORMATION);
+ MessageBox(nullptr, ptszMBox, TranslateT(MODULENAME), MB_ICONINFORMATION);
}
}
}
diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp index 5c11b907fb..a1b4f4ad20 100644 --- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp +++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp @@ -28,7 +28,9 @@ int &hLangpack(g_plugin.m_hLang); COptPage *g_PreviewOptPage; // we need to show popup even for the NULL contact if g_PreviewOptPage is not NULL (used for popup preview)
BOOL bPopupExists = FALSE, bFingerprintExists = FALSE, bVariablesExists = FALSE;
-PLUGININFOEX pluginInfo = {
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -41,11 +43,17 @@ PLUGININFOEX pluginInfo = { {0xb68a8906, 0x748b, 0x435d, {0x93, 0xe, 0x21, 0xcc, 0x6e, 0x8f, 0x3b, 0x3f}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
static int CALLBACK MenuWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg) {
@@ -58,12 +66,11 @@ static int CALLBACK MenuWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
-
static VOID NTAPI ShowContactMenu(ULONG_PTR wParam)
// wParam = hContact
{
POINT pt;
- HWND hMenuWnd = CreateWindowEx(WS_EX_TOOLWINDOW, L"static", _A2W(MOD_NAME) L"_MenuWindow", 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, nullptr, g_plugin.getInst(), nullptr);
+ HWND hMenuWnd = CreateWindowEx(WS_EX_TOOLWINDOW, L"static", _A2W(MODULENAME) L"_MenuWindow", 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, nullptr, g_plugin.getInst(), nullptr);
SetWindowLongPtr(hMenuWnd, GWLP_WNDPROC, (LONG_PTR)MenuWndProc);
HMENU hMenu = Menu_BuildContactMenu(wParam);
GetCursorPos(&pt);
@@ -74,7 +81,6 @@ static VOID NTAPI ShowContactMenu(ULONG_PTR wParam) DestroyWindow(hMenuWnd);
}
-
void Popup_DoAction(HWND hWnd, BYTE Action, PLUGIN_DATA*)
{
MCONTACT hContact = (MCONTACT)CallService(MS_POPUP_GETCONTACT, (WPARAM)hWnd, 0);
@@ -108,7 +114,6 @@ void Popup_DoAction(HWND hWnd, BYTE Action, PLUGIN_DATA*) }
}
-
static LRESULT CALLBACK PopupWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PLUGIN_DATA *pdata = (PLUGIN_DATA*)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd, 0);
@@ -137,7 +142,6 @@ static LRESULT CALLBACK PopupWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA return DefWindowProc(hWnd, message, wParam, lParam);
}
-
void ShowPopup(SHOWPOPUP_DATA *sd)
{
TCString PopupText;
@@ -195,8 +199,8 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) if (sd.MirVer.IsEmpty())
return 0;
}
- sd.OldMirVer = db_get_s(hContact, MOD_NAME, DB_OLDMIRVER, L"");
- db_set_ws(hContact, MOD_NAME, DB_OLDMIRVER, sd.MirVer); // we have to write it here, because we modify sd.OldMirVer and sd.MirVer to conform our settings later
+ sd.OldMirVer = db_get_s(hContact, MODULENAME, DB_OLDMIRVER, L"");
+ db_set_ws(hContact, MODULENAME, DB_OLDMIRVER, sd.MirVer); // we have to write it here, because we modify sd.OldMirVer and sd.MirVer to conform our settings later
if (sd.OldMirVer.IsEmpty()) // looks like it's the right way to do
return 0;
@@ -215,9 +219,9 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) if (hContact && db_get_b(hContactOrMeta, "CList", "Hidden", 0))
return 0;
- int PerContactSetting = hContact ? db_get_b(hContact, MOD_NAME, DB_CCN_NOTIFY, NOTIFY_USEGLOBAL) : NOTIFY_ALWAYS; // NOTIFY_ALWAYS for preview
+ int PerContactSetting = hContact ? db_get_b(hContact, MODULENAME, DB_CCN_NOTIFY, NOTIFY_USEGLOBAL) : NOTIFY_ALWAYS; // NOTIFY_ALWAYS for preview
if (PerContactSetting == NOTIFY_USEGLOBAL && hContactOrMeta != hContact) // subcontact setting has a priority over a metacontact setting
- PerContactSetting = db_get_b(hContactOrMeta, MOD_NAME, DB_CCN_NOTIFY, NOTIFY_USEGLOBAL);
+ PerContactSetting = db_get_b(hContactOrMeta, MODULENAME, DB_CCN_NOTIFY, NOTIFY_USEGLOBAL);
if (PerContactSetting && (PerContactSetting == NOTIFY_ALMOST_ALWAYS || PerContactSetting == NOTIFY_ALWAYS || !PopupOptPage.GetValue(IDC_POPUPOPTDLG_USESTATUSNOTIFYFLAG) || !(db_get_dw(hContactOrMeta, "Ignore", "Mask1", 0) & 0x8))) { // check if we need to notify at all
sd.hContact = hContact;
@@ -291,12 +295,14 @@ INT_PTR CALLBACK CCNErrorDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM) case WM_DESTROY:
if (IsDlgButtonChecked(hwndDlg, IDC_DONTREMIND))
- db_set_b(NULL, MOD_NAME, DB_NO_FINGERPRINT_ERROR, 1);
+ db_set_b(NULL, MODULENAME, DB_NO_FINGERPRINT_ERROR, 1);
break;
}
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
static int ModuleLoad(WPARAM, LPARAM)
{
bPopupExists = ServiceExists(MS_POPUP_ADDPOPUPT);
@@ -305,7 +311,7 @@ static int ModuleLoad(WPARAM, LPARAM) return 0;
}
-int MirandaLoaded(WPARAM, LPARAM)
+static int MirandaLoaded(WPARAM, LPARAM)
{
ModuleLoad(0, 0);
COptPage PopupOptPage(g_PopupOptPage);
@@ -336,7 +342,7 @@ int MirandaLoaded(WPARAM, LPARAM) }
// seems that Fingerprint is not installed
- if (!bFingerprintExists && !db_get_b(NULL, MOD_NAME, DB_NO_FINGERPRINT_ERROR, 0))
+ if (!bFingerprintExists && !db_get_b(NULL, MODULENAME, DB_NO_FINGERPRINT_ERROR, 0))
CreateDialog(g_plugin.getInst(), MAKEINTRESOURCE(IDD_CCN_ERROR), nullptr, CCNErrorDlgProc);
return 0;
@@ -344,23 +350,25 @@ int MirandaLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
HookEvent(ME_SYSTEM_MODULESLOADED, MirandaLoaded);
DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &g_hMainThread, THREAD_SET_CONTEXT, false, 0);
InitOptions();
- if (db_get_b(NULL, MOD_NAME, DB_SETTINGSVER, 0) < 1) {
+ if (db_get_b(NULL, MODULENAME, DB_SETTINGSVER, 0) < 1) {
TCString Str;
- Str = db_get_s(NULL, MOD_NAME, DB_IGNORESUBSTRINGS, L"");
+ Str = db_get_s(NULL, MODULENAME, DB_IGNORESUBSTRINGS, L"");
if (Str.GetLen()) // fix incorrect regexp from v0.1.1.0
- db_set_ws(NULL, MOD_NAME, DB_IGNORESUBSTRINGS, Str.Replace(L"/Miranda[0-9A-F]{8}/", L"/[0-9A-F]{8}(\\W|$)/"));
+ db_set_ws(NULL, MODULENAME, DB_IGNORESUBSTRINGS, Str.Replace(L"/Miranda[0-9A-F]{8}/", L"/[0-9A-F]{8}(\\W|$)/"));
- db_set_b(NULL, MOD_NAME, DB_SETTINGSVER, 1);
+ db_set_b(NULL, MODULENAME, DB_SETTINGSVER, 1);
}
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Unload()
{
CloseHandle(g_hMainThread);
diff --git a/plugins/ClientChangeNotify/src/OptDlg.cpp b/plugins/ClientChangeNotify/src/OptDlg.cpp index 55ce10cbd2..57653c71aa 100644 --- a/plugins/ClientChangeNotify/src/OptDlg.cpp +++ b/plugins/ClientChangeNotify/src/OptDlg.cpp @@ -21,7 +21,7 @@ // ================================================ Popup options ================================================
-COptPage g_PopupOptPage(MOD_NAME, nullptr);
+COptPage g_PopupOptPage(MODULENAME, nullptr);
void EnablePopupOptDlgControls()
{
@@ -128,7 +128,7 @@ INT_PTR CALLBACK PopupOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara DBCONTACTWRITESETTING cws = {};
cws.szModule = "ICQ";
cws.szSetting = DB_MIRVER;
- db_set_s(NULL, MOD_NAME, DB_OLDMIRVER, "ICQ Lite v5");
+ db_set_s(NULL, MODULENAME, DB_OLDMIRVER, "ICQ Lite v5");
ContactSettingChanged(NULL, (LPARAM)&cws); // simulate a version change
delete g_PreviewOptPage;
g_PreviewOptPage = nullptr;
diff --git a/plugins/ClientChangeNotify/src/stdafx.h b/plugins/ClientChangeNotify/src/stdafx.h index 2b9c9168d1..497ee6ac1d 100644 --- a/plugins/ClientChangeNotify/src/stdafx.h +++ b/plugins/ClientChangeNotify/src/stdafx.h @@ -82,17 +82,15 @@ #define NOTIFYTIMER_INTERVAL 3500
-#define MOD_NAME "ClientChangeNotify"
+#define MODULENAME "ClientChangeNotify"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MOD_NAME)
- {}
+ CMPlugin();
};
-#define LOG_ID MOD_NAME
-#define LOG_PREFIX MOD_NAME ": " // for netlib.log
+#define LOG_ID MODULENAME
+#define LOG_PREFIX MODULENAME ": " // for netlib.log
#define MS_NETLIB_LOG "Netlib/Log"
diff --git a/plugins/Clist_blind/src/init.cpp b/plugins/Clist_blind/src/init.cpp index 02a59200c4..e92ff96471 100644 --- a/plugins/Clist_blind/src/init.cpp +++ b/plugins/Clist_blind/src/init.cpp @@ -53,8 +53,8 @@ int CListOptInit(WPARAM wParam, LPARAM lParam); /////////////////////////////////////////////////////////////////////////////////////////
// returns the plugin information
-PLUGININFOEX pluginInfo = {
- sizeof(pluginInfo),
+PLUGININFOEX pluginInfoEx = {
+ sizeof(pluginInfoEx),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
__DESCRIPTION,
@@ -66,9 +66,13 @@ PLUGININFOEX pluginInfo = { {0x53e095a3, 0x2695, 0x490a, {0x9d, 0xad, 0xd2, 0x4, 0x79, 0x9, 0x38, 0x31}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>("CList", pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/Clist_blind/src/stdafx.h b/plugins/Clist_blind/src/stdafx.h index e6d70346c9..86e83604c4 100644 --- a/plugins/Clist_blind/src/stdafx.h +++ b/plugins/Clist_blind/src/stdafx.h @@ -41,9 +41,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>("CList")
- {}
+ CMPlugin();
};
struct ClcContact : public ClcContactBase {};
diff --git a/plugins/Clist_modern/src/init.cpp b/plugins/Clist_modern/src/init.cpp index 45a2b51208..c7625a6cf8 100644 --- a/plugins/Clist_modern/src/init.cpp +++ b/plugins/Clist_modern/src/init.cpp @@ -45,7 +45,7 @@ int EventArea_UnloadModule(); /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo = {
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -58,9 +58,13 @@ PLUGININFOEX pluginInfo = { { 0x43909b6, 0xaad8, 0x4d82, { 0x8e, 0xb5, 0x9f, 0x64, 0xcf, 0xe8, 0x67, 0xcd } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>("CList", pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -71,7 +75,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_CLIST, extern "C" __declspec(dllexport) int CListInitialise()
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
g_dwMainThreadID = GetCurrentThreadId();
g_hMirApp = GetModuleHandleA("mir_app.mir");
diff --git a/plugins/Clist_modern/src/modern_commonprototypes.h b/plugins/Clist_modern/src/modern_commonprototypes.h index 94a13e282b..1f0a473375 100644 --- a/plugins/Clist_modern/src/modern_commonprototypes.h +++ b/plugins/Clist_modern/src/modern_commonprototypes.h @@ -5,8 +5,6 @@ #define SKIN "ModernSkin"
-extern PLUGININFOEX pluginInfo;
-extern CLIST_INTERFACE * pcli;
extern CLIST_INTERFACE corecli;
//Global variables
diff --git a/plugins/Clist_modern/src/stdafx.h b/plugins/Clist_modern/src/stdafx.h index 7b9cdf6575..39a21ac3a5 100644 --- a/plugins/Clist_modern/src/stdafx.h +++ b/plugins/Clist_modern/src/stdafx.h @@ -104,9 +104,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>("CList")
- {}
+ CMPlugin();
};
#include "modern_global_structure.h"
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp index ac80989315..93e8c19b64 100644 --- a/plugins/Clist_nicer/src/init.cpp +++ b/plugins/Clist_nicer/src/init.cpp @@ -63,7 +63,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+static PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -77,9 +77,13 @@ PLUGININFOEX pluginInfo = { 0x8f79b4ee, 0xeb48, 0x4a03, { 0x87, 0x3e, 0x27, 0xbe, 0x6b, 0x7e, 0x9a, 0x25 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>("CList", pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -112,7 +116,7 @@ static int systemModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) CListInitialise()
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
coreCli = *pcli;
diff --git a/plugins/Clist_nicer/src/stdafx.h b/plugins/Clist_nicer/src/stdafx.h index ded6de7f66..095baf763d 100644 --- a/plugins/Clist_nicer/src/stdafx.h +++ b/plugins/Clist_nicer/src/stdafx.h @@ -74,15 +74,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>("CList")
- {}
+ CMPlugin();
};
// shared vars
extern LONG g_cxsmIcon, g_cysmIcon;
-extern PLUGININFOEX pluginInfo;
extern LIST<StatusItems_t> arStatusItems;
extern ImageItem *g_glyphItem;
extern HIMAGELIST hCListImages;
diff --git a/plugins/Cln_skinedit/src/main.cpp b/plugins/Cln_skinedit/src/main.cpp index afdd65f2a9..998ab537c1 100644 --- a/plugins/Cln_skinedit/src/main.cpp +++ b/plugins/Cln_skinedit/src/main.cpp @@ -26,7 +26,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define ID_EXTBKSEPARATOR 40200 -PLUGININFOEX pluginInfo = { +CMPlugin g_plugin; +int &hLangpack(g_plugin.m_hLang); + +StatusItems_t **StatusItems; +ChangedSItems_t ChangedSItems = { 0 }; + +static int LastModifiedItem = -1; +static int last_selcount = 0; +static int last_indizes[64]; +static int ID_EXTBK_LAST = 0, ID_EXTBK_FIRST = 0; + +///////////////////////////////////////////////////////////////////////////////////////// + +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), @@ -39,20 +52,17 @@ PLUGININFOEX pluginInfo = { {0x21948c89, 0xb549, 0x4c9d, {0x8b, 0x4f, 0x3f, 0x37, 0x26, 0xec, 0x6b, 0x4b}} }; -CMPlugin g_plugin; -int &hLangpack(g_plugin.m_hLang); +CMPlugin::CMPlugin() : + PLUGIN<CMPlugin>("Skin editor", pluginInfoEx) +{} -StatusItems_t **StatusItems; -ChangedSItems_t ChangedSItems = { 0 }; - -static int LastModifiedItem = -1; -static int last_selcount = 0; -static int last_indizes[64]; -static int ID_EXTBK_LAST = 0, ID_EXTBK_FIRST = 0; +extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD) +{ + return &pluginInfoEx; +} -/* - * prototypes - */ +///////////////////////////////////////////////////////////////////////////////////////// +// prototypes static void ChangeControlItems(HWND hwndDlg, int status, int except); static BOOL CheckItem(int item, HWND hwndDlg); @@ -886,36 +896,18 @@ static INT_PTR SkinEdit_Invoke(WPARAM, LPARAM lParam) TabCtrl_InsertItem(psd->hWndTab, iTabs++, &tci); MoveWindow((HWND)tci.lParam, 5, 25, rcClient.right - 9, rcClient.bottom - 60, 1); psd->hwndSkinEdit = (HWND)tci.lParam; - - /* - tci.lParam = (LPARAM)CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_IMAGEITEMEDIT), psd->hWndParent, SkinEdit_ImageItemEditProc, (LPARAM)psd); - tci.pszText = TranslateT("Image items"); - TabCtrl_InsertItem(psd->hWndTab, iTabs++, &tci); - MoveWindow((HWND)tci.lParam, 5, 25, rcClient.right - 9, rcClient.bottom - 60, 1); - psd->hwndImageEdit = (HWND)tci.lParam; - */ - return (INT_PTR)psd->hwndSkinEdit; } - -static int LoadModule() +extern "C" int __declspec(dllexport) Load(void) { + mir_getLP(&pluginInfoEx); CreateServiceFunction(MS_CLNSE_INVOKE, SkinEdit_Invoke); CreateServiceFunction(MS_CLNSE_FILLBYCURRENTSEL, SkinEdit_FillByCurrentSel); return 0; } -extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD) -{ - return &pluginInfo; -} - -extern "C" int __declspec(dllexport) Load(void) -{ - mir_getLP(&pluginInfo); - return LoadModule(); -} +///////////////////////////////////////////////////////////////////////////////////////// extern "C" int __declspec(dllexport) Unload(void) { diff --git a/plugins/Cln_skinedit/src/stdafx.h b/plugins/Cln_skinedit/src/stdafx.h index ff936b7ce6..5f96c2f53a 100644 --- a/plugins/Cln_skinedit/src/stdafx.h +++ b/plugins/Cln_skinedit/src/stdafx.h @@ -39,7 +39,5 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>("Skin editor")
- {}
+ CMPlugin();
};
diff --git a/plugins/CloudFile/src/Services/dropbox_service.cpp b/plugins/CloudFile/src/Services/dropbox_service.cpp index e7be5f4157..7a95027d2a 100644 --- a/plugins/CloudFile/src/Services/dropbox_service.cpp +++ b/plugins/CloudFile/src/Services/dropbox_service.cpp @@ -119,7 +119,7 @@ void CDropboxService::HandleJsonError(JSONNode &node) auto CDropboxService::UploadFile(const char *data, size_t size, const std::string &path) { ptrA token(getStringA("TokenSecret")); - BYTE strategy = db_get_b(NULL, MODULE, "ConflictStrategy", OnConflict::REPLACE); + BYTE strategy = db_get_b(NULL, MODULENAME, "ConflictStrategy", OnConflict::REPLACE); DropboxAPI::UploadFileRequest request(token, path.c_str(), data, size, (OnConflict)strategy); NLHR_PTR response(request.Send(m_hConnection)); @@ -148,7 +148,7 @@ void CDropboxService::UploadFileChunk(const std::string &sessionId, const char * auto CDropboxService::CommitUploadSession(const std::string &sessionId, const char *data, size_t size, size_t offset, const std::string &path) { ptrA token(getStringA("TokenSecret")); - BYTE strategy = db_get_b(NULL, MODULE, "ConflictStrategy", OnConflict::REPLACE); + BYTE strategy = db_get_b(NULL, MODULENAME, "ConflictStrategy", OnConflict::REPLACE); DropboxAPI::CommitUploadSessionRequest request(token, sessionId.c_str(), offset, path.c_str(), data, size, (OnConflict)strategy); NLHR_PTR response(request.Send(m_hConnection)); @@ -289,7 +289,7 @@ void CDropboxService::Upload(FileTransferParam *ftp) struct CMPluginDropbox : public PLUGIN<CMPluginDropbox> { CMPluginDropbox() : - PLUGIN<CMPluginDropbox>(MODULE "/Dropbox") + PLUGIN<CMPluginDropbox>(MODULENAME "/Dropbox", pluginInfoEx) { m_hInst = g_plugin.getInst(); diff --git a/plugins/CloudFile/src/Services/google_service.cpp b/plugins/CloudFile/src/Services/google_service.cpp index 798981a9c9..906e9e817d 100644 --- a/plugins/CloudFile/src/Services/google_service.cpp +++ b/plugins/CloudFile/src/Services/google_service.cpp @@ -286,7 +286,7 @@ void CGDriveService::Upload(FileTransferParam *ftp) struct CMPluginGoogle : public CMPluginBase { CMPluginGoogle() : - CMPluginBase(MODULE "/GDrive") + CMPluginBase(MODULENAME "/GDrive", pluginInfoEx) { m_hInst = g_plugin.getInst(); diff --git a/plugins/CloudFile/src/Services/microsoft_service.cpp b/plugins/CloudFile/src/Services/microsoft_service.cpp index 722560aec8..5adf66649a 100644 --- a/plugins/CloudFile/src/Services/microsoft_service.cpp +++ b/plugins/CloudFile/src/Services/microsoft_service.cpp @@ -140,7 +140,7 @@ void COneDriveService::HandleJsonError(JSONNode &node) auto COneDriveService::UploadFile(const std::string &parentId, const std::string &fileName, const char *data, size_t size) { ptrA token(getStringA("TokenSecret")); - BYTE strategy = db_get_b(NULL, MODULE, "ConflictStrategy", OnConflict::REPLACE); + BYTE strategy = db_get_b(NULL, MODULENAME, "ConflictStrategy", OnConflict::REPLACE); OneDriveAPI::UploadFileRequest *request = !parentId.empty() ? new OneDriveAPI::UploadFileRequest(token, parentId.c_str(), fileName.c_str(), data, size, (OnConflict)strategy) : new OneDriveAPI::UploadFileRequest(token, fileName.c_str(), data, size, (OnConflict)strategy); @@ -154,7 +154,7 @@ auto COneDriveService::UploadFile(const std::string &parentId, const std::string auto COneDriveService::CreateUploadSession(const std::string &parentId, const std::string &fileName) { ptrA token(getStringA("TokenSecret")); - BYTE strategy = db_get_b(NULL, MODULE, "ConflictStrategy", OnConflict::REPLACE); + BYTE strategy = db_get_b(NULL, MODULENAME, "ConflictStrategy", OnConflict::REPLACE); OneDriveAPI::CreateUploadSessionRequest *request = !parentId.empty() ? new OneDriveAPI::CreateUploadSessionRequest(token, parentId.c_str(), fileName.c_str(), (OnConflict)strategy) : new OneDriveAPI::CreateUploadSessionRequest(token, fileName.c_str(), (OnConflict)strategy); @@ -259,7 +259,7 @@ void COneDriveService::Upload(FileTransferParam *ftp) struct CMPluginOnedrive : public CMPluginBase { CMPluginOnedrive() : - CMPluginBase(MODULE "/OneDrive") + CMPluginBase(MODULENAME "/OneDrive", pluginInfoEx) { m_hInst = g_plugin.getInst(); diff --git a/plugins/CloudFile/src/Services/yandex_service.cpp b/plugins/CloudFile/src/Services/yandex_service.cpp index 6609e7c4b3..c5dbb50400 100644 --- a/plugins/CloudFile/src/Services/yandex_service.cpp +++ b/plugins/CloudFile/src/Services/yandex_service.cpp @@ -153,7 +153,7 @@ void CYandexService::HandleJsonError(JSONNode &node) auto CYandexService::CreateUploadSession(const std::string &path) { ptrA token(getStringA("TokenSecret")); - BYTE strategy = db_get_b(NULL, MODULE, "ConflictStrategy", OnConflict::REPLACE); + BYTE strategy = db_get_b(NULL, MODULENAME, "ConflictStrategy", OnConflict::REPLACE); YandexAPI::GetUploadUrlRequest request(token, path.c_str(), (OnConflict)strategy); NLHR_PTR response(request.Send(m_hConnection)); @@ -280,7 +280,7 @@ void CYandexService::Upload(FileTransferParam *ftp) struct CMPluginYandex : public CMPluginBase { CMPluginYandex() : - CMPluginBase(MODULE "/YandexDisk") + CMPluginBase(MODULENAME "/YandexDisk", pluginInfoEx) { m_hInst = g_plugin.getInst(); diff --git a/plugins/CloudFile/src/events.cpp b/plugins/CloudFile/src/events.cpp index f8770b5574..08bbd2974d 100644 --- a/plugins/CloudFile/src/events.cpp +++ b/plugins/CloudFile/src/events.cpp @@ -13,7 +13,7 @@ static int OnProtoAck(WPARAM, LPARAM lParam) continue; BBButton bbd = {}; - bbd.pszModuleName = MODULE; + bbd.pszModuleName = MODULENAME; bbd.dwButtonID = BBB_ID_FILE_SEND; bbd.bbbFlags = CanSendToContact(hContact) ? BBSF_RELEASED diff --git a/plugins/CloudFile/src/file_transfer.h b/plugins/CloudFile/src/file_transfer.h index 95ce0aa120..692e717f2e 100644 --- a/plugins/CloudFile/src/file_transfer.h +++ b/plugins/CloudFile/src/file_transfer.h @@ -43,7 +43,7 @@ public: pfts.szWorkingDir.w = NULL; pfts.szCurrentFile.w = NULL; - ProtoBroadcastAck(MODULE, pfts.hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, (HANDLE)id, 0); + ProtoBroadcastAck(MODULENAME, pfts.hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, (HANDLE)id, 0); } ~FileTransferParam() @@ -210,7 +210,7 @@ public: pfts.currentFileProgress += count; pfts.totalProgress += count; if (pfts.hContact) - ProtoBroadcastAck(MODULE, pfts.hContact, ACKTYPE_FILE, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&pfts); + ProtoBroadcastAck(MODULENAME, pfts.hContact, ACKTYPE_FILE, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&pfts); } void FirstFile() @@ -221,7 +221,7 @@ public: pfts.currentFileProgress = 0; pfts.szCurrentFile.w = wcsrchr(pfts.pszFiles.w[pfts.currentFileNumber], '\\') + 1; if (pfts.hContact) - ProtoBroadcastAck(MODULE, pfts.hContact, ACKTYPE_FILE, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&pfts); + ProtoBroadcastAck(MODULENAME, pfts.hContact, ACKTYPE_FILE, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&pfts); OpenCurrentFile(); CheckCurrentFile(); @@ -237,7 +237,7 @@ public: pfts.currentFileProgress = 0; pfts.szCurrentFile.w = wcsrchr(pfts.pszFiles.w[pfts.currentFileNumber], '\\') + 1; if (pfts.hContact) - ProtoBroadcastAck(MODULE, pfts.hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, (HANDLE)id, 0); + ProtoBroadcastAck(MODULENAME, pfts.hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, (HANDLE)id, 0); OpenCurrentFile(); CheckCurrentFile(); @@ -248,7 +248,7 @@ public: void SetStatus(int status, LPARAM param = 0) { if (pfts.hContact) - ProtoBroadcastAck(MODULE, pfts.hContact, ACKTYPE_FILE, status, (HANDLE)id, param); + ProtoBroadcastAck(MODULENAME, pfts.hContact, ACKTYPE_FILE, status, (HANDLE)id, param); } }; diff --git a/plugins/CloudFile/src/icons.cpp b/plugins/CloudFile/src/icons.cpp index 10ec5cba9f..001df50240 100644 --- a/plugins/CloudFile/src/icons.cpp +++ b/plugins/CloudFile/src/icons.cpp @@ -11,7 +11,7 @@ static IconItem iconList[] = void InitializeIcons() { - g_plugin.registerIcon("Protocols/" MODULE, iconList, MODULE); + g_plugin.registerIcon("Protocols/" MODULENAME, iconList, MODULENAME); } HANDLE GetIconHandle(int iconId) diff --git a/plugins/CloudFile/src/main.cpp b/plugins/CloudFile/src/main.cpp index c3c6cb7be9..3ca65743d4 100644 --- a/plugins/CloudFile/src/main.cpp +++ b/plugins/CloudFile/src/main.cpp @@ -1,8 +1,9 @@ #include "stdafx.h" +CMPlugin g_plugin; int &hLangpack(g_plugin.m_hLang); -PLUGININFOEX pluginInfo = +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -16,16 +17,16 @@ PLUGININFOEX pluginInfo = { 0xe876fe63, 0x701, 0x4cda, { 0xbe, 0xd5, 0x7c, 0x73, 0xa3, 0x79, 0xc1, 0xd1 }} }; +CMPlugin::CMPlugin() : + PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx) +{} + extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { - return &pluginInfo; + return &pluginInfoEx; } ///////////////////////////////////////////////////////////////////////////////////////// - -CMPlugin g_plugin; - -///////////////////////////////////////////////////////////////////////////////////////// // Interface information extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST }; @@ -34,7 +35,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC extern "C" int __declspec(dllexport) Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); diff --git a/plugins/CloudFile/src/menus.cpp b/plugins/CloudFile/src/menus.cpp index fed19569f6..b05b9d5e87 100644 --- a/plugins/CloudFile/src/menus.cpp +++ b/plugins/CloudFile/src/menus.cpp @@ -15,12 +15,12 @@ void InitializeMenus() SET_UID(mi, 0x93d4495b, 0x259b, 0x4fba, 0xbc, 0x14, 0xf9, 0x46, 0x2c, 0xda, 0xfc, 0x6d); mi.name.a = LPGEN("Upload to..."); - ptrA defaultService(db_get_sa(NULL, MODULE, "DefaultService")); + ptrA defaultService(db_get_sa(NULL, MODULENAME, "DefaultService")); if (defaultService) { CCloudService *service = FindService(defaultService); if (service) { mi.name.a = LPGEN("Upload"); - mi.pszService = MODULE "/Default/Upload"; + mi.pszService = MODULENAME "/Default/Upload"; CreateServiceFunctionObj(mi.pszService, UploadMenuCommand, service); } } diff --git a/plugins/CloudFile/src/options.cpp b/plugins/CloudFile/src/options.cpp index ef643b0e50..1277aed11c 100644 --- a/plugins/CloudFile/src/options.cpp +++ b/plugins/CloudFile/src/options.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" COptionsMainDlg::COptionsMainDlg() - : CPluginDlgBase(g_plugin, IDD_OPTIONS_MAIN, MODULE), + : CPluginDlgBase(g_plugin, IDD_OPTIONS_MAIN, MODULENAME), m_defaultService(this, IDC_DEFAULTSERVICE), m_doNothingOnConflict(this, IDC_DONOTHINGONCONFLICT), m_renameOnConflict(this, IDC_RENAMEONCONFLICT), @@ -21,7 +21,7 @@ void COptionsMainDlg::OnInitDialog() { CDlgBase::OnInitDialog(); - ptrA defaultService(db_get_sa(NULL, MODULE, "DefaultService")); + ptrA defaultService(db_get_sa(NULL, MODULENAME, "DefaultService")); int iItem = m_defaultService.AddString(TranslateT("None")); m_defaultService.SetCurSel(iItem); @@ -31,7 +31,7 @@ void COptionsMainDlg::OnInitDialog() m_defaultService.SetCurSel(iItem); } - BYTE strategy = db_get_b(NULL, MODULE, "ConflictStrategy", OnConflict::REPLACE); + BYTE strategy = db_get_b(NULL, MODULENAME, "ConflictStrategy", OnConflict::REPLACE); switch (strategy) { case OnConflict::RENAME: @@ -57,16 +57,16 @@ void COptionsMainDlg::OnApply() int iItem = m_defaultService.GetCurSel(); CCloudService *service = (CCloudService*)m_defaultService.GetItemData(iItem); if (service) - db_set_s(NULL, MODULE, "DefaultService", service->GetAccountName()); + db_set_s(NULL, MODULENAME, "DefaultService", service->GetAccountName()); else - db_unset(NULL, MODULE, "DefaultService"); + db_unset(NULL, MODULENAME, "DefaultService"); if (m_renameOnConflict.GetState()) - db_set_b(NULL, MODULE, "ConflictStrategy", OnConflict::RENAME); + db_set_b(NULL, MODULENAME, "ConflictStrategy", OnConflict::RENAME); else if (m_repalceOnConflict.GetState()) - db_set_b(NULL, MODULE, "ConflictStrategy", OnConflict::REPLACE); + db_set_b(NULL, MODULENAME, "ConflictStrategy", OnConflict::REPLACE); else - db_unset(NULL, MODULE, "ConflictStrategy"); + db_unset(NULL, MODULENAME, "ConflictStrategy"); } ///////////////////////////////////////////////////////////////////////////////// @@ -74,7 +74,7 @@ void COptionsMainDlg::OnApply() int OnOptionsInitialized(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = { 0 }; - odp.szTitle.w = _A2W(MODULE); + odp.szTitle.w = _A2W(MODULENAME); odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE; odp.szGroup.w = LPGENW("Services"); diff --git a/plugins/CloudFile/src/services.cpp b/plugins/CloudFile/src/services.cpp index d367dc1fe8..9f1867cb6e 100644 --- a/plugins/CloudFile/src/services.cpp +++ b/plugins/CloudFile/src/services.cpp @@ -24,7 +24,7 @@ static INT_PTR GetService(WPARAM wParam, LPARAM lParam) ptrA accountName(mir_strdup((char*)wParam)); if (!accountName || !mir_strlen(accountName)) - accountName = db_get_sa(NULL, MODULE, "DefaultService"); + accountName = db_get_sa(NULL, MODULENAME, "DefaultService"); if (accountName == nullptr) return 2; @@ -63,7 +63,7 @@ INT_PTR Upload(WPARAM wParam, LPARAM lParam) ptrA accountName(mir_strdup(uploadData->accountName)); if (!mir_strlen(accountName)) - accountName = db_get_sa(NULL, MODULE, "DefaultService"); + accountName = db_get_sa(NULL, MODULENAME, "DefaultService"); if (accountName == nullptr) return 2; @@ -96,9 +96,9 @@ INT_PTR Upload(WPARAM wParam, LPARAM lParam) void InitializeServices() { - Proto_RegisterModule(PROTOTYPE_FILTER, MODULE); + Proto_RegisterModule(PROTOTYPE_FILTER, MODULENAME); - CreateServiceFunction(MODULE PSS_FILE, SendFileInterceptor); + CreateServiceFunction(MODULENAME PSS_FILE, SendFileInterceptor); CreateServiceFunction(MS_CLOUDFILE_GETSERVICE, GetService); CreateServiceFunction(MS_CLOUDFILE_ENUMSERVICES, EnumServices); diff --git a/plugins/CloudFile/src/srmm.cpp b/plugins/CloudFile/src/srmm.cpp index 2a49cdb7ef..fd90be1d6c 100644 --- a/plugins/CloudFile/src/srmm.cpp +++ b/plugins/CloudFile/src/srmm.cpp @@ -3,7 +3,7 @@ int OnSrmmToolbarLoaded(WPARAM, LPARAM) { BBButton bbd = {}; - bbd.pszModuleName = MODULE; + bbd.pszModuleName = MODULENAME; bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_ISARROWBUTTON; CMStringW tooltip(FORMAT, TranslateT("Upload files to...")); @@ -21,7 +21,7 @@ int OnSrmmWindowOpened(WPARAM, LPARAM lParam) MessageWindowEventData *ev = (MessageWindowEventData*)lParam; if (ev->uType == MSG_WINDOW_EVT_OPENING && ev->hContact) { BBButton bbd = {}; - bbd.pszModuleName = MODULE; + bbd.pszModuleName = MODULENAME; bbd.dwButtonID = BBB_ID_FILE_SEND; bbd.bbbFlags = CanSendToContact(ev->hContact) ? BBSF_RELEASED @@ -36,14 +36,14 @@ int OnSrmmButtonPressed(WPARAM, LPARAM lParam) { CustomButtonClickData *cbc = (CustomButtonClickData*)lParam; - if (mir_strcmp(cbc->pszModule, MODULE)) + if (mir_strcmp(cbc->pszModule, MODULENAME)) return 0; if (cbc->dwButtonId != BBB_ID_FILE_SEND) return 0; if (cbc->flags != BBCF_ARROWCLICKED) { - ptrA defaultService(db_get_sa(NULL, MODULE, "DefaultService")); + ptrA defaultService(db_get_sa(NULL, MODULENAME, "DefaultService")); if (defaultService) { CCloudService *service = FindService(defaultService); if (service) diff --git a/plugins/CloudFile/src/stdafx.h b/plugins/CloudFile/src/stdafx.h index 7a54a943b9..cc8ce7c9f6 100644 --- a/plugins/CloudFile/src/stdafx.h +++ b/plugins/CloudFile/src/stdafx.h @@ -42,6 +42,7 @@ class CCloudService; #include "options.h" extern HNETLIBUSER hNetlibConnection; +extern PLUGININFOEX pluginInfoEx; class Exception { @@ -59,7 +60,7 @@ public: } }; -#define MODULE "CloudFile" +#define MODULENAME "CloudFile" #define FILE_CHUNK_SIZE 1024 * 1024 //1 MB @@ -118,9 +119,7 @@ CCloudService* FindService(const char *szProto); struct CMPlugin : public PLUGIN<CMPlugin> { - CMPlugin() : - PLUGIN<CMPlugin>(MODULE) - {} + CMPlugin(); }; #endif //_COMMON_H_
\ No newline at end of file diff --git a/plugins/CloudFile/src/utils.cpp b/plugins/CloudFile/src/utils.cpp index cb9bb8bf94..22611fe539 100644 --- a/plugins/CloudFile/src/utils.cpp +++ b/plugins/CloudFile/src/utils.cpp @@ -21,13 +21,13 @@ void ShowNotification(const wchar_t *caption, const wchar_t *message, int flags, void ShowNotification(const wchar_t *message, int flags, MCONTACT hContact) { - ShowNotification(_A2W(MODULE), message, flags, hContact); + ShowNotification(_A2W(MODULENAME), message, flags, hContact); } MEVENT AddEventToDb(MCONTACT hContact, WORD type, DWORD flags, DWORD cbBlob, PBYTE pBlob) { DBEVENTINFO dbei = {}; - dbei.szModule = MODULE; + dbei.szModule = MODULENAME; dbei.timestamp = time(0); dbei.eventType = type; dbei.cbBlob = cbBlob; @@ -102,12 +102,12 @@ void PasteToClipboard(const wchar_t *data) void Report(MCONTACT hContact, const wchar_t *data) { - if (db_get_b(NULL, MODULE, "UrlAutoSend", 1)) + if (db_get_b(NULL, MODULENAME, "UrlAutoSend", 1)) SendToContact(hContact, data); - if (db_get_b(NULL, MODULE, "UrlPasteToMessageInputArea", 0)) + if (db_get_b(NULL, MODULENAME, "UrlPasteToMessageInputArea", 0)) PasteToInputArea(hContact, data); - if (db_get_b(NULL, MODULE, "UrlCopyToClipboard", 0)) + if (db_get_b(NULL, MODULENAME, "UrlCopyToClipboard", 0)) PasteToClipboard(data); } diff --git a/plugins/CmdLine/src/CmdLine.cpp b/plugins/CmdLine/src/CmdLine.cpp index 55ee6fe732..5edd978456 100644 --- a/plugins/CmdLine/src/CmdLine.cpp +++ b/plugins/CmdLine/src/CmdLine.cpp @@ -24,7 +24,9 @@ CMPlugin g_plugin; int &hLangpack(g_plugin.m_hLang);
CLIST_INTERFACE *pcli;
-PLUGININFOEX pluginInfo = {
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -37,14 +39,20 @@ PLUGININFOEX pluginInfo = { {0x2f1a117c, 0x3c1b, 0x4c01, {0x89, 0xea, 0x6d, 0x8f, 0xd8, 0x5a, 0x9b, 0x4c}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
if (InitServer())
@@ -54,6 +62,8 @@ extern "C" int __declspec(dllexport) Load(void) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Unload()
{
bWaitForUnload = 0;
diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index 2971dbd8c3..abbec32e84 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -1436,9 +1436,8 @@ void HandleVersionCommand(PCommand command, TArgument*, int argc, PReply reply) }
else {
char miranda[512];
- DWORD v = pluginInfo.version;
Miranda_GetVersionText(miranda, _countof(miranda));
- mir_snwprintf(reply->message, L"Miranda %S\nCmdLine v.%d.%d.%d.%d", miranda, ((v >> 24) & 0xFF), ((v >> 16) & 0xFF), ((v >> 8) & 0xFF), (v & 0xFF));
+ mir_snwprintf(reply->message, L"Miranda %S\nCmdLine v.%d.%d.%d.%d", miranda, __MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM);
}
}
else HandleWrongParametersCount(command, reply);
diff --git a/plugins/CmdLine/src/mimcmd_handlers.h b/plugins/CmdLine/src/mimcmd_handlers.h index 64db00bbbf..97db4f25bf 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.h +++ b/plugins/CmdLine/src/mimcmd_handlers.h @@ -27,10 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define MS_EXCHANGE_CHECKEMAIL "Exchange/CheckEmail"
#define MS_YAMN_FORCECHECK "YAMN/Service/ForceCheck"
-extern PCommand GetCommand(char *command);
-
extern HANDLE heServerBufferFull;
-extern PLUGININFOEX pluginInfo;
void HandleCommand(PCommand command, TArgument *argv, int argc, PReply reply);
diff --git a/plugins/CmdLine/src/stdafx.h b/plugins/CmdLine/src/stdafx.h index 5e2f33eed5..1d0401030d 100644 --- a/plugins/CmdLine/src/stdafx.h +++ b/plugins/CmdLine/src/stdafx.h @@ -54,13 +54,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "mimcmd_handlers.h"
#include "mimcmd_data.h"
-#define ModuleName "CmdLine"
+#define MODULENAME "CmdLine"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(ModuleName)
- {}
+ CMPlugin();
};
extern int bUseANSIStrings;
diff --git a/plugins/CmdLine/src/utils.cpp b/plugins/CmdLine/src/utils.cpp index b0e8c552c1..f67d27b198 100644 --- a/plugins/CmdLine/src/utils.cpp +++ b/plugins/CmdLine/src/utils.cpp @@ -141,12 +141,12 @@ int GetStringFromDatabase(MCONTACT hContact, char *szModule, char *szSettingName int GetStringFromDatabase(char *szSettingName, char *szError, char *szResult, size_t size)
{
- return GetStringFromDatabase(NULL, ModuleName, szSettingName, szError, szResult, size);
+ return GetStringFromDatabase(NULL, MODULENAME, szSettingName, szError, szResult, size);
}
int GetStringFromDatabase(char *szSettingName, WCHAR *szError, WCHAR *szResult, size_t count)
{
- return GetStringFromDatabase(NULL, ModuleName, szSettingName, szError, szResult, count);
+ return GetStringFromDatabase(NULL, MODULENAME, szSettingName, szError, szResult, count);
}
#pragma warning (disable: 4312)
diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index 9f997ea8ff..32860d87b9 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -1,6 +1,8 @@ #include "stdafx.h"
+CMPlugin g_plugin;
CLIST_INTERFACE *pcli;
+int &hLangpack(g_plugin.m_hLang);
//PLUGINLINK *pluginLink=NULL;
HANDLE hOptInit = nullptr;
@@ -15,8 +17,6 @@ HANDLE hConnectionCheckThread = nullptr; HANDLE hFilterOptionsThread = nullptr;
HANDLE killCheckThreadEvent = nullptr;
HANDLE hExceptionsMutex = nullptr;
-//HANDLE hCurrentEditMutex=NULL;
-int &hLangpack(g_plugin.m_hLang);
DWORD FilterOptionsThreadId;
DWORD ConnectionCheckThreadId;
@@ -40,7 +40,9 @@ int currentStatus = ID_STATUS_OFFLINE, diffstat = 0; BOOL bOptionsOpen = FALSE;
wchar_t *tcpStates[] = { L"CLOSED", L"LISTEN", L"SYN_SENT", L"SYN_RCVD", L"ESTAB", L"FIN_WAIT1", L"FIN_WAIT2", L"CLOSE_WAIT", L"CLOSING", L"LAST_ACK", L"TIME_WAIT", L"DELETE_TCB" };
-PLUGININFOEX pluginInfo = {
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
PLUGINNAME,
__VERSION_DWORD,
@@ -53,14 +55,16 @@ PLUGININFOEX pluginInfo = { { 0x4bb5b4aa, 0xc364, 0x4f23, { 0x97, 0x46, 0xd5, 0xb7, 0x8, 0xa2, 0x86, 0xa5 } }
};
-extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD)
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(PLUGINNAME, pluginInfoEx)
{
- return &pluginInfo;
+ RegisterProtocol(PROTOTYPE_PROTOCOL);
}
-/////////////////////////////////////////////////////////////////////////////////////////
-
-CMPlugin g_plugin;
+extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD)
+{
+ return &pluginInfoEx;
+}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -300,9 +304,9 @@ INT_PTR CALLBACK DlgProcConnectionNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wPar bOptionsOpen = TRUE;
TranslateDialogDefault(hwndDlg);//translate miranda function
#ifdef _WIN64
- mir_snwprintf(buff, L"%d.%d.%d.%d/64", HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOWORD(pluginInfo.version)));
+ mir_snwprintf(buff, L"%d.%d.%d.%d/64", HIBYTE(HIWORD(pluginInfoEx.version)), LOBYTE(HIWORD(pluginInfoEx.version)), HIBYTE(LOWORD(pluginInfoEx.version)), LOBYTE(LOWORD(pluginInfoEx.version)));
#else
- mir_snwprintf(buff, L"%d.%d.%d.%d/32", HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOWORD(pluginInfo.version)));
+ mir_snwprintf(buff, L"%d.%d.%d.%d/32", HIBYTE(HIWORD(pluginInfoEx.version)), LOBYTE(HIWORD(pluginInfoEx.version)), HIBYTE(LOWORD(pluginInfoEx.version)), LOBYTE(LOWORD(pluginInfoEx.version)));
#endif
SetDlgItemText(hwndDlg, IDC_VERSION, buff);
LoadSettings();
@@ -848,7 +852,7 @@ extern "C" int __declspec(dllexport) Load(void) _OutputDebugString(L"Entering Load dll");
#endif
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
hExceptionsMutex = CreateMutex(nullptr, FALSE, L"ExceptionsMutex");
diff --git a/plugins/ConnectionNotify/src/stdafx.h b/plugins/ConnectionNotify/src/stdafx.h index a4719fa3b7..bd06f4bf8c 100644 --- a/plugins/ConnectionNotify/src/stdafx.h +++ b/plugins/ConnectionNotify/src/stdafx.h @@ -40,11 +40,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(PLUGINNAME)
- {
- RegisterProtocol(PROTOTYPE_PROTOCOL);
- }
+ CMPlugin();
};
void showMsg(wchar_t *pName,DWORD pid,wchar_t *intIp,wchar_t *extIp,int intPort,int extPort,int state);
diff --git a/plugins/Console/src/init.cpp b/plugins/Console/src/init.cpp index 6737e5a506..9c98057c69 100644 --- a/plugins/Console/src/init.cpp +++ b/plugins/Console/src/init.cpp @@ -28,6 +28,22 @@ DWORD mirandaVer; CMPlugin g_plugin;
int &hLangpack(g_plugin.m_hLang);
+static IconItem iconList[] =
+{
+ { "Show", "Console_Up", IDI_BTN_UP },
+ { "Hide", "Console_Down", IDI_BTN_DN },
+};
+
+HANDLE LoadIcon(int iIconID)
+{
+ for (int i = 0; i < _countof(iconList); i++)
+ if (iconList[i].defIconID == iIconID)
+ return iconList[i].hIcolib;
+ return nullptr;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -38,27 +54,19 @@ PLUGININFOEX pluginInfoEx = { __AUTHORWEB,
UNICODE_AWARE,
// {23D4F302-D513-45B7-9027-445F29557311}
- { 0x23d4f302, 0xd513, 0x45b7, { 0x90, 0x27, 0x44, 0x5f, 0x29, 0x55, 0x73, 0x11 } }
+{ 0x23d4f302, 0xd513, 0x45b7,{ 0x90, 0x27, 0x44, 0x5f, 0x29, 0x55, 0x73, 0x11 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>("Console", pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
}
-static IconItem iconList[] =
-{
- { "Show", "Console_Up", IDI_BTN_UP },
- { "Hide", "Console_Down", IDI_BTN_DN },
-};
-
-HANDLE LoadIcon(int iIconID)
-{
- for (int i = 0; i < _countof(iconList); i++)
- if (iconList[i].defIconID == iIconID)
- return iconList[i].hIcolib;
- return nullptr;
-}
+/////////////////////////////////////////////////////////////////////////////////////////
extern "C" __declspec(dllexport) int Load(void)
{
diff --git a/plugins/Console/src/stdafx.h b/plugins/Console/src/stdafx.h index 5465616407..064c40b5ff 100644 --- a/plugins/Console/src/stdafx.h +++ b/plugins/Console/src/stdafx.h @@ -46,9 +46,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>("Console")
- {}
+ CMPlugin();
};
void InitConsole();
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp index b114990165..2a6504324e 100644 --- a/plugins/ContactsPlus/src/main.cpp +++ b/plugins/ContactsPlus/src/main.cpp @@ -36,7 +36,9 @@ gAckList g_aAckData; HGENMENU hContactMenuItem;
-PLUGININFOEX pluginInfo = {
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -49,6 +51,17 @@ PLUGININFOEX pluginInfo = { { 0x0324785E, 0x74CE, 0x4600, { 0xB7, 0x81, 0x85, 0x17, 0x73, 0xB3, 0xEF, 0xC5 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
+{
+ return &pluginInfoEx;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
static int HookDBEventAdded(WPARAM hContact, LPARAM hDbEvent)
{
//process the event
@@ -185,14 +198,9 @@ static INT_PTR ServiceReceiveCommand(WPARAM, LPARAM lParam) return 0;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
-{
- return &pluginInfo;
-}
-
extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
InitCommonControls();
diff --git a/plugins/ContactsPlus/src/stdafx.h b/plugins/ContactsPlus/src/stdafx.h index 5fce404385..839827bc9b 100644 --- a/plugins/ContactsPlus/src/stdafx.h +++ b/plugins/ContactsPlus/src/stdafx.h @@ -54,9 +54,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {}
+ CMPlugin();
};
#define MS_CONTACTS_SEND "ContactsTransfer/SendContacts"
diff --git a/plugins/CountryFlags/src/main.cpp b/plugins/CountryFlags/src/main.cpp index 2310b6d811..ea296ea456 100644 --- a/plugins/CountryFlags/src/main.cpp +++ b/plugins/CountryFlags/src/main.cpp @@ -25,7 +25,9 @@ CountryListEntry *countries; CMPlugin g_plugin;
int &hLangpack(g_plugin.m_hLang);
-static PLUGININFOEX pluginInfo = {
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -38,14 +40,20 @@ static PLUGININFOEX pluginInfo = { {0x68c36842, 0x3d95, 0x4f4a, {0xab, 0x81, 0x1, 0x4d, 0x65, 0x93, 0x86, 0x3b}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
PrepareBufferedFunctions();
if (CallService(MS_UTILS_GETCOUNTRYLIST, (WPARAM)&nCountriesCount, (LPARAM)&countries))
@@ -62,6 +70,8 @@ extern "C" __declspec(dllexport) int Load(void) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) int Unload(void)
{
KillBufferedFunctions();
diff --git a/plugins/CountryFlags/src/stdafx.h b/plugins/CountryFlags/src/stdafx.h index 894510b513..892fdf6589 100644 --- a/plugins/CountryFlags/src/stdafx.h +++ b/plugins/CountryFlags/src/stdafx.h @@ -45,9 +45,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {}
+ CMPlugin();
};
extern int nCountriesCount;
diff --git a/plugins/CrashDumper/src/crshdmp.cpp b/plugins/CrashDumper/src/crshdmp.cpp index bddadf4f8c..693cdab46f 100644 --- a/plugins/CrashDumper/src/crshdmp.cpp +++ b/plugins/CrashDumper/src/crshdmp.cpp @@ -37,8 +37,9 @@ bool servicemode, clsdates, dtsubfldr, catchcrashes, needrestart = 0; extern HWND hViewWnd;
-static const PLUGININFOEX pluginInfoEx =
-{
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -51,7 +52,9 @@ static const PLUGININFOEX pluginInfoEx = { 0xf62c1d7a, 0xffa4, 0x4065, { 0xa2, 0x51, 0x4c, 0x9d, 0xd9, 0x10, 0x1c, 0xc8 } }
};
-const PLUGININFOEX* GetPluginInfoEx(void) { return &pluginInfoEx; }
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirVersion)
{
@@ -59,9 +62,13 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirVers return (PLUGININFOEX*)&pluginInfoEx;
}
+/////////////////////////////////////////////////////////////////////////////////////////
// MirandaInterfaces - returns the protocol interface to the core
+
extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SERVICEMODE, MIID_LAST };
+/////////////////////////////////////////////////////////////////////////////////////////
+
INT_PTR StoreVersionInfoToFile(WPARAM, LPARAM lParam)
{
CreateDirectoryTreeW(VersionInfoFolder);
@@ -155,7 +162,7 @@ INT_PTR OpenUrl(WPARAM wParam, LPARAM) INT_PTR CopyLinkToClipboard(WPARAM, LPARAM)
{
- ptrW tmp(db_get_wsa(NULL, PluginName, "Username"));
+ ptrW tmp(db_get_wsa(NULL, MODULENAME, "Username"));
if (tmp != NULL) {
wchar_t buffer[MAX_PATH];
mir_snwprintf(buffer, L"https://vi.miranda-ng.org/detail/%s", tmp);
@@ -202,7 +209,7 @@ int OptionsInit(WPARAM wParam, LPARAM) odp.position = -790000000;
odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.szTitle.a = PluginName;
+ odp.szTitle.a = MODULENAME;
odp.szGroup.a = LPGEN("Services");
odp.flags = ODPF_BOLDGROUPS;
odp.pfnDlgProc = DlgProcOptions;
@@ -247,8 +254,8 @@ static int ModulesLoaded(WPARAM, LPARAM) replaceStrW(profpath, L"%miranda_userdata%");
// Removed because it isn't available on Load()
- // hCrashLogFolder = FoldersRegisterCustomPathT(PluginName, LPGEN("Crash Reports"), CrashLogFolder);
- hVerInfoFolder = FoldersRegisterCustomPathT(PluginName, LPGEN("Version Information"), VersionInfoFolder);
+ // hCrashLogFolder = FoldersRegisterCustomPathT(MODULENAME, LPGEN("Crash Reports"), CrashLogFolder);
+ hVerInfoFolder = FoldersRegisterCustomPathT(MODULENAME, LPGEN("Version Information"), VersionInfoFolder);
HookEvent(ME_FOLDERS_PATH_CHANGED, FoldersPathChanged);
FoldersPathChanged(0, 0);
@@ -317,7 +324,7 @@ static int ModulesLoaded(WPARAM, LPARAM) Menu_ConfigureItem(Menu_AddMainMenuItem(&mi), MCI_OPT_EXECPARAM, 1);
HOTKEYDESC hk = {};
- hk.szSection.a = PluginName;
+ hk.szSection.a = MODULENAME;
hk.szDescription.a = LPGEN("Copy Version Info to clipboard");
hk.pszName = "CopyVerInfo";
@@ -338,7 +345,7 @@ static int ModulesLoaded(WPARAM, LPARAM) if (servicemode)
ViewVersionInfo(0, 0);
- else if (db_get_b(NULL, PluginName, "UploadChanged", 0) && !ProcessVIHash(false))
+ else if (db_get_b(NULL, MODULENAME, "UploadChanged", 0) && !ProcessVIHash(false))
UploadVersionInfo(0, 0xa1);
return 0;
@@ -357,9 +364,9 @@ extern "C" int __declspec(dllexport) Load(void) if (hMsftedit == nullptr)
return 1;
- clsdates = db_get_b(NULL, PluginName, "ClassicDates", 1) != 0;
- dtsubfldr = db_get_b(NULL, PluginName, "SubFolders", 1) != 0;
- catchcrashes = db_get_b(NULL, PluginName, "CatchCrashes", 1) != 0;
+ clsdates = db_get_b(NULL, MODULENAME, "ClassicDates", 1) != 0;
+ dtsubfldr = db_get_b(NULL, MODULENAME, "SubFolders", 1) != 0;
+ catchcrashes = db_get_b(NULL, MODULENAME, "CatchCrashes", 1) != 0;
mir_getLP(&pluginInfoEx);
@@ -391,6 +398,8 @@ extern "C" int __declspec(dllexport) Load(void) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Unload(void)
{
DestroyAllWindows();
diff --git a/plugins/CrashDumper/src/crshdmp_icons.cpp b/plugins/CrashDumper/src/crshdmp_icons.cpp index ae97c49528..e1dcd040ca 100644 --- a/plugins/CrashDumper/src/crshdmp_icons.cpp +++ b/plugins/CrashDumper/src/crshdmp_icons.cpp @@ -30,7 +30,7 @@ static IconItem iconList[] = void InitIcons(void)
{
- g_plugin.registerIcon(LPGEN("Crash Dumper"), iconList, PluginName);
+ g_plugin.registerIcon(LPGEN("Crash Dumper"), iconList, MODULENAME);
}
HICON LoadIconEx(int iconId, bool big)
diff --git a/plugins/CrashDumper/src/dumper.cpp b/plugins/CrashDumper/src/dumper.cpp index 4e2123733a..41af5b4721 100644 --- a/plugins/CrashDumper/src/dumper.cpp +++ b/plugins/CrashDumper/src/dumper.cpp @@ -529,16 +529,12 @@ void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const wcha frame.AddrFrame.Mode = AddrModeFlat;
frame.AddrStack.Mode = AddrModeFlat;
- const PLUGININFOEX *pluginInfoEx = GetPluginInfoEx();
-
wchar_t curtime[30];
GetISO8061Time(nullptr, curtime, 30);
CMStringW buffer;
- buffer.AppendFormat(L"Miranda Crash Report from %s. Crash Dumper v.%d.%d.%d.%d\r\n",
- curtime,
- HIBYTE(HIWORD(pluginInfoEx->version)), LOBYTE(HIWORD(pluginInfoEx->version)),
- HIBYTE(LOWORD(pluginInfoEx->version)), LOBYTE(LOWORD(pluginInfoEx->version)));
+ buffer.AppendFormat(L"Miranda Crash Report from %s. Crash Dumper v.%d.%d.%d.%d\r\n",
+ curtime, __MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM);
int crashpos = buffer.GetLength();
@@ -635,6 +631,6 @@ void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const wcha if (len > 8192)
free(dst);
- if (db_get_b(0, PluginName, "ShowCrashMessageBox", 1) && msg && IDYES == MessageBox(nullptr, msg, L"Miranda Crash Dumper", MB_YESNO | MB_ICONERROR | MB_TASKMODAL | MB_DEFBUTTON2 | MB_TOPMOST))
+ if (db_get_b(0, MODULENAME, "ShowCrashMessageBox", 1) && msg && IDYES == MessageBox(nullptr, msg, L"Miranda Crash Dumper", MB_YESNO | MB_ICONERROR | MB_TASKMODAL | MB_DEFBUTTON2 | MB_TOPMOST))
StoreStringToClip(buffer);
}
diff --git a/plugins/CrashDumper/src/stdafx.h b/plugins/CrashDumper/src/stdafx.h index ac343409e7..5abffe7fb9 100644 --- a/plugins/CrashDumper/src/stdafx.h +++ b/plugins/CrashDumper/src/stdafx.h @@ -76,13 +76,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define MS_CRASHDUMPER_URL "CrashDmp/StartUrl"
#define MS_CRASHDUMPER_URLTOCLIP "CrashDmp/CopyToClip"
-#define PluginName "Crash Dumper"
+#define MODULENAME "Crash Dumper"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(PluginName)
- {}
+ CMPlugin();
};
#define VI_FLAG_FORMAT 1
@@ -131,7 +129,6 @@ void ShowMessage(int type, const wchar_t* format, ...); bool IsPluginEnabled(wchar_t* filename);
PLUGININFOEX* GetMirInfo(HMODULE hModule);
-const PLUGININFOEX* GetPluginInfoEx(void);
void CreateMiniDump(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr);
void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const wchar_t* msg);
diff --git a/plugins/CrashDumper/src/ui.cpp b/plugins/CrashDumper/src/ui.cpp index d270b7438b..c9b642af73 100644 --- a/plugins/CrashDumper/src/ui.cpp +++ b/plugins/CrashDumper/src/ui.cpp @@ -80,7 +80,7 @@ INT_PTR CALLBACK DlgProcView(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara if (lParam & VI_FLAG_PRNDLL)
SetWindowText(hwndDlg, TranslateT("View Version Information (with DLLs)"));
- Utils_RestoreWindowPositionNoMove(hwndDlg, NULL, PluginName, "ViewInfo_");
+ Utils_RestoreWindowPositionNoMove(hwndDlg, NULL, MODULENAME, "ViewInfo_");
ShowWindow(hwndDlg, SW_SHOW);
break;
@@ -163,7 +163,7 @@ INT_PTR CALLBACK DlgProcView(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara case WM_DESTROY:
hViewWnd = nullptr;
Window_FreeIcon_IcoLib(hwndDlg);
- Utils_SaveWindowPosition(hwndDlg, NULL, PluginName, "ViewInfo_");
+ Utils_SaveWindowPosition(hwndDlg, NULL, MODULENAME, "ViewInfo_");
if (servicemode)
PostQuitMessage(0);
break;
@@ -187,15 +187,15 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP TranslateDialogDefault(hwndDlg);
{
DBVARIANT dbv;
- if (db_get_s(NULL, PluginName, "Username", &dbv) == 0) {
+ if (db_get_s(NULL, MODULENAME, "Username", &dbv) == 0) {
SetDlgItemTextA(hwndDlg, IDC_USERNAME, dbv.pszVal);
db_free(&dbv);
}
- if (db_get_s(NULL, PluginName, "Password", &dbv) == 0) {
+ if (db_get_s(NULL, MODULENAME, "Password", &dbv) == 0) {
SetDlgItemTextA(hwndDlg, IDC_PASSWORD, dbv.pszVal);
db_free(&dbv);
}
- CheckDlgButton(hwndDlg, IDC_UPLOADCHN, db_get_b(NULL, PluginName, "UploadChanged", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_UPLOADCHN, db_get_b(NULL, MODULENAME, "UploadChanged", 0) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CLASSICDATES, clsdates ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DATESUBFOLDER, dtsubfldr ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CATCHCRASHES, catchcrashes ? BST_CHECKED : BST_UNCHECKED);
@@ -230,28 +230,28 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY) {
char szSetting[100];
GetDlgItemTextA(hwndDlg, IDC_USERNAME, szSetting, _countof(szSetting));
- db_set_s(NULL, PluginName, "Username", szSetting);
+ db_set_s(NULL, MODULENAME, "Username", szSetting);
GetDlgItemTextA(hwndDlg, IDC_PASSWORD, szSetting, _countof(szSetting));
- db_set_s(NULL, PluginName, "Password", szSetting);
+ db_set_s(NULL, MODULENAME, "Password", szSetting);
- db_set_b(NULL, PluginName, "UploadChanged", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_UPLOADCHN));
+ db_set_b(NULL, MODULENAME, "UploadChanged", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_UPLOADCHN));
clsdates = IsDlgButtonChecked(hwndDlg, IDC_CLASSICDATES) == BST_CHECKED;
if (clsdates)
- db_set_b(NULL, PluginName, "ClassicDates", 1);
+ db_set_b(NULL, MODULENAME, "ClassicDates", 1);
else
- db_set_b(NULL, PluginName, "ClassicDates", 0);
+ db_set_b(NULL, MODULENAME, "ClassicDates", 0);
dtsubfldr = IsDlgButtonChecked(hwndDlg, IDC_DATESUBFOLDER) == BST_CHECKED;
if (dtsubfldr)
- db_set_b(NULL, PluginName, "SubFolders", 1);
+ db_set_b(NULL, MODULENAME, "SubFolders", 1);
else
- db_set_b(NULL, PluginName, "SubFolders", 0);
+ db_set_b(NULL, MODULENAME, "SubFolders", 0);
catchcrashes = IsDlgButtonChecked(hwndDlg, IDC_CATCHCRASHES) == BST_CHECKED;
if (catchcrashes)
- db_set_b(NULL, PluginName, "CatchCrashes", 1);
+ db_set_b(NULL, MODULENAME, "CatchCrashes", 1);
else
- db_set_b(NULL, PluginName, "CatchCrashes", 0);
+ db_set_b(NULL, MODULENAME, "CatchCrashes", 0);
}
break;
}
@@ -305,12 +305,12 @@ void ShowMessage(int type, const wchar_t* format, ...) va_end(va);
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
- mir_wstrcpy(pi.lptzContactName, _A2W(PluginName));
+ mir_wstrcpy(pi.lptzContactName, _A2W(MODULENAME));
pi.lchIcon = LoadIconEx(IDI_VI);
pi.PluginWindowProc = DlgProcPopup;
pi.PluginData = (void*)type;
PUAddPopupT(&pi);
}
- else MessageBox(nullptr, pi.lptzText, _A2W(PluginName), MB_OK | MB_ICONINFORMATION);
+ else MessageBox(nullptr, pi.lptzText, _A2W(MODULENAME), MB_OK | MB_ICONINFORMATION);
}
diff --git a/plugins/CrashDumper/src/upload.cpp b/plugins/CrashDumper/src/upload.cpp index 338cbccfa2..adfe5b0aa0 100644 --- a/plugins/CrashDumper/src/upload.cpp +++ b/plugins/CrashDumper/src/upload.cpp @@ -39,14 +39,14 @@ void GetLoginStr(char* user, size_t szuser, char* pass) {
DBVARIANT dbv;
- if (db_get_s(NULL, PluginName, "Username", &dbv) == 0) {
+ if (db_get_s(NULL, MODULENAME, "Username", &dbv) == 0) {
strncpy_s(user, szuser, dbv.pszVal, _TRUNCATE);
db_free(&dbv);
}
else
user[0] = 0;
- if (db_get_s(NULL, PluginName, "Password", &dbv) == 0) {
+ if (db_get_s(NULL, MODULENAME, "Password", &dbv) == 0) {
BYTE hash[16];
mir_md5_state_t context;
@@ -129,7 +129,7 @@ bool InternetDownloadFile(const char *szUrl, VerTrnsfr* szReq) // if the recieved code is 200 OK
switch (nlhrReply->resultCode) {
case 200:
- if (db_get_b(NULL, PluginName, "UploadChanged", 0))
+ if (db_get_b(NULL, MODULENAME, "UploadChanged", 0))
ProcessVIHash(true);
ShowMessage(1, TranslateT("Version Info upload successful."));
@@ -216,7 +216,7 @@ void UploadInit(void) {
NETLIBUSER nlu = {};
nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_NOHTTPSOPTION | NUF_UNICODE;
- nlu.szSettingsModule = (char*)PluginName;
+ nlu.szSettingsModule = (char*)MODULENAME;
nlu.szDescriptiveName.w = TranslateT("Crash Dumper HTTP connections");
hNetlibUser = Netlib_RegisterUser(&nlu);
}
@@ -242,11 +242,11 @@ bool ProcessVIHash(bool store) arrayToHex(hash, sizeof(hash), hashstr);
if (store) {
- db_set_s(NULL, PluginName, "VIHash", hashstr);
+ db_set_s(NULL, MODULENAME, "VIHash", hashstr);
return true;
}
- ptrA VIHash(db_get_sa(NULL, PluginName, "VIHash"));
+ ptrA VIHash(db_get_sa(NULL, MODULENAME, "VIHash"));
if (VIHash == NULL)
return false;
diff --git a/plugins/CryptoPP/src/commonheaders.h b/plugins/CryptoPP/src/commonheaders.h index 0925c0881f..11b6468772 100644 --- a/plugins/CryptoPP/src/commonheaders.h +++ b/plugins/CryptoPP/src/commonheaders.h @@ -56,17 +56,13 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {}
+ CMPlugin();
};
extern LPCSTR szModuleName;
extern LPCSTR szVersionStr;
// shared vars
-extern PLUGININFOEX pluginInfoEx;
-
extern HANDLE hPGPPRIV;
extern HANDLE hRSA4096;
diff --git a/plugins/CryptoPP/src/main.cpp b/plugins/CryptoPP/src/main.cpp index 52d452b873..3b12d38067 100644 --- a/plugins/CryptoPP/src/main.cpp +++ b/plugins/CryptoPP/src/main.cpp @@ -27,6 +27,10 @@ PLUGININFOEX pluginInfoEx = {0x3613F2D9, 0xC040, 0x4361, {0xA4, 0x4F, 0xDF, 0x7B, 0x5A, 0xAA, 0xCF, 0x6E}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
return &pluginInfoEx;
diff --git a/plugins/CyrTranslit/src/TransliterationProtocol.cpp b/plugins/CyrTranslit/src/TransliterationProtocol.cpp index 53382af667..516d2257d3 100644 --- a/plugins/CyrTranslit/src/TransliterationProtocol.cpp +++ b/plugins/CyrTranslit/src/TransliterationProtocol.cpp @@ -22,15 +22,15 @@ namespace CyrTranslit
{
-char *TransliterationProtocol::MODULE_NAME = "ProtoCyrTranslitByIKR";
+char *TransliterationProtocol::MODULENAME = "ProtoCyrTranslitByIKR";
//------------------------------------------------------------------------------
void TransliterationProtocol::initialize()
{
- Proto_RegisterModule(PROTOTYPE_TRANSLATION, MODULE_NAME);
+ Proto_RegisterModule(PROTOTYPE_TRANSLATION, MODULENAME);
- CreateProtoServiceFunction(MODULE_NAME, PSS_MESSAGE, sendMessage);
+ CreateProtoServiceFunction(MODULENAME, PSS_MESSAGE, sendMessage);
}
//------------------------------------------------------------------------------
diff --git a/plugins/CyrTranslit/src/TransliterationProtocol.h b/plugins/CyrTranslit/src/TransliterationProtocol.h index cf86d183bc..164debbfd4 100644 --- a/plugins/CyrTranslit/src/TransliterationProtocol.h +++ b/plugins/CyrTranslit/src/TransliterationProtocol.h @@ -49,7 +49,7 @@ public: static void TranslateMessageUTF(WPARAM wParam, LPARAM lParam);
private:
- static char *MODULE_NAME;
+ static char *MODULENAME;
TransliterationProtocol();
~TransliterationProtocol();
diff --git a/plugins/CyrTranslit/src/main.cpp b/plugins/CyrTranslit/src/main.cpp index 6822b00b0b..ec89d82d52 100644 --- a/plugins/CyrTranslit/src/main.cpp +++ b/plugins/CyrTranslit/src/main.cpp @@ -22,6 +22,8 @@ CMPlugin g_plugin;
int &hLangpack(g_plugin.m_hLang);
+/////////////////////////////////////////////////////////////////////////////////////////
+
PLUGININFOEX pluginInfoEx={
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -34,15 +36,16 @@ PLUGININFOEX pluginInfoEx={ {0xbcec0bd7, 0xca59, 0x44b2, {0x9a, 0x14, 0x3a, 0x14, 0x98, 0x0f, 0x52, 0x4a}}
};
-//------------------------------------------------------------------------------
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>("CyrTranslit", pluginInfoEx)
+{}
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
}
-
-//------------------------------------------------------------------------------
+/////////////////////////////////////////////////////////////////////////////////////////
extern "C" __declspec(dllexport) int Load(void)
{
@@ -54,7 +57,7 @@ extern "C" __declspec(dllexport) int Load(void) return 0;
}
-//------------------------------------------------------------------------------
+/////////////////////////////////////////////////////////////////////////////////////////
extern "C" __declspec(dllexport) int Unload(void)
{
diff --git a/plugins/CyrTranslit/src/stdafx.h b/plugins/CyrTranslit/src/stdafx.h index 027a5f0907..a2c3cd6387 100644 --- a/plugins/CyrTranslit/src/stdafx.h +++ b/plugins/CyrTranslit/src/stdafx.h @@ -35,7 +35,5 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>("CyrTranslit")
- {}
+ CMPlugin();
};
diff --git a/plugins/Db3x_mmap/src/init.cpp b/plugins/Db3x_mmap/src/init.cpp index b7a2652868..d284996ff0 100644 --- a/plugins/Db3x_mmap/src/init.cpp +++ b/plugins/Db3x_mmap/src/init.cpp @@ -34,8 +34,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_DATABA /////////////////////////////////////////////////////////////////////////////////////////
-static PLUGININFOEX pluginInfo =
-{
+static PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -45,12 +44,16 @@ static PLUGININFOEX pluginInfo = __AUTHORWEB,
UNICODE_AWARE | STATIC_PLUGIN,
//{F7A6B27C-9D9C-4A42-BE86-A448AE109161}
- { 0xf7a6b27c, 0x9d9c, 0x4a42, { 0xbe, 0x86, 0xa4, 0x48, 0xae, 0x10, 0x91, 0x61 } }
+ {0xf7a6b27c, 0x9d9c, 0x4a42, {0xbe, 0x86, 0xa4, 0x48, 0xae, 0x10, 0x91, 0x61}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(nullptr, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -79,7 +82,7 @@ static int grokHeader(const wchar_t *profile) static MDatabaseCommon* LoadDatabase(const wchar_t *profile, BOOL bReadOnly)
{
// set the memory, lists & UTF8 manager
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
////////////////////////////////////////////////////////////////////////////////////////
// if not read only, convert the old profile to libmdbx
diff --git a/plugins/Db3x_mmap/src/stdafx.h b/plugins/Db3x_mmap/src/stdafx.h index 012e9bb510..266918c3cf 100644 --- a/plugins/Db3x_mmap/src/stdafx.h +++ b/plugins/Db3x_mmap/src/stdafx.h @@ -55,9 +55,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(nullptr)
- {}
+ CMPlugin();
};
extern LIST<CDb3Mmap> g_Dbs;
diff --git a/plugins/DbEditorPP/src/deletemodule.cpp b/plugins/DbEditorPP/src/deletemodule.cpp index dd2758f3e5..dcc3e6463b 100644 --- a/plugins/DbEditorPP/src/deletemodule.cpp +++ b/plugins/DbEditorPP/src/deletemodule.cpp @@ -8,7 +8,7 @@ int deleteModule(MCONTACT hContact, const char *module, int confirm) if (!module || IsModuleEmpty(hContact, module))
return 0;
- if (confirm && db_get_b(NULL, modname, "WarnOnDelete", 1)) {
+ if (confirm && db_get_b(NULL, MODULENAME, "WarnOnDelete", 1)) {
wchar_t text[MSG_SIZE];
mir_snwprintf(text, TranslateT("Are you sure you want to delete module \"%s\"?"), _A2T(module));
if (dlg(text, MB_YESNO | MB_ICONEXCLAMATION) == IDNO)
diff --git a/plugins/DbEditorPP/src/findwindow.cpp b/plugins/DbEditorPP/src/findwindow.cpp index 508a9fe727..8f80063be5 100644 --- a/plugins/DbEditorPP/src/findwindow.cpp +++ b/plugins/DbEditorPP/src/findwindow.cpp @@ -85,7 +85,7 @@ INT_PTR CALLBACK FindWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP TranslateDialogDefault(hwnd);
ListView_SetExtendedListViewStyle(GetDlgItem(hwnd, IDC_LIST), 32 | LVS_EX_LABELTIP); // LVS_EX_GRIDLINES
loadListSettings(GetDlgItem(hwnd, IDC_LIST), csResultList);
- Utils_RestoreWindowPositionNoMove(hwnd, NULL, modname, "Search_");
+ Utils_RestoreWindowPositionNoMove(hwnd, NULL, MODULENAME, "Search_");
return TRUE;
case WM_COMMAND:
@@ -214,7 +214,7 @@ INT_PTR CALLBACK FindWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP case WM_DESTROY:
ListView_DeleteAllItems(GetDlgItem(hwnd, IDC_LIST));
saveListSettings(GetDlgItem(hwnd, IDC_LIST), csResultList);
- Utils_SaveWindowPosition(hwnd, NULL, modname, "Search_");
+ Utils_SaveWindowPosition(hwnd, NULL, MODULENAME, "Search_");
break;
}
return 0;
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp index a91fa47d94..55052a7592 100644 --- a/plugins/DbEditorPP/src/main.cpp +++ b/plugins/DbEditorPP/src/main.cpp @@ -16,9 +16,8 @@ extern HWND hwnd2watchedVarsWindow; #pragma comment(lib, "shlwapi.lib")
-//========================
+/////////////////////////////////////////////////////////////////////////////////////////
// MirandaPluginInfo
-//========================
PLUGININFOEX pluginInfoEx =
{
@@ -34,15 +33,23 @@ PLUGININFOEX pluginInfoEx = { 0xa8a417ef, 0x7aa, 0x4f37, { 0x86, 0x9f, 0x7b, 0xfd, 0x74, 0x88, 0x65, 0x34 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
}
+/////////////////////////////////////////////////////////////////////////////////////////
// we implement service mode interface
+
extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SERVICEMODE, MIID_LAST };
-int DBSettingChanged(WPARAM hContact, LPARAM lParam)
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static int DBSettingChanged(WPARAM hContact, LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *)lParam;
@@ -95,7 +102,7 @@ static int OnTTBLoaded(WPARAM, LPARAM) return 0;
}
-int ModulesLoaded(WPARAM, LPARAM)
+static int ModulesLoaded(WPARAM, LPARAM)
{
IcoLibRegister();
@@ -126,7 +133,7 @@ int ModulesLoaded(WPARAM, LPARAM) hkd.DefHotKey = HOTKEYCODE(HOTKEYF_SHIFT | HOTKEYF_EXT, 'D');
Hotkey_Register(&hkd);
- g_bUsePopups = db_get_b(NULL, modname, "UsePopUps", 0) != 0;
+ g_bUsePopups = db_get_b(NULL, MODULENAME, "UsePopUps", 0) != 0;
// Load the name order
for (int i = 0; i < NAMEORDERCOUNT; i++)
@@ -145,14 +152,14 @@ int ModulesLoaded(WPARAM, LPARAM) return 0;
}
-int PreShutdown(WPARAM, LPARAM)
+static int PreShutdown(WPARAM, LPARAM)
{
if (hwnd2watchedVarsWindow) DestroyWindow(hwnd2watchedVarsWindow);
if (hwnd2mainWindow) DestroyWindow(hwnd2mainWindow);
return 0;
}
-INT_PTR ServiceMode(WPARAM, LPARAM)
+static INT_PTR ServiceMode(WPARAM, LPARAM)
{
g_bServiceMode = true;
@@ -162,7 +169,7 @@ INT_PTR ServiceMode(WPARAM, LPARAM) return SERVICE_ONLYDB; // load database and then call us
}
-INT_PTR ImportFromFile(WPARAM wParam, LPARAM lParam)
+static INT_PTR ImportFromFile(WPARAM wParam, LPARAM lParam)
{
ImportSettingsFromFileMenuItem(wParam, (char *)lParam);
return 0;
@@ -196,13 +203,15 @@ extern "C" __declspec(dllexport) int Load(void) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) int Unload(void)
{
freeAllWatches();
return 0;
}
-// ======================================================================================================================
+/////////////////////////////////////////////////////////////////////////////////////////
char *StringFromBlob(BYTE *blob, WORD len)
{
@@ -516,7 +525,7 @@ void loadListSettings(HWND hwnd, ColumnsSettings *cs) int i = 0;
while (cs[i].name) {
sLC.pszText = TranslateW(cs[i].name);
- sLC.cx = db_get_w(NULL, modname, cs[i].dbname, cs[i].defsize);
+ sLC.cx = db_get_w(NULL, MODULENAME, cs[i].dbname, cs[i].defsize);
ListView_InsertColumn(hwnd, cs[i].index, &sLC);
i++;
}
@@ -531,7 +540,7 @@ void saveListSettings(HWND hwnd, ColumnsSettings *cs) while (cs[i].name) {
if (ListView_GetColumn(hwnd, cs[i].index, &sLC)) {
mir_snprintf(tmp, cs[i].dbname, i);
- db_set_w(NULL, modname, tmp, (WORD)sLC.cx);
+ db_set_w(NULL, MODULENAME, tmp, (WORD)sLC.cx);
}
i++;
}
diff --git a/plugins/DbEditorPP/src/main_window.cpp b/plugins/DbEditorPP/src/main_window.cpp index cb5c21a393..1dedfec9d5 100644 --- a/plugins/DbEditorPP/src/main_window.cpp +++ b/plugins/DbEditorPP/src/main_window.cpp @@ -213,7 +213,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) SetWindowText(hwnd, TranslateT("Database Editor++"));
// setup the splitter
- SetWindowLongPtr(GetDlgItem(hwnd, IDC_SPLITTER), GWLP_USERDATA, (LONG_PTR)db_get_w(NULL, modname, "Splitter", 200));
+ SetWindowLongPtr(GetDlgItem(hwnd, IDC_SPLITTER), GWLP_USERDATA, (LONG_PTR)db_get_w(NULL, MODULENAME, "Splitter", 200));
SendMessage(hwnd, GC_SPLITTERMOVED, 0, 0);
mir_subclassWindow(GetDlgItem(hwnd, IDC_SPLITTER), SplitterSubclassProc);
@@ -232,30 +232,30 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) for (int i = 0; i < 6; i++)
TranslateMenu(GetSubMenu(hMenu, i));
- Utils_RestoreWindowPosition(hwnd, NULL, modname, "Main_");
- if (db_get_b(NULL, modname, "Maximized", 0))
+ Utils_RestoreWindowPosition(hwnd, NULL, MODULENAME, "Main_");
+ if (db_get_b(NULL, MODULENAME, "Maximized", 0))
ShowWindow(hwnd, SW_SHOWMAXIMIZED);
- g_Inline = !db_get_b(NULL, modname, "DontAllowInLineEdit", 1);
+ g_Inline = !db_get_b(NULL, MODULENAME, "DontAllowInLineEdit", 1);
CheckMenuItem(GetSubMenu(hMenu, 5), MENU_INLINE_EDIT, MF_BYCOMMAND | (g_Inline ? MF_CHECKED : MF_UNCHECKED));
g_Mode = MODE_ALL;
CheckMenuItem(GetSubMenu(hMenu, 5), MENU_FILTER_ALL, MF_BYCOMMAND | MF_CHECKED);
- g_Hex = db_get_b(NULL, modname, "HexMode", 0);
+ g_Hex = db_get_b(NULL, MODULENAME, "HexMode", 0);
CheckMenuItem(GetSubMenu(hMenu, 5), MENU_BYTE_HEX, MF_BYCOMMAND | ((g_Hex & HEX_BYTE) ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem(GetSubMenu(hMenu, 5), MENU_WORD_HEX, MF_BYCOMMAND | ((g_Hex & HEX_WORD) ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem(GetSubMenu(hMenu, 5), MENU_DWORD_HEX, MF_BYCOMMAND | ((g_Hex & HEX_DWORD) ? MF_CHECKED : MF_UNCHECKED));
- CheckMenuItem(GetSubMenu(GetMenu(hwnd), 5), MENU_SAVE_POSITION, MF_BYCOMMAND | (db_get_b(NULL, modname, "RestoreOnOpen", 1) ? MF_CHECKED : MF_UNCHECKED));
+ CheckMenuItem(GetSubMenu(GetMenu(hwnd), 5), MENU_SAVE_POSITION, MF_BYCOMMAND | (db_get_b(NULL, MODULENAME, "RestoreOnOpen", 1) ? MF_CHECKED : MF_UNCHECKED));
- g_Order = db_get_b(NULL, modname, "SortMode", 1);
+ g_Order = db_get_b(NULL, MODULENAME, "SortMode", 1);
CheckMenuItem(GetSubMenu(GetMenu(hwnd), 5), MENU_SORT_ORDER, MF_BYCOMMAND | (g_Order ? MF_CHECKED : MF_UNCHECKED));
int restore;
if (hRestore)
restore = 3;
- else if (db_get_b(NULL, modname, "RestoreOnOpen", 1))
+ else if (db_get_b(NULL, MODULENAME, "RestoreOnOpen", 1))
restore = 2;
else
restore = 0;
@@ -283,7 +283,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) if (splitterPos > rc2.right - rc2.left - 150)
splitterPos = rc2.right - rc2.left - 150;
SetWindowLongPtr(GetDlgItem(hwnd, IDC_SPLITTER), GWLP_USERDATA, splitterPos);
- db_set_w(NULL, modname, "Splitter", (WORD)splitterPos);
+ db_set_w(NULL, MODULENAME, "Splitter", (WORD)splitterPos);
}
PostMessage(hwnd, WM_SIZE, 0, 0);
}
@@ -304,7 +304,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) break;
case WM_DESTROY: // free our shit!
- if (db_get_b(NULL, modname, "RestoreOnOpen", 1)) {
+ if (db_get_b(NULL, MODULENAME, "RestoreOnOpen", 1)) {
HTREEITEM item;
if (item = TreeView_GetSelection(hwnd2Tree)) {
@@ -322,16 +322,16 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) type = mtis->type;
}
- db_set_dw(NULL, modname, "LastContact", hContact);
+ db_set_dw(NULL, MODULENAME, "LastContact", hContact);
if (type == CONTACT)
- db_set_s(NULL, modname, "LastModule", "");
+ db_set_s(NULL, MODULENAME, "LastModule", "");
else
- db_set_s(NULL, modname, "LastModule", _T2A(text));
+ db_set_s(NULL, MODULENAME, "LastModule", _T2A(text));
}
else {
- db_unset(NULL, modname, "LastContact");
- db_unset(NULL, modname, "LastModule");
+ db_unset(NULL, MODULENAME, "LastContact");
+ db_unset(NULL, MODULENAME, "LastModule");
}
int pos = ListView_GetSelectionMark(hwnd2List);
@@ -339,28 +339,28 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) if (pos != -1) {
char data[FLD_SIZE];
ListView_GetItemTextA(hwnd2List, pos, 0, data, _countof(data));
- db_set_s(NULL, modname, "LastSetting", data);
+ db_set_s(NULL, MODULENAME, "LastSetting", data);
}
else
- db_unset(NULL, modname, "LastSetting");
+ db_unset(NULL, MODULENAME, "LastSetting");
}
}
- db_set_b(NULL, modname, "HexMode", (byte)g_Hex);
- db_set_b(NULL, modname, "SortMode", (byte)g_Order);
- db_set_b(NULL, modname, "DontAllowInLineEdit", (byte)!g_Inline);
+ db_set_b(NULL, MODULENAME, "HexMode", (byte)g_Hex);
+ db_set_b(NULL, MODULENAME, "SortMode", (byte)g_Order);
+ db_set_b(NULL, MODULENAME, "DontAllowInLineEdit", (byte)!g_Inline);
{
WINDOWPLACEMENT wp;
wp.length = sizeof(WINDOWPLACEMENT);
GetWindowPlacement(hwnd, &wp);
if (wp.flags == WPF_RESTORETOMAXIMIZED) {
- db_set_b(NULL, modname, "Maximized", 1);
+ db_set_b(NULL, MODULENAME, "Maximized", 1);
ShowWindow(hwnd, SW_SHOWNOACTIVATE);
}
- else db_set_b(NULL, modname, "Maximized", 0);
+ else db_set_b(NULL, MODULENAME, "Maximized", 0);
- Utils_SaveWindowPosition(hwnd, NULL, modname, "Main_");
+ Utils_SaveWindowPosition(hwnd, NULL, MODULENAME, "Main_");
ShowWindow(hwnd, SW_HIDE);
}
@@ -491,9 +491,9 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) break;
case MENU_SAVE_POSITION:
{
- BOOL save = !db_get_b(NULL, modname, "RestoreOnOpen", 1);
+ BOOL save = !db_get_b(NULL, MODULENAME, "RestoreOnOpen", 1);
CheckMenuItem(GetSubMenu(GetMenu(hwnd), 5), MENU_SAVE_POSITION, MF_BYCOMMAND | (save ? MF_CHECKED : MF_UNCHECKED));
- db_set_b(NULL, modname, "RestoreOnOpen", (byte)save);
+ db_set_b(NULL, MODULENAME, "RestoreOnOpen", (byte)save);
}
break;
case MENU_INLINE_EDIT:
diff --git a/plugins/DbEditorPP/src/moduletree.cpp b/plugins/DbEditorPP/src/moduletree.cpp index b9dde4ac32..3d3b15d5db 100644 --- a/plugins/DbEditorPP/src/moduletree.cpp +++ b/plugins/DbEditorPP/src/moduletree.cpp @@ -340,11 +340,11 @@ void __cdecl PopulateModuleTreeThreadFunc(LPVOID param) break;
case 2: // restore saved
- if (GetValueA(NULL, modname, "LastModule", SelectedModule, _countof(SelectedModule))) {
- hSelectedContact = db_get_dw(NULL, modname, "LastContact", INVALID_CONTACT_ID);
+ if (GetValueA(NULL, MODULENAME, "LastModule", SelectedModule, _countof(SelectedModule))) {
+ hSelectedContact = db_get_dw(NULL, MODULENAME, "LastContact", INVALID_CONTACT_ID);
if (hSelectedContact != INVALID_CONTACT_ID)
Select = 1;
- GetValueA(NULL, modname, "LastSetting", SelectedSetting, _countof(SelectedSetting));
+ GetValueA(NULL, MODULENAME, "LastSetting", SelectedSetting, _countof(SelectedSetting));
}
break;
@@ -403,7 +403,7 @@ void __cdecl PopulateModuleTreeThreadFunc(LPVOID param) insertItem(hContact, module->name, contact);
}
- if (db_get_b(NULL, modname, "ExpandSettingsOnOpen", 0))
+ if (db_get_b(NULL, MODULENAME, "ExpandSettingsOnOpen", 0))
TreeView_Expand(hwnd2Tree, contact, TVE_EXPAND);
if (Select && hSelectedContact == NULL) {
diff --git a/plugins/DbEditorPP/src/options.cpp b/plugins/DbEditorPP/src/options.cpp index 29e45ad00f..7b2b6297c1 100644 --- a/plugins/DbEditorPP/src/options.cpp +++ b/plugins/DbEditorPP/src/options.cpp @@ -6,12 +6,12 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l switch (msg) {
case WM_INITDIALOG:
bInitDone = false;
- CheckDlgButton(hwnd, IDC_EXPANDSETTINGS, db_get_b(NULL, modname, "ExpandSettingsOnOpen", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwnd, IDC_RESTORESETTINGS, db_get_b(NULL, modname, "RestoreOnOpen", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwnd, IDC_WARNONDEL, db_get_b(NULL, modname, "WarnOnDelete", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwnd, IDC_EXPANDSETTINGS, db_get_b(NULL, MODULENAME, "ExpandSettingsOnOpen", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwnd, IDC_RESTORESETTINGS, db_get_b(NULL, MODULENAME, "RestoreOnOpen", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwnd, IDC_WARNONDEL, db_get_b(NULL, MODULENAME, "WarnOnDelete", 1) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwnd, IDC_POPUPS, g_bUsePopups ? BST_CHECKED : BST_UNCHECKED);
- SetDlgItemInt(hwnd, IDC_POPUPTIMEOUT, db_get_w(NULL, modname, "PopupDelay", 4), 0);
- SendDlgItemMessage(hwnd, IDC_COLOUR, CPM_SETCOLOUR, 0, (LPARAM)db_get_dw(NULL, modname, "PopupColour", RGB(255, 0, 0)));
+ SetDlgItemInt(hwnd, IDC_POPUPTIMEOUT, db_get_w(NULL, MODULENAME, "PopupDelay", 4), 0);
+ SendDlgItemMessage(hwnd, IDC_COLOUR, CPM_SETCOLOUR, 0, (LPARAM)db_get_dw(NULL, MODULENAME, "PopupColour", RGB(255, 0, 0)));
TranslateDialogDefault(hwnd);
bInitDone = true;
return TRUE;
@@ -38,13 +38,13 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(NULL, modname, "ExpandSettingsOnOpen", (BYTE)IsDlgButtonChecked(hwnd, IDC_EXPANDSETTINGS));
- db_set_b(NULL, modname, "RestoreOnOpen", (BYTE)IsDlgButtonChecked(hwnd, IDC_RESTORESETTINGS));
- db_set_b(NULL, modname, "WarnOnDelete", (BYTE)IsDlgButtonChecked(hwnd, IDC_WARNONDEL));
+ db_set_b(NULL, MODULENAME, "ExpandSettingsOnOpen", (BYTE)IsDlgButtonChecked(hwnd, IDC_EXPANDSETTINGS));
+ db_set_b(NULL, MODULENAME, "RestoreOnOpen", (BYTE)IsDlgButtonChecked(hwnd, IDC_RESTORESETTINGS));
+ db_set_b(NULL, MODULENAME, "WarnOnDelete", (BYTE)IsDlgButtonChecked(hwnd, IDC_WARNONDEL));
g_bUsePopups = IsDlgButtonChecked(hwnd, IDC_POPUPS) != 0;
- db_set_b(NULL, modname, "UsePopUps", (BYTE)g_bUsePopups);
- db_set_w(NULL, modname, "PopupDelay", (WORD)GetDlgItemInt(hwnd, IDC_POPUPTIMEOUT, nullptr, 0));
- db_set_dw(NULL, modname, "PopupColour", (DWORD)SendDlgItemMessage(hwnd, IDC_COLOUR, CPM_GETCOLOUR, 0, 0));
+ db_set_b(NULL, MODULENAME, "UsePopUps", (BYTE)g_bUsePopups);
+ db_set_w(NULL, MODULENAME, "PopupDelay", (WORD)GetDlgItemInt(hwnd, IDC_POPUPTIMEOUT, nullptr, 0));
+ db_set_dw(NULL, MODULENAME, "PopupColour", (DWORD)SendDlgItemMessage(hwnd, IDC_COLOUR, CPM_GETCOLOUR, 0, 0));
return TRUE;
}
break;
diff --git a/plugins/DbEditorPP/src/settinglist.cpp b/plugins/DbEditorPP/src/settinglist.cpp index 6043abc02c..ccb766e9ae 100644 --- a/plugins/DbEditorPP/src/settinglist.cpp +++ b/plugins/DbEditorPP/src/settinglist.cpp @@ -127,7 +127,7 @@ void DeleteSettingsFromList(MCONTACT hContact, const char *module, const char *s if (!count) return;
- if (db_get_b(NULL, modname, "WarnOnDelete", 1)) {
+ if (db_get_b(NULL, MODULENAME, "WarnOnDelete", 1)) {
wchar_t text[MSG_SIZE];
mir_snwprintf(text, TranslateT("Are you sure you want to delete setting(s): %d?"), count);
if (dlg(text, MB_YESNO | MB_ICONEXCLAMATION) == IDNO)
diff --git a/plugins/DbEditorPP/src/stdafx.h b/plugins/DbEditorPP/src/stdafx.h index 3e3c0c9e6b..ce5058594e 100644 --- a/plugins/DbEditorPP/src/stdafx.h +++ b/plugins/DbEditorPP/src/stdafx.h @@ -44,14 +44,12 @@ //=======================================================
// Definitions
//=======================================================
-#define modname "DBEditorpp"
-#define modFullname "Database Editor++"
+#define MODULENAME "DBEditorpp"
+#define modFullname "Database Editor++"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(modname)
- {}
+ CMPlugin();
};
#define msg(a) MessageBox(hwnd2mainWindow,a,_A2T(modFullname),MB_OK)
diff --git a/plugins/DbEditorPP/src/watchedvars.cpp b/plugins/DbEditorPP/src/watchedvars.cpp index 5d894c2c5a..787354cc95 100644 --- a/plugins/DbEditorPP/src/watchedvars.cpp +++ b/plugins/DbEditorPP/src/watchedvars.cpp @@ -247,7 +247,7 @@ INT_PTR CALLBACK WatchDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) ListView_SetExtendedListViewStyle(GetDlgItem(hwnd, IDC_VARS), 32 | LVS_EX_LABELTIP); // LVS_EX_GRIDLINES
loadListSettings(GetDlgItem(hwnd, IDC_VARS), csWatchList);
- Utils_RestoreWindowPositionNoMove(hwnd, NULL, modname, "Watch_");
+ Utils_RestoreWindowPositionNoMove(hwnd, NULL, MODULENAME, "Watch_");
mir_subclassWindow(GetDlgItem(hwnd, IDC_VARS), WatchSubclassProc);
@@ -330,7 +330,7 @@ INT_PTR CALLBACK WatchDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_DESTROY:
ListView_DeleteAllItems(GetDlgItem(hwnd, IDC_VARS));
saveListSettings(GetDlgItem(hwnd, IDC_VARS), csWatchList);
- Utils_SaveWindowPosition(hwnd, NULL, modname, "Watch_");
+ Utils_SaveWindowPosition(hwnd, NULL, MODULENAME, "Watch_");
hwnd2watchedVarsWindow = nullptr;
break;
}
@@ -348,9 +348,9 @@ void openWatchedVarWindow() void popupWatchedVar(MCONTACT hContact, const char *module, const char *setting)
{
- COLORREF colorBack = db_get_dw(NULL, modname, "PopupColour", RGB(255, 0, 0));
- COLORREF colorText = db_get_dw(NULL, modname, "PopupTextColour", RGB(0, 0, 0));
- int timeout = db_get_b(NULL, modname, "PopupDelay", 3);
+ COLORREF colorBack = db_get_dw(NULL, MODULENAME, "PopupColour", RGB(255, 0, 0));
+ COLORREF colorText = db_get_dw(NULL, MODULENAME, "PopupTextColour", RGB(0, 0, 0));
+ int timeout = db_get_b(NULL, MODULENAME, "PopupDelay", 3);
wchar_t name[NAME_SIZE], text[MAX_SECONDLINE], value[MAX_SECONDLINE];
GetContactName(hContact, nullptr, name, _countof(name));
diff --git a/plugins/Db_autobackups/src/main.cpp b/plugins/Db_autobackups/src/main.cpp index 2a58bc7140..6e1e4111f8 100644 --- a/plugins/Db_autobackups/src/main.cpp +++ b/plugins/Db_autobackups/src/main.cpp @@ -6,7 +6,9 @@ int &hLangpack(g_plugin.m_hLang); HANDLE hFolder;
char g_szMirVer[100];
-PLUGININFOEX pluginInfo = {
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -19,6 +21,17 @@ PLUGININFOEX pluginInfo = { { 0x81c220a6, 0x226, 0x4ad6, { 0xbf, 0xca, 0x21, 0x7b, 0x17, 0xa1, 0x60, 0x53 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULE, pluginInfoEx)
+{}
+
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
+{
+ return &pluginInfoEx;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
static INT_PTR ABService(WPARAM, LPARAM)
{
BackupStart(nullptr);
@@ -103,14 +116,9 @@ static int PreShutdown(WPARAM, LPARAM) return 0;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
-{
- return &pluginInfo;
-}
-
extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
Miranda_GetVersionText(g_szMirVer, sizeof(g_szMirVer));
@@ -129,6 +137,8 @@ extern "C" __declspec(dllexport) int Load(void) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) int Unload(void)
{
return 0;
diff --git a/plugins/Db_autobackups/src/stdafx.h b/plugins/Db_autobackups/src/stdafx.h index 5152963200..e6acf25c7b 100644 --- a/plugins/Db_autobackups/src/stdafx.h +++ b/plugins/Db_autobackups/src/stdafx.h @@ -29,9 +29,7 @@ namespace fs = std::experimental::filesystem; struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE)
- {}
+ CMPlugin();
};
#include "options.h"
diff --git a/plugins/Dbx_mdbx/src/init.cpp b/plugins/Dbx_mdbx/src/init.cpp index c45ff40a29..ff2731bdca 100644 --- a/plugins/Dbx_mdbx/src/init.cpp +++ b/plugins/Dbx_mdbx/src/init.cpp @@ -36,7 +36,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD reason, LPVOID reserved) /////////////////////////////////////////////////////////////////////////////////////////
-static PLUGININFOEX pluginInfo =
+static PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -50,12 +50,17 @@ static PLUGININFOEX pluginInfo = { 0x7c3d0a33, 0x2646, 0x4001, { 0x91, 0x7, 0xf3, 0x5e, 0xa2, 0x99, 0xd2, 0x92 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(nullptr, pluginInfoEx)
+{}
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_DATABASE, MIID_LAST };
/////////////////////////////////////////////////////////////////////////////////////////
@@ -78,7 +83,7 @@ static int grokHeader(const TCHAR *profile) static MDatabaseCommon* loadDatabase(const TCHAR *profile, BOOL bReadOnly)
{
// set the memory, lists & UTF8 manager
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
std::unique_ptr<CDbxMDBX> db(new CDbxMDBX(profile, (bReadOnly) ? DBMODE_READONLY : 0));
if (db->Map() != ERROR_SUCCESS)
diff --git a/plugins/Dbx_mdbx/src/stdafx.h b/plugins/Dbx_mdbx/src/stdafx.h index 50031647f5..67ee331d64 100644 --- a/plugins/Dbx_mdbx/src/stdafx.h +++ b/plugins/Dbx_mdbx/src/stdafx.h @@ -164,9 +164,7 @@ public: struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(nullptr)
- {}
+ CMPlugin();
};
#include "ui.h"
diff --git a/plugins/Exchange/src/dlg_handlers.cpp b/plugins/Exchange/src/dlg_handlers.cpp index 2f1f5d62eb..ae17cb3e9f 100644 --- a/plugins/Exchange/src/dlg_handlers.cpp +++ b/plugins/Exchange/src/dlg_handlers.cpp @@ -38,7 +38,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara DBVARIANT dbv = { 0 };
dbv.type = DBVT_ASCIIZ;
- int bCheck = db_get_b(NULL, ModuleName, "Check", 1);
+ int bCheck = db_get_b(NULL, MODULENAME, "Check", 1);
wchar_t buffer[4096];
GetStringFromDatabase("Username", L"", buffer, _countof(buffer));
@@ -50,24 +50,24 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara GetStringFromDatabase("Server", L"", buffer, _countof(buffer));
SetDlgItemText(hWnd, IDC_SERVER_EDIT, buffer);
- SetDlgItemInt(hWnd, IDC_PORT_EDIT, db_get_dw(NULL, ModuleName, "Port", EXCHANGE_PORT), FALSE);
+ SetDlgItemInt(hWnd, IDC_PORT_EDIT, db_get_dw(NULL, MODULENAME, "Port", EXCHANGE_PORT), FALSE);
- SetDlgItemInt(hWnd, IDC_INTERVAL_EDIT, db_get_dw(NULL, ModuleName, "Interval", DEFAULT_INTERVAL), FALSE);
+ SetDlgItemInt(hWnd, IDC_INTERVAL_EDIT, db_get_dw(NULL, MODULENAME, "Interval", DEFAULT_INTERVAL), FALSE);
- CheckDlgButton(hWnd, IDC_RECONNECT, (db_get_b(NULL, ModuleName, "Reconnect", 0)) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_RECONNECT, (db_get_b(NULL, MODULENAME, "Reconnect", 0)) ? BST_CHECKED : BST_UNCHECKED);
- SetDlgItemInt(hWnd, IDC_RECONNECT_INTERVAL, db_get_dw(NULL, ModuleName, "ReconnectInterval", DEFAULT_RECONNECT_INTERVAL), FALSE);
- CheckDlgButton(hWnd, IDC_USE_POPUPS, (BOOL)db_get_b(NULL, ModuleName, "UsePopups", 0) ? BST_CHECKED : BST_UNCHECKED);
+ SetDlgItemInt(hWnd, IDC_RECONNECT_INTERVAL, db_get_dw(NULL, MODULENAME, "ReconnectInterval", DEFAULT_RECONNECT_INTERVAL), FALSE);
+ CheckDlgButton(hWnd, IDC_USE_POPUPS, (BOOL)db_get_b(NULL, MODULENAME, "UsePopups", 0) ? BST_CHECKED : BST_UNCHECKED);
EnableWindow(GetDlgItem(hWnd, IDC_USE_POPUPS), ServiceExists(MS_POPUP_ADDPOPUPT)); //disable the popups checkbox if no popup module is present
CheckDlgButton(hWnd, IDC_CHECK_EMAILS, (bCheck) ? BST_CHECKED : BST_UNCHECKED);
EnableWindow(GetDlgItem(hWnd, IDC_INTERVAL_EDIT), bCheck);
- int portCheck = db_get_b(NULL, ModuleName, "UsePortCheck", 1);
+ int portCheck = db_get_b(NULL, MODULENAME, "UsePortCheck", 1);
CheckDlgButton(hWnd, IDC_USE_PORTCHECK, (portCheck) ? BST_CHECKED : BST_UNCHECKED);
EnableWindow(GetDlgItem(hWnd, IDC_PORT_EDIT), portCheck);
- int retries = db_get_b(NULL, ModuleName, "MaxRetries", MAX_EXCHANGE_CONNECT_RETRIES);
+ int retries = db_get_b(NULL, MODULENAME, "MaxRetries", MAX_EXCHANGE_CONNECT_RETRIES);
SetDlgItemInt(hWnd, IDC_MAX_RETRIES, retries, FALSE);
EnableWindow(GetDlgItem(hWnd, IDC_RECONNECT_INTERVAL), IsDlgButtonChecked(hWnd, IDC_RECONNECT));
@@ -108,30 +108,30 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(NULL, ModuleName, "Check", IsDlgButtonChecked(hWnd, IDC_CHECK_EMAILS));
+ db_set_b(NULL, MODULENAME, "Check", IsDlgButtonChecked(hWnd, IDC_CHECK_EMAILS));
wchar_t buffer[4096];
GetDlgItemText(hWnd, IDC_USER_EDIT, buffer, _countof(buffer));
- db_set_ws(NULL, ModuleName, "Username", buffer);
+ db_set_ws(NULL, MODULENAME, "Username", buffer);
GetDlgItemText(hWnd, IDC_PASSWORD_EDIT, buffer, _countof(buffer));
- db_set_ws(NULL, ModuleName, "Password", buffer);
+ db_set_ws(NULL, MODULENAME, "Password", buffer);
GetDlgItemText(hWnd, IDC_SERVER_EDIT, buffer, _countof(buffer));
- db_set_ws(NULL, ModuleName, "Server", buffer);
+ db_set_ws(NULL, MODULENAME, "Server", buffer);
GetDlgItemText(hWnd, IDC_PORT_EDIT, buffer, _countof(buffer));
- db_set_dw(NULL, ModuleName, "Port", GetDlgItemInt(hWnd, IDC_PORT_EDIT, nullptr, FALSE));
+ db_set_dw(NULL, MODULENAME, "Port", GetDlgItemInt(hWnd, IDC_PORT_EDIT, nullptr, FALSE));
- db_set_dw(NULL, ModuleName, "Interval", GetDlgItemInt(hWnd, IDC_INTERVAL_EDIT, nullptr, FALSE));
- db_set_dw(NULL, ModuleName, "ReconnectInterval", GetDlgItemInt(hWnd, IDC_RECONNECT_INTERVAL, nullptr, FALSE));
+ db_set_dw(NULL, MODULENAME, "Interval", GetDlgItemInt(hWnd, IDC_INTERVAL_EDIT, nullptr, FALSE));
+ db_set_dw(NULL, MODULENAME, "ReconnectInterval", GetDlgItemInt(hWnd, IDC_RECONNECT_INTERVAL, nullptr, FALSE));
- db_set_b(NULL, ModuleName, "Reconnect", IsDlgButtonChecked(hWnd, IDC_RECONNECT));
+ db_set_b(NULL, MODULENAME, "Reconnect", IsDlgButtonChecked(hWnd, IDC_RECONNECT));
- db_set_b(NULL, ModuleName, "UsePopups", IsDlgButtonChecked(hWnd, IDC_USE_POPUPS));
- db_set_b(NULL, ModuleName, "UsePortCheck", IsDlgButtonChecked(hWnd, IDC_USE_PORTCHECK));
+ db_set_b(NULL, MODULENAME, "UsePopups", IsDlgButtonChecked(hWnd, IDC_USE_POPUPS));
+ db_set_b(NULL, MODULENAME, "UsePortCheck", IsDlgButtonChecked(hWnd, IDC_USE_PORTCHECK));
- db_set_b(NULL, ModuleName, "MaxRetries", GetDlgItemInt(hWnd, IDC_MAX_RETRIES, nullptr, FALSE));
+ db_set_b(NULL, MODULENAME, "MaxRetries", GetDlgItemInt(hWnd, IDC_MAX_RETRIES, nullptr, FALSE));
exchangeServer.Reconnect(); //login info may be changed
UpdateTimers(); //interval might get changed
diff --git a/plugins/Exchange/src/emails.cpp b/plugins/Exchange/src/emails.cpp index 1cc625746d..b15f7a8932 100644 --- a/plugins/Exchange/src/emails.cpp +++ b/plugins/Exchange/src/emails.cpp @@ -36,7 +36,7 @@ CExchangeServer::~CExchangeServer() int CExchangeServer::Connect(int bForceConnect)
{
- int maxRetries = db_get_b(NULL, ModuleName, "MaxRetries", MAX_EXCHANGE_CONNECT_RETRIES);
+ int maxRetries = db_get_b(NULL, MODULENAME, "MaxRetries", MAX_EXCHANGE_CONNECT_RETRIES);
if (bForceConnect) {
bTryConnect = 1;
cConnections = 0;
@@ -67,7 +67,7 @@ int CExchangeServer::Connect(int bForceConnect) GetStringFromDatabase("Password", L"", password, _countof(password));
GetStringFromDatabase("Server", L"", server, _countof(server));
- int port = db_get_dw(NULL, ModuleName, "Port", EXCHANGE_PORT);
+ int port = db_get_dw(NULL, MODULENAME, "Port", EXCHANGE_PORT);
if (mir_wstrlen(server) > 0) //only connect if there's a server to connect to
return DoConnect(user, password, server, port);
@@ -139,13 +139,13 @@ void InitSocketAddr(sockaddr_in *addrServer, char *szServer) else
memcpy(&(addrServer->sin_addr), hp->h_addr, hp->h_length);
- int port = db_get_dw(NULL, ModuleName, "Port", EXCHANGE_PORT);
+ int port = db_get_dw(NULL, MODULENAME, "Port", EXCHANGE_PORT);
addrServer->sin_port = htons(port);
}
int CExchangeServer::IsServerAvailable()
{
- if (!db_get_b(NULL, ModuleName, "UsePortCheck", 1))
+ if (!db_get_b(NULL, MODULENAME, "UsePortCheck", 1))
return 1;
SOCKET sServer = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
@@ -294,7 +294,7 @@ int CExchangeServer::Check(int bNoEmailsNotify) int ShowMessage(wchar_t *message, int cUnreadEmails)
{
- int usePopups = ServiceExists(MS_POPUP_ADDPOPUPT) ? db_get_b(NULL, ModuleName, "UsePopups", 0) : 0;
+ int usePopups = ServiceExists(MS_POPUP_ADDPOPUPT) ? db_get_b(NULL, MODULENAME, "UsePopups", 0) : 0;
if (usePopups)
return ShowPopupMessage(TranslateT("Exchange email"), message, cUnreadEmails);
diff --git a/plugins/Exchange/src/exchange.cpp b/plugins/Exchange/src/exchange.cpp index 56596f5577..83265c8568 100644 --- a/plugins/Exchange/src/exchange.cpp +++ b/plugins/Exchange/src/exchange.cpp @@ -30,7 +30,7 @@ CExchangeServer exchangeServer; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_DISPLAY_NAME,
@@ -43,16 +43,20 @@ PLUGININFOEX pluginInfo = {0x2fd0df15, 0x7098, 0x41ce, {0xaa, 0x92, 0xff, 0x62, 0x18, 0x06, 0xe3, 0x8b}} //{2fd0df15-7098-41ce-aa92-ff621806e38b}
};
-extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD)
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
+extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
extern "C" int __declspec(dllexport) Load()
{
- mir_getLP( &pluginInfo );
+ mir_getLP(&pluginInfoEx);
hiMailIcon = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_MAIL));
InitServices();
HookEvents();
diff --git a/plugins/Exchange/src/hooked_events.cpp b/plugins/Exchange/src/hooked_events.cpp index 702b8ad7b1..3286622a22 100644 --- a/plugins/Exchange/src/hooked_events.cpp +++ b/plugins/Exchange/src/hooked_events.cpp @@ -105,14 +105,14 @@ int UpdateTimers() {
KillTimers();
int interval;
- interval = db_get_dw(NULL, ModuleName, "Interval", DEFAULT_INTERVAL);
+ interval = db_get_dw(NULL, MODULENAME, "Interval", DEFAULT_INTERVAL);
interval *= 1000; //go from miliseconds to seconds
hCheckTimer = SetTimer(nullptr, 0, interval, (TIMERPROC) OnCheckTimer);
- int bReconnect = db_get_b(NULL, ModuleName, "Reconnect", 0);
+ int bReconnect = db_get_b(NULL, MODULENAME, "Reconnect", 0);
if (bReconnect) //user wants to forcefully reconnect every x minutes
{
- interval = db_get_dw(NULL, ModuleName, "ReconnectInterval", DEFAULT_RECONNECT_INTERVAL);
+ interval = db_get_dw(NULL, MODULENAME, "ReconnectInterval", DEFAULT_RECONNECT_INTERVAL);
interval *= 1000 * 60; //go from miliseconds to seconds to minutes
hReconnectTimer = SetTimer(nullptr, 0, interval, (TIMERPROC) OnReconnectTimer);
}
@@ -144,7 +144,7 @@ VOID CALLBACK OnCheckTimer(HWND, UINT, UINT_PTR, DWORD) else{
exchangeServer.Connect();
}*/
- int bCheck = db_get_b(NULL, ModuleName, "Check", 1);
+ int bCheck = db_get_b(NULL, MODULENAME, "Check", 1);
if (bCheck) //only check if we were told to
{
diff --git a/plugins/Exchange/src/stdafx.h b/plugins/Exchange/src/stdafx.h index 213ee4ea42..1bca507c9d 100644 --- a/plugins/Exchange/src/stdafx.h +++ b/plugins/Exchange/src/stdafx.h @@ -48,16 +48,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "services.h"
#include "hooked_events.h"
-#define ModuleName "ExchangeNotify"
+#define MODULENAME "ExchangeNotify"
extern HICON hiMailIcon;
extern HWND hEmailsDlg;
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(ModuleName)
- {}
+ CMPlugin();
};
#endif //M_EXCHANGE_COMMONHEADERS_H
\ No newline at end of file diff --git a/plugins/Exchange/src/utils.cpp b/plugins/Exchange/src/utils.cpp index 3316ce41b3..96153d13b1 100644 --- a/plugins/Exchange/src/utils.cpp +++ b/plugins/Exchange/src/utils.cpp @@ -113,7 +113,7 @@ int GetStringFromDatabase(char *szSettingName, wchar_t *szError, wchar_t *szResu DBVARIANT dbv = { 0 };
int res = 1;
dbv.type = DBVT_ASCIIZ;
- if (db_get_ws(NULL, ModuleName, szSettingName, &dbv) == 0) {
+ if (db_get_ws(NULL, MODULENAME, szSettingName, &dbv) == 0) {
res = 0;
size_t tmp = mir_wstrlen(dbv.ptszVal);
size_t len = (tmp < size - 1) ? tmp : size - 1;
diff --git a/plugins/FTPFileYM/src/dbentry.cpp b/plugins/FTPFileYM/src/dbentry.cpp index 79f74005f4..f9c39ae5b4 100644 --- a/plugins/FTPFileYM/src/dbentry.cpp +++ b/plugins/FTPFileYM/src/dbentry.cpp @@ -48,7 +48,7 @@ DBEntry *DBEntry::getNext(DBEntry *entry) for (; entryID < count; entryID++) {
int ftpNum = DB::getByteF(0, MODULE_FILES, "Ftp%d", entryID, -1);
if (ftpNum != -1) {
- ptrA Value(db_get_sa(NULL, MODULE, frmt.Format("Filename%d", entryID)));
+ ptrA Value(db_get_sa(NULL, MODULENAME, frmt.Format("Filename%d", entryID)));
if (Value) {
strncpy_s(szValue, Value, _TRUNCATE);
entry->m_fileID = entryID;
@@ -90,7 +90,7 @@ DBEntry* DBEntry::get(int fileID) int ftpNum = DB::getByteF(0, MODULE_FILES, "Ftp%d", fileID, -1);
if (ftpNum != -1) {
- ptrA Value(db_get_sa(NULL, MODULE, CMStringA(FORMAT, "Filename%d", fileID)));
+ ptrA Value(db_get_sa(NULL, MODULENAME, CMStringA(FORMAT, "Filename%d", fileID)));
if (Value) {
strncpy_s(szValue, Value, _TRUNCATE);
entry->m_fileID = fileID;
diff --git a/plugins/FTPFileYM/src/ftpfile.cpp b/plugins/FTPFileYM/src/ftpfile.cpp index 0df76f1e23..40071b7914 100644 --- a/plugins/FTPFileYM/src/ftpfile.cpp +++ b/plugins/FTPFileYM/src/ftpfile.cpp @@ -35,6 +35,8 @@ void PrebuildMainMenu(); int TabsrmmButtonPressed(WPARAM wParam, LPARAM lParam);
int UploadFile(MCONTACT hContact, int m_iFtpNum, UploadJob::EMode mode);
+/////////////////////////////////////////////////////////////////////////////////////////
+
static PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
@@ -49,14 +51,16 @@ static PLUGININFOEX pluginInfoEx = {0x9502e511, 0x7e5d, 0x49a1, {0x8b, 0xa5, 0xb1, 0xae, 0xe7, 0xf, 0xa5, 0xbf}}
};
-//------------ BASIC STAFF ------------//
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
}
-//------------ INIT FUNCTIONS ------------//
+/////////////////////////////////////////////////////////////////////////////////////////
static IconItem iconList[] =
{
@@ -75,7 +79,7 @@ static IconItem iconList[] = static void InitIcolib()
{
- g_plugin.registerIcon(LPGEN("FTP File"), iconList, MODULE);
+ g_plugin.registerIcon(LPGEN("FTP File"), iconList, MODULENAME);
}
void InitMenuItems()
@@ -103,7 +107,7 @@ void InitMenuItems() CMStringA frmt;
for (int i = 0; i < ServerList::FTP_COUNT; i++) {
- ptrA Name(db_get_sa(NULL, MODULE, frmt.Format("Name%d", i)));
+ ptrA Name(db_get_sa(NULL, MODULENAME, frmt.Format("Name%d", i)));
if (Name)
mir_snwprintf(stzName, TranslateT("FTP Server %d"), i + 1);
@@ -164,7 +168,7 @@ void InitMenuItems() void InitHotkeys()
{
HOTKEYDESC hk = {};
- hk.szSection.a = MODULE;
+ hk.szSection.a = MODULENAME;
hk.szDescription.a = LPGEN("Show FTPFile manager");
hk.pszName = "FTP_ShowManager";
hk.pszService = MS_FTPFILE_SHOWMANAGER;
@@ -175,7 +179,7 @@ void InitTabsrmmButton() {
BBButton btn = {};
btn.dwButtonID = 1;
- btn.pszModuleName = MODULE;
+ btn.pszModuleName = MODULENAME;
btn.dwDefPos = 105;
btn.hIcon = iconList[ServerList::FTP_COUNT].hIcolib;
btn.bbbFlags = BBBF_ISARROWBUTTON | BBBF_ISIMBUTTON | BBBF_CANBEHIDDEN;
@@ -217,7 +221,7 @@ int TabsrmmButtonPressed(WPARAM hContact, LPARAM lParam) {
CustomButtonClickData *cbc = (CustomButtonClickData *)lParam;
- if (!strcmp(cbc->pszModule, MODULE) && cbc->dwButtonId == 1 && hContact) {
+ if (!strcmp(cbc->pszModule, MODULENAME) && cbc->dwButtonId == 1 && hContact) {
if (cbc->flags == BBCF_ARROWCLICKED) {
HMENU hPopupMenu = CreatePopupMenu();
if (hPopupMenu) {
@@ -341,7 +345,7 @@ INT_PTR MainMenuService(WPARAM wParam, LPARAM) //------------ START & EXIT STUFF ------------//
-int ModulesLoaded(WPARAM, LPARAM)
+static int ModulesLoaded(WPARAM, LPARAM)
{
InitMenuItems();
InitTabsrmmButton();
@@ -354,7 +358,7 @@ int ModulesLoaded(WPARAM, LPARAM) return 0;
}
-int Shutdown(WPARAM, LPARAM)
+static int Shutdown(WPARAM, LPARAM)
{
deleteTimer.deinit();
@@ -402,6 +406,8 @@ extern "C" int __declspec(dllexport) Load(void) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Unload(void)
{
return 0;
diff --git a/plugins/FTPFileYM/src/options.cpp b/plugins/FTPFileYM/src/options.cpp index 922dfc15a5..e37e9bc84b 100644 --- a/plugins/FTPFileYM/src/options.cpp +++ b/plugins/FTPFileYM/src/options.cpp @@ -33,32 +33,32 @@ void Options::deinit() void Options::loadOptions()
{
- selected = db_get_b(0, MODULE, "Selected", 0);
- defaultFTP = db_get_b(0, MODULE, "Default", 0);
- bAutosend = db_get_b(0, MODULE, "Autosend", 0) ? true : false;
- bCloseDlg = db_get_b(0, MODULE, "CloseDlg", 0) ? true : false;
- bCopyLink = db_get_b(0, MODULE, "CopyLink", 1) ? true : false;
- bUseSubmenu = db_get_b(0, MODULE, "UseSubmenu", 1) ? true : false;
- bHideInactive = db_get_b(0, MODULE, "HideInactive", 1) ? true : false;
- bAutoDelete = db_get_b(0, MODULE, "DeleteTimer", 0) ? true : false;
- iDeleteTime = db_get_dw(0, MODULE, "AutoDeleteTime", 60);
- timeRange = (ETimeRange)db_get_b(0, MODULE, "TimeRange", TR_MINUTES);
- iCompressionLevel = db_get_b(0, MODULE, "CompressionLevel", 6);
- bSetZipName = db_get_b(0, MODULE, "SetZipName", 0) ? true : false;
+ selected = db_get_b(0, MODULENAME, "Selected", 0);
+ defaultFTP = db_get_b(0, MODULENAME, "Default", 0);
+ bAutosend = db_get_b(0, MODULENAME, "Autosend", 0) ? true : false;
+ bCloseDlg = db_get_b(0, MODULENAME, "CloseDlg", 0) ? true : false;
+ bCopyLink = db_get_b(0, MODULENAME, "CopyLink", 1) ? true : false;
+ bUseSubmenu = db_get_b(0, MODULENAME, "UseSubmenu", 1) ? true : false;
+ bHideInactive = db_get_b(0, MODULENAME, "HideInactive", 1) ? true : false;
+ bAutoDelete = db_get_b(0, MODULENAME, "DeleteTimer", 0) ? true : false;
+ iDeleteTime = db_get_dw(0, MODULENAME, "AutoDeleteTime", 60);
+ timeRange = (ETimeRange)db_get_b(0, MODULENAME, "TimeRange", TR_MINUTES);
+ iCompressionLevel = db_get_b(0, MODULENAME, "CompressionLevel", 6);
+ bSetZipName = db_get_b(0, MODULENAME, "SetZipName", 0) ? true : false;
}
void Options::saveOptions() const
{
- db_set_b(0, MODULE, "Autosend", bAutosend ? 1 : 0);
- db_set_b(0, MODULE, "CopyLink", bCopyLink ? 1 : 0);
- db_set_b(0, MODULE, "UseSubmenu", bUseSubmenu ? 1 : 0);
- db_set_b(0, MODULE, "HideInactive", bHideInactive ? 1 : 0);
- db_set_b(0, MODULE, "CloseDlg", bCloseDlg ? 1 : 0);
- db_set_b(0, MODULE, "DeleteTimer", bAutoDelete ? 1 : 0);
- db_set_dw(0, MODULE, "AutoDeleteTime", iDeleteTime);
- db_set_b(0, MODULE, "TimeRange", (int)timeRange);
- db_set_b(0, MODULE, "CompressionLevel", iCompressionLevel);
- db_set_b(0, MODULE, "SetZipName", bSetZipName ? 1 : 0);
+ db_set_b(0, MODULENAME, "Autosend", bAutosend ? 1 : 0);
+ db_set_b(0, MODULENAME, "CopyLink", bCopyLink ? 1 : 0);
+ db_set_b(0, MODULENAME, "UseSubmenu", bUseSubmenu ? 1 : 0);
+ db_set_b(0, MODULENAME, "HideInactive", bHideInactive ? 1 : 0);
+ db_set_b(0, MODULENAME, "CloseDlg", bCloseDlg ? 1 : 0);
+ db_set_b(0, MODULENAME, "DeleteTimer", bAutoDelete ? 1 : 0);
+ db_set_dw(0, MODULENAME, "AutoDeleteTime", iDeleteTime);
+ db_set_b(0, MODULENAME, "TimeRange", (int)timeRange);
+ db_set_b(0, MODULENAME, "CompressionLevel", iCompressionLevel);
+ db_set_b(0, MODULENAME, "SetZipName", bSetZipName ? 1 : 0);
}
void Options::enableItems(HWND hwndDlg, bool state)
diff --git a/plugins/FTPFileYM/src/serverlist.cpp b/plugins/FTPFileYM/src/serverlist.cpp index 6169b1f86b..b29c263aef 100644 --- a/plugins/FTPFileYM/src/serverlist.cpp +++ b/plugins/FTPFileYM/src/serverlist.cpp @@ -45,49 +45,49 @@ void ServerList::saveToDb() const char buff[256];
mir_snprintf(buff, "Password%d", opt.selected);
- DB::setAStringF(0, MODULE, buff, opt.selected, ftp->m_szPass);
-
- DB::setStringF(0, MODULE, "Name%d", opt.selected, ftp->m_stzName);
- DB::setAStringF(0, MODULE, "Server%d", opt.selected, ftp->m_szServer);
- DB::setAStringF(0, MODULE, "User%d", opt.selected, ftp->m_szUser);
- DB::setAStringF(0, MODULE, "Url%d", opt.selected, ftp->m_szUrl);
- DB::setAStringF(0, MODULE, "Dir%d", opt.selected, ftp->m_szDir);
- DB::setAStringF(0, MODULE, "Chmod%d", opt.selected, ftp->m_szChmod);
- DB::setWordF(0, MODULE, "FtpProto%d", opt.selected, ftp->m_ftpProto);
- DB::setWordF(0, MODULE, "Port%d", opt.selected, ftp->m_iPort);
- DB::setByteF(0, MODULE, "Passive%d", opt.selected, ftp->m_bPassive);
- DB::setByteF(0, MODULE, "Enabled%d", opt.selected, ftp->m_bEnabled);
- db_set_b(0, MODULE, "Selected", opt.selected);
- db_set_b(0, MODULE, "Default", opt.defaultFTP);
+ DB::setAStringF(0, MODULENAME, buff, opt.selected, ftp->m_szPass);
+
+ DB::setStringF(0, MODULENAME, "Name%d", opt.selected, ftp->m_stzName);
+ DB::setAStringF(0, MODULENAME, "Server%d", opt.selected, ftp->m_szServer);
+ DB::setAStringF(0, MODULENAME, "User%d", opt.selected, ftp->m_szUser);
+ DB::setAStringF(0, MODULENAME, "Url%d", opt.selected, ftp->m_szUrl);
+ DB::setAStringF(0, MODULENAME, "Dir%d", opt.selected, ftp->m_szDir);
+ DB::setAStringF(0, MODULENAME, "Chmod%d", opt.selected, ftp->m_szChmod);
+ DB::setWordF(0, MODULENAME, "FtpProto%d", opt.selected, ftp->m_ftpProto);
+ DB::setWordF(0, MODULENAME, "Port%d", opt.selected, ftp->m_iPort);
+ DB::setByteF(0, MODULENAME, "Passive%d", opt.selected, ftp->m_bPassive);
+ DB::setByteF(0, MODULENAME, "Enabled%d", opt.selected, ftp->m_bEnabled);
+ db_set_b(0, MODULENAME, "Selected", opt.selected);
+ db_set_b(0, MODULENAME, "Default", opt.defaultFTP);
}
ServerList::FTP::FTP(int index)
{
- ptrA Name(db_get_sa(NULL, MODULE, CMStringA(FORMAT, "Name%d", index)));
+ ptrA Name(db_get_sa(NULL, MODULENAME, CMStringA(FORMAT, "Name%d", index)));
if (Name)
mir_snwprintf(m_stzName, TranslateT("FTP Server %d"), index + 1);
- ptrA Pass(db_get_sa(NULL, MODULE, CMStringA(FORMAT, "Password%d", index)));
+ ptrA Pass(db_get_sa(NULL, MODULENAME, CMStringA(FORMAT, "Password%d", index)));
if (Pass)
strncpy_s(m_szPass, Pass, _TRUNCATE);
- ptrA Server(db_get_sa(NULL, MODULE, CMStringA(FORMAT, "Server%d", index)));
+ ptrA Server(db_get_sa(NULL, MODULENAME, CMStringA(FORMAT, "Server%d", index)));
if (Server)
strncpy_s(m_szServer, Server, _TRUNCATE);
- ptrA User(db_get_sa(NULL, MODULE, CMStringA(FORMAT, "User%d", index)));
+ ptrA User(db_get_sa(NULL, MODULENAME, CMStringA(FORMAT, "User%d", index)));
if (User)
strncpy_s(m_szUser, User, _TRUNCATE);
- ptrA Url(db_get_sa(NULL, MODULE, CMStringA(FORMAT, "Url%d", index)));
+ ptrA Url(db_get_sa(NULL, MODULENAME, CMStringA(FORMAT, "Url%d", index)));
if (Url)
strncpy_s(m_szUrl, Url, _TRUNCATE);
- ptrA Dir(db_get_sa(NULL, MODULE, CMStringA(FORMAT, "Dir%d", index)));
+ ptrA Dir(db_get_sa(NULL, MODULENAME, CMStringA(FORMAT, "Dir%d", index)));
if (Dir)
strncpy_s(m_szDir, Dir, _TRUNCATE);
- ptrA Chmod(db_get_sa(NULL, MODULE, CMStringA(FORMAT, "Chmod%d", index)));
+ ptrA Chmod(db_get_sa(NULL, MODULENAME, CMStringA(FORMAT, "Chmod%d", index)));
if (Chmod)
strncpy_s(m_szChmod, Chmod, _TRUNCATE);
- m_ftpProto = (FTP::EProtoType)DB::getWordF(0, MODULE, "FtpProto%d", index, FTP::FT_STANDARD);
- m_iPort = DB::getWordF(0, MODULE, "Port%d", index, 21);
- m_bPassive = DB::getByteF(0, MODULE, "Passive%d", index, 0) ? true : false;
- m_bEnabled = DB::getByteF(0, MODULE, "Enabled%d", index, 0) ? true : false;
+ m_ftpProto = (FTP::EProtoType)DB::getWordF(0, MODULENAME, "FtpProto%d", index, FTP::FT_STANDARD);
+ m_iPort = DB::getWordF(0, MODULENAME, "Port%d", index, 21);
+ m_bPassive = DB::getByteF(0, MODULENAME, "Passive%d", index, 0) ? true : false;
+ m_bEnabled = DB::getByteF(0, MODULENAME, "Enabled%d", index, 0) ? true : false;
}
ServerList::FTP* ServerList::getSelected() const
diff --git a/plugins/FTPFileYM/src/stdafx.h b/plugins/FTPFileYM/src/stdafx.h index 02cd27330b..8bcb15e909 100644 --- a/plugins/FTPFileYM/src/stdafx.h +++ b/plugins/FTPFileYM/src/stdafx.h @@ -75,15 +75,13 @@ using namespace std; #define MS_FTPFILE_CONTACTMENU "FTPFile/ContactMenu"
#define MS_FTPFILE_MAINMENU "FTPFile/MainMenu"
-#define MODULE "FTPFile"
-#define MODULE_FILES "FTPFile_Files"
+#define MODULENAME "FTPFile"
+#define MODULE_FILES "FTPFile_Files"
-#define SOUND_UPCOMPLETE "ftpfile_upcomplete"
-#define SOUND_CANCEL "ftpfile_cancel"
+#define SOUND_UPCOMPLETE "ftpfile_upcomplete"
+#define SOUND_CANCEL "ftpfile_cancel"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE)
- {}
+ CMPlugin();
};
diff --git a/plugins/FTPFileYM/src/utils.cpp b/plugins/FTPFileYM/src/utils.cpp index e6d7c020d6..e866115cd6 100644 --- a/plugins/FTPFileYM/src/utils.cpp +++ b/plugins/FTPFileYM/src/utils.cpp @@ -47,14 +47,14 @@ int Utils::msgBoxA(char *szMsg, UINT uType) HICON Utils::loadIconEx(const char *szName)
{
char buff[100];
- mir_snprintf(buff, "%s_%s", MODULE, szName);
+ mir_snprintf(buff, "%s_%s", MODULENAME, szName);
return IcoLib_GetIcon(buff);
}
HANDLE Utils::getIconHandle(const char *szName)
{
char buff[100];
- mir_snprintf(buff, "%s_%s", MODULE, szName);
+ mir_snprintf(buff, "%s_%s", MODULENAME, szName);
return IcoLib_GetIconHandle(buff);
}
@@ -111,7 +111,7 @@ void Utils::curlSetOpt(CURL *hCurl, ServerList::FTP *ftp, char *url, struct curl if (ftp->m_bPassive)
curl_easy_setopt(hCurl, CURLOPT_FTPPORT, 0);
else {
- ptrA localip(db_get_sa(NULL, MODULE, "LocalIP"));
+ ptrA localip(db_get_sa(NULL, MODULENAME, "LocalIP"));
if (localip)
curl_easy_setopt(hCurl, CURLOPT_FTPPORT, localip);
else
diff --git a/plugins/FavContacts/src/main.cpp b/plugins/FavContacts/src/main.cpp index bc75a82c0a..f3d78c6fb6 100644 --- a/plugins/FavContacts/src/main.cpp +++ b/plugins/FavContacts/src/main.cpp @@ -25,7 +25,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. CMPlugin g_plugin;
int &hLangpack(g_plugin.m_hLang);
-PLUGININFOEX pluginInfo = {
+IconItem iconList[] =
+{
+ { LPGEN("Favorite Contact"), "favcontacts_favorite", IDI_FAVORITE },
+ { LPGEN("Regular Contact"), "favcontacts_regular", IDI_REGULAR },
+};
+
+CContactCache *g_contactCache = nullptr;
+
+Options g_Options = { 0 };
+
+/////////////////////////////////////////////////////////////////////////////////////
+
+static PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -38,26 +50,20 @@ PLUGININFOEX pluginInfo = { {0xce2c0401, 0xf9e0, 0x40d7, {0x8e, 0x95, 0x1a, 0x41, 0x97, 0xd7, 0xab, 0x4}}
};
-IconItem iconList[] =
-{
- { LPGEN("Favorite Contact"), "favcontacts_favorite", IDI_FAVORITE },
- { LPGEN("Regular Contact"), "favcontacts_regular", IDI_REGULAR },
-};
-
-CContactCache *g_contactCache = nullptr;
-
-Options g_Options = { 0 };
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>("FavContacts", pluginInfoEx)
+{}
extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////
extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
g_contactCache = new CContactCache;
diff --git a/plugins/FavContacts/src/stdafx.h b/plugins/FavContacts/src/stdafx.h index 7de5e1728d..2ab32caea4 100644 --- a/plugins/FavContacts/src/stdafx.h +++ b/plugins/FavContacts/src/stdafx.h @@ -103,7 +103,5 @@ extern IconItem iconList[]; struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>("FavContacts")
- {}
+ CMPlugin();
};
diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp index ea5b0f7aed..8f426f9fb6 100644 --- a/plugins/FileAsMessage/src/dialog.cpp +++ b/plugins/FileAsMessage/src/dialog.cpp @@ -136,17 +136,17 @@ int RetrieveFileSize(wchar_t *filename) FILEECHO::FILEECHO(MCONTACT Contact)
{
hContact = Contact;
- dwSendInterval = db_get_dw(NULL, SERVICE_NAME, "SendDelay", 6000);
+ dwSendInterval = db_get_dw(NULL, MODULENAME, "SendDelay", 6000);
- chunkMaxLen = db_get_dw(NULL, SERVICE_NAME, "ChunkSize", 5000);
+ chunkMaxLen = db_get_dw(NULL, MODULENAME, "ChunkSize", 5000);
chunkCount = 0;
filename = nullptr;
- rgbRecv = db_get_dw(NULL, SERVICE_NAME, "colorRecv", RGB(64, 255, 64));
- rgbSent = db_get_dw(NULL, SERVICE_NAME, "colorSent", RGB(255, 255, 64));
- rgbUnSent = db_get_dw(NULL, SERVICE_NAME, "colorUnsent", RGB(128, 128, 128));
- rgbToSend = db_get_dw(NULL, SERVICE_NAME, "colorTosend", RGB(192, 192, 192));
- asBinary = db_get_dw(NULL, SERVICE_NAME, "base64", 1) == 0;
+ rgbRecv = db_get_dw(NULL, MODULENAME, "colorRecv", RGB(64, 255, 64));
+ rgbSent = db_get_dw(NULL, MODULENAME, "colorSent", RGB(255, 255, 64));
+ rgbUnSent = db_get_dw(NULL, MODULENAME, "colorUnsent", RGB(128, 128, 128));
+ rgbToSend = db_get_dw(NULL, MODULENAME, "colorTosend", RGB(192, 192, 192));
+ asBinary = db_get_dw(NULL, MODULENAME, "base64", 1) == 0;
}
uint controlEnabled[][2] =
@@ -419,7 +419,7 @@ void FILEECHO::incomeRequest(char *param) cle.hIcon = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_SMALLICON));
cle.flags = CLEF_URGENT;
cle.hDbEvent = 0;
- cle.pszService = SERVICE_NAME "/FERecvFile";
+ cle.pszService = MODULENAME "/FERecvFile";
pcli->pfnAddEvent(&cle);
MakePopupMsg(hDlg, hContact, L"Incoming file...");
diff --git a/plugins/FileAsMessage/src/main.cpp b/plugins/FileAsMessage/src/main.cpp index f02052c03c..6821f3a25e 100644 --- a/plugins/FileAsMessage/src/main.cpp +++ b/plugins/FileAsMessage/src/main.cpp @@ -1,19 +1,5 @@ #include "stdafx.h"
-PLUGININFOEX pluginInfo =
-{
- sizeof(PLUGININFOEX),
- __PLUGIN_NAME,
- PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
- __DESCRIPTION,
- __AUTHOR,
- __COPYRIGHT,
- __AUTHORWEB,
- UNICODE_AWARE,
- // {34B5A402-1B79-4246-B041-43D0B590AE2C}
- { 0x34b5a402, 0x1b79, 0x4246, { 0xb0, 0x41, 0x43, 0xd0, 0xb5, 0x90, 0xae, 0x2c } }
-};
-
CLIST_INTERFACE *pcli;
MWindowList hFileList;
CMPlugin g_plugin;
@@ -36,10 +22,35 @@ IconItem iconList[] = int iIconId[5] = { 3, 2, 4, 1, 0 };
-//
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx =
+{
+ sizeof(PLUGININFOEX),
+ __PLUGIN_NAME,
+ PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
+ __DESCRIPTION,
+ __AUTHOR,
+ __COPYRIGHT,
+ __AUTHORWEB,
+ UNICODE_AWARE,
+ // {34B5A402-1B79-4246-B041-43D0B590AE2C}
+ { 0x34b5a402, 0x1b79, 0x4246, { 0xb0, 0x41, 0x43, 0xd0, 0xb5, 0x90, 0xae, 0x2c } }
+};
+
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
+extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD)
+{
+ return &pluginInfoEx;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
// wParam - Section name
// lParam - Icon ID
-//
+
int OnSkinIconsChanged(WPARAM, LPARAM)
{
for (int indx = 0; indx < _countof(hIcons); indx++)
@@ -157,15 +168,6 @@ int OnOptInitialise(WPARAM wParam, LPARAM) }
//
-// MirandaPluginInfo()
-// Called by Miranda to get Version
-//
-extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD)
-{
- return &pluginInfo;
-}
-
-//
// Startup initializing
//
@@ -181,7 +183,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) mi.position = 200011;
mi.hIcolibItem = iconList[ICON_MAIN].hIcolib;
mi.name.a = LPGEN("File As Message...");
- mi.pszService = SERVICE_NAME "/FESendFile";
+ mi.pszService = MODULENAME "/FESendFile";
mi.flags = CMIF_NOTOFFLINE;
Menu_AddContactMenuItem(&mi);
return 0;
@@ -189,7 +191,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
InitCRC32();
@@ -198,11 +200,11 @@ extern "C" __declspec(dllexport) int Load(void) hFileList = WindowList_Create();
- CreateServiceFunction(SERVICE_NAME PSR_MESSAGE, OnRecvMessage);
- CreateServiceFunction(SERVICE_NAME "/FESendFile", OnSendFile);
- CreateServiceFunction(SERVICE_NAME "/FERecvFile", OnRecvFile);
+ CreateServiceFunction(MODULENAME PSR_MESSAGE, OnRecvMessage);
+ CreateServiceFunction(MODULENAME "/FESendFile", OnSendFile);
+ CreateServiceFunction(MODULENAME "/FERecvFile", OnRecvFile);
- Proto_RegisterModule(PROTOTYPE_FILTER, SERVICE_NAME);
+ Proto_RegisterModule(PROTOTYPE_FILTER, MODULENAME);
HookEvent(ME_OPT_INITIALISE, OnOptInitialise);
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
diff --git a/plugins/FileAsMessage/src/optionsdlg.cpp b/plugins/FileAsMessage/src/optionsdlg.cpp index c889e3cf95..2a1a2d0786 100644 --- a/plugins/FileAsMessage/src/optionsdlg.cpp +++ b/plugins/FileAsMessage/src/optionsdlg.cpp @@ -44,11 +44,11 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l for (int indx = 0; indx < _countof(settingId); indx++)
if (settingId[indx] > 0)
- SendDlgItemMessage(hwndDlg, settingId[indx], CPM_SETCOLOUR, 0, db_get_dw(NULL, SERVICE_NAME, settingName[indx], settingDefault[indx]));
+ SendDlgItemMessage(hwndDlg, settingId[indx], CPM_SETCOLOUR, 0, db_get_dw(NULL, MODULENAME, settingName[indx], settingDefault[indx]));
else
- SetDlgItemInt(hwndDlg, -settingId[indx], db_get_dw(NULL, SERVICE_NAME, settingName[indx], settingDefault[indx]), FALSE);
+ SetDlgItemInt(hwndDlg, -settingId[indx], db_get_dw(NULL, MODULENAME, settingName[indx], settingDefault[indx]), FALSE);
- CheckDlgButton(hwndDlg, IDC_ALPHANUM, db_get_dw(NULL, SERVICE_NAME, "base64", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ALPHANUM, db_get_dw(NULL, MODULENAME, "base64", 1) ? BST_CHECKED : BST_UNCHECKED);
return TRUE;
@@ -93,9 +93,9 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l value = GetDlgItemInt(hwndDlg, -settingId[indx], &succ, FALSE);
if (!succ) value = settingDefault[indx];
}
- db_set_dw(NULL, SERVICE_NAME, settingName[indx], value);
+ db_set_dw(NULL, MODULENAME, settingName[indx], value);
}
- db_set_dw(NULL, SERVICE_NAME, "base64", (IsDlgButtonChecked(hwndDlg, IDC_ALPHANUM) == BST_CHECKED) ? 1 : 0);
+ db_set_dw(NULL, MODULENAME, "base64", (IsDlgButtonChecked(hwndDlg, IDC_ALPHANUM) == BST_CHECKED) ? 1 : 0);
return TRUE;
}
diff --git a/plugins/FileAsMessage/src/stdafx.h b/plugins/FileAsMessage/src/stdafx.h index 519c80745d..3cc13e9f15 100644 --- a/plugins/FileAsMessage/src/stdafx.h +++ b/plugins/FileAsMessage/src/stdafx.h @@ -27,7 +27,7 @@ #define MAXBUFSIZE 4096 #define SERVICE_TITLE LPGEN("File As Message") -#define SERVICE_NAME "FileAsMessage" +#define MODULENAME "FileAsMessage" #define SERVICE_PREFIX "<%fAM-0023%>" @@ -35,9 +35,7 @@ struct CMPlugin : public PLUGIN<CMPlugin> { - CMPlugin() : - PLUGIN<CMPlugin>(SERVICE_NAME) - {} + CMPlugin(); }; extern char *szServiceTitle; diff --git a/plugins/FingerprintNG/src/main.cpp b/plugins/FingerprintNG/src/main.cpp index 6737b218bf..33220b94dc 100644 --- a/plugins/FingerprintNG/src/main.cpp +++ b/plugins/FingerprintNG/src/main.cpp @@ -28,9 +28,9 @@ int &hLangpack(g_plugin.m_hLang); HANDLE hHeap = nullptr;
-//End of header
+/////////////////////////////////////////////////////////////////////////////////////////
+// PluginInfoEx
-// PluginInfo & PluginInfoEx
PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -44,11 +44,17 @@ PLUGININFOEX pluginInfoEx = { { 0x687364af, 0x58b0, 0x4af2, { 0xa4, 0xee, 0x20, 0xf4, 0xa, 0x8d, 0x9a, 0xfb } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfoEx);
diff --git a/plugins/FingerprintNG/src/stdafx.h b/plugins/FingerprintNG/src/stdafx.h index 41a6a0a683..a416667e88 100644 --- a/plugins/FingerprintNG/src/stdafx.h +++ b/plugins/FingerprintNG/src/stdafx.h @@ -114,9 +114,7 @@ typedef struct _foundInfo struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {}
+ CMPlugin();
};
void ClearFI();
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp index 394eec15ef..c117ee54ab 100644 --- a/plugins/FloatingContacts/src/main.cpp +++ b/plugins/FloatingContacts/src/main.cpp @@ -18,6 +18,7 @@ No warranty for any misbehaviour. #include "../../utils/mir_fonts.h"
+/////////////////////////////////////////////////////////////////////////////
// Globals
// TODO: move to some more approriate place, probably part of Thumbs manager
@@ -66,7 +67,33 @@ CMPlugin g_plugin; int &hLangpack(g_plugin.m_hLang);
CLIST_INTERFACE *pcli;
-//Options
+/////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx =
+{
+ sizeof(PLUGININFOEX),
+ __PLUGIN_NAME,
+ PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
+ __DESCRIPTION,
+ __AUTHOR,
+ __COPYRIGHT,
+ __AUTHORWEB,
+ UNICODE_AWARE,
+ // {53C715A8-EB01-4136-A73C-441868610074}
+ {0x53c715a8, 0xeb01, 0x4136, {0xa7, 0x3c, 0x44, 0x18, 0x68, 0x61, 0x0, 0x74}}
+};
+
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULE, pluginInfoEx)
+{}
+
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
+{
+ return &pluginInfoEx;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// Options
FCOptions fcOpt = { 0 };
@@ -88,25 +115,6 @@ static void InitOptions() fcOpt.bShowIdle = TRUE;
}
-PLUGININFOEX pluginInfoEx =
-{
- sizeof(PLUGININFOEX),
- __PLUGIN_NAME,
- PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
- __DESCRIPTION,
- __AUTHOR,
- __COPYRIGHT,
- __AUTHORWEB,
- UNICODE_AWARE,
- // {53C715A8-EB01-4136-A73C-441868610074}
- { 0x53c715a8, 0xeb01, 0x4136, { 0xa7, 0x3c, 0x44, 0x18, 0x68, 0x61, 0x0, 0x74 } }
-};
-
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
-{
- return &pluginInfoEx;
-}
-
/////////////////////////////////////////////////////////////////////////////
// Fonts
diff --git a/plugins/FloatingContacts/src/stdafx.h b/plugins/FloatingContacts/src/stdafx.h index 82a8666bb7..532c1d94df 100644 --- a/plugins/FloatingContacts/src/stdafx.h +++ b/plugins/FloatingContacts/src/stdafx.h @@ -36,9 +36,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE)
- {}
+ CMPlugin();
};
#endif // #ifndef __STDHDR_H__
diff --git a/plugins/Folders/src/folders.cpp b/plugins/Folders/src/folders.cpp index 85061f5f38..77045afff7 100644 --- a/plugins/Folders/src/folders.cpp +++ b/plugins/Folders/src/folders.cpp @@ -25,7 +25,9 @@ int &hLangpack(g_plugin.m_hLang); OBJLIST<CFolderItem> lstRegisteredFolders(10, PtrKeySortT);
-PLUGININFOEX pluginInfo = {
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -35,17 +37,23 @@ PLUGININFOEX pluginInfo = { __AUTHORWEB,
UNICODE_AWARE,
// {2F129563-2C7D-4A9A-B948-97DFCC0AFDD7}
- { 0x2f129563, 0x2c7d, 0x4a9a, { 0xb9, 0x48, 0x97, 0xdf, 0xcc, 0x0a, 0xfd, 0xd7 } }
+ {0x2f129563, 0x2c7d, 0x4a9a, {0xb9, 0x48, 0x97, 0xdf, 0xcc, 0x0a, 0xfd, 0xd7}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(ModuleName, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
InitServices();
InitEvents();
@@ -53,6 +61,8 @@ extern "C" __declspec(dllexport) int Load(void) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) int Unload()
{
DestroyEvents();
diff --git a/plugins/Folders/src/stdafx.h b/plugins/Folders/src/stdafx.h index e78ab16a32..a3352f491b 100644 --- a/plugins/Folders/src/stdafx.h +++ b/plugins/Folders/src/stdafx.h @@ -58,9 +58,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(ModuleName)
- {}
+ CMPlugin();
};
extern OBJLIST<CFolderItem> lstRegisteredFolders;
diff --git a/plugins/GmailNotifier/src/main.cpp b/plugins/GmailNotifier/src/main.cpp index 13544edddd..68919fcb81 100644 --- a/plugins/GmailNotifier/src/main.cpp +++ b/plugins/GmailNotifier/src/main.cpp @@ -10,8 +10,10 @@ There is no warranty. #include "stdafx.h"
#include "version.h"
+CMPlugin g_plugin;
CLIST_INTERFACE *pcli;
int &hLangpack(g_plugin.m_hLang);
+
UINT hTimer;
HANDLE hMirandaStarted, hOptionsInitial;
HNETLIBUSER hNetlibUser;
@@ -22,6 +24,8 @@ OBJLIST<Account> g_accs(1); BOOL optionWindowIsOpen = FALSE;
short ID_STATUS_NONEW;
+/////////////////////////////////////////////////////////////////////////////////////////
+
static PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
@@ -36,6 +40,12 @@ static PLUGININFOEX pluginInfoEx = { 0x243955e0, 0x75d9, 0x4cc3, { 0x9b, 0x28, 0x6f, 0x9c, 0x5a, 0xf4, 0x53, 0x2d } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{
+ RegisterProtocol(PROTOTYPE_VIRTUAL);
+}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
@@ -43,10 +53,6 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) /////////////////////////////////////////////////////////////////////////////////////////
-CMPlugin g_plugin;
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
INT_PTR GetCaps(WPARAM wParam, LPARAM)
{
if (wParam == PFLAGNUM_2 && opt.ShowCustomIcon)
@@ -62,7 +68,7 @@ INT_PTR GetStatus(WPARAM, LPARAM) INT_PTR GetName(WPARAM wParam, LPARAM lParam)
{
- mir_strncpy((char*)lParam, MODULE_NAME, wParam);
+ mir_strncpy((char*)lParam, MODULENAME, wParam);
return 0;
}
@@ -95,59 +101,59 @@ extern "C" int __declspec(dllexport) Load() NETLIBUSER nlu = {};
nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_NOHTTPSOPTION | NUF_UNICODE;
- nlu.szSettingsModule = MODULE_NAME;
+ nlu.szSettingsModule = MODULENAME;
nlu.szDescriptiveName.w = TranslateT("Gmail Notifier connection");
hNetlibUser = Netlib_RegisterUser(&nlu);
- CreateProtoServiceFunction(MODULE_NAME, PS_GETCAPS, GetCaps);
- CreateProtoServiceFunction(MODULE_NAME, PS_GETSTATUS, GetStatus);
- CreateProtoServiceFunction(MODULE_NAME, PS_GETNAME, GetName);
+ CreateProtoServiceFunction(MODULENAME, PS_GETCAPS, GetCaps);
+ CreateProtoServiceFunction(MODULENAME, PS_GETSTATUS, GetStatus);
+ CreateProtoServiceFunction(MODULENAME, PS_GETNAME, GetName);
CreateServiceFunction("GmailMNotifier/Notifying", Notifying);
- opt.circleTime = db_get_dw(NULL, MODULE_NAME, "circleTime", 30);
- opt.notifierOnTray = db_get_dw(NULL, MODULE_NAME, "notifierOnTray", TRUE);
- opt.notifierOnPop = db_get_dw(NULL, MODULE_NAME, "notifierOnPop", TRUE);
- opt.popupDuration = db_get_dw(NULL, MODULE_NAME, "popupDuration", -1);
- opt.popupBgColor = db_get_dw(NULL, MODULE_NAME, "popupBgColor", RGB(173, 206, 247));
- opt.popupTxtColor = db_get_dw(NULL, MODULE_NAME, "popupTxtColor", RGB(0, 0, 0));
- opt.OpenUsePrg = db_get_dw(NULL, MODULE_NAME, "OpenUsePrg", 0);
- opt.ShowCustomIcon = db_get_dw(NULL, MODULE_NAME, "ShowCustomIcon", FALSE);
- opt.UseOnline = db_get_dw(NULL, MODULE_NAME, "UseOnline", FALSE);
- opt.AutoLogin = db_get_dw(NULL, MODULE_NAME, "AutoLogin", TRUE);
- opt.LogThreads = db_get_dw(NULL, MODULE_NAME, "LogThreads", FALSE);
+ opt.circleTime = db_get_dw(NULL, MODULENAME, "circleTime", 30);
+ opt.notifierOnTray = db_get_dw(NULL, MODULENAME, "notifierOnTray", TRUE);
+ opt.notifierOnPop = db_get_dw(NULL, MODULENAME, "notifierOnPop", TRUE);
+ opt.popupDuration = db_get_dw(NULL, MODULENAME, "popupDuration", -1);
+ opt.popupBgColor = db_get_dw(NULL, MODULENAME, "popupBgColor", RGB(173, 206, 247));
+ opt.popupTxtColor = db_get_dw(NULL, MODULENAME, "popupTxtColor", RGB(0, 0, 0));
+ opt.OpenUsePrg = db_get_dw(NULL, MODULENAME, "OpenUsePrg", 0);
+ opt.ShowCustomIcon = db_get_dw(NULL, MODULENAME, "ShowCustomIcon", FALSE);
+ opt.UseOnline = db_get_dw(NULL, MODULENAME, "UseOnline", FALSE);
+ opt.AutoLogin = db_get_dw(NULL, MODULENAME, "AutoLogin", TRUE);
+ opt.LogThreads = db_get_dw(NULL, MODULENAME, "LogThreads", FALSE);
DBVARIANT dbv;
- if (db_get_s(NULL, "SkinIcons", "core_status_" MODULE_NAME "4", &dbv)) {
- db_set_s(NULL, "SkinIcons", "core_status_" MODULE_NAME "0", "plugins\\GmailNotifier.dll,2");
- db_set_s(NULL, "SkinIcons", "core_status_" MODULE_NAME "1", "plugins\\GmailNotifier.dll,2");
- db_set_s(NULL, "SkinIcons", "core_status_" MODULE_NAME "2", "plugins\\GmailNotifier.dll,0");
- db_set_s(NULL, "SkinIcons", "core_status_" MODULE_NAME "4", "plugins\\GmailNotifier.dll,1");
+ if (db_get_s(NULL, "SkinIcons", "core_status_" MODULENAME "4", &dbv)) {
+ db_set_s(NULL, "SkinIcons", "core_status_" MODULENAME "0", "plugins\\GmailNotifier.dll,2");
+ db_set_s(NULL, "SkinIcons", "core_status_" MODULENAME "1", "plugins\\GmailNotifier.dll,2");
+ db_set_s(NULL, "SkinIcons", "core_status_" MODULENAME "2", "plugins\\GmailNotifier.dll,0");
+ db_set_s(NULL, "SkinIcons", "core_status_" MODULENAME "4", "plugins\\GmailNotifier.dll,1");
}
else db_free(&dbv);
BuildList();
ID_STATUS_NONEW = opt.UseOnline ? ID_STATUS_ONLINE : ID_STATUS_OFFLINE;
for (auto &it : g_accs)
- db_set_dw(it->hContact, MODULE_NAME, "Status", ID_STATUS_NONEW);
+ db_set_dw(it->hContact, MODULENAME, "Status", ID_STATUS_NONEW);
hTimer = SetTimer(nullptr, 0, opt.circleTime * 60000, TimerProc);
hMirandaStarted = HookEvent(ME_SYSTEM_MODULESLOADED, OnMirandaStart);
hOptionsInitial = HookEvent(ME_OPT_INITIALISE, OptInit);
- CreateServiceFunction(MODULE_NAME "/MenuCommand", PluginMenuCommand);
+ CreateServiceFunction(MODULENAME "/MenuCommand", PluginMenuCommand);
CMenuItem mi;
SET_UID(mi, 0xbe16f37, 0x17be, 0x4494, 0xaa, 0xb2, 0x3a, 0xa7, 0x38, 0xfa, 0xf9, 0xcc);
mi.position = -0x7FFFFFFF;
- mi.hIcolibItem = Skin_LoadProtoIcon(MODULE_NAME, ID_STATUS_ONLINE);
+ mi.hIcolibItem = Skin_LoadProtoIcon(MODULENAME, ID_STATUS_ONLINE);
mi.name.a = LPGEN("&Check all Gmail inboxes");
- mi.pszService = MODULE_NAME "/MenuCommand";
+ mi.pszService = MODULENAME "/MenuCommand";
Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0x22c6ace1, 0xba0c, 0x44b5, 0xa4, 0xd2, 0x1, 0x7d, 0xb1, 0xe0, 0x51, 0xeb);
mi.name.a = LPGEN("&Check Gmail inbox");
mi.pszService = "/MenuCommand";
- Menu_AddContactMenuItem(&mi, MODULE_NAME);
+ Menu_AddContactMenuItem(&mi, MODULENAME);
return 0;
}
diff --git a/plugins/GmailNotifier/src/notify.cpp b/plugins/GmailNotifier/src/notify.cpp index 8222d5c4cf..359b39e926 100644 --- a/plugins/GmailNotifier/src/notify.cpp +++ b/plugins/GmailNotifier/src/notify.cpp @@ -74,7 +74,7 @@ static void __cdecl Login_ThreadFunc(Account *curAcc) int OpenBrowser(WPARAM hContact, LPARAM)
{
char *proto = GetContactProto(hContact);
- if (proto && !mir_strcmp(proto, MODULE_NAME)) {
+ if (proto && !mir_strcmp(proto, MODULENAME)) {
Account *curAcc = GetAccountByContact(hContact);
PUDeletePopup(curAcc->popUpHwnd);
pcli->pfnRemoveEvent(curAcc->hContact, 1);
@@ -82,7 +82,7 @@ int OpenBrowser(WPARAM hContact, LPARAM) return FALSE;
if (curAcc->oldResults_num != 0) {
- db_set_w(curAcc->hContact, MODULE_NAME, "Status", ID_STATUS_NONEW);
+ db_set_w(curAcc->hContact, MODULENAME, "Status", ID_STATUS_NONEW);
curAcc->oldResults_num = 0;
DeleteResults(curAcc->results.next);
curAcc->results.next = nullptr;
@@ -134,21 +134,21 @@ void NotifyUser(Account *curAcc) PUDeletePopup(curAcc->popUpHwnd);
pcli->pfnRemoveEvent(curAcc->hContact, 1);
if (curAcc->oldResults_num != 0)
- db_set_w(curAcc->hContact, MODULE_NAME, "Status", ID_STATUS_NONEW);
+ db_set_w(curAcc->hContact, MODULENAME, "Status", ID_STATUS_NONEW);
break;
case -1:
- db_set_w(curAcc->hContact, MODULE_NAME, "Status", ID_STATUS_AWAY);
+ db_set_w(curAcc->hContact, MODULENAME, "Status", ID_STATUS_AWAY);
break;
default:
- db_set_w(curAcc->hContact, MODULE_NAME, "Status", ID_STATUS_OCCUPIED);
+ db_set_w(curAcc->hContact, MODULENAME, "Status", ID_STATUS_OCCUPIED);
int newMails = (curAcc->oldResults_num == -1) ? (curAcc->results_num) : (curAcc->results_num - curAcc->oldResults_num);
if (opt.LogThreads&&newMails > 0) {
DBEVENTINFO dbei = {};
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.flags = DBEF_READ;
- dbei.szModule = MODULE_NAME;
+ dbei.szModule = MODULENAME;
dbei.timestamp = time(0);
resultLink *prst = curAcc->results.next;
@@ -166,7 +166,7 @@ void NotifyUser(Account *curAcc) cle.hContact = curAcc->hContact;
cle.hDbEvent = 1;
cle.flags = CLEF_URGENT;
- cle.hIcon = Skin_LoadProtoIcon(MODULE_NAME, ID_STATUS_OCCUPIED);
+ cle.hIcon = Skin_LoadProtoIcon(MODULENAME, ID_STATUS_OCCUPIED);
cle.pszService = "GmailMNotifier/Notifying";
cle.szTooltip.a = curAcc->results.next->content;
pcli->pfnAddEvent(&cle);
@@ -176,7 +176,7 @@ void NotifyUser(Account *curAcc) POPUPDATA ppd = { 0 };
ppd.lchContact = curAcc->hContact;
- ppd.lchIcon = Skin_LoadProtoIcon(MODULE_NAME, ID_STATUS_OCCUPIED);
+ ppd.lchIcon = Skin_LoadProtoIcon(MODULENAME, ID_STATUS_OCCUPIED);
mir_strcpy(ppd.lpzContactName, curAcc->results.content);
resultLink *prst = curAcc->results.next;
for (int i = 0; i < 5 && i < newMails; i++) {
diff --git a/plugins/GmailNotifier/src/options.cpp b/plugins/GmailNotifier/src/options.cpp index 9d15fbe1ac..d39f25ae2e 100644 --- a/plugins/GmailNotifier/src/options.cpp +++ b/plugins/GmailNotifier/src/options.cpp @@ -10,11 +10,11 @@ static void SaveButton(HWND hwndDlg, HWND hwndCombo, int curIndex) SendMessageA(hwndCombo, CB_DELETESTRING, curIndex, 0);
SendMessageA(hwndCombo, CB_INSERTSTRING, curIndex, (LPARAM)acc.name);
SendMessageA(hwndCombo, CB_SETCURSEL, curIndex, 0);
- db_set_s(acc.hContact, MODULE_NAME, "name", acc.name);
- db_set_s(acc.hContact, MODULE_NAME, "Nick", acc.name);
+ db_set_s(acc.hContact, MODULENAME, "name", acc.name);
+ db_set_s(acc.hContact, MODULENAME, "Nick", acc.name);
GetDlgItemTextA(hwndDlg, IDC_PASS, acc.pass, _countof(acc.pass));
- db_set_s(acc.hContact, MODULE_NAME, "Password", acc.pass);
+ db_set_s(acc.hContact, MODULENAME, "Password", acc.pass);
}
}
@@ -81,7 +81,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
{
DBVARIANT dbv;
- if (!db_get_s(NULL, MODULE_NAME, "OpenUsePrgPath", &dbv)) {
+ if (!db_get_s(NULL, MODULENAME, "OpenUsePrgPath", &dbv)) {
mir_strcpy(str, dbv.pszVal);
db_free(&dbv);
}
@@ -150,7 +150,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA {
Account *p = new Account();
p->hContact = db_add_contact();
- Proto_AddToContact(p->hContact, MODULE_NAME);
+ Proto_AddToContact(p->hContact, MODULENAME);
g_accs.insert(p);
curIndex = SendMessageA(hwndCombo, CB_ADDSTRING, 0, (LPARAM)"");
@@ -214,20 +214,20 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (opt.circleTime > 0) {
KillTimer(nullptr, hTimer);
hTimer = SetTimer(nullptr, 0, opt.circleTime * 60000, TimerProc);
- db_set_dw(NULL, MODULE_NAME, "circleTime", opt.circleTime);
+ db_set_dw(NULL, MODULENAME, "circleTime", opt.circleTime);
}
opt.notifierOnTray = IsDlgButtonChecked(hwndDlg, IDC_OPTTRAY);
opt.notifierOnPop = IsDlgButtonChecked(hwndDlg, IDC_OPTPOP);
- db_set_dw(NULL, MODULE_NAME, "notifierOnTray", opt.notifierOnTray);
- db_set_dw(NULL, MODULE_NAME, "notifierOnPop", opt.notifierOnPop);
+ db_set_dw(NULL, MODULENAME, "notifierOnTray", opt.notifierOnTray);
+ db_set_dw(NULL, MODULENAME, "notifierOnPop", opt.notifierOnPop);
opt.popupDuration = GetDlgItemInt(hwndDlg, IDC_DURATION, nullptr, TRUE);
- db_set_dw(NULL, MODULE_NAME, "popupDuration", opt.popupDuration);
+ db_set_dw(NULL, MODULENAME, "popupDuration", opt.popupDuration);
opt.popupBgColor = SendDlgItemMessage(hwndDlg, IDC_BGCOLOR, CPM_GETCOLOUR, 0, opt.popupBgColor);
opt.popupTxtColor = SendDlgItemMessage(hwndDlg, IDC_TEXTCOLOR, CPM_GETCOLOUR, 0, opt.popupBgColor);
- db_set_dw(NULL, MODULE_NAME, "popupBgColor", opt.popupBgColor);
- db_set_dw(NULL, MODULE_NAME, "popupTxtColor", opt.popupTxtColor);
+ db_set_dw(NULL, MODULENAME, "popupBgColor", opt.popupBgColor);
+ db_set_dw(NULL, MODULENAME, "popupTxtColor", opt.popupTxtColor);
if (IsDlgButtonChecked(hwndDlg, IDC_SYSDEF) == BST_CHECKED)
opt.OpenUsePrg = 0;
@@ -238,8 +238,8 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
GetDlgItemTextA(hwndDlg, IDC_PRG, str, _countof(str));
- db_set_dw(NULL, MODULE_NAME, "OpenUsePrg", opt.OpenUsePrg);
- db_set_s(NULL, MODULE_NAME, "OpenUsePrgPath", str);
+ db_set_dw(NULL, MODULENAME, "OpenUsePrg", opt.OpenUsePrg);
+ db_set_s(NULL, MODULENAME, "OpenUsePrgPath", str);
opt.ShowCustomIcon = IsDlgButtonChecked(hwndDlg, IDC_SHOWICON);
opt.UseOnline = IsDlgButtonChecked(hwndDlg, IDC_ONLINE);
@@ -250,14 +250,14 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA else if (IsDlgButtonChecked(hwndDlg, IDC_AUTOLOGIN) == BST_INDETERMINATE)
opt.AutoLogin = 2;
opt.LogThreads = IsDlgButtonChecked(hwndDlg, IDC_LOGTHREADS);
- db_set_dw(NULL, MODULE_NAME, "ShowCustomIcon", opt.ShowCustomIcon);
- db_set_dw(NULL, MODULE_NAME, "UseOnline", opt.UseOnline);
- db_set_dw(NULL, MODULE_NAME, "AutoLogin", opt.AutoLogin);
- db_set_dw(NULL, MODULE_NAME, "LogThreads", opt.LogThreads);
+ db_set_dw(NULL, MODULENAME, "ShowCustomIcon", opt.ShowCustomIcon);
+ db_set_dw(NULL, MODULENAME, "UseOnline", opt.UseOnline);
+ db_set_dw(NULL, MODULENAME, "AutoLogin", opt.AutoLogin);
+ db_set_dw(NULL, MODULENAME, "LogThreads", opt.LogThreads);
ID_STATUS_NONEW = opt.UseOnline ? ID_STATUS_ONLINE : ID_STATUS_OFFLINE;
for (auto &it : g_accs)
- db_set_w(it->hContact, MODULE_NAME, "Status", ID_STATUS_NONEW);
+ db_set_w(it->hContact, MODULENAME, "Status", ID_STATUS_NONEW);
}
return TRUE;
diff --git a/plugins/GmailNotifier/src/stdafx.h b/plugins/GmailNotifier/src/stdafx.h index 0012cb756c..cd60bd5335 100644 --- a/plugins/GmailNotifier/src/stdafx.h +++ b/plugins/GmailNotifier/src/stdafx.h @@ -23,7 +23,7 @@ #define WM_SHELLNOTIFY WM_USER+5
#define IDI_TRAY WM_USER+6
-#define MODULE_NAME "GmailMNotifier"
+#define MODULENAME "GmailMNotifier"
#define _MAX_DOWN_BUFFER 65536
#define LINK "https://accounts.google.com/ServiceLogin?continue=https%3A%2F%2Fmail.google.com%2Fmail&service=mail&passive=true&Email="
#define FORMDATA1 "<body onload=document.gmail.submit();><form name=gmail action=https://www.google.com/a/"
@@ -93,9 +93,5 @@ Account* GetAccountByContact(MCONTACT hContact); struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE_NAME)
- {
- RegisterProtocol(PROTOTYPE_VIRTUAL);
- }
+ CMPlugin();
};
diff --git a/plugins/GmailNotifier/src/utility.cpp b/plugins/GmailNotifier/src/utility.cpp index 64bb3cfa11..63ab420896 100644 --- a/plugins/GmailNotifier/src/utility.cpp +++ b/plugins/GmailNotifier/src/utility.cpp @@ -4,15 +4,15 @@ void BuildList(void) {
g_accs.destroy();
- for (auto &hContact : Contacts(MODULE_NAME)) {
- ptrA szName(db_get_sa(hContact, MODULE_NAME, "name"));
+ for (auto &hContact : Contacts(MODULENAME)) {
+ ptrA szName(db_get_sa(hContact, MODULENAME, "name"));
if (szName != nullptr) {
Account *p = new Account;
p->hContact = hContact;
mir_strcpy(p->name, szName);
CallService(MS_IGNORE_IGNORE, hContact, IGNOREEVENT_USERONLINE);
- ptrA szPassword(db_get_sa(hContact, MODULE_NAME, "Password"));
+ ptrA szPassword(db_get_sa(hContact, MODULENAME, "Password"));
if (szPassword != nullptr)
mir_strcpy(p->pass, szPassword);
g_accs.insert(p);
@@ -40,7 +40,7 @@ BOOL GetBrowser(char *str) else if (opt.OpenUsePrg == 0)
strKey = strDefault;
else {
- if (!db_get_s(NULL, MODULE_NAME, "OpenUsePrgPath", &dbv)) {
+ if (!db_get_s(NULL, MODULENAME, "OpenUsePrgPath", &dbv)) {
mir_strcpy(str, dbv.pszVal);
db_free(&dbv);
}
diff --git a/plugins/HTTPServer/src/Glob.h b/plugins/HTTPServer/src/Glob.h index 0509444dfc..c66347cfec 100644 --- a/plugins/HTTPServer/src/Glob.h +++ b/plugins/HTTPServer/src/Glob.h @@ -53,16 +53,14 @@ using namespace std; #define SD_SEND 0x01
#define SD_BOTH 0x02
-#define MODULE "HTTPServer"
+#define MODULENAME "HTTPServer"
#define MSG_BOX_TITEL Translate("Miranda NG HTTP-Server")
#define SplitIpAddress( p ) (BYTE)(p>>24),(BYTE)(p>>16),(BYTE)(p>>8),(BYTE)(p)
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE)
- {}
+ CMPlugin();
};
extern HNETLIBUSER hNetlibUser;
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index edc0c5ceac..6fd41c2625 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -201,7 +201,7 @@ unsigned long GetExternIP(const char *szURL, const char *szPattern) string sCreateLink(const char * pszSrvPath)
{
char szTemp[30];
- string sLink = DBGetString(NULL, MODULE, "ExternalSrvName", szDefaultExternalSrvName);
+ string sLink = DBGetString(NULL, MODULENAME, "ExternalSrvName", szDefaultExternalSrvName);
mir_snprintf(szTemp, "%d.%d.%d.%d", SplitIpAddress(dwLocalIpAddress));
ReplaceAll(sLink, "%LocalIP%", szTemp);
@@ -721,45 +721,45 @@ static INT_PTR CALLBACK DlgProcStatsticView(HWND hwndDlg, UINT msg, WPARAM wPara LVCOLUMN cCol = { 0 };
cCol.mask = LVCF_TEXT | LVCF_WIDTH;
- cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx1", 126);
+ cCol.cx = db_get_w(NULL, MODULENAME, "StatWnd_cx1", 126);
cCol.pszText = Translate("Share name");
ListView_InsertColumn(hShareList, 0, &cCol);
- cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx2", 48);
+ cCol.cx = db_get_w(NULL, MODULENAME, "StatWnd_cx2", 48);
cCol.pszText = Translate("Max Downloads");
ListView_InsertColumn(hShareList, 1, &cCol);
- cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx3", 96);
+ cCol.cx = db_get_w(NULL, MODULENAME, "StatWnd_cx3", 96);
cCol.pszText = Translate("Allowed IP");
ListView_InsertColumn(hShareList, 2, &cCol);
- cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx4", 104);
+ cCol.cx = db_get_w(NULL, MODULENAME, "StatWnd_cx4", 104);
cCol.pszText = Translate("Allowed Mask");
ListView_InsertColumn(hShareList, 3, &cCol);
- cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx5", 252);
+ cCol.cx = db_get_w(NULL, MODULENAME, "StatWnd_cx5", 252);
cCol.pszText = Translate("Real path");
ListView_InsertColumn(hShareList, 4, &cCol);
cCol.mask = LVCF_TEXT | LVCF_WIDTH;
- cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx6", 142);
+ cCol.cx = db_get_w(NULL, MODULENAME, "StatWnd_cx6", 142);
cCol.pszText = Translate("Share name");
ListView_InsertColumn(hUserList, 0, &cCol);
- cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx7", 111);
+ cCol.cx = db_get_w(NULL, MODULENAME, "StatWnd_cx7", 111);
cCol.pszText = Translate("User");
ListView_InsertColumn(hUserList, 1, &cCol);
- cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx8", 100);
+ cCol.cx = db_get_w(NULL, MODULENAME, "StatWnd_cx8", 100);
cCol.pszText = Translate("Agent");
ListView_InsertColumn(hUserList, 2, &cCol);
- cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx9", 100);
+ cCol.cx = db_get_w(NULL, MODULENAME, "StatWnd_cx9", 100);
cCol.pszText = Translate("Completed");
ListView_InsertColumn(hUserList, 3, &cCol);
- cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx10", 100);
+ cCol.cx = db_get_w(NULL, MODULENAME, "StatWnd_cx10", 100);
cCol.pszText = Translate("Speed");
ListView_InsertColumn(hUserList, 4, &cCol);
- bool b = db_get_b(NULL, MODULE, "StatWnd_ShowHidden", 0) != 0;
+ bool b = db_get_b(NULL, MODULENAME, "StatWnd_ShowHidden", 0) != 0;
CheckDlgButton(hwndDlg, IDC_SHOWHIDDENSHARES, b ? BST_CHECKED : BST_UNCHECKED);
bLastAutoRefress = false;
UpdateStatisticView(hwndDlg);
- Utils_RestoreWindowPosition(hwndDlg, 0, MODULE, "StatWnd_");
+ Utils_RestoreWindowPosition(hwndDlg, 0, MODULENAME, "StatWnd_");
SetWindowsCtrls(hwndDlg);
}
return TRUE;
@@ -959,21 +959,21 @@ static INT_PTR CALLBACK DlgProcStatsticView(HWND hwndDlg, UINT msg, WPARAM wPara HWND hShareList = GetDlgItem(hwndDlg, IDC_CURRENT_SHARES);
HWND hUserList = GetDlgItem(hwndDlg, IDC_CURRENT_USERS);
- db_set_w(NULL, MODULE, "StatWnd_cx1", (WORD)ListView_GetColumnWidth(hShareList, 0));
- db_set_w(NULL, MODULE, "StatWnd_cx2", (WORD)ListView_GetColumnWidth(hShareList, 1));
- db_set_w(NULL, MODULE, "StatWnd_cx3", (WORD)ListView_GetColumnWidth(hShareList, 2));
- db_set_w(NULL, MODULE, "StatWnd_cx4", (WORD)ListView_GetColumnWidth(hShareList, 3));
- db_set_w(NULL, MODULE, "StatWnd_cx5", (WORD)ListView_GetColumnWidth(hShareList, 4));
- db_set_w(NULL, MODULE, "StatWnd_cx6", (WORD)ListView_GetColumnWidth(hUserList, 0));
- db_set_w(NULL, MODULE, "StatWnd_cx7", (WORD)ListView_GetColumnWidth(hUserList, 1));
- db_set_w(NULL, MODULE, "StatWnd_cx8", (WORD)ListView_GetColumnWidth(hUserList, 2));
- db_set_w(NULL, MODULE, "StatWnd_cx9", (WORD)ListView_GetColumnWidth(hUserList, 3));
- db_set_w(NULL, MODULE, "StatWnd_cx10", (WORD)ListView_GetColumnWidth(hUserList, 4));
+ db_set_w(NULL, MODULENAME, "StatWnd_cx1", (WORD)ListView_GetColumnWidth(hShareList, 0));
+ db_set_w(NULL, MODULENAME, "StatWnd_cx2", (WORD)ListView_GetColumnWidth(hShareList, 1));
+ db_set_w(NULL, MODULENAME, "StatWnd_cx3", (WORD)ListView_GetColumnWidth(hShareList, 2));
+ db_set_w(NULL, MODULENAME, "StatWnd_cx4", (WORD)ListView_GetColumnWidth(hShareList, 3));
+ db_set_w(NULL, MODULENAME, "StatWnd_cx5", (WORD)ListView_GetColumnWidth(hShareList, 4));
+ db_set_w(NULL, MODULENAME, "StatWnd_cx6", (WORD)ListView_GetColumnWidth(hUserList, 0));
+ db_set_w(NULL, MODULENAME, "StatWnd_cx7", (WORD)ListView_GetColumnWidth(hUserList, 1));
+ db_set_w(NULL, MODULENAME, "StatWnd_cx8", (WORD)ListView_GetColumnWidth(hUserList, 2));
+ db_set_w(NULL, MODULENAME, "StatWnd_cx9", (WORD)ListView_GetColumnWidth(hUserList, 3));
+ db_set_w(NULL, MODULENAME, "StatWnd_cx10", (WORD)ListView_GetColumnWidth(hUserList, 4));
bool b = IsDlgButtonChecked(hwndDlg, IDC_SHOWHIDDENSHARES) == BST_CHECKED;
- db_set_b(NULL, MODULE, "StatWnd_ShowHidden", b);
+ db_set_b(NULL, MODULENAME, "StatWnd_ShowHidden", b);
- Utils_SaveWindowPosition(hwndDlg, 0, MODULE, "StatWnd_");
+ Utils_SaveWindowPosition(hwndDlg, 0, MODULENAME, "StatWnd_");
DestroyWindow(hwndDlg);
return TRUE;
}
@@ -1039,12 +1039,12 @@ static INT_PTR nShareNewFile(WPARAM hContact, LPARAM lParam) if (!stNewShare.dwAllowedIP)
stNewShare.dwAllowedIP = db_get_dw(hContact, dbv.pszVal, "RealIP", 0);
if (!stNewShare.dwAllowedIP)
- stNewShare.dwAllowedIP = db_get_dw(hContact, MODULE, "LastUsedIP", 0);
+ stNewShare.dwAllowedIP = db_get_dw(hContact, MODULENAME, "LastUsedIP", 0);
}
}
db_free(&dbv);
- stNewShare.dwAllowedMask = db_get_dw(hContact, MODULE, "LastUsedMask", 0);
+ stNewShare.dwAllowedMask = db_get_dw(hContact, MODULENAME, "LastUsedMask", 0);
}
if (!stNewShare.dwAllowedMask) {
@@ -1058,14 +1058,14 @@ static INT_PTR nShareNewFile(WPARAM hContact, LPARAM lParam) return 0;
if (stNewShare.dwAllowedIP)
- db_set_dw(hContact, MODULE, "LastUsedIP", stNewShare.dwAllowedIP);
+ db_set_dw(hContact, MODULENAME, "LastUsedIP", stNewShare.dwAllowedIP);
else
- db_unset(hContact, MODULE, "LastUsedIP");
+ db_unset(hContact, MODULENAME, "LastUsedIP");
if (stNewShare.dwAllowedMask && stNewShare.dwAllowedMask != 0xFFFFFFFF)
- db_set_dw(hContact, MODULE, "LastUsedMask", stNewShare.dwAllowedMask);
+ db_set_dw(hContact, MODULENAME, "LastUsedMask", stNewShare.dwAllowedMask);
else
- db_unset(hContact, MODULE, "LastUsedMask");
+ db_unset(hContact, MODULENAME, "LastUsedMask");
SendLinkToUser(hContact, stNewShare.pszSrvPath);
return 0;
@@ -1103,16 +1103,16 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP switch (msg) {
case WM_INITDIALOG:
{
- string sDefExt = DBGetString(NULL, MODULE, "ExternalSrvName", szDefaultExternalSrvName);
+ string sDefExt = DBGetString(NULL, MODULENAME, "ExternalSrvName", szDefaultExternalSrvName);
SetDlgItemText(hwndDlg, IDC_EXTERNAL_SRV_NAME, sDefExt.c_str());
- bool b = db_get_b(NULL, MODULE, "AddStatisticsMenuItem", 1) != 0;
+ bool b = db_get_b(NULL, MODULENAME, "AddStatisticsMenuItem", 1) != 0;
CheckDlgButton(hwndDlg, IDC_ADD_STATISTICS_MENU_ITEM, b ? BST_CHECKED : BST_UNCHECKED);
- b = db_get_b(NULL, MODULE, "AddAcceptConMenuItem", 1) != 0;
+ b = db_get_b(NULL, MODULENAME, "AddAcceptConMenuItem", 1) != 0;
CheckDlgButton(hwndDlg, IDC_ACCEPT_COM_MENU_ITEM, b ? BST_CHECKED : BST_UNCHECKED);
- b = db_get_b(NULL, MODULE, "WriteLogFile", 0) != 0;
+ b = db_get_b(NULL, MODULENAME, "WriteLogFile", 0) != 0;
CheckDlgButton(hwndDlg, IDC_WRITE_LOG_FILE, b ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOW_POPUPS, bShowPopups ? BST_CHECKED : BST_UNCHECKED);
@@ -1148,7 +1148,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP SetDlgItemInt(hwndDlg, IDC_DEFAULT_DOWNLOAD_LIMIT, nDefaultDownloadLimit, true);
indexCreationMode =
- (eIndexCreationMode)db_get_b(NULL, MODULE, "IndexCreationMode", 3);
+ (eIndexCreationMode)db_get_b(NULL, MODULENAME, "IndexCreationMode", 3);
switch (indexCreationMode) {
case INDEX_CREATION_HTML:
@@ -1232,64 +1232,64 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP {
char szTemp[500];
if (GetDlgItemText(hwndDlg, IDC_EXTERNAL_SRV_NAME, szTemp, _countof(szTemp)))
- db_set_s(NULL, MODULE, "ExternalSrvName", szTemp);
+ db_set_s(NULL, MODULENAME, "ExternalSrvName", szTemp);
- bool b = db_get_b(NULL, MODULE, "AddStatisticsMenuItem", 1) != 0;
+ bool b = db_get_b(NULL, MODULENAME, "AddStatisticsMenuItem", 1) != 0;
bool bNew = IsDlgButtonChecked(hwndDlg, IDC_ADD_STATISTICS_MENU_ITEM) == BST_CHECKED;
if (b != bNew) {
- db_set_b(NULL, MODULE, "AddStatisticsMenuItem", bNew);
+ db_set_b(NULL, MODULENAME, "AddStatisticsMenuItem", bNew);
MessageBox(hwndDlg, Translate("You need to restart Miranda to change the main menu"), MSG_BOX_TITEL, MB_OK);
}
- b = db_get_b(NULL, MODULE, "AddAcceptConMenuItem", 1) != 0;
+ b = db_get_b(NULL, MODULENAME, "AddAcceptConMenuItem", 1) != 0;
bNew = IsDlgButtonChecked(hwndDlg, IDC_ACCEPT_COM_MENU_ITEM) == BST_CHECKED;
if (b != bNew) {
- db_set_b(NULL, MODULE, "AddAcceptConMenuItem", bNew);
+ db_set_b(NULL, MODULENAME, "AddAcceptConMenuItem", bNew);
MessageBox(hwndDlg, Translate("You need to restart Miranda to change the main menu"), MSG_BOX_TITEL, MB_OK);
}
bNew = IsDlgButtonChecked(hwndDlg, IDC_WRITE_LOG_FILE) == BST_CHECKED;
- db_set_b(NULL, MODULE, "WriteLogFile", bNew);
+ db_set_b(NULL, MODULENAME, "WriteLogFile", bNew);
bShowPopups = IsDlgButtonChecked(hwndDlg, IDC_SHOW_POPUPS) == BST_CHECKED;
- db_set_b(NULL, MODULE, "ShowPopups", bShowPopups);
+ db_set_b(NULL, MODULENAME, "ShowPopups", bShowPopups);
GetDlgItemText(hwndDlg, IDC_URL_ADDRESS, szTemp, _countof(szTemp));
sUrlAddress = szTemp;
- db_set_s(NULL, MODULE, "UrlAddress", sUrlAddress.c_str());
+ db_set_s(NULL, MODULENAME, "UrlAddress", sUrlAddress.c_str());
GetDlgItemText(hwndDlg, IDC_PAGE_KEYWORD, szTemp, _countof(szTemp));
sPageKeyword = szTemp;
- db_set_s(NULL, MODULE, "PageKeyword", sPageKeyword.c_str());
+ db_set_s(NULL, MODULENAME, "PageKeyword", sPageKeyword.c_str());
dwExternalIpAddress = 0;
BOOL bTranslated = false;
int nTemp = GetDlgItemInt(hwndDlg, IDC_MAX_SPEED, &bTranslated, true);
if (bTranslated) {
nMaxUploadSpeed = nTemp << 10;
- db_set_dw(NULL, MODULE, "MaxUploadSpeed", nMaxUploadSpeed);
+ db_set_dw(NULL, MODULENAME, "MaxUploadSpeed", nMaxUploadSpeed);
}
nTemp = GetDlgItemInt(hwndDlg, IDC_MAX_CONN_TOTAL, &bTranslated, true);
if (bTranslated) {
nMaxConnectionsTotal = nTemp;
- db_set_dw(NULL, MODULE, "MaxConnectionsTotal", nMaxConnectionsTotal);
+ db_set_dw(NULL, MODULENAME, "MaxConnectionsTotal", nMaxConnectionsTotal);
}
nTemp = GetDlgItemInt(hwndDlg, IDC_MAX_CONN_PER_USER, &bTranslated, true);
if (bTranslated) {
nMaxConnectionsPerUser = nTemp;
- db_set_dw(NULL, MODULE, "MaxConnectionsPerUser", nMaxConnectionsPerUser);
+ db_set_dw(NULL, MODULENAME, "MaxConnectionsPerUser", nMaxConnectionsPerUser);
}
nTemp = GetDlgItemInt(hwndDlg, IDC_DEFAULT_DOWNLOAD_LIMIT, &bTranslated, true);
if (bTranslated) {
nDefaultDownloadLimit = nTemp;
- db_set_dw(NULL, MODULE, "DefaultDownloadLimit", nDefaultDownloadLimit);
+ db_set_dw(NULL, MODULENAME, "DefaultDownloadLimit", nDefaultDownloadLimit);
}
bLimitOnlyWhenOnline = IsDlgButtonChecked(hwndDlg, IDC_LIMIT_ONLY_WHEN_ONLINE) == BST_CHECKED;
- db_set_b(NULL, MODULE, "LimitOnlyWhenOnline", bLimitOnlyWhenOnline);
+ db_set_b(NULL, MODULENAME, "LimitOnlyWhenOnline", bLimitOnlyWhenOnline);
if (IsDlgButtonChecked(hwndDlg, IDC_INDEX_HTML) == BST_CHECKED ||
IsDlgButtonChecked(hwndDlg, IDC_INDEX_DETECT) == BST_CHECKED) {
@@ -1312,7 +1312,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP indexCreationMode = INDEX_CREATION_DISABLE;
}
- db_set_b(NULL, MODULE, "IndexCreationMode", (BYTE)indexCreationMode);
+ db_set_b(NULL, MODULENAME, "IndexCreationMode", (BYTE)indexCreationMode);
return TRUE;
}
@@ -1367,7 +1367,7 @@ int OptionsInitialize(WPARAM wParam, LPARAM /*lParam*/) void CALLBACK MainThreadCallback(ULONG_PTR dwParam)
{
POPUPDATAT *pclData = (POPUPDATAT*)dwParam;
- if (db_get_b(NULL, MODULE, "WriteLogFile", 0) != 0)
+ if (db_get_b(NULL, MODULENAME, "WriteLogFile", 0) != 0)
LogEvent(pclData->lpzContactName, pclData->lpzText);
PUAddPopupT(pclData);
@@ -1467,8 +1467,8 @@ void InitGuiElements() //hMainThread = GetCurrentThread();
DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hMainThread, THREAD_SET_CONTEXT, FALSE, 0);
- sUrlAddress = DBGetString(NULL, MODULE, "UrlAddress", szDefaultUrlAddress);
- sPageKeyword = DBGetString(NULL, MODULE, "PageKeyword", szDefaultPageKeyword);
+ sUrlAddress = DBGetString(NULL, MODULENAME, "UrlAddress", szDefaultUrlAddress);
+ sPageKeyword = DBGetString(NULL, MODULENAME, "PageKeyword", szDefaultPageKeyword);
hShareNewFileService = CreateServiceFunction(MS_SHARE_NEW_FILE, nShareNewFile);
hShowStatisticsViewService = CreateServiceFunction(MS_SHOW_STATISTICS_VIEW, nShowStatisticsView);
@@ -1482,7 +1482,7 @@ void InitGuiElements() mi.pszService = MS_SHARE_NEW_FILE;
hShareNewFileMenuItem = Menu_AddContactMenuItem(&mi);
- if (db_get_b(NULL, MODULE, "AddStatisticsMenuItem", 1) != 0) {
+ if (db_get_b(NULL, MODULENAME, "AddStatisticsMenuItem", 1) != 0) {
SET_UID(mi, 0x68db84c9, 0xe6b4, 0x4b4f, 0x93, 0x4b, 0xfd, 0x34, 0x2d, 0x83, 0x11, 0xe7);
mi.position = 1000085005;
mi.name.w = LPGENW("Show HTTP server statistics");
@@ -1494,7 +1494,7 @@ void InitGuiElements() if (!hEventOptionsInitialize)
MessageBox(nullptr, "Failed to HookEvent ME_OPT_INITIALISE", MSG_BOX_TITEL, MB_OK);
- bShowPopups = db_get_b(NULL, MODULE, "ShowPopups", bShowPopups) != 0;
+ bShowPopups = db_get_b(NULL, MODULENAME, "ShowPopups", bShowPopups) != 0;
}
/////////////////////////////////////////////////////////////////////
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index 9b695fed2b..99b39082f5 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -87,7 +87,9 @@ int &hLangpack(g_plugin.m_hLang); extern HWND hwndStatsticView;
-PLUGININFOEX pluginInfo = {
+/////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -100,7 +102,14 @@ PLUGININFOEX pluginInfo = { {0x67848b07, 0x83d2, 0x49e9, {0x88, 0x44, 0x7e, 0x3d, 0xe2, 0x68, 0xe3, 0x4}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD /*mirandaVersion*/)
+{
+ return &pluginInfoEx;
+}
/////////////////////////////////////////////////////////////////////
// Member Function : bOpenLogFile
@@ -664,7 +673,7 @@ INT_PTR nToggelAcceptConnections(WPARAM wparam, LPARAM /*lparam*/) else return 0; // no changes;
if (!bShutdownInProgress)
- db_set_b(NULL, MODULE, "AcceptConnections", hDirectBoundPort != nullptr);
+ db_set_b(NULL, MODULENAME, "AcceptConnections", hDirectBoundPort != nullptr);
return 0;
}
@@ -717,7 +726,7 @@ int MainInit(WPARAM /*wparam*/, LPARAM /*lparam*/) NETLIBUSER nlu = {};
nlu.flags = NUF_OUTGOING | NUF_INCOMING;
- nlu.szSettingsModule = MODULE;
+ nlu.szSettingsModule = MODULENAME;
nlu.szDescriptiveName.a = Translate("HTTP Server");
hNetlibUser = Netlib_RegisterUser(&nlu);
if (!hNetlibUser) {
@@ -725,7 +734,7 @@ int MainInit(WPARAM /*wparam*/, LPARAM /*lparam*/) return 0;
}
- if (db_get_b(NULL, MODULE, "AcceptConnections", 1))
+ if (db_get_b(NULL, MODULENAME, "AcceptConnections", 1))
nToggelAcceptConnections(0, 0);
InitGuiElements();
@@ -791,31 +800,13 @@ int nSystemShutdown(WPARAM /*wparam*/, LPARAM /*lparam*/) UnInitGuiElements();
- db_set_b(NULL, MODULE, "IndexCreationMode", (BYTE)indexCreationMode);
+ db_set_b(NULL, MODULENAME, "IndexCreationMode", (BYTE)indexCreationMode);
FreeIndexHTMLTemplate();
return 0;
}
/////////////////////////////////////////////////////////////////////
-// Member Function : MirandaPluginInfoEx
-// Type : Global
-// Parameters : mirandaVersion - ?
-// Returns :
-// Description :
-//
-// References : -
-// Remarks : -
-// Created : 020422, 22 April 2002
-// Developer : KN, Houdini
-/////////////////////////////////////////////////////////////////////
-
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD /*mirandaVersion*/)
-{
- return &pluginInfo;
-}
-
-/////////////////////////////////////////////////////////////////////
// Member Function : Load
// Type : Global
// Parameters : link - ?
@@ -830,7 +821,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD /*miran extern "C" __declspec(dllexport) int Load()
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
hHttpAcceptConnectionsService = CreateServiceFunction(MS_HTTP_ACCEPT_CONNECTIONS, nToggelAcceptConnections);
@@ -889,13 +880,13 @@ extern "C" __declspec(dllexport) int Load() if (!bInitMimeHandling())
MessageBox(nullptr, "Failed to read configuration file : " szMimeTypeConfigFile, MSG_BOX_TITEL, MB_OK);
- nMaxUploadSpeed = db_get_dw(NULL, MODULE, "MaxUploadSpeed", nMaxUploadSpeed);
- nMaxConnectionsTotal = db_get_dw(NULL, MODULE, "MaxConnectionsTotal", nMaxConnectionsTotal);
- nMaxConnectionsPerUser = db_get_dw(NULL, MODULE, "MaxConnectionsPerUser", nMaxConnectionsPerUser);
- bLimitOnlyWhenOnline = db_get_b(NULL, MODULE, "LimitOnlyWhenOnline", bLimitOnlyWhenOnline) != 0;
- indexCreationMode = (eIndexCreationMode)db_get_b(NULL, MODULE, "IndexCreationMode", 2);
+ nMaxUploadSpeed = db_get_dw(NULL, MODULENAME, "MaxUploadSpeed", nMaxUploadSpeed);
+ nMaxConnectionsTotal = db_get_dw(NULL, MODULENAME, "MaxConnectionsTotal", nMaxConnectionsTotal);
+ nMaxConnectionsPerUser = db_get_dw(NULL, MODULENAME, "MaxConnectionsPerUser", nMaxConnectionsPerUser);
+ bLimitOnlyWhenOnline = db_get_b(NULL, MODULENAME, "LimitOnlyWhenOnline", bLimitOnlyWhenOnline) != 0;
+ indexCreationMode = (eIndexCreationMode)db_get_b(NULL, MODULENAME, "IndexCreationMode", 2);
- if (db_get_b(NULL, MODULE, "AddAcceptConMenuItem", 1)) {
+ if (db_get_b(NULL, MODULENAME, "AddAcceptConMenuItem", 1)) {
CMenuItem mi;
SET_UID(mi, 0xf0a68784, 0xc30e, 0x4245, 0xb6, 0x2b, 0xb8, 0x71, 0x7e, 0xe6, 0xe1, 0x73);
mi.flags = CMIF_UNICODE;
@@ -909,7 +900,7 @@ extern "C" __declspec(dllexport) int Load() if (indexCreationMode == INDEX_CREATION_HTML || indexCreationMode == INDEX_CREATION_DETECT)
if (!LoadIndexHTMLTemplate()) {
indexCreationMode = INDEX_CREATION_DISABLE;
- db_set_b(NULL, MODULE, "IndexCreationMode", (BYTE)indexCreationMode);
+ db_set_b(NULL, MODULENAME, "IndexCreationMode", (BYTE)indexCreationMode);
}
hEventProtoAck = HookEvent(ME_PROTO_ACK, nProtoAck);
diff --git a/plugins/HistoryLinkListPlus/src/linklist.cpp b/plugins/HistoryLinkListPlus/src/linklist.cpp index 4fef7f20b9..6ec31d06fe 100644 --- a/plugins/HistoryLinkListPlus/src/linklist.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist.cpp @@ -22,7 +22,9 @@ HCURSOR splitCursor; CMPlugin g_plugin;
int &hLangpack(g_plugin.m_hLang);
-PLUGININFOEX pluginInfo = {
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -35,55 +37,20 @@ PLUGININFOEX pluginInfo = { {0xDA0B09F5, 0x9C66, 0x488C, {0xAE, 0x37, 0x8A, 0x5F, 0x19, 0x1C, 0x90, 0x79}}
};
-extern "C" __declspec(dllexport) int Load(void)
-{
- mir_getLP(&pluginInfo);
-
- CreateServiceFunction("Linklist/MenuCommand", LinkList_Main);
-
- CMenuItem mi;
- SET_UID(mi, 0x2964dc6c, 0x9cf9, 0x4f20, 0x8f, 0x8a, 0xc6, 0xfe, 0xe2, 0x65, 0xac, 0xc9);
- mi.flags = CMIF_UNICODE;
- mi.hIcolibItem = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_LINKLISTICON));
- mi.name.w = LPGENW("&Create Linklist");
- mi.pszService = "Linklist/MenuCommand";
- Menu_AddContactMenuItem(&mi);
-
- hWindowList = WindowList_Create();
-
- WNDCLASS wndclass = { 0 };
- wndclass.style = CS_HREDRAW | CS_VREDRAW;
- wndclass.lpfnWndProc = ProgressBarDlg;
- wndclass.hInstance = g_plugin.getInst();
- wndclass.hIcon = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_LINKLISTICON));
- wndclass.hCursor = LoadCursor(nullptr, IDC_ARROW);
- wndclass.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
- wndclass.lpszClassName = L"Progressbar";
- RegisterClass(&wndclass);
-
- splitCursor = LoadCursor(nullptr, IDC_SIZENS);
-
- HookEvent(ME_OPT_INITIALISE, InitOptionsDlg);
- HookEvent(ME_DB_EVENT_ADDED, DBUpdate);
-
- return 0;
-}
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(LINKLIST_MODULE, pluginInfoEx)
+{}
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
-extern "C" __declspec(dllexport) int Unload(void)
-{
- WindowList_Destroy(hWindowList);
- DestroyCursor(splitCursor);
- return 0;
-}
+/////////////////////////////////////////////////////////////////////////////////////////
-int InitOptionsDlg(WPARAM wParam, LPARAM)
+static int InitOptionsDlg(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.hInstance = g_plugin.getInst();
odp.szGroup.a = LPGEN("History");
odp.szTitle.a = LPGEN("History Linklist");
@@ -183,3 +150,46 @@ static INT_PTR LinkList_Main(WPARAM hContact, LPARAM) ShowWindow(hWndMain, SW_SHOW);
return 0;
}
+
+extern "C" __declspec(dllexport) int Load(void)
+{
+ mir_getLP(&pluginInfoEx);
+
+ CreateServiceFunction("Linklist/MenuCommand", LinkList_Main);
+
+ CMenuItem mi;
+ SET_UID(mi, 0x2964dc6c, 0x9cf9, 0x4f20, 0x8f, 0x8a, 0xc6, 0xfe, 0xe2, 0x65, 0xac, 0xc9);
+ mi.flags = CMIF_UNICODE;
+ mi.hIcolibItem = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_LINKLISTICON));
+ mi.name.w = LPGENW("&Create Linklist");
+ mi.pszService = "Linklist/MenuCommand";
+ Menu_AddContactMenuItem(&mi);
+
+ hWindowList = WindowList_Create();
+
+ WNDCLASS wndclass = {};
+ wndclass.style = CS_HREDRAW | CS_VREDRAW;
+ wndclass.lpfnWndProc = ProgressBarDlg;
+ wndclass.hInstance = g_plugin.getInst();
+ wndclass.hIcon = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_LINKLISTICON));
+ wndclass.hCursor = LoadCursor(nullptr, IDC_ARROW);
+ wndclass.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
+ wndclass.lpszClassName = L"Progressbar";
+ RegisterClass(&wndclass);
+
+ splitCursor = LoadCursor(nullptr, IDC_SIZENS);
+
+ HookEvent(ME_OPT_INITIALISE, InitOptionsDlg);
+ HookEvent(ME_DB_EVENT_ADDED, DBUpdate);
+
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+extern "C" __declspec(dllexport) int Unload(void)
+{
+ WindowList_Destroy(hWindowList);
+ DestroyCursor(splitCursor);
+ return 0;
+}
diff --git a/plugins/HistoryLinkListPlus/src/stdafx.h b/plugins/HistoryLinkListPlus/src/stdafx.h index c164f59b98..dd92964454 100644 --- a/plugins/HistoryLinkListPlus/src/stdafx.h +++ b/plugins/HistoryLinkListPlus/src/stdafx.h @@ -129,9 +129,7 @@ typedef struct { struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(LINKLIST_MODULE)
- {}
+ CMPlugin();
};
#define _mstrlen(x) (_countof(x) - 1)
@@ -153,8 +151,6 @@ typedef struct { } DIALOGPARAM;
-static INT_PTR LinkList_Main(WPARAM, LPARAM);
-int InitOptionsDlg(WPARAM, LPARAM);
int DBUpdate(WPARAM, LPARAM);
int ExtractURI(DBEVENTINFO*, MEVENT, LISTELEMENT*);
int RemoveList(LISTELEMENT*);
diff --git a/plugins/HistoryStats/src/main.cpp b/plugins/HistoryStats/src/main.cpp index 44aba9af45..151ce2ecf5 100644 --- a/plugins/HistoryStats/src/main.cpp +++ b/plugins/HistoryStats/src/main.cpp @@ -16,7 +16,7 @@ int &hLangpack(g_plugin.m_hLang); static const int g_pluginFileListID = 2535;
-PLUGININFOEX g_pluginInfoEx = {
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -29,6 +29,10 @@ PLUGININFOEX g_pluginInfoEx = { {0xf184f5a0, 0xc198, 0x4454, {0xa9, 0xb4, 0xf6, 0xe2, 0xfd, 0x53, 0x41, 0x33}},
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>("HistoryStats", pluginInfoEx)
+{}
+
SettingsSerializer* g_pSettings = nullptr;
bool g_bMainMenuExists = false;
@@ -383,12 +387,12 @@ extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD) OutputDebugString(L"HistoryStats: MirandaPluginInfoEx() was called.\n");
// MEMO: (don't) fail, if version is below minimum
- return &g_pluginInfoEx;
+ return &pluginInfoEx;
}
extern "C" __declspec(dllexport) int Load()
{
- mir_getLP(&g_pluginInfoEx);
+ mir_getLP(&pluginInfoEx);
// init COM, needed for GUID generation
CoInitialize(nullptr);
diff --git a/plugins/HistoryStats/src/main.h b/plugins/HistoryStats/src/main.h index a2dffb20c6..1d2048d05c 100644 --- a/plugins/HistoryStats/src/main.h +++ b/plugins/HistoryStats/src/main.h @@ -7,7 +7,7 @@ #include "settingsserializer.h"
#include "statistic.h"
-extern PLUGININFOEX g_pluginInfoEx;
+extern PLUGININFOEX pluginInfoEx;
extern SettingsSerializer* g_pSettings;
diff --git a/plugins/HistoryStats/src/settings.cpp b/plugins/HistoryStats/src/settings.cpp index f41602217c..08f1518ea7 100644 --- a/plugins/HistoryStats/src/settings.cpp +++ b/plugins/HistoryStats/src/settings.cpp @@ -161,7 +161,7 @@ void Settings::clearColumns() }
Settings::Settings() :
- m_VersionCurrent(g_pluginInfoEx.version),
+ m_VersionCurrent(pluginInfoEx.version),
// global settings
m_OnStartup(false),
@@ -232,7 +232,7 @@ Settings::Settings() : }
Settings::Settings(const Settings& other) :
- m_VersionCurrent(g_pluginInfoEx.version)
+ m_VersionCurrent(pluginInfoEx.version)
{
*this = other;
}
diff --git a/plugins/HistoryStats/src/stdafx.h b/plugins/HistoryStats/src/stdafx.h index 55e11acbb8..f61e53f3ea 100644 --- a/plugins/HistoryStats/src/stdafx.h +++ b/plugins/HistoryStats/src/stdafx.h @@ -126,9 +126,7 @@ namespace ext struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>("HistoryStats")
- {}
+ CMPlugin();
};
#endif // HISTORYSTATS_GUARD__GLOABLS_H
diff --git a/plugins/HistorySweeperLight/src/main.cpp b/plugins/HistorySweeperLight/src/main.cpp index 9ddc5c5e84..dae726de88 100644 --- a/plugins/HistorySweeperLight/src/main.cpp +++ b/plugins/HistorySweeperLight/src/main.cpp @@ -26,6 +26,8 @@ int &hLangpack(g_plugin.m_hLang); LIST<void> g_hWindows(5, PtrKeySortT);
+/////////////////////////////////////////////////////////////////////////////////////////
+
static PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
@@ -40,7 +42,18 @@ static PLUGININFOEX pluginInfoEx = { 0x1d9bf74a, 0x44a8, 0x4b3f, { 0xa6, 0xe5, 0x73, 0x6, 0x9d, 0x3a, 0x89, 0x79 } }
};
-int OnIconPressed(WPARAM hContact, LPARAM lParam)
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(ModuleName, pluginInfoEx)
+{}
+
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
+{
+ return &pluginInfoEx;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static int OnIconPressed(WPARAM hContact, LPARAM lParam)
{
StatusIconClickData *sicd = (StatusIconClickData *)lParam;
@@ -63,7 +76,7 @@ int OnIconPressed(WPARAM hContact, LPARAM lParam) return 0;
}
-int OnModulesLoaded(WPARAM, LPARAM)
+static int OnModulesLoaded(WPARAM, LPARAM)
{
int sweep = db_get_b(NULL, ModuleName, "SweepHistory", 0);
@@ -106,11 +119,6 @@ int OnModulesLoaded(WPARAM, LPARAM) return 0;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
-{
- return &pluginInfoEx;
-}
-
extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfoEx);
@@ -122,6 +130,8 @@ extern "C" __declspec(dllexport) int Load(void) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) int Unload(void)
{
ShutdownAction();
diff --git a/plugins/HistorySweeperLight/src/stdafx.h b/plugins/HistorySweeperLight/src/stdafx.h index 27d77a69d2..c6ee6ae3c4 100644 --- a/plugins/HistorySweeperLight/src/stdafx.h +++ b/plugins/HistorySweeperLight/src/stdafx.h @@ -46,9 +46,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(ModuleName)
- {}
+ CMPlugin();
};
// main.c
diff --git a/plugins/HwHotKeys/src/HwHotKeys_Dlg.cpp b/plugins/HwHotKeys/src/HwHotKeys_Dlg.cpp index 012da96a25..934b01863f 100644 --- a/plugins/HwHotKeys/src/HwHotKeys_Dlg.cpp +++ b/plugins/HwHotKeys/src/HwHotKeys_Dlg.cpp @@ -87,11 +87,11 @@ INT_PTR CALLBACK OptDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
case PSN_APPLY: // система просит сохранить настройки плагина
code_Close = code_Close_tmp;
- db_set_dw(0, __DbModName, "Close", code_Close_tmp);
+ db_set_dw(0, MODULENAME, "Close", code_Close_tmp);
code_HideShow = code_HideShow_tmp;
- db_set_dw(0, __DbModName, "HideShow", code_HideShow_tmp);
+ db_set_dw(0, MODULENAME, "HideShow", code_HideShow_tmp);
code_ReadMsg = code_ReadMsg_tmp;
- db_set_dw(0, __DbModName, "ReadMsg", code_ReadMsg_tmp);
+ db_set_dw(0, MODULENAME, "ReadMsg", code_ReadMsg_tmp);
break; //case PSN_APPLY
}
break; //case 0
diff --git a/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp b/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp index 63d0a172fa..2e4b74d94c 100644 --- a/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp +++ b/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp @@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 - 1307, USA. CMPlugin g_plugin;
int &hLangpack(g_plugin.m_hLang);
+
HWND hDialogWnd = nullptr; // хэндл окна настроек, он глобально используется для вывода туда в реалтайме сканкодов клавы из хука
HHOOK hHook;
CLIST_INTERFACE *pcli;
@@ -67,7 +68,7 @@ CHAR key_name_buffer[150]; // буфер куда печатается имя к // ============================================================================
-PLUGININFOEX PluginInfoEx = {
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -80,9 +81,13 @@ PLUGININFOEX PluginInfoEx = { { 0x315b3800, 0x8258, 0x44c4, { 0xb6, 0xe, 0x58, 0xc5, 0xb, 0x93, 0x3, 0xb6 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD)
{
- return &PluginInfoEx;
+ return &pluginInfoEx;
}
// ============================================================================
@@ -90,12 +95,12 @@ extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD) extern "C" __declspec(dllexport) int Load(void)
{
// загружаем (из БД) настройки плагина
- code_Close = db_get_dw(0, __DbModName, "Close", 0);
- code_HideShow = db_get_dw(0, __DbModName, "HideShow", 0);
- code_ReadMsg = db_get_dw(0, __DbModName, "ReadMsg", 0);
+ code_Close = db_get_dw(0, MODULENAME, "Close", 0);
+ code_HideShow = db_get_dw(0, MODULENAME, "HideShow", 0);
+ code_ReadMsg = db_get_dw(0, MODULENAME, "ReadMsg", 0);
// установка кода локализации - макрос mir_getLP(PlgInfoEx)
- mir_getLP(&PluginInfoEx);
+ mir_getLP(&pluginInfoEx);
// Интерфейс контактлиста - макрос заполняет CLIST_INTERFACE *pcli;
pcli = Clist_GetInterface();
diff --git a/plugins/HwHotKeys/src/stdafx.h b/plugins/HwHotKeys/src/stdafx.h index fdd33abd39..da95e622c5 100644 --- a/plugins/HwHotKeys/src/stdafx.h +++ b/plugins/HwHotKeys/src/stdafx.h @@ -38,14 +38,10 @@ INT_PTR CALLBACK OptDlgProc(HWND, UINT, WPARAM, LPARAM); VOID HwHotKeys_PrintFullKeyname(DWORD);
BOOL HwHotKeys_CompareCurrentScancode(DWORD);
LRESULT CALLBACK key_hook(INT, WPARAM, LPARAM);
-extern CLIST_INTERFACE *pcli;
-
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(__DbModName)
- {}
+ CMPlugin();
};
extern HWND hDialogWnd; // глобально используется для вывода туда в реалтайме сканкодов клавы, из хука
diff --git a/plugins/HwHotKeys/src/version.h b/plugins/HwHotKeys/src/version.h index 2ab9099fbb..c2bd0de364 100644 --- a/plugins/HwHotKeys/src/version.h +++ b/plugins/HwHotKeys/src/version.h @@ -36,5 +36,5 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 - 1307, USA. #define __AUTHORWEB "http://f2065.narod.ru/" // описание плагина в dll-fileinfo "CompanyName", описание плагина в миранде #define __COPYRIGHT "© 2010-18 Eugene f2065" // описание плагина в dll-fileinfo "LegalCopyright", описание плагина в миранде -#define __DbModName "HwHotKeys" // имя раздела настроек плагина в БД миранды +#define MODULENAME "HwHotKeys" // имя раздела настроек плагина в БД миранды diff --git a/plugins/IEHistory/src/IEHistory.cpp b/plugins/IEHistory/src/IEHistory.cpp index 4984a5984b..de3b503fd5 100644 --- a/plugins/IEHistory/src/IEHistory.cpp +++ b/plugins/IEHistory/src/IEHistory.cpp @@ -31,7 +31,7 @@ MWindowList hOpenWindowsList = nullptr; HMODULE hUxTheme = nullptr; BOOL(WINAPI *MyEnableThemeDialogTexture)(HANDLE, DWORD) = nullptr; -PLUGININFOEX pluginInfo = { +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_DISPLAY_NAME, __VERSION_DWORD, @@ -44,9 +44,13 @@ PLUGININFOEX pluginInfo = { { 0x2f093b88, 0xf389, 0x44f1, { 0x9e, 0x2a, 0x37, 0xc2, 0x91, 0x94, 0x20, 0x3a } } }; +CMPlugin::CMPlugin() : + PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx) +{} + extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD) { - return &pluginInfo; + return &pluginInfoEx; } static const MUUID interfaces[] = { MIID_UIHISTORY, MIID_LAST }; @@ -58,7 +62,7 @@ extern "C" __declspec(dllexport) const MUUID *MirandaPluginInterfaces() extern "C" int __declspec(dllexport) Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); INITCOMMONCONTROLSEX icex; icex.dwSize = sizeof(icex); diff --git a/plugins/IEHistory/src/dlgHandlers.cpp b/plugins/IEHistory/src/dlgHandlers.cpp index 5a2d643f3c..b4a70b1866 100644 --- a/plugins/IEHistory/src/dlgHandlers.cpp +++ b/plugins/IEHistory/src/dlgHandlers.cpp @@ -242,8 +242,8 @@ int LoadEvents(HWND hWnd) {
HistoryWindowData *data = (HistoryWindowData *)GetWindowLongPtr(hWnd, DWLP_USER);
int count = db_event_count(data->contact);
- int bLastFirst = db_get_b(NULL, ModuleName, "ShowLastPageFirst", 0);
- int bRTL = db_get_b(NULL, ModuleName, "EnableRTL", 0);
+ int bLastFirst = db_get_b(NULL, MODULENAME, "ShowLastPageFirst", 0);
+ int bRTL = db_get_b(NULL, MODULENAME, "EnableRTL", 0);
bRTL = db_get_b(data->contact, "Tab_SRMsg", "RTL", bRTL);
data->bEnableRTL = bRTL;
data->count = count;
@@ -363,7 +363,7 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara TranslateDialogDefault(hWnd);
SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
{
- int bRTL = db_get_b(NULL, ModuleName, "EnableRTL", 0);
+ int bRTL = db_get_b(NULL, MODULENAME, "EnableRTL", 0);
if (bRTL)
SetWindowLongPtr(hWnd, GWL_EXSTYLE, WS_EX_RTLREADING);
@@ -393,7 +393,7 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara LoadEvents(hWnd);
{
bool bAll = (data->itemsPerPage <= 0) || (data->itemsPerPage >= data->count);
- int bLastFirst = db_get_b(NULL, ModuleName, "ShowLastPageFirst", 0);
+ int bLastFirst = db_get_b(NULL, MODULENAME, "ShowLastPageFirst", 0);
if (!bLastFirst) {
EnableWindow(GetDlgItem(hWnd, IDC_PREV), FALSE);
EnableWindow(GetDlgItem(hWnd, IDC_NEXT), !bAll);
@@ -490,15 +490,15 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara case WM_INITDIALOG:
TranslateDialogDefault(hWnd);
{
- int count = db_get_dw(NULL, ModuleName, "EventsToLoad", 0);
+ int count = db_get_dw(NULL, MODULENAME, "EventsToLoad", 0);
EnableWindow(GetDlgItem(hWnd, IDC_EVENTS_COUNT), count > 0);
EnableWindow(GetDlgItem(hWnd, IDC_SHOW_LAST_FIRST), count > 0);
CheckDlgButton(hWnd, IDC_LOAD_ALL, count <= 0 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hWnd, IDC_LOAD_NUMBER, count > 0 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWnd, IDC_ENABLE_RTL, db_get_b(NULL, ModuleName, "EnableRTL", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWnd, IDC_SHOW_LAST_FIRST, db_get_b(NULL, ModuleName, "ShowLastPageFirst", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWnd, IDC_LOAD_BACKGROUND, db_get_b(NULL, ModuleName, "UseWorkerThread", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_ENABLE_RTL, db_get_b(NULL, MODULENAME, "EnableRTL", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_SHOW_LAST_FIRST, db_get_b(NULL, MODULENAME, "ShowLastPageFirst", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_LOAD_BACKGROUND, db_get_b(NULL, MODULENAME, "UseWorkerThread", 0) ? BST_CHECKED : BST_UNCHECKED);
wchar_t buffer[40];
_itow_s(count, buffer, 10);
@@ -543,10 +543,10 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara count = _wtol(buffer);
count = (count < 0) ? 0 : count;
}
- db_set_b(NULL, ModuleName, "ShowLastPageFirst", IsDlgButtonChecked(hWnd, IDC_SHOW_LAST_FIRST));
- db_set_b(NULL, ModuleName, "EnableRTL", IsDlgButtonChecked(hWnd, IDC_ENABLE_RTL));
- db_set_b(NULL, ModuleName, "UseWorkerThread", IsDlgButtonChecked(hWnd, IDC_LOAD_BACKGROUND));
- db_set_dw(NULL, ModuleName, "EventsToLoad", count);
+ db_set_b(NULL, MODULENAME, "ShowLastPageFirst", IsDlgButtonChecked(hWnd, IDC_SHOW_LAST_FIRST));
+ db_set_b(NULL, MODULENAME, "EnableRTL", IsDlgButtonChecked(hWnd, IDC_ENABLE_RTL));
+ db_set_b(NULL, MODULENAME, "UseWorkerThread", IsDlgButtonChecked(hWnd, IDC_LOAD_BACKGROUND));
+ db_set_dw(NULL, MODULENAME, "EventsToLoad", count);
}
}
break;
diff --git a/plugins/IEHistory/src/services.cpp b/plugins/IEHistory/src/services.cpp index fd24bb9243..464072b8e3 100644 --- a/plugins/IEHistory/src/services.cpp +++ b/plugins/IEHistory/src/services.cpp @@ -34,8 +34,8 @@ INT_PTR ShowContactHistoryService(WPARAM wParam, LPARAM) HWND parent = nullptr; historyDlg = WindowList_Find(hOpenWindowsList, (MCONTACT)wParam); if (historyDlg == nullptr){ - int count = db_get_dw(NULL, ModuleName, "EventsToLoad", 0); - int loadInBackground = db_get_b(NULL, ModuleName, "UseWorkerThread", 0); + int count = db_get_dw(NULL, MODULENAME, "EventsToLoad", 0); + int loadInBackground = db_get_b(NULL, MODULENAME, "UseWorkerThread", 0); HistoryWindowData *data; data = (HistoryWindowData *)malloc(sizeof(HistoryWindowData)); data->contact = (MCONTACT)wParam; diff --git a/plugins/IEHistory/src/stdafx.h b/plugins/IEHistory/src/stdafx.h index 484b43b461..2ab6a12c79 100644 --- a/plugins/IEHistory/src/stdafx.h +++ b/plugins/IEHistory/src/stdafx.h @@ -70,20 +70,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # define sntprintf snwprintf #endif -#define ModuleName "IEHistory" +#define MODULENAME "IEHistory" struct CMPlugin : public PLUGIN<CMPlugin> { - CMPlugin() : - PLUGIN<CMPlugin>(ModuleName) - {} + CMPlugin(); }; extern HICON hIcon; //history icon extern MWindowList hOpenWindowsList; -extern PLUGININFOEX pluginInfo; - extern BOOL (WINAPI *MyEnableThemeDialogTexture)(HANDLE, DWORD); #endif diff --git a/plugins/IEView/src/ieview_main.cpp b/plugins/IEView/src/ieview_main.cpp index 0cb1d34bbf..b9f3733c8a 100644 --- a/plugins/IEView/src/ieview_main.cpp +++ b/plugins/IEView/src/ieview_main.cpp @@ -26,6 +26,16 @@ char *workingDirUtf8; CMPlugin g_plugin;
int &hLangpack(g_plugin.m_hLang);
+IconItem iconList[] =
+{
+ { LPGEN("RTL On"), "RTL_ON", IDI_RTL_ON },
+ { LPGEN("RTL Off"), "RTL_OFF", IDI_RTL_OFF },
+ { LPGEN("Group On"), "GROUP_ON", IDI_GROUP_ON },
+ { LPGEN("Group Off"), "GROUP_OFF", IDI_GROUP_OFF }
+};
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -39,25 +49,23 @@ PLUGININFOEX pluginInfoEx = { { 0x0495171b, 0x7137, 0x4ded, { 0x97, 0xf8, 0xce, 0x6f, 0xed, 0x67, 0xd6, 0x91 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(ieviewModuleName, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
static int ModulesLoaded(WPARAM, LPARAM)
{
Options::init();
return 0;
}
-IconItem iconList[] =
-{
- { LPGEN("RTL On"), "RTL_ON", IDI_RTL_ON },
- { LPGEN("RTL Off"), "RTL_OFF", IDI_RTL_OFF },
- { LPGEN("Group On"), "GROUP_ON", IDI_GROUP_ON },
- { LPGEN("Group Off"), "GROUP_OFF", IDI_GROUP_OFF }
-};
-
extern "C" int __declspec(dllexport) Load(void)
{
int wdsize = GetCurrentDirectory(0, nullptr);
@@ -82,6 +90,8 @@ extern "C" int __declspec(dllexport) Load(void) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Unload(void)
{
Options::uninit();
diff --git a/plugins/IEView/src/stdafx.h b/plugins/IEView/src/stdafx.h index e80200df80..68fa4d7c95 100644 --- a/plugins/IEView/src/stdafx.h +++ b/plugins/IEView/src/stdafx.h @@ -76,9 +76,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(ieviewModuleName)
- {}
+ CMPlugin();
};
extern IEView *debugView;
diff --git a/plugins/IgnoreState/src/main.cpp b/plugins/IgnoreState/src/main.cpp index 8d3261ccd3..be11b7f038 100644 --- a/plugins/IgnoreState/src/main.cpp +++ b/plugins/IgnoreState/src/main.cpp @@ -46,7 +46,7 @@ int nII = _countof(ii); /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo = {
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -59,9 +59,13 @@ PLUGININFOEX pluginInfo = { { 0xa6872bcd, 0xf2a1, 0x41b8, { 0xb2, 0xf1, 0xdd, 0x7c, 0xec, 0x05, 0x57, 0x34 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -153,7 +157,7 @@ int onContactSettingChanged(WPARAM hContact, LPARAM lParam) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged);
diff --git a/plugins/IgnoreState/src/stdafx.h b/plugins/IgnoreState/src/stdafx.h index 24925c1310..f7d5a7516c 100644 --- a/plugins/IgnoreState/src/stdafx.h +++ b/plugins/IgnoreState/src/stdafx.h @@ -41,9 +41,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {}
+ CMPlugin();
};
struct IGNOREITEMS
diff --git a/plugins/Import/src/main.cpp b/plugins/Import/src/main.cpp index cd2832123c..7781299b35 100644 --- a/plugins/Import/src/main.cpp +++ b/plugins/Import/src/main.cpp @@ -31,8 +31,10 @@ HWND hwndWizard, hwndAccMerge; CMPlugin g_plugin;
int &hLangpack(g_plugin.m_hLang);
-PLUGININFOEX pluginInfo =
-{
+/////////////////////////////////////////////////////////////////////////////////////////
+// MirandaPluginInfoEx - returns an information about a plugin
+
+static PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -41,30 +43,17 @@ PLUGININFOEX pluginInfo = __COPYRIGHT,
__AUTHORWEB,
UNICODE_AWARE,
- //{2D77A746-00A6-4343-BFC5-F808CDD772EA}
+ // {2D77A746-00A6-4343-BFC5-F808CDD772EA}
{0x2d77a746, 0xa6, 0x4343, {0xbf, 0xc5, 0xf8, 0x8, 0xcd, 0xd7, 0x72, 0xea}}
};
-static INT_PTR ImportCommand(WPARAM, LPARAM)
-{
- if (IsWindow(hwndWizard)) {
- SetForegroundWindow(hwndWizard);
- SetFocus(hwndWizard);
- }
- else {
- WizardDlgParam param = { IDD_WIZARDINTRO, (LPARAM)WizardIntroPageProc };
- CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_WIZARD), nullptr, WizardDlgProc, (LPARAM)¶m);
- }
-
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MirandaPluginInfoEx - returns an information about a plugin
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(IMPORT_MODULE, pluginInfoEx)
+{}
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -136,9 +125,23 @@ static INT_PTR CustomImport(WPARAM wParam, LPARAM) return DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_WIZARD), nullptr, WizardDlgProc, LPARAM(¶m));
}
+static INT_PTR ImportCommand(WPARAM, LPARAM)
+{
+ if (IsWindow(hwndWizard)) {
+ SetForegroundWindow(hwndWizard);
+ SetFocus(hwndWizard);
+ }
+ else {
+ WizardDlgParam param = { IDD_WIZARDINTRO, (LPARAM)WizardIntroPageProc };
+ CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_WIZARD), nullptr, WizardDlgProc, (LPARAM)¶m);
+ }
+
+ return 0;
+}
+
extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
CreateServiceFunction(IMPORT_SERVICE, ImportCommand);
CreateServiceFunction(MS_SERVICEMODE_LAUNCH, ServiceMode);
diff --git a/plugins/Import/src/stdafx.h b/plugins/Import/src/stdafx.h index 822cf6721e..c3fafad1e4 100644 --- a/plugins/Import/src/stdafx.h +++ b/plugins/Import/src/stdafx.h @@ -56,9 +56,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(IMPORT_MODULE)
- {}
+ CMPlugin();
};
// Keys
diff --git a/plugins/KeyboardNotify/src/constants.h b/plugins/KeyboardNotify/src/constants.h index f9000b0160..61c6304906 100644 --- a/plugins/KeyboardNotify/src/constants.h +++ b/plugins/KeyboardNotify/src/constants.h @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma once
// Settings values
-#define KEYBDMODULE "keybdnotify"
+#define MODULENAME "keybdnotify"
#define FLASH_SAMETIME 0
#define FLASH_INTURN 1
#define FLASH_INSEQUENCE 2
diff --git a/plugins/KeyboardNotify/src/flash.cpp b/plugins/KeyboardNotify/src/flash.cpp index b5da36a964..20c7888ba7 100644 --- a/plugins/KeyboardNotify/src/flash.cpp +++ b/plugins/KeyboardNotify/src/flash.cpp @@ -88,7 +88,7 @@ void setFlashingSequence(void) FLASHING_SEQUENCE *getCustomSeq(void)
{
- ptrW tszSeq( db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", wCustomTheme)));
+ ptrW tszSeq( db_get_wsa(NULL, MODULENAME, fmtDBSettingName("custom%d", wCustomTheme)));
static FLASHING_SEQUENCE Custom = {0};
Custom = str2FS((tszSeq != 0) ? tszSeq : L"");
@@ -317,8 +317,8 @@ void testSequence(wchar_t *testStr) static void __cdecl TestThread(void *param)
{
FLASHING_SEQUENCE *pTest = (FLASHING_SEQUENCE *)param;
- unsigned int testNum = (unsigned int)db_get_b(NULL, KEYBDMODULE, "testnum", DEF_SETTING_TESTNUM);
- unsigned int testSecs = (unsigned int)db_get_b(NULL, KEYBDMODULE, "testsecs", DEF_SETTING_TESTSECS);
+ unsigned int testNum = (unsigned int)db_get_b(NULL, MODULENAME, "testnum", DEF_SETTING_TESTNUM);
+ unsigned int testSecs = (unsigned int)db_get_b(NULL, MODULENAME, "testsecs", DEF_SETTING_TESTSECS);
for (unsigned i=0, dwEndTest=GetTickCount()+testSecs*1000; i < testNum || GetTickCount() < dwEndTest; i++)
for (pTest->index=0; pTest->index < pTest->size; pTest->index++) {
diff --git a/plugins/KeyboardNotify/src/ignore.cpp b/plugins/KeyboardNotify/src/ignore.cpp index 5869374523..35abefc6d4 100644 --- a/plugins/KeyboardNotify/src/ignore.cpp +++ b/plugins/KeyboardNotify/src/ignore.cpp @@ -27,15 +27,15 @@ static const DWORD ignoreIdToPf1[IGNOREEVENT_MAX] = {PF1_IMRECV, PF1_URLRECV, PF static DWORD GetMask(MCONTACT hContact)
{
- DWORD mask = db_get_dw(hContact, KEYBDMODULE, "Mask1", (DWORD)(-1));
+ DWORD mask = db_get_dw(hContact, MODULENAME, "Mask1", (DWORD)(-1));
if(mask == (DWORD)(-1)) {
if(hContact == NULL)
mask=0;
else {
if(db_get_b(hContact, "CList", "Hidden", 0) || db_get_b(hContact, "CList", "NotOnList", 0))
- mask = db_get_dw(NULL, KEYBDMODULE, "Mask1", 0);
+ mask = db_get_dw(NULL, MODULENAME, "Mask1", 0);
else
- mask = db_get_dw(NULL, KEYBDMODULE, "Default1", 0);
+ mask = db_get_dw(NULL, MODULENAME, "Default1", 0);
}
}
return mask;
@@ -164,7 +164,7 @@ static void SaveItemMask(HWND hwndList, MCONTACT hContact, HANDLE hItem, const c if(iImage && iImage != EMPTY_EXTRA_ICON)
mask |= 1<<i;
}
- db_set_dw(hContact, KEYBDMODULE, pszSetting, mask);
+ db_set_dw(hContact, MODULENAME, pszSetting, mask);
}
static void SetAllContactIcons(HWND hwndList)
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index 5919340b29..1d9637abee 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -86,7 +86,9 @@ BOOL bReminderDisabled = FALSE; BYTE bMetaProtoEnabled = 0;
-PLUGININFOEX pluginInfo =
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -100,11 +102,17 @@ PLUGININFOEX pluginInfo = {0x119d7288, 0x2050, 0x448d, {0x99, 0x00, 0xd8, 0x6a, 0xc7, 0x04, 0x26, 0xbf}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
int InitializeOptions(WPARAM, LPARAM);
BOOL CheckMsgWnd(MCONTACT, BOOL *);
@@ -508,13 +516,13 @@ void StartBlinkAction(char *flashSequence, WORD eventMaxSeconds) void createProcessList(void)
{
- int count = db_get_w(NULL, KEYBDMODULE, "processcount", 0);
+ int count = db_get_w(NULL, MODULENAME, "processcount", 0);
ProcessList.count = 0;
ProcessList.szFileName = (wchar_t **)mir_alloc(count * sizeof(wchar_t *));
if (ProcessList.szFileName) {
for (int i = 0; i < count; i++)
- ProcessList.szFileName[i] = db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i));
+ ProcessList.szFileName[i] = db_get_wsa(NULL, MODULENAME, fmtDBSettingName("process%d", i));
ProcessList.count = count;
}
@@ -664,36 +672,36 @@ int UnhookWindowsHooks() void LoadSettings(void)
{
- bFlashOnMsg = db_get_b(NULL, KEYBDMODULE, "onmsg", DEF_SETTING_ONMSG);
- bFlashOnURL = db_get_b(NULL, KEYBDMODULE, "onurl", DEF_SETTING_ONURL);
- bFlashOnFile = db_get_b(NULL, KEYBDMODULE, "onfile", DEF_SETTING_ONFILE);
- bFlashOnOther = db_get_b(NULL, KEYBDMODULE, "onother", DEF_SETTING_OTHER);
- bFullScreenMode = db_get_b(NULL, KEYBDMODULE, "fscreenmode", DEF_SETTING_FSCREEN);
- bScreenSaverRunning = db_get_b(NULL, KEYBDMODULE, "ssaverrunning", DEF_SETTING_SSAVER);
- bWorkstationLocked = db_get_b(NULL, KEYBDMODULE, "wstationlocked", DEF_SETTING_LOCKED);
- bProcessesAreRunning = db_get_b(NULL, KEYBDMODULE, "procsrunning", DEF_SETTING_PROCS);
- bWorkstationActive = db_get_b(NULL, KEYBDMODULE, "wstationactive", DEF_SETTING_ACTIVE);
- bFlashIfMsgOpen = db_get_b(NULL, KEYBDMODULE, "ifmsgopen", DEF_SETTING_IFMSGOPEN);
- bFlashIfMsgWinNotTop = db_get_b(NULL, KEYBDMODULE, "ifmsgnottop", DEF_SETTING_IFMSGNOTTOP);
- bFlashIfMsgOlder = db_get_b(NULL, KEYBDMODULE, "ifmsgolder", DEF_SETTING_IFMSGOLDER);
- wSecondsOlder = db_get_w(NULL, KEYBDMODULE, "secsolder", DEF_SETTING_SECSOLDER);
- bFlashUntil = db_get_b(NULL, KEYBDMODULE, "funtil", DEF_SETTING_FLASHUNTIL);
- wBlinksNumber = db_get_w(NULL, KEYBDMODULE, "nblinks", DEF_SETTING_NBLINKS);
- bMirandaOrWindows = db_get_b(NULL, KEYBDMODULE, "mirorwin", DEF_SETTING_MIRORWIN);
- wStatusMap = db_get_w(NULL, KEYBDMODULE, "status", DEF_SETTING_STATUS);
- wReminderCheck = db_get_w(NULL, KEYBDMODULE, "remcheck", DEF_SETTING_CHECKTIME);
- bFlashLed[0] = db_get_b(NULL, KEYBDMODULE, "fnum", DEF_SETTING_FLASHNUM);
- bFlashLed[1] = db_get_b(NULL, KEYBDMODULE, "fcaps", DEF_SETTING_FLASHCAPS);
- bFlashLed[2] = db_get_b(NULL, KEYBDMODULE, "fscroll", DEF_SETTING_FLASHSCROLL);
- bFlashEffect = db_get_b(NULL, KEYBDMODULE, "feffect", DEF_SETTING_FLASHEFFECT);
- bSequenceOrder = db_get_b(NULL, KEYBDMODULE, "order", DEF_SETTING_SEQORDER);
- wCustomTheme = db_get_w(NULL, KEYBDMODULE, "custom", DEF_SETTING_CUSTOMTHEME);
- bTrillianLedsMsg = db_get_b(NULL, KEYBDMODULE, "ledsmsg", DEF_SETTING_LEDSMSG);
- bTrillianLedsURL = db_get_b(NULL, KEYBDMODULE, "ledsurl", DEF_SETTING_LEDSURL);
- bTrillianLedsFile = db_get_b(NULL, KEYBDMODULE, "ledsfile", DEF_SETTING_LEDSFILE);
- bTrillianLedsOther = db_get_b(NULL, KEYBDMODULE, "ledsother", DEF_SETTING_LEDSOTHER);
- wStartDelay = db_get_w(NULL, KEYBDMODULE, "sdelay", DEF_SETTING_STARTDELAY);
- bFlashSpeed = db_get_b(NULL, KEYBDMODULE, "speed", DEF_SETTING_FLASHSPEED);
+ bFlashOnMsg = db_get_b(NULL, MODULENAME, "onmsg", DEF_SETTING_ONMSG);
+ bFlashOnURL = db_get_b(NULL, MODULENAME, "onurl", DEF_SETTING_ONURL);
+ bFlashOnFile = db_get_b(NULL, MODULENAME, "onfile", DEF_SETTING_ONFILE);
+ bFlashOnOther = db_get_b(NULL, MODULENAME, "onother", DEF_SETTING_OTHER);
+ bFullScreenMode = db_get_b(NULL, MODULENAME, "fscreenmode", DEF_SETTING_FSCREEN);
+ bScreenSaverRunning = db_get_b(NULL, MODULENAME, "ssaverrunning", DEF_SETTING_SSAVER);
+ bWorkstationLocked = db_get_b(NULL, MODULENAME, "wstationlocked", DEF_SETTING_LOCKED);
+ bProcessesAreRunning = db_get_b(NULL, MODULENAME, "procsrunning", DEF_SETTING_PROCS);
+ bWorkstationActive = db_get_b(NULL, MODULENAME, "wstationactive", DEF_SETTING_ACTIVE);
+ bFlashIfMsgOpen = db_get_b(NULL, MODULENAME, "ifmsgopen", DEF_SETTING_IFMSGOPEN);
+ bFlashIfMsgWinNotTop = db_get_b(NULL, MODULENAME, "ifmsgnottop", DEF_SETTING_IFMSGNOTTOP);
+ bFlashIfMsgOlder = db_get_b(NULL, MODULENAME, "ifmsgolder", DEF_SETTING_IFMSGOLDER);
+ wSecondsOlder = db_get_w(NULL, MODULENAME, "secsolder", DEF_SETTING_SECSOLDER);
+ bFlashUntil = db_get_b(NULL, MODULENAME, "funtil", DEF_SETTING_FLASHUNTIL);
+ wBlinksNumber = db_get_w(NULL, MODULENAME, "nblinks", DEF_SETTING_NBLINKS);
+ bMirandaOrWindows = db_get_b(NULL, MODULENAME, "mirorwin", DEF_SETTING_MIRORWIN);
+ wStatusMap = db_get_w(NULL, MODULENAME, "status", DEF_SETTING_STATUS);
+ wReminderCheck = db_get_w(NULL, MODULENAME, "remcheck", DEF_SETTING_CHECKTIME);
+ bFlashLed[0] = db_get_b(NULL, MODULENAME, "fnum", DEF_SETTING_FLASHNUM);
+ bFlashLed[1] = db_get_b(NULL, MODULENAME, "fcaps", DEF_SETTING_FLASHCAPS);
+ bFlashLed[2] = db_get_b(NULL, MODULENAME, "fscroll", DEF_SETTING_FLASHSCROLL);
+ bFlashEffect = db_get_b(NULL, MODULENAME, "feffect", DEF_SETTING_FLASHEFFECT);
+ bSequenceOrder = db_get_b(NULL, MODULENAME, "order", DEF_SETTING_SEQORDER);
+ wCustomTheme = db_get_w(NULL, MODULENAME, "custom", DEF_SETTING_CUSTOMTHEME);
+ bTrillianLedsMsg = db_get_b(NULL, MODULENAME, "ledsmsg", DEF_SETTING_LEDSMSG);
+ bTrillianLedsURL = db_get_b(NULL, MODULENAME, "ledsurl", DEF_SETTING_LEDSURL);
+ bTrillianLedsFile = db_get_b(NULL, MODULENAME, "ledsfile", DEF_SETTING_LEDSFILE);
+ bTrillianLedsOther = db_get_b(NULL, MODULENAME, "ledsother", DEF_SETTING_LEDSOTHER);
+ wStartDelay = db_get_w(NULL, MODULENAME, "sdelay", DEF_SETTING_STARTDELAY);
+ bFlashSpeed = db_get_b(NULL, MODULENAME, "speed", DEF_SETTING_FLASHSPEED);
switch (bFlashSpeed) {
case 0: nWaitDelay = 1500; break;
case 1: nWaitDelay = 0750; break;
@@ -703,19 +711,19 @@ void LoadSettings(void) default: nWaitDelay = 0050; break;
}
setFlashingSequence();
- bEmulateKeypresses = db_get_b(NULL, KEYBDMODULE, "keypresses", DEF_SETTING_KEYPRESSES);
- bOverride = db_get_b(NULL, KEYBDMODULE, "override", DEF_SETTING_OVERRIDE);
+ bEmulateKeypresses = db_get_b(NULL, MODULENAME, "keypresses", DEF_SETTING_KEYPRESSES);
+ bOverride = db_get_b(NULL, MODULENAME, "override", DEF_SETTING_OVERRIDE);
// Create hidden settings (for test button) if needed
- if (db_get_b(NULL, KEYBDMODULE, "testnum", -1) == -1)
- db_set_b(NULL, KEYBDMODULE, "testnum", DEF_SETTING_TESTNUM);
- if (db_get_b(NULL, KEYBDMODULE, "testsecs", -1) == -1)
- db_set_b(NULL, KEYBDMODULE, "testsecs", DEF_SETTING_TESTSECS);
+ if (db_get_b(NULL, MODULENAME, "testnum", -1) == -1)
+ db_set_b(NULL, MODULENAME, "testnum", DEF_SETTING_TESTNUM);
+ if (db_get_b(NULL, MODULENAME, "testsecs", -1) == -1)
+ db_set_b(NULL, MODULENAME, "testsecs", DEF_SETTING_TESTSECS);
for (int i = 0; i < ProtoList.protoCount; i++)
if (ProtoList.protoInfo[i].visible) {
unsigned int j;
- ProtoList.protoInfo[i].enabled = db_get_b(NULL, KEYBDMODULE, ProtoList.protoInfo[i].szProto, DEF_SETTING_PROTOCOL);
+ ProtoList.protoInfo[i].enabled = db_get_b(NULL, MODULENAME, ProtoList.protoInfo[i].szProto, DEF_SETTING_PROTOCOL);
for (j = 0; j < ProtoList.protoInfo[i].xstatus.count; j++)
- ProtoList.protoInfo[i].xstatus.enabled[j] = db_get_b(NULL, KEYBDMODULE, fmtDBSettingName("%sxstatus%d", ProtoList.protoInfo[i].szProto, j), DEF_SETTING_XSTATUS);
+ ProtoList.protoInfo[i].xstatus.enabled[j] = db_get_b(NULL, MODULENAME, fmtDBSettingName("%sxstatus%d", ProtoList.protoInfo[i].szProto, j), DEF_SETTING_XSTATUS);
}
bMetaProtoEnabled = db_mc_isEnabled();
@@ -925,7 +933,7 @@ static int ModulesLoaded(WPARAM, LPARAM) extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
GetWindowsVersion();
diff --git a/plugins/KeyboardNotify/src/options.cpp b/plugins/KeyboardNotify/src/options.cpp index 1d48df4dd0..a66c01ca97 100644 --- a/plugins/KeyboardNotify/src/options.cpp +++ b/plugins/KeyboardNotify/src/options.cpp @@ -65,10 +65,10 @@ void exportThemes(const wchar_t *filename) fwprintf(fExport, TranslateT("\n; Automatically generated Keyboard Notify Theme file\n\n\n")); wchar_t *szTheme; - for (int i = 0; szTheme = db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++) { + for (int i = 0; szTheme = db_get_wsa(NULL, MODULENAME, fmtDBSettingName("theme%d", i)); i++) { fwprintf(fExport, L"[%s]\n", szTheme); mir_free(szTheme); - if (szTheme = db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i))) { + if (szTheme = db_get_wsa(NULL, MODULENAME, fmtDBSettingName("custom%d", i))) { fwprintf(fExport, L"%s\n\n", szTheme); mir_free(szTheme); } @@ -551,7 +551,7 @@ static INT_PTR CALLBACK DlgProcProtoOptions(HWND hwndDlg, UINT msg, WPARAM, LPAR for (int i = 0; i < ListView_GetItemCount(hList); i++) { lvItem.iItem = i; ListView_GetItem(hList, &lvItem); - db_set_b(NULL, KEYBDMODULE, (char *)lvItem.lParam, (BYTE)ListView_GetCheckState(hList, lvItem.iItem)); + db_set_b(NULL, MODULENAME, (char *)lvItem.lParam, (BYTE)ListView_GetCheckState(hList, lvItem.iItem)); } } @@ -750,21 +750,21 @@ static INT_PTR CALLBACK DlgProcBasicOptions(HWND hwndDlg, UINT msg, WPARAM wPara case 0: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: - db_set_b(NULL, KEYBDMODULE, "onmsg", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONMESSAGE) == BST_CHECKED ? 1 : 0)); - db_set_b(NULL, KEYBDMODULE, "onurl", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONURL) == BST_CHECKED ? 1 : 0)); - db_set_b(NULL, KEYBDMODULE, "onfile", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONFILE) == BST_CHECKED ? 1 : 0)); - db_set_b(NULL, KEYBDMODULE, "onother", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONOTHER) == BST_CHECKED ? 1 : 0)); - - db_set_b(NULL, KEYBDMODULE, "fscreenmode", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_FSCREEN) == BST_CHECKED ? 1 : 0)); - db_set_b(NULL, KEYBDMODULE, "ssaverrunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SSAVER) == BST_CHECKED ? 1 : 0)); - db_set_b(NULL, KEYBDMODULE, "wstationlocked", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_LOCKED) == BST_CHECKED ? 1 : 0)); - db_set_b(NULL, KEYBDMODULE, "procsrunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_PGMS) == BST_CHECKED ? 1 : 0)); - db_set_b(NULL, KEYBDMODULE, "wstationactive", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ACTIVE) == BST_CHECKED ? 1 : 0)); - - db_set_b(NULL, KEYBDMODULE, "ifmsgopen", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFOPEN) == BST_CHECKED ? 1 : 0)); - db_set_b(NULL, KEYBDMODULE, "ifmsgnottop", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFNOTTOP) == BST_CHECKED ? 1 : 0)); - db_set_b(NULL, KEYBDMODULE, "ifmsgolder", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFOLDER) == BST_CHECKED ? 1 : 0)); - db_set_w(NULL, KEYBDMODULE, "secsolder", (WORD)SendDlgItemMessage(hwndDlg, IDC_OLDERSPIN, UDM_GETPOS, 0, 0)); + db_set_b(NULL, MODULENAME, "onmsg", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONMESSAGE) == BST_CHECKED ? 1 : 0)); + db_set_b(NULL, MODULENAME, "onurl", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONURL) == BST_CHECKED ? 1 : 0)); + db_set_b(NULL, MODULENAME, "onfile", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONFILE) == BST_CHECKED ? 1 : 0)); + db_set_b(NULL, MODULENAME, "onother", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONOTHER) == BST_CHECKED ? 1 : 0)); + + db_set_b(NULL, MODULENAME, "fscreenmode", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_FSCREEN) == BST_CHECKED ? 1 : 0)); + db_set_b(NULL, MODULENAME, "ssaverrunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SSAVER) == BST_CHECKED ? 1 : 0)); + db_set_b(NULL, MODULENAME, "wstationlocked", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_LOCKED) == BST_CHECKED ? 1 : 0)); + db_set_b(NULL, MODULENAME, "procsrunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_PGMS) == BST_CHECKED ? 1 : 0)); + db_set_b(NULL, MODULENAME, "wstationactive", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ACTIVE) == BST_CHECKED ? 1 : 0)); + + db_set_b(NULL, MODULENAME, "ifmsgopen", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFOPEN) == BST_CHECKED ? 1 : 0)); + db_set_b(NULL, MODULENAME, "ifmsgnottop", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFNOTTOP) == BST_CHECKED ? 1 : 0)); + db_set_b(NULL, MODULENAME, "ifmsgolder", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFOLDER) == BST_CHECKED ? 1 : 0)); + db_set_w(NULL, MODULENAME, "secsolder", (WORD)SendDlgItemMessage(hwndDlg, IDC_OLDERSPIN, UDM_GETPOS, 0, 0)); if (IsDlgButtonChecked(hwndDlg, IDC_UNTILBLK) == BST_CHECKED) untilMap |= UNTIL_NBLINKS; @@ -774,9 +774,9 @@ static INT_PTR CALLBACK DlgProcBasicOptions(HWND hwndDlg, UINT msg, WPARAM wPara untilMap |= UNTIL_EVENTSOPEN; if (IsDlgButtonChecked(hwndDlg, IDC_UNTILCOND) == BST_CHECKED) untilMap |= UNTIL_CONDITIONS; - db_set_b(NULL, KEYBDMODULE, "funtil", untilMap); - db_set_w(NULL, KEYBDMODULE, "nblinks", (WORD)SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_GETPOS, 0, 0)); - db_set_b(NULL, KEYBDMODULE, "mirorwin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_MIRORWIN, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_MIRORWIN, CB_GETCURSEL, 0, 0), 0)); + db_set_b(NULL, MODULENAME, "funtil", untilMap); + db_set_w(NULL, MODULENAME, "nblinks", (WORD)SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_GETPOS, 0, 0)); + db_set_b(NULL, MODULENAME, "mirorwin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_MIRORWIN, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_MIRORWIN, CB_GETCURSEL, 0, 0), 0)); if (IsDlgButtonChecked(hwndDlg, IDC_ONLINE) == BST_CHECKED) statusMap |= MAP_ONLINE; @@ -798,21 +798,21 @@ static INT_PTR CALLBACK DlgProcBasicOptions(HWND hwndDlg, UINT msg, WPARAM wPara statusMap |= MAP_OUTTOLUNCH; if (IsDlgButtonChecked(hwndDlg, IDC_OFFLINE) == BST_CHECKED) statusMap |= MAP_OFFLINE; - db_set_w(NULL, KEYBDMODULE, "status", statusMap); + db_set_w(NULL, MODULENAME, "status", statusMap); - db_set_w(NULL, KEYBDMODULE, "remcheck", (WORD)SendDlgItemMessage(hwndDlg, IDC_REMCHECK, UDM_GETPOS, 0, 0)); + db_set_w(NULL, MODULENAME, "remcheck", (WORD)SendDlgItemMessage(hwndDlg, IDC_REMCHECK, UDM_GETPOS, 0, 0)); int i = 0; for (int j = 0; j < ProcessListAux.count; j++) if (ProcessListAux.szFileName[j]) - db_set_ws(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i++), ProcessListAux.szFileName[j]); - db_set_w(NULL, KEYBDMODULE, "processcount", (WORD)i); - while (!db_unset(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i++))); + db_set_ws(NULL, MODULENAME, fmtDBSettingName("process%d", i++), ProcessListAux.szFileName[j]); + db_set_w(NULL, MODULENAME, "processcount", (WORD)i); + while (!db_unset(NULL, MODULENAME, fmtDBSettingName("process%d", i++))); if (XstatusListAux) for (i = 0; i < ProtoList.protoCount; i++) for (int j = 0; j < (int)XstatusListAux[i].count; j++) - db_set_b(NULL, KEYBDMODULE, fmtDBSettingName("%sxstatus%d", ProtoList.protoInfo[i].szProto, j), (BYTE)XstatusListAux[i].enabled[j]); + db_set_b(NULL, MODULENAME, fmtDBSettingName("%sxstatus%d", ProtoList.protoInfo[i].szProto, j), (BYTE)XstatusListAux[i].enabled[j]); LoadSettings(); @@ -863,7 +863,7 @@ static INT_PTR CALLBACK DlgProcEffectOptions(HWND hwndDlg, UINT msg, WPARAM wPar CheckDlgButton(hwndDlg, IDC_CUSTOM, bFlashEffect == FLASH_CUSTOM ? BST_CHECKED : BST_UNCHECKED); wchar_t *szTheme; - for (int i = 0; szTheme = db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++) { + for (int i = 0; szTheme = db_get_wsa(NULL, MODULENAME, fmtDBSettingName("theme%d", i)); i++) { int index = SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)szTheme); mir_free(szTheme); if (index != CB_ERR && index != CB_ERRSPACE) @@ -941,33 +941,33 @@ static INT_PTR CALLBACK DlgProcEffectOptions(HWND hwndDlg, UINT msg, WPARAM wPar case 0: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: - db_set_b(NULL, KEYBDMODULE, "fnum", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NUM) == BST_CHECKED ? 1 : 0)); - db_set_b(NULL, KEYBDMODULE, "fcaps", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CAPS) == BST_CHECKED ? 1 : 0)); - db_set_b(NULL, KEYBDMODULE, "fscroll", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SCROLL) == BST_CHECKED ? 1 : 0)); + db_set_b(NULL, MODULENAME, "fnum", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NUM) == BST_CHECKED ? 1 : 0)); + db_set_b(NULL, MODULENAME, "fcaps", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CAPS) == BST_CHECKED ? 1 : 0)); + db_set_b(NULL, MODULENAME, "fscroll", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SCROLL) == BST_CHECKED ? 1 : 0)); if (IsDlgButtonChecked(hwndDlg, IDC_INTURN) == BST_CHECKED) - db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_INTURN); + db_set_b(NULL, MODULENAME, "feffect", FLASH_INTURN); else if (IsDlgButtonChecked(hwndDlg, IDC_INSEQUENCE) == BST_CHECKED) - db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_INSEQUENCE); + db_set_b(NULL, MODULENAME, "feffect", FLASH_INSEQUENCE); else if (IsDlgButtonChecked(hwndDlg, IDC_CUSTOM) == BST_CHECKED) - db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_CUSTOM); + db_set_b(NULL, MODULENAME, "feffect", FLASH_CUSTOM); else if (IsDlgButtonChecked(hwndDlg, IDC_TRILLIAN) == BST_CHECKED) - db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_TRILLIAN); + db_set_b(NULL, MODULENAME, "feffect", FLASH_TRILLIAN); else - db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_SAMETIME); - db_set_b(NULL, KEYBDMODULE, "order", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_GETCURSEL, 0, 0), 0)); - db_set_w(NULL, KEYBDMODULE, "custom", (WORD)SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_GETCURSEL, 0, 0), 0)); + db_set_b(NULL, MODULENAME, "feffect", FLASH_SAMETIME); + db_set_b(NULL, MODULENAME, "order", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_GETCURSEL, 0, 0), 0)); + db_set_w(NULL, MODULENAME, "custom", (WORD)SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_GETCURSEL, 0, 0), 0)); - db_set_b(NULL, KEYBDMODULE, "ledsmsg", trillianLedsMsg); - db_set_b(NULL, KEYBDMODULE, "ledsfile", trillianLedsFile); - db_set_b(NULL, KEYBDMODULE, "ledsurl", trillianLedsURL); - db_set_b(NULL, KEYBDMODULE, "ledsother", trillianLedsOther); + db_set_b(NULL, MODULENAME, "ledsmsg", trillianLedsMsg); + db_set_b(NULL, MODULENAME, "ledsfile", trillianLedsFile); + db_set_b(NULL, MODULENAME, "ledsurl", trillianLedsURL); + db_set_b(NULL, MODULENAME, "ledsother", trillianLedsOther); - db_set_w(NULL, KEYBDMODULE, "sdelay", (WORD)SendDlgItemMessage(hwndDlg, IDC_DELAYSPIN, UDM_GETPOS, 0, 0)); + db_set_w(NULL, MODULENAME, "sdelay", (WORD)SendDlgItemMessage(hwndDlg, IDC_DELAYSPIN, UDM_GETPOS, 0, 0)); - db_set_b(NULL, KEYBDMODULE, "speed", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SPEED, TBM_GETPOS, 0, 0)); + db_set_b(NULL, MODULENAME, "speed", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SPEED, TBM_GETPOS, 0, 0)); - db_set_b(NULL, KEYBDMODULE, "keypresses", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_KEYPRESSES) == BST_CHECKED ? 1 : 0)); + db_set_b(NULL, MODULENAME, "keypresses", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_KEYPRESSES) == BST_CHECKED ? 1 : 0)); LoadSettings(); @@ -999,11 +999,11 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara SendDlgItemMessage(hwndDlg, IDC_CUSTOMSTRING, EM_LIMITTEXT, MAX_PATH, 0); wchar_t *szTheme; - for (int i = 0; szTheme = db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++) { + for (int i = 0; szTheme = db_get_wsa(NULL, MODULENAME, fmtDBSettingName("theme%d", i)); i++) { int index = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)szTheme); mir_free(szTheme); if (index != CB_ERR && index != CB_ERRSPACE) { - wchar_t *str = db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i)); + wchar_t *str = db_get_wsa(NULL, MODULENAME, fmtDBSettingName("custom%d", i)); if (str) SendDlgItemMessage(hwndDlg, IDC_THEME, CB_SETITEMDATA, (WPARAM)index, (LPARAM)str); } @@ -1224,7 +1224,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara case 0: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: - if (szTheme = db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", wCustomTheme))) { + if (szTheme = db_get_wsa(NULL, MODULENAME, fmtDBSettingName("theme%d", wCustomTheme))) { mir_wstrcpy(theme, szTheme); mir_free(szTheme); } @@ -1237,12 +1237,12 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara count = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETCOUNT, 0, 0); for (int i = 0; i < count; i++) { SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETLBTEXT, (WPARAM)i, (LPARAM)themeAux); - db_set_ws(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i), themeAux); + db_set_ws(NULL, MODULENAME, fmtDBSettingName("theme%d", i), themeAux); wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)i, 0); if (str) - db_set_ws(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), str); + db_set_ws(NULL, MODULENAME, fmtDBSettingName("custom%d", i), str); else - db_set_ws(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), L""); + db_set_ws(NULL, MODULENAME, fmtDBSettingName("custom%d", i), L""); if (!mir_wstrcmp(theme, themeAux)) wCustomTheme = i; @@ -1251,14 +1251,14 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara SendDlgItemMessage(hwndEffect, IDC_SCUSTOM, CB_INSERTSTRING, (WPARAM)i, (LPARAM)themeAux); SendDlgItemMessage(hwndEffect, IDC_SCUSTOM, CB_SETITEMDATA, (WPARAM)i, (LPARAM)i); } - for (int i = count; !db_unset(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++) - db_unset(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i)); + for (int i = count; !db_unset(NULL, MODULENAME, fmtDBSettingName("theme%d", i)); i++) + db_unset(NULL, MODULENAME, fmtDBSettingName("custom%d", i)); - db_set_w(NULL, KEYBDMODULE, "custom", wCustomTheme); + db_set_w(NULL, MODULENAME, "custom", wCustomTheme); // Still updating here the the Flashing tab's controls SendDlgItemMessage(hwndEffect, IDC_SCUSTOM, CB_SETCURSEL, (WPARAM)wCustomTheme, 0); - db_set_b(NULL, KEYBDMODULE, "override", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_OVERRIDE) == BST_CHECKED ? 1 : 0)); + db_set_b(NULL, MODULENAME, "override", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_OVERRIDE) == BST_CHECKED ? 1 : 0)); return TRUE; } // switch code diff --git a/plugins/KeyboardNotify/src/stdafx.h b/plugins/KeyboardNotify/src/stdafx.h index 992962837a..6af0fffa14 100644 --- a/plugins/KeyboardNotify/src/stdafx.h +++ b/plugins/KeyboardNotify/src/stdafx.h @@ -57,7 +57,5 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(KEYBDMODULE)
- {}
+ CMPlugin();
};
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index cbfa9574c3..ad615e7de4 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -174,7 +174,7 @@ int AccListChanged(WPARAM wParam, LPARAM lParam) int ModulesLoaded(WPARAM, LPARAM)
{
// Extra icon support
- hExtraIcon = ExtraIcon_RegisterIcolib(MODULE_NAME "_icon", LPGEN("Listening to music"), "listening_to_icon");
+ hExtraIcon = ExtraIcon_RegisterIcolib(MODULENAME "_icon", LPGEN("Listening to music"), "listening_to_icon");
EnableDisablePlayers();
@@ -385,7 +385,7 @@ bool ListeningToEnabled(char *proto, bool ignoreGlobal) char setting[256];
mir_snprintf(setting, "%sEnabled", proto);
- return db_get_b(NULL, MODULE_NAME, setting, false) != 0;
+ return db_get_b(NULL, MODULENAME, setting, false) != 0;
}
INT_PTR ListeningToEnabled(WPARAM wParam, LPARAM)
@@ -608,7 +608,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = nullptr) mir_free(fr[1]);
}
}
- else if (db_get_b(0, MODULE_NAME, "UseStatusMessage", 1) && ProtoServiceExists(proto, PS_SETAWAYMSG)) {
+ else if (db_get_b(0, MODULENAME, "UseStatusMessage", 1) && ProtoServiceExists(proto, PS_SETAWAYMSG)) {
int status = Proto_GetStatus(proto);
if (lti == nullptr)
CallProtoService(proto, PS_SETAWAYMSG, status, 0);
@@ -635,7 +635,7 @@ INT_PTR EnableListeningTo(char *proto, bool enabled) char setting[256];
mir_snprintf(setting, "%sEnabled", proto);
- db_set_b(NULL, MODULE_NAME, setting, enabled);
+ db_set_b(NULL, MODULENAME, setting, enabled);
// Modify menu info
ProtocolInfo *info = GetProtoInfo(proto);
diff --git a/plugins/ListeningTo/src/main.cpp b/plugins/ListeningTo/src/main.cpp index ab7a132a44..fa3513df5c 100644 --- a/plugins/ListeningTo/src/main.cpp +++ b/plugins/ListeningTo/src/main.cpp @@ -24,7 +24,7 @@ CMPlugin g_plugin; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -38,16 +38,20 @@ PLUGININFOEX pluginInfo = { 0xf981f3f5, 0x35a, 0x444f,{ 0x98, 0x92, 0xca, 0x72, 0x2c, 0x19, 0x5a, 0xda } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
CoInitialize(nullptr);
diff --git a/plugins/ListeningTo/src/options.cpp b/plugins/ListeningTo/src/options.cpp index 3dc64d76ed..acc6bc175b 100644 --- a/plugins/ListeningTo/src/options.cpp +++ b/plugins/ListeningTo/src/options.cpp @@ -111,9 +111,9 @@ void InitOptions() void LoadOptions()
{
- LoadOpts(optionsControls, _countof(optionsControls), MODULE_NAME);
- LoadOpts(formatControls, _countof(formatControls), MODULE_NAME);
- LoadOpts(playersControls, _countof(playersControls), MODULE_NAME);
+ LoadOpts(optionsControls, _countof(optionsControls), MODULENAME);
+ LoadOpts(formatControls, _countof(formatControls), MODULENAME);
+ LoadOpts(playersControls, _countof(playersControls), MODULENAME);
}
BOOL IsTypeEnabled(LISTENINGTOINFO *lti)
@@ -167,7 +167,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP {
BOOL ret = FALSE;
if (msg != WM_INITDIALOG)
- ret = SaveOptsDlgProc(optionsControls, _countof(optionsControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
+ ret = SaveOptsDlgProc(optionsControls, _countof(optionsControls), MODULENAME, hwndDlg, msg, wParam, lParam);
switch (msg) {
case WM_INITDIALOG:
@@ -187,7 +187,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendDlgItemMessage(hwndDlg, IDC_ADV_ICON, CB_ADDSTRING, 0, (LPARAM)_itow(i - first + 3, tmp, 10));
}
- ret = SaveOptsDlgProc(optionsControls, _countof(optionsControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
+ ret = SaveOptsDlgProc(optionsControls, _countof(optionsControls), MODULENAME, hwndDlg, msg, wParam, lParam);
OptionsEnableDisableCtrls(hwndDlg);
return TRUE;
@@ -249,7 +249,7 @@ static void PlayersEnableDisableCtrls(HWND hwndDlg) static INT_PTR CALLBACK PlayersDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- BOOL ret = SaveOptsDlgProc(playersControls, _countof(playersControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
+ BOOL ret = SaveOptsDlgProc(playersControls, _countof(playersControls), MODULENAME, hwndDlg, msg, wParam, lParam);
switch (msg) {
case WM_INITDIALOG:
@@ -277,5 +277,5 @@ static INT_PTR CALLBACK PlayersDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP static INT_PTR CALLBACK FormatDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- return SaveOptsDlgProc(formatControls, _countof(formatControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
+ return SaveOptsDlgProc(formatControls, _countof(formatControls), MODULENAME, hwndDlg, msg, wParam, lParam);
}
diff --git a/plugins/ListeningTo/src/players/generic.cpp b/plugins/ListeningTo/src/players/generic.cpp index 309d424b6d..4e1224cf34 100644 --- a/plugins/ListeningTo/src/players/generic.cpp +++ b/plugins/ListeningTo/src/players/generic.cpp @@ -27,7 +27,7 @@ GenericPlayer *singleton = nullptr; void m_log(const wchar_t *function, const wchar_t *fmt, ...)
{
if (hLog == nullptr) {
- hLog = mir_createLog(MODULE_NAME, L"ListeningTo log", L"c:\\temp\\listeningto.txt", 0);
+ hLog = mir_createLog(MODULENAME, L"ListeningTo log", L"c:\\temp\\listeningto.txt", 0);
if (hLog == nullptr)
return;
}
diff --git a/plugins/ListeningTo/src/stdafx.h b/plugins/ListeningTo/src/stdafx.h index cd40ca4da2..8727d8dda8 100644 --- a/plugins/ListeningTo/src/stdafx.h +++ b/plugins/ListeningTo/src/stdafx.h @@ -69,13 +69,11 @@ Boston, MA 02111-1307, USA. #define MS_LISTENINGTO_HOTKEYS_DISABLE "ListeningTo/HotkeysDisable"
#define MS_LISTENINGTO_HOTKEYS_TOGGLE "ListeningTo/HotkeysToggle"
-#define MODULE_NAME "ListeningTo"
+#define MODULENAME "ListeningTo"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE_NAME)
- {}
+ CMPlugin();
};
// Global Variables
diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index 69006c457a..d25e47eed1 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -21,7 +21,7 @@ INT_PTR SetStatus(WPARAM wParam, LPARAM lParam); #define MAX_SETTING_STR 512
#define STATUS_COUNT 9
-char PLUGINNAME[64] = {0}; //init at init_pluginname();
+char MODULENAME[64] = {0}; //init at init_pluginname();
int &hLangpack(g_plugin.m_hLang);
CMPlugin g_plugin;
CLIST_INTERFACE *pcli;
@@ -67,7 +67,7 @@ wchar_t *startuperrors[] = { /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo = {
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -79,12 +79,18 @@ PLUGININFOEX pluginInfo = { { 0x23eacc0d, 0xbab0, 0x49c0, { 0x8f, 0x37, 0x5e, 0x25, 0x9e, 0xce, 0x52, 0x7f } } // {23EACC0D-BAB0-49c0-8F37-5E259ECE527F}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{
+ RegisterProtocol(PROTOTYPE_PROTOCOL);
+}
+
extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD)
{
#ifdef _WIN64
#error LotusNotify.dll cannot work with 64bit Miranda. (Lotus client is 32bit only)
#endif
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -243,8 +249,8 @@ void init_pluginname() }
// copy to static variable
- strncpy_s(PLUGINNAME, _countof(PLUGINNAME), p, mir_strlen(p));
- assert(mir_strlen(PLUGINNAME)>0);
+ strncpy_s(MODULENAME, _countof(MODULENAME), p, mir_strlen(p));
+ assert(mir_strlen(MODULENAME)>0);
}
@@ -318,7 +324,7 @@ void Click(HWND hWnd,BOOL execute) deletePopupsHandles((&(getEl(pid->id))->pq),TRUE);
if(settingNewest && (pid->id > settingNewestID) ){
- db_set_dw(NULL, PLUGINNAME, "LNNewestID", settingNewestID=pid->id);
+ db_set_dw(NULL, MODULENAME, "LNNewestID", settingNewestID=pid->id);
}
if(execute && settingCommand[0] ) {
char tmpcommand[2*MAX_SETTING_STR];
@@ -392,7 +398,7 @@ BOOL checkNotesIniFile(BOOL bInfo) strncpy_s(tmp1,_countof(tmp1),tmp,sizeof(tmp1));//copy temporary
assert(mir_strlen(tmp1)>0);
- char* PLUGINNAME_lower = _strlwr(mir_strdup(PLUGINNAME));
+ char* PLUGINNAME_lower = _strlwr(mir_strdup(MODULENAME));
//is there our plugin as safe?
if(strstr(tmp1,PLUGINNAME_lower) == nullptr)
@@ -401,7 +407,7 @@ BOOL checkNotesIniFile(BOOL bInfo) return FALSE;
if(!settingIniAnswer || bInfo){
- switch(MessageBox(nullptr, TranslateT("This utility check your notes.ini file if it's set to authenticate this plugin as safe. Plugin is not added as Lotus Extension, so plugin built-in authentication will not work properly. Do you want to add plugin as Lotus Extension (modify notes.ini by adding \"EXTMGR_ADDINS=PLUGINNAME\")?"), TranslateT("LotusNotify plugin configuration"), MB_YESNO))
+ switch(MessageBox(nullptr, TranslateT("This utility check your notes.ini file if it's set to authenticate this plugin as safe. Plugin is not added as Lotus Extension, so plugin built-in authentication will not work properly. Do you want to add plugin as Lotus Extension (modify notes.ini by adding \"EXTMGR_ADDINS=MODULENAME\")?"), TranslateT("LotusNotify plugin configuration"), MB_YESNO))
{
case IDYES:
{
@@ -698,7 +704,7 @@ void checkthread(void*) // remember newest id depending on options set
if (settingNewest&&settingEvenNonClicked && (noteID > settingNewestID))
- db_set_dw(NULL, PLUGINNAME, "LNNewestID", settingNewestID = noteID);
+ db_set_dw(NULL, MODULENAME, "LNNewestID", settingNewestID = noteID);
//if(((!settingOnceOnly||(settingOnceOnly&&settingNonClickedOnly))&&existElem(noteID))||(settingNewest&&settingNewestID>=noteID))
//continue;
@@ -967,66 +973,66 @@ static void lookupLotusDefaultSettings(HWND hwndDlg) // get variables values stored in db.
static void LoadSettings()
{
- settingInterval = (INT)db_get_dw(NULL, PLUGINNAME, "LNInterval", 15);
- settingInterval1 = (INT)db_get_dw(NULL, PLUGINNAME, "LNInterval1", 0);
- settingKeepConnection = db_get_b(NULL, PLUGINNAME, "LNKeepConnection", 1);
+ settingInterval = (INT)db_get_dw(NULL, MODULENAME, "LNInterval", 15);
+ settingInterval1 = (INT)db_get_dw(NULL, MODULENAME, "LNInterval1", 0);
+ settingKeepConnection = db_get_b(NULL, MODULENAME, "LNKeepConnection", 1);
DBVARIANT dbv;
- if (!db_get_s(NULL, PLUGINNAME, "LNDatabase", &dbv)) {
+ if (!db_get_s(NULL, MODULENAME, "LNDatabase", &dbv)) {
strncpy_s(settingDatabase, _countof(settingDatabase), dbv.pszVal, _countof(settingDatabase));
db_free(&dbv);
}
- if (!db_get_s(NULL, PLUGINNAME, "LNServer", &dbv)) {
+ if (!db_get_s(NULL, MODULENAME, "LNServer", &dbv)) {
strncpy_s(settingServer, _countof(settingServer), dbv.pszVal, _countof(settingServer));
db_free(&dbv);
}
- if (!db_get_s(NULL, PLUGINNAME, "LNServerSec", &dbv)) {
+ if (!db_get_s(NULL, MODULENAME, "LNServerSec", &dbv)) {
strncpy_s(settingServerSec, _countof(settingServerSec), dbv.pszVal, _countof(settingServerSec));
db_free(&dbv);
}
- if (!db_get(NULL, PLUGINNAME, "LNPassword", &dbv)) {
+ if (!db_get(NULL, MODULENAME, "LNPassword", &dbv)) {
strncpy_s(settingPassword, _countof(settingPassword), dbv.pszVal, _countof(settingPassword));
db_free(&dbv);
}
- if (!db_get_s(NULL, PLUGINNAME, "LNCommand", &dbv, DBVT_ASCIIZ)) {
+ if (!db_get_s(NULL, MODULENAME, "LNCommand", &dbv, DBVT_ASCIIZ)) {
strncpy_s(settingCommand, _countof(settingCommand), dbv.pszVal, _countof(settingCommand));
db_free(&dbv);
}
- if (!db_get_s(NULL, PLUGINNAME, "LNParameters", &dbv, DBVT_ASCIIZ)) {
+ if (!db_get_s(NULL, MODULENAME, "LNParameters", &dbv, DBVT_ASCIIZ)) {
strncpy_s(settingParameters, _countof(settingParameters), dbv.pszVal, _countof(settingParameters));
db_free(&dbv);
}
- if (!db_get_ws(NULL, PLUGINNAME, "LNFilterSender", &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, "LNFilterSender", &dbv)) {
wcsncpy_s(settingFilterSender, dbv.ptszVal, _TRUNCATE);
db_free(&dbv);
}
- if (!db_get_ws(NULL, PLUGINNAME, "LNFilterSubject", &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, "LNFilterSubject", &dbv)) {
wcsncpy_s(settingFilterSubject, dbv.ptszVal, _TRUNCATE);
db_free(&dbv);
}
- if (!db_get_ws(NULL, PLUGINNAME, "LNFilterTo", &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, "LNFilterTo", &dbv)) {
wcsncpy_s(settingFilterTo, dbv.ptszVal, _TRUNCATE);
db_free(&dbv);
}
- settingOnceOnly = db_get_b(NULL, PLUGINNAME, "LNOnceOnly", 0);
+ settingOnceOnly = db_get_b(NULL, MODULENAME, "LNOnceOnly", 0);
- settingNonClickedOnly = db_get_b(NULL, PLUGINNAME, "LNNonClickedOnly", 1);
- settingShowError = db_get_b(NULL, PLUGINNAME, "LNShowError", 1);
- settingSetColours = db_get_b(NULL, PLUGINNAME, "LNSetColours", 0);
- settingBgColor = (COLORREF)db_get_dw(NULL, PLUGINNAME, "LNBgColor", (DWORD)0xFFFFFF);
- settingFgColor = (COLORREF)db_get_dw(NULL, PLUGINNAME, "LNFgColor", (DWORD)0x000000);
- settingNewest = db_get_b(NULL, PLUGINNAME, "LNNewest", 0);
- settingEvenNonClicked = db_get_b(NULL, PLUGINNAME, "LNEvenNonClicked", 0);
- settingNewestID = (DWORD)db_get_dw(NULL, PLUGINNAME, "LNNewestID", 0);
- settingIniAnswer = db_get_b(NULL, PLUGINNAME, "LNIniAnswer", 0);
- settingIniCheck = db_get_b(NULL, PLUGINNAME, "LNIniCheck", 0);
+ settingNonClickedOnly = db_get_b(NULL, MODULENAME, "LNNonClickedOnly", 1);
+ settingShowError = db_get_b(NULL, MODULENAME, "LNShowError", 1);
+ settingSetColours = db_get_b(NULL, MODULENAME, "LNSetColours", 0);
+ settingBgColor = (COLORREF)db_get_dw(NULL, MODULENAME, "LNBgColor", (DWORD)0xFFFFFF);
+ settingFgColor = (COLORREF)db_get_dw(NULL, MODULENAME, "LNFgColor", (DWORD)0x000000);
+ settingNewest = db_get_b(NULL, MODULENAME, "LNNewest", 0);
+ settingEvenNonClicked = db_get_b(NULL, MODULENAME, "LNEvenNonClicked", 0);
+ settingNewestID = (DWORD)db_get_dw(NULL, MODULENAME, "LNNewestID", 0);
+ settingIniAnswer = db_get_b(NULL, MODULENAME, "LNIniAnswer", 0);
+ settingIniCheck = db_get_b(NULL, MODULENAME, "LNIniCheck", 0);
for (int i = 0; i < STATUS_COUNT; i++) {
char buff[128];
mir_snprintf(buff, "LNStatus%d", i);
- settingStatus[i] = (db_get_b(0, PLUGINNAME, buff, 0) == 1);
+ settingStatus[i] = (db_get_b(0, MODULENAME, buff, 0) == 1);
}
//lookupLotusDefaultSettings();
}
@@ -1035,30 +1041,30 @@ static void SaveSettings(HWND hwndDlg) {
char buff[128];
GetDlgItemTextA(hwndDlg, IDC_SERVER, settingServer, _countof(settingServer));
- db_set_s(NULL, PLUGINNAME, "LNServer", settingServer);
- db_set_s(NULL, PLUGINNAME, "LNServerSec", settingServerSec);
- db_set_s(NULL, PLUGINNAME, "LNPassword", settingPassword);
- db_set_s(NULL, PLUGINNAME, "LNDatabase", settingDatabase);
- db_set_dw(NULL, PLUGINNAME, "LNInterval", settingInterval);
- db_set_dw(NULL, PLUGINNAME, "LNInterval1", settingInterval1);
- db_set_b(NULL, PLUGINNAME, "LNKeepConnection", settingKeepConnection);
- db_set_s(NULL, PLUGINNAME, "LNCommand", settingCommand);
- db_set_s(NULL, PLUGINNAME, "LNParameters", settingParameters);
- db_set_b(NULL, PLUGINNAME, "LNOnceOnly", settingOnceOnly);
- db_set_b(NULL, PLUGINNAME, "LNNonClickedOnly", settingNonClickedOnly);
- db_set_b(NULL, PLUGINNAME, "LNShowError", settingShowError);
- db_set_b(NULL, PLUGINNAME, "LNSetColours", settingSetColours);
- db_set_dw(NULL, PLUGINNAME, "LNBgColor", (DWORD)settingBgColor);
- db_set_dw(NULL, PLUGINNAME, "LNFgColor", (DWORD)settingFgColor);
- db_set_b(NULL, PLUGINNAME, "LNNewest", settingNewest);
- db_set_b(NULL, PLUGINNAME, "LNEvenNonClicked", settingEvenNonClicked);
- db_set_b(NULL, PLUGINNAME, "LNIniCheck", settingIniCheck);
- db_set_b(NULL, PLUGINNAME, "LNIniAnswer", settingIniAnswer);
+ db_set_s(NULL, MODULENAME, "LNServer", settingServer);
+ db_set_s(NULL, MODULENAME, "LNServerSec", settingServerSec);
+ db_set_s(NULL, MODULENAME, "LNPassword", settingPassword);
+ db_set_s(NULL, MODULENAME, "LNDatabase", settingDatabase);
+ db_set_dw(NULL, MODULENAME, "LNInterval", settingInterval);
+ db_set_dw(NULL, MODULENAME, "LNInterval1", settingInterval1);
+ db_set_b(NULL, MODULENAME, "LNKeepConnection", settingKeepConnection);
+ db_set_s(NULL, MODULENAME, "LNCommand", settingCommand);
+ db_set_s(NULL, MODULENAME, "LNParameters", settingParameters);
+ db_set_b(NULL, MODULENAME, "LNOnceOnly", settingOnceOnly);
+ db_set_b(NULL, MODULENAME, "LNNonClickedOnly", settingNonClickedOnly);
+ db_set_b(NULL, MODULENAME, "LNShowError", settingShowError);
+ db_set_b(NULL, MODULENAME, "LNSetColours", settingSetColours);
+ db_set_dw(NULL, MODULENAME, "LNBgColor", (DWORD)settingBgColor);
+ db_set_dw(NULL, MODULENAME, "LNFgColor", (DWORD)settingFgColor);
+ db_set_b(NULL, MODULENAME, "LNNewest", settingNewest);
+ db_set_b(NULL, MODULENAME, "LNEvenNonClicked", settingEvenNonClicked);
+ db_set_b(NULL, MODULENAME, "LNIniCheck", settingIniCheck);
+ db_set_b(NULL, MODULENAME, "LNIniAnswer", settingIniAnswer);
for (int i = 0; i < STATUS_COUNT; i++) {
mir_snprintf(buff, "LNStatus%d", i);
settingStatus[i] = (ListView_GetCheckState(GetDlgItem(hwndDlg, IDC_STATUS), i) ? TRUE : FALSE);
- db_set_b(0, PLUGINNAME, buff, settingStatus[i] ? 1 : 0);
+ db_set_b(0, MODULENAME, buff, settingStatus[i] ? 1 : 0);
}
settingFilterSender[0] = 0;
@@ -1068,7 +1074,7 @@ static void SaveSettings(HWND hwndDlg) wcscat_s(settingFilterSender, _countof(settingFilterSender), text);
wcscat_s(settingFilterSender, _countof(settingFilterSender), TEXT(";"));
}
- db_set_ws(NULL, PLUGINNAME, "LNFilterSender", settingFilterSender);
+ db_set_ws(NULL, MODULENAME, "LNFilterSender", settingFilterSender);
settingFilterSubject[0] = 0;
for (int i = 0; i < SendDlgItemMessage(hwndDlg, IDC_FILTER_SUBJECT, CB_GETCOUNT, 0, 0); i++) {
@@ -1077,7 +1083,7 @@ static void SaveSettings(HWND hwndDlg) wcscat_s(settingFilterSubject, _countof(settingFilterSubject), text);
wcscat_s(settingFilterSubject, _countof(settingFilterSubject), TEXT(";"));
}
- db_set_ws(NULL, PLUGINNAME, "LNFilterSubject", settingFilterSubject);
+ db_set_ws(NULL, MODULENAME, "LNFilterSubject", settingFilterSubject);
settingFilterTo[0] = 0;
for (int i = 0; i < SendDlgItemMessage(hwndDlg, IDC_FILTER_TO, CB_GETCOUNT, 0, 0); i++) {
@@ -1086,7 +1092,7 @@ static void SaveSettings(HWND hwndDlg) wcscat_s(settingFilterTo, _countof(settingFilterTo), text);
wcscat_s(settingFilterTo, _countof(settingFilterTo), TEXT(";"));
}
- db_set_ws(NULL, PLUGINNAME, "LNFilterTo", settingFilterTo);
+ db_set_ws(NULL, MODULENAME, "LNFilterTo", settingFilterTo);
}
//callback function to speak with user interactions in options page
@@ -1505,7 +1511,7 @@ INT_PTR GetCaps(WPARAM wParam, LPARAM) //gives name to protocol module
INT_PTR GetName(WPARAM wParam, LPARAM lParam)
{
- strncpy((char*)lParam, PLUGINNAME, wParam);
+ strncpy((char*)lParam, MODULENAME, wParam);
return 0;
}
@@ -1554,7 +1560,7 @@ INT_PTR SetStatus(WPARAM wParam, LPARAM lParam) Menu_EnableItem(hMenuHandle, TRUE);
}
else {
- ProtoBroadcastAck(PLUGINNAME, NULL, ACKTYPE_STATUS, ACKRESULT_FAILED, (HANDLE)currentStatus, wParam);
+ ProtoBroadcastAck(MODULENAME, NULL, ACKTYPE_STATUS, ACKRESULT_FAILED, (HANDLE)currentStatus, wParam);
return -1;
}
}
@@ -1572,7 +1578,7 @@ INT_PTR SetStatus(WPARAM wParam, LPARAM lParam) }
//broadcast the message
if (currentStatus != (int)wParam)
- ProtoBroadcastAck(PLUGINNAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)currentStatus, wParam);
+ ProtoBroadcastAck(MODULENAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)currentStatus, wParam);
currentStatus = wParam;
return 0;
@@ -1677,7 +1683,7 @@ static int preshutdown(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
Plugin_Terminated = false;
@@ -1697,7 +1703,7 @@ extern "C" int __declspec(dllexport) Load(void) init_pluginname();
logRegister();
- log_p(L"Load: Entering LotusNotify.dll Load() bMirandaCall=%d PLUGINNAME=[%S]", bMirandaCall, PLUGINNAME);
+ log_p(L"Load: Entering LotusNotify.dll Load() bMirandaCall=%d MODULENAME=[%S]", bMirandaCall, MODULENAME);
if (!(hCheckEvent = CreateHookableEvent("LotusNotify/Check"))) //check if there is another copy of plugin running
second = TRUE;
@@ -1722,14 +1728,14 @@ extern "C" int __declspec(dllexport) Load(void) }
// set all contacts to offline
- for (auto &hContact : Contacts(PLUGINNAME))
- db_set_w(hContact, PLUGINNAME, "status", ID_STATUS_OFFLINE);
-
- CreateProtoServiceFunction(PLUGINNAME, PS_GETCAPS, GetCaps);
- CreateProtoServiceFunction(PLUGINNAME, PS_GETNAME, GetName);
- CreateProtoServiceFunction(PLUGINNAME, PS_LOADICON, TMLoadIcon);
- CreateProtoServiceFunction(PLUGINNAME, PS_SETSTATUS, SetStatus);
- CreateProtoServiceFunction(PLUGINNAME, PS_GETSTATUS, GetStatus);
+ for (auto &hContact : Contacts(MODULENAME))
+ db_set_w(hContact, MODULENAME, "status", ID_STATUS_OFFLINE);
+
+ CreateProtoServiceFunction(MODULENAME, PS_GETCAPS, GetCaps);
+ CreateProtoServiceFunction(MODULENAME, PS_GETNAME, GetName);
+ CreateProtoServiceFunction(MODULENAME, PS_LOADICON, TMLoadIcon);
+ CreateProtoServiceFunction(MODULENAME, PS_SETSTATUS, SetStatus);
+ CreateProtoServiceFunction(MODULENAME, PS_GETSTATUS, GetStatus);
LoadSettings(); //read from db to variables
diff --git a/plugins/LotusNotify/src/LotusNotify.h b/plugins/LotusNotify/src/LotusNotify.h index 49b0ca4e99..e776381aba 100644 --- a/plugins/LotusNotify/src/LotusNotify.h +++ b/plugins/LotusNotify/src/LotusNotify.h @@ -30,9 +30,5 @@ void checkthread(void*); struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(PLUGINNAME)
- {
- RegisterProtocol(PROTOTYPE_PROTOCOL);
- }
+ CMPlugin();
};
diff --git a/plugins/LotusNotify/src/debug.cpp b/plugins/LotusNotify/src/debug.cpp index c29996f0b5..91baeb82e5 100644 --- a/plugins/LotusNotify/src/debug.cpp +++ b/plugins/LotusNotify/src/debug.cpp @@ -7,8 +7,8 @@ void logRegister(){ // Register netlib user for logging function
NETLIBUSER nlu = {};
nlu.flags = NUF_UNICODE | NUF_NOOPTIONS;
- nlu.szSettingsModule = PLUGINNAME;
- nlu.szDescriptiveName.w = mir_a2u(PLUGINNAME);
+ nlu.szSettingsModule = MODULENAME;
+ nlu.szDescriptiveName.w = mir_a2u(MODULENAME);
netlibHandle = Netlib_RegisterUser(&nlu);
}
diff --git a/plugins/LotusNotify/src/debug.h b/plugins/LotusNotify/src/debug.h index 556efcd77b..736238bda4 100644 --- a/plugins/LotusNotify/src/debug.h +++ b/plugins/LotusNotify/src/debug.h @@ -1,6 +1,6 @@ #pragma once
-extern char PLUGINNAME[];
+extern char MODULENAME[];
void logRegister(void);
void logUnregister(void);
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(); diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index 06bd112ebc..9aff4ebe0e 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -76,6 +76,8 @@ static const ii[] = { { LPGENW("Typing Notify"), IGNOREEVENT_TYPINGNOTIFY, SKINICON_OTHER_TYPING }
};
+/////////////////////////////////////////////////////////////////////////////////////////
+
PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -89,6 +91,17 @@ PLUGININFOEX pluginInfoEx = { { 0xb1902a52, 0x9114, 0x4d7e, { 0xac, 0x2e, 0xb3, 0xa5, 0x2e, 0x01, 0xd5, 0x74 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
+{
+ return &pluginInfoEx;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
struct ModSetLinkLinkItem { // code from dbe++ plugin by Bio
char *name;
BYTE *next; //struct ModSetLinkLinkItem
@@ -1043,11 +1056,6 @@ static int PluginInit(WPARAM, LPARAM) return 0;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
-{
- return &pluginInfoEx;
-}
-
extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfoEx);
@@ -1079,6 +1087,8 @@ extern "C" __declspec(dllexport) int Load(void) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) int Unload(void)
{
DestroyIcon(hIcons[3]);
diff --git a/plugins/MenuItemEx/src/stdafx.h b/plugins/MenuItemEx/src/stdafx.h index 4f83841c4e..03c9183055 100644 --- a/plugins/MenuItemEx/src/stdafx.h +++ b/plugins/MenuItemEx/src/stdafx.h @@ -32,15 +32,11 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {}
+ CMPlugin();
};
#define MIIM_STRING 0x00000040
-extern PLUGININFOEX pluginInfoEx;
-
int OptionsInit(WPARAM, LPARAM);
#define MAX_PROTOS 32
diff --git a/plugins/MessageState/src/main.cpp b/plugins/MessageState/src/main.cpp index eb82d342cb..2036443360 100644 --- a/plugins/MessageState/src/main.cpp +++ b/plugins/MessageState/src/main.cpp @@ -5,7 +5,7 @@ CMPlugin g_plugin; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -20,16 +20,20 @@ PLUGININFOEX pluginInfo = };
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
InitServices();
return 0;
diff --git a/plugins/MessageState/src/stdafx.h b/plugins/MessageState/src/stdafx.h index 13827de990..29b8b8d3f1 100644 --- a/plugins/MessageState/src/stdafx.h +++ b/plugins/MessageState/src/stdafx.h @@ -22,9 +22,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {}
+ CMPlugin();
};
extern IconItem Icons[];
\ No newline at end of file diff --git a/plugins/MirFox/src/MirandaInterface.cpp b/plugins/MirFox/src/MirandaInterface.cpp index 416ebcaf24..db64cd26ae 100644 --- a/plugins/MirFox/src/MirandaInterface.cpp +++ b/plugins/MirFox/src/MirandaInterface.cpp @@ -20,7 +20,7 @@ CMirfoxMiranda mirfoxMiranda; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -33,9 +33,13 @@ PLUGININFOEX pluginInfo = { 0xe99a09b2, 0xe05b, 0x4633, { 0xaa, 0x3a, 0x5c, 0x83, 0xef, 0x1c, 0xba, 0xb6 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec (dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -138,7 +142,7 @@ static int OnShutdown(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded);
HookEvent(ME_SYSTEM_SHUTDOWN, OnShutdown);
diff --git a/plugins/MirFox/src/MirandaOptions.cpp b/plugins/MirFox/src/MirandaOptions.cpp index b339b885c8..7cb9a470e7 100644 --- a/plugins/MirFox/src/MirandaOptions.cpp +++ b/plugins/MirFox/src/MirandaOptions.cpp @@ -102,32 +102,32 @@ INT_PTR CALLBACK DlgProcOpts_Tab1(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (((LPNMHDR)lParam)->idFrom == 0 && ((LPNMHDR)lParam)->code == PSN_APPLY){
//SaveOptions from tab1 mirfoxData to miranda database
mirfoxMiranda.getMirfoxData().leftClickSendMode = (MFENUM_SEND_MESSAGE_MODE)( 1 + (WORD)SendDlgItemMessage(hwndDlg, IDC1_COMBO1, CB_GETCURSEL, 0, 0));
- db_set_b(0, PLUGIN_DB_ID, "leftClickSendMode", (int)mirfoxMiranda.getMirfoxData().leftClickSendMode);
+ db_set_b(0, MODULENAME, "leftClickSendMode", (int)mirfoxMiranda.getMirfoxData().leftClickSendMode);
mirfoxMiranda.getMirfoxData().rightClickSendMode = (MFENUM_SEND_MESSAGE_MODE)( 1 + (WORD)SendDlgItemMessage(hwndDlg, IDC1_COMBO2, CB_GETCURSEL, 0, 0));
- db_set_b(0, PLUGIN_DB_ID, "rightClickSendMode", (int)mirfoxMiranda.getMirfoxData().rightClickSendMode);
+ db_set_b(0, MODULENAME, "rightClickSendMode", (int)mirfoxMiranda.getMirfoxData().rightClickSendMode);
mirfoxMiranda.getMirfoxData().middleClickSendMode = (MFENUM_SEND_MESSAGE_MODE)( 1 + (WORD)SendDlgItemMessage(hwndDlg, IDC1_COMBO3, CB_GETCURSEL, 0, 0));
- db_set_b(0, PLUGIN_DB_ID, "middleClickSendMode", (int)mirfoxMiranda.getMirfoxData().middleClickSendMode);
+ db_set_b(0, MODULENAME, "middleClickSendMode", (int)mirfoxMiranda.getMirfoxData().middleClickSendMode);
if (IsDlgButtonChecked(hwndDlg, IDC1_CHECK1) == BST_CHECKED){
mirfoxMiranda.getMirfoxData().setClientsProfilesFilterCheckbox(true);
- db_set_b(0, PLUGIN_DB_ID, "clientsProfilesFilterCheckbox", 1);
+ db_set_b(0, MODULENAME, "clientsProfilesFilterCheckbox", 1);
} else {
mirfoxMiranda.getMirfoxData().setClientsProfilesFilterCheckbox(false);
- db_set_b(0, PLUGIN_DB_ID, "clientsProfilesFilterCheckbox", 2);
+ db_set_b(0, MODULENAME, "clientsProfilesFilterCheckbox", 2);
}
if (IsDlgButtonChecked(hwndDlg, IDC1_CHECK2) == BST_CHECKED){
if (mirfoxMiranda.getMirfoxData().getAddAccountToContactNameCheckbox() != true){
mirfoxMiranda.getMirfoxData().setAddAccountToContactNameCheckbox(true);
- db_set_b(0, PLUGIN_DB_ID, "addAccountToContactNameCheckbox", 1);
+ db_set_b(0, MODULENAME, "addAccountToContactNameCheckbox", 1);
mirfoxMiranda.getMirfoxData().updateAllMirandaContactsNames(mirfoxMiranda.getSharedMemoryUtils());
}
} else {
if (mirfoxMiranda.getMirfoxData().getAddAccountToContactNameCheckbox() != false){
mirfoxMiranda.getMirfoxData().setAddAccountToContactNameCheckbox(false);
- db_set_b(0, PLUGIN_DB_ID, "addAccountToContactNameCheckbox", 2);
+ db_set_b(0, MODULENAME, "addAccountToContactNameCheckbox", 2);
mirfoxMiranda.getMirfoxData().updateAllMirandaContactsNames(mirfoxMiranda.getSharedMemoryUtils());
}
}
@@ -142,7 +142,7 @@ INT_PTR CALLBACK DlgProcOpts_Tab1(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM MFLogger* logger = MFLogger::getInstance();
logger->log_p(L"Options. Save clientsProfilesFilterString: [%s]", mirfoxMiranda.getMirfoxData().getClientsProfilesFilterStringPtr()->c_str());
- db_set_ws(0, PLUGIN_DB_ID, "clientsProfilesFilterString", mirfoxMiranda.getMirfoxData().getClientsProfilesFilterStringPtr()->c_str());
+ db_set_ws(0, MODULENAME, "clientsProfilesFilterString", mirfoxMiranda.getMirfoxData().getClientsProfilesFilterStringPtr()->c_str());
//TODO fire actualization visableTo field at CSM record
@@ -483,9 +483,9 @@ INT_PTR CALLBACK DlgProcOpts_Tab2(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM //save to db 1 - on, 2 - off
if (contactState == MFENUM_MIRANDACONTACT_STATE_OFF){
- db_set_b(hContact, PLUGIN_DB_ID, "state", 2);
+ db_set_b(hContact, MODULENAME, "state", 2);
} else {
- db_set_b(hContact, PLUGIN_DB_ID, "state", 1);
+ db_set_b(hContact, MODULENAME, "state", 1);
}
@@ -641,9 +641,9 @@ INT_PTR CALLBACK DlgProcOpts_Tab3(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM std::string mirandaAccountDBKey("ACCOUNTSTATE_");
mirandaAccountDBKey += accountId;
if (accountState == MFENUM_MIRANDAACCOUNT_STATE_OFF){
- db_set_b(0, PLUGIN_DB_ID, mirandaAccountDBKey.c_str(), 2);
+ db_set_b(0, MODULENAME, mirandaAccountDBKey.c_str(), 2);
} else {
- db_set_b(0, PLUGIN_DB_ID, mirandaAccountDBKey.c_str(), 1);
+ db_set_b(0, MODULENAME, mirandaAccountDBKey.c_str(), 1);
}
diff --git a/plugins/MirFox/src/MirandaUtils.cpp b/plugins/MirFox/src/MirandaUtils.cpp index 20deed6d35..585a6bbdca 100644 --- a/plugins/MirFox/src/MirandaUtils.cpp +++ b/plugins/MirFox/src/MirandaUtils.cpp @@ -31,7 +31,7 @@ void MirandaUtils::netlibRegister(){ // Register netlib user for logging function
NETLIBUSER nlu = {};
nlu.flags = NUF_UNICODE | NUF_NOOPTIONS;
- nlu.szSettingsModule = PLUGIN_DB_ID;
+ nlu.szSettingsModule = MODULENAME;
nlu.szDescriptiveName.w = TranslateT("MirFox log");
netlibHandle = Netlib_RegisterUser(&nlu);
@@ -351,7 +351,7 @@ int MirandaUtils::on_hook_OpenMW(WPARAM wParam, LPARAM lParam) }
// show and focus window
- if (db_get_b(0, PLUGIN_DB_ID, "doNotFocusWhenOpenMW", 0) == 1){
+ if (db_get_b(0, MODULENAME, "doNotFocusWhenOpenMW", 0) == 1){
delete param;
return 0;
}
@@ -467,7 +467,7 @@ void MirandaUtils::translateOldDBNames() { //settings "clientsProfilesFilterCheckbox", "clientsProfilesFilterString"
int opt1KeyValue = db_get_b(0, OLD_PLUGIN_DB_ID, "clientsProfilesFilterCheckbox", 0);
if (opt1KeyValue != 0){
- db_set_b(0, PLUGIN_DB_ID, "clientsProfilesFilterCheckbox", opt1KeyValue);
+ db_set_b(0, MODULENAME, "clientsProfilesFilterCheckbox", opt1KeyValue);
db_unset(0, OLD_PLUGIN_DB_ID, "clientsProfilesFilterCheckbox");
logger->log(L"TranslateOldDBNames: 'clientsProfilesFilterCheckbox' db entry found and moved");
} else {
@@ -479,7 +479,7 @@ void MirandaUtils::translateOldDBNames() { INT_PTR opt2Result = db_get_s(0, OLD_PLUGIN_DB_ID, "clientsProfilesFilterString", &opt2Dbv, DBVT_WCHAR);
if (opt2Result == 0){ //success
std::wstring clientsProfilesFilterString = opt2Dbv.pwszVal;
- db_set_ws(0, PLUGIN_DB_ID, "clientsProfilesFilterString", clientsProfilesFilterString.c_str());
+ db_set_ws(0, MODULENAME, "clientsProfilesFilterString", clientsProfilesFilterString.c_str());
db_unset(0, OLD_PLUGIN_DB_ID, "clientsProfilesFilterString");
logger->log(L"TranslateOldDBNames: 'clientsProfilesFilterString' db entry found and moved");
db_free(&opt2Dbv);
@@ -493,7 +493,7 @@ void MirandaUtils::translateOldDBNames() { mirandaAccountDBKey += pa->szModuleName;
int keyValue = db_get_b(0, OLD_PLUGIN_DB_ID, mirandaAccountDBKey.c_str(), 0);
if (keyValue != 0){
- db_set_b(0, PLUGIN_DB_ID, mirandaAccountDBKey.c_str(), keyValue);
+ db_set_b(0, MODULENAME, mirandaAccountDBKey.c_str(), keyValue);
db_unset(0, OLD_PLUGIN_DB_ID, mirandaAccountDBKey.c_str());
logger->log(L"TranslateOldDBNames: ACCOUNT db entry found and moved");
}
@@ -505,7 +505,7 @@ void MirandaUtils::translateOldDBNames() { int keyValue = db_get_b(hContact, OLD_PLUGIN_DB_ID, "state", 0);
if (keyValue != 0){
- db_set_b(hContact, PLUGIN_DB_ID, "state", keyValue);
+ db_set_b(hContact, MODULENAME, "state", keyValue);
db_unset(hContact, OLD_PLUGIN_DB_ID, "state");
logger->log(L"TranslateOldDBNames: CONTACT db entry found and moved");
}
diff --git a/plugins/MirFox/src/MirfoxData.cpp b/plugins/MirFox/src/MirfoxData.cpp index a58df3d5f0..c1734eb3b1 100644 --- a/plugins/MirFox/src/MirfoxData.cpp +++ b/plugins/MirFox/src/MirfoxData.cpp @@ -268,7 +268,7 @@ void MirfoxData::refreshAccount_Add(SharedMemoryUtils& sharedMemoryUtils, char* MFENUM_MIRANDAACCOUNT_STATE getOrCreateAccountStateInDB(char* szModuleName);
std::string mirandaAccountDBKey("ACCOUNTSTATE_");
mirandaAccountDBKey += szModuleName;
- int keyValue = db_get_b(0, PLUGIN_DB_ID, mirandaAccountDBKey.c_str(), 0);
+ int keyValue = db_get_b(0, MODULENAME, mirandaAccountDBKey.c_str(), 0);
if (keyValue == 1 || keyValue == 2){
//setting exist
if (keyValue == 1){
@@ -280,10 +280,10 @@ void MirfoxData::refreshAccount_Add(SharedMemoryUtils& sharedMemoryUtils, char* //setting does not exist, or is invalid -> save default setting (1 - ON)
if (getAccountDefaultState(mirandaAccountItemPtr) == 1){ //on = 1
mirandaAccountItemPtr->accountState = MFENUM_MIRANDAACCOUNT_STATE_ON; //1
- db_set_b(0, PLUGIN_DB_ID, mirandaAccountDBKey.c_str(), 1);
+ db_set_b(0, MODULENAME, mirandaAccountDBKey.c_str(), 1);
} else { //off = 2
mirandaAccountItemPtr->accountState = MFENUM_MIRANDAACCOUNT_STATE_OFF; //2
- db_set_b(0, PLUGIN_DB_ID, mirandaAccountDBKey.c_str(), 2);
+ db_set_b(0, MODULENAME, mirandaAccountDBKey.c_str(), 2);
}
}
*/
@@ -337,7 +337,7 @@ void MirfoxData::refreshAccount_Delete(SharedMemoryUtils& sharedMemoryUtils, cha std::string mirandaAccountDBKey("ACCOUNTSTATE_");
mirandaAccountDBKey += szModuleName;
- db_unset(0, PLUGIN_DB_ID, mirandaAccountDBKey.c_str());
+ db_unset(0, MODULENAME, mirandaAccountDBKey.c_str());
//del proto from SM
sharedMemoryUtils.refreshMsm_Delete('A', deletedId);
@@ -530,7 +530,7 @@ MirfoxData::createOrGetAccountStateFromDB(MirandaAccount* mirandaAccount){ std::string mirandaAccountDBKey("ACCOUNTSTATE_");
mirandaAccountDBKey += mirandaAccount->szModuleName;
- int keyValue = db_get_b(0, PLUGIN_DB_ID, mirandaAccountDBKey.c_str(), 0);
+ int keyValue = db_get_b(0, MODULENAME, mirandaAccountDBKey.c_str(), 0);
if (keyValue == 1 || keyValue == 2){
//setting exist
if (keyValue == 1){
@@ -541,10 +541,10 @@ MirfoxData::createOrGetAccountStateFromDB(MirandaAccount* mirandaAccount){ } else {
//setting does not exist, or is invalid -> save default setting (1 - ON)
if (getAccountDefaultState(mirandaAccount) == 1){ //on = 1
- db_set_b(0, PLUGIN_DB_ID, mirandaAccountDBKey.c_str(), 1);
+ db_set_b(0, MODULENAME, mirandaAccountDBKey.c_str(), 1);
return MFENUM_MIRANDAACCOUNT_STATE_ON; //1
} else { //off = 2
- db_set_b(0, PLUGIN_DB_ID, mirandaAccountDBKey.c_str(), 2);
+ db_set_b(0, MODULENAME, mirandaAccountDBKey.c_str(), 2);
return MFENUM_MIRANDAACCOUNT_STATE_OFF; //2
}
}
@@ -554,7 +554,7 @@ MirfoxData::createOrGetAccountStateFromDB(MirandaAccount* mirandaAccount){ MFENUM_MIRANDACONTACT_STATE
MirfoxData::createOrGetContactStateFromDB(MirandaContact* mirandaContact){
- int keyValue = db_get_b(mirandaContact->contactHandle, PLUGIN_DB_ID, "state", 0);
+ int keyValue = db_get_b(mirandaContact->contactHandle, MODULENAME, "state", 0);
if (keyValue == 1 || keyValue == 2){
//setting exist
if (keyValue == 1){
@@ -565,10 +565,10 @@ MirfoxData::createOrGetContactStateFromDB(MirandaContact* mirandaContact){ } else {
//setting does not exist, or is invalid -> save default setting (1 - ON)
if (MirfoxData::getContactDefaultState(mirandaContact->getObjectPtr()) == 1){ //on = 1
- db_set_b(mirandaContact->contactHandle, PLUGIN_DB_ID, "state", 1);
+ db_set_b(mirandaContact->contactHandle, MODULENAME, "state", 1);
return MFENUM_MIRANDACONTACT_STATE_ON; //1
} else { //off = 2
- db_set_b(mirandaContact->contactHandle, PLUGIN_DB_ID, "state", 2);
+ db_set_b(mirandaContact->contactHandle, MODULENAME, "state", 2);
return MFENUM_MIRANDACONTACT_STATE_OFF; //2
}
}
@@ -664,7 +664,7 @@ void MirfoxData::initializeOptions() {
//addAccountToContactNameCheckbox
- int opt2KeyValue = db_get_b(0, PLUGIN_DB_ID, "addAccountToContactNameCheckbox", 0);
+ int opt2KeyValue = db_get_b(0, MODULENAME, "addAccountToContactNameCheckbox", 0);
if (opt2KeyValue == 1 || opt2KeyValue == 2){
//setting exist
if (opt2KeyValue == 1){
@@ -675,12 +675,12 @@ void MirfoxData::initializeOptions() } else {
//setting does not exist, or is invalid -> save default setting (2 - false)
setAddAccountToContactNameCheckbox(false); //2
- db_set_b(0, PLUGIN_DB_ID, "addAccountToContactNameCheckbox", 2);
+ db_set_b(0, MODULENAME, "addAccountToContactNameCheckbox", 2);
}
//clientsProfilesFilterCheckbox
- int opt1KeyValue = db_get_b(0, PLUGIN_DB_ID, "clientsProfilesFilterCheckbox", 0);
+ int opt1KeyValue = db_get_b(0, MODULENAME, "clientsProfilesFilterCheckbox", 0);
if (opt1KeyValue == 1 || opt1KeyValue == 2){
//setting exist
if (opt1KeyValue == 1){
@@ -691,53 +691,53 @@ void MirfoxData::initializeOptions() } else {
//setting does not exist, or is invalid -> save default setting (2 - false)
setClientsProfilesFilterCheckbox(false); //2
- db_set_b(0, PLUGIN_DB_ID, "clientsProfilesFilterCheckbox", 2);
+ db_set_b(0, MODULENAME, "clientsProfilesFilterCheckbox", 2);
}
//clientsProfilesFilterString
DBVARIANT opt2Dbv = {0};
- INT_PTR opt2Result = db_get_s(0, PLUGIN_DB_ID, "clientsProfilesFilterString", &opt2Dbv, DBVT_WCHAR);
+ INT_PTR opt2Result = db_get_s(0, MODULENAME, "clientsProfilesFilterString", &opt2Dbv, DBVT_WCHAR);
if (opt2Result == 0){ //success
//option exists in DB, get value
(* getClientsProfilesFilterStringPtr()) = opt2Dbv.pwszVal;
} else {
//option not exists in DB, set default value
(* getClientsProfilesFilterStringPtr()) = L"";
- db_set_ws(0, PLUGIN_DB_ID, "clientsProfilesFilterString", getClientsProfilesFilterStringPtr()->c_str());
+ db_set_ws(0, MODULENAME, "clientsProfilesFilterString", getClientsProfilesFilterStringPtr()->c_str());
}
db_free(&opt2Dbv);
- int opt3KeyValue = db_get_b(0, PLUGIN_DB_ID, "leftClickSendMode", 0);
+ int opt3KeyValue = db_get_b(0, MODULENAME, "leftClickSendMode", 0);
if (opt3KeyValue == MFENUM_SMM_ONLY_SEND || opt3KeyValue == MFENUM_SMM_SEND_AND_SHOW_MW || opt3KeyValue == MFENUM_SMM_ONLY_SHOW_MW){
//setting exist
leftClickSendMode = (MFENUM_SEND_MESSAGE_MODE)opt3KeyValue;
} else {
//setting does not exist, or is invalid -> save default setting (MFENUM_SMM_ONLY_SEND)
leftClickSendMode = MFENUM_SMM_ONLY_SEND;
- db_set_b(0, PLUGIN_DB_ID, "leftClickSendMode", MFENUM_SMM_ONLY_SEND);
+ db_set_b(0, MODULENAME, "leftClickSendMode", MFENUM_SMM_ONLY_SEND);
}
- int opt4KeyValue = db_get_b(0, PLUGIN_DB_ID, "rightClickSendMode", 0);
+ int opt4KeyValue = db_get_b(0, MODULENAME, "rightClickSendMode", 0);
if (opt4KeyValue == MFENUM_SMM_ONLY_SEND || opt4KeyValue == MFENUM_SMM_SEND_AND_SHOW_MW || opt4KeyValue == MFENUM_SMM_ONLY_SHOW_MW){
//setting exist
rightClickSendMode = (MFENUM_SEND_MESSAGE_MODE)opt4KeyValue;
} else {
//setting does not exist, or is invalid -> save default setting (MFENUM_SMM_SEND_AND_SHOW_MW)
rightClickSendMode = MFENUM_SMM_SEND_AND_SHOW_MW;
- db_set_b(0, PLUGIN_DB_ID, "rightClickSendMode", MFENUM_SMM_SEND_AND_SHOW_MW);
+ db_set_b(0, MODULENAME, "rightClickSendMode", MFENUM_SMM_SEND_AND_SHOW_MW);
}
- int opt5KeyValue = db_get_b(0, PLUGIN_DB_ID, "middleClickSendMode", 0);
+ int opt5KeyValue = db_get_b(0, MODULENAME, "middleClickSendMode", 0);
if (opt5KeyValue == MFENUM_SMM_ONLY_SEND || opt5KeyValue == MFENUM_SMM_SEND_AND_SHOW_MW || opt5KeyValue == MFENUM_SMM_ONLY_SHOW_MW){
//setting exist
middleClickSendMode = (MFENUM_SEND_MESSAGE_MODE)opt5KeyValue;
} else {
//setting does not exist, or is invalid -> save default setting (must be MFENUM_SMM_ONLY_SEND due to Firefox bug and crash)
middleClickSendMode = MFENUM_SMM_ONLY_SEND;
- db_set_b(0, PLUGIN_DB_ID, "middleClickSendMode", MFENUM_SMM_ONLY_SEND);
+ db_set_b(0, MODULENAME, "middleClickSendMode", MFENUM_SMM_ONLY_SEND);
}
diff --git a/plugins/MirFox/src/common.h b/plugins/MirFox/src/common.h index 95b80f9861..21eefe49e8 100644 --- a/plugins/MirFox/src/common.h +++ b/plugins/MirFox/src/common.h @@ -19,14 +19,13 @@ #include <m_extraicons.h>
#include <m_protocols.h>
-#define PLUGIN_DB_ID "MirFox"
+#define MODULENAME "MirFox"
+
#define PLUGIN_OPTIONS_NAME "MirFox"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(PLUGIN_DB_ID)
- {}
+ CMPlugin();
};
//for MirandaUtils.h and MirfoxData.h and MirfoxMiranda.h
diff --git a/plugins/MirLua/src/m_hotkeys.cpp b/plugins/MirLua/src/m_hotkeys.cpp index f6041b504e..8e38f16bf8 100644 --- a/plugins/MirLua/src/m_hotkeys.cpp +++ b/plugins/MirLua/src/m_hotkeys.cpp @@ -18,7 +18,7 @@ void MakeHotkey(lua_State *L, HOTKEYDESC &hk) lua_pop(L, 1);
lua_getfield(L, -1, "Section");
- hk.szSection.w = mir_utf8decodeW(luaL_optstring(L, -1, MODULE));
+ hk.szSection.w = mir_utf8decodeW(luaL_optstring(L, -1, MODULENAME));
lua_pop(L, 1);
lua_getfield(L, -1, "Hotkey");
diff --git a/plugins/MirLua/src/m_icolib.cpp b/plugins/MirLua/src/m_icolib.cpp index 332d5273c5..a83c9877d7 100644 --- a/plugins/MirLua/src/m_icolib.cpp +++ b/plugins/MirLua/src/m_icolib.cpp @@ -18,7 +18,7 @@ static void MakeSKINICONDESC(lua_State *L, SKINICONDESC &sid) lua_pop(L, 1);
lua_getfield(L, -1, "Section");
- sid.section.w = mir_utf8decodeW(luaL_optstring(L, 3, MODULE));
+ sid.section.w = mir_utf8decodeW(luaL_optstring(L, 3, MODULENAME));
lua_pop(L, 1);
lua_getfield(L, -1, "DefaultFile");
@@ -57,7 +57,7 @@ static int lua_AddIcon(lua_State *L) sid.flags = SIDF_ALL_UNICODE;
sid.pszName = mir_utf8decodeA(luaL_checkstring(L, 1));
sid.description.w = mir_utf8decodeW(luaL_checkstring(L, 2));
- sid.section.w = mir_utf8decodeW(luaL_optstring(L, 3, MODULE));
+ sid.section.w = mir_utf8decodeW(luaL_optstring(L, 3, MODULENAME));
sid.defaultFile.w = mir_utf8decodeW(lua_tostring(L, 4));
sid.hDefaultIcon = GetIcon(IDI_SCRIPT);
diff --git a/plugins/MirLua/src/m_message.cpp b/plugins/MirLua/src/m_message.cpp index b35b4dd67d..4ac1f991e9 100644 --- a/plugins/MirLua/src/m_message.cpp +++ b/plugins/MirLua/src/m_message.cpp @@ -35,7 +35,7 @@ static int message_Send(lua_State *L) }
else if ((res = ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)message)) != ACKRESULT_FAILED) {
DBEVENTINFO dbei = {};
- dbei.szModule = MODULE;
+ dbei.szModule = MODULENAME;
dbei.timestamp = time(0);
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.cbBlob = (DWORD)mir_strlen(message);
diff --git a/plugins/MirLua/src/m_sounds.cpp b/plugins/MirLua/src/m_sounds.cpp index e6737ed705..177148320a 100644 --- a/plugins/MirLua/src/m_sounds.cpp +++ b/plugins/MirLua/src/m_sounds.cpp @@ -4,7 +4,7 @@ static int lua_AddSound(lua_State *L) {
ptrA name(mir_utf8decodeA(luaL_checkstring(L, 1)));
ptrW description(mir_utf8decodeW(luaL_checkstring(L, 2)));
- ptrW section(mir_utf8decodeW(luaL_optstring(L, 3, MODULE)));
+ ptrW section(mir_utf8decodeW(luaL_optstring(L, 3, MODULENAME)));
ptrW filePath(mir_utf8decodeW(lua_tostring(L, 4)));
int res;
diff --git a/plugins/MirLua/src/main.cpp b/plugins/MirLua/src/main.cpp index 6388952bae..73c3d91aa1 100644 --- a/plugins/MirLua/src/main.cpp +++ b/plugins/MirLua/src/main.cpp @@ -12,7 +12,7 @@ HNETLIBUSER hNetlib = nullptr; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -27,9 +27,13 @@ PLUGININFOEX pluginInfo = };
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -49,8 +53,8 @@ int OnOptionsInit(WPARAM wParam, LPARAM) int OnModulesLoaded(WPARAM, LPARAM)
{
- g_hCLibsFolder = FoldersRegisterCustomPathT(MODULE, "CLibsFolder", MIRLUA_PATHT, TranslateT("C libs folder"));
- g_hScriptsFolder = FoldersRegisterCustomPathT(MODULE, "ScriptsFolder", MIRLUA_PATHT, TranslateT("Scripts folder"));
+ g_hCLibsFolder = FoldersRegisterCustomPathT(MODULENAME, "CLibsFolder", MIRLUA_PATHT, TranslateT("C libs folder"));
+ g_hScriptsFolder = FoldersRegisterCustomPathT(MODULENAME, "ScriptsFolder", MIRLUA_PATHT, TranslateT("Scripts folder"));
HookEvent(ME_OPT_INITIALISE, OnOptionsInit);
return 0;
@@ -58,20 +62,20 @@ int OnModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
InitIcons();
NETLIBUSER nlu = {};
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS;
- nlu.szDescriptiveName.a = MODULE;
- nlu.szSettingsModule = MODULE;
+ nlu.szDescriptiveName.a = MODULENAME;
+ nlu.szSettingsModule = MODULENAME;
hNetlib = Netlib_RegisterUser(&nlu);
- Proto_RegisterModule(PROTOTYPE_FILTER, MODULE);
+ Proto_RegisterModule(PROTOTYPE_FILTER, MODULENAME);
- hRecvMessage = CreateHookableEvent(MODULE PSR_MESSAGE);
- CreateProtoServiceFunction(MODULE, PSR_MESSAGE, FilterRecvMessage);
+ hRecvMessage = CreateHookableEvent(MODULENAME PSR_MESSAGE);
+ CreateProtoServiceFunction(MODULENAME, PSR_MESSAGE, FilterRecvMessage);
g_mLua = new CMLua();
g_mLua->Load();
diff --git a/plugins/MirLua/src/mlua.cpp b/plugins/MirLua/src/mlua.cpp index b0a12289c6..169dcb6a91 100644 --- a/plugins/MirLua/src/mlua.cpp +++ b/plugins/MirLua/src/mlua.cpp @@ -1,9 +1,11 @@ #include "stdafx.h"
+extern PLUGININFOEX pluginInfoEx;
+
int hMLuaLangpack;
CMLua::CMLua()
- : PLUGIN(MODULE),
+ : PLUGIN(MODULENAME, pluginInfoEx),
L(nullptr),
Scripts(1)
{
diff --git a/plugins/MirLua/src/mlua_icons.cpp b/plugins/MirLua/src/mlua_icons.cpp index 835f45d243..3b2466bc27 100644 --- a/plugins/MirLua/src/mlua_icons.cpp +++ b/plugins/MirLua/src/mlua_icons.cpp @@ -11,7 +11,7 @@ IconItem Icons[] = void InitIcons()
{
- g_plugin.registerIcon(MODULE, Icons, MODULE);
+ g_plugin.registerIcon(MODULENAME, Icons, MODULENAME);
}
HICON GetIcon(int iconId)
diff --git a/plugins/MirLua/src/mlua_options.cpp b/plugins/MirLua/src/mlua_options.cpp index d518cae533..226a925fd9 100644 --- a/plugins/MirLua/src/mlua_options.cpp +++ b/plugins/MirLua/src/mlua_options.cpp @@ -1,7 +1,7 @@ #include "stdafx.h"
CMLuaOptions::CMLuaOptions(CMLua *mLua)
- : CPluginDlgBase(g_plugin, IDD_OPTIONS, MODULE),
+ : CPluginDlgBase(g_plugin, IDD_OPTIONS, MODULENAME),
m_mLua(mLua), isScriptListInit(false),
m_popupOnError(this, IDC_POPUPONERROR),
m_popupOnObsolete(this, IDC_POPUPONOBSOLETE),
diff --git a/plugins/MirLua/src/mlua_script.cpp b/plugins/MirLua/src/mlua_script.cpp index 83b5008e15..9e4cc4ffbe 100644 --- a/plugins/MirLua/src/mlua_script.cpp +++ b/plugins/MirLua/src/mlua_script.cpp @@ -44,17 +44,17 @@ const wchar_t* CMLuaScript::GetFileName() const bool CMLuaScript::IsEnabled()
{
- return db_get_b(NULL, MODULE, _T2A(fileName), 1);
+ return db_get_b(NULL, MODULENAME, _T2A(fileName), 1);
}
void CMLuaScript::Enable()
{
- db_unset(NULL, MODULE, _T2A(fileName));
+ db_unset(NULL, MODULENAME, _T2A(fileName));
}
void CMLuaScript::Disable()
{
- db_set_b(NULL, MODULE, _T2A(fileName), 0);
+ db_set_b(NULL, MODULENAME, _T2A(fileName), 0);
}
CMLuaScript::Status CMLuaScript::GetStatus() const
diff --git a/plugins/MirLua/src/mlua_utils.cpp b/plugins/MirLua/src/mlua_utils.cpp index 9275b74a7f..5ecdbc677d 100644 --- a/plugins/MirLua/src/mlua_utils.cpp +++ b/plugins/MirLua/src/mlua_utils.cpp @@ -44,16 +44,16 @@ void ObsoleteMethod(lua_State *L, const char *message) char text[512];
mir_snprintf(text, "%s is obsolete. %s", ar.name, message);
Log(text);
- if (db_get_b(NULL, MODULE, "PopupOnObsolete", 0))
- ShowNotification(MODULE, text, MB_OK | MB_ICONWARNING, NULL);
+ if (db_get_b(NULL, MODULENAME, "PopupOnObsolete", 0))
+ ShowNotification(MODULENAME, text, MB_OK | MB_ICONWARNING, NULL);
}
void ReportError(lua_State *L)
{
const char *message = lua_tostring(L, -1);
Log(message);
- if (db_get_b(NULL, MODULE, "PopupOnError", 0))
- ShowNotification(MODULE, message, MB_OK | MB_ICONERROR);
+ if (db_get_b(NULL, MODULENAME, "PopupOnError", 0))
+ ShowNotification(MODULENAME, message, MB_OK | MB_ICONERROR);
}
int luaM_atpanic(lua_State *L)
diff --git a/plugins/MirLua/src/stdafx.h b/plugins/MirLua/src/stdafx.h index 54c6f64a4e..f97ecd09de 100644 --- a/plugins/MirLua/src/stdafx.h +++ b/plugins/MirLua/src/stdafx.h @@ -44,13 +44,11 @@ class CMLuaScript; #include "mlua_options.h"
#include "mlua_metatable.h"
-#define MODULE "MirLua"
+#define MODULENAME "MirLua"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE)
- {}
+ CMPlugin();
};
extern CMLua *g_mLua;
diff --git a/plugins/MirOTR/src/dllmain.cpp b/plugins/MirOTR/src/dllmain.cpp index 1d1284b6de..89b6f7891c 100644 --- a/plugins/MirOTR/src/dllmain.cpp +++ b/plugins/MirOTR/src/dllmain.cpp @@ -6,7 +6,7 @@ CMPlugin g_plugin; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo={
+PLUGININFOEX pluginInfoEx={
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -19,9 +19,13 @@ PLUGININFOEX pluginInfo={ {0x12d8faad, 0x78ab, 0x4e3c, {0x98, 0x54, 0x32, 0xe, 0x9e, 0xa5, 0xcc, 0x9f}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -54,7 +58,7 @@ extern "C" __declspec(dllexport) int Load(void) {
DEBUGOUTA("LOAD MIROTR");
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
InitIcons();
diff --git a/plugins/MirOTR/src/stdafx.h b/plugins/MirOTR/src/stdafx.h index 06d1f2f45b..64a3871e43 100644 --- a/plugins/MirOTR/src/stdafx.h +++ b/plugins/MirOTR/src/stdafx.h @@ -76,9 +76,7 @@ using namespace std; struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {}
+ CMPlugin();
};
#define PREF_BYPASS_OTR 0x8000
diff --git a/plugins/MirandaG15/src/Miranda.cpp b/plugins/MirandaG15/src/Miranda.cpp index a153de8021..cad693ee75 100644 --- a/plugins/MirandaG15/src/Miranda.cpp +++ b/plugins/MirandaG15/src/Miranda.cpp @@ -58,9 +58,9 @@ bool g_bInitialized; // Plugin Information
-int &hLangpack(g_plugin.m_hLang);
CMPlugin g_plugin;
CLIST_INTERFACE *pcli;
+int &hLangpack(g_plugin.m_hLang);
// Function Prototypes
int Init(WPARAM, LPARAM);
@@ -82,6 +82,10 @@ PLUGININFOEX pluginInfoEx = {0x798221e1, 0xe47a, 0x4dc8, {0x90, 0x77, 0x1e, 0x57, 0x6f, 0x9c, 0x43, 0x7}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(nullptr, pluginInfoEx)
+{}
+
EXTERN_C __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
diff --git a/plugins/MirandaG15/src/StdAfx.h b/plugins/MirandaG15/src/StdAfx.h index 42620aaa32..632b5288fe 100644 --- a/plugins/MirandaG15/src/StdAfx.h +++ b/plugins/MirandaG15/src/StdAfx.h @@ -37,9 +37,7 @@ using namespace std; struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(nullptr)
- {}
+ CMPlugin();
};
#include "LCDFramework/LCDFramework.h"
diff --git a/plugins/MobileState/src/main.cpp b/plugins/MobileState/src/main.cpp index ebb2f68ea1..b5907f121b 100644 --- a/plugins/MobileState/src/main.cpp +++ b/plugins/MobileState/src/main.cpp @@ -31,7 +31,7 @@ static IconItem iconList[] = /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo = {
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -44,9 +44,13 @@ PLUGININFOEX pluginInfo = { { 0xf0ba32d0, 0xcd07, 0x4a9c, { 0x92, 0x6b, 0x5a, 0x1f, 0xf2, 0x1c, 0x3c, 0x10 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -108,7 +112,7 @@ static int onModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged);
diff --git a/plugins/MobileState/src/stdafx.h b/plugins/MobileState/src/stdafx.h index 0c59a5a1bd..cf9ac60eb9 100644 --- a/plugins/MobileState/src/stdafx.h +++ b/plugins/MobileState/src/stdafx.h @@ -39,7 +39,5 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {}
+ CMPlugin();
};
diff --git a/plugins/MsgPopup/src/main.cpp b/plugins/MsgPopup/src/main.cpp index 8fb334466f..aca431fc09 100644 --- a/plugins/MsgPopup/src/main.cpp +++ b/plugins/MsgPopup/src/main.cpp @@ -36,7 +36,7 @@ MSGBOXOPTIONS options; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -50,9 +50,13 @@ PLUGININFOEX pluginInfo = {0xcf25d645, 0x4dab, 0x4b0a, {0xb9, 0xf1, 0xde, 0x1e, 0x86, 0x23, 0x1f, 0x9b}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -211,19 +215,19 @@ void LoadConfig() mir_snprintf(szNameFG, "FG%d", indx);
mir_snprintf(szNameBG, "BG%d", indx);
mir_snprintf(szNameTO, "TO%d", indx);
- options.FG[indx] = db_get_dw(NULL, SERVICENAME, szNameFG, optionsDefault.FG[indx]);
- options.BG[indx] = db_get_dw(NULL, SERVICENAME, szNameBG, optionsDefault.BG[indx]);
- options.Timeout[indx] = db_get_dw(NULL, SERVICENAME, szNameTO, (DWORD)optionsDefault.Timeout[indx]);
+ options.FG[indx] = db_get_dw(NULL, MODULENAME, szNameFG, optionsDefault.FG[indx]);
+ options.BG[indx] = db_get_dw(NULL, MODULENAME, szNameBG, optionsDefault.BG[indx]);
+ options.Timeout[indx] = db_get_dw(NULL, MODULENAME, szNameTO, (DWORD)optionsDefault.Timeout[indx]);
}
- options.Sound = db_get_b(NULL, SERVICENAME, "Sound", (DWORD)optionsDefault.Sound);
+ options.Sound = db_get_b(NULL, MODULENAME, "Sound", (DWORD)optionsDefault.Sound);
}
/////////////////////////////////////////////////////////////////////////////////////////
extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
HookEvent(ME_SYSTEM_MODULESLOADED, HookedInit);
HookEvent(ME_OPT_INITIALISE, HookedOptions);
diff --git a/plugins/MsgPopup/src/options.cpp b/plugins/MsgPopup/src/options.cpp index b8883e91db..672385c66c 100644 --- a/plugins/MsgPopup/src/options.cpp +++ b/plugins/MsgPopup/src/options.cpp @@ -54,10 +54,10 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l case WM_COMMAND:
if (LOWORD(wParam) == IDC_PREVIEW) {
- MessageBox(nullptr, TranslateT("Message with question"), TranslateW(_A2W(SERVICENAME) L" - demo"), MB_ICONQUESTION);
- MessageBox(nullptr, TranslateT("Message with exclamation"), TranslateW(_A2W(SERVICENAME) L" - demo"), MB_ICONEXCLAMATION);
- MessageBox(nullptr, TranslateT("Message with error"), TranslateW(_A2W(SERVICENAME) L" - demo"), MB_ICONSTOP);
- MessageBox(nullptr, TranslateT("Message with asterisk"), TranslateW(_A2W(SERVICENAME) L" - demo"), MB_ICONASTERISK);
+ MessageBox(nullptr, TranslateT("Message with question"), TranslateW(_A2W(MODULENAME) L" - demo"), MB_ICONQUESTION);
+ MessageBox(nullptr, TranslateT("Message with exclamation"), TranslateW(_A2W(MODULENAME) L" - demo"), MB_ICONEXCLAMATION);
+ MessageBox(nullptr, TranslateT("Message with error"), TranslateW(_A2W(MODULENAME) L" - demo"), MB_ICONSTOP);
+ MessageBox(nullptr, TranslateT("Message with asterisk"), TranslateW(_A2W(MODULENAME) L" - demo"), MB_ICONASTERISK);
return FALSE;
}
@@ -103,11 +103,11 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l mir_snprintf(szNameBG, "BG%d", indx);
mir_snprintf(szNameTO, "TO%d", indx);
- DBWriteContactSettingDwordDef(NULL, SERVICENAME, szNameFG, options.FG[indx], optionsDefault.FG[indx]);
- DBWriteContactSettingDwordDef(NULL, SERVICENAME, szNameBG, options.BG[indx], optionsDefault.BG[indx]);
- DBWriteContactSettingDwordDef(NULL, SERVICENAME, szNameTO, options.Timeout[indx], (DWORD)optionsDefault.Timeout[indx]);
+ DBWriteContactSettingDwordDef(NULL, MODULENAME, szNameFG, options.FG[indx], optionsDefault.FG[indx]);
+ DBWriteContactSettingDwordDef(NULL, MODULENAME, szNameBG, options.BG[indx], optionsDefault.BG[indx]);
+ DBWriteContactSettingDwordDef(NULL, MODULENAME, szNameTO, options.Timeout[indx], (DWORD)optionsDefault.Timeout[indx]);
}
- DBWriteContactSettingDwordDef(NULL, SERVICENAME, "Sound", options.Sound, optionsDefault.Sound);
+ DBWriteContactSettingDwordDef(NULL, MODULENAME, "Sound", options.Sound, optionsDefault.Sound);
break;
}
diff --git a/plugins/MsgPopup/src/stdafx.h b/plugins/MsgPopup/src/stdafx.h index c235239788..eeac5fc31d 100644 --- a/plugins/MsgPopup/src/stdafx.h +++ b/plugins/MsgPopup/src/stdafx.h @@ -37,13 +37,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "resource.h"
#include "version.h"
-#define SERVICENAME "MessagePopup"
+#define MODULENAME "MessagePopup"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(SERVICENAME)
- {}
+ CMPlugin();
};
struct MSGBOXOPTIONS
diff --git a/plugins/Msg_Export/src/FileViewer.cpp b/plugins/Msg_Export/src/FileViewer.cpp index 074a89672c..03acddac16 100755 --- a/plugins/Msg_Export/src/FileViewer.cpp +++ b/plugins/Msg_Export/src/FileViewer.cpp @@ -906,13 +906,13 @@ void SetRichEditFont(HWND hRichEdit, bool bUseSyntaxHL) CHARFORMAT ncf = { 0 };
ncf.cbSize = sizeof(CHARFORMAT);
ncf.dwMask = CFM_BOLD | CFM_FACE | CFM_ITALIC | CFM_SIZE | CFM_UNDERLINE;
- ncf.dwEffects = db_get_dw(NULL, MODULE, szFileViewDB "TEffects", 0);
- ncf.yHeight = db_get_dw(NULL, MODULE, szFileViewDB "THeight", 165);
- wcsncpy_s(ncf.szFaceName, _DBGetString(NULL, MODULE, szFileViewDB "TFace", L"Courier New").c_str(), _TRUNCATE);
+ ncf.dwEffects = db_get_dw(NULL, MODULENAME, szFileViewDB "TEffects", 0);
+ ncf.yHeight = db_get_dw(NULL, MODULENAME, szFileViewDB "THeight", 165);
+ wcsncpy_s(ncf.szFaceName, _DBGetString(NULL, MODULENAME, szFileViewDB "TFace", L"Courier New").c_str(), _TRUNCATE);
if (!bUseSyntaxHL) {
ncf.dwMask |= CFM_COLOR;
- ncf.crTextColor = db_get_dw(NULL, MODULE, szFileViewDB "TColor", 0);
+ ncf.crTextColor = db_get_dw(NULL, MODULENAME, szFileViewDB "TColor", 0);
}
SendMessage(hRichEdit, EM_SETCHARFORMAT, (WPARAM)SCF_ALL, (LPARAM)&ncf);
@@ -956,22 +956,22 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam, InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION, ID_FV_SAVE_AS_RTF, LPGENW("Save as RTF"));
InsertMenu(hSysMenu, 0, MF_SEPARATOR | MF_BYPOSITION, 0, nullptr);
- BYTE bUseCC = (BYTE)db_get_b(NULL, MODULE, szFileViewDB "UseCC", 0);
+ BYTE bUseCC = (BYTE)db_get_b(NULL, MODULENAME, szFileViewDB "UseCC", 0);
InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION | (bUseCC ? MF_CHECKED : 0), ID_FV_COLOR, LPGENW("Color..."));
if (bUseCC)
- SendMessage(hRichEdit, EM_SETBKGNDCOLOR, 0, db_get_dw(NULL, MODULE, szFileViewDB "CustomC", RGB(255, 255, 255)));
+ SendMessage(hRichEdit, EM_SETBKGNDCOLOR, 0, db_get_dw(NULL, MODULENAME, szFileViewDB "CustomC", RGB(255, 255, 255)));
InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION, ID_FV_FONT, LPGENW("Font..."));
- bool bUseSyntaxHL = db_get_b(NULL, MODULE, szFileViewDB "UseSyntaxHL", 1) != 0;
+ bool bUseSyntaxHL = db_get_b(NULL, MODULENAME, szFileViewDB "UseSyntaxHL", 1) != 0;
InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION | (bUseSyntaxHL ? MF_CHECKED : 0), ID_FV_SYNTAX_HL, LPGENW("Syntax highlight"));
SetRichEditFont(hRichEdit, bUseSyntaxHL);
TranslateDialogDefault(hwndDlg);
- Utils_RestoreWindowPosition(hwndDlg, pclDlg->hContact, MODULE, szFileViewDB);
+ Utils_RestoreWindowPosition(hwndDlg, pclDlg->hContact, MODULENAME, szFileViewDB);
pclDlg->sPath = GetFilePathFromUser(pclDlg->hContact);
@@ -1016,7 +1016,7 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam, return 0;
case WM_DESTROY:
- Utils_SaveWindowPosition(hwndDlg, pclDlg->hContact, MODULE, szFileViewDB);
+ Utils_SaveWindowPosition(hwndDlg, pclDlg->hContact, MODULENAME, szFileViewDB);
WindowList_Remove(hInternalWindowList, hwndDlg);
return 0;
@@ -1030,18 +1030,18 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam, LOGFONT lf = { 0 };
lf.lfHeight = 14L;
- DWORD dwEffects = db_get_dw(NULL, MODULE, szFileViewDB "TEffects", 0);
+ DWORD dwEffects = db_get_dw(NULL, MODULENAME, szFileViewDB "TEffects", 0);
lf.lfWeight = (dwEffects & CFE_BOLD) ? FW_BOLD : 0;
lf.lfUnderline = (dwEffects & CFE_UNDERLINE) != 0;
lf.lfStrikeOut = (dwEffects & CFE_STRIKEOUT) != 0;
lf.lfItalic = (dwEffects & CFE_ITALIC) != 0;
- wcsncpy_s(lf.lfFaceName, _DBGetString(NULL, MODULE, szFileViewDB "TFace", L"Courier New").c_str(), _TRUNCATE);
+ wcsncpy_s(lf.lfFaceName, _DBGetString(NULL, MODULENAME, szFileViewDB "TFace", L"Courier New").c_str(), _TRUNCATE);
CHOOSEFONT cf = { 0 };
cf.lStructSize = sizeof(cf);
cf.hwndOwner = hwndDlg;
cf.lpLogFont = &lf;
- cf.rgbColors = db_get_dw(NULL, MODULE, szFileViewDB "TColor", 0);
+ cf.rgbColors = db_get_dw(NULL, MODULENAME, szFileViewDB "TColor", 0);
cf.Flags = CF_EFFECTS | CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT;
if (ChooseFont(&cf)) {
@@ -1050,27 +1050,27 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam, (lf.lfStrikeOut ? CFE_STRIKEOUT : 0) |
(lf.lfUnderline ? CFE_UNDERLINE : 0);
- db_set_dw(NULL, MODULE, szFileViewDB "TEffects", dwEffects);
- db_set_dw(NULL, MODULE, szFileViewDB "THeight", cf.iPointSize * 2);
- db_set_dw(NULL, MODULE, szFileViewDB "TColor", cf.rgbColors);
- db_set_ws(NULL, MODULE, szFileViewDB "TFace", lf.lfFaceName);
+ db_set_dw(NULL, MODULENAME, szFileViewDB "TEffects", dwEffects);
+ db_set_dw(NULL, MODULENAME, szFileViewDB "THeight", cf.iPointSize * 2);
+ db_set_dw(NULL, MODULENAME, szFileViewDB "TColor", cf.rgbColors);
+ db_set_ws(NULL, MODULENAME, szFileViewDB "TFace", lf.lfFaceName);
SetRichEditFont(hRichEdit, bUseSyntaxHL);
}
return TRUE;
}
if ((wParam & 0xFFF0) == ID_FV_COLOR) {
- BYTE bUseCC = !db_get_b(NULL, MODULE, szFileViewDB "UseCC", 0);
+ BYTE bUseCC = !db_get_b(NULL, MODULENAME, szFileViewDB "UseCC", 0);
if (bUseCC) {
CHOOSECOLOR cc = { 0 };
cc.lStructSize = sizeof(cc);
cc.hwndOwner = hwndDlg;
- cc.rgbResult = db_get_dw(NULL, MODULE, szFileViewDB "CustomC", RGB(255, 255, 255));
+ cc.rgbResult = db_get_dw(NULL, MODULENAME, szFileViewDB "CustomC", RGB(255, 255, 255));
cc.Flags = CC_ANYCOLOR | CC_FULLOPEN | CC_RGBINIT;
static COLORREF MyCustColors[16] = { 0xFFFFFFFF };
cc.lpCustColors = MyCustColors;
if (ChooseColor(&cc)) {
SendMessage(hRichEdit, EM_SETBKGNDCOLOR, 0, cc.rgbResult);
- db_set_dw(NULL, MODULE, szFileViewDB "CustomC", cc.rgbResult);
+ db_set_dw(NULL, MODULENAME, szFileViewDB "CustomC", cc.rgbResult);
}
else {
CommDlgExtendedError();
@@ -1080,7 +1080,7 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam, else SendMessage(hRichEdit, EM_SETBKGNDCOLOR, TRUE, 0);
CheckMenuItem(hSysMenu, ID_FV_COLOR, MF_BYCOMMAND | (bUseCC ? MF_CHECKED : 0));
- db_set_b(NULL, MODULE, szFileViewDB "UseCC", bUseCC);
+ db_set_b(NULL, MODULENAME, szFileViewDB "UseCC", bUseCC);
return TRUE;
}
if ((wParam & 0xFFF0) == ID_FV_SYNTAX_HL) {
@@ -1091,7 +1091,7 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam, bUseSyntaxHL = !bUseSyntaxHL;
CheckMenuItem(hSysMenu, ID_FV_SYNTAX_HL, MF_BYCOMMAND | (bUseSyntaxHL ? MF_CHECKED : 0));
- db_set_b(NULL, MODULE, szFileViewDB "UseSyntaxHL", bUseSyntaxHL);
+ db_set_b(NULL, MODULENAME, szFileViewDB "UseSyntaxHL", bUseSyntaxHL);
if (bUseSyntaxHL)
bLoadFile(hwndDlg, pclDlg);
diff --git a/plugins/Msg_Export/src/main.cpp b/plugins/Msg_Export/src/main.cpp index 393184075b..f8b790e976 100755 --- a/plugins/Msg_Export/src/main.cpp +++ b/plugins/Msg_Export/src/main.cpp @@ -27,7 +27,7 @@ MWindowList hInternalWindowList = nullptr; // Remember to update the Version in the resource !!!
/////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo = {
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -40,9 +40,13 @@ PLUGININFOEX pluginInfo = { { 0x46102b07, 0xc215, 0x4162, { 0x9c, 0x83, 0xd3, 0x77, 0x88, 0x1d, 0xa7, 0xcc } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////
@@ -141,29 +145,29 @@ int MainInit(WPARAM /*wparam*/, LPARAM /*lparam*/) extern "C" __declspec(dllexport) int Load()
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
HookEvent(ME_SYSTEM_MODULESLOADED, MainInit);
- nMaxLineWidth = db_get_w(NULL, MODULE, "MaxLineWidth", nMaxLineWidth);
+ nMaxLineWidth = db_get_w(NULL, MODULENAME, "MaxLineWidth", nMaxLineWidth);
if (nMaxLineWidth > 0 && nMaxLineWidth < 5)
nMaxLineWidth = 5;
- sExportDir = _DBGetString(NULL, MODULE, "ExportDir", L"%dbpath%\\MsgExport\\");
- sDefaultFile = _DBGetString(NULL, MODULE, "DefaultFile", L"%nick%.txt");
+ sExportDir = _DBGetString(NULL, MODULENAME, "ExportDir", L"%dbpath%\\MsgExport\\");
+ sDefaultFile = _DBGetString(NULL, MODULENAME, "DefaultFile", L"%nick%.txt");
- sTimeFormat = _DBGetString(NULL, MODULE, "TimeFormat", L"d s");
+ sTimeFormat = _DBGetString(NULL, MODULENAME, "TimeFormat", L"d s");
- sFileViewerPrg = _DBGetString(NULL, MODULE, "FileViewerPrg", L"");
- bUseInternalViewer(db_get_b(NULL, MODULE, "UseInternalViewer", bUseInternalViewer()) != 0);
+ sFileViewerPrg = _DBGetString(NULL, MODULENAME, "FileViewerPrg", L"");
+ bUseInternalViewer(db_get_b(NULL, MODULENAME, "UseInternalViewer", bUseInternalViewer()) != 0);
- bReplaceHistory = db_get_b(NULL, MODULE, "ReplaceHistory", bReplaceHistory) != 0;
- bAppendNewLine = db_get_b(NULL, MODULE, "AppendNewLine", bAppendNewLine) != 0;
- bUseUtf8InNewFiles = db_get_b(NULL, MODULE, "UseUtf8InNewFiles", bUseUtf8InNewFiles) != 0;
- bUseLessAndGreaterInExport = db_get_b(NULL, MODULE, "UseLessAndGreaterInExport", bUseLessAndGreaterInExport) != 0;
+ bReplaceHistory = db_get_b(NULL, MODULENAME, "ReplaceHistory", bReplaceHistory) != 0;
+ bAppendNewLine = db_get_b(NULL, MODULENAME, "AppendNewLine", bAppendNewLine) != 0;
+ bUseUtf8InNewFiles = db_get_b(NULL, MODULENAME, "UseUtf8InNewFiles", bUseUtf8InNewFiles) != 0;
+ bUseLessAndGreaterInExport = db_get_b(NULL, MODULENAME, "UseLessAndGreaterInExport", bUseLessAndGreaterInExport) != 0;
- enRenameAction = (ENDialogAction)db_get_b(NULL, MODULE, "RenameAction", enRenameAction);
- enDeleteAction = (ENDialogAction)db_get_b(NULL, MODULE, "DeleteAction", enDeleteAction);
+ enRenameAction = (ENDialogAction)db_get_b(NULL, MODULENAME, "RenameAction", enRenameAction);
+ enDeleteAction = (ENDialogAction)db_get_b(NULL, MODULENAME, "DeleteAction", enDeleteAction);
HANDLE hServiceFunc = nullptr;
if (bReplaceHistory)
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index d593c7f2e9..f51b662ab7 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -409,14 +409,14 @@ BOOL bApplyChanges(HWND hwndDlg) if (ListView_GetItem(hMapUser, &sItem)) {
MCONTACT hUser = (MCONTACT)sItem.lParam;
if (mir_wstrlen(szTemp) > 0)
- db_set_ws(hUser, MODULE, "FileName", szTemp);
+ db_set_ws(hUser, MODULENAME, "FileName", szTemp);
else
- db_unset(hUser, MODULE, "FileName");
+ db_unset(hUser, MODULENAME, "FileName");
if (sItem.iImage)
- db_unset(hUser, MODULE, "EnableLog"); // default is Enabled !!
+ db_unset(hUser, MODULENAME, "EnableLog"); // default is Enabled !!
else
- db_set_b(hUser, MODULE, "EnableLog", 0);
+ db_set_b(hUser, MODULENAME, "EnableLog", 0);
}
}
UpdateFileToColWidth();
@@ -632,10 +632,10 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar sItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
sItem.iItem = nUser++;
sItem.iSubItem = 0;
- sItem.iImage = db_get_b(hContact, MODULE, "EnableLog", 1);
+ sItem.iImage = db_get_b(hContact, MODULENAME, "EnableLog", 1);
sItem.lParam = hContact;
- sTmp = _DBGetString(hContact, MODULE, "FileName", L"");
+ sTmp = _DBGetString(hContact, MODULENAME, "FileName", L"");
sItem.pszText = (wchar_t*)sTmp.c_str();
ListView_InsertItem(hMapUser, &sItem);
@@ -1053,9 +1053,9 @@ BOOL bApplyChanges2(HWND hwndDlg) sItem.cchTextMax = (_countof(szTemp) - 15);
if (::SendMessage(hMapUser, LVM_GETITEMA, 0, (LPARAM)&sItem)) {
if (sItem.iImage)
- db_unset(NULL, MODULE, szTemp); // default is Enabled !!
+ db_unset(NULL, MODULENAME, szTemp); // default is Enabled !!
else
- db_set_b(NULL, MODULE, szTemp, 0);
+ db_set_b(NULL, MODULENAME, szTemp, 0);
}
}
SaveSettings();
@@ -1139,7 +1139,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts2(HWND hwndDlg, UINT msg, WPARAM wPa for (auto &pa : Accounts()) {
mir_snprintf(szTemp, "DisableProt_%s", pa->szModuleName);
sItem.pszText = pa->szModuleName;
- sItem.iImage = db_get_b(NULL, MODULE, szTemp, 1);
+ sItem.iImage = db_get_b(NULL, MODULENAME, szTemp, 1);
::SendMessage(hMapUser, LVM_INSERTITEMA, 0, (LPARAM)&sItem);
sItem.iItem++;
}
diff --git a/plugins/Msg_Export/src/stdafx.h b/plugins/Msg_Export/src/stdafx.h index 29ba199b25..9b49eebf9f 100755 --- a/plugins/Msg_Export/src/stdafx.h +++ b/plugins/Msg_Export/src/stdafx.h @@ -48,7 +48,7 @@ using namespace std; #include "resource.h"
#include "version.h"
-#define MODULE "Msg_Export"
+#define MODULENAME "Msg_Export"
#define MSG_BOX_TITEL TranslateT("Miranda NG (Message Export Plugin)")
#define MS_SHOW_EXPORT_HISTORY "History/ShowExportHistory"
#define szFileViewDB "FileV_"
@@ -56,9 +56,7 @@ using namespace std; struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE)
- {}
+ CMPlugin();
};
extern MWindowList hInternalWindowList;
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index 6112c82631..1ab91a64c9 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -518,7 +518,7 @@ void ReplaceDBPath(tstring &sRet) tstring GetFilePathFromUser(MCONTACT hContact)
{
- tstring sFilePath = sExportDir + _DBGetString(hContact, MODULE, "FileName", sDefaultFile.c_str());
+ tstring sFilePath = sExportDir + _DBGetString(hContact, MODULENAME, "FileName", sDefaultFile.c_str());
bool bNickUsed = sFilePath.find(L"%nick%") != string::npos;
@@ -530,7 +530,7 @@ tstring GetFilePathFromUser(MCONTACT hContact) ReplaceDBPath(sFilePath);
// Previous file name check to see if it has changed !!
- tstring sPrevFileName = _DBGetString(hContact, MODULE, "PrevFileName", L"");
+ tstring sPrevFileName = _DBGetString(hContact, MODULENAME, "PrevFileName", L"");
if (sNoDBPath != sPrevFileName) {
if (!sPrevFileName.empty()) {
ReplaceDBPath(sPrevFileName);
@@ -596,7 +596,7 @@ tstring GetFilePathFromUser(MCONTACT hContact) }
// Store the Filename used so that we can check if it changes.
- db_set_ws(hContact, MODULE, "PrevFileName", sNoDBPath.c_str());
+ db_set_ws(hContact, MODULENAME, "PrevFileName", sNoDBPath.c_str());
}
return sFilePath;
@@ -1209,13 +1209,13 @@ HANDLE openCreateFile(tstring sFilePath) bool bIsExportEnabled(MCONTACT hContact)
{
- if (!db_get_b(hContact, MODULE, "EnableLog", 1))
+ if (!db_get_b(hContact, MODULENAME, "EnableLog", 1))
return false;
const char *szProto = GetContactProto(hContact);
char szTemp[500];
mir_snprintf(szTemp, "DisableProt_%s", szProto);
- if (!db_get_b(NULL, MODULE, szTemp, 1))
+ if (!db_get_b(NULL, MODULENAME, szTemp, 1))
return false;
return true;
@@ -1445,20 +1445,20 @@ int nContactDeleted(WPARAM wparam, LPARAM /*lparam*/) void SaveSettings()
{
- db_set_w(NULL, MODULE, "MaxLineWidth", (WORD)nMaxLineWidth);
- db_set_ws(NULL, MODULE, "ExportDir", sExportDir.c_str());
- db_set_ws(NULL, MODULE, "DefaultFile", sDefaultFile.c_str());
- db_set_ws(NULL, MODULE, "TimeFormat", sTimeFormat.c_str());
-
- db_set_ws(NULL, MODULE, "FileViewerPrg", sFileViewerPrg.c_str());
- db_set_b(NULL, MODULE, "UseInternalViewer", bUseInternalViewer());
- db_set_b(NULL, MODULE, "ReplaceHistory", bReplaceHistory);
- db_set_b(NULL, MODULE, "AppendNewLine", bAppendNewLine);
- db_set_b(NULL, MODULE, "UseUtf8InNewFiles", bUseUtf8InNewFiles);
- db_set_b(NULL, MODULE, "UseLessAndGreaterInExport", bUseLessAndGreaterInExport);
-
- db_set_b(NULL, MODULE, "RenameAction", (BYTE)enRenameAction);
- db_set_b(NULL, MODULE, "DeleteAction", (BYTE)enDeleteAction);
+ db_set_w(NULL, MODULENAME, "MaxLineWidth", (WORD)nMaxLineWidth);
+ db_set_ws(NULL, MODULENAME, "ExportDir", sExportDir.c_str());
+ db_set_ws(NULL, MODULENAME, "DefaultFile", sDefaultFile.c_str());
+ db_set_ws(NULL, MODULENAME, "TimeFormat", sTimeFormat.c_str());
+
+ db_set_ws(NULL, MODULENAME, "FileViewerPrg", sFileViewerPrg.c_str());
+ db_set_b(NULL, MODULENAME, "UseInternalViewer", bUseInternalViewer());
+ db_set_b(NULL, MODULENAME, "ReplaceHistory", bReplaceHistory);
+ db_set_b(NULL, MODULENAME, "AppendNewLine", bAppendNewLine);
+ db_set_b(NULL, MODULENAME, "UseUtf8InNewFiles", bUseUtf8InNewFiles);
+ db_set_b(NULL, MODULENAME, "UseLessAndGreaterInExport", bUseLessAndGreaterInExport);
+
+ db_set_b(NULL, MODULENAME, "RenameAction", (BYTE)enRenameAction);
+ db_set_b(NULL, MODULENAME, "DeleteAction", (BYTE)enDeleteAction);
}
/////////////////////////////////////////////////////////////////////
diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp index 813041948d..00928f4c71 100644 --- a/plugins/MyDetails/src/data.cpp +++ b/plugins/MyDetails/src/data.cpp @@ -442,7 +442,7 @@ void ProtocolArray::SetNicks(const wchar_t *nick) mir_wstrncpy(default_nick, nick, _countof(default_nick));
- db_set_ws(0, MODULE_NAME, SETTING_DEFAULT_NICK, nick);
+ db_set_ws(0, MODULENAME, SETTING_DEFAULT_NICK, nick);
for (int i = 0; i < buffer_len; i++)
buffer[i]->SetNick(default_nick);
@@ -475,7 +475,7 @@ void ProtocolArray::SetStatusMsgs(int status, const wchar_t *message) void ProtocolArray::GetDefaultNick()
{
- ptrW tszNick(db_get_wsa(0, MODULE_NAME, SETTING_DEFAULT_NICK));
+ ptrW tszNick(db_get_wsa(0, MODULENAME, SETTING_DEFAULT_NICK));
if (tszNick)
mir_wstrncpy(default_nick, tszNick, _countof(default_nick));
else
diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index fffd5399ee..4664af7a7a 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -74,8 +74,8 @@ BYTE font_styles[] = { DBFONTF_BOLD, 0, 0, DBFONTF_ITALIC, DBFONTF_ITALIC }; COLORREF font_colors[] = { RGB(0, 0, 0), RGB(0, 0, 0), RGB(0, 0, 0), RGB(150, 150, 150), RGB(150, 150, 150) };
static ColourID
-bg_colour = { sizeof(bg_colour), LPGEN("My details"), LPGEN("Background"), MODULE_NAME, "BackgroundColor", 0, GetSysColor(COLOR_BTNFACE) },
-av_colour = { sizeof(av_colour), LPGEN("My details"), LPGEN("Avatar border"), MODULE_NAME, "AvatarBorderColor", 0, RGB(0, 0, 0) };
+bg_colour = { sizeof(bg_colour), LPGEN("My details"), LPGEN("Background"), MODULENAME, "BackgroundColor", 0, GetSysColor(COLOR_BTNFACE) },
+av_colour = { sizeof(av_colour), LPGEN("My details"), LPGEN("Avatar border"), MODULENAME, "AvatarBorderColor", 0, RGB(0, 0, 0) };
int CreateFrame();
void FixMainMenu();
@@ -236,7 +236,7 @@ int CreateFrame() font_id[i].cbSize = sizeof(FontIDW);
mir_wstrncpy(font_id[i].group, LPGENW("My details"), _countof(font_id[i].group));
mir_wstrncpy(font_id[i].name, font_names[i], _countof(font_id[i].name));
- mir_strncpy(font_id[i].dbSettingsGroup, MODULE_NAME, _countof(font_id[i].dbSettingsGroup));
+ mir_strncpy(font_id[i].dbSettingsGroup, MODULENAME, _countof(font_id[i].dbSettingsGroup));
mir_wstrncpy(font_id[i].backgroundName, LPGENW("Background"), _countof(font_id[i].backgroundName));
mir_wstrncpy(font_id[i].backgroundGroup, LPGENW("My details"), _countof(font_id[i].backgroundGroup));
@@ -336,11 +336,11 @@ int CreateFrame() mi.position = 1;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_USERDETAILS);
mi.name.w = LPGENW("Show my details");
- mi.pszService = MODULE_NAME"/ShowHideMyDetails";
+ mi.pszService = MODULENAME"/ShowHideMyDetails";
hMenuShowHideFrame = Menu_AddMainMenuItem(&mi);
Menu_ConfigureItem(hMenuShowHideFrame, MCI_OPT_EXECPARAM, -0x7FFFFFFF);
- if (db_get_b(0, MODULE_NAME, SETTING_FRAME_VISIBLE, 1) == 1) {
+ if (db_get_b(0, MODULENAME, SETTING_FRAME_VISIBLE, 1) == 1) {
ShowWindow(hwnd_container, SW_SHOW);
FixMainMenu();
}
@@ -365,9 +365,9 @@ LRESULT CALLBACK FrameContainerWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LP switch (msg) {
case WM_SHOWWINDOW:
if ((BOOL)wParam)
- Utils_RestoreWindowPosition(hwnd, 0, MODULE_NAME, WINDOW_NAME_PREFIX);
+ Utils_RestoreWindowPosition(hwnd, 0, MODULENAME, WINDOW_NAME_PREFIX);
else
- Utils_SaveWindowPosition(hwnd, 0, MODULE_NAME, WINDOW_NAME_PREFIX);
+ Utils_SaveWindowPosition(hwnd, 0, MODULENAME, WINDOW_NAME_PREFIX);
break;
case WM_ERASEBKGND:
@@ -386,7 +386,7 @@ LRESULT CALLBACK FrameContainerWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LP return TRUE;
case WM_CLOSE:
- db_set_b(0, MODULE_NAME, SETTING_FRAME_VISIBLE, 0);
+ db_set_b(0, MODULENAME, SETTING_FRAME_VISIBLE, 0);
ShowWindow(hwnd, SW_HIDE);
FixMainMenu();
return TRUE;
@@ -2186,7 +2186,7 @@ INT_PTR ShowHideFrameFunc(WPARAM, LPARAM) SendMessage(hwnd_container, WM_CLOSE, 0, 0);
else {
ShowWindow(hwnd_container, SW_SHOW);
- db_set_b(0, MODULE_NAME, SETTING_FRAME_VISIBLE, 1);
+ db_set_b(0, MODULENAME, SETTING_FRAME_VISIBLE, 1);
}
FixMainMenu();
@@ -2204,7 +2204,7 @@ INT_PTR ShowFrameFunc(WPARAM, LPARAM) else {
if (!MyDetailsFrameVisible()) {
ShowWindow(hwnd_container, SW_SHOW);
- db_set_b(0, MODULE_NAME, SETTING_FRAME_VISIBLE, 1);
+ db_set_b(0, MODULENAME, SETTING_FRAME_VISIBLE, 1);
FixMainMenu();
}
diff --git a/plugins/MyDetails/src/mydetails.cpp b/plugins/MyDetails/src/mydetails.cpp index 555a623f91..993499c4e9 100644 --- a/plugins/MyDetails/src/mydetails.cpp +++ b/plugins/MyDetails/src/mydetails.cpp @@ -34,7 +34,7 @@ static IconItem iconList[] = // Plugin data ////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo = {
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -47,9 +47,13 @@ PLUGININFOEX pluginInfo = { { 0xa82baeb3, 0xa33c, 0x4036, { 0xb8, 0x37, 0x78, 0x3, 0xa5, 0xb6, 0xc2, 0xab } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
// Services ///////////////////////////////////////////////////////////////////////////////////////
@@ -134,7 +138,7 @@ static int MainUninit(WPARAM, LPARAM) extern "C" __declspec(dllexport) int Load()
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
// Hook event to load messages and show first one
diff --git a/plugins/MyDetails/src/options.cpp b/plugins/MyDetails/src/options.cpp index 67ad87d1f7..827a598056 100644 --- a/plugins/MyDetails/src/options.cpp +++ b/plugins/MyDetails/src/options.cpp @@ -60,7 +60,7 @@ static OptPageControl pageControls[] = { // Initializations needed by options
void LoadOptions()
{
- LoadOpts(pageControls, _countof(pageControls), MODULE_NAME);
+ LoadOpts(pageControls, _countof(pageControls), MODULENAME);
// This is created here to assert that this key always exists
opts.refresh_status_message_timer = db_get_w(NULL, "MyDetails", "RefreshStatusMessageTimer", 12);
@@ -72,7 +72,7 @@ void LoadOptions() static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- BOOL ret = SaveOptsDlgProc(pageControls, _countof(pageControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
+ BOOL ret = SaveOptsDlgProc(pageControls, _countof(pageControls), MODULENAME, hwndDlg, msg, wParam, lParam);
switch (msg) {
case WM_INITDIALOG:
diff --git a/plugins/MyDetails/src/stdafx.h b/plugins/MyDetails/src/stdafx.h index 9383f39392..091cd05e56 100644 --- a/plugins/MyDetails/src/stdafx.h +++ b/plugins/MyDetails/src/stdafx.h @@ -58,16 +58,14 @@ Boston, MA 02111-1307, USA. #include "options.h"
#include "frame.h"
-#define MODULE_NAME "MyDetails"
+#define MODULENAME "MyDetails"
#define SETTING_FRAME_VISIBLE "FrameVisible"
#define SETTING_DEFAULT_NICK "DefaultNick"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE_NAME)
- {}
+ CMPlugin();
};
extern bool g_bFramesExist, g_bAvsExist;
diff --git a/plugins/NewAwaySysMod/src/AwayOpt.cpp b/plugins/NewAwaySysMod/src/AwayOpt.cpp index 731a5de605..be2996772e 100644 --- a/plugins/NewAwaySysMod/src/AwayOpt.cpp +++ b/plugins/NewAwaySysMod/src/AwayOpt.cpp @@ -64,7 +64,7 @@ void MySetPos(HWND hwndParent) // ================================================ Message options ================================================
-COptPage g_MessagesOptPage(MOD_NAME, nullptr);
+COptPage g_MessagesOptPage(MODULENAME, nullptr);
void EnableMessagesOptDlgControls(CMsgTree* MsgTree)
{
@@ -326,7 +326,7 @@ static INT_PTR CALLBACK MessagesOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LP // ================================================ Main options ================================================
-COptPage g_MoreOptPage(MOD_NAME, nullptr);
+COptPage g_MoreOptPage(MODULENAME, nullptr);
void EnableMoreOptDlgControls()
{
@@ -446,7 +446,7 @@ static INT_PTR CALLBACK MoreOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM // ================================================ Autoreply options ================================================
-COptPage g_AutoreplyOptPage(MOD_NAME, nullptr);
+COptPage g_AutoreplyOptPage(MODULENAME, nullptr);
void EnableAutoreplyOptDlgControls()
{
@@ -1046,8 +1046,8 @@ int OptsDlgInit(WPARAM wParam, LPARAM) return 0;
}
-COptPage g_SetAwayMsgPage(MOD_NAME, nullptr);
-COptPage g_MsgTreePage(MOD_NAME, nullptr);
+COptPage g_SetAwayMsgPage(MODULENAME, nullptr);
+COptPage g_MsgTreePage(MODULENAME, nullptr);
void InitOptions()
{
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index 6c4afc8c36..1d319a88d0 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -77,7 +77,7 @@ HICON GetIcon(int iconId, bool size) /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -90,9 +90,13 @@ PLUGININFOEX pluginInfo = { 0xb2dd9270, 0xce5e, 0x11df, { 0xbd, 0x3d, 0x8, 0x0, 0x20, 0xc, 0x9a, 0x66 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -146,7 +150,7 @@ int StatusMsgReq(WPARAM wParam, LPARAM lParam, CString &szProto) hFoundContact = INVALID_CONTACT_ID;
else if (iMode >= ID_STATUS_ONLINE && iMode <= ID_STATUS_OUTTOLUNCH)
// don't count xstatus requests
- db_set_w(hFoundContact, MOD_NAME, DB_REQUESTCOUNT, db_get_w(hFoundContact, MOD_NAME, DB_REQUESTCOUNT, 0) + 1);
+ db_set_w(hFoundContact, MODULENAME, DB_REQUESTCOUNT, db_get_w(hFoundContact, MODULENAME, DB_REQUESTCOUNT, 0) + 1);
MCONTACT hContactForSettings = hFoundContact; // used to take into account not-on-list contacts when getting contact settings, but at the same time allows to get correct contact info for contacts that are in the DB
if (hContactForSettings != INVALID_CONTACT_ID && db_get_b(hContactForSettings, "CList", "NotOnList", 0))
@@ -502,11 +506,11 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam) Result = TranslateT("Stranger");
}
else if (!mir_wstrcmp(ai->targv[0], VAR_REQUESTCOUNT)) {
- mir_snwprintf(Result.GetBuffer(16), 16, L"%d", db_get_w(ai->fi->hContact, MOD_NAME, DB_REQUESTCOUNT, 0));
+ mir_snwprintf(Result.GetBuffer(16), 16, L"%d", db_get_w(ai->fi->hContact, MODULENAME, DB_REQUESTCOUNT, 0));
Result.ReleaseBuffer();
}
else if (!mir_wstrcmp(ai->targv[0], VAR_MESSAGENUM)) {
- mir_snwprintf(Result.GetBuffer(16), 16, L"%d", db_get_w(ai->fi->hContact, MOD_NAME, DB_MESSAGECOUNT, 0));
+ mir_snwprintf(Result.GetBuffer(16), 16, L"%d", db_get_w(ai->fi->hContact, MODULENAME, DB_MESSAGECOUNT, 0));
Result.ReleaseBuffer();
}
else if (!mir_wstrcmp(ai->targv[0], VAR_TIMEPASSED)) {
@@ -533,7 +537,7 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam) COptPage MsgTreeData(g_MsgTreePage);
COptItem_TreeCtrl *TreeCtrl = (COptItem_TreeCtrl*)MsgTreeData.Find(IDV_MSGTREE);
- TreeCtrl->DBToMem(CString(MOD_NAME));
+ TreeCtrl->DBToMem(CString(MODULENAME));
for (int i = 0; i < TreeCtrl->m_value.GetSize(); i++) {
if (!(TreeCtrl->m_value[i].Flags & TIF_GROUP) && !mir_wstrcmpi(TreeCtrl->m_value[i].Title, ai->targv[1])) {
@@ -705,27 +709,27 @@ int MirandaLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
HookEvent(ME_SYSTEM_MODULESLOADED, MirandaLoaded);
- g_plugin.registerIcon(MOD_NAME, iconList, "nas");
+ g_plugin.registerIcon(MODULENAME, iconList, "nas");
InitCommonControls();
InitOptions(); // must be called before we hook CallService
- if (db_get_b(NULL, MOD_NAME, DB_SETTINGSVER, 0) < 1) { // change all %nas_message% variables to %extratext% if it wasn't done before
- TCString Str = db_get_s(NULL, MOD_NAME, "PopupsFormat", L"");
+ if (db_get_b(NULL, MODULENAME, DB_SETTINGSVER, 0) < 1) { // change all %nas_message% variables to %extratext% if it wasn't done before
+ TCString Str = db_get_s(NULL, MODULENAME, "PopupsFormat", L"");
if (Str.GetLen())
- db_set_ws(NULL, MOD_NAME, "PopupsFormat", Str.Replace(L"nas_message", L"extratext"));
+ db_set_ws(NULL, MODULENAME, "PopupsFormat", Str.Replace(L"nas_message", L"extratext"));
- Str = db_get_s(NULL, MOD_NAME, "ReplyPrefix", L"");
+ Str = db_get_s(NULL, MODULENAME, "ReplyPrefix", L"");
if (Str.GetLen())
- db_set_ws(NULL, MOD_NAME, "ReplyPrefix", Str.Replace(L"nas_message", L"extratext"));
+ db_set_ws(NULL, MODULENAME, "ReplyPrefix", Str.Replace(L"nas_message", L"extratext"));
}
- if (db_get_b(NULL, MOD_NAME, DB_SETTINGSVER, 0) < 2) { // disable autoreply for not-on-list contacts, as such contact may be a spam bot
- db_set_b(NULL, MOD_NAME, ContactStatusToDBSetting(0, DB_ENABLEREPLY, 0, INVALID_CONTACT_ID), 0);
- db_set_b(NULL, MOD_NAME, DB_SETTINGSVER, 2);
+ if (db_get_b(NULL, MODULENAME, DB_SETTINGSVER, 0) < 2) { // disable autoreply for not-on-list contacts, as such contact may be a spam bot
+ db_set_b(NULL, MODULENAME, ContactStatusToDBSetting(0, DB_ENABLEREPLY, 0, INVALID_CONTACT_ID), 0);
+ db_set_b(NULL, MODULENAME, DB_SETTINGSVER, 2);
}
return 0;
}
diff --git a/plugins/NewAwaySysMod/src/Client.cpp b/plugins/NewAwaySysMod/src/Client.cpp index 975db0e8cd..ab4d62c937 100644 --- a/plugins/NewAwaySysMod/src/Client.cpp +++ b/plugins/NewAwaySysMod/src/Client.cpp @@ -134,7 +134,7 @@ int GetRecentGroupID(int iMode) // COptPage MoreOptData(g_MoreOptPage);
COptPage MsgTreeData(g_MsgTreePage);
COptItem_TreeCtrl *TreeCtrl = (COptItem_TreeCtrl*)MsgTreeData.Find(IDV_MSGTREE);
- TreeCtrl->DBToMem(CString(MOD_NAME));
+ TreeCtrl->DBToMem(CString(MODULENAME));
if (!g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_PERSTATUSMRM))
return g_Messages_RecentRootID;
diff --git a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp index f86c1d6e00..43b596af48 100644 --- a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp +++ b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp @@ -176,7 +176,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam) COptPage AutoreplyOptData(g_AutoreplyOptPage);
AutoreplyOptData.DBToMem();
if (dbei->eventType == EVENTTYPE_MESSAGE)
- db_set_w(hContact, MOD_NAME, DB_MESSAGECOUNT, db_get_w(hContact, MOD_NAME, DB_MESSAGECOUNT, 0) + 1); // increment message counter
+ db_set_w(hContact, MODULENAME, DB_MESSAGECOUNT, db_get_w(hContact, MODULENAME, DB_MESSAGECOUNT, 0) + 1); // increment message counter
if (AutoreplyOptData.GetValue(StatusModeList[i].DisableReplyCtlID))
return 0;
@@ -210,7 +210,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam) int SendCount = (int)AutoreplyOptData.GetValue(IDC_REPLYDLG_SENDCOUNT);
if ((AutoreplyOptData.GetValue(IDC_REPLYDLG_DONTSENDTOICQ) && UIN) || // an icq contact
- (SendCount != -1 && db_get_b(hContact, MOD_NAME, DB_SENDCOUNT, 0) >= SendCount))
+ (SendCount != -1 && db_get_b(hContact, MODULENAME, DB_SENDCOUNT, 0) >= SendCount))
return 0;
if ((dbei->eventType == EVENTTYPE_MESSAGE && !AutoreplyOptData.GetValue(IDC_REPLYDLG_EVENTMSG)) ||
@@ -218,7 +218,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam) (dbei->eventType == EVENTTYPE_FILE && !AutoreplyOptData.GetValue(IDC_REPLYDLG_EVENTFILE)))
return 0;
- db_set_b(hContact, MOD_NAME, DB_SENDCOUNT, db_get_b(hContact, MOD_NAME, DB_SENDCOUNT, 0) + 1);
+ db_set_b(hContact, MODULENAME, DB_SENDCOUNT, db_get_b(hContact, MODULENAME, DB_SENDCOUNT, 0) + 1);
GetDynamicStatMsg(hContact); // it updates VarParseData.Message needed for %extratext% in the format
TCString Reply(*(TCString*)AutoreplyOptData.GetValue(IDC_REPLYDLG_PREFIX));
if (Reply != nullptr && ServiceExists(MS_VARS_FORMATSTRING) && !g_SetAwayMsgPage.GetDBValueCopy(IDS_SAWAYMSG_DISABLEVARIABLES)) {
diff --git a/plugins/NewAwaySysMod/src/Properties.cpp b/plugins/NewAwaySysMod/src/Properties.cpp index 077704fb56..3c570cfe51 100644 --- a/plugins/NewAwaySysMod/src/Properties.cpp +++ b/plugins/NewAwaySysMod/src/Properties.cpp @@ -24,9 +24,9 @@ CProtoStates g_ProtoStates; void ResetContactSettingsOnStatusChange(MCONTACT hContact)
{
- db_unset(hContact, MOD_NAME, DB_REQUESTCOUNT);
- db_unset(hContact, MOD_NAME, DB_SENDCOUNT);
- db_unset(hContact, MOD_NAME, DB_MESSAGECOUNT);
+ db_unset(hContact, MODULENAME, DB_REQUESTCOUNT);
+ db_unset(hContact, MODULENAME, DB_SENDCOUNT);
+ db_unset(hContact, MODULENAME, DB_MESSAGECOUNT);
}
void ResetSettingsOnStatusChange(const char *szProto = nullptr, int bResetPersonalMsgs = false, int Status = 0)
@@ -110,9 +110,9 @@ void CContactSettings::SetMsgFormat(int Flags, TCString Message) ResetContactSettingsOnStatusChange(m_hContact);
if (Message != nullptr)
- db_set_ws(m_hContact, MOD_NAME, DBSetting, Message);
+ db_set_ws(m_hContact, MODULENAME, DBSetting, Message);
else
- db_unset(m_hContact, MOD_NAME, DBSetting);
+ db_unset(m_hContact, MODULENAME, DBSetting);
}
if (Flags & (SMF_LAST | SMF_TEMPORARY)) {
@@ -132,7 +132,7 @@ TCString CContactSettings::GetMsgFormat(int Flags, int *pOrder, char *szProtoOve *pOrder = -1;
if (Flags & GMF_PERSONAL) // try getting personal message (it overrides global)
- Message = db_get_s(m_hContact, MOD_NAME, StatusToDBSetting(Status, DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPERSONAL), (wchar_t*)NULL);
+ Message = db_get_s(m_hContact, MODULENAME, StatusToDBSetting(Status, DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPERSONAL), (wchar_t*)NULL);
if (Flags & (GMF_LASTORDEFAULT | GMF_PROTOORGLOBAL | GMF_TEMPORARY) && Message.IsEmpty()) {
char *szProto = szProtoOverride ? szProtoOverride : (m_hContact ? GetContactProto(m_hContact) : nullptr);
@@ -164,19 +164,19 @@ void CProtoSettings::SetMsgFormat(int Flags, TCString Message) g_ProtoStates[szProto].TempMsg.Unset();
CString DBSetting(ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS));
if (Message != nullptr)
- db_set_ws(NULL, MOD_NAME, DBSetting, Message);
+ db_set_ws(NULL, MODULENAME, DBSetting, Message);
else {
if (!szProto)
- db_set_ws(NULL, MOD_NAME, DBSetting, CProtoSettings(nullptr, Status).GetMsgFormat(GMF_LASTORDEFAULT)); // global message can't be NULL; we can use an empty string instead if it's really necessary
+ db_set_ws(NULL, MODULENAME, DBSetting, CProtoSettings(nullptr, Status).GetMsgFormat(GMF_LASTORDEFAULT)); // global message can't be NULL; we can use an empty string instead if it's really necessary
else
- db_unset(NULL, MOD_NAME, DBSetting);
+ db_unset(NULL, MODULENAME, DBSetting);
}
}
if (Flags & SMF_LAST) {
COptPage MsgTreeData(g_MsgTreePage);
COptItem_TreeCtrl *TreeCtrl = (COptItem_TreeCtrl*)MsgTreeData.Find(IDV_MSGTREE);
- TreeCtrl->DBToMem(CString(MOD_NAME));
+ TreeCtrl->DBToMem(CString(MODULENAME));
int RecentGroupID = GetRecentGroupID(Status);
if (RecentGroupID == -1) { // we didn't find the group, it also means that we're using per status messages; so we need to create it
TreeCtrl->m_value.AddElem(CTreeItem(Status ? Clist_GetStatusModeDescription(Status, 0) : MSGTREE_RECENT_OTHERGROUP, g_Messages_RecentRootID, RecentGroupID = TreeCtrl->GenerateID(), TIF_GROUP));
@@ -244,7 +244,7 @@ void CProtoSettings::SetMsgFormat(int Flags, TCString Message) }
}
}
- TreeCtrl->MemToDB(CString(MOD_NAME));
+ TreeCtrl->MemToDB(CString(MODULENAME));
}
}
@@ -263,7 +263,7 @@ TCString CProtoSettings::GetMsgFormat(int Flags, int *pOrder) }
}
if (Flags & GMF_PERSONAL && Message == nullptr) // try getting personal message (it overrides global)
- Message = db_get_s(NULL, MOD_NAME, ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS), (wchar_t*)nullptr);
+ Message = db_get_s(NULL, MODULENAME, ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS), (wchar_t*)nullptr);
if (Flags & GMF_PROTOORGLOBAL && Message == nullptr) {
Message = CProtoSettings().GetMsgFormat(GMF_PERSONAL | (Flags & GMF_TEMPORARY), pOrder);
@@ -273,10 +273,10 @@ TCString CProtoSettings::GetMsgFormat(int Flags, int *pOrder) if (Flags & GMF_LASTORDEFAULT && Message == nullptr) { // try to get the last or default message, depending on current settings
COptPage MsgTreeData(g_MsgTreePage);
COptItem_TreeCtrl *TreeCtrl = (COptItem_TreeCtrl*)MsgTreeData.Find(IDV_MSGTREE);
- TreeCtrl->DBToMem(CString(MOD_NAME));
+ TreeCtrl->DBToMem(CString(MODULENAME));
Message = nullptr;
if (g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_USELASTMSG)) { // if using last message by default...
- Message = db_get_s(NULL, MOD_NAME, ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS), (wchar_t*)nullptr); // try per-protocol message first
+ Message = db_get_s(NULL, MODULENAME, ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS), (wchar_t*)nullptr); // try per-protocol message first
if (Message.IsEmpty()) {
Message = nullptr; // to be sure it's NULL, not "" - as we're checking 'Message == NULL' later
int RecentGroupID = GetRecentGroupID(Status);
diff --git a/plugins/NewAwaySysMod/src/Properties.h b/plugins/NewAwaySysMod/src/Properties.h index f5b2f2d7fb..27da4917e4 100644 --- a/plugins/NewAwaySysMod/src/Properties.h +++ b/plugins/NewAwaySysMod/src/Properties.h @@ -326,19 +326,19 @@ public: CAutoreply& operator=(const int m_value)
{
CString Setting(Parent->szProto ? Parent->ProtoStatusToDBSetting(DB_ENABLEREPLY, IDC_MOREOPTDLG_PERSTATUSPROTOSETTINGS) : DB_ENABLEREPLY);
- if (db_get_b(NULL, MOD_NAME, Setting, VAL_USEDEFAULT) == m_value)
+ if (db_get_b(NULL, MODULENAME, Setting, VAL_USEDEFAULT) == m_value)
return *this;
if (m_value != VAL_USEDEFAULT)
- db_set_b(NULL, MOD_NAME, Setting, m_value != 0);
+ db_set_b(NULL, MODULENAME, Setting, m_value != 0);
else
- db_unset(NULL, MOD_NAME, Setting);
+ db_unset(NULL, MODULENAME, Setting);
return *this;
}
operator int()
{
- return db_get_b(NULL, MOD_NAME, Parent->szProto ? Parent->ProtoStatusToDBSetting(DB_ENABLEREPLY, IDC_MOREOPTDLG_PERSTATUSPROTOSETTINGS) : DB_ENABLEREPLY,
+ return db_get_b(NULL, MODULENAME, Parent->szProto ? Parent->ProtoStatusToDBSetting(DB_ENABLEREPLY, IDC_MOREOPTDLG_PERSTATUSPROTOSETTINGS) : DB_ENABLEREPLY,
Parent->szProto ? VAL_USEDEFAULT : AUTOREPLY_DEF_REPLY);
}
@@ -421,15 +421,15 @@ public: CString Setting(Parent->ContactStatusToDBSetting(DB_IGNOREREQUESTS, IDC_MOREOPTDLG_PERSTATUSPERSONALSETTINGS));
MCONTACT hContact = (Parent->m_hContact != INVALID_CONTACT_ID) ? Parent->m_hContact : NULL;
if (m_value)
- db_set_b(hContact, MOD_NAME, Setting, 1);
+ db_set_b(hContact, MODULENAME, Setting, 1);
else
- db_unset(hContact, MOD_NAME, Setting);
+ db_unset(hContact, MODULENAME, Setting);
return *this;
}
operator int()
{
- return db_get_b((Parent->m_hContact != INVALID_CONTACT_ID) ? Parent->m_hContact : NULL, MOD_NAME,
+ return db_get_b((Parent->m_hContact != INVALID_CONTACT_ID) ? Parent->m_hContact : NULL, MODULENAME,
Parent->ContactStatusToDBSetting(DB_IGNOREREQUESTS, IDC_MOREOPTDLG_PERSTATUSPERSONALSETTINGS), 0);
}
@@ -445,16 +445,16 @@ public: {
CString Setting(Parent->ContactStatusToDBSetting(DB_ENABLEREPLY, IDC_MOREOPTDLG_PERSTATUSPERSONALSETTINGS));
MCONTACT hContact = (Parent->m_hContact != INVALID_CONTACT_ID) ? Parent->m_hContact : NULL;
- if (db_get_b(hContact, MOD_NAME, Setting, VAL_USEDEFAULT) == m_value)
+ if (db_get_b(hContact, MODULENAME, Setting, VAL_USEDEFAULT) == m_value)
return *this;
if (m_value != VAL_USEDEFAULT)
- db_set_b(hContact, MOD_NAME, Setting, m_value != 0);
+ db_set_b(hContact, MODULENAME, Setting, m_value != 0);
else
- db_unset(hContact, MOD_NAME, Setting);
+ db_unset(hContact, MODULENAME, Setting);
return *this;
}
- operator int() {return db_get_b((Parent->m_hContact != INVALID_CONTACT_ID) ? Parent->m_hContact : NULL, MOD_NAME, Parent->ContactStatusToDBSetting(DB_ENABLEREPLY, IDC_MOREOPTDLG_PERSTATUSPERSONALSETTINGS), Parent->m_hContact ? VAL_USEDEFAULT : AUTOREPLY_DEF_REPLY);}
+ operator int() {return db_get_b((Parent->m_hContact != INVALID_CONTACT_ID) ? Parent->m_hContact : NULL, MODULENAME, Parent->ContactStatusToDBSetting(DB_ENABLEREPLY, IDC_MOREOPTDLG_PERSTATUSPERSONALSETTINGS), Parent->m_hContact ? VAL_USEDEFAULT : AUTOREPLY_DEF_REPLY);}
int IncludingParents(const char *szProtoOverride = nullptr) // takes into account protocol and global data also, if per-contact setting is not defined
{
_ASSERT((Parent->m_hContact && Parent->m_hContact != INVALID_CONTACT_ID) || szProtoOverride); // we need either correct protocol or a correct hContact to determine its protocol
diff --git a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp index 45ae7c6dce..71108da370 100644 --- a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp @@ -53,7 +53,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
Window_SetSkinIcon_IcoLib(hwndDlg, SKINICON_OTHER_MIRANDA);
- Utils_RestoreWindowPosition(hwndDlg, NULL, MOD_NAME, RAMDLGSIZESETTING);
+ Utils_RestoreWindowPosition(hwndDlg, NULL, MODULENAME, RAMDLGSIZESETTING);
{
READAWAYMSGDATA *awayData = new READAWAYMSGDATA;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)awayData);
@@ -124,7 +124,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam awayData->hAwayMsgEvent = nullptr;
}
delete awayData;
- Utils_SaveWindowPosition(hwndDlg, NULL, MOD_NAME, RAMDLGSIZESETTING);
+ Utils_SaveWindowPosition(hwndDlg, NULL, MODULENAME, RAMDLGSIZESETTING);
WindowList_Remove(g_hReadWndList, hwndDlg);
}
return false;
diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp index 88fb5f0dcd..acf2df40ab 100644 --- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp @@ -520,12 +520,12 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA MinContactSplitterX = rcMsgDlg.right - rc.left + 1;
// [try] getting dialog position
- int DlgPosX = db_get_dw(NULL, MOD_NAME, SAM_DB_DLGPOSX, -1);
- int DlgPosY = db_get_dw(NULL, MOD_NAME, SAM_DB_DLGPOSY, -1);
- int DlgSizeX = db_get_dw(NULL, MOD_NAME, SAM_DB_DLGSIZEX, -1);
- int DlgSizeY = db_get_dw(NULL, MOD_NAME, SAM_DB_DLGSIZEY, -1);
- int MsgSplitterX = db_get_dw(NULL, MOD_NAME, SAM_DB_MSGSPLITTERPOS, -1);
- int ContactSplitterX = db_get_dw(NULL, MOD_NAME, SAM_DB_CONTACTSPLITTERPOS, -1);
+ int DlgPosX = db_get_dw(NULL, MODULENAME, SAM_DB_DLGPOSX, -1);
+ int DlgPosY = db_get_dw(NULL, MODULENAME, SAM_DB_DLGPOSY, -1);
+ int DlgSizeX = db_get_dw(NULL, MODULENAME, SAM_DB_DLGSIZEX, -1);
+ int DlgSizeY = db_get_dw(NULL, MODULENAME, SAM_DB_DLGSIZEY, -1);
+ int MsgSplitterX = db_get_dw(NULL, MODULENAME, SAM_DB_MSGSPLITTERPOS, -1);
+ int ContactSplitterX = db_get_dw(NULL, MODULENAME, SAM_DB_CONTACTSPLITTERPOS, -1);
if (DlgPosX >= 0 && DlgPosY >= 0 && DlgSizeX > 0 && DlgSizeY > 0 && MsgSplitterX > 0 && ContactSplitterX > 0) {
RECT rcWorkArea, rcIntersect;
SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, 0);
@@ -939,12 +939,12 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA {
RECT rcRect;
GetWindowRect(hwndDlg, &rcRect);
- db_set_dw(NULL, MOD_NAME, SAM_DB_DLGPOSX, rcRect.left);
- db_set_dw(NULL, MOD_NAME, SAM_DB_DLGPOSY, rcRect.top);
- db_set_dw(NULL, MOD_NAME, SAM_DB_DLGSIZEX, rcRect.right - rcRect.left);
- db_set_dw(NULL, MOD_NAME, SAM_DB_DLGSIZEY, rcRect.bottom - rcRect.top);
- db_set_dw(NULL, MOD_NAME, SAM_DB_MSGSPLITTERPOS, g_MsgSplitterX);
- db_set_dw(NULL, MOD_NAME, SAM_DB_CONTACTSPLITTERPOS, g_ContactSplitterX);
+ db_set_dw(NULL, MODULENAME, SAM_DB_DLGPOSX, rcRect.left);
+ db_set_dw(NULL, MODULENAME, SAM_DB_DLGPOSY, rcRect.top);
+ db_set_dw(NULL, MODULENAME, SAM_DB_DLGSIZEX, rcRect.right - rcRect.left);
+ db_set_dw(NULL, MODULENAME, SAM_DB_DLGSIZEY, rcRect.bottom - rcRect.top);
+ db_set_dw(NULL, MODULENAME, SAM_DB_MSGSPLITTERPOS, g_MsgSplitterX);
+ db_set_dw(NULL, MODULENAME, SAM_DB_CONTACTSPLITTERPOS, g_ContactSplitterX);
g_SetAwayMsgPage.PageToMemToDB();
}
break;
diff --git a/plugins/NewAwaySysMod/src/stdafx.h b/plugins/NewAwaySysMod/src/stdafx.h index 991bd0aa23..004dca9cb2 100644 --- a/plugins/NewAwaySysMod/src/stdafx.h +++ b/plugins/NewAwaySysMod/src/stdafx.h @@ -141,11 +141,11 @@ #define STR_XSTATUSDESC TranslateT("extended status")
-#define MOD_NAME "NewAwaySys"
+#define MODULENAME "NewAwaySys"
#define MOD_NAMEW L"NewAwaySys"
-#define LOG_ID MOD_NAME // LogService log ID
-#define LOG_PREFIX MOD_NAME ": " // netlib.log prefix for all NAS' messages
+#define LOG_ID MODULENAME // LogService log ID
+#define LOG_PREFIX MODULENAME ": " // netlib.log prefix for all NAS' messages
#define DB_SETTINGSVER "SettingsVer"
@@ -223,9 +223,7 @@ int ICQStatusToGeneralStatus(int bICQStat); // TODO: get rid of these protocol-s struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MOD_NAME)
- {}
+ CMPlugin();
};
struct SetAwayMsgData
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
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index e9383fa63c..6f56098410 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -70,6 +70,10 @@ PLUGININFOEX pluginInfoEx = { 0xebf19652, 0xe434, 0x4d79, { 0x98, 0x97, 0x91, 0xa0, 0xff, 0x22, 0x6f, 0x51 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULE, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
diff --git a/plugins/NewXstatusNotify/src/stdafx.h b/plugins/NewXstatusNotify/src/stdafx.h index a4def10dd4..6f8578163d 100644 --- a/plugins/NewXstatusNotify/src/stdafx.h +++ b/plugins/NewXstatusNotify/src/stdafx.h @@ -70,9 +70,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE)
- {}
+ CMPlugin();
};
#define MAX_STATUSTEXT 36
diff --git a/plugins/New_GPG/src/constants.h b/plugins/New_GPG/src/constants.h index be769466c9..0eef3b79a2 100644 --- a/plugins/New_GPG/src/constants.h +++ b/plugins/New_GPG/src/constants.h @@ -1,5 +1,5 @@ #ifndef CONSTANTS_H #define CONSTANTS_H -#define szGPGModuleName "GPG" +#define MODULENAME "GPG" #define PREF_METANODB 0x2000 #endif diff --git a/plugins/New_GPG/src/gpg_wrapper.cpp b/plugins/New_GPG/src/gpg_wrapper.cpp index 06a39a4425..939c0bb6cc 100755 --- a/plugins/New_GPG/src/gpg_wrapper.cpp +++ b/plugins/New_GPG/src/gpg_wrapper.cpp @@ -24,7 +24,7 @@ pxResult pxExecute(std::vector<std::wstring> &aargv, string *aoutput, LPDWORD ae return pxNotConfigured; - wchar_t *bin_path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L""); + wchar_t *bin_path = UniGetContactSettingUtf(NULL, MODULENAME, "szGpgBinPath", L""); { if(!boost::filesystem::exists(bin_path)) { @@ -47,7 +47,7 @@ pxResult pxExecute(std::vector<std::wstring> &aargv, string *aoutput, LPDWORD ae env.push_back(L"LC_ALL=English"); env.push_back(L"LANG=C"); argv.push_back(bin_path); - wchar_t *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *home_dir = UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L""); if(mir_wstrlen(home_dir)) //this check are required for first run gpg binary validation { argv.push_back(L"--homedir"); @@ -173,7 +173,7 @@ pxResult pxExecute_passwd_change(std::vector<std::wstring> &aargv, pxResult *res if(!globals.gpg_valid) return pxNotConfigured; - wchar_t *bin_path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L""); + wchar_t *bin_path = UniGetContactSettingUtf(NULL, MODULENAME, "szGpgBinPath", L""); { if(!boost::filesystem::exists(bin_path)) { @@ -195,7 +195,7 @@ pxResult pxExecute_passwd_change(std::vector<std::wstring> &aargv, pxResult *res env.push_back(L"LC_ALL=English"); argv.push_back(bin_path); argv.push_back(L"--homedir"); - wchar_t *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *home_dir = UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L""); argv.push_back(home_dir); mir_free(home_dir); argv.push_back(L"--display-charset"); diff --git a/plugins/New_GPG/src/icons.cpp b/plugins/New_GPG/src/icons.cpp index 99c0a6891c..8d6cc66f60 100755 --- a/plugins/New_GPG/src/icons.cpp +++ b/plugins/New_GPG/src/icons.cpp @@ -25,7 +25,7 @@ static IconItem iconList[] = void InitIconLib() { - g_plugin.registerIcon(szGPGModuleName, iconList); + g_plugin.registerIcon(MODULENAME, iconList); } HANDLE IconLibHookIconsChanged(MIRANDAHOOK hook) @@ -50,7 +50,7 @@ void setSrmmIcon(MCONTACT h) MCONTACT hMC = db_mc_tryMeta(hContact); StatusIconData sid = {}; - sid.szModule = szGPGModuleName; + sid.szModule = MODULENAME; sid.hIcon = IcoLib_GetIcon("secured"); sid.dwId = 1; sid.flags = enabled ? 0 : MBF_HIDDEN; diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp index db4f6cc28e..cfc89ded5f 100755 --- a/plugins/New_GPG/src/init.cpp +++ b/plugins/New_GPG/src/init.cpp @@ -22,7 +22,7 @@ CMPlugin g_plugin; ///////////////////////////////////////////////////////////////////////////////////////// -PLUGININFOEX pluginInfo={ +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), @@ -35,9 +35,13 @@ PLUGININFOEX pluginInfo={ { 0x4227c050, 0x8d97, 0x48d2, { 0x91, 0xec, 0x6a, 0x95, 0x2b, 0x3d, 0xab, 0x94 } } }; +CMPlugin::CMPlugin() : + PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx) +{} + extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { - return &pluginInfo; + return &pluginInfoEx; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -53,34 +57,34 @@ void InitIconLib(); void init_vars() { - globals.bAppendTags = db_get_b(NULL, szGPGModuleName, "bAppendTags", 0) != 0; - globals.bStripTags = db_get_b(NULL, szGPGModuleName, "bStripTags", 0) != 0; - globals.inopentag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szInOpenTag", L"<GPGdec>"); - globals.inclosetag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szInCloseTag", L"</GPGdec>"); - globals.outopentag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szOutOpenTag", L"<GPGenc>"); - globals.outclosetag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szOutCloseTag", L"</GPGenc>"); - globals.bDebugLog = db_get_b(NULL, szGPGModuleName, "bDebugLog", 0) != 0; - globals.bAutoExchange = db_get_b(NULL, szGPGModuleName, "bAutoExchange", 0) != 0; - globals.bSameAction = db_get_b(NULL, szGPGModuleName, "bSameAction", 0) != 0; - globals.password = UniGetContactSettingUtf(NULL, szGPGModuleName, "szKeyPassword", L""); + globals.bAppendTags = db_get_b(NULL, MODULENAME, "bAppendTags", 0) != 0; + globals.bStripTags = db_get_b(NULL, MODULENAME, "bStripTags", 0) != 0; + globals.inopentag = UniGetContactSettingUtf(NULL, MODULENAME, "szInOpenTag", L"<GPGdec>"); + globals.inclosetag = UniGetContactSettingUtf(NULL, MODULENAME, "szInCloseTag", L"</GPGdec>"); + globals.outopentag = UniGetContactSettingUtf(NULL, MODULENAME, "szOutOpenTag", L"<GPGenc>"); + globals.outclosetag = UniGetContactSettingUtf(NULL, MODULENAME, "szOutCloseTag", L"</GPGenc>"); + globals.bDebugLog = db_get_b(NULL, MODULENAME, "bDebugLog", 0) != 0; + globals.bAutoExchange = db_get_b(NULL, MODULENAME, "bAutoExchange", 0) != 0; + globals.bSameAction = db_get_b(NULL, MODULENAME, "bSameAction", 0) != 0; + globals.password = UniGetContactSettingUtf(NULL, MODULENAME, "szKeyPassword", L""); globals.debuglog.init(); - globals.bJabberAPI = db_get_b(NULL, szGPGModuleName, "bJabberAPI", true) != 0; - globals.bPresenceSigning = db_get_b(NULL, szGPGModuleName, "bPresenceSigning", 0) != 0; - globals.bFileTransfers = db_get_b(NULL, szGPGModuleName, "bFileTransfers", 0) != 0; - globals.firstrun_rect.left = db_get_dw(NULL, szGPGModuleName, "FirstrunWindowX", 0); - globals.firstrun_rect.top = db_get_dw(NULL, szGPGModuleName, "FirstrunWindowY", 0); - globals.key_password_rect.left = db_get_dw(NULL, szGPGModuleName, "PasswordWindowX", 0); - globals.key_password_rect.top = db_get_dw(NULL, szGPGModuleName, "PasswordWindowY", 0); - globals.key_gen_rect.left = db_get_dw(NULL, szGPGModuleName, "KeyGenWindowX", 0); - globals.key_gen_rect.top = db_get_dw(NULL, szGPGModuleName, "KeyGenWindowY", 0); - globals.load_key_rect.left = db_get_dw(NULL, szGPGModuleName, "LoadKeyWindowX", 0); - globals.load_key_rect.top = db_get_dw(NULL, szGPGModuleName, "LoadKeyWindowY", 0); - globals.import_key_rect.left = db_get_dw(NULL, szGPGModuleName, "ImportKeyWindowX", 0); - globals.import_key_rect.top = db_get_dw(NULL, szGPGModuleName, "ImportKeyWindowY", 0); - globals.new_key_rect.left = db_get_dw(NULL, szGPGModuleName, "NewKeyWindowX", 0); - globals.new_key_rect.top = db_get_dw(NULL, szGPGModuleName, "NewKeyWindowY", 0); - globals.load_existing_key_rect.left = db_get_dw(NULL, szGPGModuleName, "LoadExistingKeyWindowX", 0); - globals.load_existing_key_rect.top = db_get_dw(NULL, szGPGModuleName, "LoadExistingKeyWindowY", 0); + globals.bJabberAPI = db_get_b(NULL, MODULENAME, "bJabberAPI", true) != 0; + globals.bPresenceSigning = db_get_b(NULL, MODULENAME, "bPresenceSigning", 0) != 0; + globals.bFileTransfers = db_get_b(NULL, MODULENAME, "bFileTransfers", 0) != 0; + globals.firstrun_rect.left = db_get_dw(NULL, MODULENAME, "FirstrunWindowX", 0); + globals.firstrun_rect.top = db_get_dw(NULL, MODULENAME, "FirstrunWindowY", 0); + globals.key_password_rect.left = db_get_dw(NULL, MODULENAME, "PasswordWindowX", 0); + globals.key_password_rect.top = db_get_dw(NULL, MODULENAME, "PasswordWindowY", 0); + globals.key_gen_rect.left = db_get_dw(NULL, MODULENAME, "KeyGenWindowX", 0); + globals.key_gen_rect.top = db_get_dw(NULL, MODULENAME, "KeyGenWindowY", 0); + globals.load_key_rect.left = db_get_dw(NULL, MODULENAME, "LoadKeyWindowX", 0); + globals.load_key_rect.top = db_get_dw(NULL, MODULENAME, "LoadKeyWindowY", 0); + globals.import_key_rect.left = db_get_dw(NULL, MODULENAME, "ImportKeyWindowX", 0); + globals.import_key_rect.top = db_get_dw(NULL, MODULENAME, "ImportKeyWindowY", 0); + globals.new_key_rect.left = db_get_dw(NULL, MODULENAME, "NewKeyWindowX", 0); + globals.new_key_rect.top = db_get_dw(NULL, MODULENAME, "NewKeyWindowY", 0); + globals.load_existing_key_rect.left = db_get_dw(NULL, MODULENAME, "LoadExistingKeyWindowX", 0); + globals.load_existing_key_rect.top = db_get_dw(NULL, MODULENAME, "LoadExistingKeyWindowY", 0); globals.tabsrmm_used = isTabsrmmUsed(); globals.bold_font = CreateFont(14, 0, 0, 0, 600, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 0, L"Arial"); } @@ -102,11 +106,11 @@ static int OnModulesLoaded(WPARAM, LPARAM) void InitCheck(); void FirstRun(); FirstRun(); - if(!db_get_b(NULL, szGPGModuleName, "FirstRun", 1)) + if(!db_get_b(NULL, MODULENAME, "FirstRun", 1)) InitCheck(); StatusIconData sid = {}; - sid.szModule = szGPGModuleName; + sid.szModule = MODULENAME; sid.flags = MBF_HIDDEN; sid.dwId = 0x00000001; sid.hIcon = IcoLib_GetIcon("secured"); @@ -133,18 +137,18 @@ static int OnModulesLoaded(WPARAM, LPARAM) HookEvent(ME_MSG_WINDOWEVENT, onWindowEvent); HookEvent(ME_MSG_ICONPRESSED, onIconPressed); - Proto_RegisterModule(PROTOTYPE_ENCRYPTION, szGPGModuleName); + Proto_RegisterModule(PROTOTYPE_ENCRYPTION, MODULENAME); - CreateProtoServiceFunction(szGPGModuleName, PSR_MESSAGE, RecvMsgSvc); - CreateProtoServiceFunction(szGPGModuleName, PSS_MESSAGE, SendMsgSvc); - CreateProtoServiceFunction(szGPGModuleName, PSS_FILE, onSendFile); + CreateProtoServiceFunction(MODULENAME, PSR_MESSAGE, RecvMsgSvc); + CreateProtoServiceFunction(MODULENAME, PSS_MESSAGE, SendMsgSvc); + CreateProtoServiceFunction(MODULENAME, PSS_FILE, onSendFile); clean_temp_dir(); return 0; } extern "C" int __declspec(dllexport) Load() { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); @@ -195,7 +199,7 @@ extern "C" int __declspec(dllexport) Load() InitIconLib(); - globals.g_hCLIcon = ExtraIcon_RegisterCallback(szGPGModuleName, Translate("GPG encryption status"), "secured", onExtraImageListRebuilding, onExtraImageApplying); + globals.g_hCLIcon = ExtraIcon_RegisterCallback(MODULENAME, Translate("GPG encryption status"), "secured", onExtraImageListRebuilding, onExtraImageApplying); return 0; } diff --git a/plugins/New_GPG/src/log.cpp b/plugins/New_GPG/src/log.cpp index c7d588d03d..598047b5c3 100755 --- a/plugins/New_GPG/src/log.cpp +++ b/plugins/New_GPG/src/log.cpp @@ -73,7 +73,7 @@ void logtofile::init() { if(path) mir_free(path); - path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szLogFilePath", L"C:\\GPGdebug.log"); + path = UniGetContactSettingUtf(NULL, MODULENAME, "szLogFilePath", L"C:\\GPGdebug.log"); } _bDebugLog = globals.bDebugLog; } diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp index 7b93bb6ea7..8975dcb35a 100755 --- a/plugins/New_GPG/src/main.cpp +++ b/plugins/New_GPG/src/main.cpp @@ -21,7 +21,7 @@ void FirstRun() { - if (!db_get_b(NULL, szGPGModuleName, "FirstRun", 1)) + if (!db_get_b(NULL, MODULENAME, "FirstRun", 1)) return; CDlgGpgBinOpts *d = new CDlgGpgBinOpts; d->Show(); @@ -31,13 +31,13 @@ void InitCheck() { { // parse gpg output - wchar_t *current_home = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); - db_set_ws(NULL, szGPGModuleName, "szHomePath", L""); //we do not need home for gpg binary validation + wchar_t *current_home = UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L""); + db_set_ws(NULL, MODULENAME, "szHomePath", L""); //we do not need home for gpg binary validation globals.gpg_valid = isGPGValid(); - db_set_ws(NULL, szGPGModuleName, "szHomePath", current_home); //return current home dir back + db_set_ws(NULL, MODULENAME, "szHomePath", current_home); //return current home dir back mir_free(current_home); bool home_dir_access = false, temp_access = false; - wchar_t *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *home_dir = UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L""); std::wstring test_path = home_dir; mir_free(home_dir); test_path += L"/"; @@ -92,7 +92,7 @@ void InitCheck() if (result == pxNotFound) return; } - home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + home_dir = UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L""); wstring tmp_dir = home_dir; mir_free(home_dir); tmp_dir += L"\\tmp"; @@ -110,11 +110,11 @@ void InitCheck() acc += pa->szModuleName; acc += ")"; acc += "_KeyID"; - keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, acc.c_str(), ""); + keyid = UniGetContactSettingUtf(NULL, MODULENAME, acc.c_str(), ""); if (keyid[0]) { question = Translate("Your secret key with ID: "); mir_free(keyid); - keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", ""); + keyid = UniGetContactSettingUtf(NULL, MODULENAME, "KeyID", ""); if ((p = out.find(keyid)) == string::npos) { question += keyid; question += Translate(" for account "); @@ -176,9 +176,9 @@ void InitCheck() } } question = Translate("Your secret key with ID: "); - keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", ""); - char *key = UniGetContactSettingUtf(NULL, szGPGModuleName, "GPGPubKey", ""); - if (!db_get_b(NULL, szGPGModuleName, "FirstRun", 1) && (!keyid[0] || !key[0])) { + keyid = UniGetContactSettingUtf(NULL, MODULENAME, "KeyID", ""); + char *key = UniGetContactSettingUtf(NULL, MODULENAME, "GPGPubKey", ""); + if (!db_get_b(NULL, MODULENAME, "FirstRun", 1) && (!keyid[0] || !key[0])) { question = Translate("You didn't set a private key.\nWould you like to set it now?"); if (MessageBoxA(nullptr, question.c_str(), Translate("Own private key warning"), MB_YESNO) == IDYES) { @@ -241,7 +241,7 @@ void InitCheck() mir_free(key); } { - wchar_t *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *path = UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L""); DWORD dwFileAttr = GetFileAttributes(path); if (dwFileAttr != INVALID_FILE_ATTRIBUTES) { dwFileAttr &= ~FILE_ATTRIBUTE_READONLY; @@ -285,27 +285,27 @@ void ImportKey(MCONTACT hContact, std::wstring new_key) for (int i = 0; i < count; i++) { MCONTACT hcnt = db_mc_getSub(hContact, i); if (hcnt) - db_set_ws(hcnt, szGPGModuleName, "GPGPubKey", new_key.c_str()); + db_set_ws(hcnt, MODULENAME, "GPGPubKey", new_key.c_str()); } } - else db_set_ws(metaGetMostOnline(hContact), szGPGModuleName, "GPGPubKey", new_key.c_str()); + else db_set_ws(metaGetMostOnline(hContact), MODULENAME, "GPGPubKey", new_key.c_str()); } - else db_set_ws(hContact, szGPGModuleName, "GPGPubKey", new_key.c_str()); + else db_set_ws(hContact, MODULENAME, "GPGPubKey", new_key.c_str()); // gpg execute block std::vector<wstring> cmd; wchar_t tmp2[MAX_PATH] = { 0 }; { - wcsncpy(tmp2, ptrW(UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"")), MAX_PATH - 1); + wcsncpy(tmp2, ptrW(UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L"")), MAX_PATH - 1); mir_wstrncat(tmp2, L"\\", _countof(tmp2) - mir_wstrlen(tmp2)); mir_wstrncat(tmp2, L"temporary_exported.asc", _countof(tmp2) - mir_wstrlen(tmp2)); boost::filesystem::remove(tmp2); ptrW ptmp; if (db_mc_isMeta(hContact)) - ptmp = UniGetContactSettingUtf(metaGetMostOnline(hContact), szGPGModuleName, "GPGPubKey", L""); + ptmp = UniGetContactSettingUtf(metaGetMostOnline(hContact), MODULENAME, "GPGPubKey", L""); else - ptmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", L""); + ptmp = UniGetContactSettingUtf(hContact, MODULENAME, "GPGPubKey", L""); wfstream f(tmp2, std::ios::out); f << ptmp.get(); @@ -336,7 +336,7 @@ void ImportKey(MCONTACT hContact, std::wstring new_key) char *tmp = nullptr; string::size_type s = output.find("gpg: key ") + mir_strlen("gpg: key "); string::size_type s2 = output.find(":", s); - db_set_s(hcnt, szGPGModuleName, "KeyID", output.substr(s, s2 - s).c_str()); + db_set_s(hcnt, MODULENAME, "KeyID", output.substr(s, s2 - s).c_str()); s = output.find("“", s2); if (s == string::npos) { s = output.find("\"", s2); @@ -357,7 +357,7 @@ void ImportKey(MCONTACT hContact, std::wstring new_key) tmp = (char*)mir_alloc(sizeof(char)*(output.substr(s, s2 - s - (uncommon ? 1 : 0)).length() + 1)); mir_strcpy(tmp, output.substr(s, s2 - s - (uncommon ? 1 : 0)).c_str()); mir_utf8decode(tmp, nullptr); - db_set_s(hcnt, szGPGModuleName, "KeyMainName", tmp); + db_set_s(hcnt, MODULENAME, "KeyMainName", tmp); mir_free(tmp); } @@ -371,7 +371,7 @@ void ImportKey(MCONTACT hContact, std::wstring new_key) tmp = (char*)mir_alloc(sizeof(char)* (output.substr(s2, s - s2).length() + 1)); mir_strcpy(tmp, output.substr(s2, s - s2).c_str()); mir_utf8decode(tmp, nullptr); - db_set_s(hcnt, szGPGModuleName, "KeyComment", tmp); + db_set_s(hcnt, MODULENAME, "KeyComment", tmp); mir_free(tmp); s += 3; s2 = output.find(">", s); @@ -379,7 +379,7 @@ void ImportKey(MCONTACT hContact, std::wstring new_key) tmp = (char*)mir_alloc(sizeof(char)*(output.substr(s, s2 - s).length() + 1)); mir_strcpy(tmp, output.substr(s, s2 - s).c_str()); mir_utf8decode(tmp, nullptr); - db_set_s(hcnt, szGPGModuleName, "KeyMainEmail", tmp); + db_set_s(hcnt, MODULENAME, "KeyMainEmail", tmp); mir_free(tmp); } } @@ -387,11 +387,11 @@ void ImportKey(MCONTACT hContact, std::wstring new_key) tmp = (char*)mir_alloc(sizeof(char)* (output.substr(s2, s - s2).length() + 1)); mir_strcpy(tmp, output.substr(s2, s - s2).c_str()); mir_utf8decode(tmp, nullptr); - db_set_s(hcnt, szGPGModuleName, "KeyMainEmail", output.substr(s2, s - s2).c_str()); + db_set_s(hcnt, MODULENAME, "KeyMainEmail", output.substr(s2, s - s2).c_str()); mir_free(tmp); } } - db_unset(hcnt, szGPGModuleName, "bAlwatsTrust"); + db_unset(hcnt, MODULENAME, "bAlwatsTrust"); } } } @@ -399,7 +399,7 @@ void ImportKey(MCONTACT hContact, std::wstring new_key) char *tmp = nullptr; string::size_type s = output.find("gpg: key ") + mir_strlen("gpg: key "); string::size_type s2 = output.find(":", s); - db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyID", output.substr(s, s2 - s).c_str()); + db_set_s(metaGetMostOnline(hContact), MODULENAME, "KeyID", output.substr(s, s2 - s).c_str()); s = output.find("“", s2); if (s == string::npos) { s = output.find("\"", s2); @@ -420,7 +420,7 @@ void ImportKey(MCONTACT hContact, std::wstring new_key) tmp = (char*)mir_alloc(sizeof(char)*(output.substr(s, s2 - s - (uncommon ? 1 : 0)).length() + 1)); mir_strcpy(tmp, output.substr(s, s2 - s - (uncommon ? 1 : 0)).c_str()); mir_utf8decode(tmp, nullptr); - db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainName", tmp); + db_set_s(metaGetMostOnline(hContact), MODULENAME, "KeyMainName", tmp); mir_free(tmp); } if ((s = output.find(")", s2)) == string::npos) @@ -433,7 +433,7 @@ void ImportKey(MCONTACT hContact, std::wstring new_key) tmp = (char*)mir_alloc(sizeof(char)* (output.substr(s2, s - s2).length() + 1)); mir_strcpy(tmp, output.substr(s2, s - s2).c_str()); mir_utf8decode(tmp, nullptr); - db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyComment", tmp); + db_set_s(metaGetMostOnline(hContact), MODULENAME, "KeyComment", tmp); mir_free(tmp); s += 3; s2 = output.find(">", s); @@ -441,7 +441,7 @@ void ImportKey(MCONTACT hContact, std::wstring new_key) tmp = (char*)mir_alloc(sizeof(char)*(output.substr(s, s2 - s).length() + 1)); mir_strcpy(tmp, output.substr(s, s2 - s).c_str()); mir_utf8decode(tmp, nullptr); - db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainEmail", tmp); + db_set_s(metaGetMostOnline(hContact), MODULENAME, "KeyMainEmail", tmp); mir_free(tmp); } } @@ -449,18 +449,18 @@ void ImportKey(MCONTACT hContact, std::wstring new_key) tmp = (char*)mir_alloc(sizeof(char)* (output.substr(s2, s - s2).length() + 1)); mir_strcpy(tmp, output.substr(s2, s - s2).c_str()); mir_utf8decode(tmp, nullptr); - db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainEmail", output.substr(s2, s - s2).c_str()); + db_set_s(metaGetMostOnline(hContact), MODULENAME, "KeyMainEmail", output.substr(s2, s - s2).c_str()); mir_free(tmp); } } - db_unset(metaGetMostOnline(hContact), szGPGModuleName, "bAlwatsTrust"); + db_unset(metaGetMostOnline(hContact), MODULENAME, "bAlwatsTrust"); } } else { char *tmp = nullptr; string::size_type s = output.find("gpg: key ") + mir_strlen("gpg: key "); string::size_type s2 = output.find(":", s); - db_set_s(hContact, szGPGModuleName, "KeyID", output.substr(s, s2 - s).c_str()); + db_set_s(hContact, MODULENAME, "KeyID", output.substr(s, s2 - s).c_str()); s = output.find("“", s2); if (s == string::npos) { s = output.find("\"", s2); @@ -481,7 +481,7 @@ void ImportKey(MCONTACT hContact, std::wstring new_key) tmp = (char*)mir_alloc(sizeof(char)*(output.substr(s, s2 - s - (uncommon ? 1 : 0)).length() + 1)); mir_strcpy(tmp, output.substr(s, s2 - s - (uncommon ? 1 : 0)).c_str()); mir_utf8decode(tmp, nullptr); - db_set_s(hContact, szGPGModuleName, "KeyMainName", tmp); + db_set_s(hContact, MODULENAME, "KeyMainName", tmp); mir_free(tmp); } if ((s = output.find(")", s2)) == string::npos) @@ -494,7 +494,7 @@ void ImportKey(MCONTACT hContact, std::wstring new_key) tmp = (char*)mir_alloc(sizeof(char)* (output.substr(s2, s - s2).length() + 1)); mir_strcpy(tmp, output.substr(s2, s - s2).c_str()); mir_utf8decode(tmp, nullptr); - db_set_s(hContact, szGPGModuleName, "KeyComment", tmp); + db_set_s(hContact, MODULENAME, "KeyComment", tmp); mir_free(tmp); s += 3; s2 = output.find(">", s); @@ -502,7 +502,7 @@ void ImportKey(MCONTACT hContact, std::wstring new_key) tmp = (char*)mir_alloc(sizeof(char)*(output.substr(s, s2 - s).length() + 1)); mir_strcpy(tmp, output.substr(s, s2 - s).c_str()); mir_utf8decode(tmp, nullptr); - db_set_s(hContact, szGPGModuleName, "KeyMainEmail", tmp); + db_set_s(hContact, MODULENAME, "KeyMainEmail", tmp); mir_free(tmp); } } @@ -510,11 +510,11 @@ void ImportKey(MCONTACT hContact, std::wstring new_key) tmp = (char*)mir_alloc(sizeof(char)* (output.substr(s2, s - s2).length() + 1)); mir_strcpy(tmp, output.substr(s2, s - s2).c_str()); mir_utf8decode(tmp, nullptr); - db_set_s(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s2, s - s2).c_str()); + db_set_s(hContact, MODULENAME, "KeyMainEmail", output.substr(s2, s - s2).c_str()); mir_free(tmp); } } - db_unset(hContact, szGPGModuleName, "bAlwatsTrust"); + db_unset(hContact, MODULENAME, "bAlwatsTrust"); } MessageBox(nullptr, toUTF16(output).c_str(), L"", MB_OK); diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp index d4086b8f1a..4e8d4926e1 100755 --- a/plugins/New_GPG/src/messages.cpp +++ b/plugins/New_GPG/src/messages.cpp @@ -44,13 +44,13 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR } else { - db_set_b(db_mc_isMeta(hContact) ? metaGetMostOnline(hContact) : hContact, szGPGModuleName, "GPGEncryption", 1); + db_set_b(db_mc_isMeta(hContact) ? metaGetMostOnline(hContact) : hContact, MODULENAME, "GPGEncryption", 1); setSrmmIcon(hContact); setClistIcon(hContact); } if (isContactHaveKey(hContact)) { - db_set_b(db_mc_isMeta(hContact) ? metaGetMostOnline(hContact) : hContact, szGPGModuleName, "GPGEncryption", 1); + db_set_b(db_mc_isMeta(hContact) ? metaGetMostOnline(hContact) : hContact, MODULENAME, "GPGEncryption", 1); setSrmmIcon(hContact); setClistIcon(hContact); } @@ -66,7 +66,7 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR boost::algorithm::erase_all(str, "\r"); s2 += mir_wstrlen(L"-----END PGP MESSAGE-----"); - ptrW ptszHomePath(UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"")); + ptrW ptszHomePath(UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L"")); wstring encfile = toUTF16(get_random(10)); wstring decfile = toUTF16(get_random(10)); { @@ -88,7 +88,7 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR count += step; if(count >= timeout) { - db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0); + db_set_b(hContact, MODULENAME, "GPGEncryption", 0); setSrmmIcon(hContact); setClistIcon(hContact); globals.debuglog<<std::string(time_str() + "info: failed to create temporary file for decryption, disabling gpg for contact to avoid deadlock"); @@ -106,19 +106,19 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR std::vector<wstring> cmd; cmd.push_back(L"--batch"); { - char *inkeyid = UniGetContactSettingUtf(db_mc_isMeta(hContact) ? metaGetMostOnline(hContact) : hContact, szGPGModuleName, "InKeyID", ""); + char *inkeyid = UniGetContactSettingUtf(db_mc_isMeta(hContact) ? metaGetMostOnline(hContact) : hContact, MODULENAME, "InKeyID", ""); wchar_t *pass = nullptr; if (inkeyid[0]) { string dbsetting = "szKey_"; dbsetting += inkeyid; dbsetting += "_Password"; - pass = UniGetContactSettingUtf(NULL, szGPGModuleName, dbsetting.c_str(), L""); + pass = UniGetContactSettingUtf(NULL, MODULENAME, dbsetting.c_str(), L""); if (pass[0] && globals.bDebugLog) globals.debuglog << std::string(time_str() + ": info: found password in database for key ID: " + inkeyid + ", trying to decrypt message from " + toUTF8(Clist_GetContactDisplayName(hContact)) + " with password"); } else { - pass = UniGetContactSettingUtf(NULL, szGPGModuleName, "szKeyPassword", L""); + pass = UniGetContactSettingUtf(NULL, MODULENAME, "szKeyPassword", L""); if (pass[0] && globals.bDebugLog) globals.debuglog << std::string(time_str() + ": info: found password for all keys in database, trying to decrypt message from " + toUTF8(Clist_GetContactDisplayName(hContact)) + " with password"); } @@ -163,11 +163,11 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR boost::filesystem::remove(path, e); } HistoryLog(hContact, db_event(msg, timestamp, 0, dbflags)); - BYTE enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0); - db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0); + BYTE enc = db_get_b(hContact, MODULENAME, "GPGEncryption", 0); + db_set_b(hContact, MODULENAME, "GPGEncryption", 0); ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)"Unable to decrypt PGP encrypted message"); HistoryLog(hContact, db_event("Error message sent", 0, 0, DBEF_SENT)); - db_set_b(hContact, szGPGModuleName, "GPGEncryption", enc); + db_set_b(hContact, MODULENAME, "GPGEncryption", enc); return; } if (result == pxNotFound) @@ -201,18 +201,18 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR if (globals.bDebugLog) globals.debuglog << std::string(time_str() + ": info: failed to decrypt messaage from " + toUTF8(Clist_GetContactDisplayName(hContact)) + " password needed, trying to get one"); if (globals._terminate) { - BYTE enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0); - db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0); + BYTE enc = db_get_b(hContact, MODULENAME, "GPGEncryption", 0); + db_set_b(hContact, MODULENAME, "GPGEncryption", 0); ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)"Unable to decrypt PGP encrypted message"); HistoryLog(hContact, db_event("Error message sent", 0, 0, DBEF_SENT)); - db_set_b(hContact, szGPGModuleName, "GPGEncryption", enc); + db_set_b(hContact, MODULENAME, "GPGEncryption", enc); break; } { //save inkey id string::size_type s = out.find(" encrypted with "); s = out.find(" ID ", s); s += mir_strlen(" ID "); - db_set_s(db_mc_isMeta(hContact) ? metaGetMostOnline(hContact) : hContact, szGPGModuleName, "InKeyID", out.substr(s, out.find(",", s) - s).c_str()); + db_set_s(db_mc_isMeta(hContact) ? metaGetMostOnline(hContact) : hContact, MODULENAME, "InKeyID", out.substr(s, out.find(",", s) - s).c_str()); } CDlgKeyPasswordMsgBox *d = new CDlgKeyPasswordMsgBox(hContact); @@ -241,11 +241,11 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR } HistoryLog(hContact, db_event(msg, timestamp, 0, dbflags)); - BYTE enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0); - db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0); + BYTE enc = db_get_b(hContact, MODULENAME, "GPGEncryption", 0); + db_set_b(hContact, MODULENAME, "GPGEncryption", 0); ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)"Unable to decrypt PGP encrypted message"); HistoryLog(hContact, db_event("Error message sent", 0, 0, DBEF_SENT)); - db_set_b(hContact, szGPGModuleName, "GPGEncryption", enc); + db_set_b(hContact, MODULENAME, "GPGEncryption", enc); return; } if (result2 == pxNotFound) @@ -270,11 +270,11 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR } HistoryLog(hContact, db_event(msg, timestamp, 0, dbflags)); - BYTE enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0); - db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0); + BYTE enc = db_get_b(hContact, MODULENAME, "GPGEncryption", 0); + db_set_b(hContact, MODULENAME, "GPGEncryption", 0); ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)"Unable to decrypt PGP encrypted message"); HistoryLog(hContact, db_event("Error message sent", 0, 0, DBEF_SENT)); - db_set_b(hContact, szGPGModuleName, "GPGEncryption", enc); + db_set_b(hContact, MODULENAME, "GPGEncryption", enc); return; } if (result == pxNotFound) @@ -303,11 +303,11 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR ptrA tmp4((char*)mir_alloc(sizeof(char)*(str1.length() + 1))); mir_strcpy(tmp4, str1.c_str()); HistoryLog(hContact, db_event(msg, timestamp, 0, dbflags)); - BYTE enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0); - db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0); + BYTE enc = db_get_b(hContact, MODULENAME, "GPGEncryption", 0); + db_set_b(hContact, MODULENAME, "GPGEncryption", 0); ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)"Unable to decrypt PGP encrypted message"); HistoryLog(hContact, db_event("Error message sent", 0, 0, DBEF_SENT)); - db_set_b(hContact, szGPGModuleName, "GPGEncryption", enc); + db_set_b(hContact, MODULENAME, "GPGEncryption", enc); return; } @@ -346,11 +346,11 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR globals.debuglog << std::string(time_str() + ": info: Failed to decrypt GPG encrypted message."); HistoryLog(hContact, db_event(msg, timestamp, 0, dbflags)); - BYTE enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0); - db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0); + BYTE enc = db_get_b(hContact, MODULENAME, "GPGEncryption", 0); + db_set_b(hContact, MODULENAME, "GPGEncryption", 0); ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)"Unable to decrypt PGP encrypted message"); HistoryLog(hContact, db_event("Error message sent", 0, 0, DBEF_SENT)); - db_set_b(hContact, szGPGModuleName, "GPGEncryption", enc); + db_set_b(hContact, MODULENAME, "GPGEncryption", enc); return; } @@ -368,7 +368,7 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR } } } - if (db_get_b(db_mc_isMeta(hContact) ? metaGetMostOnline(hContact) : hContact, szGPGModuleName, "GPGEncryption", 0)) + if (db_get_b(db_mc_isMeta(hContact) ? metaGetMostOnline(hContact) : hContact, MODULENAME, "GPGEncryption", 0)) { HistoryLog(hContact, db_event(msg, timestamp, 0, dbflags | DBEF_READ)); return; @@ -413,14 +413,14 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) if (globals.bDebugLog) globals.debuglog << std::string(time_str() + ": info(autoexchange): found pubkey block:" + toUTF8(Clist_GetContactDisplayName(ccs->hContact))); s2 += mir_wstrlen(L"-----END PGP PUBLIC KEY BLOCK-----"); - db_set_ws(ccs->hContact, szGPGModuleName, "GPGPubKey", str.substr(s1, s2 - s1).c_str()); + db_set_ws(ccs->hContact, MODULENAME, "GPGPubKey", str.substr(s1, s2 - s1).c_str()); { //gpg execute block std::vector<wstring> cmd; wchar_t tmp2[MAX_PATH] = { 0 }; string output; DWORD exitcode; { - ptrW ptmp(UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"")); + ptrW ptmp(UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L"")); mir_wstrcpy(tmp2, ptmp); mir_free(ptmp); mir_wstrcat(tmp2, L"\\"); @@ -444,7 +444,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) count += step; if(count >= timeout) { - db_set_b(ccs->hContact, szGPGModuleName, "GPGEncryption", 0); + db_set_b(ccs->hContact, MODULENAME, "GPGEncryption", 0); setSrmmIcon(ccs->hContact); setClistIcon(ccs->hContact); globals.debuglog<<std::string(time_str() + "info: failed to create temporary file for decryption, disabling gpg for contact to avoid deadlock"); @@ -453,7 +453,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) f.open(tmp2, std::ios::out); } } - ptmp = UniGetContactSettingUtf(ccs->hContact, szGPGModuleName, "GPGPubKey", L""); + ptmp = UniGetContactSettingUtf(ccs->hContact, MODULENAME, "GPGPubKey", L""); f << (wchar_t*)ptmp; f.close(); cmd.push_back(L"--batch"); @@ -483,7 +483,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) char *tmp = nullptr; s1 = output.find("gpg: key ") + mir_strlen("gpg: key "); s2 = output.find(":", s1); - db_set_s(ccs->hContact, szGPGModuleName, "KeyID", output.substr(s1, s2 - s1).c_str()); + db_set_s(ccs->hContact, MODULENAME, "KeyID", output.substr(s1, s2 - s1).c_str()); s2 += 2; s1 = output.find("“", s2); if (s1 == string::npos) @@ -500,7 +500,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) tmp = (char*)mir_alloc(output.substr(s1, s2 - s1 - 1).length() + 1); mir_strcpy(tmp, output.substr(s1, s2 - s1 - 1).c_str()); mir_utf8decode(tmp, nullptr); - db_set_s(ccs->hContact, szGPGModuleName, "KeyMainName", tmp); + db_set_s(ccs->hContact, MODULENAME, "KeyMainName", tmp); mir_free(tmp); if ((s1 = output.find(")", s2)) == string::npos) s1 = output.find(">", s2); @@ -512,14 +512,14 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) tmp = (char*)mir_alloc(output.substr(s2, s1 - s2).length() + 1); mir_strcpy(tmp, output.substr(s2, s1 - s2).c_str()); mir_utf8decode(tmp, nullptr); - db_set_s(ccs->hContact, szGPGModuleName, "KeyComment", tmp); + db_set_s(ccs->hContact, MODULENAME, "KeyComment", tmp); mir_free(tmp); s1 += 3; s2 = output.find(">", s1); tmp = (char*)mir_alloc(output.substr(s1, s2 - s1).length() + 1); mir_strcpy(tmp, output.substr(s1, s2 - s1).c_str()); mir_utf8decode(tmp, nullptr); - db_set_s(ccs->hContact, szGPGModuleName, "KeyMainEmail", tmp); + db_set_s(ccs->hContact, MODULENAME, "KeyMainEmail", tmp); mir_free(tmp); } else @@ -527,11 +527,11 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) tmp = (char*)mir_alloc(output.substr(s2, s1 - s2).length() + 1); mir_strcpy(tmp, output.substr(s2, s1 - s2).c_str()); mir_utf8decode(tmp, nullptr); - db_set_s(ccs->hContact, szGPGModuleName, "KeyMainEmail", output.substr(s2, s1 - s2).c_str()); + db_set_s(ccs->hContact, MODULENAME, "KeyMainEmail", output.substr(s2, s1 - s2).c_str()); mir_free(tmp); } - db_set_b(ccs->hContact, szGPGModuleName, "GPGEncryption", 1); - db_set_b(ccs->hContact, szGPGModuleName, "bAlwatsTrust", 1); + db_set_b(ccs->hContact, MODULENAME, "GPGEncryption", 1); + db_set_b(ccs->hContact, MODULENAME, "bAlwatsTrust", 1); setSrmmIcon(ccs->hContact); setClistIcon(ccs->hContact); if (db_mc_isSub(ccs->hContact)) @@ -571,17 +571,17 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) if (globals.bDebugLog) globals.debuglog << std::string(time_str() + ": info(autoexchange): received key request from: " + toUTF8(Clist_GetContactDisplayName(ccs->hContact))); - ptrA tmp(UniGetContactSettingUtf(NULL, szGPGModuleName, "GPGPubKey", "")); + ptrA tmp(UniGetContactSettingUtf(NULL, MODULENAME, "GPGPubKey", "")); if (tmp[0]) { - int enc_state = db_get_b(ccs->hContact, szGPGModuleName, "GPGEncryption", 0); + int enc_state = db_get_b(ccs->hContact, MODULENAME, "GPGEncryption", 0); if (enc_state) - db_set_b(ccs->hContact, szGPGModuleName, "GPGEncryption", 0); + db_set_b(ccs->hContact, MODULENAME, "GPGEncryption", 0); string str1 = "-----PGP KEY RESPONSE-----"; str1.append(tmp); ProtoChainSend(ccs->hContact, PSS_MESSAGE, 0, (LPARAM)str1.c_str()); if (enc_state) - db_set_b(ccs->hContact, szGPGModuleName, "GPGEncryption", 1); + db_set_b(ccs->hContact, MODULENAME, "GPGEncryption", 1); } return 0; } @@ -656,7 +656,7 @@ void SendMsgSvc_func(MCONTACT hContact, char *msg, DWORD flags) { wchar_t *tmp2; { - char *tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyID", ""); + char *tmp = UniGetContactSettingUtf(hContact, MODULENAME, "KeyID", ""); if (!tmp[0]) { mir_free(tmp); HistoryLog(hContact, db_event("Failed to encrypt message with GPG (not found key for encryption in db)", 0, 0, DBEF_SENT)); @@ -669,7 +669,7 @@ void SendMsgSvc_func(MCONTACT hContact, char *msg, DWORD flags) cmd.push_back(L"\"\""); cmd.push_back(L"--no-version"); } - if (db_get_b(hContact, szGPGModuleName, "bAlwaysTrust", 0)) { + if (db_get_b(hContact, MODULENAME, "bAlwaysTrust", 0)) { cmd.push_back(L"--trust-model"); cmd.push_back(L"always"); } @@ -683,7 +683,7 @@ void SendMsgSvc_func(MCONTACT hContact, char *msg, DWORD flags) mir_free(tmp2); } { - wchar_t *tmp2 = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *tmp2 = UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L""); path = tmp2; cmd.push_back(std::wstring(tmp2) + L"\\tmp\\" + file); mir_free(tmp2); @@ -699,7 +699,7 @@ void SendMsgSvc_func(MCONTACT hContact, char *msg, DWORD flags) count += step; if(count >= timeout) { - db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0); //disable encryption + db_set_b(hContact, MODULENAME, "GPGEncryption", 0); //disable encryption setSrmmIcon(hContact); setClistIcon(hContact); globals.debuglog << std::string(time_str() + ": info: failed to create temporary file for encryption, disabling encryption to avoid deadlock"); @@ -735,7 +735,7 @@ void SendMsgSvc_func(MCONTACT hContact, char *msg, DWORD flags) if (out.find("There is no assurance this key belongs to the named user") != string::npos) { out.clear(); if (MessageBox(nullptr, TranslateT("We're trying to encrypt with untrusted key. Do you want to trust this key permanently?"), TranslateT("Warning"), MB_YESNO) == IDYES) { - db_set_b(hContact, szGPGModuleName, "bAlwaysTrust", 1); + db_set_b(hContact, MODULENAME, "bAlwaysTrust", 1); std::vector<std::wstring> tmp; tmp.push_back(L"--trust-model"); tmp.push_back(L"always"); @@ -791,7 +791,7 @@ void SendMsgSvc_func(MCONTACT hContact, char *msg, DWORD flags) count += step; if(count >= timeout) { - db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0); //disable encryption + db_set_b(hContact, MODULENAME, "GPGEncryption", 0); //disable encryption setSrmmIcon(hContact); setClistIcon(hContact); globals.debuglog << std::string(time_str() + ": info: gpg failed to encrypt message, disabling encryption to avoid deadlock"); diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp index 798b3a660c..650a703c05 100755 --- a/plugins/New_GPG/src/options.cpp +++ b/plugins/New_GPG/src/options.cpp @@ -70,32 +70,32 @@ public: list_USERLIST.SetItemText(row, 4, tmp); mir_free(tmp); - char *tmp2 = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyID", ""); + char *tmp2 = UniGetContactSettingUtf(hContact, MODULENAME, "KeyID", ""); tmp = mir_a2u(tmp2); mir_free(tmp2); list_USERLIST.SetItemText(row, 1, (mir_wstrlen(tmp) > 1) ? tmp : L"not set"); mir_free(tmp); - tmp2 = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyMainName", ""); + tmp2 = UniGetContactSettingUtf(hContact, MODULENAME, "KeyMainName", ""); if (!toUTF16(tmp2).empty()) tmp = mir_wstrdup(toUTF16(tmp2).c_str()); else - tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyMainName", L""); + tmp = UniGetContactSettingUtf(hContact, MODULENAME, "KeyMainName", L""); mir_free(tmp2); list_USERLIST.SetItemText(row, 2, (mir_wstrlen(tmp) > 1) ? tmp : L"not set"); mir_free(tmp); - tmp2 = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyMainEmail", ""); + tmp2 = UniGetContactSettingUtf(hContact, MODULENAME, "KeyMainEmail", ""); if (!toUTF16(tmp2).empty()) tmp = mir_wstrdup(toUTF16(tmp2).c_str()); else - tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyMainEmail", L""); + tmp = UniGetContactSettingUtf(hContact, MODULENAME, "KeyMainEmail", L""); mir_free(tmp2); list_USERLIST.SetItemText(row, 3, (mir_wstrlen(tmp) > 1) ? tmp : L"not set"); mir_free(tmp); - if (db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0)) + if (db_get_b(hContact, MODULENAME, "GPGEncryption", 0)) list_USERLIST.SetCheckState(row, 1); user_data[i] = hContact; list_USERLIST.SetColumnWidth(0, LVSCW_AUTOSIZE); @@ -106,23 +106,23 @@ public: i++; } } - edit_LOG_FILE_EDIT.SetText(ptrW(UniGetContactSettingUtf(NULL, szGPGModuleName, "szLogFilePath", L""))); + edit_LOG_FILE_EDIT.SetText(ptrW(UniGetContactSettingUtf(NULL, MODULENAME, "szLogFilePath", L""))); - check_DEBUG_LOG.SetState(db_get_b(NULL, szGPGModuleName, "bDebugLog", 0)); + check_DEBUG_LOG.SetState(db_get_b(NULL, MODULENAME, "bDebugLog", 0)); check_JABBER_API.Enable(); check_AUTO_EXCHANGE.Enable(globals.bJabberAPI); { string keyinfo = Translate("Default private key ID"); keyinfo += ": "; - char *keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", ""); + char *keyid = UniGetContactSettingUtf(NULL, MODULENAME, "KeyID", ""); keyinfo += (mir_strlen(keyid) > 0) ? keyid : Translate("not set"); mir_free(keyid); lbl_CURRENT_KEY.SetTextA(keyinfo.c_str()); } - check_JABBER_API.SetState(db_get_b(NULL, szGPGModuleName, "bJabberAPI", 1)); - check_FILE_TRANSFERS.SetState(db_get_b(NULL, szGPGModuleName, "bFileTransfers", 0)); - check_AUTO_EXCHANGE.SetState(db_get_b(NULL, szGPGModuleName, "bAutoExchange", 0)); + check_JABBER_API.SetState(db_get_b(NULL, MODULENAME, "bJabberAPI", 1)); + check_FILE_TRANSFERS.SetState(db_get_b(NULL, MODULENAME, "bFileTransfers", 0)); + check_AUTO_EXCHANGE.SetState(db_get_b(NULL, MODULENAME, "bAutoExchange", 0)); //TODO: get rid of following s..t //////////////// @@ -135,19 +135,19 @@ public: virtual void OnApply() override { - db_set_b(NULL, szGPGModuleName, "bDebugLog", globals.bDebugLog = check_DEBUG_LOG.GetState()); + db_set_b(NULL, MODULENAME, "bDebugLog", globals.bDebugLog = check_DEBUG_LOG.GetState()); if (globals.bDebugLog) globals.debuglog.init(); - db_set_b(NULL, szGPGModuleName, "bJabberAPI", globals.bJabberAPI = check_JABBER_API.GetState()); - bool old_bFileTransfers = db_get_b(NULL, szGPGModuleName, "bFileTransfers", 0) != 0; - db_set_b(NULL, szGPGModuleName, "bFileTransfers", globals.bFileTransfers = check_FILE_TRANSFERS.GetState()); + db_set_b(NULL, MODULENAME, "bJabberAPI", globals.bJabberAPI = check_JABBER_API.GetState()); + bool old_bFileTransfers = db_get_b(NULL, MODULENAME, "bFileTransfers", 0) != 0; + db_set_b(NULL, MODULENAME, "bFileTransfers", globals.bFileTransfers = check_FILE_TRANSFERS.GetState()); if (globals.bFileTransfers != old_bFileTransfers) { - db_set_b(NULL, szGPGModuleName, "bSameAction", 0); + db_set_b(NULL, MODULENAME, "bSameAction", 0); globals.bSameAction = false; } - db_set_b(NULL, szGPGModuleName, "bAutoExchange", globals.bAutoExchange = check_AUTO_EXCHANGE.GetState()); - db_set_ws(NULL, szGPGModuleName, "szLogFilePath", ptrW(edit_LOG_FILE_EDIT.GetText())); + db_set_b(NULL, MODULENAME, "bAutoExchange", globals.bAutoExchange = check_AUTO_EXCHANGE.GetState()); + db_set_ws(NULL, MODULENAME, "szLogFilePath", ptrW(edit_LOG_FILE_EDIT.GetText())); } void onClick_DELETE_KEY_BUTTON(CCtrlButton*) @@ -170,10 +170,10 @@ public: hContact = metaGetMostOnline(meta); ismetacontact = true; } - tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyID", ""); + tmp = UniGetContactSettingUtf(hContact, MODULENAME, "KeyID", ""); for (auto &hcnttmp : Contacts()) { if (hcnttmp != hContact) { - char *tmp2 = UniGetContactSettingUtf(hcnttmp, szGPGModuleName, "KeyID", ""); + char *tmp2 = UniGetContactSettingUtf(hcnttmp, MODULENAME, "KeyID", ""); if (!mir_strcmp(tmp, tmp2)) { mir_free(tmp2); keep = true; @@ -219,35 +219,35 @@ public: for (int i = 0; i < count; i++) { hcnt = db_mc_getSub(meta, i); if (hcnt) { - db_unset(hcnt, szGPGModuleName, "KeyID"); - db_unset(hcnt, szGPGModuleName, "GPGPubKey"); - db_unset(hcnt, szGPGModuleName, "KeyMainName"); - db_unset(hcnt, szGPGModuleName, "KeyType"); - db_unset(hcnt, szGPGModuleName, "KeyMainEmail"); - db_unset(hcnt, szGPGModuleName, "KeyComment"); + db_unset(hcnt, MODULENAME, "KeyID"); + db_unset(hcnt, MODULENAME, "GPGPubKey"); + db_unset(hcnt, MODULENAME, "KeyMainName"); + db_unset(hcnt, MODULENAME, "KeyType"); + db_unset(hcnt, MODULENAME, "KeyMainEmail"); + db_unset(hcnt, MODULENAME, "KeyComment"); setClistIcon(hcnt); setSrmmIcon(hcnt); } } } else { - db_unset(hContact, szGPGModuleName, "KeyID"); - db_unset(hContact, szGPGModuleName, "GPGPubKey"); - db_unset(hContact, szGPGModuleName, "KeyMainName"); - db_unset(hContact, szGPGModuleName, "KeyType"); - db_unset(hContact, szGPGModuleName, "KeyMainEmail"); - db_unset(hContact, szGPGModuleName, "KeyComment"); + db_unset(hContact, MODULENAME, "KeyID"); + db_unset(hContact, MODULENAME, "GPGPubKey"); + db_unset(hContact, MODULENAME, "KeyMainName"); + db_unset(hContact, MODULENAME, "KeyType"); + db_unset(hContact, MODULENAME, "KeyMainEmail"); + db_unset(hContact, MODULENAME, "KeyComment"); setClistIcon(hContact); setSrmmIcon(hContact); } } else { - db_unset(user_data[item_num + 1], szGPGModuleName, "KeyID"); - db_unset(user_data[item_num + 1], szGPGModuleName, "GPGPubKey"); - db_unset(user_data[item_num + 1], szGPGModuleName, "KeyMainName"); - db_unset(user_data[item_num + 1], szGPGModuleName, "KeyType"); - db_unset(user_data[item_num + 1], szGPGModuleName, "KeyMainEmail"); - db_unset(user_data[item_num + 1], szGPGModuleName, "KeyComment"); + db_unset(user_data[item_num + 1], MODULENAME, "KeyID"); + db_unset(user_data[item_num + 1], MODULENAME, "GPGPubKey"); + db_unset(user_data[item_num + 1], MODULENAME, "KeyMainName"); + db_unset(user_data[item_num + 1], MODULENAME, "KeyType"); + db_unset(user_data[item_num + 1], MODULENAME, "KeyMainEmail"); + db_unset(user_data[item_num + 1], MODULENAME, "KeyComment"); setClistIcon(user_data[item_num + 1]); setSrmmIcon(user_data[item_num + 1]); } @@ -267,7 +267,7 @@ public: { wchar_t *tmp = GetFilePath(TranslateT("Export public key"), L"*", TranslateT(".asc pubkey file"), true); if (tmp) { - wstring str(ptrW(UniGetContactSettingUtf(user_data[item_num + 1], szGPGModuleName, "GPGPubKey", L""))); + wstring str(ptrW(UniGetContactSettingUtf(user_data[item_num + 1], MODULENAME, "GPGPubKey", L""))); wstring::size_type s = 0; while ((s = str.find(L"\r", s)) != wstring::npos) str.erase(s, 1); @@ -282,7 +282,7 @@ public: void onClick_COPY_KEY(CCtrlButton*) { if (OpenClipboard(m_hwnd)) { - char *szKey = UniGetContactSettingUtf(NULL, szGPGModuleName, "GPGPubKey", ""); + char *szKey = UniGetContactSettingUtf(NULL, MODULENAME, "GPGPubKey", ""); std::string str = szKey; mir_free(szKey); boost::algorithm::replace_all(str, "\n", "\r\n"); @@ -343,9 +343,9 @@ public: void setSrmmIcon(MCONTACT hContact); item_num = hdr->iItem; if (list_USERLIST.GetCheckState(hdr->iItem)) - db_set_b(user_data[item_num + 1], szGPGModuleName, "GPGEncryption", 1); + db_set_b(user_data[item_num + 1], MODULENAME, "GPGEncryption", 1); else - db_set_b(user_data[item_num + 1], szGPGModuleName, "GPGEncryption", 0); + db_set_b(user_data[item_num + 1], MODULENAME, "GPGEncryption", 0); setClistIcon(user_data[item_num + 1]); setSrmmIcon(user_data[item_num + 1]); } @@ -384,24 +384,24 @@ public: virtual void OnInitDialog() override { - edit_BIN_PATH.SetText(ptrW(UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"gpg.exe"))); - edit_HOME_DIR.SetText(ptrW(UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"gpg"))); + edit_BIN_PATH.SetText(ptrW(UniGetContactSettingUtf(NULL, MODULENAME, "szGpgBinPath", L"gpg.exe"))); + edit_HOME_DIR.SetText(ptrW(UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L"gpg"))); } virtual void OnApply() override { wchar_t tmp[8192]; - db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", edit_BIN_PATH.GetText()); + db_set_ws(NULL, MODULENAME, "szGpgBinPath", edit_BIN_PATH.GetText()); mir_wstrncpy(tmp, edit_HOME_DIR.GetText(), 8191); while (tmp[mir_wstrlen(tmp) - 1] == '\\') tmp[mir_wstrlen(tmp) - 1] = '\0'; - db_set_ws(NULL, szGPGModuleName, "szHomePath", tmp); + db_set_ws(NULL, MODULENAME, "szHomePath", tmp); } void onClick_SET_BIN_PATH(CCtrlButton*) { GetFilePath(TranslateT("Choose gpg.exe"), "szGpgBinPath", L"*.exe", TranslateT("EXE Executables")); - CMStringW tmp(ptrW(UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"gpg.exe"))); + CMStringW tmp(ptrW(UniGetContactSettingUtf(NULL, MODULENAME, "szGpgBinPath", L"gpg.exe"))); edit_BIN_PATH.SetText(tmp); bool gpg_exists = false; { @@ -409,8 +409,8 @@ public: gpg_exists = true; if (gpg_exists) { bool bad_version = false; - wchar_t *tmp_path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L""); - db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp); + wchar_t *tmp_path = UniGetContactSettingUtf(NULL, MODULENAME, "szGpgBinPath", L""); + db_set_ws(NULL, MODULENAME, "szGpgBinPath", tmp); string out; DWORD code; std::vector<wstring> cmd; @@ -424,7 +424,7 @@ public: globals.gpg_valid = true; gpg_launcher(params); globals.gpg_valid = old_gpg_state; - db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp_path); + db_set_ws(NULL, MODULENAME, "szGpgBinPath", tmp_path); mir_free(tmp_path); string::size_type p1 = out.find("(GnuPG) "); if (p1 != string::npos) { @@ -451,7 +451,7 @@ public: void onClick_SET_HOME_DIR(CCtrlButton*) { GetFolderPath(TranslateT("Set home directory"), "szHomePath"); - CMStringW tmp(ptrW(UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""))); + CMStringW tmp(ptrW(UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L""))); edit_HOME_DIR.SetText(tmp); wchar_t mir_path[MAX_PATH]; PathToAbsoluteW(L"\\", mir_path); @@ -475,33 +475,33 @@ public: virtual void OnInitDialog() override { - check_APPEND_TAGS.SetState(db_get_b(NULL, szGPGModuleName, "bAppendTags", 0)); - check_STRIP_TAGS.SetState(db_get_b(NULL, szGPGModuleName, "bStripTags", 0)); - edit_IN_OPEN_TAG.SetText(ptrW(UniGetContactSettingUtf(NULL, szGPGModuleName, "szInOpenTag", L"<GPGdec>"))); - edit_IN_CLOSE_TAG.SetText(ptrW(UniGetContactSettingUtf(NULL, szGPGModuleName, "szInCloseTag", L"</GPGdec>"))); - edit_OUT_OPEN_TAG.SetText(ptrW(UniGetContactSettingUtf(NULL, szGPGModuleName, "szOutOpenTag", L"<GPGenc>"))); - edit_OUT_CLOSE_TAG.SetText(ptrW(UniGetContactSettingUtf(NULL, szGPGModuleName, "szOutCloseTag", L"</GPGenc>"))); + check_APPEND_TAGS.SetState(db_get_b(NULL, MODULENAME, "bAppendTags", 0)); + check_STRIP_TAGS.SetState(db_get_b(NULL, MODULENAME, "bStripTags", 0)); + edit_IN_OPEN_TAG.SetText(ptrW(UniGetContactSettingUtf(NULL, MODULENAME, "szInOpenTag", L"<GPGdec>"))); + edit_IN_CLOSE_TAG.SetText(ptrW(UniGetContactSettingUtf(NULL, MODULENAME, "szInCloseTag", L"</GPGdec>"))); + edit_OUT_OPEN_TAG.SetText(ptrW(UniGetContactSettingUtf(NULL, MODULENAME, "szOutOpenTag", L"<GPGenc>"))); + edit_OUT_CLOSE_TAG.SetText(ptrW(UniGetContactSettingUtf(NULL, MODULENAME, "szOutCloseTag", L"</GPGenc>"))); } virtual void OnApply() override { - db_set_b(NULL, szGPGModuleName, "bAppendTags", globals.bAppendTags = check_APPEND_TAGS.GetState()); - db_set_b(NULL, szGPGModuleName, "bStripTags", globals.bStripTags = check_STRIP_TAGS.GetState()); + db_set_b(NULL, MODULENAME, "bAppendTags", globals.bAppendTags = check_APPEND_TAGS.GetState()); + db_set_b(NULL, MODULENAME, "bStripTags", globals.bStripTags = check_STRIP_TAGS.GetState()); { wchar_t *tmp = mir_wstrdup(edit_IN_OPEN_TAG.GetText()); - db_set_ws(NULL, szGPGModuleName, "szInOpenTag", tmp); + db_set_ws(NULL, MODULENAME, "szInOpenTag", tmp); mir_free(globals.inopentag); globals.inopentag = tmp; tmp = mir_wstrdup(edit_IN_CLOSE_TAG.GetText()); - db_set_ws(NULL, szGPGModuleName, "szInCloseTag", tmp); + db_set_ws(NULL, MODULENAME, "szInCloseTag", tmp); mir_free(globals.inclosetag); globals.inclosetag = tmp; tmp = mir_wstrdup(edit_OUT_OPEN_TAG.GetText()); - db_set_ws(NULL, szGPGModuleName, "szOutOpenTag", tmp); + db_set_ws(NULL, MODULENAME, "szOutOpenTag", tmp); mir_free(globals.outopentag); globals.outopentag = tmp; tmp = mir_wstrdup(edit_OUT_CLOSE_TAG.GetText()); - db_set_ws(NULL, szGPGModuleName, "szOutCloseTag", tmp); + db_set_ws(NULL, MODULENAME, "szOutCloseTag", tmp); mir_free(globals.outclosetag); globals.outclosetag = tmp; } @@ -524,13 +524,13 @@ public: virtual void OnInitDialog() override { - check_PRESCENSE_SUBSCRIPTION.SetState(db_get_b(NULL, szGPGModuleName, "bPresenceSigning", 0)); + check_PRESCENSE_SUBSCRIPTION.SetState(db_get_b(NULL, MODULENAME, "bPresenceSigning", 0)); check_PRESCENSE_SUBSCRIPTION.Enable(globals.bJabberAPI); } virtual void OnApply() override { - db_set_b(NULL, szGPGModuleName, "bPresenceSigning", globals.bPresenceSigning = check_PRESCENSE_SUBSCRIPTION.GetState()); + db_set_b(NULL, MODULENAME, "bPresenceSigning", globals.bPresenceSigning = check_PRESCENSE_SUBSCRIPTION.GetState()); } void onClick_EXPORT(CCtrlButton*) @@ -603,7 +603,7 @@ public: chk_ENABLE_ENCRYPTION.SetState(1); } if (hcnt) { - wchar_t *tmp = UniGetContactSettingUtf(hcnt, szGPGModuleName, "GPGPubKey", L""); + wchar_t *tmp = UniGetContactSettingUtf(hcnt, MODULENAME, "GPGPubKey", L""); wstring str = tmp; mir_free(tmp); tmp = nullptr; if (!str.empty()) { @@ -618,9 +618,9 @@ public: } } } - // char *tmp = UniGetContactSettingUtf(hcnt, szGPGModuleName, "KeyID_Prescense", ""); + // char *tmp = UniGetContactSettingUtf(hcnt, MODULENAME, "KeyID_Prescense", ""); if (!globals.hcontact_data[hcnt].key_in_prescense.empty()) { - char *tmp2 = UniGetContactSettingUtf(hcnt, szGPGModuleName, "KeyID", ""); + char *tmp2 = UniGetContactSettingUtf(hcnt, MODULENAME, "KeyID", ""); if (!tmp2[0]) { string out; DWORD code; @@ -668,8 +668,8 @@ public: virtual void OnDestroy() override { GetWindowRect(m_hwnd, &globals.load_key_rect); - db_set_dw(NULL, szGPGModuleName, "LoadKeyWindowX", globals.load_key_rect.left); - db_set_dw(NULL, szGPGModuleName, "LoadKeyWindowY", globals.load_key_rect.top); + db_set_dw(NULL, MODULENAME, "LoadKeyWindowX", globals.load_key_rect.left); + db_set_dw(NULL, MODULENAME, "LoadKeyWindowY", globals.load_key_rect.top); edit_p_PubKeyEdit = nullptr; } @@ -716,12 +716,12 @@ public: for (int i = 0; i < count; i++) { MCONTACT hcnt = db_mc_getSub(hContact, i); if (hcnt) - db_set_ws(hcnt, szGPGModuleName, "GPGPubKey", key_buf.substr(ws1, ws2 - ws1).c_str()); + db_set_ws(hcnt, MODULENAME, "GPGPubKey", key_buf.substr(ws1, ws2 - ws1).c_str()); } } - else db_set_ws(metaGetMostOnline(hContact), szGPGModuleName, "GPGPubKey", key_buf.substr(ws1, ws2 - ws1).c_str()); + else db_set_ws(metaGetMostOnline(hContact), MODULENAME, "GPGPubKey", key_buf.substr(ws1, ws2 - ws1).c_str()); } - else db_set_ws(hContact, szGPGModuleName, "GPGPubKey", key_buf.substr(ws1, ws2 - ws1).c_str()); + else db_set_ws(hContact, MODULENAME, "GPGPubKey", key_buf.substr(ws1, ws2 - ws1).c_str()); } tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * (key_buf.length() + 1)); mir_wstrcpy(tmp, key_buf.substr(ws1, ws2 - ws1).c_str()); @@ -733,14 +733,14 @@ public: DWORD exitcode; { MCONTACT hcnt = db_mc_tryMeta(hContact); - ptmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + ptmp = UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L""); wcsncpy(tmp2, ptmp, MAX_PATH - 1); mir_free(ptmp); mir_wstrncat(tmp2, L"\\", _countof(tmp2) - mir_wstrlen(tmp2)); mir_wstrncat(tmp2, L"temporary_exported.asc", _countof(tmp2) - mir_wstrlen(tmp2)); boost::filesystem::remove(tmp2); wfstream f(tmp2, std::ios::out); - ptmp = UniGetContactSettingUtf(hcnt, szGPGModuleName, "GPGPubKey", L""); + ptmp = UniGetContactSettingUtf(hcnt, MODULENAME, "GPGPubKey", L""); wstring str = ptmp; mir_free(ptmp); wstring::size_type s = 0; @@ -771,12 +771,12 @@ public: for (int i = 0; i < count; i++) { MCONTACT hcnt = db_mc_getSub(hContact, i); if (hcnt) - db_unset(hcnt, szGPGModuleName, "bAlwatsTrust"); + db_unset(hcnt, MODULENAME, "bAlwatsTrust"); } } - else db_unset(metaGetMostOnline(hContact), szGPGModuleName, "bAlwatsTrust"); + else db_unset(metaGetMostOnline(hContact), MODULENAME, "bAlwatsTrust"); } - else db_unset(hContact, szGPGModuleName, "bAlwatsTrust"); + else db_unset(hContact, MODULENAME, "bAlwatsTrust"); } { if (output.find("already in secret keyring") != string::npos) { @@ -797,14 +797,14 @@ public: for (int i = 0; i < count; i++) { MCONTACT hcnt = db_mc_getSub(hContact, i); if (hcnt) - db_set_s(hcnt, szGPGModuleName, "KeyID", tmp3); + db_set_s(hcnt, MODULENAME, "KeyID", tmp3); } } else - db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyID", tmp3); + db_set_s(metaGetMostOnline(hContact), MODULENAME, "KeyID", tmp3); } else - db_set_s(hContact, szGPGModuleName, "KeyID", tmp3); + db_set_s(hContact, MODULENAME, "KeyID", tmp3); } mir_free(tmp3); } @@ -840,12 +840,12 @@ public: for (int i = 0; i < count; i++) { MCONTACT hcnt = db_mc_getSub(hContact, i); if (hcnt) - db_set_s(hcnt, szGPGModuleName, "KeyMainName", output.substr(s, s2 - s - 1).c_str()); + db_set_s(hcnt, MODULENAME, "KeyMainName", output.substr(s, s2 - s - 1).c_str()); } } - else db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainName", output.substr(s, s2 - s - 1).c_str()); + else db_set_s(metaGetMostOnline(hContact), MODULENAME, "KeyMainName", output.substr(s, s2 - s - 1).c_str()); } - else db_set_s(hContact, szGPGModuleName, "KeyMainName", output.substr(s, s2 - s - 1).c_str()); + else db_set_s(hContact, MODULENAME, "KeyMainName", output.substr(s, s2 - s - 1).c_str()); } mir_free(tmp3); } @@ -870,12 +870,12 @@ public: for (int i = 0; i < count; i++) { MCONTACT hcnt = db_mc_getSub(hContact, i); if (hcnt) - db_set_s(hcnt, szGPGModuleName, "KeyComment", output.substr(s2, s - s2).c_str()); + db_set_s(hcnt, MODULENAME, "KeyComment", output.substr(s2, s - s2).c_str()); } } - else db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyComment", output.substr(s2, s - s2).c_str()); + else db_set_s(metaGetMostOnline(hContact), MODULENAME, "KeyComment", output.substr(s2, s - s2).c_str()); } - else db_set_s(hContact, szGPGModuleName, "KeyComment", output.substr(s2, s - s2).c_str()); + else db_set_s(hContact, MODULENAME, "KeyComment", output.substr(s2, s - s2).c_str()); } mir_free(tmp3); s += 3; @@ -890,12 +890,12 @@ public: for (int i = 0; i < count; i++) { MCONTACT hcnt = db_mc_getSub(hContact, i); if (hcnt) - db_set_s(hcnt, szGPGModuleName, "KeyMainEmail", output.substr(s, s2 - s).c_str()); + db_set_s(hcnt, MODULENAME, "KeyMainEmail", output.substr(s, s2 - s).c_str()); } } - else db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainEmail", output.substr(s, s2 - s).c_str()); + else db_set_s(metaGetMostOnline(hContact), MODULENAME, "KeyMainEmail", output.substr(s, s2 - s).c_str()); } - else db_set_s(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s, s2 - s).c_str()); + else db_set_s(hContact, MODULENAME, "KeyMainEmail", output.substr(s, s2 - s).c_str()); } mir_free(tmp3); tmp = mir_wstrdup(toUTF16(output.substr(s, s2 - s)).c_str()); @@ -914,12 +914,12 @@ public: for (int i = 0; i < count; i++) { MCONTACT hcnt = db_mc_getSub(hContact, i); if (hcnt) - db_set_s(hcnt, szGPGModuleName, "KeyMainEmail", output.substr(s2, s - s2).c_str()); + db_set_s(hcnt, MODULENAME, "KeyMainEmail", output.substr(s2, s - s2).c_str()); } } - else db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainEmail", output.substr(s2, s - s2).c_str()); + else db_set_s(metaGetMostOnline(hContact), MODULENAME, "KeyMainEmail", output.substr(s2, s - s2).c_str()); } - else db_set_s(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s2, s - s2).c_str()); + else db_set_s(hContact, MODULENAME, "KeyMainEmail", output.substr(s2, s - s2).c_str()); } mir_free(tmp3); tmp = mir_wstrdup(toUTF16(output.substr(s2, s - s2)).c_str()); @@ -938,7 +938,7 @@ public: } } if (!hContact) { - wchar_t *fp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyID", L""); + wchar_t *fp = UniGetContactSettingUtf(hContact, MODULENAME, "KeyID", L""); { string out; DWORD code; @@ -961,7 +961,7 @@ public: while ((s = out.find("\r", s)) != string::npos) { out.erase(s, 1); } - db_set_s(hContact, szGPGModuleName, "GPGPubKey", out.c_str()); + db_set_s(hContact, MODULENAME, "GPGPubKey", out.c_str()); } } tmp = mir_wstrdup(toUTF16(output).c_str()); @@ -979,23 +979,23 @@ public: MCONTACT hcnt = db_mc_getSub(hContact, i); if (hcnt) { if (!isContactSecured(hcnt)) - db_set_b(hcnt, szGPGModuleName, "GPGEncryption", 1); + db_set_b(hcnt, MODULENAME, "GPGEncryption", 1); else - db_set_b(hcnt, szGPGModuleName, "GPGEncryption", 0); + db_set_b(hcnt, MODULENAME, "GPGEncryption", 0); setSrmmIcon(hContact); setClistIcon(hContact); } } } else if (!isContactSecured(hContact)) - db_set_b(metaGetMostOnline(hContact), szGPGModuleName, "GPGEncryption", 1); + db_set_b(metaGetMostOnline(hContact), MODULENAME, "GPGEncryption", 1); else - db_set_b(metaGetMostOnline(hContact), szGPGModuleName, "GPGEncryption", 0); + db_set_b(metaGetMostOnline(hContact), MODULENAME, "GPGEncryption", 0); } else if (!isContactSecured(hContact)) - db_set_b(hContact, szGPGModuleName, "GPGEncryption", 1); + db_set_b(hContact, MODULENAME, "GPGEncryption", 1); else - db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0); + db_set_b(hContact, MODULENAME, "GPGEncryption", 0); } } this->Close(); @@ -1064,7 +1064,7 @@ int GpgOptInit(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = {}; odp.szGroup.w = LPGENW("Services"); - odp.szTitle.w = _T(szGPGModuleName); + odp.szTitle.w = _T(MODULENAME); odp.szTab.w = LPGENW("Main"); odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; diff --git a/plugins/New_GPG/src/srmm.cpp b/plugins/New_GPG/src/srmm.cpp index 0cfa907931..d9e8187c7a 100755 --- a/plugins/New_GPG/src/srmm.cpp +++ b/plugins/New_GPG/src/srmm.cpp @@ -42,14 +42,14 @@ int __cdecl onIconPressed(WPARAM wParam, LPARAM lParam) else if(db_mc_isSub(hContact)) hMeta = db_mc_getMeta(hContact); StatusIconClickData *sicd = (StatusIconClickData *)lParam; - if(mir_strcmp(sicd->szModule, szGPGModuleName)) + if(mir_strcmp(sicd->szModule, MODULENAME)) return 0; // not our event - BYTE enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0); + BYTE enc = db_get_b(hContact, MODULENAME, "GPGEncryption", 0); if(enc) { - db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0); - hMeta?db_set_b(hMeta, szGPGModuleName, "GPGEncryption", 0):0; + db_set_b(hContact, MODULENAME, "GPGEncryption", 0); + hMeta?db_set_b(hMeta, MODULENAME, "GPGEncryption", 0):0; setSrmmIcon(hContact); setClistIcon(hContact); } @@ -64,16 +64,16 @@ int __cdecl onIconPressed(WPARAM wParam, LPARAM lParam) } else { - db_set_b(hContact, szGPGModuleName, "GPGEncryption", 1); - hMeta?db_set_b(hMeta, szGPGModuleName, "GPGEncryption", 1):0; + db_set_b(hContact, MODULENAME, "GPGEncryption", 1); + hMeta?db_set_b(hMeta, MODULENAME, "GPGEncryption", 1):0; setSrmmIcon(hContact); setClistIcon(hContact); return 0; } if(isContactHaveKey(hContact)) { - db_set_b(hContact, szGPGModuleName, "GPGEncryption", 1); - hMeta?db_set_b(hMeta, szGPGModuleName, "GPGEncryption", 1):0; + db_set_b(hContact, MODULENAME, "GPGEncryption", 1); + hMeta?db_set_b(hMeta, MODULENAME, "GPGEncryption", 1):0; setSrmmIcon(hContact); setClistIcon(hContact); } diff --git a/plugins/New_GPG/src/stdafx.h b/plugins/New_GPG/src/stdafx.h index 2353feb602..77b649545a 100755 --- a/plugins/New_GPG/src/stdafx.h +++ b/plugins/New_GPG/src/stdafx.h @@ -89,9 +89,7 @@ using std::fstream; struct CMPlugin : public PLUGIN<CMPlugin> { - CMPlugin() : - PLUGIN<CMPlugin>(szGPGModuleName) - {} + CMPlugin(); }; #endif diff --git a/plugins/New_GPG/src/ui.cpp b/plugins/New_GPG/src/ui.cpp index 17699e40e6..69216fcb5a 100755 --- a/plugins/New_GPG/src/ui.cpp +++ b/plugins/New_GPG/src/ui.cpp @@ -40,7 +40,7 @@ void CDlgEncryptedFileMsgBox::onClick_IGNORE(CCtrlButton*) { if (chk_REMEMBER.GetState()) { - db_set_b(NULL, szGPGModuleName, "bSameAction", 1); + db_set_b(NULL, MODULENAME, "bSameAction", 1); globals.bSameAction = true; } this->Close(); @@ -51,9 +51,9 @@ void CDlgEncryptedFileMsgBox::onClick_DECRYPT(CCtrlButton*) globals.bDecryptFiles = true; if (chk_REMEMBER.GetState()) { - db_set_b(NULL, szGPGModuleName, "bFileTransfers", 1); + db_set_b(NULL, MODULENAME, "bFileTransfers", 1); globals.bFileTransfers = true; - db_set_b(NULL, szGPGModuleName, "bSameAction", 0); + db_set_b(NULL, MODULENAME, "bSameAction", 0); globals.bSameAction = false; } this->Close(); @@ -110,7 +110,7 @@ void CDlgChangePasswdMsgBox::onClick_OK(CCtrlButton*) new_pass = toUTF8(edit_NEW_PASSWD1.GetText()); old_pass = toUTF8(edit_OLD_PASSWD.GetText()); bool old_pass_match = false; - wchar_t *pass = UniGetContactSettingUtf(NULL, szGPGModuleName, "szKeyPassword", L""); + wchar_t *pass = UniGetContactSettingUtf(NULL, MODULENAME, "szKeyPassword", L""); if (!mir_wstrcmp(pass, edit_OLD_PASSWD.GetText())) old_pass_match = true; mir_free(pass); @@ -120,7 +120,7 @@ void CDlgChangePasswdMsgBox::onClick_OK(CCtrlButton*) string dbsetting = "szKey_"; dbsetting += toUTF8(globals.key_id_global); dbsetting += "_Password"; - pass = UniGetContactSettingUtf(NULL, szGPGModuleName, dbsetting.c_str(), L""); + pass = UniGetContactSettingUtf(NULL, MODULENAME, dbsetting.c_str(), L""); if (!mir_wstrcmp(pass, edit_OLD_PASSWD.GetText())) old_pass_match = true; mir_free(pass); @@ -217,7 +217,7 @@ void CDlgFirstRun::OnInitDialog() combo_ACCOUNT.SelectString(TranslateT("Default")); string keyinfo = Translate("key ID"); keyinfo += ": "; - char *keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", ""); + char *keyid = UniGetContactSettingUtf(NULL, MODULENAME, "KeyID", ""); keyinfo += (mir_strlen(keyid) > 0) ? keyid : Translate("not set"); mir_free(keyid); lbl_KEY_ID.SetTextA(keyinfo.c_str()); @@ -424,32 +424,32 @@ void CDlgFirstRun::onClick_DELETE_KEY(CCtrlButton*) { char *buf = mir_strdup(combo_ACCOUNT.GetTextA()); if (!mir_strcmp(buf, Translate("Default"))) { - db_unset(NULL, szGPGModuleName, "GPGPubKey"); - db_unset(NULL, szGPGModuleName, "KeyID"); - db_unset(NULL, szGPGModuleName, "KeyComment"); - db_unset(NULL, szGPGModuleName, "KeyMainName"); - db_unset(NULL, szGPGModuleName, "KeyMainEmail"); - db_unset(NULL, szGPGModuleName, "KeyType"); + db_unset(NULL, MODULENAME, "GPGPubKey"); + db_unset(NULL, MODULENAME, "KeyID"); + db_unset(NULL, MODULENAME, "KeyComment"); + db_unset(NULL, MODULENAME, "KeyMainName"); + db_unset(NULL, MODULENAME, "KeyMainEmail"); + db_unset(NULL, MODULENAME, "KeyType"); } else { std::string acc_str = buf; acc_str += "_GPGPubKey"; - db_unset(NULL, szGPGModuleName, acc_str.c_str()); + db_unset(NULL, MODULENAME, acc_str.c_str()); acc_str = buf; acc_str += "_KeyMainName"; - db_unset(NULL, szGPGModuleName, acc_str.c_str()); + db_unset(NULL, MODULENAME, acc_str.c_str()); acc_str = buf; acc_str += "_KeyID"; - db_unset(NULL, szGPGModuleName, acc_str.c_str()); + db_unset(NULL, MODULENAME, acc_str.c_str()); acc_str = buf; acc_str += "_KeyComment"; - db_unset(NULL, szGPGModuleName, acc_str.c_str()); + db_unset(NULL, MODULENAME, acc_str.c_str()); acc_str = buf; acc_str += "_KeyMainEmail"; - db_unset(NULL, szGPGModuleName, acc_str.c_str()); + db_unset(NULL, MODULENAME, acc_str.c_str()); acc_str = buf; acc_str += "_KeyType"; - db_unset(NULL, szGPGModuleName, acc_str.c_str()); + db_unset(NULL, MODULENAME, acc_str.c_str()); } if (buf) mir_free(buf); @@ -500,20 +500,20 @@ void CDlgFirstRun::onClick_OK(CCtrlButton*) { char *buf = mir_strdup(combo_ACCOUNT.GetTextA()); if (!mir_strcmp(buf, Translate("Default"))) { - db_set_s(NULL, szGPGModuleName, "GPGPubKey", out.c_str()); - db_set_ws(NULL, szGPGModuleName, "KeyMainName", name); - db_set_ws(NULL, szGPGModuleName, "KeyID", fp); + db_set_s(NULL, MODULENAME, "GPGPubKey", out.c_str()); + db_set_ws(NULL, MODULENAME, "KeyMainName", name); + db_set_ws(NULL, MODULENAME, "KeyID", fp); } else { std::string acc_str = buf; acc_str += "_GPGPubKey"; - db_set_s(NULL, szGPGModuleName, acc_str.c_str(), out.c_str()); + db_set_s(NULL, MODULENAME, acc_str.c_str(), out.c_str()); acc_str = buf; acc_str += "_KeyMainName"; - db_set_ws(NULL, szGPGModuleName, acc_str.c_str(), name); + db_set_ws(NULL, MODULENAME, acc_str.c_str(), name); acc_str = buf; acc_str += "_KeyID"; - db_set_ws(NULL, szGPGModuleName, acc_str.c_str(), fp); + db_set_ws(NULL, MODULENAME, acc_str.c_str(), fp); } if (!mir_strcmp(buf, Translate("Default"))) { wstring keyinfo = TranslateT("Default private key ID"); @@ -533,7 +533,7 @@ void CDlgFirstRun::onClick_OK(CCtrlButton*) dbsetting += keyid; mir_free(keyid); dbsetting += "_Password"; - db_set_ws(NULL, szGPGModuleName, dbsetting.c_str(), passwd); + db_set_ws(NULL, MODULENAME, dbsetting.c_str(), passwd); } mir_free(passwd); delete[] name; @@ -549,7 +549,7 @@ void CDlgFirstRun::onChange_ACCOUNT(CCtrlCombo*) if (!mir_strcmp(buf, Translate("Default"))) { string keyinfo = Translate("key ID"); keyinfo += ": "; - char *keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", ""); + char *keyid = UniGetContactSettingUtf(NULL, MODULENAME, "KeyID", ""); keyinfo += (mir_strlen(keyid) > 0) ? keyid : Translate("not set"); mir_free(keyid); lbl_KEY_ID.SetTextA(keyinfo.c_str()); @@ -559,7 +559,7 @@ void CDlgFirstRun::onChange_ACCOUNT(CCtrlCombo*) keyinfo += ": "; std::string acc_str = buf; acc_str += "_KeyID"; - char *keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, acc_str.c_str(), ""); + char *keyid = UniGetContactSettingUtf(NULL, MODULENAME, acc_str.c_str(), ""); keyinfo += (mir_strlen(keyid) > 0) ? keyid : Translate("not set"); mir_free(keyid); lbl_KEY_ID.SetTextA(keyinfo.c_str()); @@ -584,8 +584,8 @@ void CDlgFirstRun::onChange_KEY_LIST(CCtrlListView::TEventInfo *ev) //TODO: chec void CDlgFirstRun::OnDestroy() { GetWindowRect(m_hwnd, &globals.firstrun_rect); - db_set_dw(NULL, szGPGModuleName, "FirstrunWindowX", globals.firstrun_rect.left); - db_set_dw(NULL, szGPGModuleName, "FirstrunWindowY", globals.firstrun_rect.top); + db_set_dw(NULL, MODULENAME, "FirstrunWindowX", globals.firstrun_rect.left); + db_set_dw(NULL, MODULENAME, "FirstrunWindowY", globals.firstrun_rect.top); } @@ -710,7 +710,7 @@ void CDlgFirstRun::refresh_key_list() setting += pa->szModuleName; setting += ")"; setting += "_KeyID"; - wchar_t *str = UniGetContactSettingUtf(NULL, szGPGModuleName, setting.c_str(), L""); + wchar_t *str = UniGetContactSettingUtf(NULL, MODULENAME, setting.c_str(), L""); if (key_id == str) { if (!accs.empty()) accs += L","; @@ -772,7 +772,7 @@ void CDlgGpgBinOpts::OnInitDialog() { ptrW tmp; if (!gpg_exists) { - tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", (SHGetValueW(HKEY_CURRENT_USER, L"Software\\GNU\\GnuPG", L"gpgProgram", 0, (void*)path.c_str(), &len) == ERROR_SUCCESS) ? path.c_str() : L""); + tmp = UniGetContactSettingUtf(NULL, MODULENAME, "szGpgBinPath", (SHGetValueW(HKEY_CURRENT_USER, L"Software\\GNU\\GnuPG", L"gpgProgram", 0, (void*)path.c_str(), &len) == ERROR_SUCCESS) ? path.c_str() : L""); if (tmp[0]) if (!boost::filesystem::exists((wchar_t*)tmp)) MessageBox(nullptr, TranslateT("Wrong GPG binary location found in system.\nPlease choose another location"), TranslateT("Warning"), MB_OK); @@ -781,7 +781,7 @@ void CDlgGpgBinOpts::OnInitDialog() edit_BIN_PATH.SetText(tmp); if (gpg_exists/* && lang_exists*/) { - db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp); + db_set_ws(NULL, MODULENAME, "szGpgBinPath", tmp); string out; DWORD code; std::vector<wstring> cmd; @@ -795,7 +795,7 @@ void CDlgGpgBinOpts::OnInitDialog() globals.gpg_valid = true; gpg_launcher(params); globals.gpg_valid = _gpg_valid; //TODO: check this - db_unset(NULL, szGPGModuleName, "szGpgBinPath"); + db_unset(NULL, MODULENAME, "szGpgBinPath"); string::size_type p1 = out.find("(GnuPG) "); if (p1 != string::npos) { p1 += mir_strlen("(GnuPG) "); @@ -811,7 +811,7 @@ void CDlgGpgBinOpts::OnInitDialog() } } { - ptrW tmp(UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"")); + ptrW tmp(UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L"")); if (!tmp[0]) { wchar_t mir_path[MAX_PATH]; PathToAbsoluteW(L"\\", mir_path); @@ -836,7 +836,7 @@ void CDlgGpgBinOpts::OnInitDialog() void CDlgGpgBinOpts::onClick_SET_BIN_PATH(CCtrlButton*) { GetFilePath(L"Choose gpg.exe", "szGpgBinPath", L"*.exe", L"EXE Executables"); - CMStringW tmp(ptrW(UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"gpg.exe"))); + CMStringW tmp(ptrW(UniGetContactSettingUtf(NULL, MODULENAME, "szGpgBinPath", L"gpg.exe"))); edit_BIN_PATH.SetText(tmp); wchar_t mir_path[MAX_PATH]; PathToAbsoluteW(L"\\", mir_path); @@ -850,7 +850,7 @@ void CDlgGpgBinOpts::onClick_SET_BIN_PATH(CCtrlButton*) void CDlgGpgBinOpts::onClick_SET_HOME_DIR(CCtrlButton*) { GetFolderPath(L"Set home directory", "szHomePath"); - CMStringW tmp(ptrW(UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""))); + CMStringW tmp(ptrW(UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L""))); edit_HOME_DIR.SetText(tmp); wchar_t mir_path[MAX_PATH]; PathToAbsoluteW(L"\\", mir_path); @@ -867,7 +867,7 @@ void CDlgGpgBinOpts::onClick_OK(CCtrlButton*) { gpg_save_paths(edit_BIN_PATH.GetText(), edit_HOME_DIR.GetText()); globals.gpg_valid = true; - db_set_b(NULL, szGPGModuleName, "FirstRun", 0); + db_set_b(NULL, MODULENAME, "FirstRun", 0); this->Hide(); CDlgFirstRun *d = new CDlgFirstRun; d->Show(); @@ -882,9 +882,9 @@ void CDlgGpgBinOpts::onClick_GENERATE_RANDOM(CCtrlButton*) globals.gpg_valid = true; if (gpg_use_new_random_key()) { - db_set_b(NULL, szGPGModuleName, "bAutoExchange", globals.bAutoExchange = chk_AUTO_EXCHANGE.GetState()); + db_set_b(NULL, MODULENAME, "bAutoExchange", globals.bAutoExchange = chk_AUTO_EXCHANGE.GetState()); globals.gpg_valid = true; - db_set_b(NULL, szGPGModuleName, "FirstRun", 0); + db_set_b(NULL, MODULENAME, "FirstRun", 0); this->Close(); } } @@ -910,9 +910,9 @@ void CDlgNewKey::OnInitDialog() { //new_key_hcnt_mutex.unlock(); SetWindowPos(m_hwnd, nullptr, globals.new_key_rect.left, globals.new_key_rect.top, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW); - wchar_t *tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", L""); + wchar_t *tmp = UniGetContactSettingUtf(hContact, MODULENAME, "GPGPubKey", L""); lbl_MESSAGE.SetText(tmp[0] ? TranslateT("There is existing key for contact, would you like to replace it with new key?") : TranslateT("New public key was received, do you want to import it?")); - btn_IMPORT_AND_USE.Enable(db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0)); + btn_IMPORT_AND_USE.Enable(db_get_b(hContact, MODULENAME, "GPGEncryption", 0)); btn_IMPORT.SetText(tmp[0] ? TranslateT("Replace") : TranslateT("Accept")); mir_free(tmp); tmp = new wchar_t[256]; @@ -923,8 +923,8 @@ void CDlgNewKey::OnInitDialog() void CDlgNewKey::OnDestroy() { GetWindowRect(m_hwnd, &globals.new_key_rect); - db_set_dw(NULL, szGPGModuleName, "NewKeyWindowX", globals.new_key_rect.left); - db_set_dw(NULL, szGPGModuleName, "NewKeyWindowY", globals.new_key_rect.top); + db_set_dw(NULL, MODULENAME, "NewKeyWindowX", globals.new_key_rect.left); + db_set_dw(NULL, MODULENAME, "NewKeyWindowY", globals.new_key_rect.top); } void CDlgNewKey::onClick_IMPORT(CCtrlButton*) { @@ -934,7 +934,7 @@ void CDlgNewKey::onClick_IMPORT(CCtrlButton*) void CDlgNewKey::onClick_IMPORT_AND_USE(CCtrlButton*) { ImportKey(hContact, new_key); - db_set_b(hContact, szGPGModuleName, "GPGEncryption", 1); + db_set_b(hContact, MODULENAME, "GPGEncryption", 1); void setSrmmIcon(MCONTACT hContact); void setClistIcon(MCONTACT hContact); setSrmmIcon(hContact); @@ -1042,7 +1042,7 @@ void CDlgKeyGen::onClick_OK(CCtrlButton*) mir_free(tmp); } { //generating key file - wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *tmp = UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L""); char *tmp2;// = mir_u2a(tmp); path = tmp; mir_free(tmp); @@ -1136,8 +1136,8 @@ void CDlgKeyGen::onClick_CANCEL(CCtrlButton*) void CDlgKeyGen::OnDestroy() { GetWindowRect(m_hwnd, &globals.key_gen_rect); - db_set_dw(NULL, szGPGModuleName, "KeyGenWindowX", globals.key_gen_rect.left); - db_set_dw(NULL, szGPGModuleName, "KeyGenWindowY", globals.key_gen_rect.top); + db_set_dw(NULL, MODULENAME, "KeyGenWindowX", globals.key_gen_rect.left); + db_set_dw(NULL, MODULENAME, "KeyGenWindowY", globals.key_gen_rect.top); } CDlgLoadExistingKey::CDlgLoadExistingKey() : CDlgBase(g_plugin, IDD_LOAD_EXISTING_KEY), @@ -1261,8 +1261,8 @@ void CDlgLoadExistingKey::OnInitDialog() void CDlgLoadExistingKey::OnDestroy() { GetWindowRect(m_hwnd, &globals.load_existing_key_rect); - db_set_dw(NULL, szGPGModuleName, "LoadExistingKeyWindowX", globals.load_existing_key_rect.left); - db_set_dw(NULL, szGPGModuleName, "LoadExistingKeyWindowY", globals.load_existing_key_rect.top); + db_set_dw(NULL, MODULENAME, "LoadExistingKeyWindowX", globals.load_existing_key_rect.left); + db_set_dw(NULL, MODULENAME, "LoadExistingKeyWindowY", globals.load_existing_key_rect.top); } void CDlgLoadExistingKey::onClick_OK(CCtrlButton*) { @@ -1339,8 +1339,8 @@ void CDlgImportKey::OnInitDialog() void CDlgImportKey::OnDestroy() { GetWindowRect(m_hwnd, &globals.import_key_rect); - db_set_dw(NULL, szGPGModuleName, "ImportKeyWindowX", globals.import_key_rect.left); - db_set_dw(NULL, szGPGModuleName, "ImportKeyWindowY", globals.import_key_rect.top); + db_set_dw(NULL, MODULENAME, "ImportKeyWindowX", globals.import_key_rect.left); + db_set_dw(NULL, MODULENAME, "ImportKeyWindowY", globals.import_key_rect.top); } void CDlgImportKey::onClick_IMPORT(CCtrlButton*) { @@ -1374,7 +1374,7 @@ btn_OK(this, IDOK), btn_CANCEL(this, IDCANCEL) } void CDlgKeyPasswordMsgBox::OnInitDialog() { - inkeyid = UniGetContactSettingUtf(hContact, szGPGModuleName, "InKeyID", ""); + inkeyid = UniGetContactSettingUtf(hContact, MODULENAME, "InKeyID", ""); SetWindowPos(m_hwnd, nullptr, globals.key_password_rect.left, globals.key_password_rect.top, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW); { @@ -1389,23 +1389,23 @@ void CDlgKeyPasswordMsgBox::OnDestroy() { mir_free(inkeyid); GetWindowRect(m_hwnd, &globals.key_password_rect); - db_set_dw(NULL, szGPGModuleName, "PasswordWindowX", globals.key_password_rect.left); - db_set_dw(NULL, szGPGModuleName, "PasswordWindowY", globals.key_password_rect.top); + db_set_dw(NULL, MODULENAME, "PasswordWindowX", globals.key_password_rect.left); + db_set_dw(NULL, MODULENAME, "PasswordWindowY", globals.key_password_rect.top); } void CDlgKeyPasswordMsgBox::onClick_OK(CCtrlButton*) { wchar_t *tmp = mir_wstrdup(edit_KEY_PASSWORD.GetText()); if (tmp && tmp[0]) { if (chk_SAVE_PASSWORD.GetState()) { - inkeyid = UniGetContactSettingUtf(hContact, szGPGModuleName, "InKeyID", ""); + inkeyid = UniGetContactSettingUtf(hContact, MODULENAME, "InKeyID", ""); if (inkeyid && inkeyid[0] && !chk_DEFAULT_PASSWORD.GetState()) { string dbsetting = "szKey_"; dbsetting += inkeyid; dbsetting += "_Password"; - db_set_ws(NULL, szGPGModuleName, dbsetting.c_str(), tmp); + db_set_ws(NULL, MODULENAME, dbsetting.c_str(), tmp); } else - db_set_ws(NULL, szGPGModuleName, "szKeyPassword", tmp); + db_set_ws(NULL, MODULENAME, "szKeyPassword", tmp); } if (globals.password) mir_free(globals.password); diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index f8c2531190..aaf36d1e85 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -63,7 +63,7 @@ void GetFilePath(wchar_t *WindowTittle, char *szSetting, wchar_t *szExt, wchar_t pfilter[mir_wstrlen(pfilter) + 1] = '\0'; pfilter[mir_wstrlen(pfilter) + 2] = '\0'; ofn.lpstrFilter = filter; - tmp = UniGetContactSettingUtf(0, szGPGModuleName, szSetting, L""); + tmp = UniGetContactSettingUtf(0, MODULENAME, szSetting, L""); wcsncpy(str, tmp, _countof(str) - 1); mir_free(tmp); if (mir_wstrlen(str) < 2) @@ -73,7 +73,7 @@ void GetFilePath(wchar_t *WindowTittle, char *szSetting, wchar_t *szExt, wchar_t ofn.nMaxFileTitle = MAX_PATH; if (!GetOpenFileName(&ofn)) return; - db_set_ws(0, szGPGModuleName, szSetting, str); + db_set_ws(0, MODULENAME, szSetting, str); } wchar_t *GetFilePath(wchar_t *WindowTittle, wchar_t *szExt, wchar_t *szExtDesc, bool save_file) @@ -120,7 +120,7 @@ void GetFolderPath(wchar_t *WindowTittle, char*) if (pidl != nullptr) { wchar_t path[MAX_PATH]; if (SHGetPathFromIDList(pidl, path)) { - db_set_ws(NULL, szGPGModuleName, "szHomePath", path); + db_set_ws(NULL, MODULENAME, "szHomePath", path); } IMalloc * imalloc = nullptr; if (SUCCEEDED(SHGetMalloc(&imalloc))) { @@ -155,21 +155,21 @@ INT_PTR SendKey(WPARAM w, LPARAM) key_id_str += "_KeyID"; acc_str += "_GPGPubKey"; } - szMessage = UniGetContactSettingUtf(NULL, szGPGModuleName, acc_str.empty() ? "GPGPubKey" : acc_str.c_str(), ""); + szMessage = UniGetContactSettingUtf(NULL, MODULENAME, acc_str.empty() ? "GPGPubKey" : acc_str.c_str(), ""); if (!szMessage[0]) { mir_free(szMessage); - szMessage = UniGetContactSettingUtf(NULL, szGPGModuleName, "GPGPubKey", ""); //try to get default key as fallback in any way + szMessage = UniGetContactSettingUtf(NULL, MODULENAME, "GPGPubKey", ""); //try to get default key as fallback in any way } } if (szMessage[0]) { - BYTE enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0); - db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0); + BYTE enc = db_get_b(hContact, MODULENAME, "GPGEncryption", 0); + db_set_b(hContact, MODULENAME, "GPGEncryption", 0); ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)szMessage); std::string msg = "Public key "; - char *keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, key_id_str.c_str(), ""); + char *keyid = UniGetContactSettingUtf(NULL, MODULENAME, key_id_str.c_str(), ""); if (!keyid[0]) { mir_free(keyid); - keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", ""); + keyid = UniGetContactSettingUtf(NULL, MODULENAME, "KeyID", ""); } msg += keyid; mir_free(keyid); @@ -177,7 +177,7 @@ INT_PTR SendKey(WPARAM w, LPARAM) mir_free(szMessage); szMessage = mir_strdup(msg.c_str()); HistoryLog(hContact, db_event(szMessage, 0, 0, DBEF_SENT)); - db_set_b(hContact, szGPGModuleName, "GPGEncryption", enc); + db_set_b(hContact, MODULENAME, "GPGEncryption", enc); } else mir_free(szMessage); @@ -189,20 +189,20 @@ INT_PTR ToggleEncryption(WPARAM w, LPARAM) MCONTACT hContact = (MCONTACT)w; BYTE enc; if (db_mc_isMeta(hContact)) { - enc = db_get_b(metaGetMostOnline(hContact), szGPGModuleName, "GPGEncryption", 0); + enc = db_get_b(metaGetMostOnline(hContact), MODULENAME, "GPGEncryption", 0); if (MessageBox(nullptr, TranslateT("Do you want to toggle encryption for all subcontacts?"), TranslateT("Metacontact detected"), MB_YESNO) == IDYES) { int count = db_mc_getSubCount(hContact); for (int i = 0; i < count; i++) { MCONTACT hcnt = db_mc_getSub(hContact, i); if (hcnt) - db_set_b(hcnt, szGPGModuleName, "GPGEncryption", enc ? 0 : 1); + db_set_b(hcnt, MODULENAME, "GPGEncryption", enc ? 0 : 1); } - db_set_b(hContact, szGPGModuleName, "GPGEncryption", enc ? 0 : 1); + db_set_b(hContact, MODULENAME, "GPGEncryption", enc ? 0 : 1); } } else { - enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0); - db_set_b(hContact, szGPGModuleName, "GPGEncryption", enc ? 0 : 1); + enc = db_get_b(hContact, MODULENAME, "GPGEncryption", 0); + db_set_b(hContact, MODULENAME, "GPGEncryption", enc ? 0 : 1); } void setSrmmIcon(MCONTACT hContact); void setClistIcon(MCONTACT hContact); @@ -228,10 +228,10 @@ int OnPreBuildContactMenu(WPARAM w, LPARAM) setting += ")"; setting += "_KeyID"; } - char *keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, setting.c_str(), ""); + char *keyid = UniGetContactSettingUtf(NULL, MODULENAME, setting.c_str(), ""); if (!keyid[0]) { mir_free(keyid); - keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", ""); + keyid = UniGetContactSettingUtf(NULL, MODULENAME, "KeyID", ""); } wchar_t buf[128] = { 0 }; mir_snwprintf(buf, L"%s: %s", TranslateT("Send public key"), toUTF16(keyid).c_str()); @@ -240,15 +240,15 @@ int OnPreBuildContactMenu(WPARAM w, LPARAM) } int flags; - wchar_t *tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", L""); + wchar_t *tmp = UniGetContactSettingUtf(hContact, MODULENAME, "GPGPubKey", L""); if (!tmp[0]) { - db_unset(hContact, szGPGModuleName, "GPGEncryption"); + db_unset(hContact, MODULENAME, "GPGEncryption"); flags = CMIF_GRAYED; } else flags = 0; Menu_ModifyItem(globals.hToggleEncryption, - db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0) ? L"Turn off GPG encryption" : L"Turn on GPG encryption", + db_get_b(hContact, MODULENAME, "GPGEncryption", 0) ? L"Turn off GPG encryption" : L"Turn on GPG encryption", INVALID_HANDLE_VALUE, flags); mir_free(tmp); return 0; @@ -313,17 +313,17 @@ int onProtoAck(WPARAM, LPARAM l) boost::filesystem::remove(file); { // password wchar_t *pass = nullptr; - char *keyid = UniGetContactSettingUtf(ack->hContact, szGPGModuleName, "KeyID", ""); + char *keyid = UniGetContactSettingUtf(ack->hContact, MODULENAME, "KeyID", ""); if (mir_strlen(keyid) > 0) { string dbsetting = "szKey_"; dbsetting += keyid; dbsetting += "_Password"; - pass = UniGetContactSettingUtf(NULL, szGPGModuleName, dbsetting.c_str(), L""); + pass = UniGetContactSettingUtf(NULL, MODULENAME, dbsetting.c_str(), L""); if (mir_wstrlen(pass) > 0 && globals.bDebugLog) globals.debuglog << std::string(time_str() + ": info: found password in database for key ID: " + keyid + ", trying to decrypt message from " + toUTF8(Clist_GetContactDisplayName(ack->hContact)) + " with password"); } else { - pass = UniGetContactSettingUtf(NULL, szGPGModuleName, "szKeyPassword", L""); + pass = UniGetContactSettingUtf(NULL, MODULENAME, "szKeyPassword", L""); if (mir_wstrlen(pass) > 0 && globals.bDebugLog) globals.debuglog << std::string(time_str() + ": info: found password for all keys in database, trying to decrypt message from " + toUTF8(Clist_GetContactDisplayName(ack->hContact)) + " with password"); } @@ -361,9 +361,9 @@ int onProtoAck(WPARAM, LPARAM l) s += mir_strlen(" ID "); string::size_type s2 = out.find(",", s); if (db_mc_isMeta(ack->hContact)) - db_set_s(metaGetMostOnline(ack->hContact), szGPGModuleName, "InKeyID", out.substr(s, s2 - s).c_str()); + db_set_s(metaGetMostOnline(ack->hContact), MODULENAME, "InKeyID", out.substr(s, s2 - s).c_str()); else - db_set_s(ack->hContact, szGPGModuleName, "InKeyID", out.substr(s, s2 - s).c_str()); + db_set_s(ack->hContact, MODULENAME, "InKeyID", out.substr(s, s2 - s).c_str()); } CDlgKeyPasswordMsgBox *d = new CDlgKeyPasswordMsgBox(ack->hContact); d->DoModal(); @@ -423,7 +423,7 @@ std::wstring encrypt_file(MCONTACT hContact, wchar_t *filename) cmd.push_back(L"--batch"); cmd.push_back(L"--tes"); cmd.push_back(L"-r"); - char *keyid = UniGetContactSettingUtf(hcnt, szGPGModuleName, "KeyID", ""); + char *keyid = UniGetContactSettingUtf(hcnt, MODULENAME, "KeyID", ""); wchar_t *szKeyid = mir_a2u(keyid); wchar_t *name = wcsrchr(filename, '\\'); if (!name) @@ -433,7 +433,7 @@ std::wstring encrypt_file(MCONTACT hContact, wchar_t *filename) wchar_t *file_out = new wchar_t[mir_wstrlen(name) + mir_wstrlen(L".gpg") + 1]; mir_snwprintf(file_out, mir_wstrlen(name) + mir_wstrlen(L".gpg") + 1, L"%s.gpg", name); cmd.push_back(szKeyid); - if (db_get_b(hcnt, szGPGModuleName, "bAlwaysTrust", 0)) { + if (db_get_b(hcnt, MODULENAME, "bAlwaysTrust", 0)) { cmd.push_back(L"--trust-model"); cmd.push_back(L"always"); } @@ -458,7 +458,7 @@ std::wstring encrypt_file(MCONTACT hContact, wchar_t *filename) if (out.find("There is no assurance this key belongs to the named user") != string::npos) { out.clear(); if (MessageBox(nullptr, TranslateT("We're trying to encrypt with untrusted key. Do you want to trust this key permanently?"), TranslateT("Warning"), MB_YESNO) == IDYES) { - db_set_b(hcnt, szGPGModuleName, "bAlwaysTrust", 1); + db_set_b(hcnt, MODULENAME, "bAlwaysTrust", 1); std::vector<std::wstring> tmp; tmp.push_back(L"--trust-model"); tmp.push_back(L"always"); @@ -564,7 +564,7 @@ INT_PTR onSendFile(WPARAM w, LPARAM l) void HistoryLog(MCONTACT hContact, db_event evt) { DBEVENTINFO Event = {}; - Event.szModule = szGPGModuleName; + Event.szModule = MODULENAME; Event.eventType = evt.eventType; Event.flags = evt.flags; if (!evt.timestamp) @@ -671,7 +671,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void*) } if (globals.bPresenceSigning && nodename && wcsstr(nodename, L"status")) { - wchar_t *path_c = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *path_c = UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L""); wstring path_out = path_c; wstring file = toUTF16(get_random(10)); mir_free(path_c); @@ -695,10 +695,10 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void*) char setting[64]; mir_snprintf(setting, sizeof(setting) - 1, "%s_KeyID", ji->GetModuleName()); - inkeyid = UniGetContactSettingUtf(NULL, szGPGModuleName, setting, ""); + inkeyid = UniGetContactSettingUtf(NULL, MODULENAME, setting, ""); if (!inkeyid[0]) { mir_free(inkeyid); - inkeyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", ""); + inkeyid = UniGetContactSettingUtf(NULL, MODULENAME, "KeyID", ""); } ptrW pass; @@ -706,14 +706,14 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void*) string dbsetting = "szKey_"; dbsetting += inkeyid; dbsetting += "_Password"; - pass = UniGetContactSettingUtf(NULL, szGPGModuleName, dbsetting.c_str(), L""); + pass = UniGetContactSettingUtf(NULL, MODULENAME, dbsetting.c_str(), L""); if (pass[0] && globals.bDebugLog) globals.debuglog << std::string(time_str() + ": info: found password in database for key ID: " + inkeyid + ", trying to encrypt message from self with password"); } if (inkeyid && inkeyid[0]) mir_free(inkeyid); else { - pass = UniGetContactSettingUtf(NULL, szGPGModuleName, "szKeyPassword", L""); + pass = UniGetContactSettingUtf(NULL, MODULENAME, "szKeyPassword", L""); if (pass[0] && globals.bDebugLog) globals.debuglog << std::string(time_str() + ": info: found password for all keys in database, trying to encrypt message from self with password"); } @@ -732,7 +732,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void*) } cmd.push_back(L"--local-user"); - path_c = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", L""); + path_c = UniGetContactSettingUtf(NULL, MODULENAME, "KeyID", L""); cmd.push_back(path_c); cmd.push_back(L"--default-key"); cmd.push_back(path_c); @@ -834,7 +834,7 @@ static JABBER_HANDLER_FUNC PrescenseHandler(IJabberInterface*, HXML node, void*) wstring file = toUTF16(get_random(10)), status_file = toUTF16(get_random(10)); sign += data; sign += L"\n-----END PGP SIGNATURE-----\n"; - wchar_t *path_c = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *path_c = UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L""); wstring path_out = path_c, status_file_out = path_c; mir_free(path_c); path_out += L"\\tmp\\"; @@ -942,14 +942,14 @@ void AddHandlers() bool isContactSecured(MCONTACT hContact) { - BYTE gpg_enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0); + BYTE gpg_enc = db_get_b(hContact, MODULENAME, "GPGEncryption", 0); if (!gpg_enc) { if (globals.bDebugLog) globals.debuglog << std::string(time_str() + ": encryption is turned off for " + toUTF8(Clist_GetContactDisplayName(hContact))); return false; } if (!db_mc_isMeta(hContact)) { - wchar_t *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", L""); + wchar_t *key = UniGetContactSettingUtf(hContact, MODULENAME, "GPGPubKey", L""); if (!key[0]) { mir_free(key); if (globals.bDebugLog) @@ -965,7 +965,7 @@ bool isContactSecured(MCONTACT hContact) bool isContactHaveKey(MCONTACT hContact) { - wchar_t *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", L""); + wchar_t *key = UniGetContactSettingUtf(hContact, MODULENAME, "GPGPubKey", L""); if (mir_wstrlen(key) > 0) { mir_free(key); return true; @@ -976,8 +976,8 @@ bool isContactHaveKey(MCONTACT hContact) bool isGPGKeyExist() { - wchar_t *id = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", L""); - char *key = UniGetContactSettingUtf(NULL, szGPGModuleName, "GPGPubKey", ""); + wchar_t *id = UniGetContactSettingUtf(NULL, MODULENAME, "KeyID", L""); + char *key = UniGetContactSettingUtf(NULL, MODULENAME, "GPGPubKey", ""); if (id[0] && key[0]) { mir_free(id); mir_free(key); @@ -991,7 +991,7 @@ bool isGPGValid() { wchar_t *tmp = nullptr; bool gpg_exists = false, is_valid = true; - tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L""); + tmp = UniGetContactSettingUtf(NULL, MODULENAME, "szGpgBinPath", L""); boost::filesystem::path p(tmp); if (boost::filesystem::exists(p) && boost::filesystem::is_regular_file(p)) @@ -1022,7 +1022,7 @@ bool isGPGValid() } if (gpg_exists) { - db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp); + db_set_ws(NULL, MODULENAME, "szGpgBinPath", tmp); mir_free(tmp); tmp = nullptr; string out; @@ -1050,7 +1050,7 @@ bool isGPGValid() { wstring path_ = _wgetenv(L"APPDATA"); path_ += L"\\GnuPG"; - tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", (wchar_t*)path_.c_str()); + tmp = UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", (wchar_t*)path_.c_str()); } if(tmp) mir_free(tmp); */ @@ -1079,7 +1079,7 @@ const bool StriStr(const char *str, const char *substr) bool IsOnline(MCONTACT hContact) { - if (db_get_b(hContact, szGPGModuleName, "Status", 0) == ID_STATUS_OFFLINE) + if (db_get_b(hContact, MODULENAME, "Status", 0) == ID_STATUS_OFFLINE) return false; return true; } @@ -1185,7 +1185,7 @@ void send_encrypted_msgs_thread(void *param) { MCONTACT hContact = (MCONTACT)(DWORD_PTR)param; while (true) { - //char *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", ""); + //char *key = UniGetContactSettingUtf(hContact, MODULENAME, "GPGPubKey", ""); while (!isContactSecured(hContact)) boost::this_thread::sleep(boost::posix_time::seconds(1)); if (!globals.hcontact_data[hContact].msgs_to_send.empty()) { @@ -1249,7 +1249,7 @@ void ExportGpGKeysFunc(int type) return; //TODO: handle error if (!type || type == 2) { for (auto &hContact : Contacts()) { - char *k = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", ""); + char *k = UniGetContactSettingUtf(hContact, MODULENAME, "GPGPubKey", ""); std::string key; if (!k[0]) { mir_free(k); @@ -1598,7 +1598,7 @@ INT_PTR ImportGpGKeys(WPARAM, LPARAM) string output; DWORD exitcode; { - ptmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + ptmp = UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L""); path = ptmp; mir_free(ptmp); wstring rand = toUTF16(get_random(10)); @@ -1635,7 +1635,7 @@ INT_PTR ImportGpGKeys(WPARAM, LPARAM) tmp2 = (char*)mir_alloc((output.substr(s, s2 - s).length() + 1) * sizeof(char)); mir_strcpy(tmp2, output.substr(s, s2 - s).c_str()); mir_utf8decode(tmp2, nullptr); - db_set_s(hContact, szGPGModuleName, "KeyID", tmp2); + db_set_s(hContact, MODULENAME, "KeyID", tmp2); mir_free(tmp2); s = output.find("“", s2); if (s == string::npos) { @@ -1653,7 +1653,7 @@ INT_PTR ImportGpGKeys(WPARAM, LPARAM) mir_strcpy(tmp2, output.substr(s, s2 - s - 1).c_str()); mir_utf8decode(tmp2, nullptr); if (hContact) { - db_set_s(hContact, szGPGModuleName, "KeyMainName", output.substr(s, s2 - s - 1).c_str()); + db_set_s(hContact, MODULENAME, "KeyMainName", output.substr(s, s2 - s - 1).c_str()); } mir_free(tmp2); if ((s = output.find(")", s2)) == string::npos) @@ -1666,7 +1666,7 @@ INT_PTR ImportGpGKeys(WPARAM, LPARAM) mir_strcpy(tmp2, output.substr(s2, s - s2).c_str()); mir_utf8decode(tmp2, nullptr); if (hContact) - db_set_s(hContact, szGPGModuleName, "KeyComment", output.substr(s2, s - s2).c_str()); + db_set_s(hContact, MODULENAME, "KeyComment", output.substr(s2, s - s2).c_str()); mir_free(tmp2); s += 3; s2 = output.find(">", s); @@ -1674,7 +1674,7 @@ INT_PTR ImportGpGKeys(WPARAM, LPARAM) mir_strcpy(tmp2, output.substr(s, s2 - s).c_str()); mir_utf8decode(tmp2, nullptr); if (hContact) - db_set_s(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s, s2 - s).c_str()); + db_set_s(hContact, MODULENAME, "KeyMainEmail", output.substr(s, s2 - s).c_str()); mir_free(tmp2); } else { @@ -1682,12 +1682,12 @@ INT_PTR ImportGpGKeys(WPARAM, LPARAM) mir_strcpy(tmp2, output.substr(s2, s - s2).c_str()); mir_utf8decode(tmp2, nullptr); if (hContact) - db_set_s(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s2, s - s2).c_str()); + db_set_s(hContact, MODULENAME, "KeyMainEmail", output.substr(s2, s - s2).c_str()); mir_free(tmp2); } } - db_set_b(hContact, szGPGModuleName, "GPGEncryption", 1); - db_set_ws(hContact, szGPGModuleName, "GPGPubKey", toUTF16(key).c_str()); + db_set_b(hContact, MODULENAME, "GPGEncryption", 1); + db_set_ws(hContact, MODULENAME, "GPGPubKey", toUTF16(key).c_str()); } boost::filesystem::remove(path); break; @@ -1703,7 +1703,7 @@ INT_PTR ImportGpGKeys(WPARAM, LPARAM) string output; DWORD exitcode; { - ptmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + ptmp = UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L""); wcsncpy(tmp2, ptmp, MAX_PATH - 1); mir_free(ptmp); mir_wstrncat(tmp2, L"\\", _countof(tmp2) - mir_wstrlen(tmp2)); @@ -1816,7 +1816,7 @@ void clean_temp_dir() wstring path = toUTF16(mir_path); SetCurrentDirectoryA(mir_path); delete[] mir_path; - wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *tmp = UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L""); path += tmp; mir_free(tmp); path += L"\\tmp"; @@ -1850,7 +1850,7 @@ bool gpg_validate_paths(wchar_t *gpg_bin_path, wchar_t *gpg_home_path) } { bool bad_version = false; - db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp.c_str()); + db_set_ws(NULL, MODULENAME, "szGpgBinPath", tmp.c_str()); string out; DWORD code; std::vector<wstring> cmd; @@ -1864,7 +1864,7 @@ bool gpg_validate_paths(wchar_t *gpg_bin_path, wchar_t *gpg_home_path) globals.gpg_valid = true; gpg_launcher(params); globals.gpg_valid = _gpg_valid; //TODO: check this - db_unset(NULL, szGPGModuleName, "szGpgBinPath"); + db_unset(NULL, MODULENAME, "szGpgBinPath"); string::size_type p1 = out.find("(GnuPG) "); if (p1 != string::npos) { p1 += mir_strlen("(GnuPG) "); @@ -1887,7 +1887,7 @@ bool gpg_validate_paths(wchar_t *gpg_bin_path, wchar_t *gpg_home_path) return false; } { - wchar_t *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + wchar_t *path = UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L""); DWORD dwFileAttr = GetFileAttributes(path); if (dwFileAttr != INVALID_FILE_ATTRIBUTES) { dwFileAttr &= ~FILE_ATTRIBUTE_READONLY; @@ -1900,8 +1900,8 @@ bool gpg_validate_paths(wchar_t *gpg_bin_path, wchar_t *gpg_home_path) void gpg_save_paths(wchar_t *gpg_bin_path, wchar_t *gpg_home_path) { - db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", gpg_bin_path); - db_set_ws(NULL, szGPGModuleName, "szHomePath", gpg_home_path); + db_set_ws(NULL, MODULENAME, "szGpgBinPath", gpg_bin_path); + db_set_ws(NULL, MODULENAME, "szHomePath", gpg_home_path); } bool gpg_use_new_random_key(char *account_name, wchar_t *gpg_bin_path, wchar_t *gpg_home_dir) @@ -1916,7 +1916,7 @@ bool gpg_use_new_random_key(char *account_name, wchar_t *gpg_bin_path, wchar_t * if (gpg_home_dir) tmp = gpg_home_dir; else - tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); + tmp = UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L""); path = tmp; if (!gpg_home_dir) mir_free(tmp); @@ -1994,17 +1994,17 @@ bool gpg_use_new_random_key(char *account_name, wchar_t *gpg_bin_path, wchar_t * { if (!mir_strcmp(account_name, Translate("Default"))) { - db_set_s(NULL, szGPGModuleName, "GPGPubKey", out.c_str()); - db_set_ws(NULL, szGPGModuleName, "KeyID", path.c_str()); + db_set_s(NULL, MODULENAME, "GPGPubKey", out.c_str()); + db_set_ws(NULL, MODULENAME, "KeyID", path.c_str()); } else { std::string acc_str = account_name; acc_str += "_GPGPubKey"; - db_set_s(NULL, szGPGModuleName, acc_str.c_str(), out.c_str()); + db_set_s(NULL, MODULENAME, acc_str.c_str(), out.c_str()); acc_str = account_name; acc_str += "_KeyID"; - db_set_ws(NULL, szGPGModuleName, acc_str.c_str(), path.c_str()); + db_set_ws(NULL, MODULENAME, acc_str.c_str(), path.c_str()); } } } diff --git a/plugins/NewsAggregator/Src/Authentication.cpp b/plugins/NewsAggregator/Src/Authentication.cpp index 318f8ea0a3..cc02d91bd9 100644 --- a/plugins/NewsAggregator/Src/Authentication.cpp +++ b/plugins/NewsAggregator/Src/Authentication.cpp @@ -22,9 +22,9 @@ Boston, MA 02111-1307, USA. void CreateAuthString(char *auth, MCONTACT hContact, CFeedEditor *pDlg)
{
wchar_t *tlogin = nullptr, *tpass = nullptr;
- if (hContact && db_get_b(hContact, MODULE, "UseAuth", 0)) {
- tlogin = db_get_wsa(hContact, MODULE, "Login");
- tpass = db_get_wsa(hContact, MODULE, "Password");
+ if (hContact && db_get_b(hContact, MODULENAME, "UseAuth", 0)) {
+ tlogin = db_get_wsa(hContact, MODULENAME, "Login");
+ tpass = db_get_wsa(hContact, MODULENAME, "Password");
}
else if (pDlg && pDlg->m_useauth.IsChecked()) {
tlogin = pDlg->m_login.GetText();
@@ -65,13 +65,13 @@ void CAuthRequest::OnInitDialog() }
}
else if (m_hContact) {
- wchar_t *ptszNick = db_get_wsa(m_hContact, MODULE, "Nick");
+ wchar_t *ptszNick = db_get_wsa(m_hContact, MODULENAME, "Nick");
if (ptszNick) {
m_feedname.SetText(ptszNick);
mir_free(ptszNick);
}
else {
- wchar_t *ptszURL = db_get_wsa(m_hContact, MODULE, "URL");
+ wchar_t *ptszURL = db_get_wsa(m_hContact, MODULENAME, "URL");
if (ptszURL) {
m_feedname.SetText(ptszURL);
mir_free(ptszURL);
@@ -100,9 +100,9 @@ void CAuthRequest::OnOk(CCtrlBase*) m_pDlg->m_password.SetTextA(strfeedpassword);
}
else if (m_hContact) {
- db_set_b(m_hContact, MODULE, "UseAuth", 1);
- db_set_ws(m_hContact, MODULE, "Login", strfeedusername);
- db_set_s(m_hContact, MODULE, "Password", strfeedpassword);
+ db_set_b(m_hContact, MODULENAME, "UseAuth", 1);
+ db_set_ws(m_hContact, MODULENAME, "Login", strfeedusername);
+ db_set_s(m_hContact, MODULENAME, "Password", strfeedpassword);
}
}
diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp index 559b52d3d9..fd01491274 100644 --- a/plugins/NewsAggregator/Src/CheckFeed.cpp +++ b/plugins/NewsAggregator/Src/CheckFeed.cpp @@ -112,7 +112,7 @@ LPCTSTR CheckFeed(wchar_t *tszURL, CFeedEditor *pEditDlg) static void XmlToMsg(MCONTACT hContact, CMStringW &title, CMStringW &link, CMStringW &descr, CMStringW &author, CMStringW &comments, CMStringW &guid, CMStringW &category, time_t stamp)
{
- CMStringW message = db_get_wsa(hContact, MODULE, "MsgFormat");
+ CMStringW message = db_get_wsa(hContact, MODULENAME, "MsgFormat");
if (!message)
message = TAGSDEFAULT;
@@ -190,10 +190,10 @@ static void XmlToMsg(MCONTACT hContact, CMStringW &title, CMStringW &link, CMStr void CheckCurrentFeed(MCONTACT hContact)
{
// Check is disabled by the user?
- if (!db_get_b(hContact, MODULE, "CheckState", 1) != 0)
+ if (!db_get_b(hContact, MODULENAME, "CheckState", 1) != 0)
return;
- wchar_t *szURL = db_get_wsa(hContact, MODULE, "URL");
+ wchar_t *szURL = db_get_wsa(hContact, MODULENAME, "URL");
if (szURL == nullptr)
return;
@@ -252,13 +252,13 @@ void CheckCurrentFeed(MCONTACT hContact) if (!mir_wstrcmpi(szAttrName, L"version")) {
wchar_t ver[MAX_PATH];
mir_snwprintf(ver, L"RSS %s", xmlGetAttrValue(node, szAttrName));
- db_set_ws(hContact, MODULE, "MirVer", ver);
+ db_set_ws(hContact, MODULENAME, "MirVer", ver);
break;
}
}
}
else if (isAtom)
- db_set_ws(hContact, MODULE, "MirVer", L"RSS 1.0");
+ db_set_ws(hContact, MODULENAME, "MirVer", L"RSS 1.0");
HXML chan = xmlGetChild(node, 0);
for (int j = 0; j < xmlGetChildCount(chan); j++) {
@@ -274,7 +274,7 @@ void CheckCurrentFeed(MCONTACT hContact) else
szChildText = xmlGetText(child);
if (szChildText)
- db_set_ws(hContact, MODULE, "FirstName", ClearText(szValue, szChildText));
+ db_set_ws(hContact, MODULENAME, "FirstName", ClearText(szValue, szChildText));
}
else if (!mir_wstrcmpi(childName, L"link")) {
LPCTSTR szChildText = nullptr;
@@ -286,7 +286,7 @@ void CheckCurrentFeed(MCONTACT hContact) else
szChildText = xmlGetText(child);
if (szChildText)
- db_set_ws(hContact, MODULE, "Homepage", ClearText(szValue, szChildText));
+ db_set_ws(hContact, MODULENAME, "Homepage", ClearText(szValue, szChildText));
}
else if (!mir_wstrcmpi(childName, L"description")) {
LPCTSTR szChildText = nullptr;
@@ -299,7 +299,7 @@ void CheckCurrentFeed(MCONTACT hContact) szChildText = xmlGetText(child);
if (szChildText) {
ClearText(szValue, szChildText);
- db_set_ws(hContact, MODULE, "About", szValue);
+ db_set_ws(hContact, MODULENAME, "About", szValue);
db_set_ws(hContact, "CList", "StatusMsg", szValue);
}
}
@@ -313,7 +313,7 @@ void CheckCurrentFeed(MCONTACT hContact) else
szChildText = xmlGetText(child);
if (szChildText)
- db_set_ws(hContact, MODULE, "Language1", ClearText(szValue, szChildText));
+ db_set_ws(hContact, MODULENAME, "Language1", ClearText(szValue, szChildText));
}
else if (!mir_wstrcmpi(childName, L"managingEditor")) {
LPCTSTR szChildText = nullptr;
@@ -325,7 +325,7 @@ void CheckCurrentFeed(MCONTACT hContact) else
szChildText = xmlGetText(child);
if (szChildText)
- db_set_ws(hContact, MODULE, "e-mail", ClearText(szValue, szChildText));
+ db_set_ws(hContact, MODULENAME, "e-mail", ClearText(szValue, szChildText));
}
else if (!mir_wstrcmpi(childName, L"category")) {
LPCTSTR szChildText = nullptr;
@@ -337,7 +337,7 @@ void CheckCurrentFeed(MCONTACT hContact) else
szChildText = xmlGetText(child);
if (szChildText)
- db_set_ws(hContact, MODULE, "Interest0Text", ClearText(szValue, szChildText));
+ db_set_ws(hContact, MODULENAME, "Interest0Text", ClearText(szValue, szChildText));
}
else if (!mir_wstrcmpi(childName, L"copyright")) {
LPCTSTR szChildText = nullptr;
@@ -356,12 +356,12 @@ void CheckCurrentFeed(MCONTACT hContact) HXML imageval = xmlGetChild(child, x);
if (!mir_wstrcmpi(xmlGetName(imageval), L"url")) {
LPCTSTR url = xmlGetText(imageval);
- db_set_ws(hContact, MODULE, "ImageURL", url);
+ db_set_ws(hContact, MODULENAME, "ImageURL", url);
PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = hContact;
- wchar_t *szNick = db_get_wsa(hContact, MODULE, "Nick");
+ wchar_t *szNick = db_get_wsa(hContact, MODULENAME, "Nick");
if (szNick) {
wchar_t *ext = wcsrchr((wchar_t *)url, '.') + 1;
ai.format = ProtoGetAvatarFormat(url);
@@ -371,10 +371,10 @@ void CheckCurrentFeed(MCONTACT hContact) mir_snwprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename.c_str(), ext);
CreateDirectoryTreeW(tszRoot);
if (DownloadFile(url, ai.filename)) {
- db_set_ws(hContact, MODULE, "ImagePath", ai.filename);
- ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
+ db_set_ws(hContact, MODULENAME, "ImagePath", ai.filename);
+ ProtoBroadcastAck(MODULENAME, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
}
- else ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, (HANDLE)&ai, NULL);
+ else ProtoBroadcastAck(MODULENAME, hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, (HANDLE)&ai, NULL);
mir_free(szNick);
break;
}
@@ -393,9 +393,9 @@ void CheckCurrentFeed(MCONTACT hContact) if (szChildText) {
time_t stamp = DateToUnixTime(szChildText, 0);
double deltaupd = difftime(time(0), stamp);
- double deltacheck = difftime(time(0), (time_t)db_get_dw(hContact, MODULE, "LastCheck", 0));
+ double deltacheck = difftime(time(0), (time_t)db_get_dw(hContact, MODULENAME, "LastCheck", 0));
if (deltaupd - deltacheck >= 0) {
- db_set_dw(hContact, MODULE, "LastCheck", (DWORD)time(0));
+ db_set_dw(hContact, MODULENAME, "LastCheck", (DWORD)time(0));
xmlDestroyNode(hXml);
return;
}
@@ -448,14 +448,14 @@ void CheckCurrentFeed(MCONTACT hContact) }
}
else if (!mir_wstrcmpi(szNodeName, L"feed")) {
- db_set_ws(hContact, MODULE, "MirVer", L"Atom 3");
+ db_set_ws(hContact, MODULENAME, "MirVer", L"Atom 3");
for (int j = 0; j < xmlGetChildCount(node); j++) {
HXML child = xmlGetChild(node, j);
LPCTSTR szChildName = xmlGetName(child);
if (!mir_wstrcmpi(szChildName, L"title")) {
LPCTSTR szChildText = xmlGetText(child);
if (szChildText)
- db_set_ws(hContact, MODULE, "FirstName", ClearText(szValue, szChildText));
+ db_set_ws(hContact, MODULENAME, "FirstName", ClearText(szValue, szChildText));
}
else if (!mir_wstrcmpi(szChildName, L"link")) {
for (int x = 0; x < xmlGetAttrCount(child); x++) {
@@ -464,27 +464,27 @@ void CheckCurrentFeed(MCONTACT hContact) break;
if (!mir_wstrcmpi(xmlGetAttrName(child, x), L"href"))
- db_set_ws(hContact, MODULE, "Homepage", xmlGetAttrValue(child, xmlGetAttrName(child, x)));
+ db_set_ws(hContact, MODULENAME, "Homepage", xmlGetAttrValue(child, xmlGetAttrName(child, x)));
}
}
else if (!mir_wstrcmpi(szChildName, L"subtitle")) {
LPCTSTR szChildText = xmlGetText(child);
if (szChildText) {
ClearText(szValue, szChildText);
- db_set_ws(hContact, MODULE, "About", szValue);
+ db_set_ws(hContact, MODULENAME, "About", szValue);
db_set_ws(hContact, "CList", "StatusMsg", szValue);
}
}
else if (!mir_wstrcmpi(szChildName, L"language")) {
LPCTSTR szChildText = xmlGetText(child);
if (szChildText)
- db_set_ws(hContact, MODULE, "Language1", ClearText(szValue, szChildText));
+ db_set_ws(hContact, MODULENAME, "Language1", ClearText(szValue, szChildText));
}
else if (!mir_wstrcmpi(szChildName, L"author")) {
for (int x = 0; x < xmlGetChildCount(child); x++) {
HXML authorval = xmlGetChild(child, x);
if (!mir_wstrcmpi(xmlGetName(authorval), L"email")) {
- db_set_ws(hContact, MODULE, "e-mail", xmlGetText(authorval));
+ db_set_ws(hContact, MODULENAME, "e-mail", xmlGetText(authorval));
break;
}
}
@@ -492,16 +492,16 @@ void CheckCurrentFeed(MCONTACT hContact) else if (!mir_wstrcmpi(szChildName, L"category")) {
LPCTSTR szChildText = xmlGetText(child);
if (szChildText)
- db_set_ws(hContact, MODULE, "Interest0Text", ClearText(szValue, szChildText));
+ db_set_ws(hContact, MODULENAME, "Interest0Text", ClearText(szValue, szChildText));
}
else if (!mir_wstrcmpi(szChildName, L"icon")) {
for (int x = 0; x < xmlGetChildCount(child); x++) {
HXML imageval = xmlGetChild(child, x);
if (!mir_wstrcmpi(xmlGetName(imageval), L"url")) {
LPCTSTR url = xmlGetText(imageval);
- db_set_ws(hContact, MODULE, "ImageURL", url);
+ db_set_ws(hContact, MODULENAME, "ImageURL", url);
- ptrW szNick(db_get_wsa(hContact, MODULE, "Nick"));
+ ptrW szNick(db_get_wsa(hContact, MODULENAME, "Nick"));
if (szNick) {
PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = hContact;
@@ -511,10 +511,10 @@ void CheckCurrentFeed(MCONTACT hContact) wchar_t *filename = szNick;
mir_snwprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
- db_set_ws(hContact, MODULE, "ImagePath", ai.filename);
- ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
+ db_set_ws(hContact, MODULENAME, "ImagePath", ai.filename);
+ ProtoBroadcastAck(MODULENAME, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
}
- else ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, (HANDLE)&ai, NULL);
+ else ProtoBroadcastAck(MODULENAME, hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, (HANDLE)&ai, NULL);
break;
}
}
@@ -526,9 +526,9 @@ void CheckCurrentFeed(MCONTACT hContact) wchar_t *lastupdtime = (wchar_t *)szChildText;
time_t stamp = DateToUnixTime(lastupdtime, 1);
double deltaupd = difftime(time(0), stamp);
- double deltacheck = difftime(time(0), (time_t)db_get_dw(hContact, MODULE, "LastCheck", 0));
+ double deltacheck = difftime(time(0), (time_t)db_get_dw(hContact, MODULENAME, "LastCheck", 0));
if (deltaupd - deltacheck >= 0) {
- db_set_dw(hContact, MODULE, "LastCheck", (DWORD)time(0));
+ db_set_dw(hContact, MODULENAME, "LastCheck", (DWORD)time(0));
xmlDestroyNode(hXml);
return;
}
@@ -601,15 +601,15 @@ void CheckCurrentFeed(MCONTACT hContact) xmlDestroyNode(hXml);
}
}
- db_set_dw(hContact, MODULE, "LastCheck", (DWORD)time(0));
+ db_set_dw(hContact, MODULENAME, "LastCheck", (DWORD)time(0));
}
void CheckCurrentFeedAvatar(MCONTACT hContact)
{
- if (!db_get_b(hContact, MODULE, "CheckState", 1))
+ if (!db_get_b(hContact, MODULENAME, "CheckState", 1))
return;
- wchar_t *szURL = db_get_wsa(hContact, MODULE, "URL");
+ wchar_t *szURL = db_get_wsa(hContact, MODULENAME, "URL");
if (szURL == nullptr)
return;
@@ -643,12 +643,12 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) HXML imageval = xmlGetChild(child, x);
if (!mir_wstrcmpi(xmlGetName(imageval), L"url")) {
LPCTSTR url = xmlGetText(imageval);
- db_set_ws(hContact, MODULE, "ImageURL", url);
+ db_set_ws(hContact, MODULENAME, "ImageURL", url);
PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = hContact;
- wchar_t *szNick = db_get_wsa(hContact, MODULE, "Nick");
+ wchar_t *szNick = db_get_wsa(hContact, MODULENAME, "Nick");
if (szNick) {
wchar_t *ext = wcsrchr((wchar_t *)url, '.') + 1;
ai.format = ProtoGetAvatarFormat(ext);
@@ -656,10 +656,10 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) wchar_t *filename = szNick;
mir_snwprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
- db_set_ws(hContact, MODULE, "ImagePath", ai.filename);
- ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
+ db_set_ws(hContact, MODULENAME, "ImagePath", ai.filename);
+ ProtoBroadcastAck(MODULENAME, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
}
- else ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, (HANDLE)&ai, NULL);
+ else ProtoBroadcastAck(MODULENAME, hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, (HANDLE)&ai, NULL);
mir_free(szNick);
break;
}
@@ -676,9 +676,9 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) HXML imageval = xmlGetChild(child, x);
if (!mir_wstrcmpi(xmlGetName(imageval), L"url")) {
LPCTSTR url = xmlGetText(imageval);
- db_set_ws(hContact, MODULE, "ImageURL", url);
+ db_set_ws(hContact, MODULENAME, "ImageURL", url);
- ptrW szNick(db_get_wsa(hContact, MODULE, "Nick"));
+ ptrW szNick(db_get_wsa(hContact, MODULENAME, "Nick"));
if (szNick) {
PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = hContact;
@@ -689,10 +689,10 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) wchar_t *filename = szNick;
mir_snwprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
- db_set_ws(hContact, MODULE, "ImagePath", ai.filename);
- ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
+ db_set_ws(hContact, MODULENAME, "ImagePath", ai.filename);
+ ProtoBroadcastAck(MODULENAME, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
}
- else ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, (HANDLE)&ai, NULL);
+ else ProtoBroadcastAck(MODULENAME, hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, (HANDLE)&ai, NULL);
break;
}
}
diff --git a/plugins/NewsAggregator/Src/Icons.cpp b/plugins/NewsAggregator/Src/Icons.cpp index 2c6ff8d049..4ceea9c42d 100644 --- a/plugins/NewsAggregator/Src/Icons.cpp +++ b/plugins/NewsAggregator/Src/Icons.cpp @@ -33,13 +33,13 @@ static IconItem iconList[] = void InitIcons()
{
- g_plugin.registerIcon(LPGEN("News Aggregator"), iconList, MODULE);
+ g_plugin.registerIcon(LPGEN("News Aggregator"), iconList, MODULENAME);
}
HICON LoadIconEx(const char *name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, "%s_%s", MODULE, name);
+ mir_snprintf(szSettingName, "%s_%s", MODULENAME, name);
return IcoLib_GetIcon(szSettingName, big);
}
diff --git a/plugins/NewsAggregator/Src/Menus.cpp b/plugins/NewsAggregator/Src/Menus.cpp index 73128cf5be..7f6a73f77f 100644 --- a/plugins/NewsAggregator/Src/Menus.cpp +++ b/plugins/NewsAggregator/Src/Menus.cpp @@ -30,7 +30,7 @@ void InitMenu() SET_UID(mi, 0x3ec91864, 0xefa7, 0x4994, 0xb7, 0x75, 0x6c, 0x96, 0xcb, 0x29, 0x2f, 0x93);
mi.position = 10100001;
- if (db_get_b(NULL, MODULE, "AutoUpdate", 1))
+ if (db_get_b(NULL, MODULENAME, "AutoUpdate", 1))
mi.name.w = LPGENW("Auto Update Enabled");
else
mi.name.w = LPGENW("Auto Update Disabled");
@@ -72,12 +72,12 @@ void InitMenu() mi.hIcolibItem = GetIconHandle("checkfeed");
mi.name.w = LPGENW("Check feed");
mi.pszService = MS_NEWSAGGREGATOR_CHECKFEED;
- hService2[5] = Menu_AddContactMenuItem(&mi, MODULE);
+ hService2[5] = Menu_AddContactMenuItem(&mi, MODULENAME);
SET_UID(mi, 0x41a70fbc, 0x9241, 0x44c0, 0x90, 0x90, 0x87, 0xd2, 0xc5, 0x9f, 0xc9, 0xac);
mi.name.w = LPGENW("Change feed");
mi.pszService = MS_NEWSAGGREGATOR_CHANGEFEED;
- hService2[6] = Menu_AddContactMenuItem(&mi, MODULE);
+ hService2[6] = Menu_AddContactMenuItem(&mi, MODULENAME);
- Menu_ModifyItem(hService2[0], nullptr, GetIconHandle(db_get_b(NULL, MODULE, "AutoUpdate", 1) ? "enabled" : "disabled"));
+ Menu_ModifyItem(hService2[0], nullptr, GetIconHandle(db_get_b(NULL, MODULENAME, "AutoUpdate", 1) ? "enabled" : "disabled"));
}
diff --git a/plugins/NewsAggregator/Src/NewsAggregator.cpp b/plugins/NewsAggregator/Src/NewsAggregator.cpp index 24fa21e9b0..6bf1394e3b 100644 --- a/plugins/NewsAggregator/Src/NewsAggregator.cpp +++ b/plugins/NewsAggregator/Src/NewsAggregator.cpp @@ -42,6 +42,13 @@ PLUGININFOEX pluginInfoEx = { {0x56cc3f29, 0xccbf, 0x4546, {0xa8, 0xba, 0x98, 0x56, 0x24, 0x8a, 0x41, 0x2a}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{
+ RegisterProtocol(PROTOTYPE_VIRTUAL);
+ SetUniqueId("URL");
+}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
@@ -68,14 +75,14 @@ extern "C" __declspec(dllexport) int Load(void) hUpdateMutex = CreateMutex(nullptr, FALSE, nullptr);
- CreateProtoServiceFunction(MODULE, PS_GETNAME, NewsAggrGetName);
- CreateProtoServiceFunction(MODULE, PS_GETCAPS, NewsAggrGetCaps);
- CreateProtoServiceFunction(MODULE, PS_SETSTATUS, NewsAggrSetStatus);
- CreateProtoServiceFunction(MODULE, PS_GETSTATUS, NewsAggrGetStatus);
- CreateProtoServiceFunction(MODULE, PS_LOADICON, NewsAggrLoadIcon);
- CreateProtoServiceFunction(MODULE, PSS_GETINFO, NewsAggrGetInfo);
- CreateProtoServiceFunction(MODULE, PS_GETAVATARINFO, NewsAggrGetAvatarInfo);
- CreateProtoServiceFunction(MODULE, PSR_MESSAGE, NewsAggrRecvMessage);
+ CreateProtoServiceFunction(MODULENAME, PS_GETNAME, NewsAggrGetName);
+ CreateProtoServiceFunction(MODULENAME, PS_GETCAPS, NewsAggrGetCaps);
+ CreateProtoServiceFunction(MODULENAME, PS_SETSTATUS, NewsAggrSetStatus);
+ CreateProtoServiceFunction(MODULENAME, PS_GETSTATUS, NewsAggrGetStatus);
+ CreateProtoServiceFunction(MODULENAME, PS_LOADICON, NewsAggrLoadIcon);
+ CreateProtoServiceFunction(MODULENAME, PSS_GETINFO, NewsAggrGetInfo);
+ CreateProtoServiceFunction(MODULENAME, PS_GETAVATARINFO, NewsAggrGetAvatarInfo);
+ CreateProtoServiceFunction(MODULENAME, PSR_MESSAGE, NewsAggrRecvMessage);
CreateServiceFunction(MS_NEWSAGGREGATOR_CHECKALLFEEDS, CheckAllFeeds);
CreateServiceFunction(MS_NEWSAGGREGATOR_ADDFEED, AddFeed);
diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index b51360f21e..86ce209c22 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -38,9 +38,9 @@ CExportFeed::CExportFeed() void CExportFeed::OnInitDialog()
{
- Utils_RestoreWindowPositionNoSize(m_hwnd, NULL, MODULE, "ExportDlg");
- for (auto &hContact : Contacts(MODULE)) {
- wchar_t *message = db_get_wsa(hContact, MODULE, "Nick");
+ Utils_RestoreWindowPositionNoSize(m_hwnd, NULL, MODULENAME, "ExportDlg");
+ for (auto &hContact : Contacts(MODULENAME)) {
+ wchar_t *message = db_get_wsa(hContact, MODULENAME, "Nick");
if (message != nullptr) {
m_feedslist.AddString(message);
mir_free(message);
@@ -200,9 +200,9 @@ void CExportFeed::OnOk(CCtrlBase*) m_feedsexportlist.GetItemText(i, item, _countof(item));
MCONTACT hContact = GetContactByNick(item);
wchar_t
- *title = db_get_wsa(hContact, MODULE, "Nick"),
- *url = db_get_wsa(hContact, MODULE, "URL"),
- *siteurl = db_get_wsa(hContact, MODULE, "Homepage"),
+ *title = db_get_wsa(hContact, MODULENAME, "Nick"),
+ *url = db_get_wsa(hContact, MODULENAME, "URL"),
+ *siteurl = db_get_wsa(hContact, MODULENAME, "Homepage"),
*group = db_get_wsa(hContact, "CList", "Group");
HXML elem = header;
@@ -245,7 +245,7 @@ void CExportFeed::OnOk(CCtrlBase*) void CExportFeed::OnClose()
{
- Utils_SaveWindowPosition(m_hwnd, NULL, MODULE, "ExportDlg");
+ Utils_SaveWindowPosition(m_hwnd, NULL, MODULENAME, "ExportDlg");
if (pExportDialog)
pExportDialog = nullptr;
}
@@ -272,7 +272,7 @@ CImportFeed::CImportFeed(CCtrlListView *m_feeds) void CImportFeed::OnInitDialog()
{
- Utils_RestoreWindowPositionNoSize(m_hwnd, NULL, MODULE, "ImportDlg");
+ Utils_RestoreWindowPositionNoSize(m_hwnd, NULL, MODULENAME, "ImportDlg");
m_removefeed.Disable();
m_removeallfeeds.Disable();
m_ok.Disable();
@@ -599,14 +599,14 @@ void CImportFeed::OnOk(CCtrlBase*) }
MCONTACT hContact = db_add_contact();
- Proto_AddToContact(hContact, MODULE);
- db_set_ws(hContact, MODULE, "Nick", text);
- db_set_ws(hContact, MODULE, "URL", url);
- db_set_ws(hContact, MODULE, "Homepage", siteurl);
- db_set_b(hContact, MODULE, "CheckState", 1);
- db_set_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME);
- db_set_ws(hContact, MODULE, "MsgFormat", TAGSDEFAULT);
- db_set_w(hContact, MODULE, "Status", Proto_GetStatus(MODULE));
+ Proto_AddToContact(hContact, MODULENAME);
+ db_set_ws(hContact, MODULENAME, "Nick", text);
+ db_set_ws(hContact, MODULENAME, "URL", url);
+ db_set_ws(hContact, MODULENAME, "Homepage", siteurl);
+ db_set_b(hContact, MODULENAME, "CheckState", 1);
+ db_set_dw(hContact, MODULENAME, "UpdateTime", DEFAULT_UPDATE_TIME);
+ db_set_ws(hContact, MODULENAME, "MsgFormat", TAGSDEFAULT);
+ db_set_w(hContact, MODULENAME, "Status", Proto_GetStatus(MODULENAME));
if (m_list != nullptr) {
int iItem = m_list->AddItem(text, -1);
@@ -655,7 +655,7 @@ void CImportFeed::OnOk(CCtrlBase*) void CImportFeed::OnClose()
{
- Utils_SaveWindowPosition(m_hwnd, NULL, MODULE, "ImportDlg");
+ Utils_SaveWindowPosition(m_hwnd, NULL, MODULENAME, "ImportDlg");
if (pImportDialog)
pImportDialog = nullptr;
}
@@ -692,40 +692,40 @@ void CFeedEditor::OnInitDialog() m_list->GetItemText(m_iItem, 0, SelNick, _countof(SelNick));
m_list->GetItemText(m_iItem, 1, SelUrl, _countof(SelNick));
- for (auto &hContact : Contacts(MODULE)) {
- ptrW dbNick(db_get_wsa(hContact, MODULE, "Nick"));
+ for (auto &hContact : Contacts(MODULENAME)) {
+ ptrW dbNick(db_get_wsa(hContact, MODULENAME, "Nick"));
if ((dbNick == NULL) || (mir_wstrcmp(dbNick, SelNick) != 0))
continue;
- ptrW dbURL(db_get_wsa(hContact, MODULE, "URL"));
+ ptrW dbURL(db_get_wsa(hContact, MODULENAME, "URL"));
if ((dbURL == NULL) || (mir_wstrcmp(dbURL, SelUrl) != 0))
continue;
m_hContact = hContact;
m_feedtitle.SetText(SelNick);
m_feedurl.SetText(SelUrl);
- m_checktime.SetInt(db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME));
+ m_checktime.SetInt(db_get_dw(hContact, MODULENAME, "UpdateTime", DEFAULT_UPDATE_TIME));
- wchar_t *szMsgFormat = db_get_wsa(hContact, MODULE, "MsgFormat");
+ wchar_t *szMsgFormat = db_get_wsa(hContact, MODULENAME, "MsgFormat");
if (szMsgFormat) {
m_tagedit.SetText(szMsgFormat);
mir_free(szMsgFormat);
}
- if (db_get_b(hContact, MODULE, "UseAuth", 0)) {
+ if (db_get_b(hContact, MODULENAME, "UseAuth", 0)) {
m_useauth.SetState(1);
m_login.Enable();
m_password.Enable();
- wchar_t *szLogin = db_get_wsa(hContact, MODULE, "Login");
+ wchar_t *szLogin = db_get_wsa(hContact, MODULENAME, "Login");
if (szLogin) {
m_login.SetText(szLogin);
mir_free(szLogin);
}
- pass_ptrA pwd(db_get_sa(hContact, MODULE, "Password"));
+ pass_ptrA pwd(db_get_sa(hContact, MODULENAME, "Password"));
m_password.SetTextA(pwd);
}
g_arFeeds.insert(this);
- Utils_RestoreWindowPositionNoSize(m_hwnd, hContact, MODULE, "ChangeDlg");
+ Utils_RestoreWindowPositionNoSize(m_hwnd, hContact, MODULENAME, "ChangeDlg");
break;
}
}
@@ -733,36 +733,36 @@ void CFeedEditor::OnInitDialog() m_feedurl.SetText(L"http://");
m_tagedit.SetText(TAGSDEFAULT);
m_checktime.SetInt(DEFAULT_UPDATE_TIME);
- Utils_RestoreWindowPositionNoSize(m_hwnd, NULL, MODULE, "AddDlg");
+ Utils_RestoreWindowPositionNoSize(m_hwnd, NULL, MODULENAME, "AddDlg");
}
else if (m_hContact != NULL) {
- ptrW dbNick(db_get_wsa(m_hContact, MODULE, "Nick"));
- ptrW dbURL(db_get_wsa(m_hContact, MODULE, "URL"));
+ ptrW dbNick(db_get_wsa(m_hContact, MODULENAME, "Nick"));
+ ptrW dbURL(db_get_wsa(m_hContact, MODULENAME, "URL"));
m_feedtitle.SetText(dbNick);
m_feedurl.SetText(dbURL);
- m_checktime.SetInt(db_get_dw(m_hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME));
+ m_checktime.SetInt(db_get_dw(m_hContact, MODULENAME, "UpdateTime", DEFAULT_UPDATE_TIME));
- wchar_t *szMsgFormat = db_get_wsa(m_hContact, MODULE, "MsgFormat");
+ wchar_t *szMsgFormat = db_get_wsa(m_hContact, MODULENAME, "MsgFormat");
if (szMsgFormat) {
m_tagedit.SetText(szMsgFormat);
mir_free(szMsgFormat);
}
- if (db_get_b(m_hContact, MODULE, "UseAuth", 0)) {
+ if (db_get_b(m_hContact, MODULENAME, "UseAuth", 0)) {
m_useauth.SetState(1);
m_login.Enable();
m_password.Enable();
- wchar_t *szLogin = db_get_wsa(m_hContact, MODULE, "Login");
+ wchar_t *szLogin = db_get_wsa(m_hContact, MODULENAME, "Login");
if (szLogin) {
m_login.SetText(szLogin);
mir_free(szLogin);
}
- pass_ptrA pwd(db_get_sa(m_hContact, MODULE, "Password"));
+ pass_ptrA pwd(db_get_sa(m_hContact, MODULENAME, "Password"));
m_password.SetTextA(pwd);
}
g_arFeeds.insert(this);
- Utils_RestoreWindowPositionNoSize(m_hwnd, m_hContact, MODULE, "ChangeDlg");
+ Utils_RestoreWindowPositionNoSize(m_hwnd, m_hContact, MODULENAME, "ChangeDlg");
}
}
@@ -825,26 +825,26 @@ void CFeedEditor::OnOk(CCtrlBase*) MCONTACT hContact;
if (m_iItem == -1 && m_hContact == NULL) {
hContact = db_add_contact();
- Proto_AddToContact(hContact, MODULE);
- db_set_b(hContact, MODULE, "CheckState", 1);
+ Proto_AddToContact(hContact, MODULENAME);
+ db_set_b(hContact, MODULENAME, "CheckState", 1);
}
else
hContact = m_hContact;
- db_set_ws(hContact, MODULE, "Nick", strfeedtitle);
- db_set_ws(hContact, MODULE, "URL", strfeedurl);
- db_set_dw(hContact, MODULE, "UpdateTime", (DWORD)m_checktime.GetInt());
- db_set_ws(hContact, MODULE, "MsgFormat", strtagedit);
- db_set_w(hContact, MODULE, "Status", Proto_GetStatus(MODULE));
+ db_set_ws(hContact, MODULENAME, "Nick", strfeedtitle);
+ db_set_ws(hContact, MODULENAME, "URL", strfeedurl);
+ db_set_dw(hContact, MODULENAME, "UpdateTime", (DWORD)m_checktime.GetInt());
+ db_set_ws(hContact, MODULENAME, "MsgFormat", strtagedit);
+ db_set_w(hContact, MODULENAME, "Status", Proto_GetStatus(MODULENAME));
if (m_useauth.IsChecked()) {
- db_set_b(hContact, MODULE, "UseAuth", 1);
- db_set_ws(hContact, MODULE, "Login", m_login.GetText());
- db_set_s(hContact, MODULE, "Password", m_password.GetTextA());
+ db_set_b(hContact, MODULENAME, "UseAuth", 1);
+ db_set_ws(hContact, MODULENAME, "Login", m_login.GetText());
+ db_set_s(hContact, MODULENAME, "Password", m_password.GetTextA());
}
else {
- db_unset(hContact, MODULE, "UseAuth");
- db_unset(hContact, MODULE, "Login");
- db_unset(hContact, MODULE, "Password");
+ db_unset(hContact, MODULENAME, "UseAuth");
+ db_unset(hContact, MODULENAME, "Login");
+ db_unset(hContact, MODULENAME, "Password");
}
if (m_iItem == -1 && m_list != nullptr && m_hContact == NULL) {
@@ -861,7 +861,7 @@ void CFeedEditor::OnOk(CCtrlBase*) void CFeedEditor::OnClose()
{
g_arFeeds.remove(this);
- Utils_SaveWindowPosition(m_hwnd, NULL, MODULE, m_iItem == -1 ? "AddDlg" : "ChangeDlg");
+ Utils_SaveWindowPosition(m_hwnd, NULL, MODULENAME, m_iItem == -1 ? "AddDlg" : "ChangeDlg");
if (pAddFeedDialog == this)
pAddFeedDialog = nullptr;
}
@@ -874,16 +874,16 @@ void CFeedEditor::OnUseAuth(CCtrlBase*) void COptionsMain::UpdateList()
{
- for (auto &hContact : Contacts(MODULE)) {
+ for (auto &hContact : Contacts(MODULENAME)) {
UpdateListFlag = TRUE;
- wchar_t *ptszNick = db_get_wsa(hContact, MODULE, "Nick");
+ wchar_t *ptszNick = db_get_wsa(hContact, MODULENAME, "Nick");
if (ptszNick) {
int iItem = m_feeds.AddItem(ptszNick, -1);
- wchar_t *ptszURL = db_get_wsa(hContact, MODULE, "URL");
+ wchar_t *ptszURL = db_get_wsa(hContact, MODULENAME, "URL");
if (ptszURL) {
m_feeds.SetItem(iItem, 1, ptszURL);
- m_feeds.SetCheckState(iItem, db_get_b(hContact, MODULE, "CheckState", 1));
+ m_feeds.SetCheckState(iItem, db_get_b(hContact, MODULENAME, "CheckState", 1));
mir_free(ptszURL);
}
mir_free(ptszNick);
@@ -893,7 +893,7 @@ void COptionsMain::UpdateList() }
COptionsMain::COptionsMain()
- : CPluginDlgBase(g_plugin, IDD_OPTIONS, MODULE),
+ : CPluginDlgBase(g_plugin, IDD_OPTIONS, MODULENAME),
m_feeds(this, IDC_FEEDLIST),
m_add(this, IDC_ADD),
m_change(this, IDC_CHANGE),
@@ -928,14 +928,14 @@ void COptionsMain::OnInitDialog() void COptionsMain::OnApply()
{
- for (auto &hContact : Contacts(MODULE)) {
- ptrW dbNick(db_get_wsa(hContact, MODULE, "Nick"));
+ for (auto &hContact : Contacts(MODULENAME)) {
+ ptrW dbNick(db_get_wsa(hContact, MODULENAME, "Nick"));
for (int i = 0; i < m_feeds.GetItemCount(); i++) {
wchar_t nick[MAX_PATH];
m_feeds.GetItemText(i, 0, nick, _countof(nick));
if (mir_wstrcmp(dbNick, nick) == 0)
{
- db_set_b(hContact, MODULE, "CheckState", m_feeds.GetCheckState(i));
+ db_set_b(hContact, MODULENAME, "CheckState", m_feeds.GetCheckState(i));
if (!m_feeds.GetCheckState(i))
db_set_b(hContact, "CList", "Hidden", 1);
else
@@ -968,11 +968,11 @@ void COptionsMain::OnChangeButtonClick(CCtrlBase*) m_feeds.GetItemText(isel, 0, nick, _countof(nick));
m_feeds.GetItemText(isel, 1, url, _countof(url));
- ptrW dbNick(db_get_wsa(it->getContact(), MODULE, "Nick"));
+ ptrW dbNick(db_get_wsa(it->getContact(), MODULENAME, "Nick"));
if ((dbNick == NULL) || (mir_wstrcmp(dbNick, nick) != 0))
continue;
- ptrW dbURL(db_get_wsa(it->getContact(), MODULE, "URL"));
+ ptrW dbURL(db_get_wsa(it->getContact(), MODULENAME, "URL"));
if ((dbURL == NULL) || (mir_wstrcmp(dbURL, url) != 0))
continue;
@@ -998,14 +998,14 @@ void COptionsMain::OnDeleteButtonClick(CCtrlBase*) m_feeds.GetItemText(isel, 0, nick, _countof(nick));
m_feeds.GetItemText(isel, 1, url, _countof(url));
- for (auto &hContact : Contacts(MODULE)) {
- ptrW dbNick(db_get_wsa(hContact, MODULE, "Nick"));
+ for (auto &hContact : Contacts(MODULENAME)) {
+ ptrW dbNick(db_get_wsa(hContact, MODULENAME, "Nick"));
if (dbNick == NULL)
break;
if (mir_wstrcmp(dbNick, nick))
continue;
- ptrW dbURL(db_get_wsa(hContact, MODULE, "URL"));
+ ptrW dbURL(db_get_wsa(hContact, MODULENAME, "URL"));
if (dbURL == NULL)
break;
if (mir_wstrcmp(dbURL, url))
diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp index 0cc91bec3e..4341b57672 100644 --- a/plugins/NewsAggregator/Src/Services.cpp +++ b/plugins/NewsAggregator/Src/Services.cpp @@ -36,10 +36,10 @@ int NewsAggrInit(WPARAM, LPARAM) else
mir_wstrncpy(tszRoot, VARSW(L"%miranda_userdata%\\Avatars\\" _A2W(DEFAULT_AVATARS_FOLDER)), _countof(tszRoot));
- for (auto &hContact : Contacts(MODULE)) {
- if (!db_get_b(NULL, MODULE, "StartupRetrieve", 1))
- db_set_dw(hContact, MODULE, "LastCheck", time(0));
- db_set_w(hContact, MODULE, "Status", ID_STATUS_ONLINE);
+ for (auto &hContact : Contacts(MODULENAME)) {
+ if (!db_get_b(NULL, MODULENAME, "StartupRetrieve", 1))
+ db_set_dw(hContact, MODULENAME, "LastCheck", time(0));
+ db_set_w(hContact, MODULENAME, "Status", ID_STATUS_ONLINE);
}
NetlibInit();
@@ -64,7 +64,7 @@ int NewsAggrPreShutdown(WPARAM, LPARAM) INT_PTR NewsAggrGetName(WPARAM wParam, LPARAM lParam)
{
if(lParam) {
- mir_strncpy((char *)lParam, MODULE, wParam);
+ mir_strncpy((char *)lParam, MODULENAME, wParam);
return 0;
}
@@ -96,10 +96,10 @@ INT_PTR NewsAggrSetStatus(WPARAM wp, LPARAM) if(nStatus != g_nStatus) {
g_nStatus = nStatus;
- for (auto &hContact : Contacts(MODULE))
- db_set_w(hContact, MODULE, "Status", nStatus);
+ for (auto &hContact : Contacts(MODULENAME))
+ db_set_w(hContact, MODULENAME, "Status", nStatus);
- ProtoBroadcastAck(MODULE, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)nOldStatus, g_nStatus);
+ ProtoBroadcastAck(MODULENAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)nOldStatus, g_nStatus);
}
}
@@ -119,7 +119,7 @@ INT_PTR NewsAggrLoadIcon(WPARAM wParam, LPARAM) static void __cdecl AckThreadProc(void *param)
{
Sleep(100);
- ProtoBroadcastAck(MODULE, (UINT_PTR)param, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0);
+ ProtoBroadcastAck(MODULENAME, (UINT_PTR)param, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0);
}
INT_PTR NewsAggrGetInfo(WPARAM, LPARAM lParam)
@@ -131,8 +131,8 @@ INT_PTR NewsAggrGetInfo(WPARAM, LPARAM lParam) INT_PTR CheckAllFeeds(WPARAM, LPARAM lParam)
{
- for (auto &hContact : Contacts(MODULE)) {
- if (lParam && db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME))
+ for (auto &hContact : Contacts(MODULENAME)) {
+ if (lParam && db_get_dw(hContact, MODULENAME, "UpdateTime", DEFAULT_UPDATE_TIME))
UpdateListAdd(hContact);
else if (!lParam)
UpdateListAdd(hContact);
@@ -207,12 +207,12 @@ INT_PTR NewsAggrGetAvatarInfo(WPARAM wParam, LPARAM lParam) // if GAIF_FORCE is set, we are updating the feed
// otherwise, cached avatar is used
- if ((wParam & GAIF_FORCE) && db_get_dw(pai->hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME))
+ if ((wParam & GAIF_FORCE) && db_get_dw(pai->hContact, MODULENAME, "UpdateTime", DEFAULT_UPDATE_TIME))
UpdateListAdd(pai->hContact);
- if (db_get_b(NULL, MODULE, "AutoUpdate", 1) != 0 && !ThreadRunning)
+ if (db_get_b(NULL, MODULENAME, "AutoUpdate", 1) != 0 && !ThreadRunning)
mir_forkthread(UpdateThreadProc, (void *)TRUE);
- wchar_t *ptszImageURL = db_get_wsa(pai->hContact, MODULE, "ImageURL");
+ wchar_t *ptszImageURL = db_get_wsa(pai->hContact, MODULENAME, "ImageURL");
if(ptszImageURL == nullptr)
return GAIR_NOAVATAR;
@@ -222,7 +222,7 @@ INT_PTR NewsAggrGetAvatarInfo(WPARAM wParam, LPARAM lParam) INT_PTR NewsAggrRecvMessage(WPARAM, LPARAM lParam)
{
- PROTOACCOUNT *pa = Proto_GetAccount(MODULE);
+ PROTOACCOUNT *pa = Proto_GetAccount(MODULENAME);
if (pa && pa->ppro) {
CCSDATA *ccs = (CCSDATA*)lParam;
pa->ppro->PROTO_INTERFACE::RecvMsg(ccs->hContact, (PROTORECVEVENT*)ccs->lParam);
@@ -239,14 +239,14 @@ void UpdateMenu(bool State) Menu_ModifyItem(hService2[0], LPGENW("Auto Update Disabled"), GetIconHandle("disabled"));
CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTBButton, State ? TTBST_PUSHED : 0);
- db_set_b(NULL, MODULE, "AutoUpdate", !State);
+ db_set_b(NULL, MODULENAME, "AutoUpdate", !State);
}
// update the newsaggregator auto-update menu item when click on it
INT_PTR EnableDisable(WPARAM, LPARAM)
{
- UpdateMenu(db_get_b(NULL, MODULE, "AutoUpdate", 1) != 0);
- NewsAggrSetStatus(db_get_b(NULL, MODULE, "AutoUpdate", 1) ? ID_STATUS_ONLINE : ID_STATUS_OFFLINE, 0);
+ UpdateMenu(db_get_b(NULL, MODULENAME, "AutoUpdate", 1) != 0);
+ NewsAggrSetStatus(db_get_b(NULL, MODULENAME, "AutoUpdate", 1) ? ID_STATUS_ONLINE : ID_STATUS_OFFLINE, 0);
return 0;
}
@@ -259,7 +259,7 @@ int OnToolbarLoaded(WPARAM, LPARAM) ttb.pszTooltipDn = LPGEN("Auto Update Disabled");
ttb.hIconHandleUp = GetIconHandle("enabled");
ttb.hIconHandleDn = GetIconHandle("disabled");
- ttb.dwFlags = (db_get_b(NULL, MODULE, "AutoUpdate", 1) ? 0 : TTBBF_PUSHED) | TTBBF_ASPUSHBUTTON | TTBBF_VISIBLE;
+ ttb.dwFlags = (db_get_b(NULL, MODULENAME, "AutoUpdate", 1) ? 0 : TTBBF_PUSHED) | TTBBF_ASPUSHBUTTON | TTBBF_VISIBLE;
hTBButton = TopToolbar_AddButton(&ttb);
return 0;
}
diff --git a/plugins/NewsAggregator/Src/Update.cpp b/plugins/NewsAggregator/Src/Update.cpp index 45db5d3f7e..7809904ad9 100644 --- a/plugins/NewsAggregator/Src/Update.cpp +++ b/plugins/NewsAggregator/Src/Update.cpp @@ -30,10 +30,10 @@ void CALLBACK timerProc(HWND, UINT, UINT_PTR, DWORD) // only run if it is not current updating and the auto update option is enabled
if (!ThreadRunning && !Miranda_IsTerminated()) {
bool HaveUpdates = FALSE;
- for (auto &hContact : Contacts(MODULE)) {
- if (db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME)) {
- double diff = difftime(time(0), (time_t)db_get_dw(hContact, MODULE, "LastCheck", 0));
- if (db_get_b(NULL, MODULE, "AutoUpdate", 1) != 0 && diff >= db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME) * 60) {
+ for (auto &hContact : Contacts(MODULENAME)) {
+ if (db_get_dw(hContact, MODULENAME, "UpdateTime", DEFAULT_UPDATE_TIME)) {
+ double diff = difftime(time(0), (time_t)db_get_dw(hContact, MODULENAME, "LastCheck", 0));
+ if (db_get_b(NULL, MODULENAME, "AutoUpdate", 1) != 0 && diff >= db_get_dw(hContact, MODULENAME, "UpdateTime", DEFAULT_UPDATE_TIME) * 60) {
UpdateListAdd(hContact);
HaveUpdates = TRUE;
}
@@ -51,8 +51,8 @@ void CALLBACK timerProc2(HWND, UINT, UINT_PTR, DWORD) KillTimer(nullptr, timerId);
ThreadRunning = FALSE;
- if (db_get_b(NULL, MODULE, "AutoUpdate", 1) && !Miranda_IsTerminated()) {
- if (db_get_b(NULL, MODULE, "StartupRetrieve", 1))
+ if (db_get_b(NULL, MODULENAME, "AutoUpdate", 1) && !Miranda_IsTerminated()) {
+ if (db_get_b(NULL, MODULENAME, "StartupRetrieve", 1))
CheckAllFeeds(0, 1);
timerId = SetTimer(nullptr, 0, 30000, (TIMERPROC)timerProc);
}
diff --git a/plugins/NewsAggregator/Src/Utils.cpp b/plugins/NewsAggregator/Src/Utils.cpp index 56a5a99182..47d97495d0 100644 --- a/plugins/NewsAggregator/Src/Utils.cpp +++ b/plugins/NewsAggregator/Src/Utils.cpp @@ -26,7 +26,7 @@ bool UpdateListFlag = FALSE; bool IsMyContact(MCONTACT hContact)
{
const char *szProto = GetContactProto(hContact);
- return szProto != nullptr && mir_strcmp(MODULE, szProto) == 0;
+ return szProto != nullptr && mir_strcmp(MODULENAME, szProto) == 0;
}
void NetlibInit()
@@ -34,7 +34,7 @@ void NetlibInit() NETLIBUSER nlu = {};
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szDescriptiveName.w = TranslateT("NewsAggregator HTTP connection");
- nlu.szSettingsModule = MODULE;
+ nlu.szSettingsModule = MODULENAME;
hNetlibUser = Netlib_RegisterUser(&nlu);
}
@@ -72,7 +72,7 @@ void GetNewsData(wchar_t *tszUrl, char **szData, MCONTACT hContact, CFeedEditor nlhr.headers[3].szName = "Connection";
nlhr.headers[3].szValue = "close";
char auth[256];
- if (db_get_b(hContact, MODULE, "UseAuth", 0) || (pEditDlg && pEditDlg->m_useauth.IsChecked()) /*IsDlgButtonChecked(hwndDlg, IDC_USEAUTH)*/) {
+ if (db_get_b(hContact, MODULENAME, "UseAuth", 0) || (pEditDlg && pEditDlg->m_useauth.IsChecked()) /*IsDlgButtonChecked(hwndDlg, IDC_USEAUTH)*/) {
nlhr.headersCount++;
nlhr.headers[4].szName = "Authorization";
@@ -429,8 +429,8 @@ LPCTSTR ClearText(CMStringW &result, const wchar_t *message) MCONTACT GetContactByNick(const wchar_t *nick)
{
- for (auto &hContact : Contacts(MODULE)) {
- ptrW contactNick(::db_get_wsa(hContact, MODULE, "Nick"));
+ for (auto &hContact : Contacts(MODULENAME)) {
+ ptrW contactNick(::db_get_wsa(hContact, MODULENAME, "Nick"));
if (!mir_wstrcmpi(contactNick, nick))
return hContact;
}
@@ -439,8 +439,8 @@ MCONTACT GetContactByNick(const wchar_t *nick) MCONTACT GetContactByURL(const wchar_t *url)
{
- for (auto &hContact : Contacts(MODULE)) {
- ptrW contactURL(::db_get_wsa(hContact, MODULE, "URL"));
+ for (auto &hContact : Contacts(MODULENAME)) {
+ ptrW contactURL(::db_get_wsa(hContact, MODULENAME, "URL"));
if (!mir_wstrcmpi(contactURL, url))
return hContact;
}
diff --git a/plugins/NewsAggregator/Src/stdafx.h b/plugins/NewsAggregator/Src/stdafx.h index 834e47b174..d2215249cd 100644 --- a/plugins/NewsAggregator/Src/stdafx.h +++ b/plugins/NewsAggregator/Src/stdafx.h @@ -54,7 +54,7 @@ Boston, MA 02111-1307, USA. #include "version.h"
#include "resource.h"
-#define MODULE "NewsAggregator"
+#define MODULENAME "NewsAggregator"
#define TAGSDEFAULT L"#<title>#\r\n#<link>#\r\n#<description>#"
#define DEFAULT_AVATARS_FOLDER "NewsAggregator"
#define DEFAULT_UPDATE_TIME 60
@@ -70,12 +70,7 @@ extern wchar_t tszRoot[MAX_PATH]; struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE)
- {
- RegisterProtocol(PROTOTYPE_VIRTUAL);
- SetUniqueId("URL");
- }
+ CMPlugin();
};
//============ STRUCT USED TO MAKE AN UPDATE LIST ============
diff --git a/plugins/NoHistory/src/dllmain.cpp b/plugins/NoHistory/src/dllmain.cpp index 3f3e1a8ae5..535c9fde4a 100644 --- a/plugins/NoHistory/src/dllmain.cpp +++ b/plugins/NoHistory/src/dllmain.cpp @@ -12,8 +12,8 @@ HGENMENU hMenuToggle, hMenuClear; mir_cs list_cs;
-#define MS_NOHISTORY_TOGGLE MODULE "/ToggleOnOff"
-#define MS_NOHISTORY_CLEAR MODULE "/Clear"
+#define MS_NOHISTORY_TOGGLE MODULENAME "/ToggleOnOff"
+#define MS_NOHISTORY_CLEAR MODULENAME "/Clear"
#define DBSETTING_REMOVE "RemoveHistory"
@@ -27,7 +27,7 @@ struct EventListNode { EventListNode *event_list = nullptr;
// plugin stuff
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -41,9 +41,13 @@ PLUGININFOEX pluginInfo = {0xb25e8c7b, 0x292b, 0x495a, {0x9f, 0xb8, 0xa4, 0xc3, 0xd4, 0xee, 0xb0, 0x4b}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec (dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -70,7 +74,7 @@ void RemoveReadEvents(MCONTACT hContact = 0) }
if (remove) {
- if (db_get_b(node->hContact, MODULE, DBSETTING_REMOVE, 0)) // is history disabled for this contact?
+ if (db_get_b(node->hContact, MODULENAME, DBSETTING_REMOVE, 0)) // is history disabled for this contact?
db_event_delete(node->hContact, node->hDBEvent);
// remove list node anyway
@@ -107,7 +111,7 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) int OnDatabaseEventAdd(WPARAM hContact, LPARAM hDBEvent)
{
// history not disabled for this contact
- if (db_get_b(hContact, MODULE, DBSETTING_REMOVE, 0) == 0)
+ if (db_get_b(hContact, MODULENAME, DBSETTING_REMOVE, 0) == 0)
return 0;
DBEVENTINFO info = {};
@@ -136,7 +140,7 @@ INT_PTR ServiceClear(WPARAM hContact, LPARAM) int PrebuildContactMenu(WPARAM hContact, LPARAM)
{
- bool remove = db_get_b(hContact, MODULE, DBSETTING_REMOVE, 0) != 0;
+ bool remove = db_get_b(hContact, MODULENAME, DBSETTING_REMOVE, 0) != 0;
char *proto = GetContactProto(hContact);
bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0);
@@ -155,12 +159,12 @@ int PrebuildContactMenu(WPARAM hContact, LPARAM) INT_PTR ServiceToggle(WPARAM hContact, LPARAM)
{
- int remove = db_get_b(hContact, MODULE, DBSETTING_REMOVE, 0) != 0;
+ int remove = db_get_b(hContact, MODULENAME, DBSETTING_REMOVE, 0) != 0;
remove = !remove;
- db_set_b(hContact, MODULE, DBSETTING_REMOVE, remove != 0);
+ db_set_b(hContact, MODULENAME, DBSETTING_REMOVE, remove != 0);
StatusIconData sid = {};
- sid.szModule = MODULE;
+ sid.szModule = MODULENAME;
for (int i = 0; i < 2; ++i) {
sid.dwId = i;
@@ -183,10 +187,10 @@ int WindowEvent(WPARAM, LPARAM lParam) case MSG_WINDOW_EVT_OPEN:
char *proto = GetContactProto(hContact);
bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0);
- int remove = db_get_b(hContact, MODULE, DBSETTING_REMOVE, 0) != 0;
+ int remove = db_get_b(hContact, MODULENAME, DBSETTING_REMOVE, 0) != 0;
StatusIconData sid = {};
- sid.szModule = MODULE;
+ sid.szModule = MODULENAME;
for (int i=0; i < 2; ++i) {
sid.dwId = i;
sid.flags = (chat_room ? MBF_HIDDEN : (i == remove) ? 0 : MBF_HIDDEN);
@@ -204,7 +208,7 @@ int IconPressed(WPARAM hContact, LPARAM lParam) return 0;
if (sicd->flags & MBCF_RIGHTBUTTON) return 0; // ignore right-clicks
- if (mir_strcmp(sicd->szModule, MODULE) != 0) return 0; // not our event
+ if (mir_strcmp(sicd->szModule, MODULENAME) != 0) return 0; // not our event
char *proto = GetContactProto(hContact);
bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0);
@@ -219,7 +223,7 @@ int IconPressed(WPARAM hContact, LPARAM lParam) void SrmmMenu_Load()
{
StatusIconData sid = {};
- sid.szModule = MODULE;
+ sid.szModule = MODULENAME;
sid.dwId = 0;
sid.szTooltip = LPGEN("History Enabled");
@@ -265,7 +269,7 @@ static int ModulesLoaded(WPARAM, LPARAM) extern "C" __declspec (dllexport) int Load()
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
// Ensure that the common control DLL is loaded (for listview)
INITCOMMONCONTROLSEX icex = { sizeof(icex), ICC_LISTVIEW_CLASSES };
diff --git a/plugins/NoHistory/src/icons.cpp b/plugins/NoHistory/src/icons.cpp index f9f50f3595..0fb6176f81 100644 --- a/plugins/NoHistory/src/icons.cpp +++ b/plugins/NoHistory/src/icons.cpp @@ -19,7 +19,7 @@ int ReloadIcons(WPARAM, LPARAM) void InitIcons()
{
- g_plugin.registerIcon(LPGEN("No History"), iconList, MODULE);
+ g_plugin.registerIcon(LPGEN("No History"), iconList, MODULENAME);
ReloadIcons(0, 0);
diff --git a/plugins/NoHistory/src/options.cpp b/plugins/NoHistory/src/options.cpp index da4d9555d2..4cb6b5fd65 100644 --- a/plugins/NoHistory/src/options.cpp +++ b/plugins/NoHistory/src/options.cpp @@ -84,7 +84,7 @@ static void SetAllContactIcons(HWND hwndList) if (!chat_room) {
HANDLE hItem=(HANDLE)SendMessage(hwndList,CLM_FINDCONTACT,hContact,0);
if (hItem) {
- bool disabled = (db_get_b(hContact, MODULE, DBSETTING_REMOVE, 0) == 1);
+ bool disabled = (db_get_b(hContact, MODULENAME, DBSETTING_REMOVE, 0) == 1);
SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(0,disabled?1:0));
}
}
@@ -199,7 +199,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA HANDLE hItem = (HANDLE)SendMessage(hwndList,CLM_FINDCONTACT,hContact,0);
if (hItem) {
int iImage = SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(0,0));
- db_set_b(hContact, MODULE, DBSETTING_REMOVE, iImage==1?1:0);
+ db_set_b(hContact, MODULENAME, DBSETTING_REMOVE, iImage==1?1:0);
}
}
}
diff --git a/plugins/NoHistory/src/stdafx.h b/plugins/NoHistory/src/stdafx.h index 295a3b01df..76962ba8f6 100644 --- a/plugins/NoHistory/src/stdafx.h +++ b/plugins/NoHistory/src/stdafx.h @@ -21,15 +21,13 @@ #include "options.h"
#include "version.h"
-#define MODULE "NoHistory"
+#define MODULENAME "NoHistory"
#define DBSETTING_REMOVE "RemoveHistory"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE)
- {}
+ CMPlugin();
};
void SrmmMenu_Load();
diff --git a/plugins/Non-IM Contact/src/main.cpp b/plugins/Non-IM Contact/src/main.cpp index 8666f0ac00..e7e43d6929 100644 --- a/plugins/Non-IM Contact/src/main.cpp +++ b/plugins/Non-IM Contact/src/main.cpp @@ -77,6 +77,12 @@ PLUGININFOEX pluginInfoEx = { { 0x2e0d2ae3, 0xe123, 0x4607, {0x85, 0x39, 0xd4, 0x44, 0x8d, 0x67, 0x5d, 0xdb} }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODNAME, pluginInfoEx)
+{
+ RegisterProtocol(PROTOTYPE_VIRTUAL);
+}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
diff --git a/plugins/Non-IM Contact/src/stdafx.h b/plugins/Non-IM Contact/src/stdafx.h index 6d1821d180..ff8899df3c 100644 --- a/plugins/Non-IM Contact/src/stdafx.h +++ b/plugins/Non-IM Contact/src/stdafx.h @@ -119,11 +119,7 @@ extern HNETLIBUSER hNetlibUser; struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODNAME)
- {
- RegisterProtocol(PROTOTYPE_VIRTUAL);
- }
+ CMPlugin();
};
#endif
diff --git a/plugins/NotesAndReminders/src/globals.h b/plugins/NotesAndReminders/src/globals.h index 90c0003964..b6c8363b97 100644 --- a/plugins/NotesAndReminders/src/globals.h +++ b/plugins/NotesAndReminders/src/globals.h @@ -30,9 +30,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {}
+ CMPlugin();
};
// normal timer interval for reminder update processing
diff --git a/plugins/NotesAndReminders/src/main.cpp b/plugins/NotesAndReminders/src/main.cpp index 30c88eab08..116a939710 100644 --- a/plugins/NotesAndReminders/src/main.cpp +++ b/plugins/NotesAndReminders/src/main.cpp @@ -17,7 +17,7 @@ extern TREEELEMENT *RemindersList; /////////////////////////////////////////////////////////////////////////////////////////
-static PLUGININFOEX pluginInfo =
+static PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -30,9 +30,13 @@ static PLUGININFOEX pluginInfo = {0x842a6668, 0xf9da, 0x4968, {0xbf, 0xd7, 0xd2, 0xbd, 0x9d, 0xf8, 0x48, 0xee}} // {842A6668-F9DA-4968-BFD7-D2BD9DF848EE}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -271,7 +275,7 @@ int OnModulesLoaded(WPARAM, LPARAM) extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
hmiranda = GetModuleHandle(nullptr);
diff --git a/plugins/NotifyAnything/src/main.cpp b/plugins/NotifyAnything/src/main.cpp index 4b05c673ad..893ddc3bd1 100644 --- a/plugins/NotifyAnything/src/main.cpp +++ b/plugins/NotifyAnything/src/main.cpp @@ -29,7 +29,7 @@ int &hLangpack(g_plugin.m_hLang); /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -43,9 +43,13 @@ PLUGININFOEX pluginInfo = { 0xe92874ec, 0x594a, 0x4a2f, { 0xbd, 0xed, 0xc0, 0xbe, 0x8b, 0x5a, 0x45, 0xd1 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -970,7 +974,7 @@ void stop_threads() extern "C" int __declspec(dllexport) Load()
{
g_firstrun = true;
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
wchar_t buf[MAX_PATH + 1];
mir_wstrcpy(buf, L".");
diff --git a/plugins/NotifyAnything/src/options.cpp b/plugins/NotifyAnything/src/options.cpp index 41e983dcba..d468ff11bc 100644 --- a/plugins/NotifyAnything/src/options.cpp +++ b/plugins/NotifyAnything/src/options.cpp @@ -134,34 +134,34 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara void save_settings()
{
- db_set_b(NULL, PlugName, "local_only", g_settings.local_only);
- db_set_b(NULL, PlugName, "debug_messages", g_settings.debug_messages);
- db_set_b(NULL, PlugName, "log_to_file", g_settings.log_to_file);
- db_set_b(NULL, PlugName, "beep", g_settings.sound);
- db_set_b(NULL, PlugName, "use_pcspeaker", g_settings.use_pcspeaker);
- db_set_b(NULL, PlugName, "allow_execute", g_settings.allow_execute);
- db_set_dw(NULL, PlugName, "port", g_settings.port);
- db_set_ws(NULL, PlugName, "password", g_settings.password.c_str());
- db_set_ws(NULL, PlugName, "log_filename", g_settings.log_filename.c_str());
+ db_set_b(NULL, MODULENAME, "local_only", g_settings.local_only);
+ db_set_b(NULL, MODULENAME, "debug_messages", g_settings.debug_messages);
+ db_set_b(NULL, MODULENAME, "log_to_file", g_settings.log_to_file);
+ db_set_b(NULL, MODULENAME, "beep", g_settings.sound);
+ db_set_b(NULL, MODULENAME, "use_pcspeaker", g_settings.use_pcspeaker);
+ db_set_b(NULL, MODULENAME, "allow_execute", g_settings.allow_execute);
+ db_set_dw(NULL, MODULENAME, "port", g_settings.port);
+ db_set_ws(NULL, MODULENAME, "password", g_settings.password.c_str());
+ db_set_ws(NULL, MODULENAME, "log_filename", g_settings.log_filename.c_str());
}
void load_settings()
{
- g_settings.local_only = db_get_b(NULL, PlugName, "local_only", 1) != 0;
- g_settings.debug_messages = db_get_b(NULL, PlugName, "debug_messages", 0) != 0;
- g_settings.log_to_file = db_get_b(NULL, PlugName, "log_to_file", 0) != 0;
- g_settings.sound = NASettings::sound_t(db_get_b(NULL, PlugName, "beep", g_settings.request));
- g_settings.use_pcspeaker = db_get_b(NULL, PlugName, "use_pcspeaker", 0) != 0;
- g_settings.allow_execute = db_get_b(NULL, PlugName, "allow_execute", 0) != 0;
- g_settings.port = db_get_dw(NULL, PlugName, "port", 12001);
+ g_settings.local_only = db_get_b(NULL, MODULENAME, "local_only", 1) != 0;
+ g_settings.debug_messages = db_get_b(NULL, MODULENAME, "debug_messages", 0) != 0;
+ g_settings.log_to_file = db_get_b(NULL, MODULENAME, "log_to_file", 0) != 0;
+ g_settings.sound = NASettings::sound_t(db_get_b(NULL, MODULENAME, "beep", g_settings.request));
+ g_settings.use_pcspeaker = db_get_b(NULL, MODULENAME, "use_pcspeaker", 0) != 0;
+ g_settings.allow_execute = db_get_b(NULL, MODULENAME, "allow_execute", 0) != 0;
+ g_settings.port = db_get_dw(NULL, MODULENAME, "port", 12001);
DBVARIANT dbv;
- if (!db_get_ws(NULL, PlugName, "password", &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, "password", &dbv)) {
g_settings.password = dbv.ptszVal;
db_free(&dbv);
}
- if (!db_get_ws(NULL, PlugName, "log_filename", &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, "log_filename", &dbv)) {
g_settings.log_filename = dbv.ptszVal;
db_free(&dbv);
}
diff --git a/plugins/NotifyAnything/src/stdafx.h b/plugins/NotifyAnything/src/stdafx.h index 1eaf2a7da5..940b5d379f 100644 --- a/plugins/NotifyAnything/src/stdafx.h +++ b/plugins/NotifyAnything/src/stdafx.h @@ -21,13 +21,11 @@ #include "resource.h"
#include "version.h"
-const char PlugName[] = "NotifyAnything";
+#define MODULENAME "NotifyAnything"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(PlugName)
- {}
+ CMPlugin();
};
//---------------------------
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index d32aaedcd0..b01c7c73ae 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -20,7 +20,7 @@ static IconItem iconList[] = /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -34,9 +34,13 @@ PLUGININFOEX pluginInfo = { 0xe47cc215, 0xd28, 0x462d, { 0xa0, 0xf6, 0x3a, 0xe4, 0x44, 0x3d, 0x29, 0x26 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -478,7 +482,7 @@ static int AccListChanged(WPARAM wParam, LPARAM lParam) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
LoadIcons();
diff --git a/plugins/Nudge/src/stdafx.h b/plugins/Nudge/src/stdafx.h index 3c32e9a31c..17f4503308 100644 --- a/plugins/Nudge/src/stdafx.h +++ b/plugins/Nudge/src/stdafx.h @@ -76,9 +76,7 @@ void AutoResendNudge(void *wParam) ; struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {}
+ CMPlugin();
};
extern int nProtocol;
diff --git a/plugins/OpenFolder/src/openFolder.cpp b/plugins/OpenFolder/src/openFolder.cpp index fa4f9da040..c08b14f09b 100644 --- a/plugins/OpenFolder/src/openFolder.cpp +++ b/plugins/OpenFolder/src/openFolder.cpp @@ -2,9 +2,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(nullptr)
- {}
+ CMPlugin();
}
g_plugin;
@@ -27,6 +25,10 @@ PLUGININFOEX pluginInfoEx = {0x10896143, 0x7249, 0x4b36, {0xa4, 0x8, 0x65, 0x1, 0xa6, 0xb6, 0x3, 0x5a}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(nullptr, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
diff --git a/plugins/OpenSSL/src/main.cpp b/plugins/OpenSSL/src/main.cpp index 1b59fa5b7a..c1d7dfc1bc 100644 --- a/plugins/OpenSSL/src/main.cpp +++ b/plugins/OpenSSL/src/main.cpp @@ -25,9 +25,7 @@ void UnloadSslModule(void); struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(nullptr)
- {}
+ CMPlugin();
}
g_plugin;
@@ -35,7 +33,7 @@ int &hLangpack(g_plugin.m_hLang); /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo = {
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
__VERSION_DWORD,
@@ -48,9 +46,13 @@ PLUGININFOEX pluginInfo = { { 0xb649702c, 0x13de, 0x408a, { 0xb6, 0xc2, 0xfb, 0x8f, 0xed, 0x2a, 0x2c, 0x90 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(nullptr, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -61,7 +63,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SSL, M extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
return LoadSslModule();
}
diff --git a/plugins/PackUpdater/Src/Events.cpp b/plugins/PackUpdater/Src/Events.cpp index c0a4830ac0..9ad9d4918b 100644 --- a/plugins/PackUpdater/Src/Events.cpp +++ b/plugins/PackUpdater/Src/Events.cpp @@ -31,7 +31,7 @@ int ModulesLoaded(WPARAM, LPARAM) hkd.pszName = "Check for pack updates";
hkd.szDescription.w = LPGENW("Check for pack updates");
hkd.szSection.w = LPGENW("Pack Updater");
- hkd.pszService = MODNAME"/CheckUpdates";
+ hkd.pszService = MODULENAME"/CheckUpdates";
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, VK_F10) | HKF_MIRANDA_LOCAL;
Hotkey_Register(&hkd);
diff --git a/plugins/PackUpdater/Src/Notifications.cpp b/plugins/PackUpdater/Src/Notifications.cpp index e2e3d9793c..a9d691e588 100644 --- a/plugins/PackUpdater/Src/Notifications.cpp +++ b/plugins/PackUpdater/Src/Notifications.cpp @@ -96,11 +96,11 @@ static void MakePopupAction(POPUPACTION &pa, INT id) switch (id) {
case IDYES:
pa.lchIcon = IcoLib_GetIcon("btn_ok");
- strncpy_s(pa.lpzTitle, MODNAME"/Yes", _countof(pa.lpzTitle));
+ strncpy_s(pa.lpzTitle, MODULENAME"/Yes", _countof(pa.lpzTitle));
break;
case IDNO:
pa.lchIcon = IcoLib_GetIcon("btn_cancel");
- strncpy_s(pa.lpzTitle, MODNAME"/No", _countof(pa.lpzTitle));
+ strncpy_s(pa.lpzTitle, MODULENAME"/No", _countof(pa.lpzTitle));
break;
}
}
@@ -176,9 +176,9 @@ INT_PTR CALLBACK DlgDownloadPop(HWND hDlg, UINT uMsg, WPARAM, LPARAM) static void __stdcall CreateDownloadDialog(void*)
{
- if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups3", DEFAULT_POPUP_ENABLED))
+ if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODULENAME, "Popups3", DEFAULT_POPUP_ENABLED))
hDlgDld = CreateDialog(g_plugin.getInst(), MAKEINTRESOURCE(IDD_POPUPDUMMI), nullptr, DlgDownloadPop);
- else if (db_get_b(NULL, MODNAME, "Popups3M", DEFAULT_MESSAGE_ENABLED)) {
+ else if (db_get_b(NULL, MODULENAME, "Popups3M", DEFAULT_MESSAGE_ENABLED)) {
mir_wstrncpy(tszDialogMsg, Text, _countof(tszDialogMsg));
hDlgDld = CreateDialog(g_plugin.getInst(), MAKEINTRESOURCE(IDD_DOWNLOAD), nullptr, DlgDownload);
}
@@ -195,11 +195,11 @@ void DlgDownloadProc() if (!DownloadFile(pFileUrl->tszDownloadURL, pFileUrl->tszDiskPath)) {
Title = TranslateT("Pack Updater");
Text = TranslateT("An error occurred while downloading the update.");
- if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups1", DEFAULT_POPUP_ENABLED)) {
+ if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODULENAME, "Popups1", DEFAULT_POPUP_ENABLED)) {
Number = 1;
show_popup(nullptr, Title, Text, Number, 0);
}
- else if (db_get_b(NULL, MODNAME, "Popups1M", DEFAULT_MESSAGE_ENABLED))
+ else if (db_get_b(NULL, MODULENAME, "Popups1M", DEFAULT_MESSAGE_ENABLED))
MessageBox(nullptr, Text, Title, MB_ICONSTOP);
}
CallFunctionAsync(DestroyDownloadDialog, nullptr);
@@ -274,7 +274,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam EnableWindow(hwOk, true/*one_enabled ? TRUE : FALSE*/);
// do this after filling list - enables 'ITEMCHANGED' below
SetWindowLongPtr(hDlg, GWLP_USERDATA, lParam);
- Utils_RestoreWindowPositionNoSize(hDlg, 0, MODNAME, "ConfirmWindow");
+ Utils_RestoreWindowPositionNoSize(hDlg, 0, MODULENAME, "ConfirmWindow");
}
return TRUE;
@@ -338,7 +338,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam PROCESS_INFORMATION pi;
SetWindowLongPtr(hDlg, GWLP_USERDATA, 0);
- Utils_SaveWindowPosition(hDlg, NULL, MODNAME, "ConfirmWindow");
+ Utils_SaveWindowPosition(hDlg, NULL, MODULENAME, "ConfirmWindow");
arFileType.clear();
arFilePath.clear();
@@ -401,7 +401,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam }
mir_wstrncpy(todo[i].tszCurVer, todo[i].tszNewVer, _countof(todo[i].tszCurVer));
mir_snprintf(szKey, "File_%d_CurrentVersion", todo[i].FileNum);
- db_set_ws(NULL, MODNAME, szKey, todo[i].tszCurVer);
+ db_set_ws(NULL, MODULENAME, szKey, todo[i].tszCurVer);
arFileType.push_back(todo[i].FileType);
arFilePath.push_back(todo[i].File.tszDiskPath);
arFileName.push_back(tszFileName);
@@ -420,7 +420,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam INT rc = -1;
Title = TranslateT("Pack Updater");
Text = tszBuff;
- if (ServiceExists(MS_POPUP_ADDPOPUPT) && ServiceExists(MS_POPUP_REGISTERACTIONS) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups0", DEFAULT_POPUP_ENABLED) && (db_get_dw(NULL, "Popup", "Actions", 0) & 1))
+ if (ServiceExists(MS_POPUP_ADDPOPUPT) && ServiceExists(MS_POPUP_REGISTERACTIONS) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODULENAME, "Popups0", DEFAULT_POPUP_ENABLED) && (db_get_dw(NULL, "Popup", "Actions", 0) & 1))
rc = DialogBox(g_plugin.getInst(), MAKEINTRESOURCE(IDD_POPUPDUMMI), nullptr, DlgMsgPop);
else
rc = MessageBox(nullptr, tszBuff, Title, MB_YESNO | MB_ICONQUESTION);
@@ -436,7 +436,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam break;
case 1:
if (Reminder == 2)
- db_set_b(NULL, MODNAME, "Reminder", 1);
+ db_set_b(NULL, MODULENAME, "Reminder", 1);
memset(&si, 0, sizeof(STARTUPINFO));
memset(&pi, 0, sizeof(PROCESS_INFORMATION));
si.cb = sizeof(STARTUPINFO);
@@ -504,15 +504,15 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam }
else { //reminder for not installed pack update
if (Reminder && (UpdatesCount == 1) && (arFileType[0] == 1))
- db_set_b(NULL, MODNAME, "Reminder", 2);
+ db_set_b(NULL, MODULENAME, "Reminder", 2);
mir_snwprintf(tszBuff, TranslateT("You have chosen not to install the pack update immediately.\nYou can install it manually from this location:\n\n%s"), arFilePath[0].c_str());
Title = TranslateT("Pack Updater");
Text = tszBuff;
- if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups2", DEFAULT_POPUP_ENABLED)) {
+ if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODULENAME, "Popups2", DEFAULT_POPUP_ENABLED)) {
Number = 2;
show_popup(nullptr, Title, Text, Number, 0);
}
- else if (db_get_b(NULL, MODNAME, "Popups2M", DEFAULT_MESSAGE_ENABLED))
+ else if (db_get_b(NULL, MODULENAME, "Popups2M", DEFAULT_MESSAGE_ENABLED))
MessageBox(nullptr, Text, Title, MB_ICONINFORMATION);
}
}
@@ -522,7 +522,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam case IDCANCEL:
SetWindowLongPtr(hDlg, GWLP_USERDATA, 0);
- Utils_SaveWindowPosition(hDlg, NULL, MODNAME, "ConfirmWindow");
+ Utils_SaveWindowPosition(hDlg, NULL, MODULENAME, "ConfirmWindow");
EndDialog(hDlg, IDCANCEL);
return TRUE;
diff --git a/plugins/PackUpdater/Src/Options.cpp b/plugins/PackUpdater/Src/Options.cpp index f7701cb158..49649a9f66 100644 --- a/plugins/PackUpdater/Src/Options.cpp +++ b/plugins/PackUpdater/Src/Options.cpp @@ -65,7 +65,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA else {
for (int i = 1; i < POPUPS; i++) {
mir_snprintf(str, "Popups%dM", i);
- CheckDlgButton(hwndDlg, (i + 1029), (db_get_b(NULL, MODNAME, str, DEFAULT_MESSAGE_ENABLED)) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, (i + 1029), (db_get_b(NULL, MODULENAME, str, DEFAULT_MESSAGE_ENABLED)) ? BST_CHECKED : BST_UNCHECKED);
}
}
return TRUE;
@@ -134,17 +134,17 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA InitTimer();
- db_set_b(NULL, MODNAME, "UpdateOnStartup", UpdateOnStartup);
- db_set_b(NULL, MODNAME, "OnlyOnceADay", OnlyOnceADay);
- db_set_b(NULL, MODNAME, "UpdateOnPeriod", UpdateOnPeriod);
- db_set_dw(NULL, MODNAME, "Period", Period);
- db_set_b(NULL, MODNAME, "PeriodMeasure", PeriodMeasure);
+ db_set_b(NULL, MODULENAME, "UpdateOnStartup", UpdateOnStartup);
+ db_set_b(NULL, MODULENAME, "OnlyOnceADay", OnlyOnceADay);
+ db_set_b(NULL, MODULENAME, "UpdateOnPeriod", UpdateOnPeriod);
+ db_set_dw(NULL, MODULENAME, "Period", Period);
+ db_set_b(NULL, MODULENAME, "PeriodMeasure", PeriodMeasure);
Reminder = IsDlgButtonChecked(hwndDlg, IDC_REMINDER);
- db_set_b(NULL, MODNAME, "Reminder", Reminder);
+ db_set_b(NULL, MODULENAME, "Reminder", Reminder);
if (!ServiceExists(MS_POPUP_ADDPOPUPT)) {
for (int i = 1; i < POPUPS; i++) {
mir_snprintf(str, "Popups%dM", i);
- db_set_b(NULL, MODNAME, str, (BYTE)(IsDlgButtonChecked(hwndDlg, (i + 1029))));
+ db_set_b(NULL, MODULENAME, str, (BYTE)(IsDlgButtonChecked(hwndDlg, (i + 1029))));
}
}
}
@@ -200,8 +200,8 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) for (i = 0; i < POPUPS; i++) {
mir_snprintf(str, "Popups%d", i);
mir_snprintf(str2, "Popups%dM", i);
- CheckDlgButton(hdlg, (i + 40071), (db_get_b(NULL, MODNAME, str, DEFAULT_POPUP_ENABLED)) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hdlg, (i + 1024), (db_get_b(NULL, MODNAME, str2, DEFAULT_MESSAGE_ENABLED)) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hdlg, (i + 40071), (db_get_b(NULL, MODULENAME, str, DEFAULT_POPUP_ENABLED)) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hdlg, (i + 1024), (db_get_b(NULL, MODULENAME, str2, DEFAULT_MESSAGE_ENABLED)) ? BST_CHECKED : BST_UNCHECKED);
if (IsDlgButtonChecked(hdlg, (i + 40071)))
EnableWindow(GetDlgItem(hdlg, (i + 1024)), FALSE);
else if (i > 0)
@@ -349,27 +349,27 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) ctlColor = SendDlgItemMessage(hdlg, (i + 42071), CPM_GETCOLOUR, 0, 0);
PopupsList[i].colorBack = ctlColor;
mir_snprintf(szSetting, "Popups%iBg", i);
- db_set_dw(NULL, MODNAME, szSetting, ctlColor);
+ db_set_dw(NULL, MODULENAME, szSetting, ctlColor);
ctlColor = SendDlgItemMessage(hdlg, (i + 41071), CPM_GETCOLOUR, 0, 0);
PopupsList[i].colorText = ctlColor;
mir_snprintf(szSetting, "Popups%iTx", i);
- db_set_dw(NULL, MODNAME, szSetting, ctlColor);
+ db_set_dw(NULL, MODULENAME, szSetting, ctlColor);
}
//Colors
- db_set_b(NULL, MODNAME, "DefColors", MyOptions.DefColors);
+ db_set_b(NULL, MODULENAME, "DefColors", MyOptions.DefColors);
//Timeout
MyOptions.Timeout = GetDlgItemInt(hdlg, IDC_TIMEOUT_VALUE, nullptr, TRUE);
- db_set_dw(NULL, MODNAME, "Timeout", MyOptions.Timeout);
+ db_set_dw(NULL, MODULENAME, "Timeout", MyOptions.Timeout);
//Left mouse click
- db_set_b(NULL, MODNAME, "LeftClickAction", MyOptions.LeftClickAction);
+ db_set_b(NULL, MODULENAME, "LeftClickAction", MyOptions.LeftClickAction);
//Right mouse click
- db_set_b(NULL, MODNAME, "RightClickAction", MyOptions.RightClickAction);
+ db_set_b(NULL, MODULENAME, "RightClickAction", MyOptions.RightClickAction);
//Notified popups
for (i = 0; i < POPUPS; i++) {
mir_snprintf(str, "Popups%d", i);
- db_set_b(NULL, MODNAME, str, (BYTE)(IsDlgButtonChecked(hdlg, (i + 40071))));
+ db_set_b(NULL, MODULENAME, str, (BYTE)(IsDlgButtonChecked(hdlg, (i + 40071))));
mir_snprintf(str2, "Popups%dM", i);
- db_set_b(NULL, MODNAME, str2, (BYTE)(IsDlgButtonChecked(hdlg, (i + 1024))));
+ db_set_b(NULL, MODULENAME, str2, (BYTE)(IsDlgButtonChecked(hdlg, (i + 1024))));
}
return TRUE;
}
diff --git a/plugins/PackUpdater/Src/PackUpdater.cpp b/plugins/PackUpdater/Src/PackUpdater.cpp index 2199c515ab..784bef719a 100644 --- a/plugins/PackUpdater/Src/PackUpdater.cpp +++ b/plugins/PackUpdater/Src/PackUpdater.cpp @@ -41,6 +41,10 @@ PLUGININFOEX pluginInfoEx = { 0x29517be5, 0x779a, 0x48e5, { 0x89, 0x50, 0xcb, 0x4d, 0xe1, 0xd4, 0x31, 0x72 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
@@ -66,7 +70,7 @@ extern "C" __declspec(dllexport) int Load(void) IcoLibInit();
// Add cheking update menu item
- CreateServiceFunction(MODNAME"/CheckUpdates", MenuCommand);
+ CreateServiceFunction(MODULENAME"/CheckUpdates", MenuCommand);
CMenuItem mi;
SET_UID(mi, 0x326495e8, 0xab0a, 0x47d2, 0xb2, 0x22, 0x2a, 0x8e, 0xa8, 0xae, 0x53, 0x1a);
@@ -74,18 +78,18 @@ extern "C" __declspec(dllexport) int Load(void) mi.flags = CMIF_UNICODE;
mi.hIcolibItem = IcoLib_GetIcon("check_update");
mi.name.w = LPGENW("Check for pack updates");
- mi.pszService = MODNAME"/CheckUpdates";
+ mi.pszService = MODULENAME"/CheckUpdates";
Menu_AddMainMenuItem(&mi);
// Add empty updates folder menu item
- CreateServiceFunction(MODNAME"/EmptyFolder", EmptyFolder);
+ CreateServiceFunction(MODULENAME"/EmptyFolder", EmptyFolder);
memset(&mi, 0, sizeof(mi));
SET_UID(mi, 0xc3eea590, 0xaba3, 0x454f, 0x93, 0x93, 0xbc, 0x97, 0x15, 0x2c, 0x3b, 0x3d);
mi.position = -0x7FFFFFFF;
mi.flags = CMIF_UNICODE;
mi.hIcolibItem = IcoLib_GetIcon("empty_folder");
mi.name.w = LPGENW("Clear pack updates folder");
- mi.pszService = MODNAME"/EmptyFolder";
+ mi.pszService = MODULENAME"/EmptyFolder";
Menu_AddMainMenuItem(&mi);
// Add options hook
diff --git a/plugins/PackUpdater/Src/Utils.cpp b/plugins/PackUpdater/Src/Utils.cpp index 14bd0ad350..c3c456d411 100644 --- a/plugins/PackUpdater/Src/Utils.cpp +++ b/plugins/PackUpdater/Src/Utils.cpp @@ -52,7 +52,7 @@ BOOL NetlibInit() NETLIBUSER nlu = {};
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szDescriptiveName.w = TranslateT("Pack Updater HTTP connection");
- nlu.szSettingsModule = MODNAME;
+ nlu.szSettingsModule = MODULENAME;
hNetlibUser = Netlib_RegisterUser(&nlu);
return hNetlibUser != nullptr;
@@ -69,41 +69,41 @@ void InitPopupList() int index = 0;
PopupsList[index].ID = index;
PopupsList[index].Icon = SKINICON_OTHER_MIRANDA;
- PopupsList[index].colorBack = db_get_dw(NULL, MODNAME, "Popups0Bg", COLOR_BG_FIRSTDEFAULT);
- PopupsList[index].colorText = db_get_dw(NULL, MODNAME, "Popups0Tx", COLOR_TX_DEFAULT);
+ PopupsList[index].colorBack = db_get_dw(NULL, MODULENAME, "Popups0Bg", COLOR_BG_FIRSTDEFAULT);
+ PopupsList[index].colorText = db_get_dw(NULL, MODULENAME, "Popups0Tx", COLOR_TX_DEFAULT);
index = 1;
PopupsList[index].ID = index;
PopupsList[index].Icon = SKINICON_OTHER_MIRANDA;
- PopupsList[index].colorBack = db_get_dw(NULL, MODNAME, "Popups1Bg", COLOR_BG_SECONDDEFAULT);
- PopupsList[index].colorText = db_get_dw(NULL, MODNAME, "Popups1Tx", COLOR_TX_DEFAULT);
+ PopupsList[index].colorBack = db_get_dw(NULL, MODULENAME, "Popups1Bg", COLOR_BG_SECONDDEFAULT);
+ PopupsList[index].colorText = db_get_dw(NULL, MODULENAME, "Popups1Tx", COLOR_TX_DEFAULT);
index = 2;
PopupsList[index].ID = index;
PopupsList[index].Icon = SKINICON_OTHER_MIRANDA;
- PopupsList[index].colorBack = db_get_dw(NULL, MODNAME, "Popups2Bg", COLOR_BG_FIRSTDEFAULT);
- PopupsList[index].colorText = db_get_dw(NULL, MODNAME, "Popups2Tx", COLOR_TX_DEFAULT);
+ PopupsList[index].colorBack = db_get_dw(NULL, MODULENAME, "Popups2Bg", COLOR_BG_FIRSTDEFAULT);
+ PopupsList[index].colorText = db_get_dw(NULL, MODULENAME, "Popups2Tx", COLOR_TX_DEFAULT);
index = 3;
PopupsList[index].ID = index;
PopupsList[index].Icon = SKINICON_OTHER_MIRANDA;
- PopupsList[index].colorBack = db_get_dw(NULL, MODNAME, "Popups3Bg", COLOR_BG_SECONDDEFAULT);
- PopupsList[index].colorText = db_get_dw(NULL, MODNAME, "Popups3Tx", COLOR_TX_DEFAULT);
+ PopupsList[index].colorBack = db_get_dw(NULL, MODULENAME, "Popups3Bg", COLOR_BG_SECONDDEFAULT);
+ PopupsList[index].colorText = db_get_dw(NULL, MODULENAME, "Popups3Tx", COLOR_TX_DEFAULT);
}
void LoadOptions()
{
- MyOptions.DefColors = db_get_b(NULL, MODNAME, "DefColors", DEFAULT_COLORS);
- MyOptions.LeftClickAction = db_get_b(NULL, MODNAME, "LeftClickAction", DEFAULT_POPUP_LCLICK);
- MyOptions.RightClickAction = db_get_b(NULL, MODNAME, "RightClickAction", DEFAULT_POPUP_RCLICK);
- MyOptions.Timeout = db_get_dw(NULL, MODNAME, "Timeout", DEFAULT_TIMEOUT_VALUE);
- UpdateOnStartup = db_get_b(NULL, MODNAME, "UpdateOnStartup", DEFAULT_UPDATEONSTARTUP);
- OnlyOnceADay = db_get_b(NULL, MODNAME, "OnlyOnceADay", DEFAULT_ONLYONCEADAY);
- UpdateOnPeriod = db_get_b(NULL, MODNAME, "UpdateOnPeriod", DEFAULT_UPDATEONPERIOD);
- Period = db_get_dw(NULL, MODNAME, "Period", DEFAULT_PERIOD);
- PeriodMeasure = db_get_b(NULL, MODNAME, "PeriodMeasure", DEFAULT_PERIODMEASURE);
- Reminder = db_get_b(NULL, MODNAME, "Reminder", DEFAULT_REMINDER);
- FileCount = db_get_dw(NULL, MODNAME, "FileCount", DEFAULT_FILECOUNT);
+ MyOptions.DefColors = db_get_b(NULL, MODULENAME, "DefColors", DEFAULT_COLORS);
+ MyOptions.LeftClickAction = db_get_b(NULL, MODULENAME, "LeftClickAction", DEFAULT_POPUP_LCLICK);
+ MyOptions.RightClickAction = db_get_b(NULL, MODULENAME, "RightClickAction", DEFAULT_POPUP_RCLICK);
+ MyOptions.Timeout = db_get_dw(NULL, MODULENAME, "Timeout", DEFAULT_TIMEOUT_VALUE);
+ UpdateOnStartup = db_get_b(NULL, MODULENAME, "UpdateOnStartup", DEFAULT_UPDATEONSTARTUP);
+ OnlyOnceADay = db_get_b(NULL, MODULENAME, "OnlyOnceADay", DEFAULT_ONLYONCEADAY);
+ UpdateOnPeriod = db_get_b(NULL, MODULENAME, "UpdateOnPeriod", DEFAULT_UPDATEONPERIOD);
+ Period = db_get_dw(NULL, MODULENAME, "Period", DEFAULT_PERIOD);
+ PeriodMeasure = db_get_b(NULL, MODULENAME, "PeriodMeasure", DEFAULT_PERIODMEASURE);
+ Reminder = db_get_b(NULL, MODULENAME, "Reminder", DEFAULT_REMINDER);
+ FileCount = db_get_dw(NULL, MODULENAME, "FileCount", DEFAULT_FILECOUNT);
}
BOOL DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal)
@@ -186,19 +186,19 @@ static void CheckUpdates(void *) if (!Exists(tszRoot))
CreateDirectory(tszRoot, nullptr);
Files.clear();
- Reminder = db_get_b(NULL, MODNAME, "Reminder", DEFAULT_REMINDER);
- FileCount = db_get_dw(NULL, MODNAME, "FileCount", DEFAULT_FILECOUNT);
+ Reminder = db_get_b(NULL, MODULENAME, "Reminder", DEFAULT_REMINDER);
+ FileCount = db_get_dw(NULL, MODULENAME, "FileCount", DEFAULT_FILECOUNT);
// Load files info
- ptrW tszDownloadURL(db_get_wsa(NULL, MODNAME, "File_VersionURL"));
+ ptrW tszDownloadURL(db_get_wsa(NULL, MODULENAME, "File_VersionURL"));
if (!tszDownloadURL) { // URL is not set
Title = TranslateT("Pack Updater");
Text = TranslateT("URL for checking updates not found.");
- if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups1", DEFAULT_POPUP_ENABLED)) {
+ if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODULENAME, "Popups1", DEFAULT_POPUP_ENABLED)) {
Number = 1;
show_popup(nullptr, Title, Text, Number, 0);
}
- else if (db_get_b(NULL, MODNAME, "Popups1M", DEFAULT_MESSAGE_ENABLED))
+ else if (db_get_b(NULL, MODULENAME, "Popups1M", DEFAULT_MESSAGE_ENABLED))
MessageBox(nullptr, Text, Title, MB_ICONSTOP);
hCheckThread = nullptr;
return;
@@ -222,14 +222,14 @@ static void CheckUpdates(void *) FILEINFO FileInfo = { L"", L"", L"", L"", L"", L"", L"", { L"", L"" } };
mir_snprintf(szKey, "File_%d_CurrentVersion", CurrentFile + 1);
- ptrW tszCurVer(db_get_wsa(NULL, MODNAME, szKey));
+ ptrW tszCurVer(db_get_wsa(NULL, MODULENAME, szKey));
if (tszCurVer)
mir_wstrncpy(FileInfo.tszCurVer, tszCurVer, _countof(FileInfo.tszCurVer));
else
mir_wstrncpy(FileInfo.tszCurVer, L"", _countof(FileInfo.tszCurVer));
mir_snprintf(szKey, "File_%d_LastVersion", CurrentFile + 1);
- ptrW tszLastVer(db_get_wsa(NULL, MODNAME, szKey));
+ ptrW tszLastVer(db_get_wsa(NULL, MODULENAME, szKey));
if (tszLastVer)
mir_wstrncpy(FileInfo.tszLastVer, tszLastVer, _countof(FileInfo.tszLastVer));
else
@@ -249,11 +249,11 @@ static void CheckUpdates(void *) if (wcsstr(tszBuff, L"\\")) { //check update name
Title = TranslateT("Pack Updater");
Text = TranslateT("Name of Update's file is not supported.");
- if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups1", DEFAULT_POPUP_ENABLED)) {
+ if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODULENAME, "Popups1", DEFAULT_POPUP_ENABLED)) {
Number = 1;
show_popup(nullptr, Title, Text, Number, 0);
}
- else if (db_get_b(NULL, MODNAME, "Popups1M", DEFAULT_MESSAGE_ENABLED))
+ else if (db_get_b(NULL, MODULENAME, "Popups1M", DEFAULT_MESSAGE_ENABLED))
MessageBox(nullptr, Text, Title, MB_ICONINFORMATION);
continue;
} // end check update name
@@ -323,7 +323,7 @@ static void CheckUpdates(void *) // Save last version
mir_wstrncpy(Files[CurrentFile].tszLastVer, Files[CurrentFile].tszNewVer, _countof(Files[CurrentFile].tszLastVer));
mir_snprintf(szKey, "File_%d_LastVersion", CurrentFile + 1);
- db_set_ws(NULL, MODNAME, szKey, Files[CurrentFile].tszLastVer);
+ db_set_ws(NULL, MODULENAME, szKey, Files[CurrentFile].tszLastVer);
} // end compare versions
} //end checking all files in for ()
@@ -340,22 +340,22 @@ static void CheckUpdates(void *) if (!UpdatesCount && !Silent) {
Title = TranslateT("Pack Updater");
Text = TranslateT("No updates found.");
- if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups2", DEFAULT_POPUP_ENABLED)) {
+ if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODULENAME, "Popups2", DEFAULT_POPUP_ENABLED)) {
Number = 2;
show_popup(nullptr, Title, Text, Number, 0);
}
- else if (db_get_b(NULL, MODNAME, "Popups2M", DEFAULT_MESSAGE_ENABLED))
+ else if (db_get_b(NULL, MODULENAME, "Popups2M", DEFAULT_MESSAGE_ENABLED))
MessageBox(nullptr, Text, Title, MB_ICONINFORMATION);
}
if (!FileCount) {
Title = TranslateT("Pack Updater");
Text = TranslateT("No files for update.");
- if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups2", DEFAULT_POPUP_ENABLED)) {
+ if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODULENAME, "Popups2", DEFAULT_POPUP_ENABLED)) {
Number = 2;
show_popup(nullptr, Title, Text, Number, 0);
}
- else if (db_get_b(NULL, MODNAME, "Popups2M", DEFAULT_MESSAGE_ENABLED))
+ else if (db_get_b(NULL, MODULENAME, "Popups2M", DEFAULT_MESSAGE_ENABLED))
MessageBox(nullptr, Text, Title, MB_ICONINFORMATION);
}
hCheckThread = nullptr;
@@ -366,16 +366,16 @@ void DoCheck(int iFlag) if (hCheckThread != nullptr) {
Title = TranslateT("Pack Updater");
Text = TranslateT("Update checking already started!");
- if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups2", DEFAULT_POPUP_ENABLED)) {
+ if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODULENAME, "Popups2", DEFAULT_POPUP_ENABLED)) {
Number = 2;
show_popup(nullptr, Title, Text, Number, 0);
}
- else if (db_get_b(NULL, MODNAME, "Popups2M", DEFAULT_MESSAGE_ENABLED))
+ else if (db_get_b(NULL, MODULENAME, "Popups2M", DEFAULT_MESSAGE_ENABLED))
MessageBox(nullptr, Text, Title, MB_ICONINFORMATION);
}
else if (iFlag) {
hCheckThread = mir_forkthread(CheckUpdates);
- db_set_dw(NULL, MODNAME, "LastUpdate", time(0));
+ db_set_dw(NULL, MODULENAME, "LastUpdate", time(0));
}
}
@@ -383,7 +383,7 @@ BOOL AllowUpdateOnStartup() {
if (OnlyOnceADay) {
time_t now = time(0);
- time_t was = db_get_dw(NULL, MODNAME, "LastUpdate", 0);
+ time_t was = db_get_dw(NULL, MODULENAME, "LastUpdate", 0);
if ((now - was) < 86400)
return FALSE;
diff --git a/plugins/PackUpdater/Src/stdafx.h b/plugins/PackUpdater/Src/stdafx.h index 5df3de5503..be444fdfc8 100644 --- a/plugins/PackUpdater/Src/stdafx.h +++ b/plugins/PackUpdater/Src/stdafx.h @@ -45,17 +45,15 @@ Boston, MA 02111-1307, USA. #include "resource.h"
#include "Notifications.h"
-#define MODNAME "PackUpdater"
-#define MODULEA "Pack Updater"
-#define MODULE L"Pack Updater"
+#define MODULENAME "PackUpdater"
+#define MODULEA "Pack Updater"
+#define MODULE L"Pack Updater"
#define DEFAULT_UPDATES_FOLDER L"Pack Updates"
typedef std::wstring tString;
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODNAME)
- {}
+ CMPlugin();
};
struct FILEURL
diff --git a/plugins/PasteIt/src/Options.cpp b/plugins/PasteIt/src/Options.cpp index 8a23ecc154..70a578ce7c 100644 --- a/plugins/PasteIt/src/Options.cpp +++ b/plugins/PasteIt/src/Options.cpp @@ -630,7 +630,7 @@ unsigned int Options::GetCodepageCB(HWND hwndCB, bool errorReport, unsigned int void Options::SetDefWeb(int web)
{
defWeb = web;
- db_set_ws(0, MODULE, "defWeb", pasteToWebs[web]->GetName());
+ db_set_ws(0, MODULENAME, "defWeb", pasteToWebs[web]->GetName());
DefWebPageChanged();
}
@@ -698,11 +698,11 @@ int Options::InitOptions(WPARAM wParam, LPARAM) void Options::Save()
{
- db_set_ws(0, MODULE, "defWeb", pasteToWebs[defWeb]->GetName());
- db_set_dw(0, MODULE, "codepage", codepage);
- db_set_b(0, MODULE, "autoUTF", autoUTF ? 1 : 0);
- db_set_b(0, MODULE, "confDlg", confDlg ? 1 : 0);
- db_set_b(0, MODULE, "autoSend", autoSend ? 1 : 0);
+ db_set_ws(0, MODULENAME, "defWeb", pasteToWebs[defWeb]->GetName());
+ db_set_dw(0, MODULENAME, "codepage", codepage);
+ db_set_b(0, MODULENAME, "autoUTF", autoUTF ? 1 : 0);
+ db_set_b(0, MODULENAME, "confDlg", confDlg ? 1 : 0);
+ db_set_b(0, MODULENAME, "autoSend", autoSend ? 1 : 0);
for (int i = 0; i < PasteToWeb::pages; ++i) {
char buf[256];
wchar_t* name = pasteToWebs[i]->GetName();
@@ -719,29 +719,29 @@ void Options::Save() forms += it->id + L'=' + it->name + L';';
}
- db_set_ws(0, MODULE, buf, forms.c_str());
+ db_set_ws(0, MODULENAME, buf, forms.c_str());
mir_strncpy(buf + j, "defFormatId", _countof(buf) - j);
- db_set_ws(0, MODULE, buf, webOptions[i]->defFormatId.c_str());
+ db_set_ws(0, MODULENAME, buf, webOptions[i]->defFormatId.c_str());
if (webOptions[i]->isSendFileName) {
mir_strncpy(buf + j, "sendFileName", _countof(buf) - j);
- db_set_b(0, MODULE, buf, webOptions[i]->sendFileName ? 1 : 0);
+ db_set_b(0, MODULENAME, buf, webOptions[i]->sendFileName ? 1 : 0);
}
if (webOptions[i]->isPublicPaste) {
mir_strncpy(buf + j, "publicPaste", _countof(buf) - j);
- db_set_b(0, MODULE, buf, webOptions[i]->publicPaste ? 1 : 0);
+ db_set_b(0, MODULENAME, buf, webOptions[i]->publicPaste ? 1 : 0);
}
if (webOptions[i]->isCombo1) {
mir_strncpy(buf + j, "combo1", _countof(buf) - j);
- db_set_ws(0, MODULE, buf, webOptions[i]->combo1.c_str());
+ db_set_ws(0, MODULENAME, buf, webOptions[i]->combo1.c_str());
}
if (webOptions[i]->isPastebin) {
mir_strncpy(buf + j, "pastebinUserKey", _countof(buf) - j);
- db_set_ws(0, MODULE, buf, webOptions[i]->pastebinUserKey.c_str());
+ db_set_ws(0, MODULENAME, buf, webOptions[i]->pastebinUserKey.c_str());
}
}
}
@@ -749,7 +749,7 @@ void Options::Save() void Options::Load()
{
DBVARIANT defWebV;
- if (!db_get_ws(0, MODULE, "defWeb", &defWebV)) {
+ if (!db_get_ws(0, MODULENAME, "defWeb", &defWebV)) {
for (int i = 0; i < PasteToWeb::pages; ++i) {
if (!mir_wstrcmp(pasteToWebs[i]->GetName(), defWebV.pwszVal)) {
defWeb = i;
@@ -758,10 +758,10 @@ void Options::Load() }
db_free(&defWebV);
}
- codepage = db_get_dw(0, MODULE, "codepage", CP_ACP);
- autoUTF = db_get_b(0, MODULE, "autoUTF", 1) ? true : false;
- confDlg = db_get_b(0, MODULE, "confDlg", 1) ? true : false;
- autoSend = db_get_b(0, MODULE, "autoSend", 0) ? true : false;
+ codepage = db_get_dw(0, MODULENAME, "codepage", CP_ACP);
+ autoUTF = db_get_b(0, MODULENAME, "autoUTF", 1) ? true : false;
+ confDlg = db_get_b(0, MODULENAME, "confDlg", 1) ? true : false;
+ autoSend = db_get_b(0, MODULENAME, "autoSend", 0) ? true : false;
for (int i = 0; i < PasteToWeb::pages; ++i) {
char buf[256];
int j = 0;
@@ -776,7 +776,7 @@ void Options::Load() mir_strncpy(buf + j, "formats", _countof(buf) - j);
DBVARIANT forms;
- if (!db_get_ws(0, MODULE, buf, &forms)) {
+ if (!db_get_ws(0, MODULENAME, buf, &forms)) {
webOptions[i]->formats.clear();
int k = 0;
wchar_t *id = forms.pwszVal;
@@ -803,25 +803,25 @@ void Options::Load() mir_strncpy(buf + j, "defFormatId", _countof(buf) - j);
DBVARIANT defForm;
- if (!db_get_ws(0, MODULE, buf, &defForm)) {
+ if (!db_get_ws(0, MODULENAME, buf, &defForm)) {
webOptions[i]->defFormatId = defForm.pwszVal;
db_free(&defForm);
}
if (webOptions[i]->isSendFileName) {
mir_strncpy(buf + j, "sendFileName", _countof(buf) - j);
- webOptions[i]->sendFileName = db_get_b(0, MODULE, buf, 1) ? true : false;
+ webOptions[i]->sendFileName = db_get_b(0, MODULENAME, buf, 1) ? true : false;
}
if (webOptions[i]->isPublicPaste) {
mir_strncpy(buf + j, "publicPaste", _countof(buf) - j);
- webOptions[i]->publicPaste = db_get_b(0, MODULE, buf, 0) ? true : false;
+ webOptions[i]->publicPaste = db_get_b(0, MODULENAME, buf, 0) ? true : false;
}
if (webOptions[i]->isCombo1) {
mir_strncpy(buf + j, "combo1", _countof(buf) - j);
DBVARIANT combo1;
- if (!db_get_ws(0, MODULE, buf, &combo1)) {
+ if (!db_get_ws(0, MODULENAME, buf, &combo1)) {
webOptions[i]->combo1 = combo1.pwszVal;
db_free(&combo1);
}
@@ -830,7 +830,7 @@ void Options::Load() if (webOptions[i]->isPastebin) {
mir_strncpy(buf + j, "pastebinUserKey", _countof(buf) - j);
DBVARIANT pastebinUserKey;
- if (!db_get_ws(0, MODULE, buf, &pastebinUserKey)) {
+ if (!db_get_ws(0, MODULENAME, buf, &pastebinUserKey)) {
webOptions[i]->pastebinUserKey = pastebinUserKey.pwszVal;
db_free(&pastebinUserKey);
}
diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp index 0a3341afe2..fa66646577 100644 --- a/plugins/PasteIt/src/PasteIt.cpp +++ b/plugins/PasteIt/src/PasteIt.cpp @@ -45,7 +45,7 @@ CHAT_MANAGER *pci; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -59,9 +59,13 @@ PLUGININFOEX pluginInfo = { 0x1aac15e8, 0xdcec, 0x4050, { 0xb6, 0x6f, 0x2a, 0xa0, 0xe6, 0x12, 0xc, 0x22 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -184,7 +188,7 @@ static int TabsrmmButtonPressed(WPARAM hContact, LPARAM lParam) {
CustomButtonClickData *cbc = (CustomButtonClickData *)lParam;
- if (!mir_strcmp(cbc->pszModule, MODULE) && cbc->dwButtonId == 1 && hContact) {
+ if (!mir_strcmp(cbc->pszModule, MODULENAME) && cbc->dwButtonId == 1 && hContact) {
if (cbc->flags == BBCF_ARROWCLICKED) {
HMENU hMenu = CreatePopupMenu();
if (hMenu) {
@@ -307,7 +311,7 @@ static void InitTabsrmmButton() {
BBButton btn = {};
btn.dwButtonID = 1;
- btn.pszModuleName = MODULE;
+ btn.pszModuleName = MODULENAME;
btn.dwDefPos = 110;
btn.hIcon = iconList[0].hIcolib;
btn.bbbFlags = BBBF_ISARROWBUTTON | BBBF_ISIMBUTTON | BBBF_CANBEHIDDEN | BBBF_ISCHATBUTTON;
@@ -351,14 +355,14 @@ static int ModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pci = Chat_GetInterface();
g_plugin.registerIcon(LPGEN("Paste It"), iconList);
NETLIBUSER nlu = {};
nlu.flags = NUF_UNICODE | NUF_OUTGOING | NUF_HTTPCONNS;
- nlu.szSettingsModule = MODULE;
+ nlu.szSettingsModule = MODULENAME;
nlu.szDescriptiveName.w = TranslateT("Paste It HTTP connections");
g_hNetlibUser = Netlib_RegisterUser(&nlu);
diff --git a/plugins/PasteIt/src/stdafx.h b/plugins/PasteIt/src/stdafx.h index 139b7ed2dc..347e4e0dff 100644 --- a/plugins/PasteIt/src/stdafx.h +++ b/plugins/PasteIt/src/stdafx.h @@ -38,11 +38,9 @@ extern PasteToWeb* pasteToWebs[PasteToWeb::pages];
-#define MODULE "PasteIt"
+#define MODULENAME "PasteIt"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE)
- {}
+ CMPlugin();
};
diff --git a/plugins/Ping/src/log.cpp b/plugins/Ping/src/log.cpp index 20782c2c17..6c183f40bf 100644 --- a/plugins/Ping/src/log.cpp +++ b/plugins/Ping/src/log.cpp @@ -3,7 +3,7 @@ INT_PTR Log(WPARAM wParam, LPARAM) {
wchar_t buf[1024], tbuf[512], dbuf[512];
- CallService(PLUG "/GetLogFilename", (WPARAM)1024, (LPARAM)buf);
+ CallService(MODULENAME "/GetLogFilename", (WPARAM)1024, (LPARAM)buf);
//char TBcapt[255];
SYSTEMTIME systime;
@@ -32,7 +32,7 @@ INT_PTR Log(WPARAM wParam, LPARAM) { INT_PTR GetLogFilename(WPARAM wParam, LPARAM lParam) {
DBVARIANT dbv;
wchar_t *filename = (wchar_t *)lParam;
- if (db_get_ws(0, PLUG, "LogFilename", &dbv)) {
+ if (db_get_ws(0, MODULENAME, "LogFilename", &dbv)) {
Profile_GetPathW(wParam, filename);
mir_wstrncat(filename, L"\\ping_log.txt", wParam - mir_wstrlen(filename));
}
@@ -47,13 +47,13 @@ INT_PTR GetLogFilename(WPARAM wParam, LPARAM lParam) { }
INT_PTR SetLogFilename(WPARAM, LPARAM lParam) {
- db_set_ws(0, PLUG, "LogFilename", (wchar_t *)lParam);
+ db_set_ws(0, MODULENAME, "LogFilename", (wchar_t *)lParam);
return 0;
}
INT_PTR ViewLogData(WPARAM wParam, LPARAM) {
wchar_t buf[MAX_PATH];
- CallService(PLUG "/GetLogFilename", (WPARAM)MAX_PATH, (LPARAM)buf);
+ CallService(MODULENAME "/GetLogFilename", (WPARAM)MAX_PATH, (LPARAM)buf);
return (INT_PTR)ShellExecute((HWND)wParam, L"edit", buf, L"", L"", SW_SHOW);
}
diff --git a/plugins/Ping/src/menu.cpp b/plugins/Ping/src/menu.cpp index 3f2a0bd198..b3f286a246 100644 --- a/plugins/Ping/src/menu.cpp +++ b/plugins/Ping/src/menu.cpp @@ -15,13 +15,13 @@ void InitMenus() mi.position = 2000060000;
mi.hIcolibItem = hIconResponding;
mi.name.w = LPGENW("Enable all pings");
- mi.pszService = PLUG "/EnableAll";
+ mi.pszService = MODULENAME "/EnableAll";
Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0x1dac6ea6, 0x116e, 0x41a3, 0xa6, 0xe8, 0x42, 0xdf, 0xf7, 0x27, 0xc4, 0x7c);
mi.position = 2000060001;
mi.hIcolibItem = hIconDisabled;
mi.name.w = LPGENW("Disable all pings");
- mi.pszService = PLUG "/DisableAll";
+ mi.pszService = MODULENAME "/DisableAll";
Menu_AddMainMenuItem(&mi);
}
diff --git a/plugins/Ping/src/options.cpp b/plugins/Ping/src/options.cpp index e1c880cd87..5be6572852 100644 --- a/plugins/Ping/src/options.cpp +++ b/plugins/Ping/src/options.cpp @@ -77,7 +77,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
case IDC_BTN_VIEWLOG:
- CallService(PLUG "/ViewLogData", 0, 0);
+ CallService(MODULENAME "/ViewLogData", 0, 0);
break;
case IDC_BTN_LOGBROWSE:
{
@@ -150,7 +150,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA RefreshWindow(0, 0);
- if (options.logging) CallService(PLUG "/Log", (WPARAM)L"options changed", 0);
+ if (options.logging) CallService(MODULENAME "/Log", (WPARAM)L"options changed", 0);
if (hWakeEvent) SetEvent(hWakeEvent);
return TRUE;
}
@@ -482,8 +482,8 @@ static INT_PTR CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == PSN_APPLY)
{
- CallService(PLUG "/SetAndSavePingList", (WPARAM)&temp_list, 0);
- CallService(PLUG "/GetPingList", 0, (LPARAM)&temp_list);
+ CallService(MODULENAME "/SetAndSavePingList", (WPARAM)&temp_list, 0);
+ CallService(MODULENAME "/GetPingList", 0, (LPARAM)&temp_list);
// the following will be affected due to list rebuild event
//if(hWakeEvent) SetEvent(hWakeEvent);
return TRUE;
@@ -515,50 +515,50 @@ int PingOptInit(WPARAM wParam, LPARAM) }
void LoadOptions() {
- options.ping_period = db_get_dw(NULL, PLUG, "PingPeriod", DEFAULT_PING_PERIOD);
+ options.ping_period = db_get_dw(NULL, MODULENAME, "PingPeriod", DEFAULT_PING_PERIOD);
- options.ping_timeout = db_get_dw(NULL, PLUG, "PingTimeout", DEFAULT_PING_TIMEOUT);
- CallService(PLUG "/SetPingTimeout", (WPARAM)options.ping_timeout, 0);
- options.show_popup = (db_get_b(NULL, PLUG, "ShowPopup", DEFAULT_SHOW_POPUP ? 1 : 0) == 1);
- options.show_popup2 = (db_get_b(NULL, PLUG, "ShowPopup2", DEFAULT_SHOW_POPUP2 ? 1 : 0) == 1);
- options.block_reps = (db_get_b(NULL, PLUG, "BlockReps", DEFAULT_BLOCK_REPS ? 1 : 0) == 1);
- options.logging = (db_get_b(NULL, PLUG, "LoggingEnabled", DEFAULT_LOGGING_ENABLED ? 1 : 0) == 1);
+ options.ping_timeout = db_get_dw(NULL, MODULENAME, "PingTimeout", DEFAULT_PING_TIMEOUT);
+ CallService(MODULENAME "/SetPingTimeout", (WPARAM)options.ping_timeout, 0);
+ options.show_popup = (db_get_b(NULL, MODULENAME, "ShowPopup", DEFAULT_SHOW_POPUP ? 1 : 0) == 1);
+ options.show_popup2 = (db_get_b(NULL, MODULENAME, "ShowPopup2", DEFAULT_SHOW_POPUP2 ? 1 : 0) == 1);
+ options.block_reps = (db_get_b(NULL, MODULENAME, "BlockReps", DEFAULT_BLOCK_REPS ? 1 : 0) == 1);
+ options.logging = (db_get_b(NULL, MODULENAME, "LoggingEnabled", DEFAULT_LOGGING_ENABLED ? 1 : 0) == 1);
- options.no_test_icon = (db_get_b(NULL, PLUG, "NoTestStatus", DEFAULT_NO_TEST_ICON ? 1 : 0) == 1);
+ options.no_test_icon = (db_get_b(NULL, MODULENAME, "NoTestStatus", DEFAULT_NO_TEST_ICON ? 1 : 0) == 1);
- options.indent = db_get_w(NULL, PLUG, "Indent", 0);
- options.row_height = db_get_w(NULL, PLUG, "RowHeight", GetSystemMetrics(SM_CYSMICON));
+ options.indent = db_get_w(NULL, MODULENAME, "Indent", 0);
+ options.row_height = db_get_w(NULL, MODULENAME, "RowHeight", GetSystemMetrics(SM_CYSMICON));
- options.retries = db_get_dw(NULL, PLUG, "Retries", 0);
+ options.retries = db_get_dw(NULL, MODULENAME, "Retries", 0);
- CallService(PLUG "/GetLogFilename", (WPARAM)MAX_PATH, (LPARAM)options.log_filename);
+ CallService(MODULENAME "/GetLogFilename", (WPARAM)MAX_PATH, (LPARAM)options.log_filename);
ICMP::get_instance()->set_timeout(options.ping_timeout * 1000);
- options.attach_to_clist = (db_get_b(NULL, PLUG, "AttachToClist", DEFAULT_ATTACH_TO_CLIST ? 1 : 0) == 1);
- options.log_csv = (db_get_b(NULL, PLUG, "LogCSV", 0) == 1);
+ options.attach_to_clist = (db_get_b(NULL, MODULENAME, "AttachToClist", DEFAULT_ATTACH_TO_CLIST ? 1 : 0) == 1);
+ options.log_csv = (db_get_b(NULL, MODULENAME, "LogCSV", 0) == 1);
}
void SaveOptions() {
- db_set_dw(NULL, PLUG, "PingPeriod", options.ping_period);
- db_set_dw(NULL, PLUG, "PingTimeout", options.ping_timeout);
- CallService(PLUG "/SetPingTimeout", (WPARAM)options.ping_timeout, 0);
- db_set_b(NULL, PLUG, "ShowPopup", options.show_popup ? 1 : 0);
- db_set_b(NULL, PLUG, "ShowPopup2", options.show_popup2 ? 1 : 0);
- db_set_b(NULL, PLUG, "BlockReps", options.block_reps ? 1 : 0);
- db_set_b(NULL, PLUG, "LoggingEnabled", options.logging ? 1 : 0);
+ db_set_dw(NULL, MODULENAME, "PingPeriod", options.ping_period);
+ db_set_dw(NULL, MODULENAME, "PingTimeout", options.ping_timeout);
+ CallService(MODULENAME "/SetPingTimeout", (WPARAM)options.ping_timeout, 0);
+ db_set_b(NULL, MODULENAME, "ShowPopup", options.show_popup ? 1 : 0);
+ db_set_b(NULL, MODULENAME, "ShowPopup2", options.show_popup2 ? 1 : 0);
+ db_set_b(NULL, MODULENAME, "BlockReps", options.block_reps ? 1 : 0);
+ db_set_b(NULL, MODULENAME, "LoggingEnabled", options.logging ? 1 : 0);
- db_set_b(NULL, PLUG, "NoTestStatus", options.no_test_icon ? 1 : 0);
+ db_set_b(NULL, MODULENAME, "NoTestStatus", options.no_test_icon ? 1 : 0);
- db_set_w(NULL, PLUG, "Indent", options.indent);
- db_set_w(NULL, PLUG, "RowHeight", options.row_height);
+ db_set_w(NULL, MODULENAME, "Indent", options.indent);
+ db_set_w(NULL, MODULENAME, "RowHeight", options.row_height);
- db_set_dw(NULL, PLUG, "Retries", (DWORD)options.retries);
+ db_set_dw(NULL, MODULENAME, "Retries", (DWORD)options.retries);
- CallService(PLUG "/SetLogFilename", (WPARAM)MAX_PATH, (LPARAM)options.log_filename);
+ CallService(MODULENAME "/SetLogFilename", (WPARAM)MAX_PATH, (LPARAM)options.log_filename);
ICMP::get_instance()->set_timeout(options.ping_timeout * 1000);
- db_set_b(NULL, PLUG, "AttachToClist", options.attach_to_clist ? 1 : 0);
- db_set_b(NULL, PLUG, "LogCSV", options.log_csv ? 1 : 0);
+ db_set_b(NULL, MODULENAME, "AttachToClist", options.attach_to_clist ? 1 : 0);
+ db_set_b(NULL, MODULENAME, "LogCSV", options.log_csv ? 1 : 0);
}
diff --git a/plugins/Ping/src/ping.cpp b/plugins/Ping/src/ping.cpp index 01d99dedd4..cc40dbce37 100644 --- a/plugins/Ping/src/ping.cpp +++ b/plugins/Ping/src/ping.cpp @@ -11,7 +11,7 @@ bool use_raw_ping = true; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -25,9 +25,13 @@ PLUGININFOEX pluginInfo = { 0x760ea901, 0xc0c2, 0x446c, { 0x80, 0x29, 0x94, 0xc3, 0xbc, 0x47, 0xc4, 0x5e } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -35,31 +39,31 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) static void CreatePluginServices()
{
// general
- CreateServiceFunction(PLUG "/Ping", PluginPing);
- CreateServiceFunction(PLUG "/DblClick", DblClick);
+ CreateServiceFunction(MODULENAME "/Ping", PluginPing);
+ CreateServiceFunction(MODULENAME "/DblClick", DblClick);
// list
- CreateServiceFunction(PLUG "/ClearPingList", ClearPingList);
- CreateServiceFunction(PLUG "/GetPingList", GetPingList);
- CreateServiceFunction(PLUG "/SetPingList", SetPingList);
- CreateServiceFunction(PLUG "/SetAndSavePingList", SetAndSavePingList);
- CreateServiceFunction(PLUG "/LoadPingList", LoadPingList);
- CreateServiceFunction(PLUG "/SavePingList", SavePingList);
+ CreateServiceFunction(MODULENAME "/ClearPingList", ClearPingList);
+ CreateServiceFunction(MODULENAME "/GetPingList", GetPingList);
+ CreateServiceFunction(MODULENAME "/SetPingList", SetPingList);
+ CreateServiceFunction(MODULENAME "/SetAndSavePingList", SetAndSavePingList);
+ CreateServiceFunction(MODULENAME "/LoadPingList", LoadPingList);
+ CreateServiceFunction(MODULENAME "/SavePingList", SavePingList);
- reload_event_handle = CreateHookableEvent(PLUG "/ListReload");
+ reload_event_handle = CreateHookableEvent(MODULENAME "/ListReload");
//log
- CreateServiceFunction(PLUG "/Log", Log);
- CreateServiceFunction(PLUG "/ViewLogData", ViewLogData);
- CreateServiceFunction(PLUG "/GetLogFilename", GetLogFilename);
- CreateServiceFunction(PLUG "/SetLogFilename", SetLogFilename);
+ CreateServiceFunction(MODULENAME "/Log", Log);
+ CreateServiceFunction(MODULENAME "/ViewLogData", ViewLogData);
+ CreateServiceFunction(MODULENAME "/GetLogFilename", GetLogFilename);
+ CreateServiceFunction(MODULENAME "/SetLogFilename", SetLogFilename);
// menu
- CreateServiceFunction(PLUG "/DisableAll", PingDisableAll);
- CreateServiceFunction(PLUG "/EnableAll", PingEnableAll);
- CreateServiceFunction(PLUG "/ToggleEnabled", ToggleEnabled);
- CreateServiceFunction(PLUG "/ShowGraph", ShowGraph);
- CreateServiceFunction(PLUG "/Edit", EditContact);
+ CreateServiceFunction(MODULENAME "/DisableAll", PingDisableAll);
+ CreateServiceFunction(MODULENAME "/EnableAll", PingEnableAll);
+ CreateServiceFunction(MODULENAME "/ToggleEnabled", ToggleEnabled);
+ CreateServiceFunction(MODULENAME "/ShowGraph", ShowGraph);
+ CreateServiceFunction(MODULENAME "/Edit", EditContact);
}
@@ -82,7 +86,7 @@ static int OnShutdown(WPARAM, LPARAM) static int OnModulesLoaded(WPARAM, LPARAM)
{
NETLIBUSER nl_user = {};
- nl_user.szSettingsModule = PLUG;
+ nl_user.szSettingsModule = MODULENAME;
nl_user.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nl_user.szDescriptiveName.w = TranslateT("Ping Plugin");
hNetlibUser = Netlib_RegisterUser(&nl_user);
@@ -90,23 +94,23 @@ static int OnModulesLoaded(WPARAM, LPARAM) InitUtils();
InitMenus();
- hFillListEvent = HookEvent(PLUG "/ListReload", FillList);
+ hFillListEvent = HookEvent(MODULENAME "/ListReload", FillList);
- if (!db_get_b(0, PLUG, "PingPlugImport", 0)) {
+ if (!db_get_b(0, MODULENAME, "PingPlugImport", 0)) {
if (db_get_dw(0, "PingPlug", "NumEntries", 0)) {
import_ping_addresses();
- db_set_b(0, PLUG, "PingPlugImport", 1);
+ db_set_b(0, MODULENAME, "PingPlugImport", 1);
}
}
InitList();
- CallService(PLUG "/LoadPingList", 0, 0);
+ CallService(MODULENAME "/LoadPingList", 0, 0);
graphs_init();
if (options.logging)
- CallService(PLUG "/Log", (WPARAM)L"start", 0);
+ CallService(MODULENAME "/Log", (WPARAM)L"start", 0);
return 0;
}
@@ -121,11 +125,11 @@ static IconItem iconList[] = extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
use_raw_ping = false;
- db_set_b(0, PLUG, "UsingRawSockets", (BYTE)use_raw_ping);
+ db_set_b(0, MODULENAME, "UsingRawSockets", (BYTE)use_raw_ping);
DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &mainThread, THREAD_SET_CONTEXT, FALSE, 0);
hWakeEvent = CreateEvent(nullptr, FALSE, FALSE, L"Local\\ThreadWaitEvent");
@@ -156,7 +160,7 @@ extern "C" __declspec(dllexport) int Unload(void) CloseHandle(mainThread);
if (options.logging)
- CallService(PLUG "/Log", (WPARAM)L"stop", 0);
+ CallService(MODULENAME "/Log", (WPARAM)L"stop", 0);
return 0;
}
diff --git a/plugins/Ping/src/pinggraph.cpp b/plugins/Ping/src/pinggraph.cpp index b9efbc01e8..254e175eb2 100644 --- a/plugins/Ping/src/pinggraph.cpp +++ b/plugins/Ping/src/pinggraph.cpp @@ -232,7 +232,7 @@ LRESULT CALLBACK GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar {
char buff[30];
mir_snprintf(buff, "pinggraphwnd%d", wd->item_id);
- Utils_SaveWindowPosition(hwnd, 0, PLUG, buff);
+ Utils_SaveWindowPosition(hwnd, 0, MODULENAME, buff);
}
}
break;
@@ -242,7 +242,7 @@ LRESULT CALLBACK GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar {
char buff[30];
mir_snprintf(buff, "WindowHandle%d", wd->item_id);
- db_set_dw(0, PLUG, buff, 0);
+ db_set_dw(0, MODULENAME, buff, 0);
}
delete wd;
}
@@ -255,7 +255,7 @@ LRESULT CALLBACK GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar INT_PTR ShowGraph(WPARAM wParam, LPARAM lParam) {
char buff[30];
mir_snprintf(buff, "WindowHandle%d", (DWORD)wParam);
- HWND hGraphWnd = (HWND)db_get_dw(0, PLUG, buff, 0);
+ HWND hGraphWnd = (HWND)db_get_dw(0, MODULENAME, buff, 0);
if (hGraphWnd) {
ShowWindow(hGraphWnd, SW_SHOW);
SetWindowPos(hGraphWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
@@ -272,7 +272,7 @@ INT_PTR ShowGraph(WPARAM wParam, LPARAM lParam) { wndclass.hCursor = LoadCursor(nullptr, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
wndclass.lpszMenuName = nullptr;
- wndclass.lpszClassName = _A2W(PLUG) L"GraphWindow";
+ wndclass.lpszClassName = _A2W(MODULENAME) L"GraphWindow";
RegisterClass(&wndclass);
wchar_t title[256];
@@ -283,7 +283,7 @@ INT_PTR ShowGraph(WPARAM wParam, LPARAM lParam) { }
HWND parent = nullptr;
- hGraphWnd = CreateWindowEx(0, _A2W(PLUG) L"GraphWindow", title,
+ hGraphWnd = CreateWindowEx(0, _A2W(MODULENAME) L"GraphWindow", title,
(WS_THICKFRAME | WS_CAPTION | WS_SYSMENU | WS_CLIPCHILDREN) & ~CS_VREDRAW & ~CS_HREDRAW,
0, 0, 800, 600, parent, nullptr, g_plugin.getInst(), nullptr);
@@ -291,15 +291,15 @@ INT_PTR ShowGraph(WPARAM wParam, LPARAM lParam) { wd->item_id = (DWORD)wParam; // wParam is destination id
wd->hwnd_chk_grid = nullptr;
wd->hwnd_chk_stat = nullptr;
- wd->show_grid = db_get_b(0, PLUG, "ShowGridLines", 0) ? true : false;
- wd->show_stat = db_get_b(0, PLUG, "ShowStats", 1) ? true : false;
+ wd->show_grid = db_get_b(0, MODULENAME, "ShowGridLines", 0) ? true : false;
+ wd->show_stat = db_get_b(0, MODULENAME, "ShowStats", 1) ? true : false;
- db_set_dw(0, PLUG, buff, (UINT_PTR)hGraphWnd);
+ db_set_dw(0, MODULENAME, buff, (UINT_PTR)hGraphWnd);
SetWindowLongPtr(hGraphWnd, GWLP_USERDATA, (LONG_PTR)wd);
mir_snprintf(buff, "pinggraphwnd%d", wd->item_id);
- Utils_RestoreWindowPosition(hGraphWnd, 0, PLUG, buff);
+ Utils_RestoreWindowPosition(hGraphWnd, 0, MODULENAME, buff);
if (!IsWindowVisible(hGraphWnd))
ShowWindow(hGraphWnd, SW_SHOW);
@@ -315,11 +315,11 @@ void graphs_cleanup() { for (int i = 0; i < list_size; i++) {
mir_snprintf(buff, "WindowHandle%d", i);
- if (hwnd = (HWND)db_get_dw(0, PLUG, buff, 0)) {
+ if (hwnd = (HWND)db_get_dw(0, MODULENAME, buff, 0)) {
DestroyWindow(hwnd);
- db_set_dw(0, PLUG, buff, 0);
+ db_set_dw(0, MODULENAME, buff, 0);
mir_snprintf(buff, "WindowWasOpen%d", i);
- db_set_b(0, PLUG, buff, 1);
+ db_set_b(0, MODULENAME, buff, 1);
}
}
}
@@ -328,13 +328,13 @@ void graphs_cleanup() { void graphs_init() {
PINGLIST pl;
char buff[64];
- CallService(PLUG "/GetPingList", 0, (LPARAM)&pl);
+ CallService(MODULENAME "/GetPingList", 0, (LPARAM)&pl);
for (pinglist_it i = pl.begin(); i != pl.end(); ++i) {
mir_snprintf(buff, "WindowHandle%d", i->item_id); // clean up from possible crash
- db_set_dw(0, PLUG, buff, 0);
+ db_set_dw(0, MODULENAME, buff, 0);
mir_snprintf(buff, "WindowWasOpen%d", i->item_id); // restore windows that were open on shutdown
- if (db_get_b(0, PLUG, buff, 0)) {
- db_set_b(0, PLUG, buff, 0);
+ if (db_get_b(0, MODULENAME, buff, 0)) {
+ db_set_b(0, MODULENAME, buff, 0);
ShowGraph((WPARAM)i->item_id, (LPARAM)i->pszLabel);
}
}
diff --git a/plugins/Ping/src/pinglist.cpp b/plugins/Ping/src/pinglist.cpp index 92e094e74b..d0edc89823 100644 --- a/plugins/Ping/src/pinglist.cpp +++ b/plugins/Ping/src/pinglist.cpp @@ -59,7 +59,7 @@ void write_ping_address(PINGADDRESS &i) if (i.item_id == 0) {
i.item_id = NextID++;
- db_set_dw(0, PLUG, "NextID", NextID);
+ db_set_dw(0, MODULENAME, "NextID", NextID);
}
db_set_dw(0, buff, "Id", i.item_id);
@@ -162,7 +162,7 @@ bool read_ping_address(PINGADDRESS &pa) { pa.index = index;
if (pa.item_id >= NextID) {
NextID = pa.item_id + 1;
- db_set_dw(0, PLUG, "NextID", NextID);
+ db_set_dw(0, MODULENAME, "NextID", NextID);
}
return true;
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index 077dfa855b..7551747378 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -66,7 +66,7 @@ void SetProtoStatus(wchar_t *pszLabel, char *pszProto, int if_status, int new_st if (options.logging) {
wchar_t buf[1024];
mir_snwprintf(buf, TranslateT("%s - setting status of protocol '%S' (%d)"), pszLabel, pszProto, new_status);
- CallService(PLUG "/Log", (WPARAM)buf, 0);
+ CallService(MODULENAME "/Log", (WPARAM)buf, 0);
}
CallProtoService(pszProto, PS_SETSTATUS, new_status, 0);
}
@@ -135,7 +135,7 @@ void __cdecl sttCheckStatusThreadProc(void*) InvalidateRect(list_hwnd, nullptr, FALSE);
}
- CallService(PLUG "/Ping", 0, (LPARAM)&pa);
+ CallService(MODULENAME "/Ping", 0, (LPARAM)&pa);
if (get_thread_finished()) break;
if (get_list_changed()) break;
@@ -190,7 +190,7 @@ void __cdecl sttCheckStatusThreadProc(void*) if (pa.miss_count == -1 - options.retries && options.logging) {
wchar_t buf[512];
mir_snwprintf(buf, TranslateT("%s - reply, %d"), pa.pszLabel, pa.round_trip_time);
- CallService(PLUG "/Log", (WPARAM)buf, 0);
+ CallService(MODULENAME "/Log", (WPARAM)buf, 0);
}
SetProtoStatus(pa.pszLabel, pa.pszProto, pa.get_status, pa.set_status);
}
@@ -204,7 +204,7 @@ void __cdecl sttCheckStatusThreadProc(void*) if (pa.miss_count == 1 + options.retries && options.logging) {
wchar_t buf[512];
mir_snwprintf(buf, TranslateT("%s - timeout"), pa.pszLabel);
- CallService(PLUG "/Log", (WPARAM)buf, 0);
+ CallService(MODULENAME "/Log", (WPARAM)buf, 0);
}
}
@@ -253,10 +253,10 @@ int FillList(WPARAM, LPARAM) {
if (options.logging)
- CallService(PLUG "/Log", (WPARAM)L"ping address list reload", 0);
+ CallService(MODULENAME "/Log", (WPARAM)L"ping address list reload", 0);
PINGLIST pl;
- CallService(PLUG "/GetPingList", 0, (LPARAM)&pl);
+ CallService(MODULENAME "/GetPingList", 0, (LPARAM)&pl);
SendMessage(list_hwnd, WM_SETREDRAW, FALSE, 0);
{
@@ -369,7 +369,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar SetBkColor(dis->hDC, tcol);
FillRect(dis->hDC, &dis->rcItem, (ttbrush = CreateSolidBrush(tcol)));
- tcol = db_get_dw(NULL, PLUG, "FontCol", GetSysColor(COLOR_WINDOWTEXT));
+ tcol = db_get_dw(NULL, MODULENAME, "FontCol", GetSysColor(COLOR_WINDOWTEXT));
SetTextColor(dis->hDC, tcol);
}
@@ -615,7 +615,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar }
}
if (found)
- CallService(PLUG "/ShowGraph", (WPARAM)itemData.item_id, (LPARAM)itemData.pszLabel);
+ CallService(MODULENAME "/ShowGraph", (WPARAM)itemData.item_id, (LPARAM)itemData.pszLabel);
}
}
return TRUE;
@@ -631,7 +631,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar mir_cslock lck(data_list_cs);
if (count >= 0 && count < (int)data_list.size()) {
PINGADDRESS itemData = *(PINGADDRESS *)SendMessage(list_hwnd, LB_GETITEMDATA, count, 0);
- CallService(PLUG "/ToggleEnabled", (WPARAM)itemData.item_id, 0);
+ CallService(MODULENAME "/ToggleEnabled", (WPARAM)itemData.item_id, 0);
}
}
}
@@ -656,7 +656,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (Edit(hwnd, itemData)) {
mir_cslock lck(data_list_cs);
*temp = itemData;
- CallService(PLUG "/SetAndSavePingList", (WPARAM)&data_list, 0);
+ CallService(MODULENAME "/SetAndSavePingList", (WPARAM)&data_list, 0);
}
}
}
@@ -664,11 +664,11 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar return TRUE;
case ID_MENU_DISABLEALLPINGS:
- CallService(PLUG "/DisableAll", 0, 0);
+ CallService(MODULENAME "/DisableAll", 0, 0);
return TRUE;
case ID_MENU_ENABLEALLPINGS:
- CallService(PLUG "/EnableAll", 0, 0);
+ CallService(MODULENAME "/EnableAll", 0, 0);
return TRUE;
case ID_MENU_OPTIONS:
@@ -691,14 +691,14 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (pItemData) {
DWORD item_id = pItemData->item_id;
- int wake = CallService(PLUG "/DblClick", (WPARAM)item_id, 0);
+ int wake = CallService(MODULENAME "/DblClick", (WPARAM)item_id, 0);
InvalidateRect(list_hwnd, nullptr, FALSE);
if (wake) SetEvent(hWakeEvent);
if (options.logging) {
wchar_t buf[1024];
mir_snwprintf(buf, L"%s - %s", pItemData->pszLabel, (wake ? TranslateT("enabled") : TranslateT("double clicked")));
- CallService(PLUG "/Log", (WPARAM)buf, 0);
+ CallService(MODULENAME "/Log", (WPARAM)buf, 0);
}
}
}
@@ -730,7 +730,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar case WM_DESTROY:
if (!ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
- Utils_SaveWindowPosition(hwnd, 0, PLUG, "main_window");
+ Utils_SaveWindowPosition(hwnd, 0, MODULENAME, "main_window");
}
KillTimer(hwnd, TIMER_ID);
@@ -742,7 +742,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar case WM_CLOSE:
if (!ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
- Utils_SaveWindowPosition(hwnd, 0, PLUG, "main_window");
+ Utils_SaveWindowPosition(hwnd, 0, MODULENAME, "main_window");
ShowWindow(hwnd, SW_HIDE);
return 0;
}
@@ -855,14 +855,14 @@ void InitList() wndclass.hCursor = LoadCursor(nullptr, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
wndclass.lpszMenuName = nullptr;
- wndclass.lpszClassName = _A2W(PLUG) L"WindowClass";
+ wndclass.lpszClassName = _A2W(MODULENAME) L"WindowClass";
RegisterClass(&wndclass);
if (ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
- hpwnd = CreateWindow(_A2W(PLUG) L"WindowClass", L"Ping", (WS_BORDER | WS_CHILD | WS_CLIPCHILDREN), 0, 0, 0, 0, hwnd_clist, nullptr, g_plugin.getInst(), nullptr);
+ hpwnd = CreateWindow(_A2W(MODULENAME) L"WindowClass", L"Ping", (WS_BORDER | WS_CHILD | WS_CLIPCHILDREN), 0, 0, 0, 0, hwnd_clist, nullptr, g_plugin.getInst(), nullptr);
CLISTFrame frame = { 0 };
- frame.name = PLUG;
+ frame.name = MODULENAME;
frame.cbSize = sizeof(CLISTFrame);
frame.hWnd = hpwnd;
frame.align = alBottom;
@@ -873,13 +873,13 @@ void InitList() frame_id = CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&frame, 0);
}
else {
- hpwnd = CreateWindowEx(WS_EX_TOOLWINDOW, _A2W(PLUG) L"WindowClass", L"Ping",
+ hpwnd = CreateWindowEx(WS_EX_TOOLWINDOW, _A2W(MODULENAME) L"WindowClass", L"Ping",
(WS_POPUPWINDOW | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_CLIPCHILDREN),
0, 0, 400, 300, hwnd_clist, nullptr, g_plugin.getInst(), nullptr);
- Utils_RestoreWindowPosition(hpwnd, 0, PLUG, "main_window");
+ Utils_RestoreWindowPosition(hpwnd, 0, MODULENAME, "main_window");
- CreateServiceFunction(PLUG "/ShowWindow", PingPlugShowWindow);
+ CreateServiceFunction(MODULENAME "/ShowWindow", PingPlugShowWindow);
CMenuItem mi;
mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Ping"), 1000200001);
@@ -889,7 +889,7 @@ void InitList() mi.flags = CMIF_UNICODE;
mi.position = 3000320001;
mi.name.w = LPGENW("Show/Hide &Ping Window");
- mi.pszService = PLUG "/ShowWindow";
+ mi.pszService = MODULENAME "/ShowWindow";
Menu_AddMainMenuItem(&mi);
if (options.attach_to_clist) AttachToClist(true);
diff --git a/plugins/Ping/src/rawping.cpp b/plugins/Ping/src/rawping.cpp index c5b2c0c2e8..7e66a7450e 100644 --- a/plugins/Ping/src/rawping.cpp +++ b/plugins/Ping/src/rawping.cpp @@ -95,7 +95,7 @@ extern int raw_ping(char *host, int timeout) }
else {
// Not a recognized hostname either!
- if (options.logging) CallService(PLUG "/Log", (WPARAM)L"rawping error: unrecognised host", 0);
+ if (options.logging) CallService(MODULENAME "/Log", (WPARAM)L"rawping error: unrecognised host", 0);
return -1;
}
}
@@ -119,7 +119,7 @@ extern int raw_ping(char *host, int timeout) // send packet
int bwrote = sendto(sd, (char*)packet, sizeof(ICMPHeader), 0, (sockaddr*)&dest, sizeof(dest));
if (bwrote == SOCKET_ERROR) {
- if (options.logging) CallService(PLUG "/Log", (WPARAM)L"rawping error: unable to send", 0);
+ if (options.logging) CallService(MODULENAME "/Log", (WPARAM)L"rawping error: unable to send", 0);
return -1;
}
@@ -151,39 +151,39 @@ extern int raw_ping(char *host, int timeout) if (bread == SOCKET_ERROR) {
if (WSAGetLastError() != WSAETIMEDOUT) {
if (options.logging)
- CallService(PLUG "/Log", (WPARAM)L"rawping error: socket error...cycling", 0);
+ CallService(MODULENAME "/Log", (WPARAM)L"rawping error: socket error...cycling", 0);
}
continue;
}
if (reply_header->proto != ICMP_PROTO) {
if (options.logging)
- CallService(PLUG "/Log", (WPARAM)L"rawping error: packet not ICMP...cycling", 0);
+ CallService(MODULENAME "/Log", (WPARAM)L"rawping error: packet not ICMP...cycling", 0);
continue;
}
if (reply_header->tos != 0) {
if (options.logging)
- CallService(PLUG "/Log", (WPARAM)L"rawping error: TOS not 0...cycling", 0);
+ CallService(MODULENAME "/Log", (WPARAM)L"rawping error: TOS not 0...cycling", 0);
continue;
}
reply = (ICMPHeader *)(recv_buff + reply_header->h_len * 4);
if ((unsigned)bread < reply_header->h_len * 4 + sizeof(ICMPHeader)) {
if (options.logging)
- CallService(PLUG "/Log", (WPARAM)L"rawping error: short header", 0);
+ CallService(MODULENAME "/Log", (WPARAM)L"rawping error: short header", 0);
continue;
}
if (reply->id != (USHORT)GetCurrentProcessId()) {
if (options.logging)
- CallService(PLUG "/Log", (WPARAM)L"rawping error: wrong ID...cycling", 0);
+ CallService(MODULENAME "/Log", (WPARAM)L"rawping error: wrong ID...cycling", 0);
continue;
}
if (reply->type != PT_ICMP_ECHO_REPLY && reply->type != PT_ICMP_SOURCE_QUENCH) {
if (options.logging)
- CallService(PLUG "/Log", (WPARAM)L"rawping error: wrong type...cycling", 0);
+ CallService(MODULENAME "/Log", (WPARAM)L"rawping error: wrong type...cycling", 0);
continue;
}
@@ -191,14 +191,14 @@ extern int raw_ping(char *host, int timeout) //if(reply->seq > seq_no) return -1;
if (reply->seq != seq_no) {
if (options.logging)
- CallService(PLUG "/Log", (WPARAM)L"rawping error: wrong sequence number...cycling", 0);
+ CallService(MODULENAME "/Log", (WPARAM)L"rawping error: wrong sequence number...cycling", 0);
continue;
}
if (reply->type == PT_ICMP_SOURCE_QUENCH) {
char buff[1024];
mir_snprintf(buff, Translate("Host %s requests that you reduce the amount of traffic you are sending."), host);
- MessageBoxA(nullptr, buff, Translate(PLUG " Warning"), MB_OK | MB_ICONWARNING);
+ MessageBoxA(nullptr, buff, Translate(MODULENAME " Warning"), MB_OK | MB_ICONWARNING);
}
if (use_hi_res) {
@@ -210,7 +210,7 @@ extern int raw_ping(char *host, int timeout) return current_time - send_time;
}
if (options.logging)
- CallService(PLUG "/Log", (WPARAM)L"rawping error: timeout", 0);
+ CallService(MODULENAME "/Log", (WPARAM)L"rawping error: timeout", 0);
return -1;
}
diff --git a/plugins/Ping/src/stdafx.h b/plugins/Ping/src/stdafx.h index 3e1c99c68f..d2abecce00 100644 --- a/plugins/Ping/src/stdafx.h +++ b/plugins/Ping/src/stdafx.h @@ -40,7 +40,7 @@ #define MAX_HISTORY (1440) // 12 hrs at 30 sec intervals
-#define PLUG "PING"
+#define MODULENAME "PING"
#define DEFAULT_PING_PERIOD 30
#define DEFAULT_PING_TIMEOUT 2
@@ -56,9 +56,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(PLUG)
- {}
+ CMPlugin();
};
typedef struct {
diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp index 59e0c6b5fd..9e4361538e 100644 --- a/plugins/Ping/src/utils.cpp +++ b/plugins/Ping/src/utils.cpp @@ -51,7 +51,7 @@ void __stdcall ShowPopup(wchar_t *line1, wchar_t *line2, int flags) QueueUserAPC(sttMainThreadCallback, mainThread, (ULONG_PTR)ppd);
}
else{
- MessageBox(nullptr, line2, _A2W(PLUG) L" Message", MB_OK | MB_ICONINFORMATION);
+ MessageBox(nullptr, line2, _A2W(MODULENAME) L" Message", MB_OK | MB_ICONINFORMATION);
return;
}
}
@@ -136,24 +136,24 @@ INT_PTR PluginPing(WPARAM, LPARAM lParam) INT_PTR PingDisableAll(WPARAM, LPARAM) {
PINGLIST pl;
- CallService(PLUG "/GetPingList", 0, (LPARAM)&pl);
+ CallService(MODULENAME "/GetPingList", 0, (LPARAM)&pl);
for (pinglist_it i = pl.begin(); i != pl.end(); ++i) {
i->status = PS_DISABLED;
i->miss_count = 0;
}
- CallService(PLUG "/SetPingList", (WPARAM)&pl, 0);
+ CallService(MODULENAME "/SetPingList", (WPARAM)&pl, 0);
return 0;
}
INT_PTR PingEnableAll(WPARAM, LPARAM) {
PINGLIST pl;
- CallService(PLUG "/GetPingList", 0, (LPARAM)&pl);
+ CallService(MODULENAME "/GetPingList", 0, (LPARAM)&pl);
for (pinglist_it i = pl.begin(); i != pl.end(); ++i) {
if (i->status == PS_DISABLED) {
i->status = PS_NOTRESPONDING;
}
}
- CallService(PLUG "/SetPingList", (WPARAM)&pl, 0);
+ CallService(MODULENAME "/SetPingList", (WPARAM)&pl, 0);
return 0;
}
@@ -161,7 +161,7 @@ INT_PTR PingEnableAll(WPARAM, LPARAM) { INT_PTR ToggleEnabled(WPARAM wParam, LPARAM) {
int retval = 0;
PINGLIST pl;
- CallService(PLUG "/GetPingList", 0, (LPARAM)&pl);
+ CallService(MODULENAME "/GetPingList", 0, (LPARAM)&pl);
for (pinglist_it i = pl.begin(); i != pl.end(); ++i) {
if (i->item_id == (DWORD)wParam) {
@@ -174,7 +174,7 @@ INT_PTR ToggleEnabled(WPARAM wParam, LPARAM) { }
}
}
- CallService(PLUG "/SetPingList", (WPARAM)&pl, 0);
+ CallService(MODULENAME "/SetPingList", (WPARAM)&pl, 0);
return 0;
}
@@ -183,7 +183,7 @@ INT_PTR EditContact(WPARAM wParam, LPARAM) PINGLIST pl;
HWND hwndList = pcli->hwndContactList;
- CallService(PLUG "/GetPingList", 0, (LPARAM)&pl);
+ CallService(MODULENAME "/GetPingList", 0, (LPARAM)&pl);
for (pinglist_it i = pl.begin(); i != pl.end(); ++i) {
if (i->item_id == (DWORD)wParam) {
@@ -192,7 +192,7 @@ INT_PTR EditContact(WPARAM wParam, LPARAM) if (DialogBox(g_plugin.getInst(), MAKEINTRESOURCE(IDD_DIALOG3), hwndList, DlgProcDestEdit) == IDOK) {
*i = add_edit_addr;
- CallService(PLUG "/SetAndSavePingList", (WPARAM)&pl, 0);
+ CallService(MODULENAME "/SetAndSavePingList", (WPARAM)&pl, 0);
return 0;
}
}
@@ -202,14 +202,14 @@ INT_PTR EditContact(WPARAM wParam, LPARAM) INT_PTR DblClick(WPARAM wParam, LPARAM) {
PINGLIST pl;
- CallService(PLUG "/GetPingList", 0, (LPARAM)&pl);
+ CallService(MODULENAME "/GetPingList", 0, (LPARAM)&pl);
for (pinglist_it i = pl.begin(); i != pl.end(); ++i) {
if (i->item_id == (DWORD)wParam) {
if (mir_wstrlen(i->pszCommand)) {
ShellExecute(nullptr, L"open", i->pszCommand, i->pszParams, nullptr, SW_SHOW);
}
else {
- return CallService(PLUG "/ToggleEnabled", wParam, 0);
+ return CallService(MODULENAME "/ToggleEnabled", wParam, 0);
}
}
}
diff --git a/plugins/PluginUpdater/src/DlgListNew.cpp b/plugins/PluginUpdater/src/DlgListNew.cpp index 1db3a7b496..e7a289764a 100644 --- a/plugins/PluginUpdater/src/DlgListNew.cpp +++ b/plugins/PluginUpdater/src/DlgListNew.cpp @@ -250,7 +250,7 @@ INT_PTR CALLBACK DlgList(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) // do this after filling list - enables 'ITEMCHANGED' below
SetWindowLongPtr(hDlg, GWLP_USERDATA, lParam);
- Utils_RestoreWindowPosition(hDlg, 0, MODNAME, "ListWindow");
+ Utils_RestoreWindowPosition(hDlg, 0, MODULENAME, "ListWindow");
return TRUE;
case WM_NOTIFY:
@@ -327,7 +327,7 @@ INT_PTR CALLBACK DlgList(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) break;
case WM_DESTROY:
- Utils_SaveWindowPosition(hDlg, NULL, MODNAME, "ListWindow");
+ Utils_SaveWindowPosition(hDlg, NULL, MODULENAME, "ListWindow");
Window_FreeIcon_IcoLib(hDlg);
hwndDialog = nullptr;
delete (OBJLIST<FILEINFO> *)GetWindowLongPtr(hDlg, GWLP_USERDATA);
@@ -490,6 +490,6 @@ static INT_PTR ParseUriService(WPARAM, LPARAM lParam) void InitListNew()
{
- CreateServiceFunction(MODNAME "/ParseUri", ParseUriService);
+ CreateServiceFunction(MODULENAME "/ParseUri", ParseUriService);
CreateServiceFunction(MS_PU_SHOWLIST, ShowListCommand);
}
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index 58d293b43f..950944d8b7 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -122,7 +122,7 @@ static void ApplyUpdates(void *param) }
Skin_PlaySound("updatecompleted");
- db_set_b(NULL, MODNAME, DB_SETTING_RESTART_COUNT, 5);
+ db_set_b(NULL, MODULENAME, DB_SETTING_RESTART_COUNT, 5);
if (opts.bBackup)
CallService(MS_AB_BACKUP, 0, 0);
@@ -130,28 +130,28 @@ static void ApplyUpdates(void *param) if (opts.bChangePlatform) {
wchar_t mirandaPath[MAX_PATH];
GetModuleFileName(nullptr, mirandaPath, _countof(mirandaPath));
- db_set_ws(NULL, MODNAME, "OldBin2", mirandaPath);
+ db_set_ws(NULL, MODULENAME, "OldBin2", mirandaPath);
- db_unset(NULL, MODNAME, DB_SETTING_CHANGEPLATFORM);
+ db_unset(NULL, MODULENAME, DB_SETTING_CHANGEPLATFORM);
}
else {
- ptrW oldbin(db_get_wsa(NULL, MODNAME, "OldBin2"));
+ ptrW oldbin(db_get_wsa(NULL, MODULENAME, "OldBin2"));
if (oldbin) {
SafeDeleteFile(oldbin);
- db_unset(NULL, MODNAME, "OldBin2");
+ db_unset(NULL, MODULENAME, "OldBin2");
}
}
if (opts.bForceRedownload) {
opts.bForceRedownload = 0;
- db_unset(NULL, MODNAME, DB_SETTING_REDOWNLOAD);
+ db_unset(NULL, MODULENAME, DB_SETTING_REDOWNLOAD);
}
// 5) Prepare Restart
int rc = MessageBox(hDlg, TranslateT("Update complete. Press Yes to restart Miranda now or No to postpone a restart until the exit."), TranslateT("Plugin Updater"), MB_YESNO | MB_ICONQUESTION);
PostMessage(hDlg, WM_CLOSE, 0, 0);
if (rc == IDYES) {
- BOOL bRestartCurrentProfile = db_get_b(NULL, MODNAME, "RestartCurrentProfile", 1) ? 1 : 0;
+ BOOL bRestartCurrentProfile = db_get_b(NULL, MODULENAME, "RestartCurrentProfile", 1) ? 1 : 0;
if (opts.bChangePlatform) {
wchar_t mirstartpath[MAX_PATH];
@@ -275,7 +275,7 @@ static INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM // do this after filling list - enables 'ITEMCHANGED' below
SetWindowLongPtr(hDlg, GWLP_USERDATA, lParam);
- Utils_RestoreWindowPositionNoSize(hDlg, 0, MODNAME, "ConfirmWindow");
+ Utils_RestoreWindowPositionNoSize(hDlg, 0, MODULENAME, "ConfirmWindow");
return TRUE;
case WM_NOTIFY:
@@ -361,12 +361,12 @@ static INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM case WM_DESTROY:
Window_FreeIcon_IcoLib(hDlg);
- Utils_SaveWindowPosition(hDlg, NULL, MODNAME, "ConfirmWindow");
+ Utils_SaveWindowPosition(hDlg, NULL, MODULENAME, "ConfirmWindow");
hwndDialog = nullptr;
delete (OBJLIST<FILEINFO> *)GetWindowLongPtr(hDlg, GWLP_USERDATA);
SetWindowLongPtr(hDlg, GWLP_USERDATA, 0);
- db_set_dw(NULL, MODNAME, DB_SETTING_LAST_UPDATE, time(0));
+ db_set_dw(NULL, MODULENAME, DB_SETTING_LAST_UPDATE, time(0));
mir_forkthread(InitTimer);
break;
@@ -457,13 +457,13 @@ static void DlgUpdateSilent(void *param) Skin_PlaySound("updatecompleted");
opts.bForceRedownload = false;
- db_unset(NULL, MODNAME, DB_SETTING_REDOWNLOAD);
+ db_unset(NULL, MODULENAME, DB_SETTING_REDOWNLOAD);
opts.bChangePlatform = false;
- db_unset(NULL, MODNAME, DB_SETTING_CHANGEPLATFORM);
+ db_unset(NULL, MODULENAME, DB_SETTING_CHANGEPLATFORM);
- db_set_b(NULL, MODNAME, DB_SETTING_RESTART_COUNT, 5);
- db_set_b(NULL, MODNAME, DB_SETTING_NEED_RESTART, 1);
+ db_set_b(NULL, MODULENAME, DB_SETTING_RESTART_COUNT, 5);
+ db_set_b(NULL, MODULENAME, DB_SETTING_NEED_RESTART, 1);
// 5) Prepare Restart
wchar_t tszTitle[100];
@@ -478,7 +478,7 @@ static void DlgUpdateSilent(void *param) mir_snwprintf(tszText, L"%s\n\n%s", TranslateT("You need to restart your Miranda to apply installed updates."), TranslateT("Would you like to restart it now?"));
if (MessageBox(nullptr, tszText, tszTitle, MB_ICONINFORMATION | MB_YESNO) == IDYES)
- CallServiceSync(MS_SYSTEM_RESTART, db_get_b(NULL, MODNAME, "RestartCurrentProfile", 1) ? 1 : 0, 0);
+ CallServiceSync(MS_SYSTEM_RESTART, db_get_b(NULL, MODULENAME, "RestartCurrentProfile", 1) ? 1 : 0, 0);
}
}
}
@@ -803,7 +803,7 @@ static void DoCheck(bool bSilent = true) else {
opts.bSilent = bSilent;
- db_set_dw(NULL, MODNAME, DB_SETTING_LAST_UPDATE, time(0));
+ db_set_dw(NULL, MODULENAME, DB_SETTING_LAST_UPDATE, time(0));
hCheckThread = mir_forkthread(CheckUpdates);
}
@@ -841,7 +841,7 @@ void CheckUpdateOnStartup() if (opts.bUpdateOnStartup) {
if (opts.bOnlyOnceADay) {
time_t now = time(0),
- was = db_get_dw(NULL, MODNAME, DB_SETTING_LAST_UPDATE, 0);
+ was = db_get_dw(NULL, MODULENAME, DB_SETTING_LAST_UPDATE, 0);
if ((now - was) < 86400)
return;
@@ -888,7 +888,7 @@ void InitTimer(void *type) case 0: // default, plan next check relative to last check
{
time_t now = time(0);
- time_t was = db_get_dw(NULL, MODNAME, DB_SETTING_LAST_UPDATE, 0);
+ time_t was = db_get_dw(NULL, MODULENAME, DB_SETTING_LAST_UPDATE, 0);
interval = PeriodToMilliseconds(opts.Period, opts.bPeriodMeasure);
interval -= (now - was) * 1000;
diff --git a/plugins/PluginUpdater/src/Events.cpp b/plugins/PluginUpdater/src/Events.cpp index 1d5e3176f0..3fe786d3e1 100644 --- a/plugins/PluginUpdater/src/Events.cpp +++ b/plugins/PluginUpdater/src/Events.cpp @@ -53,11 +53,11 @@ int ModulesLoaded(WPARAM, LPARAM) else lstrcpyn(g_tszRoot, VARSW(L"%miranda_path%\\" DEFAULT_UPDATES_FOLDER), _countof(g_tszRoot));
if (ServiceExists(MS_ASSOCMGR_ADDNEWURLTYPE))
- AssocMgr_AddNewUrlTypeW("mirpu:", TranslateT("Plugin updater URI scheme"), g_plugin.getInst(), IDI_PLGLIST, MODNAME "/ParseUri", 0);
+ AssocMgr_AddNewUrlTypeW("mirpu:", TranslateT("Plugin updater URI scheme"), g_plugin.getInst(), IDI_PLGLIST, MODULENAME "/ParseUri", 0);
- int iRestartCount = db_get_b(NULL, MODNAME, DB_SETTING_RESTART_COUNT, 2);
+ int iRestartCount = db_get_b(NULL, MODULENAME, DB_SETTING_RESTART_COUNT, 2);
if (iRestartCount > 0)
- db_set_b(NULL, MODNAME, DB_SETTING_RESTART_COUNT, iRestartCount - 1);
+ db_set_b(NULL, MODULENAME, DB_SETTING_RESTART_COUNT, iRestartCount - 1);
else
EmptyFolder(); // silently
diff --git a/plugins/PluginUpdater/src/Notifications.cpp b/plugins/PluginUpdater/src/Notifications.cpp index e5a948f01d..7a215758d6 100644 --- a/plugins/PluginUpdater/src/Notifications.cpp +++ b/plugins/PluginUpdater/src/Notifications.cpp @@ -25,18 +25,18 @@ void InitPopupList() {
int index = 0;
PopupsList[index].ID = index;
- PopupsList[index].colorBack = db_get_dw(NULL, MODNAME, "Popups0Bg", COLOR_BG_FIRSTDEFAULT);
- PopupsList[index].colorText = db_get_dw(NULL, MODNAME, "Popups0Tx", COLOR_TX_DEFAULT);
+ PopupsList[index].colorBack = db_get_dw(NULL, MODULENAME, "Popups0Bg", COLOR_BG_FIRSTDEFAULT);
+ PopupsList[index].colorText = db_get_dw(NULL, MODULENAME, "Popups0Tx", COLOR_TX_DEFAULT);
index = 1;
PopupsList[index].ID = index;
- PopupsList[index].colorBack = db_get_dw(NULL, MODNAME, "Popups1Bg", COLOR_BG_SECONDDEFAULT);
- PopupsList[index].colorText = db_get_dw(NULL, MODNAME, "Popups1Tx", COLOR_TX_DEFAULT);
+ PopupsList[index].colorBack = db_get_dw(NULL, MODULENAME, "Popups1Bg", COLOR_BG_SECONDDEFAULT);
+ PopupsList[index].colorText = db_get_dw(NULL, MODULENAME, "Popups1Tx", COLOR_TX_DEFAULT);
index = 2;
PopupsList[index].ID = index;
- PopupsList[index].colorBack = db_get_dw(NULL, MODNAME, "Popups2Bg", COLOR_BG_FIRSTDEFAULT);
- PopupsList[index].colorText = db_get_dw(NULL, MODNAME, "Popups2Tx", COLOR_TX_DEFAULT);
+ PopupsList[index].colorBack = db_get_dw(NULL, MODULENAME, "Popups2Bg", COLOR_BG_FIRSTDEFAULT);
+ PopupsList[index].colorText = db_get_dw(NULL, MODULENAME, "Popups2Tx", COLOR_TX_DEFAULT);
}
void PopupAction(HWND hPopup, BYTE action)
@@ -74,7 +74,7 @@ static void _stdcall RestartPrompt(void *) mir_snwprintf(tszText, L"%s\n\n%s", TranslateT("You need to restart your Miranda to apply installed updates."), TranslateT("Would you like to restart it now?"));
if (MessageBox(nullptr, tszText, TranslateT("Plugin Updater"), MB_YESNO | MB_ICONQUESTION | MB_TOPMOST) == IDYES)
- CallService(MS_SYSTEM_RESTART, db_get_b(NULL, MODNAME, "RestartCurrentProfile", 1) ? 1 : 0, 0);
+ CallService(MS_SYSTEM_RESTART, db_get_b(NULL, MODULENAME, "RestartCurrentProfile", 1) ? 1 : 0, 0);
}
static LRESULT CALLBACK PopupDlgProcRestart(HWND hPopup, UINT uMsg, WPARAM wParam, LPARAM lParam)
@@ -99,7 +99,7 @@ void ShowPopup(LPCTSTR ptszTitle, LPCTSTR ptszText, int Number) char setting[100];
mir_snprintf(setting, "Popups%d", Number);
- if (db_get_b(NULL, MODNAME, setting, DEFAULT_POPUP_ENABLED)) {
+ if (db_get_b(NULL, MODULENAME, setting, DEFAULT_POPUP_ENABLED)) {
POPUPDATAT pd = { 0 };
pd.lchContact = NULL;
pd.lchIcon = IcoLib_GetIconByHandle(iconList[0].hIcolib);
diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp index 57f50bd06f..e81c536ea2 100644 --- a/plugins/PluginUpdater/src/Options.cpp +++ b/plugins/PluginUpdater/src/Options.cpp @@ -29,14 +29,14 @@ static int GetBits(HWND hwndDlg) static int GetUpdateMode()
{
- int UpdateMode = db_get_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, -1);
+ int UpdateMode = db_get_b(NULL, MODULENAME, DB_SETTING_UPDATE_MODE, -1);
// Check if there is url for custom mode
if (UpdateMode == UPDATE_MODE_CUSTOM) {
- ptrW url(db_get_wsa(NULL, MODNAME, DB_SETTING_UPDATE_URL));
+ ptrW url(db_get_wsa(NULL, MODULENAME, DB_SETTING_UPDATE_URL));
if (url == NULL || !wcslen(url)) {
// No url for custom mode, reset that setting so it will be determined automatically
- db_unset(NULL, MODNAME, DB_SETTING_UPDATE_MODE);
+ db_unset(NULL, MODULENAME, DB_SETTING_UPDATE_MODE);
UpdateMode = -1;
}
}
@@ -65,7 +65,7 @@ wchar_t* GetDefaultUrl() mir_snwprintf(url, DEFAULT_UPDATE_URL_TRUNK_SYMBOLS, opts.bChangePlatform ? DEFAULT_OPP_BITS : DEFAULT_BITS);
return mir_wstrdup(url);
default:
- return db_get_wsa(NULL, MODNAME, DB_SETTING_UPDATE_URL);
+ return db_get_wsa(NULL, MODULENAME, DB_SETTING_UPDATE_URL);
}
}
@@ -90,7 +90,7 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar EnableWindow(GetDlgItem(hwndDlg, IDC_PERIODMEASURE), TRUE);
}
CheckDlgButton(hwndDlg, IDC_SILENTMODE, opts.bSilentMode ? BST_CHECKED : BST_UNCHECKED);
- if (db_get_b(NULL, MODNAME, DB_SETTING_NEED_RESTART, 0))
+ if (db_get_b(NULL, MODULENAME, DB_SETTING_NEED_RESTART, 0))
ShowWindow(GetDlgItem(hwndDlg, IDC_NEEDRESTARTLABEL), SW_SHOW);
SendDlgItemMessage(hwndDlg, IDC_PERIODSPIN, UDM_SETRANGE, 0, MAKELONG(99, 1));
@@ -105,12 +105,12 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar Edit_LimitText(GetDlgItem(hwndDlg, IDC_PERIOD), 2);
- if (db_get_b(NULL, MODNAME, DB_SETTING_DONT_SWITCH_TO_STABLE, 0)) {
+ if (db_get_b(NULL, MODULENAME, DB_SETTING_DONT_SWITCH_TO_STABLE, 0)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_STABLE), FALSE);
// Reset setting if needed
- int UpdateMode = db_get_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_STABLE);
+ int UpdateMode = db_get_b(NULL, MODULENAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_STABLE);
if (UpdateMode == UPDATE_MODE_STABLE)
- db_set_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK);
+ db_set_b(NULL, MODULENAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK);
SetDlgItemText(hwndDlg,IDC_STABLE,LPGENW("Stable version (incompatible with current development version)"));
}
TranslateDialogDefault(hwndDlg);
@@ -140,7 +140,7 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMURL), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CHANGE_PLATFORM), FALSE);
- ptrW url(db_get_wsa(NULL, MODNAME, DB_SETTING_UPDATE_URL));
+ ptrW url(db_get_wsa(NULL, MODULENAME, DB_SETTING_UPDATE_URL));
if (url == NULL)
url = GetDefaultUrl();
SetDlgItemText(hwndDlg, IDC_CUSTOMURL, url);
@@ -207,7 +207,7 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar EnableWindow(GetDlgItem(hwndDlg, IDC_CHANGE_PLATFORM), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMURL), TRUE);
{
- ptrW url(db_get_wsa(NULL, MODNAME, DB_SETTING_UPDATE_URL));
+ ptrW url(db_get_wsa(NULL, MODULENAME, DB_SETTING_UPDATE_URL));
if (url == NULL)
url = GetDefaultUrl();
SetDlgItemText(hwndDlg, IDC_CUSTOMURL, url);
@@ -255,52 +255,52 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
if (hdr && hdr->code == PSN_APPLY) {
- db_set_b(NULL, MODNAME, "UpdateOnStartup", opts.bUpdateOnStartup = IsDlgButtonChecked(hwndDlg, IDC_UPDATEONSTARTUP));
- db_set_b(NULL, MODNAME, "OnlyOnceADay", opts.bOnlyOnceADay = IsDlgButtonChecked(hwndDlg, IDC_ONLYONCEADAY));
- db_set_b(NULL, MODNAME, "UpdateOnPeriod", opts.bUpdateOnPeriod = IsDlgButtonChecked(hwndDlg, IDC_UPDATEONPERIOD));
- db_set_b(NULL, MODNAME, "PeriodMeasure", opts.bPeriodMeasure = ComboBox_GetCurSel(GetDlgItem(hwndDlg, IDC_PERIODMEASURE)));
- db_set_b(NULL, MODNAME, "SilentMode", opts.bSilentMode = IsDlgButtonChecked(hwndDlg, IDC_SILENTMODE));
- db_set_b(NULL, MODNAME, "Backup", opts.bBackup = IsDlgButtonChecked(hwndDlg, IDC_BACKUP));
+ db_set_b(NULL, MODULENAME, "UpdateOnStartup", opts.bUpdateOnStartup = IsDlgButtonChecked(hwndDlg, IDC_UPDATEONSTARTUP));
+ db_set_b(NULL, MODULENAME, "OnlyOnceADay", opts.bOnlyOnceADay = IsDlgButtonChecked(hwndDlg, IDC_ONLYONCEADAY));
+ db_set_b(NULL, MODULENAME, "UpdateOnPeriod", opts.bUpdateOnPeriod = IsDlgButtonChecked(hwndDlg, IDC_UPDATEONPERIOD));
+ db_set_b(NULL, MODULENAME, "PeriodMeasure", opts.bPeriodMeasure = ComboBox_GetCurSel(GetDlgItem(hwndDlg, IDC_PERIODMEASURE)));
+ db_set_b(NULL, MODULENAME, "SilentMode", opts.bSilentMode = IsDlgButtonChecked(hwndDlg, IDC_SILENTMODE));
+ db_set_b(NULL, MODULENAME, "Backup", opts.bBackup = IsDlgButtonChecked(hwndDlg, IDC_BACKUP));
wchar_t buffer[3] = {0};
Edit_GetText(GetDlgItem(hwndDlg, IDC_PERIOD), buffer, _countof(buffer));
- db_set_dw(NULL, MODNAME, "Period", opts.Period = _wtoi(buffer));
+ db_set_dw(NULL, MODULENAME, "Period", opts.Period = _wtoi(buffer));
mir_forkthread(InitTimer, (void*)1);
if ( IsDlgButtonChecked(hwndDlg, IDC_STABLE)) {
- db_set_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_STABLE);
+ db_set_b(NULL, MODULENAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_STABLE);
if (!opts.bChangePlatform)
opts.bForceRedownload = 0;
- db_unset(NULL, MODNAME, DB_SETTING_REDOWNLOAD);
+ db_unset(NULL, MODULENAME, DB_SETTING_REDOWNLOAD);
}
else if ( IsDlgButtonChecked(hwndDlg, IDC_TRUNK)) {
- db_set_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK);
+ db_set_b(NULL, MODULENAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK);
if (!opts.bChangePlatform)
opts.bForceRedownload = 0;
- db_unset(NULL, MODNAME, DB_SETTING_REDOWNLOAD);
+ db_unset(NULL, MODULENAME, DB_SETTING_REDOWNLOAD);
}
else if ( IsDlgButtonChecked(hwndDlg, IDC_TRUNK_SYMBOLS)) {
// Only set ForceRedownload if the previous UpdateMode was different
// to redownload all plugin with pdb files
- if (db_get_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_STABLE) != UPDATE_MODE_TRUNK_SYMBOLS) {
- db_set_b(NULL, MODNAME, DB_SETTING_REDOWNLOAD, opts.bForceRedownload = 1);
- db_set_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK_SYMBOLS);
+ if (db_get_b(NULL, MODULENAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_STABLE) != UPDATE_MODE_TRUNK_SYMBOLS) {
+ db_set_b(NULL, MODULENAME, DB_SETTING_REDOWNLOAD, opts.bForceRedownload = 1);
+ db_set_b(NULL, MODULENAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK_SYMBOLS);
}
}
else {
wchar_t tszUrl[100];
GetDlgItemText(hwndDlg, IDC_CUSTOMURL, tszUrl, _countof(tszUrl));
- db_set_ws(NULL, MODNAME, DB_SETTING_UPDATE_URL, tszUrl);
- db_set_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_CUSTOM);
+ db_set_ws(NULL, MODULENAME, DB_SETTING_UPDATE_URL, tszUrl);
+ db_set_b(NULL, MODULENAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_CUSTOM);
opts.bForceRedownload = 0;
- db_unset(NULL, MODNAME, DB_SETTING_REDOWNLOAD);
+ db_unset(NULL, MODULENAME, DB_SETTING_REDOWNLOAD);
}
if (IsDlgButtonChecked(hwndDlg, IDC_CHANGE_PLATFORM)) {
- db_set_b(NULL, MODNAME, DB_SETTING_REDOWNLOAD, opts.bForceRedownload = 1);
- db_set_b(NULL, MODNAME, DB_SETTING_CHANGEPLATFORM, opts.bChangePlatform = 1);
+ db_set_b(NULL, MODULENAME, DB_SETTING_REDOWNLOAD, opts.bForceRedownload = 1);
+ db_set_b(NULL, MODULENAME, DB_SETTING_CHANGEPLATFORM, opts.bChangePlatform = 1);
}
- else db_set_b(NULL, MODNAME, DB_SETTING_CHANGEPLATFORM, opts.bChangePlatform = 0);
+ else db_set_b(NULL, MODULENAME, DB_SETTING_CHANGEPLATFORM, opts.bChangePlatform = 0);
}
}
}
@@ -346,7 +346,7 @@ static INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM for (int i = 0; i < POPUPS; i++) {
char str[20] = {0};
mir_snprintf(str, "Popups%d", i);
- CheckDlgButton(hdlg, (i+40071), (db_get_b(NULL, MODNAME, str, DEFAULT_POPUP_ENABLED)) ? BST_CHECKED: BST_UNCHECKED);
+ CheckDlgButton(hdlg, (i+40071), (db_get_b(NULL, MODULENAME, str, DEFAULT_POPUP_ENABLED)) ? BST_CHECKED: BST_UNCHECKED);
}
return TRUE;
@@ -472,26 +472,26 @@ static INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM ctlColor = SendDlgItemMessage(hdlg, (i+42071), CPM_GETCOLOUR, 0, 0);
PopupsList[i].colorBack = ctlColor;
mir_snprintf(szSetting, "Popups%iBg", i);
- db_set_dw(NULL, MODNAME, szSetting, ctlColor);
+ db_set_dw(NULL, MODULENAME, szSetting, ctlColor);
ctlColor = SendDlgItemMessage(hdlg, (i+41071), CPM_GETCOLOUR, 0, 0);
PopupsList[i].colorText = ctlColor;
mir_snprintf(szSetting, "Popups%iTx", i);
- db_set_dw(NULL, MODNAME, szSetting, ctlColor);
+ db_set_dw(NULL, MODULENAME, szSetting, ctlColor);
}
//Colors
- db_set_b(NULL, MODNAME, "DefColors", PopupOptions.DefColors);
+ db_set_b(NULL, MODULENAME, "DefColors", PopupOptions.DefColors);
//Timeout
PopupOptions.Timeout = GetDlgItemInt(hdlg, IDC_TIMEOUT_VALUE, nullptr, TRUE);
- db_set_dw(NULL, MODNAME, "Timeout", PopupOptions.Timeout);
+ db_set_dw(NULL, MODULENAME, "Timeout", PopupOptions.Timeout);
//Left mouse click
- db_set_b(NULL, MODNAME, "LeftClickAction", PopupOptions.LeftClickAction);
+ db_set_b(NULL, MODULENAME, "LeftClickAction", PopupOptions.LeftClickAction);
//Right mouse click
- db_set_b(NULL, MODNAME, "RightClickAction", PopupOptions.RightClickAction);
+ db_set_b(NULL, MODULENAME, "RightClickAction", PopupOptions.RightClickAction);
//Notified popups
for (int i = 0; i < POPUPS; i++) {
char str[20] = {0};
mir_snprintf(str, "Popups%d", i);
- db_set_b(NULL, MODNAME, str, (BYTE)(IsDlgButtonChecked(hdlg, (i+40071))));
+ db_set_b(NULL, MODULENAME, str, (BYTE)(IsDlgButtonChecked(hdlg, (i+40071))));
}
return TRUE;
} //case PSN_APPLY
diff --git a/plugins/PluginUpdater/src/PluginUpdater.cpp b/plugins/PluginUpdater/src/PluginUpdater.cpp index 00e23eb0c8..bafb59f0ef 100644 --- a/plugins/PluginUpdater/src/PluginUpdater.cpp +++ b/plugins/PluginUpdater/src/PluginUpdater.cpp @@ -39,6 +39,10 @@ PLUGININFOEX pluginInfoEx = { {0x968def4a, 0xbc60, 0x4266, {0xac, 0x8, 0x75, 0x4c, 0xe7, 0x21, 0xdb, 0x5f}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
@@ -52,7 +56,7 @@ extern "C" __declspec(dllexport) int Load(void) InitServices();
- db_set_b(NULL, MODNAME, DB_SETTING_NEED_RESTART, 0);
+ db_set_b(NULL, MODULENAME, DB_SETTING_NEED_RESTART, 0);
DWORD dwLen = GetTempPath(_countof(g_tszTempPath), g_tszTempPath);
if (g_tszTempPath[dwLen-1] == '\\')
@@ -103,22 +107,22 @@ extern "C" __declspec(dllexport) int Load(void) g_plugin.addSound("updatefailed", LPGENW("Plugin Updater"), LPGENW("Update failed"));
// Upgrade old settings
- if (-1 == db_get_b(0, MODNAME, DB_SETTING_UPDATE_MODE, -1)) {
- ptrW dbvUpdateURL(db_get_wsa(0, MODNAME, DB_SETTING_UPDATE_URL));
+ if (-1 == db_get_b(0, MODULENAME, DB_SETTING_UPDATE_MODE, -1)) {
+ ptrW dbvUpdateURL(db_get_wsa(0, MODULENAME, DB_SETTING_UPDATE_URL));
if (dbvUpdateURL) {
if (!wcscmp(dbvUpdateURL, _A2W(DEFAULT_UPDATE_URL_OLD))) {
- db_set_b(0, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_STABLE);
- db_unset(0, MODNAME, DB_SETTING_UPDATE_URL);
+ db_set_b(0, MODULENAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_STABLE);
+ db_unset(0, MODULENAME, DB_SETTING_UPDATE_URL);
}
else if (!wcscmp(dbvUpdateURL, _A2W(DEFAULT_UPDATE_URL_TRUNK_OLD))) {
- db_set_b(0, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK);
- db_unset(0, MODNAME, DB_SETTING_UPDATE_URL);
+ db_set_b(0, MODULENAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK);
+ db_unset(0, MODULENAME, DB_SETTING_UPDATE_URL);
}
else if (!wcscmp(dbvUpdateURL, _A2W(DEFAULT_UPDATE_URL_TRUNK_SYMBOLS_OLD) L"/")) {
- db_set_b(0, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK_SYMBOLS);
- db_unset(0, MODNAME, DB_SETTING_UPDATE_URL);
+ db_set_b(0, MODULENAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK_SYMBOLS);
+ db_unset(0, MODULENAME, DB_SETTING_UPDATE_URL);
}
- else db_set_b(0, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_CUSTOM);
+ else db_set_b(0, MODULENAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_CUSTOM);
}
}
diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp index cb1fd9d618..ca1c94d5e9 100644 --- a/plugins/PluginUpdater/src/Utils.cpp +++ b/plugins/PluginUpdater/src/Utils.cpp @@ -25,20 +25,20 @@ HANDLE hPipe = nullptr; /////////////////////////////////////////////////////////////////////////////////////
void LoadOptions()
{
- PopupOptions.DefColors = db_get_b(NULL, MODNAME, "DefColors", DEFAULT_COLORS);
- PopupOptions.LeftClickAction= db_get_b(NULL, MODNAME, "LeftClickAction", DEFAULT_POPUP_LCLICK);
- PopupOptions.RightClickAction = db_get_b(NULL, MODNAME, "RightClickAction", DEFAULT_POPUP_RCLICK);
- PopupOptions.Timeout = db_get_dw(NULL, MODNAME, "Timeout", DEFAULT_TIMEOUT_VALUE);
-
- opts.bUpdateOnStartup = db_get_b(NULL, MODNAME, "UpdateOnStartup", DEFAULT_UPDATEONSTARTUP);
- opts.bOnlyOnceADay = db_get_b(NULL, MODNAME, "OnlyOnceADay", DEFAULT_ONLYONCEADAY);
- opts.bUpdateOnPeriod = db_get_b(NULL, MODNAME, "UpdateOnPeriod", DEFAULT_UPDATEONPERIOD);
- opts.Period = db_get_dw(NULL, MODNAME, "Period", DEFAULT_PERIOD);
- opts.bPeriodMeasure = db_get_b(NULL, MODNAME, "PeriodMeasure", DEFAULT_PERIODMEASURE);
- opts.bForceRedownload = db_get_b(NULL, MODNAME, DB_SETTING_REDOWNLOAD, 0);
- opts.bSilentMode = db_get_b(NULL, MODNAME, "SilentMode", 0);
- opts.bBackup = db_get_b(NULL, MODNAME, "Backup", 0);
- opts.bChangePlatform = db_get_b(NULL, MODNAME, DB_SETTING_CHANGEPLATFORM, 0);
+ PopupOptions.DefColors = db_get_b(NULL, MODULENAME, "DefColors", DEFAULT_COLORS);
+ PopupOptions.LeftClickAction= db_get_b(NULL, MODULENAME, "LeftClickAction", DEFAULT_POPUP_LCLICK);
+ PopupOptions.RightClickAction = db_get_b(NULL, MODULENAME, "RightClickAction", DEFAULT_POPUP_RCLICK);
+ PopupOptions.Timeout = db_get_dw(NULL, MODULENAME, "Timeout", DEFAULT_TIMEOUT_VALUE);
+
+ opts.bUpdateOnStartup = db_get_b(NULL, MODULENAME, "UpdateOnStartup", DEFAULT_UPDATEONSTARTUP);
+ opts.bOnlyOnceADay = db_get_b(NULL, MODULENAME, "OnlyOnceADay", DEFAULT_ONLYONCEADAY);
+ opts.bUpdateOnPeriod = db_get_b(NULL, MODULENAME, "UpdateOnPeriod", DEFAULT_UPDATEONPERIOD);
+ opts.Period = db_get_dw(NULL, MODULENAME, "Period", DEFAULT_PERIOD);
+ opts.bPeriodMeasure = db_get_b(NULL, MODULENAME, "PeriodMeasure", DEFAULT_PERIODMEASURE);
+ opts.bForceRedownload = db_get_b(NULL, MODULENAME, DB_SETTING_REDOWNLOAD, 0);
+ opts.bSilentMode = db_get_b(NULL, MODULENAME, "SilentMode", 0);
+ opts.bBackup = db_get_b(NULL, MODULENAME, "Backup", 0);
+ opts.bChangePlatform = db_get_b(NULL, MODULENAME, DB_SETTING_CHANGEPLATFORM, 0);
}
IconItem iconList[] =
@@ -58,7 +58,7 @@ void InitNetlib() NETLIBUSER nlu = {};
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szDescriptiveName.w = TranslateT("Plugin Updater HTTP connections");
- nlu.szSettingsModule = MODNAME;
+ nlu.szSettingsModule = MODULENAME;
hNetlibUser = Netlib_RegisterUser(&nlu);
}
@@ -205,14 +205,14 @@ bool ParseHashes(const wchar_t *ptszUrl, ptrW &baseUrl, SERVLIST &arHashes) DeleteFile(tszTmpIni);
if (bDoNotSwitchToStable) {
- db_set_b(NULL, MODNAME, DB_SETTING_DONT_SWITCH_TO_STABLE, 1);
+ db_set_b(NULL, MODULENAME, DB_SETTING_DONT_SWITCH_TO_STABLE, 1);
// Reset setting if needed
- int UpdateMode = db_get_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_STABLE);
+ int UpdateMode = db_get_b(NULL, MODULENAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_STABLE);
if (UpdateMode == UPDATE_MODE_STABLE)
- db_set_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK);
+ db_set_b(NULL, MODULENAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK);
}
else
- db_set_b(NULL, MODNAME, DB_SETTING_DONT_SWITCH_TO_STABLE, 0);
+ db_set_b(NULL, MODULENAME, DB_SETTING_DONT_SWITCH_TO_STABLE, 0);
return true;
}
diff --git a/plugins/PluginUpdater/src/stdafx.h b/plugins/PluginUpdater/src/stdafx.h index 0f66b8cfb1..e90119bcd6 100644 --- a/plugins/PluginUpdater/src/stdafx.h +++ b/plugins/PluginUpdater/src/stdafx.h @@ -62,7 +62,7 @@ Boston, MA 02111-1307, USA. #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
-#define MODNAME "PluginUpdater"
+#define MODULENAME "PluginUpdater"
#define MODULEA "Plugin Updater"
#define MODULE L"Plugin Updater"
#define DEFAULT_UPDATES_FOLDER L"Plugin Updates"
@@ -138,8 +138,8 @@ extern struct PlugOptions #define DB_SETTING_LAST_UPDATE "LastUpdate"
#define DB_SETTING_DONT_SWITCH_TO_STABLE "DontSwitchToStable"
#define DB_SETTING_CHANGEPLATFORM "ChangePlatform"
-#define DB_MODULE_FILES MODNAME "Files"
-#define DB_MODULE_NEW_FILES MODNAME "NewFiles"
+#define DB_MODULE_FILES MODULENAME "Files"
+#define DB_MODULE_NEW_FILES MODULENAME "NewFiles"
#define MAX_RETRIES 3
@@ -159,9 +159,7 @@ extern IconItem iconList[]; struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODNAME)
- {}
+ CMPlugin();
};
void UninitCheck(void);
diff --git a/plugins/Popup/src/actions.cpp b/plugins/Popup/src/actions.cpp index 480c2ac5be..5839b0c752 100644 --- a/plugins/Popup/src/actions.cpp +++ b/plugins/Popup/src/actions.cpp @@ -138,13 +138,13 @@ DWORD MouseOverride(HWND hCombo, int number) void LoadOption_Actions()
{
- PopupOptions.actions = db_get_dw(NULL, MODULNAME, "Actions",
+ PopupOptions.actions = db_get_dw(NULL, MODULENAME, "Actions",
ACT_ENABLE | ACT_RIGHTICONS | ACT_DEF_KEEPWND | ACT_DEF_IMONLY |
ACT_DEF_NOGLOBAL | ACT_DEF_MESSAGE | ACT_DEF_DETAILS | ACT_DEF_MENU |
ACT_DEF_ADD | ACT_DEF_DISMISS | ACT_DEF_PIN);
- PopupOptions.overrideLeft = db_get_dw(NULL, MODULNAME, "OverrideLeft", 0);
- PopupOptions.overrideMiddle = db_get_dw(NULL, MODULNAME, "OverrideMiddle", 0);
- PopupOptions.overrideRight = db_get_dw(NULL, MODULNAME, "OverrideRight", 0);
+ PopupOptions.overrideLeft = db_get_dw(NULL, MODULENAME, "OverrideLeft", 0);
+ PopupOptions.overrideMiddle = db_get_dw(NULL, MODULENAME, "OverrideMiddle", 0);
+ PopupOptions.overrideRight = db_get_dw(NULL, MODULENAME, "OverrideRight", 0);
}
static UINT controls[] =
@@ -340,7 +340,7 @@ INT_PTR CALLBACK DlgProcPopupActions(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break;
case PSN_APPLY:
- db_set_dw(NULL, MODULNAME, "Actions", PopupOptions.actions);
+ db_set_dw(NULL, MODULENAME, "Actions", PopupOptions.actions);
HWND hwndList = GetDlgItem(hwnd, IDC_ACTIONS);
for (int i = 0; i < gActions.getCount(); ++i) {
@@ -349,9 +349,9 @@ INT_PTR CALLBACK DlgProcPopupActions(HWND hwnd, UINT msg, WPARAM wParam, LPARAM }
// overrideActions
- db_set_dw(NULL, MODULNAME, "OverrideLeft", PopupOptions.overrideLeft);
- db_set_dw(NULL, MODULNAME, "OverrideMiddle", PopupOptions.overrideMiddle);
- db_set_dw(NULL, MODULNAME, "OverrideRight", PopupOptions.overrideRight);
+ db_set_dw(NULL, MODULENAME, "OverrideLeft", PopupOptions.overrideLeft);
+ db_set_dw(NULL, MODULENAME, "OverrideMiddle", PopupOptions.overrideMiddle);
+ db_set_dw(NULL, MODULENAME, "OverrideRight", PopupOptions.overrideRight);
}
break;
diff --git a/plugins/Popup/src/avatars.cpp b/plugins/Popup/src/avatars.cpp index d099ddbd73..e3e531fcfb 100644 --- a/plugins/Popup/src/avatars.cpp +++ b/plugins/Popup/src/avatars.cpp @@ -30,7 +30,7 @@ PopupAvatar *PopupAvatar::create(MCONTACT hContact) AVATARCACHEENTRY *av = (AVATARCACHEENTRY*)CallService(MS_AV_GETAVATARBITMAP, hContact, 0);
if (av && (mir_wstrlen(av->szFilename) > 4))
if (!mir_wstrcmpi(av->szFilename + mir_wstrlen(av->szFilename) - 4, L".gif"))
- if (db_get_b(NULL, MODULNAME, "EnableGifAnimation", 1) && GDIPlus_IsAnimatedGIF(av->szFilename))
+ if (db_get_b(NULL, MODULENAME, "EnableGifAnimation", 1) && GDIPlus_IsAnimatedGIF(av->szFilename))
return new GifAvatar(hContact);
}
}
diff --git a/plugins/Popup/src/config.cpp b/plugins/Popup/src/config.cpp index dc5e5dfdae..6abf66ddd5 100644 --- a/plugins/Popup/src/config.cpp +++ b/plugins/Popup/src/config.cpp @@ -46,7 +46,7 @@ void LoadOptions() {
memset(&PopupOptions, 0, sizeof(PopupOptions));
#if defined(_DEBUG)
- PopupOptions.debug = db_get_b(NULL, MODULNAME, "debug", FALSE);
+ PopupOptions.debug = db_get_b(NULL, MODULENAME, "debug", FALSE);
#endif
// Load Popup Options
diff --git a/plugins/Popup/src/font.h b/plugins/Popup/src/font.h index 3975a53c88..6b2b473499 100644 --- a/plugins/Popup/src/font.h +++ b/plugins/Popup/src/font.h @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //basic constants for all popup plugins
#define PU_FNT_AND_COLOR LPGEN("Popups") //common main group for customice\font&color
-#define PU_FNT_AND_COLOR_DB MODULNAME //use eg mir_strcpy(fid.dbSettingsGroup, PU_FNT_GROUP_DB);
+#define PU_FNT_AND_COLOR_DB MODULENAME //use eg mir_strcpy(fid.dbSettingsGroup, PU_FNT_GROUP_DB);
#define PU_FNT_PREFIX "fnt%s" //use eg mir_snprintf(fid.prefix, _countof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_....);
#define PU_FNT_NAME_TITLE LPGEN("Title")
diff --git a/plugins/Popup/src/history.cpp b/plugins/Popup/src/history.cpp index 5c191b2d7c..683ed6ec23 100644 --- a/plugins/Popup/src/history.cpp +++ b/plugins/Popup/src/history.cpp @@ -56,7 +56,7 @@ void PopupHistoryResize() void PopupHistoryLoad()
{
- popupHistoryBuffer = db_get_w(NULL, MODULNAME, "HistorySize", SETTING_HISTORYSIZE_DEFAULT);
+ popupHistoryBuffer = db_get_w(NULL, MODULENAME, "HistorySize", SETTING_HISTORYSIZE_DEFAULT);
}
void PopupHistoryUnload()
@@ -209,7 +209,7 @@ static INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lPara ShowWindow(hwndLog, SW_SHOW);
}
- Utils_RestoreWindowPosition(hwnd, NULL, MODULNAME, "popupHistory_");
+ Utils_RestoreWindowPosition(hwnd, NULL, MODULENAME, "popupHistory_");
if (logType == LOG_DEFAULT) {
SendMessage(hwnd, UM_RESIZELIST, 0, 0);
@@ -396,7 +396,7 @@ static INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lPara return TRUE;
case WM_CLOSE:
- Utils_SaveWindowPosition(hwnd, NULL, MODULNAME, "popupHistory_");
+ Utils_SaveWindowPosition(hwnd, NULL, MODULENAME, "popupHistory_");
DestroyWindow(hwnd);
hwndHistory = nullptr;
return TRUE;
diff --git a/plugins/Popup/src/icons.cpp b/plugins/Popup/src/icons.cpp index 77d01cc3a8..de1de4b60f 100644 --- a/plugins/Popup/src/icons.cpp +++ b/plugins/Popup/src/icons.cpp @@ -68,9 +68,9 @@ static IconItem iconList3[] = void InitIcons()
{
- g_plugin.registerIcon(SECT_POPUP, iconList1, MODULNAME);
- g_plugin.registerIcon(SECT_POPUP SECT_POPUP_OPT, iconList2, MODULNAME);
- g_plugin.registerIcon(SECT_POPUP SECT_POPUP_ACT, iconList3, MODULNAME);
+ g_plugin.registerIcon(SECT_POPUP, iconList1, MODULENAME);
+ g_plugin.registerIcon(SECT_POPUP SECT_POPUP_OPT, iconList2, MODULENAME);
+ g_plugin.registerIcon(SECT_POPUP SECT_POPUP_ACT, iconList3, MODULENAME);
}
HICON LoadIconEx(int iconId, bool big)
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp index ad6cfe6336..3e6756c3ba 100644 --- a/plugins/Popup/src/main.cpp +++ b/plugins/Popup/src/main.cpp @@ -247,7 +247,7 @@ static int ModulesLoaded(WPARAM, LPARAM) // Uninstalling purposes
if (ServiceExists("PluginSweeper/Add"))
- CallService("PluginSweeper/Add", (WPARAM)Translate(MODULNAME), (LPARAM)MODULNAME);
+ CallService("PluginSweeper/Add", (WPARAM)Translate(MODULENAME), (LPARAM)MODULENAME);
// load fonts / create hook
InitFonts();
@@ -298,12 +298,19 @@ PLUGININFOEX pluginInfoEx = { 0x26a9125d, 0x7863, 0x4e01, { 0xaf, 0xe, 0xd1, 0x4e, 0xf9, 0x5c, 0x50, 0x54 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
MIRAPI PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
}
-// called before the app goes into shutdown routine to make sure everyone is happy to exit
+//===== Load ============================================================================
+// Initializes the services provided and the link to those needed
+// Called when the plugin is loaded into Miranda
+
static int OkToExit(WPARAM, LPARAM)
{
closing = TRUE;
@@ -318,9 +325,6 @@ static int OnShutdown(WPARAM, LPARAM) return 0;
}
-//===== Load ============================================================================
-// Initializes the services provided and the link to those needed
-// Called when the plugin is loaded into Miranda
MIRAPI int Load(void)
{
mir_getLP(&pluginInfoEx);
@@ -329,7 +333,7 @@ MIRAPI int Load(void) CreateServiceFunction(MS_POPUP_GETSTATUS, GetStatus);
#if defined(_DEBUG)
- PopupOptions.debug = db_get_b(NULL, MODULNAME, "debug", FALSE);
+ PopupOptions.debug = db_get_b(NULL, MODULENAME, "debug", FALSE);
#else
PopupOptions.debug = false;
#endif
diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp index ff66767b68..235e60833a 100644 --- a/plugins/Popup/src/opt_adv.cpp +++ b/plugins/Popup/src/opt_adv.cpp @@ -46,34 +46,34 @@ void OptAdv_UnregisterVfx() void LoadOption_AdvOpts()
{
// History
- PopupOptions.EnableHistory = db_get_b(NULL, MODULNAME, "EnableHistory", TRUE);
- PopupOptions.HistorySize = db_get_w(NULL, MODULNAME, "HistorySize", SETTING_HISTORYSIZE_DEFAULT);
- PopupOptions.UseHppHistoryLog = db_get_b(NULL, MODULNAME, "UseHppHistoryLog", TRUE);
+ PopupOptions.EnableHistory = db_get_b(NULL, MODULENAME, "EnableHistory", TRUE);
+ PopupOptions.HistorySize = db_get_w(NULL, MODULENAME, "HistorySize", SETTING_HISTORYSIZE_DEFAULT);
+ PopupOptions.UseHppHistoryLog = db_get_b(NULL, MODULENAME, "UseHppHistoryLog", TRUE);
// Avatars
- PopupOptions.avatarBorders = db_get_b(NULL, MODULNAME, "AvatarBorders", TRUE);
- PopupOptions.avatarPNGBorders = db_get_b(NULL, MODULNAME, "AvatarPNGBorders", FALSE);
- PopupOptions.avatarRadius = db_get_b(NULL, MODULNAME, "AvatarRadius", 2);
- PopupOptions.avatarSize = db_get_w(NULL, MODULNAME, "AvatarSize", SETTING_AVTSIZE_DEFAULT);
- PopupOptions.EnableAvatarUpdates = db_get_b(NULL, MODULNAME, "EnableAvatarUpdates", FALSE);
+ PopupOptions.avatarBorders = db_get_b(NULL, MODULENAME, "AvatarBorders", TRUE);
+ PopupOptions.avatarPNGBorders = db_get_b(NULL, MODULENAME, "AvatarPNGBorders", FALSE);
+ PopupOptions.avatarRadius = db_get_b(NULL, MODULENAME, "AvatarRadius", 2);
+ PopupOptions.avatarSize = db_get_w(NULL, MODULENAME, "AvatarSize", SETTING_AVTSIZE_DEFAULT);
+ PopupOptions.EnableAvatarUpdates = db_get_b(NULL, MODULENAME, "EnableAvatarUpdates", FALSE);
// Monitor
- PopupOptions.Monitor = db_get_b(NULL, MODULNAME, "Monitor", SETTING_MONITOR_DEFAULT);
+ PopupOptions.Monitor = db_get_b(NULL, MODULENAME, "Monitor", SETTING_MONITOR_DEFAULT);
// Transparency
- PopupOptions.UseTransparency = db_get_b(NULL, MODULNAME, "UseTransparency", TRUE);
- PopupOptions.Alpha = db_get_b(NULL, MODULNAME, "Alpha", SETTING_ALPHA_DEFAULT);
- PopupOptions.OpaqueOnHover = db_get_b(NULL, MODULNAME, "OpaqueOnHover", TRUE);
+ PopupOptions.UseTransparency = db_get_b(NULL, MODULENAME, "UseTransparency", TRUE);
+ PopupOptions.Alpha = db_get_b(NULL, MODULENAME, "Alpha", SETTING_ALPHA_DEFAULT);
+ PopupOptions.OpaqueOnHover = db_get_b(NULL, MODULENAME, "OpaqueOnHover", TRUE);
// Effects
- PopupOptions.UseAnimations = db_get_b(NULL, MODULNAME, "UseAnimations", TRUE);
- PopupOptions.UseEffect = db_get_b(NULL, MODULNAME, "Fade", TRUE);
- PopupOptions.Effect = (LPTSTR)DBGetContactSettingStringX(NULL, MODULNAME, "Effect", "", DBVT_WCHAR);
- PopupOptions.FadeIn = db_get_dw(NULL, MODULNAME, "FadeInTime", SETTING_FADEINTIME_DEFAULT);
- PopupOptions.FadeOut = db_get_dw(NULL, MODULNAME, "FadeOutTime", SETTING_FADEOUTTIME_DEFAULT);
+ PopupOptions.UseAnimations = db_get_b(NULL, MODULENAME, "UseAnimations", TRUE);
+ PopupOptions.UseEffect = db_get_b(NULL, MODULENAME, "Fade", TRUE);
+ PopupOptions.Effect = (LPTSTR)DBGetContactSettingStringX(NULL, MODULENAME, "Effect", "", DBVT_WCHAR);
+ PopupOptions.FadeIn = db_get_dw(NULL, MODULENAME, "FadeInTime", SETTING_FADEINTIME_DEFAULT);
+ PopupOptions.FadeOut = db_get_dw(NULL, MODULENAME, "FadeOutTime", SETTING_FADEOUTTIME_DEFAULT);
// other old stuff
- PopupOptions.MaxPopups = db_get_w(NULL, MODULNAME, "MaxPopups", 20);
+ PopupOptions.MaxPopups = db_get_w(NULL, MODULENAME, "MaxPopups", 20);
}
INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -492,31 +492,31 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case PSN_APPLY:
// History
- db_set_b(NULL, MODULNAME, "EnableHistory", (BYTE)PopupOptions.EnableHistory);
- db_set_w(NULL, MODULNAME, "HistorySize", PopupOptions.HistorySize);
+ db_set_b(NULL, MODULENAME, "EnableHistory", (BYTE)PopupOptions.EnableHistory);
+ db_set_w(NULL, MODULENAME, "HistorySize", PopupOptions.HistorySize);
PopupHistoryResize();
- db_set_b(NULL, MODULNAME, "UseHppHistoryLog", PopupOptions.UseHppHistoryLog);
+ db_set_b(NULL, MODULENAME, "UseHppHistoryLog", PopupOptions.UseHppHistoryLog);
// Avatars
- db_set_b(NULL, MODULNAME, "AvatarBorders", PopupOptions.avatarBorders);
- db_set_b(NULL, MODULNAME, "AvatarPNGBorders", PopupOptions.avatarPNGBorders);
- db_set_b(NULL, MODULNAME, "AvatarRadius", PopupOptions.avatarRadius);
- db_set_w(NULL, MODULNAME, "AvatarSize", PopupOptions.avatarSize);
- db_set_b(NULL, MODULNAME, "EnableAvatarUpdates", PopupOptions.EnableAvatarUpdates);
+ db_set_b(NULL, MODULENAME, "AvatarBorders", PopupOptions.avatarBorders);
+ db_set_b(NULL, MODULENAME, "AvatarPNGBorders", PopupOptions.avatarPNGBorders);
+ db_set_b(NULL, MODULENAME, "AvatarRadius", PopupOptions.avatarRadius);
+ db_set_w(NULL, MODULENAME, "AvatarSize", PopupOptions.avatarSize);
+ db_set_b(NULL, MODULENAME, "EnableAvatarUpdates", PopupOptions.EnableAvatarUpdates);
// Monitor
- db_set_b(NULL, MODULNAME, "Monitor", PopupOptions.Monitor);
+ db_set_b(NULL, MODULENAME, "Monitor", PopupOptions.Monitor);
// Transparency
- db_set_b(NULL, MODULNAME, "UseTransparency", PopupOptions.UseTransparency);
- db_set_b(NULL, MODULNAME, "Alpha", PopupOptions.Alpha);
- db_set_b(NULL, MODULNAME, "OpaqueOnHover", PopupOptions.OpaqueOnHover);
+ db_set_b(NULL, MODULENAME, "UseTransparency", PopupOptions.UseTransparency);
+ db_set_b(NULL, MODULENAME, "Alpha", PopupOptions.Alpha);
+ db_set_b(NULL, MODULENAME, "OpaqueOnHover", PopupOptions.OpaqueOnHover);
// Effects
- db_set_b(NULL, MODULNAME, "UseAnimations", PopupOptions.UseAnimations);
- db_set_b(NULL, MODULNAME, "Fade", PopupOptions.UseEffect);
- db_set_ws(NULL, MODULNAME, "Effect", PopupOptions.Effect);
- db_set_dw(NULL, MODULNAME, "FadeInTime", PopupOptions.FadeIn);
- db_set_dw(NULL, MODULNAME, "FadeOutTime", PopupOptions.FadeOut);
+ db_set_b(NULL, MODULENAME, "UseAnimations", PopupOptions.UseAnimations);
+ db_set_b(NULL, MODULENAME, "Fade", PopupOptions.UseEffect);
+ db_set_ws(NULL, MODULENAME, "Effect", PopupOptions.Effect);
+ db_set_dw(NULL, MODULENAME, "FadeInTime", PopupOptions.FadeIn);
+ db_set_dw(NULL, MODULENAME, "FadeOutTime", PopupOptions.FadeOut);
// other old stuff
- db_set_w(NULL, MODULNAME, "MaxPopups", (BYTE)PopupOptions.MaxPopups);
+ db_set_w(NULL, MODULENAME, "MaxPopups", (BYTE)PopupOptions.MaxPopups);
}
return TRUE;
}
diff --git a/plugins/Popup/src/opt_contacts.cpp b/plugins/Popup/src/opt_contacts.cpp index d9315e2f16..cfca450f13 100644 --- a/plugins/Popup/src/opt_contacts.cpp +++ b/plugins/Popup/src/opt_contacts.cpp @@ -32,7 +32,7 @@ static void sttSetAllContactIcons(HWND hwndList) {
for (auto &hContact : Contacts()) {
HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0);
- DWORD dwMode = db_get_b(hContact, MODULNAME, "ShowMode", 0);
+ DWORD dwMode = db_get_b(hContact, MODULENAME, "ShowMode", 0);
for (int i = 0; i < 4 /*_countof(sttIcons)*/; ++i)
// hIml element [0] = SKINICON_OTHER_SMALLDOT
// hIml element [1..5] = IcoLib_GetIcon(....) ~ old sttIcons
@@ -103,7 +103,7 @@ INT_PTR CALLBACK DlgProcContactOpts(HWND hwnd, UINT msg, WPARAM, LPARAM lParam) HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0);
for (int i = 0; i < 4 /*_countof(sttIcons)*/; ++i) {
if (SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, 0))) {
- db_set_b(hContact, MODULNAME, "ShowMode", i);
+ db_set_b(hContact, MODULENAME, "ShowMode", i);
break;
}
}
diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp index 0b7cdeadca..c77cae67e9 100644 --- a/plugins/Popup/src/opt_gen.cpp +++ b/plugins/Popup/src/opt_gen.cpp @@ -89,40 +89,40 @@ int AddStatusModes(OPTTREE_OPTION *options, int pos, LPTSTR prefix, DWORD flags) void LoadOption_General()
{
// Seconds
- PopupOptions.InfiniteDelay = db_get_b(NULL, MODULNAME, "InfiniteDelay", FALSE);
+ PopupOptions.InfiniteDelay = db_get_b(NULL, MODULENAME, "InfiniteDelay", FALSE);
PopupOptions.Seconds =
- DBGetContactSettingRangedWord(NULL, MODULNAME, "Seconds", SETTING_LIFETIME_DEFAULT, SETTING_LIFETIME_MIN, SETTING_LIFETIME_MAX);
- PopupOptions.LeaveHovered = db_get_b(NULL, MODULNAME, "LeaveHovered", TRUE);
+ DBGetContactSettingRangedWord(NULL, MODULENAME, "Seconds", SETTING_LIFETIME_DEFAULT, SETTING_LIFETIME_MIN, SETTING_LIFETIME_MAX);
+ PopupOptions.LeaveHovered = db_get_b(NULL, MODULENAME, "LeaveHovered", TRUE);
// Dynamic Resize
- PopupOptions.DynamicResize = db_get_b(NULL, MODULNAME, "DynamicResize", FALSE);
- PopupOptions.UseMinimumWidth = db_get_b(NULL, MODULNAME, "UseMinimumWidth", TRUE);
- PopupOptions.MinimumWidth = db_get_w(NULL, MODULNAME, "MinimumWidth", 160);
- PopupOptions.UseMaximumWidth = db_get_b(NULL, MODULNAME, "UseMaximumWidth", TRUE);
- PopupOptions.MaximumWidth = db_get_w(NULL, MODULNAME, "MaximumWidth", 300);
+ PopupOptions.DynamicResize = db_get_b(NULL, MODULENAME, "DynamicResize", FALSE);
+ PopupOptions.UseMinimumWidth = db_get_b(NULL, MODULENAME, "UseMinimumWidth", TRUE);
+ PopupOptions.MinimumWidth = db_get_w(NULL, MODULENAME, "MinimumWidth", 160);
+ PopupOptions.UseMaximumWidth = db_get_b(NULL, MODULENAME, "UseMaximumWidth", TRUE);
+ PopupOptions.MaximumWidth = db_get_w(NULL, MODULENAME, "MaximumWidth", 300);
// Position
PopupOptions.Position =
- DBGetContactSettingRangedByte(NULL, MODULNAME, "Position", POS_LOWERRIGHT, POS_MINVALUE, POS_MAXVALUE);
+ DBGetContactSettingRangedByte(NULL, MODULENAME, "Position", POS_LOWERRIGHT, POS_MINVALUE, POS_MAXVALUE);
// Configure popup area
- PopupOptions.gapTop = db_get_w(NULL, MODULNAME, "gapTop", 5);
- PopupOptions.gapBottom = db_get_w(NULL, MODULNAME, "gapBottom", 5);
- PopupOptions.gapLeft = db_get_w(NULL, MODULNAME, "gapLeft", 5);
- PopupOptions.gapRight = db_get_w(NULL, MODULNAME, "gapRight", 5);
- PopupOptions.spacing = db_get_w(NULL, MODULNAME, "spacing", 5);
+ PopupOptions.gapTop = db_get_w(NULL, MODULENAME, "gapTop", 5);
+ PopupOptions.gapBottom = db_get_w(NULL, MODULENAME, "gapBottom", 5);
+ PopupOptions.gapLeft = db_get_w(NULL, MODULENAME, "gapLeft", 5);
+ PopupOptions.gapRight = db_get_w(NULL, MODULENAME, "gapRight", 5);
+ PopupOptions.spacing = db_get_w(NULL, MODULENAME, "spacing", 5);
// Spreading
PopupOptions.Spreading =
- DBGetContactSettingRangedByte(NULL, MODULNAME, "Spreading", SPREADING_VERTICAL, SPREADING_MINVALUE, SPREADING_MAXVALUE);
+ DBGetContactSettingRangedByte(NULL, MODULENAME, "Spreading", SPREADING_VERTICAL, SPREADING_MINVALUE, SPREADING_MAXVALUE);
// miscellaneous
- PopupOptions.ReorderPopups = db_get_b(NULL, MODULNAME, "ReorderPopups", TRUE);
- PopupOptions.ReorderPopupsWarning = db_get_b(NULL, MODULNAME, "ReorderPopupsWarning", TRUE);
+ PopupOptions.ReorderPopups = db_get_b(NULL, MODULENAME, "ReorderPopups", TRUE);
+ PopupOptions.ReorderPopupsWarning = db_get_b(NULL, MODULENAME, "ReorderPopupsWarning", TRUE);
// disable When
PopupOptions.ModuleIsEnabled = db_get_b(NULL, "Popup", "ModuleIsEnabled", TRUE);
- PopupOptions.DisableWhenFullscreen = db_get_b(NULL, MODULNAME, "DisableWhenFullscreen", TRUE);
+ PopupOptions.DisableWhenFullscreen = db_get_b(NULL, MODULENAME, "DisableWhenFullscreen", TRUE);
}
INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -243,10 +243,10 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM wchar_t pszSettingName[256];
mir_snwprintf(pszSettingName, LPGENW("Protocol Status")L"/%s", pa->tszAccountName);
- OptTree_SetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, db_get_dw(NULL, MODULNAME, prefix, 0), pszSettingName);
+ OptTree_SetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, db_get_dw(NULL, MODULENAME, prefix, 0), pszSettingName);
}
}
- OptTree_SetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, db_get_dw(NULL, MODULNAME, "Global Status", 0), LPGENW("Global Status"));
+ OptTree_SetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, db_get_dw(NULL, MODULENAME, "Global Status", 0), LPGENW("Global Status"));
}
TranslateDialogDefault(hwnd); // do it on end of WM_INITDIALOG
@@ -335,7 +335,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case IDC_REORDERPOPUPS:
PopupOptions.ReorderPopups = !PopupOptions.ReorderPopups;
- PopupOptions.ReorderPopupsWarning = PopupOptions.ReorderPopups ? db_get_b(NULL, MODULNAME, "ReorderPopupsWarning", TRUE) : TRUE;
+ PopupOptions.ReorderPopupsWarning = PopupOptions.ReorderPopups ? db_get_b(NULL, MODULENAME, "ReorderPopupsWarning", TRUE) : TRUE;
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
@@ -485,35 +485,35 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case PSN_APPLY:
// Seconds
- db_set_b(NULL, MODULNAME, "InfiniteDelay", PopupOptions.InfiniteDelay);
- db_set_w(NULL, MODULNAME, "Seconds", (WORD)PopupOptions.Seconds);
- db_set_b(NULL, MODULNAME, "LeaveHovered", PopupOptions.LeaveHovered);
+ db_set_b(NULL, MODULENAME, "InfiniteDelay", PopupOptions.InfiniteDelay);
+ db_set_w(NULL, MODULENAME, "Seconds", (WORD)PopupOptions.Seconds);
+ db_set_b(NULL, MODULENAME, "LeaveHovered", PopupOptions.LeaveHovered);
// Dynamic Resize
- db_set_b(NULL, MODULNAME, "DynamicResize", PopupOptions.DynamicResize);
- db_set_b(NULL, MODULNAME, "UseMinimumWidth", PopupOptions.UseMinimumWidth);
- db_set_w(NULL, MODULNAME, "MinimumWidth", PopupOptions.MinimumWidth);
- db_set_b(NULL, MODULNAME, "UseMaximumWidth", PopupOptions.UseMaximumWidth);
- db_set_w(NULL, MODULNAME, "MaximumWidth", PopupOptions.MaximumWidth);
+ db_set_b(NULL, MODULENAME, "DynamicResize", PopupOptions.DynamicResize);
+ db_set_b(NULL, MODULENAME, "UseMinimumWidth", PopupOptions.UseMinimumWidth);
+ db_set_w(NULL, MODULENAME, "MinimumWidth", PopupOptions.MinimumWidth);
+ db_set_b(NULL, MODULENAME, "UseMaximumWidth", PopupOptions.UseMaximumWidth);
+ db_set_w(NULL, MODULENAME, "MaximumWidth", PopupOptions.MaximumWidth);
// Position
- db_set_b(NULL, MODULNAME, "Position", (BYTE)PopupOptions.Position);
+ db_set_b(NULL, MODULENAME, "Position", (BYTE)PopupOptions.Position);
// Configure popup area
- db_set_w(NULL, MODULNAME, "gapTop", (WORD)PopupOptions.gapTop);
- db_set_w(NULL, MODULNAME, "gapBottom", (WORD)PopupOptions.gapBottom);
- db_set_w(NULL, MODULNAME, "gapLeft", (WORD)PopupOptions.gapLeft);
- db_set_w(NULL, MODULNAME, "gapRight", (WORD)PopupOptions.gapRight);
- db_set_w(NULL, MODULNAME, "spacing", (WORD)PopupOptions.spacing);
+ db_set_w(NULL, MODULENAME, "gapTop", (WORD)PopupOptions.gapTop);
+ db_set_w(NULL, MODULENAME, "gapBottom", (WORD)PopupOptions.gapBottom);
+ db_set_w(NULL, MODULENAME, "gapLeft", (WORD)PopupOptions.gapLeft);
+ db_set_w(NULL, MODULENAME, "gapRight", (WORD)PopupOptions.gapRight);
+ db_set_w(NULL, MODULENAME, "spacing", (WORD)PopupOptions.spacing);
// Spreading
- db_set_b(NULL, MODULNAME, "Spreading", (BYTE)PopupOptions.Spreading);
+ db_set_b(NULL, MODULENAME, "Spreading", (BYTE)PopupOptions.Spreading);
// miscellaneous
Check_ReorderPopups(hwnd); // this save also PopupOptions.ReorderPopups
// disable When
- db_set_b(NULL, MODULNAME, "DisableWhenFullscreen", PopupOptions.DisableWhenFullscreen);
+ db_set_b(NULL, MODULENAME, "DisableWhenFullscreen", PopupOptions.DisableWhenFullscreen);
// new status options
for (auto &pa : Accounts())
@@ -523,10 +523,10 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM wchar_t pszSettingName[256];
mir_snwprintf(pszSettingName, L"Protocol Status/%s", pa->tszAccountName);
- db_set_dw(NULL, MODULNAME, prefix, OptTree_GetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, pszSettingName));
+ db_set_dw(NULL, MODULENAME, prefix, OptTree_GetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, pszSettingName));
}
- db_set_dw(NULL, MODULNAME, "Global Status", OptTree_GetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, L"Global Status"));
+ db_set_dw(NULL, MODULENAME, "Global Status", OptTree_GetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, L"Global Status"));
return TRUE;
}
break;
@@ -598,8 +598,8 @@ void Check_ReorderPopups(HWND hwnd) return;
}
}
- db_set_b(NULL, MODULNAME, "ReorderPopups", PopupOptions.ReorderPopups);
- db_set_b(NULL, MODULNAME, "ReorderPopupsWarning", PopupOptions.ReorderPopupsWarning);
+ db_set_b(NULL, MODULENAME, "ReorderPopups", PopupOptions.ReorderPopups);
+ db_set_b(NULL, MODULENAME, "ReorderPopupsWarning", PopupOptions.ReorderPopupsWarning);
if (hwnd) CheckDlgButton(hwnd, IDC_REORDERPOPUPS, PopupOptions.ReorderPopups ? BST_CHECKED : BST_UNCHECKED);
}
diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp index 5dd0146177..c2c02423c2 100644 --- a/plugins/Popup/src/opt_skins.cpp +++ b/plugins/Popup/src/opt_skins.cpp @@ -282,7 +282,7 @@ bool SkinOptionList_Update(OPTTREE_OPTION* &options, int *OptionsCount, HWND hwn char prefix[128];
mir_snprintf(prefix, "skin.%S", PopupOptions.SkinPack);
OptTree_SetOptions(hwndDlg, IDC_SKIN_LIST_OPT, options, *OptionsCount,
- db_get_dw(NULL, MODULNAME, prefix, dwSkinOptions), L"Skin options");
+ db_get_dw(NULL, MODULENAME, prefix, dwSkinOptions), L"Skin options");
// check "Global Settings"
OptTree_SetOptions(hwndDlg, IDC_SKIN_LIST_OPT, options, *OptionsCount,
@@ -293,14 +293,14 @@ bool SkinOptionList_Update(OPTTREE_OPTION* &options, int *OptionsCount, HWND hwn void LoadOption_Skins() {
// skin pack
- PopupOptions.SkinPack = (LPTSTR)DBGetContactSettingStringX(NULL, MODULNAME, "SkinPack", "* Popup Classic", DBVT_WCHAR);
+ PopupOptions.SkinPack = (LPTSTR)DBGetContactSettingStringX(NULL, MODULENAME, "SkinPack", "* Popup Classic", DBVT_WCHAR);
// more Skin options
- PopupOptions.DisplayTime = db_get_b(NULL, MODULNAME, "DisplayTime", TRUE);
- PopupOptions.DropShadow = db_get_b(NULL, MODULNAME, "DropShadow", TRUE);
- PopupOptions.EnableFreeformShadows = db_get_b(NULL, MODULNAME, "EnableShadowRegion", 1);
- PopupOptions.EnableAeroGlass = db_get_b(NULL, MODULNAME, "EnableAeroGlass", 1);
- PopupOptions.UseWinColors = db_get_b(NULL, MODULNAME, "UseWinColors", FALSE);
- PopupOptions.UseMText = db_get_b(NULL, MODULNAME, "UseMText", TRUE);
+ PopupOptions.DisplayTime = db_get_b(NULL, MODULENAME, "DisplayTime", TRUE);
+ PopupOptions.DropShadow = db_get_b(NULL, MODULENAME, "DropShadow", TRUE);
+ PopupOptions.EnableFreeformShadows = db_get_b(NULL, MODULENAME, "EnableShadowRegion", 1);
+ PopupOptions.EnableAeroGlass = db_get_b(NULL, MODULENAME, "EnableAeroGlass", 1);
+ PopupOptions.UseWinColors = db_get_b(NULL, MODULENAME, "UseWinColors", FALSE);
+ PopupOptions.UseMText = db_get_b(NULL, MODULENAME, "UseMText", TRUE);
}
INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -477,18 +477,18 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case PSN_APPLY:
{
// skin pack
- db_set_ws(NULL, MODULNAME, "SkinPack", PopupOptions.SkinPack);
+ db_set_ws(NULL, MODULENAME, "SkinPack", PopupOptions.SkinPack);
// skin options
const PopupSkin *skin = nullptr;
if (skin = skins.getSkin(PopupOptions.SkinPack))
skin->saveOpts();
skins.freeAllButActive();
// more Skin options
- db_set_b(NULL, MODULNAME, "DisplayTime", PopupOptions.DisplayTime);
- db_set_b(NULL, MODULNAME, "DropShadow", PopupOptions.DropShadow);
- db_set_b(NULL, MODULNAME, "EnableShadowRegion", PopupOptions.EnableFreeformShadows);
- db_set_b(NULL, MODULNAME, "EnableAeroGlass", PopupOptions.EnableAeroGlass);
- db_set_b(NULL, MODULNAME, "UseMText", PopupOptions.UseMText);
+ db_set_b(NULL, MODULENAME, "DisplayTime", PopupOptions.DisplayTime);
+ db_set_b(NULL, MODULENAME, "DropShadow", PopupOptions.DropShadow);
+ db_set_b(NULL, MODULENAME, "EnableShadowRegion", PopupOptions.EnableFreeformShadows);
+ db_set_b(NULL, MODULENAME, "EnableAeroGlass", PopupOptions.EnableAeroGlass);
+ db_set_b(NULL, MODULENAME, "UseMText", PopupOptions.UseMText);
}// end PSN_APPLY:
return TRUE;
}// switch (((LPNMHDR)lParam)->code)
diff --git a/plugins/Popup/src/popup_thread.cpp b/plugins/Popup/src/popup_thread.cpp index 0363613fa0..3aa0a05167 100644 --- a/plugins/Popup/src/popup_thread.cpp +++ b/plugins/Popup/src/popup_thread.cpp @@ -152,7 +152,7 @@ static LRESULT CALLBACK PopupThreadManagerWndProc(HWND hwnd, UINT message, WPARA switch (message) {
case UTM_STOP_THREAD:
gTerminating = true;
- if (db_get_b(NULL, MODULNAME, "FastExit", 0))
+ if (db_get_b(NULL, MODULENAME, "FastExit", 0))
for (auto &it : popupList)
PUDeletePopup(it->getHwnd());
PostQuitMessage(0);
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp index fab7339724..1e25a01b6e 100644 --- a/plugins/Popup/src/services.cpp +++ b/plugins/Popup/src/services.cpp @@ -126,7 +126,7 @@ INT_PTR Popup_AddPopup2(WPARAM wParam, LPARAM lParam) if (ppd->lchContact)
proto = GetContactProto(ppd->lchContact);
- BYTE bShowMode = proto ? db_get_b(ppd->lchContact, MODULNAME, "ShowMode", PU_SHOWMODE_AUTO) : PU_SHOWMODE_AUTO;
+ BYTE bShowMode = proto ? db_get_b(ppd->lchContact, MODULENAME, "ShowMode", PU_SHOWMODE_AUTO) : PU_SHOWMODE_AUTO;
if (bShowMode == PU_SHOWMODE_BLOCK)
return -1;
@@ -138,7 +138,7 @@ INT_PTR Popup_AddPopup2(WPARAM wParam, LPARAM lParam) if (PopupOptions.DisableWhenFullscreen && (bShowMode != PU_SHOWMODE_FULLSCREEN) && IsFullScreen())
return -1;
- if (db_get_dw(NULL, MODULNAME, LPGEN("Global Status"), 0) & Proto_Status2Flag_My(CallService(MS_CLIST_GETSTATUSMODE, 0, 0)))
+ if (db_get_dw(NULL, MODULENAME, LPGEN("Global Status"), 0) & Proto_Status2Flag_My(CallService(MS_CLIST_GETSTATUSMODE, 0, 0)))
return -1;
if ((disableWhen & 0x0000FFFF) & Proto_Status2Flag_My(CallService(MS_CLIST_GETSTATUSMODE, 0, 0)))
@@ -147,7 +147,7 @@ INT_PTR Popup_AddPopup2(WPARAM wParam, LPARAM lParam) if (proto) {
char prefix[128];
mir_snprintf(prefix, LPGEN("Protocol Status") "/%s", GetContactProto(ppd->lchContact));
- if (db_get_dw(NULL, MODULNAME, prefix, 0) & Proto_Status2Flag_My(Proto_GetStatus(proto)))
+ if (db_get_dw(NULL, MODULENAME, prefix, 0) & Proto_Status2Flag_My(Proto_GetStatus(proto)))
return -1;
if (((disableWhen >> 16) & 0xFFFF0000) & Proto_Status2Flag_My(Proto_GetStatus(proto)))
return -1;
diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp index bef54628c8..34ef0665df 100644 --- a/plugins/Popup/src/skin.cpp +++ b/plugins/Popup/src/skin.cpp @@ -518,7 +518,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW if (textAreaWidth <= 0) textAreaWidth = wnd->getRenderInfo()->realtextw;
drawActionBar(bmp, wnd,
- db_get_b(NULL, MODULNAME, "CenterActions", 0) ?
+ db_get_b(NULL, MODULENAME, "CenterActions", 0) ?
(pt.x + (textAreaWidth - wnd->getRenderInfo()->actw) / 2) :
(PopupOptions.actions & ACT_RIGHTICONS) ?
(pt.x + textAreaWidth - wnd->getRenderInfo()->actw) :
@@ -1040,14 +1040,14 @@ void PopupSkin::saveOpts() const {
char buf[128];
mir_snprintf(buf, "skin.%.120S", m_name);
- db_set_dw(NULL, MODULNAME, buf, m_flags);
+ db_set_dw(NULL, MODULENAME, buf, m_flags);
}
void PopupSkin::loadOpts() const
{
char buf[128];
mir_snprintf(buf, "skin.%.120S", m_name);
- m_flags = db_get_dw(NULL, MODULNAME, buf, m_flags);
+ m_flags = db_get_dw(NULL, MODULENAME, buf, m_flags);
}
// Skins
diff --git a/plugins/Popup/src/srmm_menu.cpp b/plugins/Popup/src/srmm_menu.cpp index fa4c6bf244..abee0ec5bd 100644 --- a/plugins/Popup/src/srmm_menu.cpp +++ b/plugins/Popup/src/srmm_menu.cpp @@ -36,10 +36,10 @@ static void SrmmMenu_UpdateIcon(MCONTACT hContact) if (!hContact)
return;
- int mode = db_get_b(hContact, MODULNAME, "ShowMode", PU_SHOWMODE_AUTO);
+ int mode = db_get_b(hContact, MODULENAME, "ShowMode", PU_SHOWMODE_AUTO);
StatusIconData sid = {};
- sid.szModule = MODULNAME;
+ sid.szModule = MODULENAME;
for (int i = 0; i < 4; i++) {
sid.dwId = i;
@@ -70,13 +70,13 @@ static int SrmmMenu_ProcessEvent(WPARAM, LPARAM lParam) static int SrmmMenu_ProcessIconClick(WPARAM hContact, LPARAM lParam)
{
StatusIconClickData *sicd = (StatusIconClickData *)lParam;
- if (mir_strcmp(sicd->szModule, MODULNAME))
+ if (mir_strcmp(sicd->szModule, MODULENAME))
return 0;
if (!hContact)
return 0;
- int mode = db_get_b(hContact, MODULNAME, "ShowMode", PU_SHOWMODE_AUTO);
+ int mode = db_get_b(hContact, MODULENAME, "ShowMode", PU_SHOWMODE_AUTO);
if (sicd->flags & MBCF_RIGHTBUTTON) {
HMENU hMenu = CreatePopupMenu();
@@ -90,12 +90,12 @@ static int SrmmMenu_ProcessIconClick(WPARAM hContact, LPARAM lParam) mode = TrackPopupMenu(hMenu, TPM_RETURNCMD, sicd->clickLocation.x, sicd->clickLocation.y, 0, WindowList_Find(hDialogsList, hContact), nullptr);
if (mode) {
- db_set_b(hContact, MODULNAME, "ShowMode", mode - 1);
+ db_set_b(hContact, MODULENAME, "ShowMode", mode - 1);
SrmmMenu_UpdateIcon(hContact);
}
}
else {
- db_set_b(hContact, MODULNAME, "ShowMode", (mode == PU_SHOWMODE_AUTO) ? PU_SHOWMODE_BLOCK : PU_SHOWMODE_AUTO);
+ db_set_b(hContact, MODULENAME, "ShowMode", (mode == PU_SHOWMODE_AUTO) ? PU_SHOWMODE_BLOCK : PU_SHOWMODE_AUTO);
SrmmMenu_UpdateIcon(hContact);
}
@@ -105,7 +105,7 @@ static int SrmmMenu_ProcessIconClick(WPARAM hContact, LPARAM lParam) void SrmmMenu_Load()
{
StatusIconData sid = {};
- sid.szModule = MODULNAME;
+ sid.szModule = MODULENAME;
sid.dwId = 0;
sid.szTooltip = LPGEN("Popup Mode: Auto");
diff --git a/plugins/Popup/src/stdafx.h b/plugins/Popup/src/stdafx.h index ea91428de0..3ac1fe44e3 100644 --- a/plugins/Popup/src/stdafx.h +++ b/plugins/Popup/src/stdafx.h @@ -96,17 +96,15 @@ https://miranda-ng.org/distr/ #include <m_toptoolbar.h>
#include <m_hpp.h>
-#define PU_MODULCLASS "PopupCLASS" // temp DB modul for this plugin
-#define MODULNAME "Popup"
+#define PU_MODULCLASS "PopupCLASS" // temp DB modul for this plugin
+#define MODULENAME "Popup"
#define MODULNAME_LONG L"Popup Plus"
-#define MODULNAME_PLU "Popups"
+#define MODULNAME_PLU "Popups"
#define MODULNAME_PLUW L"Popups"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULNAME)
- {}
+ CMPlugin();
};
#include "resource.h"
diff --git a/plugins/ProfileManager/src/pmanagerEx.cpp b/plugins/ProfileManager/src/pmanagerEx.cpp index b8316ab165..5eefa70b75 100644 --- a/plugins/ProfileManager/src/pmanagerEx.cpp +++ b/plugins/ProfileManager/src/pmanagerEx.cpp @@ -15,9 +15,7 @@ There is no warranty. struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(nullptr)
- {}
+ CMPlugin();
}
g_plugin;
@@ -25,7 +23,7 @@ int &hLangpack(g_plugin.m_hLang); /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -39,9 +37,13 @@ PLUGININFOEX pluginInfo = { 0x7eeeb55e, 0x9d83, 0x4e1a, { 0xa1, 0x2f, 0x8f, 0x13, 0xf1, 0xa1, 0x24, 0xfb } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(nullptr, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -85,7 +87,7 @@ static MUUID uids[_countof(iconList)] = extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
g_plugin.registerIcon(LPGEN("Profile manager"), iconList);
diff --git a/plugins/QuickContacts/src/dialog.cpp b/plugins/QuickContacts/src/dialog.cpp index e51d2734e2..2b2e112b07 100644 --- a/plugins/QuickContacts/src/dialog.cpp +++ b/plugins/QuickContacts/src/dialog.cpp @@ -132,7 +132,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all) BOOL metacontactsEnabled = db_mc_isEnabled(); // Read last-sent-to contact from db and set handle as window-userdata - HANDLE hlastsent = (HANDLE)db_get_dw(NULL, MODULE_NAME, "LastSentTo", -1); + HANDLE hlastsent = (HANDLE)db_get_dw(NULL, MODULENAME, "LastSentTo", -1); SetWindowLongPtr(hwndMain, GWLP_USERDATA, (LONG_PTR)hlastsent); // enumerate all contacts and write them to the array @@ -160,7 +160,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all) char setting[128]; mir_snprintf(setting, "ShowOffline%s", pszProto); - if (!db_get_b(NULL, MODULE_NAME, setting, FALSE)) + if (!db_get_b(NULL, MODULENAME, setting, FALSE)) continue; // Check if proto offline @@ -179,7 +179,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all) char setting[128]; mir_snprintf(setting, "ShowOffline%s", META_PROTO); - if (db_get_b(NULL, MODULE_NAME, setting, FALSE)) + if (db_get_b(NULL, MODULENAME, setting, FALSE)) continue; } } @@ -525,13 +525,13 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SendDlgItemMessage(hwndDlg, IDC_USERNAME, CB_SETEXTENDEDUI, TRUE, 0); - Utils_RestoreWindowPositionNoSize(hwndDlg, NULL, MODULE_NAME, "window"); + Utils_RestoreWindowPositionNoSize(hwndDlg, NULL, MODULENAME, "window"); LoadContacts(hwndDlg, FALSE); EnableButtons(hwndDlg, NULL); - if (db_get_b(NULL, MODULE_NAME, "EnableLastSentTo", 0)) { - int pos = GetItemPos((MCONTACT)db_get_dw(NULL, MODULE_NAME, "LastSentTo", -1)); + if (db_get_b(NULL, MODULENAME, "EnableLastSentTo", 0)) { + int pos = GetItemPos((MCONTACT)db_get_dw(NULL, MODULENAME, "LastSentTo", -1)); if (pos != -1) { SendDlgItemMessage(hwndDlg, IDC_USERNAME, CB_SETCURSEL, (WPARAM)pos, 0); EnableButtons(hwndDlg, contacts[pos]->hcontact); @@ -559,7 +559,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA Clist_ContactDoubleClicked(hContact); - db_set_dw(NULL, MODULE_NAME, "LastSentTo", hContact); + db_set_dw(NULL, MODULENAME, "LastSentTo", hContact); SendMessage(hwndDlg, WM_CLOSE, 0, 0); } break; @@ -578,7 +578,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA CallService(MS_MSG_SENDMESSAGEW, hContact, 0); - db_set_dw(NULL, MODULE_NAME, "LastSentTo", hContact); + db_set_dw(NULL, MODULENAME, "LastSentTo", hContact); SendMessage(hwndDlg, WM_CLOSE, 0, 0); break; } @@ -599,7 +599,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA CallService(MS_FILE_SENDFILE, hContact, 0); - db_set_dw(NULL, MODULE_NAME, "LastSentTo", hContact); + db_set_dw(NULL, MODULENAME, "LastSentTo", hContact); SendMessage(hwndDlg, WM_CLOSE, 0, 0); } break; @@ -620,7 +620,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA CallService(MS_URL_SENDURL, hContact, 0); - db_set_dw(NULL, MODULE_NAME, "LastSentTo", hContact); + db_set_dw(NULL, MODULENAME, "LastSentTo", hContact); SendMessage(hwndDlg, WM_CLOSE, 0, 0); } break; @@ -641,7 +641,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA CallService(MS_USERINFO_SHOWDIALOG, hContact, 0); - db_set_dw(NULL, MODULE_NAME, "LastSentTo", hContact); + db_set_dw(NULL, MODULENAME, "LastSentTo", hContact); SendMessage(hwndDlg, WM_CLOSE, 0, 0); } break; @@ -662,7 +662,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA CallService(MS_HISTORY_SHOWCONTACTHISTORY, hContact, 0); - db_set_dw(NULL, MODULE_NAME, "LastSentTo", hContact); + db_set_dw(NULL, MODULENAME, "LastSentTo", hContact); SendMessage(hwndDlg, WM_CLOSE, 0, 0); } break; @@ -692,7 +692,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA Clist_MenuProcessCommand(LOWORD(ret), MPCF_CONTACTMENU, hContact); } - db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD)hContact); + db_set_dw(NULL, MODULENAME, "LastSentTo", (DWORD)hContact); } break; @@ -726,7 +726,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA break; case WM_CLOSE: - Utils_SaveWindowPosition(hwndDlg, NULL, MODULE_NAME, "window"); + Utils_SaveWindowPosition(hwndDlg, NULL, MODULENAME, "window"); DestroyWindow(hwndDlg); break; diff --git a/plugins/QuickContacts/src/options.cpp b/plugins/QuickContacts/src/options.cpp index 3904fb0756..ff274eee58 100644 --- a/plugins/QuickContacts/src/options.cpp +++ b/plugins/QuickContacts/src/options.cpp @@ -37,14 +37,14 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // Initializations needed by options
void LoadOptions()
{
- opts.last_sent_enable = db_get_b(NULL, MODULE_NAME, "EnableLastSentTo", TRUE);
- opts.last_sent_msg_type = db_get_w(NULL, MODULE_NAME, "MsgTypeRec", TYPE_GLOBAL);
- opts.hide_from_offline_proto = db_get_b(NULL, MODULE_NAME, "HideOfflineFromOfflineProto", TRUE);
- opts.group_append = db_get_b(NULL, MODULE_NAME, "AppendGroupName", FALSE);
- opts.group_column = db_get_b(NULL, MODULE_NAME, "GroupColumn", FALSE);
- opts.group_column_left = db_get_b(NULL, MODULE_NAME, "GroupColumnLeft", FALSE);
- opts.hide_subcontacts = db_get_b(NULL, MODULE_NAME, "HideSubcontacts", TRUE);
- opts.keep_subcontacts_from_offline = db_get_b(NULL, MODULE_NAME, "KeepSubcontactsFromOffline", TRUE);
+ opts.last_sent_enable = db_get_b(NULL, MODULENAME, "EnableLastSentTo", TRUE);
+ opts.last_sent_msg_type = db_get_w(NULL, MODULENAME, "MsgTypeRec", TYPE_GLOBAL);
+ opts.hide_from_offline_proto = db_get_b(NULL, MODULENAME, "HideOfflineFromOfflineProto", TRUE);
+ opts.group_append = db_get_b(NULL, MODULENAME, "AppendGroupName", FALSE);
+ opts.group_column = db_get_b(NULL, MODULENAME, "GroupColumn", FALSE);
+ opts.group_column_left = db_get_b(NULL, MODULENAME, "GroupColumnLeft", FALSE);
+ opts.hide_subcontacts = db_get_b(NULL, MODULENAME, "HideSubcontacts", TRUE);
+ opts.keep_subcontacts_from_offline = db_get_b(NULL, MODULENAME, "KeepSubcontactsFromOffline", TRUE);
}
int InitOptionsCallback(WPARAM wParam, LPARAM)
@@ -90,7 +90,7 @@ static OptPageControl controls[] = { static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- int ret = SaveOptsDlgProc(controls, _countof(controls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
+ int ret = SaveOptsDlgProc(controls, _countof(controls), MODULENAME, hwndDlg, msg, wParam, lParam);
switch (msg) {
case WM_INITDIALOG:
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index a367cd4da9..06312e4f2c 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -37,7 +37,7 @@ int hksAction = 0; // Functions ////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo = {
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -50,9 +50,13 @@ PLUGININFOEX pluginInfo = { {0xf93ba59c, 0x4f48, 0x4f2e, {0x8a, 0x91, 0x77, 0xa2, 0x80, 0x15, 0x27, 0xa3}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -141,17 +145,17 @@ static int EventAdded(WPARAM wparam, LPARAM hDbEvent) DBEVENTINFO dbei = {};
db_event_get(hDbEvent, &dbei);
if (!(dbei.flags & DBEF_SENT) || (dbei.flags & DBEF_READ)
- || !db_get_b(NULL, MODULE_NAME, "EnableLastSentTo", 0)
- || db_get_w(NULL, MODULE_NAME, "MsgTypeRec", TYPE_GLOBAL) != TYPE_GLOBAL)
+ || !db_get_b(NULL, MODULENAME, "EnableLastSentTo", 0)
+ || db_get_w(NULL, MODULENAME, "MsgTypeRec", TYPE_GLOBAL) != TYPE_GLOBAL)
return 0;
- db_set_dw(NULL, MODULE_NAME, "LastSentTo", (UINT_PTR)wparam);
+ db_set_dw(NULL, MODULENAME, "LastSentTo", (UINT_PTR)wparam);
return 0;
}
extern "C" __declspec(dllexport) int Load()
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
CreateServiceFunction(MS_QC_SHOW_DIALOG, ShowDialog);
diff --git a/plugins/QuickContacts/src/stdafx.h b/plugins/QuickContacts/src/stdafx.h index 842eee329e..f5abdae0e6 100644 --- a/plugins/QuickContacts/src/stdafx.h +++ b/plugins/QuickContacts/src/stdafx.h @@ -51,13 +51,11 @@ Boston, MA 02111-1307, USA. #include "options.h"
#include "version.h"
-#define MODULE_NAME "QuickContacts"
+#define MODULENAME "QuickContacts"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE_NAME)
- {}
+ CMPlugin();
};
//add a new hotkey so it has a default and can be changed in the options dialog
diff --git a/plugins/QuickMessages/src/Utils.cpp b/plugins/QuickMessages/src/Utils.cpp index 1fa555b4c6..626df47e54 100644 --- a/plugins/QuickMessages/src/Utils.cpp +++ b/plugins/QuickMessages/src/Utils.cpp @@ -153,22 +153,22 @@ void SaveModuleSettings(int buttonnum, ButtonData* bd) char szMEntry[256] = { '\0' }; mir_snprintf(szMEntry, "EntryName_%u_%u", buttonnum, bd->dwPos); - db_set_ws(NULL, PLGNAME, szMEntry, bd->pszName); + db_set_ws(NULL, MODULENAME, szMEntry, bd->pszName); mir_snprintf(szMEntry, "EntryValue_%u_%u", buttonnum, bd->dwPos); if (bd->pszValue) - db_set_ws(NULL, PLGNAME, szMEntry, bd->pszValue); + db_set_ws(NULL, MODULENAME, szMEntry, bd->pszValue); else - db_unset(NULL, PLGNAME, szMEntry); + db_unset(NULL, MODULENAME, szMEntry); mir_snprintf(szMEntry, "EntryRel_%u_%u", buttonnum, bd->dwPos); - db_set_b(NULL, PLGNAME, szMEntry, bd->fEntryType); + db_set_b(NULL, MODULENAME, szMEntry, bd->fEntryType); mir_snprintf(szMEntry, "EntryToQMenu_%u_%u", buttonnum, bd->dwPos); - db_set_b(NULL, PLGNAME, szMEntry, bd->bInQMenu); + db_set_b(NULL, MODULENAME, szMEntry, bd->bInQMenu); mir_snprintf(szMEntry, "EntryIsServiceName_%u_%u", buttonnum, bd->dwPos); - db_set_b(NULL, PLGNAME, szMEntry, bd->bIsServName); + db_set_b(NULL, MODULENAME, szMEntry, bd->bIsServName); } void CleanSettings(int buttonnum, int from) @@ -177,24 +177,24 @@ void CleanSettings(int buttonnum, int from) DBVARIANT dbv = { 0 }; if (from == -1) { mir_snprintf(szMEntry, "ButtonName_%u", buttonnum); - db_unset(NULL, PLGNAME, szMEntry); + db_unset(NULL, MODULENAME, szMEntry); mir_snprintf(szMEntry, "ButtonValue_%u", buttonnum); - db_unset(NULL, PLGNAME, szMEntry); + db_unset(NULL, MODULENAME, szMEntry); mir_snprintf(szMEntry, "RCEntryIsServiceName_%u", buttonnum); - db_unset(NULL, PLGNAME, szMEntry); + db_unset(NULL, MODULENAME, szMEntry); } mir_snprintf(szMEntry, "EntryName_%u_%u", buttonnum, from); - while (!db_get_ws(NULL, PLGNAME, szMEntry, &dbv)) { - db_unset(NULL, PLGNAME, szMEntry); + while (!db_get_ws(NULL, MODULENAME, szMEntry, &dbv)) { + db_unset(NULL, MODULENAME, szMEntry); mir_snprintf(szMEntry, "EntryValue_%u_%u", buttonnum, from); - db_unset(NULL, PLGNAME, szMEntry); + db_unset(NULL, MODULENAME, szMEntry); mir_snprintf(szMEntry, "EntryRel_%u_%u", buttonnum, from); - db_unset(NULL, PLGNAME, szMEntry); + db_unset(NULL, MODULENAME, szMEntry); mir_snprintf(szMEntry, "EntryToQMenu_%u_%u", buttonnum, from); - db_unset(NULL, PLGNAME, szMEntry); + db_unset(NULL, MODULENAME, szMEntry); mir_snprintf(szMEntry, "EntryIsServiceName_%u_%u", buttonnum, from); - db_unset(NULL, PLGNAME, szMEntry); + db_unset(NULL, MODULENAME, szMEntry); mir_snprintf(szMEntry, "EntryName_%u_%u", buttonnum, ++from); } @@ -219,7 +219,7 @@ BYTE getEntryByte(int buttonnum, int entrynum, BOOL mode) mir_snprintf(szMEntry, "RCEntryIsServiceName_%u", buttonnum); break; } - return db_get_b(NULL, PLGNAME, szMEntry, 0); + return db_get_b(NULL, MODULENAME, szMEntry, 0); } static HANDLE AddIcon(char* szIcoName) @@ -240,7 +240,7 @@ static HANDLE AddIcon(char* szIcoName) DWORD BalanceButtons(int buttonsWas, int buttonsNow) { BBButton bb = {}; - bb.pszModuleName = PLGNAME; + bb.pszModuleName = MODULENAME; while (buttonsWas > buttonsNow) { bb.dwButtonID = --buttonsWas; @@ -270,7 +270,7 @@ void InitButtonsList() ListData* ld = nullptr; if (!(pszBName = getMenuEntry(i, 0, 3))) { g_iButtonsCount = i; - db_set_b(NULL, PLGNAME, "ButtonsCount", (BYTE)g_iButtonsCount); + db_set_b(NULL, MODULENAME, "ButtonsCount", (BYTE)g_iButtonsCount); break; } @@ -352,7 +352,7 @@ wchar_t* getMenuEntry(int buttonnum, int entrynum, BYTE mode) break; } - if (!db_get_ws(NULL, PLGNAME, szMEntry, &dbv)) { + if (!db_get_ws(NULL, MODULENAME, szMEntry, &dbv)) { if (mir_wstrlen(dbv.ptszVal)) buffer = mir_wstrdup(dbv.ptszVal); db_free(&dbv); @@ -374,7 +374,7 @@ int RegisterCustomButton(WPARAM, LPARAM) bbd.dwButtonID = i; bbd.dwDefPos = 320 + i; bbd.hIcon = AddIcon(iconname); - bbd.pszModuleName = PLGNAME; + bbd.pszModuleName = MODULENAME; bbd.pwszTooltip = ld->ptszButtonName; Srmm_AddButton(&bbd); } diff --git a/plugins/QuickMessages/src/main.cpp b/plugins/QuickMessages/src/main.cpp index 974abd24d0..b6de6a8e11 100644 --- a/plugins/QuickMessages/src/main.cpp +++ b/plugins/QuickMessages/src/main.cpp @@ -32,7 +32,7 @@ BOOL g_bQuickMenu = 0; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -46,9 +46,13 @@ PLUGININFOEX pluginInfo = { 0x37ed754b, 0x6cf9, 0x40ed, { 0x9e, 0xb6, 0xf, 0xef, 0x8e, 0x82, 0x24, 0x75 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -136,7 +140,7 @@ static int InputMenuPopup(WPARAM, LPARAM lParam) static int CustomButtonPressed(WPARAM, LPARAM lParam)
{
CustomButtonClickData *cbcd = (CustomButtonClickData *)lParam;
- if (mir_strcmp(cbcd->pszModule, PLGNAME))
+ if (mir_strcmp(cbcd->pszModule, MODULENAME))
return 0;
if (!ButtonsList[cbcd->dwButtonId])
@@ -266,10 +270,10 @@ static int PluginInit(WPARAM, LPARAM) HookTemporaryEvent(ME_MSG_TOOLBARLOADED, RegisterCustomButton);
- g_bRClickAuto = db_get_b(NULL, PLGNAME, "RClickAuto", 0);
- g_bLClickAuto = db_get_b(NULL, PLGNAME, "LClickAuto", 0);
- g_iButtonsCount = db_get_b(NULL, PLGNAME, "ButtonsCount", 0);
- g_bQuickMenu = db_get_b(NULL, PLGNAME, "QuickMenu", 1);
+ g_bRClickAuto = db_get_b(NULL, MODULENAME, "RClickAuto", 0);
+ g_bLClickAuto = db_get_b(NULL, MODULENAME, "LClickAuto", 0);
+ g_iButtonsCount = db_get_b(NULL, MODULENAME, "ButtonsCount", 0);
+ g_bQuickMenu = db_get_b(NULL, MODULENAME, "QuickMenu", 1);
InitButtonsList();
@@ -279,7 +283,7 @@ static int PluginInit(WPARAM, LPARAM) extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
HookEvent(ME_SYSTEM_MODULESLOADED, PluginInit);
HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown);
diff --git a/plugins/QuickMessages/src/options.cpp b/plugins/QuickMessages/src/options.cpp index 22da0bf26b..a298bba934 100644 --- a/plugins/QuickMessages/src/options.cpp +++ b/plugins/QuickMessages/src/options.cpp @@ -249,25 +249,25 @@ void SaveMenuTree() if (ld->ptszQValue) {
mir_snprintf(szMEntry, "ButtonValue_%u", iBl);
- db_set_ws(NULL, PLGNAME, szMEntry, ld->ptszQValue);
+ db_set_ws(NULL, MODULENAME, szMEntry, ld->ptszQValue);
}
if (((ld->dwOPFlags & QMF_NEW) || (ld->dwOPFlags & QMF_RENAMED) || bDeleted)) {
BBButton bb = {};
- bb.pszModuleName = PLGNAME;
+ bb.pszModuleName = MODULENAME;
bb.dwButtonID = iBl;
bb.pwszTooltip = ld->ptszButtonName;
Srmm_ModifyButton(&bb);
}
mir_snprintf(szMEntry, "ButtonName_%u", iBl);
- db_set_ws(NULL, PLGNAME, szMEntry, ld->ptszButtonName);
+ db_set_ws(NULL, MODULENAME, szMEntry, ld->ptszButtonName);
ld->dwOPFlags = 0;
ld->dwPos = iBl;
ld->bIsServName = ld->bIsOpServName;
mir_snprintf(szMEntry, "RCEntryIsServiceName_%u", iBl);
- db_set_b(NULL, PLGNAME, szMEntry, ld->bIsServName);
+ db_set_b(NULL, MODULENAME, szMEntry, ld->bIsServName);
bDeleted = FALSE;
@@ -314,7 +314,7 @@ void SaveMenuTree() iBl++;
}
- db_set_b(NULL, PLGNAME, "ButtonsCount", (BYTE)g_iButtonsCount);
+ db_set_b(NULL, MODULENAME, "ButtonsCount", (BYTE)g_iButtonsCount);
}
void RestoreModuleData()
@@ -504,7 +504,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) g_opHdlg = hdlg;
bOptionsInit = TRUE;
TranslateDialogDefault(hdlg);
- if (g_iButtonsCount != db_get_b(NULL, PLGNAME, "ButtonsCount", 0)) {
+ if (g_iButtonsCount != db_get_b(NULL, MODULENAME, "ButtonsCount", 0)) {
LOGFONT logFont;
HFONT hFont;
bNeedRestart = TRUE;
@@ -553,9 +553,9 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) EnableWindow(GetDlgItem(hdlg, IDC_MENUVALUE), FALSE);
EnableWindow(GetDlgItem(hdlg, IDC_INQMENU), FALSE);
EnableWindow(GetDlgItem(hdlg, IDC_ISSERVNAME), FALSE);
- CheckDlgButton(hdlg, IDC_RAUTOSEND, (g_bRClickAuto = db_get_b(NULL, PLGNAME, "RClickAuto", 0)) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hdlg, IDC_LAUTOSEND, (g_bLClickAuto = db_get_b(NULL, PLGNAME, "LClickAuto", 0)) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hdlg, IDC_ENABLEQUICKMENU, (g_bQuickMenu = db_get_b(NULL, PLGNAME, "QuickMenu", 1)) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hdlg, IDC_RAUTOSEND, (g_bRClickAuto = db_get_b(NULL, MODULENAME, "RClickAuto", 0)) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hdlg, IDC_LAUTOSEND, (g_bLClickAuto = db_get_b(NULL, MODULENAME, "LClickAuto", 0)) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hdlg, IDC_ENABLEQUICKMENU, (g_bQuickMenu = db_get_b(NULL, MODULENAME, "QuickMenu", 1)) ? BST_CHECKED : BST_UNCHECKED);
bOptionsInit = FALSE;
}break;
@@ -694,9 +694,9 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) SetMenuEntryProperties(hdlg);
SaveMenuTree();
}
- db_set_b(NULL, PLGNAME, "RClickAuto", (BYTE)(g_bRClickAuto = IsDlgButtonChecked(hdlg, IDC_RAUTOSEND)));
- db_set_b(NULL, PLGNAME, "LClickAuto", (BYTE)(g_bLClickAuto = IsDlgButtonChecked(hdlg, IDC_LAUTOSEND)));
- db_set_b(NULL, PLGNAME, "QuickMenu", (BYTE)(g_bQuickMenu = IsDlgButtonChecked(hdlg, IDC_ENABLEQUICKMENU)));
+ db_set_b(NULL, MODULENAME, "RClickAuto", (BYTE)(g_bRClickAuto = IsDlgButtonChecked(hdlg, IDC_RAUTOSEND)));
+ db_set_b(NULL, MODULENAME, "LClickAuto", (BYTE)(g_bLClickAuto = IsDlgButtonChecked(hdlg, IDC_LAUTOSEND)));
+ db_set_b(NULL, MODULENAME, "QuickMenu", (BYTE)(g_bQuickMenu = IsDlgButtonChecked(hdlg, IDC_ENABLEQUICKMENU)));
return 1;
}
else if (((LPNMHDR)lparam)->code == PSN_RESET) {
diff --git a/plugins/QuickMessages/src/stdafx.h b/plugins/QuickMessages/src/stdafx.h index f41f46e448..278bea3676 100644 --- a/plugins/QuickMessages/src/stdafx.h +++ b/plugins/QuickMessages/src/stdafx.h @@ -41,13 +41,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "version.h"
#include "Utils.h"
-#define PLGNAME "QuickMessages"
+#define MODULENAME "QuickMessages"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(PLGNAME)
- {}
+ CMPlugin();
};
extern HANDLE hIcolib;
diff --git a/plugins/QuickReplies/src/events.cpp b/plugins/QuickReplies/src/events.cpp index efb7cab324..14488e58ab 100644 --- a/plugins/QuickReplies/src/events.cpp +++ b/plugins/QuickReplies/src/events.cpp @@ -37,7 +37,7 @@ int OnModulesLoaded(WPARAM, LPARAM) char buttonNameTranslated[32], buttonName[32];
mir_snprintf(buttonNameTranslated, "%s %x", Translate("Button"), iNumber + 1);
- mir_snprintf(buttonName, MODULE" %x", iNumber + 1);
+ mir_snprintf(buttonName, MODULENAME" %x", iNumber + 1);
BBButton bbd = {};
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON;
@@ -55,7 +55,7 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) CustomButtonClickData *cbcd = (CustomButtonClickData *)lParam;
char buttonName[32];
- mir_snprintf(buttonName, MODULE" %x", iNumber + 1);
+ mir_snprintf(buttonName, MODULENAME" %x", iNumber + 1);
if (mir_strcmp(cbcd->pszModule, buttonName))
return 0;
@@ -64,7 +64,7 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) char key[64];
mir_snprintf(key, "RepliesCount_%x", iNumber);
- int count = db_get_w(NULL, MODULE, key, 0);
+ int count = db_get_w(NULL, MODULENAME, key, 0);
if (count == 0 || cbcd->flags & BBCF_RIGHTBUTTON) {
mir_snprintf(buttonName, "%s %x", Translate("Button"), iNumber + 1);
@@ -77,7 +77,7 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) LIST<wchar_t> replyList(1);
for (int i = 0; i < count; i++) {
mir_snprintf(key, "Reply_%x_%x", iNumber, i);
- ptrW value(db_get_wsa(NULL, MODULE, key));
+ ptrW value(db_get_wsa(NULL, MODULENAME, key));
if (value == nullptr)
replyList.insert(mir_wstrdup(L""));
else
@@ -95,7 +95,7 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) CallService(MS_MSG_SENDMESSAGEW, cbcd->hContact, (LPARAM)replyList[index - 1]);
mir_snprintf(key, "ImmediatelySend_%x", iNumber);
- if (db_get_b(NULL, MODULE, key, 1) || cbcd->flags & BBCF_CONTROLPRESSED)
+ if (db_get_b(NULL, MODULENAME, key, 1) || cbcd->flags & BBCF_CONTROLPRESSED)
SendMessage(cbcd->hwndFrom, WM_COMMAND, IDOK, 0);
}
}
diff --git a/plugins/QuickReplies/src/options.cpp b/plugins/QuickReplies/src/options.cpp index 46abcd6ba6..70dc1fb2ca 100644 --- a/plugins/QuickReplies/src/options.cpp +++ b/plugins/QuickReplies/src/options.cpp @@ -69,14 +69,14 @@ INT_PTR CALLBACK DlgProcOptionsPage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR mir_subclassWindow(GetDlgItem(hwndDlg, IDC_REPLIES), MessageEditSubclassProc);
mir_snprintf(key, "ImmediatelySend_%x", iNumber);
- CheckDlgButton(hwndDlg, IDC_IMMEDIATELY, db_get_w(NULL, MODULE, key, 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_IMMEDIATELY, db_get_w(NULL, MODULENAME, key, 1) ? BST_CHECKED : BST_UNCHECKED);
mir_snprintf(key, "RepliesCount_%x", iNumber);
- count = db_get_w(NULL, MODULE, key, 0);
+ count = db_get_w(NULL, MODULENAME, key, 0);
for (int i = 0; i < count; i++) {
mir_snprintf(key, "Reply_%x_%x", iNumber, i);
- wchar_t *value = db_get_wsa(NULL, MODULE, key);
+ wchar_t *value = db_get_wsa(NULL, MODULENAME, key);
if (value) {
replies.Append(value);
replies.Append(L"\r\n");
@@ -113,11 +113,11 @@ INT_PTR CALLBACK DlgProcOptionsPage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR wchar_t *tszReplies;
mir_snprintf(key, "RepliesCount_%x", iNumber);
- count = db_get_b(NULL, MODULE, key, 0);
+ count = db_get_b(NULL, MODULENAME, key, 0);
for (int i = 0; i < count; i++) {
mir_snprintf(key, "Reply_%x_%x", iNumber, i);
- db_unset(NULL, MODULE, key);
+ db_unset(NULL, MODULENAME, key);
}
int length = SendDlgItemMessage(hwndDlg, IDC_REPLIES, WM_GETTEXTLENGTH, 0, 0);
@@ -133,17 +133,17 @@ INT_PTR CALLBACK DlgProcOptionsPage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR int pos = -1, prev = 0;
while ((pos = replies.Find(L"\r\n", prev)) != -1) {
mir_snprintf(key, "Reply_%x_%x", iNumber, count++);
- db_set_ws(NULL, MODULE, key, replies.Mid(prev, pos - prev).GetBuffer());
+ db_set_ws(NULL, MODULENAME, key, replies.Mid(prev, pos - prev).GetBuffer());
prev = pos + 2;
}
}
mir_free(tszReplies);
mir_snprintf(key, "RepliesCount_%x", iNumber);
- db_set_w(NULL, MODULE, key, count);
+ db_set_w(NULL, MODULENAME, key, count);
mir_snprintf(key, "ImmediatelySend_%x", iNumber);
- db_set_b(NULL, MODULE, key, IsDlgButtonChecked(hwndDlg, IDC_IMMEDIATELY));
+ db_set_b(NULL, MODULENAME, key, IsDlgButtonChecked(hwndDlg, IDC_IMMEDIATELY));
return TRUE;
}
diff --git a/plugins/QuickReplies/src/quickreplies.cpp b/plugins/QuickReplies/src/quickreplies.cpp index 22754bf120..d3bfe12faa 100644 --- a/plugins/QuickReplies/src/quickreplies.cpp +++ b/plugins/QuickReplies/src/quickreplies.cpp @@ -38,6 +38,10 @@ PLUGININFOEX pluginInfoEx = {0xa6a031b6, 0xd32f, 0x4842, {0x98, 0xc6, 0xec, 0x71, 0x6c, 0x57, 0x6b, 0x77}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
diff --git a/plugins/QuickReplies/src/stdafx.h b/plugins/QuickReplies/src/stdafx.h index f56d5845d1..821c91bab3 100644 --- a/plugins/QuickReplies/src/stdafx.h +++ b/plugins/QuickReplies/src/stdafx.h @@ -35,16 +35,14 @@ Boston, MA 02111-1307, USA. #include "version.h"
#include "resource.h"
-#define MODULE "QuickReplies"
+#define MODULENAME "QuickReplies"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE)
- {}
+ CMPlugin();
};
-#define MS_QUICKREPLIES_SERVICE MODULE"/Service"
+#define MS_QUICKREPLIES_SERVICE MODULENAME"/Service"
extern int iNumber;
diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp index 5d791bee55..9b7b3ffafc 100644 --- a/plugins/Quotes/src/Forex.cpp +++ b/plugins/Quotes/src/Forex.cpp @@ -3,7 +3,9 @@ #include "stdafx.h"
+CMPlugin g_plugin;
int &hLangpack(g_plugin.m_hLang);
+
HANDLE g_hEventWorkThreadStop;
//int g_nStatus = ID_STATUS_OFFLINE;
bool g_bAutoUpdate = true;
@@ -277,15 +279,11 @@ inline int Quotes_UnhookEvent(HANDLE h) /////////////////////////////////////////////////////////////////////////////////////////
-CMPlugin g_plugin;
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
EXTERN_C __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST };
/////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX Global_pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -299,16 +297,23 @@ PLUGININFOEX Global_pluginInfo = { 0xe882056d, 0xd1d, 0x4131, { 0x9a, 0x98, 0x40, 0x4c, 0xba, 0xea, 0x6a, 0x9c } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(QUOTES_PROTOCOL_NAME, pluginInfoEx)
+{
+ RegisterProtocol(PROTOTYPE_VIRTUAL);
+ SetUniqueId(DB_STR_QUOTE_SYMBOL);
+}
+
EXTERN_C __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &Global_pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
EXTERN_C int __declspec(dllexport) Load(void)
{
- mir_getLP(&Global_pluginInfo);
+ mir_getLP(&pluginInfoEx);
if (false == CModuleInfo::Verify())
return 1;
diff --git a/plugins/Quotes/src/stdafx.h b/plugins/Quotes/src/stdafx.h index ea4fed341e..b8fb295aaa 100644 --- a/plugins/Quotes/src/stdafx.h +++ b/plugins/Quotes/src/stdafx.h @@ -118,10 +118,5 @@ inline tstring quotes_a2t(const char* s) struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(QUOTES_PROTOCOL_NAME)
- {
- RegisterProtocol(PROTOTYPE_VIRTUAL);
- SetUniqueId(DB_STR_QUOTE_SYMBOL);
- }
+ CMPlugin();
};
diff --git a/plugins/Rate/src/main.cpp b/plugins/Rate/src/main.cpp index 9380b09e68..80eec3b6c8 100644 --- a/plugins/Rate/src/main.cpp +++ b/plugins/Rate/src/main.cpp @@ -39,9 +39,7 @@ static HANDLE hExtraIcon = nullptr; struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {}
+ CMPlugin();
}
g_plugin;
@@ -49,7 +47,7 @@ int &hLangpack(g_plugin.m_hLang); ///////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -63,10 +61,13 @@ PLUGININFOEX pluginInfo = {0x45230488, 0x977b, 0x405b, {0x85, 0x6d, 0xea, 0x27, 0x6d, 0x70, 0x83, 0xb7}}
};
-// плагининфо
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
///////////////////////////////////////////////////////////////////////////////
@@ -120,7 +121,7 @@ int onContactSettingChanged(WPARAM hContact, LPARAM lParam) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged);
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index ed1c717a54..a5d6071808 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -27,7 +27,7 @@ static IconItem iconList[] = /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -41,9 +41,13 @@ PLUGININFOEX pluginInfo = {0x0e5f3b9d, 0xebcd, 0x44d7, {0x93, 0x74, 0xd8, 0xe5, 0xd8, 0x8d, 0xf4, 0xe3}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -548,7 +552,7 @@ static INT_PTR ToggleIgnore(WPARAM hContact, LPARAM) extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
pci = Chat_GetInterface();
diff --git a/plugins/RecentContacts/src/stdafx.h b/plugins/RecentContacts/src/stdafx.h index e52935fc47..785fe4bb0f 100644 --- a/plugins/RecentContacts/src/stdafx.h +++ b/plugins/RecentContacts/src/stdafx.h @@ -50,9 +50,7 @@ void wfree(char **Data); struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {}
+ CMPlugin();
};
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp index e6c192d0eb..17532ec465 100644 --- a/plugins/RemovePersonalSettings/src/rps.cpp +++ b/plugins/RemovePersonalSettings/src/rps.cpp @@ -30,9 +30,7 @@ Based on work by nullbie struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(nullptr)
- {}
+ CMPlugin();
}
g_plugin;
@@ -43,7 +41,7 @@ char gMirandaDir[MAX_PATH]; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo = {
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -56,9 +54,13 @@ PLUGININFOEX pluginInfo = { { 0x60e94b84, 0xa799, 0x4021, { 0x94, 0x49, 0x5b, 0x83, 0x8f, 0xc0, 0x6a, 0x7c } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(nullptr, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -592,7 +594,7 @@ static INT_PTR RemoveAllService(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load()
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
CMenuItem mi;
SET_UID(mi, 0x2f9f21df, 0xf33c, 0x4640, 0xb9, 0x63, 0xd3, 0x26, 0x8a, 0xb8, 0xb1, 0xf0);
diff --git a/plugins/Restart/src/restart.cpp b/plugins/Restart/src/restart.cpp index 0616cf01d6..231df9c324 100644 --- a/plugins/Restart/src/restart.cpp +++ b/plugins/Restart/src/restart.cpp @@ -2,9 +2,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(nullptr)
- {}
+ CMPlugin();
}
g_plugin;
@@ -13,7 +11,7 @@ HANDLE hRestartMe; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo={
+PLUGININFOEX pluginInfoEx={
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -26,9 +24,13 @@ PLUGININFOEX pluginInfo={ {0x61bedf3a, 0xcc2, 0x41a3, {0xb9, 0x80, 0xbb, 0x93, 0x93, 0x36, 0x89, 0x35}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(nullptr, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -46,7 +48,7 @@ static IconItem iconList[] = extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP( &pluginInfo );
+ mir_getLP(&pluginInfoEx);
// IcoLib support
g_plugin.registerIcon(LPGEN("Restart Plugin"), iconList);
diff --git a/plugins/SMS/src/SMSConstans.h b/plugins/SMS/src/SMSConstans.h index ba2a7fc19f..fb40a680b2 100644 --- a/plugins/SMS/src/SMSConstans.h +++ b/plugins/SMS/src/SMSConstans.h @@ -1,10 +1,10 @@ #if !defined(AFX_SMS_CONSTANS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
#define AFX_SMS_CONSTANS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
-#define PROTOCOL_NAMEA "SMSPlugin"
+#define MODULENAME "SMSPlugin"
#define PROTOCOL_NAMEW L"SMSPlugin"
-#define PROTOCOL_NAME_LEN (sizeof(PROTOCOL_NAMEA)-1)
-#define PROTOCOL_NAME_SIZE sizeof(PROTOCOL_NAMEA)
+#define PROTOCOL_NAME_LEN (sizeof(MODULENAME)-1)
+#define PROTOCOL_NAME_SIZE sizeof(MODULENAME)
#define PROTOCOL_DISPLAY_NAME_ORIG "SMS"
#define TIMEOUT_MSGSEND 60000 // send sms timeout
diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp index 1543d4bb77..153f70b92a 100644 --- a/plugins/SMS/src/SMS_svc.cpp +++ b/plugins/SMS/src/SMS_svc.cpp @@ -4,7 +4,7 @@ int LoadServices(void) {
char szServiceFunction[MAX_PATH], *pszServiceFunctionName;
- memcpy(szServiceFunction, PROTOCOL_NAMEA, PROTOCOL_NAME_SIZE);
+ memcpy(szServiceFunction, MODULENAME, PROTOCOL_NAME_SIZE);
pszServiceFunctionName = szServiceFunction + PROTOCOL_NAME_LEN;
// Service creation
@@ -25,7 +25,7 @@ int LoadModules(void) HookEvent(ME_PROTO_ACCLISTCHANGED, RefreshAccountList);
char szServiceFunction[MAX_PATH];
- mir_snprintf(szServiceFunction, "%s%s", PROTOCOL_NAMEA, SMS_SEND);
+ mir_snprintf(szServiceFunction, "%s%s", MODULENAME, SMS_SEND);
CMenuItem mi;
diff --git a/plugins/SMS/src/functions.cpp b/plugins/SMS/src/functions.cpp index a5cee92a75..1b26639ae9 100644 --- a/plugins/SMS/src/functions.cpp +++ b/plugins/SMS/src/functions.cpp @@ -33,9 +33,9 @@ LPSTR GetModuleName(MCONTACT hContact) if (hContact) {
lpszRet = GetContactProto(hContact);
if (lpszRet == nullptr)
- lpszRet = PROTOCOL_NAMEA;
+ lpszRet = MODULENAME;
}
- else lpszRet = PROTOCOL_NAMEA;
+ else lpszRet = MODULENAME;
return lpszRet;
}
diff --git a/plugins/SMS/src/main.cpp b/plugins/SMS/src/main.cpp index 196b53ba3a..12691da51f 100644 --- a/plugins/SMS/src/main.cpp +++ b/plugins/SMS/src/main.cpp @@ -35,7 +35,7 @@ SMS_SETTINGS ssSMSSettings; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -49,9 +49,13 @@ PLUGININFOEX pluginInfo = {0xcf97fd5d, 0xb911, 0x47a8, {0xaf, 0x3, 0xd2, 0x19, 0x68, 0xb5, 0xb8, 0x94}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -117,7 +121,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
HookEvent(ME_SYSTEM_MODULESLOADED,OnModulesLoaded);
diff --git a/plugins/SMS/src/receive.cpp b/plugins/SMS/src/receive.cpp index 71f2d052a5..b446b1b437 100644 --- a/plugins/SMS/src/receive.cpp +++ b/plugins/SMS/src/receive.cpp @@ -217,7 +217,7 @@ int handleNewMessage(WPARAM hContact, LPARAM hDbEvent) dbei.pBlob = (PBYTE)MEMALLOC(dbei.cbBlob);
if (!dbei.pBlob)
return 0;
- memcpy(szServiceFunction, PROTOCOL_NAMEA, PROTOCOL_NAME_SIZE);
+ memcpy(szServiceFunction, MODULENAME, PROTOCOL_NAME_SIZE);
pszServiceFunctionName = szServiceFunction + PROTOCOL_NAME_LEN;
if (db_event_get(hDbEvent, &dbei) == 0)
diff --git a/plugins/SMS/src/recvdlg.cpp b/plugins/SMS/src/recvdlg.cpp index 1ec5d5bbc5..eb4ad3ace6 100644 --- a/plugins/SMS/src/recvdlg.cpp +++ b/plugins/SMS/src/recvdlg.cpp @@ -86,7 +86,7 @@ INT_PTR CALLBACK RecvSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA }
// def pos
- if (Utils_RestoreWindowPosition(hWndDlg, (DB_SMS_GetByte(NULL, "SavePerContact", 0) ? prswdWindowData->hContact : NULL), PROTOCOL_NAMEA, "recv"))
+ if (Utils_RestoreWindowPosition(hWndDlg, (DB_SMS_GetByte(NULL, "SavePerContact", 0) ? prswdWindowData->hContact : NULL), MODULENAME, "recv"))
SetWindowPos(hWndDlg, nullptr, 200, 200, 400, 350, SWP_NOZORDER);
InvalidateRect(GetDlgItem(hWndDlg, IDC_MESSAGE), nullptr, FALSE);
@@ -235,7 +235,7 @@ void RecvSMSWindowRemove(HWND hWndDlg) RECV_SMS_WINDOW_DATA *prswdWindowData = GET_WINDOW_DATA(hWndDlg);
if (prswdWindowData) {
- Utils_SaveWindowPosition(hWndDlg, (DB_SMS_GetByte(NULL, "SavePerContact", 0) ? prswdWindowData->hContact : NULL), PROTOCOL_NAMEA, "recv");
+ Utils_SaveWindowPosition(hWndDlg, (DB_SMS_GetByte(NULL, "SavePerContact", 0) ? prswdWindowData->hContact : NULL), MODULENAME, "recv");
ListMTLock(&ssSMSSettings.lmtRecvSMSWindowsListMT);
ListMTItemDelete(&ssSMSSettings.lmtRecvSMSWindowsListMT, &prswdWindowData->lmtListMTItem);
diff --git a/plugins/SMS/src/senddlg.cpp b/plugins/SMS/src/senddlg.cpp index db9051097e..4b5dbe0cb7 100644 --- a/plugins/SMS/src/senddlg.cpp +++ b/plugins/SMS/src/senddlg.cpp @@ -158,7 +158,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA SetDlgItemText(hWndDlg, IDC_COUNT, tszSign);
}
- if (Utils_RestoreWindowPosition(hWndDlg, (DB_SMS_GetByte(NULL, "SavePerContact", 0) ? psswdWindowData->hMyContact : NULL), PROTOCOL_NAMEA, "send")) {// def pos
+ if (Utils_RestoreWindowPosition(hWndDlg, (DB_SMS_GetByte(NULL, "SavePerContact", 0) ? psswdWindowData->hMyContact : NULL), MODULENAME, "send")) {// def pos
SetWindowPos(hWndDlg, nullptr, 200, 200, 400, 350, SWP_NOZORDER);
}
InvalidateRect(GetDlgItem(hWndDlg, IDC_MESSAGE), nullptr, FALSE);
@@ -580,7 +580,7 @@ void SendSMSWindowRemove(HWND hWndDlg) if (psswdWindowData) {
DB_SMS_SetDword(NULL, "LastProto", SendDlgItemMessage(hWndDlg, IDC_ACCOUNTS, CB_GETCURSEL, 0, 0));
SendSMSWindowMultipleSet(hWndDlg, FALSE);
- Utils_SaveWindowPosition(hWndDlg, (DB_SMS_GetByte(NULL, "SavePerContact", 0) ? psswdWindowData->hMyContact : NULL), PROTOCOL_NAMEA, "send");
+ Utils_SaveWindowPosition(hWndDlg, (DB_SMS_GetByte(NULL, "SavePerContact", 0) ? psswdWindowData->hMyContact : NULL), MODULENAME, "send");
ListMTLock(&ssSMSSettings.lmtSendSMSWindowsListMT);
ListMTItemDelete(&ssSMSSettings.lmtSendSMSWindowsListMT, &psswdWindowData->lmtListMTItem);
diff --git a/plugins/SMS/src/stdafx.h b/plugins/SMS/src/stdafx.h index e99ea83b45..e5c66ce515 100644 --- a/plugins/SMS/src/stdafx.h +++ b/plugins/SMS/src/stdafx.h @@ -33,9 +33,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(PROTOCOL_NAMEA)
- {}
+ CMPlugin();
};
// структура содержащая информацию по построению меню или расширенных иконок
@@ -74,17 +72,17 @@ extern SMS_SETTINGS ssSMSSettings; #define GET_DLG_ITEM_TEXT_LENGTH(hDlg,nIDDlgItem) SendDlgItemMessage(hDlg,nIDDlgItem,WM_GETTEXTLENGTH,NULL,NULL)
#define GET_CURRENT_COMBO_DATA(hWndDlg,ControlID) SendDlgItemMessage(hWndDlg,ControlID,CB_GETITEMDATA,SendDlgItemMessage(hWndDlg,ControlID,CB_GETCURSEL,0,0),0)
-#define DB_SMS_DeleteValue(Contact,valueName) db_unset(Contact,PROTOCOL_NAMEA,valueName)
-#define DB_SMS_GetDword(Contact,valueName,parDefltValue) db_get_dw(Contact,PROTOCOL_NAMEA,valueName,parDefltValue)
-#define DB_SMS_SetDword(Contact,valueName,parValue) db_set_dw(Contact,PROTOCOL_NAMEA,valueName,parValue)
-#define DB_SMS_GetWord(Contact,valueName,parDefltValue) db_get_w(Contact,PROTOCOL_NAMEA,valueName,parDefltValue)
-#define DB_SMS_SetWord(Contact,valueName,parValue) db_set_w(Contact,PROTOCOL_NAMEA,valueName,parValue)
-#define DB_SMS_GetByte(Contact,valueName,parDefltValue) db_get_b(Contact,PROTOCOL_NAMEA,valueName,parDefltValue)
-#define DB_SMS_SetByte(Contact,valueName,parValue) db_set_b(Contact,PROTOCOL_NAMEA,valueName,parValue)
+#define DB_SMS_DeleteValue(Contact,valueName) db_unset(Contact,MODULENAME,valueName)
+#define DB_SMS_GetDword(Contact,valueName,parDefltValue) db_get_dw(Contact,MODULENAME,valueName,parDefltValue)
+#define DB_SMS_SetDword(Contact,valueName,parValue) db_set_dw(Contact,MODULENAME,valueName,parValue)
+#define DB_SMS_GetWord(Contact,valueName,parDefltValue) db_get_w(Contact,MODULENAME,valueName,parDefltValue)
+#define DB_SMS_SetWord(Contact,valueName,parValue) db_set_w(Contact,MODULENAME,valueName,parValue)
+#define DB_SMS_GetByte(Contact,valueName,parDefltValue) db_get_b(Contact,MODULENAME,valueName,parDefltValue)
+#define DB_SMS_SetByte(Contact,valueName,parValue) db_set_b(Contact,MODULENAME,valueName,parValue)
BOOL DB_GetStaticStringW(MCONTACT hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpszRetBuff,size_t dwRetBuffSize,size_t *pdwRetBuffSize);
-#define DB_SMS_GetStaticStringW(Contact,ValueName,Ret,RetBuffSize,pRetBuffSize) DB_GetStaticStringW(Contact,PROTOCOL_NAMEA,ValueName,Ret,RetBuffSize,pRetBuffSize)
+#define DB_SMS_GetStaticStringW(Contact,ValueName,Ret,RetBuffSize,pRetBuffSize) DB_GetStaticStringW(Contact,MODULENAME,ValueName,Ret,RetBuffSize,pRetBuffSize)
#define DB_SetStringW(Contact,Module,valueName,parValue) db_set_ws(Contact,Module,valueName,parValue)
-#define DB_SMS_SetStringW(Contact,valueName,parValue) db_set_ws(Contact,PROTOCOL_NAMEA,valueName,parValue)
+#define DB_SMS_SetStringW(Contact,valueName,parValue) db_set_ws(Contact,MODULENAME,valueName,parValue)
LRESULT CALLBACK MessageSubclassProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
diff --git a/plugins/Scriver/src/srmm.cpp b/plugins/Scriver/src/srmm.cpp index 148f419de6..ee80705754 100644 --- a/plugins/Scriver/src/srmm.cpp +++ b/plugins/Scriver/src/srmm.cpp @@ -34,7 +34,7 @@ ITaskbarList3 *pTaskbarInterface; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo = {
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -47,9 +47,13 @@ PLUGININFOEX pluginInfo = { { 0x84636f78, 0x2057, 0x4302, { 0x8a, 0x65, 0x23, 0xa1, 0x6d, 0x46, 0x84, 0x4c } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(SRMM_MODULE, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -61,7 +65,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SRMM, extern "C" __declspec(dllexport) int Load(void)
{
// set the memory manager
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
if (IsWinVer7Plus())
diff --git a/plugins/Scriver/src/stdafx.h b/plugins/Scriver/src/stdafx.h index b300934d4f..7624a32ac3 100644 --- a/plugins/Scriver/src/stdafx.h +++ b/plugins/Scriver/src/stdafx.h @@ -118,9 +118,7 @@ int StatusIconPressed(WPARAM wParam, LPARAM lParam); struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(SRMM_MODULE)
- {}
+ CMPlugin();
};
extern GlobalMessageData g_dat;
diff --git a/plugins/SecureIM/src/commonheaders.h b/plugins/SecureIM/src/commonheaders.h index 6770296d73..75f2149272 100644 --- a/plugins/SecureIM/src/commonheaders.h +++ b/plugins/SecureIM/src/commonheaders.h @@ -64,9 +64,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {}
+ CMPlugin();
};
extern char TEMP[MAX_PATH];
diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp index e40c7ca475..30a7c11db4 100644 --- a/plugins/SecureIM/src/main.cpp +++ b/plugins/SecureIM/src/main.cpp @@ -18,23 +18,16 @@ PLUGININFOEX pluginInfoEx = { { 0x1B2A39E5, 0xE2F6, 0x494D, { 0x95, 0x8D, 0x18, 0x08, 0xFD, 0x11, 0x0D, 0xD5 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
-
-BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD dwReason, LPVOID)
-{
- if (dwReason == DLL_PROCESS_ATTACH) {
- INITCOMMONCONTROLSEX icce = { sizeof(icce), ICC_LISTVIEW_CLASSES | ICC_TAB_CLASSES };
- InitCommonControlsEx(&icce);
- }
- return TRUE;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
// basic events: onModuleLoad, onModulesLoad, onShutdown
static HGENMENU MyAddMenuItem(LPCWSTR name, int pos, LPCSTR szUid, HICON hicon, LPCSTR service, int flags = 0, WPARAM wParam = 0)
@@ -290,6 +283,9 @@ extern "C" __declspec(dllexport) int __cdecl Load(void) {
mir_getLP(&pluginInfoEx);
+ INITCOMMONCONTROLSEX icce = { sizeof(icce), ICC_LISTVIEW_CLASSES | ICC_TAB_CLASSES };
+ InitCommonControlsEx(&icce);
+
DisableThreadLibraryCalls(g_plugin.getInst());
char temp[MAX_PATH];
diff --git a/plugins/SeenPlugin/src/main.cpp b/plugins/SeenPlugin/src/main.cpp index d9ffefc59b..d1090a19ff 100644 --- a/plugins/SeenPlugin/src/main.cpp +++ b/plugins/SeenPlugin/src/main.cpp @@ -29,7 +29,7 @@ CMPlugin g_plugin; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -43,9 +43,13 @@ PLUGININFOEX pluginInfo = { 0x2d506d46, 0xc94e, 0x4ef8, { 0x85, 0x37, 0xf1, 0x12, 0x33, 0xa8, 0x03, 0x81 }}
};
-extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD)
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(S_MOD, pluginInfoEx)
+{}
+
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -95,7 +99,7 @@ static int OnShutdown(WPARAM, LPARAM) extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
g_pUserInfo = WindowList_Create();
g_hShutdownEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr);
diff --git a/plugins/SeenPlugin/src/stdafx.h b/plugins/SeenPlugin/src/stdafx.h index 9d91ee93ad..97b2b04bf3 100644 --- a/plugins/SeenPlugin/src/stdafx.h +++ b/plugins/SeenPlugin/src/stdafx.h @@ -63,9 +63,7 @@ wchar_t *any_to_Idle(MCONTACT hContact, const char *module_name, const char *set struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(S_MOD)
- {}
+ CMPlugin();
};
//#define UM_CHECKHOOKS (WM_USER+1)
diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp index 2945dce91e..356d3d5fdf 100644 --- a/plugins/SendScreenshotPlus/src/CSend.cpp +++ b/plugins/SendScreenshotPlus/src/CSend.cpp @@ -391,7 +391,7 @@ void CSend::Error(LPCTSTR pszFormat, ...) { wchar_t tszMsg[MAX_SECONDLINE]; - mir_snwprintf(tszMsg, L"%s - %s", _A2W(SZ_SENDSS), TranslateT("Error")); + mir_snwprintf(tszMsg, L"%s - %s", _A2W(MODULENAME), TranslateT("Error")); mir_free(m_ErrorTitle), m_ErrorTitle = mir_wstrdup(tszMsg); va_list vl; diff --git a/plugins/SendScreenshotPlus/src/Main.cpp b/plugins/SendScreenshotPlus/src/Main.cpp index f0c42d7093..c479946d96 100644 --- a/plugins/SendScreenshotPlus/src/Main.cpp +++ b/plugins/SendScreenshotPlus/src/Main.cpp @@ -209,7 +209,7 @@ INT_PTR service_Send2ImageShack(WPARAM wParam, LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////// -static PLUGININFOEX pluginInfo = +static PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -223,9 +223,13 @@ static PLUGININFOEX pluginInfo = { 0xed39af7c, 0xbecd, 0x404e, { 0x94, 0x99, 0x4d, 0x04, 0xf7, 0x11, 0xb9, 0xcb } } }; +CMPlugin::CMPlugin() : + PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx) +{} + extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { - return &pluginInfo; + return &pluginInfoEx; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -267,7 +271,7 @@ ATOM g_clsTargetHighlighter = 0; extern "C" __declspec(dllexport) int Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); pci = Chat_GetInterface(); /// hook events @@ -275,13 +279,13 @@ extern "C" __declspec(dllexport) int Load(void) HookEvent(ME_SYSTEM_PRESHUTDOWN, hook_SystemPreShutdown); /// icons - g_plugin.registerIcon(SZ_SENDSS, ICONS, SZ_SENDSS); - g_plugin.registerIcon(SZ_SENDSS "/" LPGEN("Buttons"), ICONS_BTN, SZ_SENDSS); + g_plugin.registerIcon(MODULENAME, ICONS, MODULENAME); + g_plugin.registerIcon(MODULENAME "/" LPGEN("Buttons"), ICONS_BTN, MODULENAME); /// services #define srv_reg(name) do{\ - m_h##name=CreateServiceFunction(SZ_SENDSS "/" #name, service_##name);\ - if(!m_h##name) MessageBoxA(NULL,Translate("Could not register Miranda service."),SZ_SENDSS "/" #name,MB_OK|MB_ICONERROR|MB_APPLMODAL);\ + m_h##name=CreateServiceFunction(MODULENAME "/" #name, service_##name);\ + if(!m_h##name) MessageBoxA(NULL,Translate("Could not register Miranda service."),MODULENAME "/" #name,MB_OK|MB_ICONERROR|MB_APPLMODAL);\ }while(0) srv_reg(OpenCaptureDialog); srv_reg(SendDesktop); diff --git a/plugins/SendScreenshotPlus/src/UMainForm.cpp b/plugins/SendScreenshotPlus/src/UMainForm.cpp index 145de2c080..398458cd85 100644 --- a/plugins/SendScreenshotPlus/src/UMainForm.cpp +++ b/plugins/SendScreenshotPlus/src/UMainForm.cpp @@ -749,54 +749,54 @@ TfrmMain::~TfrmMain() void TfrmMain::LoadOptions(void) { - DWORD rgb = db_get_dw(NULL, SZ_SENDSS, "AlphaColor", 16777215); + DWORD rgb = db_get_dw(NULL, MODULENAME, "AlphaColor", 16777215); m_AlphaColor.rgbRed = GetRValue(rgb); m_AlphaColor.rgbGreen = GetGValue(rgb); m_AlphaColor.rgbBlue = GetBValue(rgb); m_AlphaColor.rgbReserved = 0; - // m_opt_chkEmulateClick = db_get_b(NULL, SZ_SENDSS, "AutoSend", 1); - m_opt_edtQuality = db_get_b(NULL, SZ_SENDSS, "JpegQuality", 75); + // m_opt_chkEmulateClick = db_get_b(NULL, MODULENAME, "AutoSend", 1); + m_opt_edtQuality = db_get_b(NULL, MODULENAME, "JpegQuality", 75); - m_opt_tabCapture = db_get_b(NULL, SZ_SENDSS, "Capture", 0); - m_opt_chkIndirectCapture = db_get_b(NULL, SZ_SENDSS, "IndirectCapture", 0); - m_opt_chkClientArea = db_get_b(NULL, SZ_SENDSS, "ClientArea", 0); - m_opt_cboxDesktop = db_get_b(NULL, SZ_SENDSS, "Desktop", 0); + m_opt_tabCapture = db_get_b(NULL, MODULENAME, "Capture", 0); + m_opt_chkIndirectCapture = db_get_b(NULL, MODULENAME, "IndirectCapture", 0); + m_opt_chkClientArea = db_get_b(NULL, MODULENAME, "ClientArea", 0); + m_opt_cboxDesktop = db_get_b(NULL, MODULENAME, "Desktop", 0); - m_opt_chkTimed = db_get_b(NULL, SZ_SENDSS, "TimedCap", 0); - m_opt_edtTimed = db_get_b(NULL, SZ_SENDSS, "CapTime", 3); - m_opt_cboxFormat = db_get_b(NULL, SZ_SENDSS, "OutputFormat", 0); - m_opt_cboxSendBy = db_get_b(NULL, SZ_SENDSS, "SendBy", 0); + m_opt_chkTimed = db_get_b(NULL, MODULENAME, "TimedCap", 0); + m_opt_edtTimed = db_get_b(NULL, MODULENAME, "CapTime", 3); + m_opt_cboxFormat = db_get_b(NULL, MODULENAME, "OutputFormat", 0); + m_opt_cboxSendBy = db_get_b(NULL, MODULENAME, "SendBy", 0); - m_opt_btnDesc = db_get_b(NULL, SZ_SENDSS, "AutoDescription", 1); - m_opt_btnDeleteAfterSend = db_get_b(NULL, SZ_SENDSS, "DelAfterSend", 1) != 0; - m_opt_chkEditor = db_get_b(NULL, SZ_SENDSS, "Preview", 0); - m_opt_chkOpenAgain = db_get_b(NULL, SZ_SENDSS, "OpenAgain", 0); + m_opt_btnDesc = db_get_b(NULL, MODULENAME, "AutoDescription", 1); + m_opt_btnDeleteAfterSend = db_get_b(NULL, MODULENAME, "DelAfterSend", 1) != 0; + m_opt_chkEditor = db_get_b(NULL, MODULENAME, "Preview", 0); + m_opt_chkOpenAgain = db_get_b(NULL, MODULENAME, "OpenAgain", 0); } void TfrmMain::SaveOptions(void) { if (m_bOnExitSave) { - db_set_dw(NULL, SZ_SENDSS, "AlphaColor", + db_set_dw(NULL, MODULENAME, "AlphaColor", (DWORD)RGB(m_AlphaColor.rgbRed, m_AlphaColor.rgbGreen, m_AlphaColor.rgbBlue)); - // db_set_b(NULL, SZ_SENDSS, "AutoSend", m_opt_chkEmulateClick); - db_set_b(NULL, SZ_SENDSS, "JpegQuality", m_opt_edtQuality); + // db_set_b(NULL, MODULENAME, "AutoSend", m_opt_chkEmulateClick); + db_set_b(NULL, MODULENAME, "JpegQuality", m_opt_edtQuality); - db_set_b(NULL, SZ_SENDSS, "Capture", m_opt_tabCapture); - db_set_b(NULL, SZ_SENDSS, "IndirectCapture", m_opt_chkIndirectCapture); - db_set_b(NULL, SZ_SENDSS, "ClientArea", m_opt_chkClientArea); - db_set_b(NULL, SZ_SENDSS, "Desktop", m_opt_cboxDesktop); + db_set_b(NULL, MODULENAME, "Capture", m_opt_tabCapture); + db_set_b(NULL, MODULENAME, "IndirectCapture", m_opt_chkIndirectCapture); + db_set_b(NULL, MODULENAME, "ClientArea", m_opt_chkClientArea); + db_set_b(NULL, MODULENAME, "Desktop", m_opt_cboxDesktop); - db_set_b(NULL, SZ_SENDSS, "TimedCap", m_opt_chkTimed); - db_set_b(NULL, SZ_SENDSS, "CapTime", m_opt_edtTimed); - db_set_b(NULL, SZ_SENDSS, "OutputFormat", m_opt_cboxFormat); - db_set_b(NULL, SZ_SENDSS, "SendBy", m_opt_cboxSendBy); + db_set_b(NULL, MODULENAME, "TimedCap", m_opt_chkTimed); + db_set_b(NULL, MODULENAME, "CapTime", m_opt_edtTimed); + db_set_b(NULL, MODULENAME, "OutputFormat", m_opt_cboxFormat); + db_set_b(NULL, MODULENAME, "SendBy", m_opt_cboxSendBy); - db_set_b(NULL, SZ_SENDSS, "AutoDescription", m_opt_btnDesc); - db_set_b(NULL, SZ_SENDSS, "DelAfterSend", m_opt_btnDeleteAfterSend); - db_set_b(NULL, SZ_SENDSS, "Preview", m_opt_chkEditor); - db_set_b(NULL, SZ_SENDSS, "OpenAgain", m_opt_chkOpenAgain); + db_set_b(NULL, MODULENAME, "AutoDescription", m_opt_btnDesc); + db_set_b(NULL, MODULENAME, "DelAfterSend", m_opt_btnDeleteAfterSend); + db_set_b(NULL, MODULENAME, "Preview", m_opt_chkEditor); + db_set_b(NULL, MODULENAME, "OpenAgain", m_opt_chkOpenAgain); } } @@ -992,7 +992,7 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP *dib) return 1; //error // generate file name - unsigned FileNumber = db_get_dw(NULL, SZ_SENDSS, "FileNumber", 0) + 1; + unsigned FileNumber = db_get_dw(NULL, MODULENAME, "FileNumber", 0) + 1; if (FileNumber > 99999) FileNumber = 1; @@ -1080,7 +1080,7 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP *dib) if (!ret) return 1; // error - db_set_dw(NULL, SZ_SENDSS, "FileNumber", FileNumber); + db_set_dw(NULL, MODULENAME, "FileNumber", FileNumber); replaceStrW(m_pszFile, wszFileName); if (!IsWindowEnabled(GetDlgItem(m_hWnd, ID_chkDesc)) || !m_opt_btnDesc) diff --git a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp index e0a4be0666..82751abf8a 100644 --- a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp +++ b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" #define ghInst g_plugin.getInst() #define myGlobals g_myGlobals -#define MODNAME SZ_SENDSS +#define MODNAME MODULENAME #define ICO_COMMON_MAIN 0xFFFF #define ICO_DLG_DETAILS 0xFFFF diff --git a/plugins/SendScreenshotPlus/src/stdafx.h b/plugins/SendScreenshotPlus/src/stdafx.h index 6d37f1d4ae..e6517b49c0 100644 --- a/plugins/SendScreenshotPlus/src/stdafx.h +++ b/plugins/SendScreenshotPlus/src/stdafx.h @@ -116,13 +116,11 @@ typedef struct _MGLOBAL { #define ERROR_TITLE TranslateT("SendScreenshot - Error") // Miranda Database Key -#define SZ_SENDSS "SendSS" +#define MODULENAME "SendSS" struct CMPlugin : public PLUGIN<CMPlugin> { - CMPlugin() : - PLUGIN<CMPlugin>(SZ_SENDSS) - {} + CMPlugin(); }; extern ATOM g_clsTargetHighlighter; diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index 169a42ab0b..e45fc6d03a 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -61,7 +61,7 @@ IconItem iconList[] = /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -75,9 +75,13 @@ PLUGININFOEX pluginInfo = { 0x60558872, 0x2aab, 0x45aa, { 0x88, 0x8d, 0x9, 0x76, 0x91, 0xc9, 0xb6, 0x83 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -97,13 +101,13 @@ INT_PTR CALLBACK ExitDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) SavePosition(hdlg, "ExitDlg");
SaveSessionDate();
SaveSessionHandles(0, 0);
- db_set_b(NULL, MODNAME, "lastempty", 0);
+ db_set_b(NULL, MODULENAME, "lastempty", 0);
DestroyWindow(hdlg);
break;
case IDCANCEL:
SavePosition(hdlg, "ExitDlg");
- db_set_b(NULL, MODNAME, "lastempty", 1);
+ db_set_b(NULL, MODULENAME, "lastempty", 1);
DestroyWindow(hdlg);
break;
}
@@ -263,7 +267,7 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) case WM_INITDIALOG:
TranslateDialogDefault(hdlg);
{
- int iDelay = db_get_w(NULL, MODNAME, "StartupModeDelay", 1500);
+ int iDelay = db_get_w(NULL, MODULENAME, "StartupModeDelay", 1500);
if (g_hghostw == TRUE)
SetTimer(hdlg, TIMERID_LOAD, iDelay, nullptr);
else {
@@ -322,7 +326,7 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) case IDC_SESSDEL:
if (session_list_recovered[0] && ses_count == 256) {
for (int i = 0; session_list_recovered[i]; i++)
- db_set_b(session_list_recovered[i], MODNAME, "wasInLastSession", 0);
+ db_set_b(session_list_recovered[i], MODULENAME, "wasInLastSession", 0);
memset(session_list_recovered, 0, sizeof(session_list_recovered));
g_bIncompletedSave = 0;
@@ -428,7 +432,7 @@ int SaveSessionHandles(WPARAM, LPARAM lparam) }
if (lparam == 1) {
g_ses_count++;
- db_set_b(0, MODNAME, "UserSessionsCount", (BYTE)g_ses_count);
+ db_set_b(0, MODULENAME, "UserSessionsCount", (BYTE)g_ses_count);
}
return 0;
}
@@ -452,8 +456,8 @@ INT_PTR OpenSessionsManagerWindow(WPARAM, LPARAM) }
ptrW
- tszSession(db_get_wsa(NULL, MODNAME, "SessionDate_0")),
- tszUserSession(db_get_wsa(NULL, MODNAME, "UserSessionDsc_0"));
+ tszSession(db_get_wsa(NULL, MODULENAME, "SessionDate_0")),
+ tszUserSession(db_get_wsa(NULL, MODULENAME, "UserSessionDsc_0"));
if (g_bIncompletedSave || tszSession || tszUserSession) {
g_hDlg = CreateDialog(g_plugin.getInst(), MAKEINTRESOURCE(IDD_WLCMDIALOG), nullptr, LoadSessionDlgProc);
return 0;
@@ -481,9 +485,9 @@ int SaveSessionDate() char szSetting[256];
mir_snprintf(szSetting, "%s_%d", "SessionDate", 0);
- wchar_t *ptszSaveSessionDate = db_get_wsa(NULL, MODNAME, szSetting);
+ wchar_t *ptszSaveSessionDate = db_get_wsa(NULL, MODULENAME, szSetting);
- db_set_ws(NULL, MODNAME, szSetting, szSessionTime);
+ db_set_ws(NULL, MODULENAME, szSetting, szSessionTime);
mir_free(szSessionTime);
if (ptszSaveSessionDate)
@@ -495,7 +499,7 @@ int SaveSessionDate() mir_free(szDateBuf);
}
if (g_bCrashRecovery)
- db_set_b(NULL, MODNAME, "lastSaveCompleted", 1);
+ db_set_b(NULL, MODULENAME, "lastSaveCompleted", 1);
return 0;
}
@@ -506,11 +510,11 @@ int SaveUserSessionName(wchar_t *szUSessionName) char szSetting[256];
mir_snprintf(szSetting, "%s_%u", "UserSessionDsc", 0);
- wchar_t *ptszUserSessionName = db_get_wsa(NULL, MODNAME, szSetting);
+ wchar_t *ptszUserSessionName = db_get_wsa(NULL, MODULENAME, szSetting);
if (ptszUserSessionName)
ResaveSettings("UserSessionDsc", 1, 255, ptszUserSessionName);
- db_set_ws(NULL, MODNAME, szSetting, szUSessionName);
+ db_set_ws(NULL, MODULENAME, szSetting, szUSessionName);
return 0;
}
@@ -592,30 +596,30 @@ int DelUserDefSession(int ses_count) char szSessionName[256];
mir_snprintf(szSessionName, "%s_%u", "UserSessionDsc", ses_count);
- db_unset(NULL, MODNAME, szSessionName);
+ db_unset(NULL, MODULENAME, szSessionName);
mir_snprintf(szSessionName, "%s_%u", "FavUserSession", ses_count);
- db_unset(NULL, MODNAME, szSessionName);
+ db_unset(NULL, MODULENAME, szSessionName);
for (int i = ses_count + 1;; i++) {
mir_snprintf(szSessionName, "%s_%u", "UserSessionDsc", i);
- ptrW szSessionNameBuf(db_get_wsa(NULL, MODNAME, szSessionName));
+ ptrW szSessionNameBuf(db_get_wsa(NULL, MODULENAME, szSessionName));
mir_snprintf(szSessionName, "%s_%u", "UserSessionDsc", i - 1);
if (szSessionNameBuf) {
MarkUserDefSession(i - 1, IsMarkedUserDefSession(i));
- db_set_ws(NULL, MODNAME, szSessionName, szSessionNameBuf);
+ db_set_ws(NULL, MODULENAME, szSessionName, szSessionNameBuf);
}
else {
- db_unset(NULL, MODNAME, szSessionName);
+ db_unset(NULL, MODULENAME, szSessionName);
mir_snprintf(szSessionName, "%s_%u", "FavUserSession", i - 1);
- db_unset(NULL, MODNAME, szSessionName);
+ db_unset(NULL, MODULENAME, szSessionName);
break;
}
}
g_ses_count--;
- db_set_b(0, MODNAME, "UserSessionsCount", (BYTE)g_ses_count);
+ db_set_b(0, MODULENAME, "UserSessionsCount", (BYTE)g_ses_count);
return 0;
}
@@ -628,17 +632,17 @@ int DeleteAutoSession(int ses_count) char szSessionName[256];
mir_snprintf(szSessionName, "%s_%u", "SessionDate", ses_count);
- db_unset(NULL, MODNAME, szSessionName);
+ db_unset(NULL, MODULENAME, szSessionName);
for (int i = ses_count + 1;; i++) {
mir_snprintf(szSessionName, "%s_%u", "SessionDate", i);
- ptrW szSessionNameBuf(db_get_wsa(NULL, MODNAME, szSessionName));
+ ptrW szSessionNameBuf(db_get_wsa(NULL, MODULENAME, szSessionName));
mir_snprintf(szSessionName, "%s_%u", "SessionDate", i - 1);
if (szSessionNameBuf)
- db_set_ws(NULL, MODNAME, szSessionName, szSessionNameBuf);
+ db_set_ws(NULL, MODULENAME, szSessionName, szSessionNameBuf);
else {
- db_unset(NULL, MODNAME, szSessionName);
+ db_unset(NULL, MODULENAME, szSessionName);
break;
}
}
@@ -653,23 +657,23 @@ int SessionPreShutdown(WPARAM, LPARAM) if (g_hDlg) DestroyWindow(g_hDlg);
if (g_hSDlg) DestroyWindow(g_hSDlg);
- db_set_b(NULL, MODNAME, "lastSaveCompleted", 1);
+ db_set_b(NULL, MODULENAME, "lastSaveCompleted", 1);
return 0;
}
int OkToExit(WPARAM, LPARAM)
{
- int exitmode = db_get_b(NULL, MODNAME, "ShutdownMode", 2);
+ int exitmode = db_get_b(NULL, MODULENAME, "ShutdownMode", 2);
DONT = 1;
if (exitmode == 2 && session_list[0] != 0) {
SaveSessionDate();
SaveSessionHandles(0, 0);
- db_set_b(NULL, MODNAME, "lastempty", 0);
+ db_set_b(NULL, MODULENAME, "lastempty", 0);
}
else if (exitmode == 1 && session_list[0] != 0) {
DialogBox(g_plugin.getInst(), MAKEINTRESOURCE(IDD_EXDIALOG), nullptr, ExitDlgProc);
}
- else db_set_b(NULL, MODNAME, "lastempty", 1);
+ else db_set_b(NULL, MODULENAME, "lastempty", 1);
return 0;
}
@@ -679,13 +683,13 @@ static int OnSrmmWindowEvent(WPARAM, LPARAM lParam) if (MWeventdata->uType == MSG_WINDOW_EVT_OPEN) {
AddToCurSession(MWeventdata->hContact, 0);
if (g_bCrashRecovery)
- db_set_b(MWeventdata->hContact, MODNAME, "wasInLastSession", 1);
+ db_set_b(MWeventdata->hContact, MODULENAME, "wasInLastSession", 1);
}
else if (MWeventdata->uType == MSG_WINDOW_EVT_CLOSE) {
if (!DONT)
DelFromCurSession(MWeventdata->hContact, 0);
if (g_bCrashRecovery)
- db_set_b(MWeventdata->hContact, MODNAME, "wasInLastSession", 0);
+ db_set_b(MWeventdata->hContact, MODULENAME, "wasInLastSession", 0);
}
return 0;
@@ -733,7 +737,7 @@ static int CreateButtons(WPARAM, LPARAM) static void CALLBACK LaunchSessions()
{
- int startup = db_get_b(NULL, MODNAME, "StartupMode", 3);
+ int startup = db_get_b(NULL, MODULENAME, "StartupMode", 3);
if (startup == 1 || (startup == 3 && isLastTRUE == TRUE)) {
StartUp = TRUE;
g_hDlg = CreateDialog(g_plugin.getInst(), MAKEINTRESOURCE(IDD_WLCMDIALOG), nullptr, LoadSessionDlgProc);
@@ -810,7 +814,7 @@ static int PluginInit(WPARAM, LPARAM) extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
CreateServiceFunction(MS_SESSIONS_SHOWFAVORITESMENU, BuildFavMenu);
CreateServiceFunction(MS_SESSIONS_OPENMANAGER, OpenSessionsManagerWindow);
@@ -820,31 +824,31 @@ extern "C" __declspec(dllexport) int Load(void) Miranda_WaitOnHandle(LaunchSessions);
- g_ses_count = db_get_b(NULL, MODNAME, "UserSessionsCount", 0);
- g_ses_limit = db_get_b(NULL, MODNAME, "TrackCount", 10);
- g_bExclHidden = db_get_b(NULL, MODNAME, "ExclHidden", 0) != 0;
- g_bWarnOnHidden = db_get_b(NULL, MODNAME, "WarnOnHidden", 0) != 0;
- g_bOtherWarnings = db_get_b(NULL, MODNAME, "OtherWarnings", 1) != 0;
- g_bCrashRecovery = db_get_b(NULL, MODNAME, "CrashRecovery", 0) != 0;
+ g_ses_count = db_get_b(NULL, MODULENAME, "UserSessionsCount", 0);
+ g_ses_limit = db_get_b(NULL, MODULENAME, "TrackCount", 10);
+ g_bExclHidden = db_get_b(NULL, MODULENAME, "ExclHidden", 0) != 0;
+ g_bWarnOnHidden = db_get_b(NULL, MODULENAME, "WarnOnHidden", 0) != 0;
+ g_bOtherWarnings = db_get_b(NULL, MODULENAME, "OtherWarnings", 1) != 0;
+ g_bCrashRecovery = db_get_b(NULL, MODULENAME, "CrashRecovery", 0) != 0;
if (g_bCrashRecovery)
- g_bIncompletedSave = db_get_b(NULL, MODNAME, "lastSaveCompleted", 0) == 0;
+ g_bIncompletedSave = db_get_b(NULL, MODULENAME, "lastSaveCompleted", 0) == 0;
if (g_bIncompletedSave) {
int i = 0;
memset(session_list_recovered, 0, sizeof(session_list_recovered));
for (auto &hContact : Contacts())
- if (db_get_b(hContact, MODNAME, "wasInLastSession", 0))
+ if (db_get_b(hContact, MODULENAME, "wasInLastSession", 0))
session_list_recovered[i++] = hContact;
}
if (!session_list_recovered[0])
g_bIncompletedSave = false;
- db_set_b(NULL, MODNAME, "lastSaveCompleted", 0);
+ db_set_b(NULL, MODULENAME, "lastSaveCompleted", 0);
- if (!db_get_b(NULL, MODNAME, "lastempty", 1) || g_bIncompletedSave)
+ if (!db_get_b(NULL, MODULENAME, "lastempty", 1) || g_bIncompletedSave)
isLastTRUE = true;
HookEvent(ME_SYSTEM_MODULESLOADED, PluginInit);
@@ -852,7 +856,7 @@ extern "C" __declspec(dllexport) int Load(void) HookEvent(ME_SYSTEM_PRESHUTDOWN, SessionPreShutdown);
// Icons
- g_plugin.registerIcon(MODNAME, iconList);
+ g_plugin.registerIcon(MODULENAME, iconList);
return 0;
}
diff --git a/plugins/Sessions/Src/Options.cpp b/plugins/Sessions/Src/Options.cpp index b577147bbe..5ff238d1af 100644 --- a/plugins/Sessions/Src/Options.cpp +++ b/plugins/Sessions/Src/Options.cpp @@ -160,19 +160,19 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l hIcon = (bChecked = IsMarkedUserDefSession(opses_count)) ? hMarked : hNotMarked;
- SetDlgItemInt(hdlg, IDC_TRACK, g_ses_limit = db_get_b(NULL, MODNAME, "TrackCount", 10), FALSE);
+ SetDlgItemInt(hdlg, IDC_TRACK, g_ses_limit = db_get_b(NULL, MODULENAME, "TrackCount", 10), FALSE);
SendDlgItemMessage(hdlg, IDC_SPIN1, UDM_SETRANGE, 0, MAKELONG(10, 1));
SendDlgItemMessage(hdlg, IDC_SPIN1, UDM_SETPOS, 0, GetDlgItemInt(hdlg, IDC_TRACK, nullptr, FALSE));
SendDlgItemMessage(hdlg, IDC_OPCLIST, LB_RESETCONTENT, 0, 0);
- SetDlgItemInt(hdlg, IDC_STARTDELAY, db_get_w(NULL, MODNAME, "StartupModeDelay", 1500), FALSE);
- int startupmode = db_get_b(NULL, MODNAME, "StartupMode", 3);
- int exitmode = db_get_b(NULL, MODNAME, "ShutdownMode", 2);
+ SetDlgItemInt(hdlg, IDC_STARTDELAY, db_get_w(NULL, MODULENAME, "StartupModeDelay", 1500), FALSE);
+ int startupmode = db_get_b(NULL, MODULENAME, "StartupMode", 3);
+ int exitmode = db_get_b(NULL, MODULENAME, "ShutdownMode", 2);
- g_bExclHidden = db_get_b(NULL, MODNAME, "ExclHidden", 0) != 0;
- g_bWarnOnHidden = db_get_b(NULL, MODNAME, "WarnOnHidden", 0) != 0;
- g_bOtherWarnings = db_get_b(NULL, MODNAME, "OtherWarnings", 1) != 0;
- g_bCrashRecovery = db_get_b(NULL, MODNAME, "CrashRecovery", 0) != 0;
+ g_bExclHidden = db_get_b(NULL, MODULENAME, "ExclHidden", 0) != 0;
+ g_bWarnOnHidden = db_get_b(NULL, MODULENAME, "WarnOnHidden", 0) != 0;
+ g_bOtherWarnings = db_get_b(NULL, MODULENAME, "OtherWarnings", 1) != 0;
+ g_bCrashRecovery = db_get_b(NULL, MODULENAME, "CrashRecovery", 0) != 0;
CheckDlgButton(hdlg, IDC_EXCLHIDDEN, g_bExclHidden ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hdlg, IDC_LASTHIDDENWARN, g_bWarnOnHidden ? BST_CHECKED : BST_UNCHECKED);
@@ -242,30 +242,30 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l case PSN_APPLY:
{
int iDelay = GetDlgItemInt(hdlg, IDC_STARTDELAY, nullptr, FALSE);
- db_set_w(0, MODNAME, "StartupModeDelay", (WORD)iDelay);
- db_set_b(0, MODNAME, "TrackCount", (BYTE)(g_ses_limit = GetDlgItemInt(hdlg, IDC_TRACK, nullptr, FALSE)));
+ db_set_w(0, MODULENAME, "StartupModeDelay", (WORD)iDelay);
+ db_set_b(0, MODULENAME, "TrackCount", (BYTE)(g_ses_limit = GetDlgItemInt(hdlg, IDC_TRACK, nullptr, FALSE)));
if (IsDlgButtonChecked(hdlg, IDC_REXSAVE))
- db_set_b(NULL, MODNAME, "ShutdownMode", 2);
+ db_set_b(NULL, MODULENAME, "ShutdownMode", 2);
else if (IsDlgButtonChecked(hdlg, IDC_REXDSAVE))
- db_set_b(NULL, MODNAME, "ShutdownMode", 0);
+ db_set_b(NULL, MODULENAME, "ShutdownMode", 0);
else if (IsDlgButtonChecked(hdlg, IDC_REXASK))
- db_set_b(NULL, MODNAME, "ShutdownMode", 1);
+ db_set_b(NULL, MODULENAME, "ShutdownMode", 1);
if (IsDlgButtonChecked(hdlg, IDC_STARTDIALOG)) {
if (BST_UNCHECKED == IsDlgButtonChecked(hdlg, IDC_CHECKLAST))
- db_set_b(NULL, MODNAME, "StartupMode", 1);
+ db_set_b(NULL, MODULENAME, "StartupMode", 1);
else
- db_set_b(NULL, MODNAME, "StartupMode", 3);
+ db_set_b(NULL, MODULENAME, "StartupMode", 3);
}
else if (IsDlgButtonChecked(hdlg, IDC_RLOADLAST))
- db_set_b(NULL, MODNAME, "StartupMode", 2);
+ db_set_b(NULL, MODULENAME, "StartupMode", 2);
else if (IsDlgButtonChecked(hdlg, IDC_RNOTHING))
- db_set_b(NULL, MODNAME, "StartupMode", 0);
+ db_set_b(NULL, MODULENAME, "StartupMode", 0);
- db_set_b(NULL, MODNAME, "ExclHidden", (BYTE)(IsDlgButtonChecked(hdlg, IDC_EXCLHIDDEN) ? (g_bExclHidden = 1) : (g_bExclHidden = 0)));
- db_set_b(NULL, MODNAME, "WarnOnHidden", (BYTE)(IsDlgButtonChecked(hdlg, IDC_LASTHIDDENWARN) ? (g_bWarnOnHidden = 1) : (g_bWarnOnHidden = 0)));
- db_set_b(NULL, MODNAME, "OtherWarnings", (BYTE)(IsDlgButtonChecked(hdlg, IDC_WARNINGS) ? (g_bOtherWarnings = 1) : (g_bOtherWarnings = 0)));
- db_set_b(NULL, MODNAME, "CrashRecovery", (BYTE)(IsDlgButtonChecked(hdlg, IDC_CRASHRECOVERY) ? (g_bCrashRecovery = 1) : (g_bCrashRecovery = 0)));
+ db_set_b(NULL, MODULENAME, "ExclHidden", (BYTE)(IsDlgButtonChecked(hdlg, IDC_EXCLHIDDEN) ? (g_bExclHidden = 1) : (g_bExclHidden = 0)));
+ db_set_b(NULL, MODULENAME, "WarnOnHidden", (BYTE)(IsDlgButtonChecked(hdlg, IDC_LASTHIDDENWARN) ? (g_bWarnOnHidden = 1) : (g_bWarnOnHidden = 0)));
+ db_set_b(NULL, MODULENAME, "OtherWarnings", (BYTE)(IsDlgButtonChecked(hdlg, IDC_WARNINGS) ? (g_bOtherWarnings = 1) : (g_bOtherWarnings = 0)));
+ db_set_b(NULL, MODULENAME, "CrashRecovery", (BYTE)(IsDlgButtonChecked(hdlg, IDC_CRASHRECOVERY) ? (g_bCrashRecovery = 1) : (g_bCrashRecovery = 0)));
}
return 1;
@@ -493,7 +493,7 @@ int OptionsInit(WPARAM wparam, LPARAM) odp.position = 955000000;
odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.szTitle.a = MODNAME;
+ odp.szTitle.a = MODULENAME;
odp.pfnDlgProc = OptionsProc;
odp.szGroup.a = LPGEN("Message sessions");
odp.flags = ODPF_BOLDGROUPS;
diff --git a/plugins/Sessions/Src/Utils.cpp b/plugins/Sessions/Src/Utils.cpp index 0dac6aef1a..36bdeae375 100644 --- a/plugins/Sessions/Src/Utils.cpp +++ b/plugins/Sessions/Src/Utils.cpp @@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. void AddSessionMark(MCONTACT hContact, int mode, char bit)
{
if (mode == 0) {
- ptrA szValue(db_get_sa(hContact, MODNAME, "LastSessionsMarks"));
+ ptrA szValue(db_get_sa(hContact, MODULENAME, "LastSessionsMarks"));
if (szValue) {
char temp_1 = szValue[0];
for (int i = 0; i < g_ses_limit; i++) {
@@ -33,13 +33,13 @@ void AddSessionMark(MCONTACT hContact, int mode, char bit) for (int i = g_ses_limit; i < 10; i++)
szValue[i] = '0';
szValue[0] = bit;
- db_set_s(hContact, MODNAME, "LastSessionsMarks", szValue);
+ db_set_s(hContact, MODULENAME, "LastSessionsMarks", szValue);
}
else if (bit == '1')
- db_set_s(hContact, MODNAME, "LastSessionsMarks", "10000000000");
+ db_set_s(hContact, MODULENAME, "LastSessionsMarks", "10000000000");
}
else if (mode == 1) {
- ptrA szValue(db_get_sa(hContact, MODNAME, "UserSessionsMarks"));
+ ptrA szValue(db_get_sa(hContact, MODULENAME, "UserSessionsMarks"));
if (szValue) {
char *pszBuffer;
if (mir_strlen(szValue) < g_ses_count) {
@@ -56,21 +56,21 @@ void AddSessionMark(MCONTACT hContact, int mode, char bit) temp_1 = temp_2;
}
pszBuffer[0] = bit;
- db_set_s(hContact, MODNAME, "UserSessionsMarks", pszBuffer);
+ db_set_s(hContact, MODULENAME, "UserSessionsMarks", pszBuffer);
mir_free(pszBuffer);
}
else if (bit == '1')
- db_set_s(hContact, MODNAME, "UserSessionsMarks", "10000000000");
+ db_set_s(hContact, MODULENAME, "UserSessionsMarks", "10000000000");
else
- db_set_s(hContact, MODNAME, "UserSessionsMarks", "00000000000");
+ db_set_s(hContact, MODULENAME, "UserSessionsMarks", "00000000000");
}
}
void RemoveSessionMark(MCONTACT hContact, int mode, int marknum)
{
if (mode == 0) {
- ptrA szValue(db_get_sa(hContact, MODNAME, "LastSessionsMarks"));
+ ptrA szValue(db_get_sa(hContact, MODULENAME, "LastSessionsMarks"));
if (szValue) {
for (int i = marknum; i < g_ses_limit; i++)
szValue[i] = szValue[i + 1];
@@ -78,16 +78,16 @@ void RemoveSessionMark(MCONTACT hContact, int mode, int marknum) for (int i = g_ses_limit; i < 10; i++)
szValue[i] = '0';
- db_set_s(hContact, MODNAME, "LastSessionsMarks", szValue);
+ db_set_s(hContact, MODULENAME, "LastSessionsMarks", szValue);
}
}
else if (mode == 1) {
- ptrA szValue(db_get_sa(hContact, MODNAME, "UserSessionsMarks"));
+ ptrA szValue(db_get_sa(hContact, MODULENAME, "UserSessionsMarks"));
if (szValue) {
for (int i = marknum; i < g_ses_limit; i++)
szValue[i] = szValue[i + 1];
- db_set_s(hContact, MODNAME, "UserSessionsMarks", szValue);
+ db_set_s(hContact, MODULENAME, "UserSessionsMarks", szValue);
}
}
}
@@ -95,17 +95,17 @@ void RemoveSessionMark(MCONTACT hContact, int mode, int marknum) void SetSessionMark(MCONTACT hContact, int mode, char bit, unsigned int marknum)
{
if (mode == 0) {
- ptrA szValue(db_get_sa(hContact, MODNAME, "LastSessionsMarks"));
+ ptrA szValue(db_get_sa(hContact, MODULENAME, "LastSessionsMarks"));
if (szValue) {
szValue[marknum] = bit;
- db_set_s(hContact, MODNAME, "LastSessionsMarks", szValue);
+ db_set_s(hContact, MODULENAME, "LastSessionsMarks", szValue);
}
}
else if (mode == 1) {
- ptrA szValue(db_get_sa(hContact, MODNAME, "UserSessionsMarks"));
+ ptrA szValue(db_get_sa(hContact, MODULENAME, "UserSessionsMarks"));
if (szValue) {
szValue[marknum] = bit;
- db_set_s(hContact, MODNAME, "UserSessionsMarks", szValue);
+ db_set_s(hContact, MODULENAME, "UserSessionsMarks", szValue);
}
}
}
@@ -114,9 +114,9 @@ bool LoadContactsFromMask(MCONTACT hContact, int mode, int count) {
ptrA szValue;
if (mode == 0)
- szValue = db_get_sa(hContact, MODNAME, "LastSessionsMarks");
+ szValue = db_get_sa(hContact, MODULENAME, "LastSessionsMarks");
else if (mode == 1)
- szValue = db_get_sa(hContact, MODNAME, "UserSessionsMarks");
+ szValue = db_get_sa(hContact, MODULENAME, "UserSessionsMarks");
if (szValue == NULL)
return false;
@@ -130,7 +130,7 @@ void AddInSessionOrder(MCONTACT hContact, int mode, int ordernum, int writemode) mir_snprintf(szFormNumBuf, "%02u", ordernum);
if (mode == 0) {
- ptrA szValue(db_get_sa(hContact, MODNAME, "LastSessionsMarks"));
+ ptrA szValue(db_get_sa(hContact, MODULENAME, "LastSessionsMarks"));
if (szValue) {
int len = (int)mir_strlen(szValue);
if (!len)
@@ -146,15 +146,15 @@ void AddInSessionOrder(MCONTACT hContact, int mode, int ordernum, int writemode) for (int i = (g_ses_limit * 2); i < 20; i++)
temp[i] = '0';
- db_set_s(hContact, MODNAME, "LastSessionsOrder", temp);
+ db_set_s(hContact, MODULENAME, "LastSessionsOrder", temp);
}
else if (writemode == 1) {
mir_snprintf(szFormNumBuf, "%02u%s", ordernum, "000000000000000000");
- db_set_s(hContact, MODNAME, "LastSessionsOrder", szFormNumBuf);
+ db_set_s(hContact, MODULENAME, "LastSessionsOrder", szFormNumBuf);
}
}
else if (mode == 1) {
- ptrA szValue(db_get_sa(hContact, MODNAME, "UserSessionsOrder"));
+ ptrA szValue(db_get_sa(hContact, MODULENAME, "UserSessionsOrder"));
if (szValue) {
char *pszBuffer;
if (mir_strlen(szValue) < (g_ses_count * 2)) {
@@ -169,13 +169,13 @@ void AddInSessionOrder(MCONTACT hContact, int mode, int ordernum, int writemode) char *temp = (char*)_alloca(len + 1);
mir_snprintf(temp, len + 1, "%02u%s", ordernum, szValue);
- db_set_s(hContact, MODNAME, "UserSessionsOrder", temp);
+ db_set_s(hContact, MODULENAME, "UserSessionsOrder", temp);
mir_free(pszBuffer);
}
else if (writemode == 1)
- db_set_s(hContact, MODNAME, "UserSessionsOrder", szFormNumBuf);
+ db_set_s(hContact, MODULENAME, "UserSessionsOrder", szFormNumBuf);
else
- db_set_s(hContact, MODNAME, "UserSessionsOrder", "00");
+ db_set_s(hContact, MODULENAME, "UserSessionsOrder", "00");
}
}
@@ -183,14 +183,14 @@ int GetInSessionOrder(MCONTACT hContact, int mode, int count) {
char szTemp[3];
if (mode == 0) {
- ptrA szValue(db_get_sa(hContact, MODNAME, "LastSessionsOrder"));
+ ptrA szValue(db_get_sa(hContact, MODULENAME, "LastSessionsOrder"));
if (szValue) {
strncpy_s(szTemp, &szValue[count * 2], 2);
return atoi(szTemp);
}
}
else if (mode == 1) {
- ptrA szValue(db_get_sa(hContact, MODNAME, "UserSessionsOrder"));
+ ptrA szValue(db_get_sa(hContact, MODULENAME, "UserSessionsOrder"));
if (szValue) {
strncpy_s(szTemp, &szValue[count * 2], 2);
return atoi(szTemp);
@@ -205,19 +205,19 @@ void SetInSessionOrder(MCONTACT hContact, int mode, int count, unsigned int orde mir_snprintf(szTemp, "%02u", ordernum);
if (mode == 0) {
- ptrA szValue(db_get_sa(hContact, MODNAME, "LastSessionsOrder"));
+ ptrA szValue(db_get_sa(hContact, MODULENAME, "LastSessionsOrder"));
if (szValue) {
szValue[count * 2] = szTemp[0];
szValue[count * 2 + 1] = szTemp[1];
- db_set_s(hContact, MODNAME, "LastSessionsOrder", szValue);
+ db_set_s(hContact, MODULENAME, "LastSessionsOrder", szValue);
}
}
else if (mode == 1) {
- ptrA szValue(db_get_sa(hContact, MODNAME, "UserSessionsOrder"));
+ ptrA szValue(db_get_sa(hContact, MODULENAME, "UserSessionsOrder"));
if (szValue) {
szValue[count * 2] = szTemp[0];
szValue[count * 2 + 1] = szTemp[1];
- db_set_s(hContact, MODNAME, "UserSessionsOrder", szValue);
+ db_set_s(hContact, MODULENAME, "UserSessionsOrder", szValue);
}
}
}
@@ -231,8 +231,8 @@ BOOL ResaveSettings(char *szName, int iFirst, int iLimit, wchar_t *szBuffer) char szNameBuf[256];
mir_snprintf(szNameBuf, "%s_%u", szName, i);
- wchar_t *ptszTemp = db_get_wsa(NULL, MODNAME, szNameBuf);
- db_set_ws(NULL, MODNAME, szNameBuf, szBuffer);
+ wchar_t *ptszTemp = db_get_wsa(NULL, MODULENAME, szNameBuf);
+ db_set_ws(NULL, MODULENAME, szNameBuf, szBuffer);
mir_free(szBuffer);
BYTE marked = IsMarkedUserDefSession(i);
@@ -298,7 +298,7 @@ int LoadSessionToCombobox(HWND hdlg, BOOL mode, int iLimit, char* pszSetting, in for (int i = 0; i < iLimit; i++) {
mir_snprintf(szBuffer, "%s_%u", pszSetting, i);
- wchar_t *pszBuffer = db_get_wsa(NULL, MODNAME, szBuffer);
+ wchar_t *pszBuffer = db_get_wsa(NULL, MODULENAME, szBuffer);
if (pszBuffer) {
if (!IsMarkedUserDefSession(i + iFirstNum) || mode == 1) {
index = SendDlgItemMessage(hdlg, IDC_LIST, CB_ADDSTRING, 0, (LPARAM)pszBuffer);
@@ -327,7 +327,7 @@ int FillFavoritesMenu(HMENU hMenu, int iLimit) if (IsMarkedUserDefSession(i)) {
char szBuffer[256];
mir_snprintf(szBuffer, "%s_%u", "UserSessionDsc", i);
- wchar_t *pszBuffer = db_get_wsa(NULL, MODNAME, szBuffer);
+ wchar_t *pszBuffer = db_get_wsa(NULL, MODULENAME, szBuffer);
if (pszBuffer) {
AppendMenu(hMenu, MF_STRING, i + 1, pszBuffer);
iItems++;
@@ -362,14 +362,14 @@ void RenameUserDefSession(int ses_count, wchar_t* ptszNewName) {
char szSession[256];
mir_snprintf(szSession, "%s_%u", "UserSessionDsc", ses_count);
- db_set_ws(NULL, MODNAME, szSession, ptszNewName);
+ db_set_ws(NULL, MODULENAME, szSession, ptszNewName);
}
int MarkUserDefSession(int ses_count, BYTE bCheck)
{
char szSessionName[256];
mir_snprintf(szSessionName, "%s_%u", "FavUserSession", ses_count);
- db_set_b(NULL, MODNAME, szSessionName, bCheck);
+ db_set_b(NULL, MODULENAME, szSessionName, bCheck);
return 0;
}
@@ -377,7 +377,7 @@ BYTE IsMarkedUserDefSession(int ses_count) {
char szSessionName[256];
mir_snprintf(szSessionName, "%s_%u", "FavUserSession", ses_count);
- return db_get_b(NULL, MODNAME, szSessionName, 0);
+ return db_get_b(NULL, MODULENAME, szSessionName, 0);
}
void SavePosition(HWND hwnd, char *wndName)
@@ -386,17 +386,17 @@ void SavePosition(HWND hwnd, char *wndName) GetWindowRect(hwnd, &rc);
char buffer[512];
mir_snprintf(buffer, "%sPosX", wndName);
- db_set_dw(0, MODNAME, buffer, rc.left);
+ db_set_dw(0, MODULENAME, buffer, rc.left);
mir_snprintf(buffer, "%sPosY", wndName);
- db_set_dw(0, MODNAME, buffer, rc.top);
+ db_set_dw(0, MODULENAME, buffer, rc.top);
}
void LoadPosition(HWND hWnd, char *wndName)
{
char buffer[512];
mir_snprintf(buffer, "%sPosX", wndName);
- int x = db_get_dw(0, MODNAME, buffer, ((GetSystemMetrics(SM_CXSCREEN)) / 2) - 130);
+ int x = db_get_dw(0, MODULENAME, buffer, ((GetSystemMetrics(SM_CXSCREEN)) / 2) - 130);
mir_snprintf(buffer, "%sPosY", wndName);
- int y = db_get_dw(0, MODNAME, buffer, ((GetSystemMetrics(SM_CYSCREEN)) / 2) - 80);
+ int y = db_get_dw(0, MODULENAME, buffer, ((GetSystemMetrics(SM_CYSCREEN)) / 2) - 80);
SetWindowPos(hWnd, nullptr, x, y, 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOSIZE);
}
diff --git a/plugins/Sessions/Src/stdafx.h b/plugins/Sessions/Src/stdafx.h index 642ae6bc52..2a2424edbb 100644 --- a/plugins/Sessions/Src/stdafx.h +++ b/plugins/Sessions/Src/stdafx.h @@ -45,13 +45,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "version.h"
#include "Resource.h"
-#define MODNAME "Sessions"
+#define MODULENAME "Sessions"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODNAME)
- {}
+ CMPlugin();
};
extern IconItem iconList[];
diff --git a/plugins/ShellExt/src/main.cpp b/plugins/ShellExt/src/main.cpp index d928c4e914..4f3a9d19fc 100644 --- a/plugins/ShellExt/src/main.cpp +++ b/plugins/ShellExt/src/main.cpp @@ -31,6 +31,9 @@ PLUGININFOEX pluginInfoEx = { { 0x7993ab24, 0x1fda, 0x428c, { 0xa8, 0x9b, 0xbe, 0x37, 0x7a, 0x10, 0xbe, 0x3a }}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(SHLExt_Name, pluginInfoEx)
+{}
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
diff --git a/plugins/ShellExt/src/stdafx.h b/plugins/ShellExt/src/stdafx.h index 14bc44366d..edd2b9599d 100644 --- a/plugins/ShellExt/src/stdafx.h +++ b/plugins/ShellExt/src/stdafx.h @@ -45,9 +45,7 @@ HRESULT RemoveCOMRegistryEntries(); struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(SHLExt_Name)
- {}
+ CMPlugin();
};
extern bool bIsVistaPlus;
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp index 98e99e3200..af14ff2daf 100644 --- a/plugins/SimpleAR/src/Main.cpp +++ b/plugins/SimpleAR/src/Main.cpp @@ -49,6 +49,10 @@ PLUGININFOEX pluginInfoEx = { 0x46bf191f, 0x8dfb, 0x4656, { 0x88, 0xb2, 0x4c, 0x20, 0xbe, 0x4c, 0xfa, 0x44 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
@@ -58,8 +62,8 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) INT_PTR ToggleEnable(WPARAM, LPARAM)
{
- BOOL fEnabled = !db_get_b(NULL, protocolname, KEY_ENABLED, 1);
- db_set_b(NULL, protocolname, KEY_ENABLED, fEnabled);
+ BOOL fEnabled = !db_get_b(NULL, MODULENAME, KEY_ENABLED, 1);
+ db_set_b(NULL, MODULENAME, KEY_ENABLED, fEnabled);
if (fEnabled)
Menu_ModifyItem(hEnableMenu, LPGENW("Disable Auto&reply"), iconList[0].hIcolib);
@@ -70,8 +74,8 @@ INT_PTR ToggleEnable(WPARAM, LPARAM) INT_PTR Toggle(WPARAM hContact, LPARAM)
{
- BOOL on = !db_get_b(hContact, protocolname, "TurnedOn", 0);
- db_set_b(hContact, protocolname, "TurnedOn", on);
+ BOOL on = !db_get_b(hContact, MODULENAME, "TurnedOn", 0);
+ db_set_b(hContact, MODULENAME, "TurnedOn", on);
on = !on;
if (on)
@@ -83,7 +87,7 @@ INT_PTR Toggle(WPARAM hContact, LPARAM) INT OnPreBuildContactMenu(WPARAM hContact, LPARAM)
{
- BOOL on = !db_get_b(hContact, protocolname, "TurnedOn", 0);
+ BOOL on = !db_get_b(hContact, MODULENAME, "TurnedOn", 0);
if (on)
Menu_ModifyItem(hToggle, LPGENW("Turn off Autoanswer"), iconList[0].hIcolib);
else
@@ -93,12 +97,12 @@ INT OnPreBuildContactMenu(WPARAM hContact, LPARAM) INT CheckDefaults(WPARAM, LPARAM)
{
- interval = db_get_w(NULL, protocolname, KEY_REPEATINTERVAL, 300);
+ interval = db_get_w(NULL, MODULENAME, KEY_REPEATINTERVAL, 300);
- wchar_t *ptszVal = db_get_wsa(NULL, protocolname, KEY_HEADING);
+ wchar_t *ptszVal = db_get_wsa(NULL, MODULENAME, KEY_HEADING);
if (ptszVal == nullptr)
// Heading not set
- db_set_ws(NULL, protocolname, KEY_HEADING, TranslateT("Dear %user%, the owner left the following message:"));
+ db_set_ws(NULL, MODULENAME, KEY_HEADING, TranslateT("Dear %user%, the owner left the following message:"));
else
mir_free(ptszVal);
@@ -108,7 +112,7 @@ INT CheckDefaults(WPARAM, LPARAM) else {
char szStatus[6] = { 0 };
mir_snprintf(szStatus, "%d", c);
- ptszVal = db_get_wsa(NULL, protocolname, szStatus);
+ ptszVal = db_get_wsa(NULL, MODULENAME, szStatus);
if (ptszVal == nullptr) {
wchar_t *ptszDefault;
if (c < ID_STATUS_FREECHAT)
@@ -119,7 +123,7 @@ INT CheckDefaults(WPARAM, LPARAM) else
ptszDefault = nullptr;
if (ptszDefault)
- db_set_ws(NULL, protocolname, szStatus, TranslateW(ptszDefault));
+ db_set_ws(NULL, MODULENAME, szStatus, TranslateW(ptszDefault));
}
else
mir_free(ptszVal);
@@ -129,7 +133,7 @@ INT CheckDefaults(WPARAM, LPARAM) if (ServiceExists(MS_VARS_FORMATSTRING))
gbVarsServiceExist = TRUE;
- BOOL fEnabled = db_get_b(NULL, protocolname, KEY_ENABLED, 1);
+ BOOL fEnabled = db_get_b(NULL, MODULENAME, KEY_ENABLED, 1);
if (fEnabled)
Menu_ModifyItem(hEnableMenu, LPGENW("Disable Auto&reply"), iconList[0].hIcolib);
else
@@ -139,7 +143,7 @@ INT CheckDefaults(WPARAM, LPARAM) INT addEvent(WPARAM hContact, LPARAM hDBEvent)
{
- BOOL fEnabled = db_get_b(NULL, protocolname, KEY_ENABLED, 1);
+ BOOL fEnabled = db_get_b(NULL, MODULENAME, KEY_ENABLED, 1);
if (!fEnabled || !hContact || !hDBEvent)
return FALSE; /// unspecifyed error
@@ -170,12 +174,12 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) if (db_get_b(hContact, "CList", "NotOnList", 0))
return FALSE;
- if (db_get_b(hContact, protocolname, "TurnedOn", 0))
+ if (db_get_b(hContact, MODULENAME, "TurnedOn", 0))
return FALSE;
if (!(dbei.flags & DBEF_SENT)) {
- int timeBetween = time(0) - db_get_dw(hContact, protocolname, "LastReplyTS", 0);
- if (timeBetween > interval || db_get_w(hContact, protocolname, "LastStatus", 0) != status) {
+ int timeBetween = time(0) - db_get_dw(hContact, MODULENAME, "LastReplyTS", 0);
+ if (timeBetween > interval || db_get_w(hContact, MODULENAME, "LastStatus", 0) != status) {
size_t msgLen = 1;
int isQun = db_get_b(hContact, pszProto, "IsQun", 0);
if (isQun)
@@ -183,7 +187,7 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) char szStatus[6] = { 0 };
mir_snprintf(szStatus, "%d", status);
- ptszVal = db_get_wsa(NULL, protocolname, szStatus);
+ ptszVal = db_get_wsa(NULL, MODULENAME, szStatus);
if (ptszVal) {
if (*ptszVal) {
CMStringW ptszTemp;
@@ -196,7 +200,7 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) msgLen += mir_wstrlen(ptszVal);
- wchar_t *ptszHead = db_get_wsa(NULL, protocolname, KEY_HEADING);
+ wchar_t *ptszHead = db_get_wsa(NULL, MODULENAME, KEY_HEADING);
if (ptszHead != nullptr) {
ptszTemp = ptszHead;
ptszTemp.Replace(L"%user%", ptszNick);
@@ -230,8 +234,8 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) }
}
- db_set_dw(hContact, protocolname, "LastReplyTS", time(0));
- db_set_w(hContact, protocolname, "LastStatus", status);
+ db_set_dw(hContact, MODULENAME, "LastReplyTS", time(0));
+ db_set_w(hContact, MODULENAME, "LastStatus", status);
}
return 0;
}
@@ -249,21 +253,21 @@ extern "C" int __declspec(dllexport)Load(void) mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
- CreateServiceFunction(protocolname"/ToggleEnable", ToggleEnable);
- CreateServiceFunction(protocolname"/ToggleAutoanswer", Toggle);
+ CreateServiceFunction(MODULENAME"/ToggleEnable", ToggleEnable);
+ CreateServiceFunction(MODULENAME"/ToggleAutoanswer", Toggle);
CMenuItem mi;
SET_UID(mi, 0xac1c64a, 0x82ca, 0x4845, 0x86, 0x89, 0x59, 0x76, 0x12, 0x74, 0x72, 0x7b);
mi.position = 500090000;
mi.name.w = L"";
- mi.pszService = protocolname"/ToggleEnable";
+ mi.pszService = MODULENAME"/ToggleEnable";
hEnableMenu = Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0xb290cccd, 0x4ecc, 0x475e, 0x87, 0xcb, 0x51, 0xf4, 0x3b, 0xc3, 0x44, 0x9c);
mi.position = -0x7FFFFFFF;
mi.name.w = L"";
- mi.pszService = protocolname"/ToggleAutoanswer";
+ mi.pszService = MODULENAME"/ToggleAutoanswer";
hToggle = Menu_AddContactMenuItem(&mi);
//add hook
diff --git a/plugins/SimpleAR/src/Options.cpp b/plugins/SimpleAR/src/Options.cpp index e1f0f583ef..fa93906df2 100644 --- a/plugins/SimpleAR/src/Options.cpp +++ b/plugins/SimpleAR/src/Options.cpp @@ -11,11 +11,11 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara {
char tszStatus[6] = { 0 };
- CheckDlgButton(hwndDlg, IDC_ENABLEREPLIER, db_get_b(NULL, protocolname, KEY_ENABLED, 1) == 1 ? BST_CHECKED : BST_UNCHECKED);
- SetDlgItemInt(hwndDlg, IDC_INTERVAL, db_get_w(NULL, protocolname, KEY_REPEATINTERVAL, 300) / 60, FALSE);
+ CheckDlgButton(hwndDlg, IDC_ENABLEREPLIER, db_get_b(NULL, MODULENAME, KEY_ENABLED, 1) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ SetDlgItemInt(hwndDlg, IDC_INTERVAL, db_get_w(NULL, MODULENAME, KEY_REPEATINTERVAL, 300) / 60, FALSE);
DBVARIANT dbv;
- if (!db_get_ws(NULL, protocolname, KEY_HEADING, &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, KEY_HEADING, &dbv)) {
SetDlgItemText(hwndDlg, IDC_HEADING, dbv.ptszVal);
db_free(&dbv);
}
@@ -28,7 +28,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara else {
SendDlgItemMessage(hwndDlg, IDC_STATUSMODE, CB_ADDSTRING, 0, (LPARAM)pszStatus);
- if (!db_get_ws(NULL, protocolname, tszStatus, &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, tszStatus, &dbv)) {
if (c < ID_STATUS_FREECHAT)
ptszMessage[c - ID_STATUS_ONLINE - 1] = wcsdup(dbv.ptszVal);
else if (c > ID_STATUS_INVISIBLE)
@@ -80,7 +80,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara BOOL translated;
BOOL fEnabled = IsDlgButtonChecked(hwndDlg, IDC_ENABLEREPLIER) == 1;
- db_set_b(NULL, protocolname, KEY_ENABLED, (BYTE)fEnabled);
+ db_set_b(NULL, MODULENAME, KEY_ENABLED, (BYTE)fEnabled);
if (fEnabled)
Menu_ModifyItem(hEnableMenu, LPGENW("Disable Auto&reply"), iconList[0].hIcolib);
@@ -88,12 +88,12 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara Menu_ModifyItem(hEnableMenu, LPGENW("Enable Auto&reply"), iconList[1].hIcolib);
GetDlgItemText(hwndDlg, IDC_HEADING, ptszText, _countof(ptszText));
- db_set_ws(NULL, protocolname, KEY_HEADING, ptszText);
+ db_set_ws(NULL, MODULENAME, KEY_HEADING, ptszText);
INT size = GetDlgItemInt(hwndDlg, IDC_INTERVAL, &translated, FALSE);
if (translated)
interval = size * 60;
- db_set_w(NULL, protocolname, KEY_REPEATINTERVAL, interval);
+ db_set_w(NULL, MODULENAME, KEY_REPEATINTERVAL, interval);
size = SendDlgItemMessage(hwndDlg, IDC_MESSAGE, WM_GETTEXTLENGTH, 0, 0) + 1;
GetDlgItemText(hwndDlg, IDC_MESSAGE, ptszMessage[lastIndex], size);
@@ -106,11 +106,11 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara mir_snprintf(szStatus, "%d", c);
if (c<ID_STATUS_FREECHAT && ptszMessage[c - ID_STATUS_ONLINE - 1])
- db_set_ws(NULL, protocolname, szStatus, ptszMessage[c - ID_STATUS_ONLINE - 1]);
+ db_set_ws(NULL, MODULENAME, szStatus, ptszMessage[c - ID_STATUS_ONLINE - 1]);
else if (c>ID_STATUS_INVISIBLE && ptszMessage[c - ID_STATUS_ONLINE - 3])
- db_set_ws(NULL, protocolname, szStatus, ptszMessage[c - ID_STATUS_ONLINE - 3]);
+ db_set_ws(NULL, MODULENAME, szStatus, ptszMessage[c - ID_STATUS_ONLINE - 3]);
else
- db_unset(NULL, protocolname, szStatus);
+ db_unset(NULL, MODULENAME, szStatus);
}
}
return TRUE;
diff --git a/plugins/SimpleAR/src/stdafx.h b/plugins/SimpleAR/src/stdafx.h index 863bdca124..5cb8c46b34 100644 --- a/plugins/SimpleAR/src/stdafx.h +++ b/plugins/SimpleAR/src/stdafx.h @@ -16,7 +16,7 @@ #include "Resource.h"
#include "version.h"
-#define protocolname "SimpleAutoReplier" //no spaces here :)
+#define MODULENAME "SimpleAutoReplier"
#define KEY_ENABLED "Enabled"
#define KEY_HEADING "Heading"
@@ -26,9 +26,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(protocolname)
- {}
+ CMPlugin();
};
extern INT interval;
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index 26e01b7331..064180a044 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -33,7 +33,7 @@ static HANDLE *hProtoStatusMenuItem; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -47,9 +47,13 @@ PLUGININFOEX pluginInfo = { 0x768ce156, 0x34ac, 0x45a3, { 0xb5, 0x3b, 0x0, 0x83, 0xc4, 0x76, 0x15, 0xc4 }}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -1679,7 +1683,7 @@ static INT_PTR sttGetAwayMessageT(WPARAM wParam, LPARAM lParam) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
hwndSAMsgDialog = nullptr;
accounts = (PROTOACCOUNTS *)mir_alloc(sizeof(PROTOACCOUNTS));
diff --git a/plugins/SimpleStatusMsg/src/stdafx.h b/plugins/SimpleStatusMsg/src/stdafx.h index 4a0082bf49..2de8f45579 100644 --- a/plugins/SimpleStatusMsg/src/stdafx.h +++ b/plugins/SimpleStatusMsg/src/stdafx.h @@ -48,9 +48,7 @@ with this program; if not, write to the Free Software Foundation, Inc., struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {}
+ CMPlugin();
};
#include "simplestatusmsg.h"
diff --git a/plugins/SkypeStatusChange/src/main.cpp b/plugins/SkypeStatusChange/src/main.cpp index 8c76ab902c..4c927326c2 100644 --- a/plugins/SkypeStatusChange/src/main.cpp +++ b/plugins/SkypeStatusChange/src/main.cpp @@ -20,7 +20,7 @@ HANDLE g_hEventShutdown = nullptr; /////////////////////////////////////////////////////////////////////////////////////////
-static PLUGININFOEX g_pluginInfo =
+static PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -33,9 +33,13 @@ static PLUGININFOEX g_pluginInfo = { 0x2925520b, 0x6677, 0x4658, { 0x8b, 0xad, 0x56, 0x61, 0xd1, 0x3e, 0x46, 0x92 }}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &g_pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -269,7 +273,7 @@ int SSC_OnPreShutdown(WPARAM/* wParam*/, LPARAM/* lParam*/) extern "C" int __declspec(dllexport) Load()
{
- mir_getLP(&g_pluginInfo);
+ mir_getLP(&pluginInfoEx);
g_MsgIDSkypeControlAPIAttach = ::RegisterWindowMessage(L"SkypeControlAPIAttach");
g_MsgIDSkypeControlAPIDiscover = ::RegisterWindowMessage(L"SkypeControlAPIDiscover");
diff --git a/plugins/SkypeStatusChange/src/stdafx.h b/plugins/SkypeStatusChange/src/stdafx.h index d143849cc9..90dfeb1b32 100644 --- a/plugins/SkypeStatusChange/src/stdafx.h +++ b/plugins/SkypeStatusChange/src/stdafx.h @@ -19,9 +19,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {}
+ CMPlugin();
};
class COptions
diff --git a/plugins/SmileyAdd/src/main.cpp b/plugins/SmileyAdd/src/main.cpp index 44496c2994..3f7f78885e 100644 --- a/plugins/SmileyAdd/src/main.cpp +++ b/plugins/SmileyAdd/src/main.cpp @@ -42,6 +42,10 @@ static const PLUGININFOEX pluginInfoEx = {0xbd542bb4, 0x5ae4, 0x4d0e, {0xa4, 0x35, 0xba, 0x8d, 0xbe, 0x39, 0x60, 0x7f}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD /* mirandaVersion */)
{
return (PLUGININFOEX*)&pluginInfoEx;
diff --git a/plugins/SmileyAdd/src/stdafx.h b/plugins/SmileyAdd/src/stdafx.h index 94092b9044..fa7c936f8b 100644 --- a/plugins/SmileyAdd/src/stdafx.h +++ b/plugins/SmileyAdd/src/stdafx.h @@ -98,9 +98,7 @@ extern LIST<void> menuHandleArray; struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {}
+ CMPlugin();
};
#define DM_REMAKELOG (WM_USER + 11)
diff --git a/plugins/Spamotron/src/bayes.cpp b/plugins/Spamotron/src/bayes.cpp index c4fde0f693..f099109530 100644 --- a/plugins/Spamotron/src/bayes.cpp +++ b/plugins/Spamotron/src/bayes.cpp @@ -21,7 +21,7 @@ int CheckBayes() mir_free(tmp);
if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) {
- hBayesFolder = FoldersRegisterCustomPath(PLUGIN_NAME, Translate("Bayes database path"), bayesdb_tmp);
+ hBayesFolder = FoldersRegisterCustomPath(MODULENAME, Translate("Bayes database path"), bayesdb_tmp);
} else hBayesFolder = nullptr;
if (hBayesFolder)
diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp index dcaca0087b..6411a624ac 100644 --- a/plugins/Spamotron/src/options.cpp +++ b/plugins/Spamotron/src/options.cpp @@ -6,7 +6,7 @@ wchar_t* _getCOptS(wchar_t *buf, unsigned int buflen, MCONTACT hContact, const c {
DBVARIANT dbv = {0};
wcsnset(buf, 0, buflen);
- if (db_get_ws(hContact, PLUGIN_NAME, option, &dbv) != 0)
+ if (db_get_ws(hContact, MODULENAME, option, &dbv) != 0)
wcsncpy(buf, def, min(buflen, mir_wstrlen(def)+1));
else if (dbv.type == DBVT_WCHAR) {
wcsncpy(buf, dbv.ptszVal, min(buflen, mir_wstrlen(dbv.ptszVal)+1));
@@ -554,7 +554,7 @@ int OnOptInitialize(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = g_plugin.getInst();
odp.szGroup.a = LPGEN("Message sessions");
- odp.szTitle.a = PLUGIN_NAME;
+ odp.szTitle.a = MODULENAME;
odp.flags = ODPF_BOLDGROUPS;
odp.szTab.a = LPGEN("Settings");
diff --git a/plugins/Spamotron/src/popups.cpp b/plugins/Spamotron/src/popups.cpp index a5f6afde33..a58f62d27e 100644 --- a/plugins/Spamotron/src/popups.cpp +++ b/plugins/Spamotron/src/popups.cpp @@ -185,7 +185,7 @@ int ShowPopupPreview(HWND optDlg, BYTE popupType, wchar_t *line1, wchar_t *line2 ppdp.iSeconds = 0;
ppdp.lchContact = NULL;
- wcsncpy_s(ppdp.lptzContactName, (line1 ? line1 : _A2W(PLUGIN_NAME)), _TRUNCATE);
+ wcsncpy_s(ppdp.lptzContactName, (line1 ? line1 : _A2W(MODULENAME)), _TRUNCATE);
if (line2)
wcsncpy_s(ppdp.lptzText, line2, _TRUNCATE);
return PUAddPopupT(&ppdp);
@@ -234,7 +234,7 @@ int ShowPopup(MCONTACT hContact, BYTE popupType, wchar_t *line1, wchar_t *line2) ppdp.iSeconds = 0;
ppdp.lchContact = hContact;
- wcsncpy_s(ppdp.lptzContactName, (line1 ? line1 : _A2W(PLUGIN_NAME)), _TRUNCATE);
+ wcsncpy_s(ppdp.lptzContactName, (line1 ? line1 : _A2W(MODULENAME)), _TRUNCATE);
if (line2)
wcsncpy_s(ppdp.lptzText, line2, _TRUNCATE);
return PUAddPopupT(&ppdp);
diff --git a/plugins/Spamotron/src/spamotron.cpp b/plugins/Spamotron/src/spamotron.cpp index b6c3936f9f..82589c92c8 100644 --- a/plugins/Spamotron/src/spamotron.cpp +++ b/plugins/Spamotron/src/spamotron.cpp @@ -8,7 +8,7 @@ CMPlugin g_plugin; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo = {
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -21,9 +21,13 @@ PLUGININFOEX pluginInfo = { {0x14331048, 0x5a73, 0x4fdb, {0xb9, 0x09, 0x2d, 0x7e, 0x18, 0x25, 0xa0, 0x12}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -235,7 +239,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) DBVARIANT _dbv;
wchar_t AuthEventModule[100];
char* szAuthEventModule;
- if (db_get(hContact, PLUGIN_NAME, "AuthEvent", &_dbv) == 0) {
+ if (db_get(hContact, MODULENAME, "AuthEvent", &_dbv) == 0) {
DBEVENTINFO *_dbei = (DBEVENTINFO *)malloc(sizeof(DBEVENTINFO));
if (_dbei != nullptr) {
memcpy(&_dbei->cbBlob, _dbv.pbVal, sizeof(DWORD));
@@ -247,9 +251,9 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) _dbei->flags = 0;
_dbei->pBlob = _dbv.pbVal + sizeof(DWORD);
db_event_add(hContact,_dbei);
- db_unset(hContact, PLUGIN_NAME, "AuthEvent");
- db_unset(hContact, PLUGIN_NAME, "AuthEventPending");
- db_unset(hContact, PLUGIN_NAME, "AuthEventModule");
+ db_unset(hContact, MODULENAME, "AuthEvent");
+ db_unset(hContact, MODULENAME, "AuthEventPending");
+ db_unset(hContact, MODULENAME, "AuthEventModule");
mir_free(szAuthEventModule);
free(_dbei);
}
@@ -441,7 +445,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) if (eventdata != nullptr && dbei->cbBlob > 0) {
memcpy(eventdata, &dbei->cbBlob, sizeof(DWORD));
memcpy(eventdata + sizeof(DWORD), dbei->pBlob, dbei->cbBlob);
- db_set_blob(hContact, PLUGIN_NAME, "AuthEvent", eventdata, sizeof(DWORD) + dbei->cbBlob);
+ db_set_blob(hContact, MODULENAME, "AuthEvent", eventdata, sizeof(DWORD) + dbei->cbBlob);
_setCOptS(hContact, "AuthEventModule", dbei->szModule);
_setCOptB(hContact, "AuthEventPending", TRUE);
free(eventdata);
@@ -454,7 +458,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) PBYTE eventdata = (PBYTE)malloc(dbei_size);
PBYTE pos = eventdata;
if (eventdata != nullptr && dbei->cbBlob > 0) {
- if (db_get(hContact, PLUGIN_NAME, "LastMsgEvents", &_dbv) == 0) {
+ if (db_get(hContact, MODULENAME, "LastMsgEvents", &_dbv) == 0) {
eventdata = (PBYTE)realloc(eventdata, dbei_size + _dbv.cpbVal);
pos = eventdata;
memcpy(eventdata, _dbv.pbVal, _dbv.cpbVal);
@@ -467,7 +471,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) memcpy(pos + sizeof(WORD) + sizeof(DWORD) * 2, dbei->szModule, mir_strlen(dbei->szModule) + 1);
memcpy(pos + sizeof(WORD) + sizeof(DWORD) * 2 + mir_strlen(dbei->szModule) + 1, &dbei->cbBlob, sizeof(DWORD));
memcpy(pos + sizeof(WORD) + sizeof(DWORD) * 3 + mir_strlen(dbei->szModule) + 1, dbei->pBlob, dbei->cbBlob);
- db_set_blob(hContact, PLUGIN_NAME, "LastMsgEvents", eventdata, (pos - eventdata) + dbei_size);
+ db_set_blob(hContact, MODULENAME, "LastMsgEvents", eventdata, (pos - eventdata) + dbei_size);
free(eventdata);
}
@@ -505,7 +509,7 @@ void RemoveNotOnListSettings() extern "C" __declspec(dllexport) int Load()
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
srand((unsigned)time(0));
bayesdb = nullptr;
diff --git a/plugins/Spamotron/src/stdafx.h b/plugins/Spamotron/src/stdafx.h index 57abf24758..66578f6329 100644 --- a/plugins/Spamotron/src/stdafx.h +++ b/plugins/Spamotron/src/stdafx.h @@ -24,7 +24,7 @@ #include "resource.h"
#include "version.h"
-#define PLUGIN_NAME "Spam-o-tron"
+#define MODULENAME "Spam-o-tron"
#define SPAMOTRON_MODE_PLAIN 0
#define SPAMOTRON_MODE_MATH 1
@@ -33,10 +33,10 @@ #define MAX_BUFFER_LENGTH 1024
-#define _getCOptB(a,b,c) db_get_b(a, PLUGIN_NAME, b, c)
-#define _setCOptB(a,b,c) db_set_b(a, PLUGIN_NAME, b, c)
-#define _getCOptD(a,b,c) db_get_dw(a, PLUGIN_NAME, b, c)
-#define _setCOptD(a,b,c) db_set_dw(a, PLUGIN_NAME, b, c)
+#define _getCOptB(a,b,c) db_get_b(a, MODULENAME, b, c)
+#define _setCOptB(a,b,c) db_set_b(a, MODULENAME, b, c)
+#define _getCOptD(a,b,c) db_get_dw(a, MODULENAME, b, c)
+#define _setCOptD(a,b,c) db_set_dw(a, MODULENAME, b, c)
#define _getOptB(a,b) _getCOptB(NULL, a, b)
#define _setOptB(a,b) _setCOptB(NULL, a, b)
#define _getOptD(a,b) _getCOptD(NULL, a, b)
@@ -44,8 +44,8 @@ wchar_t* _getCOptS(wchar_t *buf, unsigned int buflen, MCONTACT hContact, const char* option, const wchar_t *def);
#define _getOptS(a,b,c,d) _getCOptS(a, b, NULL, c, d)
-#define _setCOptTS(a,b,c) db_set_ws(a, PLUGIN_NAME, b, c)
-#define _setCOptS(a,b,c) db_set_s(a, PLUGIN_NAME, b, c)
+#define _setCOptTS(a,b,c) db_set_ws(a, MODULENAME, b, c)
+#define _setCOptS(a,b,c) db_set_s(a, MODULENAME, b, c)
#define _setOptTS(a,b) _setCOptTS(NULL, a, b)
#define defaultMode SPAMOTRON_MODE_PLAIN
@@ -151,9 +151,7 @@ void dequeue_messages(); struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(PLUGIN_NAME)
- {}
+ CMPlugin();
};
#ifdef _DEBUG
diff --git a/plugins/Spamotron/src/utils.cpp b/plugins/Spamotron/src/utils.cpp index be49f90879..6ae1ca6d84 100644 --- a/plugins/Spamotron/src/utils.cpp +++ b/plugins/Spamotron/src/utils.cpp @@ -464,12 +464,12 @@ int LogToSystemHistory(char *message, char *origmessage) DBEVENTINFO dbei = {}; dbei.timestamp = time(&tm); - dbei.szModule = PLUGIN_NAME; + dbei.szModule = MODULENAME; dbei.pBlob = (PBYTE)msg; if (origmessage) - dbei.cbBlob = (1 + mir_snprintf(msg, "%s: %s%s %s: %s", PLUGIN_NAME, message, DOT(message), Translate("Their message was"), origmessage)); + dbei.cbBlob = (1 + mir_snprintf(msg, "%s: %s%s %s: %s", MODULENAME, message, DOT(message), Translate("Their message was"), origmessage)); else - dbei.cbBlob = (1 + mir_snprintf(msg, "%s: %s%s", PLUGIN_NAME, message, DOT(message))); + dbei.cbBlob = (1 + mir_snprintf(msg, "%s: %s%s", MODULENAME, message, DOT(message))); dbei.eventType = EVENTTYPE_MESSAGE; dbei.flags = DBEF_READ; db_event_add(NULL, &dbei); @@ -485,7 +485,7 @@ void MarkUnread(MCONTACT hContact) if (hContact == NULL) return; - if (db_get(hContact, PLUGIN_NAME, "LastMsgEvents", &_dbv) == 0) { + if (db_get(hContact, MODULENAME, "LastMsgEvents", &_dbv) == 0) { pos = _dbv.pbVal; while (pos - _dbv.pbVal < _dbv.cpbVal) { DBEVENTINFO _dbei = {}; @@ -505,6 +505,6 @@ void MarkUnread(MCONTACT hContact) db_event_add(hContact,&_dbei); } db_free(&_dbv); - db_unset(hContact, PLUGIN_NAME, "LastMsgEvents"); + db_unset(hContact, MODULENAME, "LastMsgEvents"); } } diff --git a/plugins/SpellChecker/src/dictionary.cpp b/plugins/SpellChecker/src/dictionary.cpp index 0bb88d0482..3127000d69 100644 --- a/plugins/SpellChecker/src/dictionary.cpp +++ b/plugins/SpellChecker/src/dictionary.cpp @@ -777,7 +777,7 @@ void GetDictsInfo(LIST<Dictionary> &dicts) char lang[128]; WideCharToMultiByte(CP_ACP, 0, dict->language, -1, lang, sizeof(lang), nullptr, nullptr); - if (!db_get_ws(NULL, MODULE_NAME, lang, &dbv)) { + if (!db_get_ws(NULL, MODULENAME, lang, &dbv)) { mir_wstrncpy(dict->localized_name, dbv.ptszVal, _countof(dict->localized_name)); db_free(&dbv); } diff --git a/plugins/SpellChecker/src/options.cpp b/plugins/SpellChecker/src/options.cpp index 9f4f8e22b9..9ed6be4e3c 100644 --- a/plugins/SpellChecker/src/options.cpp +++ b/plugins/SpellChecker/src/options.cpp @@ -84,8 +84,8 @@ void InitOptions() void LoadOptions()
{
- LoadOpts(optionsControls, _countof(optionsControls), MODULE_NAME);
- LoadOpts(autoReplaceControls, _countof(autoReplaceControls), MODULE_NAME);
+ LoadOpts(optionsControls, _countof(optionsControls), MODULENAME);
+ LoadOpts(autoReplaceControls, _countof(autoReplaceControls), MODULENAME);
if (languages.getCount() <= 0) {
opts.default_language[0] = '\0';
@@ -93,7 +93,7 @@ void LoadOptions() }
DBVARIANT dbv;
- if (!db_get_ws(NULL, MODULE_NAME, "DefaultLanguage", &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, "DefaultLanguage", &dbv)) {
mir_wstrncpy(opts.default_language, dbv.ptszVal, _countof(opts.default_language));
db_free(&dbv);
}
@@ -210,7 +210,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP int sel = SendDlgItemMessage(hwndDlg, IDC_DEF_LANG, CB_GETCURSEL, 0, 0);
if (sel >= languages.getCount())
sel = 0;
- db_set_ws(NULL, MODULE_NAME, "DefaultLanguage",
+ db_set_ws(NULL, MODULENAME, "DefaultLanguage",
(wchar_t *)languages[sel]->language);
mir_wstrcpy(opts.default_language, languages[sel]->language);
}
@@ -239,7 +239,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP return TRUE;
}
- return SaveOptsDlgProc(optionsControls, _countof(optionsControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
+ return SaveOptsDlgProc(optionsControls, _countof(optionsControls), MODULENAME, hwndDlg, msg, wParam, lParam);
}
struct AutoreplaceData
@@ -368,7 +368,7 @@ static INT_PTR CALLBACK AutoreplaceDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam switch (msg) {
case WM_INITDIALOG:
{
- BOOL ret = SaveOptsDlgProc(autoReplaceControls, _countof(autoReplaceControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
+ BOOL ret = SaveOptsDlgProc(autoReplaceControls, _countof(autoReplaceControls), MODULENAME, hwndDlg, msg, wParam, lParam);
int sel = -1;
for (int i = 0; i < languages.getCount(); i++) {
@@ -497,5 +497,5 @@ static INT_PTR CALLBACK AutoreplaceDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam return TRUE;
}
- return SaveOptsDlgProc(autoReplaceControls, _countof(autoReplaceControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
+ return SaveOptsDlgProc(autoReplaceControls, _countof(autoReplaceControls), MODULENAME, hwndDlg, msg, wParam, lParam);
}
diff --git a/plugins/SpellChecker/src/spellchecker.cpp b/plugins/SpellChecker/src/spellchecker.cpp index 96d535f873..cabb16747a 100644 --- a/plugins/SpellChecker/src/spellchecker.cpp +++ b/plugins/SpellChecker/src/spellchecker.cpp @@ -43,7 +43,7 @@ LIST<Dictionary> languages(1); ///////////////////////////////////////////////////////////////////////////////////////// -PLUGININFOEX pluginInfo = +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -57,9 +57,13 @@ PLUGININFOEX pluginInfo = { 0x36753ae3, 0x840b, 0x4797, { 0x94, 0xa5, 0xfd, 0x9f, 0x58, 0x52, 0xb9, 0x42 }} }; +CMPlugin::CMPlugin() : + PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx) +{} + extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { - return &pluginInfo; + return &pluginInfoEx; } // Functions //////////////////////////////////////////////////////////////////////////// @@ -67,7 +71,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) static int IconsChanged(WPARAM, LPARAM) { StatusIconData sid = {}; - sid.szModule = MODULE_NAME; + sid.szModule = MODULENAME; sid.hIconDisabled = IcoLib_GetIcon("spellchecker_disabled"); sid.flags = MBF_HIDDEN | MBF_UNICODE; @@ -189,7 +193,7 @@ static int ModulesLoaded(WPARAM, LPARAM) HookEvent(ME_MSG_ICONPRESSED, IconPressed); StatusIconData sid = {}; - sid.szModule = MODULE_NAME; + sid.szModule = MODULENAME; sid.hIconDisabled = IcoLib_GetIcon("spellchecker_disabled"); sid.flags = MBF_UNICODE | MBF_HIDDEN; @@ -227,7 +231,7 @@ static IconItem iconList[] = extern "C" int __declspec(dllexport) Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); // icons g_plugin.registerIcon(LPGEN("Spell Checker"), iconList); diff --git a/plugins/SpellChecker/src/stdafx.h b/plugins/SpellChecker/src/stdafx.h index 38317e99c4..130ad02c76 100644 --- a/plugins/SpellChecker/src/stdafx.h +++ b/plugins/SpellChecker/src/stdafx.h @@ -66,7 +66,7 @@ using namespace std; #include "ardialog.h"
#include "RichEdit.h"
-#define MODULE_NAME "SpellChecker"
+#define MODULENAME "SpellChecker"
#define FLAGS_DLL_FOLDER L"%miranda_path%\\Icons"
#define CUSTOM_DICTIONARIES_FOLDER L"%miranda_userdata%\\Dictionaries"
@@ -76,9 +76,7 @@ using namespace std; struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE_NAME)
- {}
+ CMPlugin();
};
extern BOOL uinfoex_enabled;
diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp index 4fd399f44f..1902d21b20 100644 --- a/plugins/SpellChecker/src/utils.cpp +++ b/plugins/SpellChecker/src/utils.cpp @@ -525,7 +525,7 @@ LRESULT CALLBACK OwnerProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) void ToggleEnabled(Dialog *dlg)
{
dlg->enabled = !dlg->enabled;
- db_set_b(dlg->hContact, MODULE_NAME, dlg->name, dlg->enabled);
+ db_set_b(dlg->hContact, MODULENAME, dlg->name, dlg->enabled);
if (!dlg->enabled)
SetNoUnderline(dlg);
@@ -769,13 +769,13 @@ void GetContactLanguage(Dialog *dlg) dlg->lang_name[0] = '\0';
if (dlg->hContact == NULL) {
- if (!db_get_ws(NULL, MODULE_NAME, dlg->name, &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, dlg->name, &dbv)) {
mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
}
else {
- if (!db_get_ws(dlg->hContact, MODULE_NAME, "TalkLanguage", &dbv)) {
+ if (!db_get_ws(dlg->hContact, MODULENAME, "TalkLanguage", &dbv)) {
mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
@@ -789,7 +789,7 @@ void GetContactLanguage(Dialog *dlg) if (dlg->lang_name[0] == '\0') {
MCONTACT hMetaContact = db_mc_getMeta(dlg->hContact);
if (hMetaContact != NULL) {
- if (!db_get_ws(hMetaContact, MODULE_NAME, "TalkLanguage", &dbv)) {
+ if (!db_get_ws(hMetaContact, MODULENAME, "TalkLanguage", &dbv)) {
mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
@@ -833,7 +833,7 @@ void GetContactLanguage(Dialog *dlg) void ModifyIcon(Dialog *dlg)
{
StatusIconData sid = {};
- sid.szModule = MODULE_NAME;
+ sid.szModule = MODULENAME;
for (int i = 0; i < languages.getCount(); i++) {
sid.dwId = i;
@@ -876,7 +876,7 @@ int AddContactTextBox(MCONTACT hContact, HWND hwnd, char *name, BOOL srmm, HWND dlg->hContact = hContact;
dlg->hwnd = hwnd;
strncpy(dlg->name, name, _countof(dlg->name));
- dlg->enabled = db_get_b(dlg->hContact, MODULE_NAME, dlg->name, 1);
+ dlg->enabled = db_get_b(dlg->hContact, MODULENAME, dlg->name, 1);
dlg->srmm = srmm;
GetContactLanguage(dlg);
@@ -1203,10 +1203,10 @@ BOOL HandleMenuSelection(Dialog *dlg, unsigned selection) SetNoUnderline(dlg);
if (dlg->hContact == NULL)
- db_set_ws(NULL, MODULE_NAME, dlg->name,
+ db_set_ws(NULL, MODULENAME, dlg->name,
languages[selection - LANGUAGE_MENU_ID_BASE]->language);
else
- db_set_ws(dlg->hContact, MODULE_NAME, "TalkLanguage",
+ db_set_ws(dlg->hContact, MODULENAME, "TalkLanguage",
languages[selection - LANGUAGE_MENU_ID_BASE]->language);
GetContactLanguage(dlg);
@@ -1352,7 +1352,7 @@ int MsgWindowEvent(WPARAM, LPARAM lParam) int IconPressed(WPARAM hContact, LPARAM lParam)
{
StatusIconClickData *sicd = (StatusIconClickData *)lParam;
- if (sicd == nullptr || mir_strcmp(sicd->szModule, MODULE_NAME) != 0)
+ if (sicd == nullptr || mir_strcmp(sicd->szModule, MODULENAME) != 0)
return 0;
if (hContact == NULL)
diff --git a/plugins/SplashScreen/src/main.cpp b/plugins/SplashScreen/src/main.cpp index fe3b0fef96..b7f9fd03fd 100644 --- a/plugins/SplashScreen/src/main.cpp +++ b/plugins/SplashScreen/src/main.cpp @@ -38,7 +38,7 @@ HWND hwndSplash; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo = {
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -51,9 +51,13 @@ PLUGININFOEX pluginInfo = { { 0xc64cc8e0, 0xcf03, 0x474a, { 0x8b, 0x11, 0x8b, 0xd4, 0x56, 0x5c, 0xcf, 0x04 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -79,14 +83,14 @@ void SplashMain() if (bstartup & (options.active == 1)) {
DBVARIANT dbv = { 0 };
- if (!db_get_ws(NULL, MODNAME, "VersionPrefix", &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, "VersionPrefix", &dbv)) {
mir_wstrcpy(szPrefix, dbv.ptszVal);
db_free(&dbv);
}
else
mir_wstrcpy(szPrefix, L"");
- if (!db_get_ws(NULL, MODNAME, "Path", &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, "Path", &dbv)) {
mir_wstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
@@ -103,7 +107,7 @@ void SplashMain() else
mir_wstrcpy(szSplashFile, inBuf);
- if (!db_get_ws(NULL, MODNAME, "Sound", &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, "Sound", &dbv)) {
mir_wstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
@@ -194,10 +198,10 @@ int PlugDisableHook(WPARAM wParam, LPARAM lParam) if (options.inheritGS) {
if (!strcmp(cws->szModule, "Skin") && !strcmp(cws->szSetting, "UseSound"))
- db_set_b(NULL, MODNAME, "PlaySound", cws->value.bVal);
+ db_set_b(NULL, MODULENAME, "PlaySound", cws->value.bVal);
if (!strcmp(cws->szModule, "PluginDisable") && !strcmp(cws->szSetting, _T2A(szDllName)))
- db_set_b(NULL, MODNAME, "Active", cws->value.bVal);
+ db_set_b(NULL, MODULENAME, "Active", cws->value.bVal);
}
return 0;
@@ -231,7 +235,7 @@ static int ModulesLoaded(WPARAM wParam, LPARAM lParam) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
diff --git a/plugins/SplashScreen/src/options.cpp b/plugins/SplashScreen/src/options.cpp index 851c660c93..46e2941b42 100644 --- a/plugins/SplashScreen/src/options.cpp +++ b/plugins/SplashScreen/src/options.cpp @@ -24,16 +24,16 @@ wchar_t szPath2Spash[MAX_PATH], szSoundFilePath[MAX_PATH]; // Reads values from db
void ReadDbConfig()
{
- options.active = db_get_b(NULL, MODNAME, "Active", 1);
- options.playsnd = db_get_b(NULL, MODNAME, "PlaySound", 0);
- options.fadein = db_get_b(NULL, MODNAME, "FadeIn", 1);
- options.fadeout = db_get_b(NULL, MODNAME, "FadeOut", 1);
- options.showtime = db_get_dw(NULL, MODNAME, "TimeToShow", 2000);
- options.fisteps = db_get_dw(NULL, MODNAME, "FadeinSpeed", 5);
- options.fosteps = db_get_dw(NULL, MODNAME, "FadeoutSpeed", 5);
- options.inheritGS = db_get_b(NULL, MODNAME, "InheritGlobalSound", 1);
- options.showversion = db_get_b(NULL, MODNAME, "ShowVersion", 0);
- options.random = db_get_b(NULL, MODNAME, "Random", 0);
+ options.active = db_get_b(NULL, MODULENAME, "Active", 1);
+ options.playsnd = db_get_b(NULL, MODULENAME, "PlaySound", 0);
+ options.fadein = db_get_b(NULL, MODULENAME, "FadeIn", 1);
+ options.fadeout = db_get_b(NULL, MODULENAME, "FadeOut", 1);
+ options.showtime = db_get_dw(NULL, MODULENAME, "TimeToShow", 2000);
+ options.fisteps = db_get_dw(NULL, MODULENAME, "FadeinSpeed", 5);
+ options.fosteps = db_get_dw(NULL, MODULENAME, "FadeoutSpeed", 5);
+ options.inheritGS = db_get_b(NULL, MODULENAME, "InheritGlobalSound", 1);
+ options.showversion = db_get_b(NULL, MODULENAME, "ShowVersion", 0);
+ options.random = db_get_b(NULL, MODULENAME, "Random", 0);
}
BOOL Exists(LPCTSTR strName)
@@ -53,21 +53,21 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP wchar_t inBuf[80];
{
DBVARIANT dbv = { 0 };
- if (!db_get_ws(NULL, MODNAME, "Path", &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, "Path", &dbv)) {
mir_wstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
else mir_wstrcpy(inBuf, L"splash\\splash.png");
SetDlgItemText(hwndDlg, IDC_SPLASHPATH, inBuf);
- if (!db_get_ws(NULL, MODNAME, "Sound", &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, "Sound", &dbv)) {
mir_wstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
else mir_wstrcpy(inBuf, L"sounds\\startup.wav");
SetDlgItemText(hwndDlg, IDC_SNDPATH, inBuf);
- if (!db_get_ws(NULL, MODNAME, "VersionPrefix", &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, "VersionPrefix", &dbv)) {
mir_wstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
@@ -243,86 +243,86 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
GetDlgItemText(hwndDlg, IDC_SPLASHPATH, tmp, _countof(tmp));
- db_set_ws(NULL, MODNAME, "Path", tmp);
+ db_set_ws(NULL, MODULENAME, "Path", tmp);
GetDlgItemText(hwndDlg, IDC_SNDPATH, tmp, _countof(tmp));
- db_set_ws(NULL, MODNAME, "Sound", tmp);
+ db_set_ws(NULL, MODULENAME, "Sound", tmp);
GetDlgItemText(hwndDlg, IDC_VERSIONPREFIX, tmp, _countof(tmp));
- db_set_ws(NULL, MODNAME, "VersionPrefix", tmp);
+ db_set_ws(NULL, MODULENAME, "VersionPrefix", tmp);
mir_wstrcpy(szPrefix, tmp);
GetDlgItemText(hwndDlg, IDC_SHOWTIME, tmp, _countof(tmp));
- db_set_dw(NULL, MODNAME, "TimeToShow", _wtoi(tmp));
+ db_set_dw(NULL, MODULENAME, "TimeToShow", _wtoi(tmp));
options.showtime = _wtoi(tmp);
GetDlgItemText(hwndDlg, IDC_FISTEP, tmp, _countof(tmp));
- db_set_dw(NULL, MODNAME, "FadeinSpeed", _wtoi(tmp));
+ db_set_dw(NULL, MODULENAME, "FadeinSpeed", _wtoi(tmp));
options.fisteps = _wtoi(tmp);
GetDlgItemText(hwndDlg, IDC_FOSTEP, tmp, _countof(tmp));
- db_set_dw(NULL, MODNAME, "FadeoutSpeed", _wtoi(tmp));
+ db_set_dw(NULL, MODULENAME, "FadeoutSpeed", _wtoi(tmp));
options.fosteps = _wtoi(tmp);
if (IsDlgButtonChecked(hwndDlg, IDC_ACTIVE)) {
- db_set_b(NULL, MODNAME, "Active", 1);
+ db_set_b(NULL, MODULENAME, "Active", 1);
options.active = 1;
}
else {
- db_set_b(NULL, MODNAME, "Active", 0);
+ db_set_b(NULL, MODULENAME, "Active", 0);
options.active = 0;
}
if (IsDlgButtonChecked(hwndDlg, IDC_PLAYSND)) {
- db_set_b(NULL, MODNAME, "PlaySound", 1);
+ db_set_b(NULL, MODULENAME, "PlaySound", 1);
options.playsnd = 1;
- db_set_b(NULL, MODNAME, "InheritGlobalSound", 1);
+ db_set_b(NULL, MODULENAME, "InheritGlobalSound", 1);
options.inheritGS = 1;
}
else {
- db_set_b(NULL, MODNAME, "PlaySound", 0);
+ db_set_b(NULL, MODULENAME, "PlaySound", 0);
options.playsnd = 0;
- db_set_b(NULL, MODNAME, "InheritGlobalSound", 0);
+ db_set_b(NULL, MODULENAME, "InheritGlobalSound", 0);
options.inheritGS = 0;
}
if (IsDlgButtonChecked(hwndDlg, IDC_PLAYSND) == BST_INDETERMINATE) {
- db_set_b(NULL, MODNAME, "PlaySound", 1);
+ db_set_b(NULL, MODULENAME, "PlaySound", 1);
options.playsnd = 1;
- db_set_b(NULL, MODNAME, "InheritGlobalSound", 0);
+ db_set_b(NULL, MODULENAME, "InheritGlobalSound", 0);
options.inheritGS = 0;
}
if (IsDlgButtonChecked(hwndDlg, IDC_FADEIN)) {
- db_set_b(NULL, MODNAME, "FadeIn", 1);
+ db_set_b(NULL, MODULENAME, "FadeIn", 1);
options.fadein = 1;
}
else {
- db_set_b(NULL, MODNAME, "FadeIn", 0);
+ db_set_b(NULL, MODULENAME, "FadeIn", 0);
options.fadein = 0;
}
if (IsDlgButtonChecked(hwndDlg, IDC_FADEOUT)) {
- db_set_b(NULL, MODNAME, "FadeOut", 1);
+ db_set_b(NULL, MODULENAME, "FadeOut", 1);
options.fadeout = 1;
}
else {
- db_set_b(NULL, MODNAME, "FadeOut", 0);
+ db_set_b(NULL, MODULENAME, "FadeOut", 0);
options.fadeout = 0;
}
if (IsDlgButtonChecked(hwndDlg, IDC_RANDOM)) {
- db_set_b(NULL, MODNAME, "Random", 1);
+ db_set_b(NULL, MODULENAME, "Random", 1);
options.random = 1;
}
else {
- db_set_b(NULL, MODNAME, "Random", 0);
+ db_set_b(NULL, MODULENAME, "Random", 0);
options.random = 0;
}
if (IsDlgButtonChecked(hwndDlg, IDC_SHOWVERSION)) {
- db_set_b(NULL, MODNAME, "ShowVersion", 1);
+ db_set_b(NULL, MODULENAME, "ShowVersion", 1);
options.showversion = 1;
}
else {
- db_set_b(NULL, MODNAME, "ShowVersion", 0);
+ db_set_b(NULL, MODULENAME, "ShowVersion", 0);
options.showversion = 0;
}
return TRUE;
diff --git a/plugins/SplashScreen/src/stdafx.h b/plugins/SplashScreen/src/stdafx.h index f2630ef5e9..a0841de240 100644 --- a/plugins/SplashScreen/src/stdafx.h +++ b/plugins/SplashScreen/src/stdafx.h @@ -49,14 +49,12 @@ // Internal defines
#define SPLASH_CLASS L"MirandaSplash"
-#define MODNAME "SplashScreen"
+#define MODULENAME "SplashScreen"
#define WM_LOADED (WM_USER + 10)
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODNAME)
- {}
+ CMPlugin();
};
struct SPLASHOPTS
diff --git a/plugins/StartPosition/src/main.cpp b/plugins/StartPosition/src/main.cpp index 5b8e2b3c5c..0fb2da4d0f 100644 --- a/plugins/StartPosition/src/main.cpp +++ b/plugins/StartPosition/src/main.cpp @@ -28,7 +28,7 @@ CMPlugin g_plugin; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo = {
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -43,14 +43,14 @@ PLUGININFOEX pluginInfo = { extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
g_plugin.Init();
g_plugin.positionClist();
diff --git a/plugins/StartPosition/src/options.cpp b/plugins/StartPosition/src/options.cpp index 32eb9f3c78..fba92709ef 100644 --- a/plugins/StartPosition/src/options.cpp +++ b/plugins/StartPosition/src/options.cpp @@ -1,22 +1,22 @@ #include "stdafx.h" StartPositionOptions::StartPositionOptions() : - setTopPosition(MODULE_NAME, "CLEnableTop", 1), - setBottomPosition(MODULE_NAME, "CLEnableBottom", 0), - setSidePosition(MODULE_NAME, "CLEnableSide", 1), - clistAlign(MODULE_NAME, "CLAlign", ClistAlign::right), - setClistWidth(MODULE_NAME, "CLEnableWidth", 0), - setClistStartState(MODULE_NAME, "CLEnableState", 0), - clistState(MODULE_NAME, "CLState", ClistState::normal), - pixelsFromTop(MODULE_NAME, "CLpixelsTop", 3), - pixelsFromBottom(MODULE_NAME, "CLpixelsBottom", 3), - pixelsFromSide(MODULE_NAME, "CLpixelsSide", 3), - clistWidth(MODULE_NAME, "CLWidth", 180) + setTopPosition(MODULENAME, "CLEnableTop", 1), + setBottomPosition(MODULENAME, "CLEnableBottom", 0), + setSidePosition(MODULENAME, "CLEnableSide", 1), + clistAlign(MODULENAME, "CLAlign", ClistAlign::right), + setClistWidth(MODULENAME, "CLEnableWidth", 0), + setClistStartState(MODULENAME, "CLEnableState", 0), + clistState(MODULENAME, "CLState", ClistState::normal), + pixelsFromTop(MODULENAME, "CLpixelsTop", 3), + pixelsFromBottom(MODULENAME, "CLpixelsBottom", 3), + pixelsFromSide(MODULENAME, "CLpixelsSide", 3), + clistWidth(MODULENAME, "CLWidth", 180) { } COptionsDlg::COptionsDlg() : - CPluginDlgBase(g_plugin, IDD_OPTIONS, MODULE_NAME), + CPluginDlgBase(g_plugin, IDD_OPTIONS, MODULENAME), chkPositionTop(this, IDC_CLTOPENABLE), edtPositionTop(this, IDC_CLTOP), chkPositionBottom(this, IDC_CLBOTTOMENABLE), diff --git a/plugins/StartPosition/src/startposition.cpp b/plugins/StartPosition/src/startposition.cpp index 64479d266c..34602969a6 100644 --- a/plugins/StartPosition/src/startposition.cpp +++ b/plugins/StartPosition/src/startposition.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" CMPlugin::CMPlugin() : - PLUGIN<CMPlugin>(MODULE_NAME) + PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx) {} void CMPlugin::Init() diff --git a/plugins/StartPosition/src/stdafx.h b/plugins/StartPosition/src/stdafx.h index f654557d13..92602adbc0 100644 --- a/plugins/StartPosition/src/stdafx.h +++ b/plugins/StartPosition/src/stdafx.h @@ -32,8 +32,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "resource.h"
#include "version.h"
-#define MODULE_NAME "StartPosition"
+#define MODULENAME "StartPosition"
#define CLIST_MODULE_NAME "CList"
#include "options.h"
#include "startposition.h"
+
+extern PLUGININFOEX pluginInfoEx;
\ No newline at end of file diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp index 3382ad8a5d..9dc2d008e2 100644 --- a/plugins/StartupSilence/src/main.cpp +++ b/plugins/StartupSilence/src/main.cpp @@ -63,7 +63,7 @@ static LIST<void> ttbButtons(1); /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -77,9 +77,13 @@ PLUGININFOEX pluginInfo = { 0x7b856b6a, 0xd48f, 0x4f54, { 0xb8, 0xd6, 0xc8, 0xd8, 0x6d, 0x2, 0xff, 0xc2 }}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -165,7 +169,7 @@ void InitSettings() mir_snprintf(NonStatusAllowComp, "%s_NonStatusAllow", hostname);
}
//first run on the host, initial setting
- if (!(delay = db_get_dw(NULL, MODULE_NAME, DelayComp, 0)))
+ if (!(delay = db_get_dw(NULL, MODULENAME, DelayComp, 0)))
DefSettings();
//or load host settings
else LoadSettings();
@@ -173,31 +177,31 @@ void InitSettings() void DefSettings()
{
- db_set_dw(NULL, MODULE_NAME, DelayComp, 20);
- db_set_b(NULL, MODULE_NAME, EnabledComp, 1);
- db_set_b(NULL, MODULE_NAME, PopUpComp, 1);
- db_set_dw(NULL, MODULE_NAME, PopUpTimeComp, 5);
- db_set_b(NULL, MODULE_NAME, MenuitemComp, 1);
- db_set_b(NULL, MODULE_NAME, TTBButtonsComp, 0);
- db_set_b(NULL, MODULE_NAME, DefSoundComp, 1);
- db_set_b(NULL, MODULE_NAME, DefPopupComp, 0);
- db_set_b(NULL, MODULE_NAME, DefEnabledComp, 0);
- db_set_b(NULL, MODULE_NAME, NonStatusAllowComp, 1);
+ db_set_dw(NULL, MODULENAME, DelayComp, 20);
+ db_set_b(NULL, MODULENAME, EnabledComp, 1);
+ db_set_b(NULL, MODULENAME, PopUpComp, 1);
+ db_set_dw(NULL, MODULENAME, PopUpTimeComp, 5);
+ db_set_b(NULL, MODULENAME, MenuitemComp, 1);
+ db_set_b(NULL, MODULENAME, TTBButtonsComp, 0);
+ db_set_b(NULL, MODULENAME, DefSoundComp, 1);
+ db_set_b(NULL, MODULENAME, DefPopupComp, 0);
+ db_set_b(NULL, MODULENAME, DefEnabledComp, 0);
+ db_set_b(NULL, MODULENAME, NonStatusAllowComp, 1);
LoadSettings();
}
void LoadSettings()
{
- Enabled = db_get_b(NULL, MODULE_NAME, EnabledComp, 0);
- delay = db_get_dw(NULL, MODULE_NAME, DelayComp, 0);
- PopUp = db_get_b(NULL, MODULE_NAME, PopUpComp, 0);
- PopUpTime = db_get_dw(NULL, MODULE_NAME, PopUpTimeComp, 0);
- MenuItem = db_get_b(NULL, MODULE_NAME, MenuitemComp, 0);
- TTBButtons = db_get_b(NULL, MODULE_NAME, TTBButtonsComp, 0);
- DefSound = db_get_b(NULL, MODULE_NAME, DefSoundComp, 0);
- DefPopup = db_get_b(NULL, MODULE_NAME, DefPopupComp, 0);
- DefEnabled = db_get_b(NULL, MODULE_NAME, DefEnabledComp, 0);
- NonStatusAllow = db_get_b(NULL, MODULE_NAME, NonStatusAllowComp, 0);
+ Enabled = db_get_b(NULL, MODULENAME, EnabledComp, 0);
+ delay = db_get_dw(NULL, MODULENAME, DelayComp, 0);
+ PopUp = db_get_b(NULL, MODULENAME, PopUpComp, 0);
+ PopUpTime = db_get_dw(NULL, MODULENAME, PopUpTimeComp, 0);
+ MenuItem = db_get_b(NULL, MODULENAME, MenuitemComp, 0);
+ TTBButtons = db_get_b(NULL, MODULENAME, TTBButtonsComp, 0);
+ DefSound = db_get_b(NULL, MODULENAME, DefSoundComp, 0);
+ DefPopup = db_get_b(NULL, MODULENAME, DefPopupComp, 0);
+ DefEnabled = db_get_b(NULL, MODULENAME, DefEnabledComp, 0);
+ NonStatusAllow = db_get_b(NULL, MODULENAME, NonStatusAllowComp, 0);
if (PopUpTime < 1)
PopUpTime = (DWORD)1;
if (PopUpTime > 30)
@@ -206,15 +210,15 @@ void LoadSettings() delay = (DWORD)10;
if (delay > 300)
delay = (DWORD)300;
- db_set_dw(NULL, MODULE_NAME, DelayComp, delay);
- db_set_dw(NULL, MODULE_NAME, PopUpTimeComp, PopUpTime);
+ db_set_dw(NULL, MODULENAME, DelayComp, delay);
+ db_set_dw(NULL, MODULENAME, PopUpTimeComp, PopUpTime);
}
/////////////////////////////////////////////////////////////////////////////////////////
static INT_PTR StartupSilenceEnabled(WPARAM, LPARAM)
{
- db_set_b(NULL, MODULE_NAME, EnabledComp, !Enabled);
+ db_set_b(NULL, MODULENAME, EnabledComp, !Enabled);
LoadSettings();
if (MenuItem == 1)
UpdateMenu();
@@ -336,7 +340,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP min = GetDlgItemInt(hwndDlg, IDC_SSTIME, nullptr, FALSE);
if (min == 0 && GetWindowTextLength(GetDlgItem(hwndDlg, IDC_SSTIME)))
SendDlgItemMessage(hwndDlg, IDC_SSSPIN, UDM_SETPOS, 0, MAKELONG((short)1, 0));
- delay = (DWORD)db_set_dw(NULL, MODULE_NAME, DelayComp, (DWORD)(SendDlgItemMessage(hwndDlg, IDC_SSSPIN, UDM_GETPOS, 0, 0)));
+ delay = (DWORD)db_set_dw(NULL, MODULENAME, DelayComp, (DWORD)(SendDlgItemMessage(hwndDlg, IDC_SSSPIN, UDM_GETPOS, 0, 0)));
break;
case IDC_SSPOPUPTIME:
@@ -344,7 +348,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP min = GetDlgItemInt(hwndDlg, IDC_SSPOPUPTIME, nullptr, FALSE);
if (min == 0 && GetWindowTextLength(GetDlgItem(hwndDlg, IDC_SSPOPUPTIME)))
SendDlgItemMessage(hwndDlg, IDC_SSSPIN2, UDM_SETPOS, 0, MAKELONG((short)1, 0));
- PopUpTime = (DWORD)db_set_dw(NULL, MODULE_NAME, PopUpTimeComp, (DWORD)(SendDlgItemMessage(hwndDlg, IDC_SSSPIN2, UDM_GETPOS, 0, 0)));
+ PopUpTime = (DWORD)db_set_dw(NULL, MODULENAME, PopUpTimeComp, (DWORD)(SendDlgItemMessage(hwndDlg, IDC_SSSPIN2, UDM_GETPOS, 0, 0)));
break;
case IDC_DELAY:
@@ -355,42 +359,42 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (!ServiceExists(MS_POPUP_QUERY)) {
MessageBox(nullptr, NEEDPOPUP, NOTICE, MB_OK);
CheckDlgButton(hwndDlg, IDC_DELAY2, BST_UNCHECKED);
- PopUp = (BYTE)db_set_b(NULL, MODULE_NAME, PopUpComp, 0);
+ PopUp = (BYTE)db_set_b(NULL, MODULENAME, PopUpComp, 0);
}
- else PopUp = (BYTE)db_set_b(NULL, MODULE_NAME, PopUpComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_DELAY2) == BST_CHECKED ? 1 : 0));
+ else PopUp = (BYTE)db_set_b(NULL, MODULENAME, PopUpComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_DELAY2) == BST_CHECKED ? 1 : 0));
break;
case IDC_MENU:
- MenuItem = (BYTE)db_set_b(NULL, MODULE_NAME, MenuitemComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_MENU) == BST_CHECKED ? 1 : 0));
+ MenuItem = (BYTE)db_set_b(NULL, MODULENAME, MenuitemComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_MENU) == BST_CHECKED ? 1 : 0));
break;
case IDC_TTB:
if (!hTTBarloaded) {
MessageBox(nullptr, NEEDTTBMOD, NOTICE, MB_OK);
CheckDlgButton(hwndDlg, IDC_TTB, BST_UNCHECKED);
- TTBButtons = (BYTE)db_set_b(NULL, MODULE_NAME, TTBButtonsComp, 0);
+ TTBButtons = (BYTE)db_set_b(NULL, MODULENAME, TTBButtonsComp, 0);
}
- else TTBButtons = (BYTE)db_set_b(NULL, MODULE_NAME, TTBButtonsComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_TTB) == BST_CHECKED ? 1 : 0));
+ else TTBButtons = (BYTE)db_set_b(NULL, MODULENAME, TTBButtonsComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_TTB) == BST_CHECKED ? 1 : 0));
break;
case IDC_DEFPOPUP:
- db_set_b(NULL, MODULE_NAME, DefPopupComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_DEFPOPUP) == BST_CHECKED ? 1 : 0));
- DefPopup = db_get_b(NULL, MODULE_NAME, DefPopupComp, 0);
+ db_set_b(NULL, MODULENAME, DefPopupComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_DEFPOPUP) == BST_CHECKED ? 1 : 0));
+ DefPopup = db_get_b(NULL, MODULENAME, DefPopupComp, 0);
break;
case IDC_DEFSOUNDS:
- db_set_b(NULL, MODULE_NAME, DefSoundComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_DEFSOUNDS) == BST_CHECKED ? 1 : 0));
- DefSound = db_get_b(NULL, MODULE_NAME, DefSoundComp, 0);
+ db_set_b(NULL, MODULENAME, DefSoundComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_DEFSOUNDS) == BST_CHECKED ? 1 : 0));
+ DefSound = db_get_b(NULL, MODULENAME, DefSoundComp, 0);
break;
case IDC_RESTORE:
- db_set_b(NULL, MODULE_NAME, DefEnabledComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_RESTORE) == BST_CHECKED ? 1 : 0));
- DefEnabled = db_get_b(NULL, MODULE_NAME, DefEnabledComp, 0);
+ db_set_b(NULL, MODULENAME, DefEnabledComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_RESTORE) == BST_CHECKED ? 1 : 0));
+ DefEnabled = db_get_b(NULL, MODULENAME, DefEnabledComp, 0);
break;
case IDC_NONSTATUSES:
- db_set_b(NULL, MODULE_NAME, NonStatusAllowComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NONSTATUSES) == BST_CHECKED ? 1 : 0));
- NonStatusAllow = db_get_b(NULL, MODULE_NAME, NonStatusAllowComp, 0);
+ db_set_b(NULL, MODULENAME, NonStatusAllowComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NONSTATUSES) == BST_CHECKED ? 1 : 0));
+ NonStatusAllow = db_get_b(NULL, MODULENAME, NonStatusAllowComp, 0);
break;
case IDC_RESETDEFAULT:
@@ -441,7 +445,7 @@ int ModulesLoaded(WPARAM, LPARAM) extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
InitSettings();
diff --git a/plugins/StartupSilence/src/stdafx.h b/plugins/StartupSilence/src/stdafx.h index 285f6c400f..3b8206ae8f 100644 --- a/plugins/StartupSilence/src/stdafx.h +++ b/plugins/StartupSilence/src/stdafx.h @@ -29,13 +29,11 @@ void DefSettings(); void UpdateMenu();
void UpdateTTB();
-#define MODULE_NAME "StartupSilence"
+#define MODULENAME "StartupSilence"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE_NAME)
- {}
+ CMPlugin();
};
#define SS_SERVICE_NAME "StartupSilence/ToggleEnabled"
diff --git a/plugins/StatusChange/src/main.cpp b/plugins/StatusChange/src/main.cpp index 7902464612..966be6a908 100644 --- a/plugins/StatusChange/src/main.cpp +++ b/plugins/StatusChange/src/main.cpp @@ -10,7 +10,7 @@ CMPlugin g_plugin; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -24,9 +24,13 @@ PLUGININFOEX pluginInfo = { 0x1acb2ed1, 0xc1ed, 0x43ee, { 0x89, 0xbd, 0x8, 0x66, 0x86, 0xf6, 0xeb, 0xb5 }}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -34,23 +38,23 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) void LoadOptions()
{
memset(&Options, 0, sizeof(Options));
- Options.MessageRead = (BOOL)db_get_b(NULL, PLUGINNAME, "MessageRead", FALSE);
- Options.MessageSend = (BOOL)db_get_b(NULL, PLUGINNAME, "MessageSend", TRUE);
- Options.UrlRead = (BOOL)db_get_b(NULL, PLUGINNAME, "UrlRead", FALSE);
- Options.UrlSend = (BOOL)db_get_b(NULL, PLUGINNAME, "UrlSend", TRUE);
- Options.FileRead = (BOOL)db_get_b(NULL, PLUGINNAME, "FileRead", FALSE);
- Options.FileSend = (BOOL)db_get_b(NULL, PLUGINNAME, "FileSend", TRUE);
- Options.ChangeTo = (INT)db_get_dw(NULL, PLUGINNAME, "ChangeTo", ID_STATUS_ONLINE);
- Options.IfOffline = (BOOL)db_get_b(NULL, PLUGINNAME, "IfOffline", FALSE);
- Options.IfOnline = (BOOL)db_get_b(NULL, PLUGINNAME, "IfOnline", FALSE);
- Options.IfAway = (BOOL)db_get_b(NULL, PLUGINNAME, "IfAway", TRUE);
- Options.IfNA = (BOOL)db_get_b(NULL, PLUGINNAME, "IfNA", TRUE);
- Options.IfOccupied = (BOOL)db_get_b(NULL, PLUGINNAME, "IfOccupied", FALSE);
- Options.IfDND = (BOOL)db_get_b(NULL, PLUGINNAME, "IfDND", FALSE);
- Options.IfFreeforchat = (BOOL)db_get_b(NULL, PLUGINNAME, "IfFreeforchat", FALSE);
- Options.IfInvisible = (BOOL)db_get_b(NULL, PLUGINNAME, "IfInvisible", FALSE);
- Options.IfOnthephone = (BOOL)db_get_b(NULL, PLUGINNAME, "IfOnthephone", FALSE);
- Options.IfOuttolunch = (BOOL)db_get_b(NULL, PLUGINNAME, "IfOuttolunch", FALSE);
+ Options.MessageRead = (BOOL)db_get_b(NULL, MODULENAME, "MessageRead", FALSE);
+ Options.MessageSend = (BOOL)db_get_b(NULL, MODULENAME, "MessageSend", TRUE);
+ Options.UrlRead = (BOOL)db_get_b(NULL, MODULENAME, "UrlRead", FALSE);
+ Options.UrlSend = (BOOL)db_get_b(NULL, MODULENAME, "UrlSend", TRUE);
+ Options.FileRead = (BOOL)db_get_b(NULL, MODULENAME, "FileRead", FALSE);
+ Options.FileSend = (BOOL)db_get_b(NULL, MODULENAME, "FileSend", TRUE);
+ Options.ChangeTo = (INT)db_get_dw(NULL, MODULENAME, "ChangeTo", ID_STATUS_ONLINE);
+ Options.IfOffline = (BOOL)db_get_b(NULL, MODULENAME, "IfOffline", FALSE);
+ Options.IfOnline = (BOOL)db_get_b(NULL, MODULENAME, "IfOnline", FALSE);
+ Options.IfAway = (BOOL)db_get_b(NULL, MODULENAME, "IfAway", TRUE);
+ Options.IfNA = (BOOL)db_get_b(NULL, MODULENAME, "IfNA", TRUE);
+ Options.IfOccupied = (BOOL)db_get_b(NULL, MODULENAME, "IfOccupied", FALSE);
+ Options.IfDND = (BOOL)db_get_b(NULL, MODULENAME, "IfDND", FALSE);
+ Options.IfFreeforchat = (BOOL)db_get_b(NULL, MODULENAME, "IfFreeforchat", FALSE);
+ Options.IfInvisible = (BOOL)db_get_b(NULL, MODULENAME, "IfInvisible", FALSE);
+ Options.IfOnthephone = (BOOL)db_get_b(NULL, MODULENAME, "IfOnthephone", FALSE);
+ Options.IfOuttolunch = (BOOL)db_get_b(NULL, MODULENAME, "IfOuttolunch", FALSE);
}
static int StatusChangeGetMessage(WPARAM, LPARAM hDbEvent)
@@ -285,23 +289,23 @@ static INT_PTR CALLBACK DlgProcStatusChangeOpts(HWND hwndDlg, UINT msg, WPARAM w return TRUE;
case PSN_APPLY:
- db_set_b(NULL, PLUGINNAME, "MessageRead", (BYTE)Options.MessageRead);
- db_set_b(NULL, PLUGINNAME, "MessageSend", (BYTE)Options.MessageSend);
- db_set_b(NULL, PLUGINNAME, "UrlRead", (BYTE)Options.UrlRead);
- db_set_b(NULL, PLUGINNAME, "UrlSend", (BYTE)Options.UrlSend);
- db_set_b(NULL, PLUGINNAME, "FileRead", (BYTE)Options.FileRead);
- db_set_b(NULL, PLUGINNAME, "FileSend", (BYTE)Options.FileSend);
- db_set_dw(NULL, PLUGINNAME, "ChangeTo", (DWORD)Options.ChangeTo);
- db_set_b(NULL, PLUGINNAME, "IfOffline", (BYTE)Options.IfOffline);
- db_set_b(NULL, PLUGINNAME, "IfOnline", (BYTE)Options.IfOnline);
- db_set_b(NULL, PLUGINNAME, "IfAway", (BYTE)Options.IfAway);
- db_set_b(NULL, PLUGINNAME, "IfNA", (BYTE)Options.IfNA);
- db_set_b(NULL, PLUGINNAME, "IfDND", (BYTE)Options.IfDND);
- db_set_b(NULL, PLUGINNAME, "IfOccupied", (BYTE)Options.IfOccupied);
- db_set_b(NULL, PLUGINNAME, "IfFreeforchat", (BYTE)Options.IfFreeforchat);
- db_set_b(NULL, PLUGINNAME, "IfInvisible", (BYTE)Options.IfInvisible);
- db_set_b(NULL, PLUGINNAME, "IfOnthephone", (BYTE)Options.IfOnthephone);
- db_set_b(NULL, PLUGINNAME, "IfOuttolunch", (BYTE)Options.IfOuttolunch);
+ db_set_b(NULL, MODULENAME, "MessageRead", (BYTE)Options.MessageRead);
+ db_set_b(NULL, MODULENAME, "MessageSend", (BYTE)Options.MessageSend);
+ db_set_b(NULL, MODULENAME, "UrlRead", (BYTE)Options.UrlRead);
+ db_set_b(NULL, MODULENAME, "UrlSend", (BYTE)Options.UrlSend);
+ db_set_b(NULL, MODULENAME, "FileRead", (BYTE)Options.FileRead);
+ db_set_b(NULL, MODULENAME, "FileSend", (BYTE)Options.FileSend);
+ db_set_dw(NULL, MODULENAME, "ChangeTo", (DWORD)Options.ChangeTo);
+ db_set_b(NULL, MODULENAME, "IfOffline", (BYTE)Options.IfOffline);
+ db_set_b(NULL, MODULENAME, "IfOnline", (BYTE)Options.IfOnline);
+ db_set_b(NULL, MODULENAME, "IfAway", (BYTE)Options.IfAway);
+ db_set_b(NULL, MODULENAME, "IfNA", (BYTE)Options.IfNA);
+ db_set_b(NULL, MODULENAME, "IfDND", (BYTE)Options.IfDND);
+ db_set_b(NULL, MODULENAME, "IfOccupied", (BYTE)Options.IfOccupied);
+ db_set_b(NULL, MODULENAME, "IfFreeforchat", (BYTE)Options.IfFreeforchat);
+ db_set_b(NULL, MODULENAME, "IfInvisible", (BYTE)Options.IfInvisible);
+ db_set_b(NULL, MODULENAME, "IfOnthephone", (BYTE)Options.IfOnthephone);
+ db_set_b(NULL, MODULENAME, "IfOuttolunch", (BYTE)Options.IfOuttolunch);
return TRUE;
}
break;
@@ -335,7 +339,7 @@ int StatusChangeOptInit(WPARAM wParam, LPARAM) extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
HookEvent(ME_OPT_INITIALISE, StatusChangeOptInit);
HookEvent(ME_DB_EVENT_ADDED, StatusChangeGetMessage);
diff --git a/plugins/StatusChange/src/stdafx.h b/plugins/StatusChange/src/stdafx.h index a2335bb170..c3303d1c35 100644 --- a/plugins/StatusChange/src/stdafx.h +++ b/plugins/StatusChange/src/stdafx.h @@ -16,13 +16,11 @@ #include "resource.h"
#include "version.h"
-#define PLUGINNAME "StatusChange"
+#define MODULENAME "StatusChange"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(PLUGINNAME)
- {}
+ CMPlugin();
};
struct TOPTIONS
diff --git a/plugins/StatusManager/src/main.cpp b/plugins/StatusManager/src/main.cpp index f7d35ec131..89ddb905cd 100644 --- a/plugins/StatusManager/src/main.cpp +++ b/plugins/StatusManager/src/main.cpp @@ -39,6 +39,10 @@ PLUGININFOEX pluginInfoEx = { { 0xfadd4a8a, 0x1fd0, 0x4398, { 0x83, 0xbd, 0xe3, 0x78, 0xb8, 0x5e, 0xd8, 0xf1 } } }; +CMPlugin::CMPlugin() : + PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx) +{} + extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { return &pluginInfoEx; diff --git a/plugins/StatusManager/src/stdafx.h b/plugins/StatusManager/src/stdafx.h index 4ef05fee00..63c6cf83ea 100644 --- a/plugins/StatusManager/src/stdafx.h +++ b/plugins/StatusManager/src/stdafx.h @@ -30,9 +30,7 @@ struct CMPlugin : public PLUGIN<CMPlugin> { - CMPlugin() : - PLUGIN<CMPlugin>(MODULENAME) - {} + CMPlugin(); }; #include "commonstatus.h" diff --git a/plugins/StopSpamMod/src/globals.h b/plugins/StopSpamMod/src/globals.h index ae45848eb2..c54341325e 100755 --- a/plugins/StopSpamMod/src/globals.h +++ b/plugins/StopSpamMod/src/globals.h @@ -1,5 +1,5 @@ #pragma once
-#define pluginName "StopSpam" //const char* ?
+#define MODULENAME "StopSpam" //const char* ?
#define PREF_TCHAR2 PREF_UTF
diff --git a/plugins/StopSpamMod/src/init.cpp b/plugins/StopSpamMod/src/init.cpp index 99000914c3..c49545056e 100755 --- a/plugins/StopSpamMod/src/init.cpp +++ b/plugins/StopSpamMod/src/init.cpp @@ -74,6 +74,10 @@ PLUGININFOEX pluginInfoEx = { {0x94ced94c, 0xa94a, 0x4bb1, {0xac, 0xbd, 0x5c, 0xc6, 0xeb, 0xb6, 0x89, 0xd4}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
@@ -85,33 +89,33 @@ extern wstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szMo void InitVars()
{
- gbSpammersGroup = DBGetContactSettingStringPAN(NULL, pluginName, "SpammersGroup", L"Spammers");
- gbAnswer = DBGetContactSettingStringPAN(NULL, pluginName, "answer", L"nospam");
- gbInfTalkProtection = db_get_b(NULL, pluginName, "infTalkProtection", 0);
- gbAddPermanent = db_get_b(NULL, pluginName, "addPermanent", 0);
- gbMaxQuestCount = db_get_dw(NULL, pluginName, "maxQuestCount", 5);
- gbHandleAuthReq = db_get_b(NULL, pluginName, "handleAuthReq", 1);
- gbQuestion = DBGetContactSettingStringPAN(NULL, pluginName, "question", TranslateW(defQuestion));
- gbAnswer = DBGetContactSettingStringPAN(NULL, pluginName, "answer", L"nospam");
- gbCongratulation = DBGetContactSettingStringPAN(NULL, pluginName, "congratulation", TranslateW(defCongrats));
- gbAuthRepl = DBGetContactSettingStringPAN(NULL, pluginName, "authrepl", TranslateW(defAuthReply));
- gbSpecialGroup = db_get_b(NULL, pluginName, "SpecialGroup", 0);
- gbHideContacts = db_get_b(NULL, pluginName, "HideContacts", 0);
- gbIgnoreContacts = db_get_b(NULL, pluginName, "IgnoreContacts", 0);
- gbExclude = db_get_b(NULL, pluginName, "ExcludeContacts", 1);
- gbDelExcluded = db_get_b(NULL, pluginName, "DelExcluded", 0);
- gbDelAllTempory = db_get_b(NULL, pluginName, "DelAllTempory", 0);
- gbCaseInsensitive = db_get_b(NULL, pluginName, "CaseInsensitive", 0);
- gbRegexMatch = db_get_b(NULL, pluginName, "RegexMatch", 0);
- gbInvisDisable = db_get_b(NULL, pluginName, "DisableInInvis", 0);
- gbIgnoreURL = db_get_b(NULL, pluginName, "IgnoreURL", 0);
- gbAutoAuthGroup = DBGetContactSettingStringPAN(NULL, pluginName, "AutoAuthGroup", L"Not Spammers");
- gbAutoAuth = db_get_b(NULL, pluginName, "AutoAuth", 0);
- gbAutoAddToServerList = db_get_b(NULL, pluginName, "AutoAddToServerList", 0);
- gbAutoReqAuth = db_get_b(NULL, pluginName, "AutoReqAuth", 0);
- gbLogToFile = db_get_b(NULL, pluginName, "LogSpamToFile", 0);
- gbHistoryLog = db_get_b(NULL, pluginName, "HistoryLog", 0);
- gbMathExpression = db_get_b(NULL, pluginName, "MathExpression", 0);
+ gbSpammersGroup = DBGetContactSettingStringPAN(NULL, MODULENAME, "SpammersGroup", L"Spammers");
+ gbAnswer = DBGetContactSettingStringPAN(NULL, MODULENAME, "answer", L"nospam");
+ gbInfTalkProtection = db_get_b(NULL, MODULENAME, "infTalkProtection", 0);
+ gbAddPermanent = db_get_b(NULL, MODULENAME, "addPermanent", 0);
+ gbMaxQuestCount = db_get_dw(NULL, MODULENAME, "maxQuestCount", 5);
+ gbHandleAuthReq = db_get_b(NULL, MODULENAME, "handleAuthReq", 1);
+ gbQuestion = DBGetContactSettingStringPAN(NULL, MODULENAME, "question", TranslateW(defQuestion));
+ gbAnswer = DBGetContactSettingStringPAN(NULL, MODULENAME, "answer", L"nospam");
+ gbCongratulation = DBGetContactSettingStringPAN(NULL, MODULENAME, "congratulation", TranslateW(defCongrats));
+ gbAuthRepl = DBGetContactSettingStringPAN(NULL, MODULENAME, "authrepl", TranslateW(defAuthReply));
+ gbSpecialGroup = db_get_b(NULL, MODULENAME, "SpecialGroup", 0);
+ gbHideContacts = db_get_b(NULL, MODULENAME, "HideContacts", 0);
+ gbIgnoreContacts = db_get_b(NULL, MODULENAME, "IgnoreContacts", 0);
+ gbExclude = db_get_b(NULL, MODULENAME, "ExcludeContacts", 1);
+ gbDelExcluded = db_get_b(NULL, MODULENAME, "DelExcluded", 0);
+ gbDelAllTempory = db_get_b(NULL, MODULENAME, "DelAllTempory", 0);
+ gbCaseInsensitive = db_get_b(NULL, MODULENAME, "CaseInsensitive", 0);
+ gbRegexMatch = db_get_b(NULL, MODULENAME, "RegexMatch", 0);
+ gbInvisDisable = db_get_b(NULL, MODULENAME, "DisableInInvis", 0);
+ gbIgnoreURL = db_get_b(NULL, MODULENAME, "IgnoreURL", 0);
+ gbAutoAuthGroup = DBGetContactSettingStringPAN(NULL, MODULENAME, "AutoAuthGroup", L"Not Spammers");
+ gbAutoAuth = db_get_b(NULL, MODULENAME, "AutoAuth", 0);
+ gbAutoAddToServerList = db_get_b(NULL, MODULENAME, "AutoAddToServerList", 0);
+ gbAutoReqAuth = db_get_b(NULL, MODULENAME, "AutoReqAuth", 0);
+ gbLogToFile = db_get_b(NULL, MODULENAME, "LogSpamToFile", 0);
+ gbHistoryLog = db_get_b(NULL, MODULENAME, "HistoryLog", 0);
+ gbMathExpression = db_get_b(NULL, MODULENAME, "MathExpression", 0);
}
static int OnSystemModulesLoaded(WPARAM, LPARAM)
diff --git a/plugins/StopSpamMod/src/options.cpp b/plugins/StopSpamMod/src/options.cpp index 1ed210bdc3..9847352c76 100755 --- a/plugins/StopSpamMod/src/options.cpp +++ b/plugins/StopSpamMod/src/options.cpp @@ -47,13 +47,13 @@ public: }
virtual void OnApply() override
{
- db_set_dw(NULL, pluginName, "maxQuestCount", gbMaxQuestCount = edit_MAXQUESTCOUNT.GetInt());
- db_set_b(NULL, pluginName, "infTalkProtection", gbInfTalkProtection = chk_INFTALKPROT.GetState());
- db_set_b(NULL, pluginName, "addPermanent", gbAddPermanent = chk_ADDPERMANENT.GetState());
- db_set_b(NULL, pluginName, "handleAuthReq", gbHandleAuthReq = chk_HANDLEAUTHREQ.GetState());
- db_set_b(NULL, pluginName, "HideContacts", gbHideContacts = chk_HIDECONTACTS.GetState());
- db_set_b(NULL, pluginName, "IgnoreContacts", gbIgnoreContacts = chk_IGNORESPAMMERS.GetState());
- db_set_b(NULL, pluginName, "LogSpamToFile", gbLogToFile = chk_LOGSPAMTOFILE.GetState());
+ db_set_dw(NULL, MODULENAME, "maxQuestCount", gbMaxQuestCount = edit_MAXQUESTCOUNT.GetInt());
+ db_set_b(NULL, MODULENAME, "infTalkProtection", gbInfTalkProtection = chk_INFTALKPROT.GetState());
+ db_set_b(NULL, MODULENAME, "addPermanent", gbAddPermanent = chk_ADDPERMANENT.GetState());
+ db_set_b(NULL, MODULENAME, "handleAuthReq", gbHandleAuthReq = chk_HANDLEAUTHREQ.GetState());
+ db_set_b(NULL, MODULENAME, "HideContacts", gbHideContacts = chk_HIDECONTACTS.GetState());
+ db_set_b(NULL, MODULENAME, "IgnoreContacts", gbIgnoreContacts = chk_IGNORESPAMMERS.GetState());
+ db_set_b(NULL, MODULENAME, "LogSpamToFile", gbLogToFile = chk_LOGSPAMTOFILE.GetState());
}
private:
CCtrlCheck chk_INFTALKPROT, chk_ADDPERMANENT, chk_HANDLEAUTHREQ, chk_HIDECONTACTS, chk_IGNORESPAMMERS, chk_LOGSPAMTOFILE;
@@ -85,14 +85,14 @@ public: }
virtual void OnApply() override
{
- db_set_ws(NULL, pluginName, "question", edit_QUESTION.GetText());
- gbQuestion = DBGetContactSettingStringPAN(NULL, pluginName, "question", TranslateW(defQuestion));
- db_set_ws(NULL, pluginName, "answer", edit_ANSWER.GetText());
- gbAnswer = DBGetContactSettingStringPAN(NULL, pluginName, "answer", L"nospam");
- db_set_ws(NULL, pluginName, "authrepl", edit_AUTHREPL.GetText());
- gbAuthRepl = DBGetContactSettingStringPAN(NULL, pluginName, "authrepl", TranslateW(defAuthReply));
- db_set_ws(NULL, pluginName, "congratulation", edit_CONGRATULATION.GetText());
- gbCongratulation = DBGetContactSettingStringPAN(NULL, pluginName, "congratulation", TranslateW(defCongrats));
+ db_set_ws(NULL, MODULENAME, "question", edit_QUESTION.GetText());
+ gbQuestion = DBGetContactSettingStringPAN(NULL, MODULENAME, "question", TranslateW(defQuestion));
+ db_set_ws(NULL, MODULENAME, "answer", edit_ANSWER.GetText());
+ gbAnswer = DBGetContactSettingStringPAN(NULL, MODULENAME, "answer", L"nospam");
+ db_set_ws(NULL, MODULENAME, "authrepl", edit_AUTHREPL.GetText());
+ gbAuthRepl = DBGetContactSettingStringPAN(NULL, MODULENAME, "authrepl", TranslateW(defAuthReply));
+ db_set_ws(NULL, MODULENAME, "congratulation", edit_CONGRATULATION.GetText());
+ gbCongratulation = DBGetContactSettingStringPAN(NULL, MODULENAME, "congratulation", TranslateW(defCongrats));
}
void onClick_RESTOREDEFAULTS(CCtrlButton*)
{
@@ -143,7 +143,7 @@ public: out << str << "\r\n";
mir_free(str);
}
- db_set_s(NULL, pluginName, "protoList", out.str().c_str());
+ db_set_s(NULL, MODULENAME, "protoList", out.str().c_str());
}
void onClick_ADD(CCtrlButton*)
{
@@ -213,38 +213,38 @@ public: }
virtual void OnApply() override
{
- db_set_b(NULL, pluginName, "CaseInsensitive", gbCaseInsensitive = chk_CASE_INSENSITIVE.GetState());
- db_set_b(NULL, pluginName, "DisableInInvis", gbInvisDisable = chk_INVIS_DISABLE.GetState());
+ db_set_b(NULL, MODULENAME, "CaseInsensitive", gbCaseInsensitive = chk_CASE_INSENSITIVE.GetState());
+ db_set_b(NULL, MODULENAME, "DisableInInvis", gbInvisDisable = chk_INVIS_DISABLE.GetState());
{
static wstring NewGroupName = edit_SPECIALGROUPNAME.GetText(), CurrentGroupName;
- CurrentGroupName = gbSpammersGroup = DBGetContactSettingStringPAN(NULL, pluginName, "SpammersGroup", L"0");
+ CurrentGroupName = gbSpammersGroup = DBGetContactSettingStringPAN(NULL, MODULENAME, "SpammersGroup", L"0");
if (mir_wstrcmp(CurrentGroupName.c_str(), NewGroupName.c_str()) != 0) {
bool GroupExist = Clist_GroupExists(NewGroupName.c_str()) != NULL;
- db_set_ws(NULL, pluginName, "SpammersGroup", NewGroupName.c_str());
- gbSpammersGroup = DBGetContactSettingStringPAN(NULL, pluginName, "SpammersGroup", L"Spammers");
+ db_set_ws(NULL, MODULENAME, "SpammersGroup", NewGroupName.c_str());
+ gbSpammersGroup = DBGetContactSettingStringPAN(NULL, MODULENAME, "SpammersGroup", L"Spammers");
if (!GroupExist && gbSpecialGroup)
Clist_GroupCreate(0, gbSpammersGroup.c_str());
}
}
- db_set_b(NULL, pluginName, "SpecialGroup", gbSpecialGroup = chk_SPECIALGROUP.GetState());
- db_set_b(NULL, pluginName, "ExcludeContacts", gbExclude = chk_EXCLUDE.GetState());
- db_set_b(NULL, pluginName, "DelExcluded", gbDelExcluded = chk_REMOVE_TMP.GetState());
- db_set_b(NULL, pluginName, "DelAllTempory", gbDelAllTempory = chk_REMOVE_TMP_ALL.GetState());
- db_set_b(NULL, pluginName, "IgnoreURL", gbIgnoreURL = chk_IGNOREURL.GetState());
+ db_set_b(NULL, MODULENAME, "SpecialGroup", gbSpecialGroup = chk_SPECIALGROUP.GetState());
+ db_set_b(NULL, MODULENAME, "ExcludeContacts", gbExclude = chk_EXCLUDE.GetState());
+ db_set_b(NULL, MODULENAME, "DelExcluded", gbDelExcluded = chk_REMOVE_TMP.GetState());
+ db_set_b(NULL, MODULENAME, "DelAllTempory", gbDelAllTempory = chk_REMOVE_TMP_ALL.GetState());
+ db_set_b(NULL, MODULENAME, "IgnoreURL", gbIgnoreURL = chk_IGNOREURL.GetState());
- db_set_b(NULL, pluginName, "AutoAuth", gbAutoAuth = chk_AUTOAUTH.GetState());
- db_set_b(NULL, pluginName, "AutoAddToServerList", gbAutoAddToServerList = chk_ADDTOSRVLST.GetState());
- db_set_b(NULL, pluginName, "AutoReqAuth", gbAutoReqAuth = chk_REQAUTH.GetState());
- db_set_b(NULL, pluginName, "RegexMatch", gbRegexMatch = chk_REGEX.GetState());
- db_set_b(NULL, pluginName, "HistoryLog", gbHistoryLog = chk_HISTORY_LOG.GetState());
- db_set_b(NULL, pluginName, "MathExpression", gbMathExpression = chk_MATH_QUESTION.GetState());
+ db_set_b(NULL, MODULENAME, "AutoAuth", gbAutoAuth = chk_AUTOAUTH.GetState());
+ db_set_b(NULL, MODULENAME, "AutoAddToServerList", gbAutoAddToServerList = chk_ADDTOSRVLST.GetState());
+ db_set_b(NULL, MODULENAME, "AutoReqAuth", gbAutoReqAuth = chk_REQAUTH.GetState());
+ db_set_b(NULL, MODULENAME, "RegexMatch", gbRegexMatch = chk_REGEX.GetState());
+ db_set_b(NULL, MODULENAME, "HistoryLog", gbHistoryLog = chk_HISTORY_LOG.GetState());
+ db_set_b(NULL, MODULENAME, "MathExpression", gbMathExpression = chk_MATH_QUESTION.GetState());
{
static wstring NewAGroupName = edit_AUTOADDGROUP.GetText(), CurrentAGroupName;
- CurrentAGroupName = gbAutoAuthGroup = DBGetContactSettingStringPAN(NULL, pluginName, "AutoAuthGroup", L"0");
+ CurrentAGroupName = gbAutoAuthGroup = DBGetContactSettingStringPAN(NULL, MODULENAME, "AutoAuthGroup", L"0");
if (mir_wstrcmp(CurrentAGroupName.c_str(), NewAGroupName.c_str()) != 0) {
bool GroupExist = Clist_GroupExists(NewAGroupName.c_str()) != NULL;
- db_set_ws(NULL, pluginName, "AutoAuthGroup", NewAGroupName.c_str());
- gbAutoAuthGroup = DBGetContactSettingStringPAN(NULL, pluginName, "AutoAuthGroup", L"Not Spammers");
+ db_set_ws(NULL, MODULENAME, "AutoAuthGroup", NewAGroupName.c_str());
+ gbAutoAuthGroup = DBGetContactSettingStringPAN(NULL, MODULENAME, "AutoAuthGroup", L"Not Spammers");
if (!GroupExist && gbAutoAddToServerList)
Clist_GroupCreate(0, gbAutoAuthGroup.c_str());
}
diff --git a/plugins/StopSpamMod/src/stdafx.h b/plugins/StopSpamMod/src/stdafx.h index 1ff0aa6958..d6ccebe6dd 100755 --- a/plugins/StopSpamMod/src/stdafx.h +++ b/plugins/StopSpamMod/src/stdafx.h @@ -37,9 +37,7 @@ using namespace std; struct CMPlugin : public PLUGIN<CMPlugin> { - CMPlugin() : - PLUGIN<CMPlugin>(pluginName) - {} + CMPlugin(); }; extern HANDLE hStopSpamLogDirH; diff --git a/plugins/StopSpamMod/src/stopspam.cpp b/plugins/StopSpamMod/src/stopspam.cpp index 8eaea7f827..d9da28ef66 100755 --- a/plugins/StopSpamMod/src/stopspam.cpp +++ b/plugins/StopSpamMod/src/stopspam.cpp @@ -38,7 +38,7 @@ int OnDbEventAdded(WPARAM hContact, LPARAM hDbEvent) // if request is from unknown or not marked Answered contact int a = db_get_b(hcntct, "CList", "NotOnList", 0); - int b = !db_get_b(hcntct, pluginName, "Answered", 0); + int b = !db_get_b(hcntct, MODULENAME, "Answered", 0); if (a && b) { // ...send message @@ -84,11 +84,11 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) } //do not check excluded contact - if (db_get_b(hContact, pluginName, "Answered", 0)) + if (db_get_b(hContact, MODULENAME, "Answered", 0)) return 0; - if (db_get_b(hContact, pluginName, "Excluded", 0)) { + if (db_get_b(hContact, MODULENAME, "Excluded", 0)) { if (!db_get_b(hContact, "CList", "NotOnList", 0)) - db_unset(hContact, pluginName, "Excluded"); + db_unset(hContact, MODULENAME, "Excluded"); return 0; } //we want block not only messages, i seen many types other eventtype flood @@ -97,8 +97,8 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) return 0; //mark contact which we trying to contact for exclude from check if ((dbei->flags & DBEF_SENT) && db_get_b(hContact, "CList", "NotOnList", 0) - && (!gbMaxQuestCount || db_get_dw(hContact, pluginName, "QuestionCount", 0) < gbMaxQuestCount) && gbExclude) { - db_set_b(hContact, pluginName, "Excluded", 1); + && (!gbMaxQuestCount || db_get_dw(hContact, MODULENAME, "QuestionCount", 0) < gbMaxQuestCount) && gbExclude) { + db_set_b(hContact, MODULENAME, "Excluded", 1); return 0; } // if message is from known or marked Answered contact @@ -137,7 +137,7 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) if (gbMathExpression) { if (boost::algorithm::all(message, boost::is_digit())) { int num = _wtoi(message.c_str()); - int math_answer = db_get_dw(hContact, pluginName, "MathAnswer", 0); + int math_answer = db_get_dw(hContact, MODULENAME, "MathAnswer", 0); if (num && math_answer) answered = (num == math_answer); } @@ -162,10 +162,10 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) // unhide contact db_unset(hContact, "CList", "Hidden"); - db_unset(hContact, pluginName, "MathAnswer"); + db_unset(hContact, MODULENAME, "MathAnswer"); // mark contact as Answered - db_set_b(hContact, pluginName, "Answered", 1); + db_set_b(hContact, MODULENAME, "Answered", 1); //add contact permanently if (gbAddPermanent) //do not use this ) @@ -204,7 +204,7 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) // and question count for this contact is less then maximum if (bSendMsg) { if ((!gbInfTalkProtection || wstring::npos == message.find(L"StopSpam automatic message:\r\n")) - && (!gbMaxQuestCount || db_get_dw(hContact, pluginName, "QuestionCount", 0) < gbMaxQuestCount)) { + && (!gbMaxQuestCount || db_get_dw(hContact, MODULENAME, "QuestionCount", 0) < gbMaxQuestCount)) { // send question wstring q; if (gbInfTalkProtection) @@ -264,7 +264,7 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) else break; } - db_set_dw(hContact, pluginName, "MathAnswer", math_answer); + db_set_dw(hContact, MODULENAME, "MathAnswer", math_answer); q += variables_parse(tmp_question, hContact); } else @@ -273,8 +273,8 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) ProtoChainSend(hContact, PSS_MESSAGE, 0, ptrA(mir_utf8encodeW(q.c_str()))); // increment question count - DWORD questCount = db_get_dw(hContact, pluginName, "QuestionCount", 0); - db_set_dw(hContact, pluginName, "QuestionCount", questCount + 1); + DWORD questCount = db_get_dw(hContact, MODULENAME, "QuestionCount", 0); + db_set_dw(hContact, MODULENAME, "QuestionCount", questCount + 1); } else { if (gbIgnoreContacts) @@ -288,7 +288,7 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) db_set_b(hContact, "CList", "NotOnList", 1); // save first message from contact - if (db_get_dw(hContact, pluginName, "QuestionCount", 0) < 2) { + if (db_get_dw(hContact, MODULENAME, "QuestionCount", 0) < 2) { dbei->flags |= DBEF_READ; db_event_add(hContact, dbei); }; @@ -308,8 +308,8 @@ int OnDbContactSettingChanged(WPARAM w, LPARAM l) if (strcmp(cws->szSetting, "NotOnList")) return 0; if (!cws->value.type) { - db_unset(hContact, pluginName, "Answered"); - db_unset(hContact, pluginName, "QuestionCount"); + db_unset(hContact, MODULENAME, "Answered"); + db_unset(hContact, MODULENAME, "QuestionCount"); } return 0; diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp index 5cd1e160a6..9b3dddc380 100755 --- a/plugins/StopSpamMod/src/utilities.cpp +++ b/plugins/StopSpamMod/src/utilities.cpp @@ -56,7 +56,7 @@ wstring &GetDlgItemString(HWND hwnd, int id) std::string &GetProtoList()
{
static std::string s;
- return s = DBGetContactSettingStringPAN_A(NULL, pluginName, "protoList", "ICQ\r\n");
+ return s = DBGetContactSettingStringPAN_A(NULL, MODULENAME, "protoList", "ICQ\r\n");
}
bool ProtoInList(const char *szProto)
@@ -286,7 +286,7 @@ void __cdecl CleanProtocolExclThread(void *param) std::list<MCONTACT> contacts;
for (auto &hContact : Contacts(szProto))
- if (db_get_b(hContact, "CList", "NotOnList", 0) && db_get_b(hContact, pluginName, "Excluded", 0))
+ if (db_get_b(hContact, "CList", "NotOnList", 0) && db_get_b(hContact, MODULENAME, "Excluded", 0))
contacts.push_back(hContact);
Sleep(5000);
@@ -321,7 +321,7 @@ void __cdecl CleanThread(void*) void HistoryLog(MCONTACT hContact, char *data, int event_type, int flags)
{
DBEVENTINFO Event = {};
- Event.szModule = pluginName;
+ Event.szModule = MODULENAME;
Event.eventType = event_type;
Event.flags = flags | DBEF_UTF;
Event.timestamp = (DWORD)time(0);
diff --git a/plugins/StopSpamPlus/src/events.cpp b/plugins/StopSpamPlus/src/events.cpp index e8a7f4a7e1..2c2a077b65 100644 --- a/plugins/StopSpamPlus/src/events.cpp +++ b/plugins/StopSpamPlus/src/events.cpp @@ -26,7 +26,7 @@ int OnDbEventAdded(WPARAM, LPARAM lParam) // if request is from unknown or not marked Answered contact
//and if I don't sent message to this contact
- if (db_get_b(hcntct, "CList", "NotOnList", 0) && !db_get_b(hcntct, pluginName, answeredSetting, 0) && !IsExistMyMessage(hcntct)) {
+ if (db_get_b(hcntct, "CList", "NotOnList", 0) && !db_get_b(hcntct, MODULENAME, answeredSetting, 0) && !IsExistMyMessage(hcntct)) {
if (!g_sets.HandleAuthReq) {
char *buf = mir_utf8encodeW(variables_parse(g_sets.AuthRepl, hcntct).c_str());
ProtoChainSend(hcntct, PSS_MESSAGE, 0, (LPARAM)buf);
@@ -66,7 +66,7 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) return 0;
// if message is from known or marked Answered contact
- if (db_get_b(hContact, pluginName, answeredSetting, 0))
+ if (db_get_b(hContact, MODULENAME, answeredSetting, 0))
// ...let the event go its way
return 0;
@@ -113,7 +113,7 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) db_unset(hContact, "CList", "Hidden");
// mark contact as Answered
- db_set_b(hContact, pluginName, answeredSetting, 1);
+ db_set_b(hContact, MODULENAME, answeredSetting, 1);
//add contact permanently
if (g_sets.AddPermanent)
@@ -135,7 +135,7 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) // if message message does not contain infintite talk protection prefix
// and question count for this contact is less then maximum
const wchar_t *pwszPrefix = TranslateT("StopSpam automatic message:\r\n");
- if ((!g_sets.InfTalkProtection || tstring::npos == message.find(pwszPrefix)) && (!g_sets.MaxQuestCount || db_get_dw(hContact, pluginName, questCountSetting, 0) < g_sets.MaxQuestCount)) {
+ if ((!g_sets.InfTalkProtection || tstring::npos == message.find(pwszPrefix)) && (!g_sets.MaxQuestCount || db_get_dw(hContact, MODULENAME, questCountSetting, 0) < g_sets.MaxQuestCount)) {
// send question
tstring q = pwszPrefix + variables_parse(g_sets.Question, hContact);
@@ -146,8 +146,8 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) // increment question count
- DWORD questCount = db_get_dw(hContact, pluginName, questCountSetting, 0);
- db_set_dw(hContact, pluginName, questCountSetting, questCount + 1);
+ DWORD questCount = db_get_dw(hContact, MODULENAME, questCountSetting, 0);
+ db_set_dw(hContact, MODULENAME, questCountSetting, questCount + 1);
}
// hide contact from contact list
@@ -173,8 +173,8 @@ int OnDbContactSettingchanged(WPARAM hContact, LPARAM l) return 0;
if (!cws->value.type) {
- db_unset(hContact, pluginName, answeredSetting);
- db_unset(hContact, pluginName, questCountSetting);
+ db_unset(hContact, MODULENAME, answeredSetting);
+ db_unset(hContact, MODULENAME, questCountSetting);
}
return 0;
diff --git a/plugins/StopSpamPlus/src/options.cpp b/plugins/StopSpamPlus/src/options.cpp index d540a290d5..43f33b1030 100644 --- a/plugins/StopSpamPlus/src/options.cpp +++ b/plugins/StopSpamPlus/src/options.cpp @@ -9,7 +9,7 @@ class COptMainDlg : public CPluginDlgBase public:
COptMainDlg() :
- CPluginDlgBase(g_plugin, IDD_MAIN, pluginName),
+ CPluginDlgBase(g_plugin, IDD_MAIN, MODULENAME),
edtCount(this, ID_MAXQUESTCOUNT),
edtDescr(this, ID_DESCRIPTION),
chk1(this, ID_INFTALKPROT),
@@ -44,7 +44,7 @@ class COptMessageDlg : public CPluginDlgBase public:
COptMessageDlg() :
- CPluginDlgBase(g_plugin, IDD_MESSAGES, pluginName),
+ CPluginDlgBase(g_plugin, IDD_MESSAGES, MODULENAME),
btnHelp(this, IDC_VARS),
btnRestore(this, ID_RESTOREDEFAULTS),
edtQuestion(this, ID_QUESTION),
@@ -94,7 +94,7 @@ class COptAccountDlg : public CPluginDlgBase public:
COptAccountDlg() :
- CPluginDlgBase(g_plugin, IDD_PROTO, pluginName),
+ CPluginDlgBase(g_plugin, IDD_PROTO, MODULENAME),
m_accounts(this, IDC_PROTO)
{
m_accounts.OnItemChanged = Callback(this, &COptAccountDlg::list_OnItemChanged);
@@ -159,7 +159,7 @@ int OnOptInit(WPARAM w, LPARAM) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.szGroup.a = LPGEN("Message sessions");
- odp.szTitle.a = pluginName;
+ odp.szTitle.a = MODULENAME;
odp.szTab.a = LPGEN("General");
odp.pDialog = new COptMainDlg();
diff --git a/plugins/StopSpamPlus/src/services.cpp b/plugins/StopSpamPlus/src/services.cpp index 3692a4a411..9cb028e983 100644 --- a/plugins/StopSpamPlus/src/services.cpp +++ b/plugins/StopSpamPlus/src/services.cpp @@ -9,7 +9,7 @@ INT_PTR IsContactPassed(WPARAM hContact, LPARAM /*lParam*/) if (!g_sets.ProtoDisabled(szProto))
return CS_PASSED;
- if (db_get_b(hContact, pluginName, answeredSetting, 0))
+ if (db_get_b(hContact, MODULENAME, answeredSetting, 0))
return CS_PASSED;
if (!db_get_b(hContact, "CList", "NotOnList", 0) && db_get_w(hContact, szProto, "SrvGroupId", -1) != 1)
@@ -63,7 +63,7 @@ INT_PTR RemoveTempContacts(WPARAM, LPARAM lParam) hGroup++;
} while (group_name);
if (!lParam)
- MessageBox(nullptr, TranslateT("Complete"), TranslateT(pluginName), MB_ICONINFORMATION);
+ MessageBox(nullptr, TranslateT("Complete"), TranslateT(MODULENAME), MB_ICONINFORMATION);
return 0;
}
diff --git a/plugins/StopSpamPlus/src/settings.cpp b/plugins/StopSpamPlus/src/settings.cpp index 98c7b85139..0e133956d4 100644 --- a/plugins/StopSpamPlus/src/settings.cpp +++ b/plugins/StopSpamPlus/src/settings.cpp @@ -5,18 +5,18 @@ Settings g_sets; /////////////////////////////////////////////////////////////////////////////////////////
Settings::Settings() :
- Question(pluginName, "Question", TranslateW(L"Spammers made me to install small anti-spam system you are now speaking with. Please reply \"nospam\" without quotes and spaces if you want to contact me.")),
- AuthRepl(pluginName, "AuthReply", TranslateW(L"StopSpam: send a message and reply to an anti-spam bot question.")),
- Answer(pluginName, "Answer", L"nospam"),
- Congratulation(pluginName, "Congratulation", TranslateW(L"Congratulations! You just passed human/robot test. Now you can write me a message.")),
- DisabledProtoList(pluginName, "DisabledProtoList", "MetaContacts RSSNews"),
- InfTalkProtection(pluginName, "InfTalkProtection", 1),
- AddPermanent(pluginName, "AddPermanent", 0),
- HandleAuthReq(pluginName, "HandleAuthReq", 0),
- MaxQuestCount(pluginName, "MaxQuestCount", 2),
- AnswNotCaseSens(pluginName, "AnswNotCaseSens", 1),
- AnswSplitString(pluginName, "AnswSplitString", L"|"),
- RemTmpAll(pluginName, "RemTmpAll", 1),
- HistLog(pluginName, "HistLog", 0)
+ Question(MODULENAME, "Question", TranslateW(L"Spammers made me to install small anti-spam system you are now speaking with. Please reply \"nospam\" without quotes and spaces if you want to contact me.")),
+ AuthRepl(MODULENAME, "AuthReply", TranslateW(L"StopSpam: send a message and reply to an anti-spam bot question.")),
+ Answer(MODULENAME, "Answer", L"nospam"),
+ Congratulation(MODULENAME, "Congratulation", TranslateW(L"Congratulations! You just passed human/robot test. Now you can write me a message.")),
+ DisabledProtoList(MODULENAME, "DisabledProtoList", "MetaContacts RSSNews"),
+ InfTalkProtection(MODULENAME, "InfTalkProtection", 1),
+ AddPermanent(MODULENAME, "AddPermanent", 0),
+ HandleAuthReq(MODULENAME, "HandleAuthReq", 0),
+ MaxQuestCount(MODULENAME, "MaxQuestCount", 2),
+ AnswNotCaseSens(MODULENAME, "AnswNotCaseSens", 1),
+ AnswSplitString(MODULENAME, "AnswSplitString", L"|"),
+ RemTmpAll(MODULENAME, "RemTmpAll", 1),
+ HistLog(MODULENAME, "HistLog", 0)
{
}
diff --git a/plugins/StopSpamPlus/src/stdafx.h b/plugins/StopSpamPlus/src/stdafx.h index c92038517c..7222611019 100644 --- a/plugins/StopSpamPlus/src/stdafx.h +++ b/plugins/StopSpamPlus/src/stdafx.h @@ -29,13 +29,11 @@ typedef std::wstring tstring; #include "resource.h"
#include "settings.h"
-#define pluginName LPGEN("StopSpam")
+#define MODULENAME LPGEN("StopSpam")
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(pluginName)
- {}
+ CMPlugin();
};
extern char const *answeredSetting;
diff --git a/plugins/StopSpamPlus/src/stopspam.cpp b/plugins/StopSpamPlus/src/stopspam.cpp index 8a64463236..38af9acb47 100644 --- a/plugins/StopSpamPlus/src/stopspam.cpp +++ b/plugins/StopSpamPlus/src/stopspam.cpp @@ -20,6 +20,10 @@ PLUGININFOEX pluginInfoEx = { { 0x553811ee, 0xdeb6, 0x48b8, { 0x89, 0x2, 0xa8, 0xa0, 0xc, 0x1f, 0xd6, 0x79 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
diff --git a/plugins/StopSpamPlus/src/utils.cpp b/plugins/StopSpamPlus/src/utils.cpp index 897c403178..a71e829d24 100644 --- a/plugins/StopSpamPlus/src/utils.cpp +++ b/plugins/StopSpamPlus/src/utils.cpp @@ -22,7 +22,7 @@ bool IsExistMyMessage(MCONTACT hContact) if (dbei.flags & DBEF_SENT){
// mark contact as Answered
- db_set_b(hContact, pluginName, answeredSetting, 1);
+ db_set_b(hContact, MODULENAME, answeredSetting, 1);
// ...let the event go its way
return true;
}
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index 7b1a36f1fb..de48faf728 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -1125,9 +1125,7 @@ struct SKINDESC struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(SRMSGMOD)
- {}
+ CMPlugin();
};
#endif /* _MSGS_H */
diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp index 5c09ec31cb..53b1a0dbc3 100644 --- a/plugins/TabSRMM/src/srmm.cpp +++ b/plugins/TabSRMM/src/srmm.cpp @@ -40,7 +40,7 @@ CLIST_INTERFACE *pcli; ///////////////////////////////////////////////////////////////////////////////////////// -PLUGININFOEX pluginInfo = { +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), @@ -53,9 +53,13 @@ PLUGININFOEX pluginInfo = { { 0x6ca5f042, 0x7a7f, 0x47cc, { 0xa7, 0x15, 0xfc, 0x8c, 0x46, 0xfb, 0xf4, 0x34 } } }; +CMPlugin::CMPlugin() : + PLUGIN<CMPlugin>(SRMSGMOD, pluginInfoEx) +{} + extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { - return &pluginInfo; + return &pluginInfoEx; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -72,7 +76,7 @@ extern "C" int __declspec(dllexport) Load(void) } pcli = Clist_GetInterface(); - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(lfDefault), &lfDefault, FALSE); diff --git a/plugins/TabSRMM/src/stdafx.h b/plugins/TabSRMM/src/stdafx.h index f346cb50eb..6eea03c043 100644 --- a/plugins/TabSRMM/src/stdafx.h +++ b/plugins/TabSRMM/src/stdafx.h @@ -217,7 +217,6 @@ extern TContainerData *pFirstContainer, *pLastActiveContainer; extern ButtonSet g_ButtonSet;
extern HANDLE g_hEvent;
extern RECT rcLastStatusBarClick;
-extern PLUGININFOEX pluginInfo;
extern TTemplateSet RTL_Active, LTR_Active;
extern LOGFONTA logfonts[MSGDLGFONTCOUNT + 2];
extern COLORREF fontcolors[MSGDLGFONTCOUNT + 2];
diff --git a/plugins/TipperYM/src/message_pump.cpp b/plugins/TipperYM/src/message_pump.cpp index 5eb1182f15..ac94a7b7f8 100644 --- a/plugins/TipperYM/src/message_pump.cpp +++ b/plugins/TipperYM/src/message_pump.cpp @@ -56,7 +56,7 @@ bool NeedWaitForContent(CLCINFOTIPEX *clcitex) if (opt.bWaitForStatusMsg && !bStatusMsgReady)
{
- db_unset(hContact, MODULE, "TempStatusMsg");
+ db_unset(hContact, MODULENAME, "TempStatusMsg");
if (CanRetrieveStatusMsg(hContact, szProto) && ProtoChainSend(hContact, PSS_GETAWAYMSG, 0, 0))
{
if (WaitForContentTimerID)
@@ -161,7 +161,7 @@ unsigned int CALLBACK MessagePumpThread(void*) }
if (swzMsg) {
- db_set_ws((DWORD_PTR)clcitex->hItem, MODULE, "TempStatusMsg", swzMsg);
+ db_set_ws((DWORD_PTR)clcitex->hItem, MODULENAME, "TempStatusMsg", swzMsg);
mir_free(swzMsg);
}
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index 3e920bb3d4..0f62a94f93 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -36,7 +36,7 @@ extern int IsTrayProto(const wchar_t *swzProto, BOOL bExtendedTip) DBVARIANT dbv;
int result = 1;
- if (!db_get_ws(NULL, MODULE, szSetting, &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, szSetting, &dbv)) {
result = wcsstr(dbv.ptszVal, swzProto) ? 1 : 0;
db_free(&dbv);
}
@@ -219,43 +219,43 @@ void SaveDI(DISPLAYITEM *di, int index) void SaveOptions()
{
- db_set_dw(0, MODULE, "MaxWidth", opt.iWinWidth);
- db_set_dw(0, MODULE, "MaxHeight", opt.iWinMaxHeight);
- db_set_b(0, MODULE, "AvatarOpacity", (BYTE)opt.iAvatarOpacity);
- db_set_b(0, MODULE, "AvatarRoundCorners", (opt.bAvatarRound ? 1 : 0));
- db_set_b(0, MODULE, "TitleIconLayout", (BYTE)opt.titleIconLayout);
- db_set_b(0, MODULE, "TitleShow", (opt.bShowTitle ? 1 : 0));
+ db_set_dw(0, MODULENAME, "MaxWidth", opt.iWinWidth);
+ db_set_dw(0, MODULENAME, "MaxHeight", opt.iWinMaxHeight);
+ db_set_b(0, MODULENAME, "AvatarOpacity", (BYTE)opt.iAvatarOpacity);
+ db_set_b(0, MODULENAME, "AvatarRoundCorners", (opt.bAvatarRound ? 1 : 0));
+ db_set_b(0, MODULENAME, "TitleIconLayout", (BYTE)opt.titleIconLayout);
+ db_set_b(0, MODULENAME, "TitleShow", (opt.bShowTitle ? 1 : 0));
if (ServiceExists(MS_AV_DRAWAVATAR))
- db_set_b(0, MODULE, "AVLayout", (BYTE)opt.avatarLayout);
+ db_set_b(0, MODULENAME, "AVLayout", (BYTE)opt.avatarLayout);
opt.bWaitForAvatar = (opt.avatarLayout == PAV_NONE) ? false : true;
- db_set_dw(0, MODULE, "AVSize", opt.iAvatarSize);
- db_set_dw(0, MODULE, "TextIndent", opt.iTextIndent);
- db_set_dw(0, MODULE, "TitleIndent", opt.iTitleIndent);
- db_set_dw(0, MODULE, "ValueIndent", opt.iValueIndent);
- db_set_b(0, MODULE, "ShowNoFocus", (opt.bShowNoFocus ? 1 : 0));
+ db_set_dw(0, MODULENAME, "AVSize", opt.iAvatarSize);
+ db_set_dw(0, MODULENAME, "TextIndent", opt.iTextIndent);
+ db_set_dw(0, MODULENAME, "TitleIndent", opt.iTitleIndent);
+ db_set_dw(0, MODULENAME, "ValueIndent", opt.iValueIndent);
+ db_set_b(0, MODULENAME, "ShowNoFocus", (opt.bShowNoFocus ? 1 : 0));
- db_set_w(0, MODULE, "TimeIn", opt.iTimeIn);
+ db_set_w(0, MODULENAME, "TimeIn", opt.iTimeIn);
CallService(MS_CLC_SETINFOTIPHOVERTIME, opt.iTimeIn, 0);
- db_set_w(0, MODULE, "Padding", opt.iPadding);
- db_set_w(0, MODULE, "OuterAvatarPadding", opt.iOuterAvatarPadding);
- db_set_w(0, MODULE, "InnerAvatarPadding", opt.iInnerAvatarPadding);
- db_set_w(0, MODULE, "TextPadding", opt.iTextPadding);
- db_set_b(0, MODULE, "Position", (BYTE)opt.pos);
- db_set_dw(0, MODULE, "MinWidth", (DWORD)opt.iMinWidth);
- db_set_dw(0, MODULE, "MinHeight", (DWORD)opt.iMinHeight);
- db_set_dw(0, MODULE, "SidebarWidth", (DWORD)opt.iSidebarWidth);
- db_set_b(0, MODULE, "MouseTollerance", (BYTE)opt.iMouseTollerance);
- db_set_b(0, MODULE, "SBarTips", (opt.bStatusBarTips ? 1 : 0));
-
- db_set_w(0, MODULE, "LabelVAlign", opt.iLabelValign);
- db_set_w(0, MODULE, "LabelHAlign", opt.iLabelHalign);
- db_set_w(0, MODULE, "ValueVAlign", opt.iValueValign);
- db_set_w(0, MODULE, "ValueHAlign", opt.iValueHalign);
-
- db_set_b(0, MODULE, "OriginalAvSize", (opt.bOriginalAvatarSize ? 1 : 0));
- db_set_b(0, MODULE, "AvatarBorder", (opt.bAvatarBorder ? 1 : 0));
+ db_set_w(0, MODULENAME, "Padding", opt.iPadding);
+ db_set_w(0, MODULENAME, "OuterAvatarPadding", opt.iOuterAvatarPadding);
+ db_set_w(0, MODULENAME, "InnerAvatarPadding", opt.iInnerAvatarPadding);
+ db_set_w(0, MODULENAME, "TextPadding", opt.iTextPadding);
+ db_set_b(0, MODULENAME, "Position", (BYTE)opt.pos);
+ db_set_dw(0, MODULENAME, "MinWidth", (DWORD)opt.iMinWidth);
+ db_set_dw(0, MODULENAME, "MinHeight", (DWORD)opt.iMinHeight);
+ db_set_dw(0, MODULENAME, "SidebarWidth", (DWORD)opt.iSidebarWidth);
+ db_set_b(0, MODULENAME, "MouseTollerance", (BYTE)opt.iMouseTollerance);
+ db_set_b(0, MODULENAME, "SBarTips", (opt.bStatusBarTips ? 1 : 0));
+
+ db_set_w(0, MODULENAME, "LabelVAlign", opt.iLabelValign);
+ db_set_w(0, MODULENAME, "LabelHAlign", opt.iLabelHalign);
+ db_set_w(0, MODULENAME, "ValueVAlign", opt.iValueValign);
+ db_set_w(0, MODULENAME, "ValueHAlign", opt.iValueHalign);
+
+ db_set_b(0, MODULENAME, "OriginalAvSize", (opt.bOriginalAvatarSize ? 1 : 0));
+ db_set_b(0, MODULENAME, "AvatarBorder", (opt.bAvatarBorder ? 1 : 0));
}
void SaveItems()
@@ -286,16 +286,16 @@ void SaveItems() void SaveSkinOptions()
{
- db_set_b(0, MODULE, "Border", (opt.bBorder ? 1 : 0));
- db_set_b(0, MODULE, "DropShadow", (opt.bDropShadow ? 1 : 0));
- db_set_b(0, MODULE, "RoundCorners", (opt.bRound ? 1 : 0));
- db_set_b(0, MODULE, "AeroGlass", (opt.bAeroGlass ? 1 : 0));
- db_set_b(0, MODULE, "Opacity", (BYTE)opt.iOpacity);
- db_set_b(0, MODULE, "ShowEffect", (BYTE)opt.showEffect);
- db_set_b(0, MODULE, "ShowEffectSpeed", (BYTE)opt.iAnimateSpeed);
- db_set_b(0, MODULE, "LoadFonts", (opt.bLoadFonts ? 1 : 0));
- db_set_b(0, MODULE, "LoadProportions", (opt.bLoadProportions ? 1 : 0));
- db_set_dw(0, MODULE, "EnableColoring", opt.iEnableColoring);
+ db_set_b(0, MODULENAME, "Border", (opt.bBorder ? 1 : 0));
+ db_set_b(0, MODULENAME, "DropShadow", (opt.bDropShadow ? 1 : 0));
+ db_set_b(0, MODULENAME, "RoundCorners", (opt.bRound ? 1 : 0));
+ db_set_b(0, MODULENAME, "AeroGlass", (opt.bAeroGlass ? 1 : 0));
+ db_set_b(0, MODULENAME, "Opacity", (BYTE)opt.iOpacity);
+ db_set_b(0, MODULENAME, "ShowEffect", (BYTE)opt.showEffect);
+ db_set_b(0, MODULENAME, "ShowEffectSpeed", (BYTE)opt.iAnimateSpeed);
+ db_set_b(0, MODULENAME, "LoadFonts", (opt.bLoadFonts ? 1 : 0));
+ db_set_b(0, MODULENAME, "LoadProportions", (opt.bLoadProportions ? 1 : 0));
+ db_set_dw(0, MODULENAME, "EnableColoring", opt.iEnableColoring);
}
void LoadObsoleteSkinSetting()
@@ -305,15 +305,15 @@ void LoadObsoleteSkinSetting() for (int i = 0; i < SKIN_ITEMS_COUNT; i++) {
mir_snprintf(setting, "SPaintMode%d", i);
- opt.transfMode[i] = (TransformationMode)db_get_b(0, MODULE, setting, 0);
+ opt.transfMode[i] = (TransformationMode)db_get_b(0, MODULENAME, setting, 0);
mir_snprintf(setting, "SImgFile%d", i);
- if (!db_get_ws(NULL, MODULE, setting, &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, setting, &dbv)) {
opt.szImgFile[i] = mir_wstrdup(dbv.ptszVal);
db_free(&dbv);
}
mir_snprintf(setting, "SGlyphMargins%d", i);
- DWORD margins = db_get_dw(NULL, MODULE, setting, 0);
+ DWORD margins = db_get_dw(NULL, MODULENAME, setting, 0);
opt.margins[i].top = LOBYTE(LOWORD(margins));
opt.margins[i].right = HIBYTE(LOWORD(margins));
opt.margins[i].bottom = LOBYTE(HIWORD(margins));
@@ -323,25 +323,25 @@ void LoadObsoleteSkinSetting() void LoadOptions()
{
- opt.iWinWidth = db_get_dw(0, MODULE, "MaxWidth", 420);
- opt.iWinMaxHeight = db_get_dw(0, MODULE, "MaxHeight", 400);
- opt.iAvatarOpacity = db_get_b(0, MODULE, "AvatarOpacity", 100);
+ opt.iWinWidth = db_get_dw(0, MODULENAME, "MaxWidth", 420);
+ opt.iWinMaxHeight = db_get_dw(0, MODULENAME, "MaxHeight", 400);
+ opt.iAvatarOpacity = db_get_b(0, MODULENAME, "AvatarOpacity", 100);
if (opt.iAvatarOpacity > 100) opt.iAvatarOpacity = 100;
- opt.bAvatarRound = (db_get_b(0, MODULE, "AvatarRoundCorners", opt.bRound ? 1 : 0) == 1);
- opt.titleIconLayout = (PopupIconTitleLayout)db_get_b(0, MODULE, "TitleIconLayout", (BYTE)PTL_LEFTICON);
- opt.bShowTitle = (db_get_b(0, MODULE, "TitleShow", 1) == 1);
+ opt.bAvatarRound = (db_get_b(0, MODULENAME, "AvatarRoundCorners", opt.bRound ? 1 : 0) == 1);
+ opt.titleIconLayout = (PopupIconTitleLayout)db_get_b(0, MODULENAME, "TitleIconLayout", (BYTE)PTL_LEFTICON);
+ opt.bShowTitle = (db_get_b(0, MODULENAME, "TitleShow", 1) == 1);
if (ServiceExists(MS_AV_DRAWAVATAR))
- opt.avatarLayout = (PopupAvLayout)db_get_b(0, MODULE, "AVLayout", PAV_RIGHT);
+ opt.avatarLayout = (PopupAvLayout)db_get_b(0, MODULENAME, "AVLayout", PAV_RIGHT);
else
opt.avatarLayout = PAV_NONE;
opt.bWaitForAvatar = (opt.avatarLayout == PAV_NONE) ? false : true;
- opt.iAvatarSize = db_get_dw(0, MODULE, "AVSize", 60); //tweety
- opt.iTextIndent = db_get_dw(0, MODULE, "TextIndent", 22);
- opt.iTitleIndent = db_get_dw(0, MODULE, "TitleIndent", 22);
- opt.iValueIndent = db_get_dw(0, MODULE, "ValueIndent", 10);
- opt.iSidebarWidth = db_get_dw(0, MODULE, "SidebarWidth", 22);
- opt.bShowNoFocus = (db_get_b(0, MODULE, "ShowNoFocus", 1) == 1);
+ opt.iAvatarSize = db_get_dw(0, MODULENAME, "AVSize", 60); //tweety
+ opt.iTextIndent = db_get_dw(0, MODULENAME, "TextIndent", 22);
+ opt.iTitleIndent = db_get_dw(0, MODULENAME, "TitleIndent", 22);
+ opt.iValueIndent = db_get_dw(0, MODULENAME, "ValueIndent", 10);
+ opt.iSidebarWidth = db_get_dw(0, MODULENAME, "SidebarWidth", 22);
+ opt.bShowNoFocus = (db_get_b(0, MODULENAME, "ShowNoFocus", 1) == 1);
int i, real_count = 0;
opt.dsList = nullptr;
@@ -378,21 +378,21 @@ void LoadOptions() }
opt.iDiCount = real_count;
- opt.iTimeIn = db_get_w(0, MODULE, "TimeIn", 750);
- opt.iPadding = db_get_w(0, MODULE, "Padding", 4);
- opt.iOuterAvatarPadding = db_get_w(0, MODULE, "OuterAvatarPadding", 6);
- opt.iInnerAvatarPadding = db_get_w(0, MODULE, "InnerAvatarPadding", 10);
- opt.iTextPadding = db_get_w(0, MODULE, "TextPadding", 4);
- opt.pos = (PopupPosition)db_get_b(0, MODULE, "Position", (BYTE)PP_BOTTOMRIGHT);
- opt.iMinWidth = db_get_dw(0, MODULE, "MinWidth", 0);
- opt.iMinHeight = db_get_dw(0, MODULE, "MinHeight", 0);
+ opt.iTimeIn = db_get_w(0, MODULENAME, "TimeIn", 750);
+ opt.iPadding = db_get_w(0, MODULENAME, "Padding", 4);
+ opt.iOuterAvatarPadding = db_get_w(0, MODULENAME, "OuterAvatarPadding", 6);
+ opt.iInnerAvatarPadding = db_get_w(0, MODULENAME, "InnerAvatarPadding", 10);
+ opt.iTextPadding = db_get_w(0, MODULENAME, "TextPadding", 4);
+ opt.pos = (PopupPosition)db_get_b(0, MODULENAME, "Position", (BYTE)PP_BOTTOMRIGHT);
+ opt.iMinWidth = db_get_dw(0, MODULENAME, "MinWidth", 0);
+ opt.iMinHeight = db_get_dw(0, MODULENAME, "MinHeight", 0);
- opt.iMouseTollerance = db_get_b(0, MODULE, "MouseTollerance", (BYTE)GetSystemMetrics(SM_CXSMICON));
- opt.bStatusBarTips = (db_get_b(0, MODULE, "SBarTips", 1) == 1);
+ opt.iMouseTollerance = db_get_b(0, MODULENAME, "MouseTollerance", (BYTE)GetSystemMetrics(SM_CXSMICON));
+ opt.bStatusBarTips = (db_get_b(0, MODULENAME, "SBarTips", 1) == 1);
// convert defunct last message and status message options to new 'sys' items, and remove the old settings
- if (db_get_b(0, MODULE, "ShowLastMessage", 0)) {
- db_unset(0, MODULE, "ShowLastMessage");
+ if (db_get_b(0, MODULENAME, "ShowLastMessage", 0)) {
+ db_unset(0, MODULENAME, "ShowLastMessage");
// find end of list
di_node = opt.diList;
@@ -416,8 +416,8 @@ void LoadOptions() opt.iDiCount++;
}
- if (db_get_b(0, MODULE, "ShowStatusMessage", 0)) {
- db_unset(0, MODULE, "ShowStatusMessage");
+ if (db_get_b(0, MODULENAME, "ShowStatusMessage", 0)) {
+ db_unset(0, MODULENAME, "ShowStatusMessage");
// find end of list
di_node = opt.diList;
@@ -441,31 +441,31 @@ void LoadOptions() opt.iDiCount++;
}
- opt.iLabelValign = db_get_w(0, MODULE, "LabelVAlign", DT_TOP /*DT_VCENTER*/);
- opt.iLabelHalign = db_get_w(0, MODULE, "LabelHAlign", DT_LEFT);
- opt.iValueValign = db_get_w(0, MODULE, "ValueVAlign", DT_TOP /*DT_VCENTER*/);
- opt.iValueHalign = db_get_w(0, MODULE, "ValueHAlign", DT_LEFT);
+ opt.iLabelValign = db_get_w(0, MODULENAME, "LabelVAlign", DT_TOP /*DT_VCENTER*/);
+ opt.iLabelHalign = db_get_w(0, MODULENAME, "LabelHAlign", DT_LEFT);
+ opt.iValueValign = db_get_w(0, MODULENAME, "ValueVAlign", DT_TOP /*DT_VCENTER*/);
+ opt.iValueHalign = db_get_w(0, MODULENAME, "ValueHAlign", DT_LEFT);
// tray tooltip
- opt.bTraytip = db_get_b(0, MODULE, "TrayTip", 1) ? true : false;
- opt.bHandleByTipper = db_get_b(0, MODULE, "ExtendedTrayTip", 1) ? true : false;
- opt.bExpandTraytip = db_get_b(0, MODULE, "ExpandTrayTip", 1) ? true : false;
- opt.bHideOffline = db_get_b(0, MODULE, "HideOffline", 0) ? true : false;
- opt.iExpandTime = db_get_dw(0, MODULE, "ExpandTime", 1000);
- opt.iFirstItems = db_get_dw(0, MODULE, "TrayTipItems", TRAYTIP_NUMCONTACTS | TRAYTIP_LOGON | TRAYTIP_STATUS | TRAYTIP_CLIST_EVENT);
- opt.iSecondItems = db_get_dw(0, MODULE, "TrayTipItemsEx", TRAYTIP_NUMCONTACTS | TRAYTIP_LOGON | TRAYTIP_STATUS | TRAYTIP_STATUS_MSG | TRAYTIP_EXTRA_STATUS | TRAYTIP_MIRANDA_UPTIME | TRAYTIP_CLIST_EVENT);
- opt.iFavoriteContFlags = db_get_dw(0, MODULE, "FavContFlags", FAVCONT_APPEND_PROTO);
+ opt.bTraytip = db_get_b(0, MODULENAME, "TrayTip", 1) ? true : false;
+ opt.bHandleByTipper = db_get_b(0, MODULENAME, "ExtendedTrayTip", 1) ? true : false;
+ opt.bExpandTraytip = db_get_b(0, MODULENAME, "ExpandTrayTip", 1) ? true : false;
+ opt.bHideOffline = db_get_b(0, MODULENAME, "HideOffline", 0) ? true : false;
+ opt.iExpandTime = db_get_dw(0, MODULENAME, "ExpandTime", 1000);
+ opt.iFirstItems = db_get_dw(0, MODULENAME, "TrayTipItems", TRAYTIP_NUMCONTACTS | TRAYTIP_LOGON | TRAYTIP_STATUS | TRAYTIP_CLIST_EVENT);
+ opt.iSecondItems = db_get_dw(0, MODULENAME, "TrayTipItemsEx", TRAYTIP_NUMCONTACTS | TRAYTIP_LOGON | TRAYTIP_STATUS | TRAYTIP_STATUS_MSG | TRAYTIP_EXTRA_STATUS | TRAYTIP_MIRANDA_UPTIME | TRAYTIP_CLIST_EVENT);
+ opt.iFavoriteContFlags = db_get_dw(0, MODULENAME, "FavContFlags", FAVCONT_APPEND_PROTO);
// extra setting
- opt.bWaitForContent = db_get_b(0, MODULE, "WaitForContent", 0) ? true : false;
- opt.bGetNewStatusMsg = db_get_b(0, MODULE, "GetNewStatusMsg", 0) ? true : false;
- opt.bDisableIfInvisible = db_get_b(0, MODULE, "DisableInvisible", 1) ? true : false;
- opt.bRetrieveXstatus = db_get_b(0, MODULE, "RetrieveXStatus", 0) ? true : false;
- opt.bOriginalAvatarSize = db_get_b(0, MODULE, "OriginalAvSize", 0) ? true : false;
- opt.bAvatarBorder = db_get_b(0, MODULE, "AvatarBorder", 0) ? true : false;
- opt.bLimitMsg = db_get_b(0, MODULE, "LimitMsg", 0) ? true : false;
- opt.iLimitCharCount = db_get_b(0, MODULE, "LimitCharCount", 64);
- opt.iSmileyAddFlags = db_get_dw(0, MODULE, "SmileyAddFlags", SMILEYADD_ENABLE);
+ opt.bWaitForContent = db_get_b(0, MODULENAME, "WaitForContent", 0) ? true : false;
+ opt.bGetNewStatusMsg = db_get_b(0, MODULENAME, "GetNewStatusMsg", 0) ? true : false;
+ opt.bDisableIfInvisible = db_get_b(0, MODULENAME, "DisableInvisible", 1) ? true : false;
+ opt.bRetrieveXstatus = db_get_b(0, MODULENAME, "RetrieveXStatus", 0) ? true : false;
+ opt.bOriginalAvatarSize = db_get_b(0, MODULENAME, "OriginalAvSize", 0) ? true : false;
+ opt.bAvatarBorder = db_get_b(0, MODULENAME, "AvatarBorder", 0) ? true : false;
+ opt.bLimitMsg = db_get_b(0, MODULENAME, "LimitMsg", 0) ? true : false;
+ opt.iLimitCharCount = db_get_b(0, MODULENAME, "LimitCharCount", 64);
+ opt.iSmileyAddFlags = db_get_dw(0, MODULENAME, "SmileyAddFlags", SMILEYADD_ENABLE);
DBVARIANT dbv;
// Load the icons order
@@ -474,12 +474,12 @@ void LoadOptions() opt.exIconsVis[i] = 1;
}
- if (!db_get(NULL, MODULE, "IconOrder", &dbv)) {
+ if (!db_get(NULL, MODULENAME, "IconOrder", &dbv)) {
memcpy(opt.exIconsOrder, dbv.pbVal, dbv.cpbVal);
db_free(&dbv);
}
- if (!db_get(NULL, MODULE, "icons_vis", &dbv)) {
+ if (!db_get(NULL, MODULENAME, "icons_vis", &dbv)) {
memcpy(opt.exIconsVis, dbv.pbVal, dbv.cpbVal);
db_free(&dbv);
}
@@ -489,31 +489,31 @@ void LoadOptions() exIcons[i].vis = opt.exIconsVis[i];
}
- opt.iOpacity = db_get_b(0, MODULE, "Opacity", 75);
- opt.bBorder = db_get_b(0, MODULE, "Border", 1) ? true : false;
- opt.bDropShadow = db_get_b(0, MODULE, "DropShadow", 1) ? true : false;
- opt.bRound = db_get_b(0, MODULE, "RoundCorners", 1) ? true : false;
- opt.bAeroGlass = db_get_b(0, MODULE, "AeroGlass", 0) ? true : false;
- opt.showEffect = (PopupShowEffect)db_get_b(0, MODULE, "ShowEffect", (BYTE)PSE_FADE);
- opt.iAnimateSpeed = db_get_b(0, MODULE, "ShowEffectSpeed", 12);
+ opt.iOpacity = db_get_b(0, MODULENAME, "Opacity", 75);
+ opt.bBorder = db_get_b(0, MODULENAME, "Border", 1) ? true : false;
+ opt.bDropShadow = db_get_b(0, MODULENAME, "DropShadow", 1) ? true : false;
+ opt.bRound = db_get_b(0, MODULENAME, "RoundCorners", 1) ? true : false;
+ opt.bAeroGlass = db_get_b(0, MODULENAME, "AeroGlass", 0) ? true : false;
+ opt.showEffect = (PopupShowEffect)db_get_b(0, MODULENAME, "ShowEffect", (BYTE)PSE_FADE);
+ opt.iAnimateSpeed = db_get_b(0, MODULENAME, "ShowEffectSpeed", 12);
if (opt.iAnimateSpeed < 1)
opt.iAnimateSpeed = 1;
else if (opt.iAnimateSpeed > 20)
opt.iAnimateSpeed = 20;
- int iBgImg = db_get_b(0, MODULE, "SBgImage", 0);
- opt.skinMode = (SkinMode)db_get_b(0, MODULE, "SkinEngine", iBgImg ? SM_OBSOLOTE : SM_COLORFILL);
- opt.bLoadFonts = db_get_b(0, MODULE, "LoadFonts", 1) ? true : false;
- opt.bLoadProportions = db_get_b(0, MODULE, "LoadProportions", 1) ? true : false;
- opt.iEnableColoring = db_get_dw(0, MODULE, "EnableColoring", 0);
+ int iBgImg = db_get_b(0, MODULENAME, "SBgImage", 0);
+ opt.skinMode = (SkinMode)db_get_b(0, MODULENAME, "SkinEngine", iBgImg ? SM_OBSOLOTE : SM_COLORFILL);
+ opt.bLoadFonts = db_get_b(0, MODULENAME, "LoadFonts", 1) ? true : false;
+ opt.bLoadProportions = db_get_b(0, MODULENAME, "LoadProportions", 1) ? true : false;
+ opt.iEnableColoring = db_get_dw(0, MODULENAME, "EnableColoring", 0);
opt.szSkinName[0] = 0;
if (opt.skinMode == SM_OBSOLOTE) {
LoadObsoleteSkinSetting();
}
else if (opt.skinMode == SM_IMAGE) {
- if (!db_get_ws(NULL, MODULE, "SkinName", &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, "SkinName", &dbv)) {
wcsncpy(opt.szSkinName, dbv.ptszVal, _countof(opt.szSkinName) - 1);
db_free(&dbv);
}
@@ -1500,8 +1500,8 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), item.hItem);
i++;
}
- db_set_blob(NULL, MODULE, "IconOrder", opt.exIconsOrder, _countof(opt.exIconsOrder));
- db_set_blob(NULL, MODULE, "icons_vis", opt.exIconsVis, _countof(opt.exIconsVis));
+ db_set_blob(NULL, MODULENAME, "IconOrder", opt.exIconsOrder, _countof(opt.exIconsOrder));
+ db_set_blob(NULL, MODULENAME, "icons_vis", opt.exIconsVis, _countof(opt.exIconsVis));
opt.iSmileyAddFlags = 0;
opt.iSmileyAddFlags |= (IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLESMILEYS) ? SMILEYADD_ENABLE : 0)
@@ -1516,13 +1516,13 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM opt.bLimitMsg = IsDlgButtonChecked(hwndDlg, IDC_CHK_LIMITMSG) ? true : false;
opt.iLimitCharCount = GetDlgItemInt(hwndDlg, IDC_ED_CHARCOUNT, nullptr, FALSE);
- db_set_dw(0, MODULE, "SmileyAddFlags", opt.iSmileyAddFlags);
- db_set_b(0, MODULE, "WaitForContent", opt.bWaitForContent ? 1 : 0);
- db_set_b(0, MODULE, "GetNewStatusMsg", opt.bGetNewStatusMsg ? 1 : 0);
- db_set_b(0, MODULE, "DisableInvisible", opt.bDisableIfInvisible ? 1 : 0);
- db_set_b(0, MODULE, "RetrieveXStatus", opt.bRetrieveXstatus ? 1 : 0);
- db_set_b(0, MODULE, "LimitMsg", opt.bLimitMsg ? 1 : 0);
- db_set_b(0, MODULE, "LimitCharCount", opt.iLimitCharCount);
+ db_set_dw(0, MODULENAME, "SmileyAddFlags", opt.iSmileyAddFlags);
+ db_set_b(0, MODULENAME, "WaitForContent", opt.bWaitForContent ? 1 : 0);
+ db_set_b(0, MODULENAME, "GetNewStatusMsg", opt.bGetNewStatusMsg ? 1 : 0);
+ db_set_b(0, MODULENAME, "DisableInvisible", opt.bDisableIfInvisible ? 1 : 0);
+ db_set_b(0, MODULENAME, "RetrieveXStatus", opt.bRetrieveXstatus ? 1 : 0);
+ db_set_b(0, MODULENAME, "LimitMsg", opt.bLimitMsg ? 1 : 0);
+ db_set_b(0, MODULENAME, "LimitCharCount", opt.iLimitCharCount);
return TRUE;
}
@@ -1785,8 +1785,8 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l }
}
- db_set_b(0, MODULE, "SkinEngine", opt.skinMode);
- db_set_ws(0, MODULE, "SkinName", opt.szSkinName);
+ db_set_b(0, MODULENAME, "SkinEngine", opt.skinMode);
+ db_set_ws(0, MODULENAME, "SkinName", opt.szSkinName);
DestroySkinBitmap();
SetDlgItemInt(hwndDlg, IDC_ED_TRANS, opt.iOpacity, FALSE);
@@ -1844,7 +1844,7 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, for (auto &hContact : Contacts()) {
HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, hContact, 0);
- if (hItem && db_get_b(hContact, MODULE, "FavouriteContact", 0))
+ if (hItem && db_get_b(hContact, MODULENAME, "FavouriteContact", 0))
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 1);
}
@@ -1863,18 +1863,18 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, hContact, 0);
if (hItem) {
isChecked = (BYTE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0);
- db_set_b(hContact, MODULE, "FavouriteContact", isChecked);
+ db_set_b(hContact, MODULENAME, "FavouriteContact", isChecked);
if (isChecked)
count++;
}
}
- db_set_dw(0, MODULE, "FavouriteContactsCount", count);
+ db_set_dw(0, MODULENAME, "FavouriteContactsCount", count);
opt.iFavoriteContFlags = 0;
opt.iFavoriteContFlags |= IsDlgButtonChecked(hwndDlg, IDC_CHK_HIDEOFFLINE) ? FAVCONT_HIDE_OFFLINE : 0
| IsDlgButtonChecked(hwndDlg, IDC_CHK_APPENDPROTO) ? FAVCONT_APPEND_PROTO : 0;
- db_set_dw(0, MODULE, "FavContFlags", opt.iFavoriteContFlags);
+ db_set_dw(0, MODULENAME, "FavContFlags", opt.iFavoriteContFlags);
}
__fallthrough;
@@ -1997,7 +1997,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), item.hItem);
}
- db_set_ws(0, MODULE, "TrayProtocols", swzProtos);
+ db_set_ws(0, MODULENAME, "TrayProtocols", swzProtos);
swzProtos[0] = 0;
item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS));
@@ -2012,7 +2012,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), item.hItem);
}
- db_set_ws(0, MODULE, "TrayProtocolsEx", swzProtos);
+ db_set_ws(0, MODULENAME, "TrayProtocolsEx", swzProtos);
int count = 0;
opt.iFirstItems = 0;
@@ -2046,13 +2046,13 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA opt.bHideOffline = IsDlgButtonChecked(hwndDlg, IDC_CHK_HIDEOFFLINE) ? true : false;
opt.iExpandTime = max(min(GetDlgItemInt(hwndDlg, IDC_ED_EXPANDTIME, nullptr, FALSE), 5000), 10);
- db_set_b(0, MODULE, "TrayTip", (opt.bTraytip ? 1 : 0));
- db_set_b(0, MODULE, "ExtendedTrayTip", (opt.bHandleByTipper ? 1 : 0));
- db_set_b(0, MODULE, "ExpandTrayTip", (opt.bExpandTraytip ? 1 : 0));
- db_set_b(0, MODULE, "HideOffline", (opt.bHideOffline ? 1 : 0));
- db_set_dw(0, MODULE, "ExpandTime", opt.iExpandTime);
- db_set_dw(0, MODULE, "TrayTipItems", opt.iFirstItems);
- db_set_dw(0, MODULE, "TrayTipItemsEx", opt.iSecondItems);
+ db_set_b(0, MODULENAME, "TrayTip", (opt.bTraytip ? 1 : 0));
+ db_set_b(0, MODULENAME, "ExtendedTrayTip", (opt.bHandleByTipper ? 1 : 0));
+ db_set_b(0, MODULENAME, "ExpandTrayTip", (opt.bExpandTraytip ? 1 : 0));
+ db_set_b(0, MODULENAME, "HideOffline", (opt.bHideOffline ? 1 : 0));
+ db_set_dw(0, MODULENAME, "ExpandTime", opt.iExpandTime);
+ db_set_dw(0, MODULENAME, "TrayTipItems", opt.iFirstItems);
+ db_set_dw(0, MODULENAME, "TrayTipItemsEx", opt.iSecondItems);
return TRUE;
}
break;
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index 59730218ce..716d0098b7 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -302,7 +302,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa // don't use stored status message if (!opt.bWaitForContent) - db_unset(pwd->hContact, MODULE, "TempStatusMsg"); + db_unset(pwd->hContact, MODULENAME, "TempStatusMsg"); wcsncpy_s(pwd->swzTitle, Clist_GetContactDisplayName(pwd->hContact), _TRUNCATE); @@ -954,7 +954,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa case PUM_SETSTATUSTEXT: if (pwd && wParam == pwd->hContact) { - db_set_ws(pwd->hContact, MODULE, "TempStatusMsg", (wchar_t *)lParam); + db_set_ws(pwd->hContact, MODULENAME, "TempStatusMsg", (wchar_t *)lParam); pwd->bIsPainted = false; pwd->bNeedRefresh = true; SendMessage(hwnd, PUM_REFRESH_VALUES, TRUE, 0); @@ -1579,14 +1579,14 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } if (dwItems & TRAYTIP_FAVCONTACTS) { - if (db_get_dw(0, MODULE, "FavouriteContactsCount", 0)) { + if (db_get_dw(0, MODULENAME, "FavouriteContactsCount", 0)) { wchar_t swzName[256]; wchar_t swzStatus[256]; bool bTitlePainted = false; int iCount = 0, iCountOnline = 0; for (auto &hContact : Contacts()) { - if (db_get_b(hContact, MODULE, "FavouriteContact", 0)) { + if (db_get_b(hContact, MODULENAME, "FavouriteContact", 0)) { char *proto = GetContactProto(hContact); if (proto == nullptr) continue; @@ -1633,7 +1633,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } if (dwItems & TRAYTIP_MIRANDA_UPTIME) { - if (TimestampToTimeDifference(NULL, MODULE, "MirandaStartTS", buff, 64)) { + if (TimestampToTimeDifference(NULL, MODULENAME, "MirandaStartTS", buff, 64)) { AddRow(pwd, TranslateT("Other"), L"", nullptr, false, false, !bFirstItem, true, nullptr); AddRow(pwd, TranslateT("Miranda uptime:"), buff, nullptr, false, false, false); } diff --git a/plugins/TipperYM/src/popwin.h b/plugins/TipperYM/src/popwin.h index d63ca07b33..1721111b16 100644 --- a/plugins/TipperYM/src/popwin.h +++ b/plugins/TipperYM/src/popwin.h @@ -21,7 +21,7 @@ Boston, MA 02111-1307, USA. #ifndef _POPWIN_INC
#define _POPWIN_INC
-#define POP_WIN_CLASS _T(MODULE) L"MimTTClass"
+#define POP_WIN_CLASS _T(MODULENAME) L"MimTTClass"
#define PUM_GETHEIGHT (WM_USER + 0x020)
#define PUM_CALCPOS (WM_USER + 0x021)
diff --git a/plugins/TipperYM/src/skin_parser.cpp b/plugins/TipperYM/src/skin_parser.cpp index 403ae81ac7..485a46609e 100644 --- a/plugins/TipperYM/src/skin_parser.cpp +++ b/plugins/TipperYM/src/skin_parser.cpp @@ -209,7 +209,7 @@ void ParseFontPart(FILE *fp, wchar_t *buff) if (mir_wstrlen(pch) > 32)
pch[32] = 0;
- db_set_ws(0, MODULE, szSetting, pch);
+ db_set_ws(0, MODULENAME, szSetting, pch);
}
}
else if (wcsstr(buff, L"color"))
@@ -226,7 +226,7 @@ void ParseFontPart(FILE *fp, wchar_t *buff) {
BYTE b = _wtoi(pch);
COLORREF color = RGB(r, g ,b);
- db_set_dw(0, MODULE, szSetting, color);
+ db_set_dw(0, MODULENAME, szSetting, color);
}
}
}
@@ -237,7 +237,7 @@ void ParseFontPart(FILE *fp, wchar_t *buff) {
HDC hdc = GetDC(nullptr);
int size = -MulDiv(_wtoi(pch), GetDeviceCaps(hdc, LOGPIXELSY), 72);
- db_set_b(0, MODULE, szSetting, (BYTE)size);
+ db_set_b(0, MODULENAME, szSetting, (BYTE)size);
ReleaseDC(nullptr, hdc);
}
}
@@ -253,7 +253,7 @@ void ParseFontPart(FILE *fp, wchar_t *buff) if (wcsstr(pch, L"font_underline"))
effect |= DBFONTF_UNDERLINE;
- db_set_b(0, MODULE, szSetting, effect);
+ db_set_b(0, MODULENAME, szSetting, effect);
}
}
}
diff --git a/plugins/TipperYM/src/stdafx.h b/plugins/TipperYM/src/stdafx.h index d338ff81cc..68817c16cf 100644 --- a/plugins/TipperYM/src/stdafx.h +++ b/plugins/TipperYM/src/stdafx.h @@ -69,15 +69,13 @@ Boston, MA 02111-1307, USA. #include "preset_items.h"
#include "translations.h"
-#define MODULE "Tipper"
+#define MODULENAME "Tipper"
#define MODULE_ITEMS "Tipper_Items"
#define DEFAULT_SKIN_FOLDER L"Skins\\Tipper"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE)
- {}
+ CMPlugin();
};
extern HFONT hFontTitle, hFontLabels, hFontValues, hFontTrayTitle;
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index c2be17ac88..2e6fd15826 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -78,7 +78,7 @@ bool CheckContactType(MCONTACT hContact, const DISPLAYITEM &di) void StripBBCodesInPlace(wchar_t *ptszText) { - if (!db_get_b(0, MODULE, "StripBBCodes", 1)) + if (!db_get_b(0, MODULENAME, "StripBBCodes", 1)) return; if (ptszText == nullptr) @@ -220,7 +220,7 @@ wchar_t* GetStatusMessageText(MCONTACT hContact) if (wStatus == ID_STATUS_OFFLINE) return nullptr; - if (!db_get_ws(hContact, MODULE, "TempStatusMsg", &dbv)) { + if (!db_get_ws(hContact, MODULENAME, "TempStatusMsg", &dbv)) { if (mir_wstrlen(dbv.ptszVal) != 0) swzMsg = mir_wstrdup(dbv.ptszVal); db_free(&dbv); @@ -365,17 +365,17 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int for (int i = 0; i < iNumber; i++) { if (i > 0) hTmpContact = db_mc_getSub(hContact, i); - dwRecountTs = db_get_dw(hTmpContact, MODULE, "LastCountTS", 0); + dwRecountTs = db_get_dw(hTmpContact, MODULENAME, "LastCountTS", 0); dwTime = (DWORD)time(0); dwDiff = (dwTime - dwRecountTs); if (dwDiff > (60 * 60 * 24 * 3)) { - db_set_dw(hTmpContact, MODULE, "LastCountTS", dwTime); + db_set_dw(hTmpContact, MODULENAME, "LastCountTS", dwTime); dwCountOut = dwCountIn = dwLastTs = 0; } else { - dwCountOut = db_get_dw(hTmpContact, MODULE, "MsgCountOut", 0); - dwCountIn = db_get_dw(hTmpContact, MODULE, "MsgCountIn", 0); - dwLastTs = db_get_dw(hTmpContact, MODULE, "LastMsgTS", 0); + dwCountOut = db_get_dw(hTmpContact, MODULENAME, "MsgCountOut", 0); + dwCountIn = db_get_dw(hTmpContact, MODULENAME, "MsgCountIn", 0); + dwLastTs = db_get_dw(hTmpContact, MODULENAME, "LastMsgTS", 0); } dwNewTs = dwLastTs; @@ -397,9 +397,9 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int } if (dwNewTs > dwLastTs) { - db_set_dw(hTmpContact, MODULE, "MsgCountOut", dwCountOut); - db_set_dw(hTmpContact, MODULE, "MsgCountIn", dwCountIn); - db_set_dw(hTmpContact, MODULE, "LastMsgTS", dwNewTs); + db_set_dw(hTmpContact, MODULENAME, "MsgCountOut", dwCountOut); + db_set_dw(hTmpContact, MODULENAME, "MsgCountIn", dwCountIn); + db_set_dw(hTmpContact, MODULENAME, "LastMsgTS", dwNewTs); } dwMetaCountOut += dwCountOut; diff --git a/plugins/TipperYM/src/tipper.cpp b/plugins/TipperYM/src/tipper.cpp index 75f0282409..380b4879e2 100644 --- a/plugins/TipperYM/src/tipper.cpp +++ b/plugins/TipperYM/src/tipper.cpp @@ -52,6 +52,10 @@ PLUGININFOEX pluginInfoEx = {0x8392df1d, 0x9090, 0x4f8e, {0x9d, 0xf6, 0x2f, 0xe0, 0x58, 0xed, 0xd8, 0x00}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
@@ -106,7 +110,7 @@ static int EventDeleted(WPARAM wParam, LPARAM lParam) DBEVENTINFO dbei = {};
if (!db_event_get(lParam, &dbei))
if (dbei.eventType == EVENTTYPE_MESSAGE)
- db_unset(wParam, MODULE, "LastCountTS");
+ db_unset(wParam, MODULENAME, "LastCountTS");
return 0;
}
@@ -122,7 +126,7 @@ static void InitFonts() colourBg.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colourBg.group, LPGENW("Tooltips"));
mir_wstrcpy(colourBg.name, LPGENW("Background"));
- mir_strcpy(colourBg.dbSettingsGroup, MODULE);
+ mir_strcpy(colourBg.dbSettingsGroup, MODULENAME);
mir_strcpy(colourBg.setting, "ColourBg");
colourBg.defcolour = RGB(219, 219, 219);
colourBg.order = 0;
@@ -131,7 +135,7 @@ static void InitFonts() colourBorder.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colourBorder.group, LPGENW("Tooltips"));
mir_wstrcpy(colourBorder.name, LPGENW("Border"));
- mir_strcpy(colourBorder.dbSettingsGroup, MODULE);
+ mir_strcpy(colourBorder.dbSettingsGroup, MODULENAME);
mir_strcpy(colourBorder.setting, "BorderCol");
colourBorder.defcolour = 0;
colourBorder.order = 0;
@@ -140,7 +144,7 @@ static void InitFonts() colourAvatarBorder.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colourAvatarBorder.group, LPGENW("Tooltips"));
mir_wstrcpy(colourAvatarBorder.name, LPGENW("Avatar border"));
- mir_strcpy(colourAvatarBorder.dbSettingsGroup, MODULE);
+ mir_strcpy(colourAvatarBorder.dbSettingsGroup, MODULENAME);
mir_strcpy(colourAvatarBorder.setting, "AvBorderCol");
colourAvatarBorder.defcolour = 0;
colourAvatarBorder.order = 0;
@@ -149,7 +153,7 @@ static void InitFonts() colourDivider.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colourDivider.group, LPGENW("Tooltips"));
mir_wstrcpy(colourDivider.name, LPGENW("Dividers"));
- mir_strcpy(colourDivider.dbSettingsGroup, MODULE);
+ mir_strcpy(colourDivider.dbSettingsGroup, MODULENAME);
mir_strcpy(colourDivider.setting, "DividerCol");
colourDivider.defcolour = 0;
colourDivider.order = 0;
@@ -158,7 +162,7 @@ static void InitFonts() colourSidebar.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colourSidebar.group, LPGENW("Tooltips"));
mir_wstrcpy(colourSidebar.name, LPGENW("Sidebar"));
- mir_strcpy(colourSidebar.dbSettingsGroup, MODULE);
+ mir_strcpy(colourSidebar.dbSettingsGroup, MODULENAME);
mir_strcpy(colourSidebar.setting, "SidebarCol");
colourSidebar.defcolour = RGB(192, 192, 192);
colourSidebar.order = 0;
@@ -168,7 +172,7 @@ static void InitFonts() fontTitle.flags = FIDF_ALLOWEFFECTS;
mir_wstrcpy(fontTitle.group, LPGENW("Tooltips"));
mir_wstrcpy(fontTitle.name, LPGENW("Title"));
- mir_strcpy(fontTitle.dbSettingsGroup, MODULE);
+ mir_strcpy(fontTitle.dbSettingsGroup, MODULENAME);
mir_strcpy(fontTitle.prefix, "FontFirst");
mir_wstrcpy(fontTitle.backgroundGroup, LPGENW("Tooltips"));
mir_wstrcpy(fontTitle.backgroundName, LPGENW("Background"));
@@ -184,7 +188,7 @@ static void InitFonts() fontLabels.flags = FIDF_ALLOWEFFECTS;
mir_wstrcpy(fontLabels.group, LPGENW("Tooltips"));
mir_wstrcpy(fontLabels.name, LPGENW("Labels"));
- mir_strcpy(fontLabels.dbSettingsGroup, MODULE);
+ mir_strcpy(fontLabels.dbSettingsGroup, MODULENAME);
mir_strcpy(fontLabels.prefix, "FontLabels");
mir_wstrcpy(fontLabels.backgroundGroup, LPGENW("Tooltips"));
mir_wstrcpy(fontLabels.backgroundName, LPGENW("Background"));
@@ -200,7 +204,7 @@ static void InitFonts() fontValues.flags = FIDF_ALLOWEFFECTS;
mir_wstrcpy(fontValues.group, LPGENW("Tooltips"));
mir_wstrcpy(fontValues.name, LPGENW("Values"));
- mir_strcpy(fontValues.dbSettingsGroup, MODULE);
+ mir_strcpy(fontValues.dbSettingsGroup, MODULENAME);
mir_strcpy(fontValues.prefix, "FontValues");
mir_wstrcpy(fontValues.backgroundGroup, LPGENW("Tooltips"));
mir_wstrcpy(fontValues.backgroundName, LPGENW("Background"));
@@ -216,7 +220,7 @@ static void InitFonts() fontTrayTitle.flags = FIDF_ALLOWEFFECTS;
mir_wstrcpy(fontTrayTitle.group, LPGENW("Tooltips"));
mir_wstrcpy(fontTrayTitle.name, LPGENW("Tray title"));
- mir_strcpy(fontTrayTitle.dbSettingsGroup, MODULE);
+ mir_strcpy(fontTrayTitle.dbSettingsGroup, MODULENAME);
mir_strcpy(fontTrayTitle.prefix, "FontTrayTitle");
mir_wstrcpy(fontTrayTitle.backgroundGroup, LPGENW("Tooltips"));
mir_wstrcpy(fontTrayTitle.backgroundName, LPGENW("Background"));
@@ -262,7 +266,7 @@ static int ModulesLoaded(WPARAM, LPARAM) CallService(MS_CLC_SETINFOTIPHOVERTIME, opt.iTimeIn, 0);
// set Miranda start timestamp
- db_set_dw(0, MODULE, "MirandaStartTS", (DWORD)time(0));
+ db_set_dw(0, MODULENAME, "MirandaStartTS", (DWORD)time(0));
return 0;
}
@@ -295,8 +299,8 @@ static INT_PTR ReloadSkin(WPARAM wParam, LPARAM lParam) ReloadFont(0, 0);
SaveOptions();
- db_set_b(0, MODULE, "SkinEngine", opt.skinMode);
- db_set_ws(0, MODULE, "SkinName", opt.szSkinName);
+ db_set_b(0, MODULENAME, "SkinEngine", opt.skinMode);
+ db_set_ws(0, MODULENAME, "SkinName", opt.szSkinName);
DestroySkinBitmap();
@@ -323,7 +327,7 @@ extern "C" int __declspec(dllexport) Load(void) iCodePage = Langpack_GetDefaultCodePage();
- g_plugin.registerIcon(MODULE, iconList, MODULE);
+ g_plugin.registerIcon(MODULENAME, iconList, MODULENAME);
InitTranslations();
InitMessagePump();
diff --git a/plugins/Toaster/src/main.cpp b/plugins/Toaster/src/main.cpp index acf2eae2a6..f41dd3e512 100644 --- a/plugins/Toaster/src/main.cpp +++ b/plugins/Toaster/src/main.cpp @@ -5,7 +5,7 @@ CMPlugin g_plugin; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -19,13 +19,17 @@ PLUGININFOEX pluginInfo = { 0x1fdbd8f0, 0x3929, 0x41bc, { 0x92, 0xd1, 0x2, 0x7, 0x79, 0x46, 0x7, 0x69 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
if (!IsWinVer8Plus()) {
- MessageBox(nullptr, TranslateT("This plugin requires Windows 8 or higher"), _T(MODULE), MB_OK | MB_ICONERROR);
+ MessageBox(nullptr, TranslateT("This plugin requires Windows 8 or higher"), _T(MODULENAME), MB_OK | MB_ICONERROR);
return nullptr;
}
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -51,7 +55,7 @@ static int OnPreShutdown(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
HookEvent(ME_OPT_INITIALISE, OnOptionsInitialized);
HookEvent(ME_SYSTEM_PRESHUTDOWN, &OnPreShutdown);
@@ -65,7 +69,7 @@ extern "C" int __declspec(dllexport) Load(void) if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
CreateDirectoryTreeW(wszTempDir);
}
- else MessageBox(nullptr, TranslateT("Failed to create temporary directory"), _T(MODULE), MB_OK | MB_ICONERROR);
+ else MessageBox(nullptr, TranslateT("Failed to create temporary directory"), _T(MODULENAME), MB_OK | MB_ICONERROR);
return 0;
}
diff --git a/plugins/Toaster/src/options.cpp b/plugins/Toaster/src/options.cpp index 5475b67e54..da2e46ae84 100644 --- a/plugins/Toaster/src/options.cpp +++ b/plugins/Toaster/src/options.cpp @@ -46,10 +46,10 @@ void COptions::Enabled_OnChange(CCtrlCheck* chk) int OnOptionsInitialized(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.szTitle.w = L"Popups"; //_T(MODULE);
+ odp.szTitle.w = L"Popups"; //_T(MODULENAME);
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.position = -790000000;
- odp.szTab.w = _T(MODULE);
+ odp.szTab.w = _T(MODULENAME);
odp.pDialog = new COptions();
Options_AddPage(wParam, &odp);
diff --git a/plugins/Toaster/src/stdafx.h b/plugins/Toaster/src/stdafx.h index 1d337c7cf8..a5914af140 100644 --- a/plugins/Toaster/src/stdafx.h +++ b/plugins/Toaster/src/stdafx.h @@ -29,14 +29,12 @@ const wchar_t AppUserModelID[] = L"MirandaNG";
-#define MODULE "Toaster"
+#define MODULENAME "Toaster"
#define CHECKHR(x) if (FAILED(x)) return x;
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE)
- {}
+ CMPlugin();
};
class ToastNotification;
diff --git a/plugins/TooltipNotify/src/main.cpp b/plugins/TooltipNotify/src/main.cpp index 2acb0378a4..28e808e243 100644 --- a/plugins/TooltipNotify/src/main.cpp +++ b/plugins/TooltipNotify/src/main.cpp @@ -18,7 +18,7 @@ CMPlugin g_plugin; /////////////////////////////////////////////////////////////////////////////////////////
-static PLUGININFOEX sPluginInfo =
+static PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -32,9 +32,13 @@ static PLUGININFOEX sPluginInfo = {0x5906a545, 0xf31a, 0x4726, {0xb4, 0x8f, 0x3, 0xa0, 0x9f, 0x6, 0x3, 0x18}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &sPluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -71,7 +75,7 @@ static int ModulesLoaded(WPARAM wParam, LPARAM lParam) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&sPluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
g_pTooltipNotify = new CTooltipNotify();
diff --git a/plugins/TooltipNotify/src/stdafx.h b/plugins/TooltipNotify/src/stdafx.h index bfe460cfcd..fd114c37d9 100644 --- a/plugins/TooltipNotify/src/stdafx.h +++ b/plugins/TooltipNotify/src/stdafx.h @@ -29,9 +29,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {}
+ CMPlugin();
};
#include "version.h"
diff --git a/plugins/TopToolBar/src/main.cpp b/plugins/TopToolBar/src/main.cpp index 2e0913797a..dfb827970d 100644 --- a/plugins/TopToolBar/src/main.cpp +++ b/plugins/TopToolBar/src/main.cpp @@ -21,7 +21,7 @@ IconItem iconList[] = /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -35,16 +35,20 @@ PLUGININFOEX pluginInfo = {0xf593c752, 0x51d8, 0x4d46, {0xba, 0x27, 0x37, 0x57, 0x79, 0x53, 0xf5, 0x5c}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(TTB_OPTDIR, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
g_plugin.registerIcon(TTB_OPTDIR, iconList, TTB_OPTDIR);
diff --git a/plugins/TopToolBar/src/stdafx.h b/plugins/TopToolBar/src/stdafx.h index b8d387cfde..2cee9fefc4 100644 --- a/plugins/TopToolBar/src/stdafx.h +++ b/plugins/TopToolBar/src/stdafx.h @@ -39,9 +39,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(TTB_OPTDIR)
- {}
+ CMPlugin();
};
///////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp index 6a81a662d3..31dacd156d 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.cpp +++ b/plugins/TrafficCounter/src/TrafficCounter.cpp @@ -113,6 +113,10 @@ PLUGININFOEX pluginInfoEx = {0x82181510, 0x5dfa, 0x49d7, {0xb4, 0x69, 0x33, 0x87, 0x1e, 0x2a, 0xe8, 0xb5}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
@@ -161,7 +165,7 @@ void SaveSettings(BYTE OnlyCnt) unsigned short int i;
// Сохраняем счётчик времени онлайна
- db_set_dw(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_TOTAL_ONLINE_TIME, OverallInfo.Total.Timer);
+ db_set_dw(NULL, MODULENAME, SETTINGS_TOTAL_ONLINE_TIME, OverallInfo.Total.Timer);
if (OnlyCnt) return;
@@ -172,26 +176,26 @@ void SaveSettings(BYTE OnlyCnt) }
//settings for notification
- db_set_dw(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_POPUP_BKCOLOR, Traffic_PopupBkColor);
- db_set_dw(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_POPUP_FONTCOLOR, Traffic_PopupFontColor);
+ db_set_dw(NULL, MODULENAME, SETTINGS_POPUP_BKCOLOR, Traffic_PopupBkColor);
+ db_set_dw(NULL, MODULENAME, SETTINGS_POPUP_FONTCOLOR, Traffic_PopupFontColor);
//
- db_set_b(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_POPUP_NOTIFY_TIME_VALUE, Traffic_Notify_time_value);
+ db_set_b(NULL, MODULENAME, SETTINGS_POPUP_NOTIFY_TIME_VALUE, Traffic_Notify_time_value);
//
- db_set_w(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_POPUP_NOTIFY_SIZE_VALUE, Traffic_Notify_size_value);
+ db_set_w(NULL, MODULENAME, SETTINGS_POPUP_NOTIFY_SIZE_VALUE, Traffic_Notify_size_value);
//
//popup timeout
- db_set_b(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_POPUP_TIMEOUT_DEFAULT, Traffic_PopupTimeoutDefault);
- db_set_b(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_POPUP_TIMEOUT_VALUE, Traffic_PopupTimeoutValue);
+ db_set_b(NULL, MODULENAME, SETTINGS_POPUP_TIMEOUT_DEFAULT, Traffic_PopupTimeoutDefault);
+ db_set_b(NULL, MODULENAME, SETTINGS_POPUP_TIMEOUT_VALUE, Traffic_PopupTimeoutValue);
//
// Формат счётчиков
- db_set_ws(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_COUNTER_FORMAT, Traffic_CounterFormat);
+ db_set_ws(NULL, MODULENAME, SETTINGS_COUNTER_FORMAT, Traffic_CounterFormat);
- db_set_ws(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_TOOLTIP_FORMAT, Traffic_TooltipFormat);
+ db_set_ws(NULL, MODULENAME, SETTINGS_TOOLTIP_FORMAT, Traffic_TooltipFormat);
- db_set_b(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_ADDITION_SPACE, Traffic_AdditionSpace);
+ db_set_b(NULL, MODULENAME, SETTINGS_ADDITION_SPACE, Traffic_AdditionSpace);
// Сохраняем флаги
- db_set_dw(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_WHAT_DRAW, unOptions.Flags);
- db_set_w(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_STAT_ACC_OPT, Stat_SelAcc);
+ db_set_dw(NULL, MODULENAME, SETTINGS_WHAT_DRAW, unOptions.Flags);
+ db_set_w(NULL, MODULENAME, SETTINGS_STAT_ACC_OPT, Stat_SelAcc);
}
/*--------------------------------------------------------------------------------------------*/
@@ -880,7 +884,7 @@ INT_PTR MenuCommand_TrafficShowHide(WPARAM, LPARAM) ShowWindow(TrafficHwnd, unOptions.FrameIsVisible ? SW_SHOW : SW_HIDE);
else
CallService(MS_CLIST_FRAMES_SHFRAME, (WPARAM)Traffic_FrameID, 0);
- db_set_dw(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_WHAT_DRAW, unOptions.Flags);
+ db_set_dw(NULL, MODULENAME, SETTINGS_WHAT_DRAW, unOptions.Flags);
//
return 0;
}
@@ -1086,21 +1090,21 @@ static int TrafficCounterModulesLoaded(WPARAM, LPARAM) ModuleLoad(0, 0);
// Читаем флаги
- unOptions.Flags = db_get_dw(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_WHAT_DRAW, 0x0882);
- Stat_SelAcc = db_get_w(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_STAT_ACC_OPT, 0x01);
+ unOptions.Flags = db_get_dw(NULL, MODULENAME, SETTINGS_WHAT_DRAW, 0x0882);
+ Stat_SelAcc = db_get_w(NULL, MODULENAME, SETTINGS_STAT_ACC_OPT, 0x01);
// settings for notification
- Traffic_PopupBkColor = db_get_dw(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_POPUP_BKCOLOR, RGB(200, 255, 200));
- Traffic_PopupFontColor = db_get_dw(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_POPUP_FONTCOLOR, RGB(0, 0, 0));
- Traffic_Notify_time_value = db_get_b(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_POPUP_NOTIFY_TIME_VALUE, 10);
- Traffic_Notify_size_value = db_get_w(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_POPUP_NOTIFY_SIZE_VALUE, 100);
+ Traffic_PopupBkColor = db_get_dw(NULL, MODULENAME, SETTINGS_POPUP_BKCOLOR, RGB(200, 255, 200));
+ Traffic_PopupFontColor = db_get_dw(NULL, MODULENAME, SETTINGS_POPUP_FONTCOLOR, RGB(0, 0, 0));
+ Traffic_Notify_time_value = db_get_b(NULL, MODULENAME, SETTINGS_POPUP_NOTIFY_TIME_VALUE, 10);
+ Traffic_Notify_size_value = db_get_w(NULL, MODULENAME, SETTINGS_POPUP_NOTIFY_SIZE_VALUE, 100);
// popup timeout
- Traffic_PopupTimeoutDefault = db_get_b(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_POPUP_TIMEOUT_DEFAULT, 1);
- Traffic_PopupTimeoutValue = db_get_b(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_POPUP_TIMEOUT_VALUE, 5);
+ Traffic_PopupTimeoutDefault = db_get_b(NULL, MODULENAME, SETTINGS_POPUP_TIMEOUT_DEFAULT, 1);
+ Traffic_PopupTimeoutValue = db_get_b(NULL, MODULENAME, SETTINGS_POPUP_TIMEOUT_VALUE, 5);
// Формат счётчика для каждого активного протокола
- if (db_get_ws(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_COUNTER_FORMAT, &dbv) == 0) {
+ if (db_get_ws(NULL, MODULENAME, SETTINGS_COUNTER_FORMAT, &dbv) == 0) {
if (mir_wstrlen(dbv.ptszVal) > 0)
mir_wstrncpy(Traffic_CounterFormat, dbv.ptszVal, _countof(Traffic_CounterFormat));
//
@@ -1112,7 +1116,7 @@ static int TrafficCounterModulesLoaded(WPARAM, LPARAM) }
// Формат всплывающих подсказок
- if (db_get_ws(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_TOOLTIP_FORMAT, &dbv) == 0) {
+ if (db_get_ws(NULL, MODULENAME, SETTINGS_TOOLTIP_FORMAT, &dbv) == 0) {
if (mir_wstrlen(dbv.ptszVal) > 0)
mir_wstrncpy(Traffic_TooltipFormat, dbv.ptszVal, _countof(Traffic_TooltipFormat));
//
@@ -1123,16 +1127,16 @@ static int TrafficCounterModulesLoaded(WPARAM, LPARAM) mir_wstrcpy(Traffic_TooltipFormat, L"Traffic Counter");
}
- Traffic_AdditionSpace = db_get_b(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_ADDITION_SPACE, 0);
+ Traffic_AdditionSpace = db_get_b(NULL, MODULENAME, SETTINGS_ADDITION_SPACE, 0);
// Счётчик времени онлайна
- OverallInfo.Total.Timer = db_get_dw(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_TOTAL_ONLINE_TIME, 0);
+ OverallInfo.Total.Timer = db_get_dw(NULL, MODULENAME, SETTINGS_TOTAL_ONLINE_TIME, 0);
//register traffic font
TrafficFontID.cbSize = sizeof(FontIDW);
mir_wstrcpy(TrafficFontID.group, LPGENW("Traffic counter"));
mir_wstrcpy(TrafficFontID.name, LPGENW("Font"));
- mir_strcpy(TrafficFontID.dbSettingsGroup, TRAFFIC_SETTINGS_GROUP);
+ mir_strcpy(TrafficFontID.dbSettingsGroup, MODULENAME);
mir_strcpy(TrafficFontID.prefix, "Font");
TrafficFontID.flags = FIDF_DEFAULTVALID | FIDF_SAVEPOINTSIZE;
TrafficFontID.deffontsettings.charset = DEFAULT_CHARSET;
@@ -1147,7 +1151,7 @@ static int TrafficCounterModulesLoaded(WPARAM, LPARAM) TrafficBackgroundColorID.cbSize = sizeof(ColourIDW);
mir_wstrcpy(TrafficBackgroundColorID.group, LPGENW("Traffic counter"));
mir_wstrcpy(TrafficBackgroundColorID.name, LPGENW("Font"));
- mir_strcpy(TrafficBackgroundColorID.dbSettingsGroup, TRAFFIC_SETTINGS_GROUP);
+ mir_strcpy(TrafficBackgroundColorID.dbSettingsGroup, MODULENAME);
mir_strcpy(TrafficBackgroundColorID.setting, "FontBkColor");
TrafficBackgroundColorID.defcolour = GetSysColor(COLOR_BTNFACE);
Colour_RegisterW(&TrafficBackgroundColorID);
diff --git a/plugins/TrafficCounter/src/TrafficCounter.h b/plugins/TrafficCounter/src/TrafficCounter.h index 46d24e00d9..17b6f1a7ff 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.h +++ b/plugins/TrafficCounter/src/TrafficCounter.h @@ -26,7 +26,7 @@ int TrafficSend(WPARAM wParam,LPARAM lParam); //---------------------------------------------------------------------------------------------
// Имена параметров с настройками в базе
//---------------------------------------------------------------------------------------------
-#define TRAFFIC_SETTINGS_GROUP "TrafficCounter"
+#define MODULENAME "TrafficCounter"
#define SETTINGS_COUNTER_FORMAT "CounterFormat"
#define SETTINGS_TOOLTIP_FORMAT "TooltipFormat"
diff --git a/plugins/TrafficCounter/src/stdafx.h b/plugins/TrafficCounter/src/stdafx.h index fc5fb36f37..a26ac69639 100644 --- a/plugins/TrafficCounter/src/stdafx.h +++ b/plugins/TrafficCounter/src/stdafx.h @@ -54,9 +54,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(TRAFFIC_SETTINGS_GROUP)
- {}
+ CMPlugin();
};
#pragma pack(push)
diff --git a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp index fd21e8ebf8..a5f22dc656 100644 --- a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp +++ b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp @@ -21,9 +21,7 @@ Boston, MA 02111-1307, USA. struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(nullptr)
- {}
+ CMPlugin();
}
g_plugin;
@@ -44,6 +42,10 @@ PLUGININFOEX pluginInfoEx = { { 0x286947d, 0x3140, 0x4222, { 0xb5, 0xad, 0x2c, 0x92, 0x31, 0x5e, 0x1c, 0x1e } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(nullptr, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
diff --git a/plugins/UserGuide/src/main.cpp b/plugins/UserGuide/src/main.cpp index f537c7e81b..15253c6144 100644 --- a/plugins/UserGuide/src/main.cpp +++ b/plugins/UserGuide/src/main.cpp @@ -5,7 +5,7 @@ int &hLangpack(g_plugin.m_hLang); /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -19,9 +19,13 @@ PLUGININFOEX pluginInfo = { 0x297ec1e7, 0x41b7, 0x41f9, {0xbb, 0x91, 0xef, 0xa9, 0x50, 0x28, 0xf1, 0x6c }}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(nullptr, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -69,7 +73,7 @@ static INT_PTR ShowGuideFile(WPARAM, LPARAM) extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
CMenuItem mi;
SET_UID(mi, 0x6787c12d, 0xdc85, 0x409d, 0xaa, 0x6c, 0x1f, 0xfe, 0x5f, 0xe8, 0xc1, 0x18);
diff --git a/plugins/UserGuide/src/stdafx.h b/plugins/UserGuide/src/stdafx.h index 1760206b41..55f9f3cd00 100644 --- a/plugins/UserGuide/src/stdafx.h +++ b/plugins/UserGuide/src/stdafx.h @@ -13,7 +13,5 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(nullptr)
- {}
+ CMPlugin();
};
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp index 5a38ef72f5..e4396b265e 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.cpp +++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp @@ -573,7 +573,7 @@ int MAnnivDate::DBWriteBirthDate(MCONTACT hContact) // only delete values from current contact's custom modules
!(_wFlags & (MADF_HASPROTO|MADF_HASMETA)) &&
// check whether user wants this feature
- db_get_b(NULL, MODNAME, SET_REMIND_SECUREBIRTHDAY, TRUE))
+ db_get_b(NULL, MODULENAME, SET_REMIND_SECUREBIRTHDAY, TRUE))
{
// keep the database clean
diff --git a/plugins/UserInfoEx/src/classPsTree.cpp b/plugins/UserInfoEx/src/classPsTree.cpp index c2eeb3d210..e40b6f6bff 100644 --- a/plugins/UserInfoEx/src/classPsTree.cpp +++ b/plugins/UserInfoEx/src/classPsTree.cpp @@ -159,7 +159,7 @@ BYTE CPsTree::InitTreeItems(LPWORD needWidth) return FALSE; } - if (!DB::Setting::GetUString(NULL, MODNAME, SET_LASTITEM, &dbv)) + if (!DB::Setting::GetUString(NULL, MODULENAME, SET_LASTITEM, &dbv)) { _curItem = FindItemIndexByName(dbv.pszVal); db_free(&dbv); @@ -553,8 +553,8 @@ void CPsTree::SaveState() } // save current selected item - if (pti) db_set_utf(NULL, MODNAME, SET_LASTITEM, pti->Name()); - else db_unset(NULL, MODNAME, SET_LASTITEM); + if (pti) db_set_utf(NULL, MODULENAME, SET_LASTITEM, pti->Name()); + else db_unset(NULL, MODULENAME, SET_LASTITEM); } /** @@ -570,14 +570,14 @@ void CPsTree::DBResetState() { DB::CEnumList Settings; - if (!Settings.EnumSettings(NULL, MODNAME)) + if (!Settings.EnumSettings(NULL, MODULENAME)) { LPCSTR p = (_pPs->pszProto[0]) ? _pPs->pszProto : "Owner"; size_t c = mir_strlen(p); for (auto &s : Settings) if (s && *s == '{' && !mir_strncmpi(s + 1, p, c)) - db_unset(NULL, MODNAME, s); + db_unset(NULL, MODULENAME, s); // keep only these flags _dwFlags &= PSTVF_SORTTREE|PSTVF_GROUPS; @@ -628,7 +628,7 @@ int CPsTree::BeginLabelEdit(HTREEITEM hItem) CPsTreeItem* pti; // tree is readonly - if (db_get_b(NULL, MODNAME, SET_PROPSHEET_READONLYLABEL, 0)) + if (db_get_b(NULL, MODULENAME, SET_PROPSHEET_READONLYLABEL, 0)) return 0; // get item text @@ -732,7 +732,7 @@ void CPsTree::PopupMenu() tvi.hItem = hti.hItem; TreeView_GetItem(_hWndTree, &tvi); - if (!db_get_b(NULL, MODNAME, SET_PROPSHEET_READONLYLABEL, FALSE)) { + if (!db_get_b(NULL, MODULENAME, SET_PROPSHEET_READONLYLABEL, FALSE)) { mii.dwTypeData = TranslateT("Rename Item"); mii.wID = 32001; InsertMenuItem(hPopup, 0, FALSE, &mii); diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp index c37c7b31a4..5a40b27b19 100644 --- a/plugins/UserInfoEx/src/classPsTreeItem.cpp +++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp @@ -134,7 +134,7 @@ LPCSTR CPsTreeItem::IconKey() if (pszIconName)
{
static CHAR pszSetting[MAXSETTING];
- mir_snprintf(pszSetting, MODNAME"_{%s}", pszIconName);
+ mir_snprintf(pszSetting, MODULENAME"_{%s}", pszIconName);
return pszSetting;
}
return nullptr;
@@ -151,7 +151,7 @@ LPSTR CPsTreeItem::ParentItemName() {
// try to read the parent item from the database
DBVARIANT dbv;
- if (!DB::Setting::GetAString(NULL, MODNAME, PropertyKey(SET_ITEM_GROUP), &dbv))
+ if (!DB::Setting::GetAString(NULL, MODULENAME, PropertyKey(SET_ITEM_GROUP), &dbv))
return dbv.pszVal;
const CHAR* p = mir_strrchr(_pszName, '\\');
@@ -245,7 +245,7 @@ int CPsTreeItem::ItemLabel(const BYTE bReadDBValue) mir_free(_ptszLabel);
// try to get custom label from database
- if (!bReadDBValue || DB::Setting::GetTString(NULL, MODNAME, GlobalPropertyKey(SET_ITEM_LABEL), &dbv) || (_ptszLabel = dbv.ptszVal) == nullptr) {
+ if (!bReadDBValue || DB::Setting::GetTString(NULL, MODULENAME, GlobalPropertyKey(SET_ITEM_LABEL), &dbv) || (_ptszLabel = dbv.ptszVal) == nullptr) {
// extract the name
LPSTR pszName = mir_strrchr(_pszName, '\\');
if (pszName && pszName[1])
@@ -425,12 +425,12 @@ int CPsTreeItem::Create(CPsHdr* pPsh, OPTIONSDIALOGPAGE *odp) // load custom order
if (!(pPsh->_dwFlags & PSTVF_SORTTREE)) {
- _iPosition = (int)db_get_b(NULL, MODNAME, PropertyKey(SET_ITEM_POS), odp->position);
+ _iPosition = (int)db_get_b(NULL, MODULENAME, PropertyKey(SET_ITEM_POS), odp->position);
if ((_iPosition < 0) && (_iPosition > 0x800000A))
_iPosition = 0;
}
// read visibility state
- _bState = db_get_b(NULL, MODNAME, PropertyKey(SET_ITEM_STATE), DBTVIS_EXPANDED);
+ _bState = db_get_b(NULL, MODULENAME, PropertyKey(SET_ITEM_STATE), DBTVIS_EXPANDED);
// error for no longer supported dialog template type
if (((UINT_PTR)odp->pszTemplate & 0xFFFF0000))
@@ -473,19 +473,19 @@ WORD CPsTreeItem::DBSaveItemState(LPCSTR pszGroup, int iItemPosition, UINT iStat // save group
if ((dwFlags & PSTVF_GROUPS) && (dwFlags & PSTVF_POS_CHANGED))
- numErrors += db_set_utf(NULL, MODNAME, PropertyKey(SET_ITEM_GROUP), (LPSTR)pszGroup);
+ numErrors += db_set_utf(NULL, MODULENAME, PropertyKey(SET_ITEM_GROUP), (LPSTR)pszGroup);
// save label
if ((dwFlags & PSTVF_LABEL_CHANGED) && (_dwFlags & PSTVF_LABEL_CHANGED))
- numErrors += db_set_ws(NULL, MODNAME, GlobalPropertyKey(SET_ITEM_LABEL), Label());
+ numErrors += db_set_ws(NULL, MODULENAME, GlobalPropertyKey(SET_ITEM_LABEL), Label());
// save position
if ((dwFlags & PSTVF_POS_CHANGED) && !(dwFlags & PSTVF_SORTTREE))
- numErrors += db_set_b(NULL, MODNAME, PropertyKey(SET_ITEM_POS), iItemPosition);
+ numErrors += db_set_b(NULL, MODULENAME, PropertyKey(SET_ITEM_POS), iItemPosition);
// save state
if (dwFlags & PSTVF_STATE_CHANGED)
- numErrors += db_set_b(NULL, MODNAME, PropertyKey(SET_ITEM_STATE),
+ numErrors += db_set_b(NULL, MODULENAME, PropertyKey(SET_ITEM_STATE),
_hItem ? ((iState & TVIS_EXPANDED) ? DBTVIS_EXPANDED : DBTVIS_NORMAL) : DBTVIS_INVISIBLE);
RemoveFlags(PSTVF_STATE_CHANGED|PSTVF_LABEL_CHANGED|PSTVF_POS_CHANGED);
diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.cpp b/plugins/UserInfoEx/src/ctrl_annivedit.cpp index 7f43748282..4dcda44702 100644 --- a/plugins/UserInfoEx/src/ctrl_annivedit.cpp +++ b/plugins/UserInfoEx/src/ctrl_annivedit.cpp @@ -41,7 +41,7 @@ CAnnivEditCtrl::CAnnivEditCtrl(HWND hDlg, WORD idCtrl, LPCSTR pszSetting) _hBtnEdit = GetDlgItem(hDlg, BTN_EDIT);
_hBtnMenu = GetDlgItem(hDlg, BTN_MENU);
_hwndDate = GetDlgItem(hDlg, EDIT_ANNIVERSARY_DATE);
- _ReminderEnabled = db_get_b(NULL, MODNAME, SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED);
+ _ReminderEnabled = db_get_b(NULL, MODULENAME, SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED);
_pDates = nullptr;
_curDate = 0;
@@ -148,7 +148,7 @@ void CAnnivEditCtrl::EnableCurrentItem() = !hContact ||
(pCurrent->Flags() & CTRLF_HASCUSTOM) ||
!(pCurrent->Flags() & (CTRLF_HASPROTO|CTRLF_HASMETA)) ||
- !db_get_b(NULL, MODNAME, SET_PROPSHEET_PCBIREADONLY, 0);
+ !db_get_b(NULL, MODULENAME, SET_PROPSHEET_PCBIREADONLY, 0);
EnableWindow(_hBtnEdit, bEnabled);
EnableWindow(_hBtnDel, bEnabled);
@@ -540,7 +540,7 @@ void CAnnivEditCtrl::OnReminderChecked() {
if (IsDlgButtonChecked(_hwndDlg, RADIO_REMIND1))
{
- _itow(db_get_b(NULL, MODNAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET), buf, 10);
+ _itow(db_get_b(NULL, MODULENAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET), buf, 10);
EnableWindow(GetDlgItem(_hwndDlg, EDIT_REMIND), FALSE);
EnableWindow(GetDlgItem(_hwndDlg, SPIN_REMIND), FALSE);
state = BST_INDETERMINATE;
@@ -549,7 +549,7 @@ void CAnnivEditCtrl::OnReminderChecked() {
if (pCurrent->RemindOffset() == (WORD)-1)
{
- _itow(db_get_b(NULL, MODNAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET), buf, 10);
+ _itow(db_get_b(NULL, MODULENAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET), buf, 10);
}
else
{
diff --git a/plugins/UserInfoEx/src/ctrl_base.cpp b/plugins/UserInfoEx/src/ctrl_base.cpp index 67a3614ab8..0d230a3c4f 100644 --- a/plugins/UserInfoEx/src/ctrl_base.cpp +++ b/plugins/UserInfoEx/src/ctrl_base.cpp @@ -33,11 +33,11 @@ COLORREF clrMeta = -1; void Ctrl_InitTextColours()
{
- clrBoth = db_get_dw(NULL, MODNAME, SET_PROPSHEET_CLRBOTH, RGB(0, 160, 10));
- clrChanged = db_get_dw(NULL, MODNAME, SET_PROPSHEET_CLRCHANGED, RGB(190, 0, 0));
- clrCustom = db_get_dw(NULL, MODNAME, SET_PROPSHEET_CLRCUSTOM, RGB(0, 10, 130));
- clrNormal = db_get_dw(NULL, MODNAME, SET_PROPSHEET_CLRNORMAL, RGB(90, 90, 90));
- clrMeta = db_get_dw(NULL, MODNAME, SET_PROPSHEET_CLRMETA, RGB(120, 40, 130));
+ clrBoth = db_get_dw(NULL, MODULENAME, SET_PROPSHEET_CLRBOTH, RGB(0, 160, 10));
+ clrChanged = db_get_dw(NULL, MODULENAME, SET_PROPSHEET_CLRCHANGED, RGB(190, 0, 0));
+ clrCustom = db_get_dw(NULL, MODULENAME, SET_PROPSHEET_CLRCUSTOM, RGB(0, 10, 130));
+ clrNormal = db_get_dw(NULL, MODULENAME, SET_PROPSHEET_CLRNORMAL, RGB(90, 90, 90));
+ clrMeta = db_get_dw(NULL, MODULENAME, SET_PROPSHEET_CLRMETA, RGB(120, 40, 130));
}
INT_PTR CALLBACK Ctrl_SetTextColour(HDC hdc, WORD wFlags)
@@ -55,7 +55,7 @@ INT_PTR CALLBACK Ctrl_SetTextColour(HDC hdc, WORD wFlags) INT_PTR CALLBACK Ctrl_SetTextColour(HWND hCtrl, HDC hdc)
{
- if (hCtrl && db_get_b(NULL, MODNAME, SET_PROPSHEET_SHOWCOLOURS, 1))
+ if (hCtrl && db_get_b(NULL, MODULENAME, SET_PROPSHEET_SHOWCOLOURS, 1))
{
LPCTRL pCtrl = (LPCTRL)GetUserData(hCtrl);
if (PtrIsValid(pCtrl))
diff --git a/plugins/UserInfoEx/src/ctrl_combo.cpp b/plugins/UserInfoEx/src/ctrl_combo.cpp index ecad70f50b..cf4a7b6366 100644 --- a/plugins/UserInfoEx/src/ctrl_combo.cpp +++ b/plugins/UserInfoEx/src/ctrl_combo.cpp @@ -150,7 +150,7 @@ BOOL CCombo::OnInfoChanged(MCONTACT hContact, LPCSTR pszProto) _Flags.B.hasCustom = _Flags.B.hasProto = _Flags.B.hasMeta = false;
_Flags.W |= DB::Setting::GetTStringCtrl(hContact, USERINFO, USERINFO, pszProto, _pszSetting, &dbv);
- EnableWindow(_hwnd, !hContact || _Flags.B.hasCustom || !db_get_b(NULL, MODNAME, SET_PROPSHEET_PCBIREADONLY, 0));
+ EnableWindow(_hwnd, !hContact || _Flags.B.hasCustom || !db_get_b(NULL, MODULENAME, SET_PROPSHEET_PCBIREADONLY, 0));
if (_Flags.B.hasCustom || _Flags.B.hasProto || _Flags.B.hasMeta) {
switch (dbv.type) {
diff --git a/plugins/UserInfoEx/src/ctrl_contact.cpp b/plugins/UserInfoEx/src/ctrl_contact.cpp index d252e46ac7..1254d743c1 100644 --- a/plugins/UserInfoEx/src/ctrl_contact.cpp +++ b/plugins/UserInfoEx/src/ctrl_contact.cpp @@ -152,7 +152,7 @@ static INT_PTR CALLBACK DlgProc_EMail(HWND hDlg, UINT msg, WPARAM wParam, LPARAM SetUserData(hDlg, lParam);
SendDlgItemMessage(hDlg, IDC_HEADERBAR, WM_SETICON, 0, (LPARAM)IcoLib_GetIcon(ICO_DLG_EMAIL, TRUE));
- if (db_get_b(NULL, MODNAME, SET_ICONS_BUTTONS, 1)) {
+ if (db_get_b(NULL, MODULENAME, SET_ICONS_BUTTONS, 1)) {
SendDlgItemMessage(hDlg, IDOK, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_BTN_OK));
SendDlgItemMessage(hDlg, IDCANCEL, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_BTN_CANCEL));
}
@@ -244,7 +244,7 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam SetUserData(hDlg, lParam);
SendDlgItemMessage(hDlg, IDC_HEADERBAR, WM_SETICON, 0, (LPARAM)IcoLib_GetIcon(ICO_DLG_PHONE, TRUE));
- if (db_get_b(NULL, MODNAME, SET_ICONS_BUTTONS, 1)) {
+ if (db_get_b(NULL, MODULENAME, SET_ICONS_BUTTONS, 1)) {
SendDlgItemMessage(hDlg, IDOK, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_BTN_OK));
SendDlgItemMessage(hDlg, IDCANCEL, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_BTN_CANCEL));
}
@@ -564,7 +564,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L * return: a brush
**/
case WM_CTLCOLOREDIT:
- if (!db_get_b(NULL, MODNAME, SET_PROPSHEET_SHOWCOLOURS, 1) || (HWND)lParam != cbex->hEdit || !cbex->pItems || cbex->iSelectedItem < 0)
+ if (!db_get_b(NULL, MODULENAME, SET_PROPSHEET_SHOWCOLOURS, 1) || (HWND)lParam != cbex->hEdit || !cbex->pItems || cbex->iSelectedItem < 0)
break;
return Ctrl_SetTextColour((HDC)wParam, cbex->pItems[cbex->iSelectedItem].wFlags);
@@ -1136,7 +1136,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L bEnabled = !hContact ||
(cbex->pItems[cbex->iSelectedItem].wFlags & CTRLF_HASCUSTOM) ||
!(cbex->pItems[cbex->iSelectedItem].wFlags & (CTRLF_HASPROTO|CTRLF_HASMETA)) ||
- !db_get_b(NULL, MODNAME, SET_PROPSHEET_PCBIREADONLY, 0);
+ !db_get_b(NULL, MODULENAME, SET_PROPSHEET_PCBIREADONLY, 0);
EnableWindow(cbex->hBtnEdit, bEnabled);
EnableWindow(cbex->hBtnDel, bEnabled && GetWindowTextLength(cbex->hEdit) > 0);
diff --git a/plugins/UserInfoEx/src/ctrl_edit.cpp b/plugins/UserInfoEx/src/ctrl_edit.cpp index 2e6b94ce5f..6fb2c20d43 100644 --- a/plugins/UserInfoEx/src/ctrl_edit.cpp +++ b/plugins/UserInfoEx/src/ctrl_edit.cpp @@ -114,7 +114,7 @@ BOOL CEditCtrl::OnInfoChanged(MCONTACT hContact, LPCSTR pszProto) _Flags.W |= DB::Setting::GetTStringCtrl(hContact, _pszModule, _pszModule, pszProto, _pszSetting, &dbv); EnableWindow(_hwnd, - !hContact || _Flags.B.hasCustom || !db_get_b(NULL, MODNAME, SET_PROPSHEET_PCBIREADONLY, 0)); + !hContact || _Flags.B.hasCustom || !db_get_b(NULL, MODULENAME, SET_PROPSHEET_PCBIREADONLY, 0)); MIR_FREE(_pszValue); switch (dbv.type) { diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp index 78b01514a9..4f13b68327 100644 --- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp +++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp @@ -330,7 +330,7 @@ class CAnnivList pDlg->_sizeMin.cy = rc.bottom - rc.top;
// restore position and size
- Utils_RestoreWindowPosition(hDlg, NULL, MODNAME, "AnnivDlg_");
+ Utils_RestoreWindowPosition(hDlg, NULL, MODULENAME, "AnnivDlg_");
//save win pos
GetWindowRect(hDlg, &pDlg->_rcWin);
@@ -345,17 +345,17 @@ class CAnnivList }
// init reminder groups
- pDlg->_bRemindEnable = db_get_b(NULL, MODNAME, SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED) != REMIND_OFF;
+ pDlg->_bRemindEnable = db_get_b(NULL, MODULENAME, SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED) != REMIND_OFF;
if (hCtrl = GetDlgItem(hDlg, CHECK_REMIND)) {
Button_SetCheck(hCtrl, pDlg->_bRemindEnable ? BST_INDETERMINATE : BST_UNCHECKED);
EnableWindow(hCtrl, pDlg->_bRemindEnable);
}
- CheckDlgButton(hDlg, CHECK_POPUP, db_get_b(NULL, MODNAME, SET_ANNIVLIST_POPUP, FALSE) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, CHECK_POPUP, db_get_b(NULL, MODULENAME, SET_ANNIVLIST_POPUP, FALSE) ? BST_CHECKED : BST_UNCHECKED);
// set number of days to show contact in advance
SetDlgItemInt(hDlg, EDIT_DAYS, pDlg->_filter.wDaysBefore, FALSE);
if (hCtrl = GetDlgItem(hDlg, CHECK_DAYS)) {
- Button_SetCheck(hCtrl, db_get_b(NULL, MODNAME, SET_ANNIVLIST_FILTER_DAYSENABLED, FALSE));
+ Button_SetCheck(hCtrl, db_get_b(NULL, MODULENAME, SET_ANNIVLIST_FILTER_DAYSENABLED, FALSE));
DlgProc(hDlg, WM_COMMAND, MAKEWPARAM(CHECK_DAYS, BN_CLICKED), (LPARAM)hCtrl);
}
@@ -598,7 +598,7 @@ class CAnnivList CHAR pszSetting[MAXSETTING];
mir_snprintf(pszSetting, "AnnivDlg_Col%d", iSubItem);
- lvc.cx = db_get_w(NULL, MODNAME, pszSetting, defaultWidth);
+ lvc.cx = db_get_w(NULL, MODULENAME, pszSetting, defaultWidth);
lvc.mask = LVCF_WIDTH | LVCF_TEXT;
lvc.iSubItem = iSubItem;
lvc.pszText = TranslateW(pszText);
@@ -730,7 +730,7 @@ class CAnnivList MAnnivDate ad;
int i = 0;
DWORD age = 0;
- WORD wDaysBefore = db_get_w(NULL, MODNAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET);
+ WORD wDaysBefore = db_get_w(NULL, MODULENAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET);
WORD numMale = 0;
WORD numFemale = 0;
WORD numContacts = 0;
@@ -822,17 +822,17 @@ class CAnnivList // This method loads all filter settings from db
void LoadFilter()
{
- _filter.wDaysBefore = db_get_w(NULL, MODNAME, SET_ANNIVLIST_FILTER_DAYS, 9);
- _filter.bFilterIndex = db_get_b(NULL, MODNAME, SET_ANNIVLIST_FILTER_INDEX, 0);
+ _filter.wDaysBefore = db_get_w(NULL, MODULENAME, SET_ANNIVLIST_FILTER_DAYS, 9);
+ _filter.bFilterIndex = db_get_b(NULL, MODULENAME, SET_ANNIVLIST_FILTER_INDEX, 0);
}
// This method saves all filter settings to db
void SaveFilter()
{
if (_hDlg) {
- db_set_w(NULL, MODNAME, SET_ANNIVLIST_FILTER_DAYS, (WORD)GetDlgItemInt(_hDlg, EDIT_DAYS, nullptr, FALSE));
- db_set_b(NULL, MODNAME, SET_ANNIVLIST_FILTER_DAYSENABLED, (BYTE)Button_GetCheck(GetDlgItem(_hDlg, CHECK_DAYS)));
- db_set_b(NULL, MODNAME, SET_ANNIVLIST_FILTER_INDEX, (BYTE)ComboBox_GetCurSel(GetDlgItem(_hDlg, EDIT_DAYS)));
+ db_set_w(NULL, MODULENAME, SET_ANNIVLIST_FILTER_DAYS, (WORD)GetDlgItemInt(_hDlg, EDIT_DAYS, nullptr, FALSE));
+ db_set_b(NULL, MODULENAME, SET_ANNIVLIST_FILTER_DAYSENABLED, (BYTE)Button_GetCheck(GetDlgItem(_hDlg, CHECK_DAYS)));
+ db_set_b(NULL, MODULENAME, SET_ANNIVLIST_FILTER_INDEX, (BYTE)ComboBox_GetCurSel(GetDlgItem(_hDlg, EDIT_DAYS)));
}
}
@@ -877,14 +877,14 @@ public: for (c = 0; c < cc; c++) {
mir_snprintf(pszSetting, "AnnivDlg_Col%d", c);
- db_set_w(NULL, MODNAME, pszSetting, (WORD)ListView_GetColumnWidth(_hList, c));
+ db_set_w(NULL, MODULENAME, pszSetting, (WORD)ListView_GetColumnWidth(_hList, c));
}
DeleteAllItems();
}
// remember popup setting
- db_set_b(NULL, MODNAME, SET_ANNIVLIST_POPUP, (BYTE)IsDlgButtonChecked(_hDlg, CHECK_POPUP));
+ db_set_b(NULL, MODULENAME, SET_ANNIVLIST_POPUP, (BYTE)IsDlgButtonChecked(_hDlg, CHECK_POPUP));
// save window position, size and column widths
- Utils_SaveWindowPosition(_hDlg, NULL, MODNAME, "AnnivDlg_");
+ Utils_SaveWindowPosition(_hDlg, NULL, MODULENAME, "AnnivDlg_");
SaveFilter();
// if the window did not yet retrieve a WM_DESTROY message, do it right now.
@@ -928,7 +928,7 @@ INT_PTR DlgAnniversaryListShow(WPARAM, LPARAM) {
if (!gpDlg) {
try {
- myGlobals.WantAeroAdaption = db_get_b(NULL, MODNAME, SET_PROPSHEET_AEROADAPTION, TRUE);
+ myGlobals.WantAeroAdaption = db_get_b(NULL, MODULENAME, SET_PROPSHEET_AEROADAPTION, TRUE);
gpDlg = new CAnnivList();
}
catch(...) {
@@ -979,7 +979,7 @@ void DlgAnniversaryListLoadModule() HOTKEYDESC hk = {};
hk.pszName = "AnniversaryList";
- hk.szSection.a = MODNAME;
+ hk.szSection.a = MODULENAME;
hk.szDescription.a = LPGEN("Popup anniversary list");
hk.pszService = MS_USERINFO_REMINDER_LIST;
Hotkey_Register(&hk);
diff --git a/plugins/UserInfoEx/src/dlg_msgbox.cpp b/plugins/UserInfoEx/src/dlg_msgbox.cpp index 137fe5bd7a..ecd58db4b4 100644 --- a/plugins/UserInfoEx/src/dlg_msgbox.cpp +++ b/plugins/UserInfoEx/src/dlg_msgbox.cpp @@ -108,53 +108,53 @@ static void MakePopupAction(POPUPACTION &pa, int id) switch (id) {
case IDOK:
pa.lchIcon = IcoLib_GetIcon(ICO_BTN_OK);
- mir_strcpy(pa.lpzTitle, MODNAME"/Ok");
+ mir_strcpy(pa.lpzTitle, MODULENAME"/Ok");
break;
case IDCLOSE:
case IDCANCEL:
pa.lchIcon = IcoLib_GetIcon(ICO_BTN_CANCEL);
- mir_strcpy(pa.lpzTitle, MODNAME"/Cancel");
+ mir_strcpy(pa.lpzTitle, MODULENAME"/Cancel");
break;
case IDABORT:
pa.lchIcon = IcoLib_GetIcon(ICO_BTN_CANCEL);
- mir_strcpy(pa.lpzTitle, MODNAME"/Abort");
+ mir_strcpy(pa.lpzTitle, MODULENAME"/Abort");
break;
case IDRETRY:
pa.lchIcon = IcoLib_GetIcon(ICO_BTN_UPDATE);
- mir_strcpy(pa.lpzTitle, MODNAME"/Retry");
+ mir_strcpy(pa.lpzTitle, MODULENAME"/Retry");
break;
case IDIGNORE:
pa.lchIcon = IcoLib_GetIcon(ICO_BTN_OK);
- mir_strcpy(pa.lpzTitle, MODNAME"/Ignore");
+ mir_strcpy(pa.lpzTitle, MODULENAME"/Ignore");
break;
case IDYES:
pa.lchIcon = IcoLib_GetIcon(ICO_BTN_OK);
- mir_strcpy(pa.lpzTitle, MODNAME"/Yes");
+ mir_strcpy(pa.lpzTitle, MODULENAME"/Yes");
break;
case IDNO:
pa.lchIcon = IcoLib_GetIcon(ICO_BTN_CANCEL);
- mir_strcpy(pa.lpzTitle, MODNAME"/No");
+ mir_strcpy(pa.lpzTitle, MODULENAME"/No");
break;
case IDHELP:
pa.lchIcon = IcoLib_GetIcon(ICO_BTN_CANCEL);
- mir_strcpy(pa.lpzTitle, MODNAME"/Help");
+ mir_strcpy(pa.lpzTitle, MODULENAME"/Help");
break;
case IDALL:
pa.lchIcon = IcoLib_GetIcon(ICO_BTN_OK);
- mir_strcpy(pa.lpzTitle, MODNAME"/All");
+ mir_strcpy(pa.lpzTitle, MODULENAME"/All");
break;
case IDNONE:
pa.lchIcon = IcoLib_GetIcon(ICO_BTN_CANCEL);
- mir_strcpy(pa.lpzTitle, MODNAME"/None");
+ mir_strcpy(pa.lpzTitle, MODULENAME"/None");
}
}
@@ -645,7 +645,7 @@ INT_PTR MsgBoxService(WPARAM, LPARAM lParam) && ServiceExists(MS_POPUP_ADDPOPUPT) // popups exist?
&& myGlobals.PopupActionsExist == 1 // popup support ext stuct?
&& (db_get_dw(NULL, "Popup", "Actions", 0) & 1) // popup++ actions on?
- && db_get_b(NULL, MODNAME, SET_POPUPMSGBOX, DEFVAL_POPUPMSGBOX)) // user likes popups?
+ && db_get_b(NULL, MODULENAME, SET_POPUPMSGBOX, DEFVAL_POPUPMSGBOX)) // user likes popups?
return DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_MSGBOXDUMMI), pMsgBox->hParent, MsgBoxPop, lParam);
return DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_MSGBOX), pMsgBox->hParent, MsgBoxProc, lParam);
@@ -687,7 +687,7 @@ INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszI INT_PTR CALLBACK MsgErr(HWND hParent, LPCTSTR pszFormat, ...)
{
wchar_t tszTitle[MAX_SECONDLINE], tszMsg[MAX_SECONDLINE];
- mir_snwprintf(tszTitle, L"%s - %s", _T(MODNAME), TranslateT("Error"));
+ mir_snwprintf(tszTitle, L"%s - %s", _T(MODULENAME), TranslateT("Error"));
va_list vl;
va_start(vl, pszFormat);
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index b0500db926..2bc8a85ab3 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -244,8 +244,8 @@ static int SortProc(CPsTreeItem **item1, CPsTreeItem **item2) static INT_PTR ShowDialog(WPARAM wParam, LPARAM)
{
// update some cached settings
- myGlobals.ShowPropsheetColours = db_get_b(NULL, MODNAME, SET_PROPSHEET_SHOWCOLOURS, TRUE);
- myGlobals.WantAeroAdaption = db_get_b(NULL, MODNAME, SET_PROPSHEET_AEROADAPTION, TRUE);
+ myGlobals.ShowPropsheetColours = db_get_b(NULL, MODULENAME, SET_PROPSHEET_SHOWCOLOURS, TRUE);
+ myGlobals.WantAeroAdaption = db_get_b(NULL, MODULENAME, SET_PROPSHEET_AEROADAPTION, TRUE);
// allow only one dialog per user
if (HWND hWnd = WindowList_Find(g_hWindowList, wParam)) {
@@ -259,9 +259,9 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM) bool bScanMetaSubContacts = false;
// init the treeview options
- if (db_get_b(NULL, MODNAME, SET_PROPSHEET_SORTITEMS, FALSE))
+ if (db_get_b(NULL, MODULENAME, SET_PROPSHEET_SORTITEMS, FALSE))
psh._dwFlags |= PSTVF_SORTTREE;
- if (db_get_b(NULL, MODNAME, SET_PROPSHEET_GROUPS, TRUE))
+ if (db_get_b(NULL, MODULENAME, SET_PROPSHEET_GROUPS, TRUE))
psh._dwFlags |= PSTVF_GROUPS;
// create imagelist
@@ -503,7 +503,7 @@ static int InitDetails(WPARAM wParam, LPARAM lParam) {
CPsHdr *pPsh = (CPsHdr *)wParam;
if (!(pPsh->_dwFlags & PSF_PROTOPAGESONLY)) {
- BYTE bChangeDetailsEnabled = myGlobals.CanChangeDetails && db_get_b(NULL, MODNAME, SET_PROPSHEET_CHANGEMYDETAILS, FALSE);
+ BYTE bChangeDetailsEnabled = myGlobals.CanChangeDetails && db_get_b(NULL, MODULENAME, SET_PROPSHEET_CHANGEMYDETAILS, FALSE);
if (lParam || bChangeDetailsEnabled) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = g_plugin.getInst();
@@ -803,7 +803,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar }
}
// restore window position and add required size
- Utils_RestoreWindowPositionNoSize(hDlg, NULL, MODNAME, "DetailsDlg");
+ Utils_RestoreWindowPositionNoSize(hDlg, NULL, MODULENAME, "DetailsDlg");
}
//
@@ -1128,7 +1128,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar { ICO_BTN_APPLY, BM_SETIMAGE, IDAPPLY }
};
- const int numIconsToSet = db_get_b(NULL, MODNAME, SET_ICONS_BUTTONS, 1) ? _countof(idIcon) : 1;
+ const int numIconsToSet = db_get_b(NULL, MODULENAME, SET_ICONS_BUTTONS, 1) ? _countof(idIcon) : 1;
IcoLib_SetCtrlIcons(hDlg, idIcon, numIconsToSet);
@@ -1243,7 +1243,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case ACKTYPE_GETINFO:
// is contact the owner of the dialog or any metasubcontact of the owner? skip handling otherwise!
if (ack->hContact != pPs->hContact) {
- if (!db_get_b(NULL, MODNAME, SET_META_SCAN, TRUE))
+ if (!db_get_b(NULL, MODULENAME, SET_META_SCAN, TRUE))
break;
for (i = 0; i < pPs->nSubContacts; i++) {
@@ -1316,7 +1316,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (hContact != pPs->hContact) {
if (pPs->hContact != db_mc_getMeta(hContact))
break;
- if (!db_get_b(NULL, MODNAME, SET_META_SCAN, TRUE))
+ if (!db_get_b(NULL, MODULENAME, SET_META_SCAN, TRUE))
break;
}
@@ -1517,7 +1517,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar pcli->pfnInvalidateDisplayNameCacheEntry(pPs->hContact);
// need to upload owners settings
- if (!pPs->hContact && myGlobals.CanChangeDetails && db_get_b(NULL, MODNAME, SET_PROPSHEET_CHANGEMYDETAILS, FALSE)) {
+ if (!pPs->hContact && myGlobals.CanChangeDetails && db_get_b(NULL, MODULENAME, SET_PROPSHEET_CHANGEMYDETAILS, FALSE)) {
if (pPs->pUpload = new CPsUpload(pPs, LOWORD(wParam) == IDOK)) {
if (pPs->pUpload->UploadFirst() == CPsUpload::UPLOAD_CONTINUE)
break;
@@ -1615,7 +1615,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar UnhookEvent(pPs->hIconsChanged);
// save my window position
- Utils_SaveWindowPosition(hDlg, NULL, MODNAME, "DetailsDlg");
+ Utils_SaveWindowPosition(hDlg, NULL, MODULENAME, "DetailsDlg");
// save current tree and destroy it
if (pPs->pTree != nullptr) {
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp index fe7bedb5c7..e4f0f3d090 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp @@ -167,7 +167,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar { ICO_BTN_EXPORT, BM_SETIMAGE, IDOK },
{ ICO_BTN_CANCEL, BM_SETIMAGE, IDCANCEL }
};
- const int numIconsToSet = db_get_b(NULL, MODNAME, SET_ICONS_BUTTONS, 1) ? _countof(idIcon) : 2;
+ const int numIconsToSet = db_get_b(NULL, MODULENAME, SET_ICONS_BUTTONS, 1) ? _countof(idIcon) : 2;
IcoLib_SetCtrlIcons(hDlg, idIcon, numIconsToSet);
// create imagelist for treeview
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp index fc1f62f342..df30690a1b 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp @@ -204,7 +204,7 @@ static void GetInitialDir(LPSTR pszInitialDir) szRelative[0] = 0;
// is some standard path defined
- if (!db_get_static(0, MODNAME, "vCardPath", szRelative, _countof(szRelative))) {
+ if (!db_get_static(0, MODULENAME, "vCardPath", szRelative, _countof(szRelative))) {
if (!PathToAbsolute(szRelative, pszInitialDir))
mir_strcpy(pszInitialDir, szRelative);
}
@@ -225,9 +225,9 @@ static void SaveInitialDir(LPSTR pszInitialDir) if (p = mir_strrchr(pszInitialDir, '\\')) {
*p = 0;
if ( PathToRelative(pszInitialDir, szRelative))
- db_set_s(0, MODNAME, "vCardPath", szRelative);
+ db_set_s(0, MODULENAME, "vCardPath", szRelative);
else
- db_set_s(0, MODNAME, "vCardPath", pszInitialDir);
+ db_set_s(0, MODULENAME, "vCardPath", pszInitialDir);
*p = '\\';
}
}
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp index 4b68a0de12..db0e72e03a 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp @@ -42,7 +42,7 @@ INT_PTR CALLBACK DlgProcProgress(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPar { ICO_DLG_IMPORT, STM_SETIMAGE, ICO_DLGLOGO },
{ ICO_BTN_CANCEL, BM_SETIMAGE, IDCANCEL }
};
- const int numIconsToSet = db_get_b(NULL, MODNAME, SET_ICONS_BUTTONS, 1) ? _countof(idIcon) : 2;
+ const int numIconsToSet = db_get_b(NULL, MODULENAME, SET_ICONS_BUTTONS, 1) ? _countof(idIcon) : 2;
IcoLib_SetCtrlIcons(hDlg, idIcon, numIconsToSet);
TranslateDialogDefault(hDlg);
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp index a3c8f29591..6db5af2457 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp @@ -35,7 +35,7 @@ INT_PTR CALLBACK DlgProc_DataHistory(HWND hDlg, UINT msg, WPARAM wParam, LPARAM { ICO_BTN_EXPORT, BM_SETIMAGE, IDOK },
{ ICO_BTN_CANCEL, BM_SETIMAGE, IDCANCEL }
};
- const int numIconsToSet = db_get_b(NULL, MODNAME, SET_ICONS_BUTTONS, 1) ? _countof(idIcon) : 2;
+ const int numIconsToSet = db_get_b(NULL, MODULENAME, SET_ICONS_BUTTONS, 1) ? _countof(idIcon) : 2;
IcoLib_SetCtrlIcons(hDlg, idIcon, numIconsToSet);
SendDlgItemMessage(hDlg, IDOK, BUTTONTRANSLATE, NULL, NULL);
diff --git a/plugins/UserInfoEx/src/init.cpp b/plugins/UserInfoEx/src/init.cpp index d4e3d64307..64a7753f1d 100644 --- a/plugins/UserInfoEx/src/init.cpp +++ b/plugins/UserInfoEx/src/init.cpp @@ -28,7 +28,7 @@ HMODULE hDwmApi; /////////////////////////////////////////////////////////////////////////////////////////
-static PLUGININFOEX pluginInfo =
+static PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -42,9 +42,13 @@ static PLUGININFOEX pluginInfo = {0x9c23a24b, 0xe6aa, 0x43c6, {0xb0, 0xb8, 0xd6, 0xc3, 0x6d, 0x2f, 0x7b, 0x57}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/*
@@ -154,7 +158,7 @@ extern "C" int __declspec(dllexport) Unload(void) **/
extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
// init common controls
INITCOMMONCONTROLSEX ccEx;
diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp index f659d37637..16f3358b8f 100644 --- a/plugins/UserInfoEx/src/mir_db.cpp +++ b/plugins/UserInfoEx/src/mir_db.cpp @@ -115,7 +115,7 @@ bool IsMeta(LPCSTR pszModule) bool IsMetaAndScan(LPCSTR pszModule)
{
- return 0 != db_get_b(NULL, MODNAME, SET_META_SCAN, TRUE) && IsMeta(pszModule);
+ return 0 != db_get_b(NULL, MODULENAME, SET_META_SCAN, TRUE) && IsMeta(pszModule);
}
} /* namespace Module */
diff --git a/plugins/UserInfoEx/src/mir_icolib.cpp b/plugins/UserInfoEx/src/mir_icolib.cpp index a1742bfde7..998fb45807 100644 --- a/plugins/UserInfoEx/src/mir_icolib.cpp +++ b/plugins/UserInfoEx/src/mir_icolib.cpp @@ -154,7 +154,7 @@ LPTSTR IcoLib_GetDefaultIconFileName() **/
static void IcoLib_CheckIconPackVersion(LPTSTR szIconPack)
{
- if (db_get_b(NULL, MODNAME, SET_ICONS_CHECKFILEVERSION, TRUE)) {
+ if (db_get_b(NULL, MODULENAME, SET_ICONS_CHECKFILEVERSION, TRUE)) {
if (szIconPack) {
wchar_t szAbsolutePath[MAX_PATH];
PathToAbsoluteW(szIconPack, szAbsolutePath);
diff --git a/plugins/UserInfoEx/src/mir_icolib.h b/plugins/UserInfoEx/src/mir_icolib.h index bbc5763423..185f8170b3 100644 --- a/plugins/UserInfoEx/src/mir_icolib.h +++ b/plugins/UserInfoEx/src/mir_icolib.h @@ -30,88 +30,88 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define SECT_REMIND LPGEN("Extended user info") "/" LPGEN("Reminder")
// icons
-#define ICO_COMMON_MAIN MODNAME"_common_main"
-#define ICO_COMMON_DEFAULT MODNAME"_common_default"
-#define ICO_COMMON_IM MODNAME"_common_im"
-#define ICO_COMMON_FEMALE MODNAME"_common_female"
-#define ICO_COMMON_MALE MODNAME"_common_male"
-#define ICO_COMMON_BIRTHDAY MODNAME"_common_birthday"
-#define ICO_COMMON_ANNIVERSARY MODNAME"_common_anniversary"
-#define ICO_COMMON_CLOCK MODNAME"_common_clock"
-#define ICO_COMMON_MARITAL MODNAME"_common_marital"
-#define ICO_COMMON_PASSWORD MODNAME"_common_password"
-#define ICO_COMMON_ADDRESS MODNAME"_common_address"
-#define ICO_DLG_DETAILS MODNAME"_dlg_details"
-#define ICO_DLG_PHONE MODNAME"_dlg_phone"
-#define ICO_DLG_EMAIL MODNAME"_dlg_email"
-#define ICO_DLG_EXPORT MODNAME"_dlg_export"
-#define ICO_DLG_IMPORT MODNAME"_dlg_import"
-#define ICO_DLG_ANNIVERSARY MODNAME"_dlg_anniversary"
-#define ICO_DLG_SEARCH MODNAME"_dlg_search"
-#define ICO_LST_MODULES MODNAME"_lst_modules"
-#define ICO_LST_FOLDER MODNAME"_lst_folder"
-#define ICO_BTN_UPDATE MODNAME"_btn_update"
-#define ICO_BTN_OK MODNAME"_btn_ok"
-#define ICO_BTN_CANCEL MODNAME"_btn_cancel"
-#define ICO_BTN_APPLY MODNAME"_btn_apply"
-#define ICO_BTN_GOTO MODNAME"_btn_goto"
-#define ICO_BTN_ADD MODNAME"_btn_add"
-#define ICO_BTN_EDIT MODNAME"_btn_edit"
-#define ICO_BTN_DELETE MODNAME"_btn_delete"
-#define ICO_BTN_IMPORT MODNAME"_btn_import"
-#define ICO_BTN_EXPORT MODNAME"_btn_export"
-#define ICO_BTN_NOTES MODNAME"_btn_notes"
-#define ICO_BTN_ABOUT MODNAME"_btn_about"
-#define ICO_BTN_PROFILE MODNAME"_btn_profile"
-#define ICO_BTN_DOWNARROW MODNAME"_btn_downarrow"
-#define ICO_BTN_PHONE MODNAME"_btn_phone"
-#define ICO_BTN_FAX MODNAME"_btn_fax"
-#define ICO_BTN_CELLULAR MODNAME"_btn_cellular"
-#define ICO_BTN_CUSTOMPHONE MODNAME"_btn_customphone"
-#define ICO_BTN_EMAIL MODNAME"_btn_email"
-#define ICO_BTN_SEARCH MODNAME"_btn_search"
-#define ICO_BTN_EXIMPORT MODNAME"_btn_eximport"
-#define ICO_BTN_BDAY_BACKUP MODNAME"_btn_bdaybackup"
-#define ICO_BTN_YES MODNAME"_btn_yes"
-#define ICO_BTN_NO MODNAME"_btn_no"
-#define ICO_BTN_IGNORE MODNAME"_btn_ignore"
-#define ICO_ZOD_AQUARIUS MODNAME"_zod_aquarius"
-#define ICO_ZOD_ARIES MODNAME"_zod_aries"
-#define ICO_ZOD_CANCER MODNAME"_zod_cancer"
-#define ICO_ZOD_CAPRICORN MODNAME"_zod_capricorn"
-#define ICO_ZOD_GEMINI MODNAME"_zod_gemini"
-#define ICO_ZOD_LEO MODNAME"_zod_leo"
-#define ICO_ZOD_LIBRA MODNAME"_zod_libra"
-#define ICO_ZOD_PISCES MODNAME"_zod_pisces"
-#define ICO_ZOD_SAGITTARIUS MODNAME"_zod_sagittarius"
-#define ICO_ZOD_SCORPIO MODNAME"_zod_scorpio"
-#define ICO_ZOD_TAURUS MODNAME"_zod_taurus"
-#define ICO_ZOD_VIRGO MODNAME"_zod_virgo"
-#define ICO_TREE_DEFAULT MODNAME"_tree_default"
+#define ICO_COMMON_MAIN MODULENAME"_common_main"
+#define ICO_COMMON_DEFAULT MODULENAME"_common_default"
+#define ICO_COMMON_IM MODULENAME"_common_im"
+#define ICO_COMMON_FEMALE MODULENAME"_common_female"
+#define ICO_COMMON_MALE MODULENAME"_common_male"
+#define ICO_COMMON_BIRTHDAY MODULENAME"_common_birthday"
+#define ICO_COMMON_ANNIVERSARY MODULENAME"_common_anniversary"
+#define ICO_COMMON_CLOCK MODULENAME"_common_clock"
+#define ICO_COMMON_MARITAL MODULENAME"_common_marital"
+#define ICO_COMMON_PASSWORD MODULENAME"_common_password"
+#define ICO_COMMON_ADDRESS MODULENAME"_common_address"
+#define ICO_DLG_DETAILS MODULENAME"_dlg_details"
+#define ICO_DLG_PHONE MODULENAME"_dlg_phone"
+#define ICO_DLG_EMAIL MODULENAME"_dlg_email"
+#define ICO_DLG_EXPORT MODULENAME"_dlg_export"
+#define ICO_DLG_IMPORT MODULENAME"_dlg_import"
+#define ICO_DLG_ANNIVERSARY MODULENAME"_dlg_anniversary"
+#define ICO_DLG_SEARCH MODULENAME"_dlg_search"
+#define ICO_LST_MODULES MODULENAME"_lst_modules"
+#define ICO_LST_FOLDER MODULENAME"_lst_folder"
+#define ICO_BTN_UPDATE MODULENAME"_btn_update"
+#define ICO_BTN_OK MODULENAME"_btn_ok"
+#define ICO_BTN_CANCEL MODULENAME"_btn_cancel"
+#define ICO_BTN_APPLY MODULENAME"_btn_apply"
+#define ICO_BTN_GOTO MODULENAME"_btn_goto"
+#define ICO_BTN_ADD MODULENAME"_btn_add"
+#define ICO_BTN_EDIT MODULENAME"_btn_edit"
+#define ICO_BTN_DELETE MODULENAME"_btn_delete"
+#define ICO_BTN_IMPORT MODULENAME"_btn_import"
+#define ICO_BTN_EXPORT MODULENAME"_btn_export"
+#define ICO_BTN_NOTES MODULENAME"_btn_notes"
+#define ICO_BTN_ABOUT MODULENAME"_btn_about"
+#define ICO_BTN_PROFILE MODULENAME"_btn_profile"
+#define ICO_BTN_DOWNARROW MODULENAME"_btn_downarrow"
+#define ICO_BTN_PHONE MODULENAME"_btn_phone"
+#define ICO_BTN_FAX MODULENAME"_btn_fax"
+#define ICO_BTN_CELLULAR MODULENAME"_btn_cellular"
+#define ICO_BTN_CUSTOMPHONE MODULENAME"_btn_customphone"
+#define ICO_BTN_EMAIL MODULENAME"_btn_email"
+#define ICO_BTN_SEARCH MODULENAME"_btn_search"
+#define ICO_BTN_EXIMPORT MODULENAME"_btn_eximport"
+#define ICO_BTN_BDAY_BACKUP MODULENAME"_btn_bdaybackup"
+#define ICO_BTN_YES MODULENAME"_btn_yes"
+#define ICO_BTN_NO MODULENAME"_btn_no"
+#define ICO_BTN_IGNORE MODULENAME"_btn_ignore"
+#define ICO_ZOD_AQUARIUS MODULENAME"_zod_aquarius"
+#define ICO_ZOD_ARIES MODULENAME"_zod_aries"
+#define ICO_ZOD_CANCER MODULENAME"_zod_cancer"
+#define ICO_ZOD_CAPRICORN MODULENAME"_zod_capricorn"
+#define ICO_ZOD_GEMINI MODULENAME"_zod_gemini"
+#define ICO_ZOD_LEO MODULENAME"_zod_leo"
+#define ICO_ZOD_LIBRA MODULENAME"_zod_libra"
+#define ICO_ZOD_PISCES MODULENAME"_zod_pisces"
+#define ICO_ZOD_SAGITTARIUS MODULENAME"_zod_sagittarius"
+#define ICO_ZOD_SCORPIO MODULENAME"_zod_scorpio"
+#define ICO_ZOD_TAURUS MODULENAME"_zod_taurus"
+#define ICO_ZOD_VIRGO MODULENAME"_zod_virgo"
+#define ICO_TREE_DEFAULT MODULENAME"_tree_default"
-#define ICO_RMD_DTB0 MODNAME"_rmd_dtb0"
-#define ICO_RMD_DTB1 MODNAME"_rmd_dtb1"
-#define ICO_RMD_DTB2 MODNAME"_rmd_dtb2"
-#define ICO_RMD_DTB3 MODNAME"_rmd_dtb3"
-#define ICO_RMD_DTB4 MODNAME"_rmd_dtb4"
-#define ICO_RMD_DTB5 MODNAME"_rmd_dtb5"
-#define ICO_RMD_DTB6 MODNAME"_rmd_dtb6"
-#define ICO_RMD_DTB7 MODNAME"_rmd_dtb7"
-#define ICO_RMD_DTB8 MODNAME"_rmd_dtb8"
-#define ICO_RMD_DTB9 MODNAME"_rmd_dtb9"
-#define ICO_RMD_DTBX MODNAME"_rmd_dtbx"
+#define ICO_RMD_DTB0 MODULENAME"_rmd_dtb0"
+#define ICO_RMD_DTB1 MODULENAME"_rmd_dtb1"
+#define ICO_RMD_DTB2 MODULENAME"_rmd_dtb2"
+#define ICO_RMD_DTB3 MODULENAME"_rmd_dtb3"
+#define ICO_RMD_DTB4 MODULENAME"_rmd_dtb4"
+#define ICO_RMD_DTB5 MODULENAME"_rmd_dtb5"
+#define ICO_RMD_DTB6 MODULENAME"_rmd_dtb6"
+#define ICO_RMD_DTB7 MODULENAME"_rmd_dtb7"
+#define ICO_RMD_DTB8 MODULENAME"_rmd_dtb8"
+#define ICO_RMD_DTB9 MODULENAME"_rmd_dtb9"
+#define ICO_RMD_DTBX MODULENAME"_rmd_dtbx"
-#define ICO_RMD_DTA0 MODNAME"_rmd_dta0"
-#define ICO_RMD_DTA1 MODNAME"_rmd_dta1"
-#define ICO_RMD_DTA2 MODNAME"_rmd_dta2"
-#define ICO_RMD_DTA3 MODNAME"_rmd_dta3"
-#define ICO_RMD_DTA4 MODNAME"_rmd_dta4"
-#define ICO_RMD_DTA5 MODNAME"_rmd_dta5"
-#define ICO_RMD_DTA6 MODNAME"_rmd_dta6"
-#define ICO_RMD_DTA7 MODNAME"_rmd_dta7"
-#define ICO_RMD_DTA8 MODNAME"_rmd_dta8"
-#define ICO_RMD_DTA9 MODNAME"_rmd_dta9"
-#define ICO_RMD_DTAX MODNAME"_rmd_dtax"
+#define ICO_RMD_DTA0 MODULENAME"_rmd_dta0"
+#define ICO_RMD_DTA1 MODULENAME"_rmd_dta1"
+#define ICO_RMD_DTA2 MODULENAME"_rmd_dta2"
+#define ICO_RMD_DTA3 MODULENAME"_rmd_dta3"
+#define ICO_RMD_DTA4 MODULENAME"_rmd_dta4"
+#define ICO_RMD_DTA5 MODULENAME"_rmd_dta5"
+#define ICO_RMD_DTA6 MODULENAME"_rmd_dta6"
+#define ICO_RMD_DTA7 MODULENAME"_rmd_dta7"
+#define ICO_RMD_DTA8 MODULENAME"_rmd_dta8"
+#define ICO_RMD_DTA9 MODULENAME"_rmd_dta9"
+#define ICO_RMD_DTAX MODULENAME"_rmd_dtax"
#define SET_ICONS_CHECKFILEVERSION "CheckIconPackVersion"
#define SET_ICONS_BUTTONS "ButtonIcons"
diff --git a/plugins/UserInfoEx/src/mir_menuitems.cpp b/plugins/UserInfoEx/src/mir_menuitems.cpp index 8a3986996e..a68a4f5058 100644 --- a/plugins/UserInfoEx/src/mir_menuitems.cpp +++ b/plugins/UserInfoEx/src/mir_menuitems.cpp @@ -73,10 +73,10 @@ void RebuildContact() SvcHomepageRebuildMenu();
// load options
- int flag = db_get_b(NULL, MODNAME, SET_MI_CONTACT, MCAS_NOTINITIATED);
+ int flag = db_get_b(NULL, MODULENAME, SET_MI_CONTACT, MCAS_NOTINITIATED);
if (flag == MCAS_NOTINITIATED) {
flag = MCAS_EXIMPORT | TRUE;
- db_set_b(NULL, MODNAME, SET_MI_CONTACT, flag);
+ db_set_b(NULL, MODULENAME, SET_MI_CONTACT, flag);
}
// delete all MenuItems and set all bytes 0 to avoid problems
@@ -166,10 +166,10 @@ void RebuildMain() static HGENMENU hMenuItem[8] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr };
// load options
- int flag = db_get_b(NULL, MODNAME, SET_MI_MAIN, MCAS_NOTINITIATED);
+ int flag = db_get_b(NULL, MODULENAME, SET_MI_MAIN, MCAS_NOTINITIATED);
if (flag == MCAS_NOTINITIATED) {
flag = MCAS_ALL | TRUE;
- db_set_b(NULL, MODNAME, SET_MI_MAIN, flag);
+ db_set_b(NULL, MODULENAME, SET_MI_MAIN, flag);
}
// delete all MenuItems and set all bytes 0 to avoid problems
@@ -240,8 +240,8 @@ void RebuildMain() // reminder
mi.root = mhRoot;
const BYTE bRemindMenus =
- db_get_b(NULL, MODNAME, SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED) &&
- db_get_b(NULL, MODNAME, SET_REMIND_MENUENABLED, DEFVAL_REMIND_MENUENABLED);
+ db_get_b(NULL, MODULENAME, SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED) &&
+ db_get_b(NULL, MODULENAME, SET_REMIND_MENUENABLED, DEFVAL_REMIND_MENUENABLED);
if (bRemindMenus) {
// make backup of each protocol based birthday
SET_UID(mi, 0x67980bea, 0x8fca, 0x4642, 0x96, 0x78, 0x6a, 0xc0, 0xe3, 0x74, 0x4c, 0x2a);
@@ -300,10 +300,10 @@ void RebuildGroup() static HGENMENU hMenuItem[3] = { nullptr, nullptr, nullptr };
// load options
- flag = db_get_b(NULL, MODNAME, SET_MI_GROUP, MCAS_NOTINITIATED);
+ flag = db_get_b(NULL, MODULENAME, SET_MI_GROUP, MCAS_NOTINITIATED);
if (flag == MCAS_NOTINITIATED) {
flag = MCAS_EXIMPORT | TRUE;
- db_set_b(NULL, MODNAME, SET_MI_GROUP, flag);
+ db_set_b(NULL, MODULENAME, SET_MI_GROUP, flag);
}
// delete all MenuItems and set all bytes 0 to avoid problems
@@ -391,10 +391,10 @@ void RebuildSubGroup() static HGENMENU hMenuItem[3] = { nullptr, nullptr, nullptr };
// load options
- flag = db_get_b(NULL, MODNAME, SET_MI_SUBGROUP, MCAS_NOTINITIATED);
+ flag = db_get_b(NULL, MODULENAME, SET_MI_SUBGROUP, MCAS_NOTINITIATED);
if (flag == MCAS_NOTINITIATED) {
flag = MCAS_DISABLED | TRUE;
- db_set_b(NULL, MODNAME, SET_MI_SUBGROUP, flag);
+ db_set_b(NULL, MODULENAME, SET_MI_SUBGROUP, flag);
}
// delete all MenuItems and set all bytes 0 to avoid problems
@@ -499,10 +499,10 @@ INT_PTR RebuildAccount(WPARAM, LPARAM lParam) RemoveMenuItems(hMenuItemAccount, mItems * pcli->menuProtos->getCount());
// load options
- int flag = db_get_b(NULL, MODNAME, SET_MI_ACCOUNT, MCAS_NOTINITIATED);
+ int flag = db_get_b(NULL, MODULENAME, SET_MI_ACCOUNT, MCAS_NOTINITIATED);
if (flag == MCAS_NOTINITIATED) {
flag = MCAS_EXIMPORT | TRUE;
- db_set_b(NULL, MODNAME, SET_MI_ACCOUNT, flag);
+ db_set_b(NULL, MODULENAME, SET_MI_ACCOUNT, flag);
}
// loop for all account names
diff --git a/plugins/UserInfoEx/src/psp_anniversary.cpp b/plugins/UserInfoEx/src/psp_anniversary.cpp index 7b9eb45537..ab41b642d9 100644 --- a/plugins/UserInfoEx/src/psp_anniversary.cpp +++ b/plugins/UserInfoEx/src/psp_anniversary.cpp @@ -44,7 +44,7 @@ static INT_PTR CALLBACK DlgProc_AnniversaryEditor(HWND hDlg, UINT uMsg, WPARAM w SetUserData(hDlg, lParam);
// set icons
- if (db_get_b(NULL, MODNAME, SET_ICONS_BUTTONS, 1)) {
+ if (db_get_b(NULL, MODULENAME, SET_ICONS_BUTTONS, 1)) {
SendDlgItemMessage(hDlg, IDOK, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_BTN_OK));
SendDlgItemMessage(hDlg, IDCANCEL, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_BTN_CANCEL));
}
diff --git a/plugins/UserInfoEx/src/psp_general.cpp b/plugins/UserInfoEx/src/psp_general.cpp index 5c92af6fe0..e3d1a10de4 100644 --- a/plugins/UserInfoEx/src/psp_general.cpp +++ b/plugins/UserInfoEx/src/psp_general.cpp @@ -91,7 +91,7 @@ INT_PTR CALLBACK PSPProcGeneral(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar CheckDlgButton(hDlg, RADIO_FEMALE, (dbv.bVal == 'F') ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg, RADIO_MALE, (dbv.bVal == 'M') ? BST_CHECKED : BST_UNCHECKED);
- bEnable = !hContact || Flags.B.hasCustom || !db_get_b(NULL, MODNAME, SET_PROPSHEET_PCBIREADONLY, 0);
+ bEnable = !hContact || Flags.B.hasCustom || !db_get_b(NULL, MODULENAME, SET_PROPSHEET_PCBIREADONLY, 0);
EnableWindow(GetDlgItem(hDlg, RADIO_FEMALE), bEnable);
EnableWindow(GetDlgItem(hDlg, RADIO_MALE), bEnable);
}
diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp index 5c4355f36a..071c3ece1a 100644 --- a/plugins/UserInfoEx/src/psp_options.cpp +++ b/plugins/UserInfoEx/src/psp_options.cpp @@ -135,7 +135,7 @@ static BYTE EnableControls(HWND hDlg, const int *idCtrl, int countCtrl, BYTE bEn **/
static BYTE DBGetCheckBtn(HWND hDlg, const int idCtrl, LPCSTR pszSetting, BYTE bDefault)
{
- BYTE val = (db_get_b(NULL, MODNAME, pszSetting, bDefault) & 1) == 1;
+ BYTE val = (db_get_b(NULL, MODULENAME, pszSetting, bDefault) & 1) == 1;
CheckDlgButton(hDlg, idCtrl, val ? BST_CHECKED : BST_UNCHECKED);
return val;
}
@@ -153,9 +153,9 @@ static BYTE DBGetCheckBtn(HWND hDlg, const int idCtrl, LPCSTR pszSetting, BYTE b static BYTE DBWriteCheckBtn(HWND hDlg, const int idCtrl, LPCSTR pszSetting)
{
BYTE val = IsDlgButtonChecked(hDlg, idCtrl);
- int Temp = db_get_b(NULL, MODNAME, pszSetting, 0);
+ int Temp = db_get_b(NULL, MODULENAME, pszSetting, 0);
Temp &= ~1;
- db_set_b(NULL, MODNAME, pszSetting, Temp |= val);
+ db_set_b(NULL, MODULENAME, pszSetting, Temp |= val);
return val;
}
@@ -172,7 +172,7 @@ static BYTE DBWriteCheckBtn(HWND hDlg, const int idCtrl, LPCSTR pszSetting) **/
static void DBGetColor(HWND hDlg, const int idCtrl, LPCSTR pszSetting, DWORD bDefault)
{
- SendDlgItemMessage(hDlg, idCtrl, CPM_SETCOLOUR, 0, db_get_dw(NULL, MODNAME, pszSetting, bDefault));
+ SendDlgItemMessage(hDlg, idCtrl, CPM_SETCOLOUR, 0, db_get_dw(NULL, MODULENAME, pszSetting, bDefault));
}
/**
@@ -187,7 +187,7 @@ static void DBGetColor(HWND hDlg, const int idCtrl, LPCSTR pszSetting, DWORD bDe **/
static void DBWriteColor(HWND hDlg, const int idCtrl, LPCSTR pszSetting)
{
- db_set_dw(NULL, MODNAME, pszSetting, (DWORD)SendDlgItemMessage(hDlg, idCtrl, CPM_GETCOLOUR, 0, 0));
+ db_set_dw(NULL, MODULENAME, pszSetting, (DWORD)SendDlgItemMessage(hDlg, idCtrl, CPM_GETCOLOUR, 0, 0));
}
/**
@@ -209,8 +209,8 @@ static BYTE DBWriteEditByte(HWND hDlg, const int idCtrl, LPCSTR pszSetting, BYTE BOOL t;
v = (BYTE)GetDlgItemInt(hDlg, idCtrl, &t, FALSE);
- if (t && (v != db_get_b(NULL, MODNAME, pszSetting, defVal)))
- return db_set_b(NULL, MODNAME, pszSetting, v) == 0;
+ if (t && (v != db_get_b(NULL, MODULENAME, pszSetting, defVal)))
+ return db_set_b(NULL, MODULENAME, pszSetting, v) == 0;
return FALSE;
}
@@ -233,8 +233,8 @@ static BYTE DBWriteEditWord(HWND hDlg, const int idCtrl, LPCSTR pszSetting, WORD BOOL t;
v = (WORD)GetDlgItemInt(hDlg, idCtrl, &t, FALSE);
- if (t && (v != db_get_w(NULL, MODNAME, pszSetting, defVal)))
- return db_set_w(NULL, MODNAME, pszSetting, v) == 0;
+ if (t && (v != db_get_w(NULL, MODULENAME, pszSetting, defVal)))
+ return db_set_w(NULL, MODULENAME, pszSetting, v) == 0;
return FALSE;
}
@@ -256,8 +256,8 @@ static BYTE DBWriteComboByte(HWND hDlg, const int idCtrl, LPCSTR pszSetting, BYT BYTE v;
v = (BYTE)SendDlgItemMessage(hDlg, idCtrl, CB_GETCURSEL, NULL, NULL);
- if (v != db_get_b(NULL, MODNAME, pszSetting, defVal))
- return db_set_b(NULL, MODNAME, pszSetting, v) == 0;
+ if (v != db_get_b(NULL, MODULENAME, pszSetting, defVal))
+ return db_set_b(NULL, MODULENAME, pszSetting, v) == 0;
return FALSE;
}
@@ -279,7 +279,7 @@ static INT_PTR CALLBACK DlgProc_CommonOpts(HWND hDlg, UINT uMsg, WPARAM wParam, // menu item settings
for (auto &it : ctrl_Menu) {
- int flag = db_get_b(NULL, MODNAME, it.pszKey, 2);
+ int flag = db_get_b(NULL, MODULENAME, it.pszKey, 2);
// check button and enable / disable control
int idEnable[] = { it.idCheckbox + 1, it.idNONE, it.idALL, it.idEXIMPORT };
EnableControls(hDlg, idEnable, _countof(idEnable), DBGetCheckBtn(hDlg, it.idCheckbox, it.pszKey, 0));
@@ -313,7 +313,7 @@ static INT_PTR CALLBACK DlgProc_CommonOpts(HWND hDlg, UINT uMsg, WPARAM wParam, flag |= IsDlgButtonChecked(hDlg, it.idNONE) ? 2 : 0;
flag |= IsDlgButtonChecked(hDlg, it.idALL) ? 4 : 0;
flag |= IsDlgButtonChecked(hDlg, it.idEXIMPORT) ? 8 : 0;
- db_set_b(NULL, MODNAME, it.pszKey, (BYTE)flag);
+ db_set_b(NULL, MODULENAME, it.pszKey, (BYTE)flag);
}
RebuildMenu();
@@ -347,7 +347,7 @@ static INT_PTR CALLBACK DlgProc_CommonOpts(HWND hDlg, UINT uMsg, WPARAM wParam, // misc
BYTE bEnabled = IsDlgButtonChecked(hDlg, CHECK_OPT_ZODIACAVATAR);
- db_set_b(NULL, MODNAME, SET_ZODIAC_AVATARS, bEnabled);
+ db_set_b(NULL, MODULENAME, SET_ZODIAC_AVATARS, bEnabled);
NServices::NAvatar::Enable(bEnabled);
}
break;
@@ -615,7 +615,7 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam bInitialized = 0;
// set reminder options
- BYTE bEnabled = db_get_b(NULL, MODNAME, SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED);
+ BYTE bEnabled = db_get_b(NULL, MODULENAME, SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED);
SendDlgItemMessage(hDlg, EDIT_REMIND_ENABLED, CB_SETCURSEL, bEnabled, NULL);
DlgProc_ReminderOpts(hDlg, WM_COMMAND, MAKEWPARAM(EDIT_REMIND_ENABLED, CBN_SELCHANGE),
(LPARAM)GetDlgItem(hDlg, EDIT_REMIND_ENABLED));
@@ -626,16 +626,16 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam DBGetCheckBtn(hDlg, CHECK_REMIND_STARTUP, SET_REMIND_CHECKON_STARTUP, FALSE);
DBGetCheckBtn(hDlg, CHECK_REMIND_SECURED, SET_REMIND_SECUREBIRTHDAY, FALSE);
- SetDlgItemInt(hDlg, EDIT_REMIND, db_get_w(NULL, MODNAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET), FALSE);
- SetDlgItemInt(hDlg, EDIT_REMIND_SOUNDOFFSET, db_get_b(NULL, MODNAME, SET_REMIND_SOUNDOFFSET, DEFVAL_REMIND_SOUNDOFFSET), FALSE);
- SetDlgItemInt(hDlg, EDIT_REMIND2, db_get_w(NULL, MODNAME, SET_REMIND_NOTIFYINTERVAL, DEFVAL_REMIND_NOTIFYINTERVAL), FALSE);
+ SetDlgItemInt(hDlg, EDIT_REMIND, db_get_w(NULL, MODULENAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET), FALSE);
+ SetDlgItemInt(hDlg, EDIT_REMIND_SOUNDOFFSET, db_get_b(NULL, MODULENAME, SET_REMIND_SOUNDOFFSET, DEFVAL_REMIND_SOUNDOFFSET), FALSE);
+ SetDlgItemInt(hDlg, EDIT_REMIND2, db_get_w(NULL, MODULENAME, SET_REMIND_NOTIFYINTERVAL, DEFVAL_REMIND_NOTIFYINTERVAL), FALSE);
- SendDlgItemMessage(hDlg, EDIT_BIRTHMODULE, CB_SETCURSEL, db_get_b(NULL, MODNAME, SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE), NULL);
+ SendDlgItemMessage(hDlg, EDIT_BIRTHMODULE, CB_SETCURSEL, db_get_b(NULL, MODULENAME, SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE), NULL);
MTime mtLast;
wchar_t szTime[MAX_PATH];
- mtLast.DBGetStamp(NULL, MODNAME, SET_REMIND_LASTCHECK);
+ mtLast.DBGetStamp(NULL, MODULENAME, SET_REMIND_LASTCHECK);
mtLast.UTCToLocal();
mtLast.TimeFormat(szTime, _countof(szTime));
@@ -661,7 +661,7 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam bReminderCheck = DBWriteEditWord(hDlg, EDIT_REMIND, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET);
// save primary birthday module
- BYTE bOld = db_get_b(NULL, MODNAME, SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE); // = 1
+ BYTE bOld = db_get_b(NULL, MODULENAME, SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE); // = 1
BYTE bNew = (BYTE)ComboBox_GetCurSel(GetDlgItem(hDlg, EDIT_BIRTHMODULE));
if (bOld != bNew) {
// keep the database clean
@@ -675,8 +675,8 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam // update current reminder state
BYTE bNewVal = (BYTE)SendDlgItemMessage(hDlg, EDIT_REMIND_ENABLED, CB_GETCURSEL, NULL, NULL);
- if (db_get_b(NULL, MODNAME, SET_REMIND_ENABLED, 1) != bNewVal) {
- db_set_b(NULL, MODNAME, SET_REMIND_ENABLED, bNewVal);
+ if (db_get_b(NULL, MODULENAME, SET_REMIND_ENABLED, 1) != bNewVal) {
+ db_set_b(NULL, MODULENAME, SET_REMIND_ENABLED, bNewVal);
if (bNewVal == REMIND_OFF) {
SvcReminderEnable(FALSE);
bReminderCheck = FALSE;
@@ -729,7 +729,7 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam if (bInitialized && HIWORD(wParam) == EN_UPDATE) {
BOOL t;
WORD v = (WORD)GetDlgItemInt(hDlg, LOWORD(wParam), &t, FALSE);
- if (t && (v != db_get_w(NULL, MODNAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET)))
+ if (t && (v != db_get_w(NULL, MODULENAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET)))
NotifyParentOfChange(hDlg);
}
break;
@@ -739,7 +739,7 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam if (bInitialized && HIWORD(wParam) == EN_UPDATE) {
BOOL t;
BYTE v = (BYTE)GetDlgItemInt(hDlg, LOWORD(wParam), &t, FALSE);
- if (t && (v != db_get_b(NULL, MODNAME, SET_REMIND_SOUNDOFFSET, DEFVAL_REMIND_SOUNDOFFSET)))
+ if (t && (v != db_get_b(NULL, MODULENAME, SET_REMIND_SOUNDOFFSET, DEFVAL_REMIND_SOUNDOFFSET)))
NotifyParentOfChange(hDlg);
}
break;
@@ -749,7 +749,7 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam if (bInitialized && HIWORD(wParam) == EN_UPDATE) {
BOOL t;
WORD v = (WORD)GetDlgItemInt(hDlg, LOWORD(wParam), &t, FALSE);
- if (t && (v != db_get_w(NULL, MODNAME, SET_REMIND_NOTIFYINTERVAL, DEFVAL_REMIND_NOTIFYINTERVAL)))
+ if (t && (v != db_get_w(NULL, MODULENAME, SET_REMIND_NOTIFYINTERVAL, DEFVAL_REMIND_NOTIFYINTERVAL)))
NotifyParentOfChange(hDlg);
}
}
@@ -792,7 +792,7 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR // set colortype checkboxes and color controls
DBGetColor(hDlg, CLR_BBACK, SET_POPUP_BIRTHDAY_COLOR_BACK, RGB(192, 180, 30));
DBGetColor(hDlg, CLR_BTEXT, SET_POPUP_BIRTHDAY_COLOR_TEXT, RGB(0, 0, 0));
- switch (db_get_b(NULL, MODNAME, SET_POPUP_BIRTHDAY_COLORTYPE, POPUP_COLOR_CUSTOM)) {
+ switch (db_get_b(NULL, MODULENAME, SET_POPUP_BIRTHDAY_COLORTYPE, POPUP_COLOR_CUSTOM)) {
case POPUP_COLOR_DEFAULT:
CheckDlgButton(hDlg, CHECK_OPT_POPUP_DEFCLR, BST_CHECKED);
break;
@@ -803,7 +803,7 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR DBGetColor(hDlg, CLR_ABACK, SET_POPUP_ANNIVERSARY_COLOR_BACK, RGB(90, 190, 130));
DBGetColor(hDlg, CLR_ATEXT, SET_POPUP_ANNIVERSARY_COLOR_TEXT, RGB(0, 0, 0));
- switch (db_get_b(NULL, MODNAME, SET_POPUP_ANNIVERSARY_COLORTYPE, POPUP_COLOR_CUSTOM)) {
+ switch (db_get_b(NULL, MODULENAME, SET_POPUP_ANNIVERSARY_COLORTYPE, POPUP_COLOR_CUSTOM)) {
case POPUP_COLOR_DEFAULT:
CheckDlgButton(hDlg, CHECK_OPT_POPUP_ADEFCLR, BST_CHECKED);
break;
@@ -816,7 +816,7 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR SendMessage(hDlg, WM_COMMAND, MAKEWPARAM(CHECK_OPT_POPUP_ADEFCLR, BN_CLICKED), NULL);
}
// set delay values
- bDelay = db_get_b(NULL, MODNAME, SET_POPUP_DELAY, 0);
+ bDelay = db_get_b(NULL, MODULENAME, SET_POPUP_DELAY, 0);
switch (bDelay) {
case 0:
CheckDlgButton(hDlg, RADIO_OPT_POPUP_DEFAULT, BST_CHECKED);
@@ -846,7 +846,7 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR // save popup style for birthdays
DBWriteColor(hDlg, CLR_BBACK, SET_POPUP_BIRTHDAY_COLOR_BACK);
DBWriteColor(hDlg, CLR_BTEXT, SET_POPUP_BIRTHDAY_COLOR_TEXT);
- db_set_b(NULL, MODNAME, SET_POPUP_BIRTHDAY_COLORTYPE,
+ db_set_b(NULL, MODULENAME, SET_POPUP_BIRTHDAY_COLORTYPE,
IsDlgButtonChecked(hDlg, CHECK_OPT_POPUP_DEFCLR)
? POPUP_COLOR_DEFAULT
: IsDlgButtonChecked(hDlg, CHECK_OPT_POPUP_WINCLR)
@@ -856,7 +856,7 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR // save popup style for anniversaries
DBWriteColor(hDlg, CLR_ABACK, SET_POPUP_ANNIVERSARY_COLOR_BACK);
DBWriteColor(hDlg, CLR_ATEXT, SET_POPUP_ANNIVERSARY_COLOR_TEXT);
- db_set_b(NULL, MODNAME, SET_POPUP_ANNIVERSARY_COLORTYPE,
+ db_set_b(NULL, MODULENAME, SET_POPUP_ANNIVERSARY_COLORTYPE,
IsDlgButtonChecked(hDlg, CHECK_OPT_POPUP_ADEFCLR)
? POPUP_COLOR_DEFAULT
: IsDlgButtonChecked(hDlg, CHECK_OPT_POPUP_AWINCLR)
@@ -865,14 +865,14 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR // save delay
if (IsDlgButtonChecked(hDlg, RADIO_OPT_POPUP_PERMANENT))
- db_set_b(NULL, MODNAME, SET_POPUP_DELAY, 255);
+ db_set_b(NULL, MODULENAME, SET_POPUP_DELAY, 255);
else if (IsDlgButtonChecked(hDlg, RADIO_OPT_POPUP_CUSTOM)) {
wchar_t szDelay[4];
GetDlgItemText(hDlg, EDIT_DELAY, szDelay, _countof(szDelay));
- db_set_b(NULL, MODNAME, SET_POPUP_DELAY, (BYTE)wcstol(szDelay, nullptr, 10));
+ db_set_b(NULL, MODULENAME, SET_POPUP_DELAY, (BYTE)wcstol(szDelay, nullptr, 10));
}
else
- db_unset(NULL, MODNAME, SET_POPUP_DELAY);
+ db_unset(NULL, MODULENAME, SET_POPUP_DELAY);
}
break;
@@ -881,7 +881,7 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR case BTN_PREVIEW:
{
POPUPDATAT ppd = { 0 };
- ppd.iSeconds = (int)db_get_b(NULL, MODNAME, SET_POPUP_DELAY, 0);
+ ppd.iSeconds = (int)db_get_b(NULL, MODULENAME, SET_POPUP_DELAY, 0);
mir_wstrncpy(ppd.lptzText, TranslateT("This is the reminder message"), MAX_SECONDLINE);
// Birthday
diff --git a/plugins/UserInfoEx/src/stdafx.h b/plugins/UserInfoEx/src/stdafx.h index ce7655e304..1b2fbe41cc 100644 --- a/plugins/UserInfoEx/src/stdafx.h +++ b/plugins/UserInfoEx/src/stdafx.h @@ -160,9 +160,7 @@ unsigned int hashSettingW_M2(const char * key); //new Murma2 hash struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODNAME)
- {}
+ CMPlugin();
};
typedef struct _MGLOBAL
diff --git a/plugins/UserInfoEx/src/svc_avatar.cpp b/plugins/UserInfoEx/src/svc_avatar.cpp index 6fab5abbbb..9884240d26 100644 --- a/plugins/UserInfoEx/src/svc_avatar.cpp +++ b/plugins/UserInfoEx/src/svc_avatar.cpp @@ -155,7 +155,7 @@ namespace NServices **/
void OnModulesLoaded()
{
- Enable(db_get_b(NULL, MODNAME, SET_ZODIAC_AVATARS, FALSE));
+ Enable(db_get_b(NULL, MODULENAME, SET_ZODIAC_AVATARS, FALSE));
}
} /* namespace NAvatar */
diff --git a/plugins/UserInfoEx/src/svc_constants.h b/plugins/UserInfoEx/src/svc_constants.h index 60dbc10f7f..77f7c1e264 100644 --- a/plugins/UserInfoEx/src/svc_constants.h +++ b/plugins/UserInfoEx/src/svc_constants.h @@ -22,8 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef _SVC_CONSTANTS_INCLUDED_
#define _SVC_CONSTANTS_INCLUDED_
-#define MODNAME "UserInfoEx"
-#define MODNAMET _T(MODNAME)
+#define MODULENAME "UserInfoEx"
+#define MODNAMET _T(MODULENAME)
#define USERINFO "UserInfo"
#define MODNAMEFLAGS "Flags"
#define MODULELONGNAME LPGEN("Extended user info")
diff --git a/plugins/UserInfoEx/src/svc_email.cpp b/plugins/UserInfoEx/src/svc_email.cpp index ba70f83a50..a99613dec8 100644 --- a/plugins/UserInfoEx/src/svc_email.cpp +++ b/plugins/UserInfoEx/src/svc_email.cpp @@ -177,7 +177,7 @@ void SvcEMailRebuildMenu() {
static HANDLE hPrebuildMenuHook = nullptr;
- if (db_get_b(NULL, MODNAME, SET_EXTENDED_EMAILSERVICE, TRUE)) {
+ if (db_get_b(NULL, MODULENAME, SET_EXTENDED_EMAILSERVICE, TRUE)) {
if (!hPrebuildMenuHook)
hPrebuildMenuHook = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, OnPreBuildMenu);
@@ -216,9 +216,9 @@ bool SvcEMailEnableExtraIcons(bool bEnable, bool bUpdateDB) if (bUpdateDB) {
bChanged = g_eiEmail != bEnable;
- db_set_b(NULL, MODNAME, SET_CLIST_EXTRAICON_EMAIL, g_eiEmail = bEnable);
+ db_set_b(NULL, MODULENAME, SET_CLIST_EXTRAICON_EMAIL, g_eiEmail = bEnable);
}
- else bChanged = g_eiEmail = db_get_b(NULL, MODNAME, SET_CLIST_EXTRAICON_EMAIL, DEFVAL_CLIST_EXTRAICON_EMAIL) != 0;
+ else bChanged = g_eiEmail = db_get_b(NULL, MODULENAME, SET_CLIST_EXTRAICON_EMAIL, DEFVAL_CLIST_EXTRAICON_EMAIL) != 0;
if (g_eiEmail) { // E-mail checked
// hook events
@@ -252,7 +252,7 @@ bool SvcEMailEnableExtraIcons(bool bEnable, bool bUpdateDB) void SvcEMailLoadModule()
{
SvcEMailEnableExtraIcons();
- if (db_get_b(NULL, MODNAME, SET_EXTENDED_EMAILSERVICE, TRUE)) {
+ if (db_get_b(NULL, MODULENAME, SET_EXTENDED_EMAILSERVICE, TRUE)) {
// create own email send command
DestroyServiceFunction(MS_EMAIL_SENDEMAIL);
CreateServiceFunction(MS_EMAIL_SENDEMAIL, MenuCommand);
diff --git a/plugins/UserInfoEx/src/svc_gender.cpp b/plugins/UserInfoEx/src/svc_gender.cpp index 122af6582b..b6827227eb 100644 --- a/plugins/UserInfoEx/src/svc_gender.cpp +++ b/plugins/UserInfoEx/src/svc_gender.cpp @@ -111,9 +111,9 @@ bool SvcGenderEnableExtraIcons(bool bEnable, bool bUpdateDB) if (bUpdateDB) {
bChanged = g_eiGender != bEnable;
- db_set_b(NULL, MODNAME, SET_CLIST_EXTRAICON_GENDER2, g_eiGender = bEnable);
+ db_set_b(NULL, MODULENAME, SET_CLIST_EXTRAICON_GENDER2, g_eiGender = bEnable);
}
- else bChanged = g_eiGender = db_get_b(NULL, MODNAME, SET_CLIST_EXTRAICON_GENDER2, 0) != 0;
+ else bChanged = g_eiGender = db_get_b(NULL, MODULENAME, SET_CLIST_EXTRAICON_GENDER2, 0) != 0;
if (g_eiGender) { // Gender checked or dropdown select
if (ghExtraIconSvc == INVALID_HANDLE_VALUE)
diff --git a/plugins/UserInfoEx/src/svc_homepage.cpp b/plugins/UserInfoEx/src/svc_homepage.cpp index 867d663c88..6361eafcd0 100644 --- a/plugins/UserInfoEx/src/svc_homepage.cpp +++ b/plugins/UserInfoEx/src/svc_homepage.cpp @@ -176,9 +176,9 @@ bool SvcHomepageEnableExtraIcons(bool bEnable, bool bUpdateDB) if (bUpdateDB) {
bChanged = g_eiHome != bEnable;
- db_set_b(NULL, MODNAME, SET_CLIST_EXTRAICON_HOMEPAGE, g_eiHome = bEnable);
+ db_set_b(NULL, MODULENAME, SET_CLIST_EXTRAICON_HOMEPAGE, g_eiHome = bEnable);
}
- else bChanged = g_eiHome = db_get_b(NULL, MODNAME, SET_CLIST_EXTRAICON_HOMEPAGE, DEFVAL_CLIST_EXTRAICON_HOMEPAGE) != 0;
+ else bChanged = g_eiHome = db_get_b(NULL, MODULENAME, SET_CLIST_EXTRAICON_HOMEPAGE, DEFVAL_CLIST_EXTRAICON_HOMEPAGE) != 0;
if (g_eiHome) {
// hook events
diff --git a/plugins/UserInfoEx/src/svc_phone.cpp b/plugins/UserInfoEx/src/svc_phone.cpp index daae9f022a..18e4cbb4e1 100644 --- a/plugins/UserInfoEx/src/svc_phone.cpp +++ b/plugins/UserInfoEx/src/svc_phone.cpp @@ -132,9 +132,9 @@ bool SvcPhoneEnableExtraIcons(bool bEnable, bool bUpdateDB) if (bUpdateDB) {
bChanged = g_eiPhone != bEnable;
- db_set_b(NULL, MODNAME, SET_CLIST_EXTRAICON_PHONE, g_eiPhone = bEnable);
+ db_set_b(NULL, MODULENAME, SET_CLIST_EXTRAICON_PHONE, g_eiPhone = bEnable);
}
- else bChanged = g_eiPhone = db_get_b(NULL, MODNAME, SET_CLIST_EXTRAICON_PHONE, DEFVAL_CLIST_EXTRAICON_PHONE) != 0;
+ else bChanged = g_eiPhone = db_get_b(NULL, MODULENAME, SET_CLIST_EXTRAICON_PHONE, DEFVAL_CLIST_EXTRAICON_PHONE) != 0;
// force module enabled, if extraicon plugin was found
if (g_eiPhone) {
diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp index 986e2bfa52..9295e6de7a 100644 --- a/plugins/UserInfoEx/src/svc_refreshci.cpp +++ b/plugins/UserInfoEx/src/svc_refreshci.cpp @@ -241,7 +241,7 @@ class CDlgUpdProgress : public CUpdProgress { ICO_BTN_DOWNARROW, BM_SETIMAGE, IDSKIP },
{ ICO_BTN_CANCEL, BM_SETIMAGE, IDCANCEL }
};
- IcoLib_SetCtrlIcons(hWnd, idIcon, db_get_b(NULL, MODNAME, SET_ICONS_BUTTONS, 1) ? 2 : 1);
+ IcoLib_SetCtrlIcons(hWnd, idIcon, db_get_b(NULL, MODULENAME, SET_ICONS_BUTTONS, 1) ? 2 : 1);
SendDlgItemMessage(hWnd, IDCANCEL, BUTTONTRANSLATE, NULL, NULL);
SendDlgItemMessage(hWnd, IDSKIP, BUTTONTRANSLATE, NULL, NULL);
@@ -397,7 +397,7 @@ public: _popupButtons[0].lchIcon = IcoLib_GetIcon(ICO_BTN_DOWNARROW);
_popupButtons[0].wParam = MAKEWORD(IDSKIP, BN_CLICKED);
_popupButtons[0].lParam = NULL;
- mir_strcpy(_popupButtons[0].lpzTitle, MODNAME"/Hide");
+ mir_strcpy(_popupButtons[0].lpzTitle, MODULENAME"/Hide");
// cancel button
_popupButtons[1].cbSize = sizeof(POPUPACTION);
@@ -405,7 +405,7 @@ public: _popupButtons[1].lchIcon = IcoLib_GetIcon(ICO_BTN_CANCEL);
_popupButtons[1].wParam = MAKEWORD(IDCANCEL, BN_CLICKED);
_popupButtons[1].lParam = NULL;
- mir_strcpy(_popupButtons[1].lpzTitle, MODNAME"/Cancel");
+ mir_strcpy(_popupButtons[1].lpzTitle, MODULENAME"/Cancel");
}
/**
@@ -690,7 +690,7 @@ public: if (Size() && !_pProgress)
{
- if (ServiceExists(MS_POPUP_CHANGETEXTT) && db_get_b(NULL, MODNAME, "PopupProgress", FALSE))
+ if (ServiceExists(MS_POPUP_CHANGETEXTT) && db_get_b(NULL, MODULENAME, "PopupProgress", FALSE))
{
_pProgress = new CPopupUpdProgress(this);
}
@@ -864,7 +864,7 @@ void SvcRefreshContactInfoLoadModule(void) HOTKEYDESC hk = {};
hk.pszName = "RefreshContactDetails";
- hk.szSection.a = MODNAME;
+ hk.szSection.a = MODULENAME;
hk.szDescription.a = LPGEN("Refresh contact details");
hk.pszService = MS_USERINFO_REFRESH;
Hotkey_Register(&hk);
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index 2ea030b83e..1558a72854 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -148,7 +148,7 @@ static HICON GetAnnivIcon(const CEvent &evt) if (evt._wDaysLeft > 9)
hIcon = IcoLib_GetIcon(ICO_RMD_DTBX);
else {
- mir_snprintf(szIcon, MODNAME"_rmd_dtb%u", evt._wDaysLeft);
+ mir_snprintf(szIcon, MODULENAME"_rmd_dtb%u", evt._wDaysLeft);
hIcon = IcoLib_GetIcon(szIcon);
}
break;
@@ -157,7 +157,7 @@ static HICON GetAnnivIcon(const CEvent &evt) if (evt._wDaysLeft > 9)
hIcon = IcoLib_GetIcon(ICO_RMD_DTAX);
else {
- mir_snprintf(szIcon, MODNAME"_rmd_dta%u", evt._wDaysLeft);
+ mir_snprintf(szIcon, MODULENAME"_rmd_dta%u", evt._wDaysLeft);
hIcon = IcoLib_GetIcon(szIcon);
}
}
@@ -183,7 +183,7 @@ static void NotifyWithExtraIcon(MCONTACT hContact, const CEvent &evt) if (evt._wDaysLeft > 9)
icoName = ICO_RMD_DTAX;
else {
- mir_snprintf(szIcon, MODNAME"_rmd_dtb%u", evt._wDaysLeft);
+ mir_snprintf(szIcon, MODULENAME"_rmd_dtb%u", evt._wDaysLeft);
icoName = szIcon;
}
break;
@@ -192,7 +192,7 @@ static void NotifyWithExtraIcon(MCONTACT hContact, const CEvent &evt) if (evt._wDaysLeft > 9)
icoName = ICO_RMD_DTAX;
else {
- mir_snprintf(szIcon, MODNAME"_rmd_dta%u", evt._wDaysLeft);
+ mir_snprintf(szIcon, MODULENAME"_rmd_dta%u", evt._wDaysLeft);
icoName = szIcon;
}
break;
@@ -251,7 +251,7 @@ static int NotifyWithPopup(MCONTACT hContact, CEvent::EType eventType, int DaysT POPUPDATAT ppd = { 0 };
ppd.PluginWindowProc = PopupWindowProc;
- ppd.iSeconds = (int)db_get_b(NULL, MODNAME, SET_POPUP_DELAY, 0);
+ ppd.iSeconds = (int)db_get_b(NULL, MODULENAME, SET_POPUP_DELAY, 0);
if (hContact) {
ppd.lchContact = hContact;
@@ -265,29 +265,29 @@ static int NotifyWithPopup(MCONTACT hContact, CEvent::EType eventType, int DaysT switch (eventType) {
case CEvent::BIRTHDAY:
- switch (db_get_b(NULL, MODNAME, SET_POPUP_BIRTHDAY_COLORTYPE, POPUP_COLOR_CUSTOM)) {
+ switch (db_get_b(NULL, MODULENAME, SET_POPUP_BIRTHDAY_COLORTYPE, POPUP_COLOR_CUSTOM)) {
case POPUP_COLOR_WINDOWS:
ppd.colorBack = GetSysColor(COLOR_BTNFACE);
ppd.colorText = GetSysColor(COLOR_WINDOWTEXT);
break;
case POPUP_COLOR_CUSTOM:
- ppd.colorBack = db_get_dw(NULL, MODNAME, SET_POPUP_BIRTHDAY_COLOR_BACK, RGB(192, 180, 30));
- ppd.colorText = db_get_dw(NULL, MODNAME, SET_POPUP_BIRTHDAY_COLOR_TEXT, 0);
+ ppd.colorBack = db_get_dw(NULL, MODULENAME, SET_POPUP_BIRTHDAY_COLOR_BACK, RGB(192, 180, 30));
+ ppd.colorText = db_get_dw(NULL, MODULENAME, SET_POPUP_BIRTHDAY_COLOR_TEXT, 0);
break;
}
break;
case CEvent::ANNIVERSARY:
- switch (db_get_b(NULL, MODNAME, SET_POPUP_ANNIVERSARY_COLORTYPE, POPUP_COLOR_CUSTOM)) {
+ switch (db_get_b(NULL, MODULENAME, SET_POPUP_ANNIVERSARY_COLORTYPE, POPUP_COLOR_CUSTOM)) {
case POPUP_COLOR_WINDOWS:
ppd.colorBack = GetSysColor(COLOR_BTNFACE);
ppd.colorText = GetSysColor(COLOR_WINDOWTEXT);
break;
case POPUP_COLOR_CUSTOM:
- ppd.colorBack = db_get_dw(NULL, MODNAME, SET_POPUP_ANNIVERSARY_COLOR_BACK, RGB(90, 190, 130));
- ppd.colorText = db_get_dw(NULL, MODNAME, SET_POPUP_ANNIVERSARY_COLOR_TEXT, 0);
+ ppd.colorBack = db_get_dw(NULL, MODULENAME, SET_POPUP_ANNIVERSARY_COLOR_BACK, RGB(90, 190, 130));
+ ppd.colorText = db_get_dw(NULL, MODULENAME, SET_POPUP_ANNIVERSARY_COLOR_TEXT, 0);
break;
}
}
@@ -349,7 +349,7 @@ static void NotifyFlashCListIcon(MCONTACT hContact, const CEvent &evt) static BYTE NotifyWithSound(const CEvent &evt)
{
- if (evt._wDaysLeft <= min(db_get_b(NULL, MODNAME, SET_REMIND_SOUNDOFFSET, DEFVAL_REMIND_SOUNDOFFSET), gRemindOpts.wDaysEarlier)) {
+ if (evt._wDaysLeft <= min(db_get_b(NULL, MODULENAME, SET_REMIND_SOUNDOFFSET, DEFVAL_REMIND_SOUNDOFFSET), gRemindOpts.wDaysEarlier)) {
switch (evt._eType) {
case CEvent::BIRTHDAY:
Skin_PlaySound(evt._wDaysLeft == 0 ? SOUND_BIRTHDAY_TODAY : SOUND_BIRTHDAY_SOON);
@@ -460,7 +460,7 @@ static bool CheckBirthday(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNoti mtb.DBGetReminderOpts(hContact);
// make backup of each protocol based birthday
- if (db_get_b(NULL, MODNAME, SET_REMIND_SECUREBIRTHDAY, TRUE))
+ if (db_get_b(NULL, MODULENAME, SET_REMIND_SECUREBIRTHDAY, TRUE))
mtb.BackupBirthday(hContact, nullptr, 0, LastAnwer);
if (mtb.RemindOption() != BST_UNCHECKED) {
@@ -572,7 +572,7 @@ void SvcReminderCheckAll(const ENotify notify) NotifyWithSound(evt);
// popup anniversary list
- if (db_get_b(NULL, MODNAME, SET_ANNIVLIST_POPUP, FALSE))
+ if (db_get_b(NULL, MODULENAME, SET_ANNIVLIST_POPUP, FALSE))
DlgAnniversaryListShow(0, 0);
if (evt._wDaysLeft > gRemindOpts.wDaysEarlier && notify == NOTIFY_NOANNIV)
@@ -755,7 +755,7 @@ static INT_PTR BackupBirthdayService(WPARAM hContact, LPARAM lParam) LPCSTR SvcReminderGetMyBirthdayModule()
{
- return ((db_get_b(NULL, MODNAME, SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE) == 1) ? USERINFO : MOD_MBIRTHDAY);
+ return ((db_get_b(NULL, MODULENAME, SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE) == 1) ? USERINFO : MOD_MBIRTHDAY);
}
/***********************************************************************************************************
@@ -809,23 +809,23 @@ static void CALLBACK TimerProc_Check(HWND, UINT, UINT_PTR, DWORD) static void UpdateTimer(BYTE bStartup)
{
- LONG wNotifyInterval = 60 * 60 * (LONG)db_get_w(NULL, MODNAME, SET_REMIND_NOTIFYINTERVAL, DEFVAL_REMIND_NOTIFYINTERVAL);
+ LONG wNotifyInterval = 60 * 60 * (LONG)db_get_w(NULL, MODULENAME, SET_REMIND_NOTIFYINTERVAL, DEFVAL_REMIND_NOTIFYINTERVAL);
MTime now, last;
now.GetTimeUTC();
if (bStartup) {
- last.DBGetStamp(NULL, MODNAME, SET_REMIND_LASTCHECK);
+ last.DBGetStamp(NULL, MODULENAME, SET_REMIND_LASTCHECK);
// if last check occured at least one day before just do it on startup again
- if (now.Year() > last.Year() || now.Month() > last.Month() || now.Day() > last.Day() || db_get_b(NULL, MODNAME, SET_REMIND_CHECKON_STARTUP, FALSE))
+ if (now.Year() > last.Year() || now.Month() > last.Month() || now.Day() > last.Day() || db_get_b(NULL, MODULENAME, SET_REMIND_CHECKON_STARTUP, FALSE))
wNotifyInterval = 5;
else
wNotifyInterval -= now.Compare(last);
ghRemindDateChangeTimer = SetTimer(nullptr, 0, 1000 * 60 * 5, (TIMERPROC)TimerProc_DateChanged);
}
- else now.DBWriteStamp(NULL, MODNAME, SET_REMIND_LASTCHECK);
+ else now.DBWriteStamp(NULL, MODULENAME, SET_REMIND_LASTCHECK);
// wait at least 5 seconds before checking at startup, to give miranda a better chance to load faster
KillTimer(nullptr, ghRemindTimer);
@@ -847,12 +847,12 @@ void SvcReminderEnable(BYTE bEnable) ghSettingsChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
// reinit reminder options
- gRemindOpts.RemindState = db_get_b(NULL, MODNAME, SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED);
- gRemindOpts.wDaysEarlier = db_get_w(NULL, MODNAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET);
- gRemindOpts.bCListExtraIcon = db_get_b(NULL, MODNAME, SET_REMIND_EXTRAICON, 1);
- gRemindOpts.bCheckVisibleOnly = db_get_b(NULL, MODNAME, SET_REMIND_CHECKVISIBLE, DEFVAL_REMIND_CHECKVISIBLE);
- gRemindOpts.bFlashCList = db_get_b(NULL, MODNAME, SET_REMIND_FLASHICON, FALSE);
- gRemindOpts.bPopups = ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, MODNAME, SET_POPUP_ENABLED, DEFVAL_POPUP_ENABLED);
+ gRemindOpts.RemindState = db_get_b(NULL, MODULENAME, SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED);
+ gRemindOpts.wDaysEarlier = db_get_w(NULL, MODULENAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET);
+ gRemindOpts.bCListExtraIcon = db_get_b(NULL, MODULENAME, SET_REMIND_EXTRAICON, 1);
+ gRemindOpts.bCheckVisibleOnly = db_get_b(NULL, MODULENAME, SET_REMIND_CHECKVISIBLE, DEFVAL_REMIND_CHECKVISIBLE);
+ gRemindOpts.bFlashCList = db_get_b(NULL, MODULENAME, SET_REMIND_FLASHICON, FALSE);
+ gRemindOpts.bPopups = ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, MODULENAME, SET_POPUP_ENABLED, DEFVAL_POPUP_ENABLED);
// init the timer
UpdateTimer(TRUE);
@@ -879,7 +879,7 @@ void SvcReminderOnModulesLoaded(void) // init clist extra icon structure
OnCListRebuildIcons(0, 0);
- SvcReminderEnable(db_get_b(NULL, MODNAME, SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED) != REMIND_OFF);
+ SvcReminderEnable(db_get_b(NULL, MODULENAME, SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED) != REMIND_OFF);
}
/**
@@ -904,12 +904,12 @@ void SvcReminderLoadModule(void) // register hotkey
HOTKEYDESC hk = {};
hk.pszName = "ReminderCheck";
- hk.szSection.a = MODNAME;
+ hk.szSection.a = MODULENAME;
hk.szDescription.a = LPGEN("Check anniversaries");
hk.pszService = MS_USERINFO_REMINDER_CHECK;
Hotkey_Register(&hk);
- if (db_get_b(NULL, MODNAME, SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED) != REMIND_OFF && ExtraIcon == INVALID_HANDLE_VALUE)
+ if (db_get_b(NULL, MODULENAME, SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED) != REMIND_OFF && ExtraIcon == INVALID_HANDLE_VALUE)
ExtraIcon = ExtraIcon_RegisterIcolib("Reminder", LPGEN("Reminder (UInfoEx)"), ICO_COMMON_ANNIVERSARY);
}
diff --git a/plugins/Variables/src/main.cpp b/plugins/Variables/src/main.cpp index 5865d390f8..f5656f08f1 100644 --- a/plugins/Variables/src/main.cpp +++ b/plugins/Variables/src/main.cpp @@ -39,6 +39,10 @@ PLUGININFOEX pluginInfoEx = { 0x59b0036e, 0x5403, 0x422e, {0x88, 0x3b, 0xc9, 0xaa, 0xf4, 0x25, 0x68, 0x2b }}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
diff --git a/plugins/Variables/src/stdafx.h b/plugins/Variables/src/stdafx.h index 8e6de81b06..d4514659a7 100644 --- a/plugins/Variables/src/stdafx.h +++ b/plugins/Variables/src/stdafx.h @@ -72,9 +72,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {}
+ CMPlugin();
};
#define SETTING_STARTUPTEXT "StartupText"
diff --git a/plugins/Watrack_MPD/src/init.cpp b/plugins/Watrack_MPD/src/init.cpp index 7de20e5228..cf690bb4d7 100755 --- a/plugins/Watrack_MPD/src/init.cpp +++ b/plugins/Watrack_MPD/src/init.cpp @@ -26,7 +26,7 @@ HNETLIBUSER ghNetlibUser; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -40,9 +40,13 @@ PLUGININFOEX pluginInfo = { 0x692e87d0, 0x6c71, 0x4cdc, {0x9e, 0x36, 0x2b, 0x2d, 0x69, 0xfb, 0xdc, 0x4c }}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -55,9 +59,9 @@ static int OnModulesLoaded(WPARAM, LPARAM) nlu.szSettingsModule = __PLUGIN_NAME;
ghNetlibUser = Netlib_RegisterUser(&nlu);
- gbPort = db_get_w(NULL, szModuleName, "Port", 6600);
- gbHost = UniGetContactSettingUtf(NULL, szModuleName, "Server", L"127.0.0.1");
- gbPassword = UniGetContactSettingUtf(NULL, szModuleName, "Password", L"");
+ gbPort = db_get_w(NULL, MODULENAME, "Port", 6600);
+ gbHost = UniGetContactSettingUtf(NULL, MODULENAME, "Server", L"127.0.0.1");
+ gbPassword = UniGetContactSettingUtf(NULL, MODULENAME, "Password", L"");
if (ServiceExists(MS_WAT_PLAYER))
bWatrackService = TRUE;
@@ -68,7 +72,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) extern "C" __declspec(dllexport) int Load()
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
HookEvent(ME_OPT_INITIALISE, WaMpdOptInit);
diff --git a/plugins/Watrack_MPD/src/options.cpp b/plugins/Watrack_MPD/src/options.cpp index 1a65da6ba9..a726ef26d2 100755 --- a/plugins/Watrack_MPD/src/options.cpp +++ b/plugins/Watrack_MPD/src/options.cpp @@ -24,21 +24,21 @@ public: {} virtual void OnInitDialog() override { - edit_PORT.SetInt(db_get_w(NULL, szModuleName, "Port", 6600)); - wchar_t *tmp = UniGetContactSettingUtf(NULL, szModuleName, "Server", L"127.0.0.1"); + edit_PORT.SetInt(db_get_w(NULL, MODULENAME, "Port", 6600)); + wchar_t *tmp = UniGetContactSettingUtf(NULL, MODULENAME, "Server", L"127.0.0.1"); edit_SERVER.SetText(tmp); mir_free(tmp); - tmp = UniGetContactSettingUtf(NULL, szModuleName, "Password", L""); + tmp = UniGetContactSettingUtf(NULL, MODULENAME, "Password", L""); edit_PASSWORD.SetText(tmp); mir_free(tmp); } virtual void OnApply() override { - db_set_w(NULL, szModuleName, "Port", (WORD)edit_PORT.GetInt()); + db_set_w(NULL, MODULENAME, "Port", (WORD)edit_PORT.GetInt()); gbPort = edit_PORT.GetInt(); - db_set_ws(NULL, szModuleName, "Server", edit_SERVER.GetText()); + db_set_ws(NULL, MODULENAME, "Server", edit_SERVER.GetText()); mir_wstrcpy(gbHost, edit_SERVER.GetText()); - db_set_ws(NULL, szModuleName, "Password", edit_PASSWORD.GetText()); + db_set_ws(NULL, MODULENAME, "Password", edit_PASSWORD.GetText()); mir_wstrcpy(gbPassword, edit_PASSWORD.GetText()); } private: diff --git a/plugins/Watrack_MPD/src/stdafx.h b/plugins/Watrack_MPD/src/stdafx.h index 161ccb2209..7342704828 100755 --- a/plugins/Watrack_MPD/src/stdafx.h +++ b/plugins/Watrack_MPD/src/stdafx.h @@ -32,13 +32,11 @@ #include "utilities.h"
#include "version.h"
-#define szModuleName "Watrack_MPD"
+#define MODULENAME "Watrack_MPD"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(szModuleName)
- {}
+ CMPlugin();
};
extern HNETLIBUSER ghNetlibUser;
diff --git a/plugins/Weather/src/stdafx.h b/plugins/Weather/src/stdafx.h index 9d0c550575..c197c848cf 100644 --- a/plugins/Weather/src/stdafx.h +++ b/plugins/Weather/src/stdafx.h @@ -521,12 +521,6 @@ void ReleaseIconEx(HICON hIcon); struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(WEATHERPROTONAME)
- {
- opt.NoProtoCondition = db_get_b(NULL, WEATHERPROTONAME, "NoStatus", true);
- RegisterProtocol((opt.NoProtoCondition) ? PROTOTYPE_VIRTUAL : PROTOTYPE_PROTOCOL);
- SetUniqueId("ID");
- }
+ CMPlugin();
};
diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp index 4e8637c590..d7957beeaf 100644 --- a/plugins/Weather/src/weather.cpp +++ b/plugins/Weather/src/weather.cpp @@ -39,13 +39,15 @@ HANDLE hHookWeatherError; MWindowList hDataWindowList, hWindowList;
HANDLE hUpdateMutex;
-CLIST_INTERFACE *pcli;
unsigned status;
unsigned old_status;
UINT_PTR timerId;
+
+CMPlugin g_plugin;
int &hLangpack(g_plugin.m_hLang);
+CLIST_INTERFACE *pcli;
MYOPTIONS opt;
@@ -58,10 +60,6 @@ BOOL ModuleLoaded; HANDLE hTBButton = nullptr;
/////////////////////////////////////////////////////////////////////////////////////////
-
-CMPlugin g_plugin;
-
-/////////////////////////////////////////////////////////////////////////////////////////
// plugin info
static const PLUGININFOEX pluginInfoEx =
@@ -78,6 +76,14 @@ static const PLUGININFOEX pluginInfoEx = {0x6b612a34, 0xdcf2, 0x4e32, {0x85, 0xcf, 0xb6, 0xfd, 0x0, 0x6b, 0x74, 0x5e}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(WEATHERPROTONAME, pluginInfoEx)
+{
+ opt.NoProtoCondition = db_get_b(NULL, WEATHERPROTONAME, "NoStatus", true);
+ RegisterProtocol((opt.NoProtoCondition) ? PROTOTYPE_VIRTUAL : PROTOTYPE_PROTOCOL);
+ SetUniqueId("ID");
+}
+
extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
diff --git a/plugins/WebView/src/main.cpp b/plugins/WebView/src/main.cpp index eaaeee3d07..b392550ed2 100644 --- a/plugins/WebView/src/main.cpp +++ b/plugins/WebView/src/main.cpp @@ -34,8 +34,7 @@ static HMODULE hRichEd = nullptr; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfoEx =
-{
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -48,6 +47,13 @@ PLUGININFOEX pluginInfoEx = {0xcd5427fb, 0x5320, 0x4f65, {0xb4, 0xbf, 0x86, 0xb7, 0xcf, 0x7b, 0x50, 0x87}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{
+ RegisterProtocol(PROTOTYPE_PROTOCOL);
+ SetUniqueId("PreserveName");
+}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
diff --git a/plugins/WebView/src/webview.h b/plugins/WebView/src/webview.h index ee7d9ce62c..fce570cdb1 100644 --- a/plugins/WebView/src/webview.h +++ b/plugins/WebView/src/webview.h @@ -246,10 +246,5 @@ extern HANDLE hHookAlertOSD; struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {
- RegisterProtocol(PROTOTYPE_PROTOCOL);
- SetUniqueId("PreserveName");
- }
+ CMPlugin();
};
diff --git a/plugins/WhenWasIt/src/WhenWasIt.cpp b/plugins/WhenWasIt/src/WhenWasIt.cpp index eaccb2a2c5..54539d3a54 100644 --- a/plugins/WhenWasIt/src/WhenWasIt.cpp +++ b/plugins/WhenWasIt/src/WhenWasIt.cpp @@ -31,7 +31,7 @@ CommonData commonData = { 0 }; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo = {
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -44,9 +44,13 @@ PLUGININFOEX pluginInfo = { { 0x2ff96c84, 0xb0b5, 0x470e, { 0xbb, 0xf9, 0x90, 0x7b, 0x9f, 0x3f, 0x5d, 0x2f } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -55,7 +59,7 @@ extern "C" int __declspec(dllexport) Load(void) {
Log("%s", "Entering function " __FUNCTION__);
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
INITCOMMONCONTROLSEX icex;
icex.dwSize = sizeof(icex);
diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp index 3f7f6d7ba4..e6916d60d9 100644 --- a/plugins/WhenWasIt/src/dlg_handlers.cpp +++ b/plugins/WhenWasIt/src/dlg_handlers.cpp @@ -347,35 +347,35 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara commonData.cDlgTimeout = wcstol(buffer, &stop, 10);
if (*stop) { commonData.cDlgTimeout = POPUP_TIMEOUT; }
- db_set_b(NULL, ModuleName, "IgnoreSubcontacts", commonData.bIgnoreSubcontacts);
- db_set_b(NULL, ModuleName, "UsePopups", commonData.bUsePopups);
- db_set_b(NULL, ModuleName, "UseDialog", commonData.bUseDialog);
- db_set_w(NULL, ModuleName, "CheckInterval", commonData.checkInterval);
- db_set_w(NULL, ModuleName, "DaysInAdvance", commonData.daysInAdvance);
- db_set_w(NULL, ModuleName, "DaysAfter", commonData.daysAfter);
- db_set_w(NULL, ModuleName, "PopupTimeout", commonData.popupTimeout);
- db_set_w(NULL, ModuleName, "PopupTimeoutToday", commonData.popupTimeoutToday);
+ db_set_b(NULL, MODULENAME, "IgnoreSubcontacts", commonData.bIgnoreSubcontacts);
+ db_set_b(NULL, MODULENAME, "UsePopups", commonData.bUsePopups);
+ db_set_b(NULL, MODULENAME, "UseDialog", commonData.bUseDialog);
+ db_set_w(NULL, MODULENAME, "CheckInterval", commonData.checkInterval);
+ db_set_w(NULL, MODULENAME, "DaysInAdvance", commonData.daysInAdvance);
+ db_set_w(NULL, MODULENAME, "DaysAfter", commonData.daysAfter);
+ db_set_w(NULL, MODULENAME, "PopupTimeout", commonData.popupTimeout);
+ db_set_w(NULL, MODULENAME, "PopupTimeoutToday", commonData.popupTimeoutToday);
- db_set_b(NULL, ModuleName, "ShowCurrentAge", commonData.cShowAgeMode);
- db_set_b(NULL, ModuleName, "NoBirthdaysPopup", commonData.bNoBirthdaysPopup);
+ db_set_b(NULL, MODULENAME, "ShowCurrentAge", commonData.cShowAgeMode);
+ db_set_b(NULL, MODULENAME, "NoBirthdaysPopup", commonData.bNoBirthdaysPopup);
- db_set_b(NULL, ModuleName, "OpenInBackground", commonData.bOpenInBackground);
+ db_set_b(NULL, MODULENAME, "OpenInBackground", commonData.bOpenInBackground);
- db_set_b(NULL, ModuleName, "SoundNearDays", commonData.cSoundNearDays);
+ db_set_b(NULL, MODULENAME, "SoundNearDays", commonData.cSoundNearDays);
- db_set_b(NULL, ModuleName, "DefaultModule", commonData.cDefaultModule);
+ db_set_b(NULL, MODULENAME, "DefaultModule", commonData.cDefaultModule);
- db_set_b(NULL, ModuleName, "PopupLeftClick", commonData.lPopupClick);
- db_set_b(NULL, ModuleName, "PopupRightClick", commonData.rPopupClick);
+ db_set_b(NULL, MODULENAME, "PopupLeftClick", commonData.lPopupClick);
+ db_set_b(NULL, MODULENAME, "PopupRightClick", commonData.rPopupClick);
- db_set_dw(NULL, ModuleName, "Foreground", commonData.foreground);
- db_set_dw(NULL, ModuleName, "Background", commonData.background);
+ db_set_dw(NULL, MODULENAME, "Foreground", commonData.foreground);
+ db_set_dw(NULL, MODULENAME, "Background", commonData.background);
- db_set_b(NULL, ModuleName, "OncePerDay", commonData.bOncePerDay);
+ db_set_b(NULL, MODULENAME, "OncePerDay", commonData.bOncePerDay);
- db_set_w(NULL, ModuleName, "DlgTimeout", commonData.cDlgTimeout);
+ db_set_w(NULL, MODULENAME, "DlgTimeout", commonData.cDlgTimeout);
- db_set_b(NULL, ModuleName, "NotifyFor", commonData.notifyFor);
+ db_set_b(NULL, MODULENAME, "NotifyFor", commonData.notifyFor);
RefreshAllContactListIcons();
@@ -401,7 +401,7 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l hContact = lParam;
WindowList_Add(hAddBirthdayWndsList, hWnd, hContact);
- Utils_RestoreWindowPositionNoSize(hWnd, hContact, ModuleName, "BirthdayWnd");
+ Utils_RestoreWindowPositionNoSize(hWnd, hContact, MODULENAME, "BirthdayWnd");
Window_SetIcon_IcoLib(hWnd, hAddBirthdayContact);
@@ -474,7 +474,7 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l case WM_DESTROY:
RefreshContactListIcons(hContact); //the birthday might be changed, refresh icon.
Window_FreeIcon_IcoLib(hWnd);
- Utils_SaveWindowPosition(hWnd, hContact, ModuleName, "BirthdayWnd");
+ Utils_SaveWindowPosition(hWnd, hContact, MODULENAME, "BirthdayWnd");
WindowList_Remove(hAddBirthdayWndsList, hWnd);
break;
@@ -746,14 +746,14 @@ INT_PTR CALLBACK DlgProcBirthdays(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa ListView_InsertColumn(hList, 5, &col);
LoadBirthdays(hWnd, 0);
- int column = db_get_b(NULL, ModuleName, "SortColumn", 0);
+ int column = db_get_b(NULL, MODULENAME, "SortColumn", 0);
BirthdaysSortParams params = {};
params.hList = GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST);
params.column = column;
ListView_SortItemsEx(params.hList, BirthdaysCompare, (LPARAM)¶ms);
- Utils_RestoreWindowPosition(hWnd, NULL, ModuleName, "BirthdayList");
+ Utils_RestoreWindowPosition(hWnd, NULL, MODULENAME, "BirthdayList");
}
return TRUE;
@@ -818,7 +818,7 @@ INT_PTR CALLBACK DlgProcBirthdays(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa case LVN_COLUMNCLICK:
LPNMLISTVIEW lv = (LPNMLISTVIEW)lParam;
int column = lv->iSubItem;
- db_set_b(NULL, ModuleName, "SortColumn", column);
+ db_set_b(NULL, MODULENAME, "SortColumn", column);
BirthdaysSortParams params = {};
params.hList = GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST);
params.column = column;
@@ -831,7 +831,7 @@ INT_PTR CALLBACK DlgProcBirthdays(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa case WM_DESTROY:
hBirthdaysDlg = nullptr;
- Utils_SaveWindowPosition(hWnd, NULL, ModuleName, "BirthdayList");
+ Utils_SaveWindowPosition(hWnd, NULL, MODULENAME, "BirthdayList");
Window_FreeIcon_IcoLib(hWnd);
lastColumn = -1;
break;
@@ -872,7 +872,7 @@ INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar if (timeout > 0)
SetTimer(hWnd, UPCOMING_TIMER_ID, 1000, nullptr);
- Utils_RestoreWindowPosition(hWnd, NULL, ModuleName, "BirthdayListUpcoming");
+ Utils_RestoreWindowPosition(hWnd, NULL, MODULENAME, "BirthdayListUpcoming");
}
return TRUE;
@@ -959,7 +959,7 @@ INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar case WM_DESTROY:
hUpcomingDlg = nullptr;
- Utils_SaveWindowPosition(hWnd, NULL, ModuleName, "BirthdayListUpcoming");
+ Utils_SaveWindowPosition(hWnd, NULL, MODULENAME, "BirthdayListUpcoming");
Window_FreeIcon_IcoLib(hWnd);
KillTimer(hWnd, UPCOMING_TIMER_ID);
break;
diff --git a/plugins/WhenWasIt/src/hooked_events.cpp b/plugins/WhenWasIt/src/hooked_events.cpp index 7aa2881a96..ad79aab976 100644 --- a/plugins/WhenWasIt/src/hooked_events.cpp +++ b/plugins/WhenWasIt/src/hooked_events.cpp @@ -142,7 +142,7 @@ int RefreshContactListIcons(MCONTACT hContact) int UpdateTimers()
{
- UINT interval = db_get_dw(NULL, ModuleName, "Interval", CHECK_INTERVAL);
+ UINT interval = db_get_dw(NULL, MODULENAME, "Interval", CHECK_INTERVAL);
interval *= (1000 * 60 * 60); //go from miliseconds to hours
hCheckTimer = SetTimer(nullptr, 0, interval, OnCheckTimer);
if (!hDateChangeTimer)
diff --git a/plugins/WhenWasIt/src/notifiers.h b/plugins/WhenWasIt/src/notifiers.h index 815dc79b6d..3f22598539 100644 --- a/plugins/WhenWasIt/src/notifiers.h +++ b/plugins/WhenWasIt/src/notifiers.h @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define BIRTHDAY_NEAR_DEFAULT_DAYS 3
-#define DUMMY_MODULE ModuleName
+#define DUMMY_MODULE MODULENAME
#define DUMMY_SETTING "refreshIconsDummyVal"
struct TUpcomingBirthday{
diff --git a/plugins/WhenWasIt/src/services.cpp b/plugins/WhenWasIt/src/services.cpp index 1790c0c8f6..38319dc597 100644 --- a/plugins/WhenWasIt/src/services.cpp +++ b/plugins/WhenWasIt/src/services.cpp @@ -29,26 +29,26 @@ int InitServices() {
Log("%s", "Entering function " __FUNCTION__);
- commonData.foreground = db_get_dw(NULL, ModuleName, "Foreground", FOREGROUND_COLOR);
- commonData.background = db_get_dw(NULL, ModuleName, "Background", BACKGROUND_COLOR);
- commonData.checkInterval = db_get_w(NULL, ModuleName, "CheckInterval", CHECK_INTERVAL);
- commonData.daysInAdvance = db_get_w(NULL, ModuleName, "DaysInAdvance", DAYS_TO_NOTIFY);
- commonData.daysAfter = db_get_w(NULL, ModuleName, "DaysAfter", DAYS_TO_NOTIFY_AFTER);
- commonData.popupTimeout = db_get_w(NULL, ModuleName, "PopupTimeout", POPUP_TIMEOUT);
- commonData.popupTimeoutToday = db_get_w(NULL, ModuleName, "PopupTimeoutToday", commonData.popupTimeout);
- commonData.bUsePopups = db_get_b(NULL, ModuleName, "UsePopups", TRUE);
- commonData.bUseDialog = db_get_b(NULL, ModuleName, "UseDialog", TRUE);
- commonData.bIgnoreSubcontacts = db_get_b(NULL, ModuleName, "IgnoreSubcontacts", FALSE);
- commonData.cShowAgeMode = db_get_b(NULL, ModuleName, "ShowCurrentAge", FALSE);
- commonData.bNoBirthdaysPopup = db_get_b(NULL, ModuleName, "NoBirthdaysPopup", FALSE);
- commonData.bOpenInBackground = db_get_b(NULL, ModuleName, "OpenInBackground", FALSE);
- commonData.cSoundNearDays = db_get_b(NULL, ModuleName, "SoundNearDays", BIRTHDAY_NEAR_DEFAULT_DAYS);
- commonData.cDefaultModule = db_get_b(NULL, ModuleName, "DefaultModule", 0);
- commonData.lPopupClick = db_get_b(NULL, ModuleName, "PopupLeftClick", 2);
- commonData.rPopupClick = db_get_b(NULL, ModuleName, "PopupRightClick", 1);
- commonData.bOncePerDay = db_get_b(NULL, ModuleName, "OncePerDay", 0);
- commonData.cDlgTimeout = db_get_w(NULL, ModuleName, "DlgTimeout", POPUP_TIMEOUT);
- commonData.notifyFor = db_get_b(NULL, ModuleName, "NotifyFor", 0);
+ commonData.foreground = db_get_dw(NULL, MODULENAME, "Foreground", FOREGROUND_COLOR);
+ commonData.background = db_get_dw(NULL, MODULENAME, "Background", BACKGROUND_COLOR);
+ commonData.checkInterval = db_get_w(NULL, MODULENAME, "CheckInterval", CHECK_INTERVAL);
+ commonData.daysInAdvance = db_get_w(NULL, MODULENAME, "DaysInAdvance", DAYS_TO_NOTIFY);
+ commonData.daysAfter = db_get_w(NULL, MODULENAME, "DaysAfter", DAYS_TO_NOTIFY_AFTER);
+ commonData.popupTimeout = db_get_w(NULL, MODULENAME, "PopupTimeout", POPUP_TIMEOUT);
+ commonData.popupTimeoutToday = db_get_w(NULL, MODULENAME, "PopupTimeoutToday", commonData.popupTimeout);
+ commonData.bUsePopups = db_get_b(NULL, MODULENAME, "UsePopups", TRUE);
+ commonData.bUseDialog = db_get_b(NULL, MODULENAME, "UseDialog", TRUE);
+ commonData.bIgnoreSubcontacts = db_get_b(NULL, MODULENAME, "IgnoreSubcontacts", FALSE);
+ commonData.cShowAgeMode = db_get_b(NULL, MODULENAME, "ShowCurrentAge", FALSE);
+ commonData.bNoBirthdaysPopup = db_get_b(NULL, MODULENAME, "NoBirthdaysPopup", FALSE);
+ commonData.bOpenInBackground = db_get_b(NULL, MODULENAME, "OpenInBackground", FALSE);
+ commonData.cSoundNearDays = db_get_b(NULL, MODULENAME, "SoundNearDays", BIRTHDAY_NEAR_DEFAULT_DAYS);
+ commonData.cDefaultModule = db_get_b(NULL, MODULENAME, "DefaultModule", 0);
+ commonData.lPopupClick = db_get_b(NULL, MODULENAME, "PopupLeftClick", 2);
+ commonData.rPopupClick = db_get_b(NULL, MODULENAME, "PopupRightClick", 1);
+ commonData.bOncePerDay = db_get_b(NULL, MODULENAME, "OncePerDay", 0);
+ commonData.cDlgTimeout = db_get_w(NULL, MODULENAME, "DlgTimeout", POPUP_TIMEOUT);
+ commonData.notifyFor = db_get_b(NULL, MODULENAME, "NotifyFor", 0);
CreateServiceFunction(MS_WWI_CHECK_BIRTHDAYS, CheckBirthdaysService);
CreateServiceFunction(MS_WWI_LIST_SHOW, ShowListService);
@@ -104,7 +104,7 @@ INT_PTR CheckBirthdaysService(WPARAM, LPARAM lParam) SYSTEMTIME today;
GetLocalTime(&today);
- DWORD lastChecked = db_get_dw(NULL, ModuleName, "LastChecked", 0); //get last checked date
+ DWORD lastChecked = db_get_dw(NULL, MODULENAME, "LastChecked", 0); //get last checked date
int lcDay = LOBYTE(LOWORD(lastChecked));
int lcMonth = HIBYTE(LOWORD(lastChecked));
int lcYear = HIWORD(lastChecked);
@@ -131,7 +131,7 @@ INT_PTR CheckBirthdaysService(WPARAM, LPARAM lParam) commonData.daysAfter = savedDaysAfter; //restore previous value
if (lParam) //if not forced - i.e. timer check
- db_set_dw(NULL, ModuleName, "LastChecked", MAKELONG(MAKEWORD(today.wDay, today.wMonth), today.wYear)); //write the value in DB so we don't check again today
+ db_set_dw(NULL, MODULENAME, "LastChecked", MAKELONG(MAKEWORD(today.wDay, today.wMonth), today.wYear)); //write the value in DB so we don't check again today
return 0;
}
@@ -170,7 +170,7 @@ void __cdecl RefreshUserDetailsWorkerThread(void*) Thread_SetName("WhenWasIt: RefreshUserDetailsWorkerThread");
ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Starting to refresh user details"), hRefreshUserDetails);
- int delay = db_get_w(NULL, ModuleName, "UpdateDelay", REFRESH_DETAILS_DELAY);
+ int delay = db_get_w(NULL, MODULENAME, "UpdateDelay", REFRESH_DETAILS_DELAY);
MCONTACT hContact = db_find_first();
while (hContact != NULL) {
diff --git a/plugins/WhenWasIt/src/stdafx.h b/plugins/WhenWasIt/src/stdafx.h index f9bdc75670..25dbf33929 100644 --- a/plugins/WhenWasIt/src/stdafx.h +++ b/plugins/WhenWasIt/src/stdafx.h @@ -61,13 +61,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "dlg_handlers.h"
#include "events.h"
-#define ModuleName "WhenWasIt"
+#define MODULENAME "WhenWasIt"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(ModuleName)
- {}
+ CMPlugin();
};
extern HWND hBirthdaysDlg;
diff --git a/plugins/WhenWasIt/src/utils.cpp b/plugins/WhenWasIt/src/utils.cpp index 9d3c338627..2b058289c4 100644 --- a/plugins/WhenWasIt/src/utils.cpp +++ b/plugins/WhenWasIt/src/utils.cpp @@ -135,7 +135,7 @@ int GetStringFromDatabase(MCONTACT hContact, char *szModule, char *szSettingName int GetStringFromDatabase(char *szSettingName, char *szError, char *szResult, size_t size)
{
- return GetStringFromDatabase(NULL, ModuleName, szSettingName, szError, szResult, size);
+ return GetStringFromDatabase(NULL, MODULENAME, szSettingName, szError, szResult, size);
}
wchar_t* GetContactID(MCONTACT hContact)
diff --git a/plugins/WhoUsesMyFiles/src/stdafx.h b/plugins/WhoUsesMyFiles/src/stdafx.h index 782f6938ab..ac78ddc54c 100644 --- a/plugins/WhoUsesMyFiles/src/stdafx.h +++ b/plugins/WhoUsesMyFiles/src/stdafx.h @@ -115,9 +115,7 @@ BOOL del_marked(PWumf* l); struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {}
+ CMPlugin();
};
extern WUMF_OPTIONS WumfOptions;
diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp index f9984007e5..33abd2a516 100644 --- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp +++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp @@ -9,7 +9,7 @@ int &hLangpack(g_plugin.m_hLang); /////////////////////////////////////////////////////////////////////////////////////////
-static PLUGININFOEX pluginInfo =
+static PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -23,9 +23,13 @@ static PLUGININFOEX pluginInfo = {0x80dca515, 0x973a, 0x4a7e, {0x8b, 0x85, 0x5d, 0x8e, 0xc8, 0x8f, 0xc5, 0xa7}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -220,7 +224,7 @@ int InitTopToolbar(WPARAM, LPARAM) extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
LoadOptions();
diff --git a/plugins/WinterSpeak/src/main.cpp b/plugins/WinterSpeak/src/main.cpp index 76164aea13..717fbb5a50 100644 --- a/plugins/WinterSpeak/src/main.cpp +++ b/plugins/WinterSpeak/src/main.cpp @@ -10,7 +10,7 @@ HANDLE g_event_status_change; HANDLE g_event_message_added;
HANDLE g_protocol_ack;
-PLUGININFOEX pluginInfo={
+PLUGININFOEX pluginInfoEx={
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -23,9 +23,13 @@ PLUGININFOEX pluginInfo={ { 0x81e189dc, 0xc251, 0x45f6, { 0x9e, 0xdf, 0xa0, 0xf3, 0xa0, 0x5c, 0x42, 0x48 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>("speak_config", pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
//-----------------------------------------------------------------------------
@@ -103,7 +107,7 @@ int dialogOptionsInitialise(WPARAM wParam, LPARAM) extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
if (!g_speak_config)
{
diff --git a/plugins/WinterSpeak/src/stdafx.h b/plugins/WinterSpeak/src/stdafx.h index 44c88cbd35..8899be7c6e 100644 --- a/plugins/WinterSpeak/src/stdafx.h +++ b/plugins/WinterSpeak/src/stdafx.h @@ -48,7 +48,5 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>("speak_config")
- {}
+ CMPlugin();
};
diff --git a/plugins/XSoundNotify/src/dialog.cpp b/plugins/XSoundNotify/src/dialog.cpp index 96d623ccbb..32754d42c2 100644 --- a/plugins/XSoundNotify/src/dialog.cpp +++ b/plugins/XSoundNotify/src/dialog.cpp @@ -21,7 +21,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP hContact = lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
WindowList_Add(hChangeSoundDlgList, hwndDlg, hContact);
- Utils_RestoreWindowPositionNoSize(hwndDlg, hContact, SETTINGSNAME, "ChangeSoundDlg");
+ Utils_RestoreWindowPositionNoSize(hwndDlg, hContact, MODULENAME, "ChangeSoundDlg");
char* szProto = GetContactProto(hContact);
PROTOACCOUNT *pa = Proto_GetAccount(szProto);
const char* szUniqueId = Proto_GetUniqueId(pa->szModuleName);
@@ -52,7 +52,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP }
EnableWindow(GetDlgItem(hwndDlg, IDC_CONT_BUTTON_CHOOSE_SOUND), TRUE);
DBVARIANT dbv = { 0 };
- if (!db_get_ws(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
+ if (!db_get_ws(hContact, MODULENAME, SETTINGSKEY, &dbv)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_CONT_BUTTON_TEST_PLAY), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CONT_BUTTON_RESET_SOUND), TRUE);
SetDlgItemText(hwndDlg, IDC_CONT_LABEL_SOUND, PathFindFileName(dbv.ptszVal));
@@ -64,10 +64,10 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP SetDlgItemText(hwndDlg, IDC_CONT_LABEL_SOUND, TranslateT("Not set"));
}
EnableWindow(GetDlgItem(hwndDlg, IDC_CONT_IGNORE_SOUND), TRUE);
- CheckDlgButton(hwndDlg, IDC_CONT_IGNORE_SOUND, db_get_b(hContact, SETTINGSNAME, SETTINGSIGNOREKEY, 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CONT_IGNORE_SOUND, db_get_b(hContact, MODULENAME, SETTINGSIGNOREKEY, 0) ? BST_CHECKED : BST_UNCHECKED);
p = XSN_Users.find((XSN_Data *)&hContact);
if (p == nullptr) {
- ptrW name(db_get_wsa(hContact, SETTINGSNAME, SETTINGSKEY));
+ ptrW name(db_get_wsa(hContact, MODULENAME, SETTINGSKEY));
if (name != NULL)
XSN_Users.insert(new XSN_Data(hContact, name, IsDlgButtonChecked(hwndDlg, IDC_CONT_IGNORE_SOUND) ? 1 : 0, 1));
}
@@ -82,9 +82,9 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP if (mir_wstrcmpi(p->path, L"")) {
wchar_t shortpath[MAX_PATH];
PathToRelativeW(p->path, shortpath);
- db_set_ws(hContact, SETTINGSNAME, SETTINGSKEY, shortpath);
+ db_set_ws(hContact, MODULENAME, SETTINGSKEY, shortpath);
}
- db_set_b(hContact, SETTINGSNAME, SETTINGSIGNOREKEY, p->ignore);
+ db_set_b(hContact, MODULENAME, SETTINGSIGNOREKEY, p->ignore);
}
case IDCANCEL:
@@ -134,7 +134,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP isIgnoreSound = 0;
if (p == nullptr) {
DBVARIANT dbv;
- if (!db_get_ws(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
+ if (!db_get_ws(hContact, MODULENAME, SETTINGSKEY, &dbv)) {
wchar_t longpath[MAX_PATH] = { 0 };
PathToAbsoluteW(dbv.ptszVal, longpath);
Skin_PlaySoundFile(longpath);
@@ -159,15 +159,15 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP XSN_Users.remove(p);
delete p;
}
- db_unset(hContact, SETTINGSNAME, SETTINGSKEY);
- db_unset(hContact, SETTINGSNAME, SETTINGSIGNOREKEY);
+ db_unset(hContact, MODULENAME, SETTINGSKEY);
+ db_unset(hContact, MODULENAME, SETTINGSIGNOREKEY);
break;
case IDC_CONT_IGNORE_SOUND:
p = XSN_Users.find((XSN_Data *)&hContact);
if (p == nullptr) {
DBVARIANT dbv;
- if (!db_get_ws(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
+ if (!db_get_ws(hContact, MODULENAME, SETTINGSKEY, &dbv)) {
wchar_t longpath[MAX_PATH];
PathToAbsoluteW(dbv.ptszVal, longpath);
XSN_Users.insert(new XSN_Data(hContact, longpath, IsDlgButtonChecked(hwndDlg, IDC_CONT_IGNORE_SOUND) ? 1 : 0, 1));
@@ -184,7 +184,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP break;
case WM_DESTROY:
- Utils_SaveWindowPosition(hwndDlg, hContact, SETTINGSNAME, "ChangeSoundDlg");
+ Utils_SaveWindowPosition(hwndDlg, hContact, MODULENAME, "ChangeSoundDlg");
WindowList_Remove(hChangeSoundDlgList, hwndDlg);
}
return FALSE;
diff --git a/plugins/XSoundNotify/src/options.cpp b/plugins/XSoundNotify/src/options.cpp index 61d9505381..f696ec49e6 100644 --- a/plugins/XSoundNotify/src/options.cpp +++ b/plugins/XSoundNotify/src/options.cpp @@ -97,7 +97,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l if (!cursel) {
PROTOACCOUNT *pa = (PROTOACCOUNT *)SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_PROTO, CB_GETITEMDATA, cursel, 0);
DBVARIANT dbv = { 0 };
- if (!db_get_ws(NULL, SETTINGSNAME, pa->szModuleName, &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, pa->szModuleName, &dbv)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_OPT_BUTTON_TEST_PLAY), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_OPT_BUTTON_RESET_SOUND), TRUE);
SetDlgItemText(hwndDlg, IDC_OPT_LABEL_SOUND, PathFindFileName(dbv.ptszVal));
@@ -111,13 +111,13 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l size_t value_max_len = mir_strlen(pa->szModuleName) + 8;
char *value = (char *)mir_alloc(sizeof(char) * value_max_len);
mir_snprintf(value, value_max_len, "%s_ignore", pa->szModuleName);
- CheckDlgButton(hwndDlg, IDC_OPT_IGNORE_SOUND, db_get_b(NULL, SETTINGSNAME, value, 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_OPT_IGNORE_SOUND, db_get_b(NULL, MODULENAME, value, 0) ? BST_CHECKED : BST_UNCHECKED);
mir_free(value);
}
else {
MCONTACT hContact = (MCONTACT)SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_GETITEMDATA, cursel, 0);
DBVARIANT dbv = { 0 };
- if (!db_get_ws(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
+ if (!db_get_ws(hContact, MODULENAME, SETTINGSKEY, &dbv)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_OPT_BUTTON_TEST_PLAY), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_OPT_BUTTON_RESET_SOUND), TRUE);
SetDlgItemText(hwndDlg, IDC_OPT_LABEL_SOUND, PathFindFileName(dbv.ptszVal));
@@ -128,7 +128,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l EnableWindow(GetDlgItem(hwndDlg, IDC_OPT_BUTTON_RESET_SOUND), FALSE);
SetDlgItemText(hwndDlg, IDC_OPT_LABEL_SOUND, TranslateT("Not set"));
}
- CheckDlgButton(hwndDlg, IDC_OPT_IGNORE_SOUND, db_get_b(hContact, SETTINGSNAME, SETTINGSIGNOREKEY, 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_OPT_IGNORE_SOUND, db_get_b(hContact, MODULENAME, SETTINGSIGNOREKEY, 0) ? BST_CHECKED : BST_UNCHECKED);
}
}
return 0;
@@ -200,7 +200,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l isIgnoreSound = 0;
if (p == nullptr) {
DBVARIANT dbv;
- if (!db_get_ws(NULL, SETTINGSNAME, pa->szModuleName, &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, pa->szModuleName, &dbv)) {
wchar_t longpath[MAX_PATH];
PathToAbsoluteW(dbv.ptszVal, longpath);
Skin_PlaySoundFile(longpath);
@@ -219,7 +219,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l isIgnoreSound = 0;
if (p == nullptr) {
DBVARIANT dbv;
- if (!db_get_ws(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
+ if (!db_get_ws(hContact, MODULENAME, SETTINGSKEY, &dbv)) {
wchar_t longpath[MAX_PATH];
PathToAbsoluteW(dbv.ptszVal, longpath);
Skin_PlaySoundFile(longpath);
@@ -250,11 +250,11 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l delete p;
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
- db_unset(NULL, SETTINGSNAME, pa->szModuleName);
+ db_unset(NULL, MODULENAME, pa->szModuleName);
size_t value_max_len = mir_strlen(pa->szModuleName) + 8;
char *value = (char *)mir_alloc(sizeof(char) * value_max_len);
mir_snprintf(value, value_max_len, "%s_ignore", pa->szModuleName);
- db_unset(NULL, SETTINGSNAME, value);
+ db_unset(NULL, MODULENAME, value);
mir_free(value);
}
else {
@@ -265,8 +265,8 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l delete p;
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
- db_unset(hContact, SETTINGSNAME, SETTINGSKEY);
- db_unset(hContact, SETTINGSNAME, SETTINGSIGNOREKEY);
+ db_unset(hContact, MODULENAME, SETTINGSKEY);
+ db_unset(hContact, MODULENAME, SETTINGSIGNOREKEY);
}
}
return 0;
@@ -279,7 +279,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l XSN_Data *p = XSN_Users.find((XSN_Data *)&pa->szModuleName);
if (p == nullptr) {
DBVARIANT dbv;
- if (!db_get_ws(NULL, SETTINGSNAME, pa->szModuleName, &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, pa->szModuleName, &dbv)) {
wchar_t longpath[MAX_PATH];
PathToAbsoluteW(dbv.ptszVal, longpath);
XSN_Users.insert(new XSN_Data((LPARAM)pa->szModuleName, longpath, IsDlgButtonChecked(hwndDlg, IDC_OPT_IGNORE_SOUND) ? 1 : 0, 0));
@@ -295,7 +295,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l XSN_Data *p = XSN_Users.find((XSN_Data *)&hContact);
if (p == nullptr) {
DBVARIANT dbv;
- if (!db_get_ws(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
+ if (!db_get_ws(hContact, MODULENAME, SETTINGSKEY, &dbv)) {
wchar_t longpath[MAX_PATH];
PathToAbsoluteW(dbv.ptszVal, longpath);
XSN_Users.insert(new XSN_Data(hContact, longpath, IsDlgButtonChecked(hwndDlg, IDC_OPT_IGNORE_SOUND) ? 1 : 0, 1));
@@ -320,17 +320,17 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l wchar_t shortpath[MAX_PATH];
PathToRelativeW(it->path, shortpath);
if (it->iscontact)
- db_set_ws(it->hContact, SETTINGSNAME, SETTINGSKEY, shortpath);
+ db_set_ws(it->hContact, MODULENAME, SETTINGSKEY, shortpath);
else
- db_set_ws(NULL, SETTINGSNAME, (LPCSTR)it->hContact, shortpath);
+ db_set_ws(NULL, MODULENAME, (LPCSTR)it->hContact, shortpath);
}
if (it->iscontact)
- db_set_b(it->hContact, SETTINGSNAME, SETTINGSIGNOREKEY, it->ignore);
+ db_set_b(it->hContact, MODULENAME, SETTINGSIGNOREKEY, it->ignore);
else {
size_t value_max_len = mir_strlen((const char*)it->hContact) + 8;
char *value = (char *)mir_alloc(sizeof(char) * value_max_len);
mir_snprintf(value, value_max_len, "%s_ignore", (const char*)it->hContact);
- db_set_b(NULL, SETTINGSNAME, value, it->ignore);
+ db_set_b(NULL, MODULENAME, value, it->ignore);
mir_free(value);
}
}
diff --git a/plugins/XSoundNotify/src/stdafx.h b/plugins/XSoundNotify/src/stdafx.h index 8e147d857d..70c1a6b9d6 100644 --- a/plugins/XSoundNotify/src/stdafx.h +++ b/plugins/XSoundNotify/src/stdafx.h @@ -18,15 +18,13 @@ #include "resource.h"
#include "version.h"
-#define SETTINGSNAME "XSoundNotify"
+#define MODULENAME "XSoundNotify"
#define SETTINGSKEY "XSNPlugin_sound"
#define SETTINGSIGNOREKEY "XSNPlugin_ignore"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(SETTINGSNAME)
- {}
+ CMPlugin();
};
struct XSN_Data
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index 7e7166f6d6..866ddfcb22 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -20,7 +20,7 @@ BYTE isIgnoreSound = 0, isOwnSound = 0, isIgnoreAccSound = 0, isAccSound = 0; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -34,9 +34,13 @@ PLUGININFOEX pluginInfo = { 0xa01e25f7, 0xa6ef, 0x4b40,{ 0x8c, 0xac, 0x75, 0x5a, 0x2f, 0x2e, 0x55, 0xb5 }}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -107,9 +111,9 @@ static int ProcessEvent(WPARAM hContact, LPARAM lParam) if (!isReceiveMessage(lParam))
return 0;
- isIgnoreSound = db_get_b(hContact, SETTINGSNAME, SETTINGSIGNOREKEY, 0);
+ isIgnoreSound = db_get_b(hContact, MODULENAME, SETTINGSIGNOREKEY, 0);
DBVARIANT dbv;
- if (!isIgnoreSound && !db_get_ws(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
+ if (!isIgnoreSound && !db_get_ws(hContact, MODULENAME, SETTINGSKEY, &dbv)) {
wchar_t PlaySoundPath[MAX_PATH] = { 0 };
PathToAbsoluteW(dbv.ptszVal, PlaySoundPath);
isOwnSound = 0;
@@ -124,9 +128,9 @@ static int ProcessEvent(WPARAM hContact, LPARAM lParam) size_t value_max_len = mir_strlen(pa->szModuleName) + 8;
char *value = (char *)mir_alloc(sizeof(char) * value_max_len);
mir_snprintf(value, value_max_len, "%s_ignore", pa->szModuleName);
- isIgnoreAccSound = db_get_b(NULL, SETTINGSNAME, value, 0);
+ isIgnoreAccSound = db_get_b(NULL, MODULENAME, value, 0);
mir_free(value);
- if (!isIgnoreAccSound && !db_get_ws(NULL, SETTINGSNAME, pa->szModuleName, &dbv)) {
+ if (!isIgnoreAccSound && !db_get_ws(NULL, MODULENAME, pa->szModuleName, &dbv)) {
wchar_t PlaySoundPath[MAX_PATH] = { 0 };
PathToAbsoluteW(dbv.ptszVal, PlaySoundPath);
isAccSound = 0;
@@ -152,9 +156,9 @@ static int ProcessChatEvent(WPARAM, LPARAM lParam) if (nick == NULL || gce->ptszText == nullptr)
return 0;
if (wcsstr(gce->ptszText, nick)) {
- isIgnoreSound = db_get_b(hContact, SETTINGSNAME, SETTINGSIGNOREKEY, 0);
+ isIgnoreSound = db_get_b(hContact, MODULENAME, SETTINGSIGNOREKEY, 0);
DBVARIANT dbv;
- if (!isIgnoreSound && !db_get_ws(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
+ if (!isIgnoreSound && !db_get_ws(hContact, MODULENAME, SETTINGSKEY, &dbv)) {
wchar_t PlaySoundPath[MAX_PATH] = { 0 };
PathToAbsoluteW(dbv.ptszVal, PlaySoundPath);
isOwnSound = 0;
@@ -168,9 +172,9 @@ static int ProcessChatEvent(WPARAM, LPARAM lParam) size_t value_max_len = mir_strlen(pa->szModuleName) + 8;
char *value = (char *)mir_alloc(sizeof(char) * value_max_len);
mir_snprintf(value, value_max_len, "%s_ignore", pa->szModuleName);
- isIgnoreAccSound = db_get_b(NULL, SETTINGSNAME, value, 0);
+ isIgnoreAccSound = db_get_b(NULL, MODULENAME, value, 0);
mir_free(value);
- if (!isIgnoreAccSound && !db_get_ws(NULL, SETTINGSNAME, pa->szModuleName, &dbv)) {
+ if (!isIgnoreAccSound && !db_get_ws(NULL, MODULENAME, pa->szModuleName, &dbv)) {
wchar_t PlaySoundPath[MAX_PATH] = { 0 };
PathToAbsoluteW(dbv.ptszVal, PlaySoundPath);
isAccSound = 0;
@@ -236,7 +240,7 @@ static int OnPreShutdown(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load()
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pci = Chat_GetInterface();
CreateServiceFunction("XSoundNotify/ContactMenuCommand", ShowDialog);
diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp index db71aa8e05..4638b59d42 100644 --- a/plugins/YAMN/src/main.cpp +++ b/plugins/YAMN/src/main.cpp @@ -29,6 +29,7 @@ static int iDllPlugins = 0; YAMN_VARIABLES YAMNVar; +CMPlugin g_plugin; CLIST_INTERFACE *pcli; int &hLangpack(g_plugin.m_hLang); @@ -69,15 +70,11 @@ static void GetProfileDirectory(wchar_t *szPath, int cbPath) ///////////////////////////////////////////////////////////////////////////////////////// -CMPlugin g_plugin; - -///////////////////////////////////////////////////////////////////////////////////////// - extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST }; ///////////////////////////////////////////////////////////////////////////////////////// -PLUGININFOEX pluginInfo = { +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), @@ -90,9 +87,16 @@ PLUGININFOEX pluginInfo = { {0xb047a7e5, 0x27a, 0x4cfc, {0x8b, 0x18, 0xed, 0xa8, 0x34, 0x5d, 0x27, 0x90}} }; +CMPlugin::CMPlugin() : + PLUGIN<CMPlugin>(YAMN_DBMODULE, pluginInfoEx) +{ + RegisterProtocol(PROTOTYPE_VIRTUAL); + SetUniqueId("Id"); +} + extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { - return &pluginInfo; + return &pluginInfoEx; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -237,7 +241,7 @@ static void LoadPlugins() extern "C" int __declspec(dllexport) Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); pcli = Clist_GetInterface(); YAMN_STATUS = ID_STATUS_OFFLINE; diff --git a/plugins/YAMN/src/stdafx.h b/plugins/YAMN/src/stdafx.h index b5612aa639..485e8bdf76 100644 --- a/plugins/YAMN/src/stdafx.h +++ b/plugins/YAMN/src/stdafx.h @@ -44,12 +44,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(YAMN_DBMODULE)
- {
- RegisterProtocol(PROTOTYPE_VIRTUAL);
- SetUniqueId("Id");
- }
+ CMPlugin();
};
// From services.cpp
diff --git a/plugins/YAPP/src/icons.h b/plugins/YAPP/src/icons.h index ac90ab308b..8c1c87189a 100644 --- a/plugins/YAPP/src/icons.h +++ b/plugins/YAPP/src/icons.h @@ -3,13 +3,13 @@ //ICONS
#define SECT_TOLBAR "Toolbar"
-#define SECT_POPUP MODULE
+#define SECT_POPUP MODULENAME
#define ICO_TB_POPUP_ON "TBButton_popup_ToogleUp"
#define ICO_TB_POPUP_OFF "TBButton_popup_ToogleDOWN"
-#define ICO_POPUP_ON MODULE"_enabled"
-#define ICO_POPUP_OFF MODULE"_disabled"
-#define ICO_HISTORY MODULE"_history"
+#define ICO_POPUP_ON MODULENAME"_enabled"
+#define ICO_POPUP_OFF MODULENAME"_disabled"
+#define ICO_HISTORY MODULENAME"_history"
void InitIcons();
diff --git a/plugins/YAPP/src/options.cpp b/plugins/YAPP/src/options.cpp index c02a3a17e5..95ed5a651b 100644 --- a/plugins/YAPP/src/options.cpp +++ b/plugins/YAPP/src/options.cpp @@ -6,79 +6,79 @@ HICON hPopupIcon = nullptr; void LoadModuleDependentOptions() {
if (ServiceExists(MS_AV_DRAWAVATAR))
- options.av_layout = (PopupAvLayout)db_get_b(0, MODULE, "AVLayout", PAV_RIGHT);
+ options.av_layout = (PopupAvLayout)db_get_b(0, MODULENAME, "AVLayout", PAV_RIGHT);
else
options.av_layout = PAV_NONE;
- options.time_layout = (PopupTimeLayout)db_get_b(0, MODULE, "TimeLayout", (ServiceExists(MS_AV_DRAWAVATAR) ? PT_WITHAV : PT_RIGHT));
+ options.time_layout = (PopupTimeLayout)db_get_b(0, MODULENAME, "TimeLayout", (ServiceExists(MS_AV_DRAWAVATAR) ? PT_WITHAV : PT_RIGHT));
if (options.time_layout == PT_WITHAV && !ServiceExists(MS_AV_DRAWAVATAR))
options.time_layout = PT_RIGHT;
}
void LoadOptions()
{
- options.default_timeout = db_get_dw(0, MODULE, "DefaultTimeout", 7);
- options.win_width = db_get_dw(0, MODULE, "WinWidth", 220);
- options.win_max_height = db_get_dw(0, MODULE, "WinMaxHeight", 400);
- options.location = (PopupLocation)db_get_b(0, MODULE, "Location", (BYTE)PL_BOTTOMRIGHT);
- options.opacity = db_get_b(0, MODULE, "Opacity", 75);
- options.border = db_get_b(0, MODULE, "Border", 1) == 1;
- options.round = db_get_b(0, MODULE, "RoundCorners", 1) == 1;
- options.av_round = db_get_b(0, MODULE, "AvatarRoundCorners", 1) == 1;
- options.animate = db_get_b(0, MODULE, "Animate", 0);
- options.trans_bg = db_get_b(0, MODULE, "TransparentBg", 0) == 1;
- options.use_mim_monitor = db_get_b(0, MODULE, "UseMimMonitor", 1) == 1;
- options.right_icon = db_get_b(0, MODULE, "RightIcon", 0) == 1;
+ options.default_timeout = db_get_dw(0, MODULENAME, "DefaultTimeout", 7);
+ options.win_width = db_get_dw(0, MODULENAME, "WinWidth", 220);
+ options.win_max_height = db_get_dw(0, MODULENAME, "WinMaxHeight", 400);
+ options.location = (PopupLocation)db_get_b(0, MODULENAME, "Location", (BYTE)PL_BOTTOMRIGHT);
+ options.opacity = db_get_b(0, MODULENAME, "Opacity", 75);
+ options.border = db_get_b(0, MODULENAME, "Border", 1) == 1;
+ options.round = db_get_b(0, MODULENAME, "RoundCorners", 1) == 1;
+ options.av_round = db_get_b(0, MODULENAME, "AvatarRoundCorners", 1) == 1;
+ options.animate = db_get_b(0, MODULENAME, "Animate", 0);
+ options.trans_bg = db_get_b(0, MODULENAME, "TransparentBg", 0) == 1;
+ options.use_mim_monitor = db_get_b(0, MODULENAME, "UseMimMonitor", 1) == 1;
+ options.right_icon = db_get_b(0, MODULENAME, "RightIcon", 0) == 1;
options.av_layout = PAV_NONE; // corrected in LoadModuleDependentOptions function above
- options.av_size = db_get_dw(0, MODULE, "AVSize", 40); //tweety
- options.text_indent = db_get_dw(0, MODULE, "TextIndent", 22);
- options.global_hover = db_get_b(0, MODULE, "GlobalHover", 1) == 1;
- options.time_layout = (PopupTimeLayout)db_get_b(0, MODULE, "TimeLayout", PT_RIGHT);
+ options.av_size = db_get_dw(0, MODULENAME, "AVSize", 40); //tweety
+ options.text_indent = db_get_dw(0, MODULENAME, "TextIndent", 22);
+ options.global_hover = db_get_b(0, MODULENAME, "GlobalHover", 1) == 1;
+ options.time_layout = (PopupTimeLayout)db_get_b(0, MODULENAME, "TimeLayout", PT_RIGHT);
char buff[128];
for (int i = 0; i < 10; i++) {
mir_snprintf(buff, "DisableStatus%d", i - 1); // -1 because i forgot offline status earlier!
- options.disable_status[i] = (db_get_b(0, MODULE, buff, 0) == 1);
+ options.disable_status[i] = (db_get_b(0, MODULENAME, buff, 0) == 1);
}
- options.disable_full_screen = db_get_b(0, MODULE, "DisableFullScreen", 1) == 1;
- options.drop_shadow = db_get_b(0, MODULE, "DropShadow", 0) == 1;
- options.sb_width = db_get_dw(0, MODULE, "SidebarWidth", 22);
- options.padding = db_get_dw(0, MODULE, "Padding", 4);
- options.av_padding = db_get_dw(0, MODULE, "AvatarPadding", 4);
+ options.disable_full_screen = db_get_b(0, MODULENAME, "DisableFullScreen", 1) == 1;
+ options.drop_shadow = db_get_b(0, MODULENAME, "DropShadow", 0) == 1;
+ options.sb_width = db_get_dw(0, MODULENAME, "SidebarWidth", 22);
+ options.padding = db_get_dw(0, MODULENAME, "Padding", 4);
+ options.av_padding = db_get_dw(0, MODULENAME, "AvatarPadding", 4);
}
void SaveOptions()
{
- db_set_dw(0, MODULE, "DefaultTimeout", options.default_timeout);
- db_set_dw(0, MODULE, "WinWidth", options.win_width);
- db_set_dw(0, MODULE, "WinMaxHeight", options.win_max_height);
- db_set_b(0, MODULE, "Location", (BYTE)options.location);
- db_set_b(0, MODULE, "Opacity", (BYTE)options.opacity);
- db_set_b(0, MODULE, "Border", (options.border ? 1 : 0));
- db_set_b(0, MODULE, "RoundCorners", (options.round ? 1 : 0));
- db_set_b(0, MODULE, "AvatarRoundCorners", (options.av_round ? 1 : 0));
- db_set_b(0, MODULE, "Animate", options.animate);
- db_set_b(0, MODULE, "TransparentBg", (options.trans_bg ? 1 : 0));
- db_set_b(0, MODULE, "UseMimMonitor", (options.use_mim_monitor ? 1 : 0));
- db_set_b(0, MODULE, "RightIcon", (options.right_icon ? 1 : 0));
+ db_set_dw(0, MODULENAME, "DefaultTimeout", options.default_timeout);
+ db_set_dw(0, MODULENAME, "WinWidth", options.win_width);
+ db_set_dw(0, MODULENAME, "WinMaxHeight", options.win_max_height);
+ db_set_b(0, MODULENAME, "Location", (BYTE)options.location);
+ db_set_b(0, MODULENAME, "Opacity", (BYTE)options.opacity);
+ db_set_b(0, MODULENAME, "Border", (options.border ? 1 : 0));
+ db_set_b(0, MODULENAME, "RoundCorners", (options.round ? 1 : 0));
+ db_set_b(0, MODULENAME, "AvatarRoundCorners", (options.av_round ? 1 : 0));
+ db_set_b(0, MODULENAME, "Animate", options.animate);
+ db_set_b(0, MODULENAME, "TransparentBg", (options.trans_bg ? 1 : 0));
+ db_set_b(0, MODULENAME, "UseMimMonitor", (options.use_mim_monitor ? 1 : 0));
+ db_set_b(0, MODULENAME, "RightIcon", (options.right_icon ? 1 : 0));
if (ServiceExists(MS_AV_DRAWAVATAR))
- db_set_b(0, MODULE, "AVLayout", (BYTE)options.av_layout);
- db_set_dw(0, MODULE, "AVSize", options.av_size);
- db_set_dw(0, MODULE, "TextIndent", options.text_indent);
- db_set_b(0, MODULE, "GlobalHover", (options.global_hover ? 1 : 0));
- db_set_b(0, MODULE, "TimeLayout", (BYTE)options.time_layout);
+ db_set_b(0, MODULENAME, "AVLayout", (BYTE)options.av_layout);
+ db_set_dw(0, MODULENAME, "AVSize", options.av_size);
+ db_set_dw(0, MODULENAME, "TextIndent", options.text_indent);
+ db_set_b(0, MODULENAME, "GlobalHover", (options.global_hover ? 1 : 0));
+ db_set_b(0, MODULENAME, "TimeLayout", (BYTE)options.time_layout);
char buff[128];
for (int i = 0; i < 9; i++) {
mir_snprintf(buff, "DisableStatus%d", i - 1);
- db_set_b(0, MODULE, buff, options.disable_status[i] ? 1 : 0);
+ db_set_b(0, MODULENAME, buff, options.disable_status[i] ? 1 : 0);
}
- db_set_b(0, MODULE, "DisableFullScreen", (options.disable_full_screen ? 1 : 0));
- db_set_b(0, MODULE, "DropShadow", (options.drop_shadow ? 1 : 0));
- db_set_dw(0, MODULE, "SidebarWidth", options.sb_width);
- db_set_dw(0, MODULE, "Padding", options.padding);
- db_set_dw(0, MODULE, "AvatarPadding", options.av_padding);
+ db_set_b(0, MODULENAME, "DisableFullScreen", (options.disable_full_screen ? 1 : 0));
+ db_set_b(0, MODULENAME, "DropShadow", (options.drop_shadow ? 1 : 0));
+ db_set_dw(0, MODULENAME, "SidebarWidth", options.sb_width);
+ db_set_dw(0, MODULENAME, "Padding", options.padding);
+ db_set_dw(0, MODULENAME, "AvatarPadding", options.av_padding);
}
void ShowExamplePopups()
@@ -453,11 +453,11 @@ static INT_PTR CALLBACK DlgProcOptsClasses(HWND hwndDlg, UINT msg, WPARAM wParam char setting[256];
for (auto &pc : arClasses) {
mir_snprintf(setting, "%s/Timeout", pc->pszName);
- db_set_w(0, MODULE, setting, pc->iSeconds);
+ db_set_w(0, MODULENAME, setting, pc->iSeconds);
mir_snprintf(setting, "%s/TextCol", pc->pszName);
- db_set_dw(0, MODULE, setting, (DWORD)pc->colorText);
+ db_set_dw(0, MODULENAME, setting, (DWORD)pc->colorText);
mir_snprintf(setting, "%s/BgCol", pc->pszName);
- db_set_dw(0, MODULE, setting, (DWORD)pc->colorBack);
+ db_set_dw(0, MODULENAME, setting, (DWORD)pc->colorBack);
}
return TRUE;
}
diff --git a/plugins/YAPP/src/popwin.h b/plugins/YAPP/src/popwin.h index 8248592814..cb0c148330 100644 --- a/plugins/YAPP/src/popwin.h +++ b/plugins/YAPP/src/popwin.h @@ -1,7 +1,7 @@ #ifndef _POPWIN_INC
#define _POPWIN_INC
-#define POP_WIN_CLASS _A2W(MODULE) L"YAPPWindowClass"
+#define POP_WIN_CLASS _A2W(MODULENAME) L"YAPPWindowClass"
#define PUM_SETTEXT (WM_USER + 0x020)
#define PUM_GETCONTACT (WM_USER + 0x021)
diff --git a/plugins/YAPP/src/services.cpp b/plugins/YAPP/src/services.cpp index a2951cb6ec..f507557c20 100644 --- a/plugins/YAPP/src/services.cpp +++ b/plugins/YAPP/src/services.cpp @@ -6,7 +6,7 @@ static HANDLE hEventNotify; void StripBBCodesInPlace(wchar_t *text)
{
- if (text == nullptr || db_get_b(0, MODULE, "StripBBCodes", 1) == 0)
+ if (text == nullptr || db_get_b(0, MODULENAME, "StripBBCodes", 1) == 0)
return;
int read = 0, write = 0;
@@ -338,12 +338,12 @@ static INT_PTR RegisterPopupClass(WPARAM, LPARAM lParam) char setting[256];
mir_snprintf(setting, "%s/Timeout", pc->pszName);
- pc->iSeconds = db_get_w(0, MODULE, setting, pc->iSeconds);
+ pc->iSeconds = db_get_w(0, MODULENAME, setting, pc->iSeconds);
if (pc->iSeconds == (WORD)-1) pc->iSeconds = -1;
mir_snprintf(setting, "%s/TextCol", pc->pszName);
- pc->colorText = (COLORREF)db_get_dw(0, MODULE, setting, (DWORD)pc->colorText);
+ pc->colorText = (COLORREF)db_get_dw(0, MODULENAME, setting, (DWORD)pc->colorText);
mir_snprintf(setting, "%s/BgCol", pc->pszName);
- pc->colorBack = (COLORREF)db_get_dw(0, MODULE, setting, (DWORD)pc->colorBack);
+ pc->colorBack = (COLORREF)db_get_dw(0, MODULENAME, setting, (DWORD)pc->colorBack);
arClasses.insert(pc);
return (INT_PTR)pc;
diff --git a/plugins/YAPP/src/stdafx.h b/plugins/YAPP/src/stdafx.h index d1475a724d..b36b284271 100644 --- a/plugins/YAPP/src/stdafx.h +++ b/plugins/YAPP/src/stdafx.h @@ -40,13 +40,11 @@ #include "yapp_history.h"
#include "icons.h"
-#define MODULE "YAPP"
+#define MODULENAME "YAPP"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE)
- {}
+ CMPlugin();
};
extern bool bShutdown;
diff --git a/plugins/YAPP/src/yapp.cpp b/plugins/YAPP/src/yapp.cpp index feb7f9d743..f57355fa79 100644 --- a/plugins/YAPP/src/yapp.cpp +++ b/plugins/YAPP/src/yapp.cpp @@ -30,7 +30,7 @@ HGENMENU hMenuRoot, hMenuItem, hMenuItemHistory; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -44,9 +44,13 @@ PLUGININFOEX pluginInfo = {0xefd15f16, 0x7ae4, 0x40d7, {0xa8, 0xe3, 0xa4, 0x11, 0xed, 0x74, 0x7b, 0xd5}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -94,7 +98,7 @@ static void InitFonts() font_id_firstline.flags = FIDF_ALLOWEFFECTS;
mir_wstrcpy(font_id_firstline.group, LPGENW("Popups"));
mir_wstrcpy(font_id_firstline.name, LPGENW("First line"));
- mir_strcpy(font_id_firstline.dbSettingsGroup, MODULE);
+ mir_strcpy(font_id_firstline.dbSettingsGroup, MODULENAME);
mir_strcpy(font_id_firstline.prefix, "FontFirst");
mir_wstrcpy(font_id_firstline.backgroundGroup, L"Popups");
mir_wstrcpy(font_id_firstline.backgroundName, L"Background");
@@ -105,7 +109,7 @@ static void InitFonts() font_id_secondline.flags = FIDF_ALLOWEFFECTS;
mir_wstrcpy(font_id_secondline.group, LPGENW("Popups"));
mir_wstrcpy(font_id_secondline.name, LPGENW("Second line"));
- mir_strcpy(font_id_secondline.dbSettingsGroup, MODULE);
+ mir_strcpy(font_id_secondline.dbSettingsGroup, MODULENAME);
mir_strcpy(font_id_secondline.prefix, "FontSecond");
mir_wstrcpy(font_id_secondline.backgroundGroup, L"Popups");
mir_wstrcpy(font_id_secondline.backgroundName, L"Background");
@@ -116,7 +120,7 @@ static void InitFonts() font_id_time.flags = FIDF_ALLOWEFFECTS;
mir_wstrcpy(font_id_time.group, LPGENW("Popups"));
mir_wstrcpy(font_id_time.name, LPGENW("Time"));
- mir_strcpy(font_id_time.dbSettingsGroup, MODULE);
+ mir_strcpy(font_id_time.dbSettingsGroup, MODULENAME);
mir_strcpy(font_id_time.prefix, "FontTime");
mir_wstrcpy(font_id_time.backgroundGroup, L"Popups");
mir_wstrcpy(font_id_time.backgroundName, L"Background");
@@ -126,7 +130,7 @@ static void InitFonts() colour_id_bg.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colour_id_bg.group, LPGENW("Popups"));
mir_wstrcpy(colour_id_bg.name, LPGENW("Background"));
- mir_strcpy(colour_id_bg.dbSettingsGroup, MODULE);
+ mir_strcpy(colour_id_bg.dbSettingsGroup, MODULENAME);
mir_strcpy(colour_id_bg.setting, "ColourBg");
colour_id_bg.defcolour = GetSysColor(COLOR_3DSHADOW);
colour_id_bg.order = 0;
@@ -135,7 +139,7 @@ static void InitFonts() colour_id_border.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colour_id_border.group, LPGENW("Popups"));
mir_wstrcpy(colour_id_border.name, LPGENW("Border"));
- mir_strcpy(colour_id_border.dbSettingsGroup, MODULE);
+ mir_strcpy(colour_id_border.dbSettingsGroup, MODULENAME);
mir_strcpy(colour_id_border.setting, "ColourBorder");
colour_id_border.defcolour = RGB(0, 0, 0);
colour_id_border.order = 1;
@@ -144,7 +148,7 @@ static void InitFonts() colour_id_sidebar.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colour_id_sidebar.group, LPGENW("Popups"));
mir_wstrcpy(colour_id_sidebar.name, LPGENW("Sidebar"));
- mir_strcpy(colour_id_sidebar.dbSettingsGroup, MODULE);
+ mir_strcpy(colour_id_sidebar.dbSettingsGroup, MODULENAME);
mir_strcpy(colour_id_sidebar.setting, "ColourSidebar");
colour_id_sidebar.defcolour = RGB(128, 128, 128);
colour_id_sidebar.order = 2;
@@ -153,7 +157,7 @@ static void InitFonts() colour_id_titleunderline.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colour_id_titleunderline.group, LPGENW("Popups"));
mir_wstrcpy(colour_id_titleunderline.name, LPGENW("Title underline"));
- mir_strcpy(colour_id_titleunderline.dbSettingsGroup, MODULE);
+ mir_strcpy(colour_id_titleunderline.dbSettingsGroup, MODULENAME);
mir_strcpy(colour_id_titleunderline.setting, "ColourTitleUnderline");
colour_id_titleunderline.defcolour = GetSysColor(COLOR_3DSHADOW);
colour_id_titleunderline.order = 3;
@@ -213,7 +217,7 @@ static int PreShutdown(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
InitMessagePump();
diff --git a/plugins/YARelay/src/main.cpp b/plugins/YARelay/src/main.cpp index c2a8264cd3..d5c470093f 100644 --- a/plugins/YARelay/src/main.cpp +++ b/plugins/YARelay/src/main.cpp @@ -45,6 +45,10 @@ PLUGININFOEX pluginInfoEx = { {0x1202e6a, 0xc1b3, 0x42e5, {0x83, 0x8a, 0x3e, 0x49, 0x7b, 0x31, 0xf3, 0x8e}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
diff --git a/plugins/YARelay/src/stdafx.h b/plugins/YARelay/src/stdafx.h index 2d76fcbfaa..1b9d3ae627 100644 --- a/plugins/YARelay/src/stdafx.h +++ b/plugins/YARelay/src/stdafx.h @@ -50,9 +50,7 @@ Features: struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME)
- {}
+ CMPlugin();
};
extern MCONTACT hForwardFrom, hForwardTo;
diff --git a/plugins/ZeroNotification/src/main.cpp b/plugins/ZeroNotification/src/main.cpp index d8b19def2b..6f1f596f36 100644 --- a/plugins/ZeroNotification/src/main.cpp +++ b/plugins/ZeroNotification/src/main.cpp @@ -29,6 +29,10 @@ PLUGININFOEX pluginInfoEx = { { 0x47d489d3, 0x310d, 0x4ef6, { 0xbd, 0x5, 0x69, 0x9f, 0xff, 0xd5, 0xa4, 0xaa } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
@@ -53,9 +57,9 @@ static int SoundSettingChanged(WPARAM, LPARAM lParam) int SetNotify(const long status)
{
- db_set_b(NULL, "Skin", "UseSound", (BYTE)!(db_get_dw(NULL, MODNAME, "NoSound", DEFAULT_NOSOUND) & status));
- db_set_b(NULL, "CList", "DisableTrayFlash", (BYTE)(db_get_dw(NULL, MODNAME, "NoBlink", DEFAULT_NOBLINK) & status));
- db_set_b(NULL, "CList", "NoIconBlink", (BYTE)(db_get_dw(NULL, MODNAME, "NoCLCBlink", DEFAULT_NOCLCBLINK) & status));
+ db_set_b(NULL, "Skin", "UseSound", (BYTE)!(db_get_dw(NULL, MODULENAME, "NoSound", DEFAULT_NOSOUND) & status));
+ db_set_b(NULL, "CList", "DisableTrayFlash", (BYTE)(db_get_dw(NULL, MODULENAME, "NoBlink", DEFAULT_NOBLINK) & status));
+ db_set_b(NULL, "CList", "NoIconBlink", (BYTE)(db_get_dw(NULL, MODULENAME, "NoCLCBlink", DEFAULT_NOCLCBLINK) & status));
UpdateMenuItem();
return 0;
@@ -89,14 +93,14 @@ extern "C" __declspec(dllexport) int Load(void) {
mir_getLP(&pluginInfoEx);
- if (!db_get_b(NULL, MODNAME, "HideMenu", 1)) {
- CreateServiceFunction(MODNAME "/MenuCommand", NoSoundMenuCommand);
+ if (!db_get_b(NULL, MODULENAME, "HideMenu", 1)) {
+ CreateServiceFunction(MODULENAME "/MenuCommand", NoSoundMenuCommand);
CMenuItem mi;
SET_UID(mi, 0x6bd635eb, 0xc4bb, 0x413b, 0xb9, 0x3, 0x81, 0x6d, 0x8f, 0xf1, 0x9b, 0xb0);
mi.position = -0x7FFFFFFF;
mi.flags = CMIF_UNICODE;
- mi.pszService = MODNAME "/MenuCommand";
+ mi.pszService = MODULENAME "/MenuCommand";
noSoundMenu = Menu_AddMainMenuItem(&mi);
UpdateMenuItem();
diff --git a/plugins/ZeroNotification/src/options.cpp b/plugins/ZeroNotification/src/options.cpp index 9daa6886f2..b0c6684569 100644 --- a/plugins/ZeroNotification/src/options.cpp +++ b/plugins/ZeroNotification/src/options.cpp @@ -75,11 +75,11 @@ static INT_PTR CALLBACK DlgProcNoSoundOpts(HWND hwndDlg, UINT msg, WPARAM, LPARA SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_NOSOUND), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_NOSOUND), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES); SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_NOBLINK), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_NOBLINK), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES); SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_NOCLCBLINK), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_NOCLCBLINK), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES); - CheckDlgButton(hwndDlg, IDC_HIDEMENU, db_get_b(NULL, MODNAME, "HideMenu", 1) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_HIDEMENU, db_get_b(NULL, MODULENAME, "HideMenu", 1) ? BST_CHECKED : BST_UNCHECKED); - FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_NOSOUND), statusValues, sizeof(statusValues) / sizeof(statusValues[0]), db_get_dw(NULL, MODNAME, "NoSound", DEFAULT_NOSOUND)); - FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_NOBLINK), statusValues, sizeof(statusValues) / sizeof(statusValues[0]), db_get_dw(NULL, MODNAME, "NoBlink", DEFAULT_NOBLINK)); - FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_NOCLCBLINK), statusValues, sizeof(statusValues) / sizeof(statusValues[0]), db_get_dw(NULL, MODNAME, "NoCLCBlink", DEFAULT_NOCLCBLINK)); + FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_NOSOUND), statusValues, sizeof(statusValues) / sizeof(statusValues[0]), db_get_dw(NULL, MODULENAME, "NoSound", DEFAULT_NOSOUND)); + FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_NOBLINK), statusValues, sizeof(statusValues) / sizeof(statusValues[0]), db_get_dw(NULL, MODULENAME, "NoBlink", DEFAULT_NOBLINK)); + FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_NOCLCBLINK), statusValues, sizeof(statusValues) / sizeof(statusValues[0]), db_get_dw(NULL, MODULENAME, "NoCLCBlink", DEFAULT_NOCLCBLINK)); return TRUE; case WM_COMMAND: @@ -112,11 +112,11 @@ static INT_PTR CALLBACK DlgProcNoSoundOpts(HWND hwndDlg, UINT msg, WPARAM, LPARA case 0: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: - db_set_b(NULL, MODNAME, "HideMenu", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDEMENU)); + db_set_b(NULL, MODULENAME, "HideMenu", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDEMENU)); - db_set_dw(NULL, MODNAME, "NoSound", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_NOSOUND))); - db_set_dw(NULL, MODNAME, "NoBlink", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_NOBLINK))); - db_set_dw(NULL, MODNAME, "NoCLCBlink", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_NOCLCBLINK))); + db_set_dw(NULL, MODULENAME, "NoSound", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_NOSOUND))); + db_set_dw(NULL, MODULENAME, "NoBlink", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_NOBLINK))); + db_set_dw(NULL, MODULENAME, "NoCLCBlink", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_NOCLCBLINK))); test = db_get_w(NULL, "CList", "Status", 0); SetNotify(Proto_Status2Flag(db_get_w(NULL, "CList", "Status", 0))); diff --git a/plugins/ZeroNotification/src/stdafx.h b/plugins/ZeroNotification/src/stdafx.h index c9b6406e2b..f646c02676 100644 --- a/plugins/ZeroNotification/src/stdafx.h +++ b/plugins/ZeroNotification/src/stdafx.h @@ -13,13 +13,11 @@ #include "version.h"
#include "resource.h"
-#define MODNAME "ZeroNotify"
+#define MODULENAME "ZeroNotify"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODNAME)
- {}
+ CMPlugin();
};
#define DEFAULT_NOSOUND 0x00000000
diff --git a/plugins/ZeroSwitch/src/ZeroSwitch.cpp b/plugins/ZeroSwitch/src/ZeroSwitch.cpp index 6d87f40310..dcb6fde0a6 100644 --- a/plugins/ZeroSwitch/src/ZeroSwitch.cpp +++ b/plugins/ZeroSwitch/src/ZeroSwitch.cpp @@ -5,9 +5,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(nullptr)
- {}
+ CMPlugin();
}
g_plugin;
@@ -18,7 +16,7 @@ CLIST_INTERFACE *pcli; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo = {
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -31,9 +29,13 @@ PLUGININFOEX pluginInfo = { { 0x3f1657b1, 0x69cb, 0x4992, { 0x9c, 0xfc, 0x22, 0x6c, 0x80, 0x8a, 0x52, 0x2 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(nullptr, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -138,7 +140,7 @@ LRESULT CALLBACK CallWndRetProc(int nCode, WPARAM wParam, LPARAM lParam) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
if (IsWinVerVistaPlus()) {
diff --git a/plugins/mTextControl/src/main.cpp b/plugins/mTextControl/src/main.cpp index 1430085f31..7b2e4664f8 100644 --- a/plugins/mTextControl/src/main.cpp +++ b/plugins/mTextControl/src/main.cpp @@ -45,6 +45,10 @@ PLUGININFOEX pluginInfoEx = { 0x69b9443b, 0xdc58, 0x4876, { 0xad, 0x39, 0xe3, 0xf4, 0x18, 0xa1, 0x33, 0xc5 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
diff --git a/plugins/mTextControl/src/stdafx.h b/plugins/mTextControl/src/stdafx.h index d669ffbc57..b9ddc388dc 100644 --- a/plugins/mTextControl/src/stdafx.h +++ b/plugins/mTextControl/src/stdafx.h @@ -47,7 +47,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "fancy_rtf.h"
#include "textcontrol.h"
-#define MODULNAME "MTextControl" // DB module for this plugin
+#define MODULENAME "MTextControl" // DB module for this plugin
#define MODULNAMEW L"MTextControl" // DB module for this plugin
#define MODULTITLE "Text Display"
@@ -56,9 +56,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULNAME)
- {}
+ CMPlugin();
};
#endif // __headers_h__
diff --git a/plugins/mTextControl/src/textusers.cpp b/plugins/mTextControl/src/textusers.cpp index b9a16a3d21..b0d27d16e4 100644 --- a/plugins/mTextControl/src/textusers.cpp +++ b/plugins/mTextControl/src/textusers.cpp @@ -45,8 +45,8 @@ HANDLE DLL_CALLCONV MTI_TextUserAdd(const char *userTitle, DWORD options) textUserNew->name = new char[mir_strlen(userTitle) + 1];
mir_strcpy(textUserNew->name, userTitle);
textUserNew->options =
- (db_get_dw(0, MODULNAME, userTitle, options)&MTEXT_FANCY_MASK) | (textUserNew->options&MTEXT_SYSTEM_MASK);
- db_set_dw(0, MODULNAME, userTitle, textUserNew->options);
+ (db_get_dw(0, MODULENAME, userTitle, options)&MTEXT_FANCY_MASK) | (textUserNew->options&MTEXT_SYSTEM_MASK);
+ db_set_dw(0, MODULENAME, userTitle, textUserNew->options);
textUserNew->prev = textUserLast;
textUserNew->next = nullptr;
if (textUserLast) {
@@ -73,12 +73,12 @@ void TextUserSetOptions(HANDLE userHandle, DWORD options) void TextUsersSave()
{
for (TextUser *textUser = textUserFirst; textUser; textUser = textUser->next)
- db_set_dw(0, MODULNAME, textUser->name, textUser->options);
+ db_set_dw(0, MODULENAME, textUser->name, textUser->options);
}
void TextUsersReset()
{
for (TextUser *textUser = textUserFirst; textUser; textUser = textUser->next)
textUser->options =
- (db_get_dw(0, MODULNAME, textUser->name, 0)&MTEXT_FANCY_MASK) | (textUser->options&MTEXT_SYSTEM_MASK);
+ (db_get_dw(0, MODULENAME, textUser->name, 0)&MTEXT_FANCY_MASK) | (textUser->options&MTEXT_SYSTEM_MASK);
}
diff --git a/plugins/wbOSD/src/events.cpp b/plugins/wbOSD/src/events.cpp index bda652b9ed..b16bcd1c97 100644 --- a/plugins/wbOSD/src/events.cpp +++ b/plugins/wbOSD/src/events.cpp @@ -11,7 +11,7 @@ Distributed under GNU's GPL 2 or later void logmsg2(char *str)
{
- FILE *f=fopen("c:\\logm.txt", "a");
+ FILE *f = fopen("c:\\logm.txt", "a");
fprintf(f, "%s\n", str);
fclose(f);
}
@@ -19,7 +19,7 @@ void logmsg2(char *str) void showmsgwnd(unsigned int param)
{
logmsg("showmsgwnd");
- if (db_get_b(NULL,THIS_MODULE, "showMessageWindow", DEFAULT_SHOWMSGWIN))
+ if (db_get_b(NULL, MODULENAME, "showMessageWindow", DEFAULT_SHOWMSGWIN))
CallService(MS_MSG_SENDMESSAGEW, (WPARAM)param, 0);
}
@@ -30,65 +30,67 @@ LRESULT ShowOSD(wchar_t *str, int timeout, COLORREF color, MCONTACT user) if (!g_hWnd)
return 0;
- if (timeout==0)
- timeout=db_get_dw(NULL,THIS_MODULE, "timeout", DEFAULT_TIMEOUT);
+ if (timeout == 0)
+ timeout = db_get_dw(NULL, MODULENAME, "timeout", DEFAULT_TIMEOUT);
osdmsg om;
- om.text=str;
- om.timeout=timeout;
- om.color=color;
- om.param=(unsigned int)user;
- om.callback=showmsgwnd;
-
- return SendMessage(g_hWnd, WM_USER+4, (WPARAM)&om, 0);
+ om.text = str;
+ om.timeout = timeout;
+ om.color = color;
+ om.param = (unsigned int)user;
+ om.callback = showmsgwnd;
+
+ return SendMessage(g_hWnd, WM_USER + 4, (WPARAM)&om, 0);
}
-int ProtoAck(WPARAM,LPARAM lparam)
+int ProtoAck(WPARAM, LPARAM lparam)
{
- ACKDATA *ack=(ACKDATA *)lparam;
-
+ ACKDATA *ack = (ACKDATA *)lparam;
+
logmsg("ProtoAck");
- if (!db_get_b(NULL,THIS_MODULE, "a_user", DEFAULT_ANNOUNCESTATUS))
+ if (!db_get_b(NULL, MODULENAME, "a_user", DEFAULT_ANNOUNCESTATUS))
return 0;
- if (!(db_get_dw(NULL,THIS_MODULE,"showWhen", DEFAULT_SHOWWHEN)&(1<<(db_get_w(NULL, "CList", "Status", ID_STATUS_OFFLINE)-ID_STATUS_OFFLINE))))
+ if (!(db_get_dw(NULL, MODULENAME, "showWhen", DEFAULT_SHOWWHEN)&(1 << (db_get_w(NULL, "CList", "Status", ID_STATUS_OFFLINE) - ID_STATUS_OFFLINE))))
return 0;
- if ( ack->type == ACKTYPE_STATUS ) {
- if (!db_get_b(NULL,THIS_MODULE, "showMyStatus", DEFAULT_SHOWMYSTATUS))
+ if (ack->type == ACKTYPE_STATUS) {
+ if (!db_get_b(NULL, MODULENAME, "showMyStatus", DEFAULT_SHOWMYSTATUS))
return 0;
- if ( ack->result == ACKRESULT_SUCCESS && (LPARAM)ack->hProcess != ack->lParam ) {
- DWORD ann = db_get_dw( NULL, THIS_MODULE, "announce", DEFAULT_ANNOUNCE );
- if ( ann & ( 1 << ( ack->lParam - ID_STATUS_OFFLINE ))) {
+ if (ack->result == ACKRESULT_SUCCESS && (LPARAM)ack->hProcess != ack->lParam) {
+ DWORD ann = db_get_dw(NULL, MODULENAME, "announce", DEFAULT_ANNOUNCE);
+ if (ann & (1 << (ack->lParam - ID_STATUS_OFFLINE))) {
wchar_t buffer[512];
mir_snwprintf(buffer, TranslateT("%s is %s"), Clist_GetContactDisplayName(ack->hContact), Clist_GetStatusModeDescription(ack->lParam, 0));
- ShowOSD(buffer, 0, db_get_dw(NULL,THIS_MODULE, "clr_status", DEFAULT_CLRSTATUS), ack->hContact);
- } } }
+ ShowOSD(buffer, 0, db_get_dw(NULL, MODULENAME, "clr_status", DEFAULT_CLRSTATUS), ack->hContact);
+ }
+ }
+ }
return 0;
}
-int ContactSettingChanged(WPARAM wParam,LPARAM lParam)
+int ContactSettingChanged(WPARAM wParam, LPARAM lParam)
{
- MCONTACT hContact = (MCONTACT) wParam;
- DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
+ MCONTACT hContact = (MCONTACT)wParam;
+ DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
- if(hContact==NULL || strcmp(cws->szSetting,"Status")) return 0;
+ if (hContact == NULL || strcmp(cws->szSetting, "Status")) return 0;
logmsg("ContactSettingChanged1");
WORD newStatus = cws->value.wVal;
- WORD oldStatus = DBGetContactSettingRangedWord(hContact,"UserOnline","OldStatus2",ID_STATUS_OFFLINE, ID_STATUS_MIN, ID_STATUS_MAX);
-
+ WORD oldStatus = DBGetContactSettingRangedWord(hContact, "UserOnline", "OldStatus2", ID_STATUS_OFFLINE, ID_STATUS_MIN, ID_STATUS_MAX);
+
if (oldStatus == newStatus) return 0;
-
+
logmsg("ContactSettingChanged2");
- db_set_w(hContact,"UserOnline","OldStatus2", newStatus);
+ db_set_w(hContact, "UserOnline", "OldStatus2", newStatus);
- if(CallService(MS_IGNORE_ISIGNORED,wParam,IGNOREEVENT_USERONLINE)) return 0;
+ if (CallService(MS_IGNORE_ISIGNORED, wParam, IGNOREEVENT_USERONLINE)) return 0;
DWORD dwStatuses = MAKELPARAM(oldStatus, newStatus);
NotifyEventHooks(hHookContactStatusChanged, wParam, (LPARAM)dwStatuses);
@@ -98,31 +100,31 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam) int ContactStatusChanged(WPARAM wParam, LPARAM lParam)
{
- MCONTACT hContact = (MCONTACT) wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
WORD newStatus = HIWORD(lParam);
- DWORD ann=db_get_dw(NULL,THIS_MODULE,"announce", DEFAULT_ANNOUNCE);
+ DWORD ann = db_get_dw(NULL, MODULENAME, "announce", DEFAULT_ANNOUNCE);
logmsg("ContactStatusChanged1");
- if (!db_get_b(NULL,THIS_MODULE, "a_user", DEFAULT_ANNOUNCESTATUS))
+ if (!db_get_b(NULL, MODULENAME, "a_user", DEFAULT_ANNOUNCESTATUS))
return 0;
- if (!(db_get_dw(NULL,THIS_MODULE,"showWhen", DEFAULT_SHOWWHEN)&(1<<(db_get_w(NULL, "CList", "Status", ID_STATUS_OFFLINE)-ID_STATUS_OFFLINE))))
+ if (!(db_get_dw(NULL, MODULENAME, "showWhen", DEFAULT_SHOWWHEN)&(1 << (db_get_w(NULL, "CList", "Status", ID_STATUS_OFFLINE) - ID_STATUS_OFFLINE))))
return 0;
- if (!(ann&(1<<(newStatus-ID_STATUS_OFFLINE))) )
+ if (!(ann&(1 << (newStatus - ID_STATUS_OFFLINE))))
return 0;
-
+
logmsg("ContactStatusChanged2");
- if (db_get_b(hContact,"CList","NotOnList",0) || db_get_b(hContact,"CList","Hidden",0) ||
- (CallService(MS_IGNORE_ISIGNORED,wParam,IGNOREEVENT_USERONLINE) && newStatus==ID_STATUS_ONLINE)
- )
+ if (db_get_b(hContact, "CList", "NotOnList", 0) || db_get_b(hContact, "CList", "Hidden", 0) ||
+ (CallService(MS_IGNORE_ISIGNORED, wParam, IGNOREEVENT_USERONLINE) && newStatus == ID_STATUS_ONLINE)
+ )
return 0;
wchar_t bufferW[512];
mir_snwprintf(bufferW, TranslateT("%s is %s"), Clist_GetContactDisplayName(wParam), Clist_GetStatusModeDescription(newStatus, 0));
- ShowOSD(bufferW, 0, db_get_dw(NULL,THIS_MODULE, "clr_status", DEFAULT_CLRSTATUS), hContact);
+ ShowOSD(bufferW, 0, db_get_dw(NULL, MODULENAME, "clr_status", DEFAULT_CLRSTATUS), hContact);
return 0;
}
@@ -134,68 +136,70 @@ int HookedNewEvent(WPARAM wParam, LPARAM hDBEvent) if (dbe.cbBlob == -1)
return 0;
- dbe.pBlob = (PBYTE) malloc(dbe.cbBlob);
- if(db_event_get(hDBEvent,&dbe))
+ dbe.pBlob = (PBYTE)malloc(dbe.cbBlob);
+ if (db_event_get(hDBEvent, &dbe))
return 0;
if (dbe.flags & DBEF_SENT)
- return 0;
+ return 0;
- if (db_get_b(NULL,THIS_MODULE, "messages", DEFAULT_ANNOUNCEMESSAGES)==0)
+ if (db_get_b(NULL, MODULENAME, "messages", DEFAULT_ANNOUNCEMESSAGES) == 0)
return 0;
- if (!(db_get_dw(NULL,THIS_MODULE,"showWhen", DEFAULT_SHOWWHEN)&(1<<(db_get_w(NULL, "CList", "Status", ID_STATUS_OFFLINE)-ID_STATUS_OFFLINE))))
+ if (!(db_get_dw(NULL, MODULENAME, "showWhen", DEFAULT_SHOWWHEN)&(1 << (db_get_w(NULL, "CList", "Status", ID_STATUS_OFFLINE) - ID_STATUS_OFFLINE))))
return 0;
-
+
logmsg("HookedNewEvent2");
wchar_t buf[512];
- wcsncpy(buf, DEFAULT_MESSAGEFORMAT,_countof(buf));
+ wcsncpy(buf, DEFAULT_MESSAGEFORMAT, _countof(buf));
DBVARIANT dbv;
- if(!db_get_ws(NULL,THIS_MODULE,"message_format",&dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, "message_format", &dbv)) {
mir_wstrcpy(buf, dbv.ptszVal);
db_free(&dbv);
}
- int i1=-1, i2=-1;
+ int i1 = -1, i2 = -1;
wchar_t* pbuf = buf;
while (*pbuf) {
- if (*pbuf=='%') {
- if (*(pbuf+1)=='n') {
- if (i1==-1)
- i1=1;
- else i2=1;
- *(pbuf+1)='s';
- } else if (*(pbuf+1)=='m') {
- if (i1==-1)
- i1=2;
- else i2=2;
- *(pbuf+1)='s';
- } else if (*(pbuf+1)=='l') {
- *pbuf=0x0d;
- *(pbuf+1)=0x0a;
+ if (*pbuf == '%') {
+ if (*(pbuf + 1) == 'n') {
+ if (i1 == -1)
+ i1 = 1;
+ else i2 = 1;
+ *(pbuf + 1) = 's';
+ }
+ else if (*(pbuf + 1) == 'm') {
+ if (i1 == -1)
+ i1 = 2;
+ else i2 = 2;
+ *(pbuf + 1) = 's';
+ }
+ else if (*(pbuf + 1) == 'l') {
+ *pbuf = 0x0d;
+ *(pbuf + 1) = 0x0a;
}
}
pbuf++;
}
wchar_t *c1 = nullptr, *c2 = nullptr;
- if ( i1 == 1 )
+ if (i1 == 1)
c1 = mir_wstrdup(Clist_GetContactDisplayName(wParam));
- else if ( i1 == 2 )
- c1 = DbEvent_GetTextW( &dbe, 0 );
+ else if (i1 == 2)
+ c1 = DbEvent_GetTextW(&dbe, 0);
- if ( i2 == 1 )
+ if (i2 == 1)
c2 = mir_wstrdup(Clist_GetContactDisplayName(wParam));
- else if ( i2 == 2 )
- c2 = DbEvent_GetTextW( &dbe, 0 );
+ else if (i2 == 2)
+ c2 = DbEvent_GetTextW(&dbe, 0);
wchar_t buffer[512];
mir_snwprintf(buffer, buf, c1, c2);
- ShowOSD(buffer, 0, db_get_dw(NULL,THIS_MODULE, "clr_msg", DEFAULT_CLRMSG), wParam);
+ ShowOSD(buffer, 0, db_get_dw(NULL, MODULENAME, "clr_msg", DEFAULT_CLRMSG), wParam);
- mir_free( c1 );
- mir_free( c2 );
+ mir_free(c1);
+ mir_free(c2);
return 0;
}
diff --git a/plugins/wbOSD/src/main.cpp b/plugins/wbOSD/src/main.cpp index f24e5edb8c..50114b9047 100644 --- a/plugins/wbOSD/src/main.cpp +++ b/plugins/wbOSD/src/main.cpp @@ -20,7 +20,7 @@ int MainInit(WPARAM,LPARAM); /////////////////////////////////////////////////////////////////////////////////////////
-static PLUGININFOEX pluginInfo = {
+static PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -33,16 +33,20 @@ static PLUGININFOEX pluginInfo = { {0xfc718bc7, 0xabc8, 0x43cd, {0xaa, 0xd9, 0x76, 0x16, 0x14, 0x61, 0x77, 0x38}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
extern "C" __declspec(dllexport) int Load()
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
logmsg("Load");
HookEvent(ME_SYSTEM_MODULESLOADED, MainInit);
diff --git a/plugins/wbOSD/src/options.cpp b/plugins/wbOSD/src/options.cpp index 0b041ed5d9..1c92e5829d 100644 --- a/plugins/wbOSD/src/options.cpp +++ b/plugins/wbOSD/src/options.cpp @@ -103,53 +103,53 @@ void loadDBSettings(plgsettings *ps) {
logmsg("loadDBSettings");
- ps->align = db_get_b(NULL, THIS_MODULE, "align", DEFAULT_ALIGN);
- ps->salign = db_get_b(NULL, THIS_MODULE, "salign", DEFAULT_SALIGN);
- ps->altShadow = db_get_b(NULL, THIS_MODULE, "altShadow", DEFAULT_ALTSHADOW);
- ps->transparent = db_get_b(NULL, THIS_MODULE, "transparent", DEFAULT_TRANPARENT);
- ps->showShadow = db_get_b(NULL, THIS_MODULE, "showShadow", DEFAULT_SHOWSHADOW);
- ps->messages = db_get_b(NULL, THIS_MODULE, "messages", DEFAULT_ANNOUNCEMESSAGES);
- ps->a_user = db_get_b(NULL, THIS_MODULE, "a_user", DEFAULT_ANNOUNCESTATUS);
- ps->distance = db_get_b(NULL, THIS_MODULE, "distance", DEFAULT_DISTANCE);
- ps->winx = db_get_dw(NULL, THIS_MODULE, "winx", DEFAULT_WINX);
- ps->winy = db_get_dw(NULL, THIS_MODULE, "winy", DEFAULT_WINY);
- ps->winxpos = db_get_dw(NULL, THIS_MODULE, "winxpos", DEFAULT_WINXPOS);
- ps->winypos = db_get_dw(NULL, THIS_MODULE, "winypos", DEFAULT_WINYPOS);
- ps->alpha = db_get_b(NULL, THIS_MODULE, "alpha", DEFAULT_ALPHA);
- ps->showmystatus = db_get_b(NULL, THIS_MODULE, "showMyStatus", DEFAULT_SHOWMYSTATUS);
- ps->timeout = db_get_dw(NULL, THIS_MODULE, "timeout", DEFAULT_TIMEOUT);
- ps->clr_msg = db_get_dw(NULL, THIS_MODULE, "clr_msg", DEFAULT_CLRMSG);
- ps->clr_status = db_get_dw(NULL, THIS_MODULE, "clr_status", DEFAULT_CLRSTATUS);
- ps->clr_shadow = db_get_dw(NULL, THIS_MODULE, "clr_shadow", DEFAULT_CLRSHADOW);
- ps->bkclr = db_get_dw(NULL, THIS_MODULE, "bkclr", DEFAULT_BKCLR);
-
- ps->showMsgWindow = db_get_b(NULL, THIS_MODULE, "showMessageWindow", DEFAULT_SHOWMSGWIN);
- ps->showWhen = db_get_dw(NULL, THIS_MODULE, "showWhen", DEFAULT_SHOWWHEN);
+ ps->align = db_get_b(NULL, MODULENAME, "align", DEFAULT_ALIGN);
+ ps->salign = db_get_b(NULL, MODULENAME, "salign", DEFAULT_SALIGN);
+ ps->altShadow = db_get_b(NULL, MODULENAME, "altShadow", DEFAULT_ALTSHADOW);
+ ps->transparent = db_get_b(NULL, MODULENAME, "transparent", DEFAULT_TRANPARENT);
+ ps->showShadow = db_get_b(NULL, MODULENAME, "showShadow", DEFAULT_SHOWSHADOW);
+ ps->messages = db_get_b(NULL, MODULENAME, "messages", DEFAULT_ANNOUNCEMESSAGES);
+ ps->a_user = db_get_b(NULL, MODULENAME, "a_user", DEFAULT_ANNOUNCESTATUS);
+ ps->distance = db_get_b(NULL, MODULENAME, "distance", DEFAULT_DISTANCE);
+ ps->winx = db_get_dw(NULL, MODULENAME, "winx", DEFAULT_WINX);
+ ps->winy = db_get_dw(NULL, MODULENAME, "winy", DEFAULT_WINY);
+ ps->winxpos = db_get_dw(NULL, MODULENAME, "winxpos", DEFAULT_WINXPOS);
+ ps->winypos = db_get_dw(NULL, MODULENAME, "winypos", DEFAULT_WINYPOS);
+ ps->alpha = db_get_b(NULL, MODULENAME, "alpha", DEFAULT_ALPHA);
+ ps->showmystatus = db_get_b(NULL, MODULENAME, "showMyStatus", DEFAULT_SHOWMYSTATUS);
+ ps->timeout = db_get_dw(NULL, MODULENAME, "timeout", DEFAULT_TIMEOUT);
+ ps->clr_msg = db_get_dw(NULL, MODULENAME, "clr_msg", DEFAULT_CLRMSG);
+ ps->clr_status = db_get_dw(NULL, MODULENAME, "clr_status", DEFAULT_CLRSTATUS);
+ ps->clr_shadow = db_get_dw(NULL, MODULENAME, "clr_shadow", DEFAULT_CLRSHADOW);
+ ps->bkclr = db_get_dw(NULL, MODULENAME, "bkclr", DEFAULT_BKCLR);
+
+ ps->showMsgWindow = db_get_b(NULL, MODULENAME, "showMessageWindow", DEFAULT_SHOWMSGWIN);
+ ps->showWhen = db_get_dw(NULL, MODULENAME, "showWhen", DEFAULT_SHOWWHEN);
DBVARIANT dbv;
- if (!db_get_ws(NULL, THIS_MODULE, "message_format", &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, "message_format", &dbv)) {
mir_wstrcpy(ps->msgformat, dbv.ptszVal);
db_free(&dbv);
}
else mir_wstrcpy(ps->msgformat, DEFAULT_MESSAGEFORMAT);
- ps->announce = db_get_dw(NULL, THIS_MODULE, "announce", DEFAULT_ANNOUNCE);
-
- ps->lf.lfHeight = db_get_dw(NULL, THIS_MODULE, "fntHeight", DEFAULT_FNT_HEIGHT);
- ps->lf.lfWidth = db_get_dw(NULL, THIS_MODULE, "fntWidth", DEFAULT_FNT_WIDTH);
- ps->lf.lfEscapement = db_get_dw(NULL, THIS_MODULE, "fntEscapement", DEFAULT_FNT_ESCAPEMENT);
- ps->lf.lfOrientation = db_get_dw(NULL, THIS_MODULE, "fntOrientation", DEFAULT_FNT_ORIENTATION);
- ps->lf.lfWeight = db_get_dw(NULL, THIS_MODULE, "fntWeight", DEFAULT_FNT_WEIGHT);
- ps->lf.lfItalic = db_get_b(NULL, THIS_MODULE, "fntItalic", DEFAULT_FNT_ITALIC);
- ps->lf.lfUnderline = db_get_b(NULL, THIS_MODULE, "fntUnderline", DEFAULT_FNT_UNDERLINE);
- ps->lf.lfStrikeOut = db_get_b(NULL, THIS_MODULE, "fntStrikeout", DEFAULT_FNT_STRIKEOUT);
- ps->lf.lfCharSet = db_get_b(NULL, THIS_MODULE, "fntCharSet", DEFAULT_FNT_CHARSET);
- ps->lf.lfOutPrecision = db_get_b(NULL, THIS_MODULE, "fntOutPrecision", DEFAULT_FNT_OUTPRECISION);
- ps->lf.lfClipPrecision = db_get_b(NULL, THIS_MODULE, "fntClipPrecision", DEFAULT_FNT_CLIPRECISION);
- ps->lf.lfQuality = db_get_b(NULL, THIS_MODULE, "fntQuality", DEFAULT_FNT_QUALITY);
- ps->lf.lfPitchAndFamily = db_get_b(NULL, THIS_MODULE, "fntPitchAndFamily", DEFAULT_FNT_PITCHANDFAM);
-
- if (!db_get_ws(NULL, THIS_MODULE, "fntFaceName", &dbv)) {
+ ps->announce = db_get_dw(NULL, MODULENAME, "announce", DEFAULT_ANNOUNCE);
+
+ ps->lf.lfHeight = db_get_dw(NULL, MODULENAME, "fntHeight", DEFAULT_FNT_HEIGHT);
+ ps->lf.lfWidth = db_get_dw(NULL, MODULENAME, "fntWidth", DEFAULT_FNT_WIDTH);
+ ps->lf.lfEscapement = db_get_dw(NULL, MODULENAME, "fntEscapement", DEFAULT_FNT_ESCAPEMENT);
+ ps->lf.lfOrientation = db_get_dw(NULL, MODULENAME, "fntOrientation", DEFAULT_FNT_ORIENTATION);
+ ps->lf.lfWeight = db_get_dw(NULL, MODULENAME, "fntWeight", DEFAULT_FNT_WEIGHT);
+ ps->lf.lfItalic = db_get_b(NULL, MODULENAME, "fntItalic", DEFAULT_FNT_ITALIC);
+ ps->lf.lfUnderline = db_get_b(NULL, MODULENAME, "fntUnderline", DEFAULT_FNT_UNDERLINE);
+ ps->lf.lfStrikeOut = db_get_b(NULL, MODULENAME, "fntStrikeout", DEFAULT_FNT_STRIKEOUT);
+ ps->lf.lfCharSet = db_get_b(NULL, MODULENAME, "fntCharSet", DEFAULT_FNT_CHARSET);
+ ps->lf.lfOutPrecision = db_get_b(NULL, MODULENAME, "fntOutPrecision", DEFAULT_FNT_OUTPRECISION);
+ ps->lf.lfClipPrecision = db_get_b(NULL, MODULENAME, "fntClipPrecision", DEFAULT_FNT_CLIPRECISION);
+ ps->lf.lfQuality = db_get_b(NULL, MODULENAME, "fntQuality", DEFAULT_FNT_QUALITY);
+ ps->lf.lfPitchAndFamily = db_get_b(NULL, MODULENAME, "fntPitchAndFamily", DEFAULT_FNT_PITCHANDFAM);
+
+ if (!db_get_ws(NULL, MODULENAME, "fntFaceName", &dbv)) {
mir_wstrcpy(ps->lf.lfFaceName, dbv.ptszVal);
db_free(&dbv);
}
@@ -161,52 +161,52 @@ void saveDBSettings(plgsettings *ps) {
logmsg("saveDBSettings");
- db_set_b(NULL, THIS_MODULE, "showShadow", ps->showShadow);
- db_set_b(NULL, THIS_MODULE, "altShadow", ps->altShadow);
- db_set_b(NULL, THIS_MODULE, "distance", ps->distance);
-
- db_set_dw(NULL, THIS_MODULE, "winx", ps->winx);
- db_set_dw(NULL, THIS_MODULE, "winy", ps->winy);
- db_set_dw(NULL, THIS_MODULE, "winxpos", ps->winxpos);
- db_set_dw(NULL, THIS_MODULE, "winypos", ps->winypos);
-
- db_set_b(NULL, THIS_MODULE, "alpha", ps->alpha);
- db_set_dw(NULL, THIS_MODULE, "timeout", ps->timeout);
-
- db_set_b(NULL, THIS_MODULE, "transparent", ps->transparent);
- db_set_b(NULL, THIS_MODULE, "messages", ps->messages);
- db_set_b(NULL, THIS_MODULE, "a_user", ps->a_user);
- db_set_ws(NULL, THIS_MODULE, "message_format", ps->msgformat);
-
- db_set_b(NULL, THIS_MODULE, "align", ps->align);
- db_set_b(NULL, THIS_MODULE, "salign", ps->salign);
-
- db_set_b(NULL, THIS_MODULE, "showMyStatus", ps->showmystatus);
-
- db_set_dw(NULL, THIS_MODULE, "clr_msg", ps->clr_msg);
- db_set_dw(NULL, THIS_MODULE, "clr_shadow", ps->clr_shadow);
- db_set_dw(NULL, THIS_MODULE, "clr_status", ps->clr_status);
- db_set_dw(NULL, THIS_MODULE, "bkclr", ps->bkclr);
-
- db_set_dw(NULL, THIS_MODULE, "fntHeight", ps->lf.lfHeight);
- db_set_dw(NULL, THIS_MODULE, "fntWidth", ps->lf.lfWidth);
- db_set_dw(NULL, THIS_MODULE, "fntEscapement", ps->lf.lfEscapement);
- db_set_dw(NULL, THIS_MODULE, "fntOrientation", ps->lf.lfOrientation);
- db_set_dw(NULL, THIS_MODULE, "fntWeight", ps->lf.lfWeight);
- db_set_b(NULL, THIS_MODULE, "fntItalic", ps->lf.lfItalic);
- db_set_b(NULL, THIS_MODULE, "fntUnderline", ps->lf.lfUnderline);
- db_set_b(NULL, THIS_MODULE, "fntStrikeout", ps->lf.lfStrikeOut);
- db_set_b(NULL, THIS_MODULE, "fntCharSet", ps->lf.lfCharSet);
- db_set_b(NULL, THIS_MODULE, "fntOutPrecision", ps->lf.lfOutPrecision);
- db_set_b(NULL, THIS_MODULE, "fntClipPrecision", ps->lf.lfClipPrecision);
- db_set_b(NULL, THIS_MODULE, "fntQuality", ps->lf.lfQuality);
- db_set_b(NULL, THIS_MODULE, "fntPitchAndFamily", ps->lf.lfPitchAndFamily);
- db_set_ws(NULL, THIS_MODULE, "fntFaceName", ps->lf.lfFaceName);
-
- db_set_dw(NULL, THIS_MODULE, "announce", ps->announce);
-
- db_set_b(NULL, THIS_MODULE, "showMessageWindow", ps->showMsgWindow);
- db_set_dw(NULL, THIS_MODULE, "showWhen", ps->showWhen);
+ db_set_b(NULL, MODULENAME, "showShadow", ps->showShadow);
+ db_set_b(NULL, MODULENAME, "altShadow", ps->altShadow);
+ db_set_b(NULL, MODULENAME, "distance", ps->distance);
+
+ db_set_dw(NULL, MODULENAME, "winx", ps->winx);
+ db_set_dw(NULL, MODULENAME, "winy", ps->winy);
+ db_set_dw(NULL, MODULENAME, "winxpos", ps->winxpos);
+ db_set_dw(NULL, MODULENAME, "winypos", ps->winypos);
+
+ db_set_b(NULL, MODULENAME, "alpha", ps->alpha);
+ db_set_dw(NULL, MODULENAME, "timeout", ps->timeout);
+
+ db_set_b(NULL, MODULENAME, "transparent", ps->transparent);
+ db_set_b(NULL, MODULENAME, "messages", ps->messages);
+ db_set_b(NULL, MODULENAME, "a_user", ps->a_user);
+ db_set_ws(NULL, MODULENAME, "message_format", ps->msgformat);
+
+ db_set_b(NULL, MODULENAME, "align", ps->align);
+ db_set_b(NULL, MODULENAME, "salign", ps->salign);
+
+ db_set_b(NULL, MODULENAME, "showMyStatus", ps->showmystatus);
+
+ db_set_dw(NULL, MODULENAME, "clr_msg", ps->clr_msg);
+ db_set_dw(NULL, MODULENAME, "clr_shadow", ps->clr_shadow);
+ db_set_dw(NULL, MODULENAME, "clr_status", ps->clr_status);
+ db_set_dw(NULL, MODULENAME, "bkclr", ps->bkclr);
+
+ db_set_dw(NULL, MODULENAME, "fntHeight", ps->lf.lfHeight);
+ db_set_dw(NULL, MODULENAME, "fntWidth", ps->lf.lfWidth);
+ db_set_dw(NULL, MODULENAME, "fntEscapement", ps->lf.lfEscapement);
+ db_set_dw(NULL, MODULENAME, "fntOrientation", ps->lf.lfOrientation);
+ db_set_dw(NULL, MODULENAME, "fntWeight", ps->lf.lfWeight);
+ db_set_b(NULL, MODULENAME, "fntItalic", ps->lf.lfItalic);
+ db_set_b(NULL, MODULENAME, "fntUnderline", ps->lf.lfUnderline);
+ db_set_b(NULL, MODULENAME, "fntStrikeout", ps->lf.lfStrikeOut);
+ db_set_b(NULL, MODULENAME, "fntCharSet", ps->lf.lfCharSet);
+ db_set_b(NULL, MODULENAME, "fntOutPrecision", ps->lf.lfOutPrecision);
+ db_set_b(NULL, MODULENAME, "fntClipPrecision", ps->lf.lfClipPrecision);
+ db_set_b(NULL, MODULENAME, "fntQuality", ps->lf.lfQuality);
+ db_set_b(NULL, MODULENAME, "fntPitchAndFamily", ps->lf.lfPitchAndFamily);
+ db_set_ws(NULL, MODULENAME, "fntFaceName", ps->lf.lfFaceName);
+
+ db_set_dw(NULL, MODULENAME, "announce", ps->announce);
+
+ db_set_b(NULL, MODULENAME, "showMessageWindow", ps->showMsgWindow);
+ db_set_dw(NULL, MODULENAME, "showWhen", ps->showWhen);
}
INT_PTR CALLBACK OptDlgProc(HWND hDlg, UINT msg, WPARAM wparam, LPARAM lparam)
@@ -364,9 +364,9 @@ xxx: saveDBSettings(ps);
SetWindowPos(g_hWnd, nullptr, 0, 0, ps->winx, ps->winy, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
SetLayeredWindowAttributes(g_hWnd,
- db_get_dw(NULL, THIS_MODULE, "bkclr", DEFAULT_BKCLR),
- db_get_b(NULL, THIS_MODULE, "alpha", DEFAULT_ALPHA),
- (db_get_b(NULL, THIS_MODULE, "transparent", DEFAULT_TRANPARENT) ? LWA_COLORKEY : 0) | LWA_ALPHA);
+ db_get_dw(NULL, MODULENAME, "bkclr", DEFAULT_BKCLR),
+ db_get_b(NULL, MODULENAME, "alpha", DEFAULT_ALPHA),
+ (db_get_b(NULL, MODULENAME, "transparent", DEFAULT_TRANPARENT) ? LWA_COLORKEY : 0) | LWA_ALPHA);
InvalidateRect(g_hWnd, nullptr, TRUE);
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
@@ -397,7 +397,7 @@ xxx: ps[1] = ps[0]; //apply current settings at closing
saveDBSettings(ps);
- SetLayeredWindowAttributes(g_hWnd, db_get_dw(NULL, THIS_MODULE, "bkclr", DEFAULT_BKCLR), db_get_b(NULL, THIS_MODULE, "alpha", DEFAULT_ALPHA), (db_get_b(NULL, THIS_MODULE, "transparent", DEFAULT_TRANPARENT) ? LWA_COLORKEY : 0) | LWA_ALPHA);
+ SetLayeredWindowAttributes(g_hWnd, db_get_dw(NULL, MODULENAME, "bkclr", DEFAULT_BKCLR), db_get_b(NULL, MODULENAME, "alpha", DEFAULT_ALPHA), (db_get_b(NULL, MODULENAME, "transparent", DEFAULT_TRANPARENT) ? LWA_COLORKEY : 0) | LWA_ALPHA);
InvalidateRect(g_hWnd, nullptr, TRUE);
break;
}
diff --git a/plugins/wbOSD/src/stdafx.h b/plugins/wbOSD/src/stdafx.h index 9d261f861d..1355f3787d 100644 --- a/plugins/wbOSD/src/stdafx.h +++ b/plugins/wbOSD/src/stdafx.h @@ -26,13 +26,11 @@ Distributed under GNU's GPL 2 or later #include "resource.h"
#include "version.h"
-#define THIS_MODULE "mirandaosd"
+#define MODULENAME "mirandaosd"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(THIS_MODULE)
- {}
+ CMPlugin();
};
// Settings defaults
diff --git a/plugins/wbOSD/src/wbOSD.cpp b/plugins/wbOSD/src/wbOSD.cpp index 7b227db5cb..4be73bf5f1 100644 --- a/plugins/wbOSD/src/wbOSD.cpp +++ b/plugins/wbOSD/src/wbOSD.cpp @@ -163,10 +163,10 @@ LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM ms = (osdmsg*)mir_alloc(sizeof(osdmsg));
ms->text = mir_wstrdup((wchar_t *)wParam);
if (lParam == 0)
- lParam = db_get_dw(NULL, THIS_MODULE, "timeout", DEFAULT_TIMEOUT);
+ lParam = db_get_dw(NULL, MODULENAME, "timeout", DEFAULT_TIMEOUT);
ms->timeout = lParam;
ms->callback = nullptr;
- ms->color = db_get_dw(NULL, THIS_MODULE, "clr_msg", DEFAULT_CLRMSG);
+ ms->color = db_get_dw(NULL, MODULENAME, "clr_msg", DEFAULT_CLRMSG);
ms->param = 0;
SendMessage(hwnd, WM_USER + 4, (WPARAM)ms, 0);
mir_free(ms->text);
@@ -278,15 +278,15 @@ int MainInit(WPARAM, LPARAM) g_hWnd = CreateWindowEx(WS_EX_LAYERED | WS_EX_TOOLWINDOW, szClassName, L"WannaBeOSD",
WS_POPUP,
- db_get_dw(NULL, THIS_MODULE, "winxpos", DEFAULT_WINXPOS),
- db_get_dw(NULL, THIS_MODULE, "winypos", DEFAULT_WINYPOS),
- db_get_dw(NULL, THIS_MODULE, "winx", DEFAULT_WINX),
- db_get_dw(NULL, THIS_MODULE, "winy", DEFAULT_WINY),
+ db_get_dw(NULL, MODULENAME, "winxpos", DEFAULT_WINXPOS),
+ db_get_dw(NULL, MODULENAME, "winypos", DEFAULT_WINYPOS),
+ db_get_dw(NULL, MODULENAME, "winx", DEFAULT_WINX),
+ db_get_dw(NULL, MODULENAME, "winy", DEFAULT_WINY),
HWND_DESKTOP, nullptr, g_plugin.getInst(), nullptr);
SetWindowLongPtr(g_hWnd, GWLP_USERDATA, 0);
- SetLayeredWindowAttributes(g_hWnd, db_get_dw(NULL, THIS_MODULE, "bkclr", DEFAULT_BKCLR), db_get_b(NULL, THIS_MODULE, "alpha", DEFAULT_ALPHA), (db_get_b(NULL, THIS_MODULE, "transparent", DEFAULT_TRANPARENT) ? LWA_COLORKEY : 0) | LWA_ALPHA);
+ SetLayeredWindowAttributes(g_hWnd, db_get_dw(NULL, MODULENAME, "bkclr", DEFAULT_BKCLR), db_get_b(NULL, MODULENAME, "alpha", DEFAULT_ALPHA), (db_get_b(NULL, MODULENAME, "transparent", DEFAULT_TRANPARENT) ? LWA_COLORKEY : 0) | LWA_ALPHA);
CreateServiceFunction("OSD/Announce", OSDAnnounce);
|