diff options
Diffstat (limited to 'plugins/YAPP/src')
-rw-r--r-- | plugins/YAPP/src/icons.h | 8 | ||||
-rw-r--r-- | plugins/YAPP/src/options.cpp | 100 | ||||
-rw-r--r-- | plugins/YAPP/src/popwin.h | 2 | ||||
-rw-r--r-- | plugins/YAPP/src/services.cpp | 8 | ||||
-rw-r--r-- | plugins/YAPP/src/stdafx.h | 6 | ||||
-rw-r--r-- | plugins/YAPP/src/yapp.cpp | 24 |
6 files changed, 75 insertions, 73 deletions
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();
|