From 8ae3679aa1339ce9abee53adb69902bd6b7513dc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 25 Jul 2016 10:31:04 +0000 Subject: hello, Unix. phase 1: removing _T() git-svn-id: http://svn.miranda-ng.org/main/trunk@17127 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SmileyAdd/src/customsmiley.cpp | 4 +- plugins/SmileyAdd/src/dlgboxsubclass.cpp | 2 +- plugins/SmileyAdd/src/download.cpp | 14 ++--- plugins/SmileyAdd/src/general.cpp | 18 +++---- plugins/SmileyAdd/src/imagecache.cpp | 12 ++--- plugins/SmileyAdd/src/options.cpp | 20 +++---- plugins/SmileyAdd/src/richcall.cpp | 2 +- plugins/SmileyAdd/src/services.cpp | 22 ++++---- plugins/SmileyAdd/src/smileyroutines.cpp | 4 +- plugins/SmileyAdd/src/smileys.cpp | 92 ++++++++++++++++---------------- plugins/SmileyAdd/src/smileys.h | 2 +- plugins/SmileyAdd/src/smltool.cpp | 8 +-- 12 files changed, 100 insertions(+), 100 deletions(-) (limited to 'plugins/SmileyAdd') diff --git a/plugins/SmileyAdd/src/customsmiley.cpp b/plugins/SmileyAdd/src/customsmiley.cpp index 0a6be1ca46..97480911f6 100644 --- a/plugins/SmileyAdd/src/customsmiley.cpp +++ b/plugins/SmileyAdd/src/customsmiley.cpp @@ -96,7 +96,7 @@ bool SmileyCType::CreateTriggerText(char *text) bool SmileyPackCType::LoadSmileyDir(TCHAR *dir) { CMString dirs = dir; - dirs += _T("\\*.*"); + dirs += L"\\*.*"; _tfinddata_t c_file; INT_PTR hFile = _tfindfirst((TCHAR*)dirs.c_str(), &c_file); @@ -104,7 +104,7 @@ bool SmileyPackCType::LoadSmileyDir(TCHAR *dir) do { if (c_file.name[0] != '.') { CMString fullpath = dir; - fullpath = fullpath + _T("\\") + c_file.name; + fullpath = fullpath + L"\\" + c_file.name; TCHAR *div = _tcsrchr(c_file.name, '.'); if (div) { *div = 0; diff --git a/plugins/SmileyAdd/src/dlgboxsubclass.cpp b/plugins/SmileyAdd/src/dlgboxsubclass.cpp index fa5d09face..70f5082737 100644 --- a/plugins/SmileyAdd/src/dlgboxsubclass.cpp +++ b/plugins/SmileyAdd/src/dlgboxsubclass.cpp @@ -113,7 +113,7 @@ public: hSmlButton = CreateWindowEx( WS_EX_LEFT | WS_EX_NOPARENTNOTIFY | WS_EX_TOPMOST, MIRANDABUTTONCLASS, - _T("S"), + L"S", WS_CHILD | WS_VISIBLE | WS_TABSTOP, rect.left, rect.top, diff --git a/plugins/SmileyAdd/src/download.cpp b/plugins/SmileyAdd/src/download.cpp index 5c39cc3844..b015c34603 100644 --- a/plugins/SmileyAdd/src/download.cpp +++ b/plugins/SmileyAdd/src/download.cpp @@ -158,13 +158,13 @@ void __cdecl SmileyDownloadThread(void*) bool GetSmileyFile(CMString &url, const CMString &packstr) { - _TPattern *urlsplit = _TPattern::compile(_T(".*/(.*)")); + _TPattern *urlsplit = _TPattern::compile(L".*/(.*)"); _TMatcher *m0 = urlsplit->createTMatcher(url); m0->findFirstMatch(); CMString filename; - filename.AppendFormat(_T("%s\\%s\\"), cachepath, packstr.c_str()); + filename.AppendFormat(L"%s\\%s\\", cachepath, packstr.c_str()); int pathpos = filename.GetLength(); filename += m0->getGroup(1); @@ -173,7 +173,7 @@ bool GetSmileyFile(CMString &url, const CMString &packstr) bool needext = filename.Find('.') == -1; if (needext) - filename += _T(".*"); + filename += L".*"; _tfinddata_t c_file; INT_PTR hFile = _tfindfirst((TCHAR*)filename.c_str(), &c_file); @@ -202,18 +202,18 @@ bool GetSmileyFile(CMString &url, const CMString &packstr) int FolderChanged(WPARAM, LPARAM) { - FoldersGetCustomPathT(hFolder, cachepath, MAX_PATH, _T("")); + FoldersGetCustomPathT(hFolder, cachepath, MAX_PATH, L""); return 0; } void GetSmileyCacheFolder(void) { - hFolder = FoldersRegisterCustomPathT(LPGEN("SmileyAdd"), LPGEN("Smiley cache"), MIRANDA_USERDATAT _T("\\SmileyCache")); + hFolder = FoldersRegisterCustomPathT(LPGEN("SmileyAdd"), LPGEN("Smiley cache"), MIRANDA_USERDATAT L"\\SmileyCache"); if (hFolder) { - FoldersGetCustomPathT(hFolder, cachepath, MAX_PATH, _T("")); + FoldersGetCustomPathT(hFolder, cachepath, MAX_PATH, L""); HookEvent(ME_FOLDERS_PATH_CHANGED, FolderChanged); } - else mir_tstrncpy(cachepath, VARST(_T("%miranda_userdata%\\SmileyCache")), MAX_PATH); + else mir_tstrncpy(cachepath, VARST(L"%miranda_userdata%\\SmileyCache"), MAX_PATH); } void DownloadInit(void) diff --git a/plugins/SmileyAdd/src/general.cpp b/plugins/SmileyAdd/src/general.cpp index f09ccbb30e..5a6b94ca63 100644 --- a/plugins/SmileyAdd/src/general.cpp +++ b/plugins/SmileyAdd/src/general.cpp @@ -38,7 +38,7 @@ int CalculateTextHeight(HDC hdc, CHARFORMAT2 *chf) SelectObject(hcdc, hFont); SIZE fontSize; - GetTextExtentPoint32(hcdc, _T(")"), 1, &fontSize); + GetTextExtentPoint32(hcdc, L")", 1, &fontSize); DeleteObject(hFont); DeleteDC(hcdc); @@ -61,7 +61,7 @@ HICON GetDefaultIcon(bool copy) const TCHAR* GetImageExt(CMString &fname) { - const TCHAR *ext = _T(""); + const TCHAR *ext = L""; int fileId = _topen(fname.c_str(), O_RDONLY | _O_BINARY); if (fileId != -1) { @@ -70,13 +70,13 @@ const TCHAR* GetImageExt(CMString &fname) int bytes = _read(fileId, buf, sizeof(buf)); if (bytes > 4) { if (*(unsigned short*)buf == 0xd8ff) - ext = _T("jpg"); + ext = L"jpg"; else if (*(unsigned short*)buf == 0x4d42) - ext = _T("bmp"); + ext = L"bmp"; else if (*(unsigned*)buf == 0x474e5089) - ext = _T("png"); + ext = L"png"; else if (*(unsigned*)buf == 0x38464947) - ext = _T("gif"); + ext = L"gif"; } _close(fileId); } @@ -186,8 +186,8 @@ bool InitGdiPlus(void) { Gdiplus::GdiplusStartupInput gdiplusStartupInput; - static const TCHAR errmsg[] = _T("GDI+ not installed.\n") - _T("GDI+ can be downloaded here: http://www.microsoft.com/downloads"); + static const TCHAR errmsg[] = L"GDI+ not installed.\n" + L"GDI+ can be downloaded here: http://www.microsoft.com/downloads"; __try { if (g_gdiplusToken == 0 && !gdiPlusFail) @@ -229,7 +229,7 @@ bool IsSmileyProto(char *proto) void ReportError(const TCHAR *errmsg) { - static const TCHAR title[] = _T("Miranda SmileyAdd"); + static const TCHAR title[] = L"Miranda SmileyAdd"; POPUPDATAT pd = { 0 }; mir_tstrcpy(pd.lpwzContactName, title); diff --git a/plugins/SmileyAdd/src/imagecache.cpp b/plugins/SmileyAdd/src/imagecache.cpp index 755c2b8165..1592a858fc 100644 --- a/plugins/SmileyAdd/src/imagecache.cpp +++ b/plugins/SmileyAdd/src/imagecache.cpp @@ -527,7 +527,7 @@ void DestroyImageCache(void) ImageBase* AddCacheImage(const CMString &file, int index) { - CMString tmpfile(file); tmpfile.AppendFormat(_T("#%d"), index); + CMString tmpfile(file); tmpfile.AppendFormat(L"#%d", index); unsigned id = mir_hash(tmpfile.c_str(), tmpfile.GetLength() * sizeof(TCHAR)); WaitForSingleObject(g_hMutexIm, 3000); @@ -541,15 +541,15 @@ ImageBase* AddCacheImage(const CMString &file, int index) CMString ext = file.Mid(ind + 1); ext.MakeLower(); - if (ext == _T("dll") || ext == _T("exe")) + if (ext == L"dll" || ext == L"exe") img = opt.HQScaling ? (ImageBase*)new ImageType(id, file, index, icoDll) : (ImageBase*)new IconType(id, file, index, icoDll); - else if (ext == _T("ico")) + else if (ext == L"ico") img = opt.HQScaling ? (ImageBase*)new ImageType(id, file, 0, icoFile) : (ImageBase*)new IconType(id, file, 0, icoFile); - else if (ext == _T("icl")) + else if (ext == L"icl") img = opt.HQScaling ? (ImageBase*)new ImageType(id, file, index, icoIcl) : (ImageBase*)new IconType(id, file, index, icoIcl); - else if (ext == _T("gif")) + else if (ext == L"gif") img = new ImageType(id, file, NULL); - else if (fei == NULL || ext == _T("tif") || ext == _T("tiff")) + else if (fei == NULL || ext == L"tif" || ext == L"tiff") img = new ImageType(id, file, NULL); else img = opt.HQScaling ? (ImageBase*)new ImageType(id, file, NULL) : (ImageBase*)new ImageFType(id, file); diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp index e2cf526a9f..86264d591a 100644 --- a/plugins/SmileyAdd/src/options.cpp +++ b/plugins/SmileyAdd/src/options.cpp @@ -286,7 +286,7 @@ void OptionsDialogType::UpdateVisibleSmPackList(void) bool visible = useOne ? !smc[i].IsProto() : visiblecat; if (!visible && smc[i].IsAcc() && !useOne) { - CMString PhysProtoName = _T("AllProto"); + CMString PhysProtoName = L"AllProto"; CMString ProtoName = smc[i].GetName(); DBVARIANT dbv; if (db_get_ts(NULL, _T2A(ProtoName.GetBuffer()), "AM_BaseProto", &dbv) == 0) { @@ -463,14 +463,14 @@ bool OptionsDialogType::BrowseForSmileyPacks(int item) { OPENFILENAME ofn = { 0 }; - TCHAR filename[MAX_PATH] = _T(""); + TCHAR filename[MAX_PATH] = L""; ofn.lpstrFile = filename; ofn.nMaxFile = _countof(filename); CMString inidir; SmileyCategoryType *smc = tmpsmcat.GetSmileyCategory(item); if (smc->GetFilename().IsEmpty()) - pathToAbsolute(_T("Smileys"), inidir); + pathToAbsolute(L"Smileys", inidir); else { pathToAbsolute(smc->GetFilename(), inidir); inidir.Truncate(inidir.ReverseFind('\\')); @@ -482,21 +482,21 @@ bool OptionsDialogType::BrowseForSmileyPacks(int item) TCHAR filter[512], *pfilter; mir_tstrcpy(filter, TranslateT("Smiley packs")); - mir_tstrcat(filter, _T(" (*.msl;*.asl;*.xep)")); + mir_tstrcat(filter, L" (*.msl;*.asl;*.xep)"); pfilter = filter + mir_tstrlen(filter) + 1; - mir_tstrcpy(pfilter, _T("*.msl;*.asl;*.xep")); + mir_tstrcpy(pfilter, L"*.msl;*.asl;*.xep"); pfilter = pfilter + mir_tstrlen(pfilter) + 1; mir_tstrcpy(pfilter, TranslateT("All files")); - mir_tstrcat(pfilter, _T(" (*.*)")); + mir_tstrcat(pfilter, L" (*.*)"); pfilter = pfilter + mir_tstrlen(pfilter) + 1; - mir_tstrcpy(pfilter, _T("*.*")); + mir_tstrcpy(pfilter, L"*.*"); pfilter = pfilter + mir_tstrlen(pfilter) + 1; *pfilter = '\0'; ofn.lpstrFilter = filter; ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_READONLY | OFN_EXPLORER | OFN_LONGNAMES | OFN_NOCHANGEDIR; - ofn.lpstrDefExt = _T("msl"); + ofn.lpstrDefExt = L"msl"; if (GetOpenFileName(&ofn)) { CMString relpath; @@ -590,7 +590,7 @@ void OptionsType::Load(void) void OptionsType::ReadPackFileName(CMString &filename, const CMString &name, const CMString &defaultFilename) { - CMString settingKey = name + _T("-filename"); + CMString settingKey = name + L"-filename"; ptrT tszValue(db_get_tsa(NULL, "SmileyAdd", _T2A(settingKey.c_str()))); filename = (tszValue != NULL) ? (TCHAR*)tszValue : defaultFilename; @@ -598,7 +598,7 @@ void OptionsType::ReadPackFileName(CMString &filename, const CMString &name, con void OptionsType::WritePackFileName(const CMString &filename, const CMString &name) { - CMString settingKey = name + _T("-filename"); + CMString settingKey = name + L"-filename"; db_set_ts(NULL, "SmileyAdd", _T2A(settingKey.c_str()), filename.c_str()); } diff --git a/plugins/SmileyAdd/src/richcall.cpp b/plugins/SmileyAdd/src/richcall.cpp index 7354488309..9e994418ea 100644 --- a/plugins/SmileyAdd/src/richcall.cpp +++ b/plugins/SmileyAdd/src/richcall.cpp @@ -109,7 +109,7 @@ static void SetTooltip(long x, long y, HWND hwnd, RichEditData *rdt) if (needtip != -1) { if (rdt->tipActive == -1) { - rdt->hToolTip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, _T(""), TTS_NOPREFIX | WS_POPUP, + rdt->hToolTip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, L"", TTS_NOPREFIX | WS_POPUP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hwnd, NULL, g_hInst, NULL); SendMessage(rdt->hToolTip, TTM_ADDTOOL, 0, (LPARAM)&ti); diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp index a8a8a20ee5..c0d453624c 100644 --- a/plugins/SmileyAdd/src/services.cpp +++ b/plugins/SmileyAdd/src/services.cpp @@ -36,7 +36,7 @@ SmileyPackType* GetSmileyPack(const char *proto, MCONTACT hContact, SmileyPackCT CMString categoryName; if (hContact != NULL) { opt.ReadContactCategory(hContact, categoryName); - if (categoryName == _T("")) return NULL; + if (categoryName == L"") return NULL; if (!categoryName.IsEmpty() && g_SmileyCategories.GetSmileyCategory(categoryName) == NULL) { categoryName.Empty(); opt.WriteContactCategory(hContact, categoryName); @@ -51,10 +51,10 @@ SmileyPackType* GetSmileyPack(const char *proto, MCONTACT hContact, SmileyPackCT db_free(&dbv); } else if (opt.UsePhysProto && db_get_ts(NULL, protonam, "AM_BaseProto", &dbv) == 0) { - categoryName = _T("AllProto"); + categoryName = L"AllProto"; categoryName += dbv.ptszVal; db_free(&dbv); - CMString categoryFileName = g_SmileyCategories.GetSmileyCategory(categoryName) ? g_SmileyCategories.GetSmileyCategory(categoryName)->GetFilename() : _T(""); + CMString categoryFileName = g_SmileyCategories.GetSmileyCategory(categoryName) ? g_SmileyCategories.GetSmileyCategory(categoryName)->GetFilename() : L""; if (categoryFileName.IsEmpty()) categoryName = _A2T(protonam); } @@ -66,13 +66,13 @@ SmileyPackType* GetSmileyPack(const char *proto, MCONTACT hContact, SmileyPackCT if (categoryName.IsEmpty()) { if (proto == NULL || proto[0] == 0) - categoryName = _T("Standard"); + categoryName = L"Standard"; else { categoryName = _A2T(proto); if (opt.UseOneForAll) { SmileyCategoryType *smc = g_SmileyCategories.GetSmileyCategory(categoryName); if (smc == NULL || smc->IsProto()) - categoryName = _T("Standard"); + categoryName = L"Standard"; } } } @@ -250,7 +250,7 @@ INT_PTR CustomCatMenu(WPARAM hContact, LPARAM lParam) opt.WriteContactCategory(hContact, smct->GetName()); else { CMString empty; - if (lParam == 1) empty = _T(""); + if (lParam == 1) empty = L""; opt.WriteContactCategory(hContact, empty); } NotifyEventHooks(hEvent1, hContact, 0); @@ -315,8 +315,8 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) } mi.position = 1; - mi.name.t = _T(""); - if (cat == _T("")) { + mi.name.t = L""; + if (cat == L"") { mi.flags |= CMIF_CHECKED; nonecheck = false; } @@ -382,7 +382,7 @@ int AccountListChanged(WPARAM wParam, LPARAM lParam) switch (wParam) { case PRAC_ADDED: if (acc != NULL) { - CMString catname(_T("Standard")); + CMString catname(L"Standard"); const CMString &defaultFile = g_SmileyCategories.GetSmileyCategory(catname)->GetFilename(); g_SmileyCategories.AddAccountAsCategory(acc, defaultFile); } @@ -406,7 +406,7 @@ int AccountListChanged(WPARAM wParam, LPARAM lParam) case PRAC_CHECKED: if (acc != NULL) { if (acc->bIsEnabled) { - CMString catname(_T("Standard")); + CMString catname(L"Standard"); const CMString &defaultFile = g_SmileyCategories.GetSmileyCategory(catname)->GetFilename(); g_SmileyCategories.AddAccountAsCategory(acc, defaultFile); } @@ -427,7 +427,7 @@ int DbSettingChanged(WPARAM hContact, LPARAM lParam) return 0; if (strcmp(cws->szSetting, "Transport") == 0) { - CMString catname(_T("Standard")); + CMString catname(L"Standard"); SmileyCategoryType *smc = g_SmileyCategories.GetSmileyCategory(catname); if (smc != NULL) g_SmileyCategories.AddContactTransportAsCategory(hContact, smc->GetFilename()); diff --git a/plugins/SmileyAdd/src/smileyroutines.cpp b/plugins/SmileyAdd/src/smileyroutines.cpp index 554ca0e492..d71a91fed0 100644 --- a/plugins/SmileyAdd/src/smileyroutines.cpp +++ b/plugins/SmileyAdd/src/smileyroutines.cpp @@ -223,7 +223,7 @@ void ReplaceSmileys(HWND hwnd, SmileyPackType *smp, SmileyPackCType *smcp, const TCHAR classname[20]; GetClassName(hwnd, classname, _countof(classname)); - bool ishpp = (_tcsncmp(classname, _T("THppRichEdit"), 12) == 0) || fireView; + bool ishpp = (_tcsncmp(classname, L"THppRichEdit", 12) == 0) || fireView; SetRichCallback(hwnd, NULL, false, true); @@ -261,7 +261,7 @@ void ReplaceSmileys(HWND hwnd, SmileyPackType *smp, SmileyPackCType *smcp, const unsigned numBTBSm = 0; - BSTR spaceb = SysAllocString(_T(" ")); + BSTR spaceb = SysAllocString(L" "); // Replace smileys specified in the list in RichEdit for (int j = smllist.getCount()-1; j >= 0; j--) { diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index 716b74572c..97c63f00a5 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -35,7 +35,7 @@ static void CALLBACK timerProc(HWND, UINT, UINT_PTR param, DWORD) static void CALLBACK sttStartTimer(PVOID obj) { if (hwndHidden == NULL) - hwndHidden = CreateWindowEx(0, _T("STATIC"), NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL); + hwndHidden = CreateWindowEx(0, L"STATIC", NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL); SmileyType *pType = (SmileyType*)obj; pType->SetFrameDelay(); @@ -212,7 +212,7 @@ static DWORD_PTR ConvertServiceParam(MCONTACT hContact, const TCHAR *param) { if (param == NULL) return 0; - if (mir_tstrcmpi(_T("hContact"), param) == 0) + if (mir_tstrcmpi(L"hContact", param) == 0) return hContact; if (_istdigit(*param)) return _ttoi(param); @@ -222,7 +222,7 @@ static DWORD_PTR ConvertServiceParam(MCONTACT hContact, const TCHAR *param) void SmileyType::CallSmileyService(MCONTACT hContact) { - _TPattern *srvsplit = _TPattern::compile(_T("(.*)\\|(.*)\\|(.*)")); + _TPattern *srvsplit = _TPattern::compile(L"(.*)\\|(.*)\\|(.*)"); _TMatcher *m0 = srvsplit->createTMatcher(GetTriggerText()); m0->findFirstMatch(); @@ -254,13 +254,13 @@ SmileyPackType::~SmileyPackType() } static const TCHAR urlRegEx[] = -_T("(?:ftp|https|http|file|aim|webcal|irc|msnim|xmpp|gopher|mailto|news|nntp|telnet|wais|prospero)://?[\\w.?%:/$+;]*"); -static const TCHAR pathRegEx[] = _T("[\\s\"][a-zA-Z]:[\\\\/][\\w.\\-\\\\/]*"); -static const TCHAR timeRegEx[] = _T("\\d{1,2}:\\d{2}:\\d{2}|\\d{1,2}:\\d{2}"); +L"(?:ftp|https|http|file|aim|webcal|irc|msnim|xmpp|gopher|mailto|news|nntp|telnet|wais|prospero)://?[\\w.?%:/$+;]*"; +static const TCHAR pathRegEx[] = L"[\\s\"][a-zA-Z]:[\\\\/][\\w.\\-\\\\/]*"; +static const TCHAR timeRegEx[] = L"\\d{1,2}:\\d{2}:\\d{2}|\\d{1,2}:\\d{2}"; void SmileyPackType::AddTriggersToSmileyLookup(void) { - _TPattern *p = _TPattern::compile(_T("\\s+")); + _TPattern *p = _TPattern::compile(L"\\s+"); { CMString emptystr; m_SmileyLookup.insert(new SmileyLookup(urlRegEx, true, -1, emptystr)); @@ -322,8 +322,8 @@ void SmileyPackType::AddTriggersToSmileyLookup(void) void SmileyPackType::ReplaceAllSpecials(const CMString &Input, CMString &Output) { - Output = _TPattern::replace(_T("%%_{1,2}%%"), Input, _T(" ")); - Output = _TPattern::replace(_T("%%''%%"), Output, _T("\"")); + Output = _TPattern::replace(L"%%_{1,2}%%", Input, L" "); + Output = _TPattern::replace(L"%%''%%", Output, L"\""); } void SmileyPackType::Clear(void) @@ -346,7 +346,7 @@ bool SmileyPackType::LoadSmileyFile(const CMString &filename, const CMString &pa Clear(); if (filename.IsEmpty()) { - m_Name = _T("Nothing loaded"); + m_Name = L"Nothing loaded"; return false; } @@ -363,7 +363,7 @@ bool SmileyPackType::LoadSmileyFile(const CMString &filename, const CMString &pa ReportError(msgtxt); } - m_Name = _T("Nothing loaded"); + m_Name = L"Nothing loaded"; return false; } @@ -394,7 +394,7 @@ bool SmileyPackType::LoadSmileyFile(const CMString &filename, const CMString &pa delete[] buf; bool res; - if (filename.Find(_T(".xep")) == -1) + if (filename.Find(L".xep") == -1) res = LoadSmileyFileMSL(tbuf, onlyInfo, modpath); else res = LoadSmileyFileXEP(tbuf, onlyInfo, modpath); @@ -409,7 +409,7 @@ bool SmileyPackType::LoadSmileyFileMSL(CMString &tbuf, bool onlyInfo, CMString & { CMString pathstr, packstr; { - _TPattern *pathsplit = _TPattern::compile(_T("(.*\\\\)(.*)\\.|$")); + _TPattern *pathsplit = _TPattern::compile(L"(.*\\\\)(.*)\\.|$"); _TMatcher *m0 = pathsplit->createTMatcher(modpath); m0->findFirstMatch(); pathstr = m0->getGroup(1); @@ -419,16 +419,16 @@ bool SmileyPackType::LoadSmileyFileMSL(CMString &tbuf, bool onlyInfo, CMString & } { _TPattern *otherf = _TPattern::compile( - _T("^\\s*(Name|Author|Date|Version|ButtonSmiley)\\s*=\\s*\"(.*)\""), + L"^\\s*(Name|Author|Date|Version|ButtonSmiley)\\s*=\\s*\"(.*)\"", _TPattern::MULTILINE_MATCHING); _TMatcher *m0 = otherf->createTMatcher(tbuf); while (m0->findNextMatch()) { - if (m0->getGroup(1) == _T("Name")) m_Name = m0->getGroup(2); - if (m0->getGroup(1) == _T("Author")) m_Author = m0->getGroup(2); - if (m0->getGroup(1) == _T("Date")) m_Date = m0->getGroup(2); - if (m0->getGroup(1) == _T("Version")) m_Version = m0->getGroup(2); - if (m0->getGroup(1) == _T("ButtonSmiley")) m_ButtonSmiley = m0->getGroup(2); + if (m0->getGroup(1) == L"Name") m_Name = m0->getGroup(2); + if (m0->getGroup(1) == L"Author") m_Author = m0->getGroup(2); + if (m0->getGroup(1) == L"Date") m_Date = m0->getGroup(2); + if (m0->getGroup(1) == L"Version") m_Version = m0->getGroup(2); + if (m0->getGroup(1) == L"ButtonSmiley") m_ButtonSmiley = m0->getGroup(2); } delete m0; delete otherf; @@ -438,7 +438,7 @@ bool SmileyPackType::LoadSmileyFileMSL(CMString &tbuf, bool onlyInfo, CMString & selec.x = selec.y = win.x = win.y = 0; { _TPattern *pat = _TPattern::compile( - _T("^\\s*(Selection|Window)Size\\s*=\\s*(\\d+)\\s*,\\s*(\\d+)"), + L"^\\s*(Selection|Window)Size\\s*=\\s*(\\d+)\\s*,\\s*(\\d+)", _TPattern::MULTILINE_MATCHING); _TMatcher *m0 = pat->createTMatcher(tbuf); while (m0->findNextMatch()) { @@ -446,9 +446,9 @@ bool SmileyPackType::LoadSmileyFileMSL(CMString &tbuf, bool onlyInfo, CMString & tpt.x = _ttol(m0->getGroup(2).c_str()); tpt.y = _ttol(m0->getGroup(3).c_str()); - if (m0->getGroup(1) == _T("Selection")) + if (m0->getGroup(1) == L"Selection") selec = tpt; - else if (m0->getGroup(1) == _T("Window")) + else if (m0->getGroup(1) == L"Window") win = tpt; } delete m0; @@ -456,12 +456,12 @@ bool SmileyPackType::LoadSmileyFileMSL(CMString &tbuf, bool onlyInfo, CMString & } _TPattern *smiley = _TPattern::compile( - _T("^\\s*Smiley(\\*)?\\s*=") // Is Hidden - _T("(?:\\s*\"(.*)\")") // Smiley file name - _T("(?:[\\s,]+(\\-?\\d+))") // Icon resource id - _T("(?:[\\s,]+(R|S)?\"(.*?)\")") // Trigger text - _T("(?:[\\s,]+\"(.*?)\")?") // Tooltip or insert text - _T("(?:[\\s,]+\"(.*?)\")?"), // Tooltip text + L"^\\s*Smiley(\\*)?\\s*=" // Is Hidden + L"(?:\\s*\"(.*)\")" // Smiley file name + L"(?:[\\s,]+(\\-?\\d+))" // Icon resource id + L"(?:[\\s,]+(R|S)?\"(.*?)\")" // Trigger text + L"(?:[\\s,]+\"(.*?)\"?)" // Tooltip or insert text + L"(?:[\\s,]+\"(.*?)\"?)", // Tooltip text _TPattern::MULTILINE_MATCHING); SmileyVectorType hiddenSmileys; @@ -470,7 +470,7 @@ bool SmileyPackType::LoadSmileyFileMSL(CMString &tbuf, bool onlyInfo, CMString & _TMatcher *m0 = smiley->createTMatcher(tbuf); while (m0->findNextMatch()) { CMString resname = m0->getGroup(2); - if (resname.Find(_T("http://")) != -1) { + if (resname.Find(L"http://") != -1) { if (GetSmileyFile(resname, packstr)) continue; } @@ -483,8 +483,8 @@ bool SmileyPackType::LoadSmileyFileMSL(CMString &tbuf, bool onlyInfo, CMString & dat->SetHidden(m0->getStartingIndex(1) >= 0); if (m0->getStartingIndex(4) >= 0) { - dat->SetRegEx(m0->getGroup(4) == _T("R")); - dat->SetService(m0->getGroup(4) == _T("S")); + dat->SetRegEx(m0->getGroup(4) == L"R"); + dat->SetService(m0->getGroup(4) == L"S"); } dat->m_TriggerText = m0->getGroup(5); if (dat->IsRegEx()) { @@ -543,8 +543,8 @@ bool SmileyPackType::LoadSmileyFileMSL(CMString &tbuf, bool onlyInfo, CMString & static void DecodeHTML(CMString &str) { if (str.Find('&') != -1) { - str = _TPattern::replace(CMString(_T("<")), str, CMString(_T("<"))); - str = _TPattern::replace(CMString(_T(">")), str, CMString(_T(">"))); + str = _TPattern::replace(CMString(L"<"), str, CMString(L"<")); + str = _TPattern::replace(CMString(L">"), str, CMString(L">")); } } @@ -575,11 +575,11 @@ bool SmileyPackType::LoadSmileyFileXEP(CMString &tbuf, bool onlyInfo, CMString&) { _TMatcher *m0, *m1, *m2; - _TPattern *dbname_re = _TPattern::compile(_T("\\s*\"(.*?)\"\\s*"), + _TPattern *dbname_re = _TPattern::compile(L"\\s*\"(.*?)\"\\s*", _TPattern::MULTILINE_MATCHING); - _TPattern *author_re = _TPattern::compile(_T("\\s*\"(.*?)\"\\s*"), + _TPattern *author_re = _TPattern::compile(L"\\s*\"(.*?)\"\\s*", _TPattern::MULTILINE_MATCHING); - _TPattern *settings_re = _TPattern::compile(_T("(.*?)"), + _TPattern *settings_re = _TPattern::compile(L"(.*?)", _TPattern::MULTILINE_MATCHING | _TPattern::DOT_MATCHES_ALL); m0 = settings_re->createTMatcher(tbuf); @@ -607,17 +607,17 @@ bool SmileyPackType::LoadSmileyFileXEP(CMString &tbuf, bool onlyInfo, CMString&) delete settings_re; if (!onlyInfo) { - _TPattern *record_re = _TPattern::compile(_T("(?:\\s*\"(.*?)\")?(.*?)"), + _TPattern *record_re = _TPattern::compile(L"(?:\\s*\"(.*?)\"?(.*?))", _TPattern::MULTILINE_MATCHING | _TPattern::DOT_MATCHES_ALL); - _TPattern *expression_re = _TPattern::compile(_T("\\s*\"(.*?)\"\\s*"), + _TPattern *expression_re = _TPattern::compile(L"\\s*\"(.*?)\"\\s*", _TPattern::MULTILINE_MATCHING); - _TPattern *pastetext_re = _TPattern::compile(_T("\\s*\"(.*?)\"\\s*"), + _TPattern *pastetext_re = _TPattern::compile(L"\\s*\"(.*?)\"\\s*", _TPattern::MULTILINE_MATCHING); - _TPattern *images_re = _TPattern::compile(_T("(.*?)"), + _TPattern *images_re = _TPattern::compile(L"(.*?)", _TPattern::MULTILINE_MATCHING | _TPattern::DOT_MATCHES_ALL); - _TPattern *image_re = _TPattern::compile(_T("(.*?)"), + _TPattern *image_re = _TPattern::compile(L"(.*?)", _TPattern::MULTILINE_MATCHING | _TPattern::DOT_MATCHES_ALL); - _TPattern *imagedt_re = _TPattern::compile(_T(""), + _TPattern *imagedt_re = _TPattern::compile(L"", _TPattern::MULTILINE_MATCHING); m0 = images_re->createTMatcher(tbuf); @@ -875,13 +875,13 @@ void SmileyCategoryListType::AddAccountAsCategory(PROTOACCOUNT *acc, const CMStr DBVARIANT dbv; if (db_get_ts(NULL, acc->szModuleName, "AM_BaseProto", &dbv) == 0) { - PhysProtoName = _T("AllProto"); + PhysProtoName = L"AllProto"; PhysProtoName += dbv.ptszVal; db_free(&dbv); } if (!PhysProtoName.IsEmpty()) - paths = g_SmileyCategories.GetSmileyCategory(PhysProtoName) ? g_SmileyCategories.GetSmileyCategory(PhysProtoName)->GetFilename() : _T(""); + paths = g_SmileyCategories.GetSmileyCategory(PhysProtoName) ? g_SmileyCategories.GetSmileyCategory(PhysProtoName)->GetFilename() : L""; if (paths.IsEmpty()) { const char *packnam = acc->szProtoName; @@ -1009,7 +1009,7 @@ void SmileyCategoryListType::AddContactTransportAsCategory(MCONTACT hContact, co void SmileyCategoryListType::AddAllProtocolsAsCategory(void) { CMString displayName = TranslateT("Standard"); - CMString tname = _T("Standard"); + CMString tname = L"Standard"; AddCategory(tname, displayName, smcStd); const CMString &defaultFile = GetSmileyCategory(tname)->GetFilename(); @@ -1059,7 +1059,7 @@ SmileyLookup::SmileyLookup(const CMString &str, const bool regexs, const int ind m_ind = ind; if (regexs) { - static const CMString testString(_T("Test String")); + static const CMString testString(L"Test String"); m_pattern = _TPattern::compile(str); m_valid = m_pattern != NULL; if (m_valid) { diff --git a/plugins/SmileyAdd/src/smileys.h b/plugins/SmileyAdd/src/smileys.h index e61cd50920..765480e123 100644 --- a/plugins/SmileyAdd/src/smileys.h +++ b/plugins/SmileyAdd/src/smileys.h @@ -306,7 +306,7 @@ public: int NumberOfSmileyCategories(void) { return m_SmileyCategories.getCount(); } void AddCategory(const CMString& name, const CMString& displayName, SmcType typ, - const CMString& defaultFilename = CMString(_T("Smileys\\nova\\default.msl"))); + const CMString& defaultFilename = CMString(L"Smileys\\nova\\default.msl")); void AddAndLoad(const CMString& name, const CMString& displayName); void AddAllProtocolsAsCategory(void); void AddAccountAsCategory(PROTOACCOUNT *acc, const CMString& defaultFile); diff --git a/plugins/SmileyAdd/src/smltool.cpp b/plugins/SmileyAdd/src/smltool.cpp index c310abdbd6..d427c47644 100644 --- a/plugins/SmileyAdd/src/smltool.cpp +++ b/plugins/SmileyAdd/src/smltool.cpp @@ -525,7 +525,7 @@ void SmileyToolWindowType::InitDialog(LPARAM lParam) if (opt.AnimateSel) SetTimer(m_hwndDialog, 1, 100, NULL); //add tooltips - m_hToolTip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, _T(""), + m_hToolTip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, L"", TTS_NOPREFIX | WS_POPUP, 0, 0, 0, 0, m_hwndDialog, NULL, g_hInst, NULL); TOOLINFO ti = { 0 }; ti.cbSize = sizeof(ti); @@ -728,11 +728,11 @@ void __cdecl SmileyToolThread(void *arg) wndclass.hCursor = LoadCursor(NULL, IDC_ARROW); wndclass.hbrBackground = CreateSolidBrush(opt.SelWndBkgClr); wndclass.lpszMenuName = NULL; - wndclass.lpszClassName = _T("SmileyTool"); + wndclass.lpszClassName = L"SmileyTool"; wndclass.hIconSm = NULL; RegisterClassEx(&wndclass); - CreateWindowEx(WS_EX_TOPMOST | WS_EX_NOPARENTNOTIFY, _T("SmileyTool"), NULL, + CreateWindowEx(WS_EX_TOPMOST | WS_EX_NOPARENTNOTIFY, L"SmileyTool", NULL, WS_BORDER | WS_POPUP | WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, ((SmileyToolWindowParam*)arg)->hWndParent, NULL, g_hInst, arg); @@ -744,7 +744,7 @@ void __cdecl SmileyToolThread(void *arg) TranslateMessage(&msg); DispatchMessage(&msg); } - UnregisterClass(_T("SmileyTool"), g_hInst); + UnregisterClass(L"SmileyTool", g_hInst); } delete stwp; } -- cgit v1.2.3