summaryrefslogtreecommitdiff
path: root/plugins/Clist_nicer/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-27 14:23:31 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-27 14:23:31 +0000
commit2f261839b60692e33d0e160344d0d636d49c90ba (patch)
tree187921722698b681d29df3f6e60fb18394a5e9d5 /plugins/Clist_nicer/src
parent2e931a0b2780587d85f3902468c935f5adba70c8 (diff)
less TCHARs
git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_nicer/src')
-rw-r--r--plugins/Clist_nicer/src/CLCButton.cpp2
-rw-r--r--plugins/Clist_nicer/src/clc.cpp4
-rw-r--r--plugins/Clist_nicer/src/clcitems.cpp22
-rw-r--r--plugins/Clist_nicer/src/clcpaint.cpp16
-rw-r--r--plugins/Clist_nicer/src/clcutils.cpp18
-rw-r--r--plugins/Clist_nicer/src/clistevents.cpp2
-rw-r--r--plugins/Clist_nicer/src/clistmenus.cpp2
-rw-r--r--plugins/Clist_nicer/src/clui.cpp20
-rw-r--r--plugins/Clist_nicer/src/cluiframes.cpp30
-rw-r--r--plugins/Clist_nicer/src/cluiopts.cpp2
-rw-r--r--plugins/Clist_nicer/src/cluiservices.cpp10
-rw-r--r--plugins/Clist_nicer/src/config.cpp12
-rw-r--r--plugins/Clist_nicer/src/extBackg.cpp2
-rw-r--r--plugins/Clist_nicer/src/statusbar.cpp2
-rw-r--r--plugins/Clist_nicer/src/viewmodes.cpp8
15 files changed, 76 insertions, 76 deletions
diff --git a/plugins/Clist_nicer/src/CLCButton.cpp b/plugins/Clist_nicer/src/CLCButton.cpp
index fef024d3b1..42ce47c46c 100644
--- a/plugins/Clist_nicer/src/CLCButton.cpp
+++ b/plugins/Clist_nicer/src/CLCButton.cpp
@@ -326,7 +326,7 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint)
ctl->sLabel.cx = ctl->sLabel.cy = 0;
}
else {
- GetTextExtentPoint32(hdcMem, ctl->szText, (int)mir_tstrlen(ctl->szText), &ctl->sLabel);
+ GetTextExtentPoint32(hdcMem, ctl->szText, (int)mir_wstrlen(ctl->szText), &ctl->sLabel);
if (g_cxsmIcon + ctl->sLabel.cx + 8 > rcClient.right - rcClient.left)
ctl->sLabel.cx = (rcClient.right - rcClient.left) - g_cxsmIcon - 8;
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp
index cc7ec10771..7d25e6faf0 100644
--- a/plugins/Clist_nicer/src/clc.cpp
+++ b/plugins/Clist_nicer/src/clc.cpp
@@ -404,7 +404,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
case INTM_NAMECHANGED:
if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL))
break;
- mir_tstrncpy(contact->szText, pcli->pfnGetContactDisplayName(wParam, 0), _countof(contact->szText));
+ mir_wstrncpy(contact->szText, pcli->pfnGetContactDisplayName(wParam, 0), _countof(contact->szText));
RTL_DetectAndSet(contact, 0);
@@ -490,7 +490,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
contact->proto = GetContactProto(wParam);
pcli->pfnInvalidateDisplayNameCacheEntry(wParam);
- mir_tstrncpy(contact->szText, pcli->pfnGetContactDisplayName(wParam, 0), _countof(contact->szText));
+ mir_wstrncpy(contact->szText, pcli->pfnGetContactDisplayName(wParam, 0), _countof(contact->szText));
RTL_DetectAndSet(contact, 0);
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp
index d46f474e20..4aeb70399c 100644
--- a/plugins/Clist_nicer/src/clcitems.cpp
+++ b/plugins/Clist_nicer/src/clcitems.cpp
@@ -164,7 +164,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto)
DBVARIANT dbv = { 0 };
INT_PTR result = db_get_ts(hContact, "CList", "StatusMsg", &dbv);
- if (!result && mir_tstrlen(dbv.ptszVal) > 0)
+ if (!result && mir_wstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_CLIST;
else {
if (!szProto)
@@ -172,11 +172,11 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto)
if (szProto) {
if (!result)
db_free(&dbv);
- if (!(result = db_get_ts(hContact, szProto, "YMsg", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0)
+ if (!(result = db_get_ts(hContact, szProto, "YMsg", &dbv)) && mir_wstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_YIM;
- else if (!(result = db_get_ts(hContact, szProto, "StatusDescr", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0)
+ else if (!(result = db_get_ts(hContact, szProto, "StatusDescr", &dbv)) && mir_wstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_GG;
- else if (!(result = db_get_ts(hContact, szProto, "XStatusMsg", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0)
+ else if (!(result = db_get_ts(hContact, szProto, "XStatusMsg", &dbv)) && mir_wstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_XSTATUS;
}
}
@@ -185,8 +185,8 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto)
if (!result)
db_free(&dbv);
result = db_get_ts(hContact, szProto, "XStatusName", &dbv);
- if (!result && mir_tstrlen(dbv.ptszVal) > 1) {
- size_t iLen = mir_tstrlen(dbv.ptszVal);
+ if (!result && mir_wstrlen(dbv.ptszVal) > 1) {
+ size_t iLen = mir_wstrlen(dbv.ptszVal);
p->bStatusMsgValid = STATUSMSG_XSTATUSNAME;
p->statusMsg = (wchar_t *)realloc(p->statusMsg, (iLen + 2) * sizeof(wchar_t));
wcsncpy(p->statusMsg, dbv.ptszVal, iLen + 1);
@@ -205,8 +205,8 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto)
cst.ptszName = xStatusName;
if (!CallProtoService(szProto, PS_GETCUSTOMSTATUSEX, hContact, (LPARAM)&cst)) {
wchar_t *szwXstatusName = TranslateTS(xStatusName);
- p->statusMsg = (wchar_t *)realloc(p->statusMsg, (mir_tstrlen(szwXstatusName) + 2) * sizeof(wchar_t));
- wcsncpy(p->statusMsg, szwXstatusName, mir_tstrlen(szwXstatusName) + 1);
+ p->statusMsg = (wchar_t *)realloc(p->statusMsg, (mir_wstrlen(szwXstatusName) + 2) * sizeof(wchar_t));
+ wcsncpy(p->statusMsg, szwXstatusName, mir_wstrlen(szwXstatusName) + 1);
p->bStatusMsgValid = STATUSMSG_XSTATUSNAME;
}
}
@@ -215,7 +215,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto)
if (p->bStatusMsgValid > STATUSMSG_XSTATUSNAME) {
int j = 0;
- p->statusMsg = (wchar_t *)realloc(p->statusMsg, (mir_tstrlen(dbv.ptszVal) + 2) * sizeof(wchar_t));
+ p->statusMsg = (wchar_t *)realloc(p->statusMsg, (mir_wstrlen(dbv.ptszVal) + 2) * sizeof(wchar_t));
for (int i = 0; dbv.ptszVal[i]; i++) {
if (dbv.ptszVal[i] == (wchar_t)0x0d)
continue;
@@ -407,10 +407,10 @@ int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, struct ClcData
}
if (cfg::dat.bFilterEffective & CLVM_FILTER_GROUPS) {
- ptrT tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszGroup(db_get_tsa(hContact, "CList", "Group"));
if (tszGroup != NULL) {
wchar_t szGroupMask[256];
- mir_sntprintf(szGroupMask, L"%s|", tszGroup);
+ mir_snwprintf(szGroupMask, L"%s|", tszGroup);
int bHasGroup = wcsstr(cfg::dat.groupFilter, szGroupMask) ? 1 : 0;
filterResult = (cfg::dat.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | bHasGroup) : (filterResult & bHasGroup);
}
diff --git a/plugins/Clist_nicer/src/clcpaint.cpp b/plugins/Clist_nicer/src/clcpaint.cpp
index 76d2aa23ed..e8f3488f7b 100644
--- a/plugins/Clist_nicer/src/clcpaint.cpp
+++ b/plugins/Clist_nicer/src/clcpaint.cpp
@@ -485,7 +485,7 @@ set_bg_l:
}
else if (type == CLCIT_DIVIDER) {
ChangeToFont(hdcMem, dat, FONTID_DIVIDERS, &fontHeight);
- GetTextExtentPoint32(hdcMem, contact->szText, (int)mir_tstrlen(contact->szText), &textSize);
+ GetTextExtentPoint32(hdcMem, contact->szText, (int)mir_wstrlen(contact->szText), &textSize);
}
else if (type == CLCIT_CONTACT && flags & CONTACTF_NOTONLIST)
ChangeToFont(hdcMem, dat, FONTID_NOTONLIST, &fontHeight);
@@ -501,13 +501,13 @@ set_bg_l:
wchar_t *szCounts = NULL;
if (type == CLCIT_GROUP) {
- GetTextExtentPoint32(hdcMem, contact->szText, (int)mir_tstrlen(contact->szText), &textSize);
+ GetTextExtentPoint32(hdcMem, contact->szText, (int)mir_wstrlen(contact->szText), &textSize);
int width = textSize.cx;
szCounts = pcli->pfnGetGroupCountsText(dat, contact);
if (szCounts[0]) {
GetTextExtentPoint32(hdcMem, L" ", 1, &spaceSize);
ChangeToFont(hdcMem, dat, FONTID_GROUPCOUNTS, &fontHeight);
- GetTextExtentPoint32(hdcMem, szCounts, (int)mir_tstrlen(szCounts), &countsSize);
+ GetTextExtentPoint32(hdcMem, szCounts, (int)mir_wstrlen(szCounts), &countsSize);
width += spaceSize.cx + countsSize.cx;
}
}
@@ -969,7 +969,7 @@ bgskipped:
rc2.left = rcContent.left;
rc2.right = rc2.left - dat->rightMargin + ((clRect->right - rc2.left - textSize.cx) >> 1) - 3;
DrawEdge(hdcMem, &rc2, BDR_SUNKENOUTER, BF_RECT);
- TextOut(hdcMem, rc2.right + 3, y + ((rowHeight - fontHeight) >> 1), contact->szText, (int)mir_tstrlen(contact->szText));
+ TextOut(hdcMem, rc2.right + 3, y + ((rowHeight - fontHeight) >> 1), contact->szText, (int)mir_wstrlen(contact->szText));
rc2.left = rc2.right + 6 + textSize.cx;
rc2.right = clRect->right - dat->rightMargin;
DrawEdge(hdcMem, &rc2, BDR_SUNKENOUTER, BF_RECT);
@@ -1002,7 +1002,7 @@ bgskipped:
int labelWidth = textSize.cx + countsSize.cx + spaceSize.cx;
int offset = (g_center) ? ((rc2.right - rc2.left) - labelWidth) / 2 : 0;
- TextOut(hdcMem, rc2.left + offset + textSize.cx + spaceSize.cx, rc2.top + groupCountsFontTopShift, szCounts, (int)mir_tstrlen(szCounts));
+ TextOut(hdcMem, rc2.left + offset + textSize.cx + spaceSize.cx, rc2.top + groupCountsFontTopShift, szCounts, (int)mir_wstrlen(szCounts));
rightLineStart = rc2.left + offset + textSize.cx + spaceSize.cx + countsSize.cx + 2;
if (selected && !g_ignoreselforgroups)
@@ -1110,7 +1110,7 @@ bgskipped:
COLORREF oldColor = GetTextColor(hdcMem);
int idOldFont = dat->currentFontID;
ChangeToFont(hdcMem, dat, FONTID_TIMESTAMP, &fHeight);
- GetTextExtentPoint32(hdcMem, szResult, (int)mir_tstrlen(szResult), &szTime);
+ GetTextExtentPoint32(hdcMem, szResult, (int)mir_wstrlen(szResult), &szTime);
verticalfit = (rowHeight - fHeight >= g_cysmIcon + 1);
if (av_right) {
@@ -1191,7 +1191,7 @@ bgskipped:
LONG rightIconsTop = rcContent.bottom - g_cysmIcon;
LONG old_right = rcContent.right;
ULONG textCounter = 0;
- size_t ulLen = mir_tstrlen(szText);
+ size_t ulLen = mir_wstrlen(szText);
LONG old_bottom = rcContent.bottom;
DWORD i_dtFlags = DT_WORDBREAK | DT_NOPREFIX | dt_2ndrowflags;
dtp.cbSize = sizeof(dtp);
@@ -1215,7 +1215,7 @@ bgskipped:
if (selected) {
if (type != CLCIT_DIVIDER) {
RECT rc2;
- int qlen = (int)mir_tstrlen(dat->szQuickSearch);
+ int qlen = (int)mir_wstrlen(dat->szQuickSearch);
if (hPreviousFont)
SelectObject(hdcMem, hPreviousFont);
SetTextColor(hdcMem, dat->quickSearchColour);
diff --git a/plugins/Clist_nicer/src/clcutils.cpp b/plugins/Clist_nicer/src/clcutils.cpp
index 576642bf86..3bfc67c656 100644
--- a/plugins/Clist_nicer/src/clcutils.cpp
+++ b/plugins/Clist_nicer/src/clcutils.cpp
@@ -37,7 +37,7 @@ extern void ( *saveRecalcScrollBar )(HWND hwnd, struct ClcData *dat);
static int MY_pathIsAbsolute(const wchar_t *path)
{
- if (!path || !(mir_tstrlen(path) > 2))
+ if (!path || !(mir_wstrlen(path) > 2))
return 0;
if ((path[1] == ':' && path[2] == '\\') || (path[0] == '\\' && path[1] == '\\'))
@@ -52,7 +52,7 @@ size_t MY_pathToRelative(const wchar_t *pSrc, wchar_t *pOut)
if (!pSrc || !pOut)
return 0;
- dwSrcLen = mir_tstrlen(pSrc);
+ dwSrcLen = mir_wstrlen(pSrc);
if (!dwSrcLen || dwSrcLen > (MAX_PATH - 1))
return 0;
if (!MY_pathIsAbsolute(pSrc))
@@ -63,7 +63,7 @@ size_t MY_pathToRelative(const wchar_t *pSrc, wchar_t *pOut)
szTmp[dwSrcLen] = 0;
wcslwr(szTmp);
if (wcsstr(szTmp, cfg::dat.tszProfilePath)) {
- dwProfilePathLen = mir_tstrlen(cfg::dat.tszProfilePath);
+ dwProfilePathLen = mir_wstrlen(cfg::dat.tszProfilePath);
memcpy(pOut, (pSrc + (dwProfilePathLen - 1)), ((dwSrcLen - (dwProfilePathLen - 1)) * sizeof(wchar_t)));
pOut[0] = '.';
pOut[dwSrcLen] = 0;
@@ -82,7 +82,7 @@ size_t MY_pathToAbsolute(const wchar_t *pSrc, wchar_t *pOut)
if (!pSrc || !pOut)
return 0;
- dwSrcLen = mir_tstrlen(pSrc);
+ dwSrcLen = mir_wstrlen(pSrc);
if (!dwSrcLen || dwSrcLen > (MAX_PATH - 1))
return 0;
@@ -92,7 +92,7 @@ size_t MY_pathToAbsolute(const wchar_t *pSrc, wchar_t *pOut)
return dwSrcLen;
}
if (pSrc[0] == '.')
- return (mir_sntprintf(pOut, MAX_PATH, L"%s\\%s", cfg::dat.tszProfilePath, pSrc));
+ return (mir_snwprintf(pOut, MAX_PATH, L"%s\\%s", cfg::dat.tszProfilePath, pSrc));
return 0;
}
@@ -164,7 +164,7 @@ int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, ClcContact *hitcontac
hFont = reinterpret_cast<HFONT>(SelectObject(hdc, dat->fontInfo[FONTID_GROUPS].hFont));
else
hFont = reinterpret_cast<HFONT>(SelectObject(hdc, dat->fontInfo[FONTID_CONTACTS].hFont));
- GetTextExtentPoint32(hdc, hitcontact->szText, (int)mir_tstrlen(hitcontact->szText), &textSize);
+ GetTextExtentPoint32(hdc, hitcontact->szText, (int)mir_wstrlen(hitcontact->szText), &textSize);
width = textSize.cx;
if (hitcontact->type == CLCIT_GROUP) {
wchar_t *szCounts;
@@ -173,7 +173,7 @@ int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, ClcContact *hitcontac
GetTextExtentPoint32(hdc, L" ", 1, &textSize);
width += textSize.cx;
SelectObject(hdc, dat->fontInfo[FONTID_GROUPCOUNTS].hFont);
- GetTextExtentPoint32(hdc, szCounts, (int)mir_tstrlen(szCounts), &textSize);
+ GetTextExtentPoint32(hdc, szCounts, (int)mir_wstrlen(szCounts), &textSize);
width += textSize.cx;
}
}
@@ -305,7 +305,7 @@ int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **c
hFont = reinterpret_cast<HFONT>(SelectObject(hdc, dat->fontInfo[FONTID_GROUPS].hFont));
else
hFont = reinterpret_cast<HFONT>(SelectObject(hdc, dat->fontInfo[FONTID_CONTACTS].hFont));
- GetTextExtentPoint32(hdc, hitcontact->szText, (int)mir_tstrlen(hitcontact->szText), &textSize);
+ GetTextExtentPoint32(hdc, hitcontact->szText, (int)mir_wstrlen(hitcontact->szText), &textSize);
width = textSize.cx;
if (hitcontact->type == CLCIT_GROUP) {
wchar_t *szCounts;
@@ -314,7 +314,7 @@ int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **c
GetTextExtentPoint32(hdc, L" ", 1, &textSize);
width += textSize.cx;
SelectObject(hdc, dat->fontInfo[FONTID_GROUPCOUNTS].hFont);
- GetTextExtentPoint32(hdc, szCounts, (int)mir_tstrlen(szCounts), &textSize);
+ GetTextExtentPoint32(hdc, szCounts, (int)mir_wstrlen(szCounts), &textSize);
width += textSize.cx;
}
}
diff --git a/plugins/Clist_nicer/src/clistevents.cpp b/plugins/Clist_nicer/src/clistevents.cpp
index 6a504da5b3..01f6882ce7 100644
--- a/plugins/Clist_nicer/src/clistevents.cpp
+++ b/plugins/Clist_nicer/src/clistevents.cpp
@@ -264,7 +264,7 @@ CListEvent* AddEvent(CLISTEVENT *cle)
wchar_t szwProto[64];
MultiByteToWideChar(CP_ACP, 0, szProto, -1, szwProto, 64);
szwProto[63] = 0;
- mir_sntprintf(szBuffer, L"%s: %s (%s)", szwProto, szName, szStatus);
+ mir_snwprintf(szBuffer, L"%s: %s (%s)", szwProto, szName, szStatus);
szBuffer[127] = 0;
AppendMenu(cfg::dat.hMenuNotify, MF_BYCOMMAND | MF_STRING, cfg::dat.wNextMenuID, szBuffer);
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp
index 94cfbf6e52..8f8f9b6018 100644
--- a/plugins/Clist_nicer/src/clistmenus.cpp
+++ b/plugins/Clist_nicer/src/clistmenus.cpp
@@ -102,7 +102,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
DWORD dwFlags = db_get_dw(hContact, "CList", "CLN_Flags", 0);
BYTE bSecondLine = db_get_b(hContact, "CList", "CLN_2ndline", -1);
- mir_sntprintf(szTitle, TranslateT("Contact list display and ignore options for %s"), contact ? contact->szText : pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(szTitle, TranslateT("Contact list display and ignore options for %s"), contact ? contact->szText : pcli->pfnGetContactDisplayName(hContact, 0));
SetWindowText(hWnd, szTitle);
Window_SetSkinIcon_IcoLib(hWnd, SKINICON_OTHER_MIRANDA);
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp
index 954d08a5bd..639cffa96e 100644
--- a/plugins/Clist_nicer/src/clui.cpp
+++ b/plugins/Clist_nicer/src/clui.cpp
@@ -267,7 +267,7 @@ static void InitIcoLib()
continue;
wchar_t szDescr[128];
- mir_sntprintf(szDescr, TranslateT("%s connecting"), accs[k]->tszAccountName);
+ mir_snwprintf(szDescr, TranslateT("%s connecting"), accs[k]->tszAccountName);
IconItemT icon = { szDescr, "conn", IDI_PROTOCONNECTING };
Icon_RegisterT(g_hInst, LPGENW("Contact list") L"/" LPGENW("Connecting icons"), &icon, 1, accs[k]->szModuleName);
}
@@ -1416,7 +1416,7 @@ skipbg:
MessageBox(0, TranslateT("The requested action requires a valid contact selection. Please select a contact from the contact list and repeat."), TranslateT("Parameter mismatch"), MB_OK);
if (serviceFailure) {
wchar_t szError[512];
- mir_sntprintf(szError, TranslateT("The service %S specified by the %S button definition was not found. You may need to install additional plugins."), item->szService, item->szName);
+ mir_snwprintf(szError, TranslateT("The service %S specified by the %S button definition was not found. You may need to install additional plugins."), item->szService, item->szName);
MessageBox(NULL, szError, TranslateT("Service failure"), MB_OK);
}
break;
@@ -1709,22 +1709,22 @@ buttons_done:
wchar_t szName[64];
PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (pa) {
- mir_tstrncpy(szName, pa->tszAccountName, _countof(szName));
+ mir_wstrncpy(szName, pa->tszAccountName, _countof(szName));
szName[_countof(szName) - 1] = 0;
}
else
szName[0] = 0;
- if (mir_tstrlen(szName) < sizeof(szName) - 1)
- mir_tstrcat(szName, L" ");
- GetTextExtentPoint32(dis->hDC, szName, (int)mir_tstrlen(szName), &textSize);
- TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szName, (int)mir_tstrlen(szName));
+ if (mir_wstrlen(szName) < sizeof(szName) - 1)
+ mir_wstrcat(szName, L" ");
+ GetTextExtentPoint32(dis->hDC, szName, (int)mir_wstrlen(szName), &textSize);
+ TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szName, (int)mir_wstrlen(szName));
x += textSize.cx;
}
if (showOpts & 4) {
wchar_t *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
- GetTextExtentPoint32(dis->hDC, szStatus, (int)mir_tstrlen(szStatus), &textSize);
- TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szStatus, (int)mir_tstrlen(szStatus));
+ GetTextExtentPoint32(dis->hDC, szStatus, (int)mir_wstrlen(szStatus), &textSize);
+ TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szStatus, (int)mir_wstrlen(szStatus));
}
}
else if (dis->CtlType == ODT_MENU) {
@@ -1827,7 +1827,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
{
wchar_t str[64];
DWORD v = pluginInfo.version;
- mir_sntprintf(str, L"%s %d.%d.%d.%d", TranslateT("Version"), HIBYTE(HIWORD(v)), LOBYTE(HIWORD(v)), HIBYTE(LOWORD(v)), LOBYTE(LOWORD(v)));
+ mir_snwprintf(str, L"%s %d.%d.%d.%d", TranslateT("Version"), HIBYTE(HIWORD(v)), LOBYTE(HIWORD(v)), HIBYTE(LOWORD(v)), LOBYTE(LOWORD(v)));
SetDlgItemText(hwndDlg, IDC_VERSION, str);
}
{
diff --git a/plugins/Clist_nicer/src/cluiframes.cpp b/plugins/Clist_nicer/src/cluiframes.cpp
index 53e2692258..4e7b17a37f 100644
--- a/plugins/Clist_nicer/src/cluiframes.cpp
+++ b/plugins/Clist_nicer/src/cluiframes.cpp
@@ -472,9 +472,9 @@ int LocateStorePosition(int Frameid, int maxstored)
for (int i = 0; i < maxstored; i++) {
char settingname[255];
mir_snprintf(settingname, "Name%d", i);
- ptrT frmname(db_get_tsa(0, CLUIFrameModule, settingname));
+ ptrW frmname(db_get_tsa(0, CLUIFrameModule, settingname));
if (frmname == NULL) continue;
- if (mir_tstrcmpi(frmname, Frames[Frameid].name) == 0)
+ if (mir_wstrcmpi(frmname, Frames[Frameid].name) == 0)
return i;
}
return -1;
@@ -867,7 +867,7 @@ INT_PTR CLUIFramesSetFrameOptions(WPARAM wParam, LPARAM lParam)
return -1;
mir_free(Frames[pos].name);
- Frames[pos].name = (wParam & FO_UNICODETEXT) ? mir_u2t((LPWSTR)lParam) : mir_a2t((LPSTR)lParam);
+ Frames[pos].name = (wParam & FO_UNICODETEXT) ? mir_wstrdup((LPWSTR)lParam) : mir_a2u((LPSTR)lParam);
return 0;
case FO_TBNAME:
@@ -875,7 +875,7 @@ INT_PTR CLUIFramesSetFrameOptions(WPARAM wParam, LPARAM lParam)
return -1;
mir_free(Frames[pos].TitleBar.tbname);
- Frames[pos].TitleBar.tbname = (wParam & FO_UNICODETEXT) ? mir_u2t((LPWSTR)lParam) : mir_a2t((LPSTR)lParam);
+ Frames[pos].TitleBar.tbname = (wParam & FO_UNICODETEXT) ? mir_wstrdup((LPWSTR)lParam) : mir_a2u((LPSTR)lParam);
lck.unlock();
if (Frames[pos].floating && (Frames[pos].TitleBar.tbname != NULL))
@@ -887,7 +887,7 @@ INT_PTR CLUIFramesSetFrameOptions(WPARAM wParam, LPARAM lParam)
return -1;
mir_free(Frames[pos].TitleBar.tooltip);
- Frames[pos].TitleBar.tooltip = (wParam & FO_UNICODETEXT) ? mir_u2t((LPWSTR)lParam) : mir_a2t((LPSTR)lParam);
+ Frames[pos].TitleBar.tooltip = (wParam & FO_UNICODETEXT) ? mir_wstrdup((LPWSTR)lParam) : mir_a2u((LPSTR)lParam);
UpdateTBToolTip(pos);
return 0;
@@ -1014,7 +1014,7 @@ INT_PTR CLUIFramesShowHideFrame(WPARAM frameId, LPARAM)
{
mir_cslock lck(csFrameHook);
pos = id2pos(frameId);
- if (pos >= 0 && !mir_tstrcmp(Frames[pos].name, L"My contacts"))
+ if (pos >= 0 && !mir_wstrcmp(Frames[pos].name, L"My contacts"))
Frames[pos].visible = 1;
else {
if (pos >= 0 && (int)pos < nFramescount)
@@ -1599,15 +1599,15 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM)
if (clfrm->name == NULL || ((clfrm->Flags&F_UNICODE) ? mir_wstrlen(clfrm->wname) : mir_strlen(clfrm->name)) == 0) {
wchar_t ptszClassName[256];
GetClassName(Frames[nFramescount].hWnd, ptszClassName, _countof(ptszClassName));
- Frames[nFramescount].name = mir_tstrdup(ptszClassName);
+ Frames[nFramescount].name = mir_wstrdup(ptszClassName);
}
- else Frames[nFramescount].name = (clfrm->Flags & F_UNICODE) ? mir_u2t(clfrm->wname) : mir_a2t(clfrm->name);
+ else Frames[nFramescount].name = (clfrm->Flags & F_UNICODE) ? mir_wstrdup(clfrm->wname) : mir_a2u(clfrm->name);
if (IsBadCodePtr((FARPROC)clfrm->TBname) || clfrm->TBname == NULL
|| ((clfrm->Flags&F_UNICODE) ? mir_wstrlen(clfrm->TBwname) : mir_strlen(clfrm->TBname)) == 0)
- Frames[nFramescount].TitleBar.tbname = mir_tstrdup(Frames[nFramescount].name);
+ Frames[nFramescount].TitleBar.tbname = mir_wstrdup(Frames[nFramescount].name);
else
- Frames[nFramescount].TitleBar.tbname = (clfrm->Flags & F_UNICODE) ? mir_u2t(clfrm->TBwname) : mir_a2t(clfrm->TBname);
+ Frames[nFramescount].TitleBar.tbname = (clfrm->Flags & F_UNICODE) ? mir_wstrdup(clfrm->TBwname) : mir_a2u(clfrm->TBname);
Frames[nFramescount].needhide = FALSE;
Frames[nFramescount].TitleBar.ShowTitleBar = (clfrm->Flags & F_SHOWTB ? TRUE : FALSE);
Frames[nFramescount].TitleBar.ShowTitleBarTip = (clfrm->Flags & F_SHOWTBTIP ? TRUE : FALSE);
@@ -2153,7 +2153,7 @@ int OnFrameTitleBarBackgroundChange()
hBmpBackground = NULL;
}
if (db_get_b(NULL, "FrameTitleBar", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- ptrT tszBitmapName(db_get_tsa(NULL, "FrameTitleBar", "BkBitmap"));
+ ptrW tszBitmapName(db_get_tsa(NULL, "FrameTitleBar", "BkBitmap"));
if (tszBitmapName != NULL)
hBmpBackground = Bitmap_Load(tszBitmapName);
}
@@ -2224,11 +2224,11 @@ static int DrawTitleBar(HDC dc, RECT rect, int Frameid)
if (!AlignCOLLIconToLeft) {
if (Frames[pos].TitleBar.hicon != NULL) {
DrawIconEx(hdcMem, 6 + cfg::dat.bClipBorder, ((TitleBarH >> 1) - 8), Frames[pos].TitleBar.hicon, 16, 16, 0, NULL, DI_NORMAL);
- TextOut(hdcMem, 24 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, (int)mir_tstrlen(Frames[pos].TitleBar.tbname));
+ TextOut(hdcMem, 24 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, (int)mir_wstrlen(Frames[pos].TitleBar.tbname));
}
- else TextOut(hdcMem, 6 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, (int)mir_tstrlen(Frames[pos].TitleBar.tbname));
+ else TextOut(hdcMem, 6 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, (int)mir_wstrlen(Frames[pos].TitleBar.tbname));
}
- else TextOut(hdcMem, 18 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, (int)mir_tstrlen(Frames[pos].TitleBar.tbname));
+ else TextOut(hdcMem, 18 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, (int)mir_wstrlen(Frames[pos].TitleBar.tbname));
if (!AlignCOLLIconToLeft)
DrawIconEx(hdcMem, Frames[pos].TitleBar.wndSize.right - 22, ((TitleBarH >> 1) - 8), Frames[pos].collapsed ? Skin_LoadIcon(SKINICON_OTHER_GROUPOPEN) : Skin_LoadIcon(SKINICON_OTHER_GROUPSHUT), 16, 16, 0, NULL, DI_NORMAL);
@@ -2896,7 +2896,7 @@ wchar_t g_ptszEventName[100];
static int CLUIFrameOnModulesLoad(WPARAM, LPARAM)
{
- mir_sntprintf(g_ptszEventName, L"mf_update_evt_%d", GetCurrentThreadId());
+ mir_snwprintf(g_ptszEventName, L"mf_update_evt_%d", GetCurrentThreadId());
g_hEventThread = CreateEvent(NULL, TRUE, FALSE, g_ptszEventName);
hThreadMFUpdate = mir_forkthread(MF_UpdateThread, NULL);
SetThreadPriority(hThreadMFUpdate, THREAD_PRIORITY_IDLE);
diff --git a/plugins/Clist_nicer/src/cluiopts.cpp b/plugins/Clist_nicer/src/cluiopts.cpp
index fe8f5e380f..f3cdc54267 100644
--- a/plugins/Clist_nicer/src/cluiopts.cpp
+++ b/plugins/Clist_nicer/src/cluiopts.cpp
@@ -84,7 +84,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
Utils::enableDlgControl(hwndDlg, IDC_AUTOSIZEUPWARD, FALSE);
}
{
- ptrT tszTitle(db_get_tsa(NULL, "CList", "TitleText"));
+ ptrW tszTitle(db_get_tsa(NULL, "CList", "TitleText"));
if (tszTitle != NULL)
SetDlgItemText(hwndDlg, IDC_TITLETEXT, tszTitle);
else
diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp
index 826fcdfcab..e4116b900a 100644
--- a/plugins/Clist_nicer/src/cluiservices.cpp
+++ b/plugins/Clist_nicer/src/cluiservices.cpp
@@ -131,16 +131,16 @@ void CluiProtocolStatusChanged(int, const char*)
if (showOpts & 1)
x += 16;
if (showOpts & 2) {
- mir_tstrncpy(szName, pa->tszAccountName, _countof(szName));
+ mir_wstrncpy(szName, pa->tszAccountName, _countof(szName));
szName[_countof(szName) - 1] = 0;
- if ((showOpts & 4) && mir_tstrlen(szName) < sizeof(szName) - 1)
- mir_tstrcat(szName, L" ");
- GetTextExtentPoint32(hdc, szName, (int)mir_tstrlen(szName), &textSize);
+ if ((showOpts & 4) && mir_wstrlen(szName) < sizeof(szName) - 1)
+ mir_wstrcat(szName, L" ");
+ GetTextExtentPoint32(hdc, szName, (int)mir_wstrlen(szName), &textSize);
x += textSize.cx + GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room
}
if (showOpts & 4) {
wchar_t* modeDescr = pcli->pfnGetStatusModeDescription(CallProtoService(accs[i]->szModuleName, PS_GETSTATUS, 0, 0), 0);
- GetTextExtentPoint32(hdc, modeDescr, (int)mir_tstrlen(modeDescr), &textSize);
+ GetTextExtentPoint32(hdc, modeDescr, (int)mir_wstrlen(modeDescr), &textSize);
x += textSize.cx + GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room
}
partWidths[partCount] = (partCount ? partWidths[partCount - 1] : cfg::dat.bCLeft) + x + 2;
diff --git a/plugins/Clist_nicer/src/config.cpp b/plugins/Clist_nicer/src/config.cpp
index 663e4dadef..b42c4a24ab 100644
--- a/plugins/Clist_nicer/src/config.cpp
+++ b/plugins/Clist_nicer/src/config.cpp
@@ -202,7 +202,7 @@ int API::Ex_ShowDialog(EXCEPTION_POINTERS *ep, const char *szFile, int line, wch
memcpy(&exCtx, ep->ContextRecord, sizeof(CONTEXT));
mir_snprintf(exSzFile, "%s%s", szName, szExt);
- mir_sntprintf(exReason, L"An application error has occured: %s", szReason);
+ mir_snwprintf(exReason, L"An application error has occured: %s", szReason);
exLine = line;
exLastResult = DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_EXCEPTION), 0, Ex_DlgProc, 0);
exAllowContinue = fAllowContinue;
@@ -240,10 +240,10 @@ HMODULE Utils::loadSystemLibrary(const wchar_t* szFilename, bool useGetHandle)
throw(CRTException("Error while loading system library", szFilename));
sysPathName[MAX_PATH - 1] = 0;
- if (mir_tstrlen(sysPathName) + mir_tstrlen(szFilename) >= MAX_PATH)
+ if (mir_wstrlen(sysPathName) + mir_wstrlen(szFilename) >= MAX_PATH)
throw(CRTException("Error while loading system library", szFilename));
- mir_tstrcat(sysPathName, szFilename);
+ mir_wstrcat(sysPathName, szFilename);
if (useGetHandle)
_h = ::GetModuleHandle(sysPathName);
else
@@ -260,15 +260,15 @@ HMODULE Utils::loadSystemLibrary(const wchar_t* szFilename, bool useGetHandle)
CRTException::CRTException(const char *szMsg, const wchar_t *szParam) : std::runtime_error(std::string(szMsg))
{
- mir_sntprintf(m_szParam, MAX_PATH, szParam);
+ mir_snwprintf(m_szParam, MAX_PATH, szParam);
}
void CRTException::display() const
{
- wchar_t *tszMsg = mir_a2t(what());
+ wchar_t *tszMsg = mir_a2u(what());
wchar_t tszBoxMsg[500];
- mir_sntprintf(tszBoxMsg, L"%s\n\n(%s)", tszMsg, m_szParam);
+ mir_snwprintf(tszBoxMsg, L"%s\n\n(%s)", tszMsg, m_szParam);
::MessageBox(0, tszBoxMsg, L"Clist_nicer runtime error", MB_OK | MB_ICONERROR);
mir_free(tszMsg);
}
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp
index 5ed6ee4347..f25aa3dc81 100644
--- a/plugins/Clist_nicer/src/extBackg.cpp
+++ b/plugins/Clist_nicer/src/extBackg.cpp
@@ -1543,7 +1543,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
DBVARIANT dbv = { 0 };
if (!db_get_ts(NULL, "CLC", "AdvancedSkin", &dbv)) {
- if (mir_tstrcmp(dbv.ptszVal, final_path))
+ if (mir_wstrcmp(dbv.ptszVal, final_path))
skinChanged = TRUE;
db_free(&dbv);
}
diff --git a/plugins/Clist_nicer/src/statusbar.cpp b/plugins/Clist_nicer/src/statusbar.cpp
index 6484ccba6a..0bdf030fb0 100644
--- a/plugins/Clist_nicer/src/statusbar.cpp
+++ b/plugins/Clist_nicer/src/statusbar.cpp
@@ -160,7 +160,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
BYTE isLocked = db_get_b(NULL, PD->RealName, "LockMainStatus", 0);
wchar_t szTipText[256];
- mir_sntprintf(szTipText, L"<b>%s</b>: %s%s",
+ mir_snwprintf(szTipText, L"<b>%s</b>: %s%s",
PD->RealName, pcli->pfnGetStatusModeDescription(wStatus, 0), isLocked ? L" (LOCKED)" : L"");
CLCINFOTIP ti = { sizeof(ti) };
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp
index 772f2e0fa0..8a0e588ce9 100644
--- a/plugins/Clist_nicer/src/viewmodes.cpp
+++ b/plugins/Clist_nicer/src/viewmodes.cpp
@@ -434,7 +434,7 @@ void UpdateFilters()
mir_strncpy(sttModeName, szBuf, sizeof(sttModeName));
{
wchar_t szTemp[100];
- mir_sntprintf(szTemp, TranslateT("Current view mode: %S"), sttModeName);
+ mir_snwprintf(szTemp, TranslateT("Current view mode: %S"), sttModeName);
SetDlgItemText(sttClvmHwnd, IDC_CURVIEWMODE2, szTemp);
}
@@ -493,7 +493,7 @@ void UpdateFilters()
for (int i = 1; i < ListView_GetItemCount(hwndList); i++) {
item.iItem = i;
SendMessage(hwndList, LVM_GETITEM, 0, (LPARAM)&item);
- mir_sntprintf(szMask, L"%s|", szTemp);
+ mir_snwprintf(szMask, L"%s|", szTemp);
if (dbv_gf.ptszVal && wcsstr(dbv_gf.ptszVal, szMask)) {
ListView_SetCheckState(hwndList, i, TRUE);
}
@@ -1042,8 +1042,8 @@ void ApplyViewMode(const char *name)
}
mir_snprintf(szSetting, "%c%s_GF", 246, name);
- ptrT tszGroups(db_get_tsa(NULL, CLVM_MODULE, szSetting));
- if (mir_tstrlen(tszGroups) >= 2) {
+ ptrW tszGroups(db_get_tsa(NULL, CLVM_MODULE, szSetting));
+ if (mir_wstrlen(tszGroups) >= 2) {
wcsncpy_s(cfg::dat.groupFilter, tszGroups, _TRUNCATE);
cfg::dat.bFilterEffective |= CLVM_FILTER_GROUPS;
}