summaryrefslogtreecommitdiff
path: root/plugins/AVS
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-29 12:36:34 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-29 12:36:34 +0000
commit428bf0cbd77813a43094cb5c984436deff251936 (patch)
treed7dfa8971153d53a849e45c942be97fe5b90b7ec /plugins/AVS
parent82ef17ca5286f58ae7af604fb9518e8dc496b7c3 (diff)
no more TCHARs
git-svn-id: http://svn.miranda-ng.org/main/trunk@17143 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AVS')
-rw-r--r--plugins/AVS/src/acc.cpp8
-rw-r--r--plugins/AVS/src/cache.cpp2
-rw-r--r--plugins/AVS/src/image_utils.cpp6
-rw-r--r--plugins/AVS/src/main.cpp2
-rw-r--r--plugins/AVS/src/options.cpp20
-rw-r--r--plugins/AVS/src/poll.cpp2
-rw-r--r--plugins/AVS/src/services.cpp16
-rw-r--r--plugins/AVS/src/utils.cpp28
8 files changed, 42 insertions, 42 deletions
diff --git a/plugins/AVS/src/acc.cpp b/plugins/AVS/src/acc.cpp
index 38e62a954f..1e57d38f08 100644
--- a/plugins/AVS/src/acc.cpp
+++ b/plugins/AVS/src/acc.cpp
@@ -248,11 +248,11 @@ void StartAnimatedGif(ACCData* data)
if (format != PA_FORMAT_GIF)
return;
- FREE_IMAGE_FORMAT fif = fei->FI_GetFileTypeT(ace->szFilename, 0);
+ FREE_IMAGE_FORMAT fif = fei->FI_GetFileTypeU(ace->szFilename, 0);
if (fif == FIF_UNKNOWN)
- fif = fei->FI_GetFIFFromFilenameT(ace->szFilename);
+ fif = fei->FI_GetFIFFromFilenameU(ace->szFilename);
- data->ag.multi = fei->FI_OpenMultiBitmapT(fif, ace->szFilename, FALSE, TRUE, FALSE, GIF_LOAD256);
+ data->ag.multi = fei->FI_OpenMultiBitmapU(fif, ace->szFilename, FALSE, TRUE, FALSE, GIF_LOAD256);
if (data->ag.multi == NULL)
return;
@@ -469,7 +469,7 @@ static LRESULT CALLBACK ACCWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
return TRUE;
case AVATAR_SETNOAVATARTEXT:
- mir_wstrncpy(data->noAvatarText, TranslateTS((wchar_t*)lParam), _countof(data->noAvatarText));
+ mir_wstrncpy(data->noAvatarText, TranslateW((wchar_t*)lParam), _countof(data->noAvatarText));
Invalidate(hwnd);
return TRUE;
diff --git a/plugins/AVS/src/cache.cpp b/plugins/AVS/src/cache.cpp
index 2f521cc01d..6bd8f97177 100644
--- a/plugins/AVS/src/cache.cpp
+++ b/plugins/AVS/src/cache.cpp
@@ -136,7 +136,7 @@ void NotifyMetaAware(MCONTACT hContact, CacheNode *node, AVATARCACHEENTRY *ace)
if (szProto != NULL) {
DBVARIANT dbv = { 0 };
if (!db_get_s(hContact, szProto, "AvatarHash", &dbv)) {
- if (dbv.type == DBVT_TCHAR)
+ if (dbv.type == DBVT_WCHAR)
wcsncpy_s(cacn.hash, dbv.ptszVal, _TRUNCATE);
else if (dbv.type == DBVT_ASCIIZ)
wcsncpy_s(cacn.hash, _A2T(dbv.pszVal), _TRUNCATE);
diff --git a/plugins/AVS/src/image_utils.cpp b/plugins/AVS/src/image_utils.cpp
index 70fe12713e..6219f7d8f5 100644
--- a/plugins/AVS/src/image_utils.cpp
+++ b/plugins/AVS/src/image_utils.cpp
@@ -164,7 +164,7 @@ HBITMAP BmpFilterLoadBitmap(BOOL *bIsTransparent, const wchar_t *ptszFilename)
if (fei == NULL)
return 0;
- FIBITMAP *dib = (FIBITMAP*)CallService(MS_IMG_LOAD, (WPARAM)ptszFilename, IMGL_RETURNDIB | IMGL_TCHAR);
+ FIBITMAP *dib = (FIBITMAP*)CallService(MS_IMG_LOAD, (WPARAM)ptszFilename, IMGL_RETURNDIB | IMGL_WCHAR);
if (dib == NULL)
return 0;
@@ -209,7 +209,7 @@ int BmpFilterSaveBitmap(HBITMAP hBmp, const wchar_t *ptszFile, int flags)
return -1;
wchar_t tszFilename[MAX_PATH];
- if (!PathToAbsoluteT(ptszFile, tszFilename))
+ if (!PathToAbsoluteW(ptszFile, tszFilename))
wcsncpy_s(tszFilename, ptszFile, _TRUNCATE);
if (mir_wstrlen(tszFilename) <= 4)
@@ -222,7 +222,7 @@ int BmpFilterSaveBitmap(HBITMAP hBmp, const wchar_t *ptszFile, int flags)
i.dwMask = IMGI_HBITMAP;
i.fif = FIF_UNKNOWN;
- return !CallService(MS_IMG_SAVE, (WPARAM)&i, MAKELONG(IMGL_TCHAR, flags));
+ return !CallService(MS_IMG_SAVE, (WPARAM)&i, MAKELONG(IMGL_WCHAR, flags));
}
// Other utilities ////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp
index a52cd78b6a..1fe80d8d71 100644
--- a/plugins/AVS/src/main.cpp
+++ b/plugins/AVS/src/main.cpp
@@ -381,7 +381,7 @@ static int LoadAvatarModule()
InitServices();
InitPolls();
- wcsncpy_s(g_szDataPath, _countof(g_szDataPath), VARST(L"%miranda_userdata%\\"), _TRUNCATE);
+ wcsncpy_s(g_szDataPath, _countof(g_szDataPath), VARSW(L"%miranda_userdata%\\"), _TRUNCATE);
wcslwr(g_szDataPath);
return 0;
}
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp
index cead97c735..11f36dfb1e 100644
--- a/plugins/AVS/src/options.cpp
+++ b/plugins/AVS/src/options.cpp
@@ -121,7 +121,7 @@ static void SetProtoPic(char *szProto)
wchar_t szNewPath[MAX_PATH];
PathToRelativeT(FileName, szNewPath, g_szDataPath);
- db_set_ts(NULL, PPICT_MODULE, szProto, szNewPath);
+ db_set_ws(NULL, PPICT_MODULE, szProto, szNewPath);
if (!mir_strcmp(AVS_DEFAULT, szProto)) {
for (int i = 0; i < g_ProtoPictures.getCount(); i++) {
@@ -385,8 +385,8 @@ static INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wPar
g_selectedProto = GetProtoFromList(hwndDlg, iItem);
if (g_selectedProto) {
DBVARIANT dbv;
- if (!db_get_ts(NULL, PPICT_MODULE, g_selectedProto, &dbv)) {
- if (!PathIsAbsoluteT(VARST(dbv.ptszVal))) {
+ if (!db_get_ws(NULL, PPICT_MODULE, g_selectedProto, &dbv)) {
+ if (!PathIsAbsoluteW(VARSW(dbv.ptszVal))) {
wchar_t szFinalPath[MAX_PATH];
mir_snwprintf(szFinalPath, L"%%miranda_path%%\\%s", dbv.ptszVal);
SetDlgItemText(hwndDlg, IDC_PROTOAVATARNAME, szFinalPath);
@@ -576,7 +576,7 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
ProtectAvatar(hContact, 0);
if (MessageBox(0, TranslateT("Delete picture file from disk (may be necessary to force a reload, but will delete local pictures)?"), TranslateT("Reset contact picture"), MB_YESNO) == IDYES) {
DBVARIANT dbv = { 0 };
- if (!db_get_ts(hContact, "ContactPhoto", "File", &dbv)) {
+ if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) {
DeleteFile(dbv.ptszVal);
db_free(&dbv);
}
@@ -601,7 +601,7 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
if (MessageBox(0, TranslateT("Delete picture file from disk (may be necessary to force a reload, but will delete local pictures)?"), TranslateT("Reset contact picture"), MB_YESNO) == IDYES) {
DBVARIANT dbv = { 0 };
ProtectAvatar(hContact, 0);
- if (!db_get_ts(hContact, "ContactPhoto", "File", &dbv)) {
+ if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) {
DeleteFile(dbv.ptszVal);
db_free(&dbv);
}
@@ -666,15 +666,15 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
szFinalName[0] = 0;
- if (is_locked && !db_get_ts(hContact, "ContactPhoto", "Backup", &dbv)) {
+ if (is_locked && !db_get_ws(hContact, "ContactPhoto", "Backup", &dbv)) {
MyPathToAbsolute(dbv.ptszVal, szFinalName);
db_free(&dbv);
}
- else if (!db_get_ts(hContact, "ContactPhoto", "RFile", &dbv)) {
+ else if (!db_get_ws(hContact, "ContactPhoto", "RFile", &dbv)) {
MyPathToAbsolute(dbv.ptszVal, szFinalName);
db_free(&dbv);
}
- else if (!db_get_ts(hContact, "ContactPhoto", "File", &dbv)) {
+ else if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) {
MyPathToAbsolute(dbv.ptszVal, szFinalName);
db_free(&dbv);
}
@@ -822,7 +822,7 @@ static INT_PTR CALLBACK DlgProcAvatarUserInfo(HWND hwndDlg, UINT msg, WPARAM wPa
ProtectAvatar(hContact, 0);
if (MessageBox(0, TranslateT("Delete picture file from disk (may be necessary to force a reload, but will delete local pictures)?"), TranslateT("Reset contact picture"), MB_YESNO) == IDYES) {
DBVARIANT dbv = { 0 };
- if (!db_get_ts(hContact, "ContactPhoto", "File", &dbv)) {
+ if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) {
DeleteFile(dbv.ptszVal);
db_free(&dbv);
}
@@ -846,7 +846,7 @@ static INT_PTR CALLBACK DlgProcAvatarUserInfo(HWND hwndDlg, UINT msg, WPARAM wPa
ProtectAvatar(hContact, 0);
if (MessageBox(0, TranslateT("Delete picture file from disk (may be necessary to force a reload, but will delete local pictures)?"), TranslateT("Reset contact picture"), MB_YESNO) == IDYES) {
DBVARIANT dbv = { 0 };
- if (!db_get_ts(hContact, "ContactPhoto", "File", &dbv)) {
+ if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) {
DeleteFile(dbv.ptszVal);
db_free(&dbv);
}
diff --git a/plugins/AVS/src/poll.cpp b/plugins/AVS/src/poll.cpp
index 226bb12278..1b02acda79 100644
--- a/plugins/AVS/src/poll.cpp
+++ b/plugins/AVS/src/poll.cpp
@@ -143,7 +143,7 @@ void ProcessAvatarInfo(MCONTACT hContact, int type, PROTO_AVATAR_INFORMATION *pa
db_unset(hContact, "ContactPhoto", "RFile");
if (!db_get_b(hContact, "ContactPhoto", "Locked", 0))
db_unset(hContact, "ContactPhoto", "Backup");
- db_set_ts(hContact, "ContactPhoto", "File", pai->filename);
+ db_set_ws(hContact, "ContactPhoto", "File", pai->filename);
db_set_w(hContact, "ContactPhoto", "Format", pai->format);
if (pai->format == PA_FORMAT_PNG || pai->format == PA_FORMAT_JPEG
diff --git a/plugins/AVS/src/services.cpp b/plugins/AVS/src/services.cpp
index 817c15630e..cb27c8d98e 100644
--- a/plugins/AVS/src/services.cpp
+++ b/plugins/AVS/src/services.cpp
@@ -161,10 +161,10 @@ static INT_PTR avSetAvatar(MCONTACT hContact, wchar_t *tszPath)
// file exists...
wchar_t szBackupName[MAX_PATH];
PathToRelativeT(szFinalName, szBackupName, g_szDataPath);
- db_set_ts(hContact, "ContactPhoto", "Backup", szBackupName);
+ db_set_ws(hContact, "ContactPhoto", "Backup", szBackupName);
db_set_b(hContact, "ContactPhoto", "Locked", is_locked);
- db_set_ts(hContact, "ContactPhoto", "File", szFinalName);
+ db_set_ws(hContact, "ContactPhoto", "File", szFinalName);
MakePathRelative(hContact, szFinalName);
// Fix cache
@@ -214,7 +214,7 @@ static int InternalRemoveMyAvatar(char *protocol)
if (ret == 0) {
// Has global avatar?
DBVARIANT dbv = { 0 };
- if (!db_get_ts(NULL, AVS_MODULE, "GlobalUserAvatarFile", &dbv)) {
+ if (!db_get_ws(NULL, AVS_MODULE, "GlobalUserAvatarFile", &dbv)) {
db_free(&dbv);
db_set_b(NULL, AVS_MODULE, "GlobalUserAvatarNotConsistent", 1);
DeleteGlobalUserAvatar();
@@ -253,7 +253,7 @@ static int InternalRemoveMyAvatar(char *protocol)
return ret;
}
-static void FilterGetStrings(CMString &filter, BOOL xml, BOOL swf)
+static void FilterGetStrings(CMStringW &filter, BOOL xml, BOOL swf)
{
filter.AppendFormat(L"%s (*.bmp;*.jpg;*.gif;*.png", TranslateT("All files"));
if (swf) filter.Append(L";*.swf");
@@ -510,7 +510,7 @@ static int InternalSetMyAvatar(char *protocol, wchar_t *szFinalName, SetMyAvatar
}
else {
// Try to open if is not a flash or XML
- hBmp = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)szFinalName, IMGL_TCHAR);
+ hBmp = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)szFinalName, IMGL_WCHAR);
if (hBmp == NULL)
return -4;
}
@@ -590,9 +590,9 @@ static int InternalSetMyAvatar(char *protocol, wchar_t *szFinalName, SetMyAvatar
if (saved) {
wchar_t relFile[1024];
if (PathToRelativeT(globalFile, relFile, g_szDataPath))
- db_set_ts(NULL, AVS_MODULE, "GlobalUserAvatarFile", relFile);
+ db_set_ws(NULL, AVS_MODULE, "GlobalUserAvatarFile", relFile);
else
- db_set_ts(NULL, AVS_MODULE, "GlobalUserAvatarFile", globalFile);
+ db_set_ws(NULL, AVS_MODULE, "GlobalUserAvatarFile", globalFile);
db_set_b(NULL, AVS_MODULE, "GlobalUserAvatarNotConsistent", 0);
}
@@ -661,7 +661,7 @@ INT_PTR avSetMyAvatar(char* protocol, wchar_t* tszPath)
if (tszPath == NULL) {
data.protocol = protocol;
- CMString filter;
+ CMStringW filter;
FilterGetStrings(filter, allAcceptXML, allAcceptSWF);
wchar_t inipath[1024];
diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp
index 4cfc38d67f..7fcbd8435f 100644
--- a/plugins/AVS/src/utils.cpp
+++ b/plugins/AVS/src/utils.cpp
@@ -30,7 +30,7 @@ void mir_sleep(int time)
void MyPathToAbsolute(const wchar_t *ptszPath, wchar_t *ptszDest)
{
- PathToAbsoluteT(VARST(ptszPath), ptszDest, g_szDataPath);
+ PathToAbsoluteW(VARSW(ptszPath), ptszDest, g_szDataPath);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -44,9 +44,9 @@ void MakePathRelative(MCONTACT hContact, wchar_t *path)
size_t result = PathToRelativeT(path, szFinalPath, g_szDataPath);
if (result && szFinalPath[0] != '\0') {
- db_set_ts(hContact, "ContactPhoto", "RFile", szFinalPath);
+ db_set_ws(hContact, "ContactPhoto", "RFile", szFinalPath);
if (!db_get_b(hContact, "ContactPhoto", "Locked", 0))
- db_set_ts(hContact, "ContactPhoto", "Backup", szFinalPath);
+ db_set_ws(hContact, "ContactPhoto", "Backup", szFinalPath);
}
}
@@ -56,7 +56,7 @@ void MakePathRelative(MCONTACT hContact, wchar_t *path)
void MakePathRelative(MCONTACT hContact)
{
- ptrW tszPath(db_get_tsa(hContact, "ContactPhoto", "File"));
+ ptrW tszPath(db_get_wsa(hContact, "ContactPhoto", "File"));
if (tszPath)
MakePathRelative(hContact, tszPath);
}
@@ -82,20 +82,20 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto)
if (proto == NULL || !db_get_b(NULL, AVS_MODULE, proto, 1))
return -1;
- if (db_get_b(hContact, "ContactPhoto", "Locked", 0) && (tszValue = db_get_tsa(hContact, "ContactPhoto", "Backup")))
+ if (db_get_b(hContact, "ContactPhoto", "Locked", 0) && (tszValue = db_get_wsa(hContact, "ContactPhoto", "Backup")))
MyPathToAbsolute(tszValue, tszFilename);
- else if (tszValue = db_get_tsa(hContact, "ContactPhoto", "RFile"))
+ else if (tszValue = db_get_wsa(hContact, "ContactPhoto", "RFile"))
MyPathToAbsolute(tszValue, tszFilename);
- else if (tszValue = db_get_tsa(hContact, "ContactPhoto", "File"))
+ else if (tszValue = db_get_wsa(hContact, "ContactPhoto", "File"))
MyPathToAbsolute(tszValue, tszFilename);
else return -2;
}
else {
if (hContact == 0) { // create a protocol picture in the proto picture cache
- if (tszValue = db_get_tsa(NULL, PPICT_MODULE, szProto))
+ if (tszValue = db_get_wsa(NULL, PPICT_MODULE, szProto))
MyPathToAbsolute(tszValue, tszFilename);
else if (mir_strcmp(szProto, AVS_DEFAULT)) {
- if (tszValue = db_get_tsa(NULL, PPICT_MODULE, AVS_DEFAULT))
+ if (tszValue = db_get_wsa(NULL, PPICT_MODULE, AVS_DEFAULT))
MyPathToAbsolute(tszValue, tszFilename);
if (!strstr(szProto, "Global avatar for")) {
@@ -104,7 +104,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto)
return -1;
char key[MAX_PATH];
mir_snprintf(key, "Global avatar for %s accounts", pdescr->szProtoName);
- if (tszValue = db_get_tsa(NULL, PPICT_MODULE, key))
+ if (tszValue = db_get_wsa(NULL, PPICT_MODULE, key))
MyPathToAbsolute(tszValue, tszFilename);
}
}
@@ -114,7 +114,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto)
// startup and everytime they are changed.
if (szProto[0] == '\0') {
// Global avatar
- if (tszValue = db_get_tsa(NULL, AVS_MODULE, "GlobalUserAvatarFile"))
+ if (tszValue = db_get_wsa(NULL, AVS_MODULE, "GlobalUserAvatarFile"))
MyPathToAbsolute(tszValue, tszFilename);
else
return -10;
@@ -130,7 +130,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto)
else
MultiByteToWideChar(CP_ACP, 0, szFileName, -1, tszFilename, _countof(tszFilename));
}
- else if (tszValue = db_get_tsa(NULL, szProto, "AvatarFile"))
+ else if (tszValue = db_get_wsa(NULL, szProto, "AvatarFile"))
MyPathToAbsolute(tszValue, tszFilename);
else return -1;
}
@@ -139,7 +139,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto)
if (mir_wstrlen(tszFilename) < 4)
return -1;
- wcsncpy_s(tszFilename, VARST(tszFilename), _TRUNCATE);
+ wcsncpy_s(tszFilename, VARSW(tszFilename), _TRUNCATE);
if (_waccess(tszFilename, 4) == -1)
return -2;
@@ -432,7 +432,7 @@ int ChangeAvatar(MCONTACT hContact, bool fLoad, bool fNotifyHist, int pa_format)
void DeleteGlobalUserAvatar()
{
DBVARIANT dbv = { 0 };
- if (db_get_ts(NULL, AVS_MODULE, "GlobalUserAvatarFile", &dbv))
+ if (db_get_ws(NULL, AVS_MODULE, "GlobalUserAvatarFile", &dbv))
return;
wchar_t szFilename[MAX_PATH];