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 --- src/core/stdchat/src/main.cpp | 14 +-- src/core/stdchat/src/manager.cpp | 2 +- src/core/stdchat/src/options.cpp | 192 +++++++++++++++++++-------------------- src/core/stdchat/src/stdafx.h | 10 +- src/core/stdchat/src/tools.cpp | 16 ++-- src/core/stdchat/src/window.cpp | 46 +++++----- 6 files changed, 140 insertions(+), 140 deletions(-) (limited to 'src/core/stdchat') diff --git a/src/core/stdchat/src/main.cpp b/src/core/stdchat/src/main.cpp index 28e27f8b5d..430992defb 100644 --- a/src/core/stdchat/src/main.cpp +++ b/src/core/stdchat/src/main.cpp @@ -287,30 +287,30 @@ static void RegisterFonts() { ColourIDT colourid = { sizeof(colourid) }; strncpy(colourid.dbSettingsGroup, CHAT_MODULE, sizeof(colourid.dbSettingsGroup)); - _tcsncpy(colourid.group, LPGENT("Chat module"), _countof(colourid.group)); + wcsncpy(colourid.group, LPGENW("Chat module"), _countof(colourid.group)); strncpy(colourid.setting, "ColorLogBG", _countof(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Group chat log background"), _countof(colourid.name)); + wcsncpy(colourid.name, LPGENW("Group chat log background"), _countof(colourid.name)); colourid.defcolour = GetSysColor(COLOR_WINDOW); ColourRegisterT(&colourid); strncpy(colourid.setting, "ColorMessageBG", _countof(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Message background"), _countof(colourid.name)); + wcsncpy(colourid.name, LPGENW("Message background"), _countof(colourid.name)); colourid.defcolour = GetSysColor(COLOR_WINDOW); ColourRegisterT(&colourid); strncpy(colourid.setting, "ColorNicklistBG", _countof(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Nick list background"), _countof(colourid.name)); + wcsncpy(colourid.name, LPGENW("Nick list background"), _countof(colourid.name)); colourid.defcolour = GetSysColor(COLOR_WINDOW); ColourRegisterT(&colourid); strncpy(colourid.setting, "ColorNicklistLines", _countof(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Nick list lines"), _countof(colourid.name)); + wcsncpy(colourid.name, LPGENW("Nick list lines"), _countof(colourid.name)); colourid.defcolour = GetSysColor(COLOR_INACTIVEBORDER); ColourRegisterT(&colourid); strncpy(colourid.setting, "ColorNicklistSelectedBG", _countof(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Nick list background (selected)"), _countof(colourid.name)); + wcsncpy(colourid.name, LPGENW("Nick list background (selected)"), _countof(colourid.name)); colourid.defcolour = GetSysColor(COLOR_HIGHLIGHT); ColourRegisterT(&colourid); } @@ -345,7 +345,7 @@ extern "C" __declspec(dllexport) int Load(void) AddIcons(); RegisterFonts(); - CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENT("Chat module"), FONTMODE_SKIP }; + CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Chat module"), FONTMODE_SKIP }; mir_getCI(&data); saveCI = *pci; diff --git a/src/core/stdchat/src/manager.cpp b/src/core/stdchat/src/manager.cpp index f0fd3076cc..bc901042e8 100644 --- a/src/core/stdchat/src/manager.cpp +++ b/src/core/stdchat/src/manager.cpp @@ -78,7 +78,7 @@ SESSION_INFO* SM_GetNextWindow(SESSION_INFO *si) // be restored //--------------------------------------------------- -BOOL TabM_AddTab(const TCHAR *pszID, const char* pszModule) +BOOL TabM_AddTab(const wchar_t *pszID, const char* pszModule) { TABLIST *node = NULL; if (!pszID || !pszModule) diff --git a/src/core/stdchat/src/options.cpp b/src/core/stdchat/src/options.cpp index 1bd3a33c5c..5ce45f72ce 100644 --- a/src/core/stdchat/src/options.cpp +++ b/src/core/stdchat/src/options.cpp @@ -23,109 +23,109 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct branch_t { - const TCHAR* szDescr; + const wchar_t* szDescr; const char* szDBName; int iMode; BYTE bDefault; }; static const struct branch_t branch0[] = { - { LPGENT("Use a tabbed interface"), "Tabs", 0, 1 }, - { LPGENT("Close tab on double click"), "TabCloseOnDblClick", 0, 0 }, - { LPGENT("Restore previously open tabs when showing the window"), "TabRestore", 0, 0 }, - { LPGENT("Show tabs at the bottom"), "TabBottom", 0, 0 }, + { LPGENW("Use a tabbed interface"), "Tabs", 0, 1 }, + { LPGENW("Close tab on double click"), "TabCloseOnDblClick", 0, 0 }, + { LPGENW("Restore previously open tabs when showing the window"), "TabRestore", 0, 0 }, + { LPGENW("Show tabs at the bottom"), "TabBottom", 0, 0 }, }; static const struct branch_t branch1[] = { - { LPGENT("Send message by pressing the 'Enter' key"), "SendOnEnter", 0, 1 }, - { LPGENT("Send message by pressing the 'Enter' key twice"), "SendOnDblEnter", 0, 0 }, - { LPGENT("Flash window when someone speaks"), "FlashWindow", 0, 0 }, - { LPGENT("Flash window when a word is highlighted"), "FlashWindowHighlight", 0, 1 }, - { LPGENT("Show list of users in the chat room"), "ShowNicklist", 0, 1 }, - { LPGENT("Show button for sending messages"), "ShowSend", 0, 0 }, - { LPGENT("Show buttons for controlling the chat room"), "ShowTopButtons", 0, 1 }, - { LPGENT("Show buttons for formatting the text you are typing"), "ShowFormatButtons", 0, 1 }, - { LPGENT("Show button menus when right clicking the buttons"), "RightClickFilter", 0, 0 }, - { LPGENT("Show new windows cascaded"), "CascadeWindows", 0, 1 }, - { LPGENT("Save the size and position of chat rooms"), "SavePosition", 0, 0 }, - { LPGENT("Show the topic of the room on your contact list (if supported)"), "TopicOnClist", 0, 0 }, - { LPGENT("Do not play sounds when the chat room is focused"), "SoundsFocus", 0, 0 }, - { LPGENT("Do not pop up the window when joining a chat room"), "PopupOnJoin", 0, 0 }, - { LPGENT("Toggle the visible state when double clicking in the contact list"), "ToggleVisibility", 0, 0 }, - { LPGENT("Show contact statuses if protocol supports them"), "ShowContactStatus", 0, 0 }, - { LPGENT("Display contact status icon before user role icon"), "ContactStatusFirst", 0, 0 }, + { LPGENW("Send message by pressing the 'Enter' key"), "SendOnEnter", 0, 1 }, + { LPGENW("Send message by pressing the 'Enter' key twice"), "SendOnDblEnter", 0, 0 }, + { LPGENW("Flash window when someone speaks"), "FlashWindow", 0, 0 }, + { LPGENW("Flash window when a word is highlighted"), "FlashWindowHighlight", 0, 1 }, + { LPGENW("Show list of users in the chat room"), "ShowNicklist", 0, 1 }, + { LPGENW("Show button for sending messages"), "ShowSend", 0, 0 }, + { LPGENW("Show buttons for controlling the chat room"), "ShowTopButtons", 0, 1 }, + { LPGENW("Show buttons for formatting the text you are typing"), "ShowFormatButtons", 0, 1 }, + { LPGENW("Show button menus when right clicking the buttons"), "RightClickFilter", 0, 0 }, + { LPGENW("Show new windows cascaded"), "CascadeWindows", 0, 1 }, + { LPGENW("Save the size and position of chat rooms"), "SavePosition", 0, 0 }, + { LPGENW("Show the topic of the room on your contact list (if supported)"), "TopicOnClist", 0, 0 }, + { LPGENW("Do not play sounds when the chat room is focused"), "SoundsFocus", 0, 0 }, + { LPGENW("Do not pop up the window when joining a chat room"), "PopupOnJoin", 0, 0 }, + { LPGENW("Toggle the visible state when double clicking in the contact list"), "ToggleVisibility", 0, 0 }, + { LPGENW("Show contact statuses if protocol supports them"), "ShowContactStatus", 0, 0 }, + { LPGENW("Display contact status icon before user role icon"), "ContactStatusFirst", 0, 0 }, }; static const struct branch_t branch2[] = { - { LPGENT("Prefix all events with a timestamp"), "ShowTimeStamp", 0, 1 }, - { LPGENT("Only prefix with timestamp if it has changed"), "ShowTimeStampIfChanged", 0, 0 }, - { LPGENT("Timestamp has same color as the event"), "TimeStampEventColour", 0, 0 }, - { LPGENT("Indent the second line of a message"), "LogIndentEnabled", 0, 1 }, - { LPGENT("Limit user names in the message log to 20 characters"), "LogLimitNames", 0, 1 }, - { LPGENT("Add ':' to auto-completed user names"), "AddColonToAutoComplete", 0, 1 }, - { LPGENT("Strip colors from messages in the log"), "StripFormatting", 0, 0 }, - { LPGENT("Enable the 'event filter' for new rooms"), "FilterEnabled", 0, 0 } + { LPGENW("Prefix all events with a timestamp"), "ShowTimeStamp", 0, 1 }, + { LPGENW("Only prefix with timestamp if it has changed"), "ShowTimeStampIfChanged", 0, 0 }, + { LPGENW("Timestamp has same color as the event"), "TimeStampEventColour", 0, 0 }, + { LPGENW("Indent the second line of a message"), "LogIndentEnabled", 0, 1 }, + { LPGENW("Limit user names in the message log to 20 characters"), "LogLimitNames", 0, 1 }, + { LPGENW("Add ':' to auto-completed user names"), "AddColonToAutoComplete", 0, 1 }, + { LPGENW("Strip colors from messages in the log"), "StripFormatting", 0, 0 }, + { LPGENW("Enable the 'event filter' for new rooms"), "FilterEnabled", 0, 0 } }; static const struct branch_t branch3[] = { - { LPGENT("Show topic changes"), "FilterFlags", GC_EVENT_TOPIC, 0 }, - { LPGENT("Show users joining"), "FilterFlags", GC_EVENT_JOIN, 0 }, - { LPGENT("Show users disconnecting"), "FilterFlags", GC_EVENT_QUIT, 0 }, - { LPGENT("Show messages"), "FilterFlags", GC_EVENT_MESSAGE, 1 }, - { LPGENT("Show actions"), "FilterFlags", GC_EVENT_ACTION, 1 }, - { LPGENT("Show users leaving"), "FilterFlags", GC_EVENT_PART, 0 }, - { LPGENT("Show users being kicked"), "FilterFlags", GC_EVENT_KICK, 1 }, - { LPGENT("Show notices"), "FilterFlags", GC_EVENT_NOTICE, 1 }, - { LPGENT("Show users changing name"), "FilterFlags", GC_EVENT_NICK, 0 }, - { LPGENT("Show information messages"), "FilterFlags", GC_EVENT_INFORMATION, 1 }, - { LPGENT("Show status changes of users"), "FilterFlags", GC_EVENT_ADDSTATUS, 0 }, + { LPGENW("Show topic changes"), "FilterFlags", GC_EVENT_TOPIC, 0 }, + { LPGENW("Show users joining"), "FilterFlags", GC_EVENT_JOIN, 0 }, + { LPGENW("Show users disconnecting"), "FilterFlags", GC_EVENT_QUIT, 0 }, + { LPGENW("Show messages"), "FilterFlags", GC_EVENT_MESSAGE, 1 }, + { LPGENW("Show actions"), "FilterFlags", GC_EVENT_ACTION, 1 }, + { LPGENW("Show users leaving"), "FilterFlags", GC_EVENT_PART, 0 }, + { LPGENW("Show users being kicked"), "FilterFlags", GC_EVENT_KICK, 1 }, + { LPGENW("Show notices"), "FilterFlags", GC_EVENT_NOTICE, 1 }, + { LPGENW("Show users changing name"), "FilterFlags", GC_EVENT_NICK, 0 }, + { LPGENW("Show information messages"), "FilterFlags", GC_EVENT_INFORMATION, 1 }, + { LPGENW("Show status changes of users"), "FilterFlags", GC_EVENT_ADDSTATUS, 0 }, }; static const struct branch_t branch4[] = { - { LPGENT("Show icon for topic changes"), "IconFlags", GC_EVENT_TOPIC, 0 }, - { LPGENT("Show icon for users joining"), "IconFlags", GC_EVENT_JOIN, 1 }, - { LPGENT("Show icon for users disconnecting"), "IconFlags", GC_EVENT_QUIT, 0 }, - { LPGENT("Show icon for messages"), "IconFlags", GC_EVENT_MESSAGE, 0 }, - { LPGENT("Show icon for actions"), "IconFlags", GC_EVENT_ACTION, 0 }, - { LPGENT("Show icon for highlights"), "IconFlags", GC_EVENT_HIGHLIGHT, 0 }, - { LPGENT("Show icon for users leaving"), "IconFlags", GC_EVENT_PART, 0 }, - { LPGENT("Show icon for users kicking other user"), "IconFlags", GC_EVENT_KICK, 0 }, - { LPGENT("Show icon for notices"), "IconFlags", GC_EVENT_NOTICE, 0 }, - { LPGENT("Show icon for name changes"), "IconFlags", GC_EVENT_NICK, 0 }, - { LPGENT("Show icon for information messages"), "IconFlags", GC_EVENT_INFORMATION, 0 }, - { LPGENT("Show icon for status changes"), "IconFlags", GC_EVENT_ADDSTATUS, 0 }, + { LPGENW("Show icon for topic changes"), "IconFlags", GC_EVENT_TOPIC, 0 }, + { LPGENW("Show icon for users joining"), "IconFlags", GC_EVENT_JOIN, 1 }, + { LPGENW("Show icon for users disconnecting"), "IconFlags", GC_EVENT_QUIT, 0 }, + { LPGENW("Show icon for messages"), "IconFlags", GC_EVENT_MESSAGE, 0 }, + { LPGENW("Show icon for actions"), "IconFlags", GC_EVENT_ACTION, 0 }, + { LPGENW("Show icon for highlights"), "IconFlags", GC_EVENT_HIGHLIGHT, 0 }, + { LPGENW("Show icon for users leaving"), "IconFlags", GC_EVENT_PART, 0 }, + { LPGENW("Show icon for users kicking other user"), "IconFlags", GC_EVENT_KICK, 0 }, + { LPGENW("Show icon for notices"), "IconFlags", GC_EVENT_NOTICE, 0 }, + { LPGENW("Show icon for name changes"), "IconFlags", GC_EVENT_NICK, 0 }, + { LPGENW("Show icon for information messages"), "IconFlags", GC_EVENT_INFORMATION, 0 }, + { LPGENW("Show icon for status changes"), "IconFlags", GC_EVENT_ADDSTATUS, 0 }, }; static const struct branch_t branch5[] = { - { LPGENT("Show icons in tray only when the chat room is not active"), "TrayIconInactiveOnly", 0, 1 }, - { LPGENT("Show icon in tray for topic changes"), "TrayIconFlags", GC_EVENT_TOPIC, 0 }, - { LPGENT("Show icon in tray for users joining"), "TrayIconFlags", GC_EVENT_JOIN, 0 }, - { LPGENT("Show icon in tray for users disconnecting"), "TrayIconFlags", GC_EVENT_QUIT, 0 }, - { LPGENT("Show icon in tray for messages"), "TrayIconFlags", GC_EVENT_MESSAGE, 0 }, - { LPGENT("Show icon in tray for actions"), "TrayIconFlags", GC_EVENT_ACTION, 0 }, - { LPGENT("Show icon in tray for highlights"), "TrayIconFlags", GC_EVENT_HIGHLIGHT, 1 }, - { LPGENT("Show icon in tray for users leaving"), "TrayIconFlags", GC_EVENT_PART, 0 }, - { LPGENT("Show icon in tray for users kicking other user"), "TrayIconFlags", GC_EVENT_KICK, 0 }, - { LPGENT("Show icon in tray for notices"), "TrayIconFlags", GC_EVENT_NOTICE, 0 }, - { LPGENT("Show icon in tray for name changes"), "TrayIconFlags", GC_EVENT_NICK, 0 }, - { LPGENT("Show icon in tray for information messages"), "TrayIconFlags", GC_EVENT_INFORMATION, 0 }, - { LPGENT("Show icon in tray for status changes"), "TrayIconFlags", GC_EVENT_ADDSTATUS, 0 }, + { LPGENW("Show icons in tray only when the chat room is not active"), "TrayIconInactiveOnly", 0, 1 }, + { LPGENW("Show icon in tray for topic changes"), "TrayIconFlags", GC_EVENT_TOPIC, 0 }, + { LPGENW("Show icon in tray for users joining"), "TrayIconFlags", GC_EVENT_JOIN, 0 }, + { LPGENW("Show icon in tray for users disconnecting"), "TrayIconFlags", GC_EVENT_QUIT, 0 }, + { LPGENW("Show icon in tray for messages"), "TrayIconFlags", GC_EVENT_MESSAGE, 0 }, + { LPGENW("Show icon in tray for actions"), "TrayIconFlags", GC_EVENT_ACTION, 0 }, + { LPGENW("Show icon in tray for highlights"), "TrayIconFlags", GC_EVENT_HIGHLIGHT, 1 }, + { LPGENW("Show icon in tray for users leaving"), "TrayIconFlags", GC_EVENT_PART, 0 }, + { LPGENW("Show icon in tray for users kicking other user"), "TrayIconFlags", GC_EVENT_KICK, 0 }, + { LPGENW("Show icon in tray for notices"), "TrayIconFlags", GC_EVENT_NOTICE, 0 }, + { LPGENW("Show icon in tray for name changes"), "TrayIconFlags", GC_EVENT_NICK, 0 }, + { LPGENW("Show icon in tray for information messages"), "TrayIconFlags", GC_EVENT_INFORMATION, 0 }, + { LPGENW("Show icon in tray for status changes"), "TrayIconFlags", GC_EVENT_ADDSTATUS, 0 }, }; static const struct branch_t branch6[] = { - { LPGENT("Show popups only when the chat room is not active"), "PopupInactiveOnly", 0, 1 }, - { LPGENT("Show popup for topic changes"), "PopupFlags", GC_EVENT_TOPIC, 0 }, - { LPGENT("Show popup for users joining"), "PopupFlags", GC_EVENT_JOIN, 0 }, - { LPGENT("Show popup for users disconnecting"), "PopupFlags", GC_EVENT_QUIT, 0 }, - { LPGENT("Show popup for messages"), "PopupFlags", GC_EVENT_MESSAGE, 0 }, - { LPGENT("Show popup for actions"), "PopupFlags", GC_EVENT_ACTION, 0 }, - { LPGENT("Show popup for highlights"), "PopupFlags", GC_EVENT_HIGHLIGHT, 0 }, - { LPGENT("Show popup for users leaving"), "PopupFlags", GC_EVENT_PART, 0 }, - { LPGENT("Show popup for users kicking other user"), "PopupFlags", GC_EVENT_KICK, 0 }, - { LPGENT("Show popup for notices"), "PopupFlags", GC_EVENT_NOTICE, 0 }, - { LPGENT("Show popup for name changes"), "PopupFlags", GC_EVENT_NICK, 0 }, - { LPGENT("Show popup for information messages"), "PopupFlags", GC_EVENT_INFORMATION, 0 }, - { LPGENT("Show popup for status changes"), "PopupFlags", GC_EVENT_ADDSTATUS, 0 }, + { LPGENW("Show popups only when the chat room is not active"), "PopupInactiveOnly", 0, 1 }, + { LPGENW("Show popup for topic changes"), "PopupFlags", GC_EVENT_TOPIC, 0 }, + { LPGENW("Show popup for users joining"), "PopupFlags", GC_EVENT_JOIN, 0 }, + { LPGENW("Show popup for users disconnecting"), "PopupFlags", GC_EVENT_QUIT, 0 }, + { LPGENW("Show popup for messages"), "PopupFlags", GC_EVENT_MESSAGE, 0 }, + { LPGENW("Show popup for actions"), "PopupFlags", GC_EVENT_ACTION, 0 }, + { LPGENW("Show popup for highlights"), "PopupFlags", GC_EVENT_HIGHLIGHT, 0 }, + { LPGENW("Show popup for users leaving"), "PopupFlags", GC_EVENT_PART, 0 }, + { LPGENW("Show popup for users kicking other user"), "PopupFlags", GC_EVENT_KICK, 0 }, + { LPGENW("Show popup for notices"), "PopupFlags", GC_EVENT_NOTICE, 0 }, + { LPGENW("Show popup for name changes"), "PopupFlags", GC_EVENT_NICK, 0 }, + { LPGENW("Show popup for information messages"), "PopupFlags", GC_EVENT_INFORMATION, 0 }, + { LPGENW("Show popup for status changes"), "PopupFlags", GC_EVENT_ADDSTATUS, 0 }, }; HTREEITEM hItemB0[_countof(branch0)]; @@ -242,7 +242,7 @@ static void CheckBranches(HWND hwndTree, HTREEITEM hHeading) static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData) { - TCHAR szDir[MAX_PATH]; + wchar_t szDir[MAX_PATH]; switch (uMsg) { case BFFM_INITIALIZED: SendMessage(hwnd, BFFM_SETSELECTION, TRUE, pData); @@ -320,7 +320,7 @@ HANDLE GetIconHandle(const char *pszIcoLibName) return IcoLib_GetIconHandle(szTemp); } -static void InitSetting(TCHAR** ppPointer, char* pszSetting, TCHAR* pszDefault) +static void InitSetting(wchar_t** ppPointer, char* pszSetting, wchar_t* pszDefault) { DBVARIANT dbv; if (!db_get_ts(NULL, CHAT_MODULE, pszSetting, &dbv)) { @@ -484,13 +484,13 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, SendDlgItemMessage(hwndDlg, IDC_SPIN4, UDM_SETRANGE, 0, MAKELONG(255, 10)); SendDlgItemMessage(hwndDlg, IDC_SPIN4, UDM_SETPOS, 0, MAKELONG(db_get_b(NULL, CHAT_MODULE, "NicklistRowDist", 12), 0)); { - TCHAR* pszGroup = NULL; + wchar_t* pszGroup = NULL; InitSetting(&pszGroup, "AddToGroup", L"Chat rooms"); SetDlgItemText(hwndDlg, IDC_GROUP, pszGroup); mir_free(pszGroup); } { - TCHAR szTemp[MAX_PATH]; + wchar_t szTemp[MAX_PATH]; PathToRelativeT(g_Settings.pszLogDir, szTemp); SetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, szTemp); } @@ -529,8 +529,8 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, case IDC_FONTCHOOSE: { - TCHAR szDirectory[MAX_PATH]; - TCHAR szTemp[MAX_PATH]; + wchar_t szDirectory[MAX_PATH]; + wchar_t szTemp[MAX_PATH]; BROWSEINFO bi = { 0 }; bi.hwndOwner = hwndDlg; @@ -561,18 +561,18 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, case WM_NOTIFY: if (((LPNMHDR)lParam)->idFrom == 0 && ((LPNMHDR)lParam)->code == PSN_APPLY) { - TCHAR * pszText = NULL; + wchar_t * pszText = NULL; int iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_HIGHLIGHTWORDS)); if (iLen > 0) { - TCHAR *ptszText = (TCHAR *)mir_alloc((iLen + 2) * sizeof(TCHAR)); - TCHAR *p2 = NULL; + wchar_t *ptszText = (wchar_t *)mir_alloc((iLen + 2) * sizeof(wchar_t)); + wchar_t *p2 = NULL; if (ptszText) { GetDlgItemText(hwndDlg, IDC_HIGHLIGHTWORDS, ptszText, iLen + 1); - p2 = _tcschr(ptszText, ','); + p2 = wcschr(ptszText, ','); while (p2) { *p2 = ' '; - p2 = _tcschr(ptszText, ','); + p2 = wcschr(ptszText, ','); } db_set_ts(NULL, CHAT_MODULE, "HighlightWords", ptszText); mir_free(ptszText); @@ -582,7 +582,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_LOGDIRECTORY)); if (iLen > 0) { - pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR)); + pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t)); GetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, pszText, iLen + 1); db_set_ts(NULL, CHAT_MODULE, "LogDirectory", pszText); } @@ -591,7 +591,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_LOGTIMESTAMP)); if (iLen > 0) { - pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR)); + pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t)); GetDlgItemText(hwndDlg, IDC_LOGTIMESTAMP, pszText, iLen + 1); db_set_ts(NULL, CHAT_MODULE, "LogTimestamp", pszText); } @@ -599,7 +599,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_TIMESTAMP)); if (iLen > 0) { - pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR)); + pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t)); GetDlgItemText(hwndDlg, IDC_TIMESTAMP, pszText, iLen + 1); db_set_ts(NULL, CHAT_MODULE, "HeaderTime", pszText); } @@ -607,7 +607,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_INSTAMP)); if (iLen > 0) { - pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR)); + pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t)); GetDlgItemText(hwndDlg, IDC_INSTAMP, pszText, iLen + 1); db_set_ts(NULL, CHAT_MODULE, "HeaderIncoming", pszText); } @@ -615,7 +615,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_OUTSTAMP)); if (iLen > 0) { - pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR)); + pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t)); GetDlgItemText(hwndDlg, IDC_OUTSTAMP, pszText, iLen + 1); db_set_ts(NULL, CHAT_MODULE, "HeaderOutgoing", pszText); } @@ -634,7 +634,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_GROUP)); if (iLen > 0) { - pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR)); + pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t)); GetDlgItemText(hwndDlg, IDC_GROUP, pszText, iLen + 1); db_set_ts(NULL, CHAT_MODULE, "AddToGroup", pszText); } diff --git a/src/core/stdchat/src/stdafx.h b/src/core/stdchat/src/stdafx.h index 5acc72626b..5e27b6b467 100644 --- a/src/core/stdchat/src/stdafx.h +++ b/src/core/stdchat/src/stdafx.h @@ -67,7 +67,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct TABLIST { - TCHAR *pszID; + wchar_t *pszID; char *pszModule; TABLIST *next; }; @@ -135,12 +135,12 @@ void LoadIcons(void); // log.c void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, BOOL bRedraw, BOOL bPhaseTwo); -void ValidateFilename (TCHAR * filename); +void ValidateFilename (wchar_t * filename); 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); SESSION_INFO* SM_GetPrevWindow(SESSION_INFO *si); SESSION_INFO* SM_GetNextWindow(SESSION_INFO *si); @@ -158,14 +158,14 @@ void ShowRoom(SESSION_INFO *si, WPARAM wp, BOOL bSetForeground); int GetColorIndex(const char* pszModule, COLORREF cr); void CheckColorsInModule(const char* pszModule); int GetRichTextLength(HWND hwnd); -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); bool LoadMessageFont(LOGFONT *lf, COLORREF *colour); // message.c char* Message_GetFromStream(HWND hwndDlg, SESSION_INFO *si); -BOOL TabM_AddTab(const TCHAR *pszID, const char* pszModule); +BOOL TabM_AddTab(const wchar_t *pszID, const char* pszModule); BOOL TabM_RemoveAll(void); #pragma comment(lib,"comctl32.lib") diff --git a/src/core/stdchat/src/tools.cpp b/src/core/stdchat/src/tools.cpp index 56765958bd..12731649f2 100644 --- a/src/core/stdchat/src/tools.cpp +++ b/src/core/stdchat/src/tools.cpp @@ -109,7 +109,7 @@ void CheckColorsInModule(const char* pszModule) } } -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; *hMenu = GetSubMenu(g_hMenu, iIndex); @@ -134,7 +134,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); } @@ -142,7 +142,7 @@ 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 @@ -160,7 +160,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) { @@ -199,12 +199,12 @@ void DestroyGCMenu(HMENU *hMenu, int iIndex) } } -void ValidateFilename(TCHAR *filename) +void ValidateFilename(wchar_t *filename) { - TCHAR *p1 = filename; - TCHAR szForbidden[] = L"\\/:*?\"<>|"; + wchar_t *p1 = filename; + wchar_t szForbidden[] = L"\\/:*?\"<>|"; while (*p1 != '\0') { - if (_tcschr(szForbidden, *p1)) + if (wcschr(szForbidden, *p1)) *p1 = '_'; p1 += 1; } diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp index 7fdbf8f562..bf71ea9f90 100644 --- a/src/core/stdchat/src/window.cpp +++ b/src/core/stdchat/src/window.cpp @@ -27,10 +27,10 @@ static HKL hkl = NULL; struct MESSAGESUBDATA { time_t lastEnterTime; - TCHAR szTabSave[20]; + wchar_t szTabSave[20]; }; -static TCHAR szTrimString[] = L":;,.!?\'\"><()[]- \r\n"; +static wchar_t szTrimString[] = L":;,.!?\'\"><()[]- \r\n"; static LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -363,7 +363,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, SendMessage(GetParent(hwnd), GC_SWITCHTAB, 0, (int)wParam - (int)VK_NUMPAD1); if (wParam == VK_TAB && !isCtrl && !isShift) { //tab-autocomplete - TCHAR* pszText = NULL; + wchar_t* pszText = NULL; LRESULT lResult = (LRESULT)SendMessage(hwnd, EM_GETSEL, 0, 0); SendMessage(hwnd, WM_SETREDRAW, FALSE, 0); @@ -376,7 +376,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, gtl.codepage = CP_ACP; int iLen = SendMessage(hwnd, EM_GETTEXTLENGTHEX, (WPARAM)>l, 0); if (iLen > 0) { - pszText = (TCHAR *)mir_alloc(sizeof(TCHAR)*(iLen + 100)); + pszText = (wchar_t *)mir_alloc(sizeof(wchar_t)*(iLen + 100)); GETTEXTEX gt = { 0 }; gt.cb = iLen + 99; @@ -392,10 +392,10 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, if (dat->szTabSave[0] == '\0') mir_tstrncpy(dat->szTabSave, pszText + start, end - start + 1); - TCHAR *pszSelName = (TCHAR *)mir_alloc(sizeof(TCHAR)*(end - start + 1)); + wchar_t *pszSelName = (wchar_t *)mir_alloc(sizeof(wchar_t)*(end - start + 1)); mir_tstrncpy(pszSelName, pszText + start, end - start + 1); - TCHAR *pszName = pci->UM_FindUserAutoComplete(Parentsi->pUsers, dat->szTabSave, pszSelName); + wchar_t *pszName = pci->UM_FindUserAutoComplete(Parentsi->pUsers, dat->szTabSave, pszSelName); if (pszName == NULL) { pszName = dat->szTabSave; SendMessage(hwnd, EM_SETSEL, start, end); @@ -984,13 +984,13 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO *si ti.uId = 1; ti.rect = clientRect; - TCHAR tszBuf[1024]; tszBuf[0] = 0; + wchar_t tszBuf[1024]; tszBuf[0] = 0; USERINFO *ui = pci->SM_GetUserFromIndex(si->ptszID, si->pszModule, currentHovered); if (ui) { if (ProtoServiceExists(si->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT)) { - TCHAR *p = (TCHAR*)CallProtoService(si->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)si->ptszID, (LPARAM)ui->pszUID); + wchar_t *p = (wchar_t*)CallProtoService(si->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)si->ptszID, (LPARAM)ui->pszUID); if (p != NULL) { - _tcsncpy_s(tszBuf, p, _TRUNCATE); + wcsncpy_s(tszBuf, p, _TRUNCATE); mir_free(p); } } @@ -1170,7 +1170,7 @@ static int RestoreWindowPosition(HWND hwnd, MCONTACT hContact, char * szModule, return 1; } -int GetTextPixelSize(TCHAR* pszText, HFONT hFont, BOOL bWidth) +int GetTextPixelSize(wchar_t* pszText, HFONT hFont, BOOL bWidth) { if (!pszText || !hFont) return 0; @@ -1220,7 +1220,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar SendDlgItemMessage(hwndDlg, IDC_LOG, EM_AUTOURLDETECT, 1, 0); int mask = (int)SendDlgItemMessage(hwndDlg, IDC_LOG, EM_GETEVENTMASK, 0, 0); SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETEVENTMASK, 0, mask | ENM_LINK | ENM_MOUSEEVENTS); - SendDlgItemMessage(hwndDlg, IDC_LOG, EM_LIMITTEXT, (WPARAM)sizeof(TCHAR) * 0x7FFFFFFF, 0); + SendDlgItemMessage(hwndDlg, IDC_LOG, EM_LIMITTEXT, (WPARAM)sizeof(wchar_t) * 0x7FFFFFFF, 0); SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETOLECALLBACK, 0, (LPARAM)& reOleCallback); si->hwndStatus = CreateWindowEx(0, STATUSCLASSNAME, NULL, WS_CHILD | WS_VISIBLE | SBARS_SIZEGRIP | SBT_TOOLTIPS, 0, 0, 0, 0, hwndDlg, NULL, g_hInst, NULL); @@ -1311,7 +1311,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case GC_UPDATETITLE: { - TCHAR szTemp[100]; + wchar_t szTemp[100]; switch (si->iType) { case GCW_CHATROOM: mir_sntprintf(szTemp, @@ -1334,7 +1334,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case GC_UPDATESTATUSBAR: { MODULEINFO *mi = pci->MM_FindModule(si->pszModule); - TCHAR* ptszDispName = mi->ptszModDispName; + wchar_t* ptszDispName = mi->ptszModDispName; int x = 12; x += GetTextPixelSize(ptszDispName, (HFONT)SendMessage(si->hwndStatus, WM_GETFONT, 0, 0), TRUE); x += GetSystemMetrics(SM_CXSMICON); @@ -1603,7 +1603,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (!bFound) { // create a new tab int insertat; - TCHAR szTemp[30]; + wchar_t szTemp[30]; mir_tstrncpy(szTemp, s1->ptszName, 21); if (mir_tstrlen(s1->ptszName) > 20) @@ -2170,7 +2170,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar POINT pt; UINT uID = 0; HMENU hMenu = 0; - TCHAR pszWord[4096]; + wchar_t pszWord[4096]; pt.x = (short)LOWORD(((ENLINK *)lParam)->lParam); pt.y = (short)HIWORD(((ENLINK *)lParam)->lParam); @@ -2199,7 +2199,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar tr.lpstrText = pszWord; long iRes = SendDlgItemMessage(hwndDlg, IDC_LOG, EM_GETTEXTRANGE, 0, (LPARAM)&tr); if (iRes > 0) - for (size_t iLen = mir_tstrlen(pszWord) - 1; _tcschr(szTrimString, pszWord[iLen]); iLen--) + for (size_t iLen = mir_tstrlen(pszWord) - 1; wcschr(szTrimString, pszWord[iLen]); iLen--) pszWord[iLen] = 0; } @@ -2271,7 +2271,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar TEXTRANGE tr; tr.chrg = ((ENLINK *)lParam)->chrg; - tr.lpstrText = (LPTSTR)mir_alloc(sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 1)); + tr.lpstrText = (LPTSTR)mir_alloc(sizeof(wchar_t)*(tr.chrg.cpMax - tr.chrg.cpMin + 1)); SendMessage(((LPNMHDR)lParam)->hwndFrom, EM_GETTEXTRANGE, 0, (LPARAM)&tr); if (((ENLINK *)lParam)->msg == WM_RBUTTONDOWN) { @@ -2298,8 +2298,8 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (!OpenClipboard(hwndDlg)) break; EmptyClipboard(); - hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(mir_tstrlen(tr.lpstrText) + 1)); - mir_tstrcpy((TCHAR*)GlobalLock(hData), tr.lpstrText); + hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(wchar_t)*(mir_tstrlen(tr.lpstrText) + 1)); + mir_tstrcpy((wchar_t*)GlobalLock(hData), tr.lpstrText); GlobalUnlock(hData); SetClipboardData(CF_UNICODETEXT, hData); CloseClipboard(); @@ -2330,7 +2330,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar int item = LOWORD(SendDlgItemMessage(hwndDlg, IDC_LIST, LB_ITEMFROMPOINT, 0, MAKELPARAM(p.x, p.y))); USERINFO *ui = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, item); if (ui != NULL) { - static TCHAR ptszBuf[1024]; + static wchar_t ptszBuf[1024]; mir_sntprintf(ptszBuf, L"%s: %s\r\n%s: %s\r\n%s: %s", TranslateT("Nickname"), ui->pszNick, TranslateT("Unique ID"), ui->pszUID, @@ -2357,7 +2357,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar LRESULT lResult = (LRESULT)SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_GETSEL, 0, 0); int start = LOWORD(lResult); size_t dwNameLenMax = (mir_tstrlen(ui->pszUID) + 3); - TCHAR* pszName = (TCHAR*)alloca(sizeof(TCHAR) * dwNameLenMax); + wchar_t* pszName = (wchar_t*)alloca(sizeof(wchar_t) * dwNameLenMax); if (start == 0) mir_sntprintf(pszName, dwNameLenMax, L"%s: ", ui->pszUID); else @@ -2446,8 +2446,8 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_HISTORY))) { MODULEINFO *pInfo = pci->MM_FindModule(si->pszModule); if (pInfo) { - TCHAR szFile[MAX_PATH], szName[MAX_PATH], szFolder[MAX_PATH]; - _tcsncpy_s(szName, (pInfo->ptszModDispName ? pInfo->ptszModDispName : _A2T(si->pszModule)), _TRUNCATE); + wchar_t szFile[MAX_PATH], szName[MAX_PATH], szFolder[MAX_PATH]; + wcsncpy_s(szName, (pInfo->ptszModDispName ? pInfo->ptszModDispName : _A2T(si->pszModule)), _TRUNCATE); ValidateFilename(szName); mir_sntprintf(szFolder, L"%s\\%s", g_Settings.pszLogDir, szName); -- cgit v1.2.3