diff options
author | George Hazan <george.hazan@gmail.com> | 2016-07-26 09:20:25 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-07-26 09:20:25 +0000 |
commit | 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac (patch) | |
tree | 2e8bb660c908b54914abd562af8aafa4a486c846 /plugins/XSoundNotify/src | |
parent | a61c8728b379057fe7f0a0d86fe0b037598229dd (diff) |
less TCHARs:
- TCHAR is replaced with wchar_t everywhere;
- LPGENT replaced with either LPGENW or LPGEN;
- fixes for ANSI plugins that improperly used _t functions;
- TCHAR *t removed from MAllStrings;
- ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz*
git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/XSoundNotify/src')
-rw-r--r-- | plugins/XSoundNotify/src/dialog.cpp | 24 | ||||
-rw-r--r-- | plugins/XSoundNotify/src/options.cpp | 28 | ||||
-rw-r--r-- | plugins/XSoundNotify/src/stdafx.h | 6 | ||||
-rw-r--r-- | plugins/XSoundNotify/src/xsn_main.cpp | 10 |
4 files changed, 34 insertions, 34 deletions
diff --git a/plugins/XSoundNotify/src/dialog.cpp b/plugins/XSoundNotify/src/dialog.cpp index 34da7e7d13..5a6bff9772 100644 --- a/plugins/XSoundNotify/src/dialog.cpp +++ b/plugins/XSoundNotify/src/dialog.cpp @@ -28,10 +28,10 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP if ((INT_PTR)szUniqueId != CALLSERVICE_NOTFOUND && szUniqueId != NULL) {
DBVARIANT dbvuid = { 0 };
if (!db_get(hContact, pa->szModuleName, szUniqueId, &dbvuid)) {
- TCHAR uid[MAX_PATH];
+ wchar_t uid[MAX_PATH];
switch (dbvuid.type) {
case DBVT_DWORD:
- _itot(dbvuid.dVal, uid, 10);
+ _itow(dbvuid.dVal, uid, 10);
break;
case DBVT_ASCIIZ:
@@ -43,8 +43,8 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP break;
}
- TCHAR *nick = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR value[100];
+ wchar_t *nick = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t value[100];
mir_sntprintf(value, TranslateT("Custom sound for %s (%s)"), nick, uid);
SetWindowText(hwndDlg, value);
db_free(&dbvuid);
@@ -80,7 +80,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP p = XSN_Users.find((XSN_Data *)&hContact);
if (p != NULL) {
if (mir_tstrcmpi(p->path, L"")) {
- TCHAR shortpath[MAX_PATH];
+ wchar_t shortpath[MAX_PATH];
PathToRelativeT(p->path, shortpath);
db_set_ts(hContact, SETTINGSNAME, SETTINGSKEY, shortpath);
}
@@ -93,12 +93,12 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP case IDC_CONT_BUTTON_CHOOSE_SOUND:
{
- TCHAR FileName[MAX_PATH];
- TCHAR *tszMirDir = Utils_ReplaceVarsT(L"%miranda_path%");
+ wchar_t FileName[MAX_PATH];
+ wchar_t *tszMirDir = Utils_ReplaceVarsT(L"%miranda_path%");
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
- TCHAR tmp[MAX_PATH];
+ wchar_t tmp[MAX_PATH];
if (GetModuleHandle(L"bass_interface.dll"))
mir_sntprintf(tmp, L"%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%c", TranslateT("Sound files"), 0, 0, 0);
else
@@ -119,7 +119,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP if (p == NULL)
XSN_Users.insert(new XSN_Data(hContact, FileName, IsDlgButtonChecked(hwndDlg, IDC_CONT_IGNORE_SOUND) ? 1 : 0));
else {
- _tcsncpy(p->path, FileName, _countof(p->path));
+ wcsncpy(p->path, FileName, _countof(p->path));
p->ignore = IsDlgButtonChecked(hwndDlg, IDC_CONT_IGNORE_SOUND) ? 1 : 0;
}
EnableWindow(GetDlgItem(hwndDlg, IDC_CONT_BUTTON_TEST_PLAY), TRUE);
@@ -135,14 +135,14 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP if (p == NULL) {
DBVARIANT dbv;
if (!db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
- TCHAR longpath[MAX_PATH] = { 0 };
+ wchar_t longpath[MAX_PATH] = { 0 };
PathToAbsoluteT(dbv.ptszVal, longpath);
SkinPlaySoundFile(longpath);
db_free(&dbv);
}
}
else {
- TCHAR longpath[MAX_PATH] = { 0 };
+ wchar_t longpath[MAX_PATH] = { 0 };
PathToAbsoluteT(p->path, longpath);
SkinPlaySoundFile(longpath);
}
@@ -168,7 +168,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP if (p == NULL) {
DBVARIANT dbv;
if (!db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
- TCHAR longpath[MAX_PATH];
+ wchar_t longpath[MAX_PATH];
PathToAbsoluteT(dbv.ptszVal, longpath);
XSN_Users.insert(new XSN_Data(hContact, longpath, IsDlgButtonChecked(hwndDlg, IDC_CONT_IGNORE_SOUND) ? 1 : 0));
db_free(&dbv);
diff --git a/plugins/XSoundNotify/src/options.cpp b/plugins/XSoundNotify/src/options.cpp index 6317a5ecb6..775cfc6ffd 100644 --- a/plugins/XSoundNotify/src/options.cpp +++ b/plugins/XSoundNotify/src/options.cpp @@ -59,10 +59,10 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l if ((INT_PTR)szUniqueId != CALLSERVICE_NOTFOUND && szUniqueId != NULL) {
DBVARIANT dbvuid = { 0 };
if (!db_get(hContact, pa->szModuleName, szUniqueId, &dbvuid)) {
- TCHAR uid[MAX_PATH];
+ wchar_t uid[MAX_PATH];
switch (dbvuid.type) {
case DBVT_DWORD:
- _itot(dbvuid.dVal, uid, 10);
+ _itow(dbvuid.dVal, uid, 10);
break;
case DBVT_ASCIIZ:
@@ -77,9 +77,9 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l mir_tstrcpy(uid, TranslateT("(Unknown contact)"));
}
- TCHAR *nick = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *nick = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0);
size_t value_max_len = (mir_tstrlen(uid) + mir_tstrlen(nick) + 4);
- TCHAR *value = (TCHAR *)mir_alloc(sizeof(TCHAR) * value_max_len);
+ wchar_t *value = (wchar_t *)mir_alloc(sizeof(wchar_t) * value_max_len);
mir_sntprintf(value, value_max_len, L"%s (%s)", nick, uid);
SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_SETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_ADDSTRING, 0, (LPARAM)value), hContact);
mir_free(value);
@@ -115,12 +115,12 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case IDC_OPT_BUTTON_CHOOSE_SOUND:
{
- TCHAR FileName[MAX_PATH];
- TCHAR *tszMirDir = Utils_ReplaceVarsT(L"%miranda_path%");
+ wchar_t FileName[MAX_PATH];
+ wchar_t *tszMirDir = Utils_ReplaceVarsT(L"%miranda_path%");
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
- TCHAR tmp[MAX_PATH];
+ wchar_t tmp[MAX_PATH];
if (GetModuleHandle(L"bass_interface.dll"))
mir_sntprintf(tmp, L"%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%c", TranslateT("Sound files"), 0, 0, 0);
else
@@ -144,7 +144,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l XSN_Users.insert(new XSN_Data(hContact, FileName, IsDlgButtonChecked(hwndDlg, IDC_OPT_IGNORE_SOUND) ? 1 : 0));
else
{
- _tcsncpy(p->path, FileName, _countof(p->path));
+ wcsncpy(p->path, FileName, _countof(p->path));
p->ignore = IsDlgButtonChecked(hwndDlg, IDC_OPT_IGNORE_SOUND) ? 1 : 0;
}
EnableWindow(GetDlgItem(hwndDlg, IDC_OPT_BUTTON_TEST_PLAY), TRUE);
@@ -164,14 +164,14 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l if (p == NULL) {
DBVARIANT dbv;
if (!db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
- TCHAR longpath[MAX_PATH];
+ wchar_t longpath[MAX_PATH];
PathToAbsoluteT(dbv.ptszVal, longpath);
SkinPlaySoundFile(longpath);
db_free(&dbv);
}
}
else {
- TCHAR longpath[MAX_PATH] = { 0 };
+ wchar_t longpath[MAX_PATH] = { 0 };
PathToAbsoluteT(p->path, longpath);
SkinPlaySoundFile(longpath);
}
@@ -205,7 +205,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l if (p == NULL) {
DBVARIANT dbv;
if (!db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
- TCHAR longpath[MAX_PATH];
+ wchar_t longpath[MAX_PATH];
PathToAbsoluteT(dbv.ptszVal, longpath);
XSN_Users.insert(new XSN_Data(hContact, longpath, IsDlgButtonChecked(hwndDlg, IDC_OPT_IGNORE_SOUND) ? 1 : 0));
db_free(&dbv);
@@ -225,7 +225,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case PSN_APPLY:
for (int i = 0; i < XSN_Users.getCount(); i++) {
if (mir_tstrcmpi(XSN_Users[i]->path, L"")) {
- TCHAR shortpath[MAX_PATH];
+ wchar_t shortpath[MAX_PATH];
PathToRelativeT(XSN_Users[i]->path, shortpath);
db_set_ts(XSN_Users[i]->hContact, SETTINGSNAME, SETTINGSKEY, shortpath);
}
@@ -244,8 +244,8 @@ INT OptInit(WPARAM wParam, LPARAM) odp.hInstance = hInst;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.ptszGroup = LPGENT("Sounds");
- odp.ptszTitle = LPGENT("XSound Notify");
+ odp.pwszGroup = LPGENW("Sounds");
+ odp.pwszTitle = LPGENW("XSound Notify");
odp.pfnDlgProc = OptsProc;
Options_AddPage(wParam, &odp);
return 0;
diff --git a/plugins/XSoundNotify/src/stdafx.h b/plugins/XSoundNotify/src/stdafx.h index 6bee45d772..ae497266c6 100644 --- a/plugins/XSoundNotify/src/stdafx.h +++ b/plugins/XSoundNotify/src/stdafx.h @@ -23,13 +23,13 @@ struct XSN_Data
{
MCONTACT hContact;
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
BYTE ignore;
- __forceinline XSN_Data(MCONTACT _aContact, TCHAR *_path, BYTE _ignore) :
+ __forceinline XSN_Data(MCONTACT _aContact, wchar_t *_path, BYTE _ignore) :
hContact(_aContact)
{
- _tcsncpy(path, _path, _countof(path));
+ wcsncpy(path, _path, _countof(path));
ignore = _ignore;
}
};
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index d8ffcb9d97..afb720d85b 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -76,7 +76,7 @@ void InitSelfSounds() char namebuf[128];
mir_snprintf(namebuf, "%s%s", protos[i]->szModuleName, selfSounds[j].szName);
- TCHAR infobuf[256];
+ wchar_t infobuf[256];
mir_sntprintf(infobuf, L"%s [%s]", TranslateT("Self status"), protos[i]->tszAccountName);
SkinAddNewSoundExT(namebuf, infobuf, pcli->pfnGetStatusModeDescription(selfSounds[j].iStatus, 0));
}
@@ -118,7 +118,7 @@ static int ProcessEvent(WPARAM hContact, LPARAM lParam) isIgnoreSound = db_get_b(hContact, SETTINGSNAME, SETTINGSIGNOREKEY, 0);
DBVARIANT dbv;
if (!isIgnoreSound && !db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
- TCHAR PlaySoundPath[MAX_PATH] = { 0 };
+ wchar_t PlaySoundPath[MAX_PATH] = { 0 };
PathToAbsoluteT(dbv.ptszVal, PlaySoundPath);
isOwnSound = 0;
SkinPlaySoundFile(PlaySoundPath);
@@ -144,11 +144,11 @@ static int ProcessChatEvent(WPARAM, LPARAM lParam) ptrT nick(db_get_tsa(hContact, gcd->pszModule, "MyNick"));
if (nick == NULL || gce->ptszText == NULL)
return 0;
- if (_tcsstr(gce->ptszText, nick)) {
+ if (wcsstr(gce->ptszText, nick)) {
isIgnoreSound = db_get_b(hContact, SETTINGSNAME, SETTINGSIGNOREKEY, 0);
DBVARIANT dbv;
if (!isIgnoreSound && !db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
- TCHAR PlaySoundPath[MAX_PATH] = { 0 };
+ wchar_t PlaySoundPath[MAX_PATH] = { 0 };
PathToAbsoluteT(dbv.ptszVal, PlaySoundPath);
isOwnSound = 0;
SkinPlaySoundFile(PlaySoundPath);
@@ -182,7 +182,7 @@ static int OnLoadInit(WPARAM, LPARAM) mi.position = -0x7FFFFFFF;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
- mi.name.t = LPGENT("Custom contact sound");
+ mi.name.w = LPGENW("Custom contact sound");
mi.pszService = "XSoundNotify/ContactMenuCommand";
hChangeSound = Menu_AddContactMenuItem(&mi);
|