diff options
-rw-r--r-- | include/m_clistint.h | 2 | ||||
-rw-r--r-- | plugins/Clist_blind/src/clcpaint.cpp | 8 | ||||
-rw-r--r-- | plugins/Clist_blind/src/init.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_modern/src/hdr/modern_commonprototypes.h | 7 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcitems.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcpaint.cpp | 34 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_rowheight_funcs.cpp | 8 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_statusbar.cpp | 16 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcpaint.cpp | 6 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcutils.cpp | 12 | ||||
-rw-r--r-- | src/core/stdclist/src/clcpaint.cpp | 8 | ||||
-rw-r--r-- | src/modules/clist/clc.h | 2 | ||||
-rw-r--r-- | src/modules/clist/clcutils.cpp | 16 |
13 files changed, 59 insertions, 64 deletions
diff --git a/include/m_clistint.h b/include/m_clistint.h index 477179390d..976f20d8df 100644 --- a/include/m_clistint.h +++ b/include/m_clistint.h @@ -305,7 +305,7 @@ typedef struct void (*pfnPaintClc)(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint);
/* clcutils.c */
- char* (*pfnGetGroupCountsText)(struct ClcData *dat, ClcContact *contact);
+ TCHAR* (*pfnGetGroupCountsText)(struct ClcData *dat, ClcContact *contact);
int (*pfnHitTest)(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **contact, ClcGroup **group, DWORD * flags);
void (*pfnScrollTo)(HWND hwnd, struct ClcData *dat, int desty, int noSmooth);
void (*pfnEnsureVisible)(HWND hwnd, struct ClcData *dat, int iItem, int partialOk);
diff --git a/plugins/Clist_blind/src/clcpaint.cpp b/plugins/Clist_blind/src/clcpaint.cpp index 82ffbf2b43..2289203589 100644 --- a/plugins/Clist_blind/src/clcpaint.cpp +++ b/plugins/Clist_blind/src/clcpaint.cpp @@ -267,7 +267,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) int hottrack = dat->exStyle & CLS_EX_TRACKSELECT && group->cl.items[group->scanIndex]->type != CLCIT_DIVIDER && dat->iHotTrack == index;
SIZE textSize, countsSize = { 0 }, spaceSize = { 0 };
int width, checkboxWidth;
- char *szCounts = NULL;
+ TCHAR *szCounts = NULL;
//alternating grey
if (style & CLS_GREYALTERNATE && index & 1) {
@@ -312,9 +312,9 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) {
szCounts = pcli->pfnGetGroupCountsText(dat, group->cl.items[group->scanIndex]);
if (szCounts[0]) {
- GetTextExtentPoint32A(hdcMem, " ", 1, &spaceSize);
+ GetTextExtentPoint32(hdcMem, _T(" "), 1, &spaceSize);
ChangeToFont(hdcMem, dat, FONTID_GROUPCOUNTS, &fontHeight);
- GetTextExtentPoint32A(hdcMem, szCounts, (int)mir_strlen(szCounts), &countsSize);
+ GetTextExtentPoint32(hdcMem, szCounts, (int)mir_tstrlen(szCounts), &countsSize);
width += spaceSize.cx + countsSize.cx;
}
}
@@ -404,7 +404,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) if (rc.right < rc.left + 4)
rc.right = clRect.right + 1;
else
- TextOutA(hdcMem, rc.right, rc.top + groupCountsFontTopShift, szCounts, (int)mir_strlen(szCounts));
+ TextOut(hdcMem, rc.right, rc.top + groupCountsFontTopShift, szCounts, (int)mir_tstrlen(szCounts));
ChangeToFont(hdcMem, dat, FONTID_GROUPS, &fontHeight);
if (selected)
SetTextColor(hdcMem, dat->selTextColour);
diff --git a/plugins/Clist_blind/src/init.cpp b/plugins/Clist_blind/src/init.cpp index bf7a49885f..432b41fcc3 100644 --- a/plugins/Clist_blind/src/init.cpp +++ b/plugins/Clist_blind/src/init.cpp @@ -548,7 +548,7 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig) {
case CLCIT_GROUP:
{
- char *szCounts = pcli->pfnGetGroupCountsText((ClcData*)dat, item);
+ TCHAR *szCounts = pcli->pfnGetGroupCountsText((ClcData*)dat, item);
const TCHAR *t[] = {
_T("%name%"),
_T("%count%"),
diff --git a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h index 757505caf4..512f145f69 100644 --- a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h +++ b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h @@ -158,11 +158,6 @@ int ske_UpdateWindowImage(); int ske_UpdateWindowImageRect(RECT *lpRect);
int ske_ValidateFrameImageProc(RECT *r);
-__forceinline BOOL ske_DrawTextA(HDC hdc, char *lpString, int nCount, RECT *lpRect, UINT format)
-{
- return ske_DrawText(hdc, _A2T(lpString), nCount, lpRect, format);
-}
-
/* CLUIFrames.c PROXIED */
int CLUIFrames_ActivateSubContainers(BOOL wParam);
@@ -274,7 +269,7 @@ void cli_AddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int upd void cli_DeleteItemFromTree(HWND hwnd, MCONTACT hItem);
void cli_FreeContact(ClcContact*);
void cli_FreeGroup(ClcGroup*);
-char* cli_GetGroupCountsText(ClcData *dat, ClcContact *contact);
+TCHAR* cli_GetGroupCountsText(ClcData *dat, ClcContact *contact);
void cli_ChangeContactIcon(MCONTACT hContact, int iIcon, int add);
void cli_SetContactCheckboxes(ClcContact*, int);
LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index 98c69bda70..22cd91558f 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -636,7 +636,7 @@ void cli_SetContactCheckboxes(ClcContact *cc, int checked) corecli.pfnSetContactCheckboxes(&cc->subcontacts[i], checked); } -char* cli_GetGroupCountsText(ClcData *dat, ClcContact *contact) +TCHAR* cli_GetGroupCountsText(ClcData *dat, ClcContact *contact) { return corecli.pfnGetGroupCountsText(dat, contact); } diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp index c3cd45e234..b4594aa7e7 100644 --- a/plugins/Clist_modern/src/modern_clcpaint.cpp +++ b/plugins/Clist_modern/src/modern_clcpaint.cpp @@ -805,7 +805,7 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact //3 draw text
{
SIZE text_size = { 0 };
- char * szCounts = NULL;
+ TCHAR * szCounts = NULL;
RECT text_rect = fr_rc;
RECT counts_rc = { 0 };
UINT uTextFormat = DT_LEFT | DT_VCENTER | (gl_TrimText ? DT_END_ELLIPSIS : 0) | DT_SINGLELINE;
@@ -823,9 +823,9 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact RECT count_rc = { 0 };
SIZE count_size = { 0 };
int space_width = 0;
- char * szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
+ TCHAR * szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
// Has to draw the count?
- if (szCounts && strlen(szCounts) > 0) {
+ if (szCounts && mir_tstrlen(szCounts) > 0) {
// calc width and height
ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
ske_DrawText(hdcMem, _T(" "), 1, &count_rc, DT_CALCRECT | DT_NOPREFIX);
@@ -833,7 +833,7 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact space_width = count_size.cx;
count_rc.right = 0;
count_rc.left = 0;
- ske_DrawTextA(hdcMem, szCounts, (int)mir_strlen(szCounts), &count_rc, DT_CALCRECT);
+ ske_DrawText(hdcMem, szCounts, (int)mir_tstrlen(szCounts), &count_rc, DT_CALCRECT);
count_size.cx += count_rc.right - count_rc.left;
count_size.cy = count_rc.bottom - count_rc.top;
}
@@ -882,14 +882,14 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, (int)mir_tstrlen(Drawing->szText), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
}
- if (szCounts && strlen(szCounts) > 0) {
+ if (szCounts && mir_tstrlen(szCounts) > 0) {
ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
if (selected)
SetTextColor(hdcMem, dat->selTextColour);
else if (hottrack)
_SetHotTrackColour(hdcMem, dat);
if (dat->text_rtl != 0) _RTLRect(&countRect, free_row_rc.right);
- ske_DrawTextA(hdcMem, szCounts, (int)mir_strlen(szCounts), &countRect, uTextFormat);
+ ske_DrawText(hdcMem, szCounts, (int)mir_tstrlen(szCounts), &countRect, uTextFormat);
}
{
RECT rc = fr_rc;
@@ -916,7 +916,7 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact space_size.cy = min(space_rc.bottom - space_rc.top, fr_rc.bottom - fr_rc.top);
ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
- DrawTextA(hdcMem, szCounts, (int)mir_strlen(szCounts), &counts_rc, DT_CALCRECT);
+ DrawText(hdcMem, szCounts, (int)mir_tstrlen(szCounts), &counts_rc, DT_CALCRECT);
counts_size.cx = counts_rc.right - counts_rc.left;
counts_size.cy = min(counts_rc.bottom - counts_rc.top, fr_rc.bottom - fr_rc.top);
@@ -962,7 +962,7 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact if (Drawing->type == CLCIT_GROUP && szCounts && szCounts[0] && counts_rc.right - counts_rc.left > 0) {
ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
if (dat->text_rtl != 0) _RTLRect(&counts_rc, free_row_rc.right);
- ske_DrawTextA(hdcMem, szCounts, (int)mir_strlen(szCounts), &counts_rc, uTextFormat);
+ ske_DrawText(hdcMem, szCounts, (int)mir_tstrlen(szCounts), &counts_rc, uTextFormat);
if (dat->text_rtl == 0)
text_rect.right = counts_rc.right;
else
@@ -1052,9 +1052,9 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact RECT count_rc = { 0 };
SIZE count_size = { 0 };
int space_width = 0;
- char * szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
+ TCHAR *szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
// Has to draw the count?
- if (szCounts && strlen(szCounts) > 0) {
+ if (szCounts && mir_tstrlen(szCounts) > 0) {
// calc width and height
ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
ske_DrawText(hdcMem, _T(" "), 1, &count_rc, DT_CALCRECT | DT_NOPREFIX);
@@ -1062,7 +1062,7 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact space_width = count_size.cx;
count_rc.right = 0;
count_rc.left = 0;
- ske_DrawTextA(hdcMem, szCounts, (int)mir_strlen(szCounts), &count_rc, DT_CALCRECT);
+ ske_DrawText(hdcMem, szCounts, (int)mir_tstrlen(szCounts), &count_rc, DT_CALCRECT);
count_size.cx += count_rc.right - count_rc.left;
count_size.cy = count_rc.bottom - count_rc.top;
}
@@ -1108,13 +1108,13 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact SetTextColor(hdcMem, dat->quickSearchColour);
_DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, (int)mir_tstrlen(Drawing->szText), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
}
- if (szCounts && strlen(szCounts) > 0) {
+ if (szCounts && mir_tstrlen(szCounts) > 0) {
ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
if (selected)
SetTextColor(hdcMem, dat->selTextColour);
else if (hottrack)
_SetHotTrackColour(hdcMem, dat);
- ske_DrawTextA(hdcMem, szCounts, (int)mir_strlen(szCounts), &countRect, uTextFormat);
+ ske_DrawText(hdcMem, szCounts, (int)mir_tstrlen(szCounts), &countRect, uTextFormat);
}
Drawing->pos_rename_rect = p_rect;
Drawing->pos_label = nameRect;
@@ -2285,7 +2285,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT SIZE third_line_text_size = { 0 };
SIZE space_size = { 0 };
SIZE counts_size = { 0 };
- char *szCounts = NULL;//mir_tstrdup( _T(""));
+ TCHAR *szCounts = NULL;//mir_tstrdup( _T(""));
int free_width;
int free_height;
int max_bottom_selection_border = SELECTION_BORDER;
@@ -2336,7 +2336,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT space_size.cy = min(space_rc.bottom - space_rc.top, free_height);
ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
- DrawTextA(hdcMem, szCounts, (int)mir_strlen(szCounts), &counts_rc, DT_CALCRECT);
+ DrawText(hdcMem, szCounts, (int)mir_tstrlen(szCounts), &counts_rc, DT_CALCRECT);
//Store position
//StoreItemPos( Drawing, CIT_SUBTEXT1, &counts_rc ); // Or not to comment?
@@ -2825,7 +2825,7 @@ void CLCPaint::_DrawContactText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, i void CLCPaint::_DrawContactSubText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem, UINT uTextFormat, BYTE itemType)
{
if (Drawing->type == CLCIT_GROUP) {
- char * szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
+ TCHAR *szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
// Has to draw the count?
if (szCounts && szCounts[0]) {
@@ -2834,7 +2834,7 @@ void CLCPaint::_DrawContactSubText(HDC hdcMem, ClcData *dat, ClcContact *Drawing SetTextColor(hdcMem, dat->selTextColour);
else if (hottrack)
_SetHotTrackColour(hdcMem, dat);
- ske_DrawTextA(hdcMem, szCounts, -1, prcItem, uTextFormat);
+ ske_DrawText(hdcMem, szCounts, -1, prcItem, uTextFormat);
ske_ResetTextEffect(hdcMem);
}
}
diff --git a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp index 401f755893..8a6e7b5eab 100644 --- a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp +++ b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp @@ -98,7 +98,7 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i if (dat->text_replace_smileys && dat->first_line_draw_smileys && !dat->text_resize_smileys)
tmp = max(tmp, contact->ssText.iMaxSmileyHeight);
if (contact->type == CLCIT_GROUP) {
- char *szCounts = pcli->pfnGetGroupCountsText(dat, contact);
+ TCHAR *szCounts = pcli->pfnGetGroupCountsText(dat, contact);
// Has the count?
if (szCounts && szCounts[0])
tmp = max(tmp, dat->fontModernInfo[contact->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS].fontHeight);
@@ -136,8 +136,8 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i g_clcPainter.ChangeToFont(hdc, dat, g_clcPainter.GetBasicFontID(contact), NULL);
g_clcPainter.GetTextSize(&size, hdc, dummyRect, contact->szText, contact->ssText.plText, 0, dat->text_resize_smileys ? 0 : contact->ssText.iMaxSmileyHeight);
if (contact->type == CLCIT_GROUP) {
- char *szCounts = pcli->pfnGetGroupCountsText(dat, contact);
- if (szCounts && strlen(szCounts) > 0) {
+ TCHAR *szCounts = pcli->pfnGetGroupCountsText(dat, contact);
+ if (szCounts && mir_tstrlen(szCounts) > 0) {
RECT count_rc = { 0 };
// calc width and height
g_clcPainter.ChangeToFont(hdc, dat, contact->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
@@ -145,7 +145,7 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i size.cx += count_rc.right - count_rc.left;
count_rc.right = 0;
count_rc.left = 0;
- ske_DrawTextA(hdc, szCounts, (int)mir_strlen(szCounts), &count_rc, DT_CALCRECT);
+ ske_DrawText(hdc, szCounts, (int)mir_tstrlen(szCounts), &count_rc, DT_CALCRECT);
size.cx += count_rc.right - count_rc.left;
tmp = max(tmp, count_rc.bottom - count_rc.top);
}
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index c34fcf9540..8527387a58 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -33,7 +33,7 @@ struct ProtoItemData : public MZeroedObject ptrA szAccountName;
int iProtoStatus;
ptrT tszProtoHumanName;
- ptrA szProtoEMailCount;
+ ptrT szProtoEMailCount;
ptrT tszProtoStatusText;
ptrT tszProtoXStatus;
int iProtoPos;
@@ -246,9 +246,9 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) if (p->bShowProtoEmails == 1 && ProtoServiceExists(szProto, PS_GETUNREADEMAILCOUNT)) {
int nEmails = (int)ProtoCallService(szProto, PS_GETUNREADEMAILCOUNT, 0, 0);
if (nEmails > 0) {
- char buf[40];
- mir_snprintf(buf, SIZEOF(buf), "[%d]", nEmails);
- p->szProtoEMailCount = mir_strdup(buf);
+ TCHAR buf[40];
+ mir_sntprintf(buf, SIZEOF(buf), _T("[%d]"), nEmails);
+ p->szProtoEMailCount = mir_tstrdup(buf);
}
}
@@ -374,7 +374,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) }
if (p.bShowProtoEmails && p.szProtoEMailCount) {
- GetTextExtentPoint32A(hDC, p.szProtoEMailCount, (int)mir_strlen(p.szProtoEMailCount), &textSize);
+ GetTextExtentPoint32(hDC, p.szProtoEMailCount, (int)mir_tstrlen(p.szProtoEMailCount), &textSize);
w += textSize.cx + 3 + spaceWidth;
}
@@ -537,14 +537,14 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) }
if (p.bShowProtoEmails && p.szProtoEMailCount != NULL) {
- int cbLen = (int)mir_strlen(p.szProtoEMailCount);
+ int cbLen = (int)mir_tstrlen(p.szProtoEMailCount);
RECT rt = r;
rt.left = x + (spaceWidth >> 1);
rt.top = textY;
- ske_DrawTextA(hDC, p.szProtoEMailCount, cbLen, &rt, 0);
+ ske_DrawText(hDC, p.szProtoEMailCount, cbLen, &rt, 0);
if (p.bShowStatusName || ((p.xStatusMode & 8) && p.tszProtoXStatus)) {
SIZE textSize;
- GetTextExtentPoint32A(hDC, p.szProtoEMailCount, cbLen, &textSize);
+ GetTextExtentPoint32(hDC, p.szProtoEMailCount, cbLen, &textSize);
x += textSize.cx + 3;
}
}
diff --git a/plugins/Clist_nicer/src/clcpaint.cpp b/plugins/Clist_nicer/src/clcpaint.cpp index 5eda1289d4..1b63554991 100644 --- a/plugins/Clist_nicer/src/clcpaint.cpp +++ b/plugins/Clist_nicer/src/clcpaint.cpp @@ -505,7 +505,7 @@ set_bg_l: else
ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight);
- char *szCounts = NULL;
+ TCHAR *szCounts = NULL;
if (type == CLCIT_GROUP) {
GetTextExtentPoint32(hdcMem, contact->szText, (int)mir_tstrlen(contact->szText), &textSize);
int width = textSize.cx;
@@ -513,7 +513,7 @@ set_bg_l: if (szCounts[0]) {
GetTextExtentPoint32(hdcMem, _T(" "), 1, &spaceSize);
ChangeToFont(hdcMem, dat, FONTID_GROUPCOUNTS, &fontHeight);
- GetTextExtentPoint32A(hdcMem, szCounts, (int)mir_strlen(szCounts), &countsSize);
+ GetTextExtentPoint32(hdcMem, szCounts, (int)mir_tstrlen(szCounts), &countsSize);
width += spaceSize.cx + countsSize.cx;
}
}
@@ -1008,7 +1008,7 @@ bgskipped: int labelWidth = textSize.cx + countsSize.cx + spaceSize.cx;
int offset = (g_center) ? ((rc.right - rc.left) - labelWidth) / 2 : 0;
- TextOutA(hdcMem, rc.left + offset + textSize.cx + spaceSize.cx, rc.top + groupCountsFontTopShift, szCounts, (int)mir_strlen(szCounts));
+ TextOut(hdcMem, rc.left + offset + textSize.cx + spaceSize.cx, rc.top + groupCountsFontTopShift, szCounts, (int)mir_tstrlen(szCounts));
rightLineStart = rc.left + offset + textSize.cx + spaceSize.cx + countsSize.cx + 2;
if (selected && !g_ignoreselforgroups)
diff --git a/plugins/Clist_nicer/src/clcutils.cpp b/plugins/Clist_nicer/src/clcutils.cpp index 3cab8d60d3..2a213032ed 100644 --- a/plugins/Clist_nicer/src/clcutils.cpp +++ b/plugins/Clist_nicer/src/clcutils.cpp @@ -167,13 +167,13 @@ int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, ClcContact *hitcontac GetTextExtentPoint32(hdc, hitcontact->szText, (int)mir_tstrlen(hitcontact->szText), &textSize);
width = textSize.cx;
if (hitcontact->type == CLCIT_GROUP) {
- char *szCounts;
+ TCHAR *szCounts;
szCounts = pcli->pfnGetGroupCountsText(dat, hitcontact);
if (szCounts[0]) {
- GetTextExtentPoint32A(hdc, " ", 1, &textSize);
+ GetTextExtentPoint32(hdc, _T(" "), 1, &textSize);
width += textSize.cx;
SelectObject(hdc, dat->fontInfo[FONTID_GROUPCOUNTS].hFont);
- GetTextExtentPoint32A(hdc, szCounts, (int)mir_strlen(szCounts), &textSize);
+ GetTextExtentPoint32(hdc, szCounts, (int)mir_tstrlen(szCounts), &textSize);
width += textSize.cx;
}
}
@@ -308,13 +308,13 @@ int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **c GetTextExtentPoint32(hdc, hitcontact->szText, (int)mir_tstrlen(hitcontact->szText), &textSize);
width = textSize.cx;
if (hitcontact->type == CLCIT_GROUP) {
- char *szCounts;
+ TCHAR *szCounts;
szCounts = pcli->pfnGetGroupCountsText(dat, hitcontact);
if (szCounts[0]) {
- GetTextExtentPoint32A(hdc, " ", 1, &textSize);
+ GetTextExtentPoint32(hdc, _T(" "), 1, &textSize);
width += textSize.cx;
SelectObject(hdc, dat->fontInfo[FONTID_GROUPCOUNTS].hFont);
- GetTextExtentPoint32A(hdc, szCounts, (int)mir_strlen(szCounts), &textSize);
+ GetTextExtentPoint32(hdc, szCounts, (int)mir_tstrlen(szCounts), &textSize);
width += textSize.cx;
}
}
diff --git a/src/core/stdclist/src/clcpaint.cpp b/src/core/stdclist/src/clcpaint.cpp index f240d2e89a..36e5918a35 100644 --- a/src/core/stdclist/src/clcpaint.cpp +++ b/src/core/stdclist/src/clcpaint.cpp @@ -277,7 +277,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) int hottrack = dat->exStyle & CLS_EX_TRACKSELECT && group->cl.items[group->scanIndex]->type != CLCIT_DIVIDER && dat->iHotTrack == index;
SIZE textSize, countsSize, spaceSize;
int width, checkboxWidth;
- char *szCounts;
+ TCHAR *szCounts;
// alternating grey
if (style & CLS_GREYALTERNATE && index & 1) {
@@ -320,9 +320,9 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) {
szCounts = pcli->pfnGetGroupCountsText(dat, group->cl.items[group->scanIndex]);
if (szCounts[0]) {
- GetTextExtentPoint32A(hdcMem, " ", 1, &spaceSize);
+ GetTextExtentPoint32(hdcMem, _T(" "), 1, &spaceSize);
ChangeToFont(hdcMem, dat, FONTID_GROUPCOUNTS, &fontHeight);
- GetTextExtentPoint32A(hdcMem, szCounts, (int)mir_strlen(szCounts), &countsSize);
+ GetTextExtentPoint32(hdcMem, szCounts, (int)mir_tstrlen(szCounts), &countsSize);
width += spaceSize.cx + countsSize.cx;
}
}
@@ -435,7 +435,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) if (rc.right < rc.left + 4)
rc.right = clRect.right + 1;
else
- TextOutA(hdcMem, rc.right, rc.top + groupCountsFontTopShift, szCounts, (int)mir_strlen(szCounts));
+ TextOut(hdcMem, rc.right, rc.top + groupCountsFontTopShift, szCounts, (int)mir_tstrlen(szCounts));
ChangeToFont(hdcMem, dat, FONTID_GROUPS, &fontHeight);
if (selected)
SetTextColor(hdcMem, dat->selTextColour);
diff --git a/src/modules/clist/clc.h b/src/modules/clist/clc.h index c0100a6b8c..3a79db0804 100644 --- a/src/modules/clist/clc.h +++ b/src/modules/clist/clc.h @@ -71,7 +71,7 @@ void fnSaveStateAndRebuildList(HWND hwnd, struct ClcData *dat); LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
/* clcutils.c */
-char* fnGetGroupCountsText(struct ClcData *dat, ClcContact *contact);
+TCHAR* fnGetGroupCountsText(struct ClcData *dat, ClcContact *contact);
int fnHitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **contact, ClcGroup **group, DWORD * flags);
void fnScrollTo(HWND hwnd, struct ClcData *dat, int desty, int noSmooth);
void fnEnsureVisible(HWND hwnd, struct ClcData *dat, int iItem, int partialOk);
diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp index b08c1a1c12..246c3ab893 100644 --- a/src/modules/clist/clcutils.cpp +++ b/src/modules/clist/clcutils.cpp @@ -29,10 +29,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern HANDLE hHideInfoTipEvent;
-char* fnGetGroupCountsText(struct ClcData *dat, ClcContact *contact)
+TCHAR* fnGetGroupCountsText(struct ClcData *dat, ClcContact *contact)
{
if (contact->type != CLCIT_GROUP || !(dat->exStyle & CLS_EX_SHOWGROUPCOUNTS))
- return "";
+ return _T("");
ClcGroup *group = contact->group, *topgroup = group;
int onlineCount = 0;
@@ -56,10 +56,10 @@ char* fnGetGroupCountsText(struct ClcData *dat, ClcContact *contact) group->scanIndex++;
}
if (onlineCount == 0 && dat->exStyle & CLS_EX_HIDECOUNTSWHENEMPTY)
- return "";
+ return _T("");
- static char szName[32];
- mir_snprintf(szName, SIZEOF(szName), "(%u/%u)", onlineCount, totalCount);
+ static TCHAR szName[32];
+ mir_sntprintf(szName, SIZEOF(szName), _T("(%u/%u)"), onlineCount, totalCount);
return szName;
}
@@ -168,13 +168,13 @@ int fnHitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact * GetTextExtentPoint32(hdc, hitcontact->szText, (int)mir_tstrlen(hitcontact->szText), &textSize);
int width = textSize.cx;
if (hitcontact->type == CLCIT_GROUP) {
- char *szCounts;
+ TCHAR *szCounts;
szCounts = cli.pfnGetGroupCountsText(dat, hitcontact);
if (szCounts[0]) {
- GetTextExtentPoint32A(hdc, " ", 1, &textSize);
+ GetTextExtentPoint32(hdc, _T(" "), 1, &textSize);
width += textSize.cx;
SelectObject(hdc, dat->fontInfo[FONTID_GROUPCOUNTS].hFont);
- GetTextExtentPoint32A(hdc, szCounts, (int)mir_strlen(szCounts), &textSize);
+ GetTextExtentPoint32(hdc, szCounts, (int)mir_tstrlen(szCounts), &textSize);
width += textSize.cx;
}
}
|