diff options
author | George Hazan <george.hazan@gmail.com> | 2016-07-29 12:36:34 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-07-29 12:36:34 +0000 |
commit | 428bf0cbd77813a43094cb5c984436deff251936 (patch) | |
tree | d7dfa8971153d53a849e45c942be97fe5b90b7ec /src/mir_app | |
parent | 82ef17ca5286f58ae7af604fb9518e8dc496b7c3 (diff) |
no more TCHARs
git-svn-id: http://svn.miranda-ng.org/main/trunk@17143 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/mir_app')
63 files changed, 272 insertions, 272 deletions
diff --git a/src/mir_app/src/ExtraIconGroup.cpp b/src/mir_app/src/ExtraIconGroup.cpp index 7101175272..1057ab073e 100644 --- a/src/mir_app/src/ExtraIconGroup.cpp +++ b/src/mir_app/src/ExtraIconGroup.cpp @@ -38,7 +38,7 @@ void ExtraIconGroup::addExtraIcon(BaseExtraIcon *extra) {
m_items.insert(extra);
- CMString description;
+ CMStringW description;
for (int i = 0; i < m_items.getCount(); i++) {
if (i > 0)
description += L" / ";
diff --git a/src/mir_app/src/FontOptions.cpp b/src/mir_app/src/FontOptions.cpp index 30a6aa4d5e..b415cc284b 100644 --- a/src/mir_app/src/FontOptions.cpp +++ b/src/mir_app/src/FontOptions.cpp @@ -121,7 +121,7 @@ int __inline DrawTextWithEffect(HDC hdc, LPCTSTR lpchText, int cchText, RECT * l #define FSUI_FONTFRAMEVERT 4
#define FSUI_FONTLEFT (FSUI_COLORBOXLEFT+FSUI_COLORBOXWIDTH+5)
-void UpdateFontSettings(FontIDW *font_id, FontSettingsT *fontsettings);
+void UpdateFontSettings(FontIDW *font_id, FontSettingsW *fontsettings);
void UpdateColourSettings(ColourIDW *colour_id, COLORREF *colour);
void UpdateEffectSettings(EffectIDW *effect_id, FONTEFFECT* effectsettings);
@@ -340,7 +340,7 @@ static void sttFsuiCreateSettingsTreeNode(HWND hwndTree, const wchar_t *groupNam if (sectionName = wcschr(sectionName, '/'))
*sectionName = 0;
- pItemName = TranslateTH(_hLang, pItemName);
+ pItemName = TranslateW_LP(pItemName, _hLang);
hItem = sttFindNamedTreeItemAt(hwndTree, hSection, pItemName);
if (!sectionName || !hItem) {
@@ -448,7 +448,7 @@ static INT_PTR CALLBACK ChooseEffectDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wPar pEffect = (FONTEFFECT*)lParam;
{
for (int i = 0; i < _countof(ModernEffectNames); i++) {
- int itemid = SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_ADDSTRING, 0, (LPARAM)TranslateTS(ModernEffectNames[i]));
+ int itemid = SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_ADDSTRING, 0, (LPARAM)TranslateW(ModernEffectNames[i]));
SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_SETITEMDATA, itemid, i);
SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_SETCURSEL, 0, 0);
}
@@ -505,7 +505,7 @@ static void sttSaveFontData(HWND hwndDlg, FontInternal &F) else
strncpy_s(str, F.prefix, _TRUNCATE);
- if (db_set_ts(NULL, F.dbSettingsGroup, str, F.value.szFace)) {
+ if (db_set_ws(NULL, F.dbSettingsGroup, str, F.value.szFace)) {
char buff[1024];
WideCharToMultiByte(code_page, 0, F.value.szFace, -1, buff, 1024, 0, 0);
db_set_s(NULL, F.dbSettingsGroup, str, buff);
diff --git a/src/mir_app/src/FontService.cpp b/src/mir_app/src/FontService.cpp index 6e1d678965..58aefe7638 100644 --- a/src/mir_app/src/FontService.cpp +++ b/src/mir_app/src/FontService.cpp @@ -95,24 +95,24 @@ int LoadFontserviceModule(void) hColourReloadEvent = CreateHookableEvent(ME_COLOUR_RELOAD);
// create generic fonts
- FontIDT fontid = { sizeof(fontid) };
+ FontIDW fontid = { sizeof(fontid) };
strncpy(fontid.dbSettingsGroup, "Fonts", sizeof(fontid.dbSettingsGroup));
wcsncpy_s(fontid.group, LPGENW("General"), _TRUNCATE);
wcsncpy_s(fontid.name, LPGENW("Headers"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSHEADER;
strncpy(fontid.prefix, "Header", _countof(fontid.prefix));
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
wcsncpy_s(fontid.name, LPGENW("Generic text"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSGENERAL;
strncpy(fontid.prefix, "Generic", _countof(fontid.prefix));
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
wcsncpy_s(fontid.name, LPGENW("Small text"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSSMALL;
strncpy(fontid.prefix, "Small", _countof(fontid.prefix));
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
// do last for silly dyna plugin
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
diff --git a/src/mir_app/src/FontService.h b/src/mir_app/src/FontService.h index 9a1ea0c9d0..55d58f4089 100644 --- a/src/mir_app/src/FontService.h +++ b/src/mir_app/src/FontService.h @@ -26,12 +26,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // a font identifier structure - used for registering a font, and getting one out again
-struct FontInternal : public FontIDT
+struct FontInternal : public FontIDW
{
- FontSettingsT value;
+ FontSettingsW value;
int hLangpack;
- __inline wchar_t* getName() const { return TranslateTH(hLangpack, name); }
+ __inline wchar_t* getName() const { return TranslateW_LP(name, hLangpack); }
__inline bool isHeader() const
{
@@ -45,17 +45,17 @@ struct FontInternal : public FontIDT }
};
-struct ColourInternal : public ColourIDT
+struct ColourInternal : public ColourIDW
{
- __inline wchar_t* getName() const { return TranslateTH(hLangpack, name); }
+ __inline wchar_t* getName() const { return TranslateW_LP(name, hLangpack); }
COLORREF value;
int hLangpack;
};
-struct EffectInternal : public EffectIDT
+struct EffectInternal : public EffectIDW
{
- __inline wchar_t* getName() const { return TranslateTH(hLangpack, name); }
+ __inline wchar_t* getName() const { return TranslateW_LP(name, hLangpack); }
int hLangpack;
};
@@ -77,4 +77,4 @@ extern OBJLIST<EffectInternal> effect_id_list; extern int code_page;
extern HANDLE hFontReloadEvent, hColourReloadEvent;
-int CreateFromFontSettings(FontSettingsT *fs, LOGFONT *lf);
+int CreateFromFontSettings(FontSettingsW *fs, LOGFONT *lf);
diff --git a/src/mir_app/src/IcoLib.h b/src/mir_app/src/IcoLib.h index 5510e92996..1356762945 100644 --- a/src/mir_app/src/IcoLib.h +++ b/src/mir_app/src/IcoLib.h @@ -78,7 +78,7 @@ struct IcolibItem : public MZeroedObject char* name;
SectionItem* section;
int orderID;
- wchar_t* description;
+ wchar_t* description;
IconSourceFile* default_file;
int default_indx;
int cx, cy;
@@ -88,12 +88,12 @@ struct IcolibItem : public MZeroedObject IconSourceItem* source_big;
IconSourceItem* default_icon;
- wchar_t* temp_file;
+ wchar_t* temp_file;
HICON temp_icon;
BOOL temp_reset;
__inline ~IcolibItem() { clear(); }
- __inline wchar_t* getDescr() const { return TranslateTH(hLangpack, description); }
+ __inline wchar_t* getDescr() const { return TranslateW_LP(description, hLangpack); }
void clear();
};
diff --git a/src/mir_app/src/addcontact.cpp b/src/mir_app/src/addcontact.cpp index fb6380f9e7..7b049000c0 100644 --- a/src/mir_app/src/addcontact.cpp +++ b/src/mir_app/src/addcontact.cpp @@ -110,7 +110,7 @@ public: }
if (szName && szName[0])
- SetCaption(CMString(FORMAT, TranslateT("Add %s"), szName));
+ SetCaption(CMStringW(FORMAT, TranslateT("Add %s"), szName));
else
SetCaption(TranslateT("Add contact"));
mir_free(tmpStr);
@@ -120,7 +120,7 @@ public: m_acs.szProto = GetContactProto(m_acs.hContact);
int groupSel = 0;
- ptrW tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszGroup(db_get_wsa(hContact, "CList", "Group"));
wchar_t *grpName;
for (int groupId = 1; (grpName = Clist_GroupGetName(groupId, NULL)) != NULL; groupId++) {
int id = m_group.AddString(grpName, groupId);
@@ -200,7 +200,7 @@ public: ptrW szHandle(m_myHandle.GetText());
if (mir_wstrlen(szHandle))
- db_set_ts(hContact, "CList", "MyHandle", szHandle);
+ db_set_ws(hContact, "CList", "MyHandle", szHandle);
int item = m_group.GetCurSel();
if (item > 0)
diff --git a/src/mir_app/src/button.cpp b/src/mir_app/src/button.cpp index c020904f0d..a406d172c0 100644 --- a/src/mir_app/src/button.cpp +++ b/src/mir_app/src/button.cpp @@ -486,7 +486,7 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR ti.uFlags = TTF_IDISHWND|TTF_SUBCLASS;
ti.uId = (UINT_PTR)bct->hwnd;
if (lParam & BATF_UNICODE)
- ti.lpszText = mir_wstrdup(TranslateTS((WCHAR*)wParam));
+ ti.lpszText = mir_wstrdup(TranslateW((WCHAR*)wParam));
else
ti.lpszText = Langpack_PcharToTchar((char*)wParam);
diff --git a/src/mir_app/src/chat.h b/src/mir_app/src/chat.h index 7f493c3bcf..84d418ac78 100644 --- a/src/mir_app/src/chat.h +++ b/src/mir_app/src/chat.h @@ -87,7 +87,7 @@ int LoadChatModule(void); void UnloadChatModule(void);
// tools.c
-int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors);
+int DoRtfToTags(CMStringW &pszText, int iNumColors, COLORREF *pColors);
int GetTextPixelSize(wchar_t* pszText, HFONT hFont, BOOL bWidth);
wchar_t *RemoveFormatting(const wchar_t* pszText);
BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight, int bManyFix);
diff --git a/src/mir_app/src/chat_clist.cpp b/src/mir_app/src/chat_clist.cpp index ea92494bc7..859c93e59a 100644 --- a/src/mir_app/src/chat_clist.cpp +++ b/src/mir_app/src/chat_clist.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. MCONTACT AddRoom(const char *pszModule, const wchar_t *pszRoom, const wchar_t *pszDisplayName, int iType)
{
wchar_t pszGroup[50]; *pszGroup = '\0';
- ptrW groupName(db_get_tsa(NULL, CHAT_MODULE, "AddToGroup"));
+ ptrW groupName(db_get_wsa(NULL, CHAT_MODULE, "AddToGroup"));
if (groupName)
wcsncpy_s(pszGroup, groupName, _TRUNCATE);
else
@@ -43,13 +43,13 @@ MCONTACT AddRoom(const char *pszModule, const wchar_t *pszRoom, const wchar_t *p MCONTACT hContact = chatApi.FindRoom(pszModule, pszRoom);
if (hContact) { //contact exist, make sure it is in the right group
if (pszGroup[0]) {
- ptrW grpName(db_get_tsa(hContact, "CList", "Group"));
+ ptrW grpName(db_get_wsa(hContact, "CList", "Group"));
if (!mir_wstrcmp(pszGroup, grpName))
- db_set_ts(hContact, "CList", "Group", pszGroup);
+ db_set_ws(hContact, "CList", "Group", pszGroup);
}
db_set_w(hContact, pszModule, "Status", ID_STATUS_OFFLINE);
- db_set_ts(hContact, pszModule, "Nick", pszDisplayName);
+ db_set_ws(hContact, pszModule, "Nick", pszDisplayName);
return hContact;
}
@@ -59,11 +59,11 @@ MCONTACT AddRoom(const char *pszModule, const wchar_t *pszRoom, const wchar_t *p Proto_AddToContact(hContact, pszModule);
if (pszGroup[0])
- db_set_ts(hContact, "CList", "Group", pszGroup);
+ db_set_ws(hContact, "CList", "Group", pszGroup);
else
db_unset(hContact, "CList", "Group");
- db_set_ts(hContact, pszModule, "Nick", pszDisplayName);
- db_set_ts(hContact, pszModule, "ChatRoomID", pszRoom);
+ db_set_ws(hContact, pszModule, "Nick", pszDisplayName);
+ db_set_ws(hContact, pszModule, "ChatRoomID", pszRoom);
db_set_b(hContact, pszModule, "ChatRoom", (BYTE)iType);
db_set_w(hContact, pszModule, "Status", ID_STATUS_OFFLINE);
return hContact;
@@ -110,7 +110,7 @@ int RoomDoubleclicked(WPARAM hContact, LPARAM) if (db_get_b(hContact, szProto, "ChatRoom", 0) == 0)
return 0;
- ptrW roomid(db_get_tsa(hContact, szProto, "ChatRoomID"));
+ ptrW roomid(db_get_wsa(hContact, szProto, "ChatRoomID"));
if (roomid == NULL)
return 0;
@@ -216,7 +216,7 @@ BOOL AddEvent(MCONTACT hContact, HICON hIcon, MEVENT hEvent, int type, wchar_t* cle.flags = type | CLEF_TCHAR;
cle.hIcon = hIcon;
cle.pszService = "GChat/DblClickEvent" ;
- cle.ptszTooltip = TranslateTS(szBuf);
+ cle.ptszTooltip = TranslateW(szBuf);
if (type) {
if (!cli.pfnGetEvent(hContact, 0))
cli.pfnAddEvent(&cle);
@@ -235,7 +235,7 @@ MCONTACT FindRoom(const char *pszModule, const wchar_t *pszRoom) if (!db_get_b(hContact, pszModule, "ChatRoom", 0))
continue;
- ptrW roomid(db_get_tsa(hContact, pszModule, "ChatRoomID"));
+ ptrW roomid(db_get_wsa(hContact, pszModule, "ChatRoomID"));
if (roomid != NULL && !mir_wstrcmpi(roomid, pszRoom))
return hContact;
}
diff --git a/src/mir_app/src/chat_opts.cpp b/src/mir_app/src/chat_opts.cpp index 969e01ebb6..8fd7591762 100644 --- a/src/mir_app/src/chat_opts.cpp +++ b/src/mir_app/src/chat_opts.cpp @@ -120,7 +120,7 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour) lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
mir_snprintf(str, "Font%d", i);
- ptrW tszFace(db_get_tsa(NULL, CHATFONT_MODULE, str));
+ ptrW tszFace(db_get_wsa(NULL, CHATFONT_MODULE, str));
if (tszFace == NULL)
mir_wstrcpy(lf->lfFaceName, FO.szDefFace);
else
@@ -134,7 +134,7 @@ void RegisterFonts(void) SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(lfDefault), &lfDefault, FALSE);
- FontIDT fontid = { sizeof(fontid) };
+ FontIDW fontid = { sizeof(fontid) };
fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID | FIDF_NEEDRESTART;
wcsncpy_s(fontid.backgroundGroup, g_szFontGroup, _TRUNCATE);
wcsncpy_s(fontid.group, g_szFontGroup, _TRUNCATE);
@@ -192,7 +192,7 @@ HICON LoadIconEx(char* pszIcoLibName, bool big) static void InitSetting(wchar_t** ppPointer, char* pszSetting, wchar_t* pszDefault)
{
DBVARIANT dbv;
- if (!db_get_ts(NULL, CHAT_MODULE, pszSetting, &dbv)) {
+ if (!db_get_ws(NULL, CHAT_MODULE, pszSetting, &dbv)) {
replaceStrW(*ppPointer, dbv.ptszVal);
db_free(&dbv);
}
diff --git a/src/mir_app/src/chat_rtf.cpp b/src/mir_app/src/chat_rtf.cpp index 1b901c3cb4..d24a9c0a9f 100644 --- a/src/mir_app/src/chat_rtf.cpp +++ b/src/mir_app/src/chat_rtf.cpp @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static wchar_t tszRtfBreaks[] = L" \\\n\r"; -static void CreateColorMap(CMString &Text, int iCount, COLORREF *pSrc, int *pDst) +static void CreateColorMap(CMStringW &Text, int iCount, COLORREF *pSrc, int *pDst) { const wchar_t *pszText = Text; int iIndex = 1; @@ -73,7 +73,7 @@ static int GetRtfIndex(int iCol, int iCount, int *pIndex) return -1; } -int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors) +int DoRtfToTags(CMStringW &pszText, int iNumColors, COLORREF *pColors) { if (pszText.IsEmpty()) return FALSE; @@ -93,7 +93,7 @@ int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors) else idx += 5; bool bInsideColor = false, bInsideUl = false; - CMString res; + CMStringW res; // iterate through all characters, if rtf control character found then take action for (const wchar_t *p = pszText.GetString() + idx; *p;) { diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp index dd1ad27d09..58fdbb1bb3 100644 --- a/src/mir_app/src/chat_svc.cpp +++ b/src/mir_app/src/chat_svc.cpp @@ -257,7 +257,7 @@ static INT_PTR Service_NewChat(WPARAM, LPARAM lParam) db_set_s(si->hContact, si->pszModule, "Topic", "");
db_unset(si->hContact, "CList", "StatusMsg");
if (si->ptszStatusbarText)
- db_set_ts(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
+ db_set_ws(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
else
db_set_s(si->hContact, si->pszModule, "StatusBar", "");
@@ -358,7 +358,7 @@ static int DoControl(GCEVENT *gce, WPARAM wp) if (si = chatApi.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule)) {
replaceStrW(si->ptszStatusbarText, gce->ptszText);
if (si->ptszStatusbarText)
- db_set_ts(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
+ db_set_ws(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
else
db_set_s(si->hContact, si->pszModule, "StatusBar", "");
@@ -451,11 +451,11 @@ static INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam) if (SESSION_INFO *si = chatApi.SM_FindSession(gcd->ptszID, gcd->pszModule)) {
if (gce->ptszText) {
replaceStrW(si->ptszTopic, RemoveFormatting(gce->ptszText));
- db_set_ts(si->hContact, si->pszModule, "Topic", si->ptszTopic);
+ db_set_ws(si->hContact, si->pszModule, "Topic", si->ptszTopic);
if (chatApi.OnSetTopic)
chatApi.OnSetTopic(si);
if (db_get_b(NULL, CHAT_MODULE, "TopicOnClist", 0))
- db_set_ts(si->hContact, "CList", "StatusMsg", si->ptszTopic);
+ db_set_ws(si->hContact, "CList", "StatusMsg", si->ptszTopic);
}
}
break;
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp index 33f7574dd2..0ac5311f81 100644 --- a/src/mir_app/src/chat_tools.cpp +++ b/src/mir_app/src/chat_tools.cpp @@ -185,7 +185,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char *pszProtoNa PROTOACCOUNT *pa = Proto_GetAccount(pszProtoName);
mir_snwprintf(pd.lptzContactName, L"%s - %s", (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName, cli.pfnGetContactDisplayName(hContact, 0));
- mir_wstrncpy(pd.lptzText, TranslateTS(szBuf), _countof(pd.lptzText));
+ mir_wstrncpy(pd.lptzText, TranslateW(szBuf), _countof(pd.lptzText));
pd.iSeconds = g_Settings->iPopupTimeout;
if (g_Settings->iPopupStyle == 2) {
@@ -424,10 +424,10 @@ BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *gce) wchar_t *buf = RemoveFormatting(NEWWSTR_ALLOCA(gce->ptszText));
int iStart = 0;
- CMString tszHighlightWords(g_Settings->pszHighlightWords);
+ CMStringW tszHighlightWords(g_Settings->pszHighlightWords);
while (true) {
- CMString tszToken = tszHighlightWords.Tokenize(L"\t ", iStart);
+ CMStringW tszToken = tszHighlightWords.Tokenize(L"\t ", iStart);
if (iStart == -1)
break;
@@ -465,7 +465,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) wcsncpy_s(tszFolder, si->pszLogFileName, _TRUNCATE);
PathRemoveFileSpec(tszFolder);
if (!PathIsDirectory(tszFolder))
- CreateDirectoryTreeT(tszFolder);
+ CreateDirectoryTreeW(tszFolder);
wchar_t szTime[100];
mir_wstrncpy(szTime, chatApi.MakeTimeStamp(g_Settings->pszTimeStampLog, gce->time), 99);
@@ -588,7 +588,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) wchar_t tszNewPath[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20];
mir_snwprintf(tszNewPath, L"%s%sarchived\\", tszDrive, tszDir);
- CreateDirectoryTreeT(tszNewPath);
+ CreateDirectoryTreeW(tszNewPath);
wchar_t tszNewName[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20];
mir_snwprintf(tszNewName, L"%s%s-%s%s", tszNewPath, tszName, tszTimestamp, tszExt);
@@ -748,7 +748,7 @@ wchar_t* GetChatLogsFilename(SESSION_INFO *si, time_t tTime) if (chatApi.OnGetLogName)
chatApi.OnGetLogName(si, tszParsedName);
else
- PathToAbsoluteT(tszParsedName, si->pszLogFileName);
+ PathToAbsoluteW(tszParsedName, si->pszLogFileName);
mir_free(tszParsedName);
for (int i = 0; i < _countof(rva); i++)
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index d331cbbb51..23fcc6e060 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -389,7 +389,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam int i, eq;
//check name of group and ignore message if just being expanded/collapsed
if (cli.pfnFindItem(hwnd, dat, groupId | HCONTACT_ISGROUP, &contact, &group, NULL)) {
- CMString szFullName(contact->szText);
+ CMStringW szFullName(contact->szText);
while (group->parent) {
ClcContact *cc = NULL;
for (i = 0; i < group->parent->cl.getCount(); i++) {
@@ -401,7 +401,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam szFullName.Empty();
break;
}
- szFullName = CMString(cc->szText) + L"\\" + szFullName;
+ szFullName = CMStringW(cc->szText) + L"\\" + szFullName;
group = group->parent;
}
diff --git a/src/mir_app/src/clcitems.cpp b/src/mir_app/src/clcitems.cpp index c8de95e416..7305d6658e 100644 --- a/src/mir_app/src/clcitems.cpp +++ b/src/mir_app/src/clcitems.cpp @@ -224,7 +224,7 @@ void fnAddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int updateTo int i; DWORD groupFlags; ClcGroup *group; - ptrW tszGroup(db_get_tsa(hContact, "CList", "Group")); + ptrW tszGroup(db_get_wsa(hContact, "CList", "Group")); if (tszGroup == NULL) group = &dat->list; else { @@ -310,7 +310,7 @@ void fnDeleteItemFromTree(HWND hwnd, MCONTACT hItem) int i, nameOffset; if (!IsHContactContact(hItem)) return; - if (db_get_ts(hItem, "CList", "Group", &dbv)) + if (db_get_ws(hItem, "CList", "Group", &dbv)) return; //decrease member counts of all parent groups too @@ -365,7 +365,7 @@ void fnRebuildEntireList(HWND hwnd, ClcData *dat) ClcCacheEntry *pce = cli.pfnGetCacheEntry(hContact); ClcGroup *group; - ptrW tszGroupName(db_get_tsa(hContact, "CList", "Group")); + ptrW tszGroupName(db_get_wsa(hContact, "CList", "Group")); if (tszGroupName == NULL) group = &dat->list; else { diff --git a/src/mir_app/src/clcutils.cpp b/src/mir_app/src/clcutils.cpp index e1814d1f37..de469d6a17 100644 --- a/src/mir_app/src/clcutils.cpp +++ b/src/mir_app/src/clcutils.cpp @@ -434,7 +434,7 @@ void fnEndRename(HWND, ClcData *dat, int save) if (!text[0] || !mir_wstrcmp(otherName, text))
db_unset(contact->hContact, "CList", "MyHandle");
else
- db_set_ts(contact->hContact, "CList", "MyHandle", text);
+ db_set_ws(contact->hContact, "CList", "MyHandle", text);
mir_free(otherName);
}
}
@@ -698,7 +698,7 @@ void fnGetFontSetting(int i, LOGFONT* lf, COLORREF* colour) char idstr[20];
mir_snprintf(idstr, "Font%dName", i);
- ptrW tszFace(db_get_tsa(NULL, "CLC", idstr));
+ ptrW tszFace(db_get_wsa(NULL, "CLC", idstr));
if (tszFace)
mir_wstrcpy(lf->lfFaceName, tszFace);
@@ -769,7 +769,7 @@ void fnLoadClcOptions(HWND hwnd, ClcData *dat, BOOL bFirst) dat->hBmpBackground = NULL;
}
if (db_get_b(NULL, "CLC", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- ptrW tszBitmap(db_get_tsa(NULL, "CLC", "BkBitmap"));
+ ptrW tszBitmap(db_get_wsa(NULL, "CLC", "BkBitmap"));
if (tszBitmap)
dat->hBmpBackground = Bitmap_Load(tszBitmap);
}
diff --git a/src/mir_app/src/clistgroups.cpp b/src/mir_app/src/clistgroups.cpp index a9b1e0ab2f..b8b3bbdb0e 100644 --- a/src/mir_app/src/clistgroups.cpp +++ b/src/mir_app/src/clistgroups.cpp @@ -43,7 +43,7 @@ struct CGroupInternal {
char idstr[33];
itoa(groupId, idstr, 10);
- db_set_ts(NULL, "CListGroups", idstr, groupName);
+ db_set_ws(NULL, "CListGroups", idstr, groupName);
}
};
@@ -204,14 +204,14 @@ MIR_APP_DLL(int) Clist_GroupDelete(MGROUP hGroup) }
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- ptrW tszGroupName(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszGroupName(db_get_wsa(hContact, "CList", "Group"));
if (mir_wstrcmp(tszGroupName, pGroup->groupName+1))
continue;
CLISTGROUPCHANGE grpChg = { sizeof(grpChg), NULL, NULL };
grpChg.pszOldName = pGroup->groupName+1;
if (szNewParent[0]) {
- db_set_ts(hContact, "CList", "Group", szNewParent);
+ db_set_ws(hContact, "CList", "Group", szNewParent);
grpChg.pszNewName = szNewParent;
}
else {
@@ -340,7 +340,7 @@ static int RenameGroupWithMove(int groupId, const wchar_t *szName, int move) for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
ClcCacheEntry *cache = cli.pfnGetCacheEntry(hContact);
if (!mir_wstrcmp(cache->tszGroup, oldName)) {
- db_set_ts(hContact, "CList", "Group", szName);
+ db_set_ws(hContact, "CList", "Group", szName);
replaceStrW(cache->tszGroup, szName);
}
}
@@ -512,7 +512,7 @@ int InitGroupServices(void) for (int i = 0;; i++) {
char str[32];
_itoa(i, str, 10);
- ptrW tszGroup(db_get_tsa(NULL, "CListGroups", str));
+ ptrW tszGroup(db_get_wsa(NULL, "CListGroups", str));
if (tszGroup == NULL)
break;
diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp index f33faa939a..844027ecf1 100644 --- a/src/mir_app/src/clistmod.cpp +++ b/src/mir_app/src/clistmod.cpp @@ -101,13 +101,13 @@ wchar_t* fnGetStatusModeDescription(int mode, int flags) default:
if (IsStatusConnecting(mode)) {
const wchar_t* connFmt = LPGENW("Connecting (attempt %d)");
- mir_snwprintf(szMode, (flags & GSMDF_UNTRANSLATED) ? connFmt : TranslateTS(connFmt), mode - ID_STATUS_CONNECTING + 1);
+ mir_snwprintf(szMode, (flags & GSMDF_UNTRANSLATED) ? connFmt : TranslateW(connFmt), mode - ID_STATUS_CONNECTING + 1);
return szMode;
}
return NULL;
}
- return (flags & GSMDF_UNTRANSLATED) ? descr : TranslateTS(descr);
+ return (flags & GSMDF_UNTRANSLATED) ? descr : TranslateW(descr);
}
static int ProtocolAck(WPARAM, LPARAM lParam)
diff --git a/src/mir_app/src/clistsettings.cpp b/src/mir_app/src/clistsettings.cpp index b82bc7c746..86652d5078 100644 --- a/src/mir_app/src/clistsettings.cpp +++ b/src/mir_app/src/clistsettings.cpp @@ -55,7 +55,7 @@ ClcCacheEntry* fnCreateCacheItem(MCONTACT hContact) void fnCheckCacheItem(ClcCacheEntry *p)
{
if (p->tszGroup == NULL) {
- p->tszGroup = db_get_tsa(p->hContact, "CList", "Group");
+ p->tszGroup = db_get_wsa(p->hContact, "CList", "Group");
if (p->tszGroup == NULL)
p->tszGroup = mir_wstrdup(L"");
}
diff --git a/src/mir_app/src/clisttray.cpp b/src/mir_app/src/clisttray.cpp index aafe45ab1c..5254bb9372 100644 --- a/src/mir_app/src/clisttray.cpp +++ b/src/mir_app/src/clisttray.cpp @@ -49,7 +49,7 @@ static wchar_t* sttGetXStatus(const char *szProto) if (CallProtoServiceInt(NULL, szProto, PS_GETSTATUS, 0, 0) > ID_STATUS_OFFLINE) {
wchar_t tszStatus[512];
CUSTOM_STATUS cs = { sizeof(cs) };
- cs.flags = CSSF_MASK_MESSAGE | CSSF_TCHAR;
+ cs.flags = CSSF_MASK_MESSAGE | CSSF_UNICODE;
cs.ptszMessage = tszStatus;
if (CallProtoServiceInt(NULL, szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&cs) == 0)
return mir_wstrdup(tszStatus);
@@ -81,7 +81,7 @@ wchar_t* fnTrayIconMakeTooltip(const wchar_t *szPrefix, const char *szProto) if (accounts.getCount() == 1)
return cli.pfnTrayIconMakeTooltip(szPrefix, accounts[0]->szModuleName);
- CMString tszTip;
+ CMStringW tszTip;
if (szPrefix && szPrefix[0]) {
if (!db_get_b(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT)) {
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 37a7fc8739..250287f634 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -275,7 +275,7 @@ int LoadCLUIModule(void) wndclass.hIconSm = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
RegisterClassEx(&wndclass);
- if (db_get_ts(NULL, "CList", "TitleText", &dbv))
+ if (db_get_ws(NULL, "CList", "TitleText", &dbv))
mir_wstrncpy(titleText, _T(MIRANDANAME), _countof(titleText));
else {
mir_wstrncpy(titleText, dbv.ptszVal, _countof(titleText));
@@ -412,7 +412,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (msg == uMsgProcessProfile) {
wchar_t profile[MAX_PATH];
if (GlobalGetAtomName((ATOM)wParam, profile, _countof(profile))) {
- int rc = mir_wstrcmpi(profile, VARST(L"%miranda_userdata%\\%miranda_profilename%.dat")) == 0;
+ int rc = mir_wstrcmpi(profile, VARSW(L"%miranda_userdata%\\%miranda_profilename%.dat")) == 0;
ReplyMessage(rc);
if (rc) {
ShowWindow(hwnd, SW_RESTORE);
diff --git a/src/mir_app/src/contact.cpp b/src/mir_app/src/contact.cpp index ceedd7a125..c482deed19 100644 --- a/src/mir_app/src/contact.cpp +++ b/src/mir_app/src/contact.cpp @@ -54,7 +54,7 @@ INT_PTR ContactChangeGroup(WPARAM wParam, LPARAM lParam) db_unset(wParam, "CList", "Group"); else { grpChg.pszNewName = Clist_GroupGetName(lParam, NULL); - db_set_ts(wParam, "CList", "Group", grpChg.pszNewName); + db_set_ws(wParam, "CList", "Group", grpChg.pszNewName); } NotifyEventHooks(hGroupChangeEvent, wParam, (LPARAM)&grpChg); diff --git a/src/mir_app/src/contacts.cpp b/src/mir_app/src/contacts.cpp index f9e717d541..ced2f8ab5a 100644 --- a/src/mir_app/src/contacts.cpp +++ b/src/mir_app/src/contacts.cpp @@ -309,7 +309,7 @@ public: tvis.item.mask = TVIF_TEXT | TVIF_PARAM;
for (int i = 0; i < _countof(nameOrderDescr); i++) {
tvis.item.lParam = nameOrder[i];
- tvis.item.pszText = TranslateTS(nameOrderDescr[nameOrder[i]]);
+ tvis.item.pszText = TranslateW(nameOrderDescr[nameOrder[i]]);
m_nameOrder.InsertItem(&tvis);
}
}
diff --git a/src/mir_app/src/database.cpp b/src/mir_app/src/database.cpp index 2331ee3159..420e442f15 100644 --- a/src/mir_app/src/database.cpp +++ b/src/mir_app/src/database.cpp @@ -62,7 +62,7 @@ static void fillProfileName(const wchar_t* ptszFileName) bool IsInsideRootDir(wchar_t* profiledir, bool exact)
{
- VARST pfd(L"%miranda_path%");
+ VARSW pfd(L"%miranda_path%");
if (exact)
return mir_wstrcmpi(profiledir, pfd) == 0;
@@ -78,7 +78,7 @@ int getProfilePath(wchar_t *buf, size_t) if (profiledir[0] == 0)
mir_wstrcpy(profiledir, L"%miranda_path%\\Profiles");
- size_t len = PathToAbsoluteT(VARST(profiledir), buf);
+ size_t len = PathToAbsoluteW(VARSW(profiledir), buf);
if (buf[len - 1] == '/' || buf[len - 1] == '\\')
buf[len - 1] = 0;
@@ -124,7 +124,7 @@ static void getDefaultProfile(wchar_t *szProfile, size_t cch) if (defaultProfile[0] == 0)
return;
- VARST res(defaultProfile);
+ VARSW res(defaultProfile);
if (res)
mir_snwprintf(szProfile, cch, L"%s\\%s\\%s%s", g_profileDir, (wchar_t*)res, (wchar_t*)res, isValidProfileName(res) ? L"" : L".dat");
else
@@ -150,7 +150,7 @@ static void loadProfileByShortName(const wchar_t* src, wchar_t *szProfile, size_ p = wcsrchr(profileName, '.'); if (p) *p = 0;
mir_snwprintf(newProfileDir, cch, L"%s\\%s\\", g_profileDir, profileName);
- PathToAbsoluteT(buf, szProfile, newProfileDir);
+ PathToAbsoluteW(buf, szProfile, newProfileDir);
if (wcschr(buf, '\\')) {
wcsncpy_s(g_profileDir, szProfile, _TRUNCATE);
@@ -184,7 +184,7 @@ static void moveProfileDirProfiles(wchar_t *profiledir, BOOL isRootDir = TRUE) {
wchar_t pfd[MAX_PATH];
if (isRootDir)
- wcsncpy_s(pfd, VARST(L"%miranda_path%\\*.dat"), _TRUNCATE);
+ wcsncpy_s(pfd, VARSW(L"%miranda_path%\\*.dat"), _TRUNCATE);
else
mir_snwprintf(pfd, L"%s\\*.dat", profiledir);
@@ -198,7 +198,7 @@ static void moveProfileDirProfiles(wchar_t *profiledir, BOOL isRootDir = TRUE) c = wcsrchr(profile, '.'); if (c) *c = 0;
mir_snwprintf(path, L"%s\\%s", pfd, ffd.cFileName);
mir_snwprintf(path2, L"%s\\%s", profiledir, profile);
- CreateDirectoryTreeT(path2);
+ CreateDirectoryTreeW(path2);
mir_snwprintf(path2, L"%s\\%s\\%s", profiledir, profile, ffd.cFileName);
if (_waccess(path2, 0) == 0) {
wchar_t buf[512];
@@ -420,7 +420,7 @@ int tryOpenDatabase(const wchar_t *tszProfile) static int tryCreateDatabase(const wchar_t *ptszProfile)
{
wchar_t *tszProfile = NEWWSTR_ALLOCA(ptszProfile);
- CreatePathToFileT(tszProfile);
+ CreatePathToFileW(tszProfile);
for (int i = 0; i < arDbPlugins.getCount(); i++) {
DATABASELINK* p = arDbPlugins[i];
@@ -482,7 +482,7 @@ static wchar_t tszNoSuitableDriver[] = LPGENW("Miranda was unable to open '%s'\n int LoadDatabaseModule(void)
{
wchar_t szProfile[MAX_PATH];
- PathToAbsoluteT(L".", szProfile);
+ PathToAbsoluteW(L".", szProfile);
_tchdir(szProfile);
szProfile[0] = 0;
@@ -497,7 +497,7 @@ int LoadDatabaseModule(void) if (arDbPlugins.getCount() == 0) {
MessageBox(NULL,
- CMString(FORMAT, TranslateTS(tszNoDrivers), ptszFileName),
+ CMStringW(FORMAT, TranslateW(tszNoDrivers), ptszFileName),
TranslateT("No profile support installed!"), MB_OK | MB_ICONERROR);
return 1;
}
@@ -515,7 +515,7 @@ int LoadDatabaseModule(void) // there were no suitable driver installed
if (rc == -1) {
MessageBox(NULL,
- CMString(FORMAT, TranslateTS(tszNoSuitableDriver), ptszFileName),
+ CMStringW(FORMAT, TranslateW(tszNoSuitableDriver), ptszFileName),
TranslateT("Miranda can't open that profile"), MB_OK | MB_ICONERROR);
}
else if (rc > 0) {
@@ -523,12 +523,12 @@ int LoadDatabaseModule(void) if (fileExist(szProfile)) {
// file isn't locked, just no driver could open it.
MessageBox(NULL,
- CMString(FORMAT, TranslateTS(tszUnknownFormat), ptszFileName),
+ CMStringW(FORMAT, TranslateW(tszUnknownFormat), ptszFileName),
TranslateT("Miranda can't understand that profile"), MB_OK | MB_ICONERROR);
}
else if (!FindMirandaForProfile(szProfile)) {
retry = IDRETRY == MessageBox(NULL,
- CMString(FORMAT, TranslateTS(tszProfileLocked), ptszFileName),
+ CMStringW(FORMAT, TranslateW(tszProfileLocked), ptszFileName),
TranslateT("Miranda can't open that profile"), MB_RETRYCANCEL | MB_ICONERROR);
}
}
diff --git a/src/mir_app/src/dbini.cpp b/src/mir_app/src/dbini.cpp index b545aae71c..09d6a336ff 100644 --- a/src/mir_app/src/dbini.cpp +++ b/src/mir_app/src/dbini.cpp @@ -46,7 +46,7 @@ static INT_PTR CALLBACK InstallIniDlgProc(HWND hwndDlg, UINT message, WPARAM wPa else if (!mir_wstrcmpi(szSecurity, L"none"))
pszSecurityInfo = LPGENW("Security systems to prevent malicious changes have been disabled. You will receive no further warnings.");
else pszSecurityInfo = NULL;
- if (pszSecurityInfo) SetDlgItemText(hwndDlg, IDC_SECURITYINFO, TranslateTS(pszSecurityInfo));
+ if (pszSecurityInfo) SetDlgItemText(hwndDlg, IDC_SECURITYINFO, TranslateW(pszSecurityInfo));
}
return TRUE;
@@ -122,7 +122,7 @@ static INT_PTR CALLBACK WarnIniChangeDlgProc(HWND hwndDlg, UINT message, WPARAM pszSecurityInfo = LPGENW("This change is known to be potentially hazardous.");
else
pszSecurityInfo = LPGENW("This change is not known to be safe.");
- SetDlgItemText(hwndDlg, IDC_SECURITYINFO, TranslateTS(pszSecurityInfo));
+ SetDlgItemText(hwndDlg, IDC_SECURITYINFO, TranslateW(pszSecurityInfo));
}
return TRUE;
@@ -455,11 +455,11 @@ static void DoAutoExec(void) GetPrivateProfileString(L"AutoExec", L"Glob", L"autoexec_*.ini", szFindPath, _countof(szFindPath), mirandabootini);
if (g_bDbCreated && szOnCreateFilename[0]) {
- PathToAbsoluteT(VARST(szOnCreateFilename), szIniPath);
+ PathToAbsoluteW(VARSW(szOnCreateFilename), szIniPath);
ProcessIniFile(szIniPath, szSafeSections, szUnsafeSections, 0, 1);
}
- PathToAbsoluteT(VARST(szFindPath), szFindPath);
+ PathToAbsoluteW(VARSW(szFindPath), szFindPath);
WIN32_FIND_DATA fd;
HANDLE hFind = FindFirstFile(szFindPath, &fd);
@@ -537,7 +537,7 @@ int InitIni(void) DoAutoExec();
wchar_t szMirandaDir[MAX_PATH];
- PathToAbsoluteT(L".", szMirandaDir);
+ PathToAbsoluteW(L".", szMirandaDir);
hIniChangeNotification = FindFirstChangeNotification(szMirandaDir, 0, FILE_NOTIFY_CHANGE_FILE_NAME);
if (hIniChangeNotification != INVALID_HANDLE_VALUE) {
CreateServiceFunction("DB/Ini/CheckImportNow", CheckIniImportNow);
diff --git a/src/mir_app/src/dbintf.cpp b/src/mir_app/src/dbintf.cpp index dca13b96f3..ffa510f9e9 100644 --- a/src/mir_app/src/dbintf.cpp +++ b/src/mir_app/src/dbintf.cpp @@ -48,7 +48,7 @@ static INT_PTR srvGetContactCount(WPARAM, LPARAM) static INT_PTR srvDeleteContact(WPARAM wParam, LPARAM)
{
DBVARIANT dbv = { 0 };
- if (!db_get_ts(wParam, "ContactPhoto", "File", &dbv)) {
+ if (!db_get_ws(wParam, "ContactPhoto", "File", &dbv)) {
DeleteFile(dbv.ptszVal);
db_free(&dbv);
}
diff --git a/src/mir_app/src/dbutils.cpp b/src/mir_app/src/dbutils.cpp index 8f63f74dbf..a8003bec86 100644 --- a/src/mir_app/src/dbutils.cpp +++ b/src/mir_app/src/dbutils.cpp @@ -118,7 +118,7 @@ static INT_PTR DbEventGetText(WPARAM wParam, LPARAM lParam) ptrW tszLast(getEventString(dbei, buf));
ptrW tszEmail(getEventString(dbei, buf));
- CMString nick, text;
+ CMStringW nick, text;
if (tszFirst || tszLast) {
nick.AppendFormat(L"%s %s", tszFirst, tszLast);
nick.Trim();
@@ -147,7 +147,7 @@ static INT_PTR DbEventGetText(WPARAM wParam, LPARAM lParam) }
if (dbei->eventType == EVENTTYPE_CONTACTS) {
- CMString text(TranslateT("Contacts: "));
+ CMStringW text(TranslateT("Contacts: "));
// blob is: [uin(ASCIIZ), nick(ASCIIZ)]*
char *buf = LPSTR(dbei->pBlob), *limit = LPSTR(dbei->pBlob) + dbei->cbBlob;
while (buf < limit) {
diff --git a/src/mir_app/src/enterstring.cpp b/src/mir_app/src/enterstring.cpp index b68b24b661..5632a6acf1 100644 --- a/src/mir_app/src/enterstring.cpp +++ b/src/mir_app/src/enterstring.cpp @@ -57,7 +57,7 @@ static void ComboLoadRecentStrings(HWND hwndDlg, EnterStringFormParam *pForm) for (int i = 0; i < pForm->recentCount; i++) {
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "%s%d", pForm->szDataPrefix, i);
- ptrW tszRecent(db_get_tsa(NULL, pForm->szModuleName, setting));
+ ptrW tszRecent(db_get_wsa(NULL, pForm->szModuleName, setting));
if (tszRecent != NULL)
SendDlgItemMessage(hwndDlg, pForm->idcControl, CB_ADDSTRING, 0, tszRecent);
}
@@ -83,7 +83,7 @@ static void ComboAddRecentString(HWND hwndDlg, EnterStringFormParam *pForm) id = db_get_b(NULL, pForm->szModuleName, pForm->szDataPrefix, 0);
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "%s%d", pForm->szDataPrefix, id);
- db_set_ts(NULL, pForm->szModuleName, setting, string);
+ db_set_ws(NULL, pForm->szModuleName, setting, string);
db_set_b(NULL, pForm->szModuleName, pForm->szDataPrefix, (id + 1) % pForm->idcControl);
}
diff --git a/src/mir_app/src/extraicons.cpp b/src/mir_app/src/extraicons.cpp index bcdeea5161..aae28f5ff2 100644 --- a/src/mir_app/src/extraicons.cpp +++ b/src/mir_app/src/extraicons.cpp @@ -395,7 +395,7 @@ EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterCallback(const char *name, const return 0;
ptrW tszDesc(mir_a2u(description));
- wchar_t *desc = TranslateTH(_hLang, tszDesc);
+ wchar_t *desc = TranslateW_LP(tszDesc, _hLang);
int id = registeredExtraIcons.getCount() + 1;
BaseExtraIcon *extra = new CallbackExtraIcon(id, name, desc, descIcon == NULL ? "" : descIcon, RebuildIcons, ApplyIcon, OnClick, onClickParam);
@@ -410,7 +410,7 @@ EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterIcolib(const char *name, const ch return 0;
ptrW tszDesc(mir_a2u(description));
- wchar_t *desc = TranslateTH(_hLang, tszDesc);
+ wchar_t *desc = TranslateW_LP(tszDesc, _hLang);
BaseExtraIcon *extra = GetExtraIconByName(name);
if (extra != NULL) {
@@ -419,7 +419,7 @@ EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterIcolib(const char *name, const ch // Found one, now merge it
if (mir_wstrcmpi(extra->getDescription(), desc)) {
- CMString newDesc = extra->getDescription();
+ CMStringW newDesc = extra->getDescription();
newDesc += L" / ";
newDesc += desc;
extra->setDescription(newDesc.c_str());
diff --git a/src/mir_app/src/findadd.cpp b/src/mir_app/src/findadd.cpp index cef250a96c..bf17091830 100644 --- a/src/mir_app/src/findadd.cpp +++ b/src/mir_app/src/findadd.cpp @@ -326,7 +326,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP dat->iLastColumnSortIndex = 1; dat->bSortAscending = 1; SendDlgItemMessage(hwndDlg, IDC_MOREOPTIONS, BUTTONSETARROW, 1, 0); - SendDlgItemMessage(hwndDlg, IDOK, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Ctrl+Search add contact"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDOK, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Ctrl+Search add contact"), BATF_UNICODE); ListView_SetExtendedListViewStyle(hwndList, LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP); @@ -364,7 +364,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP SetStatusBarSearchInfo(GetDlgItem(hwndDlg, IDC_STATUSBAR), dat); wchar_t *szProto = NULL; - ptrW tszLast(db_get_tsa(NULL, "FindAdd", "LastSearched")); + ptrW tszLast(db_get_wsa(NULL, "FindAdd", "LastSearched")); if (tszLast) szProto = NEWWSTR_ALLOCA(tszLast); @@ -765,7 +765,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP PROTOSEARCHRESULT psr = { 0 }; psr.cbSize = sizeof(psr); - psr.flags = PSR_TCHAR; + psr.flags = PSR_UNICODE; psr.id.w = str; acs.psr = &psr; @@ -854,7 +854,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP LVCOLUMN lvc = { 0 }; lvc.mask = LVCF_TEXT; for (int iColumn = 0; iColumn < csr->nFieldCount; iColumn++) { - lvc.pszText = TranslateTS(csr->pszFields[iColumn]); + lvc.pszText = TranslateW(csr->pszFields[iColumn]); ListView_InsertColumn(hwndList, iColumn + 1, &lvc); } } @@ -869,7 +869,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP lsr->psr.firstName.w = sttDecodeString(psr->flags, psr->firstName); lsr->psr.lastName.w = sttDecodeString(psr->flags, psr->lastName); lsr->psr.email.w = sttDecodeString(psr->flags, psr->email); - lsr->psr.flags = psr->flags & ~PSR_UNICODE | PSR_TCHAR; + lsr->psr.flags = psr->flags & ~PSR_UNICODE | PSR_UNICODE; LVITEM lvi = { 0 }; lvi.mask = LVIF_PARAM | LVIF_IMAGE; @@ -909,7 +909,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP lsr->psr.lastName.w = sttDecodeString(psr->flags, psr->lastName); lsr->psr.email.w = sttDecodeString(psr->flags, psr->email); lsr->psr.id.w = sttDecodeString(psr->flags, psr->id); - lsr->psr.flags = psr->flags & ~PSR_UNICODE | PSR_TCHAR; + lsr->psr.flags = psr->flags & ~PSR_UNICODE | PSR_UNICODE; LVITEM lvi = { 0 }; lvi.mask = LVIF_PARAM | LVIF_IMAGE; @@ -948,7 +948,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (szProto != NULL) { *szProto = '\0'; SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETLBTEXT, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), (LPARAM)szProto); - db_set_ts(NULL, "FindAdd", "LastSearched", szProto); + db_set_ws(NULL, "FindAdd", "LastSearched", szProto); } SaveColumnSizes(hwndList); diff --git a/src/mir_app/src/hotkey_opts.cpp b/src/mir_app/src/hotkey_opts.cpp index cb02b5496e..d85da9566e 100644 --- a/src/mir_app/src/hotkey_opts.cpp +++ b/src/mir_app/src/hotkey_opts.cpp @@ -311,8 +311,8 @@ static void sttOptionsAddHotkey(HWND hwndList, THotkeyItem *item) THotkeyItem *newItem = (THotkeyItem *)mir_alloc(sizeof(THotkeyItem)); newItem->pszName = NULL; newItem->pszService = item->pszService ? mir_strdup(item->pszService) : NULL; - newItem->ptszSection = mir_wstrdup(item->ptszSection); - newItem->ptszDescription = mir_wstrdup(item->ptszDescription); + newItem->pwszSection = mir_wstrdup(item->pwszSection); + newItem->pwszDescription = mir_wstrdup(item->pwszDescription); newItem->lParam = item->lParam; newItem->idHotkey = GlobalAddAtomA(buf); newItem->rootHotkey = item; @@ -393,7 +393,7 @@ static void sttBuildHotkeyList(HWND hwndList) if (item->OptDeleted) continue; - if (!i || mir_wstrcmp(item->ptszSection, hotkeys[i - 1]->ptszSection)) { + if (!i || mir_wstrcmp(item->pwszSection, hotkeys[i - 1]->pwszSection)) { lvi.mask = LVIF_TEXT | LVIF_PARAM; lvi.iItem = nItems++; lvi.iSubItem = 0; @@ -404,7 +404,7 @@ static void sttBuildHotkeyList(HWND hwndList) lvi.mask = LVIF_TEXT; lvi.iSubItem = 1; - lvi.pszText = item->ptszSection; + lvi.pszText = item->pwszSection; ListView_SetItem(hwndList, &lvi); lvi.iSubItem = 0; diff --git a/src/mir_app/src/hotkeys.cpp b/src/mir_app/src/hotkeys.cpp index 7ecb0b1c3a..e4884e26d7 100644 --- a/src/mir_app/src/hotkeys.cpp +++ b/src/mir_app/src/hotkeys.cpp @@ -29,9 +29,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static int sttCompareHotkeys(const THotkeyItem *p1, const THotkeyItem *p2)
{
int res;
- if (res = mir_wstrcmp(p1->ptszSection, p2->ptszSection))
+ if (res = mir_wstrcmp(p1->pwszSection, p2->pwszSection))
return res;
- if (res = mir_wstrcmp(p1->ptszDescription, p2->ptszDescription))
+ if (res = mir_wstrcmp(p1->pwszDescription, p2->pwszDescription))
return res;
if (!p1->rootHotkey && p2->rootHotkey)
return -1;
@@ -138,12 +138,12 @@ static INT_PTR svcHotkeyRegister(WPARAM wParam, LPARAM lParam) THotkeyItem *p = (THotkeyItem*)mir_alloc(sizeof(THotkeyItem));
DWORD dwFlags = (desc->cbSize >= sizeof(HOTKEYDESC)) ? desc->dwFlags : 0;
if (dwFlags & HKD_UNICODE) {
- p->ptszSection = mir_wstrdup(desc->ptszSection);
- p->ptszDescription = mir_wstrdup(desc->ptszDescription);
+ p->pwszSection = mir_wstrdup(desc->pwszSection);
+ p->pwszDescription = mir_wstrdup(desc->pwszDescription);
}
else {
- p->ptszSection = mir_a2u(desc->pszSection);
- p->ptszDescription = mir_a2u(desc->pszDescription);
+ p->pwszSection = mir_a2u(desc->pszSection);
+ p->pwszDescription = mir_a2u(desc->pszDescription);
}
p->hLangpack = (int)wParam;
@@ -161,8 +161,8 @@ static INT_PTR svcHotkeyRegister(WPARAM wParam, LPARAM lParam) p->rootHotkey->nSubHotkeys++;
}
else {
- mir_free(p->ptszSection);
- mir_free(p->ptszDescription);
+ mir_free(p->pwszSection);
+ mir_free(p->pwszDescription);
mir_free(p);
return 0;
}
@@ -264,7 +264,7 @@ static INT_PTR svcHotkeyCheck(WPARAM wParam, LPARAM lParam) for (i = 0; i < hotkeys.getCount(); i++) {
THotkeyItem *p = hotkeys[i];
- if ((p->type != HKT_MANUAL) || mir_wstrcmp(pszSection, p->ptszSection))
+ if ((p->type != HKT_MANUAL) || mir_wstrcmp(pszSection, p->pwszSection))
continue;
BYTE hkMod, hkVk;
@@ -290,8 +290,8 @@ void FreeHotkey(THotkeyItem *p) GlobalDeleteAtom(p->idHotkey);
mir_free(p->pszName);
mir_free(p->pszService);
- mir_free(p->ptszDescription);
- mir_free(p->ptszSection);
+ mir_free(p->pwszDescription);
+ mir_free(p->pwszSection);
mir_free(p);
}
diff --git a/src/mir_app/src/icolib.cpp b/src/mir_app/src/icolib.cpp index d2f8f34e24..692f695819 100644 --- a/src/mir_app/src/icolib.cpp +++ b/src/mir_app/src/icolib.cpp @@ -81,7 +81,7 @@ static IconSourceFile* IconSourceFile_Get(const wchar_t *file, bool isPath) IconSourceFile key;
if (isPath)
- PathToAbsoluteT(file, key.file); /// TODO: convert path to long - eliminate duplicate items
+ PathToAbsoluteW(file, key.file); /// TODO: convert path to long - eliminate duplicate items
else
wcsncpy_s(key.file, file, _TRUNCATE);
@@ -667,10 +667,10 @@ HICON IconItem_GetIcon(HANDLE hIcoLib, bool big) big = big && !item->cx;
IconSourceItem* &source = big ? item->source_big : item->source_small;
if (source == NULL) {
- ptrW tszCustomPath(db_get_tsa(NULL, "SkinIcons", item->name));
+ ptrW tszCustomPath(db_get_wsa(NULL, "SkinIcons", item->name));
if (tszCustomPath != NULL) {
wchar_t tszFullPath[MAX_PATH];
- PathToAbsoluteT(tszCustomPath, tszFullPath);
+ PathToAbsoluteW(tszCustomPath, tszFullPath);
int cx = item->cx ? item->cx : (big ? g_iIconX : g_iIconSX);
int cy = item->cy ? item->cy : (big ? g_iIconY : g_iIconSY);
source = GetIconSourceItemFromPath(tszFullPath, cx, cy);
diff --git a/src/mir_app/src/keyboard.cpp b/src/mir_app/src/keyboard.cpp index e71b72c9c9..fbda9d07bf 100644 --- a/src/mir_app/src/keyboard.cpp +++ b/src/mir_app/src/keyboard.cpp @@ -53,38 +53,38 @@ int InitClistHotKeys(void) CreateServiceFunction("CLIST/HK/Read", hkRead);
HOTKEYDESC shk = { sizeof(shk) };
- shk.dwFlags = HKD_TCHAR;
- shk.ptszDescription = LPGENW("Show/Hide contact list");
+ shk.dwFlags = HKD_UNICODE;
+ shk.pwszDescription = LPGENW("Show/Hide contact list");
shk.pszName = "ShowHide";
- shk.ptszSection = L"Main";
+ shk.pwszSection = L"Main";
shk.pszService = "CLIST/HK/SHOWHIDE";
shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'A');
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENW("Read message");
+ shk.pwszDescription = LPGENW("Read message");
shk.pszName = "ReadMessage";
- shk.ptszSection = L"Main";
+ shk.pwszSection = L"Main";
shk.pszService = "CLIST/HK/Read";
shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'I');
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENW("Open Options page");
+ shk.pwszDescription = LPGENW("Open Options page");
shk.pszName = "ShowOptions";
- shk.ptszSection = L"Main";
+ shk.pwszSection = L"Main";
shk.pszService = "CLIST/HK/Opts";
shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'O') | HKF_MIRANDA_LOCAL;
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENW("Open logging options");
+ shk.pwszDescription = LPGENW("Open logging options");
shk.pszName = "ShowLogOptions";
- shk.ptszSection = L"Main";
+ shk.pwszSection = L"Main";
shk.pszService = "Netlib/Log/Win";
shk.DefHotKey = 0;
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENW("Open 'Find user' dialog");
+ shk.pwszDescription = LPGENW("Open 'Find user' dialog");
shk.pszName = "FindUsers";
- shk.ptszSection = L"Main";
+ shk.pwszSection = L"Main";
shk.pszService = "FindAdd/FindAddCommand";
shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'F') | HKF_MIRANDA_LOCAL;
Hotkey_Register(&shk);
diff --git a/src/mir_app/src/langpack.cpp b/src/mir_app/src/langpack.cpp index 3a17d94307..b7f1bf02b0 100644 --- a/src/mir_app/src/langpack.cpp +++ b/src/mir_app/src/langpack.cpp @@ -34,10 +34,10 @@ BOOL EnumLangpacks(ENUM_PACKS_CALLBACK callback, WPARAM wParam, LPARAM lParam) BOOL res = FALSE;
/* language folder */
- ptrW langpack(db_get_tsa(NULL, "Langpack", "Current"));
+ ptrW langpack(db_get_wsa(NULL, "Langpack", "Current"));
wchar_t tszFullPath[MAX_PATH];
- PathToAbsoluteT(L"\\Languages\\langpack_*.txt", tszFullPath);
+ PathToAbsoluteW(L"\\Languages\\langpack_*.txt", tszFullPath);
BOOL fPackFound = FALSE;
WIN32_FIND_DATA wfd;
@@ -46,7 +46,7 @@ BOOL EnumLangpacks(ENUM_PACKS_CALLBACK callback, WPARAM wParam, LPARAM lParam) do {
if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue;
/* get data */
- PathToAbsoluteT(L"\\Languages\\", tszFullPath);
+ PathToAbsoluteW(L"\\Languages\\", tszFullPath);
mir_wstrcat(tszFullPath, wfd.cFileName);
LANGPACK_INFO pack;
diff --git a/src/mir_app/src/lpopts.cpp b/src/mir_app/src/lpopts.cpp index c8e7ed7602..ef319c03ac 100644 --- a/src/mir_app/src/lpopts.cpp +++ b/src/mir_app/src/lpopts.cpp @@ -43,7 +43,7 @@ static void DisplayPackInfo(HWND hwndDlg, const LANGPACK_INFO *pack) /* add some note if its incompatible */
if (szLanguageName[0] && szContryName[0]) {
- mir_snwprintf(szLocaleName, L"%s (%s)", TranslateTS(szLanguageName), TranslateTS(szContryName));
+ mir_snwprintf(szLocaleName, L"%s (%s)", TranslateW(szLanguageName), TranslateW(szContryName));
if (!IsValidLocale(pack->Locale, LCID_INSTALLED)) {
wchar_t *pszIncompat;
pszIncompat = TranslateT("(incompatible)");
@@ -67,7 +67,7 @@ static void DisplayPackInfo(HWND hwndDlg, const LANGPACK_INFO *pack) SetDlgItemText_CP(hwndDlg, IDC_LANGMODUSING, pack->szLastModifiedUsing);
SetDlgItemText_CP(hwndDlg, IDC_LANGAUTHORS, pack->szAuthors);
SetDlgItemText_CP(hwndDlg, IDC_LANGEMAIL, pack->szAuthorEmail);
- SetDlgItemText(hwndDlg, IDC_LANGINFOFRAME, TranslateTS(pack->tszLanguage));
+ SetDlgItemText(hwndDlg, IDC_LANGINFOFRAME, TranslateW(pack->tszLanguage));
}
static BOOL InsertPackItemEnumProc(LANGPACK_INFO *pack, WPARAM wParam, LPARAM)
@@ -78,7 +78,7 @@ static BOOL InsertPackItemEnumProc(LANGPACK_INFO *pack, WPARAM wParam, LPARAM) /* insert */
wchar_t tszName[512];
mir_snwprintf(tszName, L"%s [%s]",
- TranslateTS(pack->tszLanguage),
+ TranslateW(pack->tszLanguage),
pack->flags & LPF_DEFAULT ? TranslateT("built-in") : pack->tszFileName);
UINT message = pack->flags & LPF_DEFAULT ? CB_INSERTSTRING : CB_ADDSTRING;
int idx = SendMessage((HWND)wParam, message, 0, (LPARAM)tszName);
@@ -166,7 +166,7 @@ INT_PTR CALLBACK DlgLangpackOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP for (int i = 0; i < count; i++) {
LANGPACK_INFO *pack = (LANGPACK_INFO*)ComboBox_GetItemData(hwndList, i);
if (i == idx) {
- db_set_ts(NULL, "Langpack", "Current", pack->tszFileName);
+ db_set_ws(NULL, "Langpack", "Current", pack->tszFileName);
mir_wstrcpy(tszPath, pack->tszFullPath);
pack->flags |= LPF_ENABLED;
}
diff --git a/src/mir_app/src/menu_clist.cpp b/src/mir_app/src/menu_clist.cpp index 894c323e3b..524e19b75b 100644 --- a/src/mir_app/src/menu_clist.cpp +++ b/src/mir_app/src/menu_clist.cpp @@ -467,7 +467,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM) if (reset || check) {
TMO_IntMenuItem *timiParent = MO_GetIntMenuItem(pimi->mi.root);
if (timiParent) {
- LPTSTR ptszName = TranslateTH(pimi->mi.hLangpack, pimi->mi.hIcolibItem ? pimi->mi.name.w : LPGENW("Custom status"));
+ LPTSTR ptszName = TranslateW_LP(pimi->mi.hIcolibItem ? pimi->mi.name.w : LPGENW("Custom status"), pimi->mi.hLangpack);
timiParent = MO_GetIntMenuItem(pimi->mi.root);
@@ -816,7 +816,7 @@ void RebuildMenuOrder(void) // adding root
CMenuItem mi;
- mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.flags = CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
mi.position = pos++;
mi.hIcon = ic = (HICON)CallProtoServiceInt(NULL, pa->szModuleName, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0);
@@ -832,7 +832,7 @@ void RebuildMenuOrder(void) TMO_IntMenuItem *rootmenu = Menu_AddItem(hStatusMenuObject, &mi, smep);
memset(&mi, 0, sizeof(mi));
- mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.flags = CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
mi.root = rootmenu;
mi.position = pos++;
mi.hIcon = ic;
@@ -873,7 +873,7 @@ void RebuildMenuOrder(void) // adding
memset(&mi, 0, sizeof(mi));
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
if (statusModeList[j] == ID_STATUS_OFFLINE)
mi.flags |= CMIF_CHECKED;
mi.root = rootmenu;
@@ -914,7 +914,7 @@ void RebuildMenuOrder(void) continue;
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
if (statusModeList[j] == ID_STATUS_OFFLINE)
mi.flags |= CMIF_CHECKED;
@@ -1145,14 +1145,14 @@ void InitCustomMenus(void) CreateServiceFunction(MS_CLIST_HKSTATUS, HotkeySetStatus);
HOTKEYDESC hkd = { sizeof(hkd) };
- hkd.ptszSection = L"Status";
- hkd.dwFlags = HKD_TCHAR;
+ hkd.pwszSection = L"Status";
+ hkd.dwFlags = HKD_UNICODE;
for (int i = 0; i < _countof(statusHotkeys); i++) {
char szName[30];
mir_snprintf(szName, "StatusHotKey_%d", i);
hkd.pszName = szName;
hkd.lParam = statusModeList[i];
- hkd.ptszDescription = fnGetStatusModeDescription(hkd.lParam, 0);
+ hkd.pwszDescription = fnGetStatusModeDescription(hkd.lParam, 0);
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, '0' + i) | HKF_MIRANDA_LOCAL;
hkd.pszService = MS_CLIST_HKSTATUS;
statusHotkeys[i] = Hotkey_Register(&hkd);
diff --git a/src/mir_app/src/menu_options.cpp b/src/mir_app/src/menu_options.cpp index a2acb5dfaa..c2d1bf2b5a 100644 --- a/src/mir_app/src/menu_options.cpp +++ b/src/mir_app/src/menu_options.cpp @@ -96,8 +96,8 @@ class CGenMenuOptionsPage : public CDlgBase else ptszCustomName = L""; - CMString tszValue(FORMAT, L"%d;%d;%S;%s", visible, runtimepos, pszParent, ptszCustomName); - db_set_ts(NULL, szModule, menuItemName, tszValue); + CMStringW tszValue(FORMAT, L"%d;%d;%S;%s", visible, runtimepos, pszParent, ptszCustomName); + db_set_ws(NULL, szModule, menuItemName, tszValue); if (pimi->mi.flags & CMIF_CUSTOM) db_set_s(NULL, szModule, CMStringA(FORMAT, "Custom%d", customOrder++), menuItemName); @@ -321,7 +321,7 @@ public: for (int i = 0; i < g_menus.getCount(); i++) { TIntMenuObject *p = g_menus[i]; if (p->id != (int)hStatusMenuObject && p->m_bUseUserDefinedItems) - m_menuObjects.AddString(TranslateTS(p->ptszDisplayName), p->id); + m_menuObjects.AddString(TranslateW(p->ptszDisplayName), p->id); } m_menuObjects.SetCurSel(0); diff --git a/src/mir_app/src/menu_utils.cpp b/src/mir_app/src/menu_utils.cpp index 838eb24344..b301b8cac0 100644 --- a/src/mir_app/src/menu_utils.cpp +++ b/src/mir_app/src/menu_utils.cpp @@ -78,7 +78,7 @@ LPTSTR GetMenuItemText(TMO_IntMenuItem *pimi) if (pimi->mi.flags & CMIF_KEEPUNTRANSLATED)
return pimi->mi.name.w;
- return TranslateTH(pimi->mi.hLangpack, pimi->mi.name.w);
+ return TranslateW_LP(pimi->mi.name.w, pimi->mi.hLangpack);
}
///////////////////////////////////////////////////////////////////////////////
@@ -241,7 +241,7 @@ MIR_APP_DLL(HGENMENU) Menu_GetProtocolRoot(PROTO_INTERFACE *pThis) CMenuItem mi;
mi.name.w = pThis->m_tszUserName;
mi.position = 500090000;
- mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.flags = CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
mi.hIcolibItem = pThis->m_hProtoIcon;
char szUid[33];
@@ -685,7 +685,7 @@ MIR_APP_DLL(HGENMENU) Menu_CreateRoot(int hMenuObject, LPCTSTR ptszName, int pos return oldroot;
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = hIcoLib;
mi.hLangpack = _hLang;
mi.name.w = (wchar_t*)ptszName;
@@ -875,7 +875,7 @@ static int sttReadOldItem(TMO_IntMenuItem *pmi, void *szModule) // mi.name.w
mir_snprintf(szSetting, "%s_name", menuItemName);
- wchar_t *tszCustomName = db_get_tsa(NULL, (char*)szModule, szSetting);
+ wchar_t *tszCustomName = db_get_wsa(NULL, (char*)szModule, szSetting);
if (tszCustomName != NULL) {
mir_free(pmi->ptszCustomName);
pmi->ptszCustomName = tszCustomName;
@@ -906,8 +906,8 @@ static int sttDumpItem(TMO_IntMenuItem *pmi, void *szModule) else
bin2hex(&pmi->mi.root->mi.uid, sizeof(MUUID), szRootUid);
- CMString szNewValue(FORMAT, L"%d;%d;%S;%s", bVisible, pmi->mi.position, szRootUid, ptszName);
- db_set_ts(NULL, (char*)szModule, menuItemName, szNewValue);
+ CMStringW szNewValue(FORMAT, L"%d;%d;%S;%s", bVisible, pmi->mi.position, szRootUid, ptszName);
+ db_set_ws(NULL, (char*)szModule, menuItemName, szNewValue);
Netlib_Logf(NULL, "MENU[%s] => %s, %d, %d", menuItemName, pmi->pszUniqName, bVisible, pmi->mi.position);
}
@@ -989,7 +989,7 @@ int Menu_LoadFromDatabase(TMO_IntMenuItem *pimi, void *szModule) bin2hex(&pimi->mi.uid, sizeof(pimi->mi.uid), menuItemName);
TIntMenuObject *pmo = pimi->parent;
- ptrW szValue(db_get_tsa(NULL, (char*)szModule, menuItemName));
+ ptrW szValue(db_get_wsa(NULL, (char*)szModule, menuItemName));
if (szValue == NULL)
return 0;
@@ -1221,7 +1221,7 @@ static int MO_RegisterIcon(TMO_IntMenuItem *pmi, void*) HICON hIcon = ImageList_GetIcon(pmi->parent->m_hMenuIcons, pmi->iconId, 0);
wchar_t sectionName[256];
- mir_snwprintf(sectionName, LPGENW("Menu icons") L"/%s", TranslateTS(pmi->parent->ptszDisplayName));
+ mir_snwprintf(sectionName, LPGENW("Menu icons") L"/%s", TranslateW(pmi->parent->ptszDisplayName));
char iconame[256], uname[100];
bin2hex(&pmi->mi.uid, sizeof(pmi->mi.uid), uname);
@@ -1242,7 +1242,7 @@ static int MO_RegisterIcon(TMO_IntMenuItem *pmi, void*) }
SKINICONDESC sid = { 0 };
- sid.flags = SIDF_TCHAR;
+ sid.flags = SIDF_UNICODE;
sid.section.w = sectionName;
sid.pszName = iconame;
sid.description.w = descr;
diff --git a/src/mir_app/src/meta_addto.cpp b/src/mir_app/src/meta_addto.cpp index 41e4d349d9..2a65e52656 100644 --- a/src/mir_app/src/meta_addto.cpp +++ b/src/mir_app/src/meta_addto.cpp @@ -141,7 +141,7 @@ static INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wPa CheckDlgButton(hwndDlg, IDC_ONLYAVAIL, BST_CHECKED); // Initially checked; display all metacontacts is only an option
// Besides, we can check if there is at least one metacontact to add the contact to.
if (BuildList(GetDlgItem(hwndDlg, IDC_METALIST), FALSE) <= 0) {
- if (MessageBox(hwndDlg, TranslateTS(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES)
+ if (MessageBox(hwndDlg, TranslateW(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES)
Meta_Convert(lParam, 0);
DestroyWindow(hwndDlg);
return TRUE;
@@ -187,7 +187,7 @@ static INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wPa case IDC_CHK_SRT:
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_METALIST), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_METALIST), GWL_STYLE) ^ LBS_SORT);
if (BuildList(GetDlgItem(hwndDlg, IDC_METALIST), IsDlgButtonChecked(hwndDlg, IDC_CHK_SRT) ? TRUE : FALSE) <= 0) {
- if (MessageBox(hwndDlg, TranslateTS(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES)
+ if (MessageBox(hwndDlg, TranslateW(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES)
Meta_Convert(lParam, 0);
DestroyWindow(hwndDlg);
return TRUE;
diff --git a/src/mir_app/src/meta_edit.cpp b/src/mir_app/src/meta_edit.cpp index ecb690d268..67e593666e 100644 --- a/src/mir_app/src/meta_edit.cpp +++ b/src/mir_app/src/meta_edit.cpp @@ -169,7 +169,7 @@ static void ApplyChanges() ai.format = PA_FORMAT_UNKNOWN;
wcsncpy_s(ai.filename, L"X", _TRUNCATE);
if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS)
- db_set_ts(g_data.hMeta, "ContactPhoto", "File", ai.filename);
+ db_set_ws(g_data.hMeta, "ContactPhoto", "File", ai.filename);
}
}
@@ -304,7 +304,7 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara switch (LOWORD(wParam)) {
case IDC_VALIDATE: // Apply changes, if there is still one contact attached to the metacontact.
if (g_data.num_contacts == 0) { // Otherwise, delete the metacontact.
- if (IDYES == MessageBox(hwndDlg, TranslateTS(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) {
+ if (IDYES == MessageBox(hwndDlg, TranslateW(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) {
Meta_Delete(g_data.hMeta, 0);
DestroyWindow(hwndDlg);
}
@@ -319,7 +319,7 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara case IDOK:
if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_VALIDATE))) { // If there are changes that could be made,
if (g_data.num_contacts == 0) { // do the work that would have be done if the 'Apply' button was clicked.
- if (IDYES == MessageBox(hwndDlg, TranslateTS(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) {
+ if (IDYES == MessageBox(hwndDlg, TranslateW(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) {
Meta_Delete(g_data.hMeta, 0);
DestroyWindow(hwndDlg);
}
diff --git a/src/mir_app/src/meta_menu.cpp b/src/mir_app/src/meta_menu.cpp index 3929c057e8..cac1b4bdb2 100644 --- a/src/mir_app/src/meta_menu.cpp +++ b/src/mir_app/src/meta_menu.cpp @@ -49,7 +49,7 @@ static HGENMENU INT_PTR Meta_Convert(WPARAM wParam, LPARAM)
{
- ptrW tszGroup(db_get_tsa(wParam, "CList", "Group"));
+ ptrW tszGroup(db_get_wsa(wParam, "CList", "Group"));
// Create a new metacontact
MCONTACT hMetaContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
@@ -68,7 +68,7 @@ INT_PTR Meta_Convert(WPARAM wParam, LPARAM) Proto_AddToContact(hMetaContact, META_PROTO);
if (tszGroup)
- db_set_ts(hMetaContact, "CList", "Group", tszGroup);
+ db_set_ws(hMetaContact, "CList", "Group", tszGroup);
// Assign the contact to the MetaContact just created (and make default).
if (!Meta_Assign(wParam, hMetaContact, TRUE)) {
@@ -167,7 +167,7 @@ void Meta_RemoveContactNumber(DBCachedContact *ccMeta, int number, bool bUpdateI wcsncpy_s(ai.filename, L"X", _TRUNCATE);
if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS)
- db_set_ts(ccMeta->contactID, "ContactPhoto", "File", ai.filename);
+ db_set_ws(ccMeta->contactID, "ContactPhoto", "File", ai.filename);
}
}
}
@@ -207,7 +207,7 @@ INT_PTR Meta_Delete(WPARAM hContact, LPARAM bSkipQuestion) return 2;
if (cc->nSubs == 1) {
- if (IDYES == MessageBox(0, TranslateTS(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1))
+ if (IDYES == MessageBox(0, TranslateW(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1))
Meta_Delete(cc->contactID, 1);
return 0;
@@ -266,7 +266,7 @@ int Meta_ModifyMenu(WPARAM hMeta, LPARAM) Menu_ModifyItem(hMenuDelete, LPGENW("Remove from metacontact"));
// show subcontact menu items
- CMString tszNick;
+ CMStringW tszNick;
for (int i = 0; i < MAX_CONTACTS; i++) {
if (i >= cc->nSubs) {
Menu_ShowItem(hMenuContact[i], false);
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index ae59188348..f42d3de877 100644 --- a/src/mir_app/src/meta_services.cpp +++ b/src/mir_app/src/meta_services.cpp @@ -299,7 +299,7 @@ int Meta_HandleACK(WPARAM, LPARAM lParam) return 0;
if (!db_get(ack->hContact, "ContactPhoto", "File", &dbv)) {
- db_set_ts(cc->contactID, "ContactPhoto", "File", dbv.ptszVal);
+ db_set_ws(cc->contactID, "ContactPhoto", "File", dbv.ptszVal);
db_free(&dbv);
}
@@ -380,7 +380,7 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam) mir_snprintf(buffer, "Nick%d", contact_number);
db_set(ccMeta->contactID, META_PROTO, buffer, &dcws->value);
- ptrW tszMyhandle(db_get_tsa(hContact, "CList", "MyHandle"));
+ ptrW tszMyhandle(db_get_wsa(hContact, "CList", "MyHandle"));
if (tszMyhandle == NULL) {
mir_snprintf(buffer, "CListName%d", contact_number);
db_set(ccMeta->contactID, META_PROTO, buffer, &dcws->value);
@@ -408,8 +408,8 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam) mir_snprintf(buffer, "CListName%d", contact_number);
DBVARIANT dbv;
- if (proto && !db_get_ts(hContact, proto, "Nick", &dbv)) {
- db_set_ts(ccMeta->contactID, META_PROTO, buffer, dbv.ptszVal);
+ if (proto && !db_get_ws(hContact, proto, "Nick", &dbv)) {
+ db_set_ws(ccMeta->contactID, META_PROTO, buffer, dbv.ptszVal);
db_free(&dbv);
}
else db_unset(ccMeta->contactID, META_PROTO, buffer);
@@ -430,7 +430,7 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam) db_set_w(ccMeta->contactID, META_PROTO, buffer, dcws->value.wVal);
mir_snprintf(buffer, "StatusString%d", contact_number);
- db_set_ts(ccMeta->contactID, META_PROTO, buffer, cli.pfnGetStatusModeDescription(dcws->value.wVal, 0));
+ db_set_ws(ccMeta->contactID, META_PROTO, buffer, cli.pfnGetStatusModeDescription(dcws->value.wVal, 0));
// set status to that of most online contact
MCONTACT hMostOnline = Meta_GetMostOnline(ccMeta);
@@ -448,7 +448,7 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam) ai.format = PA_FORMAT_UNKNOWN;
wcsncpy_s(ai.filename, L"X", _TRUNCATE);
if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS)
- db_set_ts(ccMeta->contactID, "ContactPhoto", "File", ai.filename);
+ db_set_ws(ccMeta->contactID, "ContactPhoto", "File", ai.filename);
}
}
@@ -607,7 +607,7 @@ static int Meta_SrmmIconClicked(WPARAM hMeta, LPARAM lParam) if (pa == NULL)
continue;
- CMString tszNick;
+ CMStringW tszNick;
if (options.menu_contact_label == DNT_DID)
tszNick = cli.pfnGetContactDisplayName(cc->pSubs[i], 0);
else
@@ -653,7 +653,7 @@ int Meta_ModulesLoaded(WPARAM, LPARAM) // create srmm icon
StatusIconData sid = { sizeof(sid) };
sid.szModule = META_PROTO;
- sid.flags = MBF_TCHAR;
+ sid.flags = MBF_UNICODE;
sid.tszTooltip = LPGENW("Select metacontact");
sid.hIcon = Skin_LoadProtoIcon(META_PROTO, ID_STATUS_ONLINE);
Srmm_AddIcon(&sid);
@@ -692,7 +692,7 @@ INT_PTR Meta_ContactMenuFunc(WPARAM hMeta, LPARAM lParam) // set default contact for sending/status and open message window
Meta_SetSrmmSub(hMeta, hContact);
db_mc_setDefaultNum(hMeta, lParam, false);
- CallService(MS_MSG_SENDMESSAGET, hMeta, 0);
+ CallService(MS_MSG_SENDMESSAGEW, hMeta, 0);
}
else // protocol does not support messaging - simulate double click
CallService(MS_CLIST_CONTACTDOUBLECLICKED, hContact, 0);
@@ -798,7 +798,7 @@ INT_PTR Meta_GetInfo(WPARAM, LPARAM lParam) ai.format = PA_FORMAT_UNKNOWN;
wcsncpy_s(ai.filename, L"X", _TRUNCATE);
if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS)
- db_set_ts(ccs->hContact, "ContactPhoto", "File", ai.filename);
+ db_set_ws(ccs->hContact, "ContactPhoto", "File", ai.filename);
hMostOnline = Meta_GetMostOnline(cc);
Meta_CopyContactNick(cc, hMostOnline);
diff --git a/src/mir_app/src/meta_utils.cpp b/src/mir_app/src/meta_utils.cpp index 8ef0a9876f..d15be199ec 100644 --- a/src/mir_app/src/meta_utils.cpp +++ b/src/mir_app/src/meta_utils.cpp @@ -44,7 +44,7 @@ int Meta_SetNick(char *szProto) if (tszNick == NULL)
return 1;
- db_set_ts(NULL, META_PROTO, "Nick", tszNick);
+ db_set_ws(NULL, META_PROTO, "Nick", tszNick);
return 0;
}
@@ -124,7 +124,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) // write the display name
mir_snprintf(buffer, "CListName%d", ccDest->nSubs);
- db_set_ts(hMeta, META_PROTO, buffer, cli.pfnGetContactDisplayName(hSub, 0));
+ db_set_ws(hMeta, META_PROTO, buffer, cli.pfnGetContactDisplayName(hSub, 0));
// Get the status
WORD status = db_get_w(hSub, szProto, "Status", ID_STATUS_OFFLINE);
@@ -141,7 +141,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) mir_snprintf(buffer, "StatusString%d", ccDest->nSubs);
wchar_t *szStatus = cli.pfnGetStatusModeDescription(status, 0);
- db_set_ts(hMeta, META_PROTO, buffer, szStatus);
+ db_set_ws(hMeta, META_PROTO, buffer, szStatus);
// Write the link in the contact
db_set_dw(hSub, META_PROTO, "ParentMeta", hMeta);
@@ -173,7 +173,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) wcsncpy_s(ai.filename, L"X", _TRUNCATE);
if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS)
- db_set_ts(hMeta, "ContactPhoto", "File", ai.filename);
+ db_set_ws(hMeta, "ContactPhoto", "File", ai.filename);
}
// merge sub's events to the meta-history
@@ -431,16 +431,16 @@ int Meta_CopyContactNick(DBCachedContact *ccMeta, MCONTACT hContact) return 1;
if (options.clist_contact_name == CNNT_NICK) {
- ptrW tszNick(db_get_tsa(hContact, szProto, "Nick"));
+ ptrW tszNick(db_get_wsa(hContact, szProto, "Nick"));
if (tszNick) {
- db_set_ts(ccMeta->contactID, META_PROTO, "Nick", tszNick);
+ db_set_ws(ccMeta->contactID, META_PROTO, "Nick", tszNick);
return 0;
}
}
else if (options.clist_contact_name == CNNT_DISPLAYNAME) {
wchar_t *name = cli.pfnGetContactDisplayName(hContact, 0);
if (name && mir_wstrcmp(name, TranslateT("(Unknown contact)")) != 0) {
- db_set_ts(ccMeta->contactID, META_PROTO, "Nick", name);
+ db_set_ws(ccMeta->contactID, META_PROTO, "Nick", name);
return 0;
}
}
@@ -499,7 +499,7 @@ int Meta_SwapContacts(DBCachedContact *cc, int n1, int n2) /////////////////////////////////////////////////////////////////////////////////////////
-void Meta_GetSubNick(MCONTACT hMeta, int i, CMString &tszDest)
+void Meta_GetSubNick(MCONTACT hMeta, int i, CMStringW &tszDest)
{
char idStr[50];
mir_snprintf(idStr, "Login%d", i);
diff --git a/src/mir_app/src/metacontacts.h b/src/mir_app/src/metacontacts.h index c47b419729..8aadcca5cb 100644 --- a/src/mir_app/src/metacontacts.h +++ b/src/mir_app/src/metacontacts.h @@ -55,7 +55,7 @@ int Meta_SuppressStatus(int suppress); int Meta_CopyContactNick(DBCachedContact *cc, MCONTACT hContact);
int Meta_SetAllNicks();
int Meta_SwapContacts(DBCachedContact *cc, int contact_number1, int contact_number2);
-void Meta_GetSubNick(MCONTACT hMeta, int i, CMString &tszDest);
+void Meta_GetSubNick(MCONTACT hMeta, int i, CMStringW &tszDest);
MCONTACT Meta_GetMostOnline(DBCachedContact *cc);
MCONTACT Meta_GetMostOnlineSupporting(DBCachedContact *cc, int pflagnum, unsigned long capability);
diff --git a/src/mir_app/src/movetogroup.cpp b/src/mir_app/src/movetogroup.cpp index 541404e28b..6f229c38d7 100644 --- a/src/mir_app/src/movetogroup.cpp +++ b/src/mir_app/src/movetogroup.cpp @@ -70,7 +70,7 @@ static void AddGroupItem(HGENMENU hRoot, wchar_t* name, int pos, WPARAM param, b mi.root = hRoot;
mi.position = pos;
mi.name.w = PrepareGroupName(name);
- mi.flags = CMIF_SYSTEM | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.flags = CMIF_SYSTEM | CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
if (checked)
mi.flags |= CMIF_CHECKED;
mi.pszService = MTG_MOVE;
@@ -92,7 +92,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM) Menu_RemoveItem((HGENMENU)lphGroupsItems[i]);
lphGroupsItems.destroy();
- ptrW szContactGroup(db_get_tsa(wParam, "CList", "Group"));
+ ptrW szContactGroup(db_get_wsa(wParam, "CList", "Group"));
int pos = 1000;
@@ -105,7 +105,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM) _itoa(i, intname, 10);
DBVARIANT dbv;
- if (db_get_ts(NULL, "CListGroups", intname, &dbv))
+ if (db_get_ws(NULL, "CListGroups", intname, &dbv))
break;
if (dbv.ptszVal[0])
diff --git a/src/mir_app/src/netliblog.cpp b/src/mir_app/src/netliblog.cpp index 7c78bf6561..300caa9684 100644 --- a/src/mir_app/src/netliblog.cpp +++ b/src/mir_app/src/netliblog.cpp @@ -42,7 +42,7 @@ struct { int showUser;
int dumpSent, dumpRecv, dumpProxy, dumpSsl;
int textDumps, autoDetectText;
- CMString tszFile, tszUserFile;
+ CMStringW tszFile, tszUserFile;
}
static logOptions = { 0 };
@@ -64,16 +64,16 @@ static void InitLog() hLogger = NULL;
}
- ptrW szBuf(db_get_tsa(NULL, "Netlib", "File"));
+ ptrW szBuf(db_get_wsa(NULL, "Netlib", "File"));
if (mir_wstrlen(szBuf)) {
logOptions.tszUserFile = szBuf.get();
wchar_t path[MAX_PATH];
- PathToAbsoluteT(VARST(szBuf), path);
+ PathToAbsoluteW(VARSW(szBuf), path);
logOptions.tszFile = path;
}
else {
- db_set_ts(NULL, "Netlib", "File", logOptions.tszUserFile = L"%miranda_logpath%\\netlog.txt");
+ db_set_ws(NULL, "Netlib", "File", logOptions.tszUserFile = L"%miranda_logpath%\\netlog.txt");
logOptions.tszFile = Utils_ReplaceVarsT(logOptions.tszUserFile);
}
@@ -105,7 +105,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa CheckDlgButton(hwndDlg, IDC_AUTODETECTTEXT, logOptions.autoDetectText ? BST_CHECKED : BST_UNCHECKED);
{
for (int i=0; i < _countof(szTimeFormats); i++)
- SendDlgItemMessage(hwndDlg, IDC_TIMEFORMAT, CB_ADDSTRING, 0, (LPARAM)TranslateTS(szTimeFormats[i]));
+ SendDlgItemMessage(hwndDlg, IDC_TIMEFORMAT, CB_ADDSTRING, 0, (LPARAM)TranslateW(szTimeFormats[i]));
}
SendDlgItemMessage(hwndDlg, IDC_TIMEFORMAT, CB_SETCURSEL, logOptions.timeFormat, 0);
CheckDlgButton(hwndDlg, IDC_SHOWNAMES, logOptions.showUser ? BST_CHECKED : BST_UNCHECKED);
@@ -150,7 +150,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa wchar_t path[MAX_PATH];
GetWindowText((HWND)lParam, path, _countof(path));
- PathToAbsoluteT(VARST(path), path);
+ PathToAbsoluteW(VARSW(path), path);
SetDlgItemText(hwndDlg, IDC_PATH, path);
}
break;
@@ -202,12 +202,12 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa case IDOK:
GetDlgItemText(hwndDlg, IDC_RUNATSTART, str, _countof(str));
- db_set_ts(NULL, "Netlib", "RunAtStart", str);
+ db_set_ws(NULL, "Netlib", "RunAtStart", str);
db_set_b(NULL, "Netlib", "ShowLogOptsAtStart", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWTHISDLGATSTART));
GetDlgItemText(hwndDlg, IDC_FILENAME, str, _countof(str));
logOptions.tszUserFile = rtrimw(str);
- db_set_ts(NULL, "Netlib", "File", str);
+ db_set_ws(NULL, "Netlib", "File", str);
GetDlgItemText(hwndDlg, IDC_PATH, str, _countof(str));
logOptions.tszFile = rtrimw(str);
@@ -515,7 +515,7 @@ void NetlibLogInit(void) if (db_get_b(NULL, "Netlib", "ShowLogOptsAtStart", 0))
NetlibLogShowOptions();
- ptrW szBuf(db_get_tsa(NULL, "Netlib", "RunAtStart"));
+ ptrW szBuf(db_get_wsa(NULL, "Netlib", "RunAtStart"));
if (szBuf) {
STARTUPINFO si = { sizeof(si) };
PROCESS_INFORMATION pi;
diff --git a/src/mir_app/src/netlibopts.cpp b/src/mir_app/src/netlibopts.cpp index 3a3c3512a5..aaa22b5887 100644 --- a/src/mir_app/src/netlibopts.cpp +++ b/src/mir_app/src/netlibopts.cpp @@ -87,7 +87,7 @@ static void EnableMultipleControls(HWND hwndDlg, const UINT *controls, int cCont static void AddProxyTypeItem(HWND hwndDlg, int type, int selectType)
{
- int i = SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_ADDSTRING, 0, (LPARAM)(type == 0 ? TranslateTS(szProxyTypes[type]) : szProxyTypes[type]));
+ int i = SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_ADDSTRING, 0, (LPARAM)(type == 0 ? TranslateW(szProxyTypes[type]) : szProxyTypes[type]));
SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_SETITEMDATA, i, type);
if (type == selectType)
SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_SETCURSEL, i, 0);
diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp index 51edc215b1..1f22c5e15e 100644 --- a/src/mir_app/src/newplugins.cpp +++ b/src/mir_app/src/newplugins.cpp @@ -569,7 +569,7 @@ bool LoadCorePlugin(MuuidReplacement &mr) pluginEntry* pPlug = OpenPlugin(tszPlugName, L"Core", exe);
if (pPlug->pclass & PCLASS_FAILED) {
LBL_Error:
- MessageBox(NULL, CMString(FORMAT, TranslateTS(tszCoreErr), mr.stdplugname), TranslateT("Fatal error"), MB_OK | MB_ICONSTOP);
+ MessageBox(NULL, CMStringW(FORMAT, TranslateW(tszCoreErr), mr.stdplugname), TranslateT("Fatal error"), MB_OK | MB_ICONSTOP);
Plugin_UnloadDyn(pPlug);
mr.pImpl = NULL;
@@ -862,7 +862,7 @@ int LoadNewPluginsModuleInfos(void) mirandaVersion = (DWORD)CallService(MS_SYSTEM_GETVERSION, 0, 0);
// remember where the mirandaboot.ini goes
- PathToAbsoluteT(L"mirandaboot.ini", mirandabootini);
+ PathToAbsoluteW(L"mirandaboot.ini", mirandabootini);
// look for all *.dll's
enumPlugins(scanPluginsDir, 0, 0);
diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp index 556fb50687..f572d9865a 100644 --- a/src/mir_app/src/options.cpp +++ b/src/mir_app/src/options.cpp @@ -130,7 +130,7 @@ struct OptionsPageData : public MZeroedObject {
if (flags & ODPF_DONTTRANSLATE)
return ptszStr;
- return TranslateTH(hLangpack, ptszStr);
+ return TranslateW_LP(ptszStr, hLangpack);
}
};
@@ -564,7 +564,7 @@ static void RebuildPageTree(HWND hdlg, OptionsDlgData *dat) HWND oldWnd = NULL;
HWND oldTab = NULL;
- CMString fullTitle;
+ CMStringW fullTitle;
OptionsPageData *opd = dat->getCurrent();
if (opd != NULL) {
@@ -588,9 +588,9 @@ static void RebuildPageTree(HWND hdlg, OptionsDlgData *dat) continue;
opd = dat->arOpd[i];
- wchar_t *ptszGroup = TranslateTH(opd->hLangpack, opd->ptszGroup);
+ wchar_t *ptszGroup = TranslateW_LP(opd->ptszGroup, opd->hLangpack);
wchar_t *ptszTitle = opd->getString(opd->ptszTitle), *useTitle;
- wchar_t *ptszTab = TranslateTH(opd->hLangpack, opd->ptszTab);
+ wchar_t *ptszTab = TranslateW_LP(opd->ptszTab, opd->hLangpack);
tvis.hParent = NULL;
useTitle = ptszTitle;
@@ -798,10 +798,10 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L ptrW lastPage, lastGroup, lastTab;
OPENOPTIONSDIALOG *ood = (OPENOPTIONSDIALOG*)psh->pStartPage;
if (ood->pszPage == NULL) {
- lastPage = db_get_tsa(NULL, "Options", "LastPage");
+ lastPage = db_get_wsa(NULL, "Options", "LastPage");
if (ood->pszGroup == NULL)
- lastGroup = db_get_tsa(NULL, "Options", "LastGroup");
+ lastGroup = db_get_wsa(NULL, "Options", "LastGroup");
else
lastGroup = mir_a2u(ood->pszGroup);
}
@@ -811,7 +811,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L }
if (ood->pszTab == NULL)
- lastTab = db_get_tsa(NULL, "Options", "LastTab");
+ lastTab = db_get_wsa(NULL, "Options", "LastTab");
else
lastTab = mir_a2u(ood->pszTab);
@@ -979,7 +979,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L if (mir_wstrcmp(opd->ptszTitle, p->ptszTitle) || mir_wstrcmp(opd->ptszGroup, p->ptszGroup))
continue;
- tie.pszText = TranslateTH(p->hLangpack, p->ptszTab);
+ tie.pszText = TranslateW_LP(p->ptszTab, p->hLangpack);
tie.lParam = i;
TabCtrl_InsertItem(hwndTab, pages, &tie);
if (!mir_wstrcmp(opd->ptszTab, p->ptszTab))
@@ -1107,14 +1107,14 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L opd = dat->getCurrent();
if (opd) {
if (opd->ptszTab)
- db_set_ts(NULL, "Options", "LastTab", opd->ptszTab);
+ db_set_ws(NULL, "Options", "LastTab", opd->ptszTab);
else
db_unset(NULL, "Options", "LastTab");
if (opd->ptszGroup)
- db_set_ts(NULL, "Options", "LastGroup", opd->ptszGroup);
+ db_set_ws(NULL, "Options", "LastGroup", opd->ptszGroup);
else
db_unset(NULL, "Options", "LastGroup");
- db_set_ts(NULL, "Options", "LastPage", opd->ptszTitle);
+ db_set_ws(NULL, "Options", "LastPage", opd->ptszTitle);
}
else {
db_unset(NULL, "Options", "LastTab");
@@ -1176,11 +1176,11 @@ static void OpenOptionsNow(int _hLang, const char *pszGroup, const char *pszPage HTREEITEM hItem = NULL;
if (pszGroup != NULL) {
ptrW ptszGroup(mir_a2u(pszGroup));
- hItem = FindNamedTreeItemAtRoot(GetDlgItem(hwndOptions, IDC_PAGETREE), TranslateTH(_hLang, ptszGroup));
+ hItem = FindNamedTreeItemAtRoot(GetDlgItem(hwndOptions, IDC_PAGETREE), TranslateW_LP(ptszGroup, _hLang));
if (hItem != NULL)
- hItem = FindNamedTreeItemAtChildren(GetDlgItem(hwndOptions, IDC_PAGETREE), hItem, TranslateTH(_hLang, ptszPage));
+ hItem = FindNamedTreeItemAtChildren(GetDlgItem(hwndOptions, IDC_PAGETREE), hItem, TranslateW_LP(ptszPage, _hLang));
}
- else hItem = FindNamedTreeItemAtRoot(GetDlgItem(hwndOptions, IDC_PAGETREE), TranslateTH(_hLang, ptszPage));
+ else hItem = FindNamedTreeItemAtRoot(GetDlgItem(hwndOptions, IDC_PAGETREE), TranslateW_LP(ptszPage, _hLang));
if (hItem != NULL)
TreeView_SelectItem(GetDlgItem(hwndOptions, IDC_PAGETREE), hItem);
diff --git a/src/mir_app/src/options_ei.cpp b/src/mir_app/src/options_ei.cpp index fb6f3778dd..060fa85b93 100644 --- a/src/mir_app/src/options_ei.cpp +++ b/src/mir_app/src/options_ei.cpp @@ -111,7 +111,7 @@ class CExtraIconOptsDlg : public CDlgBase HTREEITEM Tree_AddExtraIconGroup(intlist &group, bool selected, HTREEITEM hAfter = TVI_LAST)
{
intlist *ids = new intlist();
- CMString desc;
+ CMStringW desc;
int img = 0;
for (int i = 0; i < group.count; i++) {
BaseExtraIcon *extra = registeredExtraIcons[group.data[i] - 1];
@@ -254,7 +254,7 @@ public: int numSlots = GetNumberOfSlots();
if (numSlots < (int)registeredExtraIcons.getCount()) {
HWND label = GetDlgItem(m_hwnd, IDC_MAX_ICONS_L);
- SetWindowText(label, CMString(FORMAT, TranslateT("*only the first %d icons will be shown"), numSlots));
+ SetWindowText(label, CMStringW(FORMAT, TranslateT("*only the first %d icons will be shown"), numSlots));
ShowWindow(label, SW_SHOW);
}
diff --git a/src/mir_app/src/path.cpp b/src/mir_app/src/path.cpp index cc1986da61..60687a30e4 100644 --- a/src/mir_app/src/path.cpp +++ b/src/mir_app/src/path.cpp @@ -36,7 +36,7 @@ wchar_t* GetContactID(MCONTACT hContact) {
char *szProto = GetContactProto(hContact);
if (db_get_b(hContact, szProto, "ChatRoom", 0) == 1)
- return db_get_tsa(hContact, szProto, "ChatRoomID");
+ return db_get_wsa(hContact, szProto, "ChatRoomID");
return Contact_GetInfo(CNF_UNIQUEID, hContact, szProto);
}
diff --git a/src/mir_app/src/pluginopts.cpp b/src/mir_app/src/pluginopts.cpp index cc4e3132b5..42c20aabe3 100644 --- a/src/mir_app/src/pluginopts.cpp +++ b/src/mir_app/src/pluginopts.cpp @@ -32,7 +32,7 @@ extern MUUID miid_clist, miid_database, miid_protocol; HANDLE hevLoadModule, hevUnloadModule;
static bool bOldMode = false;
-static CMString szFilter;
+static CMStringW szFilter;
static UINT_PTR timerID;
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_app/src/profilemanager.cpp b/src/mir_app/src/profilemanager.cpp index bac436b91a..0c24f1738c 100644 --- a/src/mir_app/src/profilemanager.cpp +++ b/src/mir_app/src/profilemanager.cpp @@ -115,7 +115,7 @@ class CCreateProfileDlg : public CDlgBase // now the file should be gone! } // ask the database to create the profile - CreatePathToFileT(profile); + CreatePathToFileW(profile); if ((err = link->makeDatabase(profile)) != ERROR_SUCCESS) { mir_snwprintf(buf, TranslateT("Unable to create the profile '%s', the error was %x"), file, err); MessageBox(m_hwnd, buf, TranslateT("Problem creating profile"), MB_ICONERROR | MB_OK); @@ -154,7 +154,7 @@ public: else { for (int i = 0; i < arDbPlugins.getCount(); i++) { DATABASELINK *p = arDbPlugins[i]; - m_driverList.AddString(TranslateTS(p->szFullName), (LPARAM)p); + m_driverList.AddString(TranslateW(p->szFullName), (LPARAM)p); } } @@ -302,7 +302,7 @@ class CChooseProfileDlg : public CDlgBase if (bFileLocked) // file locked list.SetItemText(iItem, 1, TranslateT("<In use>")); else - list.SetItemText(iItem, 1, TranslateTS(dblink->szFullName)); + list.SetItemText(iItem, 1, TranslateW(dblink->szFullName)); } else list.SetItemText(iItem, 1, TranslateT("<Unknown format>")); @@ -615,7 +615,7 @@ public: for (int i = 0; i < servicePlugins.getCount(); i++) { pluginEntry *p = servicePlugins[i]; - m_servicePlugs.AddString(TranslateTS(p->pluginname), i); + m_servicePlugs.AddString(TranslateW(p->pluginname), i); } } } diff --git a/src/mir_app/src/proto_accs.cpp b/src/mir_app/src/proto_accs.cpp index c6fdab3704..8999e88f06 100644 --- a/src/mir_app/src/proto_accs.cpp +++ b/src/mir_app/src/proto_accs.cpp @@ -90,7 +90,7 @@ void LoadDbAccounts(void) if (ver >= 4) {
_itoa(OFFSET_NAME + i, buf, 10);
- pa->tszAccountName = db_get_tsa(NULL, "Protocols", buf);
+ pa->tszAccountName = db_get_wsa(NULL, "Protocols", buf);
_itoa(OFFSET_ENABLED + i, buf, 10);
pa->bIsEnabled = db_get_dw(NULL, "Protocols", buf, 1) != 0;
@@ -179,7 +179,7 @@ void WriteDbAccounts() db_set_dw(NULL, "Protocols", buf, pa->bIsEnabled);
_itoa(OFFSET_NAME + i, buf, 10);
- db_set_ts(NULL, "Protocols", buf, pa->tszAccountName);
+ db_set_ws(NULL, "Protocols", buf, pa->tszAccountName);
}
db_unset(0, "Protocols", "ProtoCount");
diff --git a/src/mir_app/src/protocols.cpp b/src/mir_app/src/protocols.cpp index 4f1f1cde42..acbcf1c409 100644 --- a/src/mir_app/src/protocols.cpp +++ b/src/mir_app/src/protocols.cpp @@ -244,7 +244,7 @@ static INT_PTR Proto_ContactIsTyping(WPARAM wParam, LPARAM lParam) void Proto_SetStatus(const char *szProto, unsigned status)
{
if (CallProtoServiceInt(NULL, szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) {
- ptrW tszAwayMsg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, status, (LPARAM)szProto));
+ ptrW tszAwayMsg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGW, status, (LPARAM)szProto));
CallProtoServiceInt(NULL, szProto, PS_SETAWAYMSG, status, tszAwayMsg);
}
CallProtoServiceInt(NULL, szProto, PS_SETSTATUS, status, 0);
diff --git a/src/mir_app/src/searchresults.cpp b/src/mir_app/src/searchresults.cpp index 571712de7b..8f05b95e4d 100644 --- a/src/mir_app/src/searchresults.cpp +++ b/src/mir_app/src/searchresults.cpp @@ -71,7 +71,7 @@ void LoadColumnSizes(HWND hwndResults, const char *szProto) bool bNeedsFree = false;
lvc.mask = LVCF_TEXT | LVCF_WIDTH;
if (szColumnNames[i] != NULL)
- lvc.pszText = TranslateTS(szColumnNames[i]);
+ lvc.pszText = TranslateW(szColumnNames[i]);
else {
if (i == COLUMNID_HANDLE) {
lvc.pszText = L"ID";
@@ -243,7 +243,7 @@ int BeginSearch(HWND, struct FindAddDlgData *dat, const char *szProto, const cha void SetStatusBarSearchInfo(HWND hwndStatus, struct FindAddDlgData *dat)
{
- CMString str;
+ CMStringW str;
if (dat->searchCount != 0) {
str = TranslateT("Searching");
@@ -270,7 +270,7 @@ struct ProtoResultsSummary void SetStatusBarResultInfo(HWND hwndDlg)
{
HWND hwndResults = GetDlgItem(hwndDlg, IDC_RESULTS);
- CMString str;
+ CMStringW str;
int total = ListView_GetItemCount(hwndResults);
if (total != 0) {
diff --git a/src/mir_app/src/services.cpp b/src/mir_app/src/services.cpp index fc081a19ce..65b27c4862 100644 --- a/src/mir_app/src/services.cpp +++ b/src/mir_app/src/services.cpp @@ -142,7 +142,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT *lf, COLORR strncpy_s(idstr, prefix, _TRUNCATE);
int retval = 0;
- ptrW tszGroup(db_get_tsa(NULL, settings_group, idstr));
+ ptrW tszGroup(db_get_wsa(NULL, settings_group, idstr));
if (tszGroup != NULL)
wcsncpy_s(lf->lfFaceName, tszGroup, _TRUNCATE);
else
@@ -196,7 +196,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT *lf, COLORR return retval;
}
-int CreateFromFontSettings(FontSettingsT *fs, LOGFONT *lf)
+int CreateFromFontSettings(FontSettingsW *fs, LOGFONT *lf)
{
GetDefaultFontSetting(lf, 0);
@@ -217,7 +217,7 @@ int CreateFromFontSettings(FontSettingsT *fs, LOGFONT *lf) return 0;
}
-void UpdateFontSettings(FontIDW *font_id, FontSettingsT *fontsettings)
+void UpdateFontSettings(FontIDW *font_id, FontSettingsW *fontsettings)
{
LOGFONT lf;
COLORREF colour;
diff --git a/src/mir_app/src/skin.h b/src/mir_app/src/skin.h index 121169f8c3..2b78632534 100644 --- a/src/mir_app/src/skin.h +++ b/src/mir_app/src/skin.h @@ -38,7 +38,7 @@ struct THotkeyItem {
THotkeyType type;
char *pszService, *pszName; // pszName is valid _only_ for "root" hotkeys
- wchar_t *ptszSection, *ptszDescription;
+ wchar_t *pwszSection, *pwszDescription;
LPARAM lParam;
WORD DefHotkey, Hotkey;
bool Enabled;
@@ -56,8 +56,8 @@ struct THotkeyItem bool UnregisterHotkey; // valid only during WM_APP message in options UI, used to remove unregistered hotkeys from options
- __inline wchar_t* getSection() const { return TranslateTH(hLangpack, ptszSection); }
- __inline wchar_t* getDescr() const { return TranslateTH(hLangpack, ptszDescription); }
+ __inline wchar_t* getSection() const { return TranslateW_LP(pwszSection, hLangpack); }
+ __inline wchar_t* getDescr() const { return TranslateW_LP(pwszDescription, hLangpack); }
};
extern LIST<THotkeyItem> hotkeys;
diff --git a/src/mir_app/src/skin2opts.cpp b/src/mir_app/src/skin2opts.cpp index bfaf0c505e..7c240f1a6d 100644 --- a/src/mir_app/src/skin2opts.cpp +++ b/src/mir_app/src/skin2opts.cpp @@ -57,7 +57,7 @@ static HICON ExtractIconFromPath(const wchar_t *path, int cxIcon, int cyIcon) n = _wtoi(comma + 1);
*comma = 0;
}
- PathToAbsoluteT(file, fileFull);
+ PathToAbsoluteW(file, fileFull);
hIcon = NULL;
//SHOULD BE REPLACED WITH GOOD ENOUGH FUNCTION
@@ -681,7 +681,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM *sectionName = 0;
}
- pItemName = TranslateTS(pItemName);
+ pItemName = TranslateW(pItemName);
hItem = FindNamedTreeItemAt(hwndTree, hSection, pItemName);
if (!sectionName || !hItem) {
if (!hItem) {
@@ -908,7 +908,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
}
else if (item->temp_file) {
- db_set_ts(NULL, "SkinIcons", item->name, item->temp_file);
+ db_set_ws(NULL, "SkinIcons", item->name, item->temp_file);
item->source_small->release();
item->source_small = NULL;
SafeDestroyIcon(item->temp_icon);
diff --git a/src/mir_app/src/skinicons.cpp b/src/mir_app/src/skinicons.cpp index d653fb7aaf..f9c5a83088 100644 --- a/src/mir_app/src/skinicons.cpp +++ b/src/mir_app/src/skinicons.cpp @@ -282,7 +282,7 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) SKINICONDESC sid = { 0 };
sid.section.w = tszSection;
- sid.flags = SIDF_ALL_TCHAR;
+ sid.flags = SIDF_ALL_UNICODE;
str = wcsrchr(szPath, '\\');
if (str != NULL)
@@ -385,7 +385,7 @@ int LoadSkinIcons(void) char iconName[MAX_PATH];
SKINICONDESC sid = { 0 };
sid.defaultFile.w = modulePath;
- sid.flags = SIDF_PATH_TCHAR;
+ sid.flags = SIDF_PATH_UNICODE;
sid.pszName = iconName;
// Add main icons to list
diff --git a/src/mir_app/src/sounds.cpp b/src/mir_app/src/sounds.cpp index 847b456494..ebc1ea7cc6 100644 --- a/src/mir_app/src/sounds.cpp +++ b/src/mir_app/src/sounds.cpp @@ -29,19 +29,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct SoundItem
{
char* name;
- wchar_t* ptszSection;
- wchar_t* ptszDescription;
+ wchar_t* pwszSection;
+ wchar_t* pwszDescription;
wchar_t* ptszTempFile;
int hLangpack;
- __inline wchar_t* getSection() const { return TranslateTH(hLangpack, ptszSection); }
- __inline wchar_t* getDescr() const { return TranslateTH(hLangpack, ptszDescription); }
+ __inline wchar_t* getSection() const { return TranslateW_LP(pwszSection, hLangpack); }
+ __inline wchar_t* getDescr() const { return TranslateW_LP(pwszDescription, hLangpack); }
__inline void clear(void)
{
mir_free(name);
- mir_free(ptszSection);
- mir_free(ptszDescription);
+ mir_free(pwszSection);
+ mir_free(pwszDescription);
mir_free(ptszTempFile);
}
};
@@ -77,31 +77,31 @@ static INT_PTR ServiceSkinAddNewSound(WPARAM wParam, LPARAM lParam) if (ssd->cbSize != sizeof(SKINSOUNDDESCEX) || ssd->pszName == NULL || ssd->pszDescription == NULL)
return 1;
- SoundItem* item = new SoundItem; // due to OBJLIST
+ SoundItem *item = new SoundItem; // due to OBJLIST
item->name = mir_strdup(ssd->pszName);
item->ptszTempFile = NULL;
item->hLangpack = (int)wParam;
arSounds.insert(item);
- wchar_t* ptszDefaultFile;
+ wchar_t *pwszDefaultFile;
if (ssd->dwFlags & SSDF_UNICODE) {
- item->ptszDescription = mir_wstrdup(ssd->ptszDescription);
- item->ptszSection = mir_wstrdup((ssd->pszSection != NULL) ? ssd->ptszSection : L"Other");
- ptszDefaultFile = mir_wstrdup(ssd->ptszDefaultFile);
+ item->pwszDescription = mir_wstrdup(ssd->pwszDescription);
+ item->pwszSection = mir_wstrdup((ssd->pszSection != NULL) ? ssd->pwszSection : L"Other");
+ pwszDefaultFile = mir_wstrdup(ssd->pwszDefaultFile);
}
else {
- item->ptszDescription = mir_a2u(ssd->pszDescription);
- item->ptszSection = mir_a2u((ssd->pszSection != NULL) ? ssd->pszSection : "Other");
- ptszDefaultFile = mir_a2u(ssd->pszDefaultFile);
+ item->pwszDescription = mir_a2u(ssd->pszDescription);
+ item->pwszSection = mir_a2u((ssd->pszSection != NULL) ? ssd->pszSection : "Other");
+ pwszDefaultFile = mir_a2u(ssd->pszDefaultFile);
}
- if (ptszDefaultFile) {
+ if (pwszDefaultFile) {
DBVARIANT dbv;
if (db_get_s(NULL, "SkinSounds", item->name, &dbv))
- db_set_ts(NULL, "SkinSounds", item->name, ptszDefaultFile);
+ db_set_ws(NULL, "SkinSounds", item->name, pwszDefaultFile);
else
db_free(&dbv);
- mir_free(ptszDefaultFile);
+ mir_free(pwszDefaultFile);
}
return 0;
@@ -109,7 +109,7 @@ static INT_PTR ServiceSkinAddNewSound(WPARAM wParam, LPARAM lParam) static int SkinPlaySoundDefault(WPARAM wParam, LPARAM lParam)
{
- wchar_t* pszFile = (wchar_t*) lParam;
+ wchar_t *pszFile = (wchar_t*) lParam;
if (pszFile && (db_get_b(NULL, "Skin", "UseSound", 0) || (int)wParam == 1))
PlaySound(pszFile, NULL, SND_ASYNC | SND_FILENAME | SND_NOSTOP);
@@ -123,7 +123,7 @@ static INT_PTR ServiceSkinPlaySoundFile(WPARAM, LPARAM lParam) return 1;
wchar_t tszFull[MAX_PATH];
- PathToAbsoluteT(ptszFileName, tszFull);
+ PathToAbsoluteW(ptszFileName, tszFull);
NotifyEventHooks(hPlayEvent, 0, (LPARAM)tszFull);
return 0;
}
@@ -143,7 +143,7 @@ static INT_PTR ServiceSkinPlaySound(WPARAM, LPARAM lParam) return 1;
DBVARIANT dbv;
- if ( db_get_ts(NULL, "SkinSounds", pszSoundName, &dbv) == 0) {
+ if ( db_get_ws(NULL, "SkinSounds", pszSoundName, &dbv) == 0) {
ServiceSkinPlaySoundFile(0, (LPARAM)dbv.ptszVal);
db_free(&dbv);
return 0;
@@ -265,9 +265,9 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM NotifyEventHooks(hPlayEvent, 1, (LPARAM)arSounds[tvi.lParam].ptszTempFile);
else {
DBVARIANT dbv;
- if (!db_get_ts(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
+ if (!db_get_ws(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
wchar_t szPathFull[MAX_PATH];
- PathToAbsoluteT(dbv.ptszVal, szPathFull);
+ PathToAbsoluteW(dbv.ptszVal, szPathFull);
NotifyEventHooks(hPlayEvent, 1, (LPARAM)szPathFull);
db_free(&dbv);
}
@@ -296,13 +296,13 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM else {
if (db_get_b(NULL, "SkinSoundsOff", snd.name, 0) == 0) {
DBVARIANT dbv;
- if (db_get_ts(NULL, "SkinSounds", snd.name, &dbv) == 0) {
- PathToAbsoluteT(dbv.ptszVal, strdir);
+ if (db_get_ws(NULL, "SkinSounds", snd.name, &dbv) == 0) {
+ PathToAbsoluteW(dbv.ptszVal, strdir);
db_free(&dbv);
} } }
wcsncpy_s(strFull, (snd.ptszTempFile ? snd.ptszTempFile : L""), _TRUNCATE);
- PathToAbsoluteT(strFull, strdir);
+ PathToAbsoluteW(strFull, strdir);
OPENFILENAME ofn;
memset(&ofn, 0, sizeof(ofn));
@@ -352,7 +352,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM for (int i=0; i < arSounds.getCount(); i++)
if (arSounds[i].ptszTempFile)
- db_set_ts(NULL, "SkinSounds", arSounds[i].name, arSounds[i].ptszTempFile);
+ db_set_ws(NULL, "SkinSounds", arSounds[i].name, arSounds[i].ptszTempFile);
TVITEM tvi, tvic;
tvi.hItem = TreeView_GetRoot(hwndTree);
@@ -394,7 +394,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SetDlgItemText(hwndDlg, IDC_LOCATION, arSounds[tvi.lParam].ptszTempFile);
else {
DBVARIANT dbv;
- if (!db_get_ts(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
+ if (!db_get_ws(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
SetDlgItemText(hwndDlg, IDC_LOCATION, dbv.ptszVal);
db_free(&dbv);
}
diff --git a/src/mir_app/src/srmm_statusicon.cpp b/src/mir_app/src/srmm_statusicon.cpp index bcf7a8a0b7..dbc6daff65 100644 --- a/src/mir_app/src/srmm_statusicon.cpp +++ b/src/mir_app/src/srmm_statusicon.cpp @@ -180,7 +180,7 @@ static INT_PTR GetNthIcon(WPARAM wParam, LPARAM lParam) if (pc->tszTooltip) res.tszTooltip = pc->tszTooltip;
res.flags = pc->flags;
}
- res.tszTooltip = TranslateTH(p.hLangpack, res.tszTooltip);
+ res.tszTooltip = TranslateW_LP(res.tszTooltip, p.hLangpack);
return (INT_PTR)&res;
}
nVis++;
|