diff options
author | George Hazan <ghazan@miranda.im> | 2019-02-27 12:43:20 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-02-27 12:43:20 +0300 |
commit | 423be683866fd8e305457eb725d8cdbe1f297fbd (patch) | |
tree | c49a7bdaf7f08683b9bfae48f0250050b2bf1872 /plugins/TabSRMM | |
parent | 288a07c81370226937d882b7a14fe3b6e3607e9e (diff) |
popup code cleaning (cause we have no tchar.h)
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r-- | plugins/TabSRMM/src/chat_tools.cpp | 8 | ||||
-rw-r--r-- | plugins/TabSRMM/src/eventpopups.cpp | 18 | ||||
-rw-r--r-- | plugins/TabSRMM/src/globals.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgs.cpp | 8 | ||||
-rw-r--r-- | plugins/TabSRMM/src/nen.h | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/sendlater.cpp | 10 | ||||
-rw-r--r-- | plugins/TabSRMM/src/typingnotify.cpp | 26 |
7 files changed, 37 insertions, 37 deletions
diff --git a/plugins/TabSRMM/src/chat_tools.cpp b/plugins/TabSRMM/src/chat_tools.cpp index cac75f3c7e..cb22e44284 100644 --- a/plugins/TabSRMM/src/chat_tools.cpp +++ b/plugins/TabSRMM/src/chat_tools.cpp @@ -86,7 +86,7 @@ BOOL DoTrayIcon(SESSION_INFO *si, GCEVENT *gce) int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, wchar_t*, COLORREF crBkg, const wchar_t* fmt, ...)
{
- POPUPDATAT pd = { 0 };
+ POPUPDATAW pd = { 0 };
va_list marker;
static wchar_t szBuf[4 * 1024];
@@ -105,8 +105,8 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa pd.lchIcon = LoadIconEx("window");
PROTOACCOUNT *pa = Proto_GetAccount(pszProtoName);
- mir_snwprintf(pd.lptzContactName, L"%s - %s", (pa == nullptr) ? _A2T(pszProtoName) : pa->tszAccountName, Clist_GetContactDisplayName(hContact));
- wcsncpy_s(pd.lptzText, TranslateW(szBuf), _TRUNCATE);
+ mir_snwprintf(pd.lpwzContactName, L"%s - %s", (pa == nullptr) ? _A2T(pszProtoName) : pa->tszAccountName, Clist_GetContactDisplayName(hContact));
+ wcsncpy_s(pd.lpwzText, TranslateW(szBuf), _TRUNCATE);
pd.iSeconds = g_Settings.iPopupTimeout;
if (g_Settings.iPopupStyle == 2) {
@@ -124,7 +124,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa pd.PluginWindowProc = PopupDlgProc;
pd.PluginData = si;
- return PUAddPopupT(&pd);
+ return PUAddPopupW(&pd);
}
BOOL DoPopup(SESSION_INFO *si, GCEVENT *gce)
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index bee5a8cb42..2f380b2169 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -369,7 +369,7 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent) if (dbe.pBlob)
mir_free(dbe.pBlob);
- PUChangeTextT(pdata->hWnd, lpzText);
+ PUChangeTextW(pdata->hWnd, lpzText);
return 0;
}
@@ -393,7 +393,7 @@ static int PopupShowT(NEN_OPTIONS *pluginOptions, MCONTACT hContact, MEVENT hEve if (hEvent == 0 && hContact == 0)
dbe.szModule = Translate("Unknown module or contact");
- POPUPDATAT pud = { 0 };
+ POPUPDATAW pud = { 0 };
long iSeconds;
switch (eventType) {
case EVENTTYPE_MESSAGE:
@@ -426,27 +426,27 @@ static int PopupShowT(NEN_OPTIONS *pluginOptions, MCONTACT hContact, MEVENT hEve pud.PluginData = pdata;
if (hContact)
- wcsncpy_s(pud.lptzContactName, Clist_GetContactDisplayName(hContact), _TRUNCATE);
+ wcsncpy_s(pud.lpwzContactName, Clist_GetContactDisplayName(hContact), _TRUNCATE);
else
- wcsncpy_s(pud.lptzContactName, _A2T(dbe.szModule), _TRUNCATE);
+ wcsncpy_s(pud.lpwzContactName, _A2T(dbe.szModule), _TRUNCATE);
wchar_t *szPreview = GetPreviewT((WORD)eventType, &dbe);
if (szPreview) {
- wcsncpy_s(pud.lptzText, szPreview, _TRUNCATE);
+ wcsncpy_s(pud.lpwzText, szPreview, _TRUNCATE);
mir_free(szPreview);
}
- else wcsncpy(pud.lptzText, L" ", MAX_SECONDLINE);
+ else wcsncpy(pud.lpwzText, L" ", MAX_SECONDLINE);
pdata->eventData = (EVENT_DATAT *)mir_alloc(NR_MERGED * sizeof(EVENT_DATAT));
pdata->eventData[0].hEvent = hEvent;
pdata->eventData[0].timestamp = dbe.timestamp;
- wcsncpy(pdata->eventData[0].tszText, pud.lptzText, MAX_SECONDLINE);
+ wcsncpy(pdata->eventData[0].tszText, pud.lpwzText, MAX_SECONDLINE);
pdata->eventData[0].tszText[MAX_SECONDLINE - 1] = 0;
pdata->nrEventsAlloced = NR_MERGED;
pdata->nrMerged = 1;
// fix for broken popups -- process failures
- if (PUAddPopupT(&pud) < 0) {
+ if (PUAddPopupW(&pud) < 0) {
mir_free(pdata->eventData);
mir_free(pdata);
}
@@ -647,7 +647,7 @@ static INT_PTR CALLBACK DlgProcPopupOpts(HWND hWnd, UINT msg, WPARAM wParam, LPA void Popup_Options(WPARAM wParam)
{
- if (!ServiceExists(MS_POPUP_ADDPOPUPT))
+ if (!ServiceExists(MS_POPUP_ADDPOPUPW))
return;
OPTIONSDIALOGPAGE odp = {};
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index f7fd797a41..9c4d3b2fe1 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -113,7 +113,7 @@ void CGlobals::reloadSystemModulesChanged() m_hwndClist = g_clistApi.hwndContactList;
- g_bPopupAvail = ServiceExists(MS_POPUP_ADDPOPUPT) != 0;
+ g_bPopupAvail = ServiceExists(MS_POPUP_ADDPOPUPW) != 0;
CMenuItem mi(&g_plugin);
SET_UID(mi, 0x58d8dc1, 0x1c25, 0x49c0, 0xb8, 0x7c, 0xa3, 0x22, 0x2b, 0x3d, 0xf1, 0xd8);
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index c501af13f9..694f823531 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -251,10 +251,10 @@ void CTabBaseDlg::NotifyDeliveryFailure() const if (CallService(MS_POPUP_QUERY, PUQS_GETSTATUS, 0) != 1)
return;
- POPUPDATAT ppd = { 0 };
+ POPUPDATAW ppd = { 0 };
ppd.lchContact = m_hContact;
- wcsncpy_s(ppd.lptzContactName, m_cache->getNick(), _TRUNCATE);
- wcsncpy_s(ppd.lptzText, TranslateT("A message delivery has failed.\nClick to open the message window."), _TRUNCATE);
+ wcsncpy_s(ppd.lpwzContactName, m_cache->getNick(), _TRUNCATE);
+ wcsncpy_s(ppd.lpwzText, TranslateT("A message delivery has failed.\nClick to open the message window."), _TRUNCATE);
if (!(BOOL)db_get_b(0, MODULE, OPT_COLDEFAULT_ERR, TRUE)) {
ppd.colorText = (COLORREF)db_get_dw(0, MODULE, OPT_COLTEXT_ERR, DEFAULT_COLTEXT);
@@ -266,7 +266,7 @@ void CTabBaseDlg::NotifyDeliveryFailure() const ppd.lchIcon = PluginConfig.g_iconErr;
ppd.PluginData = nullptr;
ppd.iSeconds = (int)db_get_dw(0, MODULE, OPT_DELAY_ERR, (DWORD)DEFAULT_DELAY);
- PUAddPopupT(&ppd);
+ PUAddPopupW(&ppd);
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/TabSRMM/src/nen.h b/plugins/TabSRMM/src/nen.h index aa8c70d568..c502738d99 100644 --- a/plugins/TabSRMM/src/nen.h +++ b/plugins/TabSRMM/src/nen.h @@ -142,7 +142,7 @@ struct PLUGIN_DATAT MCONTACT hContact;
UINT eventType;
NEN_OPTIONS *pluginOptions;
- POPUPDATAT *pud;
+ POPUPDATAW *pud;
HWND hWnd;
long iSeconds;
int nrMerged;
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index 1ea1e7b940..8212a9f840 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -118,17 +118,17 @@ CSendLaterJob::~CSendLaterJob() if (PluginConfig.g_bPopupAvail && fShowPopup) {
wchar_t *tszName = Clist_GetContactDisplayName(hContact);
- POPUPDATAT ppd = { 0 };
+ POPUPDATAW ppd = { 0 };
ppd.lchContact = hContact;
- wcsncpy_s(ppd.lptzContactName, (tszName ? tszName : TranslateT("'(Unknown contact)'")), _TRUNCATE);
+ wcsncpy_s(ppd.lpwzContactName, (tszName ? tszName : TranslateT("'(Unknown contact)'")), _TRUNCATE);
wchar_t *msgPreview = Utils::GetPreviewWithEllipsis(reinterpret_cast<wchar_t *>(&pBuf[mir_strlen((char *)pBuf) + 1]), 100);
if (fSuccess) {
- mir_snwprintf(ppd.lptzText, TranslateT("A send later job completed successfully.\nThe original message: %s"),
+ mir_snwprintf(ppd.lpwzText, TranslateT("A send later job completed successfully.\nThe original message: %s"),
msgPreview);
mir_free(msgPreview);
}
else if (fFailed) {
- mir_snwprintf(ppd.lptzText, TranslateT("A send later job failed to complete.\nThe original message: %s"),
+ mir_snwprintf(ppd.lpwzText, TranslateT("A send later job failed to complete.\nThe original message: %s"),
msgPreview);
mir_free(msgPreview);
}
@@ -141,7 +141,7 @@ CSendLaterJob::~CSendLaterJob() ppd.lchIcon = fFailed ? PluginConfig.g_iconErr : PluginConfig.g_IconMsgEvent;
ppd.PluginData = nullptr;
ppd.iSeconds = fFailed ? -1 : nen_options.iDelayMsg;
- PUAddPopupT(&ppd);
+ PUAddPopupW(&ppd);
}
}
if (fFailed && (bCode == JOB_AGE || bCode == JOB_REMOVABLE) && szId[0] == 'S')
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp index 335e9e8816..e4a59d5327 100644 --- a/plugins/TabSRMM/src/typingnotify.cpp +++ b/plugins/TabSRMM/src/typingnotify.cpp @@ -99,22 +99,22 @@ void TN_TypingMessage(MCONTACT hContact, int iMode) }
int notyping;
- POPUPDATAT_V2 ppd = { 0 };
+ POPUPDATAW_V2 ppd = { 0 };
ppd.cbSize = sizeof(ppd);
if (iMode == PROTOTYPE_CONTACTTYPING_OFF) {
if (StopDisabled)
return;
- wcsncpy_s(ppd.lptzContactName, szContactName, _TRUNCATE);
- wcsncpy_s(ppd.lptzText, szStop, _TRUNCATE);
+ wcsncpy_s(ppd.lpwzContactName, szContactName, _TRUNCATE);
+ wcsncpy_s(ppd.lpwzText, szStop, _TRUNCATE);
ppd.hNotification = hntfStopped;
notyping = 1;
}
else {
if (StartDisabled)
return;
- wcsncpy_s(ppd.lptzContactName, szContactName, _TRUNCATE);
- wcsncpy_s(ppd.lptzText, szStart, _TRUNCATE);
+ wcsncpy_s(ppd.lpwzContactName, szContactName, _TRUNCATE);
+ wcsncpy_s(ppd.lpwzText, szStart, _TRUNCATE);
ppd.hNotification = hntfStarted;
notyping = 0;
}
@@ -167,7 +167,7 @@ void TN_TypingMessage(MCONTACT hContact, int iMode) ppd.lchIcon = PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING];
ppd.lchContact = hContact;
ppd.PluginWindowProc = PopupDlgProc;
- CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, APF_NEWDATA);
+ CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&ppd, APF_NEWDATA);
}
static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -292,17 +292,17 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_PREVIEW:
if (PluginConfig.g_bPopupAvail) {
- POPUPDATAT ppd = { 0 };
+ POPUPDATAW ppd = { 0 };
for (int i = 0; i < 2; i++) {
int notyping;
if (i == PROTOTYPE_CONTACTTYPING_OFF) {
- wcsncpy_s(ppd.lptzContactName, TranslateT("Contact"), _TRUNCATE);
- wcsncpy_s(ppd.lptzText, szStop, _TRUNCATE);
+ wcsncpy_s(ppd.lpwzContactName, TranslateT("Contact"), _TRUNCATE);
+ wcsncpy_s(ppd.lpwzText, szStop, _TRUNCATE);
notyping = 1;
}
else {
- wcsncpy_s(ppd.lptzContactName, TranslateT("Contact"), _TRUNCATE);
- wcsncpy_s(ppd.lptzText, szStart, _TRUNCATE);
+ wcsncpy_s(ppd.lpwzContactName, TranslateT("Contact"), _TRUNCATE);
+ wcsncpy_s(ppd.lpwzText, szStart, _TRUNCATE);
notyping = 0;
}
@@ -355,7 +355,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ppd.lchContact = wParam;
ppd.PluginWindowProc = nullptr;
ppd.PluginData = nullptr;
- PUAddPopupT(&ppd);
+ PUAddPopupW(&ppd);
}
}
break;
@@ -489,7 +489,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA int TN_OptionsInitialize(WPARAM wParam, LPARAM)
{
- if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
+ if (ServiceExists(MS_POPUP_ADDPOPUPW)) {
OPTIONSDIALOGPAGE odp = {};
odp.position = 100000000;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TYPINGNOTIFYPOPUP);
|