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/Scriver/src/chat/chat.h | 10 +-- plugins/Scriver/src/chat/main.cpp | 2 +- plugins/Scriver/src/chat/manager.cpp | 4 +- plugins/Scriver/src/chat/options.cpp | 136 +++++++++++++++++------------------ plugins/Scriver/src/chat/tools.cpp | 14 ++-- plugins/Scriver/src/chat/window.cpp | 62 ++++++++-------- 6 files changed, 114 insertions(+), 114 deletions(-) (limited to 'plugins/Scriver/src/chat') diff --git a/plugins/Scriver/src/chat/chat.h b/plugins/Scriver/src/chat/chat.h index 949202712a..e1d2c3a693 100644 --- a/plugins/Scriver/src/chat/chat.h +++ b/plugins/Scriver/src/chat/chat.h @@ -60,7 +60,7 @@ struct LOGSTREAMDATA : public GCLogStreamDataBase struct SESSION_INFO : public GCSessionInfoBase, public CommonWindowData { - TCHAR szSearch[255]; + wchar_t szSearch[255]; int desiredInputAreaHeight; }; @@ -79,7 +79,7 @@ void LoadMsgLogBitmaps(void); void FreeMsgLogBitmaps(void); // window.c -int GetTextPixelSize( TCHAR* pszText, HFONT hFont, BOOL bWidth); +int GetTextPixelSize( wchar_t* pszText, HFONT hFont, BOOL bWidth); // options.c int OptionsInit(void); @@ -89,13 +89,13 @@ void ShowRoom(SESSION_INFO *si, WPARAM wp, BOOL bSetForeground); // manager.c HWND SM_FindWindowByContact(MCONTACT hContact); -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); char SM_GetStatusIndicator(SESSION_INFO *si, USERINFO *ui); // tools.c BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight, int bManyFix); -TCHAR* my_strstri(const TCHAR* s1, const TCHAR* s2) ; -UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, TCHAR* pszUID, TCHAR* pszWordText); +wchar_t* my_strstri(const wchar_t* s1, const wchar_t* s2) ; +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); ////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/Scriver/src/chat/main.cpp b/plugins/Scriver/src/chat/main.cpp index 29b88790d4..a223f9898d 100644 --- a/plugins/Scriver/src/chat/main.cpp +++ b/plugins/Scriver/src/chat/main.cpp @@ -154,7 +154,7 @@ static void OnLoadSettings() int Chat_Load() { - CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENT("Messaging") L"/" LPGENT("Group chats"), FONTMODE_SKIP }; + CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Messaging") L"/" LPGENW("Group chats"), FONTMODE_SKIP }; mir_getCI(&data); saveCI = *pci; diff --git a/plugins/Scriver/src/chat/manager.cpp b/plugins/Scriver/src/chat/manager.cpp index 823547751c..e71eecc249 100644 --- a/plugins/Scriver/src/chat/manager.cpp +++ b/plugins/Scriver/src/chat/manager.cpp @@ -34,13 +34,13 @@ HWND SM_FindWindowByContact(MCONTACT hContact) 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) { SESSION_INFO* pResult = NULL; if (prevSession == NULL && my_strstri(currSession->ptszName, pszOriginal) == currSession->ptszName) pResult = currSession; else { - TCHAR* pszName = NULL; + wchar_t* pszName = NULL; SESSION_INFO* pTemp = pci->wndList; if (currSession == prevSession) pszCurrent = pszOriginal; diff --git a/plugins/Scriver/src/chat/options.cpp b/plugins/Scriver/src/chat/options.cpp index db8d646289..6f83994009 100644 --- a/plugins/Scriver/src/chat/options.cpp +++ b/plugins/Scriver/src/chat/options.cpp @@ -27,7 +27,7 @@ static HWND hPathTip = 0; struct branch_t { - TCHAR* szDescr; + wchar_t* szDescr; char* szDBName; int iMode; BYTE bDefault; @@ -35,79 +35,79 @@ struct branch_t }; static struct branch_t branch1[] = { - { LPGENT("Flash when someone speaks"), "FlashWindow", 0, 0, NULL }, - { LPGENT("Flash when a word is highlighted"), "FlashWindowHighlight", 0, 1, NULL }, - { LPGENT("Show chat nick list"), "ShowNicklist", 0, 1, NULL }, - { LPGENT("Enable button context menus"), "RightClickFilter", 0, 0, NULL }, - { LPGENT("Show topic on your contact list (if supported)"), "TopicOnClist", 0, 0, NULL }, - { LPGENT("Do not play sounds when focused"), "SoundsFocus", 0, 0, NULL }, - { LPGENT("Do not pop up when joining"), "PopupOnJoin", 0, 0, NULL }, - { LPGENT("Show and hide by double clicking in the contact list"), "ToggleVisibility", 0, 0, NULL }, - { LPGENT("Show contact statuses (if supported)"), "ShowContactStatus", 0, 0, NULL }, - { LPGENT("Display contact status icon before role icon"), "ContactStatusFirst", 0, 0, NULL }, - { LPGENT("Add ':' to auto-completed names"), "AddColonToAutoComplete", 0, 1, NULL } + { LPGENW("Flash when someone speaks"), "FlashWindow", 0, 0, NULL }, + { LPGENW("Flash when a word is highlighted"), "FlashWindowHighlight", 0, 1, NULL }, + { LPGENW("Show chat nick list"), "ShowNicklist", 0, 1, NULL }, + { LPGENW("Enable button context menus"), "RightClickFilter", 0, 0, NULL }, + { LPGENW("Show topic on your contact list (if supported)"), "TopicOnClist", 0, 0, NULL }, + { LPGENW("Do not play sounds when focused"), "SoundsFocus", 0, 0, NULL }, + { LPGENW("Do not pop up when joining"), "PopupOnJoin", 0, 0, NULL }, + { LPGENW("Show and hide by double clicking in the contact list"), "ToggleVisibility", 0, 0, NULL }, + { LPGENW("Show contact statuses (if supported)"), "ShowContactStatus", 0, 0, NULL }, + { LPGENW("Display contact status icon before role icon"), "ContactStatusFirst", 0, 0, NULL }, + { LPGENW("Add ':' to auto-completed names"), "AddColonToAutoComplete", 0, 1, NULL } }; static struct branch_t branch2[] = { - { LPGENT("Show icons"), "IconFlags", GC_EVENT_TOPIC | GC_EVENT_JOIN | GC_EVENT_QUIT | + { LPGENW("Show icons"), "IconFlags", GC_EVENT_TOPIC | GC_EVENT_JOIN | GC_EVENT_QUIT | GC_EVENT_MESSAGE | GC_EVENT_ACTION | GC_EVENT_HIGHLIGHT | GC_EVENT_PART | GC_EVENT_KICK | GC_EVENT_NOTICE | GC_EVENT_NICK | GC_EVENT_INFORMATION | GC_EVENT_ADDSTATUS, 0, NULL }, - { LPGENT("Prefix all events with a timestamp"), "ShowTimeStamp", 0, 1, NULL }, - { LPGENT("Only prefix with timestamp if it has changed"), "ShowTimeStampIfChanged", 0, 0, NULL }, - { LPGENT("Timestamp has same color as event"), "TimeStampEventColour", 0, 0, NULL }, - { LPGENT("Indent the second line of a message"), "LogIndentEnabled", 0, 1, NULL }, - { LPGENT("Limit user names to 20 characters"), "LogLimitNames", 0, 1, NULL }, - { LPGENT("Strip colors from messages"), "StripFormatting", 0, 0, NULL }, - { LPGENT("Enable 'event filter' for new rooms"), "FilterEnabled", 0, 0, NULL } + { LPGENW("Prefix all events with a timestamp"), "ShowTimeStamp", 0, 1, NULL }, + { LPGENW("Only prefix with timestamp if it has changed"), "ShowTimeStampIfChanged", 0, 0, NULL }, + { LPGENW("Timestamp has same color as event"), "TimeStampEventColour", 0, 0, NULL }, + { LPGENW("Indent the second line of a message"), "LogIndentEnabled", 0, 1, NULL }, + { LPGENW("Limit user names to 20 characters"), "LogLimitNames", 0, 1, NULL }, + { LPGENW("Strip colors from messages"), "StripFormatting", 0, 0, NULL }, + { LPGENW("Enable 'event filter' for new rooms"), "FilterEnabled", 0, 0, NULL } }; static struct branch_t branch3[] = { - { LPGENT("Show topic changes"), "FilterFlags", GC_EVENT_TOPIC, 0, NULL }, - { LPGENT("Show users joining"), "FilterFlags", GC_EVENT_JOIN, 0, NULL }, - { LPGENT("Show users disconnecting"), "FilterFlags", GC_EVENT_QUIT, 0, NULL }, - { LPGENT("Show messages"), "FilterFlags", GC_EVENT_MESSAGE, 1, NULL }, - { LPGENT("Show actions"), "FilterFlags", GC_EVENT_ACTION, 1, NULL }, - { LPGENT("Show users leaving"), "FilterFlags", GC_EVENT_PART, 0, NULL }, - { LPGENT("Show users being kicked"), "FilterFlags", GC_EVENT_KICK, 1, NULL }, - { LPGENT("Show notices"), "FilterFlags", GC_EVENT_NOTICE, 1, NULL }, - { LPGENT("Show users changing name"), "FilterFlags", GC_EVENT_NICK, 0, NULL }, - { LPGENT("Show information messages"), "FilterFlags", GC_EVENT_INFORMATION, 1, NULL }, - { LPGENT("Show status changes of users"), "FilterFlags", GC_EVENT_ADDSTATUS, 0, NULL }, + { LPGENW("Show topic changes"), "FilterFlags", GC_EVENT_TOPIC, 0, NULL }, + { LPGENW("Show users joining"), "FilterFlags", GC_EVENT_JOIN, 0, NULL }, + { LPGENW("Show users disconnecting"), "FilterFlags", GC_EVENT_QUIT, 0, NULL }, + { LPGENW("Show messages"), "FilterFlags", GC_EVENT_MESSAGE, 1, NULL }, + { LPGENW("Show actions"), "FilterFlags", GC_EVENT_ACTION, 1, NULL }, + { LPGENW("Show users leaving"), "FilterFlags", GC_EVENT_PART, 0, NULL }, + { LPGENW("Show users being kicked"), "FilterFlags", GC_EVENT_KICK, 1, NULL }, + { LPGENW("Show notices"), "FilterFlags", GC_EVENT_NOTICE, 1, NULL }, + { LPGENW("Show users changing name"), "FilterFlags", GC_EVENT_NICK, 0, NULL }, + { LPGENW("Show information messages"), "FilterFlags", GC_EVENT_INFORMATION, 1, NULL }, + { LPGENW("Show status changes of users"), "FilterFlags", GC_EVENT_ADDSTATUS, 0, NULL }, }; static struct branch_t branch4[] = { - { LPGENT("Show icons in tray only when the chat room is not active"), "TrayIconInactiveOnly", 0, 1, NULL }, - { LPGENT("Show icon in tray for topic changes"), "TrayIconFlags", GC_EVENT_TOPIC, 0, NULL }, - { LPGENT("Show icon in tray for users joining"), "TrayIconFlags", GC_EVENT_JOIN, 0, NULL }, - { LPGENT("Show icon in tray for users disconnecting"), "TrayIconFlags", GC_EVENT_QUIT, 0, NULL }, - { LPGENT("Show icon in tray for messages"), "TrayIconFlags", GC_EVENT_MESSAGE, 0, NULL }, - { LPGENT("Show icon in tray for actions"), "TrayIconFlags", GC_EVENT_ACTION, 0, NULL }, - { LPGENT("Show icon in tray for highlights"), "TrayIconFlags", GC_EVENT_HIGHLIGHT, 1, NULL }, - { LPGENT("Show icon in tray for users leaving"), "TrayIconFlags", GC_EVENT_PART, 0, NULL }, - { LPGENT("Show icon in tray for users kicking other user"), "TrayIconFlags", GC_EVENT_KICK, 0, NULL }, - { LPGENT("Show icon in tray for notices"), "TrayIconFlags", GC_EVENT_NOTICE, 0, NULL }, - { LPGENT("Show icon in tray for name changes"), "TrayIconFlags", GC_EVENT_NICK, 0, NULL }, - { LPGENT("Show icon in tray for information messages"), "TrayIconFlags", GC_EVENT_INFORMATION, 0, NULL }, - { LPGENT("Show icon in tray for status changes"), "TrayIconFlags", GC_EVENT_ADDSTATUS, 0, NULL }, + { LPGENW("Show icons in tray only when the chat room is not active"), "TrayIconInactiveOnly", 0, 1, NULL }, + { LPGENW("Show icon in tray for topic changes"), "TrayIconFlags", GC_EVENT_TOPIC, 0, NULL }, + { LPGENW("Show icon in tray for users joining"), "TrayIconFlags", GC_EVENT_JOIN, 0, NULL }, + { LPGENW("Show icon in tray for users disconnecting"), "TrayIconFlags", GC_EVENT_QUIT, 0, NULL }, + { LPGENW("Show icon in tray for messages"), "TrayIconFlags", GC_EVENT_MESSAGE, 0, NULL }, + { LPGENW("Show icon in tray for actions"), "TrayIconFlags", GC_EVENT_ACTION, 0, NULL }, + { LPGENW("Show icon in tray for highlights"), "TrayIconFlags", GC_EVENT_HIGHLIGHT, 1, NULL }, + { LPGENW("Show icon in tray for users leaving"), "TrayIconFlags", GC_EVENT_PART, 0, NULL }, + { LPGENW("Show icon in tray for users kicking other user"), "TrayIconFlags", GC_EVENT_KICK, 0, NULL }, + { LPGENW("Show icon in tray for notices"), "TrayIconFlags", GC_EVENT_NOTICE, 0, NULL }, + { LPGENW("Show icon in tray for name changes"), "TrayIconFlags", GC_EVENT_NICK, 0, NULL }, + { LPGENW("Show icon in tray for information messages"), "TrayIconFlags", GC_EVENT_INFORMATION, 0, NULL }, + { LPGENW("Show icon in tray for status changes"), "TrayIconFlags", GC_EVENT_ADDSTATUS, 0, NULL }, }; static struct branch_t branch6[] = { - { LPGENT("Show popups only when the chat room is not active"), "PopupInactiveOnly", 0, 1, NULL }, - { LPGENT("Show popup for topic changes"), "PopupFlags", GC_EVENT_TOPIC, 0, NULL }, - { LPGENT("Show popup for users joining"), "PopupFlags", GC_EVENT_JOIN, 0, NULL }, - { LPGENT("Show popup for users disconnecting"), "PopupFlags", GC_EVENT_QUIT, 0, NULL }, - { LPGENT("Show popup for messages"), "PopupFlags", GC_EVENT_MESSAGE, 0, NULL }, - { LPGENT("Show popup for actions"), "PopupFlags", GC_EVENT_ACTION, 0, NULL }, - { LPGENT("Show popup for highlights"), "PopupFlags", GC_EVENT_HIGHLIGHT, 0, NULL }, - { LPGENT("Show popup for users leaving"), "PopupFlags", GC_EVENT_PART, 0, NULL }, - { LPGENT("Show popup for users kicking other user"), "PopupFlags", GC_EVENT_KICK, 0, NULL }, - { LPGENT("Show popup for notices"), "PopupFlags", GC_EVENT_NOTICE, 0, NULL }, - { LPGENT("Show popup for name changes"), "PopupFlags", GC_EVENT_NICK, 0, NULL }, - { LPGENT("Show popup for information messages"), "PopupFlags", GC_EVENT_INFORMATION, 0, NULL }, - { LPGENT("Show popup for status changes"), "PopupFlags", GC_EVENT_ADDSTATUS, 0, NULL }, + { LPGENW("Show popups only when the chat room is not active"), "PopupInactiveOnly", 0, 1, NULL }, + { LPGENW("Show popup for topic changes"), "PopupFlags", GC_EVENT_TOPIC, 0, NULL }, + { LPGENW("Show popup for users joining"), "PopupFlags", GC_EVENT_JOIN, 0, NULL }, + { LPGENW("Show popup for users disconnecting"), "PopupFlags", GC_EVENT_QUIT, 0, NULL }, + { LPGENW("Show popup for messages"), "PopupFlags", GC_EVENT_MESSAGE, 0, NULL }, + { LPGENW("Show popup for actions"), "PopupFlags", GC_EVENT_ACTION, 0, NULL }, + { LPGENW("Show popup for highlights"), "PopupFlags", GC_EVENT_HIGHLIGHT, 0, NULL }, + { LPGENW("Show popup for users leaving"), "PopupFlags", GC_EVENT_PART, 0, NULL }, + { LPGENW("Show popup for users kicking other user"), "PopupFlags", GC_EVENT_KICK, 0, NULL }, + { LPGENW("Show popup for notices"), "PopupFlags", GC_EVENT_NOTICE, 0, NULL }, + { LPGENW("Show popup for name changes"), "PopupFlags", GC_EVENT_NICK, 0, NULL }, + { LPGENW("Show popup for information messages"), "PopupFlags", GC_EVENT_INFORMATION, 0, NULL }, + { LPGENW("Show popup for status changes"), "PopupFlags", GC_EVENT_ADDSTATUS, 0, NULL }, }; -static HTREEITEM InsertBranch(HWND hwndTree, TCHAR* pszDescr, BOOL bExpanded) +static HTREEITEM InsertBranch(HWND hwndTree, wchar_t* pszDescr, BOOL bExpanded) { TVINSERTSTRUCT tvis; tvis.hParent = NULL; @@ -222,7 +222,7 @@ static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM p return 0; } -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 )) { @@ -250,7 +250,7 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading4, branch4, _countof(branch4), 0x1000); SendMessage(hwndDlg, OPT_FIXHEADINGS, 0, 0); { - TCHAR* pszGroup = NULL; + wchar_t* pszGroup = NULL; InitSetting(&pszGroup, "AddToGroup", L"Chat rooms"); SetDlgItemText(hwndDlg, IDC_CHAT_GROUP, pszGroup); mir_free(pszGroup); @@ -357,12 +357,12 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN3,UDM_SETRANGE,0,MAKELONG(10000,0)); SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN3,UDM_SETPOS,0,MAKELONG(db_get_w(NULL,CHAT_MODULE,"LoggingLimit",100),0)); { - TCHAR tszTemp[MAX_PATH]; + wchar_t tszTemp[MAX_PATH]; PathToRelativeT(g_Settings.pszLogDir, tszTemp); SetDlgItemText(hwndDlg, IDC_CHAT_LOGDIRECTORY, tszTemp); } - TCHAR tszTooltipText[2048]; + wchar_t tszTooltipText[2048]; RECT rect; mir_sntprintf(tszTooltipText, @@ -452,7 +452,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa case IDC_CHAT_LOGDIRCHOOSE: LPMALLOC psMalloc; if (SUCCEEDED(CoGetMalloc(1, &psMalloc))) { - TCHAR tszDirectory[MAX_PATH], tszTemp[MAX_PATH]; + wchar_t tszDirectory[MAX_PATH], tszTemp[MAX_PATH]; BROWSEINFO bi = { 0 }; bi.hwndOwner = hwndDlg; bi.pszDisplayName = tszDirectory; @@ -519,15 +519,15 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_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_CHAT_HIGHLIGHTWORDS, ptszText, iLen + 1); - p2 = _tcschr(ptszText, (TCHAR)','); + p2 = wcschr(ptszText, (wchar_t)','); while (p2) { *p2 = ' '; - p2 = _tcschr(ptszText, (TCHAR)','); + p2 = wcschr(ptszText, (wchar_t)','); } db_set_ts(NULL, CHAT_MODULE, "HighlightWords", ptszText); mir_free(ptszText); @@ -537,7 +537,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRECTORY)); if (iLen > 0) { - TCHAR *pszText1 = (TCHAR*)malloc(iLen*sizeof(TCHAR)+2); + wchar_t *pszText1 = (wchar_t*)malloc(iLen*sizeof(wchar_t)+2); GetDlgItemText(hwndDlg, IDC_CHAT_LOGDIRECTORY, pszText1, iLen + 1); db_set_ts(NULL, CHAT_MODULE, "LogDirectory", pszText1); free(pszText1); diff --git a/plugins/Scriver/src/chat/tools.cpp b/plugins/Scriver/src/chat/tools.cpp index 1a9be6ca87..eebd6fdd00 100644 --- a/plugins/Scriver/src/chat/tools.cpp +++ b/plugins/Scriver/src/chat/tools.cpp @@ -21,17 +21,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "../stdafx.h" -TCHAR* my_strstri(const TCHAR* s1, const TCHAR* s2) +wchar_t* my_strstri(const wchar_t* s1, const wchar_t* s2) { for (int i = 0; s1[i]; i++) - for (int j = i, k = 0; _totlower(s1[j]) == _totlower(s2[k]); j++, k++) + for (int 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; } -UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, TCHAR* pszUID, TCHAR* pszWordText) +UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, wchar_t* pszUID, wchar_t* pszWordText) { GCMENUITEMS gcmi = { 0 }; HMENU hSubMenu = 0; @@ -52,7 +52,7 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s } 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); SetSearchEngineIcons(*hMenu, g_dat.hSearchEngineIconList); @@ -61,7 +61,7 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s 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 @@ -79,7 +79,7 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s 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) { diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp index 53eaba0c5a..9e5d799407 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -22,23 +22,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "../stdafx.h" static ToolbarButton toolbarButtons[] = { - { LPGENT("Bold"), IDC_CHAT_BOLD, 0, 4, 24 }, - { LPGENT("Italic"), IDC_CHAT_ITALICS, 0, 0, 24 }, - { LPGENT("Underline"), IDC_CHAT_UNDERLINE, 0, 0, 24 }, - { LPGENT("Text color"), IDC_CHAT_COLOR, 0, 0, 24 }, - { LPGENT("Background color"), IDC_CHAT_BKGCOLOR, 0, 0, 24 }, - { LPGENT("History"), IDC_CHAT_HISTORY, 1, 0, 24 }, - { LPGENT("Filter"), IDC_CHAT_FILTER, 1, 0, 24 }, - { LPGENT("Manager"), IDC_CHAT_CHANMGR, 1, 0, 24 }, - { LPGENT("Nick list"), IDC_CHAT_SHOWNICKLIST, 1, 0, 24 }, - { LPGENT("Send"), IDOK, 1, 0, 38 }, + { LPGENW("Bold"), IDC_CHAT_BOLD, 0, 4, 24 }, + { LPGENW("Italic"), IDC_CHAT_ITALICS, 0, 0, 24 }, + { LPGENW("Underline"), IDC_CHAT_UNDERLINE, 0, 0, 24 }, + { LPGENW("Text color"), IDC_CHAT_COLOR, 0, 0, 24 }, + { LPGENW("Background color"), IDC_CHAT_BKGCOLOR, 0, 0, 24 }, + { LPGENW("History"), IDC_CHAT_HISTORY, 1, 0, 24 }, + { LPGENW("Filter"), IDC_CHAT_FILTER, 1, 0, 24 }, + { LPGENW("Manager"), IDC_CHAT_CHANMGR, 1, 0, 24 }, + { LPGENW("Nick list"), IDC_CHAT_SHOWNICKLIST, 1, 0, 24 }, + { LPGENW("Send"), IDOK, 1, 0, 38 }, }; struct MESSAGESUBDATA { time_t lastEnterTime; - TCHAR *szSearchQuery; - TCHAR *szSearchResult; + wchar_t *szSearchQuery; + wchar_t *szSearchResult; SESSION_INFO *lastSession; }; @@ -207,9 +207,9 @@ static void TabAutoComplete(HWND hwnd, MESSAGESUBDATA *dat, SESSION_INFO *si) return; bool isTopic = false, isRoom = false; - TCHAR *pszName = NULL; - TCHAR* pszText = (TCHAR*)mir_alloc(iLen + 100 * sizeof(TCHAR)); - gt.cb = iLen + 99 * sizeof(TCHAR); + wchar_t *pszName = NULL; + wchar_t* pszText = (wchar_t*)mir_alloc(iLen + 100 * sizeof(wchar_t)); + gt.cb = iLen + 99 * sizeof(wchar_t); gt.flags = GT_DEFAULT; SendMessage(hwnd, EM_GETTEXTEX, (WPARAM)>, (LPARAM)pszText); @@ -218,7 +218,7 @@ static void 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; } @@ -237,12 +237,12 @@ 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) { - dat->szSearchQuery = (TCHAR*)mir_alloc(sizeof(TCHAR)*(end - start + 1)); + dat->szSearchQuery = (wchar_t*)mir_alloc(sizeof(wchar_t)*(end - start + 1)); mir_tstrncpy(dat->szSearchQuery, pszText + start, end - start + 1); dat->szSearchResult = mir_tstrdup(dat->szSearchQuery); dat->lastSession = NULL; @@ -272,7 +272,7 @@ LBL_SkipEnd: if (end != start) { ptrT szReplace; if (!isRoom && !isTopic && g_Settings.bAddColonToAutoComplete && start == 0) { - szReplace = (TCHAR*)mir_alloc((mir_tstrlen(pszName) + 4) * sizeof(TCHAR)); + szReplace = (wchar_t*)mir_alloc((mir_tstrlen(pszName) + 4) * sizeof(wchar_t)); mir_tstrcpy(szReplace, pszName); mir_tstrcat(szReplace, L": "); pszName = szReplace; @@ -783,13 +783,13 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO * p ti.uId = 1; ti.rect = clientRect; - TCHAR tszBuf[1024]; tszBuf[0] = 0; + wchar_t tszBuf[1024]; tszBuf[0] = 0; USERINFO *ui = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, currentHovered); if (ui) { if (ProtoServiceExists(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT)) { - TCHAR *p = (TCHAR*)CallProtoService(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)parentdat->ptszID, (LPARAM)ui->pszUID); + wchar_t *p = (wchar_t*)CallProtoService(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)parentdat->ptszID, (LPARAM)ui->pszUID); if (p != NULL) { - _tcsncpy_s(tszBuf, p, _TRUNCATE); + wcsncpy_s(tszBuf, p, _TRUNCATE); mir_free(p); } } @@ -960,8 +960,8 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, else if (wParam < ' ') break; else { - TCHAR szNew[2]; - szNew[0] = (TCHAR)wParam; + wchar_t szNew[2]; + szNew[0] = (wchar_t)wParam; szNew[1] = '\0'; if (mir_tstrlen(si->szSearch) >= _countof(si->szSearch) - 2) { MessageBeep(MB_OK); @@ -976,7 +976,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, for (int 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_SETCURSEL, i, 0); InvalidateRect(hwnd, NULL, FALSE); return 0; @@ -1018,7 +1018,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, return mir_callNextSubclass(hwnd, NicklistSubclassProc, msg, wParam, lParam); } -int GetTextPixelSize(TCHAR* pszText, HFONT hFont, BOOL bWidth) +int GetTextPixelSize(wchar_t* pszText, HFONT hFont, BOOL bWidth) { if (!pszText || !hFont) return 0; @@ -1051,7 +1051,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR HICON hIcon; TabControlData tcd; TitleBarData tbd; - TCHAR szTemp[512]; + wchar_t szTemp[512]; SESSION_INFO *si = (SESSION_INFO *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); if (!si && uMsg != WM_INITDIALOG) @@ -1088,7 +1088,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR int mask = (int)SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_GETEVENTMASK, 0, 0); SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_SETEVENTMASK, 0, mask | ENM_LINK | ENM_MOUSEEVENTS); SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_SETEVENTMASK, 0, ENM_MOUSEEVENTS | ENM_KEYEVENTS | ENM_CHANGE | ENM_REQUESTRESIZE); - SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_LIMITTEXT, sizeof(TCHAR) * 0x7FFFFFFF, 0); + SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_LIMITTEXT, sizeof(wchar_t) * 0x7FFFFFFF, 0); SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_SETOLECALLBACK, 0, (LPARAM)&reOleCallback); if (db_get_b(NULL, CHAT_MODULE, "UseIEView", 0)) { @@ -1427,7 +1427,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR if (ui) { char szIndicator = SM_GetStatusIndicator(si, ui); if (szIndicator > '\0') { - static TCHAR ptszBuf[128]; + static wchar_t ptszBuf[128]; mir_sntprintf(ptszBuf, L"%c%s", szIndicator, ui->pszNick); SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, LB_ADDSTRING, 0, (LPARAM)ptszBuf); } @@ -1636,7 +1636,7 @@ LABEL_SHOWWINDOW: int item = LOWORD(SendDlgItemMessage(hwndDlg, IDC_CHAT_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, @@ -1668,7 +1668,7 @@ LABEL_SHOWWINDOW: LRESULT lResult = (LRESULT)SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_GETSEL, 0, 0); int start = LOWORD(lResult); size_t dwNameLenMax = (mir_tstrlen(ui->pszUID) + 4); - 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 -- cgit v1.2.3