From 2f261839b60692e33d0e160344d0d636d49c90ba Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 27 Jul 2016 14:23:31 +0000 Subject: less TCHARs git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/YAPP/src/popwin.cpp | 14 ++++++------ plugins/YAPP/src/services.cpp | 2 +- plugins/YAPP/src/yapp.cpp | 40 +++++++++++++++++------------------ plugins/YAPP/src/yapp_history.cpp | 4 ++-- plugins/YAPP/src/yapp_history_dlg.cpp | 8 +++---- 5 files changed, 34 insertions(+), 34 deletions(-) (limited to 'plugins/YAPP') diff --git a/plugins/YAPP/src/popwin.cpp b/plugins/YAPP/src/popwin.cpp index 7bbdc6ca52..60f273e1f0 100644 --- a/plugins/YAPP/src/popwin.cpp +++ b/plugins/YAPP/src/popwin.cpp @@ -469,7 +469,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (pwd->custom_col) SetTextColor(ps.hdc, pd->colorText); else SetTextColor(ps.hdc, colFirstLine); - wchar_t *title = mir_u2t(pd->pwzTitle); + wchar_t *title = mir_wstrdup(pd->pwzTitle); DrawText(ps.hdc, title, -1, &tr, DT_VCENTER | DT_LEFT | DT_END_ELLIPSIS | DT_SINGLELINE | DT_NOPREFIX); mir_free(title); @@ -491,7 +491,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (options.av_layout != PAV_NONE && options.time_layout == PT_WITHAV && pwd->time_height <= pwd->tb_height && !pwd->have_av) GetClientRect(hwnd, &r); - wchar_t *text = mir_u2t(pd->pwzText); + wchar_t *text = mir_wstrdup(pd->pwzText); tr.left = r.left + options.padding + options.text_indent; tr.right = r.right - options.padding; tr.top = tr.bottom + options.padding; tr.bottom = r.bottom - options.padding; DrawText(ps.hdc, text, -1, &tr, DT_NOPREFIX | DT_WORDBREAK | DT_EXTERNALLEADING | DT_TOP | DT_LEFT | DT_WORD_ELLIPSIS); mir_free(text); @@ -560,7 +560,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa return TRUE; case PUM_SETTEXT: - replaceStrT(pd->ptzText, (wchar_t*)lParam); + replaceStrW(pd->ptzText, (wchar_t*)lParam); InvalidateRect(hwnd, 0, TRUE); RepositionWindows(); return TRUE; @@ -585,15 +585,15 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (options.time_layout != PT_NONE) { SIZE size_t; if (hFontTime) SelectObject(hdc, (HGDIOBJ)hFontTime); - GetTextExtentPoint32(hdc, pwd->tbuff, (int)mir_tstrlen(pwd->tbuff), &size_t); + GetTextExtentPoint32(hdc, pwd->tbuff, (int)mir_wstrlen(pwd->tbuff), &size_t); pwd->time_height = size_t.cy; pwd->time_width = size_t.cx; } // titlebar height if (hFontFirstLine) SelectObject(hdc, (HGDIOBJ)hFontFirstLine); - wchar_t *title = mir_u2t(pd->pwzTitle); - GetTextExtentPoint32(hdc, title, (int)mir_tstrlen(title), &size); + wchar_t *title = mir_wstrdup(pd->pwzTitle); + GetTextExtentPoint32(hdc, title, (int)mir_wstrlen(title), &size); mir_free(title); pwd->tb_height = size.cy; if (options.time_layout == PT_LEFT || options.time_layout == PT_RIGHT) { @@ -630,7 +630,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa r.right -= pwd->time_width + options.padding; if (hFontSecondLine) SelectObject(hdc, (HGDIOBJ)hFontSecondLine); - wchar_t *text = mir_u2t(pd->pwzText); + wchar_t *text = mir_wstrdup(pd->pwzText); DrawText(hdc, text, -1, &r, DT_CALCRECT | DT_NOPREFIX | DT_WORDBREAK | DT_EXTERNALLEADING | DT_TOP | DT_LEFT | DT_WORD_ELLIPSIS); pwd->text_height = r.bottom; mir_free(text); diff --git a/plugins/YAPP/src/services.cpp b/plugins/YAPP/src/services.cpp index 8b74676a1b..da7c2d89b8 100644 --- a/plugins/YAPP/src/services.cpp +++ b/plugins/YAPP/src/services.cpp @@ -289,7 +289,7 @@ static INT_PTR ShowMessage(WPARAM wParam, LPARAM lParam) if (db_get_b(0, "Popup", "ModuleIsEnabled", 1)) { POPUPDATAT pd = {0}; - mir_tstrcpy(pd.lptzContactName, lParam == SM_WARNING ? L"Warning" : L"Notification"); + mir_wstrcpy(pd.lptzContactName, lParam == SM_WARNING ? L"Warning" : L"Notification"); pd.lchIcon = LoadIcon(0, lParam == SM_WARNING ? IDI_WARNING : IDI_INFORMATION); wcsncpy(pd.lptzText, _A2T((char *)wParam), MAX_SECONDLINE); pd.lptzText[MAX_SECONDLINE-1] = 0; CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&pd, 0); diff --git a/plugins/YAPP/src/yapp.cpp b/plugins/YAPP/src/yapp.cpp index 06ce6610fd..79f787dbc7 100644 --- a/plugins/YAPP/src/yapp.cpp +++ b/plugins/YAPP/src/yapp.cpp @@ -94,40 +94,40 @@ static void InitFonts() { font_id_firstline.cbSize = sizeof(FontIDT); font_id_firstline.flags = FIDF_ALLOWEFFECTS; - mir_tstrcpy(font_id_firstline.group, LPGENW("Popups")); - mir_tstrcpy(font_id_firstline.name, LPGENW("First line")); + mir_wstrcpy(font_id_firstline.group, LPGENW("Popups")); + mir_wstrcpy(font_id_firstline.name, LPGENW("First line")); mir_strcpy(font_id_firstline.dbSettingsGroup, MODULE); mir_strcpy(font_id_firstline.prefix, "FontFirst"); - mir_tstrcpy(font_id_firstline.backgroundGroup, L"Popups"); - mir_tstrcpy(font_id_firstline.backgroundName, L"Background"); + mir_wstrcpy(font_id_firstline.backgroundGroup, L"Popups"); + mir_wstrcpy(font_id_firstline.backgroundName, L"Background"); font_id_firstline.order = 0; FontRegisterT(&font_id_firstline); font_id_secondline.cbSize = sizeof(FontIDT); font_id_secondline.flags = FIDF_ALLOWEFFECTS; - mir_tstrcpy(font_id_secondline.group, LPGENW("Popups")); - mir_tstrcpy(font_id_secondline.name, LPGENW("Second line")); + mir_wstrcpy(font_id_secondline.group, LPGENW("Popups")); + mir_wstrcpy(font_id_secondline.name, LPGENW("Second line")); mir_strcpy(font_id_secondline.dbSettingsGroup, MODULE); mir_strcpy(font_id_secondline.prefix, "FontSecond"); - mir_tstrcpy(font_id_secondline.backgroundGroup, L"Popups"); - mir_tstrcpy(font_id_secondline.backgroundName, L"Background"); + mir_wstrcpy(font_id_secondline.backgroundGroup, L"Popups"); + mir_wstrcpy(font_id_secondline.backgroundName, L"Background"); font_id_secondline.order = 1; FontRegisterT(&font_id_secondline); font_id_time.cbSize = sizeof(FontIDT); font_id_time.flags = FIDF_ALLOWEFFECTS; - mir_tstrcpy(font_id_time.group, LPGENW("Popups")); - mir_tstrcpy(font_id_time.name, LPGENW("Time")); + mir_wstrcpy(font_id_time.group, LPGENW("Popups")); + mir_wstrcpy(font_id_time.name, LPGENW("Time")); mir_strcpy(font_id_time.dbSettingsGroup, MODULE); mir_strcpy(font_id_time.prefix, "FontTime"); - mir_tstrcpy(font_id_time.backgroundGroup, L"Popups"); - mir_tstrcpy(font_id_time.backgroundName, L"Background"); + mir_wstrcpy(font_id_time.backgroundGroup, L"Popups"); + mir_wstrcpy(font_id_time.backgroundName, L"Background"); font_id_time.order = 2; FontRegisterT(&font_id_time); colour_id_bg.cbSize = sizeof(ColourIDT); - mir_tstrcpy(colour_id_bg.group, LPGENW("Popups")); - mir_tstrcpy(colour_id_bg.name, LPGENW("Background")); + mir_wstrcpy(colour_id_bg.group, LPGENW("Popups")); + mir_wstrcpy(colour_id_bg.name, LPGENW("Background")); mir_strcpy(colour_id_bg.dbSettingsGroup, MODULE); mir_strcpy(colour_id_bg.setting, "ColourBg"); colour_id_bg.defcolour = GetSysColor(COLOR_3DSHADOW); @@ -135,8 +135,8 @@ static void InitFonts() ColourRegisterT(&colour_id_bg); colour_id_border.cbSize = sizeof(ColourIDT); - mir_tstrcpy(colour_id_border.group, LPGENW("Popups")); - mir_tstrcpy(colour_id_border.name, LPGENW("Border")); + mir_wstrcpy(colour_id_border.group, LPGENW("Popups")); + mir_wstrcpy(colour_id_border.name, LPGENW("Border")); mir_strcpy(colour_id_border.dbSettingsGroup, MODULE); mir_strcpy(colour_id_border.setting, "ColourBorder"); colour_id_border.defcolour = RGB(0, 0, 0); @@ -144,8 +144,8 @@ static void InitFonts() ColourRegisterT(&colour_id_border); colour_id_sidebar.cbSize = sizeof(ColourIDT); - mir_tstrcpy(colour_id_sidebar.group, LPGENW("Popups")); - mir_tstrcpy(colour_id_sidebar.name, LPGENW("Sidebar")); + mir_wstrcpy(colour_id_sidebar.group, LPGENW("Popups")); + mir_wstrcpy(colour_id_sidebar.name, LPGENW("Sidebar")); mir_strcpy(colour_id_sidebar.dbSettingsGroup, MODULE); mir_strcpy(colour_id_sidebar.setting, "ColourSidebar"); colour_id_sidebar.defcolour = RGB(128, 128, 128); @@ -153,8 +153,8 @@ static void InitFonts() ColourRegisterT(&colour_id_sidebar); colour_id_titleunderline.cbSize = sizeof(ColourIDT); - mir_tstrcpy(colour_id_titleunderline.group, LPGENW("Popups")); - mir_tstrcpy(colour_id_titleunderline.name, LPGENW("Title underline")); + mir_wstrcpy(colour_id_titleunderline.group, LPGENW("Popups")); + mir_wstrcpy(colour_id_titleunderline.name, LPGENW("Title underline")); mir_strcpy(colour_id_titleunderline.dbSettingsGroup, MODULE); mir_strcpy(colour_id_titleunderline.setting, "ColourTitleUnderline"); colour_id_titleunderline.defcolour = GetSysColor(COLOR_3DSHADOW); diff --git a/plugins/YAPP/src/yapp_history.cpp b/plugins/YAPP/src/yapp_history.cpp index 08ff8f747a..8e02c3c2ca 100644 --- a/plugins/YAPP/src/yapp_history.cpp +++ b/plugins/YAPP/src/yapp_history.cpp @@ -68,8 +68,8 @@ void PopupHistoryList::Add(wchar_t *title, wchar_t *message, time_t timestamp) PopupHistoryData item = {0}; //create an unicode history item item.flags = PHDF_UNICODE; //mark it as unicode item.timestamp = timestamp; - item.titleT = mir_u2t(title); - item.messageT = mir_u2t(message); + item.titleT = mir_wstrdup(title); + item.messageT = mir_wstrdup(message); AddItem(item); //add it } diff --git a/plugins/YAPP/src/yapp_history_dlg.cpp b/plugins/YAPP/src/yapp_history_dlg.cpp index 535b4a7ee5..c3b7a08e35 100644 --- a/plugins/YAPP/src/yapp_history_dlg.cpp +++ b/plugins/YAPP/src/yapp_history_dlg.cpp @@ -120,7 +120,7 @@ static int lastColumn = -1; //last sort column int MatchesFilterCS(const wchar_t *filter, const PopupHistoryData *popupItem) //case sensitive { - if (mir_tstrlen(filter) <= 0) { return 1; } //if no filter is set then the popup item matches the filter + if (mir_wstrlen(filter) <= 0) { return 1; } //if no filter is set then the popup item matches the filter int match = 0; match = (wcsstr(popupItem->messageT, filter)) ? 1 : match; //check message part @@ -149,7 +149,7 @@ __inline void ConvertCase(wchar_t *dest, const wchar_t *source, size_t size) int MatchesFilterCI(const wchar_t *filterS, const PopupHistoryData *popupItem) { - if (mir_tstrlen(filterS) <= 0) { return 1; } //if no filter is set then the popup item matches the filter + if (mir_wstrlen(filterS) <= 0) { return 1; } //if no filter is set then the popup item matches the filter int match = 0; const int BUFFER_SIZE = 1024; wchar_t buffer[BUFFER_SIZE]; @@ -187,7 +187,7 @@ int CALLBACK PopupsCompare(LPARAM lParam1, LPARAM lParam2, LPARAM myParam) ListView_GetItemText(params.hList, (int) lParam1, params.column, text1, _countof(text1)); ListView_GetItemText(params.hList, (int) lParam2, params.column, text2, _countof(text2)); - res = mir_tstrcmpi(text1, text2); + res = mir_wstrcmpi(text1, text2); res = (params.column == lastColumn) ? -res : res; //do reverse search on second click on same column @@ -489,7 +489,7 @@ void CopyPopupDataToClipboard(HWND hList, int selection) if (found) { EmptyClipboard(); - int len = (int)mir_tstrlen(buffer); + int len = (int)mir_wstrlen(buffer); HANDLE hData = GlobalAlloc(GMEM_MOVEABLE, (len + 2) * sizeof(wchar_t)); clipboard = (wchar_t *) GlobalLock(hData); -- cgit v1.2.3