diff options
author | George Hazan <george.hazan@gmail.com> | 2016-07-27 14:23:31 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-07-27 14:23:31 +0000 |
commit | 2f261839b60692e33d0e160344d0d636d49c90ba (patch) | |
tree | 187921722698b681d29df3f6e60fb18394a5e9d5 /plugins/SplashScreen/src | |
parent | 2e931a0b2780587d85f3902468c935f5adba70c8 (diff) |
less TCHARs
git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SplashScreen/src')
-rw-r--r-- | plugins/SplashScreen/src/bitmap_funcs.cpp | 2 | ||||
-rw-r--r-- | plugins/SplashScreen/src/debug.h | 8 | ||||
-rw-r--r-- | plugins/SplashScreen/src/main.cpp | 44 | ||||
-rw-r--r-- | plugins/SplashScreen/src/options.cpp | 36 | ||||
-rw-r--r-- | plugins/SplashScreen/src/services.cpp | 8 | ||||
-rw-r--r-- | plugins/SplashScreen/src/splash.cpp | 14 |
6 files changed, 56 insertions, 56 deletions
diff --git a/plugins/SplashScreen/src/bitmap_funcs.cpp b/plugins/SplashScreen/src/bitmap_funcs.cpp index 9c89965cbe..c0d1531c17 100644 --- a/plugins/SplashScreen/src/bitmap_funcs.cpp +++ b/plugins/SplashScreen/src/bitmap_funcs.cpp @@ -120,7 +120,7 @@ void MyBitmap::restoreAlpha(int x, int y, int w, int h) void MyBitmap::DrawText(wchar_t *str, int x, int y)
{
- SIZE sz; GetTextExtentPoint32(this->getDC(), str, (int)mir_tstrlen(str), &sz);
+ SIZE sz; GetTextExtentPoint32(this->getDC(), str, (int)mir_wstrlen(str), &sz);
RECT rc; SetRect(&rc, x, y, x + 10000, y + 10000);
this->saveAlpha(x - 2, y - 2, sz.cx + 2, sz.cy + 2);
::DrawText(this->getDC(), str, -1, &rc, DT_LEFT | DT_TOP | DT_SINGLELINE | DT_NOPREFIX);
diff --git a/plugins/SplashScreen/src/debug.h b/plugins/SplashScreen/src/debug.h index c283bd30d9..91f45ef971 100644 --- a/plugins/SplashScreen/src/debug.h +++ b/plugins/SplashScreen/src/debug.h @@ -17,17 +17,17 @@ int inline _DebugPopup(MCONTACT hContact, wchar_t *fmt, ...) wchar_t debug[1024];
va_start(va, fmt);
- mir_sntprintf(debug, fmt, va);
+ mir_snwprintf(debug, fmt, va);
if(CallService(MS_POPUP_QUERY, PUQS_GETSTATUS, 0) == 1) {
POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact;
ppd.lchIcon = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
if(hContact != 0)
- mir_tstrncpy(ppd.lptzContactName, (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
+ mir_wstrncpy(ppd.lptzContactName, (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
else
- mir_tstrncpy(ppd.lptzContactName, _A2W(PlugName), MAX_CONTACTNAME);
- mir_tstrncpy(ppd.lptzText, debug, MAX_SECONDLINE - 20);
+ mir_wstrncpy(ppd.lptzContactName, _A2W(PlugName), MAX_CONTACTNAME);
+ mir_wstrncpy(ppd.lptzText, debug, MAX_SECONDLINE - 20);
ppd.colorText = RGB(255,255,255);
ppd.colorBack = RGB(255,0,0);
PUAddPopupT(&ppd);
diff --git a/plugins/SplashScreen/src/main.cpp b/plugins/SplashScreen/src/main.cpp index 0a88380ac3..9fa6d0263d 100644 --- a/plugins/SplashScreen/src/main.cpp +++ b/plugins/SplashScreen/src/main.cpp @@ -65,13 +65,13 @@ void SplashMain() if (bstartup) {
// Retrive path to exe of current running Miranda is located
szMirDir = Utils_ReplaceVarsT(L"%miranda_path%");
- mir_sntprintf(szhAdvaimgPath, L"%s\\plugins\\advaimg.dll", szMirDir);
+ mir_snwprintf(szhAdvaimgPath, L"%s\\plugins\\advaimg.dll", szMirDir);
CallService(MS_SYSTEM_GETVERSIONTEXT, MAX_PATH, (LPARAM)szVersion);
#ifdef _DEBUG
- mir_sntprintf(szLogFile, L"%s\\%s.log", szMirDir, _A2W(__PLUGIN_NAME));
+ mir_snwprintf(szLogFile, L"%s\\%s.log", szMirDir, _A2W(__PLUGIN_NAME));
initLog();
- wchar_t *mirandaVerString = mir_a2t(szVersion);
+ wchar_t *mirandaVerString = mir_a2u(szVersion);
logMessage(L"Miranda version", mirandaVerString);
mir_free(mirandaVerString);
logMessage(L"Dll Name", _A2W(__FILENAME));
@@ -84,45 +84,45 @@ void SplashMain() if (bstartup & (options.active == 1)) {
DBVARIANT dbv = { 0 };
if (!db_get_ts(NULL, MODNAME, "VersionPrefix", &dbv)) {
- mir_tstrcpy(szPrefix, dbv.ptszVal);
+ mir_wstrcpy(szPrefix, dbv.ptszVal);
db_free(&dbv);
}
else
- mir_tstrcpy(szPrefix, L"");
+ mir_wstrcpy(szPrefix, L"");
if (!db_get_ts(NULL, MODNAME, "Path", &dbv)) {
- mir_tstrcpy(inBuf, dbv.ptszVal);
+ mir_wstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
- else mir_tstrcpy(inBuf, L"splash\\splash.png");
+ else mir_wstrcpy(inBuf, L"splash\\splash.png");
wchar_t szExpandedSplashFile[MAX_PATH];
ExpandEnvironmentStrings(inBuf, szExpandedSplashFile, _countof(szExpandedSplashFile));
- mir_tstrcpy(inBuf, szExpandedSplashFile);
+ mir_wstrcpy(inBuf, szExpandedSplashFile);
wchar_t *pos3 = 0;
pos3 = wcsrchr(inBuf, ':');
if (pos3 == NULL)
- mir_sntprintf(szSplashFile, L"%s\\%s", szMirDir, inBuf);
+ mir_snwprintf(szSplashFile, L"%s\\%s", szMirDir, inBuf);
else
- mir_tstrcpy(szSplashFile, inBuf);
+ mir_wstrcpy(szSplashFile, inBuf);
if (!db_get_ts(NULL, MODNAME, "Sound", &dbv)) {
- mir_tstrcpy(inBuf, dbv.ptszVal);
+ mir_wstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
- else mir_tstrcpy(inBuf, L"sounds\\startup.wav");
+ else mir_wstrcpy(inBuf, L"sounds\\startup.wav");
wchar_t szExpandedSoundFile[MAX_PATH];
ExpandEnvironmentStrings(inBuf, szExpandedSoundFile, _countof(szExpandedSoundFile));
- mir_tstrcpy(inBuf, szExpandedSoundFile);
+ mir_wstrcpy(inBuf, szExpandedSoundFile);
wchar_t *pos2;
pos2 = wcschr(inBuf, ':');
if (pos2 == NULL)
- mir_sntprintf(szSoundFile, L"%s\\%s", szMirDir, inBuf);
+ mir_snwprintf(szSoundFile, L"%s\\%s", szMirDir, inBuf);
else
- mir_tstrcpy(szSoundFile, inBuf);
+ mir_wstrcpy(szSoundFile, inBuf);
#ifdef _DEBUG
logMessage(L"SoundFilePath", szSoundFile);
@@ -137,13 +137,13 @@ void SplashMain() wchar_t *p = 0;
wchar_t files[255][50]; //TODO: make memory allocation dynamic
- mir_tstrcpy(szSplashDir, szSplashFile);
- mir_tstrcpy(szOldPath, szSplashFile);
+ mir_wstrcpy(szSplashDir, szSplashFile);
+ mir_wstrcpy(szOldPath, szSplashFile);
// find the last \ and null it out, this leaves no trailing slash
p = wcsrchr(szSplashDir, '\\');
if (p) *p = 0;
// create the search filter
- mir_sntprintf(szSearch, L"%s\\*.*", szSplashDir);
+ mir_snwprintf(szSearch, L"%s\\*.*", szSplashDir);
// FFFN will return filenames
HANDLE hFind = INVALID_HANDLE_VALUE;
WIN32_FIND_DATA ffd;
@@ -157,19 +157,19 @@ void SplashMain() //files = new char[mir_strlen(ffd.cFileName)];
//files[filescount] = new char[mir_strlen(ffd.cFileName)];
wchar_t ext[5];
- wmemcpy(ext, ffd.cFileName + (mir_tstrlen(ffd.cFileName) - 4), 5);
+ wmemcpy(ext, ffd.cFileName + (mir_wstrlen(ffd.cFileName) - 4), 5);
#ifdef _DEBUG
logMessage(L"Extention", ext);
#endif
- if (mir_tstrcmpi(ext, L".png") & mir_tstrcmpi(ext, L".bmp"))
+ if (mir_wstrcmpi(ext, L".png") & mir_wstrcmpi(ext, L".bmp"))
continue;
#ifdef _DEBUG
logMessage(L"File has valid ext", ext);
#endif
- mir_tstrcpy(files[filescount++], ffd.cFileName);
+ mir_wstrcpy(files[filescount++], ffd.cFileName);
} //if
} while (FindNextFile(hFind, &ffd));
@@ -177,7 +177,7 @@ void SplashMain() int r = 0;
if (filescount) r = (rand() % filescount) + 1;
- mir_sntprintf(szSplashFile, L"%s\\%s", szSplashDir, files[r - 1]);
+ mir_snwprintf(szSplashFile, L"%s\\%s", szSplashDir, files[r - 1]);
#ifdef _DEBUG
logMessage(L"final file", szSplashFile);
diff --git a/plugins/SplashScreen/src/options.cpp b/plugins/SplashScreen/src/options.cpp index f68eac44be..dce6380576 100644 --- a/plugins/SplashScreen/src/options.cpp +++ b/plugins/SplashScreen/src/options.cpp @@ -69,27 +69,27 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP wchar_t inBuf[80];
DBVARIANT dbv = { 0 };
if (!db_get_ts(NULL, MODNAME, "Path", &dbv)) {
- mir_tstrcpy(inBuf, dbv.ptszVal);
+ mir_wstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
else
- mir_tstrcpy(inBuf, L"splash\\splash.png");
+ mir_wstrcpy(inBuf, L"splash\\splash.png");
SetDlgItemText(hwndDlg, IDC_SPLASHPATH, inBuf);
if (!db_get_ts(NULL, MODNAME, "Sound", &dbv)) {
- mir_tstrcpy(inBuf, dbv.ptszVal);
+ mir_wstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
else
- mir_tstrcpy(inBuf, L"sounds\\startup.wav");
+ mir_wstrcpy(inBuf, L"sounds\\startup.wav");
SetDlgItemText(hwndDlg, IDC_SNDPATH, inBuf);
if (!db_get_ts(NULL, MODNAME, "VersionPrefix", &dbv)) {
- mir_tstrcpy(inBuf, dbv.ptszVal);
+ mir_wstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
else
- mir_tstrcpy(inBuf, L"");
+ mir_wstrcpy(inBuf, L"");
SetDlgItemText(hwndDlg, IDC_VERSIONPREFIX, inBuf);
if (options.active)
@@ -169,19 +169,19 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP wchar_t szTempPath[MAX_PATH], initDir[MAX_PATH];
if (Exists(szSplashFile)) {
- mir_tstrcpy(initDir, szSplashFile);
+ mir_wstrcpy(initDir, szSplashFile);
wchar_t *pos = wcsrchr(initDir, '\\');
if (pos != NULL)
*pos = 0;
}
else {
szMirDir = Utils_ReplaceVarsT(L"%miranda_path%");
- mir_tstrcpy(initDir, szMirDir);
+ mir_wstrcpy(initDir, szMirDir);
mir_free(szMirDir);
}
wchar_t tmp[MAX_PATH];
- mir_sntprintf(tmp, L"%s (*.png, *.bmp)%c*.png;*.bmp%c%c", TranslateT("Graphic files"), 0, 0, 0);
+ mir_snwprintf(tmp, L"%s (*.png, *.bmp)%c*.png;*.bmp%c%c", TranslateT("Graphic files"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
@@ -195,19 +195,19 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP ofn.lpstrDefExt = L"";
if (GetOpenFileName(&ofn)) {
- mir_tstrcpy(szSplashFile, szTempPath);
+ mir_wstrcpy(szSplashFile, szTempPath);
#ifdef _DEBUG
logMessage(L"Set path", szSplashFile);
#endif
// Make path relative
int result = PathToRelativeT(szTempPath, szPath2Spash);
- if (result && mir_tstrlen(szPath2Spash) > 0) {
+ if (result && mir_wstrlen(szPath2Spash) > 0) {
if (options.random) {
wchar_t *pos = wcsrchr(szPath2Spash, '\\');
if (pos != NULL) {
*pos = 0;
- mir_tstrcat(szPath2Spash, L"\\");
+ mir_wstrcat(szPath2Spash, L"\\");
}
}
@@ -226,20 +226,20 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP wchar_t *pos;
if (Exists(szSoundFile)) {
- mir_tstrcpy(initDir, szSoundFile);
+ mir_wstrcpy(initDir, szSoundFile);
pos = wcsrchr(initDir, '\\');
if (pos != NULL) *pos = 0;
}
else {
szMirDir = Utils_ReplaceVarsT(L"%miranda_path%");
- mir_tstrcpy(initDir, szMirDir);
+ mir_wstrcpy(initDir, szMirDir);
mir_free(szMirDir);
}
OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
wchar_t tmp[MAX_PATH];
- mir_sntprintf(tmp, L"%s (*.wav, *.mp3)%c*.wav;*.mp3%c%c", TranslateT("Sound Files"), 0, 0, 0);
+ mir_snwprintf(tmp, L"%s (*.wav, *.mp3)%c*.wav;*.mp3%c%c", TranslateT("Sound Files"), 0, 0, 0);
ofn.lpstrFilter = tmp;
ofn.hwndOwner = 0;
ofn.lpstrFile = szTempPath;
@@ -251,7 +251,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP ofn.lpstrDefExt = L"";
if (GetOpenFileName(&ofn)) {
- mir_tstrcpy(szSoundFile, szTempPath);
+ mir_wstrcpy(szSoundFile, szTempPath);
#ifdef _DEBUG
logMessage(L"Set sound path", szSoundFile);
@@ -259,7 +259,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP // Make path relative
int result = PathToRelativeT(szTempPath, szSoundFilePath);
- if (result && mir_tstrlen(szSoundFile) > 0)
+ if (result && mir_wstrlen(szSoundFile) > 0)
SetDlgItemText(hwndDlg, IDC_SNDPATH, szSoundFilePath);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -295,7 +295,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP GetDlgItemText(hwndDlg, IDC_VERSIONPREFIX, tmp, _countof(tmp));
db_set_ts(NULL, MODNAME, "VersionPrefix", tmp);
- mir_tstrcpy(szPrefix, tmp);
+ mir_wstrcpy(szPrefix, tmp);
GetDlgItemText(hwndDlg, IDC_SHOWTIME, tmp, _countof(tmp));
db_set_dw(NULL, MODNAME, "TimeToShow", _wtoi(tmp));
diff --git a/plugins/SplashScreen/src/services.cpp b/plugins/SplashScreen/src/services.cpp index 7a9e35cc69..8b9f6e4caf 100644 --- a/plugins/SplashScreen/src/services.cpp +++ b/plugins/SplashScreen/src/services.cpp @@ -26,18 +26,18 @@ INT_PTR ShowSplashService(WPARAM wparam, LPARAM lparam) wchar_t *filename = (wchar_t*)wparam;
int timetoshow = (int)lparam;
- mir_tstrcpy(szOldfn, szSplashFile);
+ mir_wstrcpy(szOldfn, szSplashFile);
options.showtime = timetoshow;
wchar_t *pos = wcsrchr(filename, ':');
if (pos == NULL)
- mir_sntprintf(szSplashFile, L"%s\\%s", szMirDir, filename);
+ mir_snwprintf(szSplashFile, L"%s\\%s", szMirDir, filename);
else
- mir_tstrcpy(szSplashFile, filename);
+ mir_wstrcpy(szSplashFile, filename);
ShowSplash(false);
- mir_tstrcpy(szSplashFile, szOldfn);
+ mir_wstrcpy(szSplashFile, szOldfn);
return 0;
}
diff --git a/plugins/SplashScreen/src/splash.cpp b/plugins/SplashScreen/src/splash.cpp index c3cafffbc6..fa5f838ab2 100644 --- a/plugins/SplashScreen/src/splash.cpp +++ b/plugins/SplashScreen/src/splash.cpp @@ -42,9 +42,9 @@ LRESULT CALLBACK SplashWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM #ifdef _DEBUG
wchar_t b[40];
- mir_sntprintf(b, L"%d", wParam);
+ mir_snwprintf(b, L"%d", wParam);
logMessage(L"Timer ID", b);
- mir_sntprintf(b, L"%d", options.showtime);
+ mir_snwprintf(b, L"%d", options.showtime);
logMessage(L"ShowTime value", b);
#endif
@@ -228,16 +228,16 @@ void __cdecl SplashThread(void *arg) }
wchar_t verString[256] = { 0 };
- wchar_t *mirandaVerString = mir_a2t(szVersion);
- mir_sntprintf(verString, L"%s%s", szPrefix, mirandaVerString);
+ wchar_t *mirandaVerString = mir_a2u(szVersion);
+ mir_snwprintf(verString, L"%s%s", szPrefix, mirandaVerString);
mir_free(mirandaVerString);
LOGFONT lf = { 0 };
lf.lfHeight = 14;
- mir_tstrcpy(lf.lfFaceName, L"Verdana");
+ mir_wstrcpy(lf.lfFaceName, L"Verdana");
SelectObject(SplashBmp->getDC(), CreateFontIndirect(&lf));
if (!splashWithMarkers) {
SIZE v_sz = { 0, 0 };
- GetTextExtentPoint32(SplashBmp->getDC(), verString, (int)mir_tstrlen(verString), &v_sz);
+ GetTextExtentPoint32(SplashBmp->getDC(), verString, (int)mir_wstrlen(verString), &v_sz);
x = SplashBmp->getWidth() / 2 - (v_sz.cx / 2);
y = SplashBmp->getHeight() - (SplashBmp->getHeight()*(100 - 90) / 100);
}
@@ -327,7 +327,7 @@ BOOL ShowSplash(BOOL bpreview) timeout = options.showtime;
#ifdef _DEBUG
wchar_t b[40];
- mir_sntprintf(b, L"%d", options.showtime);
+ mir_snwprintf(b, L"%d", options.showtime);
logMessage(L"Timeout", b);
#endif
}
|