summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-09-03 18:25:42 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-09-03 18:25:42 +0300
commitc0274fa5abfcfb59a4c8ae4d113d705ea0272c4c (patch)
treed8eda62b1e94d67f84a121295a3cb8f68b01849e /protocols
parent4db67c1a255bf379e63641eff1f3527ea6aa2759 (diff)
popup code cleaning
Diffstat (limited to 'protocols')
-rw-r--r--protocols/FacebookRM/src/json.cpp4
-rw-r--r--protocols/FacebookRM/src/proto.cpp22
-rw-r--r--protocols/Gadu-Gadu/src/popups.cpp4
-rwxr-xr-xprotocols/JabberG/src/jabber_misc.cpp4
-rw-r--r--protocols/MSN/src/msn_misc.cpp4
-rw-r--r--protocols/Sametime/src/utils.cpp4
-rw-r--r--protocols/SkypeWeb/src/skype_popups.cpp11
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp17
8 files changed, 28 insertions, 42 deletions
diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp
index 51112635f5..0b4db5be8c 100644
--- a/protocols/FacebookRM/src/json.cpp
+++ b/protocols/FacebookRM/src/json.cpp
@@ -546,10 +546,10 @@ const char* FacebookProto::ParseIcon(const std::string &url)
mir_snprintf(name, "%s_%s%d", m_szModuleName, "Reaction", idx);
POPUPCLASS ppc = { sizeof(ppc) };
- ppc.flags = PCF_TCHAR;
+ ppc.flags = PCF_UNICODE;
ppc.PluginWindowProc = PopupDlgProc;
ppc.lParam = APF_RETURN_HWND;
- ppc.pwszDescription = desc;
+ ppc.pszDescription.w = desc;
ppc.pszName = name;
ppc.hIcon = hIcon;
ppc.colorBack = RGB(59, 89, 152); // Facebook's blue
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index 0f975b148a..dd24b8af02 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -914,19 +914,19 @@ LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
*/
void FacebookProto::InitPopups()
{
+ char name[256];
+ wchar_t desc[256];
+
POPUPCLASS ppc = { sizeof(ppc) };
- ppc.flags = PCF_TCHAR;
+ ppc.flags = PCF_UNICODE;
ppc.PluginWindowProc = PopupDlgProc;
ppc.lParam = APF_RETURN_HWND;
-
- wchar_t desc[256];
- char name[256];
+ ppc.pszName = name;
+ ppc.pszDescription.w = desc;
// Client
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Client errors"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Client");
- ppc.pwszDescription = desc;
- ppc.pszName = name;
ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("facebook"));
ppc.colorBack = RGB(191, 0, 0); // red
ppc.colorText = RGB(255, 255, 255); // white
@@ -936,7 +936,6 @@ void FacebookProto::InitPopups()
// Newsfeeds
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Wall posts"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Newsfeed");
- ppc.pwszDescription = desc;
ppc.pszName = name;
ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("newsfeed"));
ppc.colorBack = RGB(255, 255, 255); // white
@@ -947,7 +946,6 @@ void FacebookProto::InitPopups()
// Notifications
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Notifications"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Notification");
- ppc.pwszDescription = desc;
ppc.pszName = name;
ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("notification"));
ppc.colorBack = RGB(59, 89, 152); // Facebook's blue
@@ -958,8 +956,6 @@ void FacebookProto::InitPopups()
// Others
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Other events"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Other");
- ppc.pwszDescription = desc;
- ppc.pszName = name;
ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("facebook"));
ppc.colorBack = RGB(255, 255, 255); // white
ppc.colorText = RGB(0, 0, 0); // black
@@ -969,8 +965,6 @@ void FacebookProto::InitPopups()
// Friendship changes
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Friendship events"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Friendship");
- ppc.pwszDescription = desc;
- ppc.pszName = name;
ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("friendship"));
ppc.colorBack = RGB(47, 71, 122); // Facebook's darker blue
ppc.colorText = RGB(255, 255, 255); // white
@@ -980,8 +974,6 @@ void FacebookProto::InitPopups()
// Ticker
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Real-time friends activity"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Ticker");
- ppc.pwszDescription = desc;
- ppc.pszName = name;
ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("newsfeed"));
ppc.colorBack = RGB(255, 255, 255); // white
ppc.colorText = RGB(0, 0, 0); // black
@@ -991,8 +983,6 @@ void FacebookProto::InitPopups()
// On this day (memories)
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Memories"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Memories");
- ppc.pwszDescription = desc;
- ppc.pszName = name;
ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("memories"));
ppc.colorBack = RGB(255, 255, 255); // white
ppc.colorText = RGB(0, 0, 0); // black
diff --git a/protocols/Gadu-Gadu/src/popups.cpp b/protocols/Gadu-Gadu/src/popups.cpp
index d6cae63309..ecce63ae83 100644
--- a/protocols/Gadu-Gadu/src/popups.cpp
+++ b/protocols/Gadu-Gadu/src/popups.cpp
@@ -78,9 +78,9 @@ void GaduProto::initpopups()
POPUPCLASS puc = { 0 };
puc.cbSize = sizeof(puc);
puc.PluginWindowProc = PopupWindowProc;
- puc.flags = PCF_TCHAR;
- puc.pwszDescription = szDescr;
+ puc.flags = PCF_UNICODE;
puc.pszName = szName;
+ puc.pszDescription.w = szDescr;
puc.colorBack = RGB(173, 206, 247);
puc.colorText = GetSysColor(COLOR_WINDOWTEXT);
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index 854d66b78a..eba91277ee 100755
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -411,9 +411,9 @@ void CJabberProto::InitPopups(void)
mir_snprintf(name, "%s_%s", m_szModuleName, "Error");
POPUPCLASS ppc = { sizeof(ppc) };
- ppc.flags = PCF_TCHAR;
- ppc.pwszDescription = desc;
+ ppc.flags = PCF_UNICODE;
ppc.pszName = name;
+ ppc.pszDescription.w = desc;
ppc.hIcon = LoadIconEx("main");
ppc.colorBack = RGB(191, 0, 0); //Red
ppc.colorText = RGB(255, 245, 225); //Yellow
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp
index 1f343115d0..9f95bb34f8 100644
--- a/protocols/MSN/src/msn_misc.cpp
+++ b/protocols/MSN/src/msn_misc.cpp
@@ -795,11 +795,11 @@ void CMsnProto::InitPopups(void)
char name[256];
POPUPCLASS ppc = { sizeof(ppc) };
- ppc.flags = PCF_TCHAR;
+ ppc.flags = PCF_UNICODE;
ppc.PluginWindowProc = NullWindowProc;
ppc.hIcon = LoadIconEx("main");
- ppc.pwszDescription = desc;
ppc.pszName = name;
+ ppc.pszDescription.w = desc;
ppc.colorBack = RGB(173, 206, 247);
ppc.colorText = GetSysColor(COLOR_WINDOWTEXT);
diff --git a/protocols/Sametime/src/utils.cpp b/protocols/Sametime/src/utils.cpp
index 2d942c4b7c..b83b46ea68 100644
--- a/protocols/Sametime/src/utils.cpp
+++ b/protocols/Sametime/src/utils.cpp
@@ -36,9 +36,9 @@ void CSametimeProto::RegisterPopups()
POPUPCLASS puc = { sizeof(puc) };
puc.PluginWindowProc = PopupWindowProc;
- puc.flags = PCF_TCHAR;
- puc.pwszDescription = szDescr;
+ puc.flags = PCF_UNICODE;
puc.pszName = szName;
+ puc.pszDescription.w = szDescr;
mir_snprintf(szName, "%s_%s", m_szModuleName, "Notify");
mir_snwprintf(szDescr, L"%s/%s", m_tszUserName, TranslateT("Notifications"));
diff --git a/protocols/SkypeWeb/src/skype_popups.cpp b/protocols/SkypeWeb/src/skype_popups.cpp
index 64fd9b5228..06aac781c4 100644
--- a/protocols/SkypeWeb/src/skype_popups.cpp
+++ b/protocols/SkypeWeb/src/skype_popups.cpp
@@ -4,13 +4,14 @@ void CSkypeProto::InitPopups()
{
wchar_t desc[256];
char name[256];
+
POPUPCLASS ppc = { sizeof(ppc) };
- ppc.flags = PCF_TCHAR;
+ ppc.flags = PCF_UNICODE;
+ ppc.pszName = name;
+ ppc.pszDescription.w = desc;
mir_snwprintf(desc, L"%s %s", m_tszUserName, TranslateT("Notifications"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Notification");
- ppc.pwszDescription = desc;
- ppc.pszName = name;
ppc.hIcon = GetIcon(IDI_NOTIFY);
ppc.colorBack = RGB(255, 255, 255);
ppc.colorText = RGB(0, 0, 0);
@@ -19,8 +20,6 @@ void CSkypeProto::InitPopups()
mir_snwprintf(desc, L"%s %s", m_tszUserName, TranslateT("Errors"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Error");
- ppc.pwszDescription = desc;
- ppc.pszName = name;
ppc.hIcon = GetIcon(IDI_ERRORICON);
ppc.colorBack = RGB(255, 255, 255);
ppc.colorText = RGB(0, 0, 0);
@@ -29,8 +28,6 @@ void CSkypeProto::InitPopups()
mir_snwprintf(desc, L"%s %s", m_tszUserName, TranslateT("Calls"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Call");
- ppc.pwszDescription = desc;
- ppc.pszName = name;
ppc.hIcon = GetIcon(IDI_CALL);
ppc.colorBack = RGB(255, 255, 255);
ppc.colorText = RGB(0, 0, 0);
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp
index 4c73f8323b..c8ec72fd91 100644
--- a/protocols/VKontakte/src/vk_proto.cpp
+++ b/protocols/VKontakte/src/vk_proto.cpp
@@ -409,28 +409,27 @@ void CVkProto::InitPopups(void)
{
wchar_t desc[256];
char name[256];
+
POPUPCLASS ppc = { sizeof(ppc) };
- ppc.flags = PCF_TCHAR;
+ ppc.flags = PCF_UNICODE;
+ ppc.pszName = name;
+ ppc.pszDescription.w = desc;
ppc.PluginWindowProc = PopupDlgProc;
ppc.lParam = APF_RETURN_HWND;
mir_snwprintf(desc, L"%s %s", m_tszUserName, TranslateT("Errors"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Error");
- ppc.pwszDescription = desc;
- ppc.pszName = name;
ppc.hIcon = Skin_LoadIcon(SKINICON_ERROR);
- ppc.colorBack = RGB(191, 0, 0); //Red
- ppc.colorText = RGB(255, 245, 225); //Yellow
+ ppc.colorBack = RGB(191, 0, 0); // Red
+ ppc.colorText = RGB(255, 245, 225); // Yellow
ppc.iSeconds = 60;
m_hPopupClassError = Popup_RegisterClass(&ppc);
mir_snwprintf(desc, L"%s %s", m_tszUserName, TranslateT("Notifications"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Notification");
- ppc.pwszDescription = desc;
- ppc.pszName = name;
ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION));
- ppc.colorBack = RGB(190, 225, 255); //Blue
- ppc.colorText = RGB(255, 255, 255); //White
+ ppc.colorBack = RGB(190, 225, 255); // Blue
+ ppc.colorText = RGB(255, 255, 255); // White
ppc.iSeconds = 4;
m_hPopupClassNotification = Popup_RegisterClass(&ppc);
}