diff options
author | George Hazan <ghazan@miranda.im> | 2018-07-25 23:10:36 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-07-25 23:10:36 +0300 |
commit | a411a7391bb879db8da398f067245a13c7fa7aee (patch) | |
tree | 4b2c76ca8bc0b43b1084b8234746810c3ef6c446 /plugins/Popup/src | |
parent | 942c498d6e8901f751b088c0adfcb8f3fc67576c (diff) |
major code cleaning of all font-related structures
Diffstat (limited to 'plugins/Popup/src')
-rw-r--r-- | plugins/Popup/src/font.cpp | 16 | ||||
-rw-r--r-- | plugins/Popup/src/notifications.cpp | 8 | ||||
-rw-r--r-- | plugins/Popup/src/services.cpp | 10 |
3 files changed, 14 insertions, 20 deletions
diff --git a/plugins/Popup/src/font.cpp b/plugins/Popup/src/font.cpp index 6570315168..b274615963 100644 --- a/plugins/Popup/src/font.cpp +++ b/plugins/Popup/src/font.cpp @@ -28,8 +28,7 @@ PopupFonts fonts = {}; void InitFonts()
{
// Fonts
- FontIDW fid = { 0 };
- fid.cbSize = sizeof(FontIDW);
+ FontIDW fid = {};
mir_wstrncpy(fid.group, _A2W(PU_FNT_AND_COLOR), _countof(fid.group));
mir_strncpy(fid.dbSettingsGroup, PU_FNT_AND_COLOR_DB, _countof(fid.dbSettingsGroup));
fid.flags = FIDF_DEFAULTVALID;
@@ -40,33 +39,32 @@ void InitFonts() mir_wstrncpy(fid.deffontsettings.szFace, L"Tahoma", _countof(fid.deffontsettings.szFace));
mir_wstrncpy(fid.name, _A2W(PU_FNT_NAME_TITLE), _countof(fid.name));
- mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_TITLE);
+ mir_snprintf(fid.setting, PU_FNT_PREFIX, PU_FNT_NAME_TITLE);
fid.deffontsettings.style = DBFONTF_BOLD;
fid.deffontsettings.colour = RGB(0, 0, 0);
g_plugin.addFont(&fid);
mir_wstrncpy(fid.name, _A2W(PU_FNT_NAME_CLOCK), _countof(fid.name));
- mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_CLOCK);
+ mir_snprintf(fid.setting, PU_FNT_PREFIX, PU_FNT_NAME_CLOCK);
g_plugin.addFont(&fid);
mir_wstrncpy(fid.name, _A2W(PU_FNT_NAME_TEXT), _countof(fid.name));
- mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_TEXT);
+ mir_snprintf(fid.setting, PU_FNT_PREFIX, PU_FNT_NAME_TEXT);
fid.deffontsettings.style = 0;
g_plugin.addFont(&fid);
mir_wstrncpy(fid.name, _A2W(PU_FNT_NAME_ACTION), _countof(fid.name));
- mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_ACTION);
+ mir_snprintf(fid.setting, PU_FNT_PREFIX, PU_FNT_NAME_ACTION);
fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS;
fid.deffontsettings.colour = RGB(0, 0, 255);
g_plugin.addFont(&fid);
mir_wstrncpy(fid.name, _A2W(PU_FNT_NAME_HOVERED_ACTION), _countof(fid.name));
- mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_HOVERED_ACTION);
+ mir_snprintf(fid.setting, PU_FNT_PREFIX, PU_FNT_NAME_HOVERED_ACTION);
fid.deffontsettings.style = DBFONTF_UNDERLINE;
g_plugin.addFont(&fid);
- ColourIDW cid = { 0 };
- cid.cbSize = sizeof(ColourIDW);
+ ColourIDW cid = {};
mir_wstrncpy(cid.group, _A2W(PU_FNT_AND_COLOR), _countof(cid.group));
mir_strncpy(cid.dbSettingsGroup, PU_FNT_AND_COLOR_DB, _countof(cid.dbSettingsGroup));
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp index 1e2d97e7bc..fdd18a93cc 100644 --- a/plugins/Popup/src/notifications.cpp +++ b/plugins/Popup/src/notifications.cpp @@ -183,8 +183,7 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification) // ugly hack to make reset always possible
SaveNotificationSettings(ptd, "PopupNotifications");
- FontID fontid = { 0 };
- fontid.cbSize = sizeof(fontid);
+ FontID fontid = {};
mir_snprintf(fontid.group, PU_FNT_AND_COLOR "/%s", notification->lpzGroup);
mir_strcpy(fontid.dbSettingsGroup, "PopupNotifications");
fontid.flags = FIDF_DEFAULTVALID;
@@ -194,12 +193,11 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification) mir_strncpy(fontid.deffontsettings.szFace, "MS Shell Dlg", _countof(fontid.deffontsettings.szFace));
fontid.deffontsettings.style = 0;
mir_snprintf(fontid.name, "%s (colors only)", notification->lpzName);
- mir_snprintf(fontid.prefix, "{%s/%s}text", notification->lpzGroup, notification->lpzName);
+ mir_snprintf(fontid.setting, "{%s/%s}text", notification->lpzGroup, notification->lpzName);
fontid.deffontsettings.style = 0;
g_plugin.addFont(&fontid);
- ColourID colourid = { 0 };
- colourid.cbSize = sizeof(colourid);
+ ColourID colourid = {};
mir_snprintf(colourid.group, PU_FNT_AND_COLOR"/%s", notification->lpzGroup);
mir_strcpy(colourid.dbSettingsGroup, "PopupNotifications");
mir_snprintf(colourid.name, "%s (colors only)", notification->lpzName);
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp index 960762e556..77ab39de01 100644 --- a/plugins/Popup/src/services.cpp +++ b/plugins/Popup/src/services.cpp @@ -381,8 +381,7 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) mir_snprintf(setting, "%s/TextCol", ptd->pupClass.pszName);
ptd->pupClass.colorText = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, fonts.clText/*pc->colorText*/);
- FontIDW fid = { 0 };
- fid.cbSize = sizeof(FontIDW);
+ FontIDW fid = {};
mir_snwprintf(fid.group, L"%S/%s", PU_FNT_AND_COLOR, ptd->pszDescription);
strncpy_s(fid.dbSettingsGroup, PU_MODULCLASS, _TRUNCATE);
fid.flags = FIDF_DEFAULTVALID;
@@ -390,8 +389,8 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) fid.deffontsettings.size = -11;
wcsncpy_s(fid.deffontsettings.szFace, L"Verdana", _TRUNCATE);
wcsncpy_s(fid.name, _A2W(PU_FNT_NAME_TEXT), _TRUNCATE);
- strncpy_s(fid.prefix, setting, _TRUNCATE);
- mir_snprintf(fid.prefix, "%s/Text", ptd->pupClass.pszName); // result is "%s/TextCol"
+ strncpy_s(fid.setting, setting, _TRUNCATE);
+ mir_snprintf(fid.setting, "%s/Text", ptd->pupClass.pszName); // result is "%s/TextCol"
fid.deffontsettings.style = 0;
fid.deffontsettings.colour = fonts.clText;
g_plugin.addFont(&fid);
@@ -400,8 +399,7 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) mir_snprintf(setting, "%s/BgCol", ptd->pupClass.pszName);
ptd->pupClass.colorBack = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, (DWORD)fonts.clBack/*pc->colorBack*/);
- ColourIDW cid = { 0 };
- cid.cbSize = sizeof(ColourIDW);
+ ColourIDW cid = {};
mir_snwprintf(cid.group, L"%S/%s", PU_FNT_AND_COLOR, ptd->pszDescription);
wcsncpy_s(cid.name, PU_COL_BACK_NAME, _TRUNCATE);
strncpy_s(cid.dbSettingsGroup, PU_MODULCLASS, _TRUNCATE);
|