diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-04-28 08:14:32 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-04-28 08:14:32 +0000 |
commit | b612f28362fe77f5a6cf8f8b75a0ac86167c7777 (patch) | |
tree | 42a40218246722d3391bed4e222623608ca9b6ad /plugins/Clist_modern | |
parent | ceaff728d741c2c03378f63cb87480052fdc716f (diff) |
minus ansi function
git-svn-id: http://svn.miranda-ng.org/main/trunk@13222 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern')
-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 |
5 files changed, 31 insertions, 36 deletions
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;
}
}
|