summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2015-05-16 14:23:28 +0000
committerKirill Volinsky <mataes2007@gmail.com>2015-05-16 14:23:28 +0000
commit581a7a4fca5155decdc48ee1972af806d24c6ceb (patch)
tree9b9a9be8923231a1ac8a073480d432456ea312a2
parent8677ac8db6aa7528fdb84bf3cd8a996a3f45e254 (diff)
cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@13616 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp10
-rw-r--r--plugins/Clist_modern/src/hdr/modern_commonheaders.h6
-rw-r--r--plugins/Clist_modern/src/hdr/modern_effectenum.h68
-rw-r--r--plugins/Clist_modern/src/hdr/modern_log.h2
-rw-r--r--plugins/Clist_modern/src/modern_aniavatars.cpp8
-rw-r--r--plugins/Clist_modern/src/modern_cachefuncs.cpp40
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp12
-rw-r--r--plugins/Clist_modern/src/modern_clcidents.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clcmsgs.cpp156
-rw-r--r--plugins/Clist_modern/src/modern_clcopts.cpp38
-rw-r--r--plugins/Clist_modern/src/modern_clcpaint.cpp930
-rw-r--r--plugins/Clist_modern/src/modern_clcutils.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_clistmod.cpp5
-rw-r--r--plugins/Clist_modern/src/modern_clisttray.cpp47
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp18
-rw-r--r--plugins/Clist_modern/src/modern_row.cpp72
-rw-r--r--plugins/Clist_modern/src/modern_rowheight_funcs.cpp8
-rw-r--r--plugins/Clist_modern/src/modern_rowtemplateopt.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_skinbutton.cpp24
-rw-r--r--plugins/Clist_modern/src/modern_skinengine.cpp48
-rw-r--r--plugins/Clist_modern/src/modern_skinopt.cpp232
-rw-r--r--plugins/Clist_modern/src/modern_skinselector.cpp15
-rw-r--r--plugins/Clist_modern/src/modern_statusbar.cpp12
-rw-r--r--plugins/Clist_modern/src/modern_tbbutton.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_toolbar.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_utils.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_viewmodebar.cpp28
27 files changed, 896 insertions, 903 deletions
diff --git a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
index 53170369c0..832f59484f 100644
--- a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
@@ -221,7 +221,7 @@ int CLUIFrames_OnShowHide(int mode)
else SetWindowPos(g_pfwFrames[i].OwnerWindow, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE);
}
}
-
+
if (mode != SW_HIDE)
SetForegroundWindow(pcli->hwndContactList);
AniAva_RedrawAllAvatars(TRUE);
@@ -243,7 +243,7 @@ static int id2pos(int id)
for (int i = 0; i < g_nFramesCount; i++)
if (g_pfwFrames[i].id == id)
return i;
-
+
return -1;
};
@@ -292,7 +292,7 @@ int FindFrameID(HWND FrameHwnd)
{
if (FrameHwnd == NULL)
return 0;
-
+
FRAMEWND *frm = FindFrameByItsHWND(FrameHwnd);
return (frm) ? frm->id : 0;
}
@@ -595,8 +595,8 @@ static void GetBorderSize(HWND hwnd, RECT *rect)
static char __inline *AS(char *str, const char *setting, char *addstr)
{
if (str != NULL) {
- strcpy(str, setting);
- strcat(str, addstr);
+ mir_strcpy(str, setting);
+ mir_strcat(str, addstr);
}
return str;
}
diff --git a/plugins/Clist_modern/src/hdr/modern_commonheaders.h b/plugins/Clist_modern/src/hdr/modern_commonheaders.h
index ab4108520f..f1e5cbcce0 100644
--- a/plugins/Clist_modern/src/hdr/modern_commonheaders.h
+++ b/plugins/Clist_modern/src/hdr/modern_commonheaders.h
@@ -290,19 +290,19 @@ public:
HashStringKeyNoCase(const char* szKey)
{
- _strKey = _strdup(szKey);
+ _strKey = mir_strdup(szKey);
_CreateHashKey();
}
HashStringKeyNoCase(const HashStringKeyNoCase& hsKey)
{
- _strKey = _strdup(hsKey._strKey);
+ _strKey = mir_strdup(hsKey._strKey);
_dwKey = hsKey._dwKey;
}
HashStringKeyNoCase& operator= (const HashStringKeyNoCase& hsKey)
{
- _strKey = _strdup(hsKey._strKey);
+ _strKey = mir_strdup(hsKey._strKey);
_dwKey = hsKey._dwKey;
}
diff --git a/plugins/Clist_modern/src/hdr/modern_effectenum.h b/plugins/Clist_modern/src/hdr/modern_effectenum.h
index 0a63ffbdce..b15c4a1f11 100644
--- a/plugins/Clist_modern/src/hdr/modern_effectenum.h
+++ b/plugins/Clist_modern/src/hdr/modern_effectenum.h
@@ -20,7 +20,7 @@ typedef struct _MODERNEFFECT
}MODERNEFFECT;
#ifdef _EFFECTENUM_FULL_H
-TCHAR * ModernEffectNames[]=
+TCHAR * ModernEffectNames[] =
#else
TCHAR * _ModernEffectNames[] =
#endif
@@ -35,51 +35,51 @@ TCHAR * _ModernEffectNames[] =
};
#ifdef _EFFECTENUM_FULL_H
-MODERNEFFECTMATRIX ModernEffectsEnum[]={
+MODERNEFFECTMATRIX ModernEffectsEnum[] = {
{ //Shadow at Left
- { 0, 0, 0, 0, 0,
- 0, 4, 16, 4, 4,
- 0, 16, 64, 32, 16,
- 0, 4, 32, 32, 16,
- 0, 4, 16, 16, 16 }, 2,2,2,2,1},
+ { 0, 0, 0, 0, 0,
+ 0, 4, 16, 4, 4,
+ 0, 16, 64, 32, 16,
+ 0, 4, 32, 32, 16,
+ 0, 4, 16, 16, 16 }, 2, 2, 2, 2, 1 },
{ //Shadow at Right
- { 0, 0, 0, 0, 0,
- 4, 4, 16, 4, 0,
- 16, 32, 64, 16, 0,
- 16, 32, 32, 4, 0,
- 16, 16, 16, 4, 0 }, 2,2,2,2,1},
+ { 0, 0, 0, 0, 0,
+ 4, 4, 16, 4, 0,
+ 16, 32, 64, 16, 0,
+ 16, 32, 32, 4, 0,
+ 16, 16, 16, 4, 0 }, 2, 2, 2, 2, 1 },
{ //Outline
- { 0, 0, 0, 0, 0,
- 0, 16, 16, 16, 0,
- 0, 16, 32, 16, 0,
- 0, 16, 16, 16, 0,
- 0, 0, 0, 0, 0 }, 1,1,1,1,1},
+ { 0, 0, 0, 0, 0,
+ 0, 16, 16, 16, 0,
+ 0, 16, 32, 16, 0,
+ 0, 16, 16, 16, 0,
+ 0, 0, 0, 0, 0 }, 1, 1, 1, 1, 1 },
{ //Outline smooth
- { 4, 4, 4, 4, 4,
- 4, 8, 8, 8, 4,
- 4, 8, 32, 8, 4,
- 4, 8, 8, 8, 4,
- 4, 4, 4, 4, 4 }, 2,2,2,2,1},
+ { 4, 4, 4, 4, 4,
+ 4, 8, 8, 8, 4,
+ 4, 8, 32, 8, 4,
+ 4, 8, 8, 8, 4,
+ 4, 4, 4, 4, 4 }, 2, 2, 2, 2, 1 },
{ //Smooth bump
- { -2, 2, 2, 2, 2,
- -2, -16, 16, 16, 2,
- -2, -16, 48, 16, 2,
- -2, -16,-16, 16, 2,
- -2, -2, -2, -2, -2 }, 2,2,2,2,1+0x80},
+ { -2, 2, 2, 2, 2,
+ -2, -16, 16, 16, 2,
+ -2, -16, 48, 16, 2,
+ -2, -16, -16, 16, 2,
+ -2, -2, -2, -2, -2 }, 2, 2, 2, 2, 1 + 0x80 },
{ //Contour thin
- { 0, 0, 0, 0, 0,
- 0, 48, 64, 48, 0,
- 0, 64, 64, 64, 0,
- 0, 48, 64, 48, 0,
- 0, 0, 0, 0, 0 }, 1,1,1,1,1},
+ { 0, 0, 0, 0, 0,
+ 0, 48, 64, 48, 0,
+ 0, 64, 64, 64, 0,
+ 0, 48, 64, 48, 0,
+ 0, 0, 0, 0, 0 }, 1, 1, 1, 1, 1 },
{ //Contour heavy
- { 8, 16, 16, 16, 8,
+ { 8, 16, 16, 16, 8,
16, 64, 64, 64, 16,
16, 64, 64, 64, 16,
16, 64, 64, 64, 16,
- 8, 16, 16, 16, 8 }, 2,2,2,2,1},
+ 8, 16, 16, 16, 8 }, 2, 2, 2, 2, 1 },
};
#endif
diff --git a/plugins/Clist_modern/src/hdr/modern_log.h b/plugins/Clist_modern/src/hdr/modern_log.h
index 468dc5117d..b96eaafd65 100644
--- a/plugins/Clist_modern/src/hdr/modern_log.h
+++ b/plugins/Clist_modern/src/hdr/modern_log.h
@@ -5,7 +5,7 @@
#ifdef _DEBUG
-void Log(const char *file,int line,const char *fmt,...);
+void Log(const char *file, int line, const char *fmt, ...);
#define log0(s) Log(__FILE__,__LINE__,s)
#define log1(s,a) Log(__FILE__,__LINE__,s,a)
diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp
index 4981ac56d4..14548b7f21 100644
--- a/plugins/Clist_modern/src/modern_aniavatars.cpp
+++ b/plugins/Clist_modern/src/modern_aniavatars.cpp
@@ -153,7 +153,7 @@ static int _AniAva_SortAvatarInfo(const ANIAVA_INFO *aai1, const ANIAVA_INFO *aa
{
int res;
if (aai1 && aai1->tcsFilename && aai2 && aai2->tcsFilename)
- res = _tcsicmp(aai2->tcsFilename, aai1->tcsFilename);
+ res = mir_tstrcmpi(aai2->tcsFilename, aai1->tcsFilename);
else {
int a1 = (aai1 != NULL && aai1->tcsFilename != NULL);
int a2 = (aai2 != NULL && aai2->tcsFilename != NULL);
@@ -188,7 +188,7 @@ static void _AniAva_AnimationTreadProc(void*)
DWORD rc = MsgWaitForMultipleObjectsEx(1, &s_hExitEvent, INFINITE, QS_ALLINPUT, MWMO_ALERTABLE);
if (MirandaExiting())
break;
-
+
ResetEvent(s_hExitEvent);
if (rc == WAIT_OBJECT_0 + 1) {
MSG msg;
@@ -228,7 +228,7 @@ static void CALLBACK _AniAva_SyncCallerUserAPCProc(DWORD_PTR dwParam)
static INT_PTR _AniAva_CreateAvatarWindowSync_Worker(WPARAM tszName, LPARAM)
{
- HWND hwnd = CreateWindowEx(WS_EX_TOPMOST | WS_EX_TRANSPARENT | WS_EX_NOPARENTNOTIFY, ANIAVAWINDOWCLASS,
+ HWND hwnd = CreateWindowEx(WS_EX_TOPMOST | WS_EX_TRANSPARENT | WS_EX_NOPARENTNOTIFY, ANIAVAWINDOWCLASS,
(TCHAR*)tszName, WS_POPUP, 0, 0, 1, 1, pcli->hwndContactList, NULL, pcli->hInst, NULL);
return (INT_PTR)hwnd;
}
@@ -305,7 +305,7 @@ static void _AniAva_RealRemoveAvatar(DWORD UniqueID)
taai->nStripTop -= aai->FrameSize.cx*aai->nFrameCount;
}
}
-
+
if (s_AniAvatarList.getCount() > 0) {
int newWidth = s_width - aai->FrameSize.cx*aai->nFrameCount;
int newHeight = 0;
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp
index d586363953..218618edc2 100644
--- a/plugins/Clist_modern/src/modern_cachefuncs.cpp
+++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp
@@ -83,7 +83,7 @@ void CSmileyString::AddListeningToIcon(SHORTDATA *dat, TCHAR *szText)
if (szText == NULL)
return;
- int text_size = (int)_tcslen(szText);
+ int text_size = (int)mir_tstrlen(szText);
plText = List_Create(0, 1);
@@ -189,7 +189,7 @@ void CSmileyString::ReplaceSmileys(SHORTDATA *dat, ClcCacheEntry *pdnce, TCHAR *
if (!dat->text_replace_smileys || !replace_smileys || szText == NULL)
return;
- int text_size = (int)_tcslen(szText);
+ int text_size = (int)mir_tstrlen(szText);
// Call service for the first time to see if needs to be used...
SMADD_BATCHPARSE2 sp = { 0 };
@@ -304,7 +304,7 @@ int GetStatusName(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xstatus
// Get Status name
TCHAR *tmp = pcli->pfnGetStatusModeDescription(nStatus, 0);
if (tmp && *tmp) {
- _tcsncpy_s(text, text_size, tmp, _TRUNCATE);
+ mir_tstrncpy(text, tmp, text_size);
return 1;
}
@@ -459,7 +459,7 @@ int Cache_GetLineText(
// Try to get XStatusName
if (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
if (dbv.ptszVal != NULL && dbv.ptszVal[0] != 0)
- _tcsncpy_s(text, text_size, dbv.ptszVal, _TRUNCATE);
+ mir_tstrncpy(text, dbv.ptszVal, text_size);
CopySkipUnprintableChars(text, text, text_size - 1);
db_free(&dbv);
}
@@ -484,13 +484,13 @@ int Cache_GetLineText(
return TEXT_LISTENING_TO;
case TEXT_TEXT:
- {
- TCHAR *tmp = variables_parsedup(variable_text, pdnce->tszName, pdnce->hContact);
- mir_tstrncpy(text, tmp, text_size);
- mir_free(tmp);
- CopySkipUnprintableChars(text, text, text_size - 1);
- }
- return TEXT_TEXT;
+ {
+ TCHAR *tmp = variables_parsedup(variable_text, pdnce->tszName, pdnce->hContact);
+ mir_tstrncpy(text, tmp, text_size);
+ mir_free(tmp);
+ CopySkipUnprintableChars(text, text, text_size - 1);
+ }
+ return TEXT_TEXT;
case TEXT_CONTACT_TIME:
if (pdnce->hTimeZone) {
@@ -523,7 +523,7 @@ void Cache_GetFirstLineText(ClcData *dat, ClcContact *contact)
db_free(&dbv);
// They are the same -> use the name to keep the case
- if (_tcsicmp(name, nick) == 0)
+ if (mir_tstrcmpi(name, nick) == 0)
mir_tstrncpy(contact->szText, name, SIZEOF(contact->szText));
else
// Append then
@@ -551,8 +551,8 @@ void Cache_GetSecondLineText(SHORTDATA *dat, ClcCacheEntry *pdnce)
if (dat->second_line_show)
type = Cache_GetLineText(pdnce, dat->second_line_type, Text, SIZEOF(Text), dat->second_line_text,
- dat->second_line_xstatus_has_priority, dat->second_line_show_status_if_no_away, dat->second_line_show_listening_if_no_away,
- dat->second_line_use_name_and_message_for_xstatus, dat->contact_time_show_only_if_different);
+ dat->second_line_xstatus_has_priority, dat->second_line_show_status_if_no_away, dat->second_line_show_listening_if_no_away,
+ dat->second_line_use_name_and_message_for_xstatus, dat->contact_time_show_only_if_different);
Text[SIZEOF(Text) - 1] = 0; //to be sure that it is null terminated string
@@ -575,8 +575,8 @@ void Cache_GetThirdLineText(SHORTDATA *dat, ClcCacheEntry *pdnce)
int type = TEXT_EMPTY;
if (dat->third_line_show)
type = Cache_GetLineText(pdnce, dat->third_line_type, Text, SIZEOF(Text), dat->third_line_text,
- dat->third_line_xstatus_has_priority, dat->third_line_show_status_if_no_away, dat->third_line_show_listening_if_no_away,
- dat->third_line_use_name_and_message_for_xstatus, dat->contact_time_show_only_if_different);
+ dat->third_line_xstatus_has_priority, dat->third_line_show_status_if_no_away, dat->third_line_show_listening_if_no_away,
+ dat->third_line_use_name_and_message_for_xstatus, dat->contact_time_show_only_if_different);
Text[SIZEOF(Text) - 1] = 0; //to be sure that it is null terminated string
@@ -592,8 +592,8 @@ void Cache_GetThirdLineText(SHORTDATA *dat, ClcCacheEntry *pdnce)
void RemoveTag(TCHAR *to, TCHAR *tag)
{
TCHAR *st = to;
- int len = (int)_tcslen(tag);
- int lastsize = (int)_tcslen(to) + 1;
+ int len = (int)mir_tstrlen(tag);
+ int lastsize = (int)mir_tstrlen(to) + 1;
while (st = _tcsstr(st, tag)) {
lastsize -= len;
memmove((void*)st, (void*)(st + len), (lastsize)*sizeof(TCHAR));
@@ -712,7 +712,7 @@ void Cache_ProceedAvatarInList(ClcData *dat, ClcContact *contact)
// Avatar was not ready or removed - need to remove it from cache
if (old_pos >= 0) {
ImageArray_RemoveImage(&dat->avatar_cache, old_pos);
-
+
// Update all items
ExecuteOnAllContacts(dat, ReduceAvatarPosition, (void *)&old_pos);
contact->avatar_pos = AVATAR_POS_DONT_HAVE;
@@ -753,7 +753,7 @@ void Cache_ProceedAvatarInList(ClcData *dat, ClcContact *contact)
DrawAvatarImageWithGDIp(hdc, 0, 0, width_clip, height_clip, ace->hbmPic, 0, 0, ace->bmWidth, ace->bmHeight, ace->dwFlags, 255);
SelectObject(hdc, oldBmp);
DeleteDC(hdc);
-
+
// Add to list
if (old_pos >= 0) {
ImageArray_ChangeImage(&dat->avatar_cache, hDrawBmp, old_pos);
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index ab01d8fa73..9683c423d9 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -1268,7 +1268,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam,
TCHAR *shortGroup = NULL;
TCHAR *sourceGrName = mir_tstrdup(pcli->pfnGetGroupName(destgroup->groupId, 0));
if (groupName) {
- int len = (int)_tcslen(groupName);
+ int len = (int)mir_tstrlen(groupName);
do { len--; } while (len >= 0 && groupName[len] != '\\');
if (len >= 0) shortGroup = groupName + len + 1;
else shortGroup = groupName;
@@ -1278,7 +1278,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam,
if (sourceGrName)
mir_sntprintf(newName, SIZEOF(newName), _T("%s\\%s"), sourceGrName, shortGroup);
else
- _tcsncpy_s(newName, shortGroup, _TRUNCATE);
+ mir_tstrncpy(newName, shortGroup, SIZEOF(newName));
}
mir_free(groupName);
mir_free(sourceGrName);
@@ -1621,8 +1621,8 @@ static int clcHookModulesLoaded(WPARAM, LPARAM)
if (!ServiceExists(MS_AV_GETAVATARBITMAP))
MessageBox(NULL,
- TranslateT("Clist Modern requires AVS plugin to be present. Install it using PluginUpdater or download from http://wiki.miranda-ng.org/Download"),
- TranslateT("Error loading plugin"), MB_ICONERROR | MB_OK);
+ TranslateT("Clist Modern requires AVS plugin to be present. Install it using PluginUpdater or download from http://wiki.miranda-ng.org/Download"),
+ TranslateT("Error loading plugin"), MB_ICONERROR | MB_OK);
HookEvent(ME_AV_AVATARCHANGED, clcHookAvatarChanged);
@@ -1781,7 +1781,7 @@ int ClcGetShortData(ClcData* pData, SHORTDATA *pShortData)
pShortData->second_line_draw_smileys = pData->second_line_draw_smileys;
pShortData->second_line_type = pData->second_line_type;
- _tcsncpy(pShortData->second_line_text, pData->second_line_text, TEXT_TEXT_MAX_LENGTH);
+ mir_tstrncpy(pShortData->second_line_text, pData->second_line_text, SIZEOF(pShortData->second_line_text));
pShortData->second_line_xstatus_has_priority = pData->second_line_xstatus_has_priority;
pShortData->second_line_show_status_if_no_away = pData->second_line_show_status_if_no_away;
@@ -1793,7 +1793,7 @@ int ClcGetShortData(ClcData* pData, SHORTDATA *pShortData)
pShortData->third_line_draw_smileys = pData->third_line_draw_smileys;
pShortData->third_line_type = pData->third_line_type;
- _tcsncpy(pShortData->third_line_text, pData->third_line_text, TEXT_TEXT_MAX_LENGTH);
+ mir_tstrncpy(pShortData->third_line_text, pData->third_line_text, SIZEOF(pShortData->third_line_text));
pShortData->third_line_xstatus_has_priority = pData->third_line_xstatus_has_priority;
pShortData->third_line_show_status_if_no_away = pData->third_line_show_status_if_no_away;
diff --git a/plugins/Clist_modern/src/modern_clcidents.cpp b/plugins/Clist_modern/src/modern_clcidents.cpp
index 87ca223163..8e04c56eea 100644
--- a/plugins/Clist_modern/src/modern_clcidents.cpp
+++ b/plugins/Clist_modern/src/modern_clcidents.cpp
@@ -74,7 +74,7 @@ int cliGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex)
if (c->type == CLCIT_GROUP) {
if (c->group == subgroup && contactIndex == -1)
return count - 1;
-
+
if (c->group->expanded) {
group = c->group;
group->scanIndex = 0;
diff --git a/plugins/Clist_modern/src/modern_clcmsgs.cpp b/plugins/Clist_modern/src/modern_clcmsgs.cpp
index a706bfb938..849270026b 100644
--- a/plugins/Clist_modern/src/modern_clcmsgs.cpp
+++ b/plugins/Clist_modern/src/modern_clcmsgs.cpp
@@ -62,17 +62,17 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wP
return 0;
case CLM_SETHIDEEMPTYGROUPS:
- {
- BOOL old = ((GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) != 0);
- if (wParam)
- SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | CLS_HIDEEMPTYGROUPS);
- else
- SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) &~CLS_HIDEEMPTYGROUPS);
- BOOL newval = ((GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) != 0);
- if (newval != old)
- pcli->pfnInitAutoRebuild(hwnd);
- }
- return 0;
+ {
+ BOOL old = ((GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) != 0);
+ if (wParam)
+ SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | CLS_HIDEEMPTYGROUPS);
+ else
+ SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) &~CLS_HIDEEMPTYGROUPS);
+ BOOL newval = ((GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) != 0);
+ if (newval != old)
+ pcli->pfnInitAutoRebuild(hwnd);
+ }
+ return 0;
case CLM_SETTEXTCOLOR:
if (wParam > FONTID_MODERN_MAX) break;
@@ -105,76 +105,76 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wP
return 0;
case CLM_GETNEXTITEM:
- {
- int i = 0;
- if (wParam != CLGN_ROOT) {
- if (!pcli->pfnFindItem(hwnd, dat, lParam, &contact, &group, NULL))
- return NULL;
- i = List_IndexOf((SortedList*)&group->cl, contact);
- if (i < 0) return 0;
- }
- switch (wParam) {
- case CLGN_ROOT:
- if (dat->list.cl.count)
- return (LRESULT)pcli->pfnContactToHItem(dat->list.cl.items[0]);
- else
- return NULL;
- case CLGN_CHILD:
- if (contact->type != CLCIT_GROUP)
- return NULL;
- group = contact->group;
- if (group->cl.count == 0)
- return NULL;
- return (LRESULT)pcli->pfnContactToHItem(group->cl.items[0]);
- case CLGN_PARENT:
- return group->groupId | HCONTACT_ISGROUP;
- case CLGN_NEXT:
- do {
- if (++i >= group->cl.count)
- return NULL;
- } while (group->cl.items[i]->type == CLCIT_DIVIDER);
- return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
- case CLGN_PREVIOUS:
- do {
- if (--i < 0)
- return NULL;
- } while (group->cl.items[i]->type == CLCIT_DIVIDER);
- return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
- case CLGN_NEXTCONTACT:
- for (i++; i < group->cl.count; i++)
- if (group->cl.items[i]->type == CLCIT_CONTACT)
- break;
- if (i >= group->cl.count)
- return NULL;
- return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
- case CLGN_PREVIOUSCONTACT:
- if (i >= group->cl.count)
- return NULL;
- for (i--; i >= 0; i--)
- if (group->cl.items[i]->type == CLCIT_CONTACT)
- break;
- if (i < 0)
- return NULL;
- return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
- case CLGN_NEXTGROUP:
- for (i++; i < group->cl.count; i++)
- if (group->cl.items[i]->type == CLCIT_GROUP)
- break;
- if (i >= group->cl.count)
- return NULL;
- return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
- case CLGN_PREVIOUSGROUP:
- if (i >= group->cl.count)
+ {
+ int i = 0;
+ if (wParam != CLGN_ROOT) {
+ if (!pcli->pfnFindItem(hwnd, dat, lParam, &contact, &group, NULL))
+ return NULL;
+ i = List_IndexOf((SortedList*)&group->cl, contact);
+ if (i < 0) return 0;
+ }
+ switch (wParam) {
+ case CLGN_ROOT:
+ if (dat->list.cl.count)
+ return (LRESULT)pcli->pfnContactToHItem(dat->list.cl.items[0]);
+ else
+ return NULL;
+ case CLGN_CHILD:
+ if (contact->type != CLCIT_GROUP)
+ return NULL;
+ group = contact->group;
+ if (group->cl.count == 0)
+ return NULL;
+ return (LRESULT)pcli->pfnContactToHItem(group->cl.items[0]);
+ case CLGN_PARENT:
+ return group->groupId | HCONTACT_ISGROUP;
+ case CLGN_NEXT:
+ do {
+ if (++i >= group->cl.count)
return NULL;
- for (i--; i >= 0; i--)
- if (group->cl.items[i]->type == CLCIT_GROUP)
- break;
- if (i < 0)
+ } while (group->cl.items[i]->type == CLCIT_DIVIDER);
+ return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
+ case CLGN_PREVIOUS:
+ do {
+ if (--i < 0)
return NULL;
- return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
- }
+ } while (group->cl.items[i]->type == CLCIT_DIVIDER);
+ return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
+ case CLGN_NEXTCONTACT:
+ for (i++; i < group->cl.count; i++)
+ if (group->cl.items[i]->type == CLCIT_CONTACT)
+ break;
+ if (i >= group->cl.count)
+ return NULL;
+ return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
+ case CLGN_PREVIOUSCONTACT:
+ if (i >= group->cl.count)
+ return NULL;
+ for (i--; i >= 0; i--)
+ if (group->cl.items[i]->type == CLCIT_CONTACT)
+ break;
+ if (i < 0)
+ return NULL;
+ return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
+ case CLGN_NEXTGROUP:
+ for (i++; i < group->cl.count; i++)
+ if (group->cl.items[i]->type == CLCIT_GROUP)
+ break;
+ if (i >= group->cl.count)
+ return NULL;
+ return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
+ case CLGN_PREVIOUSGROUP:
+ if (i >= group->cl.count)
+ return NULL;
+ for (i--; i >= 0; i--)
+ if (group->cl.items[i]->type == CLCIT_GROUP)
+ break;
+ if (i < 0)
+ return NULL;
+ return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
}
- return NULL;
+ }
+ return NULL;
case CLM_SELECTITEM:
ClcGroup *tgroup;
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp
index 16a41b358c..dacd58ece0 100644
--- a/plugins/Clist_modern/src/modern_clcopts.cpp
+++ b/plugins/Clist_modern/src/modern_clcopts.cpp
@@ -135,33 +135,33 @@ void RegisterCLUIFonts(void)
int index = 0;
fontid.cbSize = sizeof(fontid);
- strncpy(fontid.dbSettingsGroup, "CLC", SIZEOF(fontid.dbSettingsGroup));
+ mir_strncpy(fontid.dbSettingsGroup, "CLC", SIZEOF(fontid.dbSettingsGroup));
effectid.cbSize = sizeof(effectid);
- strncpy(effectid.dbSettingsGroup, "CLC", SIZEOF(effectid.dbSettingsGroup));
+ mir_strncpy(effectid.dbSettingsGroup, "CLC", SIZEOF(effectid.dbSettingsGroup));
for (int i = 0; i < SIZEOF(fontOptionsList); i++, index++) {
fontid.flags = FIDF_DEFAULTVALID | FIDF_APPENDNAME | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_ALLOWREREGISTER | FIDF_NOAS;
fontid.flags |= fontOptionsList[i].dwFlags;
- _tcsncpy(fontid.group, fontOptionsList[i].szGroup, SIZEOF(fontid.group));
- _tcsncpy(fontid.name, fontOptionsList[i].szDescr, SIZEOF(fontid.name));
+ mir_tstrncpy(fontid.group, fontOptionsList[i].szGroup, SIZEOF(fontid.group));
+ mir_tstrncpy(fontid.name, fontOptionsList[i].szDescr, SIZEOF(fontid.name));
mir_snprintf(idstr, SIZEOF(idstr), "Font%d", fontOptionsList[i].fontID);
- strncpy(fontid.prefix, idstr, SIZEOF(fontid.prefix));
+ mir_strncpy(fontid.prefix, idstr, SIZEOF(fontid.prefix));
fontid.order = i + 1;
fontid.deffontsettings.charset = fontOptionsList[i].defCharset;
fontid.deffontsettings.colour = fontOptionsList[i].defColour;
fontid.deffontsettings.size = fontOptionsList[i].defSize;
fontid.deffontsettings.style = fontOptionsList[i].defStyle;
- _tcsncpy(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, SIZEOF(fontid.deffontsettings.szFace));
+ mir_tstrncpy(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, SIZEOF(fontid.deffontsettings.szFace));
FontRegisterT(&fontid);
- _tcsncpy(effectid.group, fontOptionsList[i].szGroup, SIZEOF(effectid.group));
- _tcsncpy(effectid.name, fontOptionsList[i].szDescr, SIZEOF(effectid.name));
+ mir_tstrncpy(effectid.group, fontOptionsList[i].szGroup, SIZEOF(effectid.group));
+ mir_tstrncpy(effectid.name, fontOptionsList[i].szDescr, SIZEOF(effectid.name));
mir_snprintf(idstr, SIZEOF(idstr), "Font%d", fontOptionsList[i].fontID);
- strncpy(effectid.setting, idstr, SIZEOF(effectid.setting));
+ mir_strncpy(effectid.setting, idstr, SIZEOF(effectid.setting));
effectid.order = i + 1;
effectid.defeffect.effectIndex = fontOptionsList[i].defeffect.effectIndex;
@@ -175,10 +175,10 @@ void RegisterCLUIFonts(void)
colourid.cbSize = sizeof(colourid);
for (int i = 0; i < SIZEOF(colourOptionsList); i++) {
- _tcsncpy(colourid.group, colourOptionsList[i].szGroup, SIZEOF(colourid.group));
- _tcsncpy(colourid.name, colourOptionsList[i].szDescr, SIZEOF(colourid.group));
- strncpy(colourid.setting, colourOptionsList[i].chName, SIZEOF(colourid.setting));
- strncpy(colourid.dbSettingsGroup, colourOptionsList[i].chGroup, SIZEOF(colourid.dbSettingsGroup));
+ mir_tstrncpy(colourid.group, colourOptionsList[i].szGroup, SIZEOF(colourid.group));
+ mir_tstrncpy(colourid.name, colourOptionsList[i].szDescr, SIZEOF(colourid.group));
+ mir_strncpy(colourid.setting, colourOptionsList[i].chName, SIZEOF(colourid.setting));
+ mir_strncpy(colourid.dbSettingsGroup, colourOptionsList[i].chGroup, SIZEOF(colourid.dbSettingsGroup));
colourid.defcolour = colourOptionsList[i].defColour;
colourid.order = i + 1;
ColourRegisterT(&colourid);
@@ -211,8 +211,8 @@ void GetFontSetting(int i, LOGFONT *lf, COLORREF *colour, BYTE *effect, COLORREF
FontIDT fontid = { 0 };
fontid.cbSize = sizeof(fontid);
- _tcsncpy(fontid.group, fontOptionsList[index].szGroup, SIZEOF(fontid.group));
- _tcsncpy(fontid.name, fontOptionsList[index].szDescr, SIZEOF(fontid.name));
+ mir_tstrncpy(fontid.group, fontOptionsList[index].szGroup, SIZEOF(fontid.group));
+ mir_tstrncpy(fontid.name, fontOptionsList[index].szDescr, SIZEOF(fontid.name));
COLORREF col = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)lf);
@@ -1263,7 +1263,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
dat->item = (struct BkgrItem*)mir_alloc(sizeof(struct BkgrItem)*dat->count);
dat->indx = CB_ERR;
for (indx = 0; indx < dat->count; indx++) {
- char *module = bkgrList[indx] + strlen(bkgrList[indx]) + 1;
+ char *module = bkgrList[indx] + mir_strlen(bkgrList[indx]) + 1;
int jndx;
dat->item[indx].changed = FALSE;
@@ -1276,7 +1276,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
if (!db_get_s(NULL, module, "BkBitmap", &dbv)) {
int retval = PathToAbsolute(dbv.pszVal, dat->item[indx].filename);
if (!retval || retval == CALLSERVICE_NOTFOUND)
- mir_strncpy(dat->item[indx].filename, dbv.pszVal, MAX_PATH);
+ mir_strncpy(dat->item[indx].filename, dbv.pszVal, SIZEOF(dat->item[indx].filename));
mir_free(dbv.pszVal);
}
else *dat->item[indx].filename = 0;
@@ -1429,7 +1429,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
if (!p.changed)
continue;
- char *module = bkgrList[indx] + strlen(bkgrList[indx]) + 1;
+ char *module = bkgrList[indx] + mir_strlen(bkgrList[indx]) + 1;
db_set_b(NULL, module, "UseBitmap", (BYTE)p.useBitmap);
COLORREF col;
@@ -1467,7 +1467,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
static INT_PTR BkgrCfg_Register(WPARAM wParam, LPARAM lParam)
{
char *szSetting = (char*)wParam;
- size_t len = strlen(szSetting) + 1;
+ size_t len = mir_strlen(szSetting) + 1;
char *value = (char *)mir_alloc(len + 4); // add room for flags (DWORD)
memcpy(value, szSetting, len);
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp
index 6280bda195..cca4d6844b 100644
--- a/plugins/Clist_modern/src/modern_clcpaint.cpp
+++ b/plugins/Clist_modern/src/modern_clcpaint.cpp
@@ -438,7 +438,7 @@ void CLCPaint::_DrawTextSmiley(HDC hdcMem, RECT *free_rc, SIZE * text_size, TCH
int pos_x = 0;
int row_height;
RECT tmp_rc = *free_rc;
- if (len == -1) len = (int)_tcslen(szText);
+ if (len == -1) len = (int)mir_tstrlen(szText);
if (uTextFormat & DT_RTLREADING)
i = plText->realCount - 1;
else
@@ -539,14 +539,14 @@ void CLCPaint::_FillParam(MASKPARAM * lpParam, DWORD dwParamHash, const char* c
{
lpParam->bMaskParamFlag = MPF_EQUAL | MPF_HASHED;
lpParam->dwId = dwParamHash;
-
+
if (!dwValueHash && szValue && szValue[0])
lpParam->dwValueHash = mod_CalcHash(szValue);
else
lpParam->dwValueHash = dwValueHash;
-
+
if (szValue)
- lpParam->szValue = strdupn(szValue, (int)strlen(szValue));
+ lpParam->szValue = strdupn(szValue, (int)mir_strlen(szValue));
else
lpParam->szValue = NULL;
}
@@ -572,7 +572,7 @@ MODERNMASK *CLCPaint::_GetCLCContactRowBackModernMask(ClcGroup *group, ClcContac
_AddParamShort(mpModernMask, hi_Open, (Drawing->group && Drawing->group->expanded) ? hi_True : hi_False);
_AddParamShort(mpModernMask, hi_IsEmpty, (Drawing->group->cl.count == 0) ? hi_True : hi_False);
break;
-
+
case CLCIT_CONTACT:
{
ClcContact *mCont = Drawing;
@@ -599,17 +599,17 @@ MODERNMASK *CLCPaint::_GetCLCContactRowBackModernMask(ClcGroup *group, ClcContac
AddParam(mpModernMask, HASH[hi_Protocol], Drawing->proto, 0);
_AddParamShort(mpModernMask, hi_RootGroup, (group && group->parent == NULL) ? hi_True : hi_False);
switch (GetContactCachedStatus(Drawing->hContact)) {
- case ID_STATUS_ONLINE: _AddParamShort(mpModernMask, hi_Status, hi_ONLINE); break;
- case ID_STATUS_AWAY: _AddParamShort(mpModernMask, hi_Status, hi_AWAY); break;
- case ID_STATUS_DND: _AddParamShort(mpModernMask, hi_Status, hi_DND); break;
- case ID_STATUS_NA: _AddParamShort(mpModernMask, hi_Status, hi_NA); break;
- case ID_STATUS_OCCUPIED: _AddParamShort(mpModernMask, hi_Status, hi_OCCUPIED); break;
- case ID_STATUS_FREECHAT: _AddParamShort(mpModernMask, hi_Status, hi_FREECHAT); break;
- case ID_STATUS_INVISIBLE: _AddParamShort(mpModernMask, hi_Status, hi_INVISIBLE); break;
- case ID_STATUS_OUTTOLUNCH: _AddParamShort(mpModernMask, hi_Status, hi_OUTTOLUNCH); break;
- case ID_STATUS_ONTHEPHONE: _AddParamShort(mpModernMask, hi_Status, hi_ONTHEPHONE); break;
- case ID_STATUS_IDLE: _AddParamShort(mpModernMask, hi_Status, hi_IDLE); break;
- default: _AddParamShort(mpModernMask, hi_Status, hi_OFFLINE);
+ case ID_STATUS_ONLINE: _AddParamShort(mpModernMask, hi_Status, hi_ONLINE); break;
+ case ID_STATUS_AWAY: _AddParamShort(mpModernMask, hi_Status, hi_AWAY); break;
+ case ID_STATUS_DND: _AddParamShort(mpModernMask, hi_Status, hi_DND); break;
+ case ID_STATUS_NA: _AddParamShort(mpModernMask, hi_Status, hi_NA); break;
+ case ID_STATUS_OCCUPIED: _AddParamShort(mpModernMask, hi_Status, hi_OCCUPIED); break;
+ case ID_STATUS_FREECHAT: _AddParamShort(mpModernMask, hi_Status, hi_FREECHAT); break;
+ case ID_STATUS_INVISIBLE: _AddParamShort(mpModernMask, hi_Status, hi_INVISIBLE); break;
+ case ID_STATUS_OUTTOLUNCH: _AddParamShort(mpModernMask, hi_Status, hi_OUTTOLUNCH); break;
+ case ID_STATUS_ONTHEPHONE: _AddParamShort(mpModernMask, hi_Status, hi_ONTHEPHONE); break;
+ case ID_STATUS_IDLE: _AddParamShort(mpModernMask, hi_Status, hi_IDLE); break;
+ default: _AddParamShort(mpModernMask, hi_Status, hi_OFFLINE);
}
_AddParamShort(mpModernMask, hi_HasAvatar, (dat->avatars_show && Drawing->avatar_data != NULL) ? hi_True : hi_False);
_AddParamShort(mpModernMask, hi_Rate, hi_None + Drawing->bContactRate);
@@ -623,7 +623,7 @@ MODERNMASK *CLCPaint::_GetCLCContactRowBackModernMask(ClcGroup *group, ClcContac
_AddParamShort(mpModernMask, hi_Type, hi_Info);
break;
}
-
+
if (group->scanIndex == 0 && group->cl.count == 1)
_AddParamShort(mpModernMask, hi_GroupPos, hi_First_Single);
else if (group->scanIndex == 0)
@@ -718,7 +718,7 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
}
else if (Drawing->type == CLCIT_CONTACT)
iImage = Drawing->iImage;
-
+
if (iImage != -1) {
COLORREF colourFg;
int mode;
@@ -1006,67 +1006,67 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
OffsetRect(&p_rect, dx, dy);
if (dat->text_rtl != 0 && gl_RowTabAccess[i]->type != TC_EXTRA /*each extra icon modified separately*/)
_RTLRect(&p_rect, free_row_rc.right);
-
+
SIZE text_size;
switch (gl_RowTabAccess[i]->type) {
case TC_TEXT1:
- {
- // paint text 1
- UINT uTextFormat = (dat->text_rtl ? DT_RTLREADING : 0);
- text_size.cx = p_rect.right - p_rect.left;
- text_size.cy = p_rect.bottom - p_rect.top;
- ChangeToFont(hdcMem, dat, GetBasicFontID(Drawing), NULL);
+ {
+ // paint text 1
+ UINT uTextFormat = (dat->text_rtl ? DT_RTLREADING : 0);
+ text_size.cx = p_rect.right - p_rect.left;
+ text_size.cy = p_rect.bottom - p_rect.top;
+ ChangeToFont(hdcMem, dat, GetBasicFontID(Drawing), NULL);
- uTextFormat |= (gl_RowTabAccess[i]->valign == TC_VCENTER) ? DT_VCENTER : (gl_RowTabAccess[i]->valign == TC_BOTTOM) ? DT_BOTTOM : 0;
- uTextFormat |= (gl_RowTabAccess[i]->halign == TC_HCENTER) ? DT_CENTER : (gl_RowTabAccess[i]->halign == TC_RIGHT) ? DT_RIGHT : 0;
+ uTextFormat |= (gl_RowTabAccess[i]->valign == TC_VCENTER) ? DT_VCENTER : (gl_RowTabAccess[i]->valign == TC_BOTTOM) ? DT_BOTTOM : 0;
+ uTextFormat |= (gl_RowTabAccess[i]->halign == TC_HCENTER) ? DT_CENTER : (gl_RowTabAccess[i]->halign == TC_RIGHT) ? DT_RIGHT : 0;
- uTextFormat = uTextFormat | (gl_TrimText ? DT_END_ELLIPSIS : 0) | DT_SINGLELINE;
- if (Drawing->type == CLCIT_CONTACT) {
- if (selected)
- SetTextColor(hdcMem, dat->selTextColour);
- else if (hottrack)
- _SetHotTrackColour(hdcMem, dat);
- _DrawTextSmiley(hdcMem, &p_rect, &text_size, Drawing->szText, 0, (int)mir_tstrlen(Drawing->szText), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
- if ((dat->filterSearch || selected) && dat->szQuickSearch[0] != '\0') {
- int idx = 0;
- if (dat->filterSearch) {
- TCHAR *lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
- TCHAR *lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch));
- TCHAR *p1 = _tcsstr(lowered, lowered_search);
- if (p1)
- idx = int(p1 - lowered);
- }
- SetTextColor(hdcMem, dat->quickSearchColour);
- _DrawTextSmiley(hdcMem, &p_rect, &text_size, Drawing->szText, idx, (int)mir_tstrlen(dat->szQuickSearch), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
+ uTextFormat = uTextFormat | (gl_TrimText ? DT_END_ELLIPSIS : 0) | DT_SINGLELINE;
+ if (Drawing->type == CLCIT_CONTACT) {
+ if (selected)
+ SetTextColor(hdcMem, dat->selTextColour);
+ else if (hottrack)
+ _SetHotTrackColour(hdcMem, dat);
+ _DrawTextSmiley(hdcMem, &p_rect, &text_size, Drawing->szText, 0, (int)mir_tstrlen(Drawing->szText), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
+ if ((dat->filterSearch || selected) && dat->szQuickSearch[0] != '\0') {
+ int idx = 0;
+ if (dat->filterSearch) {
+ TCHAR *lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
+ TCHAR *lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch));
+ TCHAR *p1 = _tcsstr(lowered, lowered_search);
+ if (p1)
+ idx = int(p1 - lowered);
}
- Drawing->pos_rename_rect = p_rect;
+ SetTextColor(hdcMem, dat->quickSearchColour);
+ _DrawTextSmiley(hdcMem, &p_rect, &text_size, Drawing->szText, idx, (int)mir_tstrlen(dat->szQuickSearch), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
+ }
+ Drawing->pos_rename_rect = p_rect;
- SIZE size;
- GetTextSize(&size, hdcMem, p_rect, Drawing->szText, Drawing->ssText.plText, 0, dat->text_resize_smileys ? 0 : Drawing->ssText.iMaxSmileyHeight);
- Drawing->pos_label = p_rect;
- Drawing->pos_label.right = min(Drawing->pos_label.right, Drawing->pos_label.left + size.cx);
+ SIZE size;
+ GetTextSize(&size, hdcMem, p_rect, Drawing->szText, Drawing->ssText.plText, 0, dat->text_resize_smileys ? 0 : Drawing->ssText.iMaxSmileyHeight);
+ Drawing->pos_label = p_rect;
+ Drawing->pos_label.right = min(Drawing->pos_label.right, Drawing->pos_label.left + size.cx);
+ }
+ else if (Drawing->type == CLCIT_GROUP) {
+ RECT nameRect = p_rect;
+ RECT countRect = { 0 };
+ RECT count_rc = { 0 };
+ SIZE count_size = { 0 };
+ int space_width = 0;
+ TCHAR *szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
+ // Has to draw the count?
+ 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);
+ count_size.cx = count_rc.right - count_rc.left;
+ space_width = count_size.cx;
+ count_rc.right = 0;
+ count_rc.left = 0;
+ 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;
}
- else if (Drawing->type == CLCIT_GROUP) {
- RECT nameRect = p_rect;
- RECT countRect = { 0 };
- RECT count_rc = { 0 };
- SIZE count_size = { 0 };
- int space_width = 0;
- TCHAR *szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
- // Has to draw the count?
- 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);
- count_size.cx = count_rc.right - count_rc.left;
- space_width = count_size.cx;
- count_rc.right = 0;
- count_rc.left = 0;
- 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;
- }
- // modify text rect
+ // modify text rect
{
SIZE text_size = { 0 };
int wid = p_rect.right - p_rect.left;
@@ -1118,66 +1118,66 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
}
Drawing->pos_rename_rect = p_rect;
Drawing->pos_label = nameRect;
- }
}
- break;
+ }
+ break;
case TC_TEXT2:
- {
- // paint text 2
- //
- // Select font
- UINT uTextFormat = (dat->text_rtl ? DT_RTLREADING : 0);
+ {
+ // paint text 2
+ //
+ // Select font
+ UINT uTextFormat = (dat->text_rtl ? DT_RTLREADING : 0);
- if (dat->second_line_show && dat->second_line_type == TEXT_CONTACT_TIME && pdnce->hTimeZone) {
- // Get contact time
- TCHAR buf[70] = _T("");
- mir_free_and_nil(pdnce->szSecondLineText);
+ if (dat->second_line_show && dat->second_line_type == TEXT_CONTACT_TIME && pdnce->hTimeZone) {
+ // Get contact time
+ TCHAR buf[70] = _T("");
+ mir_free_and_nil(pdnce->szSecondLineText);
- tmi.printDateTime(pdnce->hTimeZone, _T("t"), buf, SIZEOF(buf), 0);
- pdnce->szSecondLineText = mir_tstrdup(buf);
- }
+ tmi.printDateTime(pdnce->hTimeZone, _T("t"), buf, SIZEOF(buf), 0);
+ pdnce->szSecondLineText = mir_tstrdup(buf);
+ }
- uTextFormat |= (gl_RowTabAccess[i]->valign == TC_VCENTER) ? DT_VCENTER : (gl_RowTabAccess[i]->valign == TC_BOTTOM) ? DT_BOTTOM : 0;
- uTextFormat |= (gl_RowTabAccess[i]->halign == TC_HCENTER) ? DT_CENTER : (gl_RowTabAccess[i]->halign == TC_RIGHT) ? DT_RIGHT : 0;
+ uTextFormat |= (gl_RowTabAccess[i]->valign == TC_VCENTER) ? DT_VCENTER : (gl_RowTabAccess[i]->valign == TC_BOTTOM) ? DT_BOTTOM : 0;
+ uTextFormat |= (gl_RowTabAccess[i]->halign == TC_HCENTER) ? DT_CENTER : (gl_RowTabAccess[i]->halign == TC_RIGHT) ? DT_RIGHT : 0;
- text_size.cx = p_rect.right - p_rect.left;
- text_size.cy = p_rect.bottom - p_rect.top;
+ text_size.cx = p_rect.right - p_rect.left;
+ text_size.cy = p_rect.bottom - p_rect.top;
- ChangeToFont(hdcMem, dat, FONTID_SECONDLINE, NULL);
- uTextFormat = uTextFormat | (gl_TrimText ? DT_END_ELLIPSIS : 0) | DT_SINGLELINE;
- if (Drawing->type == CLCIT_CONTACT)
- _DrawTextSmiley(hdcMem, &p_rect, &text_size, pdnce->szSecondLineText, 0, (int)mir_tstrlen(pdnce->szSecondLineText), pdnce->ssSecondLine.plText, uTextFormat, dat->text_resize_smileys);
- }
- break;
+ ChangeToFont(hdcMem, dat, FONTID_SECONDLINE, NULL);
+ uTextFormat = uTextFormat | (gl_TrimText ? DT_END_ELLIPSIS : 0) | DT_SINGLELINE;
+ if (Drawing->type == CLCIT_CONTACT)
+ _DrawTextSmiley(hdcMem, &p_rect, &text_size, pdnce->szSecondLineText, 0, (int)mir_tstrlen(pdnce->szSecondLineText), pdnce->ssSecondLine.plText, uTextFormat, dat->text_resize_smileys);
+ }
+ break;
case TC_TEXT3:
- {
- //paint text 3
- // Select font
- UINT uTextFormat = (dat->text_rtl ? DT_RTLREADING : 0);
+ {
+ //paint text 3
+ // Select font
+ UINT uTextFormat = (dat->text_rtl ? DT_RTLREADING : 0);
- if (dat->third_line_show && dat->third_line_type == TEXT_CONTACT_TIME && pdnce->hTimeZone) {
- // Get contact time
- TCHAR buf[70] = _T("");
- mir_free(pdnce->szThirdLineText);
+ if (dat->third_line_show && dat->third_line_type == TEXT_CONTACT_TIME && pdnce->hTimeZone) {
+ // Get contact time
+ TCHAR buf[70] = _T("");
+ mir_free(pdnce->szThirdLineText);
- tmi.printDateTime(pdnce->hTimeZone, _T("t"), buf, SIZEOF(buf), 0);
- pdnce->szThirdLineText = mir_tstrdup(buf);
- }
+ tmi.printDateTime(pdnce->hTimeZone, _T("t"), buf, SIZEOF(buf), 0);
+ pdnce->szThirdLineText = mir_tstrdup(buf);
+ }
- uTextFormat |= (gl_RowTabAccess[i]->valign == TC_VCENTER) ? DT_VCENTER : (gl_RowTabAccess[i]->valign == TC_BOTTOM) ? DT_BOTTOM : 0;
- uTextFormat |= (gl_RowTabAccess[i]->halign == TC_HCENTER) ? DT_CENTER : (gl_RowTabAccess[i]->halign == TC_RIGHT) ? DT_RIGHT : 0;
+ uTextFormat |= (gl_RowTabAccess[i]->valign == TC_VCENTER) ? DT_VCENTER : (gl_RowTabAccess[i]->valign == TC_BOTTOM) ? DT_BOTTOM : 0;
+ uTextFormat |= (gl_RowTabAccess[i]->halign == TC_HCENTER) ? DT_CENTER : (gl_RowTabAccess[i]->halign == TC_RIGHT) ? DT_RIGHT : 0;
- text_size.cx = p_rect.right - p_rect.left;
- text_size.cy = p_rect.bottom - p_rect.top;
+ text_size.cx = p_rect.right - p_rect.left;
+ text_size.cy = p_rect.bottom - p_rect.top;
- ChangeToFont(hdcMem, dat, FONTID_THIRDLINE, NULL);
- uTextFormat = uTextFormat | (gl_TrimText ? DT_END_ELLIPSIS : 0) | DT_SINGLELINE;
- if (Drawing->type == CLCIT_CONTACT)
- _DrawTextSmiley(hdcMem, &p_rect, &text_size, pdnce->szThirdLineText, 0, (int)mir_tstrlen(pdnce->szThirdLineText), pdnce->ssThirdLine.plText, uTextFormat, dat->text_resize_smileys);
- }
- break;
+ ChangeToFont(hdcMem, dat, FONTID_THIRDLINE, NULL);
+ uTextFormat = uTextFormat | (gl_TrimText ? DT_END_ELLIPSIS : 0) | DT_SINGLELINE;
+ if (Drawing->type == CLCIT_CONTACT)
+ _DrawTextSmiley(hdcMem, &p_rect, &text_size, pdnce->szThirdLineText, 0, (int)mir_tstrlen(pdnce->szThirdLineText), pdnce->ssThirdLine.plText, uTextFormat, dat->text_resize_smileys);
+ }
+ break;
case TC_STATUS:
if ((Drawing->type == CLCIT_GROUP && !dat->row_hide_group_icon) || (Drawing->type == CLCIT_CONTACT && Drawing->iImage != -1
@@ -1220,142 +1220,142 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
break;
case TC_AVATAR:
- {
- BOOL hasAvatar = Drawing->avatar_data != NULL;
- BYTE blendmode = 255;
- if (hottrack)
- blendmode = 255;
- else if (Drawing->type == CLCIT_CONTACT && Drawing->flags & CONTACTF_NOTONLIST)
- blendmode = 128;
- if (Drawing->type == CLCIT_CONTACT && dat->showIdle && (Drawing->flags&CONTACTF_IDLE) &&
- _GetRealStatus(Drawing, ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
- blendmode = 128;
- if (!hasAvatar) { // if no avatar then paint icon image
- int iImage = Drawing->iImage;
- if (iImage != -1) {
- COLORREF colourFg;
- int mode;
- // Store pos
- Drawing->pos_icon = p_rect;
- if (hottrack) {
- colourFg = dat->hotTextColour;
- mode = ILD_NORMAL;
- }
- else if (Drawing->type == CLCIT_CONTACT && Drawing->flags & CONTACTF_NOTONLIST) {
- colourFg = dat->fontModernInfo[FONTID_NOTONLIST].colour;
- mode = ILD_BLEND50;
- }
- else {
- colourFg = dat->selBkColour;
- mode = ILD_NORMAL;
- }
-
- if (Drawing->type == CLCIT_CONTACT && dat->showIdle && (Drawing->flags & CONTACTF_IDLE) &&
- _GetRealStatus(Drawing, ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) {
- mode = ILD_SELECTED;
- }
-
- _DrawStatusIcon(Drawing, dat, iImage, hdcMem, p_rect.left, p_rect.top, 0, 0, CLR_NONE, colourFg, mode);
-
- }
- }
- else {
- HRGN rgn = NULL;
- HRGN oldrgn;
- int round_radius = 0;
- int width = p_rect.right - p_rect.left;
- int height = p_rect.bottom - p_rect.top;
+ {
+ BOOL hasAvatar = Drawing->avatar_data != NULL;
+ BYTE blendmode = 255;
+ if (hottrack)
+ blendmode = 255;
+ else if (Drawing->type == CLCIT_CONTACT && Drawing->flags & CONTACTF_NOTONLIST)
+ blendmode = 128;
+ if (Drawing->type == CLCIT_CONTACT && dat->showIdle && (Drawing->flags&CONTACTF_IDLE) &&
+ _GetRealStatus(Drawing, ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
+ blendmode = 128;
+ if (!hasAvatar) { // if no avatar then paint icon image
+ int iImage = Drawing->iImage;
+ if (iImage != -1) {
+ COLORREF colourFg;
+ int mode;
// Store pos
- Drawing->pos_avatar = p_rect;
- oldrgn = CreateRectRgn(0, 0, 0, 0);
- GetClipRgn(hdcMem, oldrgn);
-
- // Round corners
- if (dat->avatars_round_corners) {
- if (dat->avatars_use_custom_corner_size)
- round_radius = dat->avatars_custom_corner_size;
- else
- round_radius = min(width, height) / 5;
+ Drawing->pos_icon = p_rect;
+ if (hottrack) {
+ colourFg = dat->hotTextColour;
+ mode = ILD_NORMAL;
}
- else round_radius = 0;
-
- if (dat->avatars_draw_border) {
- HBRUSH hBrush = CreateSolidBrush(dat->avatars_border_color);
- HBRUSH hOldBrush = (HBRUSH)SelectObject(hdcMem, hBrush);
- HRGN rgn2;
- rgn = CreateRoundRectRgn(p_rect.left, p_rect.top, p_rect.right + 1, p_rect.bottom + 1, round_radius << 1, round_radius << 1);
- rgn2 = CreateRoundRectRgn(p_rect.left + 1, p_rect.top + 1, p_rect.right, p_rect.bottom, round_radius << 1, round_radius << 1);
- CombineRgn(rgn2, rgn, rgn2, RGN_DIFF);
- // FrameRgn(hdcMem, rgn, hBrush, 1, 1 );
- FillRgn(hdcMem, rgn2, hBrush);
- ske_SetRgnOpaque(hdcMem, rgn2);
- SelectObject(hdcMem, hOldBrush);
- DeleteObject(hBrush);
- DeleteObject(rgn);
- DeleteObject(rgn2);
+ else if (Drawing->type == CLCIT_CONTACT && Drawing->flags & CONTACTF_NOTONLIST) {
+ colourFg = dat->fontModernInfo[FONTID_NOTONLIST].colour;
+ mode = ILD_BLEND50;
}
- if (dat->avatars_round_corners || dat->avatars_draw_border) {
- int k = dat->avatars_draw_border ? 1 : 0;
- rgn = CreateRoundRectRgn(p_rect.left + k, p_rect.top + k, p_rect.right + 1 - k, p_rect.bottom + 1 - k, round_radius * 2, round_radius * 2);
- ExtSelectClipRgn(hdcMem, rgn, RGN_AND);
+ else {
+ colourFg = dat->selBkColour;
+ mode = ILD_NORMAL;
}
- // Draw avatar
- _DrawContactAvatar(hdcMem, dat, Drawing, &row_rc, selected, hottrack, &p_rect);
+ if (Drawing->type == CLCIT_CONTACT && dat->showIdle && (Drawing->flags & CONTACTF_IDLE) &&
+ _GetRealStatus(Drawing, ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) {
+ mode = ILD_SELECTED;
+ }
- // Restore region
- if (dat->avatars_round_corners || dat->avatars_draw_border)
- DeleteObject(rgn);
+ _DrawStatusIcon(Drawing, dat, iImage, hdcMem, p_rect.left, p_rect.top, 0, 0, CLR_NONE, colourFg, mode);
- SelectClipRgn(hdcMem, oldrgn);
- DeleteObject(oldrgn);
+ }
+ }
+ else {
+ HRGN rgn = NULL;
+ HRGN oldrgn;
+ int round_radius = 0;
+ int width = p_rect.right - p_rect.left;
+ int height = p_rect.bottom - p_rect.top;
+ // Store pos
+ Drawing->pos_avatar = p_rect;
+ oldrgn = CreateRectRgn(0, 0, 0, 0);
+ GetClipRgn(hdcMem, oldrgn);
+
+ // Round corners
+ if (dat->avatars_round_corners) {
+ if (dat->avatars_use_custom_corner_size)
+ round_radius = dat->avatars_custom_corner_size;
+ else
+ round_radius = min(width, height) / 5;
+ }
+ else round_radius = 0;
+
+ if (dat->avatars_draw_border) {
+ HBRUSH hBrush = CreateSolidBrush(dat->avatars_border_color);
+ HBRUSH hOldBrush = (HBRUSH)SelectObject(hdcMem, hBrush);
+ HRGN rgn2;
+ rgn = CreateRoundRectRgn(p_rect.left, p_rect.top, p_rect.right + 1, p_rect.bottom + 1, round_radius << 1, round_radius << 1);
+ rgn2 = CreateRoundRectRgn(p_rect.left + 1, p_rect.top + 1, p_rect.right, p_rect.bottom, round_radius << 1, round_radius << 1);
+ CombineRgn(rgn2, rgn, rgn2, RGN_DIFF);
+ // FrameRgn(hdcMem, rgn, hBrush, 1, 1 );
+ FillRgn(hdcMem, rgn2, hBrush);
+ ske_SetRgnOpaque(hdcMem, rgn2);
+ SelectObject(hdcMem, hOldBrush);
+ DeleteObject(hBrush);
+ DeleteObject(rgn);
+ DeleteObject(rgn2);
+ }
+ if (dat->avatars_round_corners || dat->avatars_draw_border) {
+ int k = dat->avatars_draw_border ? 1 : 0;
+ rgn = CreateRoundRectRgn(p_rect.left + k, p_rect.top + k, p_rect.right + 1 - k, p_rect.bottom + 1 - k, round_radius * 2, round_radius * 2);
+ ExtSelectClipRgn(hdcMem, rgn, RGN_AND);
+ }
- // Draw borders
+ // Draw avatar
+ _DrawContactAvatar(hdcMem, dat, Drawing, &row_rc, selected, hottrack, &p_rect);
- //TODO fix overlays
- // Draw overlay
- if (dat->avatars_draw_overlay && dat->avatars_maxheight_size >= ICON_HEIGHT + (dat->avatars_draw_border ? 2 : 0)
- && GetContactCachedStatus(Drawing->hContact) - ID_STATUS_OFFLINE < SIZEOF(g_pAvatarOverlayIcons)) {
- p_rect.top = p_rect.bottom - ICON_HEIGHT;
- p_rect.left = p_rect.right - ICON_HEIGHT;
+ // Restore region
+ if (dat->avatars_round_corners || dat->avatars_draw_border)
+ DeleteObject(rgn);
- if (dat->avatars_draw_border) {
- p_rect.top--;
- p_rect.left--;
- }
+ SelectClipRgn(hdcMem, oldrgn);
+ DeleteObject(oldrgn);
- switch (dat->avatars_overlay_type) {
- case SETTING_AVATAR_OVERLAY_TYPE_NORMAL:
- {
- UINT a = blendmode;
- a = (a << 24);
- ske_ImageList_DrawEx(hAvatarOverlays, g_pAvatarOverlayIcons[GetContactCachedStatus(Drawing->hContact) - ID_STATUS_OFFLINE].listID,
- hdcMem,
- p_rect.left, p_rect.top, ICON_HEIGHT, ICON_HEIGHT,
- CLR_NONE, CLR_NONE,
- (blendmode == 255) ? ILD_NORMAL : (blendmode == 128) ? ILD_BLEND50 : ILD_BLEND25);
- }
- break;
- case SETTING_AVATAR_OVERLAY_TYPE_PROTOCOL:
- {
- int item = pcli->pfnIconFromStatusMode(Drawing->proto, Drawing->proto == NULL ? ID_STATUS_OFFLINE : GetContactCachedStatus(Drawing->hContact), Drawing->hContact);
- if (item != -1)
- _DrawStatusIcon(Drawing, dat, item, hdcMem,
- p_rect.left, p_rect.top, ICON_HEIGHT, ICON_HEIGHT,
- CLR_NONE, CLR_NONE, (blendmode == 255) ? ILD_NORMAL : (blendmode == 128) ? ILD_BLEND50 : ILD_BLEND25);
- }
- break;
- case SETTING_AVATAR_OVERLAY_TYPE_CONTACT:
- if (Drawing->iImage != -1)
- _DrawStatusIcon(Drawing, dat, Drawing->iImage, hdcMem,
- p_rect.left, p_rect.top, ICON_HEIGHT, ICON_HEIGHT,
- CLR_NONE, CLR_NONE, (blendmode == 255) ? ILD_NORMAL : (blendmode == 128) ? ILD_BLEND50 : ILD_BLEND25);
- break;
- }
+ // Draw borders
+
+ //TODO fix overlays
+ // Draw overlay
+ if (dat->avatars_draw_overlay && dat->avatars_maxheight_size >= ICON_HEIGHT + (dat->avatars_draw_border ? 2 : 0)
+ && GetContactCachedStatus(Drawing->hContact) - ID_STATUS_OFFLINE < SIZEOF(g_pAvatarOverlayIcons)) {
+ p_rect.top = p_rect.bottom - ICON_HEIGHT;
+ p_rect.left = p_rect.right - ICON_HEIGHT;
+
+ if (dat->avatars_draw_border) {
+ p_rect.top--;
+ p_rect.left--;
+ }
+
+ switch (dat->avatars_overlay_type) {
+ case SETTING_AVATAR_OVERLAY_TYPE_NORMAL:
+ {
+ UINT a = blendmode;
+ a = (a << 24);
+ ske_ImageList_DrawEx(hAvatarOverlays, g_pAvatarOverlayIcons[GetContactCachedStatus(Drawing->hContact) - ID_STATUS_OFFLINE].listID,
+ hdcMem,
+ p_rect.left, p_rect.top, ICON_HEIGHT, ICON_HEIGHT,
+ CLR_NONE, CLR_NONE,
+ (blendmode == 255) ? ILD_NORMAL : (blendmode == 128) ? ILD_BLEND50 : ILD_BLEND25);
+ }
+ break;
+ case SETTING_AVATAR_OVERLAY_TYPE_PROTOCOL:
+ {
+ int item = pcli->pfnIconFromStatusMode(Drawing->proto, Drawing->proto == NULL ? ID_STATUS_OFFLINE : GetContactCachedStatus(Drawing->hContact), Drawing->hContact);
+ if (item != -1)
+ _DrawStatusIcon(Drawing, dat, item, hdcMem,
+ p_rect.left, p_rect.top, ICON_HEIGHT, ICON_HEIGHT,
+ CLR_NONE, CLR_NONE, (blendmode == 255) ? ILD_NORMAL : (blendmode == 128) ? ILD_BLEND50 : ILD_BLEND25);
+ }
+ break;
+ case SETTING_AVATAR_OVERLAY_TYPE_CONTACT:
+ if (Drawing->iImage != -1)
+ _DrawStatusIcon(Drawing, dat, Drawing->iImage, hdcMem,
+ p_rect.left, p_rect.top, ICON_HEIGHT, ICON_HEIGHT,
+ CLR_NONE, CLR_NONE, (blendmode == 255) ? ILD_NORMAL : (blendmode == 128) ? ILD_BLEND50 : ILD_BLEND25);
+ break;
}
}
}
- break;
+ }
+ break;
case TC_EXTRA:
if (Drawing->type == CLCIT_CONTACT &&
@@ -1804,16 +1804,16 @@ void CLCPaint::_DrawLines(HWND hWnd, ClcData *dat, int paintMode, RECT* rcPaint,
switch (dat->HiLightMode) {
case 0:
case 1:
- {
- int row_height = row_rc.bottom - row_rc.top;
- for (int i = y; i < y + row_height; i += max(dat->row_min_heigh, 1)) {
- ImageList_DrawEx(dat->himlHighlight, 0, pc.hdcMem, 0, i, clRect.right,
- min(y + row_height - i, max(dat->row_min_heigh, 1)), CLR_NONE, CLR_NONE,
- dat->exStyle&CLS_EX_NOTRANSLUCENTSEL ? ILD_NORMAL : ILD_BLEND25);
- }
- SetTextColor(pc.hdcMem, paintMode&DM_CONTROL ? GetSysColor(COLOR_HIGHLIGHTTEXT) : dat->selTextColour);
+ {
+ int row_height = row_rc.bottom - row_rc.top;
+ for (int i = y; i < y + row_height; i += max(dat->row_min_heigh, 1)) {
+ ImageList_DrawEx(dat->himlHighlight, 0, pc.hdcMem, 0, i, clRect.right,
+ min(y + row_height - i, max(dat->row_min_heigh, 1)), CLR_NONE, CLR_NONE,
+ dat->exStyle&CLS_EX_NOTRANSLUCENTSEL ? ILD_NORMAL : ILD_BLEND25);
}
- break;
+ SetTextColor(pc.hdcMem, paintMode&DM_CONTROL ? GetSysColor(COLOR_HIGHLIGHTTEXT) : dat->selTextColour);
+ }
+ break;
case 2:
int row_height = row_rc.bottom - row_rc.top - 1;
@@ -1921,7 +1921,7 @@ void CLCPaint::_DrawInsertionMark(ClcData *dat, RECT& clRect, _PaintContext& pc)
pts[5].x = pts[2].x + 1; pts[5].y = pts[1].y + 2;
pts[6].x = pts[1].x; pts[6].y = pts[5].y;
pts[7].x = pts[0].x; pts[7].y = pts[4].y;
-
+
HRGN hRgn = CreatePolygonRgn(pts, sizeof(pts) / sizeof(pts[0]), ALTERNATE);
HBRUSH hBrush = CreateSolidBrush(dat->fontModernInfo[FONTID_CONTACTS].colour);
HBRUSH hoBrush = (HBRUSH)SelectObject(pc.hdcMem, hBrush);
@@ -2054,131 +2054,98 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT
switch (dat->row_items[item]) {
case ITEM_AVATAR: ///////////////////////////////////////////////////////////////////////////////////////////////////
- {
- RECT rc;
- int max_width;
- int width;
- int height;
- BOOL miniMode;
- if (!dat->avatars_show || Drawing->type != CLCIT_CONTACT)
- break;
- miniMode = CheckMiniMode(dat, selected);
- AniAva_InvalidateAvatarPositions(Drawing->hContact);
- if (dat->icon_hide_on_avatar && dat->icon_draw_on_avatar_space)
- max_width = max(dat->iconXSpace, dat->avatars_maxheight_size);
- else
- max_width = dat->avatars_maxheight_size;
+ {
+ RECT rc;
+ int max_width;
+ int width;
+ int height;
+ BOOL miniMode;
+ if (!dat->avatars_show || Drawing->type != CLCIT_CONTACT)
+ break;
+ miniMode = CheckMiniMode(dat, selected);
+ AniAva_InvalidateAvatarPositions(Drawing->hContact);
+ if (dat->icon_hide_on_avatar && dat->icon_draw_on_avatar_space)
+ max_width = max(dat->iconXSpace, dat->avatars_maxheight_size);
+ else
+ max_width = dat->avatars_maxheight_size;
- // Has to draw?
- if (Drawing->avatar_data == NULL || miniMode) {
- // Don't have to draw avatar
+ // Has to draw?
+ if (Drawing->avatar_data == NULL || miniMode) {
+ // Don't have to draw avatar
- // Has to draw icon instead?
- if (dat->icon_hide_on_avatar && dat->icon_draw_on_avatar_space && Drawing->iImage != -1) {
- RECT rc;
+ // Has to draw icon instead?
+ if (dat->icon_hide_on_avatar && dat->icon_draw_on_avatar_space && Drawing->iImage != -1) {
+ RECT rc;
- // Make rectangle
- rc = _GetRectangle(dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
- left, dat->iconXSpace, max_width, ICON_HEIGHT, HORIZONTAL_SPACE);
+ // Make rectangle
+ rc = _GetRectangle(dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
+ left, dat->iconXSpace, max_width, ICON_HEIGHT, HORIZONTAL_SPACE);
- if (rc.left < rc.right) {
- /* center icon in avatar place */
- if (rc.right - rc.left > 16) rc.left += (((rc.right - rc.left) - 16) >> 1);
- if (rc.bottom - rc.top > 16) rc.top += (((rc.bottom - rc.top) - 16) >> 1);
+ if (rc.left < rc.right) {
+ /* center icon in avatar place */
+ if (rc.right - rc.left > 16) rc.left += (((rc.right - rc.left) - 16) >> 1);
+ if (rc.bottom - rc.top > 16) rc.top += (((rc.bottom - rc.top) - 16) >> 1);
- // Store position
- _StoreItemPos(Drawing, CIT_ICON, &rc);
- }
+ // Store position
+ _StoreItemPos(Drawing, CIT_ICON, &rc);
}
- else {
- // Has to keep the empty space??
- if ((left && !dat->row_align_left_items_to_left) || (!left && !dat->row_align_right_items_to_right)) {
- // Make rectangle
- rc = _GetRectangle(dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
- left, max_width, max_width, dat->avatars_maxheight_size, HORIZONTAL_SPACE);
+ }
+ else {
+ // Has to keep the empty space??
+ if ((left && !dat->row_align_left_items_to_left) || (!left && !dat->row_align_right_items_to_right)) {
+ // Make rectangle
+ rc = _GetRectangle(dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
+ left, max_width, max_width, dat->avatars_maxheight_size, HORIZONTAL_SPACE);
- // Store position
- //StoreItemPos( Drawing, CIT_AVATAR, &rc );
- //Drawing->pos_avatar = rc;
- }
+ // Store position
+ //StoreItemPos( Drawing, CIT_AVATAR, &rc );
+ //Drawing->pos_avatar = rc;
}
- break;
}
+ break;
+ }
- // Has to draw avatar
- if (dat->avatar_cache.nodes && Drawing->avatar_pos > AVATAR_POS_DONT_HAVE) {
- width = dat->avatar_cache.nodes[Drawing->avatar_pos].width;
- height = dat->avatar_cache.nodes[Drawing->avatar_pos].height;
- }
- else if (Drawing->avatar_pos == AVATAR_POS_ANIMATED) {
- width = Drawing->avatar_size.cx;
- height = Drawing->avatar_size.cy;
- }
- else {
- width = 0;
- height = 0;
- }
+ // Has to draw avatar
+ if (dat->avatar_cache.nodes && Drawing->avatar_pos > AVATAR_POS_DONT_HAVE) {
+ width = dat->avatar_cache.nodes[Drawing->avatar_pos].width;
+ height = dat->avatar_cache.nodes[Drawing->avatar_pos].height;
+ }
+ else if (Drawing->avatar_pos == AVATAR_POS_ANIMATED) {
+ width = Drawing->avatar_size.cx;
+ height = Drawing->avatar_size.cy;
+ }
+ else {
+ width = 0;
+ height = 0;
+ }
- // Make rectangle
- rc = _GetRectangle(dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
- left, width, max_width, height, HORIZONTAL_SPACE);
+ // Make rectangle
+ rc = _GetRectangle(dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
+ left, width, max_width, height, HORIZONTAL_SPACE);
- rc.top = max(free_row_rc.top, rc.top);
- rc.bottom = min(free_row_rc.bottom, rc.bottom);
+ rc.top = max(free_row_rc.top, rc.top);
+ rc.bottom = min(free_row_rc.bottom, rc.bottom);
- if (rc.left < rc.right) // Store position
- _StoreItemPos(Drawing, CIT_AVATAR, &rc);
- //TO DO: CALC avatar overlays
- }
- break;
+ if (rc.left < rc.right) // Store position
+ _StoreItemPos(Drawing, CIT_AVATAR, &rc);
+ //TO DO: CALC avatar overlays
+ }
+ break;
case ITEM_ICON: /////////////////////////////////////////////////////////////////////////////////////////////////////
- {
- RECT rc;
- int iImage = -1;
- BOOL has_avatar = Drawing->avatar_data != NULL && !CheckMiniMode(dat, selected);
-
- if (Drawing->type == CLCIT_CONTACT
- && dat->icon_hide_on_avatar
- && !dat->icon_draw_on_avatar_space
- && has_avatar
- && !Drawing->image_is_special)
- {
- // Don't have to draw, but has to keep the empty space?
- if ((left && !dat->row_align_left_items_to_left) || (!left && !dat->row_align_right_items_to_right)) {
- rc = _GetRectangle(dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
- left, dat->iconXSpace, dat->iconXSpace, ICON_HEIGHT, HORIZONTAL_SPACE);
-
- if (rc.left < rc.right) {
- // Store position
- _StoreItemPos(Drawing, CIT_ICON, &rc);
- }
- }
- break;
- }
- if (Drawing->type == CLCIT_CONTACT
- && dat->icon_hide_on_avatar
- && dat->icon_draw_on_avatar_space
- && (!Drawing->image_is_special || !has_avatar ||
- (dat->avatars_draw_overlay
- && dat->avatars_maxheight_size >= ICON_HEIGHT + (dat->avatars_draw_border ? 2 : 0)
- && GetContactCachedStatus(Drawing->hContact) - ID_STATUS_OFFLINE < SIZEOF(g_pAvatarOverlayIcons)
- && dat->avatars_overlay_type == SETTING_AVATAR_OVERLAY_TYPE_CONTACT)))
- {
- // Don't have to draw and don't have to keep the empty space
- break;
- }
-
- // Get image
- iImage = -1;
- if (Drawing->type == CLCIT_GROUP && !dat->row_hide_group_icon)
- iImage = Drawing->group->expanded ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT;
- else if (Drawing->type == CLCIT_CONTACT)
- iImage = Drawing->iImage;
+ {
+ RECT rc;
+ int iImage = -1;
+ BOOL has_avatar = Drawing->avatar_data != NULL && !CheckMiniMode(dat, selected);
- // Has image to draw?
- if (iImage != -1) {
- // Make rectangle
+ if (Drawing->type == CLCIT_CONTACT
+ && dat->icon_hide_on_avatar
+ && !dat->icon_draw_on_avatar_space
+ && has_avatar
+ && !Drawing->image_is_special)
+ {
+ // Don't have to draw, but has to keep the empty space?
+ if ((left && !dat->row_align_left_items_to_left) || (!left && !dat->row_align_right_items_to_right)) {
rc = _GetRectangle(dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
left, dat->iconXSpace, dat->iconXSpace, ICON_HEIGHT, HORIZONTAL_SPACE);
@@ -2187,40 +2154,73 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT
_StoreItemPos(Drawing, CIT_ICON, &rc);
}
}
+ break;
}
- break;
+ if (Drawing->type == CLCIT_CONTACT
+ && dat->icon_hide_on_avatar
+ && dat->icon_draw_on_avatar_space
+ && (!Drawing->image_is_special || !has_avatar ||
+ (dat->avatars_draw_overlay
+ && dat->avatars_maxheight_size >= ICON_HEIGHT + (dat->avatars_draw_border ? 2 : 0)
+ && GetContactCachedStatus(Drawing->hContact) - ID_STATUS_OFFLINE < SIZEOF(g_pAvatarOverlayIcons)
+ && dat->avatars_overlay_type == SETTING_AVATAR_OVERLAY_TYPE_CONTACT)))
+ {
+ // Don't have to draw and don't have to keep the empty space
+ break;
+ }
+
+ // Get image
+ iImage = -1;
+ if (Drawing->type == CLCIT_GROUP && !dat->row_hide_group_icon)
+ iImage = Drawing->group->expanded ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT;
+ else if (Drawing->type == CLCIT_CONTACT)
+ iImage = Drawing->iImage;
+
+ // Has image to draw?
+ if (iImage != -1) {
+ // Make rectangle
+ rc = _GetRectangle(dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
+ left, dat->iconXSpace, dat->iconXSpace, ICON_HEIGHT, HORIZONTAL_SPACE);
+
+ if (rc.left < rc.right) {
+ // Store position
+ _StoreItemPos(Drawing, CIT_ICON, &rc);
+ }
+ }
+ }
+ break;
case ITEM_CONTACT_TIME: /////////////////////////////////////////////////////////////////////////////////////////////////////
- {
- ClcCacheEntry *pdnce = (Drawing->type == CLCIT_CONTACT) ? pcli->pfnGetCacheEntry(Drawing->hContact) : NULL;
- if (Drawing->type == CLCIT_CONTACT && dat->contact_time_show && pdnce->hTimeZone) {
- TCHAR szResult[80];
+ {
+ ClcCacheEntry *pdnce = (Drawing->type == CLCIT_CONTACT) ? pcli->pfnGetCacheEntry(Drawing->hContact) : NULL;
+ if (Drawing->type == CLCIT_CONTACT && dat->contact_time_show && pdnce->hTimeZone) {
+ TCHAR szResult[80];
- if (!tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0)) {
- SIZE text_size;
- RECT rc;
+ if (!tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0)) {
+ SIZE text_size;
+ RECT rc;
- // Select font
- ChangeToFont(hdcMem, dat, FONTID_CONTACT_TIME, NULL);
+ // Select font
+ ChangeToFont(hdcMem, dat, FONTID_CONTACT_TIME, NULL);
- // Get text size
- text_size.cy = ske_DrawText(hdcMem, szResult, (int)mir_tstrlen(szResult), &rc, DT_CALCRECT | DT_NOPREFIX | DT_SINGLELINE);
- text_size.cy = min(text_size.cy, free_row_rc.bottom - free_row_rc.top);
- text_size.cx = rc.right - rc.left;
+ // Get text size
+ text_size.cy = ske_DrawText(hdcMem, szResult, (int)mir_tstrlen(szResult), &rc, DT_CALCRECT | DT_NOPREFIX | DT_SINGLELINE);
+ text_size.cy = min(text_size.cy, free_row_rc.bottom - free_row_rc.top);
+ text_size.cx = rc.right - rc.left;
- // Get rc
- rc = _GetRectangle(dat, &row_rc, &free_row_rc, &left_pos, &right_pos, left,
- text_size.cx, text_size.cx, text_size.cy, HORIZONTAL_SPACE);
+ // Get rc
+ rc = _GetRectangle(dat, &row_rc, &free_row_rc, &left_pos, &right_pos, left,
+ text_size.cx, text_size.cx, text_size.cy, HORIZONTAL_SPACE);
- if (rc.left < rc.right) {
- // Store pos
- Drawing->pos_contact_time = rc;
- _StoreItemPos(Drawing, CIT_TIME, &rc);
- }
+ if (rc.left < rc.right) {
+ // Store pos
+ Drawing->pos_contact_time = rc;
+ _StoreItemPos(Drawing, CIT_TIME, &rc);
}
}
}
- break;
+ }
+ break;
case ITEM_TEXT: /////////////////////////////////////////////////////////////////////////////////////////////////////
// Store init text position:
@@ -2474,116 +2474,116 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT
switch (Drawing->type) {
case CLCIT_DIVIDER:
- {
- //devider
- RECT trc = free_row_rc;
- RECT rc = free_row_rc;
- rc.top += (rc.bottom - rc.top) >> 1;
- rc.bottom = rc.top + 2;
- rc.right = rc.left + ((rc.right - rc.left - text_size.cx) >> 1) - 3;
- trc.left = rc.right + 3;
- trc.right = trc.left + text_size.cx + 6;
- if (text_size.cy < trc.bottom - trc.top) {
- trc.top += (trc.bottom - trc.top - text_size.cy) >> 1;
- trc.bottom = trc.top + text_size.cy;
- }
- _StoreItemPos(Drawing, CIT_TEXT, &trc);
- rc.left = rc.right + 6 + text_size.cx;
- rc.right = free_row_rc.right;
+ {
+ //devider
+ RECT trc = free_row_rc;
+ RECT rc = free_row_rc;
+ rc.top += (rc.bottom - rc.top) >> 1;
+ rc.bottom = rc.top + 2;
+ rc.right = rc.left + ((rc.right - rc.left - text_size.cx) >> 1) - 3;
+ trc.left = rc.right + 3;
+ trc.right = trc.left + text_size.cx + 6;
+ if (text_size.cy < trc.bottom - trc.top) {
+ trc.top += (trc.bottom - trc.top - text_size.cy) >> 1;
+ trc.bottom = trc.top + text_size.cy;
}
- break;
+ _StoreItemPos(Drawing, CIT_TEXT, &trc);
+ rc.left = rc.right + 6 + text_size.cx;
+ rc.right = free_row_rc.right;
+ }
+ break;
case CLCIT_GROUP:
- {
- RECT rc = text_rc;
+ {
+ RECT rc = text_rc;
+
+ // Get text rectangle
+ if (dat->text_align_right)
+ rc.left = rc.right - text_size.cx;
+ else
+ rc.right = rc.left + text_size.cx;
+
- // Get text rectangle
+ if (text_size.cy < rc.bottom - rc.top) {
+ rc.top += (rc.bottom - rc.top - text_size.cy) >> 1;
+ rc.bottom = rc.top + text_size.cy;
+ }
+
+ // Draw text
+ _StoreItemPos(Drawing, CIT_TEXT, &rc);
+
+ // Has to draw the count?
+ if (counts_size.cx > 0) {
+ RECT counts_rc = text_rc;
+ //counts_size.cx;
if (dat->text_align_right)
- rc.left = rc.right - text_size.cx;
+ counts_rc.right = text_rc.left + counts_size.cx;
else
- rc.right = rc.left + text_size.cx;
-
+ counts_rc.left = text_rc.right - counts_size.cx;
- if (text_size.cy < rc.bottom - rc.top) {
- rc.top += (rc.bottom - rc.top - text_size.cy) >> 1;
- rc.bottom = rc.top + text_size.cy;
+ if (counts_size.cy < counts_rc.bottom - counts_rc.top) {
+ counts_rc.top += (counts_rc.bottom - counts_rc.top - counts_size.cy + 1) >> 1;
+ counts_rc.bottom = counts_rc.top + counts_size.cy;
}
+ // Draw counts
+ _StoreItemPos(Drawing, CIT_SUBTEXT1, &counts_rc);
+ }
+ }
+ break;
+ case CLCIT_CONTACT:
+ {
+ RECT free_rc = text_rc;
+ if (text_size.cx > 0 && free_rc.bottom > free_rc.top) {
+ RECT rc = free_rc;
+ rc.bottom = min(rc.bottom, rc.top + text_size.cy);
- // Draw text
- _StoreItemPos(Drawing, CIT_TEXT, &rc);
-
- // Has to draw the count?
- if (counts_size.cx > 0) {
- RECT counts_rc = text_rc;
- //counts_size.cx;
+ if (text_size.cx < rc.right - rc.left) {
if (dat->text_align_right)
- counts_rc.right = text_rc.left + counts_size.cx;
+ rc.left = rc.right - text_size.cx;
else
- counts_rc.left = text_rc.right - counts_size.cx;
-
- if (counts_size.cy < counts_rc.bottom - counts_rc.top) {
- counts_rc.top += (counts_rc.bottom - counts_rc.top - counts_size.cy + 1) >> 1;
- counts_rc.bottom = counts_rc.top + counts_size.cy;
- }
- // Draw counts
- _StoreItemPos(Drawing, CIT_SUBTEXT1, &counts_rc);
+ rc.right = rc.left + text_size.cx;
}
+ uTextFormat |= DT_VCENTER;
+ _StoreItemPos(Drawing, CIT_TEXT, &rc);
+ free_rc.top = rc.bottom;
}
- break;
- case CLCIT_CONTACT:
- {
- RECT free_rc = text_rc;
- if (text_size.cx > 0 && free_rc.bottom > free_rc.top) {
+ uTextFormat &= ~DT_VCENTER;
+ if (second_line_text_size.cx > 0 && free_rc.bottom > free_rc.top) {
+ free_rc.top += dat->second_line_top_space;
+
+ if (free_rc.bottom > free_rc.top) {
RECT rc = free_rc;
- rc.bottom = min(rc.bottom, rc.top + text_size.cy);
+ rc.bottom = min(rc.bottom, rc.top + second_line_text_size.cy);
- if (text_size.cx < rc.right - rc.left) {
+ if (second_line_text_size.cx < rc.right - rc.left) {
if (dat->text_align_right)
- rc.left = rc.right - text_size.cx;
+ rc.left = rc.right - second_line_text_size.cx;
else
- rc.right = rc.left + text_size.cx;
+ rc.right = rc.left + second_line_text_size.cx;
}
- uTextFormat |= DT_VCENTER;
- _StoreItemPos(Drawing, CIT_TEXT, &rc);
+ _StoreItemPos(Drawing, CIT_SUBTEXT1, &rc);
free_rc.top = rc.bottom;
}
- uTextFormat &= ~DT_VCENTER;
- if (second_line_text_size.cx > 0 && free_rc.bottom > free_rc.top) {
- free_rc.top += dat->second_line_top_space;
-
- if (free_rc.bottom > free_rc.top) {
- RECT rc = free_rc;
- rc.bottom = min(rc.bottom, rc.top + second_line_text_size.cy);
-
- if (second_line_text_size.cx < rc.right - rc.left) {
- if (dat->text_align_right)
- rc.left = rc.right - second_line_text_size.cx;
- else
- rc.right = rc.left + second_line_text_size.cx;
- }
- _StoreItemPos(Drawing, CIT_SUBTEXT1, &rc);
- free_rc.top = rc.bottom;
- }
- }
+ }
- if (third_line_text_size.cx > 0 && free_rc.bottom > free_rc.top) {
- free_rc.top += dat->third_line_top_space;
+ if (third_line_text_size.cx > 0 && free_rc.bottom > free_rc.top) {
+ free_rc.top += dat->third_line_top_space;
- if (free_rc.bottom > free_rc.top) {
- RECT rc = free_rc;
- rc.bottom = min(rc.bottom, rc.top + third_line_text_size.cy);
+ if (free_rc.bottom > free_rc.top) {
+ RECT rc = free_rc;
+ rc.bottom = min(rc.bottom, rc.top + third_line_text_size.cy);
- if (third_line_text_size.cx < rc.right - rc.left) {
- if (dat->text_align_right)
- rc.left = rc.right - third_line_text_size.cx;
- else
- rc.right = rc.left + third_line_text_size.cx;
- }
- _StoreItemPos(Drawing, CIT_SUBTEXT2, &rc);
- free_rc.top = rc.bottom;
+ if (third_line_text_size.cx < rc.right - rc.left) {
+ if (dat->text_align_right)
+ rc.left = rc.right - third_line_text_size.cx;
+ else
+ rc.right = rc.left + third_line_text_size.cx;
}
+ _StoreItemPos(Drawing, CIT_SUBTEXT2, &rc);
+ free_rc.top = rc.bottom;
}
}
- break;
+ }
+ break;
default: // CLCIT_INFO
_StoreItemPos(Drawing, CIT_TEXT, &text_rc);
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp
index b2d97083c1..6fd85d6d35 100644
--- a/plugins/Clist_modern/src/modern_clcutils.cpp
+++ b/plugins/Clist_modern/src/modern_clcutils.cpp
@@ -611,7 +611,7 @@ void LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst)
ptrT tszLineText(db_get_tsa(NULL, "CList", "SecondLineText"));
if (tszLineText)
- _tcsncpy_s(dat->second_line_text, SIZEOF(dat->second_line_text), tszLineText, _TRUNCATE);
+ mir_tstrncpy(dat->second_line_text, tszLineText, SIZEOF(dat->second_line_text));
else
dat->second_line_text[0] = _T('\0');
@@ -639,7 +639,7 @@ void LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst)
ptrT tszLineText(db_get_tsa(NULL, "CList", "ThirdLineText"));
if (tszLineText)
- _tcsncpy_s(dat->third_line_text, SIZEOF(dat->third_line_text), tszLineText, _TRUNCATE);
+ mir_tstrncpy(dat->third_line_text, tszLineText, SIZEOF(dat->third_line_text));
else
dat->third_line_text[0] = _T('\0');
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp
index 288dbf5536..d033a41625 100644
--- a/plugins/Clist_modern/src/modern_clistmod.cpp
+++ b/plugins/Clist_modern/src/modern_clistmod.cpp
@@ -305,8 +305,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY)
break;
}
}
- }
- while (hAux != NULL && hAuxOld != hAux);
+ } while (hAux != NULL && hAuxOld != hAux);
if (hWndFound) // There's window!
iNotCoveredDots++; // Let's count the not covered dots.
@@ -414,7 +413,7 @@ int cliShowHide(WPARAM, LPARAM lParam)
int CListMod_HideWindow()
{
KillTimer(pcli->hwndContactList, 1);
-
+
if (!CLUI_HideBehindEdge())
return CLUI_SmoothAlphaTransition(pcli->hwndContactList, 0, 1);
return 0;
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp
index 4357e06315..e89b6f8aab 100644
--- a/plugins/Clist_modern/src/modern_clisttray.cpp
+++ b/plugins/Clist_modern/src/modern_clisttray.cpp
@@ -390,8 +390,7 @@ VOID CALLBACK cliTrayCycleTimerProc(HWND, UINT, UINT_PTR, DWORD)
pcli->cycleStep = (pcli->cycleStep + 1) % AccNum;
if (pcli->cycleStep == t)
return;
- }
- while (acc[pcli->cycleStep]->bIsVirtual || !acc[pcli->cycleStep]->bIsVisible);
+ } while (acc[pcli->cycleStep]->bIsVirtual || !acc[pcli->cycleStep]->bIsVisible);
cliTrayCalcChanged(acc[pcli->cycleStep]->szModuleName, 0, 0);
}
@@ -531,18 +530,18 @@ int cliTrayIconInit(HWND hwnd)
break;
case TRAY_ICON_MODE_ACC:
- {
- ptrA szProto(db_get_sa(NULL, "CList", (!bDiffers) ? "tiAccS" : "tiAccV"));
- if (!szProto)
- break;
+ {
+ ptrA szProto(db_get_sa(NULL, "CList", (!bDiffers) ? "tiAccS" : "tiAccV"));
+ if (!szProto)
+ break;
- PROTOACCOUNT *pa = ProtoGetAccount(szProto);
- if (!pa || !pa->ppro)
- pcli->pfnTrayIconAdd(hwnd, NULL, NULL, CListTray_GetGlobalStatus(0, 0));
- else
- pcli->pfnTrayIconAdd(hwnd, pa->szModuleName, NULL, pa->ppro->m_iStatus);
- }
- break;
+ PROTOACCOUNT *pa = ProtoGetAccount(szProto);
+ if (!pa || !pa->ppro)
+ pcli->pfnTrayIconAdd(hwnd, NULL, NULL, CListTray_GetGlobalStatus(0, 0));
+ else
+ pcli->pfnTrayIconAdd(hwnd, pa->szModuleName, NULL, pa->ppro->m_iStatus);
+ }
+ break;
case TRAY_ICON_MODE_CYCLE:
pcli->pfnTrayIconAdd(hwnd, NULL, NULL, CListTray_GetGlobalStatus(0, 0));
@@ -571,33 +570,33 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int)
{
if (!szChangedProto)
return -1;
-
+
if (!pcli->trayIconCount)
return -1;
-
+
if (!pcli->pfnGetProtocolVisibility(szChangedProto))
return -1;
bool bDiffers, bConn;
GetGoodAccNum(&bDiffers, &bConn);
-
+
// if the icon number to be changed, reinitialize module from scratch
BYTE Mode = db_get_b(NULL, "CList", (!bDiffers) ? "tiModeS" : "tiModeV", TRAY_ICON_MODE_GLOBAL);
if (Mode != OldMode) {
OldMode = Mode;
pcli->pfnTrayIconIconsChanged();
}
-
+
HICON hIcon = NULL;
int i = 0, iStatus;
char *szProto;
-
+
switch (Mode) {
case TRAY_ICON_MODE_GLOBAL:
hIcon = pcli->pfnGetIconFromStatusMode(NULL, NULL, CListTray_GetGlobalStatus(0, 0));
pcli->pfnTrayIconMakeTooltip(NULL, NULL);
break;
-
+
case TRAY_ICON_MODE_ACC:
//  ýòîì ðåæèìå ïîêàçûâàåòñÿ èêîíêà ñîâåðøåííî îïðåäåë¸ííîãî àêêàóíòà, è íå âñåãäà ýòî szChangedProto.
szProto = db_get_sa(NULL, "CList", bDiffers ? "tiAccV" : "tiAccS");
@@ -609,10 +608,10 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int)
hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)szProto, 0);
else
hIcon = pcli->pfnGetIconFromStatusMode(NULL, szProto, ProtoCallService(szProto, PS_GETSTATUS, 0, 0));
-
+
pcli->pfnTrayIconMakeTooltip(NULL, szProto);
break;
-
+
case TRAY_ICON_MODE_CYCLE:
iStatus = ProtoCallService(szChangedProto, PS_GETSTATUS, 0, 0);
if (g_StatusBarData.bConnectingIcon && IsStatusConnecting(iStatus))
@@ -621,11 +620,11 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int)
hIcon = pcli->pfnGetIconFromStatusMode(NULL, szChangedProto, ProtoCallService(szChangedProto, PS_GETSTATUS, 0, 0));
pcli->pfnTrayIconMakeTooltip(NULL, NULL);
break;
-
+
case TRAY_ICON_MODE_ALL:
// Êàêîé èíäåêñ ó àêêàóíòà, êîòîðûé áóäåì àïäåéòèòü?
for (; i < pcli->trayIconCount; i++)
- if (!strcmp(pcli->trayIcon[i].szProto, szChangedProto))
+ if (!mir_strcmp(pcli->trayIcon[i].szProto, szChangedProto))
break;
iStatus = ProtoCallService(szChangedProto, PS_GETSTATUS, 0, 0);
@@ -649,7 +648,7 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int)
// if Tipper is missing or turned off for tray, use system tooltips
if (!ServiceExists("mToolTip/ShowTip") || !db_get_b(NULL, "Tipper", "TrayTip", 1))
- lstrcpyn(nid.szTip, pcli->szTip, SIZEOF(nid.szTip));
+ mir_tstrncpy(nid.szTip, pcli->szTip, SIZEOF(nid.szTip));
Shell_NotifyIcon(NIM_MODIFY, &nid);
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index 4e160f4ad0..8474bb8961 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -276,7 +276,7 @@ HRESULT CLUI::CreateCluiFrames()
}
CLUI::CLUI() :
- m_hDwmapiDll(NULL)
+m_hDwmapiDll(NULL)
{
m_pCLUI = this;
g_CluiData.bSTATE = STATE_CLUI_LOADING;
@@ -642,7 +642,7 @@ void CLUI_ChangeWindowMode()
g_CluiData.fSmoothAnimation = db_get_b(NULL, "CLUI", "FadeInOut", SETTING_FADEIN_DEFAULT);
if (g_bTransparentFlag == 0 && g_CluiData.bCurrentAlpha != 0)
g_CluiData.bCurrentAlpha = 255;
-
+
// 2 - Calculate STYLES and STYLESEX
if (!g_CluiData.fLayered) {
style = 0;
@@ -1056,19 +1056,19 @@ int CLUI_ReloadCLUIOptions()
g_CluiData.fAutoSize = db_get_b(NULL, "CLUI", "AutoSize", SETTING_AUTOSIZE_DEFAULT);
g_CluiData.bInternalAwayMsgDiscovery = db_get_b(NULL, "ModernData", "InternalAwayMsgDiscovery", SETTING_INTERNALAWAYMSGREQUEST_DEFAULT);
g_CluiData.bRemoveAwayMessageForOffline = db_get_b(NULL, "ModernData", "RemoveAwayMessageForOffline", SETTING_REMOVEAWAYMSGFOROFFLINE_DEFAULT);
-
+
// window borders
if (g_CluiData.fDisableSkinEngine) {
- g_CluiData.LeftClientMargin = 0;
- g_CluiData.RightClientMargin = 0;
- g_CluiData.TopClientMargin = 0;
+ g_CluiData.LeftClientMargin = 0;
+ g_CluiData.RightClientMargin = 0;
+ g_CluiData.TopClientMargin = 0;
g_CluiData.BottomClientMargin = 0;
}
else {
// window borders
- g_CluiData.LeftClientMargin = db_get_b(NULL, "CLUI", "LeftClientMargin", SETTING_LEFTCLIENTMARIGN_DEFAULT);
- g_CluiData.RightClientMargin = db_get_b(NULL, "CLUI", "RightClientMargin", SETTING_RIGHTCLIENTMARIGN_DEFAULT);
- g_CluiData.TopClientMargin = db_get_b(NULL, "CLUI", "TopClientMargin", SETTING_TOPCLIENTMARIGN_DEFAULT);
+ g_CluiData.LeftClientMargin = db_get_b(NULL, "CLUI", "LeftClientMargin", SETTING_LEFTCLIENTMARIGN_DEFAULT);
+ g_CluiData.RightClientMargin = db_get_b(NULL, "CLUI", "RightClientMargin", SETTING_RIGHTCLIENTMARIGN_DEFAULT);
+ g_CluiData.TopClientMargin = db_get_b(NULL, "CLUI", "TopClientMargin", SETTING_TOPCLIENTMARIGN_DEFAULT);
g_CluiData.BottomClientMargin = db_get_b(NULL, "CLUI", "BottomClientMargin", SETTING_BOTTOMCLIENTMARIGN_DEFAULT);
}
BroadCastMessageToChild(pcli->hwndContactList, WM_THEMECHANGED, 0, 0);
diff --git a/plugins/Clist_modern/src/modern_row.cpp b/plugins/Clist_modern/src/modern_row.cpp
index 0ea04b808f..52a530e276 100644
--- a/plugins/Clist_modern/src/modern_row.cpp
+++ b/plugins/Clist_modern/src/modern_row.cpp
@@ -222,40 +222,40 @@ void rowParserGetParam(ROWCELL* &cell, char *tbuf, int &hbuf)
char * word = rowParserGetNextWord(tbuf, hbuf);
int param = 0;
- if (!_strnicmp(word, "avatar", strlen(word))) param = TC_AVATAR;
- else if (!_strnicmp(word, "text1", strlen(word))) param = TC_TEXT1;
- else if (!_strnicmp(word, "text2", strlen(word))) param = TC_TEXT2;
- else if (!_strnicmp(word, "text3", strlen(word))) param = TC_TEXT3;
- else if (!_strnicmp(word, "status", strlen(word))) param = TC_STATUS;
- else if (!_strnicmp(word, "extra", strlen(word))) param = TC_EXTRA;
- else if (!_strnicmp(word, "extra1", strlen(word))) param = TC_EXTRA1;
- else if (!_strnicmp(word, "extra2", strlen(word))) param = TC_EXTRA2;
- else if (!_strnicmp(word, "extra3", strlen(word))) param = TC_EXTRA3;
- else if (!_strnicmp(word, "extra4", strlen(word))) param = TC_EXTRA4;
- else if (!_strnicmp(word, "extra5", strlen(word))) param = TC_EXTRA5;
- else if (!_strnicmp(word, "extra6", strlen(word))) param = TC_EXTRA6;
- else if (!_strnicmp(word, "extra7", strlen(word))) param = TC_EXTRA7;
- else if (!_strnicmp(word, "extra8", strlen(word))) param = TC_EXTRA8;
- else if (!_strnicmp(word, "extra9", strlen(word))) param = TC_EXTRA9;
- else if (!_strnicmp(word, "time", strlen(word))) param = TC_TIME;
- else if (!_strnicmp(word, "space", strlen(word))) param = TC_SPACE;
- else if (!_strnicmp(word, "fspace", strlen(word))) param = TC_FIXED;
-
- else if (!_strnicmp(word, "left", strlen(word))) param = TC_LEFT;
- else if (!_strnicmp(word, "top", strlen(word))) param = TC_TOP;
- else if (!_strnicmp(word, "vcenter", strlen(word))) param = TC_VCENTER;
- else if (!_strnicmp(word, "hcenter", strlen(word))) param = TC_HCENTER;
- else if (!_strnicmp(word, "right", strlen(word))) param = TC_RIGHT;
- else if (!_strnicmp(word, "bottom", strlen(word))) param = TC_BOTTOM;
-
- else if (!_strnicmp(word, "layer", strlen(word))) cell->layer = TRUE;
-
- else if (!_strnicmp(word, "width", strlen(word))) param = TC_WIDTH;
- else if (!_strnicmp(word, "height", strlen(word))) param = TC_HEIGHT;
+ if (!_strnicmp(word, "avatar", mir_strlen(word))) param = TC_AVATAR;
+ else if (!_strnicmp(word, "text1", mir_strlen(word))) param = TC_TEXT1;
+ else if (!_strnicmp(word, "text2", mir_strlen(word))) param = TC_TEXT2;
+ else if (!_strnicmp(word, "text3", mir_strlen(word))) param = TC_TEXT3;
+ else if (!_strnicmp(word, "status", mir_strlen(word))) param = TC_STATUS;
+ else if (!_strnicmp(word, "extra", mir_strlen(word))) param = TC_EXTRA;
+ else if (!_strnicmp(word, "extra1", mir_strlen(word))) param = TC_EXTRA1;
+ else if (!_strnicmp(word, "extra2", mir_strlen(word))) param = TC_EXTRA2;
+ else if (!_strnicmp(word, "extra3", mir_strlen(word))) param = TC_EXTRA3;
+ else if (!_strnicmp(word, "extra4", mir_strlen(word))) param = TC_EXTRA4;
+ else if (!_strnicmp(word, "extra5", mir_strlen(word))) param = TC_EXTRA5;
+ else if (!_strnicmp(word, "extra6", mir_strlen(word))) param = TC_EXTRA6;
+ else if (!_strnicmp(word, "extra7", mir_strlen(word))) param = TC_EXTRA7;
+ else if (!_strnicmp(word, "extra8", mir_strlen(word))) param = TC_EXTRA8;
+ else if (!_strnicmp(word, "extra9", mir_strlen(word))) param = TC_EXTRA9;
+ else if (!_strnicmp(word, "time", mir_strlen(word))) param = TC_TIME;
+ else if (!_strnicmp(word, "space", mir_strlen(word))) param = TC_SPACE;
+ else if (!_strnicmp(word, "fspace", mir_strlen(word))) param = TC_FIXED;
+
+ else if (!_strnicmp(word, "left", mir_strlen(word))) param = TC_LEFT;
+ else if (!_strnicmp(word, "top", mir_strlen(word))) param = TC_TOP;
+ else if (!_strnicmp(word, "vcenter", mir_strlen(word))) param = TC_VCENTER;
+ else if (!_strnicmp(word, "hcenter", mir_strlen(word))) param = TC_HCENTER;
+ else if (!_strnicmp(word, "right", mir_strlen(word))) param = TC_RIGHT;
+ else if (!_strnicmp(word, "bottom", mir_strlen(word))) param = TC_BOTTOM;
+
+ else if (!_strnicmp(word, "layer", mir_strlen(word))) cell->layer = TRUE;
+
+ else if (!_strnicmp(word, "width", mir_strlen(word))) param = TC_WIDTH;
+ else if (!_strnicmp(word, "height", mir_strlen(word))) param = TC_HEIGHT;
else
{
- hbuf -= (int)strlen(word);
+ hbuf -= (int)mir_strlen(word);
return;
}
@@ -326,11 +326,11 @@ BOOL rowParse(ROWCELL* &cell, ROWCELL* parent, char *tbuf, int &hbuf, int &seque
word = rowParserGetNextWord(tbuf, hbuf);
int cont;
- if (!_strnicmp(word, "<tr", strlen(word)) || !_strnicmp(word, "<tr>", strlen(word))) cont = TC_ROW;
- else if (!_strnicmp(word, "<tc", strlen(word)) || !_strnicmp(word, "<tc>", strlen(word))) cont = TC_COL;
- else if (!_strnicmp(word, "/>", strlen(word)) ||
- !_strnicmp(word, "</tr>", strlen(word)) ||
- !_strnicmp(word, "</tc>", strlen(word))) return TRUE;
+ if (!_strnicmp(word, "<tr", mir_strlen(word)) || !_strnicmp(word, "<tr>", mir_strlen(word))) cont = TC_ROW;
+ else if (!_strnicmp(word, "<tc", mir_strlen(word)) || !_strnicmp(word, "<tc>", mir_strlen(word))) cont = TC_COL;
+ else if (!_strnicmp(word, "/>", mir_strlen(word)) ||
+ !_strnicmp(word, "</tr>", mir_strlen(word)) ||
+ !_strnicmp(word, "</tc>", mir_strlen(word))) return TRUE;
else return FALSE;
rowAddCell(cell, cont);
diff --git a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
index f6a450aa27..bc2aee1df6 100644
--- a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
+++ b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
@@ -318,11 +318,7 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i
return height;
}
-/*
-*
-*/
-
-BOOL RowHeights_Initialize(struct ClcData *dat)
+BOOL RowHeights_Initialize(struct ClcData *dat)
{
dat->rowHeight = 0;
dat->row_heights_size = 0;
@@ -589,7 +585,7 @@ int RowHeights_GetRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact,
// Icon size
if (!dat->icon_ignore_size_for_row_height) {
- if (contact->type == CLCIT_GROUP ||
+ if (contact->type == CLCIT_GROUP ||
(contact->type == CLCIT_CONTACT && contact->iImage != -1 && !(dat->icon_hide_on_avatar && dat->avatars_show && contact->avatar_data != NULL && !contact->image_is_special)))
{
height = max(height, ICON_HEIGHT);
diff --git a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp
index 02600b8d03..fd468c8d70 100644
--- a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp
+++ b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp
@@ -317,16 +317,16 @@ void RefreshTree(HWND hwndDlg, HTREEITEM hti)
if (cell->type == 0)
mir_sntprintf(buf, SIZEOF(buf), TranslateT("Empty %s cell"), cell->cont == TC_COL ? TranslateT("column") : TranslateT("line"));
else
- _tcsncpy_s(buf, TranslateTS(types[cell->type]), _TRUNCATE);
+ mir_tstrncpy(buf, TranslateTS(types[cell->type]), SIZEOF(buf));
}
else
{
if (cell->type == 0)
- _tcsncpy_s(buf, (cell->cont != TC_COL ? TranslateT("columns") : TranslateT("lines")), _TRUNCATE);
+ mir_tstrncpy(buf, (cell->cont != TC_COL ? TranslateT("columns") : TranslateT("lines")), SIZEOF(buf));
else
mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s, contain %s"), TranslateTS(types[cell->type]), cell->cont != TC_COL ? TranslateT("columns") : TranslateT("lines"));
}
- if (cell->layer) _tcsncat_s(buf, TranslateT(" layered"),_TRUNCATE);
+ if (cell->layer) mir_tstrncat(buf, TranslateT(" layered"), _TRUNCATE);
tvi.mask = TVIF_HANDLE | TVIF_TEXT;
tvi.pszText = buf;
TreeView_SetItem(htree, &tvi);
diff --git a/plugins/Clist_modern/src/modern_skinbutton.cpp b/plugins/Clist_modern/src/modern_skinbutton.cpp
index 6d0617bbff..3049b8f7e5 100644
--- a/plugins/Clist_modern/src/modern_skinbutton.cpp
+++ b/plugins/Clist_modern/src/modern_skinbutton.cpp
@@ -266,7 +266,7 @@ static int ModernSkinButtonToggleDBValue(char * ValueDBSection, char *ValueTypeD
static char *_skipblank(char * str) //str will be modified;
{
- char * endstr = str + strlen(str);
+ char * endstr = str + mir_strlen(str);
while ((*str == ' ' || *str == '\t') && *str != '\0') str++;
while ((*endstr == ' ' || *endstr == '\t') && *endstr != '\0' && endstr < str) endstr--;
if (*endstr != '\0')
@@ -285,7 +285,7 @@ static int _CallServiceStrParams(IN char * toParce, OUT int *Return)
char *pszService = mir_strdup(toParce);
if (!pszService)
return 0;
- if (strlen(pszService) == 0) {
+ if (mir_strlen(pszService) == 0) {
mir_free(pszService);
return 0;
}
@@ -295,7 +295,7 @@ static int _CallServiceStrParams(IN char * toParce, OUT int *Return)
paramCount++;
*param2 = '\0'; param2++;
_skipblank(param2);
- if (strlen(param2) == 0)
+ if (mir_strlen(param2) == 0)
param2 = NULL;
}
char *param1 = strrchr(pszService, '%');
@@ -304,13 +304,13 @@ static int _CallServiceStrParams(IN char * toParce, OUT int *Return)
paramCount++;
*param1 = '\0'; param1++;
_skipblank(param1);
- if (strlen(param1) == 0)
+ if (mir_strlen(param1) == 0)
param1 = NULL;
}
if (param1 && *param1 == '\"')
{
param1++;
- *(param1 + strlen(param1)) = '\0';
+ *(param1 + mir_strlen(param1)) = '\0';
}
else if (param1)
{
@@ -319,7 +319,7 @@ static int _CallServiceStrParams(IN char * toParce, OUT int *Return)
if (param2 && *param2 == '\"')
{
param2++;
- *(param2 + strlen(param2)) = '\0';
+ *(param2 + mir_strlen(param2)) = '\0';
}
else if (param2)
param2 = (char*)atoi(param2);
@@ -399,12 +399,12 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM w
break; // DONT! fall thru
case WM_SETCURSOR:
- {
- HCURSOR hCurs1 = LoadCursor(NULL, IDC_ARROW);
- if (hCurs1) SetCursor(hCurs1);
- if (bct) SetToolTip(hwndDlg, bct->Hint);
- }
- return 1;
+ {
+ HCURSOR hCurs1 = LoadCursor(NULL, IDC_ARROW);
+ if (hCurs1) SetCursor(hCurs1);
+ if (bct) SetToolTip(hwndDlg, bct->Hint);
+ }
+ return 1;
case WM_PRINT:
if (IsWindowVisible(hwndDlg))
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp
index e0aa2ce889..2eac19011f 100644
--- a/plugins/Clist_modern/src/modern_skinengine.cpp
+++ b/plugins/Clist_modern/src/modern_skinengine.cpp
@@ -185,15 +185,15 @@ HRESULT IniParser::WriteStrToDb(const char * szSection, const char * szName, con
int IniParser::GetSkinFolder(IN const TCHAR * szFileName, OUT TCHAR * pszFolderName)
{
TCHAR *szBuff = mir_tstrdup(szFileName);
- TCHAR *pszPos = szBuff + _tcslen(szBuff);
+ TCHAR *pszPos = szBuff + mir_tstrlen(szBuff);
while (pszPos > szBuff && *pszPos != _T('.')) { pszPos--; }
*pszPos = _T('\0');
- _tcscpy(pszFolderName, szBuff);
+ mir_tstrcpy(pszFolderName, szBuff);
TCHAR custom_folder[MAX_PATH], cus[MAX_PATH];
TCHAR *b3;
- _tcsncpy(custom_folder, pszFolderName, MAX_PATH-1);
- b3 = custom_folder + _tcslen(custom_folder);
+ mir_tstrncpy(custom_folder, pszFolderName, SIZEOF(custom_folder));
+ b3 = custom_folder + mir_tstrlen(custom_folder);
while (b3 > custom_folder && *b3 != _T('\\')) { b3--; }
*b3 = _T('\0');
@@ -288,7 +288,7 @@ const char * IniParser::_RemoveTailings(const char * szLine, size_t& len)
const char * pStart = szLine;
while (*pStart == ' ' || *pStart == '\t')
pStart++; //skip spaces at begin
- const char * pEnd = pStart + strlen(pStart);
+ const char * pEnd = pStart + mir_strlen(pStart);
while (pEnd > pStart && (*pEnd == ' ' || *pEnd == '\t' || *pEnd == '\n' || *pEnd == '\r'))
pEnd--;
@@ -299,7 +299,7 @@ const char * IniParser::_RemoveTailings(const char * szLine, size_t& len)
BOOL IniParser::_DoParseLine(char *szLine)
{
_nLine++;
- size_t len = strlen(szLine);
+ size_t len = mir_strlen(szLine);
if (len == 0)
return TRUE;
@@ -322,7 +322,7 @@ BOOL IniParser::_DoParseLine(char *szLine)
DWORD sectionLen = ebuf - tbuf;
_szSection = (char*)mir_alloc(sectionLen + 1);
- strncpy(_szSection, tbuf, sectionLen);
+ mir_strncpy(_szSection, tbuf, sectionLen);
_szSection[sectionLen] = '\0';
}
return TRUE;
@@ -334,7 +334,7 @@ BOOL IniParser::_DoParseLine(char *szLine)
char *keyName = szLine;
char *keyValue = szLine;
- size_t eqPlace = 0, len2 = strlen(keyName);
+ size_t eqPlace = 0, len2 = mir_strlen(keyName);
while (eqPlace < len2 && keyName[eqPlace] != '=')
eqPlace++; //find '='
@@ -1382,7 +1382,7 @@ INT_PTR ske_Service_DrawGlyph(WPARAM wParam, LPARAM lParam)
LPSKINDRAWREQUEST preq = (LPSKINDRAWREQUEST)wParam;
if (preq == NULL)
return -1;
-
+
mir_cslock lck(cs_SkinChanging);
LPSKINOBJECTDESCRIPTOR pgl = (lParam ? ske_FindObjectByMask((MODERNMASK*)lParam, NULL) : ske_FindObject(preq->szObjectID, NULL));
@@ -1462,7 +1462,7 @@ int ske_GetFullFilename(TCHAR *buf, const TCHAR *file, TCHAR *skinfolder, BOOL m
if (file[0] != '\\' && file[1] != ':')
mir_sntprintf(b2, SIZEOF(b2), _T("%s\\%s"), (skinfolder == NULL) ? SkinPlace : ((INT_PTR)skinfolder != -1) ? skinfolder : _T(""), file);
else
- _tcsncpy(b2, file, SIZEOF(b2));
+ mir_tstrncpy(b2, file, SIZEOF(b2));
if (madeAbsolute) {
if (b2[0] == '\\' && b2[1] != '\\')
@@ -1470,7 +1470,7 @@ int ske_GetFullFilename(TCHAR *buf, const TCHAR *file, TCHAR *skinfolder, BOOL m
else
PathToAbsoluteT(b2, buf);
}
- else _tcsncpy(buf, b2, MAX_PATH);
+ else mir_tstrncpy(buf, b2, MAX_PATH);
mir_free(SkinPlace);
return 0;
@@ -1742,7 +1742,7 @@ HBITMAP ske_LoadGlyphImage(const TCHAR *tszFileName)
return NULL;
// add to loaded list
- if (dwLoadedImagesCount + 1>dwLoadedImagesAlocated) {
+ if (dwLoadedImagesCount + 1 > dwLoadedImagesAlocated) {
pLoadedImages = (GLYPHIMAGE*)mir_realloc(pLoadedImages, sizeof(GLYPHIMAGE)*(dwLoadedImagesCount + 1));
if (!pLoadedImages)
return NULL;
@@ -1761,7 +1761,7 @@ int ske_UnloadGlyphImage(HBITMAP hbmp)
for (DWORD i = 0; i < dwLoadedImagesCount && pLoadedImages; i++) {
if (hbmp != pLoadedImages[i].hGlyph)
continue;
-
+
pLoadedImages[i].dwLoadedTimes--;
if (pLoadedImages[i].dwLoadedTimes == 0) {
LPGLYPHIMAGE gl = &(pLoadedImages[i]);
@@ -1802,7 +1802,7 @@ int ske_UnloadSkin(SKINOBJECTSLIST * Skin)
if (Skin->pTextList) List_Destroy(Skin->pTextList);
mir_free_and_nil(Skin->pTextList);
ModernSkinButtonDeleteAll();
- if (Skin->dwObjLPAlocated == 0)
+ if (Skin->dwObjLPAlocated == 0)
return 0;
for (DWORD i = 0; i < Skin->dwObjLPAlocated; i++) {
@@ -1854,7 +1854,7 @@ static void RegisterMaskByParce(const char *szSetting, char *szValue, SKINOBJECT
DWORD ID = atoi(szSetting + 1);
Mask = szValue + i + 1;
Obj = (char*)mir_alloc(i + 1);
- strncpy(Obj, szValue, i);
+ mir_strncpy(Obj, szValue, i);
Obj[i] = '\0';
res = AddStrModernMaskToList(ID, Mask, Obj, pSkin->pMaskList);
mir_free(Obj);
@@ -2307,7 +2307,7 @@ static int ske_AlphaTextOut(HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect,
int workRectWidth = workRect.right - workRect.left;
int workRectHeight = workRect.bottom - workRect.top;
if (workRectWidth <= 0 || workRectHeight <= 0) {
- if(destHasNotDIB)
+ if (destHasNotDIB)
mir_free(pDestBits);
return 0;
}
@@ -2649,7 +2649,7 @@ BOOL ske_DrawIconEx(HDC hdcDst, int xLeft, int yTop, HICON hIcon, int cxWidth, i
DeleteObject(ici.hbmMask);
return 0;
}
-
+
BITMAP immaskbt;
GetObject(ici.hbmMask, sizeof(BITMAP), &immaskbt);
DWORD cy = imbt.bmHeight;
@@ -2667,7 +2667,7 @@ BOOL ske_DrawIconEx(HDC hdcDst, int xLeft, int yTop, HICON hIcon, int cxWidth, i
}
DeleteDC(tempDC1);
}
-
+
bool NoDIBImage = (imbt.bmBits == NULL);
if (NoDIBImage) {
imimagbits = (BYTE*)malloc(cy*imbt.bmWidthBytes);
@@ -3492,7 +3492,7 @@ static void ske_AddParseSkinFont(char * szFontID, char * szDefineString)
logfont.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
char buf[255];
- strncpy(logfont.lfFaceName, GetParamN(szDefineString, buf, sizeof(buf), 0, ',', TRUE), 32);
+ mir_strncpy(logfont.lfFaceName, GetParamN(szDefineString, buf, sizeof(buf), 0, ',', TRUE), SIZEOF(logfont.lfFaceName));
logfont.lfHeight = atoi(GetParamN(szDefineString, buf, sizeof(buf), 1, ',', TRUE));
if (logfont.lfHeight < 0) {
HDC hdc = CreateCompatibleDC(NULL);
@@ -3749,13 +3749,13 @@ HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha)
}
#define NEWJOINEDSTR(destination, first, separator, last) \
- destination = (char*)alloca(strlen(first)+strlen(separator)+strlen(last)+1); \
+ destination = (char*)alloca(mir_strlen(first)+mir_strlen(separator)+mir_strlen(last)+1); \
if (destination) { \
*destination = '\0'; \
- strcat(destination,first); \
- strcat(destination,separator); \
- strcat(destination,last); \
- }
+ mir_strcat(destination,first); \
+ mir_strcat(destination,separator); \
+ mir_strcat(destination,last); \
+ }
#define SKINSETSECTION "SkinnedSettings"
diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp
index 2a9fe1b69e..1e6ff91483 100644
--- a/plugins/Clist_modern/src/modern_skinopt.cpp
+++ b/plugins/Clist_modern/src/modern_skinopt.cpp
@@ -105,39 +105,39 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
break;
case IDC_BUTTON_INFO:
+ {
+ TCHAR Author[255], URL[MAX_PATH], Contact[255], Description[400], text[2000];
+ SkinListData *sd = NULL;
+ HTREEITEM hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE1));
+ if (hti == 0) return 0;
{
- TCHAR Author[255], URL[MAX_PATH], Contact[255], Description[400], text[2000];
- SkinListData *sd = NULL;
- HTREEITEM hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE1));
- if (hti == 0) return 0;
- {
- TVITEM tvi = { 0 };
- tvi.hItem = hti;
- tvi.mask = TVIF_HANDLE | TVIF_PARAM;
- TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE1), &tvi);
- sd = (SkinListData*)(tvi.lParam);
- }
- if (!sd) return 0;
- if (sd->File && !_tcschr(sd->File, _T('%'))) {
- GetPrivateProfileString(_T("Skin_Description_Section"), _T("Author"), TranslateT("( unknown )"), Author, SIZEOF(Author), sd->File);
- GetPrivateProfileString(_T("Skin_Description_Section"), _T("URL"), _T(""), URL, SIZEOF(URL), sd->File);
- GetPrivateProfileString(_T("Skin_Description_Section"), _T("Contact"), _T(""), Contact, SIZEOF(Contact), sd->File);
- GetPrivateProfileString(_T("Skin_Description_Section"), _T("Description"), _T(""), Description, SIZEOF(Description), sd->File);
- mir_sntprintf(text, SIZEOF(text), TranslateT("%s\n\n%s\n\nAuthor(s):\t %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s"),
- sd->Name, Description, Author, Contact, URL, sd->File);
- }
- else {
- mir_sntprintf(text, SIZEOF(text), TranslateT("%s\n\n%s\n\nAuthor(s): %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s"),
- TranslateT("reVista for Modern v0.5"),
- TranslateT("This is second default Modern Contact list skin in Vista Aero style"),
- TranslateT("Angeli-Ka (graphics), FYR (template)"),
- _T("JID: fyr@jabber.ru"),
- _T("fyr.mirandaim.ru"),
- TranslateT("Inside library"));
- }
- MessageBox(hwndDlg, text, TranslateT("Skin information"), MB_OK | MB_ICONINFORMATION);
+ TVITEM tvi = { 0 };
+ tvi.hItem = hti;
+ tvi.mask = TVIF_HANDLE | TVIF_PARAM;
+ TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE1), &tvi);
+ sd = (SkinListData*)(tvi.lParam);
}
- break;
+ if (!sd) return 0;
+ if (sd->File && !_tcschr(sd->File, _T('%'))) {
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("Author"), TranslateT("( unknown )"), Author, SIZEOF(Author), sd->File);
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("URL"), _T(""), URL, SIZEOF(URL), sd->File);
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("Contact"), _T(""), Contact, SIZEOF(Contact), sd->File);
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("Description"), _T(""), Description, SIZEOF(Description), sd->File);
+ mir_sntprintf(text, SIZEOF(text), TranslateT("%s\n\n%s\n\nAuthor(s):\t %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s"),
+ sd->Name, Description, Author, Contact, URL, sd->File);
+ }
+ else {
+ mir_sntprintf(text, SIZEOF(text), TranslateT("%s\n\n%s\n\nAuthor(s): %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s"),
+ TranslateT("reVista for Modern v0.5"),
+ TranslateT("This is second default Modern Contact list skin in Vista Aero style"),
+ TranslateT("Angeli-Ka (graphics), FYR (template)"),
+ _T("JID: fyr@jabber.ru"),
+ _T("fyr.mirandaim.ru"),
+ TranslateT("Inside library"));
+ }
+ MessageBox(hwndDlg, text, TranslateT("Skin information"), MB_OK | MB_ICONINFORMATION);
+ }
+ break;
case IDC_BUTTON_APPLY_SKIN:
if (HIWORD(wParam) == BN_CLICKED) {
@@ -230,88 +230,88 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->idFrom) {
case IDC_TREE1:
- {
- NMTREEVIEW * nmtv = (NMTREEVIEW *)lParam;
- if (nmtv == NULL)
- return 0;
-
- if (nmtv->hdr.code == TVN_SELCHANGED) {
- SkinListData * sd = NULL;
- if (hPreviewBitmap) {
- ske_UnloadGlyphImage(hPreviewBitmap);
- hPreviewBitmap = NULL;
- }
+ {
+ NMTREEVIEW * nmtv = (NMTREEVIEW *)lParam;
+ if (nmtv == NULL)
+ return 0;
+
+ if (nmtv->hdr.code == TVN_SELCHANGED) {
+ SkinListData * sd = NULL;
+ if (hPreviewBitmap) {
+ ske_UnloadGlyphImage(hPreviewBitmap);
+ hPreviewBitmap = NULL;
+ }
- if (nmtv->itemNew.lParam) {
- sd = (SkinListData*)nmtv->itemNew.lParam;
-
- TCHAR buf[MAX_PATH];
- PathToRelativeT(sd->File, buf);
- SetDlgItemText(hwndDlg, IDC_EDIT_SKIN_FILENAME, buf);
-
- TCHAR prfn[MAX_PATH] = { 0 }, imfn[MAX_PATH] = { 0 }, skinfolder[MAX_PATH] = { 0 };
- GetPrivateProfileString(_T("Skin_Description_Section"), _T("Preview"), _T(""), imfn, SIZEOF(imfn), sd->File);
- IniParser::GetSkinFolder(sd->File, skinfolder);
- mir_sntprintf(prfn, SIZEOF(prfn), _T("%s\\%s"), skinfolder, imfn);
- PathToAbsoluteT(prfn, imfn);
- hPreviewBitmap = ske_LoadGlyphImage(imfn);
-
- EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_APPLY_SKIN), TRUE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_INFO), TRUE);
- if (hPreviewBitmap)
- InvalidateRect(GetDlgItem(hwndDlg, IDC_PREVIEW), NULL, TRUE);
- else { //prepare text
- TCHAR Author[255], URL[MAX_PATH], Contact[255], Description[400], text[2000];
- SkinListData* sd = NULL;
- HTREEITEM hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE1));
- if (hti == 0) return 0;
- {
- TVITEM tvi = { 0 };
- tvi.hItem = hti;
- tvi.mask = TVIF_HANDLE | TVIF_PARAM;
- TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE1), &tvi);
- sd = (SkinListData*)(tvi.lParam);
- }
- if (!sd) return 0;
-
- if (sd->File && !_tcschr(sd->File, _T('%'))) {
- GetPrivateProfileString(_T("Skin_Description_Section"), _T("Author"), TranslateT("( unknown )"), Author, SIZEOF(Author), sd->File);
- GetPrivateProfileString(_T("Skin_Description_Section"), _T("URL"), _T(""), URL, SIZEOF(URL), sd->File);
- GetPrivateProfileString(_T("Skin_Description_Section"), _T("Contact"), _T(""), Contact, SIZEOF(Contact), sd->File);
- GetPrivateProfileString(_T("Skin_Description_Section"), _T("Description"), _T(""), Description, SIZEOF(Description), sd->File);
- mir_sntprintf(text, SIZEOF(text), TranslateT("Preview is not available\n\n%s\n----------------------\n\n%s\n\nAUTHOR(S):\n%s\n\nCONTACT:\n%s\n\nHOMEPAGE:\n%s"),
- sd->Name, Description, Author, Contact, URL);
- }
- else {
- mir_sntprintf(text, SIZEOF(text), TranslateT("%s\n\n%s\n\nAUTHORS:\n%s\n\nCONTACT:\n%s\n\nWEB:\n%s\n\n\n"),
- TranslateT("reVista for Modern v0.5"),
- TranslateT("This is second default Modern Contact list skin in Vista Aero style"),
- TranslateT("graphics by Angeli-Ka\ntemplate by FYR"),
- _T("JID: fyr@jabber.ru"),
- _T("fyr.mirandaim.ru"));
- }
- ShowWindow(GetDlgItem(hwndDlg, IDC_PREVIEW), SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg, IDC_STATIC_INFO), SW_SHOW);
- SetDlgItemText(hwndDlg, IDC_STATIC_INFO, text);
+ if (nmtv->itemNew.lParam) {
+ sd = (SkinListData*)nmtv->itemNew.lParam;
+
+ TCHAR buf[MAX_PATH];
+ PathToRelativeT(sd->File, buf);
+ SetDlgItemText(hwndDlg, IDC_EDIT_SKIN_FILENAME, buf);
+
+ TCHAR prfn[MAX_PATH] = { 0 }, imfn[MAX_PATH] = { 0 }, skinfolder[MAX_PATH] = { 0 };
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("Preview"), _T(""), imfn, SIZEOF(imfn), sd->File);
+ IniParser::GetSkinFolder(sd->File, skinfolder);
+ mir_sntprintf(prfn, SIZEOF(prfn), _T("%s\\%s"), skinfolder, imfn);
+ PathToAbsoluteT(prfn, imfn);
+ hPreviewBitmap = ske_LoadGlyphImage(imfn);
+
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_APPLY_SKIN), TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_INFO), TRUE);
+ if (hPreviewBitmap)
+ InvalidateRect(GetDlgItem(hwndDlg, IDC_PREVIEW), NULL, TRUE);
+ else { //prepare text
+ TCHAR Author[255], URL[MAX_PATH], Contact[255], Description[400], text[2000];
+ SkinListData* sd = NULL;
+ HTREEITEM hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE1));
+ if (hti == 0) return 0;
+ {
+ TVITEM tvi = { 0 };
+ tvi.hItem = hti;
+ tvi.mask = TVIF_HANDLE | TVIF_PARAM;
+ TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE1), &tvi);
+ sd = (SkinListData*)(tvi.lParam);
+ }
+ if (!sd) return 0;
+
+ if (sd->File && !_tcschr(sd->File, _T('%'))) {
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("Author"), TranslateT("( unknown )"), Author, SIZEOF(Author), sd->File);
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("URL"), _T(""), URL, SIZEOF(URL), sd->File);
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("Contact"), _T(""), Contact, SIZEOF(Contact), sd->File);
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("Description"), _T(""), Description, SIZEOF(Description), sd->File);
+ mir_sntprintf(text, SIZEOF(text), TranslateT("Preview is not available\n\n%s\n----------------------\n\n%s\n\nAUTHOR(S):\n%s\n\nCONTACT:\n%s\n\nHOMEPAGE:\n%s"),
+ sd->Name, Description, Author, Contact, URL);
+ }
+ else {
+ mir_sntprintf(text, SIZEOF(text), TranslateT("%s\n\n%s\n\nAUTHORS:\n%s\n\nCONTACT:\n%s\n\nWEB:\n%s\n\n\n"),
+ TranslateT("reVista for Modern v0.5"),
+ TranslateT("This is second default Modern Contact list skin in Vista Aero style"),
+ TranslateT("graphics by Angeli-Ka\ntemplate by FYR"),
+ _T("JID: fyr@jabber.ru"),
+ _T("fyr.mirandaim.ru"));
}
- }
- else {
- //no selected
- SetDlgItemText(hwndDlg, IDC_EDIT_SKIN_FILENAME, TranslateT("Select skin from list"));
- EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_APPLY_SKIN), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_INFO), FALSE);
- SetDlgItemText(hwndDlg, IDC_STATIC_INFO, TranslateT("Please select skin to apply"));
ShowWindow(GetDlgItem(hwndDlg, IDC_PREVIEW), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_STATIC_INFO), SW_SHOW);
+ SetDlgItemText(hwndDlg, IDC_STATIC_INFO, text);
}
- ShowWindow(GetDlgItem(hwndDlg, IDC_PREVIEW), hPreviewBitmap ? SW_SHOW : SW_HIDE);
- return 0;
}
- else if (nmtv->hdr.code == TVN_DELETEITEM) {
- mir_free_and_nil(nmtv->itemOld.lParam);
- return 0;
+ else {
+ //no selected
+ SetDlgItemText(hwndDlg, IDC_EDIT_SKIN_FILENAME, TranslateT("Select skin from list"));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_APPLY_SKIN), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_INFO), FALSE);
+ SetDlgItemText(hwndDlg, IDC_STATIC_INFO, TranslateT("Please select skin to apply"));
+ ShowWindow(GetDlgItem(hwndDlg, IDC_PREVIEW), SW_HIDE);
}
+ ShowWindow(GetDlgItem(hwndDlg, IDC_PREVIEW), hPreviewBitmap ? SW_SHOW : SW_HIDE);
+ return 0;
}
- break;
+ else if (nmtv->hdr.code == TVN_DELETEITEM) {
+ mir_free_and_nil(nmtv->itemOld.lParam);
+ return 0;
+ }
+ }
+ break;
case 0:
switch (((LPNMHDR)lParam)->code) {
@@ -346,7 +346,7 @@ int SearchSkinFiles(HWND hwndDlg, TCHAR * Folder)
hFile = _tfindfirst(mask, &fd);
{
do {
- if (fd.attrib&_A_SUBDIR && !(_tcsicmp(fd.name, _T(".")) == 0 || _tcsicmp(fd.name, _T("..")) == 0))
+ if (fd.attrib&_A_SUBDIR && !(mir_tstrcmpi(fd.name, _T(".")) == 0 || mir_tstrcmpi(fd.name, _T("..")) == 0))
{//Next level of subfolders
TCHAR path[MAX_PATH];
mir_sntprintf(path, SIZEOF(path), _T("%s\\%s"), Folder, fd.name);
@@ -384,8 +384,8 @@ HTREEITEM AddSkinToListFullName(HWND hwndDlg, TCHAR * fullName)
TCHAR path[MAX_PATH] = { 0 };
TCHAR file[MAX_PATH] = { 0 };
TCHAR *buf;
- _tcsncpy(path, fullName, SIZEOF(path));
- buf = path + _tcslen(path);
+ mir_tstrncpy(path, fullName, SIZEOF(path));
+ buf = path + mir_tstrlen(path);
while (buf > path)
{
if (*buf == _T('\\'))
@@ -396,7 +396,7 @@ HTREEITEM AddSkinToListFullName(HWND hwndDlg, TCHAR * fullName)
buf--;
}
buf++;
- _tcsncpy(file, buf, SIZEOF(file));
+ mir_tstrncpy(file, buf, SIZEOF(file));
return AddSkinToList(hwndDlg, path, file);
}
@@ -411,14 +411,14 @@ HTREEITEM AddSkinToList(HWND hwndDlg, TCHAR * path, TCHAR* file)
if (!file || _tcschr(file, _T('%'))) {
mir_sntprintf(sd->File, SIZEOF(sd->File), _T("%%Default Skin%%"));
mir_sntprintf(sd->Name, SIZEOF(sd->Name), TranslateT("%Default Skin%"));
- _tcsncpy(fullName, TranslateT("Default Skin"), SIZEOF(fullName));
+ mir_tstrncpy(fullName, TranslateT("Default Skin"), SIZEOF(fullName));
}
else {
mir_sntprintf(fullName, SIZEOF(fullName), _T("%s\\%s"), path, file);
- memcpy(defskinname, file, (_tcslen(file) - 4) * sizeof(TCHAR));
- defskinname[_tcslen(file) + 1] = _T('\0');
+ memcpy(defskinname, file, (mir_tstrlen(file) - 4) * sizeof(TCHAR));
+ defskinname[mir_tstrlen(file) + 1] = _T('\0');
GetPrivateProfileString(_T("Skin_Description_Section"), _T("Name"), defskinname, sd->Name, SIZEOF(sd->Name), fullName);
- _tcscpy(sd->File, fullName);
+ mir_tstrcpy(sd->File, fullName);
}
return AddItemToTree(GetDlgItem(hwndDlg, IDC_TREE1), sd->Name, sd);
}
@@ -439,7 +439,7 @@ HTREEITEM FindChild(HWND hTree, HTREEITEM Parent, TCHAR * Caption, void * data)
tvi.pszText = buf;
tvi.cchTextMax = SIZEOF(buf);
TreeView_GetItem(hTree, &tvi);
- if (_tcsicmp(Caption, tvi.pszText) == 0) {
+ if (mir_tstrcmpi(Caption, tvi.pszText) == 0) {
if (!data)
return tmp;
@@ -449,7 +449,7 @@ HTREEITEM FindChild(HWND hTree, HTREEITEM Parent, TCHAR * Caption, void * data)
TreeView_GetItem(hTree, &tvi);
SkinListData *sd = (SkinListData*)tvi.lParam;
if (sd)
- if (!_tcsicmp(sd->File, ((SkinListData*)data)->File))
+ if (!mir_tstrcmpi(sd->File, ((SkinListData*)data)->File))
return tmp;
}
tmp = TreeView_GetNextSibling(hTree, tmp);
diff --git a/plugins/Clist_modern/src/modern_skinselector.cpp b/plugins/Clist_modern/src/modern_skinselector.cpp
index 7d62758208..e78f3f79e1 100644
--- a/plugins/Clist_modern/src/modern_skinselector.cpp
+++ b/plugins/Clist_modern/src/modern_skinselector.cpp
@@ -95,7 +95,7 @@ DWORD mod_CalcHash(const char *szStr)
mov esi, szStr
mov al, [esi]
xor cl, cl
-lph_top : //only 4 of 9 instructions in here don't use AL, so optimal pipe use is impossible
+ lph_top : //only 4 of 9 instructions in here don't use AL, so optimal pipe use is impossible
xor edx, eax
inc esi
xor eax, eax
@@ -195,8 +195,7 @@ int SortMaskList(LISTMODERNMASK * mmList)
pos = 1;
}
else pos++;
- }
- while (pos < mmList->dwMaskCnt);
+ } while (pos < mmList->dwMaskCnt);
return 1;
}
@@ -327,7 +326,7 @@ int ParseToModernMask(MODERNMASK *mm, char *szText)
}
else //ParamName = 'Module'
{
- param.szName = _strdup("Module");
+ param.szName = mir_strdup("Module");
param.dwId = mod_CalcHash(param.szName);
}
@@ -414,7 +413,7 @@ int AddStrModernMaskToList(DWORD maskID, char *szStr, char *objectName, LISTMODE
SKINOBJECTDESCRIPTOR *skin_FindObjectByMask(MODERNMASK *mm, LISTMODERNMASK *mmTemplateList)
{
- for (DWORD i = 0;i < mmTemplateList->dwMaskCnt;i++)
+ for (DWORD i = 0; i < mmTemplateList->dwMaskCnt; i++)
if (CompareModernMask(mm, &(mmTemplateList->pl_Masks[i])))
return (SKINOBJECTDESCRIPTOR*)mmTemplateList->pl_Masks[i].pObject;
@@ -465,7 +464,7 @@ WCHAR* GetParamN(WCHAR *string, WCHAR *buf, int buflen, BYTE paramN, WCHAR Delim
i--;
}
len = ((int)(i - start) < buflen) ? i - start : buflen;
- _tcsncpy(buf, string + start, len);
+ mir_tstrncpy(buf, string + start, len);
buf[len] = '\0';
}
else buf[0] = '\0';
@@ -491,7 +490,7 @@ char * GetParamN(char * string, char * buf, int buflen, BYTE paramN, char Delim,
i--;
}
len = ((int)(i - start) < buflen) ? i - start : buflen;
- strncpy(buf, string + start, len);
+ mir_strncpy(buf, string + start, len);
buf[len] = '\0';
}
else buf[0] = '\0';
@@ -642,6 +641,6 @@ int SkinDrawGlyphMask(HDC hdc, RECT *rcSize, RECT *rcClip, MODERNMASK *ModernMas
rq.hDC = hdc;
rq.rcDestRect = *rcSize;
rq.rcClipRect = *rcClip;
- strncpy(rq.szObjectID, "Masked draw", SIZEOF(rq.szObjectID)-1);
+ mir_strncpy(rq.szObjectID, "Masked draw", SIZEOF(rq.szObjectID));
return ske_Service_DrawGlyph((WPARAM)&rq, (LPARAM)ModernMask);
}
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp
index 8527387a58..82d031905c 100644
--- a/plugins/Clist_modern/src/modern_statusbar.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar.cpp
@@ -566,7 +566,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
RECT rt = r;
rt.left = x + (spaceWidth >> 1);
rt.top = textY;
- ske_DrawText(hDC, p.tszProtoXStatus, (int)_tcslen(p.tszProtoXStatus), &rt, 0);
+ ske_DrawText(hDC, p.tszProtoXStatus, (int)mir_tstrlen(p.tszProtoXStatus), &rt, 0);
}
p.protoRect = r;
@@ -782,10 +782,10 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
char *pos = strstri(g_CluiData.protoFilter, p.szAccountName);
if (pos) {
// remove filter
- size_t len = strlen(protoF);
- memmove(pos, pos + len, strlen(pos + len) + 1);
+ size_t len = mir_strlen(protoF);
+ memmove(pos, pos + len, mir_strlen(pos + len) + 1);
- if (strlen(g_CluiData.protoFilter) == 0)
+ if (mir_strlen(g_CluiData.protoFilter) == 0)
ApplyViewMode("");
else
g_CluiData.bFilterEffective = CLVM_FILTER_PROTOS;
@@ -816,8 +816,8 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
if (strstri(g_CluiData.protoFilter, protoF)) {
char * temp = mir_utf8encodeT(accs[i]->tszAccountName);
if (!first)
- strncat(filterName, "; ", SIZEOF(filterName) - strlen(filterName));
- strncat(filterName, temp, SIZEOF(filterName) - strlen(filterName));
+ mir_strncat(filterName, "; ", SIZEOF(filterName) - mir_strlen(filterName));
+ mir_strncat(filterName, temp, SIZEOF(filterName) - mir_strlen(filterName));
first = false;
mir_free(temp);
}
diff --git a/plugins/Clist_modern/src/modern_tbbutton.cpp b/plugins/Clist_modern/src/modern_tbbutton.cpp
index 95beef5399..9d38947961 100644
--- a/plugins/Clist_modern/src/modern_tbbutton.cpp
+++ b/plugins/Clist_modern/src/modern_tbbutton.cpp
@@ -239,7 +239,7 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam
break;
case WM_SETTEXT:
- _tcsncpy_s(bct->szText, (TCHAR*)lParam, _TRUNCATE);
+ mir_tstrncpy(bct->szText, (TCHAR*)lParam, SIZEOF(bct->szText));
break;
case WM_SETFONT:
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp
index 07195a35f2..cee0d5137a 100644
--- a/plugins/Clist_modern/src/modern_toolbar.cpp
+++ b/plugins/Clist_modern/src/modern_toolbar.cpp
@@ -318,7 +318,7 @@ void CustomizeButton(HANDLE ttbid, HWND hWnd, LPARAM lParam);
static int Toolbar_ModuleReloaded(WPARAM wParam, LPARAM)
{
PLUGININFOEX *pInfo = (PLUGININFOEX*)wParam;
- if (!_stricmp(pInfo->shortName, "TopToolBar"))
+ if (!mir_strcmpi(pInfo->shortName, "TopToolBar"))
TopToolbar_SetCustomProc(CustomizeButton, 0);
return 0;
diff --git a/plugins/Clist_modern/src/modern_utils.cpp b/plugins/Clist_modern/src/modern_utils.cpp
index 1dbd55bb5d..6164b79de4 100644
--- a/plugins/Clist_modern/src/modern_utils.cpp
+++ b/plugins/Clist_modern/src/modern_utils.cpp
@@ -6,8 +6,8 @@ char * __cdecl strstri(char *a, const char *b)
{
char * x, *y;
if (!a || !b) return FALSE;
- x = _strdup(a);
- y = _strdup(b);
+ x = mir_strdup(a);
+ y = mir_strdup(b);
x = _strupr(x);
y = _strupr(y);
char * pos = strstr(x, y);
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp
index 56767b068b..a5af9e501b 100644
--- a/plugins/Clist_modern/src/modern_viewmodebar.cpp
+++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp
@@ -183,7 +183,7 @@ static void UpdateStickies()
MCONTACT hItem = (MCONTACT)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_FINDCONTACT, hContact, 0);
if (hItem)
SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, (BYTE)db_get_dw(hContact, CLVM_MODULE, g_szModename, 0) ? 1 : 0);
-
+
DWORD localMask = HIWORD(db_get_dw(hContact, CLVM_MODULE, g_szModename, 0));
UpdateClistItem(hItem, (localMask == 0 || localMask == stickyStatusMask) ? stickyStatusMask : localMask);
}
@@ -287,7 +287,7 @@ static int FillDialog(HWND hwnd)
static void SetAllChildIcons(HWND hwndList, HANDLE hFirstItem, int iColumn, int iImage)
{
int typeOfFirst = SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hFirstItem, 0);
-
+
// check groups
HANDLE hItem = (typeOfFirst == CLCIT_GROUP) ? hFirstItem : (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hFirstItem);
while (hItem) {
@@ -296,7 +296,7 @@ static void SetAllChildIcons(HWND hwndList, HANDLE hFirstItem, int iColumn, int
SetAllChildIcons(hwndList, hChildItem, iColumn, iImage);
hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hItem);
}
-
+
// check contacts
if (typeOfFirst == CLCIT_CONTACT) hItem = hFirstItem;
else hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hFirstItem);
@@ -391,8 +391,8 @@ void SaveState()
item.cchTextMax = SIZEOF(szTemp);
item.iItem = i;
SendMessageA(hwndList, LVM_GETITEMA, 0, (LPARAM)&item);
- strncat(newProtoFilter, szTemp, SIZEOF(newProtoFilter));
- strncat(newProtoFilter, "|", SIZEOF(newProtoFilter));
+ mir_strncat(newProtoFilter, szTemp, _TRUNCATE);
+ mir_strncat(newProtoFilter, "|", _TRUNCATE);
newProtoFilter[2047] = 0;
}
}
@@ -412,8 +412,8 @@ void SaveState()
item.cchTextMax = SIZEOF(szTemp);
item.iItem = i;
SendMessage(hwndList, LVM_GETITEM, 0, (LPARAM)&item);
- _tcsncat(newGroupFilter, szTemp, SIZEOF(newGroupFilter));
- _tcsncat(newGroupFilter, _T("|"), SIZEOF(newGroupFilter));
+ mir_tstrncat(newGroupFilter, szTemp, _TRUNCATE);
+ mir_tstrncat(newGroupFilter, _T("|"), _TRUNCATE);
newGroupFilter[2047] = 0;
}
}
@@ -506,7 +506,7 @@ static void UpdateFilters()
SendDlgItemMessage(clvmHwnd, IDC_VIEWMODES, LB_GETTEXT, clvm_curItem, (LPARAM)szTempBuf);
szBuf = mir_utf8encodeT(szTempBuf);
- strncpy(g_szModename, szBuf, SIZEOF(g_szModename));
+ mir_strncpy(g_szModename, szBuf, SIZEOF(g_szModename));
g_szModename[SIZEOF(g_szModename) - 1] = 0;
mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("Configuring view mode: %s"), szTempBuf);
SetDlgItemText(clvmHwnd, IDC_CURVIEWMODE2, szTemp);
@@ -1122,13 +1122,13 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case IDC_RESETMODES:
clvm_reset_command :
ApplyViewMode("");
- break;
+ break;
case IDC_CONFIGUREMODES:
clvm_config_command :
if (!g_ViewModeOptDlg)
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_OPT_VIEWMODES), 0, DlgProcViewModesSetup, 0);
- break;
+ break;
}
default:
@@ -1286,7 +1286,7 @@ void ApplyViewMode(const char *Name, bool onlySelector)
mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_PF", 246, Name);
if (!db_get_s(NULL, CLVM_MODULE, szSetting, &dbv)) {
if (mir_strlen(dbv.pszVal) >= 2) {
- strncpy(g_CluiData.protoFilter, dbv.pszVal, SIZEOF(g_CluiData.protoFilter));
+ mir_strncpy(g_CluiData.protoFilter, dbv.pszVal, SIZEOF(g_CluiData.protoFilter));
g_CluiData.protoFilter[SIZEOF(g_CluiData.protoFilter) - 1] = 0;
g_CluiData.bFilterEffective |= CLVM_FILTER_PROTOS;
}
@@ -1295,7 +1295,7 @@ void ApplyViewMode(const char *Name, bool onlySelector)
mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_GF", 246, Name);
if (!db_get_ts(NULL, CLVM_MODULE, szSetting, &dbv)) {
if (mir_tstrlen(dbv.ptszVal) >= 2) {
- _tcsncpy(g_CluiData.groupFilter, dbv.ptszVal, SIZEOF(g_CluiData.groupFilter));
+ mir_tstrncpy(g_CluiData.groupFilter, dbv.ptszVal, SIZEOF(g_CluiData.groupFilter));
g_CluiData.groupFilter[SIZEOF(g_CluiData.groupFilter) - 1] = 0;
g_CluiData.bFilterEffective |= CLVM_FILTER_GROUPS;
}
@@ -1318,7 +1318,7 @@ void ApplyViewMode(const char *Name, bool onlySelector)
if (g_CluiData.filterFlags & CLVM_AUTOCLEAR) {
mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_OPT", 246, Name);
DWORD timerexpire = LOWORD(db_get_dw(NULL, CLVM_MODULE, szSetting, 0));
- strncpy(g_CluiData.old_viewmode, g_CluiData.current_viewmode, 256);
+ mir_strncpy(g_CluiData.old_viewmode, g_CluiData.current_viewmode, SIZEOF(g_CluiData.old_viewmode));
g_CluiData.old_viewmode[255] = 0;
CLUI_SafeSetTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE, timerexpire * 1000, NULL);
}
@@ -1326,7 +1326,7 @@ void ApplyViewMode(const char *Name, bool onlySelector)
mir_snprintf(szSetting, SIZEOF(szSetting), "%c_LastMode", 246);
db_set_s(NULL, CLVM_MODULE, szSetting, Name);
}
- strncpy(g_CluiData.current_viewmode, Name, 256);
+ mir_strncpy(g_CluiData.current_viewmode, Name, SIZEOF(g_CluiData.current_viewmode));
g_CluiData.current_viewmode[255] = 0;
if (g_CluiData.filterFlags & CLVM_USELASTMSG) {