From 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 26 Jul 2016 09:20:25 +0000 Subject: less TCHARs: - TCHAR is replaced with wchar_t everywhere; - LPGENT replaced with either LPGENW or LPGEN; - fixes for ANSI plugins that improperly used _t functions; - TCHAR *t removed from MAllStrings; - ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz* git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/TSButton.cpp | 2 +- plugins/TabSRMM/src/buttonsbar.cpp | 46 ++--- plugins/TabSRMM/src/chat/chat.h | 16 +- plugins/TabSRMM/src/chat/log.cpp | 68 +++---- plugins/TabSRMM/src/chat/main.cpp | 2 +- plugins/TabSRMM/src/chat/manager.cpp | 12 +- plugins/TabSRMM/src/chat/muchighlight.cpp | 20 +- plugins/TabSRMM/src/chat/muchighlight.h | 10 +- plugins/TabSRMM/src/chat/options.cpp | 304 ++++++++++++++-------------- plugins/TabSRMM/src/chat/services.cpp | 16 +- plugins/TabSRMM/src/chat/tools.cpp | 30 +-- plugins/TabSRMM/src/chat/window.cpp | 86 ++++---- plugins/TabSRMM/src/contactcache.cpp | 22 +- plugins/TabSRMM/src/contactcache.h | 22 +- plugins/TabSRMM/src/container.cpp | 44 ++-- plugins/TabSRMM/src/containeroptions.cpp | 26 +-- plugins/TabSRMM/src/controls.cpp | 14 +- plugins/TabSRMM/src/controls.h | 2 +- plugins/TabSRMM/src/eventpopups.cpp | 48 ++--- plugins/TabSRMM/src/functions.h | 24 +-- plugins/TabSRMM/src/generic_msghandlers.cpp | 38 ++-- plugins/TabSRMM/src/globals.cpp | 8 +- plugins/TabSRMM/src/globals.h | 2 +- plugins/TabSRMM/src/infopanel.cpp | 44 ++-- plugins/TabSRMM/src/infopanel.h | 6 +- plugins/TabSRMM/src/mim.cpp | 54 ++--- plugins/TabSRMM/src/mim.h | 4 +- plugins/TabSRMM/src/modplus.cpp | 20 +- plugins/TabSRMM/src/msgdialog.cpp | 44 ++-- plugins/TabSRMM/src/msgdlgutils.cpp | 140 ++++++------- plugins/TabSRMM/src/msgdlgutils.h | 6 +- plugins/TabSRMM/src/msglog.cpp | 98 ++++----- plugins/TabSRMM/src/msgoptions.cpp | 30 +-- plugins/TabSRMM/src/msgs.cpp | 32 +-- plugins/TabSRMM/src/msgs.h | 36 ++-- plugins/TabSRMM/src/nen.h | 2 +- plugins/TabSRMM/src/selectcontainer.cpp | 28 +-- plugins/TabSRMM/src/sendlater.cpp | 32 +-- plugins/TabSRMM/src/sendlater.h | 2 +- plugins/TabSRMM/src/sendqueue.cpp | 24 +-- plugins/TabSRMM/src/sendqueue.h | 4 +- plugins/TabSRMM/src/sidebar.cpp | 12 +- plugins/TabSRMM/src/sidebar.h | 2 +- plugins/TabSRMM/src/srmm.cpp | 6 +- plugins/TabSRMM/src/stdafx.h | 4 +- plugins/TabSRMM/src/taskbar.cpp | 2 +- plugins/TabSRMM/src/taskbar.h | 4 +- plugins/TabSRMM/src/templates.cpp | 14 +- plugins/TabSRMM/src/themeio.cpp | 24 +-- plugins/TabSRMM/src/themes.cpp | 112 +++++----- plugins/TabSRMM/src/themes.h | 38 ++-- plugins/TabSRMM/src/translator.cpp | 194 +++++++++--------- plugins/TabSRMM/src/trayicon.cpp | 18 +- plugins/TabSRMM/src/typingnotify.cpp | 28 +-- plugins/TabSRMM/src/userprefs.cpp | 2 +- plugins/TabSRMM/src/utils.cpp | 106 +++++----- plugins/TabSRMM/src/utils.h | 20 +- 57 files changed, 1027 insertions(+), 1027 deletions(-) (limited to 'plugins/TabSRMM') diff --git a/plugins/TabSRMM/src/TSButton.cpp b/plugins/TabSRMM/src/TSButton.cpp index 603bdceb34..673ad7d5a2 100644 --- a/plugins/TabSRMM/src/TSButton.cpp +++ b/plugins/TabSRMM/src/TSButton.cpp @@ -277,7 +277,7 @@ static void PaintWorker(TSButtonCtrl *ctl, HDC hdcPaint) RECT rcText; CopyRect(&rcText, &rcClient); - TCHAR szText[MAX_PATH]; + wchar_t szText[MAX_PATH]; GetWindowText(ctl->hwnd, szText, _countof(szText)); SetBkMode(hdcMem, TRANSPARENT); HFONT hOldFont = (HFONT)SelectObject(hdcMem, ctl->hFont); diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index adb7c964c5..2e2561c2c2 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -24,7 +24,7 @@ struct CustomButtonData : public MZeroedObject DWORD m_dwButtonCID; DWORD m_dwArrowCID; // only use with BBBF_ISARROWBUTTON flag - TCHAR *m_ptszTooltip; // button's tooltip + wchar_t *m_ptszTooltip; // button's tooltip int m_iButtonWidth; // must be 22 for regular button and 33 for button with arrow HANDLE m_hIcon; // Handle to icolib registred icon @@ -356,7 +356,7 @@ static int SaveTree(HWND hToolBarTree) bool RSide = false; int count = 10; DWORD loc_sepcout = 0; - TCHAR strbuf[128]; + wchar_t strbuf[128]; TVITEM tvi; tvi.mask = TVIF_TEXT | TVIF_PARAM | TVIF_HANDLE; @@ -561,7 +561,7 @@ INT_PTR CALLBACK DlgProcToolBar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l TreeView_GetItem(hToolBarTree, &tvi); if (hti.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT) || (hti.hItem == TVI_FIRST)) { TVINSERTSTRUCT tvis; - TCHAR strbuf[128]; + wchar_t strbuf[128]; tvis.item.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE; tvis.item.stateMask = 0xFFFFFFFF; tvis.item.pszText = strbuf; @@ -699,7 +699,7 @@ INT_PTR CALLBACK DlgProcToolBar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l case TVN_SELCHANGING: hItem = TreeView_GetSelection(hToolBarTree); if (hItem != NULL) { - TCHAR strbuf[128]; + wchar_t strbuf[128]; TVITEM tvi; tvi.hItem = hItem; @@ -727,7 +727,7 @@ INT_PTR CALLBACK DlgProcToolBar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l case TVN_SELCHANGED: hItem = TreeView_GetSelection(hToolBarTree); if (hItem != NULL) { - TCHAR strbuf[128]; + wchar_t strbuf[128]; TVITEM tvi; tvi.pszText = strbuf; @@ -840,14 +840,14 @@ void CB_InitDefaultButtons() bbd.dwDefPos = 10; bbd.hIcon = Skin_GetIconHandle(SKINICON_OTHER_CONNECTING); bbd.pszModuleName = "Tabsrmm"; - bbd.ptszTooltip = LPGENT("Protocol button"); + bbd.ptszTooltip = LPGENW("Protocol button"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISLSIDEBUTTON | BBBF_ISARROWBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_NAME; bbd.dwDefPos = 20; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[20]; - bbd.ptszTooltip = LPGENT("Info button"); + bbd.ptszTooltip = LPGENW("Info button"); CB_AddButton(0, (LPARAM)&bbd); if (PluginConfig.g_SmileyAddAvail) { @@ -856,7 +856,7 @@ void CB_InitDefaultButtons() bbd.iButtonWidth = 0; bbd.dwDefPos = 30; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[9]; - bbd.ptszTooltip = LPGENT("Insert emoticon"); + bbd.ptszTooltip = LPGENW("Insert emoticon"); CB_AddButton(0, (LPARAM)&bbd); } @@ -864,35 +864,35 @@ void CB_InitDefaultButtons() bbd.dwButtonID = IDC_FONTBOLD; bbd.dwDefPos = 40; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[10]; - bbd.ptszTooltip = LPGENT("Bold text"); + bbd.ptszTooltip = LPGENW("Bold text"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON | BBBF_ISPUSHBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID; bbd.dwButtonID = IDC_FONTITALIC; bbd.dwDefPos = 50; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[11]; - bbd.ptszTooltip = LPGENT("Italic text"); + bbd.ptszTooltip = LPGENW("Italic text"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON | BBBF_ISPUSHBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID; bbd.dwButtonID = IDC_FONTUNDERLINE; bbd.dwDefPos = 60; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[12]; - bbd.ptszTooltip = LPGENT("Underlined text"); + bbd.ptszTooltip = LPGENW("Underlined text"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISLSIDEBUTTON | BBBF_ISPUSHBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID; bbd.dwButtonID = IDC_FONTSTRIKEOUT; bbd.dwDefPos = 70; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[15]; - bbd.ptszTooltip = LPGENT("Strike-through text"); + bbd.ptszTooltip = LPGENW("Strike-through text"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID; bbd.dwButtonID = IDC_FONTFACE; bbd.dwDefPos = 80; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[14]; - bbd.ptszTooltip = LPGENT("Select font color"); + bbd.ptszTooltip = LPGENW("Select font color"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_ISARROWBUTTON | BBBF_CREATEBYID; @@ -900,7 +900,7 @@ void CB_InitDefaultButtons() bbd.dwDefPos = 10; bbd.iButtonWidth = 51; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[6]; - bbd.ptszTooltip = LPGENT("Send message\nClick dropdown arrow for sending options"); + bbd.ptszTooltip = LPGENW("Send message\nClick dropdown arrow for sending options"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; @@ -908,7 +908,7 @@ void CB_InitDefaultButtons() bbd.dwDefPos = 20; bbd.iButtonWidth = 0; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[8]; - bbd.ptszTooltip = LPGENT("Close session"); + bbd.ptszTooltip = LPGENW("Close session"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; @@ -916,7 +916,7 @@ void CB_InitDefaultButtons() bbd.dwDefPos = 30; bbd.iButtonWidth = 0; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[4]; - bbd.ptszTooltip = LPGENT("Quote last message OR selected text"); + bbd.ptszTooltip = LPGENW("Quote last message OR selected text"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; @@ -924,7 +924,7 @@ void CB_InitDefaultButtons() bbd.dwDefPos = 40; bbd.iButtonWidth = 0; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[2]; - bbd.ptszTooltip = LPGENT("Message log options"); + bbd.ptszTooltip = LPGENW("Message log options"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; @@ -932,7 +932,7 @@ void CB_InitDefaultButtons() bbd.dwDefPos = 50; bbd.iButtonWidth = 0; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[0]; - bbd.ptszTooltip = LPGENT("View user's history"); + bbd.ptszTooltip = LPGENW("View user's history"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; @@ -940,7 +940,7 @@ void CB_InitDefaultButtons() bbd.dwDefPos = 60; bbd.iButtonWidth = 0; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[7]; - bbd.ptszTooltip = LPGENT("Edit user notes"); + bbd.ptszTooltip = LPGENW("Edit user notes"); CB_AddButton(0, (LPARAM)&bbd); //chat buttons @@ -976,7 +976,7 @@ void CB_InitDefaultButtons() bbd.dwDefPos = 81; bbd.iButtonWidth = 22; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[16]; - bbd.ptszTooltip = LPGENT("Change background color"); + bbd.ptszTooltip = LPGENW("Change background color"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; @@ -984,7 +984,7 @@ void CB_InitDefaultButtons() bbd.dwDefPos = 22; bbd.iButtonWidth = 22; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[19]; - bbd.ptszTooltip = LPGENT("Toggle nick list"); + bbd.ptszTooltip = LPGENW("Toggle nick list"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; @@ -992,7 +992,7 @@ void CB_InitDefaultButtons() bbd.dwDefPos = 24; bbd.iButtonWidth = 22; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[18]; - bbd.ptszTooltip = LPGENT("Event filter - right click to setup, left click to activate/deactivate"); + bbd.ptszTooltip = LPGENW("Event filter - right click to setup, left click to activate/deactivate"); CB_AddButton(0, (LPARAM)&bbd); bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; @@ -1000,7 +1000,7 @@ void CB_InitDefaultButtons() bbd.dwDefPos = 33; bbd.iButtonWidth = 22; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[17]; - bbd.ptszTooltip = LPGENT("Channel manager"); + bbd.ptszTooltip = LPGENW("Channel manager"); CB_AddButton(0, (LPARAM)&bbd); BB_RegisterSeparators(); diff --git a/plugins/TabSRMM/src/chat/chat.h b/plugins/TabSRMM/src/chat/chat.h index 536f837528..59f4078655 100644 --- a/plugins/TabSRMM/src/chat/chat.h +++ b/plugins/TabSRMM/src/chat/chat.h @@ -52,7 +52,7 @@ struct MODULEINFO : public GCModuleInfoBase { DWORD idleTimeStamp; DWORD lastIdleCheck; - TCHAR tszIdleMsg[60]; + wchar_t tszIdleMsg[60]; }; struct SESSION_INFO : public GCSessionInfoBase @@ -62,7 +62,7 @@ struct SESSION_INFO : public GCSessionInfoBase int iLogTrayFlags, iLogPopupFlags, iDiskLogFlags; int iSearchItem; - TCHAR szSearch[255]; + wchar_t szSearch[255]; }; struct LOGSTREAMDATA : public GCLogStreamDataBase @@ -116,7 +116,7 @@ char* Log_CreateRtfHeader(MODULEINFO *mi); // window.c INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int GetTextPixelSize(TCHAR* pszText, HFONT hFont, bool bWidth); +int GetTextPixelSize(wchar_t* pszText, HFONT hFont, bool bWidth); // options.c enum { FONTSECTION_AUTO, FONTSECTION_IM, FONTSECTION_IP }; @@ -132,28 +132,28 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT // manager.c SESSION_INFO* SM_FindSessionByHWND(HWND h); SESSION_INFO* SM_FindSessionByHCONTACT(MCONTACT h); -SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const TCHAR* pszOriginal, const TCHAR* pszCurrent); +SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const wchar_t* pszOriginal, const wchar_t* pszCurrent); void SM_RemoveContainer(TContainerData *pContainer); BOOL SM_ReconfigureFilters(); -int UM_CompareItem(USERINFO *u1, const TCHAR* pszNick, WORD wStatus); +int UM_CompareItem(USERINFO *u1, const wchar_t* pszNick, WORD wStatus); //clist.c //tools.c BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight, int bManyFix); int Chat_GetColorIndex(const char* pszModule, COLORREF cr); -TCHAR* my_strstri(const TCHAR* s1, const TCHAR* s2); +wchar_t* my_strstri(const wchar_t* s1, const wchar_t* s2); int GetRichTextLength(HWND hwnd); BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *pszText); char GetIndicator(SESSION_INFO *si, LPCTSTR ptszNick, int *iNickIndex); -UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, TCHAR* pszUID, TCHAR* pszWordText); +UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, wchar_t* pszUID, wchar_t* pszWordText); void DestroyGCMenu(HMENU *hMenu, int iIndex); void Chat_SetFilters(SESSION_INFO *si); void TSAPI DoFlashAndSoundWorker(FLASH_PARAMS* p); BOOL DoPopup(SESSION_INFO *si, GCEVENT* gce); -int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, TCHAR* pszRoomName, COLORREF crBkg, const TCHAR* fmt, ...); +int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, wchar_t* pszRoomName, COLORREF crBkg, const wchar_t* fmt, ...); BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce); #include "chat_resource.h" diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp index a7894b3e37..09b240c6aa 100644 --- a/plugins/TabSRMM/src/chat/log.cpp +++ b/plugins/TabSRMM/src/chat/log.cpp @@ -54,16 +54,16 @@ static char* u2a(const wchar_t* src, int codepage) return result; } -static char* t2acp(const TCHAR* src, int codepage) +static char* t2acp(const wchar_t* src, int codepage) { return u2a(src, codepage); } -static TCHAR *a2tcp(const char *text, int cp) +static wchar_t *a2tcp(const char *text, int cp) { if (text != NULL) { int cbLen = MultiByteToWideChar(cp, 0, text, -1, NULL, 0); - TCHAR* result = (TCHAR*)mir_alloc(sizeof(TCHAR)*(cbLen + 1)); + wchar_t* result = (wchar_t*)mir_alloc(sizeof(wchar_t)*(cbLen + 1)); if (result == NULL) return NULL; MultiByteToWideChar(cp, 0, text, -1, result, cbLen); @@ -72,12 +72,12 @@ static TCHAR *a2tcp(const char *text, int cp) return NULL; } -static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR **buffer, int *cbBufferEnd, int *cbBufferAlloced, const TCHAR *fmt, ...) +static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, wchar_t **buffer, int *cbBufferEnd, int *cbBufferAlloced, const wchar_t *fmt, ...) { va_list va; int lineLen, textCharsCount = 0; - TCHAR* line = (TCHAR*)_alloca(8001 * sizeof(TCHAR)); - TCHAR* d; + wchar_t* line = (wchar_t*)_alloca(8001 * sizeof(wchar_t)); + wchar_t* d; MODULEINFO *mi = pci->MM_FindModule(streamData->si->pszModule); va_start(va, fmt); @@ -89,14 +89,14 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR ** lineLen = lineLen * 9 + 8; if (*cbBufferEnd + lineLen > *cbBufferAlloced) { cbBufferAlloced[0] += (lineLen + 1024 - lineLen % 1024); - *buffer = (TCHAR*)mir_realloc(*buffer, *cbBufferAlloced * sizeof(TCHAR)); + *buffer = (wchar_t*)mir_realloc(*buffer, *cbBufferAlloced * sizeof(wchar_t)); } d = *buffer + *cbBufferEnd; for (; *line; line++, textCharsCount++) { if (*line == '%' && !simpleMode) { - TCHAR szTemp[200]; + wchar_t szTemp[200]; szTemp[0] = '\0'; switch (*++line) { @@ -109,12 +109,12 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR ** case 'f': if (!g_Settings.bStripFormat && !streamData->bStripFormat) { if (line[1] != '\0' && line[2] != '\0') { - TCHAR szTemp3[3], c = *line; + wchar_t szTemp3[3], c = *line; int col; szTemp3[0] = line[1]; szTemp3[1] = line[2]; szTemp3[2] = '\0'; - col = _ttoi(szTemp3); + col = _wtoi(szTemp3); mir_sntprintf(szTemp, L"%%%c#%02X%02X%02X", c, GetRValue(mi->crColors[col]), GetGValue(mi->crColors[col]), GetBValue(mi->crColors[col])); } } @@ -141,7 +141,7 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR ** if (szTemp[0]) { size_t iLen = mir_tstrlen(szTemp); - memcpy(d, szTemp, iLen * sizeof(TCHAR)); + memcpy(d, szTemp, iLen * sizeof(wchar_t)); d += iLen; } } @@ -150,7 +150,7 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR ** *d++ = (char)*line; } else { - *d++ = (TCHAR)*line; + *d++ = (wchar_t)*line; } } *d = '\0'; @@ -158,21 +158,21 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR ** return textCharsCount; } -static void AddEventTextToBufferIEView(TCHAR **buffer, int *bufferEnd, int *bufferAlloced, LOGSTREAMDATA *streamData) +static void AddEventTextToBufferIEView(wchar_t **buffer, int *bufferEnd, int *bufferAlloced, LOGSTREAMDATA *streamData) { if (streamData->lin->ptszText) Log_AppendIEView(streamData, FALSE, str, L": %s", streamData->lin->ptszText); } -static void AddEventToBufferIEView(TCHAR **buffer, int *bufferEnd, int *bufferAlloced, LOGSTREAMDATA *streamData, TCHAR *pszNick) +static void AddEventToBufferIEView(wchar_t **buffer, int *bufferEnd, int *bufferAlloced, LOGSTREAMDATA *streamData, wchar_t *pszNick) { if (streamData && streamData->lin) { switch (streamData->lin->iType) { case GC_EVENT_MESSAGE: if (streamData->lin->ptszText) { - TCHAR *ptszTemp = NULL; - TCHAR *ptszText = streamData->lin->ptszText; + wchar_t *ptszTemp = NULL; + wchar_t *ptszText = streamData->lin->ptszText; if (streamData->dat->codePage != CP_ACP) { char *aText = t2acp(streamData->lin->ptszText, CP_ACP); ptszText = ptszTemp = a2tcp(aText, streamData->dat->codePage); @@ -249,9 +249,9 @@ static void AddEventToBufferIEView(TCHAR **buffer, int *bufferEnd, int *bufferAl } } -static void LogEventIEView(LOGSTREAMDATA *streamData, TCHAR *ptszNick) +static void LogEventIEView(LOGSTREAMDATA *streamData, wchar_t *ptszNick) { - TCHAR *buffer = NULL; + wchar_t *buffer = NULL; int bufferEnd = 0; int bufferAlloced = 0; IEVIEWEVENTDATA ied; @@ -422,10 +422,10 @@ static int EventToIcon(LOGINFO * lin) return 0; } -static void Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, CMStringA &str, const TCHAR *fmt, ...) +static void Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, CMStringA &str, const wchar_t *fmt, ...) { int textCharsCount = 0; - TCHAR *line = (TCHAR*)_alloca(8001 * sizeof(TCHAR)); + wchar_t *line = (wchar_t*)_alloca(8001 * sizeof(wchar_t)); va_list va; va_start(va, fmt); @@ -458,14 +458,14 @@ static void Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, CMStringA if (g_Settings.bStripFormat || streamData->bStripFormat) line += 2; else if (line[1] != '\0' && line[2] != '\0') { - TCHAR szTemp3[3], c = *line; + wchar_t szTemp3[3], c = *line; int col; szTemp3[0] = line[1]; szTemp3[1] = line[2]; szTemp3[2] = '\0'; line += 2; - col = _ttoi(szTemp3); + col = _wtoi(szTemp3); col += (OPTIONS_FONTCOUNT + 1); res.AppendFormat((c == 'c') ? "\\cf%u " : "\\highlight%u ", col); } @@ -520,8 +520,8 @@ static void Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, CMStringA static void AddEventToBuffer(CMStringA &str, LOGSTREAMDATA *streamData) { - TCHAR szTemp[512], szTemp2[512]; - TCHAR* pszNick = NULL; + wchar_t szTemp[512], szTemp2[512]; + wchar_t* pszNick = NULL; if (streamData == NULL) return; @@ -531,20 +531,20 @@ static void AddEventToBuffer(CMStringA &str, LOGSTREAMDATA *streamData) if (streamData->lin->ptszNick) { if (g_Settings.bLogLimitNames && mir_tstrlen(streamData->lin->ptszNick) > 20) { - _tcsncpy_s(szTemp, 20, streamData->lin->ptszNick, _TRUNCATE); - _tcsncpy_s(szTemp + 20, 4, L"...", _TRUNCATE); + wcsncpy_s(szTemp, 20, streamData->lin->ptszNick, _TRUNCATE); + wcsncpy_s(szTemp + 20, 4, L"...", _TRUNCATE); } - else _tcsncpy_s(szTemp, streamData->lin->ptszNick, _TRUNCATE); + else wcsncpy_s(szTemp, streamData->lin->ptszNick, _TRUNCATE); if (g_Settings.bClickableNicks) mir_sntprintf(szTemp2, L"~~++#%s#++~~", szTemp); else - _tcsncpy_s(szTemp2, szTemp, _TRUNCATE); + wcsncpy_s(szTemp2, szTemp, _TRUNCATE); if (streamData->lin->ptszUserInfo && streamData->lin->iType != GC_EVENT_TOPIC) mir_sntprintf(szTemp, L"%s (%s)", szTemp2, streamData->lin->ptszUserInfo); else - _tcsncpy_s(szTemp, szTemp2, _TRUNCATE); + wcsncpy_s(szTemp, szTemp2, _TRUNCATE); pszNick = szTemp; } @@ -669,7 +669,7 @@ char* Log_CreateRtfHeader(MODULEINFO *mi) int iIndent = 0; if (g_Settings.bLogSymbols) { - TCHAR szString[2]; + wchar_t szString[2]; LOGFONT lf; szString[1] = 0; @@ -770,10 +770,10 @@ static char* Log_CreateRTF(LOGSTREAMDATA *streamData) //insert timestamp if (g_Settings.bShowTime) { - TCHAR szTimeStamp[30], szOldTimeStamp[30]; + wchar_t szTimeStamp[30], szOldTimeStamp[30]; - _tcsncpy_s(szTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, lin->time), _TRUNCATE); - _tcsncpy_s(szOldTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, streamData->si->LastTime), _TRUNCATE); + wcsncpy_s(szTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, lin->time), _TRUNCATE); + wcsncpy_s(szOldTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, streamData->si->LastTime), _TRUNCATE); if (!g_Settings.bShowTimeIfChanged || streamData->si->LastTime == 0 || mir_tstrcmp(szTimeStamp, szOldTimeStamp)) { streamData->si->LastTime = lin->time; Log_AppendRTF(streamData, TRUE, str, L"%s", szTimeStamp); @@ -984,7 +984,7 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedra // trim the message log to the number of most recent events // this uses hidden marks in the rich text to find the events which should be deleted if (si->bTrimmed) { - TCHAR szPattern[50]; + wchar_t szPattern[50]; mir_sntprintf(szPattern, L"~-+%d+-~", si->pLogEnd); FINDTEXTEX fi; diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp index eee0f6823d..61859eab96 100644 --- a/plugins/TabSRMM/src/chat/main.cpp +++ b/plugins/TabSRMM/src/chat/main.cpp @@ -269,7 +269,7 @@ int Chat_Load() { CheckUpdate(); - CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENT("Message Sessions") L"/" LPGENT("Group chats"), FONTMODE_ALTER }; + CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Message Sessions") L"/" LPGENW("Group chats"), FONTMODE_ALTER }; mir_getCI(&data); saveCI = *pci; pci->OnCreateModule = OnCreateModule; diff --git a/plugins/TabSRMM/src/chat/manager.cpp b/plugins/TabSRMM/src/chat/manager.cpp index b1958c909c..014b238b05 100644 --- a/plugins/TabSRMM/src/chat/manager.cpp +++ b/plugins/TabSRMM/src/chat/manager.cpp @@ -26,14 +26,14 @@ #include "../stdafx.h" -static int sttCompareNicknames(const TCHAR *s1, const TCHAR *s2) +static int sttCompareNicknames(const wchar_t *s1, const wchar_t *s2) { if (s2 == NULL) return 1; // skip rubbish - while (*s1 && !_istalpha(*s1)) ++s1; - while (*s2 && !_istalpha(*s2)) ++s2; + while (*s1 && !iswalpha(*s1)) ++s1; + while (*s2 && !iswalpha(*s2)) ++s2; // are there ~0veRy^kEwL_n1kz? if (!*s1 && !*s2) return 0; @@ -44,7 +44,7 @@ static int sttCompareNicknames(const TCHAR *s1, const TCHAR *s2) return mir_tstrcmpi(s1, s2); } -int UM_CompareItem(USERINFO *u1, const TCHAR* pszNick, WORD wStatus) +int UM_CompareItem(USERINFO *u1, const wchar_t* pszNick, WORD wStatus) { WORD dw1 = u1->Status; WORD dw2 = wStatus; @@ -108,12 +108,12 @@ SESSION_INFO* SM_FindSessionByHCONTACT(MCONTACT h) return NULL; } -SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const TCHAR* pszOriginal, const TCHAR* pszCurrent) +SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const wchar_t* pszOriginal, const wchar_t* pszCurrent) { if (prevSession == NULL && my_strstri(currSession->ptszName, pszOriginal) == currSession->ptszName) return currSession; - TCHAR* pszName = NULL; + wchar_t* pszName = NULL; if (currSession == prevSession) pszCurrent = pszOriginal; diff --git a/plugins/TabSRMM/src/chat/muchighlight.cpp b/plugins/TabSRMM/src/chat/muchighlight.cpp index 4567ba7000..0ec60454ff 100644 --- a/plugins/TabSRMM/src/chat/muchighlight.cpp +++ b/plugins/TabSRMM/src/chat/muchighlight.cpp @@ -65,12 +65,12 @@ void CMUCHighlight::init() tokenize(m_NickPatternString, m_NickPatterns, m_iNickPatterns); } -void CMUCHighlight::tokenize(TCHAR *tszString, TCHAR**& patterns, UINT& nr) +void CMUCHighlight::tokenize(wchar_t *tszString, wchar_t**& patterns, UINT& nr) { if (tszString == 0) return; - TCHAR *p = tszString; + wchar_t *p = tszString; if (*p == 0) return; @@ -83,14 +83,14 @@ void CMUCHighlight::tokenize(TCHAR *tszString, TCHAR**& patterns, UINT& nr) while (*p) { if (*p == ' ') { p++; - while (*p && _istspace(*p)) + while (*p && iswspace(*p)) p++; if (*p) nr++; } p++; } - patterns = (TCHAR **)mir_alloc(nr * sizeof(TCHAR*)); + patterns = (wchar_t **)mir_alloc(nr * sizeof(wchar_t*)); p = tszString; nr = 0; @@ -101,7 +101,7 @@ void CMUCHighlight::tokenize(TCHAR *tszString, TCHAR**& patterns, UINT& nr) while (*p) { if (*p == ' ') { *p++ = 0; - while (*p && _istspace(*p)) + while (*p && iswspace(*p)) p++; if (*p) patterns[nr++] = p; @@ -118,13 +118,13 @@ int CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dwF return 0; if ((m_dwFlags & MATCH_TEXT) && (dwFlags & MATCH_TEXT) && (m_fHighlightMe || m_iTextPatterns > 0) && psi != 0) { - TCHAR *p = pci->RemoveFormatting(pgce->ptszText); - p = NEWTSTR_ALLOCA(p); + wchar_t *p = pci->RemoveFormatting(pgce->ptszText); + p = NEWWSTR_ALLOCA(p); if (p == NULL) return 0; CharLower(p); - TCHAR *tszMe = ((psi && psi->pMe) ? NEWTSTR_ALLOCA(psi->pMe->pszNick) : 0); + wchar_t *tszMe = ((psi && psi->pMe) ? NEWWSTR_ALLOCA(psi->pMe->pszNick) : 0); if (tszMe) CharLower(tszMe); @@ -141,7 +141,7 @@ int CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dwF if (*p == 0) break; - TCHAR *p1 = p; + wchar_t *p1 = p; while (*p1 && *p1 != ' ' && *p1 != ',' && *p1 != '.' && *p1 != ':' && *p1 != ';' && *p1 != '?' && *p1 != '!') p1++; @@ -250,7 +250,7 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L iLen = ::GetWindowTextLength(::GetDlgItem(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN)); if (iLen) { - szBuf = reinterpret_cast(mir_realloc(szBuf, sizeof(wchar_t) * (iLen + 2))); + szBuf = reinterpret_cast(mir_realloc(szBuf, sizeof(wchar_t) * (iLen + 2))); ::GetDlgItemText(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN, szBuf, iLen + 1); db_set_ts(0, CHAT_MODULE, "HighlightWords", szBuf); } diff --git a/plugins/TabSRMM/src/chat/muchighlight.h b/plugins/TabSRMM/src/chat/muchighlight.h index 570541e075..5f8533868e 100644 --- a/plugins/TabSRMM/src/chat/muchighlight.h +++ b/plugins/TabSRMM/src/chat/muchighlight.h @@ -60,16 +60,16 @@ public: static INT_PTR CALLBACK dlgProcAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); // for the "add to" dialog private: - void tokenize(TCHAR *tszString, TCHAR**& patterns, UINT& nr); + void tokenize(wchar_t *tszString, wchar_t**& patterns, UINT& nr); DWORD m_dwFlags; bool m_fInitialized; - TCHAR** m_NickPatterns; - TCHAR** m_TextPatterns; + wchar_t** m_NickPatterns; + wchar_t** m_TextPatterns; UINT m_iNickPatterns; UINT m_iTextPatterns; - TCHAR *m_NickPatternString; - TCHAR *m_TextPatternString; + wchar_t *m_NickPatternString; + wchar_t *m_TextPatternString; bool m_Valid; bool m_fHighlightMe; }; diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp index 36c9ec9d29..79bfc11d83 100644 --- a/plugins/TabSRMM/src/chat/options.cpp +++ b/plugins/TabSRMM/src/chat/options.cpp @@ -33,13 +33,13 @@ struct FontOptionsList { - TCHAR* szDescr; + wchar_t* szDescr; COLORREF defColour; - TCHAR* szDefFace; + wchar_t* szDefFace; BYTE defCharset, defStyle; char defSize; COLORREF colour; - TCHAR szFace[LF_FACESIZE]; + wchar_t szFace[LF_FACESIZE]; BYTE charset, style; char size; }; @@ -47,8 +47,8 @@ struct FontOptionsList struct ColorOptionsList { int order; - TCHAR* tszGroup; - TCHAR* tszName; + wchar_t* tszGroup; + wchar_t* tszName; char* szSetting; COLORREF def; }; @@ -58,70 +58,70 @@ struct ColorOptionsList * (GetSysColor(default_color & 0x00ffffff)), not a rgb value. */ static ColorOptionsList _clrs[] = { - { 0, LPGENT("Message Sessions"), LPGENT("Input area background"), "inputbg", SRMSGDEFSET_BKGCOLOUR }, - { 1, LPGENT("Message Sessions"), LPGENT("Log background"), SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR }, - { 0, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), LPGENT("Outgoing background"), "outbg", SRMSGDEFSET_BKGOUTCOLOUR }, - { 1, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), LPGENT("Incoming background"), "inbg", SRMSGDEFSET_BKGINCOLOUR }, - { 2, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), LPGENT("Status background"), "statbg", SRMSGDEFSET_BKGCOLOUR }, - { 3, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), LPGENT("Incoming background(old)"), "oldinbg", SRMSGDEFSET_BKGINCOLOUR }, - { 4, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), LPGENT("Outgoing background(old)"), "oldoutbg", SRMSGDEFSET_BKGOUTCOLOUR }, - { 5, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), LPGENT("Horizontal Grid Lines"), "hgrid", RGB(224, 224, 224) }, - { 0, LPGENT("Message Sessions") L"/" LPGENT("Info Panel"), LPGENT("Panel background low"), "ipfieldsbg", 0x62caff }, - { 1, LPGENT("Message Sessions") L"/" LPGENT("Info Panel"), LPGENT("Panel background high"), "ipfieldsbgHigh", 0xf0f0f0 }, - { 0, LPGENT("Message Sessions") L"/" LPGENT("Common colors"), LPGENT("Toolbar background high"), "tbBgHigh", 0 }, - { 1, LPGENT("Message Sessions") L"/" LPGENT("Common colors"), LPGENT("Toolbar background low"), "tbBgLow", 0 }, - { 2, LPGENT("Message Sessions") L"/" LPGENT("Common colors"), LPGENT("Window fill color"), "fillColor", 0 }, - { 3, LPGENT("Message Sessions") L"/" LPGENT("Common colors"), LPGENT("Text area borders"), "cRichBorders", 0 }, - { 4, LPGENT("Message Sessions") L"/" LPGENT("Common colors"), LPGENT("Aero glow effect"), "aeroGlow", RGB(40, 40, 255) }, - { 4, LPGENT("Message Sessions") L"/" LPGENT("Common colors"), LPGENT("Generic text color (only when fill color is set)"), "genericTxtClr", 0xff000000 | COLOR_BTNTEXT }, + { 0, LPGENW("Message Sessions"), LPGENW("Input area background"), "inputbg", SRMSGDEFSET_BKGCOLOUR }, + { 1, LPGENW("Message Sessions"), LPGENW("Log background"), SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR }, + { 0, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Outgoing background"), "outbg", SRMSGDEFSET_BKGOUTCOLOUR }, + { 1, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Incoming background"), "inbg", SRMSGDEFSET_BKGINCOLOUR }, + { 2, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Status background"), "statbg", SRMSGDEFSET_BKGCOLOUR }, + { 3, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Incoming background(old)"), "oldinbg", SRMSGDEFSET_BKGINCOLOUR }, + { 4, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Outgoing background(old)"), "oldoutbg", SRMSGDEFSET_BKGOUTCOLOUR }, + { 5, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Horizontal Grid Lines"), "hgrid", RGB(224, 224, 224) }, + { 0, LPGENW("Message Sessions") L"/" LPGENW("Info Panel"), LPGENW("Panel background low"), "ipfieldsbg", 0x62caff }, + { 1, LPGENW("Message Sessions") L"/" LPGENW("Info Panel"), LPGENW("Panel background high"), "ipfieldsbgHigh", 0xf0f0f0 }, + { 0, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Toolbar background high"), "tbBgHigh", 0 }, + { 1, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Toolbar background low"), "tbBgLow", 0 }, + { 2, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Window fill color"), "fillColor", 0 }, + { 3, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Text area borders"), "cRichBorders", 0 }, + { 4, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Aero glow effect"), "aeroGlow", RGB(40, 40, 255) }, + { 4, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Generic text color (only when fill color is set)"), "genericTxtClr", 0xff000000 | COLOR_BTNTEXT }, }; static ColorOptionsList _tabclrs[] = { - { 0, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Normal text"), "tab_txt_normal", 0xff000000 | COLOR_BTNTEXT }, - { 1, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Active text"), "tab_txt_active", 0xff000000 | COLOR_BTNTEXT }, - { 2, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Hovered text"), "tab_txt_hottrack", 0xff000000 | COLOR_HOTLIGHT }, - { 3, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Unread text"), "tab_txt_unread", 0xff000000 | COLOR_HOTLIGHT }, - - { 4, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Normal background"), "tab_bg_normal", 0xff000000 | COLOR_3DFACE }, - { 5, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Active background"), "tab_bg_active", 0xff000000 | COLOR_3DFACE }, - { 6, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Hovered background"), "tab_bg_hottrack", 0xff000000 | COLOR_3DFACE }, - { 7, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Unread background"), "tab_bg_unread", 0xff000000 | COLOR_3DFACE } + { 0, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Normal text"), "tab_txt_normal", 0xff000000 | COLOR_BTNTEXT }, + { 1, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Active text"), "tab_txt_active", 0xff000000 | COLOR_BTNTEXT }, + { 2, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Hovered text"), "tab_txt_hottrack", 0xff000000 | COLOR_HOTLIGHT }, + { 3, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Unread text"), "tab_txt_unread", 0xff000000 | COLOR_HOTLIGHT }, + + { 4, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Normal background"), "tab_bg_normal", 0xff000000 | COLOR_3DFACE }, + { 5, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Active background"), "tab_bg_active", 0xff000000 | COLOR_3DFACE }, + { 6, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Hovered background"), "tab_bg_hottrack", 0xff000000 | COLOR_3DFACE }, + { 7, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Unread background"), "tab_bg_unread", 0xff000000 | COLOR_3DFACE } }; extern LOGFONT lfDefault; static FontOptionsList IM_fontOptionsList[] = { - { LPGENT(">> Outgoing messages"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, - { LPGENT(">> Outgoing misc events"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, - { LPGENT("<< Incoming messages"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, - { LPGENT("<< Incoming misc events"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, - { LPGENT(">> Outgoing name"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 }, - { LPGENT(">> Outgoing timestamp"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 }, - { LPGENT("<< Incoming name"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 }, - { LPGENT("<< Incoming timestamp"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 }, - { LPGENT(">> Outgoing messages (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, - { LPGENT(">> Outgoing misc events (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, - { LPGENT("<< Incoming messages (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, - { LPGENT("<< Incoming misc events (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, - { LPGENT(">> Outgoing name (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 }, - { LPGENT(">> Outgoing timestamp (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 }, - { LPGENT("<< Incoming name (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 }, - { LPGENT("<< Incoming timestamp (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 }, - { LPGENT("* Message Input Area"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, - { LPGENT("* Status changes"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, - { LPGENT("* Dividers"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, - { LPGENT("* Error and warning messages"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, - { LPGENT("* Symbols (incoming)"), RGB(50, 50, 50), L"Webdings", SYMBOL_CHARSET, 0, -12 }, - { LPGENT("* Symbols (outgoing)"), RGB(50, 50, 50), L"Webdings", SYMBOL_CHARSET, 0, -12 }, + { LPGENW(">> Outgoing messages"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, + { LPGENW(">> Outgoing misc events"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, + { LPGENW("<< Incoming messages"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, + { LPGENW("<< Incoming misc events"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, + { LPGENW(">> Outgoing name"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 }, + { LPGENW(">> Outgoing timestamp"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 }, + { LPGENW("<< Incoming name"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 }, + { LPGENW("<< Incoming timestamp"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 }, + { LPGENW(">> Outgoing messages (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, + { LPGENW(">> Outgoing misc events (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, + { LPGENW("<< Incoming messages (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, + { LPGENW("<< Incoming misc events (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, + { LPGENW(">> Outgoing name (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 }, + { LPGENW(">> Outgoing timestamp (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 }, + { LPGENW("<< Incoming name (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 }, + { LPGENW("<< Incoming timestamp (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 }, + { LPGENW("* Message Input Area"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, + { LPGENW("* Status changes"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, + { LPGENW("* Dividers"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, + { LPGENW("* Error and warning messages"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, + { LPGENW("* Symbols (incoming)"), RGB(50, 50, 50), L"Webdings", SYMBOL_CHARSET, 0, -12 }, + { LPGENW("* Symbols (outgoing)"), RGB(50, 50, 50), L"Webdings", SYMBOL_CHARSET, 0, -12 }, }; static FontOptionsList IP_fontOptionsList[] = { - { LPGENT("Nickname"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, - { LPGENT("UIN"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, - { LPGENT("Status"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, - { LPGENT("Protocol"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, - { LPGENT("Contacts local time"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, - { LPGENT("Window caption (skinned mode)"), RGB(255, 255, 255), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, + { LPGENW("Nickname"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, + { LPGENW("UIN"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, + { LPGENW("Status"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, + { LPGENW("Protocol"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, + { LPGENW("Contacts local time"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, + { LPGENW("Window caption (skinned mode)"), RGB(255, 255, 255), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, }; static FontOptionsList *fontOptionsList = IM_fontOptionsList; @@ -129,49 +129,49 @@ static int fontCount = MSGDLGFONTCOUNT; struct branch_t { - TCHAR* szDescr; + wchar_t* szDescr; char* szDBName; int iMode; BYTE bDefault; HTREEITEM hItem; }; static branch_t branch1[] = { - { LPGENT("Open new chat rooms in the default container"), "DefaultContainer", 0, 1, NULL }, - { LPGENT("Flash window when someone speaks"), "FlashWindow", 0, 0, NULL }, - { LPGENT("Flash window when a word is highlighted"), "FlashWindowHighlight", 0, 1, NULL }, - { LPGENT("Create tabs or windows for highlight events"), "CreateWindowOnHighlight", 0, 0, NULL }, - { LPGENT("Activate chat window on highlight"), "AnnoyingHighlight", 0, 0, NULL }, - { LPGENT("Show list of users in the chat room"), "ShowNicklist", 0, 1, NULL }, - { LPGENT("Colorize nicknames in member list"), "ColorizeNicks", 0, 1, NULL }, - { LPGENT("Show button menus when right clicking the buttons"), "RightClickFilter", 0, 1, NULL }, - { LPGENT("Show topic as status message on the contact list"), "TopicOnClist", 0, 1, NULL }, - { LPGENT("Do not pop up the window when joining a chat room"), "PopupOnJoin", 0, 0, NULL }, - { LPGENT("Hide or show the window by double click in the contact list"), "ToggleVisibility", 0, 0, NULL }, - { LPGENT("Sync splitter position with standard IM sessions"), "SyncSplitter", 0, 0, NULL }, - { LPGENT("Show contact's status modes if supported by the protocol"), "ShowContactStatus", 0, 1, NULL }, - { LPGENT("Display contact's status icon before user role icon"), "ContactStatusFirst", 0, 0, NULL }, - { LPGENT("Use IRC style status indicators in the nick list"), "ClassicIndicators", 0, 0, NULL }, - { LPGENT("Use alternative sorting method in member list"), "AlternativeSorting", 0, 1, NULL } + { LPGENW("Open new chat rooms in the default container"), "DefaultContainer", 0, 1, NULL }, + { LPGENW("Flash window when someone speaks"), "FlashWindow", 0, 0, NULL }, + { LPGENW("Flash window when a word is highlighted"), "FlashWindowHighlight", 0, 1, NULL }, + { LPGENW("Create tabs or windows for highlight events"), "CreateWindowOnHighlight", 0, 0, NULL }, + { LPGENW("Activate chat window on highlight"), "AnnoyingHighlight", 0, 0, NULL }, + { LPGENW("Show list of users in the chat room"), "ShowNicklist", 0, 1, NULL }, + { LPGENW("Colorize nicknames in member list"), "ColorizeNicks", 0, 1, NULL }, + { LPGENW("Show button menus when right clicking the buttons"), "RightClickFilter", 0, 1, NULL }, + { LPGENW("Show topic as status message on the contact list"), "TopicOnClist", 0, 1, NULL }, + { LPGENW("Do not pop up the window when joining a chat room"), "PopupOnJoin", 0, 0, NULL }, + { LPGENW("Hide or show the window by double click in the contact list"), "ToggleVisibility", 0, 0, NULL }, + { LPGENW("Sync splitter position with standard IM sessions"), "SyncSplitter", 0, 0, NULL }, + { LPGENW("Show contact's status modes if supported by the protocol"), "ShowContactStatus", 0, 1, NULL }, + { LPGENW("Display contact's status icon before user role icon"), "ContactStatusFirst", 0, 0, NULL }, + { LPGENW("Use IRC style status indicators in the nick list"), "ClassicIndicators", 0, 0, NULL }, + { LPGENW("Use alternative sorting method in member list"), "AlternativeSorting", 0, 1, NULL } }; static branch_t branch2[] = { - { LPGENT("Prefix all events with a timestamp"), "ShowTimeStamp", 0, 1, NULL }, - { LPGENT("Timestamp only when event time differs"), "ShowTimeStampIfChanged", 0, 0, NULL }, - { LPGENT("Timestamp has same color as the event"), "TimeStampEventColour", 0, 0, NULL }, - { LPGENT("Indent the second line of a message"), "LogIndentEnabled", 0, 1, NULL }, - { LPGENT("Limit user names in the message log to 20 characters"), "LogLimitNames", 0, 1, NULL }, - { LPGENT("Add a colon (:) to auto-completed user names"), "AddColonToAutoComplete", 0, 1, NULL }, - { LPGENT("Add a comma instead of a colon to auto-completed user names"), "UseCommaAsColon", 0, 0, NULL }, - { LPGENT("Start private conversation on double click in nick list (insert nick if unchecked)"), "DoubleClick4Privat", 0, 0, NULL }, - { LPGENT("Strip colors from messages in the log"), "StripFormatting", 0, 0, NULL }, - { LPGENT("Enable the 'event filter' for new rooms"), "FilterEnabled", 0, 0, NULL }, - { LPGENT("Use IRC style status indicators in the log"), "LogClassicIndicators", 0, 0, NULL }, - { LPGENT("Allow clickable user names in the message log"), "ClickableNicks", 0, 1, NULL }, - { LPGENT("Add new line after names"), "NewlineAfterNames", 0, 0, NULL }, - { LPGENT("Colorize user names in message log"), "ColorizeNicksInLog", 0, 1, NULL }, - { LPGENT("Scale down icons to 10x10 pixels in the chat log"), "ScaleIcons", 0, 1, NULL }, - { LPGENT("Place a separator in the log after a window lost its foreground status"), "UseDividers", 0, 1, NULL }, - { LPGENT("Only place a separator when an incoming event is announced with a popup"), "DividersUsePopupConfig", 0, 1, NULL } + { LPGENW("Prefix all events with a timestamp"), "ShowTimeStamp", 0, 1, NULL }, + { LPGENW("Timestamp only when event time differs"), "ShowTimeStampIfChanged", 0, 0, NULL }, + { LPGENW("Timestamp has same color as the event"), "TimeStampEventColour", 0, 0, NULL }, + { LPGENW("Indent the second line of a message"), "LogIndentEnabled", 0, 1, NULL }, + { LPGENW("Limit user names in the message log to 20 characters"), "LogLimitNames", 0, 1, NULL }, + { LPGENW("Add a colon (:) to auto-completed user names"), "AddColonToAutoComplete", 0, 1, NULL }, + { LPGENW("Add a comma instead of a colon to auto-completed user names"), "UseCommaAsColon", 0, 0, NULL }, + { LPGENW("Start private conversation on double click in nick list (insert nick if unchecked)"), "DoubleClick4Privat", 0, 0, NULL }, + { LPGENW("Strip colors from messages in the log"), "StripFormatting", 0, 0, NULL }, + { LPGENW("Enable the 'event filter' for new rooms"), "FilterEnabled", 0, 0, NULL }, + { LPGENW("Use IRC style status indicators in the log"), "LogClassicIndicators", 0, 0, NULL }, + { LPGENW("Allow clickable user names in the message log"), "ClickableNicks", 0, 1, NULL }, + { LPGENW("Add new line after names"), "NewlineAfterNames", 0, 0, NULL }, + { LPGENW("Colorize user names in message log"), "ColorizeNicksInLog", 0, 1, NULL }, + { LPGENW("Scale down icons to 10x10 pixels in the chat log"), "ScaleIcons", 0, 1, NULL }, + { LPGENW("Place a separator in the log after a window lost its foreground status"), "UseDividers", 0, 1, NULL }, + { LPGENW("Only place a separator when an incoming event is announced with a popup"), "DividersUsePopupConfig", 0, 1, NULL } }; static HWND hPathTip = 0; @@ -222,19 +222,19 @@ void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szM mir_snprintf(str, "Font%d", i); if ((i == 17 && !mir_strcmp(szMod, CHATFONT_MODULE)) || ((i == 20 || i == 21) && !mir_strcmp(szMod, FONTMODULE))) { lf->lfCharSet = SYMBOL_CHARSET; - _tcsncpy_s(lf->lfFaceName, L"Webdings", _TRUNCATE); + wcsncpy_s(lf->lfFaceName, L"Webdings", _TRUNCATE); } else { ptrT tszDefFace(db_get_tsa(NULL, szMod, str)); if (tszDefFace == NULL) - _tcsncpy_s(lf->lfFaceName, fol[j].szDefFace, _TRUNCATE); + wcsncpy_s(lf->lfFaceName, fol[j].szDefFace, _TRUNCATE); else - _tcsncpy_s(lf->lfFaceName, tszDefFace, _TRUNCATE); + wcsncpy_s(lf->lfFaceName, tszDefFace, _TRUNCATE); } } } -static HTREEITEM InsertBranch(HWND hwndTree, TCHAR* pszDescr, BOOL bExpanded) +static HTREEITEM InsertBranch(HWND hwndTree, wchar_t* pszDescr, BOOL bExpanded) { TVINSERTSTRUCT tvis; tvis.hParent = NULL; @@ -354,7 +354,7 @@ HICON LoadIconEx(char *pszIcoLibName) return IcoLib_GetIcon(szTemp); } -static void InitSetting(TCHAR* &ppPointer, const char *pszSetting, const TCHAR *pszDefault) +static void InitSetting(wchar_t* &ppPointer, const char *pszSetting, const wchar_t *pszDefault) { ptrT val(db_get_tsa(NULL, CHAT_MODULE, pszSetting)); replaceStrT(ppPointer, (val != NULL) ? val : pszDefault); @@ -410,7 +410,7 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM FillBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading1, branch1, _countof(branch1), 0x0000); FillBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading2, branch2, _countof(branch2), 0x0000); - TCHAR* pszGroup = NULL; + wchar_t* pszGroup = NULL; InitSetting(pszGroup, "AddToGroup", L"Chat rooms"); SetDlgItemText(hwndDlg, IDC_GROUP, pszGroup); mir_free(pszGroup); @@ -435,12 +435,12 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: int iLen; - TCHAR *pszText = NULL; + wchar_t *pszText = NULL; BYTE b; iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_GROUP)); if (iLen > 0) { - pszText = (TCHAR*)mir_realloc(pszText, (iLen + 2) * sizeof(TCHAR)); + pszText = (wchar_t*)mir_realloc(pszText, (iLen + 2) * sizeof(wchar_t)); GetDlgItemText(hwndDlg, IDC_GROUP, pszText, iLen + 1); db_set_ts(NULL, CHAT_MODULE, "AddToGroup", pszText); } @@ -472,16 +472,16 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM return FALSE; } -static TCHAR* chatcolorsnames[] = +static wchar_t* chatcolorsnames[] = { - LPGENT("Voiced"), - LPGENT("Half operators"), - LPGENT("Channel operators"), - LPGENT("Extended mode 1"), - LPGENT("Extended mode 2"), - LPGENT("Selection background"), - LPGENT("Selected text"), - LPGENT("Incremental search highlight") + LPGENW("Voiced"), + LPGENW("Half operators"), + LPGENW("Channel operators"), + LPGENW("Extended mode 1"), + LPGENW("Extended mode 2"), + LPGENW("Selection background"), + LPGENW("Selected text"), + LPGENW("Incremental search highlight") }; void RegisterFontServiceFonts() @@ -502,54 +502,54 @@ void RegisterFontServiceFonts() mir_snprintf(szTemp, "Font%d", i); strncpy(fid.prefix, szTemp, _countof(fid.prefix)); fid.order = i; - _tcsncpy(fid.name, fontOptionsList[i].szDescr, _countof(fid.name)); + wcsncpy(fid.name, fontOptionsList[i].szDescr, _countof(fid.name)); fid.deffontsettings.colour = fontOptionsList[i].colour; fid.deffontsettings.size = (char)lf.lfHeight; fid.deffontsettings.style = (lf.lfWeight >= FW_BOLD ? FONTF_BOLD : 0) | (lf.lfItalic ? FONTF_ITALIC : 0); fid.deffontsettings.charset = lf.lfCharSet; fid.flags = fid.flags & ~FIDF_CLASSMASK | (fid.deffontsettings.style&FONTF_BOLD ? FIDF_CLASSHEADER : FIDF_CLASSGENERAL); - _tcsncpy(fid.deffontsettings.szFace, lf.lfFaceName, LF_FACESIZE); - _tcsncpy(fid.backgroundGroup, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), _countof(fid.backgroundGroup)); - _tcsncpy(fid.group, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), _countof(fid.group)); + wcsncpy(fid.deffontsettings.szFace, lf.lfFaceName, LF_FACESIZE); + wcsncpy(fid.backgroundGroup, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), _countof(fid.backgroundGroup)); + wcsncpy(fid.group, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), _countof(fid.group)); switch (i) { case MSGFONTID_MYMSG: case 1: case MSGFONTID_MYNAME: case MSGFONTID_MYTIME: case 21: - _tcsncpy(fid.backgroundName, LPGENT("Outgoing background"), _countof(fid.backgroundName)); + wcsncpy(fid.backgroundName, LPGENW("Outgoing background"), _countof(fid.backgroundName)); break; case 8: case 9: case 12: case 13: - _tcsncpy(fid.backgroundName, LPGENT("Outgoing background(old)"), _countof(fid.backgroundName)); + wcsncpy(fid.backgroundName, LPGENW("Outgoing background(old)"), _countof(fid.backgroundName)); break; case 10: case 11: case 14: case 15: - _tcsncpy(fid.backgroundName, LPGENT("Incoming background(old)"), _countof(fid.backgroundName)); + wcsncpy(fid.backgroundName, LPGENW("Incoming background(old)"), _countof(fid.backgroundName)); break; case MSGFONTID_MESSAGEAREA: - _tcsncpy(fid.group, LPGENT("Message Sessions"), _countof(fid.group)); - _tcsncpy(fid.backgroundGroup, LPGENT("Message Sessions"), _countof(fid.backgroundGroup)); - _tcsncpy(fid.backgroundName, LPGENT("Input area background"), _countof(fid.backgroundName)); + wcsncpy(fid.group, LPGENW("Message Sessions"), _countof(fid.group)); + wcsncpy(fid.backgroundGroup, LPGENW("Message Sessions"), _countof(fid.backgroundGroup)); + wcsncpy(fid.backgroundName, LPGENW("Input area background"), _countof(fid.backgroundName)); fid.flags |= FIDF_DISABLESTYLES; fid.flags &= ~FIDF_ALLOWEFFECTS; break; case 17: - _tcsncpy(fid.backgroundName, LPGENT("Status background"), _countof(fid.backgroundName)); + wcsncpy(fid.backgroundName, LPGENW("Status background"), _countof(fid.backgroundName)); break; case 18: - _tcsncpy(fid.backgroundGroup, LPGENT("Message Sessions"), _countof(fid.backgroundGroup)); - _tcsncpy(fid.backgroundName, LPGENT("Log background"), _countof(fid.backgroundName)); + wcsncpy(fid.backgroundGroup, LPGENW("Message Sessions"), _countof(fid.backgroundGroup)); + wcsncpy(fid.backgroundName, LPGENW("Log background"), _countof(fid.backgroundName)); break; case 19: - _tcsncpy(fid.backgroundName, L"", _countof(fid.backgroundName)); + wcsncpy(fid.backgroundName, L"", _countof(fid.backgroundName)); break; default: - _tcsncpy(fid.backgroundName, LPGENT("Incoming background"), _countof(fid.backgroundName)); + wcsncpy(fid.backgroundName, LPGENW("Incoming background"), _countof(fid.backgroundName)); break; } FontRegisterT(&fid); @@ -557,35 +557,35 @@ void RegisterFontServiceFonts() fontOptionsList = IP_fontOptionsList; fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS; - _tcsncpy(fid.group, LPGENT("Message Sessions") L"/" LPGENT("Info Panel"), _countof(fid.group)); - _tcsncpy(fid.backgroundGroup, LPGENT("Message Sessions") L"/" LPGENT("Info Panel"), _countof(fid.backgroundGroup)); - _tcsncpy(fid.backgroundName, LPGENT("Fields background"), _countof(fid.backgroundName)); + wcsncpy(fid.group, LPGENW("Message Sessions") L"/" LPGENW("Info Panel"), _countof(fid.group)); + wcsncpy(fid.backgroundGroup, LPGENW("Message Sessions") L"/" LPGENW("Info Panel"), _countof(fid.backgroundGroup)); + wcsncpy(fid.backgroundName, LPGENW("Fields background"), _countof(fid.backgroundName)); for (int i = 0; i < IPFONTCOUNT; i++) { LoadMsgDlgFont(FONTSECTION_IP, i + 100, &lf, &fontOptionsList[i].colour, FONTMODULE); mir_snprintf(szTemp, "Font%d", i + 100); strncpy(fid.prefix, szTemp, _countof(fid.prefix)); fid.order = i + 100; - _tcsncpy(fid.name, fontOptionsList[i].szDescr, _countof(fid.name)); + wcsncpy(fid.name, fontOptionsList[i].szDescr, _countof(fid.name)); fid.deffontsettings.colour = fontOptionsList[i].colour; fid.deffontsettings.size = (char)lf.lfHeight; fid.deffontsettings.style = (lf.lfWeight >= FW_BOLD ? FONTF_BOLD : 0) | (lf.lfItalic ? FONTF_ITALIC : 0); fid.deffontsettings.charset = lf.lfCharSet; fid.flags = fid.flags & ~FIDF_CLASSMASK | (fid.deffontsettings.style&FONTF_BOLD ? FIDF_CLASSHEADER : FIDF_CLASSGENERAL); fid.deffontsettings.charset = lf.lfCharSet; - _tcsncpy(fid.deffontsettings.szFace, lf.lfFaceName, LF_FACESIZE); + wcsncpy(fid.deffontsettings.szFace, lf.lfFaceName, LF_FACESIZE); if (i == IPFONTCOUNT - 1) { - _tcsncpy(fid.backgroundGroup, L"", _countof(fid.backgroundGroup)); - _tcsncpy(fid.backgroundName, L"", _countof(fid.backgroundName)); - _tcsncpy(fid.group, LPGENT("Message Sessions"), _countof(fid.group)); + wcsncpy(fid.backgroundGroup, L"", _countof(fid.backgroundGroup)); + wcsncpy(fid.backgroundName, L"", _countof(fid.backgroundName)); + wcsncpy(fid.group, LPGENW("Message Sessions"), _countof(fid.group)); } FontRegisterT(&fid); } - _tcsncpy(cid.group, LPGENT("Message Sessions") L"/" LPGENT("Group chats"), _countof(cid.group)); + wcsncpy(cid.group, LPGENW("Message Sessions") L"/" LPGENW("Group chats"), _countof(cid.group)); strncpy(cid.dbSettingsGroup, CHAT_MODULE, _countof(cid.dbSettingsGroup)); for (int i = 0; i <= 7; i++) { mir_snprintf(szTemp, "NickColor%d", i); - _tcsncpy(cid.name, chatcolorsnames[i], _countof(cid.name)); + wcsncpy(cid.name, chatcolorsnames[i], _countof(cid.name)); cid.order = i + 1; strncpy(cid.setting, szTemp, _countof(cid.setting)); switch (i) { @@ -602,13 +602,13 @@ void RegisterFontServiceFonts() ColourRegisterT(&cid); } cid.order++; - _tcsncpy_s(cid.name, LPGENT("Nick list background"), _TRUNCATE); + wcsncpy_s(cid.name, LPGENW("Nick list background"), _TRUNCATE); strncpy_s(cid.setting, "ColorNicklistBG", _TRUNCATE); cid.defcolour = SRMSGDEFSET_BKGCOLOUR; ColourRegisterT(&cid); cid.order++; - _tcsncpy_s(cid.name, LPGENT("Group chat log background"), _TRUNCATE); + wcsncpy_s(cid.name, LPGENW("Group chat log background"), _TRUNCATE); strncpy_s(cid.setting, "ColorLogBG", _TRUNCATE); ColourRegisterT(&cid); @@ -618,8 +618,8 @@ void RegisterFontServiceFonts() for (int i = 0; i < _countof(_clrs); i++) { cid.order = _clrs[i].order; - _tcsncpy(cid.group, _clrs[i].tszGroup, _countof(fid.group)); - _tcsncpy(cid.name, _clrs[i].tszName, _countof(cid.name)); + wcsncpy(cid.group, _clrs[i].tszGroup, _countof(fid.group)); + wcsncpy(cid.name, _clrs[i].tszName, _countof(cid.name)); strncpy(cid.setting, _clrs[i].szSetting, _countof(cid.setting)); if (_clrs[i].def & 0xff000000) cid.defcolour = GetSysColor(_clrs[i].def & 0x000000ff); @@ -633,8 +633,8 @@ void RegisterFontServiceFonts() // text and background colors for tabs for (int i = 0; i < _countof(_tabclrs); i++) { cid.order = _tabclrs[i].order; - _tcsncpy(cid.group, _tabclrs[i].tszGroup, _countof(fid.group)); - _tcsncpy(cid.name, _tabclrs[i].tszName, _countof(cid.name)); + wcsncpy(cid.group, _tabclrs[i].tszGroup, _countof(fid.group)); + wcsncpy(cid.name, _tabclrs[i].tszName, _countof(cid.name)); strncpy(cid.setting, _tabclrs[i].szSetting, _countof(cid.setting)); if (_tabclrs[i].def & 0xff000000) cid.defcolour = GetSysColor(_tabclrs[i].def & 0x000000ff); @@ -689,7 +689,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN4, UDM_SETPOS, 0, MAKELONG(db_get_w(NULL, CHAT_MODULE, "LoggingLimit", 100), 0)); Utils::enableDlgControl(hwndDlg, IDC_LIMIT, g_Settings.bLoggingEnabled); - TCHAR tszTooltipText[2048]; + wchar_t tszTooltipText[2048]; mir_sntprintf(tszTooltipText, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n" @@ -745,23 +745,23 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM switch (LOWORD(wParam)) { case IDC_MUC_OPENLOGBASEDIR: { - TCHAR tszTemp[MAX_PATH + 20]; - _tcsncpy_s(tszTemp, g_Settings.pszLogDir, _TRUNCATE); + wchar_t tszTemp[MAX_PATH + 20]; + wcsncpy_s(tszTemp, g_Settings.pszLogDir, _TRUNCATE); - TCHAR *p = tszTemp; + wchar_t *p = tszTemp; while (*p && (*p == '\\' || *p == '.')) p++; if (*p) - if (TCHAR *p1 = _tcschr(p, '\\')) + if (wchar_t *p1 = wcschr(p, '\\')) *p1 = 0; - TCHAR tszInitialDir[_MAX_DRIVE + _MAX_PATH + 10]; + wchar_t tszInitialDir[_MAX_DRIVE + _MAX_PATH + 10]; mir_sntprintf(tszInitialDir, L"%s%s", M.getChatLogPath(), p); if (!PathFileExists(tszInitialDir)) - _tcsncpy_s(tszInitialDir, M.getChatLogPath(), _TRUNCATE); + wcsncpy_s(tszInitialDir, M.getChatLogPath(), _TRUNCATE); - TCHAR tszReturnName[MAX_PATH]; tszReturnName[0] = 0; + wchar_t tszReturnName[MAX_PATH]; tszReturnName[0] = 0; mir_sntprintf(tszTemp, L"%s%c*.*%c%c", TranslateT("All files"), 0, 0, 0); OPENFILENAME ofn = { 0 }; @@ -779,7 +779,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM case IDC_FONTCHOOSE: { - TCHAR tszDirectory[MAX_PATH]; + wchar_t tszDirectory[MAX_PATH]; LPMALLOC psMalloc; if (SUCCEEDED(CoGetMalloc(1, &psMalloc))) { @@ -793,11 +793,11 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM LPITEMIDLIST idList = SHBrowseForFolder(&bi); if (idList) { - const TCHAR *szUserDir = M.getUserDir(); + const wchar_t *szUserDir = M.getUserDir(); SHGetPathFromIDList(idList, tszDirectory); mir_tstrcat(tszDirectory, L"\\"); - TCHAR tszTemp[MAX_PATH]; + wchar_t tszTemp[MAX_PATH]; PathToRelativeT(tszDirectory, tszTemp, szUserDir); SetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, mir_tstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME); } @@ -824,7 +824,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM int iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_LOGDIRECTORY)); if (iLen > 0) { - TCHAR *pszText1 = (TCHAR*)mir_alloc(iLen*sizeof(TCHAR) + 2); + wchar_t *pszText1 = (wchar_t*)mir_alloc(iLen*sizeof(wchar_t) + 2); GetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, pszText1, iLen + 1); db_set_ts(NULL, CHAT_MODULE, "LogDirectory", pszText1); mir_free(pszText1); diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp index d892fc66aa..4fd40eb4d2 100644 --- a/plugins/TabSRMM/src/chat/services.cpp +++ b/plugins/TabSRMM/src/chat/services.cpp @@ -34,9 +34,9 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT if (M.FindWindow(hContact) != 0) return 0; - if (hContact != 0 && M.GetByte("limittabs", 0) && !_tcsncmp(pContainer->szName, L"default", 6)) { + if (hContact != 0 && M.GetByte("limittabs", 0) && !wcsncmp(pContainer->szName, L"default", 6)) { if ((pContainer = FindMatchingContainer(L"default")) == NULL) { - TCHAR szName[CONTAINER_NAMELEN + 1]; + wchar_t szName[CONTAINER_NAMELEN + 1]; mir_sntprintf(szName, L"default"); if ((pContainer = CreateContainer(szName, CNT_CREATEFLAG_CLONED, hContact)) == NULL) return 0; @@ -49,17 +49,17 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT newData.szInitialText = NULL; memset(&newData.item, 0, sizeof(newData.item)); - TCHAR *contactName = pcli->pfnGetContactDisplayName(newData.hContact, 0); + wchar_t *contactName = pcli->pfnGetContactDisplayName(newData.hContact, 0); // cut nickname if larger than x chars... - TCHAR newcontactname[128]; + wchar_t newcontactname[128]; if (mir_tstrlen(contactName) > 0) { if (M.GetByte("cuttitle", 0)) CutContactName(contactName, newcontactname, _countof(newcontactname)); else - _tcsncpy_s(newcontactname, contactName, _TRUNCATE); + wcsncpy_s(newcontactname, contactName, _TRUNCATE); } - else _tcsncpy_s(newcontactname, L"_U_", _TRUNCATE); + else wcsncpy_s(newcontactname, L"_U_", _TRUNCATE); newData.item.pszText = newcontactname; newData.item.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM; @@ -163,12 +163,12 @@ void ShowRoom(SESSION_INFO *si, WPARAM, BOOL) return; } - TCHAR szName[CONTAINER_NAMELEN + 2]; szName[0] = 0; + wchar_t szName[CONTAINER_NAMELEN + 2]; szName[0] = 0; TContainerData *pContainer = si->pContainer; if (pContainer == NULL) { GetContainerNameForContact(si->hContact, szName, CONTAINER_NAMELEN); if (!g_Settings.bOpenInDefault && !mir_tstrcmp(szName, L"default")) - _tcsncpy(szName, L"Chat Rooms", CONTAINER_NAMELEN); + wcsncpy(szName, L"Chat Rooms", CONTAINER_NAMELEN); szName[CONTAINER_NAMELEN] = 0; pContainer = FindContainerByName(szName); } diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index 98a3b8f603..274e4ab8a0 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -92,11 +92,11 @@ BOOL DoTrayIcon(SESSION_INFO *si, GCEVENT *gce) return TRUE; } -int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, TCHAR*, COLORREF crBkg, const TCHAR* fmt, ...) +int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, wchar_t*, COLORREF crBkg, const wchar_t* fmt, ...) { POPUPDATAT pd = { 0 }; va_list marker; - static TCHAR szBuf[4 * 1024]; + static wchar_t szBuf[4 * 1024]; if (!fmt || mir_tstrlen(fmt) == 0 || mir_tstrlen(fmt) > 2000) return 0; @@ -114,7 +114,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa PROTOACCOUNT *pa = Proto_GetAccount(pszProtoName); mir_sntprintf(pd.lptzContactName, L"%s - %s", (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName, pcli->pfnGetContactDisplayName(hContact, 0)); - _tcsncpy_s(pd.lptzText, TranslateTS(szBuf), _TRUNCATE); + wcsncpy_s(pd.lptzText, TranslateTS(szBuf), _TRUNCATE); pd.iSeconds = g_Settings.iPopupTimeout; if (g_Settings.iPopupStyle == 2) { @@ -144,7 +144,7 @@ BOOL DoPopup(SESSION_INFO *si, GCEVENT* gce) TWindowData *dat = si->dat; TContainerData *pContainer = dat ? dat->pContainer : NULL; - TCHAR *bbStart, *bbEnd; + wchar_t *bbStart, *bbEnd; if (g_Settings.bBBCodeInPopups) { bbStart = L"[b]"; bbEnd = L"[/b]"; @@ -474,15 +474,15 @@ int Chat_GetColorIndex(const char* pszModule, COLORREF cr) return -1; } -TCHAR* my_strstri(const TCHAR* s1, const TCHAR* s2) +wchar_t* my_strstri(const wchar_t* s1, const wchar_t* s2) { int i, j, k; - _tsetlocale(LC_ALL, L""); + _wsetlocale(LC_ALL, L""); for (i = 0; s1[i]; i++) - for (j = i, k = 0; _totlower(s1[j]) == _totlower(s2[k]); j++, k++) + for (j = i, k = 0; towlower(s1[j]) == towlower(s2[k]); j++, k++) if (!s2[k + 1]) - return (TCHAR*)(s1 + i); + return (wchar_t*)(s1 + i); return NULL; } @@ -505,7 +505,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) return saveCI.LogToFile(si, gce); // call kernel method } -UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, TCHAR* pszUID, TCHAR* pszWordText) +UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, wchar_t* pszUID, wchar_t* pszWordText) { HMENU hSubMenu = 0; @@ -531,7 +531,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO } if (pszWordText && pszWordText[0]) { - TCHAR szMenuText[4096]; + wchar_t szMenuText[4096]; mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText); ModifyMenu(*hMenu, 4, MF_STRING | MF_BYPOSITION, 4, szMenuText); } @@ -539,14 +539,14 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO gcmi.Type = MENU_ON_LOG; } else if (iIndex == 0) { - TCHAR szTemp[50]; + wchar_t szTemp[50]; if (pszWordText) mir_sntprintf(szTemp, TranslateT("&Message %s"), pszWordText); else - _tcsncpy_s(szTemp, TranslateT("&Message"), _TRUNCATE); + wcsncpy_s(szTemp, TranslateT("&Message"), _TRUNCATE); if (mir_tstrlen(szTemp) > 40) - _tcsncpy_s(szTemp + 40, 4, L"...", _TRUNCATE); + wcsncpy_s(szTemp + 40, 4, L"...", _TRUNCATE); ModifyMenu(*hMenu, ID_MESS, MF_STRING | MF_BYCOMMAND, ID_MESS, szTemp); gcmi.Type = MENU_ON_NICKLIST; } @@ -557,7 +557,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO AppendMenu(*hMenu, MF_SEPARATOR, 0, 0); for (int i = 0; i < gcmi.nItems; i++) { - TCHAR *ptszText = TranslateTS(gcmi.Item[i].pszDesc); + wchar_t *ptszText = TranslateTS(gcmi.Item[i].pszDesc); DWORD dwState = gcmi.Item[i].bDisabled ? MF_GRAYED : 0; if (gcmi.Item[i].uType == MENU_NEWPOPUP) { @@ -686,7 +686,7 @@ BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *gce) dwMask |= CMUCHighlight::MATCH_NICKNAME; if (si && g_Settings.bLogClassicIndicators) { size_t len = mir_tstrlen(gce->ptszNick) + 1; - TCHAR *tmp = (TCHAR*)_alloca(sizeof(TCHAR)*(len + 1)); + wchar_t *tmp = (wchar_t*)_alloca(sizeof(wchar_t)*(len + 1)); *tmp = GetIndicator(si, gce->ptszNick, 0); mir_tstrcpy(tmp + 1, gce->ptszNick); evTmp.ptszNick = tmp; diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index c633d50ee9..cde016a19e 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -44,8 +44,8 @@ char szIndicators[] = { 0, '+', '%', '@', '!', '*' }; struct MESSAGESUBDATA { time_t lastEnterTime; - TCHAR *szSearchQuery; - TCHAR *szSearchResult; + wchar_t *szSearchQuery; + wchar_t *szSearchResult; BOOL iSavedSpaces; SESSION_INFO *lastSession; }; @@ -130,18 +130,18 @@ static BOOL CheckCustomLink(HWND hwndDlg, POINT *ptClient, UINT uMsg, WPARAM wPa return bIsCustomLink; } -bool IsStringValidLink(TCHAR *pszText) +bool IsStringValidLink(wchar_t *pszText) { if (pszText == NULL) return false; - if (mir_tstrlen(pszText) < 5 || _tcschr(pszText, '"')) + if (mir_tstrlen(pszText) < 5 || wcschr(pszText, '"')) return false; - if (_totlower(pszText[0]) == 'w' && _totlower(pszText[1]) == 'w' && _totlower(pszText[2]) == 'w' && pszText[3] == '.' && _istalnum(pszText[4])) + if (towlower(pszText[0]) == 'w' && towlower(pszText[1]) == 'w' && towlower(pszText[2]) == 'w' && pszText[3] == '.' && iswalnum(pszText[4])) return true; - return _tcsstr(pszText, L"://") != NULL; + return wcsstr(pszText, L"://") != NULL; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -440,11 +440,11 @@ static bool TabAutoComplete(HWND hwnd, MESSAGESUBDATA *dat, SESSION_INFO *si) return false; bool isTopic = false, isRoom = false; - TCHAR *pszName = NULL; - TCHAR *pszText = (TCHAR*)mir_calloc((iLen + 10) * sizeof(TCHAR)); + wchar_t *pszName = NULL; + wchar_t *pszText = (wchar_t*)mir_calloc((iLen + 10) * sizeof(wchar_t)); gt.flags = GT_DEFAULT; - gt.cb = (iLen + 9) * sizeof(TCHAR); + gt.cb = (iLen + 9) * sizeof(wchar_t); SendMessage(hwnd, EM_GETTEXTEX, (WPARAM)>, (LPARAM)pszText); if (start > 1 && pszText[start - 1] == ' ' && pszText[start - 2] == ':') @@ -452,7 +452,7 @@ static bool TabAutoComplete(HWND hwnd, MESSAGESUBDATA *dat, SESSION_INFO *si) if (dat->szSearchResult != NULL) { int cbResult = (int)mir_tstrlen(dat->szSearchResult); - if (start >= cbResult && !_tcsncicmp(dat->szSearchResult, pszText + start - cbResult, cbResult)) { + if (start >= cbResult && !wcsnicmp(dat->szSearchResult, pszText + start - cbResult, cbResult)) { start -= cbResult; goto LBL_SkipEnd; } @@ -471,7 +471,7 @@ LBL_SkipEnd: int topicStart = start; while (topicStart > 0 && (pszText[topicStart - 1] == ' ' || pszText[topicStart - 1] == 13 || pszText[topicStart - 1] == VK_TAB)) topicStart--; - if (topicStart > 5 && _tcsstr(&pszText[topicStart - 6], L"/topic") == &pszText[topicStart - 6]) + if (topicStart > 5 && wcsstr(&pszText[topicStart - 6], L"/topic") == &pszText[topicStart - 6]) isTopic = TRUE; } if (dat->szSearchQuery == NULL) { @@ -495,7 +495,7 @@ LBL_SkipEnd: if (end != start) { ptrT szReplace; if (!isRoom && !isTopic && g_Settings.bAddColonToAutoComplete && start == 0) { - szReplace = (TCHAR*)mir_alloc((mir_wstrlen(pszName) + 4) * sizeof(TCHAR)); + szReplace = (wchar_t*)mir_alloc((mir_wstrlen(pszName) + 4) * sizeof(wchar_t)); mir_wstrcpy(szReplace, pszName); mir_wstrcat(szReplace, g_Settings.bUseCommaAsColon ? L", " : L": "); pszName = szReplace; @@ -1308,14 +1308,14 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO *pa ti.uId = 1; ti.rect = clientRect; - TCHAR tszBuf[1024]; tszBuf[0] = 0; + wchar_t tszBuf[1024]; tszBuf[0] = 0; USERINFO *ui1 = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, currentHovered); if (ui1) { if (ProtoServiceExists(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT)) { - TCHAR *p = (TCHAR*)CallProtoService(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)parentdat->ptszID, (LPARAM)ui1->pszUID); + wchar_t *p = (wchar_t*)CallProtoService(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)parentdat->ptszID, (LPARAM)ui1->pszUID); if (p != NULL) { - _tcsncpy_s(tszBuf, p, _TRUNCATE); + wcsncpy_s(tszBuf, p, _TRUNCATE); mir_free(p); } } @@ -1460,8 +1460,8 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, MessageBeep(MB_OK); break; } - TCHAR szNew[2]; - szNew[0] = (TCHAR)wParam; + wchar_t szNew[2]; + szNew[0] = (wchar_t)wParam; szNew[1] = '\0'; mir_tstrcat(si->szSearch, szNew); } @@ -1472,7 +1472,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, for (i = 0; i < iItems; i++) { USERINFO *ui = pci->UM_FindUserFromIndex(si->pUsers, i); if (ui) { - if (!_tcsnicmp(ui->pszNick, si->szSearch, mir_tstrlen(si->szSearch))) { + if (!wcsnicmp(ui->pszNick, si->szSearch, mir_tstrlen(si->szSearch))) { SendMessage(hwnd, LB_SETSEL, FALSE, -1); SendMessage(hwnd, LB_SETSEL, TRUE, i); si->iSearchItem = i; @@ -1662,11 +1662,11 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, USERINFO *ui1 = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, currentHovered); if (ui1) { - TCHAR tszBuf[1024]; tszBuf[0] = 0; + wchar_t tszBuf[1024]; tszBuf[0] = 0; if (ProtoServiceExists(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT)) { - TCHAR *p = (TCHAR*)CallProtoService(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)parentdat->ptszID, (LPARAM)ui1->pszUID); + wchar_t *p = (wchar_t*)CallProtoService(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)parentdat->ptszID, (LPARAM)ui1->pszUID); if (p) { - _tcsncpy_s(tszBuf, p, _TRUNCATE); + wcsncpy_s(tszBuf, p, _TRUNCATE); mir_free(p); } } @@ -1691,7 +1691,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, // calculate the required rectangle for a string using the given font. This is more // precise than using GetTextExtentPoint...() -int GetTextPixelSize(TCHAR* pszText, HFONT hFont, bool bWidth) +int GetTextPixelSize(wchar_t* pszText, HFONT hFont, bool bWidth) { if (!pszText || !hFont) return 0; @@ -1889,15 +1889,15 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (!dat->bWasDeleted) { dat->wStatus = si->wStatus; - const TCHAR *szNick = dat->cache->getNick(); + const wchar_t *szNick = dat->cache->getNick(); if (mir_tstrlen(szNick) > 0) { if (M.GetByte("cuttitle", 0)) CutContactName(szNick, dat->newtitle, _countof(dat->newtitle)); else - _tcsncpy_s(dat->newtitle, szNick, _TRUNCATE); + wcsncpy_s(dat->newtitle, szNick, _TRUNCATE); } - TCHAR szTemp[100]; + wchar_t szTemp[100]; HICON hIcon = 0; switch (si->iType) { @@ -1930,7 +1930,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar dat->hTabIcon = dat->hTabStatusIcon; if (dat->cache->getStatus() != dat->cache->getOldStatus()) { - _tcsncpy_s(dat->szStatus, pcli->pfnGetStatusModeDescription(dat->wStatus, 0), _TRUNCATE); + wcsncpy_s(dat->szStatus, pcli->pfnGetStatusModeDescription(dat->wStatus, 0), _TRUNCATE); TCITEM item = { 0 }; item.mask = TCIF_TEXT; @@ -1953,7 +1953,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar break; if (si->pszModule != NULL) { - TCHAR szFinalStatusBarText[512]; + wchar_t szFinalStatusBarText[512]; //Mad: strange rare crash here... MODULEINFO *mi = pci->MM_FindModule(si->pszModule); @@ -1990,7 +1990,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (si->ptszStatusbarText) mir_sntprintf(szFinalStatusBarText, L"%s %s", mi->ptszModDispName, si->ptszStatusbarText); else - _tcsncpy_s(szFinalStatusBarText, mi->ptszModDispName, _TRUNCATE); + wcsncpy_s(szFinalStatusBarText, mi->ptszModDispName, _TRUNCATE); } SendMessage(dat->pContainer->hwndStatus, SB_SETTEXT, 0, (LPARAM)szFinalStatusBarText); UpdateStatusBar(dat); @@ -2511,7 +2511,7 @@ LABEL_SHOWWINDOW: ClientToScreen(((LPNMHDR)lParam)->hwndFrom, &pt); // fixing stuff for searches - TCHAR *pszWord = (TCHAR*)_alloca(8192); + wchar_t *pszWord = (wchar_t*)_alloca(8192); pszWord[0] = '\0'; POINTL ptl = { pt.x, pt.y }; ScreenToClient(GetDlgItem(hwndDlg, IDC_CHAT_LOG), (LPPOINT)&ptl); @@ -2531,7 +2531,7 @@ LABEL_SHOWWINDOW: TEXTRANGE tr = { 0 }; tr.chrg = cr; - tr.lpstrText = (TCHAR*)pszWord; + tr.lpstrText = (wchar_t*)pszWord; int iRes = SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_GETTEXTRANGE, 0, (LPARAM)&tr); if (iRes > 0) { @@ -2617,7 +2617,7 @@ LABEL_SHOWWINDOW: TEXTRANGE tr; tr.lpstrText = NULL; tr.chrg = ((ENLINK*)lParam)->chrg; - tr.lpstrText = (TCHAR*)mir_alloc(sizeof(TCHAR) * (tr.chrg.cpMax - tr.chrg.cpMin + 2)); + tr.lpstrText = (wchar_t*)mir_alloc(sizeof(wchar_t) * (tr.chrg.cpMax - tr.chrg.cpMin + 2)); SendMessage(((LPNMHDR)lParam)->hwndFrom, EM_GETTEXTRANGE, 0, (LPARAM)&tr); BOOL isLink = IsStringValidLink(tr.lpstrText); @@ -2684,19 +2684,19 @@ LABEL_SHOWWINDOW: CHARRANGE chr; SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_EXGETSEL, 0, (LPARAM)&chr); - TCHAR tszAplTmpl[] = L"%s:"; + wchar_t tszAplTmpl[] = L"%s:"; size_t bufSize = mir_tstrlen(tr.lpstrText) + mir_tstrlen(tszAplTmpl) + 3; - TCHAR *tszTmp = (TCHAR*)mir_alloc(bufSize * sizeof(TCHAR)), *tszAppeal = tszTmp; + wchar_t *tszTmp = (wchar_t*)mir_alloc(bufSize * sizeof(wchar_t)), *tszAppeal = tszTmp; TEXTRANGE tr2; - tr2.lpstrText = (LPTSTR)mir_alloc(sizeof(TCHAR) * 2); + tr2.lpstrText = (LPTSTR)mir_alloc(sizeof(wchar_t) * 2); if (chr.cpMin) { // prepend nick with space if needed tr2.chrg.cpMin = chr.cpMin - 1; tr2.chrg.cpMax = chr.cpMin; SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_GETTEXTRANGE, 0, (LPARAM)&tr2); - if (!_istspace(*tr2.lpstrText)) - *tszTmp++ = _T(' '); + if (!iswspace(*tr2.lpstrText)) + *tszTmp++ = ' '; mir_tstrcpy(tszTmp, tr.lpstrText); } else // in the beginning of the message window @@ -2708,14 +2708,14 @@ LABEL_SHOWWINDOW: tr2.chrg.cpMax = chr.cpMax + 1; // if there is no space after selection, // or there is nothing after selection at all... - if (!SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_GETTEXTRANGE, 0, (LPARAM)&tr2) || !_istspace(*tr2.lpstrText)) { - tszAppeal[st++] = _T(' '); - tszAppeal[st++] = _T('\0'); + if (!SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_GETTEXTRANGE, 0, (LPARAM)&tr2) || !iswspace(*tr2.lpstrText)) { + tszAppeal[st++] = ' '; + tszAppeal[st++] = '\0'; } } else { - tszAppeal[st++] = _T(' '); - tszAppeal[st++] = _T('\0'); + tszAppeal[st++] = ' '; + tszAppeal[st++] = '\0'; } SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_REPLACESEL, FALSE, (LPARAM)tszAppeal); mir_free((void*)tr2.lpstrText); @@ -3202,11 +3202,11 @@ LABEL_SHOWWINDOW: case DM_CONTAINERSELECTED: { - TCHAR *szNewName = (TCHAR*)lParam; + wchar_t *szNewName = (wchar_t*)lParam; if (!mir_tstrcmp(szNewName, TranslateT("Default container"))) szNewName = CGlobals::m_default_container_name; int iOldItems = TabCtrl_GetItemCount(hwndTab); - if (!_tcsncmp(dat->pContainer->szName, szNewName, CONTAINER_NAMELEN)) + if (!wcsncmp(dat->pContainer->szName, szNewName, CONTAINER_NAMELEN)) break; TContainerData *pNewContainer = FindContainerByName(szNewName); if (pNewContainer == NULL) diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index 9f7ccd8adc..b955bd2cb8 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -117,10 +117,10 @@ bool CContactCache::updateNick() { bool fChanged = false; if (m_Valid) { - TCHAR *tszNick = pcli->pfnGetContactDisplayName(getActiveContact(), 0); + wchar_t *tszNick = pcli->pfnGetContactDisplayName(getActiveContact(), 0); if (tszNick && mir_tstrcmp(m_szNick, tszNick)) fChanged = true; - _tcsncpy_s(m_szNick, (tszNick ? tszNick : L""), _TRUNCATE); + wcsncpy_s(m_szNick, (tszNick ? tszNick : L""), _TRUNCATE); } return fChanged; } @@ -180,7 +180,7 @@ bool CContactCache::updateUIN() if (m_Valid) { ptrT uid(Contact_GetInfo(CNF_DISPLAYUID, getActiveContact(), getActiveProto())); if (uid != NULL) - _tcsncpy_s(m_szUIN, uid, _TRUNCATE); + wcsncpy_s(m_szUIN, uid, _TRUNCATE); } return false; @@ -287,12 +287,12 @@ void CContactCache::saveHistory(WPARAM wParam, LPARAM) if (m_history[m_iHistoryTop].szText == NULL) { if (iLength < HISTORY_INITIAL_ALLOCSIZE) iLength = HISTORY_INITIAL_ALLOCSIZE; - m_history[m_iHistoryTop].szText = (TCHAR*)mir_alloc(iLength); + m_history[m_iHistoryTop].szText = (wchar_t*)mir_alloc(iLength); m_history[m_iHistoryTop].lLen = iLength; } else { if (iLength > m_history[m_iHistoryTop].lLen) { - m_history[m_iHistoryTop].szText = (TCHAR*)mir_realloc(m_history[m_iHistoryTop].szText, iLength); + m_history[m_iHistoryTop].szText = (wchar_t*)mir_realloc(m_history[m_iHistoryTop].szText, iLength); m_history[m_iHistoryTop].lLen = iLength; } } @@ -329,7 +329,7 @@ void CContactCache::inputHistoryEvent(WPARAM wParam) if (::GetWindowTextLength(hwndEdit) > 0) saveHistory(m_iHistorySize, 0); else - m_history[m_iHistorySize].szText[0] = (TCHAR)'\0'; + m_history[m_iHistorySize].szText[0] = (wchar_t)'\0'; } if (wParam == VK_UP) { if (m_iHistoryCurrent == 0) @@ -379,7 +379,7 @@ void CContactCache::allocHistory() m_iHistoryTop = 0; if (m_history) memset(m_history, 0, (sizeof(TInputHistory) * m_iHistorySize)); - m_history[m_iHistorySize].szText = (TCHAR*)mir_alloc((HISTORY_INITIAL_ALLOCSIZE + 1) * sizeof(TCHAR)); + m_history[m_iHistorySize].szText = (wchar_t*)mir_alloc((HISTORY_INITIAL_ALLOCSIZE + 1) * sizeof(wchar_t)); m_history[m_iHistorySize].lLen = HISTORY_INITIAL_ALLOCSIZE; } @@ -517,11 +517,11 @@ int CContactCache::cacheUpdateMetaChanged(WPARAM bMetaEnabled, LPARAM) /** * normalize the status message with proper cr/lf sequences. - * @param src TCHAR*: original status message + * @param src wchar_t*: original status message * @param fStripAll bool: strip all cr/lf sequences and replace them with spaces (use for title bar) - * @return TCHAR*: converted status message. CALLER is responsible to mir_free it, MUST use mir_free() + * @return wchar_t*: converted status message. CALLER is responsible to mir_free it, MUST use mir_free() */ -TCHAR* CContactCache::getNormalizedStatusMsg(const TCHAR *src, bool fStripAll) +wchar_t* CContactCache::getNormalizedStatusMsg(const wchar_t *src, bool fStripAll) { if (src == 0 || mir_tstrlen(src) < 2) return 0; @@ -531,7 +531,7 @@ TCHAR* CContactCache::getNormalizedStatusMsg(const TCHAR *src, bool fStripAll) for (int i = 0; src[i] != 0; i++) { if (src[i] == 0x0d || src[i] == '\t') continue; - if (i && src[i] == (TCHAR)0x0a) { + if (i && src[i] == (wchar_t)0x0a) { if (fStripAll) { dest.AppendChar(' '); continue; diff --git a/plugins/TabSRMM/src/contactcache.h b/plugins/TabSRMM/src/contactcache.h index 4be30f678b..a6e6fa191b 100644 --- a/plugins/TabSRMM/src/contactcache.h +++ b/plugins/TabSRMM/src/contactcache.h @@ -33,7 +33,7 @@ #define HISTORY_INITIAL_ALLOCSIZE 300 struct TInputHistory { - TCHAR* szText; + wchar_t* szText; size_t lLen; }; @@ -68,7 +68,7 @@ struct CContactCache : public MZeroedObject const WORD getStatus() const { return m_wStatus; } const WORD getActiveStatus() const { return m_isMeta ? m_wMetaStatus : m_wStatus; } const WORD getOldStatus() const { return m_wOldStatus; } - const TCHAR* getNick() const { return m_szNick; } + const wchar_t* getNick() const { return m_szNick; } const MCONTACT getContact() const { return m_hContact; } const MCONTACT getActiveContact() const { return (m_isMeta) ? m_hSub : m_hContact; } const DWORD getIdleTS() const { return m_idleTS; } @@ -78,11 +78,11 @@ struct CContactCache : public MZeroedObject bool isSubContact() const { return cc->IsSub(); } bool isFavorite() const { return m_isFavorite; } bool isRecent() const { return m_isRecent; } - const TCHAR* getRealAccount() const { return m_szAccount ? m_szAccount : C_INVALID_ACCOUNT; } - const TCHAR* getUIN() const { return m_szUIN; } - const TCHAR* getStatusMsg() const { return m_szStatusMsg; } - const TCHAR* getXStatusMsg() const { return m_xStatusMsg; } - const TCHAR* getListeningInfo() const { return m_ListeningInfo; } + const wchar_t* getRealAccount() const { return m_szAccount ? m_szAccount : C_INVALID_ACCOUNT; } + const wchar_t* getUIN() const { return m_szUIN; } + const wchar_t* getStatusMsg() const { return m_szStatusMsg; } + const wchar_t* getXStatusMsg() const { return m_xStatusMsg; } + const wchar_t* getListeningInfo() const { return m_ListeningInfo; } BYTE getXStatusId() const { return m_xStatus; } const HWND getWindowData(TWindowData*& dat) const { dat = m_dat; return m_hwnd; } const HWND getHwnd() const { return m_hwnd; } @@ -107,7 +107,7 @@ struct CContactCache : public MZeroedObject void closeWindow(); void deletedHandler(); void updateFavorite(); - TCHAR* getNormalizedStatusMsg(const TCHAR *src, bool fStripAll = false); + wchar_t* getNormalizedStatusMsg(const wchar_t *src, bool fStripAll = false); HICON getIcon(int& iSize) const; /* @@ -128,9 +128,9 @@ private: MCONTACT m_hContact, m_hSub; WORD m_wStatus, m_wOldStatus, m_wMetaStatus; char *m_szMetaProto; - TCHAR *m_szAccount; - TCHAR m_szNick[80], m_szUIN[80]; - TCHAR *m_szStatusMsg, *m_xStatusMsg, *m_ListeningInfo; + wchar_t *m_szAccount; + wchar_t m_szNick[80], m_szUIN[80]; + wchar_t *m_szStatusMsg, *m_xStatusMsg, *m_ListeningInfo; BYTE m_xStatus; DWORD m_idleTS; bool m_isMeta; diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 57edcf6d1f..02851f893c 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -151,7 +151,7 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, CSkin::DrawItem(dcMem, &rcWindow, &SkinItems[pContainer->ncActive ? ID_EXTBKFRAME : ID_EXTBKFRAMEINACTIVE]); - TCHAR szWindowText[512]; + wchar_t szWindowText[512]; GetWindowText(hwndDlg, szWindowText, _countof(szWindowText)); szWindowText[511] = 0; @@ -1006,7 +1006,7 @@ panel_found: dat = NULL; if (lParam) { // lParam != 0 means sent by a chat window - TCHAR szText[512]; + wchar_t szText[512]; dat = (TWindowData*)GetWindowLongPtr((HWND)wParam, GWLP_USERDATA); GetWindowText((HWND)wParam, szText, _countof(szText)); szText[_countof(szText) - 1] = 0; @@ -1305,9 +1305,9 @@ panel_found: case DM_OPTIONSAPPLIED: char szCname[40]; - TCHAR szTitleFormat[200]; + wchar_t szTitleFormat[200]; { - TCHAR *szThemeName = NULL; + wchar_t *szThemeName = NULL; DBVARIANT dbv = { 0 }; szTitleFormat[0] = 0; @@ -1332,7 +1332,7 @@ panel_found: if (szThemeName != NULL) { PathToAbsoluteT(szThemeName, pContainer->szAbsThemeFile, M.getDataPath()); - _tcsncpy_s(pContainer->szRelThemeFile, szThemeName, _TRUNCATE); + wcsncpy_s(pContainer->szRelThemeFile, szThemeName, _TRUNCATE); db_free(&dbv); } else pContainer->szAbsThemeFile[0] = pContainer->szRelThemeFile[0] = 0; @@ -1748,7 +1748,7 @@ panel_found: // The WM_DESTROY handler of the container DlgProc is responsible for mir_free()'ing the // pointer and for removing the struct from the linked list. -TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, MCONTACT hContactFrom) +TContainerData* TSAPI CreateContainer(const wchar_t *name, int iTemp, MCONTACT hContactFrom) { if (CMimAPI::m_shutDown) return NULL; @@ -1756,7 +1756,7 @@ TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, MCONTACT hCo TContainerData *pContainer = (TContainerData*)mir_calloc(sizeof(TContainerData)); if (pContainer == NULL) return NULL; - _tcsncpy(pContainer->szName, name, CONTAINER_NAMELEN + 1); + wcsncpy(pContainer->szName, name, CONTAINER_NAMELEN + 1); AppendToContainerList(pContainer); if (M.GetByte("limittabs", 0) && !mir_tstrcmp(name, L"default")) @@ -1781,11 +1781,11 @@ TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, MCONTACT hCo break; } - if (!_tcsncmp(tszName, name, CONTAINER_NAMELEN)) { + if (!wcsncmp(tszName, name, CONTAINER_NAMELEN)) { pContainer->iContainerIndex = i; iFound = TRUE; } - else if (!_tcsncmp(tszName, L"**mir_free**", CONTAINER_NAMELEN)) + else if (!wcsncmp(tszName, L"**mir_free**", CONTAINER_NAMELEN)) iFirstFree = i; } while (++i && iFound == FALSE); } @@ -1874,12 +1874,12 @@ void TSAPI CloseOtherTabs(HWND hwndTab, TWindowData &dat) // // size = max length of target string -int TSAPI CutContactName(const TCHAR *oldname, TCHAR *newname, size_t size) +int TSAPI CutContactName(const wchar_t *oldname, wchar_t *newname, size_t size) { if (mir_tstrlen(oldname) <= PluginConfig.m_iTabNameLimit) - _tcsncpy_s(newname, size, oldname, _TRUNCATE); + wcsncpy_s(newname, size, oldname, _TRUNCATE); else { - TCHAR fmt[30]; + wchar_t fmt[30]; mir_sntprintf(fmt, L"%%%d.%ds...", PluginConfig.m_iTabNameLimit, PluginConfig.m_iTabNameLimit); mir_sntprintf(newname, size, fmt, oldname); } @@ -1904,7 +1904,7 @@ static TContainerData* TSAPI AppendToContainerList(TContainerData *pContainer) return p; } -TContainerData* TSAPI FindContainerByName(const TCHAR *name) +TContainerData* TSAPI FindContainerByName(const wchar_t *name) { if (name == NULL || mir_tstrlen(name) == 0) return 0; @@ -1913,7 +1913,7 @@ TContainerData* TSAPI FindContainerByName(const TCHAR *name) return NULL; for (TContainerData *p = pFirstContainer; p; p = p->pNext) - if (!_tcsncmp(p->szName, name, CONTAINER_NAMELEN)) + if (!wcsncmp(p->szName, name, CONTAINER_NAMELEN)) return p; // error, didn't find it. @@ -2006,11 +2006,11 @@ void TSAPI AdjustTabClientRect(TContainerData *pContainer, RECT *rc) // retrieve the container name for the given contact handle. // if none is assigned, return the name of the default container -int TSAPI GetContainerNameForContact(MCONTACT hContact, TCHAR *szName, int iNameLen) +int TSAPI GetContainerNameForContact(MCONTACT hContact, wchar_t *szName, int iNameLen) { // single window mode using cloned (temporary) containers if (M.GetByte("singlewinmode", 0)) { - _tcsncpy_s(szName, iNameLen, L"Message Session", _TRUNCATE); + wcsncpy_s(szName, iNameLen, L"Message Session", _TRUNCATE); return 0; } @@ -2018,21 +2018,21 @@ int TSAPI GetContainerNameForContact(MCONTACT hContact, TCHAR *szName, int iName if (M.GetByte("useclistgroups", 0)) { ptrT tszGroup(db_get_tsa(hContact, "CList", "Group")); if (tszGroup == NULL) { - _tcsncpy_s(szName, iNameLen, L"default", _TRUNCATE); + wcsncpy_s(szName, iNameLen, L"default", _TRUNCATE); return 0; } - _tcsncpy_s(szName, iNameLen, tszGroup, _TRUNCATE); + wcsncpy_s(szName, iNameLen, tszGroup, _TRUNCATE); return 1; } ptrT tszContainerName(db_get_tsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY)); if (tszContainerName == NULL) { - _tcsncpy_s(szName, iNameLen, L"default", _TRUNCATE); + wcsncpy_s(szName, iNameLen, L"default", _TRUNCATE); return 0; } - _tcsncpy_s(szName, iNameLen, tszContainerName, _TRUNCATE); + wcsncpy_s(szName, iNameLen, tszContainerName, _TRUNCATE); return 1; } @@ -2067,7 +2067,7 @@ void TSAPI DeleteContainer(int iIndex) db_unset(NULL, SRMSGMOD_T, szSetting); } -void TSAPI RenameContainer(int iIndex, const TCHAR *szNew) +void TSAPI RenameContainer(int iIndex, const wchar_t *szNew) { if (mir_tstrlen(szNew) == 0) return; @@ -2109,7 +2109,7 @@ HMENU TSAPI BuildContainerMenu() if (tszName == NULL) break; - if (_tcsncmp(tszName, L"**mir_free**", CONTAINER_NAMELEN)) + if (wcsncmp(tszName, L"**mir_free**", CONTAINER_NAMELEN)) AppendMenu(hMenu, MF_STRING, IDM_CONTAINERMENU + i, !mir_tstrcmp(tszName, L"default") ? TranslateT("Default container") : tszName); i++; } diff --git a/plugins/TabSRMM/src/containeroptions.cpp b/plugins/TabSRMM/src/containeroptions.cpp index edc4d321be..33f27f8b7c 100644 --- a/plugins/TabSRMM/src/containeroptions.cpp +++ b/plugins/TabSRMM/src/containeroptions.cpp @@ -101,19 +101,19 @@ void TSAPI ApplyContainerSetting(TContainerData *pContainer, DWORD flags, UINT m static struct _tagPages { - const TCHAR *szTitle, *szDesc; + const wchar_t *szTitle, *szDesc; UINT uIds[10]; } o_pages[] = { - { LPGENT("General options"), NULL, IDC_O_NOTABS, IDC_O_STICKY, IDC_VERTICALMAX, IDC_AUTOSPLITTER, IDC_O_AUTOHIDE, IDC_AUTOCLOSETABTIME, IDC_AUTOCLOSETABSPIN, IDC_O_AUTOHIDESECONDS, 0, 0 }, - { LPGENT("Window layout"), NULL, IDC_CNTNOSTATUSBAR, IDC_HIDEMENUBAR, IDC_UIDSTATUSBAR, IDC_HIDETOOLBAR, IDC_INFOPANEL, IDC_BOTTOMTOOLBAR, 0, 0, 0, 0 }, - { LPGENT("Tabs and switch bar"), LPGENT("Choose your options for the tabbed user interface. Not all options can be applied to open windows. You may need to close and re-open them."), IDC_TABMODE, IDC_O_TABMODE, IDC_O_SBARLAYOUT, IDC_SBARLAYOUT, IDC_FLASHICON, IDC_FLASHLABEL, IDC_SINGLEROWTAB, IDC_BUTTONTABS, IDC_CLOSEBUTTONONTABS, 0 }, - { LPGENT("Notifications"), LPGENT("Select, when you want to see event notifications (popups) for this window. The settings apply to all tabs within this window."), IDC_O_DONTREPORT, IDC_DONTREPORTUNFOCUSED2, IDC_DONTREPORTFOCUSED2, IDC_ALWAYSPOPUPSINACTIVE, IDC_O_EXPLAINGLOBALNOTIFY, 0, 0, 0, 0, 0 }, - { LPGENT("Flashing"), NULL, IDC_O_FLASHDEFAULT, IDC_O_FLASHALWAYS, IDC_O_FLASHNEVER, 0, 0, 0, 0, 0, 0, 0 }, - { LPGENT("Title bar"), NULL, IDC_O_HIDETITLE, IDC_TITLEFORMAT, IDC_O_TITLEBARFORMAT, IDC_O_HELP_TITLEFORMAT, 0, 0, 0, 0, 0, 0 }, - { LPGENT("Window size and theme"), LPGENT("You can select a private theme (.tabsrmm file) for this container which will then override the default message log theme. You will have to close and re-open all message windows after changing this option."), IDC_THEME, IDC_SELECTTHEME, IDC_USEGLOBALSIZE, IDC_SAVESIZEASGLOBAL, IDC_LABEL_PRIVATETHEME, IDC_TSLABEL_EXPLAINTHEME, 0, 0, 0, 0 }, - { LPGENT("Transparency"), LPGENT("This feature may be unavailable when using a container skin."), IDC_TRANSPARENCY, IDC_TRANSPARENCY_ACTIVE, IDC_TRANSPARENCY_INACTIVE, IDC_TSLABEL_ACTIVE, IDC_TSLABEL_INACTIVE, 0, 0, 0, 0, 0 }, - { LPGENT("Contact avatars"), NULL, IDC_O_STATIC_AVATAR, IDC_O_STATIC_OWNAVATAR, IDC_AVATARMODE, IDC_OWNAVATARMODE, IDC_AVATARSONTASKBAR, 0, 0, 0, 0, 0 }, - { LPGENT("Sound notifications"), NULL, IDC_O_ENABLESOUNDS, IDC_O_SOUNDSMINIMIZED, IDC_O_SOUNDSUNFOCUSED, IDC_O_SOUNDSINACTIVE, IDC_O_SOUNDSFOCUSED, 0, 0, 0, 0, 0 }, + { LPGENW("General options"), NULL, IDC_O_NOTABS, IDC_O_STICKY, IDC_VERTICALMAX, IDC_AUTOSPLITTER, IDC_O_AUTOHIDE, IDC_AUTOCLOSETABTIME, IDC_AUTOCLOSETABSPIN, IDC_O_AUTOHIDESECONDS, 0, 0 }, + { LPGENW("Window layout"), NULL, IDC_CNTNOSTATUSBAR, IDC_HIDEMENUBAR, IDC_UIDSTATUSBAR, IDC_HIDETOOLBAR, IDC_INFOPANEL, IDC_BOTTOMTOOLBAR, 0, 0, 0, 0 }, + { LPGENW("Tabs and switch bar"), LPGENW("Choose your options for the tabbed user interface. Not all options can be applied to open windows. You may need to close and re-open them."), IDC_TABMODE, IDC_O_TABMODE, IDC_O_SBARLAYOUT, IDC_SBARLAYOUT, IDC_FLASHICON, IDC_FLASHLABEL, IDC_SINGLEROWTAB, IDC_BUTTONTABS, IDC_CLOSEBUTTONONTABS, 0 }, + { LPGENW("Notifications"), LPGENW("Select, when you want to see event notifications (popups) for this window. The settings apply to all tabs within this window."), IDC_O_DONTREPORT, IDC_DONTREPORTUNFOCUSED2, IDC_DONTREPORTFOCUSED2, IDC_ALWAYSPOPUPSINACTIVE, IDC_O_EXPLAINGLOBALNOTIFY, 0, 0, 0, 0, 0 }, + { LPGENW("Flashing"), NULL, IDC_O_FLASHDEFAULT, IDC_O_FLASHALWAYS, IDC_O_FLASHNEVER, 0, 0, 0, 0, 0, 0, 0 }, + { LPGENW("Title bar"), NULL, IDC_O_HIDETITLE, IDC_TITLEFORMAT, IDC_O_TITLEBARFORMAT, IDC_O_HELP_TITLEFORMAT, 0, 0, 0, 0, 0, 0 }, + { LPGENW("Window size and theme"), LPGENW("You can select a private theme (.tabsrmm file) for this container which will then override the default message log theme. You will have to close and re-open all message windows after changing this option."), IDC_THEME, IDC_SELECTTHEME, IDC_USEGLOBALSIZE, IDC_SAVESIZEASGLOBAL, IDC_LABEL_PRIVATETHEME, IDC_TSLABEL_EXPLAINTHEME, 0, 0, 0, 0 }, + { LPGENW("Transparency"), LPGENW("This feature may be unavailable when using a container skin."), IDC_TRANSPARENCY, IDC_TRANSPARENCY_ACTIVE, IDC_TRANSPARENCY_INACTIVE, IDC_TSLABEL_ACTIVE, IDC_TSLABEL_INACTIVE, 0, 0, 0, 0, 0 }, + { LPGENW("Contact avatars"), NULL, IDC_O_STATIC_AVATAR, IDC_O_STATIC_OWNAVATAR, IDC_AVATARMODE, IDC_OWNAVATARMODE, IDC_AVATARSONTASKBAR, 0, 0, 0, 0, 0 }, + { LPGENW("Sound notifications"), NULL, IDC_O_ENABLESOUNDS, IDC_O_SOUNDSMINIMIZED, IDC_O_SOUNDSUNFOCUSED, IDC_O_SOUNDSINACTIVE, IDC_O_SOUNDSFOCUSED, 0, 0, 0, 0, 0 }, }; static void ShowPage(HWND hwndDlg, int iPage, BOOL fShow) @@ -152,7 +152,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam, pContainer = (TContainerData*)lParam; pContainer->hWndOptions = hwndDlg; SetWindowText(hwndDlg, TranslateT("Container options")); - TCHAR szNewTitle[128]; + wchar_t szNewTitle[128]; mir_sntprintf(szNewTitle, L"%s", !mir_tstrcmp(pContainer->szName, L"default") ? TranslateT("Default container") : pContainer->szName); SetDlgItemText(hwndDlg, IDC_HEADERBAR, szNewTitle); @@ -342,7 +342,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam, pContainer->fPrivateThemeChanged = TRUE; if (PathFileExists(szFinalThemeFile)) - _tcsncpy_s(pContainer->szRelThemeFile, szFilename, _TRUNCATE); + wcsncpy_s(pContainer->szRelThemeFile, szFilename, _TRUNCATE); else pContainer->szRelThemeFile[0] = 0; } diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp index 3fdb69954f..a60bf718a8 100644 --- a/plugins/TabSRMM/src/controls.cpp +++ b/plugins/TabSRMM/src/controls.cpp @@ -270,12 +270,12 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm) return CDRF_NOTIFYITEMDRAW | CDRF_NOTIFYPOSTPAINT | CDRF_NOTIFYPOSTERASE; case CDDS_ITEMPREPAINT: - TCHAR *szText; + wchar_t *szText; bool fDraw; { int iIndex = idToIndex(nmtb->nmcd.dwItemSpec); if (iIndex >= 0 && iIndex < NR_BUTTONS) - szText = (TCHAR*)m_TbButtons[iIndex].iString; + szText = (wchar_t*)m_TbButtons[iIndex].iString; else szText = NULL; @@ -834,7 +834,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR int height = itemRect.bottom - itemRect.top; HICON hIcon = (HICON)SendMessage(hWnd, SB_GETICON, i, 0); - TCHAR szText[1024]; szText[0] = 0; + wchar_t szText[1024]; szText[0] = 0; LRESULT result = SendMessage(hWnd, SB_GETTEXT, i, (LPARAM)szText); if (i == 2 && pContainer) { TWindowData *pDat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA); @@ -952,7 +952,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR if (dat != NULL) { RECT rc; SIZE size; - TCHAR wBuf[512]; wBuf[0] = 0; + wchar_t wBuf[512]; wBuf[0] = 0; CLCINFOTIP ti = { 0 }; ti.cbSize = sizeof(ti); ti.ptCursor = pt; @@ -975,10 +975,10 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR mtnStatus ? TranslateT("enabled") : TranslateT("disabled")); } else if (sid->dwId == MSG_ICON_SESSION) - _tcsncpy_s(wBuf, TranslateT("Session list.\nClick left for a list of open sessions.\nClick right to access favorites and quickly configure message window behavior"), _TRUNCATE); + wcsncpy_s(wBuf, TranslateT("Session list.\nClick left for a list of open sessions.\nClick right to access favorites and quickly configure message window behavior"), _TRUNCATE); } else if (sid->tszTooltip) - _tcsncpy(wBuf, sid->tszTooltip, _countof(wBuf)); + wcsncpy(wBuf, sid->tszTooltip, _countof(wBuf)); if (wBuf[0]) { CallService("mToolTip/ShowTipW", (WPARAM)wBuf, (LPARAM)&ti); @@ -995,7 +995,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR iLength = SendDlgItemMessage(dat->hwnd, dat->bType == SESSIONTYPE_IM ? IDC_MESSAGE : IDC_CHAT_MESSAGE, EM_GETTEXTLENGTHEX, (WPARAM)>xl, 0); tooltip_active = TRUE; - const TCHAR *szFormat = TranslateT("There are %d pending send jobs. Message length: %d bytes, message length limit: %d bytes\n\n%d messages are queued for later delivery"); + const wchar_t *szFormat = TranslateT("There are %d pending send jobs. Message length: %d bytes, message length limit: %d bytes\n\n%d messages are queued for later delivery"); mir_sntprintf(wBuf, szFormat, dat->iOpenJobs, iLength, dat->nMax ? dat->nMax : 20000, iQueued); CallService("mToolTip/ShowTipW", (WPARAM)wBuf, (LPARAM)&ti); diff --git a/plugins/TabSRMM/src/controls.h b/plugins/TabSRMM/src/controls.h index cefcf8276b..bda3bc61ac 100644 --- a/plugins/TabSRMM/src/controls.h +++ b/plugins/TabSRMM/src/controls.h @@ -66,7 +66,7 @@ public: void setAero(bool fState) { m_isAero = fState; } const bool getAero(void) const { return(m_isAero); } - const LRESULT processAccelerator(TCHAR a, UINT& ctlId) const + const LRESULT processAccelerator(wchar_t a, UINT& ctlId) const { UINT _ctlId; diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index 629c9a6d11..0680d86d3a 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -414,14 +414,14 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA * @return */ -static TCHAR* ShortenPreview(DBEVENTINFO* dbe) +static wchar_t* ShortenPreview(DBEVENTINFO* dbe) { bool fAddEllipsis = false; size_t iPreviewLimit = nen_options.iLimitPreview; if (iPreviewLimit > 500 || iPreviewLimit == 0) iPreviewLimit = 500; - TCHAR *buf = DbGetEventTextT(dbe, CP_ACP); + wchar_t *buf = DbGetEventTextT(dbe, CP_ACP); if (mir_tstrlen(buf) > iPreviewLimit) { fAddEllipsis = true; size_t iIndex = iPreviewLimit; @@ -432,13 +432,13 @@ static TCHAR* ShortenPreview(DBEVENTINFO* dbe) buf[iIndex] = 0; } if (fAddEllipsis) { - buf = (TCHAR*)mir_realloc(buf, (mir_tstrlen(buf) + 5) * sizeof(TCHAR)); + buf = (wchar_t*)mir_realloc(buf, (mir_tstrlen(buf) + 5) * sizeof(wchar_t)); mir_tstrcat(buf, L"..."); } return buf; } -static TCHAR* GetPreviewT(WORD eventType, DBEVENTINFO* dbe) +static wchar_t* GetPreviewT(WORD eventType, DBEVENTINFO* dbe) { char *pBlob = (char *)dbe->pBlob; @@ -463,7 +463,7 @@ static TCHAR* GetPreviewT(WORD eventType, DBEVENTINFO* dbe) szDescr = szFileName + namelength + 1; ptrT tszFileName(DbGetEventStringT(dbe, szFileName)); - TCHAR buf[1024]; + wchar_t buf[1024]; if (szDescr && Utils::safe_strlen(szDescr, dbe->cbBlob - sizeof(DWORD) - namelength - 1) > 0) { ptrT tszDescr(DbGetEventStringT(dbe, szDescr)); @@ -498,7 +498,7 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent) if (hEvent == NULL) return 0; - TCHAR szHeader[256]; + wchar_t szHeader[256]; if (pdata->pluginOptions->bShowHeaders) mir_sntprintf(szHeader, L"%s %d\n", TranslateT("New messages: "), pdata->nrMerged + 1); else @@ -511,11 +511,11 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent) } db_event_get(hEvent, &dbe); - TCHAR timestamp[MAX_DATASIZE]; - _tcsftime(timestamp, MAX_DATASIZE, L"%Y.%m.%d %H:%M", _localtime32((__time32_t *)&dbe.timestamp)); + wchar_t timestamp[MAX_DATASIZE]; + wcsftime(timestamp, MAX_DATASIZE, L"%Y.%m.%d %H:%M", _localtime32((__time32_t *)&dbe.timestamp)); mir_sntprintf(pdata->eventData[pdata->nrMerged].tszText, L"\n\n%s\n", timestamp); - TCHAR *szPreview = GetPreviewT(dbe.eventType, &dbe); + wchar_t *szPreview = GetPreviewT(dbe.eventType, &dbe); if (szPreview) { mir_tstrncat(pdata->eventData[pdata->nrMerged].tszText, szPreview, _countof(pdata->eventData[pdata->nrMerged].tszText) - mir_tstrlen(pdata->eventData[pdata->nrMerged].tszText)); mir_free(szPreview); @@ -529,10 +529,10 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent) * for which there is enough space in the popup text */ - TCHAR lpzText[MAX_SECONDLINE]; + wchar_t lpzText[MAX_SECONDLINE]; int i, available = MAX_SECONDLINE - 1; if (pdata->pluginOptions->bShowHeaders) { - _tcsncpy(lpzText, szHeader, MAX_SECONDLINE); + wcsncpy(lpzText, szHeader, MAX_SECONDLINE); available -= (int)mir_tstrlen(szHeader); } else lpzText[0] = 0; @@ -613,21 +613,21 @@ static int PopupShowT(NEN_OPTIONS *pluginOptions, MCONTACT hContact, MEVENT hEve pud.PluginData = pdata; if (hContact) - _tcsncpy_s(pud.lptzContactName, pcli->pfnGetContactDisplayName(hContact, 0), _TRUNCATE); + wcsncpy_s(pud.lptzContactName, pcli->pfnGetContactDisplayName(hContact, 0), _TRUNCATE); else - _tcsncpy_s(pud.lptzContactName, _A2T(dbe.szModule), _TRUNCATE); + wcsncpy_s(pud.lptzContactName, _A2T(dbe.szModule), _TRUNCATE); - TCHAR *szPreview = GetPreviewT((WORD)eventType, &dbe); + wchar_t *szPreview = GetPreviewT((WORD)eventType, &dbe); if (szPreview) { - _tcsncpy_s(pud.lptzText, szPreview, _TRUNCATE); + wcsncpy_s(pud.lptzText, szPreview, _TRUNCATE); mir_free(szPreview); } - else _tcsncpy(pud.lptzText, L" ", MAX_SECONDLINE); + else wcsncpy(pud.lptzText, L" ", MAX_SECONDLINE); pdata->eventData = (EVENT_DATAT *)mir_alloc(NR_MERGED * sizeof(EVENT_DATAT)); pdata->eventData[0].hEvent = hEvent; pdata->eventData[0].timestamp = dbe.timestamp; - _tcsncpy(pdata->eventData[0].tszText, pud.lptzText, MAX_SECONDLINE); + wcsncpy(pdata->eventData[0].tszText, pud.lptzText, MAX_SECONDLINE); pdata->eventData[0].tszText[MAX_SECONDLINE - 1] = 0; pdata->nrEventsAlloced = NR_MERGED; pdata->nrMerged = 1; @@ -662,14 +662,14 @@ void TSAPI UpdateTrayMenuState(TWindowData *dat, BOOL bForced) mii.cbSize = sizeof(mii); mii.fMask = MIIM_DATA | MIIM_BITMAP; - const TCHAR *tszProto = dat->cache->getRealAccount(); + const wchar_t *tszProto = dat->cache->getRealAccount(); assert(tszProto != 0); GetMenuItemInfo(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)dat->hContact, FALSE, &mii); if (!bForced) PluginConfig.m_UnreadInTray -= (mii.dwItemData & 0x0000ffff); if (mii.dwItemData > 0 || bForced) { - TCHAR szMenuEntry[80]; + wchar_t szMenuEntry[80]; mir_sntprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszProto, dat->cache->getNick(), dat->szStatus[0] ? dat->szStatus : L"(undef)", mii.dwItemData & 0x0000ffff); @@ -684,18 +684,18 @@ void TSAPI UpdateTrayMenuState(TWindowData *dat, BOOL bForced) } // if we want tray support, add the contact to the list of unread sessions in the tray menu -int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szProto, const TCHAR *szStatus, MCONTACT hContact, DWORD fromEvent) +int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szProto, const wchar_t *szStatus, MCONTACT hContact, DWORD fromEvent) { if (!PluginConfig.g_hMenuTrayUnread || hContact == 0 || szProto == NULL) return 0; PROTOACCOUNT *acc = Proto_GetAccount(szProto); - TCHAR *tszFinalProto = (acc && acc->tszAccountName ? acc->tszAccountName : 0); + wchar_t *tszFinalProto = (acc && acc->tszAccountName ? acc->tszAccountName : 0); if (tszFinalProto == 0) return 0; WORD wMyStatus = (wStatus == 0) ? db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE) : wStatus; - const TCHAR *szMyStatus = (szStatus == NULL) ? pcli->pfnGetStatusModeDescription(wMyStatus, 0) : szStatus; + const wchar_t *szMyStatus = (szStatus == NULL) ? pcli->pfnGetStatusModeDescription(wMyStatus, 0) : szStatus; MENUITEMINFO mii = { 0 }; mii.cbSize = sizeof(mii); @@ -703,8 +703,8 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro mii.wID = (UINT)hContact; mii.hbmpItem = HBMMENU_CALLBACK; - TCHAR szMenuEntry[80]; - const TCHAR *szNick = NULL; + wchar_t szMenuEntry[80]; + const wchar_t *szNick = NULL; if (dat != 0) { szNick = dat->cache->getNick(); GetMenuItemInfo(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)hContact, FALSE, &mii); diff --git a/plugins/TabSRMM/src/functions.h b/plugins/TabSRMM/src/functions.h index 00ab7a0f2e..de55cf7163 100644 --- a/plugins/TabSRMM/src/functions.h +++ b/plugins/TabSRMM/src/functions.h @@ -50,7 +50,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP int TSAPI NEN_ReadOptions(NEN_OPTIONS *options); int TSAPI NEN_WriteOptions(NEN_OPTIONS *options); -int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szProto, const TCHAR *szStatus, MCONTACT hContact, DWORD fromEvent); +int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szProto, const wchar_t *szStatus, MCONTACT hContact, DWORD fromEvent); void TSAPI DeletePopupsForContact(MCONTACT hContact, DWORD dwMask); /* @@ -61,7 +61,7 @@ void TSAPI CreateSystrayIcon(int create); void TSAPI FlashTrayIcon(HICON hIcon); void TSAPI UpdateTrayMenuState(TWindowData *dat, BOOL bForced); void TSAPI LoadFavoritesAndRecent(); -void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, const char *szProto, TCHAR *szStatus, +void TSAPI AddContactToFavorites(MCONTACT hContact, const wchar_t *szNickname, const char *szProto, wchar_t *szStatus, WORD wStatus, HICON hIcon, BOOL mode, HMENU hMenu); void TSAPI CreateTrayMenus(int mode); void TSAPI HandleMenuEntryFromhContact(MCONTACT iSelection); @@ -76,9 +76,9 @@ int TSAPI ActivateTabFromHWND(HWND hwndTab, HWND hwnd); void TSAPI FlashContainer(TContainerData *pContainer, int iMode, int iNum); void TSAPI CreateImageList(BOOL bInitial); -TContainerData* TSAPI FindMatchingContainer(const TCHAR *szName); -TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, MCONTACT hContactFrom); -TContainerData* TSAPI FindContainerByName(const TCHAR *name); +TContainerData* TSAPI FindMatchingContainer(const wchar_t *szName); +TContainerData* TSAPI CreateContainer(const wchar_t *name, int iTemp, MCONTACT hContactFrom); +TContainerData* TSAPI FindContainerByName(const wchar_t *name); int TSAPI GetTabIndexFromHWND(HWND hwndTab, HWND hwnd); HWND TSAPI GetHWNDFromTabIndex(HWND hwndTab, int idx); @@ -90,8 +90,8 @@ void TSAPI ReflashContainer(TContainerData *pContainer); void TSAPI CloseAllContainers(); void TSAPI DeleteContainer(int iIndex); -void TSAPI RenameContainer(int iIndex, const TCHAR *newName); -int TSAPI GetContainerNameForContact(MCONTACT hContact, TCHAR *szName, int iNameLen); +void TSAPI RenameContainer(int iIndex, const wchar_t *newName); +int TSAPI GetContainerNameForContact(MCONTACT hContact, wchar_t *szName, int iNameLen); HMENU TSAPI BuildContainerMenu(); void TSAPI PreTranslateDates(); void TSAPI ApplyContainerSetting(TContainerData *pContainer, DWORD flags, UINT mode, bool fForceResize); @@ -142,15 +142,15 @@ int TSAPI UnloadTSButtonModule(); #if defined(__LOGDEBUG_) int _DebugTraceW(const wchar_t *fmt, ...); #endif -int _DebugPopup(MCONTACT hContact, const TCHAR *fmt, ...); +int _DebugPopup(MCONTACT hContact, const wchar_t *fmt, ...); int _DebugMessage(HWND hwndDlg, TWindowData *dat, const char *fmt, ...); // themes -const TCHAR* TSAPI GetThemeFileName(int iMode); -int TSAPI CheckThemeVersion(const TCHAR *szIniFilename); -void TSAPI WriteThemeToINI(const TCHAR *szIniFilename, TWindowData *dat); -void TSAPI ReadThemeFromINI(const TCHAR *szIniFilename, TContainerData *dat, int noAdvanced, DWORD dwFlags); +const wchar_t* TSAPI GetThemeFileName(int iMode); +int TSAPI CheckThemeVersion(const wchar_t *szIniFilename); +void TSAPI WriteThemeToINI(const wchar_t *szIniFilename, TWindowData *dat); +void TSAPI ReadThemeFromINI(const wchar_t *szIniFilename, TContainerData *dat, int noAdvanced, DWORD dwFlags); // user prefs diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 5f63d6c7e5..03317d8d5b 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -43,13 +43,13 @@ void TSAPI DM_SaveLogAsRTF(const TWindowData *dat) CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&event); } else if (dat) { - TCHAR szFilter[MAX_PATH], szFilename[MAX_PATH]; + wchar_t szFilter[MAX_PATH], szFilename[MAX_PATH]; mir_sntprintf(szFilter, L"%s%c*.rtf%c%c", TranslateT("Rich Edit file"), 0, 0, 0); mir_sntprintf(szFilename, L"%s.rtf", dat->cache->getNick()); Utils::sanitizeFilename(szFilename); - TCHAR szInitialDir[MAX_PATH + 2]; + wchar_t szInitialDir[MAX_PATH + 2]; mir_sntprintf(szInitialDir, L"%s%s\\", M.getDataPath(), L"\\Saved message logs"); CreateDirectoryTreeT(szInitialDir); @@ -535,7 +535,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer, else { int iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE)); - TCHAR *buf = (TCHAR*)mir_alloc((iLen + 2) * sizeof(TCHAR)); + wchar_t *buf = (wchar_t*)mir_alloc((iLen + 2) * sizeof(wchar_t)); GetDlgItemText(hwndDlg, IDC_MESSAGE, buf, iLen + 1); db_set_ts(dat->hContact, "UserInfo", "MyNotes", buf); SetDlgItemText(hwndDlg, IDC_MESSAGE, L""); @@ -612,7 +612,7 @@ static INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR WORD v[4]; CallService(MS_SYSTEM_GETFILEVERSION, 0, (LPARAM)&v); - TCHAR tStr[80]; + wchar_t tStr[80]; mir_sntprintf(tStr, L"%s %d.%d.%d.%d [build %d]", TranslateT("Version"), __MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM, v[3]); SetDlgItemText(hwndDlg, IDC_HEADERBAR, tStr); @@ -1000,9 +1000,9 @@ void TSAPI DM_LoadLocale(TWindowData *dat) if (!db_get_ts(dat->hContact, SRMSGMOD_T, "locale", &dbv)) db_free(&dbv); else { - TCHAR szKLName[KL_NAMELENGTH + 1]; + wchar_t szKLName[KL_NAMELENGTH + 1]; if (!PluginConfig.m_bDontUseDefaultKbd) { - TCHAR szBuf[20]; + wchar_t szBuf[20]; GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_ILANGUAGE, szBuf, 20); mir_sntprintf(szKLName, L"0000%s", szBuf); db_set_ts(dat->hContact, SRMSGMOD_T, "locale", szKLName); @@ -1039,7 +1039,7 @@ void TSAPI DM_UpdateLastMessage(const TWindowData *dat) if (dat->pContainer->hwndStatus == 0 || dat->pContainer->hwndActive != dat->hwnd) return; - TCHAR szBuf[100]; + wchar_t szBuf[100]; if (dat->bShowTyping) { SendMessage(dat->pContainer->hwndStatus, SB_SETICON, 0, (LPARAM)PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING]); mir_sntprintf(szBuf, TranslateT("%s is typing a message..."), dat->cache->getNick()); @@ -1055,7 +1055,7 @@ void TSAPI DM_UpdateLastMessage(const TWindowData *dat) if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR) mir_sntprintf(szBuf, L"UID: %s", dat->cache->getUIN()); else if (dat->lastMessage) { - TCHAR date[64], time[64]; + wchar_t date[64], time[64]; TimeZone_PrintTimeStamp(NULL, dat->lastMessage, L"d", date, _countof(date), 0); if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR && mir_tstrlen(date) > 6) date[mir_tstrlen(date) - 5] = 0; @@ -1077,7 +1077,7 @@ void TSAPI DM_SaveLocale(TWindowData *dat, WPARAM, LPARAM lParam) return; if (PluginConfig.m_bAutoLocaleSupport && dat->hContact && dat->pContainer->hwndActive == dat->hwnd) { - TCHAR szKLName[KL_NAMELENGTH + 1]; + wchar_t szKLName[KL_NAMELENGTH + 1]; if ((HKL)lParam != dat->hkl) { dat->hkl = (HKL)lParam; ActivateKeyboardLayout(dat->hkl, 0); @@ -1591,7 +1591,7 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM hContact, LPARAM lParam) } dat->hQueuedEvents[dat->iNextQueuedEvent++] = hDbEvent; - TCHAR szBuf[100]; + wchar_t szBuf[100]; mir_sntprintf(szBuf, TranslateT("Auto scrolling is disabled, %d message(s) queued (press F12 to enable it)"), dat->iNextQueuedEvent); SetDlgItemText(hwndDlg, IDC_LOGFROZENTEXT, szBuf); @@ -1704,7 +1704,7 @@ void TSAPI DM_HandleAutoSizeRequest(TWindowData *dat, REQRESIZE* rr) void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam) { - TCHAR newtitle[128], newcontactname[128]; + wchar_t newtitle[128], newcontactname[128]; DWORD dwOldIdle = dat->idle; const char *szActProto = 0; @@ -1722,7 +1722,7 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam) TCITEM item = { 0 }; if (dat->hContact) { - const TCHAR *szNick = dat->cache->getNick(); + const wchar_t *szNick = dat->cache->getNick(); if (dat->szProto) { szActProto = dat->cache->getProto(); @@ -1732,13 +1732,13 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam) dat->dwFlagsEx = dat->idle ? dat->dwFlagsEx | MWF_SHOW_ISIDLE : dat->dwFlagsEx & ~MWF_SHOW_ISIDLE; dat->wStatus = dat->cache->getStatus(); - _tcsncpy_s(dat->szStatus, pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : dat->wStatus, 0), _TRUNCATE); + wcsncpy_s(dat->szStatus, pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : dat->wStatus, 0), _TRUNCATE); if (lParam != 0) { if (PluginConfig.m_bCutContactNameOnTabs) CutContactName(szNick, newcontactname, _countof(newcontactname)); else - _tcsncpy_s(newcontactname, szNick, _TRUNCATE); + wcsncpy_s(newcontactname, szNick, _TRUNCATE); Utils::DoubleAmpersands(newcontactname, _countof(newcontactname)); @@ -1746,15 +1746,15 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam) if (PluginConfig.m_bStatusOnTabs) mir_sntprintf(newtitle, L"%s (%s)", newcontactname, dat->szStatus); else - _tcsncpy_s(newtitle, newcontactname, _TRUNCATE); + wcsncpy_s(newtitle, newcontactname, _TRUNCATE); } - else _tcsncpy_s(newtitle, L"Forward", _TRUNCATE); + else wcsncpy_s(newtitle, L"Forward", _TRUNCATE); item.mask |= TCIF_TEXT; } SendMessage(hwndDlg, DM_UPDATEWINICON, 0, 0); - TCHAR fulluin[256]; + wchar_t fulluin[256]; if (dat->bIsMeta) mir_sntprintf(fulluin, TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for user's details\nRight click for metacontact control\nClick dropdown to add or remove user from your favorites."), @@ -1767,12 +1767,12 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam) SendDlgItemMessage(hwndDlg, IDC_NAME, BUTTONADDTOOLTIP, (WPARAM)fulluin, BATF_TCHAR); } } - else _tcsncpy_s(newtitle, L"Message Session", _TRUNCATE); + else wcsncpy_s(newtitle, L"Message Session", _TRUNCATE); if (dat->idle != dwOldIdle || lParam != 0) { if (item.mask & TCIF_TEXT) { item.pszText = newtitle; - _tcsncpy(dat->newtitle, newtitle, _countof(dat->newtitle)); + wcsncpy(dat->newtitle, newtitle, _countof(dat->newtitle)); dat->newtitle[127] = 0; if (dat->pWnd) dat->pWnd->updateTitle(dat->cache->getNick()); diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index 688a365f04..9bb015b8bf 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -37,7 +37,7 @@ CGlobals PluginConfig; static TContainerSettings _cnt_default = { false, CNT_FLAGS_DEFAULT, CNT_FLAGSEX_DEFAULT, 255, CInfoPanel::DEGRADE_THRESHOLD, 60, L"%n (%s)", 1, 0 }; -TCHAR* CGlobals::m_default_container_name = L"default"; +wchar_t* CGlobals::m_default_container_name = L"default"; extern HANDLE hHookButtonPressedEvt; extern HANDLE hHookToolBarLoadedEvt; @@ -558,7 +558,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void) } } - TCHAR toolTip[256]; + wchar_t toolTip[256]; CLISTEVENT cle = {}; cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE); @@ -597,8 +597,8 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c) if (wStatus == wOldStatus) return; - TCHAR *szOldStatus = pcli->pfnGetStatusModeDescription(wOldStatus, 0); - TCHAR *szNewStatus = pcli->pfnGetStatusModeDescription(wStatus, 0); + wchar_t *szOldStatus = pcli->pfnGetStatusModeDescription(wOldStatus, 0); + wchar_t *szNewStatus = pcli->pfnGetStatusModeDescription(wStatus, 0); if (szOldStatus == 0 || szNewStatus == 0) return; diff --git a/plugins/TabSRMM/src/globals.h b/plugins/TabSRMM/src/globals.h index d258f91259..3cc0a9b484 100644 --- a/plugins/TabSRMM/src/globals.h +++ b/plugins/TabSRMM/src/globals.h @@ -148,7 +148,7 @@ public: TSplitterBroadCast lastSPlitterPos; TContainerSettings globalContainerSettings; - static TCHAR* m_default_container_name; + static wchar_t* m_default_container_name; static void logStatusChange(WPARAM wParam, const CContactCache *c); diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp index 8d92bde883..00b3abf2fe 100644 --- a/plugins/TabSRMM/src/infopanel.cpp +++ b/plugins/TabSRMM/src/infopanel.cpp @@ -28,7 +28,7 @@ #include "stdafx.h" -TCHAR *xStatusDescr[] = +wchar_t *xStatusDescr[] = { L"Angry", L"Duck", L"Tired", L"Party", L"Beer", L"Thinking", L"Eating", L"TV", L"Friends", L"Coffee", L"Music", L"Business", L"Camera", L"Funny", @@ -383,8 +383,8 @@ void CInfoPanel::renderContent(const HDC hdc) void CInfoPanel::RenderIPNickname(const HDC hdc, RECT &rcItem) { - const TCHAR *szStatusMsg = NULL; - const TCHAR *szTextToShow = 0; + const wchar_t *szStatusMsg = NULL; + const wchar_t *szTextToShow = 0; bool fShowUin = false; COLORREF clr = 0; @@ -488,9 +488,9 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem) else hOldFont = reinterpret_cast(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_UIN])); - const TCHAR *tszUin = m_dat->cache->getUIN(); + const wchar_t *tszUin = m_dat->cache->getUIN(); if (tszUin[0]) { - TCHAR szBuf[256]; + wchar_t szBuf[256]; if (m_dat->idle) { time_t diff = time(NULL) - m_dat->idle; @@ -498,16 +498,16 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem) int i_mins = (diff - i_hrs * 3600) / 60; mir_sntprintf(szBuf, TranslateT("%s Idle: %dh,%02dm"), tszUin, i_hrs, i_mins); } - else _tcscpy_s(szBuf, 256, tszUin); + else wcscpy_s(szBuf, 256, tszUin); if (M.GetByte("ShowClientDescription", 1)) { - TCHAR temp[256]; + wchar_t temp[256]; ptrT szVersion(db_get_tsa(m_dat->cache->getActiveContact(), m_dat->cache->getActiveProto(), "MirVer")); if (szVersion) mir_sntprintf(temp, TranslateT(" Client: %s"), szVersion); else mir_sntprintf(temp, TranslateT(" Client not cached yet")); - _tcscat_s(szBuf, 256, temp); + wcscat_s(szBuf, 256, temp); } SIZE sUIN; @@ -535,13 +535,13 @@ void CInfoPanel::RenderIPStatus(const HDC hdc, RECT& rcItem) GetTextExtentPoint32(hdc, m_dat->szStatus, (int)mir_tstrlen(m_dat->szStatus), &sStatus); // figure out final account name - const TCHAR *szFinalProto = m_dat->cache->getRealAccount(); + const wchar_t *szFinalProto = m_dat->cache->getRealAccount(); if (szFinalProto) { SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_PROTO]); GetTextExtentPoint32(hdc, szFinalProto, (int)mir_tstrlen(szFinalProto), &sProto); } - TCHAR szResult[80]; szResult[0] = 0; + wchar_t szResult[80]; szResult[0] = 0; if (m_dat->hTimeZone) { TimeZone_PrintDateTime(m_dat->hTimeZone, L"t", szResult, _countof(szResult), 0); GetTextExtentPoint32(hdc, szResult, (int)mir_tstrlen(szResult), &sTime); @@ -612,7 +612,7 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem) HFONT hOldFont; if (m_height < DEGRADE_THRESHOLD) { - TCHAR tszText[2048]; + wchar_t tszText[2048]; mir_sntprintf(tszText, TranslateT("Topic is: %s"), si->ptszTopic ? si->ptszTopic : TranslateT("no topic set.")); @@ -621,7 +621,7 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem) CSkin::m_glowSize, m_ipConfig.clrs[IPFONTID_UIN]); } else { - const TCHAR *tszNick = m_dat->cache->getNick(); + const wchar_t *tszNick = m_dat->cache->getNick(); hOldFont = reinterpret_cast(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_NICK])); ::GetTextExtentPoint32(hdc, tszNick, (int)mir_tstrlen(tszNick), &m_szNick); @@ -640,7 +640,7 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem) ::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_STATUS]); if (si->ptszStatusbarText) { - TCHAR *pTmp = _tcschr(si->ptszStatusbarText, ']'); + wchar_t *pTmp = wcschr(si->ptszStatusbarText, ']'); pTmp += 2; if (si->ptszStatusbarText[0] == '[' && pTmp > si->ptszStatusbarText) { @@ -669,7 +669,7 @@ void CInfoPanel::Chat_RenderIPSecondLine(const HDC hdc, RECT& rcItem) COLORREF clr = m_ipConfig.clrs[IPFONTID_UIN]; SIZE szTitle; - TCHAR szPrefix[100]; + wchar_t szPrefix[100]; mir_sntprintf(szPrefix, TranslateT("Topic is: %s"), L""); ::GetTextExtentPoint32(hdc, szPrefix, (int)mir_tstrlen(szPrefix), &szTitle); mapRealRect(rcItem, m_rcUIN, szTitle); @@ -865,7 +865,7 @@ void CInfoPanel::trackMouse(POINT &pt) ///////////////////////////////////////////////////////////////////////////////////////// // activate a tooltip // @param ctrlId : control id -// @param lParam : typically a TCHAR * for the tooltip text +// @param lParam : typically a wchar_t * for the tooltip text void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam) { @@ -879,7 +879,7 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam) ::SendMessage(m_dat->hwndTip, TTM_TRACKPOSITION, 0, (LPARAM)MAKELONG(rc.left, rc.bottom)); } if (lParam) - m_dat->ti.lpszText = reinterpret_cast(lParam); + m_dat->ti.lpszText = reinterpret_cast(lParam); else { if (m_hwndConfig) return; @@ -891,7 +891,7 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam) DBVARIANT dbv = { 0 }; if (BYTE xStatus = m_dat->cache->getXStatusId()) { - TCHAR *tszXStatusName = 0; + wchar_t *tszXStatusName = 0; if (0 == db_get_ts(m_dat->cache->getContact(), m_dat->cache->getProto(), "XStatusName", &dbv)) tszXStatusName = dbv.ptszVal; else if (xStatus > 0 && xStatus <= 31) @@ -1060,7 +1060,7 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L switch (msg) { case WM_INITDIALOG: { - TCHAR tszTitle[100]; + wchar_t tszTitle[100]; mir_sntprintf(tszTitle, TranslateT("Set panel visibility for this %s"), m_isChat ? TranslateT("chat room") : TranslateT("contact")); ::SetDlgItemText(hwnd, IDC_STATIC_VISIBILTY, tszTitle); @@ -1306,10 +1306,10 @@ void CInfoPanel::dismissConfig(bool fForced) // // @param hwndParent HWND owner (used only for position calculation) // @param hContact HANDLE contact handle -// @param pszText TCHAR* the content of the rich edit control +// @param pszText wchar_t* the content of the rich edit control // @param panel CInfoPanel* the panel which owns it -CTip::CTip(const HWND hwndParent, const MCONTACT hContact, const TCHAR *pszText, const CInfoPanel* panel) +CTip::CTip(const HWND hwndParent, const MCONTACT hContact, const wchar_t *pszText, const CInfoPanel* panel) { m_hwnd = ::CreateWindowEx(WS_EX_TOOLWINDOW, L"RichEditTipClass", L"", (M.isAero() ? WS_THICKFRAME : WS_BORDER) | WS_POPUPWINDOW | WS_TABSTOP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0, 0, 40, 40, 0, 0, g_hInst, this); @@ -1339,7 +1339,7 @@ CTip::CTip(const HWND hwndParent, const MCONTACT hContact, const TCHAR *pszText, // @param hIcon optional icon to display in the tip header // @param szTitle optional title to display in the tip header -void CTip::show(const RECT& rc, POINT& pt, const HICON hIcon, const TCHAR *szTitle) +void CTip::show(const RECT& rc, POINT& pt, const HICON hIcon, const wchar_t *szTitle) { HDC hdc = ::GetDC(m_hwnd); @@ -1492,7 +1492,7 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam break; case WM_ERASEBKGND: - TCHAR szTitle[128]; + wchar_t szTitle[128]; { HDC hdc = (HDC)wParam; COLORREF clr = CInfoPanel::m_ipConfig.clrs[IPFONTID_NICK]; diff --git a/plugins/TabSRMM/src/infopanel.h b/plugins/TabSRMM/src/infopanel.h index 7cf319ac94..aadb0d1f84 100644 --- a/plugins/TabSRMM/src/infopanel.h +++ b/plugins/TabSRMM/src/infopanel.h @@ -52,7 +52,7 @@ struct TInfoPanelConfig { UINT height1, height2; }; -extern TCHAR *xStatusDescr[]; +extern wchar_t *xStatusDescr[]; /** * a simple tooltip class using a richedit control to display its content. Allows @@ -71,12 +71,12 @@ public: LEFT_BAR_WIDTH = 20 }; - CTip(const HWND hwndParent, const MCONTACT hContact, const TCHAR *pszText = 0, const CInfoPanel *panel = 0); + CTip(const HWND hwndParent, const MCONTACT hContact, const wchar_t *pszText = 0, const CInfoPanel *panel = 0); ~CTip() { mir_free(m_pszText); } - void show(const RECT& rc, POINT& pt, const HICON hIcon = 0, const TCHAR *szTitle = 0); + void show(const RECT& rc, POINT& pt, const HICON hIcon = 0, const wchar_t *szTitle = 0); const HWND getHwnd() const { return(m_hwnd); } static void registerClass(); diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index 193be84d7b..d79da9851b 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -47,7 +47,7 @@ DURT CMimAPI::m_pfnDwmUnregisterThumbnail = 0; DSIT CMimAPI::m_pfnDwmSetIconicThumbnail = 0; DSILP CMimAPI::m_pfnDwmSetIconicLivePreviewBitmap = 0; bool CMimAPI::m_shutDown = 0; -TCHAR CMimAPI::m_userDir[] = L"\0"; +wchar_t CMimAPI::m_userDir[] = L"\0"; bool CMimAPI::m_haveBufferedPaint = false; @@ -88,10 +88,10 @@ int CMimAPI::FoldersPathChanged(WPARAM, LPARAM) void CMimAPI::configureCustomFolders() { - m_hDataPath = FoldersRegisterCustomPathT(LPGEN("TabSRMM"), LPGEN("Data path"), const_cast(getDataPath())); - m_hSkinsPath = FoldersRegisterCustomPathT(LPGEN("Skins"), LPGEN("TabSRMM"), const_cast(getSkinPath())); - m_hAvatarsPath = FoldersRegisterCustomPathT(LPGEN("Avatars"), LPGEN("Saved TabSRMM avatars"), const_cast(getSavedAvatarPath())); - m_hChatLogsPath = FoldersRegisterCustomPathT(LPGEN("TabSRMM"), LPGEN("Group chat logs root"), const_cast(getChatLogPath())); + m_hDataPath = FoldersRegisterCustomPathT(LPGEN("TabSRMM"), LPGEN("Data path"), const_cast(getDataPath())); + m_hSkinsPath = FoldersRegisterCustomPathT(LPGEN("Skins"), LPGEN("TabSRMM"), const_cast(getSkinPath())); + m_hAvatarsPath = FoldersRegisterCustomPathT(LPGEN("Avatars"), LPGEN("Saved TabSRMM avatars"), const_cast(getSavedAvatarPath())); + m_hChatLogsPath = FoldersRegisterCustomPathT(LPGEN("TabSRMM"), LPGEN("Group chat logs root"), const_cast(getChatLogPath())); if (m_hDataPath) HookEvent(ME_FOLDERS_PATH_CHANGED, CMimAPI::FoldersPathChanged); @@ -101,25 +101,25 @@ void CMimAPI::configureCustomFolders() INT_PTR CMimAPI::foldersPathChanged() { - TCHAR szTemp[MAX_PATH + 2]; + wchar_t szTemp[MAX_PATH + 2]; if (m_hDataPath) { szTemp[0] = 0; - FoldersGetCustomPathT(m_hDataPath, szTemp, MAX_PATH, const_cast(getDataPath())); - _tcsncpy_s(m_szProfilePath, szTemp, _TRUNCATE); + FoldersGetCustomPathT(m_hDataPath, szTemp, MAX_PATH, const_cast(getDataPath())); + wcsncpy_s(m_szProfilePath, szTemp, _TRUNCATE); szTemp[0] = 0; - FoldersGetCustomPathT(m_hSkinsPath, szTemp, MAX_PATH, const_cast(getSkinPath())); - _tcsncpy_s(m_szSkinsPath, (MAX_PATH - 1), szTemp, _TRUNCATE); + FoldersGetCustomPathT(m_hSkinsPath, szTemp, MAX_PATH, const_cast(getSkinPath())); + wcsncpy_s(m_szSkinsPath, (MAX_PATH - 1), szTemp, _TRUNCATE); Utils::ensureTralingBackslash(m_szSkinsPath); szTemp[0] = 0; - FoldersGetCustomPathT(m_hAvatarsPath, szTemp, MAX_PATH, const_cast(getSavedAvatarPath())); - _tcsncpy_s(m_szSavedAvatarsPath, szTemp, _TRUNCATE); + FoldersGetCustomPathT(m_hAvatarsPath, szTemp, MAX_PATH, const_cast(getSavedAvatarPath())); + wcsncpy_s(m_szSavedAvatarsPath, szTemp, _TRUNCATE); szTemp[0] = 0; - FoldersGetCustomPathT(m_hChatLogsPath, szTemp, MAX_PATH, const_cast(getChatLogPath())); - _tcsncpy_s(m_szChatLogsPath, (MAX_PATH - 1), szTemp, _TRUNCATE); + FoldersGetCustomPathT(m_hChatLogsPath, szTemp, MAX_PATH, const_cast(getChatLogPath())); + wcsncpy_s(m_szChatLogsPath, (MAX_PATH - 1), szTemp, _TRUNCATE); Utils::ensureTralingBackslash(m_szChatLogsPath); } @@ -132,13 +132,13 @@ INT_PTR CMimAPI::foldersPathChanged() return 0; } -const TCHAR* CMimAPI::getUserDir() +const wchar_t* CMimAPI::getUserDir() { if (m_userDir[0] == 0) { if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) - _tcsncpy_s(m_userDir, L"%miranda_userdata%", _TRUNCATE); + wcsncpy_s(m_userDir, L"%miranda_userdata%", _TRUNCATE); else - _tcsncpy_s(m_userDir, VARST(L"%miranda_userdata%"), _TRUNCATE); + wcsncpy_s(m_userDir, VARST(L"%miranda_userdata%"), _TRUNCATE); Utils::ensureTralingBackslash(m_userDir); } @@ -147,16 +147,16 @@ const TCHAR* CMimAPI::getUserDir() void CMimAPI::InitPaths() { - const TCHAR *szUserdataDir = getUserDir(); + const wchar_t *szUserdataDir = getUserDir(); mir_sntprintf(m_szProfilePath, L"%stabSRMM", szUserdataDir); if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) { - _tcsncpy_s(m_szChatLogsPath, L"%miranda_logpath%", _TRUNCATE); - _tcsncpy_s(m_szSkinsPath, L"%miranda_path%\\Skins\\TabSRMM", _TRUNCATE); + wcsncpy_s(m_szChatLogsPath, L"%miranda_logpath%", _TRUNCATE); + wcsncpy_s(m_szSkinsPath, L"%miranda_path%\\Skins\\TabSRMM", _TRUNCATE); } else { - _tcsncpy_s(m_szChatLogsPath, VARST(L"%miranda_logpath%"), _TRUNCATE); - _tcsncpy_s(m_szSkinsPath, VARST(L"%miranda_path%\\Skins\\TabSRMM"), _TRUNCATE); + wcsncpy_s(m_szChatLogsPath, VARST(L"%miranda_logpath%"), _TRUNCATE); + wcsncpy_s(m_szSkinsPath, VARST(L"%miranda_path%\\Skins\\TabSRMM"), _TRUNCATE); } Utils::ensureTralingBackslash(m_szChatLogsPath); @@ -298,7 +298,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode) } if (mode) { - TCHAR szTip[256]; + wchar_t szTip[256]; mir_sntprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0)); if (fShowOnClist && ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && M.GetByte(SRMSGMOD, "ShowTypingBalloon", 0)) { MIRANDASYSTRAYNOTIFY tn; @@ -320,7 +320,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode) cle.hIcon = PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING]; cle.pszService = "SRMsg/TypingMessage"; cle.ptszTooltip = szTip; - pcli->pfnAddEvent(&cle); + pcli->pfnAddEvent(&cle); } } return 0; @@ -411,7 +411,7 @@ int CMimAPI::DispatchNewEvent(WPARAM hContact, LPARAM hDbEvent) int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM hDbEvent) { - TCHAR szName[CONTAINER_NAMELEN + 1]; + wchar_t szName[CONTAINER_NAMELEN + 1]; DBEVENTINFO dbei = { sizeof(dbei) }; db_event_get(hDbEvent, &dbei); @@ -542,7 +542,7 @@ nowindowcreate: if (!(dbei.flags & DBEF_READ)) { UpdateTrayMenu(0, 0, dbei.szModule, NULL, hContact, 1); if (!nen_options.bTraySupport) { - TCHAR toolTip[256], *contactName; + wchar_t toolTip[256], *contactName; CLISTEVENT cle = {}; cle.hContact = hContact; @@ -553,7 +553,7 @@ nowindowcreate: contactName = pcli->pfnGetContactDisplayName(hContact, 0); mir_sntprintf(toolTip, TranslateT("Message from %s"), contactName); cle.ptszTooltip = toolTip; - pcli->pfnAddEvent(&cle); + pcli->pfnAddEvent(&cle); } tabSRMM_ShowPopup(hContact, hDbEvent, dbei.eventType, 0, 0, 0, dbei.szModule); } diff --git a/plugins/TabSRMM/src/mim.h b/plugins/TabSRMM/src/mim.h index c70aa767f6..8322326611 100644 --- a/plugins/TabSRMM/src/mim.h +++ b/plugins/TabSRMM/src/mim.h @@ -216,7 +216,7 @@ public: static bool m_shutDown, m_haveBufferedPaint; private: - TCHAR m_szProfilePath[MAX_PATH + 2], m_szSkinsPath[MAX_PATH + 2], m_szSavedAvatarsPath[MAX_PATH + 2], m_szChatLogsPath[MAX_PATH + 2]; + wchar_t m_szProfilePath[MAX_PATH + 2], m_szSkinsPath[MAX_PATH + 2], m_szSavedAvatarsPath[MAX_PATH + 2], m_szChatLogsPath[MAX_PATH + 2]; HMODULE m_hUxTheme, m_hDwmApi; bool m_isAero, m_DwmActive, m_isVsThemed; HANDLE m_hDataPath, m_hSkinsPath, m_hAvatarsPath, m_hChatLogsPath; @@ -231,7 +231,7 @@ private: void InitPaths(); private: - static TCHAR m_userDir[MAX_PATH + 2]; + static wchar_t m_userDir[MAX_PATH + 2]; }; extern CMimAPI M; diff --git a/plugins/TabSRMM/src/modplus.cpp b/plugins/TabSRMM/src/modplus.cpp index 907f802484..1fc829c606 100644 --- a/plugins/TabSRMM/src/modplus.cpp +++ b/plugins/TabSRMM/src/modplus.cpp @@ -40,7 +40,7 @@ #include "stdafx.h" -static TCHAR* getMenuEntry(int i) +static wchar_t* getMenuEntry(int i) { char MEntry[256]; mir_snprintf(MEntry, "MenuEntry_%u", i); @@ -59,7 +59,7 @@ static int RegisterCustomButton(WPARAM, LPARAM) bbd.dwDefPos = 200; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[3]; bbd.pszModuleName = "Tabmodplus"; - bbd.ptszTooltip = LPGENT("Insert [img] tag / surround selected text with [img][/img]"); + bbd.ptszTooltip = LPGENW("Insert [img] tag / surround selected text with [img][/img]"); return CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd); } @@ -74,14 +74,14 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam) bbd.pszModuleName = "Tabmodplus"; CallService(MS_BB_GETBUTTONSTATE, wParam, (LPARAM)&bbd); - TCHAR *pszText = L""; + wchar_t *pszText = L""; CHARRANGE cr; cr.cpMin = cr.cpMax = 0; SendDlgItemMessage(cbcd->hwndFrom, IDC_MESSAGE, EM_EXGETSEL, 0, (LPARAM)&cr); UINT textlenght = cr.cpMax - cr.cpMin; if (textlenght) { - pszText = (TCHAR*)mir_alloc((textlenght + 1)*sizeof(TCHAR)); - memset(pszText, 0, ((textlenght + 1) * sizeof(TCHAR))); + pszText = (wchar_t*)mir_alloc((textlenght + 1)*sizeof(wchar_t)); + memset(pszText, 0, ((textlenght + 1) * sizeof(wchar_t))); SendDlgItemMessage(cbcd->hwndFrom, IDC_MESSAGE, EM_GETSELTEXT, 0, (LPARAM)pszText); } @@ -95,7 +95,7 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam) else state = 4; - TCHAR *pszFormatedText = NULL, *pszMenu[256] = { 0 }; + wchar_t *pszFormatedText = NULL, *pszMenu[256] = { 0 }; size_t bufSize; @@ -118,7 +118,7 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam) break; bufSize = textlenght + mir_tstrlen(pszMenu[res - 1]) + 2; - pszFormatedText = (TCHAR*)_alloca(bufSize*sizeof(TCHAR)); + pszFormatedText = (wchar_t*)_alloca(bufSize*sizeof(wchar_t)); mir_sntprintf(pszFormatedText, bufSize, pszMenu[res - 1], pszText); } break; @@ -127,7 +127,7 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam) SendDlgItemMessage(cbcd->hwndFrom, IDC_MESSAGE, EM_GETSELTEXT, 0, (LPARAM)pszText); bufSize = textlenght + 12; - pszFormatedText = (TCHAR*)_alloca(bufSize*sizeof(TCHAR)); + pszFormatedText = (wchar_t*)_alloca(bufSize*sizeof(wchar_t)); mir_sntprintf(pszFormatedText, bufSize, L"[img]%s[/img]", pszText); bbd.ptszTooltip = 0; @@ -139,14 +139,14 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam) case 3: pszFormatedText = L"[img]"; - bbd.ptszTooltip = LPGENT("Insert [img] tag / surround selected text with [img][/img]"); + bbd.ptszTooltip = LPGENW("Insert [img] tag / surround selected text with [img][/img]"); CallService(MS_BB_SETBUTTONSTATE, wParam, (LPARAM)&bbd); break; case 4: pszFormatedText = L"[/img]"; - bbd.ptszTooltip = LPGENT("Insert [img] tag / surround selected text with [img][/img]"); + bbd.ptszTooltip = LPGENW("Insert [img] tag / surround selected text with [img][/img]"); CallService(MS_BB_SETBUTTONSTATE, wParam, (LPARAM)&bbd); break; } diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 83be1cc69e..529dac6ce1 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -30,9 +30,9 @@ #define MS_HTTPSERVER_ADDFILENAME "HTTPServer/AddFileName" -bool IsStringValidLink(TCHAR* pszText); +bool IsStringValidLink(wchar_t* pszText); -const TCHAR *pszIDCSAVE_close = 0, *pszIDCSAVE_save = 0; +const wchar_t *pszIDCSAVE_close = 0, *pszIDCSAVE_save = 0; static const UINT sendControls[] = { IDC_MESSAGE, IDC_LOG }; static const UINT formatControls[] = { IDC_SMILEYBTN, IDC_FONTBOLD, IDC_FONTITALIC, IDC_FONTUNDERLINE, IDC_FONTFACE, IDC_FONTSTRIKEOUT }; @@ -45,13 +45,13 @@ static COLORREF rtfDefColors[] = { RGB(255, 0, 0), RGB(0, 0, 255), RGB(0, 255, 0 static struct { int id; - const TCHAR* text; + const wchar_t* text; } tooltips[] = { - { IDC_ADD, LPGENT("Add this contact permanently to your contact list") }, - { IDC_CANCELADD, LPGENT("Do not add this contact permanently") }, - { IDC_TOGGLESIDEBAR, LPGENT("Expand or collapse the side bar") } + { IDC_ADD, LPGENW("Add this contact permanently to your contact list") }, + { IDC_CANCELADD, LPGENW("Do not add this contact permanently") }, + { IDC_TOGGLESIDEBAR, LPGENW("Expand or collapse the side bar") } }; static struct @@ -587,7 +587,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar HANDLE hClip = GetClipboardData(CF_TEXT); if (hClip) { if ((int)mir_strlen((char*)hClip) > mwdat->nMax) { - TCHAR szBuffer[512]; + wchar_t szBuffer[512]; if (M.GetByte("autosplit", 0)) mir_sntprintf(szBuffer, TranslateT("WARNING: The message you are trying to paste exceeds the message size limit for the active protocol. It will be sent in chunks of max %d characters"), mwdat->nMax - 10); else @@ -1189,7 +1189,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (dat->hContact && dat->szProto != NULL) { dat->wStatus = db_get_w(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE); - _tcsncpy_s(dat->szStatus, pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : dat->wStatus, 0), _TRUNCATE); + wcsncpy_s(dat->szStatus, pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : dat->wStatus, 0), _TRUNCATE); } else dat->wStatus = ID_STATUS_OFFLINE; @@ -1353,7 +1353,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l } if (newData->szInitialText) { if (newData->isWchar) - SetDlgItemTextW(hwndDlg, IDC_MESSAGE, (TCHAR*)newData->szInitialText); + SetDlgItemTextW(hwndDlg, IDC_MESSAGE, (wchar_t*)newData->szInitialText); else SetDlgItemTextA(hwndDlg, IDC_MESSAGE, newData->szInitialText); int len = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE)); @@ -2706,7 +2706,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l MEVENT hDBEvent = 0; if (dat->hwndIEView || dat->hwndHPP) { // IEView quoting support.. - TCHAR *selected = 0; + wchar_t *selected = 0; IEVIEWEVENT event = { sizeof(event) }; event.hContact = dat->hContact; @@ -2715,11 +2715,11 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (dat->hwndIEView) { event.hwnd = dat->hwndIEView; - selected = (TCHAR*)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&event); + selected = (wchar_t*)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&event); } else { event.hwnd = dat->hwndHPP; - selected = (TCHAR*)CallService(MS_HPP_EG_EVENT, 0, (LPARAM)&event); + selected = (wchar_t*)CallService(MS_HPP_EG_EVENT, 0, (LPARAM)&event); } if (selected != NULL) { @@ -2742,22 +2742,22 @@ quote_from_last: if (sel.cpMin == sel.cpMax) { DBEVENTINFO dbei = { sizeof(dbei) }; dbei.cbBlob = db_event_getBlobSize(hDBEvent); - TCHAR *szText = (TCHAR*)mir_alloc((dbei.cbBlob + 1) * sizeof(TCHAR)); //URLs are made one char bigger for crlf + wchar_t *szText = (wchar_t*)mir_alloc((dbei.cbBlob + 1) * sizeof(wchar_t)); //URLs are made one char bigger for crlf dbei.pBlob = (BYTE*)szText; db_event_get(hDBEvent, &dbei); int iSize = int(mir_strlen((char*)dbei.pBlob)) + 1; bool bNeedsFree = false; - TCHAR *szConverted; + wchar_t *szConverted; if (dbei.flags & DBEF_UTF) { szConverted = mir_utf8decodeW((char*)szText); bNeedsFree = true; } else { if (iSize != (int)dbei.cbBlob) - szConverted = (TCHAR*)&dbei.pBlob[iSize]; + szConverted = (wchar_t*)&dbei.pBlob[iSize]; else { - szConverted = (TCHAR*)mir_alloc(sizeof(TCHAR) * iSize); + szConverted = (wchar_t*)mir_alloc(sizeof(wchar_t) * iSize); bNeedsFree = true; MultiByteToWideChar(CP_ACP, 0, (char*)dbei.pBlob, -1, szConverted, iSize); } @@ -2768,7 +2768,7 @@ quote_from_last: memmove(szText + iDescr + 2, szText + sizeof(DWORD) + iDescr, dbei.cbBlob - iDescr - sizeof(DWORD)-1); szText[iDescr] = '\r'; szText[iDescr + 1] = '\n'; - szConverted = (TCHAR*)mir_alloc(sizeof(TCHAR)* (1 + mir_strlen((char *)szText))); + szConverted = (wchar_t*)mir_alloc(sizeof(wchar_t)* (1 + mir_strlen((char *)szText))); MultiByteToWideChar(CP_ACP, 0, (char *)szText, -1, szConverted, 1 + (int)mir_strlen((char *)szText)); bNeedsFree = true; } @@ -2871,15 +2871,15 @@ quote_from_last: return 0; // sent by the select container dialog box when a container was selected... - // lParam = (TCHAR*)selected name... + // lParam = (wchar_t*)selected name... case DM_CONTAINERSELECTED: { - TCHAR *szNewName = (TCHAR*)lParam; + wchar_t *szNewName = (wchar_t*)lParam; if (!mir_tstrcmp(szNewName, TranslateT("Default container"))) szNewName = CGlobals::m_default_container_name; int iOldItems = TabCtrl_GetItemCount(hwndTab); - if (!_tcsncmp(m_pContainer->szName, szNewName, CONTAINER_NAMELEN)) + if (!wcsncmp(m_pContainer->szName, szNewName, CONTAINER_NAMELEN)) break; TContainerData *pNewContainer = FindContainerByName(szNewName); @@ -3041,10 +3041,10 @@ quote_from_last: } if (dat->hContact != NULL) { - TCHAR szFilename[MAX_PATH]; + wchar_t szFilename[MAX_PATH]; HDROP hDrop = (HDROP)wParam; int fileCount = DragQueryFile(hDrop, -1, NULL, 0), totalCount = 0, i; - TCHAR** ppFiles = NULL; + wchar_t** ppFiles = NULL; for (i = 0; i < fileCount; i++) { DragQueryFile(hDrop, i, szFilename, _countof(szFilename)); Utils::AddToFileList(&ppFiles, &totalCount, szFilename); diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index d50f9b4374..f68dd7c692 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -77,7 +77,7 @@ void TSAPI RearrangeTab(HWND hwndDlg, const TWindowData *dat, int iMode, BOOL fS return; HWND hwndTab = GetParent(hwndDlg); - TCHAR oldText[512]; + wchar_t oldText[512]; TCITEM item = { 0 }; item.mask = TCIF_IMAGE | TCIF_TEXT | TCIF_PARAM; @@ -129,17 +129,17 @@ static UINT_PTR CALLBACK OpenFileSubclass(HWND hwnd, UINT msg, WPARAM, LPARAM lP static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic) { - TCHAR szFinalFilename[MAX_PATH]; + wchar_t szFinalFilename[MAX_PATH]; time_t t = time(NULL); struct tm *lt = localtime(&t); DWORD setView = 1; - TCHAR szTimestamp[100]; + wchar_t szTimestamp[100]; mir_sntprintf(szTimestamp, L"%04u %02u %02u_%02u%02u", lt->tm_year + 1900, lt->tm_mon, lt->tm_mday, lt->tm_hour, lt->tm_min); - TCHAR *szProto = mir_a2t(dat->cache->getActiveProto()); + wchar_t *szProto = mir_a2t(dat->cache->getActiveProto()); - TCHAR szFinalPath[MAX_PATH]; + wchar_t szFinalPath[MAX_PATH]; mir_sntprintf(szFinalPath, L"%s\\%s", M.getSavedAvatarPath(), szProto); mir_free(szProto); @@ -151,7 +151,7 @@ static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic) } } - TCHAR szBaseName[MAX_PATH]; + wchar_t szBaseName[MAX_PATH]; if (isOwnPic) mir_sntprintf(szBaseName, L"My Avatar_%s", szTimestamp); else @@ -162,7 +162,7 @@ static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic) // do not allow / or \ or % in the filename Utils::sanitizeFilename(szFinalFilename); - TCHAR filter[MAX_PATH]; + wchar_t filter[MAX_PATH]; mir_sntprintf(filter, L"%s%c*.bmp;*.png;*.jpg;*.gif%c%c", TranslateT("Image files"), 0, 0, 0); OPENFILENAME ofn = { 0 }; @@ -259,7 +259,7 @@ int TSAPI MsgWindowUpdateMenu(TWindowData *dat, HMENU submenu, int menuID) EnableMenuItem(submenu, ID_TABMENU_CLEARSAVEDTABPOSITION, (M.GetDword(dat->hContact, "tabindex", -1) != -1) ? MF_ENABLED : MF_GRAYED); } else if (menuID == MENU_PICMENU) { - TCHAR *szText = NULL; + wchar_t *szText = NULL; char avOverride = (char)M.GetByte(dat->hContact, "hideavatar", -1); HMENU visMenu = GetSubMenu(submenu, 0); BOOL picValid = bInfoPanel ? (dat->hOwnPic != 0) : (dat->ace && dat->ace->hbmPic && dat->ace->hbmPic != PluginConfig.g_hbmUnknown); @@ -424,7 +424,7 @@ int TSAPI MsgWindowMenuHandler(TWindowData *dat, int selection, int menuId) void TSAPI UpdateReadChars(const TWindowData *dat) { if (dat && (dat->pContainer->hwndStatus && dat->pContainer->hwndActive == dat->hwnd)) { - TCHAR buf[128]; + wchar_t buf[128]; int len; if (dat->bType == SESSIONTYPE_CHAT) @@ -441,7 +441,7 @@ void TSAPI UpdateReadChars(const TWindowData *dat) BOOL fCaps = (GetKeyState(VK_CAPITAL) & 1); BOOL fNum = (GetKeyState(VK_NUMLOCK) & 1); - TCHAR szBuf[20]; szBuf[0] = 0; + wchar_t szBuf[20]; szBuf[0] = 0; if (dat->fInsertMode) mir_tstrcat(szBuf, L"O"); if (fCaps) @@ -646,19 +646,19 @@ int TSAPI CheckValidSmileyPack(const char *szProto, MCONTACT hContact) ///////////////////////////////////////////////////////////////////////////////////////// // return value MUST be mir_free()'d by caller. -TCHAR* TSAPI QuoteText(const TCHAR *text) +wchar_t* TSAPI QuoteText(const wchar_t *text) { int outChar, lineChar; int iCharsPerLine = M.GetDword("quoteLineLength", 64); size_t bufSize = mir_wstrlen(text) + 23; - TCHAR *strout = (TCHAR*)mir_alloc(bufSize * sizeof(TCHAR)); + wchar_t *strout = (wchar_t*)mir_alloc(bufSize * sizeof(wchar_t)); int inChar = 0; int justDoneLineBreak = 1; for (outChar = 0, lineChar = 0; text[inChar];) { if (outChar >= bufSize - 8) { bufSize += 20; - strout = (TCHAR*)mir_realloc(strout, bufSize * sizeof(TCHAR)); + strout = (wchar_t*)mir_realloc(strout, bufSize * sizeof(wchar_t)); } if (justDoneLineBreak && text[inChar] != '\r' && text[inChar] != '\n') { strout[outChar++] = '>'; @@ -832,31 +832,31 @@ char* TSAPI Message_GetFromStream(HWND hwndRtf, DWORD dwPassedFlags) return pszText; // pszText contains the text } -static TCHAR tszRtfBreaks[] = L" \\\n\r"; +static wchar_t tszRtfBreaks[] = L" \\\n\r"; static void CreateColorMap(CMString &Text, int iCount, COLORREF *pSrc, int *pDst) { - const TCHAR *pszText = Text; + const wchar_t *pszText = Text; int iIndex = 1; - static const TCHAR *lpszFmt = L"\\red%[^ \x5b\\]\\green%[^ \x5b\\]\\blue%[^ \x5b;];"; - TCHAR szRed[10], szGreen[10], szBlue[10]; + static const wchar_t *lpszFmt = L"\\red%[^ \x5b\\]\\green%[^ \x5b\\]\\blue%[^ \x5b;];"; + wchar_t szRed[10], szGreen[10], szBlue[10]; - const TCHAR *p1 = _tcsstr(pszText, L"\\colortbl"); + const wchar_t *p1 = wcsstr(pszText, L"\\colortbl"); if (!p1) return; - const TCHAR *pEnd = _tcschr(p1, '}'); + const wchar_t *pEnd = wcschr(p1, '}'); - const TCHAR *p2 = _tcsstr(p1, L"\\red"); + const wchar_t *p2 = wcsstr(p1, L"\\red"); for (int i = 0; i < iCount; i++) pDst[i] = -1; while (p2 && p2 < pEnd) { - if (_stscanf(p2, lpszFmt, &szRed, &szGreen, &szBlue) > 0) { + if (swscanf(p2, lpszFmt, &szRed, &szGreen, &szBlue) > 0) { for (int i = 0; i < iCount; i++) { - if (pSrc[i] == RGB(_ttoi(szRed), _ttoi(szGreen), _ttoi(szBlue))) + if (pSrc[i] == RGB(_wtoi(szRed), _wtoi(szGreen), _wtoi(szBlue))) pDst[i] = iIndex; } } @@ -864,7 +864,7 @@ static void CreateColorMap(CMString &Text, int iCount, COLORREF *pSrc, int *pDst p1 = p2; p1++; - p2 = _tcsstr(p1, L"\\red"); + p2 = wcsstr(p1, L"\\red"); } } @@ -907,7 +907,7 @@ BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors CMString res; // iterate through all characters, if rtf control character found then take action - for (const TCHAR *p = pszText.GetString() + idx; *p;) { + for (const wchar_t *p = pszText.GetString() + idx; *p;) { switch (*p) { case '\\': if (p[1] == '\\' || p[1] == '{' || p[1] == '}') { // escaped characters @@ -919,8 +919,8 @@ BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors p += 2; break; } - if (!_tcsncmp(p, L"\\cf", 3)) { // foreground color - int iCol = _ttoi(p + 3); + if (!wcsncmp(p, L"\\cf", 3)) { // foreground color + int iCol = _wtoi(p + 3); int iInd = GetRtfIndex(iCol, iNumColors, pIndex); if (iCol && dat->bType != SESSIONTYPE_CHAT) @@ -928,85 +928,85 @@ BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors bInsideColor = iInd > 0; } - else if (!_tcsncmp(p, L"\\highlight", 10)) { //background color - TCHAR szTemp[20]; - int iCol = _ttoi(p + 10); + else if (!wcsncmp(p, L"\\highlight", 10)) { //background color + wchar_t szTemp[20]; + int iCol = _wtoi(p + 10); mir_sntprintf(szTemp, L"%d", iCol); } - else if (!_tcsncmp(p, L"\\line", 5)) { // soft line break; + else if (!wcsncmp(p, L"\\line", 5)) { // soft line break; res.AppendChar('\n'); } - else if (!_tcsncmp(p, L"\\endash", 7)) { + else if (!wcsncmp(p, L"\\endash", 7)) { res.AppendChar(0x2013); } - else if (!_tcsncmp(p, L"\\emdash", 7)) { + else if (!wcsncmp(p, L"\\emdash", 7)) { res.AppendChar(0x2014); } - else if (!_tcsncmp(p, L"\\bullet", 7)) { + else if (!wcsncmp(p, L"\\bullet", 7)) { res.AppendChar(0x2022); } - else if (!_tcsncmp(p, L"\\ldblquote", 10)) { + else if (!wcsncmp(p, L"\\ldblquote", 10)) { res.AppendChar(0x201C); } - else if (!_tcsncmp(p, L"\\rdblquote", 10)) { + else if (!wcsncmp(p, L"\\rdblquote", 10)) { res.AppendChar(0x201D); } - else if (!_tcsncmp(p, L"\\lquote", 7)) { + else if (!wcsncmp(p, L"\\lquote", 7)) { res.AppendChar(0x2018); } - else if (!_tcsncmp(p, L"\\rquote", 7)) { + else if (!wcsncmp(p, L"\\rquote", 7)) { res.AppendChar(0x2019); } - else if (!_tcsncmp(p, L"\\b", 2)) { //bold + else if (!wcsncmp(p, L"\\b", 2)) { //bold if (!(lf.lfWeight == FW_BOLD)) // only allow bold if the font itself isn't a bold one, otherwise just strip it.. if (dat->SendFormat) res.Append((p[2] != '0') ? L"[b]" : L"[/b]"); } - else if (!_tcsncmp(p, L"\\i", 2)) { // italics + else if (!wcsncmp(p, L"\\i", 2)) { // italics if (!lf.lfItalic && dat->SendFormat) res.Append((p[2] != '0') ? L"[i]" : L"[/i]"); } - else if (!_tcsncmp(p, L"\\strike", 7)) { // strike-out + else if (!wcsncmp(p, L"\\strike", 7)) { // strike-out if (!lf.lfStrikeOut && dat->SendFormat) res.Append((p[7] != '0') ? L"[s]" : L"[/s]"); } - else if (!_tcsncmp(p, L"\\ul", 3)) { // underlined + else if (!wcsncmp(p, L"\\ul", 3)) { // underlined if (!lf.lfUnderline && dat->SendFormat) { - if (p[3] == 0 || _tcschr(tszRtfBreaks, p[3])) { + if (p[3] == 0 || wcschr(tszRtfBreaks, p[3])) { res.Append(L"[u]"); bInsideUl = true; } - else if (!_tcsnccmp(p + 3, L"none", 4)) { + else if (!wcsncmp(p + 3, L"none", 4)) { if (bInsideUl) res.Append(L"[/u]"); bInsideUl = false; } } } - else if (!_tcsncmp(p, L"\\tab", 4)) { // tab + else if (!wcsncmp(p, L"\\tab", 4)) { // tab res.AppendChar('\t'); } else if (p[1] == '\'') { // special character if (p[2] != ' ' && p[2] != '\\') { - TCHAR tmp[10]; + wchar_t tmp[10]; if (p[3] != ' ' && p[3] != '\\') { - _tcsncpy(tmp, p + 2, 3); + wcsncpy(tmp, p + 2, 3); tmp[3] = 0; } else { - _tcsncpy(tmp, p + 2, 2); + wcsncpy(tmp, p + 2, 2); tmp[2] = 0; } // convert string containing char in hex format to int. - TCHAR *stoppedHere; - res.AppendChar(_tcstol(tmp, &stoppedHere, 16)); + wchar_t *stoppedHere; + res.AppendChar(wcstol(tmp, &stoppedHere, 16)); } } p++; // skip initial slash - p += _tcscspn(p, tszRtfBreaks); + p += wcscspn(p, tszRtfBreaks); if (*p == ' ') p++; break; @@ -1039,7 +1039,7 @@ void TSAPI GetMYUIN(TWindowData *dat) { ptrT uid(Contact_GetInfo(CNF_DISPLAYUID, NULL, dat->cache->getActiveProto())); if (uid != NULL) - _tcsncpy_s(dat->myUin, uid, _TRUNCATE); + wcsncpy_s(dat->myUin, uid, _TRUNCATE); else dat->myUin[0] = 0; } @@ -1249,9 +1249,9 @@ void TSAPI GetSendFormat(TWindowData *dat) // // GetLocaleInfo() should no longer be used on Vista and later -void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName) +void TSAPI GetLocaleID(TWindowData *dat, const wchar_t *szKLName) { - TCHAR szLI[256], *stopped = NULL; + wchar_t szLI[256], *stopped = NULL; USHORT langID; WORD wCtype2[3]; PARAFORMAT2 pf2; @@ -1261,34 +1261,34 @@ void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName) szLI[0] = szLI[1] = 0; memset(&pf2, 0, sizeof(PARAFORMAT2)); - langID = (USHORT)_tcstol(szKLName, &stopped, 16); + langID = (USHORT)wcstol(szKLName, &stopped, 16); dat->lcid = MAKELCID(langID, 0); /* * Vista+: read ISO locale names from the registry */ if (PluginConfig.m_bIsVista) { HKEY hKey = 0; - TCHAR szKey[20]; - DWORD dwLID = _tcstoul(szKLName, &stopped, 16); + wchar_t szKey[20]; + DWORD dwLID = wcstoul(szKLName, &stopped, 16); mir_sntprintf(szKey, L"%04.04x", LOWORD(dwLID)); if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, L"MIME\\Database\\Rfc1766", 0, KEY_READ, &hKey)) { DWORD dwLength = 255; if (ERROR_SUCCESS == RegQueryValueEx(hKey, szKey, 0, 0, (unsigned char *)szLI, &dwLength)) { - TCHAR* p; + wchar_t* p; szLI[255] = 0; - if ((p = _tcschr(szLI, ';')) != 0) + if ((p = wcschr(szLI, ';')) != 0) *p = 0; } RegCloseKey(hKey); } - szLI[0] = _totupper(szLI[0]); - szLI[1] = _totupper(szLI[1]); + szLI[0] = towupper(szLI[0]); + szLI[1] = towupper(szLI[1]); } else { GetLocaleInfo(dat->lcid, LOCALE_SISO639LANGNAME, szLI, 10); - _tcsupr(szLI); + wcsupr(szLI); } fLocaleNotSet = (dat->lcID[0] == 0 && dat->lcID[1] == 0); mir_sntprintf(dat->lcID, szLI); @@ -1557,7 +1557,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM, LPARAM lParam, TWindowData *dat) } if (dis->hwndItem == GetDlgItem(hwndDlg, IDC_STATICTEXT) || dis->hwndItem == GetDlgItem(hwndDlg, IDC_LOGFROZENTEXT)) { - TCHAR szWindowText[256]; + wchar_t szWindowText[256]; if (CSkin::m_skinEnabled) { SetTextColor(dis->hDC, CSkin::m_DefaultFontColor); CSkin::SkinDrawBG(dis->hwndItem, dat->pContainer->hwnd, dat->pContainer, &dis->rcItem, dis->hDC); @@ -1737,11 +1737,11 @@ void TSAPI GetMyNick(TWindowData *dat) ptrT tszNick(Contact_GetInfo(CNF_NICK, NULL, dat->cache->getActiveProto())); if (tszNick != NULL) { if (mir_tstrlen(tszNick) == 0 || !mir_tstrcmp(tszNick, TranslateT("'(Unknown contact)'"))) - _tcsncpy_s(dat->szMyNickname, (dat->myUin[0] ? dat->myUin : TranslateT("'(Unknown contact)'")), _TRUNCATE); + wcsncpy_s(dat->szMyNickname, (dat->myUin[0] ? dat->myUin : TranslateT("'(Unknown contact)'")), _TRUNCATE); else - _tcsncpy_s(dat->szMyNickname, tszNick, _TRUNCATE); + wcsncpy_s(dat->szMyNickname, tszNick, _TRUNCATE); } - else _tcsncpy_s(dat->szMyNickname, L"", _TRUNCATE); // same here + else wcsncpy_s(dat->szMyNickname, L"", _TRUNCATE); // same here } HICON TSAPI MY_GetContactIcon(const TWindowData *dat, LPCSTR szSetting) @@ -1849,14 +1849,14 @@ LONG TSAPI GetDefaultMinimumInputHeight(const TWindowData *dat) return(height); } -static LIST vTempFilenames(5); +static LIST vTempFilenames(5); // send a pasted bitmap by file transfer. void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp) { const wchar_t* mirandatempdir = L"Miranda"; const wchar_t* filenametemplate = L"\\clp-%Y%m%d-%H%M%S0.jpg"; - TCHAR filename[MAX_PATH]; + wchar_t filename[MAX_PATH]; size_t tempdirlen = GetTempPath(MAX_PATH, filename); bool fSend = true; @@ -1899,7 +1899,7 @@ void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp) time(&rawtime); const tm* timeinfo; timeinfo = _localtime32((__time32_t *)&rawtime); - _tcsftime(filename + tempdirlen, MAX_PATH - tempdirlen, filenametemplate, timeinfo); + wcsftime(filename + tempdirlen, MAX_PATH - tempdirlen, filenametemplate, timeinfo); size_t firstnumberpos = tempdirlen + 14; size_t lastnumberpos = tempdirlen + 20; while (GetFileAttributes(filename) != INVALID_FILE_ATTRIBUTES) { // while it exists @@ -1916,7 +1916,7 @@ void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp) } if (filename[0] == 0) { // prompting to save - TCHAR filter[MAX_PATH]; + wchar_t filter[MAX_PATH]; mir_sntprintf(filter, L"%s%c*.jpg%c%c", TranslateT("JPEG-compressed images"), 0, 0, 0); OPENFILENAME dlg; @@ -1940,7 +1940,7 @@ void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp) CallService(MS_IMG_SAVE, (WPARAM)&ii, IMGL_TCHAR); int totalCount = 0; - TCHAR **ppFiles = NULL; + wchar_t **ppFiles = NULL; Utils::AddToFileList(&ppFiles, &totalCount, filename); wchar_t* _t = mir_tstrdup(filename); diff --git a/plugins/TabSRMM/src/msgdlgutils.h b/plugins/TabSRMM/src/msgdlgutils.h index 7b6c84ebb5..1d7610caca 100644 --- a/plugins/TabSRMM/src/msgdlgutils.h +++ b/plugins/TabSRMM/src/msgdlgutils.h @@ -38,7 +38,7 @@ bool TSAPI GetAvatarVisibility(HWND hwndDlg, TWindowData *dat); void TSAPI ProcessAvatarChange(HWND hwnd, LPARAM lParam); void TSAPI UpdateStatusBar(const TWindowData *dat); int TSAPI CheckValidSmileyPack(const char *szProto, MCONTACT hContact); -TCHAR* TSAPI QuoteText(const TCHAR *text); +wchar_t* TSAPI QuoteText(const wchar_t *text); void TSAPI UpdateReadChars(const TWindowData *dat); void TSAPI ShowPicture(TWindowData *dat, BOOL showNewPic); void TSAPI AdjustBottomAvatarDisplay(TWindowData *dat); @@ -55,7 +55,7 @@ void TSAPI SaveSplitter(TWindowData *dat); void TSAPI LoadSplitter(TWindowData *dat); void TSAPI PlayIncomingSound(const TWindowData *dat); void TSAPI GetSendFormat(TWindowData *dat); -void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName); +void TSAPI GetLocaleID(TWindowData *dat, const wchar_t *szKLName); void TSAPI LoadOwnAvatar(TWindowData *dat); void TSAPI LoadContactAvatar(TWindowData *dat); void TSAPI LoadTimeZone(TWindowData *dat); @@ -64,7 +64,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat void TSAPI LoadOverrideTheme(TContainerData *pContainer); void TSAPI LoadThemeDefaults(TContainerData *pContainer); void TSAPI ConfigureSmileyButton(TWindowData *dat); -int TSAPI CutContactName(const TCHAR *szold, TCHAR *sznew, size_t size); +int TSAPI CutContactName(const wchar_t *szold, wchar_t *sznew, size_t size); void TSAPI SendNudge(const TWindowData *dat); void TSAPI EnableSendButton(const TWindowData *dat, int iMode); LRESULT TSAPI GetSendButtonState(HWND hwnd); diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index 52d7273605..8abd3a071b 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -29,41 +29,41 @@ #include "stdafx.h" struct TCpTable cpTable[] = { - { 874, LPGENT("Thai") }, - { 932, LPGENT("Japanese") }, - { 936, LPGENT("Simplified Chinese") }, - { 949, LPGENT("Korean") }, - { 950, LPGENT("Traditional Chinese") }, - { 1250, LPGENT("Central European") }, - { 1251, LPGENT("Cyrillic") }, - { 20866, LPGENT("Cyrillic KOI8-R") }, - { 1252, LPGENT("Latin I") }, - { 1253, LPGENT("Greek") }, - { 1254, LPGENT("Turkish") }, - { 1255, LPGENT("Hebrew") }, - { 1256, LPGENT("Arabic") }, - { 1257, LPGENT("Baltic") }, - { 1258, LPGENT("Vietnamese") }, - { 1361, LPGENT("Korean (Johab)") }, + { 874, LPGENW("Thai") }, + { 932, LPGENW("Japanese") }, + { 936, LPGENW("Simplified Chinese") }, + { 949, LPGENW("Korean") }, + { 950, LPGENW("Traditional Chinese") }, + { 1250, LPGENW("Central European") }, + { 1251, LPGENW("Cyrillic") }, + { 20866, LPGENW("Cyrillic KOI8-R") }, + { 1252, LPGENW("Latin I") }, + { 1253, LPGENW("Greek") }, + { 1254, LPGENW("Turkish") }, + { 1255, LPGENW("Hebrew") }, + { 1256, LPGENW("Arabic") }, + { 1257, LPGENW("Baltic") }, + { 1258, LPGENW("Vietnamese") }, + { 1361, LPGENW("Korean (Johab)") }, { (UINT)-1, NULL } }; -wchar_t* weekDays[7] = { LPGENT("Sunday"), LPGENT("Monday"), LPGENT("Tuesday"), LPGENT("Wednesday"), LPGENT("Thursday"), LPGENT("Friday"), LPGENT("Saturday") }; +wchar_t* weekDays[7] = { LPGENW("Sunday"), LPGENW("Monday"), LPGENW("Tuesday"), LPGENW("Wednesday"), LPGENW("Thursday"), LPGENW("Friday"), LPGENW("Saturday") }; wchar_t* months[12] = { - LPGENT("January"), LPGENT("February"), LPGENT("March"), LPGENT("April"), LPGENT("May"), LPGENT("June"), - LPGENT("July"), LPGENT("August"), LPGENT("September"), LPGENT("October"), LPGENT("November"), LPGENT("December") + LPGENW("January"), LPGENW("February"), LPGENW("March"), LPGENW("April"), LPGENW("May"), LPGENW("June"), + LPGENW("July"), LPGENW("August"), LPGENW("September"), LPGENW("October"), LPGENW("November"), LPGENW("December") }; static time_t today; int g_groupBreak = TRUE; -static TCHAR *szMyName = NULL; -static TCHAR *szYourName = NULL; +static wchar_t *szMyName = NULL; +static wchar_t *szYourName = NULL; static int logPixelSY; -static TCHAR szToday[22], szYesterday[22]; +static wchar_t szToday[22], szYesterday[22]; char rtfFontsGlobal[MSGDLGFONTCOUNT + 2][RTFCACHELINESIZE]; char *rtfFonts; @@ -107,7 +107,7 @@ __forceinline char *GetRTFFont(DWORD dwIndex) * the highlight code (individual background colors). * Doesn't touch the message for sure, but empty lines at the end are ugly anyway. */ -static void TrimMessage(TCHAR *msg) +static void TrimMessage(wchar_t *msg) { size_t iLen = mir_tstrlen(msg) - 1; size_t i = iLen; @@ -132,8 +132,8 @@ void TSAPI CacheLogFonts() } mir_snprintf(rtfFontsGlobal[MSGDLGFONTCOUNT], "\\f%u\\cf%u\\b%d\\i%d\\fs%u", MSGDLGFONTCOUNT, MSGDLGFONTCOUNT, 0, 0, 0); - _tcsncpy(szToday, TranslateT("Today"), 20); - _tcsncpy(szYesterday, TranslateT("Yesterday"), 20); + wcsncpy(szToday, TranslateT("Today"), 20); + wcsncpy(szYesterday, TranslateT("Yesterday"), 20); szToday[19] = szYesterday[19] = 0; // cache/create the info panel fonts @@ -198,14 +198,14 @@ static int TSAPI GetColorIndex(char *rtffont) return 0; } -static int AppendUnicodeToBuffer(CMStringA &str, const TCHAR *line, int mode) +static int AppendUnicodeToBuffer(CMStringA &str, const wchar_t *line, int mode) { str.Append("{\\uc1 "); int textCharsCount = 0; for (; *line; line++, textCharsCount++) { if (*line == 127 && line[1] != 0) { - TCHAR code = line[2]; + wchar_t code = line[2]; if (((code == '0' || code == '1') && line[3] == ' ') || (line[1] == 'c' && code == 'x')) { int begin = (code == '1'); switch (line[1]) { @@ -336,7 +336,7 @@ static char* CreateRTFHeader(TWindowData *dat) return str.Detach(); } -static void AppendTimeStamp(TCHAR *szFinalTimestamp, int isSent, CMStringA &str, int skipFont, TWindowData *dat, int iFontIDOffset) +static void AppendTimeStamp(wchar_t *szFinalTimestamp, int isSent, CMStringA &str, int skipFont, TWindowData *dat, int iFontIDOffset) { if (skipFont) AppendUnicodeToBuffer(str, szFinalTimestamp, MAKELONG(isSent, dat->bIsHistory)); @@ -347,14 +347,14 @@ static void AppendTimeStamp(TCHAR *szFinalTimestamp, int isSent, CMStringA &str, } } -static TCHAR* Template_MakeRelativeDate(HANDLE hTimeZone, time_t check, TCHAR code) +static wchar_t* Template_MakeRelativeDate(HANDLE hTimeZone, time_t check, wchar_t code) { - static TCHAR szResult[100]; - const TCHAR *szFormat; + static wchar_t szResult[100]; + const wchar_t *szFormat; - if ((code == (TCHAR)'R' || code == (TCHAR)'r') && check >= today) + if ((code == (wchar_t)'R' || code == (wchar_t)'r') && check >= today) mir_tstrcpy(szResult, szToday); - else if ((code == (TCHAR)'R' || code == (TCHAR)'r') && check > (today - 86400)) + else if ((code == (wchar_t)'R' || code == (wchar_t)'r') && check > (today - 86400)) mir_tstrcpy(szResult, szYesterday); else { if (code == 'D' || code == 'R') @@ -419,14 +419,14 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, if (dbei.eventType == EVENTTYPE_MESSAGE && !dbei.markedRead()) dat->cache->updateStats(TSessionStats::SET_LAST_RCV, mir_strlen((char *)dbei.pBlob)); - TCHAR *formatted = NULL; - TCHAR *msg = DbGetEventTextT(&dbei, CP_UTF8); + wchar_t *formatted = NULL; + wchar_t *msg = DbGetEventTextT(&dbei, CP_UTF8); if (!msg) { mir_free(dbei.pBlob); return NULL; } TrimMessage(msg); - formatted = const_cast(Utils::FormatRaw(dat, msg, dwFormattingParams, FALSE)); + formatted = const_cast(Utils::FormatRaw(dat, msg, dwFormattingParams, FALSE)); mir_free(msg); CMStringA str; @@ -501,7 +501,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, TTemplateSet *this_templateset = dbei.flags & DBEF_RTL ? dat->pContainer->rtl_templates : dat->pContainer->ltr_templates; - TCHAR *szTemplate; + wchar_t *szTemplate; if (bIsStatusChangeEvent) szTemplate = this_templateset->szTemplates[TMPL_STATUSCHG]; else if (dbei.eventType == EVENTTYPE_ERRMSG) @@ -529,9 +529,9 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, str.Append("\\ul0\\b0\\i0\\v0 "); for (size_t i = 0; i < iTemplateLen;) { - TCHAR ci = szTemplate[i]; + wchar_t ci = szTemplate[i]; if (ci == '%') { - TCHAR cc = szTemplate[i + 1]; + wchar_t cc = szTemplate[i + 1]; skipToNext = FALSE; skipFont = FALSE; @@ -584,7 +584,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, } } - TCHAR color, code; + wchar_t color, code; switch (cc) { case 'V': //str.Append("\\fs0\\\expnd-40 ~-%d-~", hDbEvent); @@ -615,14 +615,14 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, break; case 'D': // long date if (showTime && showDate) { - TCHAR *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, 'D'); + wchar_t *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, 'D'); AppendTimeStamp(szFinalTimestamp, isSent, str, skipFont, dat, iFontIDOffset); } else skipToNext = TRUE; break; case 'E': // short date... if (showTime && showDate) { - TCHAR *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, 'E'); + wchar_t *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, 'E'); AppendTimeStamp(szFinalTimestamp, isSent, str, skipFont, dat, iFontIDOffset); } else skipToNext = TRUE; @@ -721,7 +721,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, case 'R': case 'r': // long date if (showTime && showDate) { - TCHAR *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, cc); + wchar_t *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, cc); AppendTimeStamp(szFinalTimestamp, isSent, str, skipFont, dat, iFontIDOffset); } else skipToNext = TRUE; @@ -729,7 +729,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, case 't': case 'T': if (showTime) { - TCHAR *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, (TCHAR)((dwEffectiveFlags & MWF_LOG_SHOWSECONDS) ? cc : (TCHAR)'t')); + wchar_t *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, (wchar_t)((dwEffectiveFlags & MWF_LOG_SHOWSECONDS) ? cc : (wchar_t)'t')); AppendTimeStamp(szFinalTimestamp, isSent, str, skipFont, dat, iFontIDOffset); } else skipToNext = TRUE; @@ -830,7 +830,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, if (*szDescr != 0) { ptrT tszDescr(DbGetEventStringT(&dbei, szDescr)); - TCHAR buf[1000]; + wchar_t buf[1000]; mir_sntprintf(buf, L"%s (%s)", tszFileName, tszDescr); AppendUnicodeToBuffer(str, buf, 0); } @@ -1035,7 +1035,7 @@ static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppe { DWORD dwScale = M.GetDword("iconscale", 0); - TCHAR trbuffer[40]; + wchar_t trbuffer[40]; TEXTRANGE tr; tr.lpstrText = trbuffer; @@ -1062,8 +1062,8 @@ static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppe cr.cpMax = cr.cpMin + 18; SendMessage(hwndrtf, EM_EXSETSEL, 0, (LPARAM)&cr); SendMessage(hwndrtf, EM_REPLACESEL, FALSE, (LPARAM)L""); - UINT length = (unsigned int)_ttol(&trbuffer[7]); - int index = _ttol(&trbuffer[14]); + UINT length = (unsigned int)_wtol(&trbuffer[7]); + int index = _wtol(&trbuffer[14]); if (length > 0 && length < 20000 && index >= RTF_CTABLE_DEFSIZE && index < Utils::rtf_ctable_size) { cf2.crTextColor = Utils::rtf_ctable[index].clr; cr.cpMin = fi.chrgText.cpMin; @@ -1234,7 +1234,7 @@ void TSAPI StreamInEvents(HWND hwndDlg, MEVENT hDbEventFirst, int count, int fAp if (dat->szMicroLf[0] == 0) SetupLogFormatting(dat); - szYourName = const_cast(dat->cache->getNick()); + szYourName = const_cast(dat->cache->getNick()); szMyName = dat->szMyNickname; SendMessage(hwndrtf, EM_HIDESELECTION, TRUE, 0); diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index 9cb53d4b0c..4928636933 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -93,16 +93,16 @@ static HWND hwndTabConfig = 0; // // [Global]/Name property is new in TabSRMM version 3. -static int TSAPI ScanSkinDir(const TCHAR* tszFolder, HWND hwndCombobox) +static int TSAPI ScanSkinDir(const wchar_t* tszFolder, HWND hwndCombobox) { bool fValid = false; - TCHAR tszMask[MAX_PATH]; + wchar_t tszMask[MAX_PATH]; mir_sntprintf(tszMask, L"%s*.*", tszFolder); WIN32_FIND_DATA fd = { 0 }; HANDLE h = FindFirstFile(tszMask, &fd); while (h != INVALID_HANDLE_VALUE) { - if (mir_tstrlen(fd.cFileName) >= 5 && !_tcsnicmp(fd.cFileName + mir_tstrlen(fd.cFileName) - 4, L".tsk", 4)) { + if (mir_tstrlen(fd.cFileName) >= 5 && !wcsnicmp(fd.cFileName + mir_tstrlen(fd.cFileName) - 4, L".tsk", 4)) { fValid = true; break; } @@ -113,21 +113,21 @@ static int TSAPI ScanSkinDir(const TCHAR* tszFolder, HWND hwndCombobox) FindClose(h); if (fValid) { - TCHAR tszFinalName[MAX_PATH], tszRel[MAX_PATH]; + wchar_t tszFinalName[MAX_PATH], tszRel[MAX_PATH]; LRESULT lr; - TCHAR szBuf[255]; + wchar_t szBuf[255]; mir_sntprintf(tszFinalName, L"%s%s", tszFolder, fd.cFileName); GetPrivateProfileString(L"Global", L"Name", L"None", szBuf, _countof(szBuf), tszFinalName); if (!mir_tstrcmp(szBuf, L"None")) { fd.cFileName[mir_tstrlen(fd.cFileName) - 4] = 0; - _tcsncpy_s(szBuf, fd.cFileName, _TRUNCATE); + wcsncpy_s(szBuf, fd.cFileName, _TRUNCATE); } PathToRelativeT(tszFinalName, tszRel, M.getSkinPath()); if ((lr = SendMessage(hwndCombobox, CB_INSERTSTRING, -1, (LPARAM)szBuf)) != CB_ERR) { - TCHAR *idata = (TCHAR*)mir_alloc((mir_tstrlen(tszRel) + 1) * sizeof(TCHAR)); + wchar_t *idata = (wchar_t*)mir_alloc((mir_tstrlen(tszRel) + 1) * sizeof(wchar_t)); mir_tstrcpy(idata, tszRel); SendMessage(hwndCombobox, CB_SETITEMDATA, lr, (LPARAM)idata); @@ -149,8 +149,8 @@ static int TSAPI RescanSkins(HWND hwndCombobox) { DBVARIANT dbv = { 0 }; - TCHAR tszSkinRoot[MAX_PATH], tszFindMask[MAX_PATH]; - _tcsncpy_s(tszSkinRoot, M.getSkinPath(), _TRUNCATE); + wchar_t tszSkinRoot[MAX_PATH], tszFindMask[MAX_PATH]; + wcsncpy_s(tszSkinRoot, M.getSkinPath(), _TRUNCATE); SetDlgItemText(GetParent(hwndCombobox), IDC_SKINROOTFOLDER, tszSkinRoot); mir_sntprintf(tszFindMask, L"%s*.*", tszSkinRoot); @@ -162,7 +162,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox) HANDLE h = FindFirstFile(tszFindMask, &fd); while (h != INVALID_HANDLE_VALUE) { if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY && fd.cFileName[0] != '.') { - TCHAR tszSubDir[MAX_PATH]; + wchar_t tszSubDir[MAX_PATH]; mir_sntprintf(tszSubDir, L"%s%s\\", tszSkinRoot, fd.cFileName); ScanSkinDir(tszSubDir, hwndCombobox); } @@ -176,8 +176,8 @@ static int TSAPI RescanSkins(HWND hwndCombobox) if (0 == db_get_ts(0, SRMSGMOD_T, "ContainerSkin", &dbv)) { LRESULT lr = SendMessage(hwndCombobox, CB_GETCOUNT, 0, 0); for (int i = 1; i < lr; i++) { - TCHAR *idata = (TCHAR*)SendMessage(hwndCombobox, CB_GETITEMDATA, i, 0); - if (idata && idata != (TCHAR*)CB_ERR) { + wchar_t *idata = (wchar_t*)SendMessage(hwndCombobox, CB_GETITEMDATA, i, 0); + if (idata && idata != (wchar_t*)CB_ERR) { if (!mir_tstrcmpi(dbv.ptszVal, idata)) { SendMessage(hwndCombobox, CB_SETCURSEL, i, 0); break; @@ -291,7 +291,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L case IDC_THEMEEXPORT: { - const TCHAR *szFilename = GetThemeFileName(1); + const wchar_t *szFilename = GetThemeFileName(1); if (szFilename != NULL) WriteThemeToINI(szFilename, 0); } @@ -342,8 +342,8 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L if (HIWORD(wParam) == CBN_SELCHANGE) { LRESULT lr = SendDlgItemMessage(hwndDlg, IDC_SKINNAME, CB_GETCURSEL, 0, 0); if (lr != CB_ERR && lr > 0) { - TCHAR *tszRelPath = (TCHAR*)SendDlgItemMessage(hwndDlg, IDC_SKINNAME, CB_GETITEMDATA, lr, 0); - if (tszRelPath && tszRelPath != (TCHAR*)CB_ERR) + wchar_t *tszRelPath = (wchar_t*)SendDlgItemMessage(hwndDlg, IDC_SKINNAME, CB_GETITEMDATA, lr, 0); + if (tszRelPath && tszRelPath != (wchar_t*)CB_ERR) db_set_ts(0, SRMSGMOD_T, "ContainerSkin", tszRelPath); SendMessage(hwndDlg, WM_COMMAND, IDC_RELOADSKIN, 0); } diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 657c3643ec..1301f3af80 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -281,7 +281,7 @@ static INT_PTR ReadMessageCommand(WPARAM, LPARAM lParam) if (hwndExisting != 0) SendMessage(hwndExisting, DM_ACTIVATEME, 0, 0); else { - TCHAR szName[CONTAINER_NAMELEN + 1]; + wchar_t szName[CONTAINER_NAMELEN + 1]; GetContainerNameForContact(hContact, szName, CONTAINER_NAMELEN); TContainerData *pContainer = FindContainerByName(szName); if (pContainer == NULL) @@ -330,7 +330,7 @@ INT_PTR SendMessageCommand_Worker(MCONTACT hContact, LPCSTR pszMsg, bool isWchar SendMessage(hwnd, DM_ACTIVATEME, 0, 0); } else { - TCHAR szName[CONTAINER_NAMELEN + 1]; + wchar_t szName[CONTAINER_NAMELEN + 1]; GetContainerNameForContact(hContact, szName, CONTAINER_NAMELEN); TContainerData *pContainer = FindContainerByName(szName); @@ -473,7 +473,7 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, } // if we have a max # of tabs/container set and want to open something in the default container... - if (hContact != 0 && M.GetByte("limittabs", 0) && !_tcsncmp(pContainer->szName, L"default", 6)) + if (hContact != 0 && M.GetByte("limittabs", 0) && !wcsncmp(pContainer->szName, L"default", 6)) if ((pContainer = FindMatchingContainer(L"default")) == NULL) if ((pContainer = CreateContainer(L"default", CNT_CREATEFLAG_CLONED, hContact)) == NULL) return 0; @@ -487,21 +487,21 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, memset(&newData.item, 0, sizeof(newData.item)); // obtain various status information about the contact - TCHAR *contactName = pcli->pfnGetContactDisplayName(newData.hContact, 0); + wchar_t *contactName = pcli->pfnGetContactDisplayName(newData.hContact, 0); // cut nickname if larger than x chars... - TCHAR newcontactname[128], tabtitle[128]; + wchar_t newcontactname[128], tabtitle[128]; if (contactName && mir_tstrlen(contactName) > 0) { if (M.GetByte("cuttitle", 0)) CutContactName(contactName, newcontactname, _countof(newcontactname)); else - _tcsncpy_s(newcontactname, contactName, _TRUNCATE); + wcsncpy_s(newcontactname, contactName, _TRUNCATE); Utils::DoubleAmpersands(newcontactname, _countof(newcontactname)); } - else _tcsncpy_s(newcontactname, L"_U_", _TRUNCATE); + else wcsncpy_s(newcontactname, L"_U_", _TRUNCATE); - TCHAR *szStatus = pcli->pfnGetStatusModeDescription(szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE), 0); + wchar_t *szStatus = pcli->pfnGetStatusModeDescription(szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE), 0); if (M.GetByte("tabstatus", 1)) mir_sntprintf(tabtitle, L"%s (%s) ", newcontactname, szStatus); @@ -618,13 +618,13 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, // it searches a container with "room" for the new tabs or otherwise creates // a new (cloned) one. -TContainerData* TSAPI FindMatchingContainer(const TCHAR *szName) +TContainerData* TSAPI FindMatchingContainer(const wchar_t *szName) { int iMaxTabs = M.GetDword("maxtabs", 0); - if (iMaxTabs > 0 && M.GetByte("limittabs", 0) && !_tcsncmp(szName, L"default", 6)) { + if (iMaxTabs > 0 && M.GetByte("limittabs", 0) && !wcsncmp(szName, L"default", 6)) { // search a "default" with less than iMaxTabs opened... for (TContainerData *p = pFirstContainer; p; p = p->pNext) - if (!_tcsncmp(p->szName, L"default", 6) && p->iChilds < iMaxTabs) + if (!wcsncmp(p->szName, L"default", 6) && p->iChilds < iMaxTabs) return p; return NULL; @@ -800,8 +800,8 @@ static int TSAPI SetupIconLibConfig() { int j = 2, version = 0; - TCHAR szFilename[MAX_PATH]; - _tcsncpy(szFilename, L"icons\\tabsrmm_icons.dll", MAX_PATH); + wchar_t szFilename[MAX_PATH]; + wcsncpy(szFilename, L"icons\\tabsrmm_icons.dll", MAX_PATH); g_hIconDLL = LoadLibrary(szFilename); if (g_hIconDLL == 0) { CWarning::show(CWarning::WARN_ICONPACKMISSING, CWarning::CWF_NOALLOWHIDE | MB_ICONERROR | MB_OK); @@ -815,7 +815,7 @@ static int TSAPI SetupIconLibConfig() g_hIconDLL = 0; SKINICONDESC sid = { 0 }; - sid.defaultFile.t = szFilename; + sid.defaultFile.w = szFilename; sid.flags = SIDF_PATH_TCHAR; for (int n = 0; n < _countof(ICONBLOCKS); n++) { @@ -838,7 +838,7 @@ static int TSAPI SetupIconLibConfig() sid.iDefaultIndex = -IDI_CLOCK; IcoLib_AddIcon(&sid); - _tcsncpy(szFilename, L"plugins\\tabsrmm.dll", MAX_PATH); + wcsncpy(szFilename, L"plugins\\tabsrmm.dll", MAX_PATH); sid.pszName = "tabSRMM_overlay_disabled"; sid.description.a = LPGEN("Feature disabled (used as overlay)"); @@ -1068,7 +1068,7 @@ STDMETHODIMP CREOleCallback::GetInPlaceContext(LPOLEINPLACEFRAME*, LPOLEINPLACEU STDMETHODIMP CREOleCallback::GetNewStorage(LPSTORAGE *lplpstg) { - TCHAR sztName[64]; + wchar_t sztName[64]; mir_sntprintf(sztName, L"s%u", nextStgId++); if (pictStg == NULL) return STG_E_MEDIUMFULL; diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index e096eae9ec..b58246c00e 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -113,7 +113,7 @@ struct TTemplateSet { BOOL valid; // all templates populated (may still contain crap.. so it's only half-assed safety :) - TCHAR szTemplates[TMPL_ERRMSG + 1][TEMPLATE_LENGTH]; // the template strings + wchar_t szTemplates[TMPL_ERRMSG + 1][TEMPLATE_LENGTH]; // the template strings char szSetName[20]; // everything in this world needs a name. so does this poor template set. }; @@ -161,7 +161,7 @@ struct TContainerSettings DWORD dwTransparency; DWORD panelheight; DWORD splitterPos; - TCHAR szTitleFormat[TITLE_FORMATLEN + 2]; + wchar_t szTitleFormat[TITLE_FORMATLEN + 2]; WORD avatarMode; WORD ownAvatarMode; WORD autoCloseSeconds; @@ -174,7 +174,7 @@ struct TContainerData { TContainerData *pNext; - TCHAR szName[CONTAINER_NAMELEN + 4]; // container name + wchar_t szName[CONTAINER_NAMELEN + 4]; // container name HWND hwndActive; // active message window HWND hwnd; // the container handle int iTabIndex; // next tab id @@ -198,7 +198,7 @@ struct TContainerData DWORD dwFlashingStarted; HWND hWndOptions; BOOL bSizingLoop; - TCHAR szRelThemeFile[MAX_PATH], szAbsThemeFile[MAX_PATH]; + wchar_t szRelThemeFile[MAX_PATH], szAbsThemeFile[MAX_PATH]; TTemplateSet *ltr_templates, *rtl_templates; HDC cachedDC; HBITMAP cachedHBM, oldHBM; @@ -239,11 +239,11 @@ struct TWindowData DWORD dwFlagsEx; MCONTACT hContact; char *szProto; - TCHAR szMyNickname[130]; - TCHAR szStatusBar[100]; + wchar_t szMyNickname[130]; + wchar_t szStatusBar[100]; StatusTextData *sbCustom; - TCHAR newtitle[130]; // tab title... - TCHAR szStatus[50]; + wchar_t newtitle[130]; // tab title... + wchar_t szStatus[50]; WORD wStatus; char *sendBuffer; size_t iSendBufferSize; @@ -287,14 +287,14 @@ struct TWindowData int iOpenJobs; int iCurrentQueueError; MEVENT hFlashingEvent; - TCHAR myUin[80]; + wchar_t myUin[80]; int SendFormat; MEVENT *hQueuedEvents; int iNextQueuedEvent; #define EVENT_QUEUE_SIZE 10 int iEventQueueSize; LCID lcid; - TCHAR lcID[10]; + wchar_t lcID[10]; int iPanelAvatarX, iPanelAvatarY; DWORD idle; HWND hwndTip; @@ -370,8 +370,8 @@ struct TIconDesc struct TIconDescW { - TCHAR *szName; - TCHAR *szDesc; + wchar_t *szName; + wchar_t *szDesc; HICON *phIcon; // where the handle is saved... INT_PTR uId; // icon ID BOOL bForceSmall; // true: force 16x16 @@ -754,7 +754,7 @@ struct TLogIcon { struct TCpTable { UINT cpId; - TCHAR *cpName; + wchar_t *cpName; }; #define LOI_TYPE_FLAG 1 @@ -762,12 +762,12 @@ struct TCpTable { struct TOptionListGroup { LRESULT handle; - TCHAR *szName; + wchar_t *szName; }; struct TOptionListItem { LRESULT handle; - TCHAR *szName; + wchar_t *szName; UINT id; UINT uType; UINT_PTR lParam; @@ -797,10 +797,10 @@ struct SIDEBARITEM { UINT uId; DWORD dwFlags; HICON *hIcon, *hIconPressed, *hIconHover; - TCHAR *szName; + wchar_t *szName; void(*pfnAction)(ButtonItem *item, HWND hwndDlg, TWindowData *dat, HWND hwndItem); void(*pfnCallback)(ButtonItem *item, HWND hwndDlg, TWindowData *dat, HWND hwndItem); - TCHAR *tszTip; + wchar_t *tszTip; }; #define FONTF_BOLD 1 @@ -971,7 +971,7 @@ void CheckStatusIconClick(TWindowData *dat, POINT pt, const RECT &rc, int gap, i struct SKINDESC { ULONG ulID; // resource id - TCHAR tszName[30]; + wchar_t tszName[30]; }; #define SKIN_NR_ELEMENTS 6 diff --git a/plugins/TabSRMM/src/nen.h b/plugins/TabSRMM/src/nen.h index 04cd1a7a70..ac0ab76372 100644 --- a/plugins/TabSRMM/src/nen.h +++ b/plugins/TabSRMM/src/nen.h @@ -133,7 +133,7 @@ struct NEN_OPTIONS struct EVENT_DATAT { MEVENT hEvent; - TCHAR tszText[MAX_SECONDLINE + 2]; + wchar_t tszText[MAX_SECONDLINE + 2]; DWORD timestamp; }; diff --git a/plugins/TabSRMM/src/selectcontainer.cpp b/plugins/TabSRMM/src/selectcontainer.cpp index b743ef8868..d52a25f738 100644 --- a/plugins/TabSRMM/src/selectcontainer.cpp +++ b/plugins/TabSRMM/src/selectcontainer.cpp @@ -36,7 +36,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L switch (msg) { case WM_INITDIALOG: { - TCHAR szNewTitle[128]; + wchar_t szNewTitle[128]; RECT rc, rcParent; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); @@ -65,7 +65,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: { - TCHAR szName[CONTAINER_NAMELEN]; + wchar_t szName[CONTAINER_NAMELEN]; LRESULT iItem; if ((iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETCURSEL, 0, 0)) != LB_ERR) { @@ -81,12 +81,12 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L DestroyWindow(hwndDlg); break; case IDC_DELETECONTAINER: { - TCHAR szName[CONTAINER_NAMELEN + 1]; + wchar_t szName[CONTAINER_NAMELEN + 1]; LRESULT iItem; if ((iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETCURSEL, 0, 0)) != LB_ERR) { SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szName); - if (!_tcsncmp(szName, L"default", CONTAINER_NAMELEN) || !_tcsncmp(szName, TranslateT("Default container"), CONTAINER_NAMELEN)) + if (!wcsncmp(szName, L"default", CONTAINER_NAMELEN) || !wcsncmp(szName, TranslateT("Default container"), CONTAINER_NAMELEN)) MessageBox(hwndDlg, TranslateT("You cannot delete the default container"), TranslateT("Error"), MB_OK | MB_ICONERROR); else { int iIndex = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETITEMDATA, (WPARAM)iItem, 0); @@ -99,18 +99,18 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L break; } case IDC_RENAMECONTAINER: { - TCHAR szNewName[CONTAINER_NAMELEN], szName[CONTAINER_NAMELEN + 1]; + wchar_t szNewName[CONTAINER_NAMELEN], szName[CONTAINER_NAMELEN + 1]; int iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_NEWCONTAINERNAME)); if (iLen) { GetDlgItemText(hwndDlg, IDC_NEWCONTAINERNAME, szNewName, _countof(szNewName)); - if (!_tcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN) || !_tcsncmp(szNewName, TranslateT("Default container"), CONTAINER_NAMELEN)) { + if (!wcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN) || !wcsncmp(szNewName, TranslateT("Default container"), CONTAINER_NAMELEN)) { MessageBox(hwndDlg, TranslateT("You cannot rename the default container"), TranslateT("Error"), MB_OK | MB_ICONERROR); break; } int iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_FINDSTRING, (WPARAM)-1, (LPARAM)szNewName); if (iItem != LB_ERR) { - TCHAR szOldName[CONTAINER_NAMELEN + 1]; + wchar_t szOldName[CONTAINER_NAMELEN + 1]; SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szOldName); if (mir_tstrlen(szOldName) == mir_tstrlen(szNewName)) { MessageBox(0, TranslateT("This name is already in use"), TranslateT("Error"), MB_OK | MB_ICONERROR); @@ -120,15 +120,15 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L } if ((iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETCURSEL, 0, 0)) != LB_ERR) { SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szName); - if (!_tcsncmp(szName, L"default", CONTAINER_NAMELEN) || !_tcsncmp(szName, TranslateT("Default container"), CONTAINER_NAMELEN)) + if (!wcsncmp(szName, L"default", CONTAINER_NAMELEN) || !wcsncmp(szName, TranslateT("Default container"), CONTAINER_NAMELEN)) MessageBox(hwndDlg, TranslateT("You cannot rename the default container"), TranslateT("Error"), MB_OK | MB_ICONERROR); else { int iIndex = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETITEMDATA, (WPARAM)iItem, 0); RenameContainer(iIndex, szNewName); SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_RESETCONTENT, 0, 0); for (TContainerData *p = pFirstContainer; p; p = p->pNext) { - if (!_tcsncmp(p->szName, szName, CONTAINER_NAMELEN) && mir_tstrlen(p->szName) == mir_tstrlen(szName)) { - _tcsncpy(p->szName, szNewName, CONTAINER_NAMELEN); + if (!wcsncmp(p->szName, szName, CONTAINER_NAMELEN) && mir_tstrlen(p->szName) == mir_tstrlen(szName)) { + wcsncpy(p->szName, szNewName, CONTAINER_NAMELEN); SendMessage(p->hwnd, DM_CONFIGURECONTAINER, 0, 0); } } @@ -140,15 +140,15 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L break; } case IDC_CREATENEW: { - TCHAR szNewName[CONTAINER_NAMELEN], szName[CONTAINER_NAMELEN + 1]; + wchar_t szNewName[CONTAINER_NAMELEN], szName[CONTAINER_NAMELEN + 1]; int iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_NEWCONTAINER)); if (iLen) { GetDlgItemText(hwndDlg, IDC_NEWCONTAINER, szNewName, _countof(szNewName)); int iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_FINDSTRING, (WPARAM)-1, (LPARAM)szNewName); - if (iItem != LB_ERR || !_tcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) { + if (iItem != LB_ERR || !wcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) { SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szName); - if (mir_tstrlen(szName) == mir_tstrlen(szNewName) || !_tcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) { + if (mir_tstrlen(szName) == mir_tstrlen(szNewName) || !wcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) { MessageBox(0, TranslateT("This name is already in use"), TranslateT("Error"), MB_OK | MB_ICONERROR); SetFocus(GetDlgItem(hwndDlg, IDC_NEWCONTAINER)); break; @@ -182,7 +182,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L if (db_get_ts(NULL, szKey, szValue, &dbv)) break; // end of list if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR) { - if (_tcsncmp(dbv.ptszVal, L"**mir_free**", CONTAINER_NAMELEN)) { + if (wcsncmp(dbv.ptszVal, L"**mir_free**", CONTAINER_NAMELEN)) { iItemNew = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_ADDSTRING, 0, (LPARAM)(!mir_tstrcmp(dbv.ptszVal, L"default") ? TranslateT("Default container") : dbv.ptszVal)); if (iItemNew != LB_ERR) diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index 1c74331fa1..e52fb5adb0 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -116,12 +116,12 @@ CSendLaterJob::~CSendLaterJob() * show a popup notification, unless they are disabled */ if (PluginConfig.g_bPopupAvail && fShowPopup) { - TCHAR *tszName = pcli->pfnGetContactDisplayName(hContact, 0); + wchar_t *tszName = pcli->pfnGetContactDisplayName(hContact, 0); POPUPDATAT ppd = { 0 }; ppd.lchContact = hContact; - _tcsncpy_s(ppd.lptzContactName, (tszName ? tszName : TranslateT("'(Unknown contact)'")), _TRUNCATE); - TCHAR *msgPreview = Utils::GetPreviewWithEllipsis(reinterpret_cast(&pBuf[mir_strlen((char *)pBuf) + 1]), 100); + wcsncpy_s(ppd.lptzContactName, (tszName ? tszName : TranslateT("'(Unknown contact)'")), _TRUNCATE); + wchar_t *msgPreview = Utils::GetPreviewWithEllipsis(reinterpret_cast(&pBuf[mir_strlen((char *)pBuf) + 1]), 100); if (fSuccess) { mir_sntprintf(ppd.lptzText, TranslateT("A send later job completed successfully.\nThe original message: %s"), msgPreview); @@ -479,7 +479,7 @@ void CSendLater::qMgrUpdate(bool fReEnable) } } -LRESULT CSendLater::qMgrAddFilter(const MCONTACT hContact, const TCHAR* tszNick) +LRESULT CSendLater::qMgrAddFilter(const MCONTACT hContact, const wchar_t* tszNick) { LRESULT lr = ::SendMessage(m_hwndFilter, CB_FINDSTRING, 0, LPARAM(tszNick)); if (lr == CB_ERR) { @@ -495,7 +495,7 @@ LRESULT CSendLater::qMgrAddFilter(const MCONTACT hContact, const TCHAR* tszNick) // filters by m_hFilter (contact handle) void CSendLater::qMgrFillList(bool fClear) { - TCHAR *formatTime = L"%Y.%m.%d - %H:%M"; + wchar_t *formatTime = L"%Y.%m.%d - %H:%M"; if (fClear) { ::SendMessage(m_hwndList, LVM_DELETEALLITEMS, 0, 0); @@ -515,14 +515,14 @@ void CSendLater::qMgrFillList(bool fClear) CSendLaterJob *p = m_sendLaterJobList[i]; CContactCache *c = CContactCache::getContactCache(p->hContact); if (c) { - const TCHAR *tszNick = c->getNick(); + const wchar_t *tszNick = c->getNick(); if (m_hFilter && m_hFilter != p->hContact) { qMgrAddFilter(c->getContact(), tszNick); continue; } lvItem.mask = LVIF_TEXT | LVIF_PARAM; - TCHAR tszBuf[255]; + wchar_t tszBuf[255]; mir_sntprintf(tszBuf, L"%s [%s]", tszNick, c->getRealAccount()); lvItem.pszText = tszBuf; lvItem.cchTextMax = _countof(tszBuf); @@ -533,22 +533,22 @@ void CSendLater::qMgrFillList(bool fClear) qMgrAddFilter(c->getContact(), tszNick); lvItem.mask = LVIF_TEXT; - TCHAR tszTimestamp[30]; - _tcsftime(tszTimestamp, 30, formatTime, _localtime32((__time32_t *)&p->created)); + wchar_t tszTimestamp[30]; + wcsftime(tszTimestamp, 30, formatTime, _localtime32((__time32_t *)&p->created)); tszTimestamp[29] = 0; lvItem.pszText = tszTimestamp; lvItem.iSubItem = 1; ::SendMessage(m_hwndList, LVM_SETITEM, 0, LPARAM(&lvItem)); - TCHAR *msg = mir_utf8decodeT(p->sendBuffer); - TCHAR *preview = Utils::GetPreviewWithEllipsis(msg, 255); + wchar_t *msg = mir_utf8decodeT(p->sendBuffer); + wchar_t *preview = Utils::GetPreviewWithEllipsis(msg, 255); lvItem.pszText = preview; lvItem.iSubItem = 2; ::SendMessage(m_hwndList, LVM_SETITEM, 0, LPARAM(&lvItem)); mir_free(preview); mir_free(msg); - const TCHAR *tszStatusText = 0; + const wchar_t *tszStatusText = 0; if (p->fFailed) { tszStatusText = p->bCode == CSendLaterJob::JOB_REMOVABLE ? TranslateT("Removed") : TranslateT("Failed"); @@ -574,7 +574,7 @@ void CSendLater::qMgrFillList(bool fClear) if (p->bCode) bCode = p->bCode; - TCHAR tszStatus[20]; + wchar_t tszStatus[20]; mir_sntprintf(tszStatus, L"X/%s[%c] (%d)", tszStatusText, bCode, p->iSendCount); tszStatus[0] = p->szId[0]; lvItem.pszText = tszStatus; @@ -582,9 +582,9 @@ void CSendLater::qMgrFillList(bool fClear) ::SendMessage(m_hwndList, LVM_SETITEM, 0, LPARAM(&lvItem)); if (p->lastSent == 0) - _tcsncpy_s(tszTimestamp, L"Never", _TRUNCATE); + wcsncpy_s(tszTimestamp, L"Never", _TRUNCATE); else { - _tcsftime(tszTimestamp, 30, formatTime, _localtime32((__time32_t *)&p->lastSent)); + wcsftime(tszTimestamp, 30, formatTime, _localtime32((__time32_t *)&p->lastSent)); tszTimestamp[29] = 0; } lvItem.pszText = tszTimestamp; @@ -807,7 +807,7 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM job->writeFlags(); break; case ID_QUEUEMANAGER_COPYMESSAGETOCLIPBOARD: - Utils::CopyToClipBoard((TCHAR*)ptrT(mir_utf8decodeT(job->sendBuffer)), m_hwndDlg); + Utils::CopyToClipBoard((wchar_t*)ptrT(mir_utf8decodeT(job->sendBuffer)), m_hwndDlg); break; case ID_QUEUEMANAGER_RESETSELECTED: if (job->bCode == CSendLaterJob::JOB_DEFERRED) { diff --git a/plugins/TabSRMM/src/sendlater.h b/plugins/TabSRMM/src/sendlater.h index f187eb1581..76ab17e89f 100644 --- a/plugins/TabSRMM/src/sendlater.h +++ b/plugins/TabSRMM/src/sendlater.h @@ -124,7 +124,7 @@ private: void qMgrFillList(bool fClear = true); void qMgrSetupColumns(); void qMgrSaveColumns(); - LRESULT qMgrAddFilter(const MCONTACT hContact, const TCHAR* tszNick); + LRESULT qMgrAddFilter(const MCONTACT hContact, const wchar_t* tszNick); LIST m_sendLaterContactList; LIST m_sendLaterJobList; diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index d04b2e621b..b7a6f80f5a 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -49,10 +49,10 @@ void SendQueue::handleError(TWindowData *dat, const int iEntry) const { if (!dat) return; - TCHAR szErrorMsg[500]; + wchar_t szErrorMsg[500]; dat->iCurrentQueueError = iEntry; - _tcsncpy_s(szErrorMsg, m_jobs[iEntry].szErrorMsg, _TRUNCATE); + wcsncpy_s(szErrorMsg, m_jobs[iEntry].szErrorMsg, _TRUNCATE); logError(dat, iEntry, szErrorMsg); recallFailed(dat, iEntry); showErrorControls(dat, TRUE); @@ -218,7 +218,7 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry) } if (iSendLength >= iMinLength) { - TCHAR tszError[256]; + wchar_t tszError[256]; mir_sntprintf(tszError, TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), iMinLength); ::SendMessage(dat->hwnd, DM_ACTIVATETOOLTIP, IDC_MESSAGE, LPARAM(tszError)); sendQueue->clearJob(iEntry); @@ -270,7 +270,7 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry) m_jobs[iEntry].iStatus = SQ_INPROGRESS; m_jobs[iEntry].iAcksNeeded = 1; if (dat->sendMode & SMODE_SENDLATER) { - TCHAR tszError[256]; + wchar_t tszError[256]; size_t iSendLength = getSendLength(iEntry); if (iSendLength >= dat->nMax) { @@ -344,7 +344,7 @@ void SendQueue::checkQueue(const TWindowData *dat) const // logs an error message to the message window.Optionally, appends the original message // from the given sendJob (queue index) -void SendQueue::logError(const TWindowData *dat, int iSendJobIndex, const TCHAR *szErrMsg) const +void SendQueue::logError(const TWindowData *dat, int iSendJobIndex, const wchar_t *szErrMsg) const { if (dat == 0) return; @@ -473,8 +473,8 @@ void SendQueue::NotifyDeliveryFailure(const TWindowData *dat) POPUPDATAT ppd = { 0 }; ppd.lchContact = dat->hContact; - _tcsncpy_s(ppd.lptzContactName, dat->cache->getNick(), _TRUNCATE); - _tcsncpy_s(ppd.lptzText, TranslateT("A message delivery has failed.\nClick to open the message window."), _TRUNCATE); + wcsncpy_s(ppd.lptzContactName, dat->cache->getNick(), _TRUNCATE); + wcsncpy_s(ppd.lptzText, TranslateT("A message delivery has failed.\nClick to open the message window."), _TRUNCATE); if (!(BOOL)M.GetByte(MODULE, OPT_COLDEFAULT_ERR, TRUE)) { ppd.colorText = (COLORREF)M.GetDword(MODULE, OPT_COLTEXT_ERR, DEFAULT_COLTEXT); @@ -543,7 +543,7 @@ int SendQueue::ackMessage(TWindowData *dat, WPARAM wParam, LPARAM lParam) if (!nen_options.iNoSounds && !(m_pContainer->dwFlags & CNT_NOSOUND)) SkinPlaySound("SendError"); - TCHAR *szAckMsg = mir_a2t((char *)ack->lParam); + wchar_t *szAckMsg = mir_a2t((char *)ack->lParam); mir_sntprintf(job.szErrorMsg, TranslateT("Delivery failure: %s"), szAckMsg); job.iStatus = SQ_ERROR; mir_free(szAckMsg); @@ -642,7 +642,7 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, MCONTACT hContact, b { bool fAvail = sendLater->isAvail(); - const TCHAR *szNote = 0; + const wchar_t *szNote = 0; if (fIsSendLater && dat) { if (fAvail) @@ -677,12 +677,12 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, MCONTACT hContact, b if (iJobIndex >= 0 && iJobIndex < NR_SENDJOBS) { SendJob *job = &m_jobs[iJobIndex]; char szKeyName[20]; - TCHAR tszHeader[150]; + wchar_t tszHeader[150]; if (fIsSendLater) { time_t now = time(0); - TCHAR tszTimestamp[30]; - _tcsftime(tszTimestamp, _countof(tszTimestamp), L"%Y.%m.%d - %H:%M", _localtime32((__time32_t *)&now)); + wchar_t tszTimestamp[30]; + wcsftime(tszTimestamp, _countof(tszTimestamp), L"%Y.%m.%d - %H:%M", _localtime32((__time32_t *)&now)); mir_snprintf(szKeyName, "S%d", now); mir_sntprintf(tszHeader, TranslateT("\n(Sent delayed. Original timestamp %s)"), tszTimestamp); } diff --git a/plugins/TabSRMM/src/sendqueue.h b/plugins/TabSRMM/src/sendqueue.h index c6b736638b..48b92a8e29 100644 --- a/plugins/TabSRMM/src/sendqueue.h +++ b/plugins/TabSRMM/src/sendqueue.h @@ -50,7 +50,7 @@ struct SendJob MCONTACT hContact; HWND hOwnerWnd; unsigned iStatus; - TCHAR szErrorMsg[128]; + wchar_t szErrorMsg[128]; DWORD dwFlags; int iAcksNeeded; HANDLE hEventSplit; @@ -91,7 +91,7 @@ public: int sendQueued(TWindowData *dat, const int iEntry); size_t getSendLength(const int iEntry); void checkQueue(const TWindowData *dat) const; - void logError(const TWindowData *dat, int iSendJobIndex, const TCHAR *szErrMsg) const; + void logError(const TWindowData *dat, int iSendJobIndex, const wchar_t *szErrMsg) const; void recallFailed(const TWindowData *dat, int iEntry) const; void showErrorControls(TWindowData *dat, const int showCmd) const; int ackMessage(TWindowData *dat, WPARAM wParam, LPARAM lParam); diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp index dfce840e74..908b4b59d0 100644 --- a/plugins/TabSRMM/src/sidebar.cpp +++ b/plugins/TabSRMM/src/sidebar.cpp @@ -30,7 +30,7 @@ TSideBarLayout CSideBar::m_layouts[CSideBar::NR_LAYOUTS] = { { - LPGENT("Like tabs, vertical text orientation"), + LPGENW("Like tabs, vertical text orientation"), 26, 30, SIDEBARLAYOUT_DYNHEIGHT | SIDEBARLAYOUT_VERTICALORIENTATION, CSideBar::m_DefaultContentRenderer, @@ -40,7 +40,7 @@ TSideBarLayout CSideBar::m_layouts[CSideBar::NR_LAYOUTS] = { SIDEBARLAYOUT_VERTICAL }, { - LPGENT("Compact layout, horizontal buttons"), + LPGENW("Compact layout, horizontal buttons"), 100, 24, 0, CSideBar::m_DefaultContentRenderer, @@ -50,7 +50,7 @@ TSideBarLayout CSideBar::m_layouts[CSideBar::NR_LAYOUTS] = { SIDEBARLAYOUT_NORMAL }, { - LPGENT("Advanced layout with avatars"), + LPGENW("Advanced layout with avatars"), 140, 40, SIDEBARLAYOUT_NOCLOSEBUTTONS, CSideBar::m_AdvancedContentRenderer, @@ -60,7 +60,7 @@ TSideBarLayout CSideBar::m_layouts[CSideBar::NR_LAYOUTS] = { SIDEBARLAYOUT_NORMAL }, { - LPGENT("Advanced with avatars, vertical orientation"), + LPGENW("Advanced with avatars, vertical orientation"), 40, 40, SIDEBARLAYOUT_DYNHEIGHT | SIDEBARLAYOUT_VERTICALORIENTATION | SIDEBARLAYOUT_NOCLOSEBUTTONS, CSideBar::m_AdvancedContentRenderer, @@ -140,11 +140,11 @@ const SIZE& CSideBarButton::measureItem() m_sideBarLayout->pfnMeasureItem(this); // use the current layout's function, if available, else use default else { HDC dc = ::GetDC(m_hwnd); - TCHAR tszLabel[255]; + wchar_t tszLabel[255]; HFONT oldFont = reinterpret_cast(::SelectObject(dc, ::GetStockObject(DEFAULT_GUI_FONT))); - _tcsncpy_s(tszLabel, m_dat->newtitle, _TRUNCATE); + wcsncpy_s(tszLabel, m_dat->newtitle, _TRUNCATE); ::GetTextExtentPoint32(dc, tszLabel, (int)mir_tstrlen(tszLabel), &sz); sz.cx += 28; diff --git a/plugins/TabSRMM/src/sidebar.h b/plugins/TabSRMM/src/sidebar.h index 35d147f96a..4f848f289b 100644 --- a/plugins/TabSRMM/src/sidebar.h +++ b/plugins/TabSRMM/src/sidebar.h @@ -38,7 +38,7 @@ struct TSideBarNotify struct TSideBarLayout { - TCHAR szName[50]; // everything wants a name... + wchar_t szName[50]; // everything wants a name... LONG width; // width of the switchbar element (a single button) LONG height; // height of a single switchbar element DWORD dwFlags; // flags, obviously :) diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp index 9250052093..78ec8e47da 100644 --- a/plugins/TabSRMM/src/srmm.cpp +++ b/plugins/TabSRMM/src/srmm.cpp @@ -141,10 +141,10 @@ int _DebugTraceW(const wchar_t *fmt, ...) * can display the message either as systray notification (baloon popup) or using the * popup plugin. */ -int _DebugPopup(MCONTACT hContact, const TCHAR *fmt, ...) +int _DebugPopup(MCONTACT hContact, const wchar_t *fmt, ...) { va_list va; - TCHAR debug[1024]; + wchar_t debug[1024]; int ibsize = 1023; va_start(va, fmt); @@ -152,7 +152,7 @@ int _DebugPopup(MCONTACT hContact, const TCHAR *fmt, ...) if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) { MIRANDASYSTRAYNOTIFY tn; - TCHAR szTitle[128]; + wchar_t szTitle[128]; mir_sntprintf(szTitle, TranslateT("TabSRMM message (%s)"), (hContact != 0) ? pcli->pfnGetContactDisplayName(hContact, 0) : TranslateT("Global")); diff --git a/plugins/TabSRMM/src/stdafx.h b/plugins/TabSRMM/src/stdafx.h index d38bfa6cf6..39383d1ed6 100644 --- a/plugins/TabSRMM/src/stdafx.h +++ b/plugins/TabSRMM/src/stdafx.h @@ -233,7 +233,7 @@ extern HINSTANCE hinstance; extern BOOL g_bIMGtagButton; extern HANDLE hHookToolBarLoadedEvt; extern TLogIcon msgLogIcons[NR_LOGICONS * 3]; -extern const TCHAR *pszIDCSAVE_save, *pszIDCSAVE_close; +extern const wchar_t *pszIDCSAVE_save, *pszIDCSAVE_close; extern char *TemplateNames[]; extern HANDLE hUserPrefsWindowList; extern TCpTable cpTable[]; @@ -246,7 +246,7 @@ extern CREOleCallback2 reOleCallback2; int LoadSendRecvMessageModule(void); int SplitmsgShutdown(void); -void LogErrorMessage(HWND hwndDlg, TWindowData *dat, int i, TCHAR *szMsg); +void LogErrorMessage(HWND hwndDlg, TWindowData *dat, int i, wchar_t *szMsg); int Chat_Load(), Chat_Unload(); void FreeLogFonts(); void ImageDataInsertBitmap(IRichEditOle *ole, HBITMAP hBm); diff --git a/plugins/TabSRMM/src/taskbar.cpp b/plugins/TabSRMM/src/taskbar.cpp index 0ac8a44021..224053c4c8 100644 --- a/plugins/TabSRMM/src/taskbar.cpp +++ b/plugins/TabSRMM/src/taskbar.cpp @@ -515,7 +515,7 @@ void CProxyWindow::Invalidate() const * update the thumb title string (usually, the nickname) * @param tszTitle: new title string */ -void CProxyWindow::updateTitle(const TCHAR *tszTitle) const +void CProxyWindow::updateTitle(const wchar_t *tszTitle) const { if (m_hwndProxy && tszTitle) ::SetWindowText(m_hwndProxy, tszTitle); diff --git a/plugins/TabSRMM/src/taskbar.h b/plugins/TabSRMM/src/taskbar.h index 8a66d5a8ba..1d97f22a39 100644 --- a/plugins/TabSRMM/src/taskbar.h +++ b/plugins/TabSRMM/src/taskbar.h @@ -101,7 +101,7 @@ public: ~CProxyWindow(); void updateIcon(const HICON hIcon) const; - void updateTitle(const TCHAR *tszTitle) const; + void updateTitle(const wchar_t *tszTitle) const; void setBigIcon(const HICON hIcon, bool fInvalidate = true); void setOverlayIcon(const HICON hIcon, bool fInvalidate = true); void activateTab() const; @@ -181,7 +181,7 @@ public: void unRegisterTab(const HWND hwndTab) const; void SetTabActive(const HWND hwndTab, const HWND hwndGroup) const; - //const TCHAR* getFileNameFromWindow (const HWND hWnd); + //const wchar_t* getFileNameFromWindow (const HWND hWnd); private: ITaskbarList3 *m_pTaskbarInterface; diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index 64f4d77917..9ad2b93557 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -84,7 +84,7 @@ static void LoadTemplatesFrom(TTemplateSet *tSet, MCONTACT hContact, int rtl) if (db_get_ts(hContact, rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, TemplateNames[i], &dbv)) continue; if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR) - _tcsncpy_s(tSet->szTemplates[i], dbv.ptszVal, _TRUNCATE); + wcsncpy_s(tSet->szTemplates[i], dbv.ptszVal, _TRUNCATE); db_free(&dbv); } } @@ -247,10 +247,10 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP break; case IDC_SAVETEMPLATE: { - TCHAR newTemplate[TEMPLATE_LENGTH + 2]; + wchar_t newTemplate[TEMPLATE_LENGTH + 2]; GetDlgItemText(hwndDlg, IDC_EDITTEMPLATE, newTemplate, _countof(newTemplate)); - memcpy(tSet->szTemplates[teInfo->inEdit], newTemplate, sizeof(TCHAR) * TEMPLATE_LENGTH); + memcpy(tSet->szTemplates[teInfo->inEdit], newTemplate, sizeof(wchar_t) * TEMPLATE_LENGTH); teInfo->changed = FALSE; teInfo->updateInfo[teInfo->inEdit] = FALSE; Utils::enableDlgControl(hwndDlg, IDC_SAVETEMPLATE, FALSE); @@ -282,7 +282,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP teInfo->changed = FALSE; teInfo->updateInfo[teInfo->inEdit] = FALSE; teInfo->selchanging = TRUE; - memcpy(tSet->szTemplates[teInfo->inEdit], LTR_Default.szTemplates[teInfo->inEdit], sizeof(TCHAR) * TEMPLATE_LENGTH); + memcpy(tSet->szTemplates[teInfo->inEdit], LTR_Default.szTemplates[teInfo->inEdit], sizeof(wchar_t) * TEMPLATE_LENGTH); SetDlgItemText(hwndDlg, IDC_EDITTEMPLATE, tSet->szTemplates[teInfo->inEdit]); db_unset(teInfo->hContact, teInfo->rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, TemplateNames[teInfo->inEdit]); SetFocus(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE)); @@ -334,10 +334,10 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP case DM_UPDATETEMPLATEPREVIEW: { DBEVENTINFO dbei = { 0 }; int iIndex = SendDlgItemMessage(hwndDlg, IDC_TEMPLATELIST, LB_GETCURSEL, 0, 0); - TCHAR szTemp[TEMPLATE_LENGTH + 2]; + wchar_t szTemp[TEMPLATE_LENGTH + 2]; if (teInfo->changed) { - memcpy(szTemp, tSet->szTemplates[teInfo->inEdit], (TEMPLATE_LENGTH * sizeof(TCHAR))); + memcpy(szTemp, tSet->szTemplates[teInfo->inEdit], (TEMPLATE_LENGTH * sizeof(wchar_t))); GetDlgItemText(hwndDlg, IDC_EDITTEMPLATE, tSet->szTemplates[teInfo->inEdit], TEMPLATE_LENGTH); } dbei.szModule = dat->szProto; @@ -361,7 +361,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP StreamInEvents(hwndDlg, 0, 1, 0, &dbei); SendDlgItemMessage(hwndDlg, IDC_PREVIEW, EM_SETSEL, -1, -1); if (teInfo->changed) - memcpy(tSet->szTemplates[teInfo->inEdit], szTemp, TEMPLATE_LENGTH * sizeof(TCHAR)); + memcpy(tSet->szTemplates[teInfo->inEdit], szTemp, TEMPLATE_LENGTH * sizeof(wchar_t)); break; } case WM_DESTROY: diff --git a/plugins/TabSRMM/src/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp index 204a1fa8f2..96cbe340d7 100644 --- a/plugins/TabSRMM/src/themeio.cpp +++ b/plugins/TabSRMM/src/themeio.cpp @@ -166,7 +166,7 @@ static struct _tagFontBlocks { NULL, 0, 0, NULL }; -int TSAPI CheckThemeVersion(const TCHAR *szIniFilename) +int TSAPI CheckThemeVersion(const wchar_t *szIniFilename) { int cookie = GetPrivateProfileInt(L"TabSRMM Theme", L"Cookie", 0, szIniFilename); int version = GetPrivateProfileInt(L"TabSRMM Theme", L"Version", 0, szIniFilename); @@ -176,7 +176,7 @@ int TSAPI CheckThemeVersion(const TCHAR *szIniFilename) return 0; } -void TSAPI WriteThemeToINI(const TCHAR *szIniFilenameT, TWindowData *dat) +void TSAPI WriteThemeToINI(const wchar_t *szIniFilenameT, TWindowData *dat) { int i, n = 0; DBVARIANT dbv; @@ -244,7 +244,7 @@ void TSAPI WriteThemeToINI(const TCHAR *szIniFilenameT, TWindowData *dat) mir_free(szIniFilename); } -void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, int noAdvanced, DWORD dwFlags) +void TSAPI ReadThemeFromINI(const wchar_t *szIniFilenameT, TContainerData *dat, int noAdvanced, DWORD dwFlags) { char szBuf[512], szTemp[100], szAppname[100]; int i, n = 0; @@ -385,9 +385,9 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in db_set_utf(NULL, TEMPLATES_MODULE, TemplateNames[i], szTemplateBuffer); decoded = mir_utf8decodeW(szTemplateBuffer); if (dat == 0) - _tcsncpy_s(LTR_Active.szTemplates[i], decoded, _TRUNCATE); + wcsncpy_s(LTR_Active.szTemplates[i], decoded, _TRUNCATE); else - _tcsncpy_s(dat->ltr_templates->szTemplates[i], decoded, _TRUNCATE); + wcsncpy_s(dat->ltr_templates->szTemplates[i], decoded, _TRUNCATE); mir_free(decoded); } @@ -398,9 +398,9 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in db_set_utf(NULL, RTLTEMPLATES_MODULE, TemplateNames[i], szTemplateBuffer); decoded = mir_utf8decodeW(szTemplateBuffer); if (dat == 0) - _tcsncpy_s(RTL_Active.szTemplates[i], decoded, _TRUNCATE); + wcsncpy_s(RTL_Active.szTemplates[i], decoded, _TRUNCATE); else - _tcsncpy_s(dat->rtl_templates->szTemplates[i], decoded, _TRUNCATE); + wcsncpy_s(dat->rtl_templates->szTemplates[i], decoded, _TRUNCATE); mir_free(decoded); } } @@ -414,17 +414,17 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in * iMode = 0 - GetOpenFilename, otherwise, GetSaveAs... */ -const TCHAR* TSAPI GetThemeFileName(int iMode) +const wchar_t* TSAPI GetThemeFileName(int iMode) { - static TCHAR szFilename[MAX_PATH]; + static wchar_t szFilename[MAX_PATH]; OPENFILENAME ofn = { 0 }; - TCHAR szInitialDir[MAX_PATH]; + wchar_t szInitialDir[MAX_PATH]; - _tcsncpy_s(szInitialDir, M.getSkinPath(), _TRUNCATE); + wcsncpy_s(szInitialDir, M.getSkinPath(), _TRUNCATE); szFilename[0] = 0; - TCHAR filter[MAX_PATH]; + wchar_t filter[MAX_PATH]; mir_sntprintf(filter, L"%s%c*.tabsrmm%c%c", TranslateT("TabSRMM themes"), 0, 0, 0); ofn.lpstrFilter = filter; ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index 48c0a11bce..740f69c74b 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -108,10 +108,10 @@ AeroEffect *CSkin::m_pCurrentAeroEffect = 0; AeroEffect CSkin::m_aeroEffects[AERO_EFFECT_LAST] = { { - LPGENT("No effect"), 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0 + LPGENW("No effect"), 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0 }, { - LPGENT("Milky Glass"), + LPGENW("Milky Glass"), 0xf5f5f5, /* base color */ 0xaaaaaa, /* gradient color */ 70, /* base alpha */ @@ -126,7 +126,7 @@ AeroEffect CSkin::m_aeroEffects[AERO_EFFECT_LAST] = { AeroEffectCallback_Milk /* callback function to render the effect */ }, { - LPGENT("Carbon"), + LPGENW("Carbon"), 0xf0f0f0, 0x000000, 75, @@ -141,7 +141,7 @@ AeroEffect CSkin::m_aeroEffects[AERO_EFFECT_LAST] = { AeroEffectCallback_Carbon }, { - LPGENT("Semi transparent, custom colors"), + LPGENW("Semi transparent, custom colors"), 0xffffff, 0x444444, 60, @@ -156,7 +156,7 @@ AeroEffect CSkin::m_aeroEffects[AERO_EFFECT_LAST] = { AeroEffectCallback_Solid }, { - LPGENT("Silver shadow"), + LPGENW("Silver shadow"), 0xffffff, 0xa0a0a0, 80, @@ -171,7 +171,7 @@ AeroEffect CSkin::m_aeroEffects[AERO_EFFECT_LAST] = { AeroEffectCallback_Solid }, { - LPGENT("Custom (use own gradient colors)"), + LPGENW("Custom (use own gradient colors)"), 0xffffff, 0xa0a0a0, 80, @@ -732,7 +732,7 @@ static CSkinItem StatusItem_Default = { static struct { - TCHAR *szIniKey, *szIniName; + wchar_t *szIniKey, *szIniName; char *szSetting; unsigned int size; int defaultval; @@ -750,7 +750,7 @@ static struct NULL, NULL, NULL, 0, 0 }; -void CImageItem::Create(const TCHAR *szImageFile) +void CImageItem::Create(const wchar_t *szImageFile) { HBITMAP hbm = LoadPNG(szImageFile); BITMAP bm; @@ -795,15 +795,15 @@ void CImageItem::Create(const TCHAR *szImageFile) // @return char*: full path and filename to the .png image which represents this image item. // caller MUST delete it. -TCHAR* CImageItem::Read(const TCHAR *szFilename) +wchar_t* CImageItem::Read(const wchar_t *szFilename) { - TCHAR buffer[501]; - TCHAR szDrive[MAX_PATH], szPath[MAX_PATH]; - TCHAR *szFinalName = 0; + wchar_t buffer[501]; + wchar_t szDrive[MAX_PATH], szPath[MAX_PATH]; + wchar_t *szFinalName = 0; GetPrivateProfileString(m_szName, L"Glyph", L"None", buffer, 500, szFilename); if (mir_tstrcmp(buffer, L"None")) { - _stscanf(buffer, L"%d,%d,%d,%d", &m_glyphMetrics[0], &m_glyphMetrics[1], + swscanf(buffer, L"%d,%d,%d,%d", &m_glyphMetrics[0], &m_glyphMetrics[1], &m_glyphMetrics[2], &m_glyphMetrics[3]); if (m_glyphMetrics[2] > m_glyphMetrics[0] && m_glyphMetrics[3] > m_glyphMetrics[1]) { m_dwFlags |= IMAGE_GLYPH; @@ -814,10 +814,10 @@ TCHAR* CImageItem::Read(const TCHAR *szFilename) GetPrivateProfileString(m_szName, L"Image", L"None", buffer, 500, szFilename); if (mir_tstrcmp(buffer, L"None") || m_dwFlags & IMAGE_GLYPH) { - szFinalName = new TCHAR[MAX_PATH]; + szFinalName = new wchar_t[MAX_PATH]; //strncpy(m_szName, &m_szName[1], sizeof(m_szName)); //m_szName[sizeof(m_szName) - 1] = 0; - _tsplitpath(szFilename, szDrive, szPath, NULL, NULL); + _wsplitpath(szFilename, szDrive, szPath, NULL, NULL); mir_sntprintf(szFinalName, MAX_PATH, L"%s\\%s%s", szDrive, szPath, buffer); if (!PathFileExists(szFinalName)) { delete[] szFinalName; @@ -999,7 +999,7 @@ void CImageItem::Colorize(HBITMAP hBitmap, BYTE dr, BYTE dg, BYTE db, BYTE alpha ///////////////////////////////////////////////////////////////////////////////////////// // load PNG image using core service(advaimg) -HBITMAP TSAPI CImageItem::LoadPNG(const TCHAR *szFilename) +HBITMAP TSAPI CImageItem::LoadPNG(const wchar_t *szFilename) { HBITMAP hBitmap = 0; hBitmap = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)szFilename, IMGL_TCHAR); @@ -1195,19 +1195,19 @@ void CSkin::Unload() m_DisableScrollbars = M.GetByte("disableVScroll", 0) ? true : false; } -void CSkin::LoadIcon(const TCHAR *szSection, const TCHAR *name, HICON &hIcon) +void CSkin::LoadIcon(const wchar_t *szSection, const wchar_t *name, HICON &hIcon) { if (hIcon != 0) DestroyIcon(hIcon); - TCHAR buffer[512]; + wchar_t buffer[512]; GetPrivateProfileString(szSection, name, L"none", buffer, 250, m_tszFileName); buffer[500] = 0; if (mir_tstrcmpi(buffer, L"none")) { - TCHAR szDrive[MAX_PATH], szDir[MAX_PATH], szImagePath[MAX_PATH]; + wchar_t szDrive[MAX_PATH], szDir[MAX_PATH], szImagePath[MAX_PATH]; - _tsplitpath(m_tszFileName, szDrive, szDir, NULL, NULL); + _wsplitpath(m_tszFileName, szDrive, szDir, NULL, NULL); mir_sntprintf(szImagePath, L"%s\\%s\\%s", szDrive, szDir, buffer); hIcon = (HICON)LoadImage(0, szImagePath, IMAGE_ICON, 16, 16, LR_LOADFROMFILE); } @@ -1224,10 +1224,10 @@ void CSkin::LoadIcon(const TCHAR *szSection, const TCHAR *name, HICON &hIcon) // @param szItem char *: the section name in the ini file which holds the definition for this // item. -void CSkin::ReadItem(const int id, const TCHAR *szItem) +void CSkin::ReadItem(const int id, const wchar_t *szItem) { - TCHAR buffer[512]; - TCHAR def_color[20]; + wchar_t buffer[512]; + wchar_t def_color[20]; COLORREF clr; CSkinItem *defaults = &StatusItem_Default; @@ -1250,26 +1250,26 @@ void CSkin::ReadItem(const int id, const TCHAR *szItem) this_item->CORNER = defaults->CORNER & CORNER_ACTIVE ? defaults->CORNER : 0; GetPrivateProfileString(szItem, L"Corner", L"None", buffer, 400, m_tszFileName); - if (_tcsstr(buffer, L"tl")) + if (wcsstr(buffer, L"tl")) this_item->CORNER |= CORNER_TL; - if (_tcsstr(buffer, L"tr")) + if (wcsstr(buffer, L"tr")) this_item->CORNER |= CORNER_TR; - if (_tcsstr(buffer, L"bl")) + if (wcsstr(buffer, L"bl")) this_item->CORNER |= CORNER_BL; - if (_tcsstr(buffer, L"br")) + if (wcsstr(buffer, L"br")) this_item->CORNER |= CORNER_BR; if (this_item->CORNER) this_item->CORNER |= CORNER_ACTIVE; this_item->GRADIENT = defaults->GRADIENT & GRADIENT_ACTIVE ? defaults->GRADIENT : 0; GetPrivateProfileString(szItem, L"Gradient", L"None", buffer, 400, m_tszFileName); - if (_tcsstr(buffer, L"left")) + if (wcsstr(buffer, L"left")) this_item->GRADIENT = GRADIENT_RL; - else if (_tcsstr(buffer, L"right")) + else if (wcsstr(buffer, L"right")) this_item->GRADIENT = GRADIENT_LR; - else if (_tcsstr(buffer, L"up")) + else if (wcsstr(buffer, L"up")) this_item->GRADIENT = GRADIENT_BT; - else if (_tcsstr(buffer, L"down")) + else if (wcsstr(buffer, L"down")) this_item->GRADIENT = GRADIENT_TB; if (this_item->GRADIENT) this_item->GRADIENT |= GRADIENT_ACTIVE; @@ -1291,13 +1291,13 @@ void CSkin::ReadItem(const int id, const TCHAR *szItem) // // @param itemname char *: image item name, also section name in the .tsk file -void CSkin::ReadImageItem(const TCHAR *itemname) +void CSkin::ReadImageItem(const wchar_t *itemname) { - TCHAR buffer[512], szItemNr[30]; + wchar_t buffer[512], szItemNr[30]; CImageItem tmpItem(itemname); - TCHAR *szImageFileName = tmpItem.Read(m_tszFileName); + wchar_t *szImageFileName = tmpItem.Read(m_tszFileName); if (!mir_tstrcmpi(itemname, L"$glyphs") && szImageFileName != 0) { // the glyph item MUST have a valid image tmpItem.Create(szImageFileName); @@ -1370,7 +1370,7 @@ void CSkin::Load(void) int i = 1, j = 0; UINT data; - TCHAR buffer[500]; + wchar_t buffer[500]; if (!(GetPrivateProfileInt(L"Global", L"Version", 0, m_tszFileName) >= 1 && GetPrivateProfileInt(L"Global", L"Signature", 0, m_tszFileName) == 101)) return; @@ -1401,11 +1401,11 @@ void CSkin::Load(void) m_DisableScrollbars = M.GetByte("disableVScroll", 0) ? true : false; - TCHAR *szSections = (TCHAR*)mir_alloc(6004); + wchar_t *szSections = (wchar_t*)mir_alloc(6004); memset(szSections, 0, 6000); GetPrivateProfileSectionNames(szSections, 3000, m_tszFileName); szSections[3001] = szSections[3000] = 0; - TCHAR *p = szSections; + wchar_t *p = szSections; while (mir_tstrlen(p) > 1) { if (p[0] != '%') { p += (mir_tstrlen(p) + 1); @@ -1464,8 +1464,8 @@ void CSkin::Load(void) m_bClipBorder = GetPrivateProfileInt(L"WindowFrame", L"ClipFrame", 0, m_tszFileName) ? true : false; BYTE radius_tl, radius_tr, radius_bl, radius_br; - TCHAR szFinalName[MAX_PATH]; - TCHAR szDrive[MAX_PATH], szPath[MAX_PATH]; + wchar_t szFinalName[MAX_PATH]; + wchar_t szDrive[MAX_PATH], szPath[MAX_PATH]; radius_tl = GetPrivateProfileInt(L"WindowFrame", L"RadiusTL", 0, m_tszFileName); radius_tr = GetPrivateProfileInt(L"WindowFrame", L"RadiusTR", 0, m_tszFileName); @@ -1476,7 +1476,7 @@ void CSkin::Load(void) GetPrivateProfileString(L"Theme", L"File", L"None", buffer, MAX_PATH, m_tszFileName); - _tsplitpath(m_tszFileName, szDrive, szPath, NULL, NULL); + _wsplitpath(m_tszFileName, szDrive, szPath, NULL, NULL); mir_sntprintf(szFinalName, L"%s\\%s\\%s", szDrive, szPath, buffer); if (PathFileExists(szFinalName)) { ReadThemeFromINI(szFinalName, 0, FALSE, m_fLoadOnStartup ? 0 : M.GetByte("skin_loadmode", 0)); @@ -1523,8 +1523,8 @@ void CSkin::Load(void) void CSkin::LoadItems() { - TCHAR *szSections = NULL; - TCHAR *p, *p1; + wchar_t *szSections = NULL; + wchar_t *p, *p1; TIconDesc tmpIconDesc = { 0 }; if (m_skinIcons == NULL) @@ -1532,15 +1532,15 @@ void CSkin::LoadItems() m_nrSkinIcons = 0; - szSections = (TCHAR*)mir_alloc((SECT_BUFFER_SIZE + 2) * sizeof(TCHAR)); - memset(szSections, 0, ((SECT_BUFFER_SIZE + 2) * sizeof(TCHAR))); + szSections = (wchar_t*)mir_alloc((SECT_BUFFER_SIZE + 2) * sizeof(wchar_t)); + memset(szSections, 0, ((SECT_BUFFER_SIZE + 2) * sizeof(wchar_t))); GetPrivateProfileSection(L"Icons", szSections, SECT_BUFFER_SIZE, m_tszFileName); szSections[SECT_BUFFER_SIZE] = 0; p = szSections; while (mir_tstrlen(p) > 1) { - p1 = _tcschr(p, (int)'='); + p1 = wcschr(p, (int)'='); if (p1) *p1 = 0; if (m_nrSkinIcons < NR_MAXSKINICONS && p1) { @@ -1549,7 +1549,7 @@ void CSkin::LoadItems() memset(&m_skinIcons[m_nrSkinIcons], 0, sizeof(TIconDesc)); m_skinIcons[m_nrSkinIcons].uId = tmpIconDesc.uId; m_skinIcons[m_nrSkinIcons].phIcon = (HICON *)(&m_skinIcons[m_nrSkinIcons].uId); - m_skinIcons[m_nrSkinIcons].szName = (TCHAR*)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(p) + 1)); + m_skinIcons[m_nrSkinIcons].szName = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_tstrlen(p) + 1)); mir_tstrcpy(m_skinIcons[m_nrSkinIcons].szName, p); m_nrSkinIcons++; } @@ -1559,7 +1559,7 @@ void CSkin::LoadItems() p += (mir_tstrlen(p) + 1); } - memset(szSections, 0, ((SECT_BUFFER_SIZE + 2) * sizeof(TCHAR))); + memset(szSections, 0, ((SECT_BUFFER_SIZE + 2) * sizeof(wchar_t))); GetPrivateProfileSectionNames(szSections, SECT_BUFFER_SIZE, m_tszFileName); szSections[SECT_BUFFER_SIZE] = 0; @@ -1666,8 +1666,8 @@ void CSkin::setupAeroSkins() if (!m_fAeroSkinsValid) return; - TCHAR tszFilename[MAX_PATH], tszBasePath[MAX_PATH]; - _tcsncpy_s(tszBasePath, M.getDataPath(), _TRUNCATE); + wchar_t tszFilename[MAX_PATH], tszBasePath[MAX_PATH]; + wcsncpy_s(tszBasePath, M.getDataPath(), _TRUNCATE); if (tszBasePath[mir_tstrlen(tszBasePath) - 1] != '\\') mir_tstrcat(tszBasePath, L"\\"); @@ -2034,16 +2034,16 @@ UINT CSkin::DrawRichEditFrame(HWND hwnd, const TWindowData *mwdat, UINT skinID, ///////////////////////////////////////////////////////////////////////////////////////// // convert a html-style color string (without the #) to a 32bit COLORREF value // -// @param szSource TCHAR*: the color value as string. format: +// @param szSource wchar_t*: the color value as string. format: // html-style without the leading #. e.g. // "f3e355" // // @return COLORREF representation of the string value. -DWORD __fastcall CSkin::HexStringToLong(const TCHAR *szSource) +DWORD __fastcall CSkin::HexStringToLong(const wchar_t *szSource) { - TCHAR *stopped; - COLORREF clr = _tcstol(szSource, &stopped, 16); + wchar_t *stopped; + COLORREF clr = wcstol(szSource, &stopped, 16); if (clr == -1) return clr; return(RGB(GetBValue(clr), GetGValue(clr), GetRValue(clr))); @@ -2053,7 +2053,7 @@ DWORD __fastcall CSkin::HexStringToLong(const TCHAR *szSource) // Render text to the given HDC. This function is aero aware and will use uxtheme DrawThemeTextEx() when needed. // Paramaters are pretty much comparable to GDI DrawText() API -int CSkin::RenderText(HDC hdc, HANDLE hTheme, const TCHAR *szText, RECT *rc, DWORD dtFlags, const int iGlowSize, COLORREF clr, bool fForceAero) +int CSkin::RenderText(HDC hdc, HANDLE hTheme, const wchar_t *szText, RECT *rc, DWORD dtFlags, const int iGlowSize, COLORREF clr, bool fForceAero) { if ((PluginConfig.m_bIsVista && !CSkin::m_skinEnabled && hTheme) || fForceAero) { DTTOPTS dto = { 0 }; @@ -2437,8 +2437,8 @@ void CSkin::setAeroEffect(LRESULT effect) void CSkin::extractSkinsAndLogo(bool fForceOverwrite) const { - TCHAR tszBasePath[MAX_PATH]; - _tcsncpy_s(tszBasePath, M.getDataPath(), _TRUNCATE); + wchar_t tszBasePath[MAX_PATH]; + wcsncpy_s(tszBasePath, M.getDataPath(), _TRUNCATE); if (tszBasePath[mir_tstrlen(tszBasePath) - 1] != '\\') mir_tstrcat(tszBasePath, L"\\"); diff --git a/plugins/TabSRMM/src/themes.h b/plugins/TabSRMM/src/themes.h index 0c5d1cf32a..32d3ac2d2d 100644 --- a/plugins/TabSRMM/src/themes.h +++ b/plugins/TabSRMM/src/themes.h @@ -33,7 +33,7 @@ #ifndef __THEMES_H #define __THEMES_H -HBITMAP IMG_LoadLogo(const TCHAR *szName); +HBITMAP IMG_LoadLogo(const wchar_t *szName); class CSideBarButton; @@ -118,7 +118,7 @@ void CustomizeButton(HWND hwndButton); struct AeroEffect { - TCHAR tszName[40]; + wchar_t tszName[40]; DWORD m_baseColor; DWORD m_gradientColor; BYTE m_baseAlpha; @@ -148,7 +148,7 @@ public: *this = From; m_nextItem = 0; } - CImageItem(const TCHAR *szName) + CImageItem(const wchar_t *szName) { memset(this, 0, sizeof(CImageItem)); mir_sntprintf(m_szName, szName); @@ -220,19 +220,19 @@ public: const BLENDFUNCTION &bf = m_bf; return(bf); } - const TCHAR* getName() const { return (m_szName); } - TCHAR* Read(const TCHAR *szFilename); - void Create(const TCHAR *szImageFile); + const wchar_t* getName() const { return (m_szName); } + wchar_t* Read(const wchar_t *szFilename); + void Create(const wchar_t *szImageFile); void __fastcall Render(const HDC hdc, const RECT *rc, bool fIgnoreGlyph) const; static void TSAPI PreMultiply(HBITMAP hBitmap, int mode); static void TSAPI SetBitmap32Alpha(HBITMAP hBitmap, BYTE bAlpha = 255); static void TSAPI Colorize(HBITMAP hBitmap, BYTE dr, BYTE dg, BYTE db, BYTE alpha = 0); - static HBITMAP TSAPI LoadPNG(const TCHAR *szFilename); + static HBITMAP TSAPI LoadPNG(const wchar_t *szFilename); public: bool m_fValid; // verified item, indicates that all parameters are valid private: - TCHAR m_szName[40]; // everything wants a name, an image item doesn't need one though + wchar_t m_szName[40]; // everything wants a name, an image item doesn't need one though HBITMAP m_hbm; // the bitmap handle BYTE m_bLeft, m_bRight, m_bTop, m_bBottom; // sizing margins for the outer 8 image parts BYTE m_alpha; // constant alpha for the entire image, applied via m_bf. sums with perpixel alpha @@ -250,7 +250,7 @@ private: struct CSkinItem { - TCHAR szName[40]; + wchar_t szName[40]; char szDBname[40]; int statusID; @@ -335,11 +335,11 @@ public: void Unload(); void UnloadAeroTabs(); void setFileName(); - void ReadItem(const int id, const TCHAR *section); + void ReadItem(const int id, const wchar_t *section); void LoadItems(); - void LoadIcon(const TCHAR *szSection, const TCHAR *name, HICON &hIcon); - void ReadImageItem(const TCHAR *szItemName); - void ReadButtonItem(const TCHAR *itemName) const; + void LoadIcon(const wchar_t *szSection, const wchar_t *name, HICON &hIcon); + void ReadImageItem(const wchar_t *szItemName); + void ReadButtonItem(const wchar_t *itemName) const; bool haveGlyphItem() const { return(m_fHaveGlyph); } int getNrIcons() const { return(m_nrSkinIcons); } DWORD getDwmColor() const { return(m_dwmColor); } @@ -370,11 +370,11 @@ public: static void TSAPI SkinDrawBGFromDC(HWND hwndClient, HWND hwnd, RECT *rcClient, HDC hdcTarget); static void TSAPI SkinDrawBG(HWND hwndClient, HWND hwnd, TContainerData *pContainer, RECT *rcClient, HDC hdcTarget); static void TSAPI DrawDimmedIcon(HDC hdc, LONG left, LONG top, LONG dx, LONG dy, HICON hIcon, BYTE alpha); - static DWORD __fastcall HexStringToLong(const TCHAR *szSource); + static DWORD __fastcall HexStringToLong(const wchar_t *szSource); static UINT TSAPI DrawRichEditFrame(HWND hwnd, const TWindowData *mwdat, UINT skinID, UINT msg, WPARAM wParam, LPARAM lParam, WNDPROC OldWndProc); static UINT TSAPI NcCalcRichEditFrame(HWND hwnd, const TWindowData *mwdat, UINT skinID, UINT msg, WPARAM wParam, LPARAM lParam, WNDPROC OldWndProc); static HBITMAP TSAPI CreateAeroCompatibleBitmap(const RECT &rc, HDC dc); - static int TSAPI RenderText(HDC hdc, HANDLE hTheme, const TCHAR *szText, RECT *rc, DWORD dtFlags, const int iGlowSize = DEFAULT_GLOW_SIZE, COLORREF clr = 0, bool fForceAero = false); + static int TSAPI RenderText(HDC hdc, HANDLE hTheme, const wchar_t *szText, RECT *rc, DWORD dtFlags, const int iGlowSize = DEFAULT_GLOW_SIZE, COLORREF clr = 0, bool fForceAero = false); static void TSAPI MapClientToParent(HWND hwndClient, HWND hwndParent, RECT &rc); static void TSAPI RenderToolbarBG(const TWindowData *dat, HDC hdc, const RECT &rcWindow); static HBITMAP TSAPI ResizeBitmap(HBITMAP hBmpSrc, LONG width, LONG height, bool &mustFree); @@ -431,7 +431,7 @@ public: static bool m_fAeroSkinsValid; private: - TCHAR m_tszFileName[MAX_PATH]; // full path and filename of the currently loaded skin + wchar_t m_tszFileName[MAX_PATH]; // full path and filename of the currently loaded skin CSkinItem* m_SkinItems; CImageItem* m_ImageItems; // the list of image item objects CImageItem m_glyphItem; @@ -484,7 +484,7 @@ extern CSkin *Skin; */ struct ButtonItem { - TCHAR szName[40]; + wchar_t szName[40]; HWND hWnd; LONG xOff, yOff; LONG width, height; @@ -494,14 +494,14 @@ struct ButtonItem { LONG_PTR pressedGlyphMetrics[4]; DWORD dwFlags, dwStockFlags; DWORD uId; - TCHAR szTip[256]; + wchar_t szTip[256]; char szService[256]; char szModule[256], szSetting[256]; BYTE bValuePush[256], bValueRelease[256]; DWORD type; void(*pfnAction)(ButtonItem *item, HWND hwndDlg, TWindowData *dat, HWND hwndItem); void(*pfnCallback)(ButtonItem *item, HWND hwndDlg, TWindowData *dat, HWND hwndItem); - TCHAR tszLabel[40]; + wchar_t tszLabel[40]; ButtonItem* nextItem; HANDLE hContact; TWindowData *dat; diff --git a/plugins/TabSRMM/src/translator.cpp b/plugins/TabSRMM/src/translator.cpp index d0893ea53c..a3ab89b044 100644 --- a/plugins/TabSRMM/src/translator.cpp +++ b/plugins/TabSRMM/src/translator.cpp @@ -30,149 +30,149 @@ TOptionListGroup m_lvGroupsModPlus[] = { - { 0, LPGENT("Message window tweaks") }, - { 0, LPGENT("Display metacontact icons") }, - { 0, LPGENT("Error feedback") }, + { 0, LPGENW("Message window tweaks") }, + { 0, LPGENW("Display metacontact icons") }, + { 0, LPGENW("Error feedback") }, { 0, NULL } }; TOptionListItem m_lvItemsModPlus[] = { - { 0, LPGENT("Show skinnable tooltip in chat (Tipper plugin required)"), 1, LOI_TYPE_SETTING, (UINT_PTR)"adv_TipperTooltip", 0 }, - { 0, LPGENT("Enable typing sounds"), 0, LOI_TYPE_SETTING, (UINT_PTR)"adv_soundontyping", 0 }, - { 0, LPGENT("Close current tab on send"), 0, LOI_TYPE_SETTING, (UINT_PTR)"adv_AutoClose_2", 0 }, - { 0, LPGENT("Automatic keyboard layout: Do not load the system default for new contacts"), 1, LOI_TYPE_SETTING, (UINT_PTR)"adv_leaveKeyboardAlone", 0 }, - { 0, LPGENT("Enable unattended send (experimental feature, required for multisend and send later) (*)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendLaterAvail", 0 }, - { 0, LPGENT("Show client description in info panel"), 1, LOI_TYPE_SETTING, (UINT_PTR)"ShowClientDescription", 0 }, - { 0, LPGENT("On tab control"), 1, LOI_TYPE_SETTING, (UINT_PTR)"MetaiconTab", 1 }, - { 0, LPGENT("On the button bar"), 0, LOI_TYPE_SETTING, (UINT_PTR)"MetaiconBar", 1 }, - { 0, LPGENT("Disable error popups on sending failures"), 0, LOI_TYPE_SETTING, (UINT_PTR)"adv_noErrorPopups", 2 }, + { 0, LPGENW("Show skinnable tooltip in chat (Tipper plugin required)"), 1, LOI_TYPE_SETTING, (UINT_PTR)"adv_TipperTooltip", 0 }, + { 0, LPGENW("Enable typing sounds"), 0, LOI_TYPE_SETTING, (UINT_PTR)"adv_soundontyping", 0 }, + { 0, LPGENW("Close current tab on send"), 0, LOI_TYPE_SETTING, (UINT_PTR)"adv_AutoClose_2", 0 }, + { 0, LPGENW("Automatic keyboard layout: Do not load the system default for new contacts"), 1, LOI_TYPE_SETTING, (UINT_PTR)"adv_leaveKeyboardAlone", 0 }, + { 0, LPGENW("Enable unattended send (experimental feature, required for multisend and send later) (*)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendLaterAvail", 0 }, + { 0, LPGENW("Show client description in info panel"), 1, LOI_TYPE_SETTING, (UINT_PTR)"ShowClientDescription", 0 }, + { 0, LPGENW("On tab control"), 1, LOI_TYPE_SETTING, (UINT_PTR)"MetaiconTab", 1 }, + { 0, LPGENW("On the button bar"), 0, LOI_TYPE_SETTING, (UINT_PTR)"MetaiconBar", 1 }, + { 0, LPGENW("Disable error popups on sending failures"), 0, LOI_TYPE_SETTING, (UINT_PTR)"adv_noErrorPopups", 2 }, { 0, NULL, 0, 0, 0, 0 } }; TOptionListItem m_lvItemsNEN[] = { - { 0, LPGENT("Show a preview of the event"), IDC_CHKPREVIEW, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bPreview, 1 }, - { 0, LPGENT("Don't announce event when message dialog is open"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bWindowCheck, 1 }, - { 0, LPGENT("Don't announce events from RSS protocols"), IDC_NORSS, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bNoRSS, 1 }, - { 0, LPGENT("Enable the system tray icon"), IDC_ENABLETRAYSUPPORT, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bTraySupport, 2 }, - { 0, LPGENT("Merge new events for the same contact into existing popup"), 1, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bMergePopup, 6 }, - { 0, LPGENT("Show headers"), IDC_CHKSHOWHEADERS, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bShowHeaders, 6 }, - { 0, LPGENT("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 }, - { 0, LPGENT("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 }, - { 0, LPGENT("Dismiss event"), MASK_REMOVE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 }, - - { 0, LPGENT("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 }, - { 0, LPGENT("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 }, - { 0, LPGENT("Dismiss event"), MASK_REMOVE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 }, - - { 0, LPGENT("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActTE, 5 }, - { 0, LPGENT("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActTE, 5 }, - - { 0, LPGENT("Disable event notifications for instant messages"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.iDisable, 0 }, - { 0, LPGENT("Disable event notifications for group chats"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.iMUCDisable, 0 }, - { 0, LPGENT("Disable notifications for non-message events"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bDisableNonMessage, 0 }, - - { 0, LPGENT("Remove popups for a contact when the message window is focused"), PU_REMOVE_ON_FOCUS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 }, - { 0, LPGENT("Remove popups for a contact when I start typing a reply"), PU_REMOVE_ON_TYPE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 }, - { 0, LPGENT("Remove popups for a contact when I send a reply"), PU_REMOVE_ON_SEND, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 }, + { 0, LPGENW("Show a preview of the event"), IDC_CHKPREVIEW, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bPreview, 1 }, + { 0, LPGENW("Don't announce event when message dialog is open"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bWindowCheck, 1 }, + { 0, LPGENW("Don't announce events from RSS protocols"), IDC_NORSS, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bNoRSS, 1 }, + { 0, LPGENW("Enable the system tray icon"), IDC_ENABLETRAYSUPPORT, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bTraySupport, 2 }, + { 0, LPGENW("Merge new events for the same contact into existing popup"), 1, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bMergePopup, 6 }, + { 0, LPGENW("Show headers"), IDC_CHKSHOWHEADERS, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bShowHeaders, 6 }, + { 0, LPGENW("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 }, + { 0, LPGENW("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 }, + { 0, LPGENW("Dismiss event"), MASK_REMOVE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 }, + + { 0, LPGENW("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 }, + { 0, LPGENW("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 }, + { 0, LPGENW("Dismiss event"), MASK_REMOVE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 }, + + { 0, LPGENW("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActTE, 5 }, + { 0, LPGENW("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActTE, 5 }, + + { 0, LPGENW("Disable event notifications for instant messages"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.iDisable, 0 }, + { 0, LPGENW("Disable event notifications for group chats"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.iMUCDisable, 0 }, + { 0, LPGENW("Disable notifications for non-message events"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bDisableNonMessage, 0 }, + + { 0, LPGENW("Remove popups for a contact when the message window is focused"), PU_REMOVE_ON_FOCUS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 }, + { 0, LPGENW("Remove popups for a contact when I start typing a reply"), PU_REMOVE_ON_TYPE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 }, + { 0, LPGENW("Remove popups for a contact when I send a reply"), PU_REMOVE_ON_SEND, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 }, { 0, NULL, 0, 0, 0, 0 } }; TOptionListGroup m_lvGroupsNEN[] = { - { 0, LPGENT("Disable notifications") }, - { 0, LPGENT("General options") }, - { 0, LPGENT("System tray icon") }, - { 0, LPGENT("Left click actions (popups only)") }, - { 0, LPGENT("Right click actions (popups only)") }, - { 0, LPGENT("Timeout actions (popups only)") }, - { 0, LPGENT("Combine notifications for the same contact") }, - { 0, LPGENT("Remove popups under following conditions") }, + { 0, LPGENW("Disable notifications") }, + { 0, LPGENW("General options") }, + { 0, LPGENW("System tray icon") }, + { 0, LPGENW("Left click actions (popups only)") }, + { 0, LPGENW("Right click actions (popups only)") }, + { 0, LPGENW("Timeout actions (popups only)") }, + { 0, LPGENW("Combine notifications for the same contact") }, + { 0, LPGENW("Remove popups under following conditions") }, { 0, NULL } }; TOptionListGroup m_lvGroupsMsg[] = { - { 0, LPGENT("Message window behavior") }, - { 0, LPGENT("Sending messages") }, - { 0, LPGENT("Other options") }, + { 0, LPGENW("Message window behavior") }, + { 0, LPGENW("Sending messages") }, + { 0, LPGENW("Other options") }, { 0, NULL } }; TOptionListItem m_lvItemsMsg[] = { - { 0, LPGENT("Send on Shift+Enter"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendonshiftenter", 1 }, - { 0, LPGENT("Send message on 'Enter'"), SRMSGDEFSET_SENDONENTER, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_SENDONENTER, 1 }, - { 0, LPGENT("Send message on double 'Enter'"), 0, LOI_TYPE_SETTING, (UINT_PTR)"SendOnDblEnter", 1 }, - { 0, LPGENT("Minimize the message window on send"), SRMSGDEFSET_AUTOMIN, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_AUTOMIN, 1 }, - { 0, LPGENT("Close the message window on send"), 0, LOI_TYPE_SETTING, (UINT_PTR)"AutoClose", 1 }, - { 0, LPGENT("Always flash contact list and tray icon for new messages"), 0, LOI_TYPE_SETTING, (UINT_PTR)"flashcl", 0 }, - { 0, LPGENT("Delete temporary contacts on close"), 0, LOI_TYPE_SETTING, (UINT_PTR)"deletetemp", 0 }, - { 0, LPGENT("Enable \"Paste and send\" feature"), 0, LOI_TYPE_SETTING, (UINT_PTR)"pasteandsend", 1 }, - { 0, LPGENT("Allow BBCode formatting in outgoing messages"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendformat", 1 }, - { 0, LPGENT("Automatically split long messages (experimental, use with care)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"autosplit", 2 }, - { 0, LPGENT("Log status changes"), 0, LOI_TYPE_SETTING, (UINT_PTR)"logstatuschanges", 2 }, - { 0, LPGENT("Automatically copy selected text"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autocopy", 2 }, + { 0, LPGENW("Send on Shift+Enter"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendonshiftenter", 1 }, + { 0, LPGENW("Send message on 'Enter'"), SRMSGDEFSET_SENDONENTER, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_SENDONENTER, 1 }, + { 0, LPGENW("Send message on double 'Enter'"), 0, LOI_TYPE_SETTING, (UINT_PTR)"SendOnDblEnter", 1 }, + { 0, LPGENW("Minimize the message window on send"), SRMSGDEFSET_AUTOMIN, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_AUTOMIN, 1 }, + { 0, LPGENW("Close the message window on send"), 0, LOI_TYPE_SETTING, (UINT_PTR)"AutoClose", 1 }, + { 0, LPGENW("Always flash contact list and tray icon for new messages"), 0, LOI_TYPE_SETTING, (UINT_PTR)"flashcl", 0 }, + { 0, LPGENW("Delete temporary contacts on close"), 0, LOI_TYPE_SETTING, (UINT_PTR)"deletetemp", 0 }, + { 0, LPGENW("Enable \"Paste and send\" feature"), 0, LOI_TYPE_SETTING, (UINT_PTR)"pasteandsend", 1 }, + { 0, LPGENW("Allow BBCode formatting in outgoing messages"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendformat", 1 }, + { 0, LPGENW("Automatically split long messages (experimental, use with care)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"autosplit", 2 }, + { 0, LPGENW("Log status changes"), 0, LOI_TYPE_SETTING, (UINT_PTR)"logstatuschanges", 2 }, + { 0, LPGENW("Automatically copy selected text"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autocopy", 2 }, { 0, NULL, 0, 0, 0, 0 } }; TOptionListGroup m_lvGroupsLog[] = { - { 0, LPGENT("Message log appearance") }, - { 0, LPGENT("Support for external plugins") }, - { 0, LPGENT("Timestamp settings (note: timestamps also depend on your templates)") }, - { 0, LPGENT("Message log icons") }, + { 0, LPGENW("Message log appearance") }, + { 0, LPGENW("Support for external plugins") }, + { 0, LPGENW("Timestamp settings (note: timestamps also depend on your templates)") }, + { 0, LPGENW("Message log icons") }, { 0, NULL } }; TOptionListItem m_lvItemsLog[] = { - { 0, LPGENT("Show timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWTIME, 2 }, - { 0, LPGENT("Show dates in timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWDATES, 2 }, - { 0, LPGENT("Show seconds in timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWSECONDS, 2 }, - { 0, LPGENT("Use contacts local time (if timezone info available)"), 0, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_LOCALTIME, 2 }, - { 0, LPGENT("Draw grid lines"), 1, LOI_TYPE_FLAG, MWF_LOG_GRID, 0 }, - { 0, LPGENT("Event type icons in the message log"), 1, LOI_TYPE_FLAG, MWF_LOG_SHOWICONS, 3 }, - { 0, LPGENT("Text symbols as event markers"), 0, LOI_TYPE_FLAG, MWF_LOG_SYMBOLS, 3 }, - { 0, LPGENT("Use incoming/outgoing icons"), 1, LOI_TYPE_FLAG, MWF_LOG_INOUTICONS, 3 }, - { 0, LPGENT("Use message grouping"), 1, LOI_TYPE_FLAG, MWF_LOG_GROUPMODE, 0 }, - { 0, LPGENT("Indent message body"), 1, LOI_TYPE_FLAG, MWF_LOG_INDENT, 0 }, - { 0, LPGENT("Simple text formatting (*bold*, etc.)"), 0, LOI_TYPE_FLAG, MWF_LOG_TEXTFORMAT, 0 }, - { 0, LPGENT("Support BBCode formatting"), 1, LOI_TYPE_FLAG, MWF_LOG_BBCODE, 0 }, - { 0, LPGENT("Place a separator in the log after a window lost its foreground status"), 0, LOI_TYPE_SETTING, (UINT_PTR)"usedividers", 0 }, - { 0, LPGENT("Only place a separator when an incoming event is announced with a popup"), 0, LOI_TYPE_SETTING, (UINT_PTR)"div_popupconfig", 0 }, - { 0, LPGENT("RTL is default text direction"), 0, LOI_TYPE_FLAG, MWF_LOG_RTL, 0 }, - { 0, LPGENT("Show events at the new line (IEView Compatibility Mode)"), 1, LOI_TYPE_FLAG, MWF_LOG_NEWLINE, 1 }, - { 0, LPGENT("Underline timestamp/nickname (IEView Compatibility Mode)"), 0, LOI_TYPE_FLAG, MWF_LOG_UNDERLINE, 1 }, - { 0, LPGENT("Show timestamp after nickname (IEView Compatibility Mode)"), 0, LOI_TYPE_FLAG, MWF_LOG_SWAPNICK, 1 }, - { 0, LPGENT("Use normal templates (uncheck to use simple templates if your template set supports them)"), 1, LOI_TYPE_FLAG, MWF_LOG_NORMALTEMPLATES, 0 }, + { 0, LPGENW("Show timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWTIME, 2 }, + { 0, LPGENW("Show dates in timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWDATES, 2 }, + { 0, LPGENW("Show seconds in timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWSECONDS, 2 }, + { 0, LPGENW("Use contacts local time (if timezone info available)"), 0, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_LOCALTIME, 2 }, + { 0, LPGENW("Draw grid lines"), 1, LOI_TYPE_FLAG, MWF_LOG_GRID, 0 }, + { 0, LPGENW("Event type icons in the message log"), 1, LOI_TYPE_FLAG, MWF_LOG_SHOWICONS, 3 }, + { 0, LPGENW("Text symbols as event markers"), 0, LOI_TYPE_FLAG, MWF_LOG_SYMBOLS, 3 }, + { 0, LPGENW("Use incoming/outgoing icons"), 1, LOI_TYPE_FLAG, MWF_LOG_INOUTICONS, 3 }, + { 0, LPGENW("Use message grouping"), 1, LOI_TYPE_FLAG, MWF_LOG_GROUPMODE, 0 }, + { 0, LPGENW("Indent message body"), 1, LOI_TYPE_FLAG, MWF_LOG_INDENT, 0 }, + { 0, LPGENW("Simple text formatting (*bold*, etc.)"), 0, LOI_TYPE_FLAG, MWF_LOG_TEXTFORMAT, 0 }, + { 0, LPGENW("Support BBCode formatting"), 1, LOI_TYPE_FLAG, MWF_LOG_BBCODE, 0 }, + { 0, LPGENW("Place a separator in the log after a window lost its foreground status"), 0, LOI_TYPE_SETTING, (UINT_PTR)"usedividers", 0 }, + { 0, LPGENW("Only place a separator when an incoming event is announced with a popup"), 0, LOI_TYPE_SETTING, (UINT_PTR)"div_popupconfig", 0 }, + { 0, LPGENW("RTL is default text direction"), 0, LOI_TYPE_FLAG, MWF_LOG_RTL, 0 }, + { 0, LPGENW("Show events at the new line (IEView Compatibility Mode)"), 1, LOI_TYPE_FLAG, MWF_LOG_NEWLINE, 1 }, + { 0, LPGENW("Underline timestamp/nickname (IEView Compatibility Mode)"), 0, LOI_TYPE_FLAG, MWF_LOG_UNDERLINE, 1 }, + { 0, LPGENW("Show timestamp after nickname (IEView Compatibility Mode)"), 0, LOI_TYPE_FLAG, MWF_LOG_SWAPNICK, 1 }, + { 0, LPGENW("Use normal templates (uncheck to use simple templates if your template set supports them)"), 1, LOI_TYPE_FLAG, MWF_LOG_NORMALTEMPLATES, 0 }, { 0, NULL, 0, 0, 0, 0 } }; TOptionListGroup m_lvGroupsTab[] = { - { 0, LPGENT("Tab options") }, - { 0, LPGENT("How to create tabs and windows for incoming messages") }, - { 0, LPGENT("Miscellaneous options") }, + { 0, LPGENW("Tab options") }, + { 0, LPGENW("How to create tabs and windows for incoming messages") }, + { 0, LPGENW("Miscellaneous options") }, { 0, NULL } }; TOptionListItem m_lvItemsTab[] = { - { 0, LPGENT("Show status text on tabs"), 1, LOI_TYPE_SETTING, (UINT_PTR)"tabstatus", 0 }, - { 0, LPGENT("Prefer xStatus icons when available"), 1, LOI_TYPE_SETTING, (UINT_PTR)"use_xicons", 0 }, - { 0, LPGENT("Detailed tooltip on tabs (requires Tipper plugin)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"d_tooltips", 0 }, - { 0, LPGENT("ALWAYS activate new message sessions (has PRIORITY over the options below)"), SRMSGDEFSET_AUTOPOPUP, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_AUTOPOPUP, 1 }, - { 0, LPGENT("Automatically create new message sessions without activating them"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autotabs", 1 }, - { 0, LPGENT("New windows are minimized (the option above MUST be active)"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autocontainer", 1 }, - { 0, LPGENT("Activate a minimized window when a new tab is created inside it"), 0, LOI_TYPE_SETTING, (UINT_PTR)"cpopup", 1 }, - { 0, LPGENT("Automatically switch existing tabs in minimized windows on incoming messages (ignored when using Aero Peek task bar features)"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autoswitchtabs", 1 }, - { 0, LPGENT("Remember and set keyboard layout per contact"), 1, LOI_TYPE_SETTING, (UINT_PTR)"al", 2 }, - { 0, LPGENT("Close button only hides message windows"), 0, LOI_TYPE_SETTING, (UINT_PTR)"hideonclose", 2 }, - { 0, LPGENT("Allow TAB key in typing area (this will disable focus selection by TAB key)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"tabmode", 2 }, - { 0, LPGENT("Add offline contacts to multisend list"), 0, LOI_TYPE_SETTING, (UINT_PTR) "AllowOfflineMultisend", 2 }, + { 0, LPGENW("Show status text on tabs"), 1, LOI_TYPE_SETTING, (UINT_PTR)"tabstatus", 0 }, + { 0, LPGENW("Prefer xStatus icons when available"), 1, LOI_TYPE_SETTING, (UINT_PTR)"use_xicons", 0 }, + { 0, LPGENW("Detailed tooltip on tabs (requires Tipper plugin)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"d_tooltips", 0 }, + { 0, LPGENW("ALWAYS activate new message sessions (has PRIORITY over the options below)"), SRMSGDEFSET_AUTOPOPUP, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_AUTOPOPUP, 1 }, + { 0, LPGENW("Automatically create new message sessions without activating them"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autotabs", 1 }, + { 0, LPGENW("New windows are minimized (the option above MUST be active)"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autocontainer", 1 }, + { 0, LPGENW("Activate a minimized window when a new tab is created inside it"), 0, LOI_TYPE_SETTING, (UINT_PTR)"cpopup", 1 }, + { 0, LPGENW("Automatically switch existing tabs in minimized windows on incoming messages (ignored when using Aero Peek task bar features)"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autoswitchtabs", 1 }, + { 0, LPGENW("Remember and set keyboard layout per contact"), 1, LOI_TYPE_SETTING, (UINT_PTR)"al", 2 }, + { 0, LPGENW("Close button only hides message windows"), 0, LOI_TYPE_SETTING, (UINT_PTR)"hideonclose", 2 }, + { 0, LPGENW("Allow TAB key in typing area (this will disable focus selection by TAB key)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"tabmode", 2 }, + { 0, LPGENW("Add offline contacts to multisend list"), 0, LOI_TYPE_SETTING, (UINT_PTR) "AllowOfflineMultisend", 2 }, { 0, NULL, 0, 0, 0, 0 } }; diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp index d27a5446ca..f13c5195c5 100644 --- a/plugins/TabSRMM/src/trayicon.cpp +++ b/plugins/TabSRMM/src/trayicon.cpp @@ -33,7 +33,7 @@ static HANDLE hTrayAnimThread = 0; static HICON hIconTrayCurrent = 0; HANDLE g_hEvent = 0; -static TCHAR g_eventName[100]; +static wchar_t g_eventName[100]; static void TrayAnimThread(LPVOID) { @@ -142,7 +142,7 @@ void TSAPI CreateSystrayIcon(int create) nim.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP; nim.hIcon = PluginConfig.g_iconContainer; nim.uCallbackMessage = DM_TRAYICONNOTIFY; - _tcsncpy_s(nim.szTip, L"tabSRMM", _TRUNCATE); + wcsncpy_s(nim.szTip, L"tabSRMM", _TRUNCATE); if (create && !nen_options.bTrayExist) { Shell_NotifyIcon(NIM_ADD, &nim); nen_options.bTrayExist = TRUE; @@ -189,15 +189,15 @@ void TSAPI FlashTrayIcon(HICON hIcon) * maximum number of allowed entries (20 at the moment). The oldest (topmost) entry * is deleted, if necessary. */ -void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, const char *szProto, TCHAR *szStatus, WORD wStatus, HICON hIcon, BOOL mode, HMENU hMenu) +void TSAPI AddContactToFavorites(MCONTACT hContact, const wchar_t *szNickname, const char *szProto, wchar_t *szStatus, WORD wStatus, HICON hIcon, BOOL mode, HMENU hMenu) { - TCHAR szMenuEntry[80]; - TCHAR szFinalNick[100]; + wchar_t szMenuEntry[80]; + wchar_t szFinalNick[100]; if (szNickname == NULL) - _tcsncpy_s(szFinalNick, pcli->pfnGetContactDisplayName(hContact, 0), _TRUNCATE); + wcsncpy_s(szFinalNick, pcli->pfnGetContactDisplayName(hContact, 0), _TRUNCATE); else - _tcsncpy_s(szFinalNick, szNickname, _TRUNCATE); + wcsncpy_s(szFinalNick, szNickname, _TRUNCATE); if (szProto == NULL) szProto = GetContactProto(hContact); @@ -236,7 +236,7 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, con AppendMenu(hMenu, MF_BYCOMMAND, (UINT_PTR)hContact, szMenuEntry); } else if (hMenu == PluginConfig.g_hMenuFavorites) { // insert the item sorted... - TCHAR szBuffer[142]; + wchar_t szBuffer[142]; int i, c = GetMenuItemCount(PluginConfig.g_hMenuFavorites); MENUITEMINFO mii2 = { 0 }; @@ -252,7 +252,7 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, con mii2.cch++; mii2.dwTypeData = szBuffer; GetMenuItemInfo(PluginConfig.g_hMenuFavorites, i, TRUE, &mii2); - if (_tcsncmp((TCHAR*)mii2.dwTypeData, szMenuEntry, 140) > 0 || i == c) { + if (wcsncmp((wchar_t*)mii2.dwTypeData, szMenuEntry, 140) > 0 || i == c) { InsertMenu(PluginConfig.g_hMenuFavorites, i, MF_BYPOSITION, (UINT_PTR)hContact, szMenuEntry); break; } diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp index a3a78f74cc..a9a06b6611 100644 --- a/plugins/TabSRMM/src/typingnotify.cpp +++ b/plugins/TabSRMM/src/typingnotify.cpp @@ -21,8 +21,8 @@ static int newTimeout2; static BYTE newTimeoutMode; static BYTE newTimeoutMode2; static BYTE newColorMode; -static TCHAR szStart[128]; -static TCHAR szStop[128]; +static wchar_t szStart[128]; +static wchar_t szStop[128]; static HANDLE hntfStarted = 0; static HANDLE hntfStopped = 0; @@ -47,9 +47,9 @@ static INT_PTR EnableDisableMenuCommand(WPARAM, LPARAM) if (PluginConfig.g_bPopupAvail) { if (!Disabled) - Menu_ModifyItem(hDisableMenu, LPGENT("Disable &typing notification"), LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_ENABLED))); + Menu_ModifyItem(hDisableMenu, LPGENW("Disable &typing notification"), LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_ENABLED))); else - Menu_ModifyItem(hDisableMenu, LPGENT("Enable &typing notification"), LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_DISABLED))); + Menu_ModifyItem(hDisableMenu, LPGENW("Enable &typing notification"), LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_DISABLED))); } return 0; @@ -90,7 +90,7 @@ void TN_TypingMessage(MCONTACT hContact, int iMode) if (!PluginConfig.g_bPopupAvail || Disabled) return; - TCHAR *szContactName = pcli->pfnGetContactDisplayName(hContact, 0); + wchar_t *szContactName = pcli->pfnGetContactDisplayName(hContact, 0); if (OnePopup) { HWND hPopupWnd = WindowList_Find(hPopupsList, hContact); @@ -107,16 +107,16 @@ void TN_TypingMessage(MCONTACT hContact, int iMode) if (iMode == PROTOTYPE_CONTACTTYPING_OFF) { if (StopDisabled) return; - _tcsncpy_s(ppd.lptzContactName, szContactName, _TRUNCATE); - _tcsncpy_s(ppd.lptzText, szStop, _TRUNCATE); + wcsncpy_s(ppd.lptzContactName, szContactName, _TRUNCATE); + wcsncpy_s(ppd.lptzText, szStop, _TRUNCATE); ppd.hNotification = hntfStopped; notyping = 1; } else { if (StartDisabled) return; - _tcsncpy_s(ppd.lptzContactName, szContactName, _TRUNCATE); - _tcsncpy_s(ppd.lptzText, szStart, _TRUNCATE); + wcsncpy_s(ppd.lptzContactName, szContactName, _TRUNCATE); + wcsncpy_s(ppd.lptzText, szStart, _TRUNCATE); ppd.hNotification = hntfStarted; notyping = 0; } @@ -297,13 +297,13 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA for (int i = 0; i < 2; i++) { int notyping; if (i == PROTOTYPE_CONTACTTYPING_OFF) { - _tcsncpy_s(ppd.lptzContactName, TranslateT("Contact"), _TRUNCATE); - _tcsncpy_s(ppd.lptzText, szStop, _TRUNCATE); + wcsncpy_s(ppd.lptzContactName, TranslateT("Contact"), _TRUNCATE); + wcsncpy_s(ppd.lptzText, szStop, _TRUNCATE); notyping = 1; } else { - _tcsncpy_s(ppd.lptzContactName, TranslateT("Contact"), _TRUNCATE); - _tcsncpy_s(ppd.lptzText, szStart, _TRUNCATE); + wcsncpy_s(ppd.lptzContactName, TranslateT("Contact"), _TRUNCATE); + wcsncpy_s(ppd.lptzText, szStart, _TRUNCATE); notyping = 0; } @@ -545,7 +545,7 @@ int TN_ModuleInit() mi.hIcolibItem = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_DISABLED)); } mi.pszService = "TypingNotify/EnableDisableMenuCommand"; - mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Popups"), 0); + mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Popups"), 0); hDisableMenu = Menu_AddMainMenuItem(&mi); } diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp index 442335bde0..39f367e2c1 100644 --- a/plugins/TabSRMM/src/userprefs.cpp +++ b/plugins/TabSRMM/src/userprefs.cpp @@ -415,7 +415,7 @@ INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LP RECT rcClient; GetClientRect(hwndDlg, &rcClient); - TCHAR szBuffer[180]; + wchar_t szBuffer[180]; mir_sntprintf(szBuffer, TranslateT("Set messaging options for %s"), pcli->pfnGetContactDisplayName(hContact, 0)); SetWindowText(hwndDlg, szBuffer); diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index 674872b380..82918649a4 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -30,7 +30,7 @@ #include -typedef std::basic_string tstring; +typedef std::basic_string tstring; #define MWF_LOG_BBCODE 1 #define MWF_LOG_TEXTFORMAT 0x2000000 @@ -54,11 +54,11 @@ TRTFColorTable* Utils::rtf_ctable = 0; MWindowList CWarning::hWindowList = 0; -static TCHAR *w_bbcodes_begin[] = { L"[b]", L"[i]", L"[u]", L"[s]", L"[color=" }; -static TCHAR *w_bbcodes_end[] = { L"[/b]", L"[/i]", L"[/u]", L"[/s]", L"[/color]" }; +static wchar_t *w_bbcodes_begin[] = { L"[b]", L"[i]", L"[u]", L"[s]", L"[color=" }; +static wchar_t *w_bbcodes_end[] = { L"[/b]", L"[/i]", L"[/u]", L"[/s]", L"[/color]" }; -static TCHAR *formatting_strings_begin[] = { L"b1 ", L"i1 ", L"u1 ", L"s1 ", L"c1 " }; -static TCHAR *formatting_strings_end[] = { L"b0 ", L"i0 ", L"u0 ", L"s0 ", L"c0 " }; +static wchar_t *formatting_strings_begin[] = { L"b1 ", L"i1 ", L"u1 ", L"s1 ", L"c1 " }; +static wchar_t *formatting_strings_end[] = { L"b0 ", L"i0 ", L"u0 ", L"s0 ", L"c0 " }; #define NR_CODES 5 @@ -67,13 +67,13 @@ static TCHAR *formatting_strings_end[] = { L"b0 ", L"i0 ", L"u0 ", L"s0 ", L // flags: loword = words only for simple * /_ formatting // hiword = bbcode support (strip bbcodes if 0) -const TCHAR* Utils::FormatRaw(TWindowData *dat, const TCHAR *msg, int flags, BOOL isSent) +const wchar_t* Utils::FormatRaw(TWindowData *dat, const wchar_t *msg, int flags, BOOL isSent) { bool clr_was_added = false, was_added; static tstring message(msg); size_t beginmark = 0, endmark = 0, tempmark = 0, index; int i, endindex; - TCHAR endmarker; + wchar_t endmarker; DWORD dwFlags = dat->dwFlags; message.assign(msg); @@ -103,7 +103,7 @@ const TCHAR* Utils::FormatRaw(TWindowData *dat, const TCHAR *msg, int flags, BOO search_again: bool clr_found = false; for (int ii = 0; ii < rtf_ctable_size; ii++) { - if (!_tcsnicmp((TCHAR*)colorname.c_str(), rtf_ctable[ii].szName, mir_tstrlen(rtf_ctable[ii].szName))) { + if (!wcsnicmp((wchar_t*)colorname.c_str(), rtf_ctable[ii].szName, mir_tstrlen(rtf_ctable[ii].szName))) { closing = beginmark + 7 + mir_tstrlen(rtf_ctable[ii].szName); if (endmark != message.npos) { message.erase(endmark, 4); @@ -111,14 +111,14 @@ search_again: } message.erase(beginmark, (closing - beginmark)); - TCHAR szTemp[5]; + wchar_t szTemp[5]; message.insert(beginmark, L"cxxx "); mir_sntprintf(szTemp, L"%02d", MSGDLGFONTCOUNT + 13 + ii); message[beginmark + 3] = szTemp[0]; message[beginmark + 4] = szTemp[1]; clr_found = true; if (was_added) { - TCHAR wszTemp[100]; + wchar_t wszTemp[100]; mir_sntprintf(wszTemp, L"##col##%06u:%04u", endmark - closing, ii); wszTemp[99] = 0; message.insert(beginmark, wszTemp); @@ -130,7 +130,7 @@ search_again: size_t c_closing = colorname.find_first_of(L"]", 0); if (c_closing == colorname.npos) c_closing = colorname.length(); - const TCHAR *wszColname = colorname.c_str(); + const wchar_t *wszColname = colorname.c_str(); if (endmark != message.npos && c_closing > 2 && c_closing <= 6 && iswalnum(colorname[0]) && iswalnum(colorname[c_closing - 1])) { RTF_ColorAdd(wszColname, c_closing); if (!was_added) { @@ -166,7 +166,7 @@ invalid_code: while ((beginmark = message.find_first_of(L"*/_", beginmark)) != message.npos) { endmarker = message[beginmark]; if (LOWORD(flags)) { - if (beginmark > 0 && !_istspace(message[beginmark - 1]) && !_istpunct(message[beginmark - 1])) { + if (beginmark > 0 && !iswspace(message[beginmark - 1]) && !iswpunct(message[beginmark - 1])) { beginmark++; continue; } @@ -174,7 +174,7 @@ invalid_code: // search a corresponding endmarker which fulfills the criteria INT_PTR mark = beginmark + 1; while ((endmark = message.find(endmarker, mark)) != message.npos) { - if (_istpunct(message[endmark + 1]) || _istspace(message[endmark + 1]) || message[endmark + 1] == 0 || _tcschr(L"*/_", message[endmark + 1]) != NULL) + if (iswpunct(message[endmark + 1]) || iswspace(message[endmark + 1]) || message[endmark + 1] == 0 || wcschr(L"*/_", message[endmark + 1]) != NULL) goto ok; mark = endmark + 1; } @@ -212,7 +212,7 @@ ok: smbp.cbSize = sizeof(smbp); smbp.Protocolname = dat->cache->getActiveProto(); smbp.flag = SAFL_TCHAR | SAFL_PATH | (isSent ? SAFL_OUTGOING : 0); - smbp.str = (TCHAR*)smcode.c_str(); + smbp.str = (wchar_t*)smcode.c_str(); smbp.hContact = dat->hContact; SMADD_BATCHPARSERES *smbpr = (SMADD_BATCHPARSERES *)CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)&smbp); if (smbpr) { @@ -234,19 +234,19 @@ ok: // format the title bar string for IM chat sessions using placeholders. // the caller must mir_free() the returned string -static TCHAR* Trunc500(TCHAR *str) +static wchar_t* Trunc500(wchar_t *str) { if (mir_tstrlen(str) > 500) str[500] = 0; return str; } -bool Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat, CMString &dest) +bool Utils::FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMString &dest) { if (dat == 0) return false; - for (const TCHAR *src = szFormat; *src; src++) { + for (const wchar_t *src = szFormat; *src; src++) { if (*src != '%') { dest.AppendChar(*src); continue; @@ -361,7 +361,7 @@ WCHAR* Utils::FilterEventMarkers(WCHAR *wszText) ///////////////////////////////////////////////////////////////////////////////////////// -void Utils::DoubleAmpersands(TCHAR *pszText, size_t len) +void Utils::DoubleAmpersands(wchar_t *pszText, size_t len) { CMString text(pszText); text.Replace(L"&", L"&&"); @@ -373,12 +373,12 @@ void Utils::DoubleAmpersands(TCHAR *pszText, size_t len) // // @param szText source text // @param iMaxLen max length of the preview -// @return TCHAR* result (caller must mir_free() it) +// @return wchar_t* result (caller must mir_free() it) -TCHAR* Utils::GetPreviewWithEllipsis(TCHAR *szText, size_t iMaxLen) +wchar_t* Utils::GetPreviewWithEllipsis(wchar_t *szText, size_t iMaxLen) { size_t uRequired; - TCHAR *p = 0, cSaved; + wchar_t *p = 0, cSaved; bool fEllipsis = false; if (mir_tstrlen(szText) <= iMaxLen) { @@ -398,7 +398,7 @@ TCHAR* Utils::GetPreviewWithEllipsis(TCHAR *szText, size_t iMaxLen) *p = 0; uRequired = (p - szText) + 6; } - TCHAR *szResult = reinterpret_cast(mir_alloc((uRequired + 1) * sizeof(TCHAR))); + wchar_t *szResult = reinterpret_cast(mir_alloc((uRequired + 1) * sizeof(wchar_t))); mir_sntprintf(szResult, (uRequired + 1), fEllipsis ? L"%s..." : L"%s", szText); if (p) @@ -450,17 +450,17 @@ void Utils::RTF_CTableInit() ///////////////////////////////////////////////////////////////////////////////////////// // add a color to the global rtf color table -void Utils::RTF_ColorAdd(const TCHAR *tszColname, size_t length) +void Utils::RTF_ColorAdd(const wchar_t *tszColname, size_t length) { - TCHAR *stopped; + wchar_t *stopped; rtf_ctable_size++; rtf_ctable = (TRTFColorTable *)mir_realloc(rtf_ctable, sizeof(TRTFColorTable) * rtf_ctable_size); - COLORREF clr = _tcstol(tszColname, &stopped, 16); + COLORREF clr = wcstol(tszColname, &stopped, 16); mir_sntprintf(rtf_ctable[rtf_ctable_size - 1].szName, length + 1, L"%06x", clr); rtf_ctable[rtf_ctable_size - 1].menuid = 0; - clr = _tcstol(tszColname, &stopped, 16); + clr = wcstol(tszColname, &stopped, 16); rtf_ctable[rtf_ctable_size - 1].clr = (RGB(GetBValue(clr), GetGValue(clr), GetRValue(clr))); } @@ -710,11 +710,11 @@ void Utils::getIconSize(HICON hIcon, int& sizeX, int& sizeY) // @param uID the item command id // @param pos zero-based position index -void Utils::addMenuItem(const HMENU& m, MENUITEMINFO &mii, HICON hIcon, const TCHAR *szText, UINT uID, UINT pos) +void Utils::addMenuItem(const HMENU& m, MENUITEMINFO &mii, HICON hIcon, const wchar_t *szText, UINT uID, UINT pos) { mii.wID = uID; mii.dwItemData = (ULONG_PTR)hIcon; - mii.dwTypeData = const_cast(szText); + mii.dwTypeData = const_cast(szText); mii.cch = (int)mir_tstrlen(mii.dwTypeData) + 1; ::InsertMenuItem(m, pos, TRUE, &mii); @@ -772,7 +772,7 @@ void Utils::showDlgControl(const HWND hwnd, UINT id, int showCmd) // stream function to write the contents of the message log to an rtf file DWORD CALLBACK Utils::StreamOut(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG * pcb) { - TCHAR *szFilename = (TCHAR*)dwCookie; + wchar_t *szFilename = (wchar_t*)dwCookie; HANDLE hFile = CreateFile(szFilename, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile != INVALID_HANDLE_VALUE) { SetFilePointer(hFile, 0, NULL, FILE_END); @@ -789,8 +789,8 @@ DWORD CALLBACK Utils::StreamOut(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG // extract a resource from the given module // tszPath must end with \ -bool Utils::extractResource(const HMODULE h, const UINT uID, const TCHAR *tszName, const TCHAR *tszPath, - const TCHAR *tszFilename, bool fForceOverwrite) +bool Utils::extractResource(const HMODULE h, const UINT uID, const wchar_t *tszName, const wchar_t *tszPath, + const wchar_t *tszFilename, bool fForceOverwrite) { HRSRC hRes = FindResource(h, MAKEINTRESOURCE(uID), tszName); if (hRes) { @@ -799,7 +799,7 @@ bool Utils::extractResource(const HMODULE h, const UINT uID, const TCHAR *tszNam char *pData = (char *)LockResource(hResource); DWORD dwSize = SizeofResource(g_hInst, hRes), written = 0; - TCHAR szFilename[MAX_PATH]; + wchar_t szFilename[MAX_PATH]; mir_sntprintf(szFilename, L"%s%s", tszPath, tszFilename); if (!fForceOverwrite) if (PathFileExists(szFilename)) @@ -817,12 +817,12 @@ bool Utils::extractResource(const HMODULE h, const UINT uID, const TCHAR *tszNam } ///////////////////////////////////////////////////////////////////////////////////////// -// extract the clicked URL from a rich edit control. Return the URL as TCHAR* +// extract the clicked URL from a rich edit control. Return the URL as wchar_t* // caller MUST mir_free() the returned string // @param hwndRich - rich edit window handle // @return wchar_t* extracted URL -TCHAR* Utils::extractURLFromRichEdit(const ENLINK* _e, const HWND hwndRich) +wchar_t* Utils::extractURLFromRichEdit(const ENLINK* _e, const HWND hwndRich) { CHARRANGE sel = { 0 }; ::SendMessage(hwndRich, EM_EXGETSEL, 0, (LPARAM)&sel); @@ -831,9 +831,9 @@ TCHAR* Utils::extractURLFromRichEdit(const ENLINK* _e, const HWND hwndRich) TEXTRANGE tr; tr.chrg = _e->chrg; - tr.lpstrText = (TCHAR*)mir_alloc(sizeof(TCHAR) * (tr.chrg.cpMax - tr.chrg.cpMin + 8)); + tr.lpstrText = (wchar_t*)mir_alloc(sizeof(wchar_t) * (tr.chrg.cpMax - tr.chrg.cpMin + 8)); ::SendMessage(hwndRich, EM_GETTEXTRANGE, 0, (LPARAM)&tr); - if (_tcschr(tr.lpstrText, '@') != NULL && _tcschr(tr.lpstrText, ':') == NULL && _tcschr(tr.lpstrText, '/') == NULL) { + if (wcschr(tr.lpstrText, '@') != NULL && wcschr(tr.lpstrText, ':') == NULL && wcschr(tr.lpstrText, '/') == NULL) { mir_tstrncpy(tr.lpstrText, L"mailto:", 7); mir_tstrncpy(tr.lpstrText + 7, tr.lpstrText, tr.chrg.cpMax - tr.chrg.cpMin + 1); } @@ -935,7 +935,7 @@ size_t Utils::CopyToClipBoard(const wchar_t *str, const HWND hwndOwner) if (!OpenClipboard(hwndOwner) || str == 0) return 0; - size_t i = sizeof(TCHAR) * (mir_tstrlen(str) + 1); + size_t i = sizeof(wchar_t) * (mir_tstrlen(str) + 1); EmptyClipboard(); HGLOBAL hData = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, i); @@ -950,15 +950,15 @@ size_t Utils::CopyToClipBoard(const wchar_t *str, const HWND hwndOwner) ///////////////////////////////////////////////////////////////////////////////////////// // file list handler -void Utils::AddToFileList(TCHAR ***pppFiles, int *totalCount, LPCTSTR szFilename) +void Utils::AddToFileList(wchar_t ***pppFiles, int *totalCount, LPCTSTR szFilename) { - *pppFiles = (TCHAR**)mir_realloc(*pppFiles, (++*totalCount + 1) * sizeof(TCHAR*)); + *pppFiles = (wchar_t**)mir_realloc(*pppFiles, (++*totalCount + 1) * sizeof(wchar_t*)); (*pppFiles)[*totalCount] = NULL; (*pppFiles)[*totalCount - 1] = mir_tstrdup(szFilename); if (GetFileAttributes(szFilename) & FILE_ATTRIBUTE_DIRECTORY) { WIN32_FIND_DATA fd; - TCHAR szPath[MAX_PATH]; + wchar_t szPath[MAX_PATH]; mir_tstrcpy(szPath, szFilename); mir_tstrcat(szPath, L"\\*"); HANDLE hFind = FindFirstFile(szPath, &fd); @@ -993,20 +993,20 @@ void Utils::AddToFileList(TCHAR ***pppFiles, int *totalCount, LPCTSTR szFilename // some strings are empty, this is intentional and used for error messages that share // the message with other possible error notifications (popups, tool tips etc.) // -// Entries that do not use the LPGENT() macro are NOT TRANSLATABLE, so don't bother translating them. +// Entries that do not use the LPGENW() macro are NOT TRANSLATABLE, so don't bother translating them. static wchar_t* warnings[] = { - LPGENT("Important release notes|A test warning message"), /* WARN_TEST */ /* reserved for important notes after upgrade - NOT translatable */ - LPGENT("Icon pack version check|The installed icon pack is outdated and might be incompatible with TabSRMM version 3.\n\n\\b1Missing or misplaced icons are possible issues with the currently installed icon pack.\\b0"), /* WARN_ICONPACKVERSION */ - LPGENT("Edit user notes|You are editing the user notes. Click the button again or use the hotkey (default: Alt-N) to save the notes and return to normal messaging mode"), /* WARN_EDITUSERNOTES */ - LPGENT("Missing component|The icon pack is missing. Please install it to the default icons folder.\n\nNo icons will be available"), /* WARN_ICONPACKMISSING */ - LPGENT("Aero peek warning|You have enabled Aero Peek features and loaded a custom container window skin\n\nThis can result in minor visual anomalies in the live preview feature."), /* WARN_AEROPEEKSKIN */ - LPGENT("File transfer problem|Sending the image by file transfer failed.\n\nPossible reasons: File transfers not supported, either you or the target contact is offline, or you are invisible and the target contact is not on your visibility list."), /* WARN_IMGSVC_MISSING */ - LPGENT("Settings problem|The option \\b1 History -> Imitate IEView API\\b0 is enabled and the History++ plugin is active. This can cause problems when using IEView as message log viewer.\n\nShould I correct the option (a restart is required)?"), /* WARN_HPP_APICHECK */ + LPGENW("Important release notes|A test warning message"), /* WARN_TEST */ /* reserved for important notes after upgrade - NOT translatable */ + LPGENW("Icon pack version check|The installed icon pack is outdated and might be incompatible with TabSRMM version 3.\n\n\\b1Missing or misplaced icons are possible issues with the currently installed icon pack.\\b0"), /* WARN_ICONPACKVERSION */ + LPGENW("Edit user notes|You are editing the user notes. Click the button again or use the hotkey (default: Alt-N) to save the notes and return to normal messaging mode"), /* WARN_EDITUSERNOTES */ + LPGENW("Missing component|The icon pack is missing. Please install it to the default icons folder.\n\nNo icons will be available"), /* WARN_ICONPACKMISSING */ + LPGENW("Aero peek warning|You have enabled Aero Peek features and loaded a custom container window skin\n\nThis can result in minor visual anomalies in the live preview feature."), /* WARN_AEROPEEKSKIN */ + LPGENW("File transfer problem|Sending the image by file transfer failed.\n\nPossible reasons: File transfers not supported, either you or the target contact is offline, or you are invisible and the target contact is not on your visibility list."), /* WARN_IMGSVC_MISSING */ + LPGENW("Settings problem|The option \\b1 History -> Imitate IEView API\\b0 is enabled and the History++ plugin is active. This can cause problems when using IEView as message log viewer.\n\nShould I correct the option (a restart is required)?"), /* WARN_HPP_APICHECK */ L" ", /* WARN_NO_SENDLATER */ /*uses "Configuration issue|The unattended send feature is disabled. The \\b1 send later\\b0 and \\b1 send to multiple contacts\\b0 features depend on it.\n\nYou must enable it under \\b1Options -> Message sessions -> Advanced tweaks\\b0. Changing this option requires a restart." */ - LPGENT("Closing Window|You are about to close a window with multiple tabs open.\n\nProceed?"), /* WARN_CLOSEWINDOW */ - LPGENT("Closing options dialog|To reflect the changes done by importing a theme in the options dialog, the dialog must be closed after loading a theme \\b1 and unsaved changes might be lost\\b0 .\n\nDo you want to continue?"), /* WARN_OPTION_CLOSE */ - LPGENT("Loading a theme|Loading a color and font theme can overwrite the settings defined by your skin.\n\nDo you want to continue?"), /* WARN_THEME_OVERWRITE */ + LPGENW("Closing Window|You are about to close a window with multiple tabs open.\n\nProceed?"), /* WARN_CLOSEWINDOW */ + LPGENW("Closing options dialog|To reflect the changes done by importing a theme in the options dialog, the dialog must be closed after loading a theme \\b1 and unsaved changes might be lost\\b0 .\n\nDo you want to continue?"), /* WARN_OPTION_CLOSE */ + LPGENW("Loading a theme|Loading a color and font theme can overwrite the settings defined by your skin.\n\nDo you want to continue?"), /* WARN_THEME_OVERWRITE */ }; CWarning::CWarning(const wchar_t *tszTitle, const wchar_t *tszText, const UINT uId, const DWORD dwFlags) : @@ -1168,7 +1168,7 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP { HICON hIcon = 0; UINT uResId = 0; - TCHAR temp[1024]; + wchar_t temp[1024]; SETTEXTEX stx = { ST_SELECTION, CP_UTF8 }; size_t pos = 0; @@ -1303,7 +1303,7 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP const wchar_t *wszUrl = Utils::extractURLFromRichEdit(e, ::GetDlgItem(hwnd, IDC_WARNTEXT)); if (wszUrl) { Utils_OpenUrlW(wszUrl); - mir_free(const_cast(wszUrl)); + mir_free(const_cast(wszUrl)); } } } diff --git a/plugins/TabSRMM/src/utils.h b/plugins/TabSRMM/src/utils.h index a5bed3cef5..245db9db97 100644 --- a/plugins/TabSRMM/src/utils.h +++ b/plugins/TabSRMM/src/utils.h @@ -38,7 +38,7 @@ struct TRTFColorTable { - TCHAR szName[10]; + wchar_t szName[10]; COLORREF clr; int menuid; }; @@ -53,14 +53,14 @@ public: }; static int FindRTLLocale(TWindowData *dat); - static TCHAR* GetPreviewWithEllipsis(TCHAR *szText, size_t iMaxLen); - static TCHAR* FilterEventMarkers(TCHAR *wszText); - static LPCTSTR FormatRaw(TWindowData *dat, const TCHAR *msg, int flags, BOOL isSent); - static bool FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat, CMString &dest); + static wchar_t* GetPreviewWithEllipsis(wchar_t *szText, size_t iMaxLen); + static wchar_t* FilterEventMarkers(wchar_t *wszText); + static LPCTSTR FormatRaw(TWindowData *dat, const wchar_t *msg, int flags, BOOL isSent); + static bool FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMString &dest); static char* FilterEventMarkers(char *szText); - static void DoubleAmpersands(TCHAR *pszText, size_t len); + static void DoubleAmpersands(wchar_t *pszText, size_t len); static void RTF_CTableInit(); - static void RTF_ColorAdd(const TCHAR *tszColname, size_t length); + static void RTF_ColorAdd(const wchar_t *tszColname, size_t length); static int ReadContainerSettingsFromDB(const MCONTACT hContact, TContainerSettings *cs, const char *szKey = 0); static int WriteContainerSettingsToDB(const MCONTACT hContact, TContainerSettings *cs, const char *szKey = 0); static void SettingsToContainer(TContainerData *pContainer); @@ -71,7 +71,7 @@ public: static DWORD CALLBACK StreamOut(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG * pcb); static LRESULT CmdDispatcher(UINT uType, HWND hwndDlg, UINT cmd, WPARAM wParam, LPARAM lParam, TWindowData *dat = 0, TContainerData *pContainer = 0); - static void addMenuItem(const HMENU& m, MENUITEMINFO& mii, HICON hIcon, const TCHAR *szText, UINT uID, UINT pos); + static void addMenuItem(const HMENU& m, MENUITEMINFO& mii, HICON hIcon, const wchar_t *szText, UINT uID, UINT pos); static void enableDlgControl(const HWND hwnd, UINT id, bool fEnable = true); static void showDlgControl(const HWND hwnd, UINT id, int showCmd); static int mustPlaySound(const TWindowData *dat); @@ -79,7 +79,7 @@ public: static void setAvatarContact(HWND hWnd, MCONTACT hContact); static void getIconSize(HICON hIcon, int& sizeX, int& sizeY); - static bool extractResource(const HMODULE h, const UINT uID, const TCHAR *tszName, const TCHAR *tszPath, const TCHAR *tszFilename, bool fForceOverwrite); + static bool extractResource(const HMODULE h, const UINT uID, const wchar_t *tszName, const wchar_t *tszPath, const wchar_t *tszFilename, bool fForceOverwrite); static void scaleAvatarHeightLimited(const HBITMAP hBm, double& dNewWidth, double& dNewHeight, const LONG maxHeight); static AVATARCACHEENTRY* loadAvatarFromAVS(const MCONTACT hContact); @@ -96,7 +96,7 @@ public: static size_t CopyToClipBoard(const wchar_t *str, const HWND hwndOwner); - static void AddToFileList(TCHAR ***pppFiles, int *totalCount, LPCTSTR szFilename); + static void AddToFileList(wchar_t ***pppFiles, int *totalCount, LPCTSTR szFilename); ////////////////////////////////////////////////////////////////////////////////////// // safe mir_strlen function - do not overflow the given buffer length -- cgit v1.2.3