summaryrefslogtreecommitdiff
path: root/plugins/TipperYM/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-26 09:20:25 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-26 09:20:25 +0000
commit6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac (patch)
tree2e8bb660c908b54914abd562af8aafa4a486c846 /plugins/TipperYM/src
parenta61c8728b379057fe7f0a0d86fe0b037598229dd (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/TipperYM/src')
-rw-r--r--plugins/TipperYM/src/bitmap_func.cpp2
-rw-r--r--plugins/TipperYM/src/message_pump.cpp8
-rw-r--r--plugins/TipperYM/src/mir_smileys.cpp20
-rw-r--r--plugins/TipperYM/src/mir_smileys.h6
-rw-r--r--plugins/TipperYM/src/options.cpp70
-rw-r--r--plugins/TipperYM/src/options.h60
-rw-r--r--plugins/TipperYM/src/popwin.cpp94
-rw-r--r--plugins/TipperYM/src/popwin.h8
-rw-r--r--plugins/TipperYM/src/preset_items.cpp70
-rw-r--r--plugins/TipperYM/src/preset_items.h8
-rw-r--r--plugins/TipperYM/src/skin_parser.cpp136
-rw-r--r--plugins/TipperYM/src/skin_parser.h2
-rw-r--r--plugins/TipperYM/src/stdafx.h8
-rw-r--r--plugins/TipperYM/src/str_utils.cpp28
-rw-r--r--plugins/TipperYM/src/str_utils.h26
-rw-r--r--plugins/TipperYM/src/subst.cpp134
-rw-r--r--plugins/TipperYM/src/subst.h22
-rw-r--r--plugins/TipperYM/src/tipper.cpp62
-rw-r--r--plugins/TipperYM/src/translations.cpp112
-rw-r--r--plugins/TipperYM/src/translations.h6
20 files changed, 443 insertions, 439 deletions
diff --git a/plugins/TipperYM/src/bitmap_func.cpp b/plugins/TipperYM/src/bitmap_func.cpp
index cdd1a71bb0..fe9ecfce84 100644
--- a/plugins/TipperYM/src/bitmap_func.cpp
+++ b/plugins/TipperYM/src/bitmap_func.cpp
@@ -150,7 +150,7 @@ void CreateFromBitmaps(bool bServiceTip)
if (i == SKIN_ITEM_SIDEBAR && (!opt.iSidebarWidth || bServiceTip))
continue;
- TCHAR* tszFileName = opt.szImgFile[i];
+ wchar_t* tszFileName = opt.szImgFile[i];
if (tszFileName && *tszFileName != 0) {
FIBITMAP *fib = NULL;
if (!skin.bCached) {
diff --git a/plugins/TipperYM/src/message_pump.cpp b/plugins/TipperYM/src/message_pump.cpp
index 4f07b1395d..d19096e067 100644
--- a/plugins/TipperYM/src/message_pump.cpp
+++ b/plugins/TipperYM/src/message_pump.cpp
@@ -20,6 +20,8 @@ Boston, MA 02111-1307, USA.
#include "stdafx.h"
+#include <tchar.h>
+
HMODULE hDwmapiDll = 0;
HRESULT (WINAPI *MyDwmEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHIND *pBlurBehind) = 0;
@@ -150,7 +152,7 @@ unsigned int CALLBACK MessagePumpThread(void*)
case MUM_GOTSTATUS:
{
MCONTACT hContact = (MCONTACT)hwndMsg.wParam;
- TCHAR *swzMsg = (TCHAR *)hwndMsg.lParam;
+ wchar_t *swzMsg = (wchar_t *)hwndMsg.lParam;
if (opt.bWaitForContent && !bStatusMsgReady && clcitex && clcitex->hItem == (HANDLE)hContact) {
if (WaitForContentTimerID) {
@@ -282,7 +284,7 @@ INT_PTR ShowTipW(WPARAM wParam, LPARAM lParam)
if (wParam) // wParam is char pointer containing text - e.g. status bar tooltip
{
- clcit2->swzText = mir_tstrdup((TCHAR *)wParam);
+ clcit2->swzText = mir_tstrdup((wchar_t *)wParam);
GetCursorPos(&clcit2->ptCursor);
}
@@ -313,7 +315,7 @@ int ProtoAck(WPARAM, LPARAM lParam)
return 0;
if (ack->type == ACKTYPE_AWAYMSG) {
- TCHAR *tszMsg = (TCHAR*)ack->lParam;
+ wchar_t *tszMsg = (wchar_t*)ack->lParam;
if (mir_tstrlen(tszMsg))
PostMPMessage(MUM_GOTSTATUS, (WPARAM)ack->hContact, (LPARAM)mir_tstrdup(tszMsg));
}
diff --git a/plugins/TipperYM/src/mir_smileys.cpp b/plugins/TipperYM/src/mir_smileys.cpp
index 3e2df38660..5e8c62b8c9 100644
--- a/plugins/TipperYM/src/mir_smileys.cpp
+++ b/plugins/TipperYM/src/mir_smileys.cpp
@@ -20,6 +20,8 @@ Boston, MA 02111-1307, USA.
#include "stdafx.h"
+#include <tchar.h>
+
int InitTipperSmileys()
{
// Register smiley category
@@ -104,13 +106,13 @@ int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT
return text_size.cy;
}
-SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SMILEYPARSEINFO info, UINT uTextFormat, int max_width)
+SIZE GetTextSize(HDC hdcMem, const wchar_t *szText, SMILEYPARSEINFO info, UINT uTextFormat, int max_width)
{
SIZE text_size = { 0 };
int text_height;
int row_count = 0, pos_x = 0;
- if (szText == NULL || _tcsclen(szText) == 0) {
+ if (szText == NULL || wcslen(szText) == 0) {
text_size.cy = 0;
text_size.cx = 0;
}
@@ -177,7 +179,7 @@ SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SMILEYPARSEINFO info, UINT uTe
return text_size;
}
-void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SMILEYPARSEINFO info, UINT uTextFormat)
+void DrawTextSmiley(HDC hdcMem, RECT free_rc, const wchar_t *szText, int len, SMILEYPARSEINFO info, UINT uTextFormat)
{
if (szText == NULL)
return;
@@ -304,7 +306,7 @@ void DestroySmileyList(SortedList* p_list)
}
// Generate the list of smileys / text to be drawn
-SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protocol, int *max_smiley_height)
+SortedList *ReplaceSmileys(const wchar_t *text, int text_size, const char *protocol, int *max_smiley_height)
{
*max_smiley_height = 0;
@@ -322,7 +324,7 @@ SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protoco
// Parse it!
SMADD_BATCHPARSE2 sp = { 0 };
sp.cbSize = sizeof(sp);
- sp.str = (TCHAR *)text;
+ sp.str = (wchar_t *)text;
sp.flag = SAFL_TCHAR;
sp.Protocolname = (opt.iSmileyAddFlags & SMILEYADD_USEPROTO) ? smileyProto : "tipper";
SMADD_BATCHPARSERES *spres = (SMADD_BATCHPARSERES *)CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)&sp);
@@ -333,11 +335,11 @@ SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protoco
// Lets add smileys
SortedList *plText = List_Create(0, 10);
- TCHAR *word_start, *word_end;
- TCHAR *smiley_start, *smiley_end;
- TCHAR *last_text_pos = _tcsninc(text, text_size);
+ wchar_t *word_start, *word_end;
+ wchar_t *smiley_start, *smiley_end;
+ wchar_t *last_text_pos = _tcsninc(text, text_size);
- word_start = word_end = (TCHAR *)text;
+ word_start = word_end = (wchar_t *)text;
for (unsigned i = 0; i < sp.numSmileys; i++) {
// Get smile position
diff --git a/plugins/TipperYM/src/mir_smileys.h b/plugins/TipperYM/src/mir_smileys.h
index 0e95710240..eead1110b3 100644
--- a/plugins/TipperYM/src/mir_smileys.h
+++ b/plugins/TipperYM/src/mir_smileys.h
@@ -59,9 +59,9 @@ int InitTipperSmileys();
SMILEYPARSEINFO Smileys_PreParse(LPCTSTR lpString, int nCount, const char *protocol);
void Smileys_FreeParse(SMILEYPARSEINFO parseInfo);
-SortedList* ReplaceSmileys(const TCHAR *text, int text_size, const char *protocol, int *max_smiley_height);
-SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SMILEYPARSEINFO info, UINT uTextFormat, int max_width);
-void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SMILEYPARSEINFO info, UINT uTextFormat);
+SortedList* ReplaceSmileys(const wchar_t *text, int text_size, const char *protocol, int *max_smiley_height);
+SIZE GetTextSize(HDC hdcMem, const wchar_t *szText, SMILEYPARSEINFO info, UINT uTextFormat, int max_width);
+void DrawTextSmiley(HDC hdcMem, RECT free_rc, const wchar_t *szText, int len, SMILEYPARSEINFO info, UINT uTextFormat);
void DestroySmileyList(SortedList* p_list);
int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat, SMILEYPARSEINFO parseInfo);
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp
index 63ca767e1e..d083f1bc98 100644
--- a/plugins/TipperYM/src/options.cpp
+++ b/plugins/TipperYM/src/options.cpp
@@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA.
OPTIONS opt;
ICONSTATE exIcons[EXICONS_COUNT];
-extern int IsTrayProto(const TCHAR *swzProto, BOOL bExtendedTip)
+extern int IsTrayProto(const wchar_t *swzProto, BOOL bExtendedTip)
{
if (swzProto == NULL)
return 0;
@@ -37,7 +37,7 @@ extern int IsTrayProto(const TCHAR *swzProto, BOOL bExtendedTip)
DBVARIANT dbv;
int result = 1;
if (!db_get_ts(NULL, MODULE, szSetting, &dbv)) {
- result = _tcsstr(dbv.ptszVal, swzProto) ? 1 : 0;
+ result = wcsstr(dbv.ptszVal, swzProto) ? 1 : 0;
db_free(&dbv);
}
@@ -49,8 +49,8 @@ void CreateDefaultItems()
for (int i = 0; defaultItemList[i].szName; i++) {
if (defaultItemList[i].szName[0] == '-') {
DIListNode *di_node = (DIListNode *)mir_alloc(sizeof(DIListNode));
- _tcsncpy(di_node->di.swzLabel, L"", LABEL_LEN);
- _tcsncpy(di_node->di.swzValue, L"", VALUE_LEN);
+ wcsncpy(di_node->di.swzLabel, L"", LABEL_LEN);
+ wcsncpy(di_node->di.swzValue, L"", VALUE_LEN);
di_node->di.bLineAbove = true;
di_node->di.bIsVisible = true;
di_node->di.bParseTipperVarsFirst = false;
@@ -67,7 +67,7 @@ void CreateDefaultItems()
if (subst == NULL) continue;
DSListNode *ds_node = (DSListNode *)mir_alloc(sizeof(DSListNode));
- _tcsncpy(ds_node->ds.swzName, subst->swzName, LABEL_LEN);
+ wcsncpy(ds_node->ds.swzName, subst->swzName, LABEL_LEN);
ds_node->ds.type = subst->type;
strncpy(ds_node->ds.szSettingName, subst->szSettingName, SETTING_NAME_LEN);
ds_node->ds.iTranslateFuncId = subst->iTranslateFuncId;
@@ -77,8 +77,8 @@ void CreateDefaultItems()
}
DIListNode *di_node = (DIListNode *)mir_alloc(sizeof(DIListNode));
- _tcsncpy(di_node->di.swzLabel, TranslateTS(item->swzLabel), LABEL_LEN);
- _tcsncpy(di_node->di.swzValue, item->swzValue, VALUE_LEN);
+ wcsncpy(di_node->di.swzLabel, TranslateTS(item->swzLabel), LABEL_LEN);
+ wcsncpy(di_node->di.swzValue, item->swzValue, VALUE_LEN);
di_node->di.bLineAbove = false;
di_node->di.bValueNewline = defaultItemList[i].bValueNewline;
di_node->di.bIsVisible = true;
@@ -100,7 +100,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index)
if (db_get_ts(0, MODULE_ITEMS, setting, &dbv))
return false;
- _tcsncpy(ds->swzName, dbv.ptszVal, _countof(ds->swzName));
+ wcsncpy(ds->swzName, dbv.ptszVal, _countof(ds->swzName));
ds->swzName[_countof(ds->swzName) - 1] = 0;
db_free(&dbv);
@@ -161,14 +161,14 @@ bool LoadDI(DISPLAYITEM *di, int index)
if (db_get_ts(0, MODULE_ITEMS, setting, &dbv))
return false;
- _tcsncpy(di->swzLabel, dbv.ptszVal, _countof(di->swzLabel));
+ wcsncpy(di->swzLabel, dbv.ptszVal, _countof(di->swzLabel));
di->swzLabel[_countof(di->swzLabel) - 1] = 0;
db_free(&dbv);
mir_snprintf(setting, "DIValue%d", index);
di->swzValue[0] = 0;
if (!db_get_ts(0, MODULE_ITEMS, setting, &dbv)) {
- _tcsncpy(di->swzValue, dbv.ptszVal, _countof(di->swzValue));
+ wcsncpy(di->swzValue, dbv.ptszVal, _countof(di->swzValue));
di->swzValue[_countof(di->swzValue) - 1] = 0;
db_free(&dbv);
}
@@ -275,7 +275,7 @@ void SaveItems()
opt.bWaitForStatusMsg = false;
while (di_node) {
SaveDI(&di_node->di, index);
- if (di_node->di.bIsVisible && _tcsstr(di_node->di.swzValue, L"sys:status_msg"))
+ if (di_node->di.bIsVisible && wcsstr(di_node->di.swzValue, L"sys:status_msg"))
opt.bWaitForStatusMsg = true;
di_node = di_node->next;
index++;
@@ -372,7 +372,7 @@ void LoadOptions()
di_node->next = opt.diList;
opt.diList = di_node;
real_count++;
- if (di_node->di.bIsVisible && _tcsstr(di_node->di.swzValue, L"sys:status_msg"))
+ if (di_node->di.bIsVisible && wcsstr(di_node->di.swzValue, L"sys:status_msg"))
opt.bWaitForStatusMsg = true;
}
else
@@ -411,8 +411,8 @@ void LoadOptions()
di_node = opt.diList;
}
- _tcsncpy(di_node->di.swzLabel, L"Last message: (%sys:last_msg_reltime% ago)", LABEL_LEN);
- _tcsncpy(di_node->di.swzValue, L"%sys:last_msg%", VALUE_LEN);
+ wcsncpy(di_node->di.swzLabel, L"Last message: (%sys:last_msg_reltime% ago)", LABEL_LEN);
+ wcsncpy(di_node->di.swzValue, L"%sys:last_msg%", VALUE_LEN);
di_node->di.bLineAbove = di_node->di.bValueNewline = true;
di_node->next = 0;
opt.iDiCount++;
@@ -436,8 +436,8 @@ void LoadOptions()
di_node = opt.diList;
}
- _tcsncpy(di_node->di.swzLabel, L"Status message:", LABEL_LEN);
- _tcsncpy(di_node->di.swzValue, L"%sys:status_msg%", VALUE_LEN);
+ wcsncpy(di_node->di.swzLabel, L"Status message:", LABEL_LEN);
+ wcsncpy(di_node->di.swzValue, L"%sys:status_msg%", VALUE_LEN);
di_node->di.bLineAbove = di_node->di.bValueNewline = true;
di_node->next = 0;
opt.iDiCount++;
@@ -516,7 +516,7 @@ void LoadOptions()
}
else if (opt.skinMode == SM_IMAGE) {
if (!db_get_ts(NULL, MODULE, "SkinName", &dbv)) {
- _tcsncpy(opt.szSkinName, dbv.ptszVal, _countof(opt.szSkinName) - 1);
+ wcsncpy(opt.szSkinName, dbv.ptszVal, _countof(opt.szSkinName) - 1);
db_free(&dbv);
}
}
@@ -584,7 +584,7 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
sel = SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETCURSEL, 0, 0);
if (sel != CB_ERR) {
- TCHAR buff[256];
+ wchar_t buff[256];
SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETLBTEXT, sel, (LPARAM)buff);
for (int i = 0; presetItems[i].szID; i++) {
if (mir_tstrcmp(buff, TranslateTS(presetItems[i].swzName)) == 0) {
@@ -620,7 +620,7 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (LOWORD(wParam) == IDC_CMB_PRESETITEMS) {
int sel = SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETCURSEL, 0, 0);
if (sel != CB_ERR) {
- TCHAR buff[256];
+ wchar_t buff[256];
SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETLBTEXT, sel, (LPARAM)buff);
for (int i = 0; presetItems[i].szID; i++) {
if (mir_tstrcmp(buff, TranslateTS(presetItems[i].swzName)) == 0) {
@@ -737,7 +737,7 @@ INT_PTR CALLBACK DlgProcAddSubst(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
return 0;
}
-static void SetTreeItemText(DIListNode *node, TCHAR **pszText)
+static void SetTreeItemText(DIListNode *node, wchar_t **pszText)
{
if (node->di.swzLabel[0] == 0) {
if (node->di.swzValue[0] == 0 && node->di.bLineAbove)
@@ -750,15 +750,15 @@ static void SetTreeItemText(DIListNode *node, TCHAR **pszText)
}
static OPTBUTTON btns[9] = {
- IDC_BTN_ADD, SKINICON_OTHER_ADDCONTACT, 0, LPGENT("Add item"),
- IDC_BTN_SEPARATOR, 0, IDI_SEPARATOR, LPGENT("Add separator"),
- IDC_BTN_EDIT, SKINICON_OTHER_RENAME, 0, LPGENT("Edit"),
- IDC_BTN_REMOVE, SKINICON_OTHER_DELETE, 0, LPGENT("Remove"),
- IDC_BTN_UP, 0, IDI_UP, LPGENT("Move up"),
- IDC_BTN_DOWN, 0, IDI_DOWN, LPGENT("Move down"),
- IDC_BTN_ADD2, SKINICON_OTHER_ADDCONTACT, 0, LPGENT("Add"),
- IDC_BTN_REMOVE2, SKINICON_OTHER_DELETE, 0, LPGENT("Remove"),
- IDC_BTN_EDIT2, SKINICON_OTHER_RENAME, 0, LPGENT("Edit")
+ IDC_BTN_ADD, SKINICON_OTHER_ADDCONTACT, 0, LPGENW("Add item"),
+ IDC_BTN_SEPARATOR, 0, IDI_SEPARATOR, LPGENW("Add separator"),
+ IDC_BTN_EDIT, SKINICON_OTHER_RENAME, 0, LPGENW("Edit"),
+ IDC_BTN_REMOVE, SKINICON_OTHER_DELETE, 0, LPGENW("Remove"),
+ IDC_BTN_UP, 0, IDI_UP, LPGENW("Move up"),
+ IDC_BTN_DOWN, 0, IDI_DOWN, LPGENW("Move down"),
+ IDC_BTN_ADD2, SKINICON_OTHER_ADDCONTACT, 0, LPGENW("Add"),
+ IDC_BTN_REMOVE2, SKINICON_OTHER_DELETE, 0, LPGENW("Remove"),
+ IDC_BTN_EDIT2, SKINICON_OTHER_RENAME, 0, LPGENW("Edit")
};
INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -907,7 +907,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
memset(ds_value, 0, sizeof(DSListNode));
ds_value->next = NULL;
ds_value->ds.type = subst->type;
- _tcsncpy(ds_value->ds.swzName, subst->swzName, LABEL_LEN - 1);
+ wcsncpy(ds_value->ds.swzName, subst->swzName, LABEL_LEN - 1);
if (ds_value->ds.type == DVT_DB && subst->szModuleName)
strncpy(ds_value->ds.szModuleName, subst->szModuleName, MODULE_NAME_LEN - 1);
@@ -985,7 +985,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
hNewItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem);
if (hNewItem) {
- TCHAR buff[512], buff2[512];
+ wchar_t buff[512], buff2[512];
LPARAM tmpParam;
UINT tmpState;
@@ -1643,7 +1643,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &item);
if (hti.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT) || (hti.hItem == TVI_FIRST)) {
TVINSERTSTRUCT tvis;
- TCHAR swzName[256];
+ wchar_t swzName[256];
tvis.item.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
tvis.item.pszText = swzName;
@@ -1794,7 +1794,7 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
EnableControls(hwndDlg, false);
}
else if (iSel != LB_ERR) {
- TCHAR swzSkinName[256];
+ wchar_t swzSkinName[256];
if (ListBox_GetText(hwndList, iSel, swzSkinName) > 0)
ParseSkinFile(swzSkinName, false, true);
EnableControls(hwndDlg, true);
@@ -2026,8 +2026,8 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
switch (((LPNMHDR)lParam)->idFrom) {
case 0:
if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY) {
- TCHAR buff[256];
- TCHAR swzProtos[1024] = { 0 };
+ wchar_t buff[256];
+ wchar_t swzProtos[1024] = { 0 };
TVITEM item;
item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS));
diff --git a/plugins/TipperYM/src/options.h b/plugins/TipperYM/src/options.h
index f75e828d89..3161b5e2d4 100644
--- a/plugins/TipperYM/src/options.h
+++ b/plugins/TipperYM/src/options.h
@@ -35,13 +35,13 @@ Boston, MA 02111-1307, USA.
typedef struct {
UINT id, uintCoreIconId, uintResIconId;
- TCHAR *swzTooltip;
+ wchar_t *swzTooltip;
} OPTBUTTON;
typedef enum { DIT_ALL = 0, DIT_CONTACTS = 1, DIT_CHATS = 2 } DisplayItemType;
typedef struct {
- TCHAR swzLabel[LABEL_LEN];
- TCHAR swzValue[VALUE_LEN];
+ wchar_t swzLabel[LABEL_LEN];
+ wchar_t swzValue[VALUE_LEN];
DisplayItemType type;
bool bLineAbove, bValueNewline;
bool bIsVisible;
@@ -51,16 +51,16 @@ typedef struct {
// display item types
static struct {
DisplayItemType type;
- TCHAR *title;
+ wchar_t *title;
} displayItemTypes[] = {
- { DIT_ALL, LPGENT("Show for all contact types") },
- { DIT_CONTACTS, LPGENT("Show only for contacts") },
- { DIT_CHATS, LPGENT("Show only for chatrooms") }
+ { DIT_ALL, LPGENW("Show for all contact types") },
+ { DIT_CONTACTS, LPGENW("Show only for contacts") },
+ { DIT_CHATS, LPGENW("Show only for chatrooms") }
};
typedef enum { DVT_DB = 0, DVT_PROTODB = 1 } DisplaySubstType;
typedef struct {
- TCHAR swzName[LABEL_LEN];
+ wchar_t swzName[LABEL_LEN];
DisplaySubstType type;
char szModuleName[MODULE_NAME_LEN];
char szSettingName[SETTING_NAME_LEN];
@@ -85,28 +85,28 @@ typedef struct {
} MARGINS;
// tray tooltip items
-static TCHAR *trayTipItems[TRAYTIP_ITEMS_COUNT] = {
- LPGENT("Number of contacts"),
- LPGENT("Protocol lock status"),
- LPGENT("Logon time"),
- LPGENT("Unread emails"),
- LPGENT("Status"),
- LPGENT("Status message"),
- LPGENT("Extra status"),
- LPGENT("Listening to"),
- LPGENT("Favorite contacts"),
- LPGENT("Miranda uptime"),
- LPGENT("Contact list event")
+static wchar_t *trayTipItems[TRAYTIP_ITEMS_COUNT] = {
+ LPGENW("Number of contacts"),
+ LPGENW("Protocol lock status"),
+ LPGENW("Logon time"),
+ LPGENW("Unread emails"),
+ LPGENW("Status"),
+ LPGENW("Status message"),
+ LPGENW("Extra status"),
+ LPGENW("Listening to"),
+ LPGENW("Favorite contacts"),
+ LPGENW("Miranda uptime"),
+ LPGENW("Contact list event")
};
// extra icons
-static TCHAR *extraIconName[6] = {
- LPGENT("Status"),
- LPGENT("Extra status"),
- LPGENT("Jabber activity"),
- LPGENT("Gender"),
- LPGENT("Country flag"),
- LPGENT("Client")
+static wchar_t *extraIconName[6] = {
+ LPGENW("Status"),
+ LPGENW("Extra status"),
+ LPGENW("Jabber activity"),
+ LPGENW("Gender"),
+ LPGENW("Country flag"),
+ LPGENW("Client")
};
typedef struct {
@@ -148,9 +148,9 @@ typedef struct {
// tooltip skin
SkinMode skinMode;
- TCHAR szSkinName[256];
- TCHAR szPreviewFile[1024];
- TCHAR *szImgFile[SKIN_ITEMS_COUNT];
+ wchar_t szSkinName[256];
+ wchar_t szPreviewFile[1024];
+ wchar_t *szImgFile[SKIN_ITEMS_COUNT];
MARGINS margins[SKIN_ITEMS_COUNT];
TransformationMode transfMode[SKIN_ITEMS_COUNT];
PopupShowEffect showEffect;
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp
index 1a238d7ba9..2b0cbebb6b 100644
--- a/plugins/TipperYM/src/popwin.cpp
+++ b/plugins/TipperYM/src/popwin.cpp
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA.
#include "stdafx.h"
-__inline void AddRow(PopupWindowData *pwd, TCHAR *swzLabel, TCHAR *swzValue, char *szProto, bool bParseSmileys, bool bNewline, bool bLineAbove, bool bIsTitle = false, HICON hIcon = NULL)
+__inline void AddRow(PopupWindowData *pwd, wchar_t *swzLabel, wchar_t *swzValue, char *szProto, bool bParseSmileys, bool bNewline, bool bLineAbove, bool bIsTitle = false, HICON hIcon = NULL)
{
RowData *pRows = (RowData *)mir_realloc(pwd->rows, sizeof(RowData) * (pwd->iRowCount + 1));
if (pRows == NULL)
@@ -97,31 +97,31 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
// uid info
- TCHAR swzUid[256], swzUidName[256];
+ wchar_t swzUid[256], swzUidName[256];
if (Uid(0, pwd->clcit.szProto, swzUid, 256) && UidName(pwd->clcit.szProto, swzUidName, 253)) {
mir_tstrcat(swzUidName, L": ");
AddRow(pwd, swzUidName, swzUid, NULL, false, false, false);
}
// logon info
- TCHAR swzLogon[64];
+ wchar_t swzLogon[64];
if (TimestampToTimeDifference(NULL, pwd->clcit.szProto, "LogonTS", swzLogon, 59)) {
- TCHAR ago[96];
+ wchar_t ago[96];
mir_sntprintf(ago, TranslateT("%s ago"), swzLogon);
AddRow(pwd, TranslateT("Log on:"), ago, NULL, false, false, false);
}
// number of unread emails
- TCHAR swzEmailCount[64];
+ wchar_t swzEmailCount[64];
if (ProtoServiceExists(pwd->clcit.szProto, PS_GETUNREADEMAILCOUNT)) {
int iCount = (int)CallProtoService(pwd->clcit.szProto, PS_GETUNREADEMAILCOUNT, 0, 0);
if (iCount > 0) {
- _itot(iCount, swzEmailCount, 10);
+ _itow(iCount, swzEmailCount, 10);
AddRow(pwd, TranslateT("Unread emails:"), swzEmailCount, NULL, false, false, false);
}
}
- TCHAR *swzText = pcli->pfnGetStatusModeDescription(wStatus, 0);
+ wchar_t *swzText = pcli->pfnGetStatusModeDescription(wStatus, 0);
if (swzText)
AddRow(pwd, TranslateT("Status:"), swzText, NULL, false, false, false);
@@ -134,7 +134,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
// jabber mood or icq xstatus
- TCHAR *swzAdvTitle = GetJabberAdvStatusText(pwd->clcit.szProto, "mood", "title");
+ wchar_t *swzAdvTitle = GetJabberAdvStatusText(pwd->clcit.szProto, "mood", "title");
if (swzAdvTitle) {
StripBBCodesInPlace(swzAdvTitle);
AddRow(pwd, TranslateT("Mood:"), swzAdvTitle, pwd->clcit.szProto, true, false, true);
@@ -217,14 +217,14 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
SetTimer(hwnd, ID_TIMER_TRAYTIP, opt.iExpandTime, 0);
}
else {
- TCHAR buff[2048], *swzText = pwd->clcit.swzText;
+ wchar_t buff[2048], *swzText = pwd->clcit.swzText;
size_t iBuffPos, i = 0, iSize = mir_tstrlen(pwd->clcit.swzText);
bool bTopMessage = false;
- while (i < iSize && swzText[i] != _T('<')) {
+ while (i < iSize && swzText[i] != '<') {
iBuffPos = 0;
- while (swzText[i] != _T('\n') && swzText[i] != _T('\r') && i < iSize && iBuffPos < 2048) {
- if (swzText[i] != _T('\t'))
+ while (swzText[i] != '\n' && swzText[i] != '\r' && i < iSize && iBuffPos < 2048) {
+ if (swzText[i] != '\t')
buff[iBuffPos++] = swzText[i];
i++;
}
@@ -236,21 +236,21 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
bTopMessage = true;
}
- while (i < iSize && (swzText[i] == _T('\n') || swzText[i] == _T('\r')))
+ while (i < iSize && (swzText[i] == '\n' || swzText[i] == '\r'))
i++;
}
// parse bold bits into labels and the rest into items
while (i < iSize) {
- while (i + 2 < iSize && (swzText[i] != _T('<') || swzText[i + 1] != _T('b') || swzText[i + 2] != _T('>')))
+ while (i + 2 < iSize && (swzText[i] != '<' || swzText[i + 1] != 'b' || swzText[i + 2] != '>'))
i++;
i += 3;
iBuffPos = 0;
- while (i + 3 < iSize && iBuffPos < 2048 && (swzText[i] != _T('<')
- || swzText[i + 1] != _T('/') || swzText[i + 2] != _T('b') || swzText[i + 3] != _T('>'))) {
- if (swzText[i] != _T('\t'))
+ while (i + 3 < iSize && iBuffPos < 2048 && (swzText[i] != '<'
+ || swzText[i + 1] != '/' || swzText[i + 2] != 'b' || swzText[i + 3] != '>')) {
+ if (swzText[i] != '\t')
buff[iBuffPos++] = swzText[i];
i++;
}
@@ -269,8 +269,8 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
pwd->rows[pwd->iRowCount].bLineAbove = false;
iBuffPos = 0;
- while (i < iSize && iBuffPos < 2048 && swzText[i] != _T('\n')) {
- if (swzText[i] != _T('\t') && swzText[i] != _T('\r'))
+ while (i < iSize && iBuffPos < 2048 && swzText[i] != '\n') {
+ if (swzText[i] != '\t' && swzText[i] != '\r')
buff[iBuffPos++] = swzText[i];
i++;
}
@@ -306,7 +306,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (!opt.bWaitForContent)
db_unset(pwd->hContact, MODULE, "TempStatusMsg");
- _tcsncpy_s(pwd->swzTitle, pcli->pfnGetContactDisplayName(pwd->hContact, 0), _TRUNCATE);
+ wcsncpy_s(pwd->swzTitle, pcli->pfnGetContactDisplayName(pwd->hContact, 0), _TRUNCATE);
char *szProto = GetContactProto(pwd->hContact);
pwd->spiTitle = Smileys_PreParse(pwd->swzTitle, -1, szProto);
@@ -741,10 +741,10 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
HBITMAP hbmpAllItems = iconInfo.hbmColor;
DestroyIcon(hIcon);
- AppendMenu(hMenu, MF_STRING, COPYMENU_ALLITEMS_LABELS, LPGENT("Copy all items with labels"));
- AppendMenu(hMenu, MF_STRING, COPYMENU_ALLITEMS, LPGENT("Copy all items"));
+ AppendMenu(hMenu, MF_STRING, COPYMENU_ALLITEMS_LABELS, LPGENW("Copy all items with labels"));
+ AppendMenu(hMenu, MF_STRING, COPYMENU_ALLITEMS, LPGENW("Copy all items"));
if (pwd->clcit.szProto || pwd->hContact)
- AppendMenu(hMenu, MF_STRING, COPYMENU_AVATAR, LPGENT("Copy avatar"));
+ AppendMenu(hMenu, MF_STRING, COPYMENU_AVATAR, LPGENW("Copy avatar"));
AppendMenu(hMenu, MF_SEPARATOR, 2000, 0);
TranslateMenu(hMenu);
@@ -765,11 +765,11 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
for (int i = 0; i < pwd->iRowCount; i++) {
if (pwd->rows[i].swzValue) {
- TCHAR buff[128];
+ wchar_t buff[128];
int iLen = (int)mir_tstrlen(pwd->rows[i].swzValue);
if (iLen) {
if (iLen > MAX_VALUE_LEN) {
- _tcsncpy(buff, pwd->rows[i].swzValue, MAX_VALUE_LEN);
+ wcsncpy(buff, pwd->rows[i].swzValue, MAX_VALUE_LEN);
buff[MAX_VALUE_LEN] = 0;
mir_tstrcat(buff, L"...");
}
@@ -816,7 +816,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
else { // copy text
HGLOBAL hClipboardData = GlobalAlloc(GMEM_DDESHARE, 4096);
- TCHAR *pchData = (TCHAR *)GlobalLock(hClipboardData);
+ wchar_t *pchData = (wchar_t *)GlobalLock(hClipboardData);
pchData[0] = 0;
if (iSelItem == COPYMENU_ALLITEMS_LABELS) { // copy all items with labels
for (int i = 0; i < pwd->iRowCount; i++) {
@@ -965,7 +965,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
case PUM_SETSTATUSTEXT:
if (pwd && wParam == pwd->hContact) {
- db_set_ts(pwd->hContact, MODULE, "TempStatusMsg", (TCHAR *)lParam);
+ db_set_ts(pwd->hContact, MODULE, "TempStatusMsg", (wchar_t *)lParam);
pwd->bIsPainted = false;
pwd->bNeedRefresh = true;
SendMessage(hwnd, PUM_REFRESH_VALUES, TRUE, 0);
@@ -1035,7 +1035,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
pwd->iRowCount = 0;
DIListNode *node = opt.diList;
- TCHAR buff_label[LABEL_LEN], buff[VALUE_LEN];
+ wchar_t buff_label[LABEL_LEN], buff[VALUE_LEN];
while (node) {
if (node->di.bIsVisible && CheckContactType(pwd->hContact, node->di)) {
if (GetLabelText(pwd->hContact, node->di, buff_label, LABEL_LEN) && GetValueText(pwd->hContact, node->di, buff, VALUE_LEN)) {
@@ -1453,7 +1453,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
DWORD dwItems = (wParam == 0) ? opt.iFirstItems : opt.iSecondItems;
bool bFirstItem = true;
- TCHAR buff[64];
+ wchar_t buff[64];
int oldOrder = -1, iProtoCount = 0;
PROTOACCOUNT **accs;
@@ -1488,7 +1488,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
else buff[0] = 0;
- TCHAR swzProto[256];
+ wchar_t swzProto[256];
mir_tstrcpy(swzProto, pa->tszAccountName);
if (dwItems & TRAYTIP_LOCKSTATUS)
if (Proto_IsAccountLocked(pa))
@@ -1499,7 +1499,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (dwItems & TRAYTIP_LOGON) {
if (TimestampToTimeDifference(NULL, pa->szModuleName, "LogonTS", buff, 59)) {
- TCHAR ago[96];
+ wchar_t ago[96];
mir_sntprintf(ago, TranslateT("%s ago"), buff);
AddRow(pwd, TranslateT("Log on:"), ago, NULL, false, false, false);
}
@@ -1508,20 +1508,20 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (dwItems & TRAYTIP_UNREAD_EMAILS && ProtoServiceExists(pa->szModuleName, PS_GETUNREADEMAILCOUNT)) {
int iCount = (int)CallProtoService(pa->szModuleName, PS_GETUNREADEMAILCOUNT, 0, 0);
if (iCount > 0) {
- _itot(iCount, buff, 10);
+ _itow(iCount, buff, 10);
AddRow(pwd, TranslateT("Unread emails:"), buff, NULL, false, false, false);
}
}
if (dwItems & TRAYTIP_STATUS) {
- TCHAR *swzText = pcli->pfnGetStatusModeDescription(wStatus, 0);
+ wchar_t *swzText = pcli->pfnGetStatusModeDescription(wStatus, 0);
if (swzText)
AddRow(pwd, TranslateT("Status:"), swzText, NULL, false, false, false);
}
if (wStatus >= ID_STATUS_ONLINE && wStatus <= ID_STATUS_OUTTOLUNCH) {
if (dwItems & TRAYTIP_STATUS_MSG) {
- TCHAR *swzText = GetProtoStatusMessage(pa->szModuleName, wStatus);
+ wchar_t *swzText = GetProtoStatusMessage(pa->szModuleName, wStatus);
if (swzText) {
StripBBCodesInPlace(swzText);
AddRow(pwd, TranslateT("Status message:"), swzText, pa->szModuleName, true, true, false);
@@ -1531,13 +1531,13 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (dwItems & TRAYTIP_EXTRA_STATUS) {
// jabber mood or icq xstatus
- TCHAR *swzAdvTitle = GetJabberAdvStatusText(pa->szModuleName, "mood", "title");
+ wchar_t *swzAdvTitle = GetJabberAdvStatusText(pa->szModuleName, "mood", "title");
if (swzAdvTitle) {
StripBBCodesInPlace(swzAdvTitle);
AddRow(pwd, TranslateT("Mood:"), swzAdvTitle, pa->szModuleName, true, false, false);
mir_free(swzAdvTitle);
- TCHAR *swzAdvText = GetJabberAdvStatusText(pa->szModuleName, "mood", "text");
+ wchar_t *swzAdvText = GetJabberAdvStatusText(pa->szModuleName, "mood", "text");
if (swzAdvText) {
StripBBCodesInPlace(swzAdvText);
AddRow(pwd, L"", swzAdvText, pa->szModuleName, true, true, false);
@@ -1555,7 +1555,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
// xstatus message
- TCHAR *swzAdvText = GetProtoExtraStatusMessage(pa->szModuleName);
+ wchar_t *swzAdvText = GetProtoExtraStatusMessage(pa->szModuleName);
if (swzAdvText) {
StripBBCodesInPlace(swzAdvText);
AddRow(pwd, L"", swzAdvText, pa->szModuleName, true, true, false);
@@ -1564,14 +1564,14 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
}
- TCHAR *swzActTitle = GetJabberAdvStatusText(pa->szModuleName, "activity", "title");
+ wchar_t *swzActTitle = GetJabberAdvStatusText(pa->szModuleName, "activity", "title");
if (swzActTitle) {
StripBBCodesInPlace(swzActTitle);
AddRow(pwd, TranslateT("Activity:"), swzActTitle, pa->szModuleName, true, false, false);
mir_free(swzActTitle);
}
- TCHAR *swzActText = GetJabberAdvStatusText(pa->szModuleName, "activity", "text");
+ wchar_t *swzActText = GetJabberAdvStatusText(pa->szModuleName, "activity", "text");
if (swzActText) {
StripBBCodesInPlace(swzActText);
AddRow(pwd, L"", swzActText, pa->szModuleName, true, true, false);
@@ -1580,7 +1580,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
if (dwItems & TRAYTIP_LISTENINGTO) {
- TCHAR *swzListening = GetListeningTo(pa->szModuleName);
+ wchar_t *swzListening = GetListeningTo(pa->szModuleName);
if (swzListening) {
StripBBCodesInPlace(swzListening);
AddRow(pwd, TranslateT("Listening to:"), swzListening, NULL, false, true, false);
@@ -1592,8 +1592,8 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (dwItems & TRAYTIP_FAVCONTACTS) {
if (db_get_dw(0, MODULE, "FavouriteContactsCount", 0)) {
- TCHAR swzName[256];
- TCHAR swzStatus[256];
+ wchar_t swzName[256];
+ wchar_t swzStatus[256];
bool bTitlePainted = false;
int iCount = 0, iCountOnline = 0;
@@ -1618,9 +1618,9 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
bTitlePainted = true;
}
- TCHAR *swzNick = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *swzNick = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0);
if (opt.iFavoriteContFlags & FAVCONT_APPEND_PROTO) {
- TCHAR *swzProto = a2t(proto);
+ wchar_t *swzProto = a2t(proto);
mir_sntprintf(swzName, L"%s (%s)", swzNick, swzProto);
mir_free(swzProto);
}
@@ -1652,11 +1652,11 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
if (dwItems & TRAYTIP_CLIST_EVENT && pwd->clcit.swzText) {
- TCHAR *pchBr = _tcschr(pwd->clcit.swzText, '\n');
- TCHAR *pchBold = _tcsstr(pwd->clcit.swzText, L"<b>");
+ wchar_t *pchBr = wcschr(pwd->clcit.swzText, '\n');
+ wchar_t *pchBold = wcsstr(pwd->clcit.swzText, L"<b>");
if (!pchBold || pchBold != pwd->clcit.swzText) {
- TCHAR swzText[256];
+ wchar_t swzText[256];
mir_tstrcpy(swzText, pwd->clcit.swzText);
if (pchBr) swzText[pchBr - pwd->clcit.swzText] = 0;
AddRow(pwd, swzText, L"", NULL, false, true, false, true, Skin_LoadIcon(SKINICON_OTHER_FILLEDBLOB));
diff --git a/plugins/TipperYM/src/popwin.h b/plugins/TipperYM/src/popwin.h
index 92ac1e2855..d63ca07b33 100644
--- a/plugins/TipperYM/src/popwin.h
+++ b/plugins/TipperYM/src/popwin.h
@@ -89,12 +89,12 @@ typedef struct {
HANDLE hItem; //handle to group or contact
POINT ptCursor;
RECT rcItem;
- TCHAR *swzText; // for tips with specific text
+ wchar_t *swzText; // for tips with specific text
char *szProto; // for proto tips
} CLCINFOTIPEX;
typedef struct {
- TCHAR *swzLabel, *swzValue;
+ wchar_t *swzLabel, *swzValue;
HICON hIcon;
bool bValueNewline;
bool bLineAbove;
@@ -110,7 +110,7 @@ typedef struct {
MCONTACT hContact;
int iIconIndex;
CLCINFOTIPEX clcit;
- TCHAR swzTitle[TITLE_TEXT_LEN];
+ wchar_t swzTitle[TITLE_TEXT_LEN];
SMILEYPARSEINFO spiTitle;
RowData *rows;
int iRowCount;
@@ -132,7 +132,7 @@ typedef struct {
LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
-extern int IsTrayProto(const TCHAR *swzProto, BOOL bExtendedTip);
+extern int IsTrayProto(const wchar_t *swzProto, BOOL bExtendedTip);
#endif
diff --git a/plugins/TipperYM/src/preset_items.cpp b/plugins/TipperYM/src/preset_items.cpp
index 764264c42d..e29ca11708 100644
--- a/plugins/TipperYM/src/preset_items.cpp
+++ b/plugins/TipperYM/src/preset_items.cpp
@@ -22,42 +22,42 @@ Boston, MA 02111-1307, USA.
PRESETITEM presetItems[] =
{
- "account", LPGENT("Account"), LPGENT("Account:"), L"%sys:account%", 0, 0, 0,
- "birth", LPGENT("Birthday"), LPGENT("Birthday:"), L"%birthday_date% (%birthday_age%) @ Next: %birthday_next%", "birthdate", "birthage", "birthnext",
- "client", LPGENT("Client"), LPGENT("Client:"), L"%raw:/MirVer%", 0, 0, 0,
- "email", LPGENT("Email"), LPGENT("Email:"), L"%raw:/e-mail%", 0, 0, 0,
- "gender", LPGENT("Gender"), LPGENT("Gender:"), L"%gender%", 0, 0, 0,
- "homepage", LPGENT("Homepage"), LPGENT("Homepage:"), L"%raw:/Homepage%", 0, 0, 0,
- "id", LPGENT("Identifier"), L"%sys:uidname|UID^!MetaContacts%:", L"%sys:uid%", 0, 0, 0,
- "idle", LPGENT("Idle"), LPGENT("Idle:"), L"%idle% (%idle_diff% ago)", "idle", "idlediff", 0,
+ "account", LPGENW("Account"), LPGENW("Account:"), L"%sys:account%", 0, 0, 0,
+ "birth", LPGENW("Birthday"), LPGENW("Birthday:"), L"%birthday_date% (%birthday_age%) @ Next: %birthday_next%", "birthdate", "birthage", "birthnext",
+ "client", LPGENW("Client"), LPGENW("Client:"), L"%raw:/MirVer%", 0, 0, 0,
+ "email", LPGENW("Email"), LPGENW("Email:"), L"%raw:/e-mail%", 0, 0, 0,
+ "gender", LPGENW("Gender"), LPGENW("Gender:"), L"%gender%", 0, 0, 0,
+ "homepage", LPGENW("Homepage"), LPGENW("Homepage:"), L"%raw:/Homepage%", 0, 0, 0,
+ "id", LPGENW("Identifier"), L"%sys:uidname|UID^!MetaContacts%:", L"%sys:uid%", 0, 0, 0,
+ "idle", LPGENW("Idle"), LPGENW("Idle:"), L"%idle% (%idle_diff% ago)", "idle", "idlediff", 0,
"ip", L"IP", L"IP:", L"%ip%", "ip", 0, 0,
- "ipint", LPGENT("IP internal"), LPGENT("IP internal:"), L"%ip_internal%", "ipint", 0, 0,
- "lastmsg", LPGENT("Last message"), LPGENT("Last message: (%sys:last_msg_reltime% ago)"), L"%sys:last_msg%", 0, 0, 0,
- "listening", LPGENT("Listening to"), LPGENT("Listening to:"), L"%raw:/ListeningTo%", 0, 0, 0,
- "name", LPGENT("Name"), LPGENT("Name:"), L"%raw:/FirstName|% %raw:/LastName%", 0, 0, 0,
- "received", LPGENT("Number of received messages"), LPGENT("Number of msg [IN]:"), L"%sys:msg_count_in%", 0, 0, 0,
- "sended", LPGENT("Number of sent messages"), LPGENT("Number of msg [OUT]:"), L"%sys:msg_count_out%", 0, 0, 0,
- "status", LPGENT("Status"), LPGENT("Status:"), L"%Status%", "status", 0, 0,
- "statusmsg", LPGENT("Status message"), LPGENT("Status message:"), L"%sys:status_msg%", 0, 0, 0,
- "time", LPGENT("Contact time"), LPGENT("Time:"), L"%sys:time%", 0, 0, 0,
- "xtitle", LPGENT("xStatus title"), LPGENT("xStatus title:"), L"%xsname%", "xname", 0, 0,
- "xtext", LPGENT("xStatus text"), LPGENT("xStatus text:"), L"%raw:/XStatusMsg%", 0, 0, 0,
- "acttitle", LPGENT("[jabber.dll] Activity title"), LPGENT("Activity title:"), L"%raw:AdvStatus/?dbsetting(%subject%,Protocol,p)/activity/title%", 0, 0, 0,
- "acttext", LPGENT("[jabber.dll] Activity text"), LPGENT("Activity text:"), L"%raw:AdvStatus/?dbsetting(%subject%,Protocol,p)/activity/text%", 0, 0, 0,
- "lastseentime", LPGENT("[seenplugin.dll] Last seen time"), LPGENT("Last seen time:"), L"%lastseen_date% @ %lastseen_time%", "lsdate", "lstime", 0,
- "lastseenstatus", LPGENT("[seenplugin.dll] Last seen status"), LPGENT("Last seen status:"), L"%lastseen_status% (%lastseen_ago% ago)", "lsstatus", "lsago", 0,
- "cond", LPGENT("[weather.dll] Condition"), LPGENT("Condition:"), L"%raw:Current/Condition%", 0, 0, 0,
- "humidity", LPGENT("[weather.dll] Humidity"), LPGENT("Humidity:"), L"%raw:Current/Humidity%", 0, 0, 0,
- "minmaxtemp", LPGENT("[weather.dll] Max/Min temperature"), LPGENT("Max/Min:"), L"%raw:Current/High%/%raw:Current/Low%", 0, 0, 0,
- "moon", LPGENT("[weather.dll] Moon"), LPGENT("Moon:"), L"%raw:Current/Moon%", 0, 0, 0,
- "pressure", LPGENT("[weather.dll] Pressure"), LPGENT("Pressure:"), L"%raw:Current/Pressure% (%raw:Current/Pressure Tendency%)", 0, 0, 0,
- "sunrise", LPGENT("[weather.dll] Sunrise"), LPGENT("Sunrise:"), L"%raw:Current/Sunrise%", 0, 0, 0,
- "sunset", LPGENT("[weather.dll] Sunset"), LPGENT("Sunset:"), L"%raw:Current/Sunset%", 0, 0, 0,
- "temp", LPGENT("[weather.dll] Temperature"), LPGENT("Temperature:"), L"%raw:Current/Temperature%", 0, 0, 0,
- "uptime", LPGENT("[weather.dll] Update time"), LPGENT("Update time:"), L"%raw:Current/Update%", 0, 0, 0,
- "uvindex", LPGENT("[weather.dll] UV Index"), LPGENT("UV Index:"), L"%raw:Current/UV% - %raw:Current/UVI%", 0, 0, 0,
- "vis", LPGENT("[weather.dll] Visibility"), LPGENT("Visibility:"), L"%raw:Current/Visibility%", 0, 0, 0,
- "wind", LPGENT("[weather.dll] Wind"), LPGENT("Wind:"), L"%raw:Current/Wind Direction% (%raw:Current/Wind Direction DEG%)/%raw:Current/Wind Speed%", 0, 0, 0,
+ "ipint", LPGENW("IP internal"), LPGENW("IP internal:"), L"%ip_internal%", "ipint", 0, 0,
+ "lastmsg", LPGENW("Last message"), LPGENW("Last message: (%sys:last_msg_reltime% ago)"), L"%sys:last_msg%", 0, 0, 0,
+ "listening", LPGENW("Listening to"), LPGENW("Listening to:"), L"%raw:/ListeningTo%", 0, 0, 0,
+ "name", LPGENW("Name"), LPGENW("Name:"), L"%raw:/FirstName|% %raw:/LastName%", 0, 0, 0,
+ "received", LPGENW("Number of received messages"), LPGENW("Number of msg [IN]:"), L"%sys:msg_count_in%", 0, 0, 0,
+ "sended", LPGENW("Number of sent messages"), LPGENW("Number of msg [OUT]:"), L"%sys:msg_count_out%", 0, 0, 0,
+ "status", LPGENW("Status"), LPGENW("Status:"), L"%Status%", "status", 0, 0,
+ "statusmsg", LPGENW("Status message"), LPGENW("Status message:"), L"%sys:status_msg%", 0, 0, 0,
+ "time", LPGENW("Contact time"), LPGENW("Time:"), L"%sys:time%", 0, 0, 0,
+ "xtitle", LPGENW("xStatus title"), LPGENW("xStatus title:"), L"%xsname%", "xname", 0, 0,
+ "xtext", LPGENW("xStatus text"), LPGENW("xStatus text:"), L"%raw:/XStatusMsg%", 0, 0, 0,
+ "acttitle", LPGENW("[jabber.dll] Activity title"), LPGENW("Activity title:"), L"%raw:AdvStatus/?dbsetting(%subject%,Protocol,p)/activity/title%", 0, 0, 0,
+ "acttext", LPGENW("[jabber.dll] Activity text"), LPGENW("Activity text:"), L"%raw:AdvStatus/?dbsetting(%subject%,Protocol,p)/activity/text%", 0, 0, 0,
+ "lastseentime", LPGENW("[seenplugin.dll] Last seen time"), LPGENW("Last seen time:"), L"%lastseen_date% @ %lastseen_time%", "lsdate", "lstime", 0,
+ "lastseenstatus", LPGENW("[seenplugin.dll] Last seen status"), LPGENW("Last seen status:"), L"%lastseen_status% (%lastseen_ago% ago)", "lsstatus", "lsago", 0,
+ "cond", LPGENW("[weather.dll] Condition"), LPGENW("Condition:"), L"%raw:Current/Condition%", 0, 0, 0,
+ "humidity", LPGENW("[weather.dll] Humidity"), LPGENW("Humidity:"), L"%raw:Current/Humidity%", 0, 0, 0,
+ "minmaxtemp", LPGENW("[weather.dll] Max/Min temperature"), LPGENW("Max/Min:"), L"%raw:Current/High%/%raw:Current/Low%", 0, 0, 0,
+ "moon", LPGENW("[weather.dll] Moon"), LPGENW("Moon:"), L"%raw:Current/Moon%", 0, 0, 0,
+ "pressure", LPGENW("[weather.dll] Pressure"), LPGENW("Pressure:"), L"%raw:Current/Pressure% (%raw:Current/Pressure Tendency%)", 0, 0, 0,
+ "sunrise", LPGENW("[weather.dll] Sunrise"), LPGENW("Sunrise:"), L"%raw:Current/Sunrise%", 0, 0, 0,
+ "sunset", LPGENW("[weather.dll] Sunset"), LPGENW("Sunset:"), L"%raw:Current/Sunset%", 0, 0, 0,
+ "temp", LPGENW("[weather.dll] Temperature"), LPGENW("Temperature:"), L"%raw:Current/Temperature%", 0, 0, 0,
+ "uptime", LPGENW("[weather.dll] Update time"), LPGENW("Update time:"), L"%raw:Current/Update%", 0, 0, 0,
+ "uvindex", LPGENW("[weather.dll] UV Index"), LPGENW("UV Index:"), L"%raw:Current/UV% - %raw:Current/UVI%", 0, 0, 0,
+ "vis", LPGENW("[weather.dll] Visibility"), LPGENW("Visibility:"), L"%raw:Current/Visibility%", 0, 0, 0,
+ "wind", LPGENW("[weather.dll] Wind"), LPGENW("Wind:"), L"%raw:Current/Wind Direction% (%raw:Current/Wind Direction DEG%)/%raw:Current/Wind Speed%", 0, 0, 0,
0, 0, 0, 0, 0, 0, 0
};
diff --git a/plugins/TipperYM/src/preset_items.h b/plugins/TipperYM/src/preset_items.h
index 8b07f0069c..a402cca5d6 100644
--- a/plugins/TipperYM/src/preset_items.h
+++ b/plugins/TipperYM/src/preset_items.h
@@ -25,15 +25,15 @@ Boston, MA 02111-1307, USA.
typedef struct {
char *szID;
- TCHAR *swzName;
- TCHAR *swzLabel;
- TCHAR *swzValue;
+ wchar_t *swzName;
+ wchar_t *swzLabel;
+ wchar_t *swzValue;
char *szNeededSubst[MAX_PRESET_SUBST_COUNT];
} PRESETITEM;
typedef struct {
char *szID;
- TCHAR *swzName;
+ wchar_t *swzName;
DisplaySubstType type;
char *szModuleName;
char *szSettingName;
diff --git a/plugins/TipperYM/src/skin_parser.cpp b/plugins/TipperYM/src/skin_parser.cpp
index 9f4416e51b..8bcb23daca 100644
--- a/plugins/TipperYM/src/skin_parser.cpp
+++ b/plugins/TipperYM/src/skin_parser.cpp
@@ -26,7 +26,7 @@ int RefreshSkinList(HWND hwndDlg)
ListBox_ResetContent(hwndSkins);
ListBox_AddString(hwndSkins, TranslateT("# Solid color fill"));
- TCHAR szDirSave[1024];
+ wchar_t szDirSave[1024];
GetCurrentDirectory(1024, szDirSave);
SetCurrentDirectory(SKIN_FOLDER);
@@ -56,7 +56,7 @@ int RefreshSkinList(HWND hwndDlg)
return ListBox_SelectString(GetDlgItem(hwndDlg, IDC_LB_SKINS), -1, opt.szSkinName);
}
-bool FileExists(TCHAR *filename)
+bool FileExists(wchar_t *filename)
{
HANDLE hFile = CreateFile(filename, 0, 0, 0, OPEN_EXISTING, 0, 0);
if (hFile != INVALID_HANDLE_VALUE)
@@ -68,14 +68,14 @@ bool FileExists(TCHAR *filename)
return false;
}
-void ParseAboutPart(FILE *fp, TCHAR *buff, TCHAR *szSkinName)
+void ParseAboutPart(FILE *fp, wchar_t *buff, wchar_t *szSkinName)
{
myfgets(buff, 1024, fp);
while (buff[0] != '[')
{
if (buff[0] != ';')
{
- TCHAR *pch = _tcschr(buff, '=');
+ wchar_t *pch = wcschr(buff, '=');
if (pch++)
{
while (pch && (*pch == ' ' || *pch == '\t'))
@@ -83,11 +83,11 @@ void ParseAboutPart(FILE *fp, TCHAR *buff, TCHAR *szSkinName)
if (pch)
{
- if (_tcsstr(buff, L"author"))
+ if (wcsstr(buff, L"author"))
{}
- else if (_tcsstr(buff, L"preview"))
+ else if (wcsstr(buff, L"preview"))
{
- TCHAR szImgPath[1024];
+ wchar_t szImgPath[1024];
mir_sntprintf(szImgPath, L"%s\\%s\\%s", SKIN_FOLDER, szSkinName, pch);
if (FileExists(szImgPath))
mir_tstrcpy(opt.szPreviewFile, szImgPath);
@@ -101,7 +101,7 @@ void ParseAboutPart(FILE *fp, TCHAR *buff, TCHAR *szSkinName)
}
}
-void ParseImagePart(FILE *fp, TCHAR *buff, int iPart)
+void ParseImagePart(FILE *fp, wchar_t *buff, int iPart)
{
opt.szImgFile[iPart] = NULL;
opt.transfMode[iPart] = TM_NONE;
@@ -115,7 +115,7 @@ void ParseImagePart(FILE *fp, TCHAR *buff, int iPart)
{
if (buff[0] != ';')
{
- TCHAR *pch = _tcschr(buff, '=');
+ wchar_t *pch = wcschr(buff, '=');
if (pch++)
{
while (pch && (*pch == ' ' || *pch == '\t'))
@@ -123,13 +123,13 @@ void ParseImagePart(FILE *fp, TCHAR *buff, int iPart)
if (pch)
{
- if (_tcsstr(buff, L"image"))
+ if (wcsstr(buff, L"image"))
{
- TCHAR szImgPath[1024];
+ wchar_t szImgPath[1024];
mir_sntprintf(szImgPath, L"%s\\%s\\%s", SKIN_FOLDER, opt.szSkinName, pch);
opt.szImgFile[iPart] = mir_tstrdup(szImgPath);
}
- else if (_tcsstr(buff, L"tm"))
+ else if (wcsstr(buff, L"tm"))
{
if (!mir_tstrcmpi(pch, L"TM_NONE"))
opt.transfMode[iPart] = TM_NONE;
@@ -150,14 +150,14 @@ void ParseImagePart(FILE *fp, TCHAR *buff, int iPart)
else
opt.transfMode[iPart] = TM_NONE;
}
- else if (_tcsstr(buff, L"left"))
- opt.margins[iPart].left = _ttoi(pch);
- else if (_tcsstr(buff, L"top"))
- opt.margins[iPart].top = _ttoi(pch);
- else if (_tcsstr(buff, L"right"))
- opt.margins[iPart].right = _ttoi(pch);
- else if (_tcsstr(buff, L"bottom"))
- opt.margins[iPart].bottom = _ttoi(pch);
+ else if (wcsstr(buff, L"left"))
+ opt.margins[iPart].left = _wtoi(pch);
+ else if (wcsstr(buff, L"top"))
+ opt.margins[iPart].top = _wtoi(pch);
+ else if (wcsstr(buff, L"right"))
+ opt.margins[iPart].right = _wtoi(pch);
+ else if (wcsstr(buff, L"bottom"))
+ opt.margins[iPart].bottom = _wtoi(pch);
}
}
}
@@ -167,25 +167,25 @@ void ParseImagePart(FILE *fp, TCHAR *buff, int iPart)
}
}
-char *GetSettingName(TCHAR *szValue, char *szPostfix, char *buff, size_t buffsize)
+char *GetSettingName(wchar_t *szValue, char *szPostfix, char *buff, size_t buffsize)
{
buff[0] = 0;
- if (_tcsstr(szValue, L"traytitle"))
+ if (wcsstr(szValue, L"traytitle"))
mir_snprintf(buff, buffsize, "FontTrayTitle%s", szPostfix);
- else if (_tcsstr(szValue, L"title"))
+ else if (wcsstr(szValue, L"title"))
mir_snprintf(buff, buffsize, "FontFirst%s", szPostfix);
- else if (_tcsstr(szValue, L"label"))
+ else if (wcsstr(szValue, L"label"))
mir_snprintf(buff, buffsize, "FontLabels%s", szPostfix);
- else if (_tcsstr(szValue, L"value"))
+ else if (wcsstr(szValue, L"value"))
mir_snprintf(buff, buffsize, "FontValues%s", szPostfix);
- else if (_tcsstr(szValue, L"divider"))
+ else if (wcsstr(szValue, L"divider"))
mir_snprintf(buff, buffsize, "Divider%s", szPostfix);
return buff[0] ? buff : NULL;
}
-void ParseFontPart(FILE *fp, TCHAR *buff)
+void ParseFontPart(FILE *fp, wchar_t *buff)
{
char szSetting[64];
@@ -194,7 +194,7 @@ void ParseFontPart(FILE *fp, TCHAR *buff)
{
if (buff[0] != ';')
{
- TCHAR *pch = _tcschr(buff, '=');
+ wchar_t *pch = wcschr(buff, '=');
if (pch++)
{
while (pch && (*pch == ' ' || *pch == '\t'))
@@ -202,7 +202,7 @@ void ParseFontPart(FILE *fp, TCHAR *buff)
if (pch)
{
- if (_tcsstr(buff, L"face"))
+ if (wcsstr(buff, L"face"))
{
if (GetSettingName(buff, "", szSetting, sizeof(szSetting) - 1))
{
@@ -212,45 +212,45 @@ void ParseFontPart(FILE *fp, TCHAR *buff)
db_set_ts(0, MODULE, szSetting, pch);
}
}
- else if (_tcsstr(buff, L"color"))
+ else if (wcsstr(buff, L"color"))
{
if (GetSettingName(buff, "Col", szSetting, sizeof(szSetting) - 1))
{
- BYTE r = _ttoi(pch);
- pch = _tcschr(pch, ' ');
+ BYTE r = _wtoi(pch);
+ pch = wcschr(pch, ' ');
if (++pch)
{
- BYTE g = _ttoi(pch);
- pch = _tcschr(pch, ' ');
+ BYTE g = _wtoi(pch);
+ pch = wcschr(pch, ' ');
if (++pch)
{
- BYTE b = _ttoi(pch);
+ BYTE b = _wtoi(pch);
COLORREF color = RGB(r, g ,b);
db_set_dw(0, MODULE, szSetting, color);
}
}
}
}
- else if (_tcsstr(buff, L"size"))
+ else if (wcsstr(buff, L"size"))
{
if (GetSettingName(buff, "Size", szSetting, sizeof(szSetting) - 1))
{
HDC hdc = GetDC(0);
- int size = -MulDiv(_ttoi(pch), GetDeviceCaps(hdc, LOGPIXELSY), 72);
+ int size = -MulDiv(_wtoi(pch), GetDeviceCaps(hdc, LOGPIXELSY), 72);
db_set_b(0, MODULE, szSetting, (BYTE)size);
ReleaseDC(0, hdc);
}
}
- else if (_tcsstr(buff, L"effect"))
+ else if (wcsstr(buff, L"effect"))
{
if (GetSettingName(buff, "Sty", szSetting, sizeof(szSetting) - 1))
{
BYTE effect = 0;
- if (_tcsstr(pch, L"font_bold"))
+ if (wcsstr(pch, L"font_bold"))
effect |= DBFONTF_BOLD;
- if (_tcsstr(pch, L"font_italic"))
+ if (wcsstr(pch, L"font_italic"))
effect |= DBFONTF_ITALIC;
- if (_tcsstr(pch, L"font_underline"))
+ if (wcsstr(pch, L"font_underline"))
effect |= DBFONTF_UNDERLINE;
db_set_b(0, MODULE, szSetting, effect);
@@ -265,14 +265,14 @@ void ParseFontPart(FILE *fp, TCHAR *buff)
}
}
-void ParseAppearancePart(FILE *fp, TCHAR *buff)
+void ParseAppearancePart(FILE *fp, wchar_t *buff)
{
myfgets(buff, 1024, fp);
while (buff[0] != '[')
{
if (buff[0] != ';')
{
- TCHAR *pch = _tcschr(buff, '=');
+ wchar_t *pch = wcschr(buff, '=');
if (pch++)
{
while (pch && (*pch == ' ' || *pch == '\t'))
@@ -280,24 +280,24 @@ void ParseAppearancePart(FILE *fp, TCHAR *buff)
if (pch)
{
- if (_tcsstr(buff, L"general-padding"))
- opt.iPadding = _ttoi(pch);
- else if (_tcsstr(buff, L"title-indent"))
- opt.iTitleIndent = _ttoi(pch);
- else if (_tcsstr(buff, L"text-indent"))
- opt.iTextIndent = _ttoi(pch);
- else if (_tcsstr(buff, L"value-indent"))
- opt.iValueIndent = _ttoi(pch);
- else if (_tcsstr(buff, L"text-padding"))
- opt.iTextPadding = _ttoi(pch);
- else if (_tcsstr(buff, L"outer-avatar-padding"))
- opt.iOuterAvatarPadding = _ttoi(pch);
- else if (_tcsstr(buff, L"inner-avatar-padding"))
- opt.iInnerAvatarPadding = _ttoi(pch);
- else if (_tcsstr(buff, L"sidebar-width"))
- opt.iSidebarWidth = _ttoi(pch);
- else if (_tcsstr(buff, L"opacity"))
- opt.iOpacity = _ttoi(pch);
+ if (wcsstr(buff, L"general-padding"))
+ opt.iPadding = _wtoi(pch);
+ else if (wcsstr(buff, L"title-indent"))
+ opt.iTitleIndent = _wtoi(pch);
+ else if (wcsstr(buff, L"text-indent"))
+ opt.iTextIndent = _wtoi(pch);
+ else if (wcsstr(buff, L"value-indent"))
+ opt.iValueIndent = _wtoi(pch);
+ else if (wcsstr(buff, L"text-padding"))
+ opt.iTextPadding = _wtoi(pch);
+ else if (wcsstr(buff, L"outer-avatar-padding"))
+ opt.iOuterAvatarPadding = _wtoi(pch);
+ else if (wcsstr(buff, L"inner-avatar-padding"))
+ opt.iInnerAvatarPadding = _wtoi(pch);
+ else if (wcsstr(buff, L"sidebar-width"))
+ opt.iSidebarWidth = _wtoi(pch);
+ else if (wcsstr(buff, L"opacity"))
+ opt.iOpacity = _wtoi(pch);
}
}
}
@@ -307,14 +307,14 @@ void ParseAppearancePart(FILE *fp, TCHAR *buff)
}
}
-void ParseOtherPart(FILE *fp, TCHAR *buff)
+void ParseOtherPart(FILE *fp, wchar_t *buff)
{
myfgets(buff, 1024, fp);
while (buff[0] != '[')
{
if (buff[0] != ';')
{
- TCHAR *pch = _tcschr(buff, '=');
+ wchar_t *pch = wcschr(buff, '=');
if (pch++)
{
while (pch && (*pch == ' ' || *pch == '\t'))
@@ -322,9 +322,9 @@ void ParseOtherPart(FILE *fp, TCHAR *buff)
if (pch)
{
- if (_tcsstr(buff, L"enable-coloring"))
+ if (wcsstr(buff, L"enable-coloring"))
{
- if (_tcsstr(pch, L"false"))
+ if (wcsstr(pch, L"false"))
opt.iEnableColoring = -1;
}
}
@@ -336,9 +336,9 @@ void ParseOtherPart(FILE *fp, TCHAR *buff)
}
}
-void ParseSkinFile(TCHAR *szSkinName, bool bStartup, bool bOnlyPreview)
+void ParseSkinFile(wchar_t *szSkinName, bool bStartup, bool bOnlyPreview)
{
- TCHAR szDirSave[1024], buff[1024];
+ wchar_t szDirSave[1024], buff[1024];
if (opt.skinMode == SM_OBSOLOTE && bStartup)
return;
@@ -354,7 +354,7 @@ void ParseSkinFile(TCHAR *szSkinName, bool bStartup, bool bOnlyPreview)
HANDLE hFind = FindFirstFile(L"*.tsf", &ffd);
if (hFind != INVALID_HANDLE_VALUE)
{
- FILE *fp = _tfopen(ffd.cFileName, L"r");
+ FILE *fp = _wfopen(ffd.cFileName, L"r");
if (fp)
{
myfgets(buff, 1024, fp);
diff --git a/plugins/TipperYM/src/skin_parser.h b/plugins/TipperYM/src/skin_parser.h
index ca83f47915..c7981709b2 100644
--- a/plugins/TipperYM/src/skin_parser.h
+++ b/plugins/TipperYM/src/skin_parser.h
@@ -26,5 +26,5 @@ typedef enum {
} SkinMode;
int RefreshSkinList(HWND hwndDlg);
-void ParseSkinFile(TCHAR *szSkinName, bool bStartup, bool bOnlyPreview);
+void ParseSkinFile(wchar_t *szSkinName, bool bStartup, bool bOnlyPreview);
#endif \ No newline at end of file
diff --git a/plugins/TipperYM/src/stdafx.h b/plugins/TipperYM/src/stdafx.h
index b0bd0ad7df..b6facc2c8d 100644
--- a/plugins/TipperYM/src/stdafx.h
+++ b/plugins/TipperYM/src/stdafx.h
@@ -66,9 +66,9 @@ Boston, MA 02111-1307, USA.
#include "preset_items.h"
#include "translations.h"
-#define MODULE "Tipper"
-#define MODULE_ITEMS "Tipper_Items"
-#define DEFAULT_SKIN_FOLDER "Skins\\Tipper"
+#define MODULE "Tipper"
+#define MODULE_ITEMS "Tipper_Items"
+#define DEFAULT_SKIN_FOLDER L"Skins\\Tipper"
extern HMODULE hInst;
@@ -80,6 +80,6 @@ extern int iCodePage;
extern FI_INTERFACE *fii;
extern TOOLTIPSKIN skin;
-extern TCHAR SKIN_FOLDER[256];
+extern wchar_t SKIN_FOLDER[256];
extern int ReloadFont(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/TipperYM/src/str_utils.cpp b/plugins/TipperYM/src/str_utils.cpp
index 63ccd39165..ccc537581a 100644
--- a/plugins/TipperYM/src/str_utils.cpp
+++ b/plugins/TipperYM/src/str_utils.cpp
@@ -67,34 +67,34 @@ bool utf2a(const char *us, char *buff, int bufflen)
}
-bool t2w(const TCHAR *ts, wchar_t *buff, int bufflen)
+bool t2w(const wchar_t *ts, wchar_t *buff, int bufflen)
{
wcsncpy(buff, ts, bufflen);
return true;
}
-bool w2t(const wchar_t *ws, TCHAR *buff, int bufflen)
+bool w2t(const wchar_t *ws, wchar_t *buff, int bufflen)
{
wcsncpy(buff, ws, bufflen);
return true;
}
-bool t2a(const TCHAR *ts, char *buff, int bufflen)
+bool t2a(const wchar_t *ts, char *buff, int bufflen)
{
return w2a(ts, buff, bufflen);
}
-bool a2t(const char *as, TCHAR *buff, int bufflen)
+bool a2t(const char *as, wchar_t *buff, int bufflen)
{
return a2w(as, buff, bufflen);
}
-bool t2utf(const TCHAR *ts, char *buff, int bufflen)
+bool t2utf(const wchar_t *ts, char *buff, int bufflen)
{
return w2utf(ts, buff, bufflen);
}
-bool utf2t(const char *us, TCHAR *buff, int bufflen)
+bool utf2t(const char *us, wchar_t *buff, int bufflen)
{
return utf2w(us, buff, bufflen);
}
@@ -161,40 +161,40 @@ char *a2utf(const char *as)
return ret;
}
-TCHAR *w2t(const wchar_t *ws)
+wchar_t *w2t(const wchar_t *ws)
{
return mir_wstrdup(ws);
}
-wchar_t *t2w(const TCHAR *ts)
+wchar_t *t2w(const wchar_t *ts)
{
return mir_tstrdup(ts);
}
-char *t2a(const TCHAR *ts)
+char *t2a(const wchar_t *ts)
{
return w2a(ts);
}
-TCHAR *a2t(const char *as)
+wchar_t *a2t(const char *as)
{
return a2w(as);
}
-TCHAR *utf2t(const char *utfs)
+wchar_t *utf2t(const char *utfs)
{
return utf2w(utfs);
}
-char *t2utf(const TCHAR *ts)
+char *t2utf(const wchar_t *ts)
{
return w2utf(ts);
}
-TCHAR *myfgets(TCHAR *Buf, int MaxCount, FILE *File)
+wchar_t *myfgets(wchar_t *Buf, int MaxCount, FILE *File)
{
- _fgetts(Buf, MaxCount, File);
+ fgetws(Buf, MaxCount, File);
for (size_t i = mir_tstrlen(Buf) - 1; ; i--)
{
if (Buf[i] == '\n' || Buf[i] == ' ')
diff --git a/plugins/TipperYM/src/str_utils.h b/plugins/TipperYM/src/str_utils.h
index 26fbb613fa..4beca4e51b 100644
--- a/plugins/TipperYM/src/str_utils.h
+++ b/plugins/TipperYM/src/str_utils.h
@@ -32,14 +32,14 @@ bool w2utf(const wchar_t *ws, char *buff, int bufflen);
bool a2utf(const char *as, char *buff, int bufflen);
bool utf2a(const char *ws, char *buff, int bufflen);
-bool t2w(const TCHAR *ts, wchar_t *buff, int bufflen);
-bool w2t(const wchar_t *ws, TCHAR *buff, int bufflen);
+bool t2w(const wchar_t *ts, wchar_t *buff, int bufflen);
+bool w2t(const wchar_t *ws, wchar_t *buff, int bufflen);
-bool t2a(const TCHAR *ts, char *buff, int bufflen);
-bool a2t(const char *as, TCHAR *buff, int bufflen);
+bool t2a(const wchar_t *ts, char *buff, int bufflen);
+bool a2t(const char *as, wchar_t *buff, int bufflen);
-bool t2utf(const TCHAR *ts, char *buff, int bufflen);
-bool utf2t(const char *us, TCHAR *buff, int bufflen);
+bool t2utf(const wchar_t *ts, char *buff, int bufflen);
+bool utf2t(const char *us, wchar_t *buff, int bufflen);
// remember to free return value
wchar_t *a2w(const char *as);
@@ -51,16 +51,16 @@ char *w2utf(const wchar_t *ws);
char *utf2a(const char *us);
char *a2utf(const char *as);
-wchar_t *t2w(const TCHAR *ts);
-TCHAR *w2t(const wchar_t *ws);
+wchar_t *t2w(const wchar_t *ts);
+wchar_t *w2t(const wchar_t *ws);
-TCHAR *utf2t(const char *us);
-char *t2utf(const TCHAR *ts);
+wchar_t *utf2t(const char *us);
+char *t2utf(const wchar_t *ts);
-char *t2a(const TCHAR *ts);
-TCHAR *a2t(const char *as);
+char *t2a(const wchar_t *ts);
+wchar_t *a2t(const char *as);
-TCHAR *myfgets(TCHAR *Buf, int MaxCount, FILE *File);
+wchar_t *myfgets(wchar_t *Buf, int MaxCount, FILE *File);
#endif
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp
index fb0674de07..071e73c212 100644
--- a/plugins/TipperYM/src/subst.cpp
+++ b/plugins/TipperYM/src/subst.cpp
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA.
#include "stdafx.h"
-bool DBGetContactSettingAsString(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+bool DBGetContactSettingAsString(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
buff[0] = 0;
@@ -31,13 +31,13 @@ bool DBGetContactSettingAsString(MCONTACT hContact, const char *szModuleName, co
if (!db_get(hContact, szModuleName, szSettingName, &dbv)) {
switch (dbv.type) {
case DBVT_BYTE:
- _itot(dbv.bVal, buff, 10);
+ _itow(dbv.bVal, buff, 10);
break;
case DBVT_WORD:
- _ltot(dbv.wVal, buff, 10);
+ _ltow(dbv.wVal, buff, 10);
break;
case DBVT_DWORD:
- _ltot(dbv.dVal, buff, 10);
+ _ltow(dbv.dVal, buff, 10);
break;
case DBVT_ASCIIZ:
if (dbv.pszVal) a2t(dbv.pszVal, buff, bufflen);
@@ -76,7 +76,7 @@ bool CheckContactType(MCONTACT hContact, const DISPLAYITEM &di)
return false;
}
-void StripBBCodesInPlace(TCHAR *ptszText)
+void StripBBCodesInPlace(wchar_t *ptszText)
{
if (!db_get_b(0, MODULE, "StripBBCodes", 1))
return;
@@ -96,21 +96,21 @@ void StripBBCodesInPlace(TCHAR *ptszText)
if (iRead > iLen)
break;
- if (iLen - iRead >= 3 && (_tcsnicmp(ptszText + iRead, L"[b]", 3) == 0 || _tcsnicmp(ptszText + iRead, L"[i]", 3) == 0))
+ if (iLen - iRead >= 3 && (wcsnicmp(ptszText + iRead, L"[b]", 3) == 0 || wcsnicmp(ptszText + iRead, L"[i]", 3) == 0))
iRead += 3;
- else if (iLen - iRead >= 4 && (_tcsnicmp(ptszText + iRead, L"[/b]", 4) == 0 || _tcsnicmp(ptszText + iRead, L"[/i]", 4) == 0))
+ else if (iLen - iRead >= 4 && (wcsnicmp(ptszText + iRead, L"[/b]", 4) == 0 || wcsnicmp(ptszText + iRead, L"[/i]", 4) == 0))
iRead += 4;
- else if (iLen - iRead >= 6 && (_tcsnicmp(ptszText + iRead, L"[color", 6) == 0)) {
+ else if (iLen - iRead >= 6 && (wcsnicmp(ptszText + iRead, L"[color", 6) == 0)) {
while (iRead < iLen && ptszText[iRead] != ']') iRead++;
iRead++;// skip the ']'
}
- else if (iLen - iRead >= 8 && (_tcsnicmp(ptszText + iRead, L"[/color]", 8) == 0))
+ else if (iLen - iRead >= 8 && (wcsnicmp(ptszText + iRead, L"[/color]", 8) == 0))
iRead += 8;
- else if (iLen - iRead >= 5 && (_tcsnicmp(ptszText + iRead, L"[size", 5) == 0)) {
+ else if (iLen - iRead >= 5 && (wcsnicmp(ptszText + iRead, L"[size", 5) == 0)) {
while (iRead < iLen && ptszText[iRead] != ']') iRead++;
iRead++;// skip the ']'
}
- else if (iLen - iRead >= 7 && (_tcsnicmp(ptszText + iRead, L"[/size]", 7) == 0))
+ else if (iLen - iRead >= 7 && (wcsnicmp(ptszText + iRead, L"[/size]", 7) == 0))
iRead += 7;
else {
if (ptszText[iRead] != ptszText[iWrite]) ptszText[iWrite] = ptszText[iRead];
@@ -131,14 +131,14 @@ DWORD LastMessageTimestamp(MCONTACT hContact, bool received)
return 0;
}
-void FormatTimestamp(DWORD ts, char *szFormat, TCHAR *buff, int bufflen)
+void FormatTimestamp(DWORD ts, char *szFormat, wchar_t *buff, int bufflen)
{
- TCHAR swzForm[16];
+ wchar_t swzForm[16];
a2t(szFormat, swzForm, 16);
TimeZone_ToStringT(ts, swzForm, buff, bufflen);
}
-bool Uid(MCONTACT hContact, char *szProto, TCHAR *buff, int bufflen)
+bool Uid(MCONTACT hContact, char *szProto, wchar_t *buff, int bufflen)
{
char *tmpProto = (hContact ? GetContactProto(hContact) : szProto);
if (tmpProto) {
@@ -150,7 +150,7 @@ bool Uid(MCONTACT hContact, char *szProto, TCHAR *buff, int bufflen)
return false;
}
-bool UidName(char *szProto, TCHAR *buff, int bufflen)
+bool UidName(char *szProto, wchar_t *buff, int bufflen)
{
if (szProto) {
char *szUidName = (char*)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDTEXT, 0);
@@ -162,7 +162,7 @@ bool UidName(char *szProto, TCHAR *buff, int bufflen)
return false;
}
-TCHAR* GetLastMessageText(MCONTACT hContact, bool received)
+wchar_t* GetLastMessageText(MCONTACT hContact, bool received)
{
for (MEVENT hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) {
DBEVENTINFO dbei = { sizeof(dbei) };
@@ -173,8 +173,8 @@ TCHAR* GetLastMessageText(MCONTACT hContact, bool received)
if (dbei.cbBlob == 0 || dbei.pBlob == 0)
return 0;
- TCHAR *buff = DbGetEventTextT( &dbei, CP_ACP );
- TCHAR *swzMsg = mir_tstrdup(buff);
+ wchar_t *buff = DbGetEventTextT( &dbei, CP_ACP );
+ wchar_t *swzMsg = mir_tstrdup(buff);
mir_free(buff);
StripBBCodesInPlace(swzMsg);
@@ -206,9 +206,9 @@ bool CanRetrieveStatusMsg(MCONTACT hContact, char *szProto)
return false;
}
-TCHAR* GetStatusMessageText(MCONTACT hContact)
+wchar_t* GetStatusMessageText(MCONTACT hContact)
{
- TCHAR *swzMsg = NULL;
+ wchar_t *swzMsg = NULL;
DBVARIANT dbv;
char *szProto = GetContactProto(hContact);
@@ -246,7 +246,7 @@ TCHAR* GetStatusMessageText(MCONTACT hContact)
return swzMsg;
}
-bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int bufflen)
+bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int bufflen)
{
bool recv = false;
@@ -268,7 +268,7 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff
else if (szProto) {
PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (pa && pa->tszAccountName) {
- _tcsncpy(buff, pa->tszAccountName, bufflen);
+ wcsncpy(buff, pa->tszAccountName, bufflen);
return true;
}
else
@@ -284,17 +284,17 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff
return UidName(szProto, buff, bufflen);
}
else if (!mir_tstrcmp(swzRawSpec, L"status_msg")) {
- TCHAR *swzMsg = GetStatusMessageText(hContact);
+ wchar_t *swzMsg = GetStatusMessageText(hContact);
if (swzMsg) {
- _tcsncpy(buff, swzMsg, bufflen);
+ wcsncpy(buff, swzMsg, bufflen);
mir_free(swzMsg);
return true;
}
}
else if ((recv = !mir_tstrcmp(swzRawSpec, L"last_msg")) || !mir_tstrcmp(swzRawSpec, L"last_msg_out")) {
- TCHAR *swzMsg = GetLastMessageText(hContact, recv);
+ wchar_t *swzMsg = GetLastMessageText(hContact, recv);
if (swzMsg) {
- _tcsncpy(buff, swzMsg, bufflen);
+ wcsncpy(buff, swzMsg, bufflen);
mir_free(swzMsg);
return true;
}
@@ -305,9 +305,9 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff
if (!hSubContact)
return false;
- TCHAR *swzNick = pcli->pfnGetContactDisplayName(hSubContact, 0);
+ wchar_t *swzNick = pcli->pfnGetContactDisplayName(hSubContact, 0);
if (swzNick)
- _tcsncpy(buff, swzNick, bufflen);
+ wcsncpy(buff, swzNick, bufflen);
return true;
}
else if (!mir_tstrcmp(swzRawSpec, L"meta_subuid")) {
@@ -418,7 +418,7 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff
return false;
}
-bool GetSubstText(MCONTACT hContact, const DISPLAYSUBST &ds, TCHAR *buff, int bufflen)
+bool GetSubstText(MCONTACT hContact, const DISPLAYSUBST &ds, wchar_t *buff, int bufflen)
{
TranslateFunc *transFunc = 0;
for (int i = 0; i < iTransFuncsCount; i++)
@@ -445,7 +445,7 @@ bool GetSubstText(MCONTACT hContact, const DISPLAYSUBST &ds, TCHAR *buff, int bu
return false;
}
-bool GetRawSubstText(MCONTACT hContact, char *szRawSpec, TCHAR *buff, int bufflen)
+bool GetRawSubstText(MCONTACT hContact, char *szRawSpec, wchar_t *buff, int bufflen)
{
size_t lenght = mir_strlen(szRawSpec);
for (size_t i = 0; i < lenght; i++) {
@@ -466,7 +466,7 @@ bool GetRawSubstText(MCONTACT hContact, char *szRawSpec, TCHAR *buff, int buffle
return false;
}
-bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsFirst, TCHAR *swzDest, size_t iDestLen)
+bool ApplySubst(MCONTACT hContact, const wchar_t *swzSource, bool parseTipperVarsFirst, wchar_t *swzDest, size_t iDestLen)
{
// hack - allow empty strings before passing to variables (note - zero length strings return false after this)
if (swzDest && swzSource && (*swzSource == 0)) {
@@ -475,18 +475,18 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
}
// pass to variables plugin if available
- TCHAR *swzVarSrc = (parseTipperVarsFirst ? mir_tstrdup(swzSource) : variables_parsedup((TCHAR *)swzSource, 0, hContact));
+ wchar_t *swzVarSrc = (parseTipperVarsFirst ? mir_tstrdup(swzSource) : variables_parsedup((wchar_t *)swzSource, 0, hContact));
size_t iSourceLen = mir_tstrlen(swzVarSrc);
size_t si = 0, di = 0, v = 0;
- TCHAR swzVName[LABEL_LEN], swzRep[VALUE_LEN], swzAlt[VALUE_LEN];
+ wchar_t swzVName[LABEL_LEN], swzRep[VALUE_LEN], swzAlt[VALUE_LEN];
while (si < iSourceLen && di < iDestLen - 1) {
- if (swzVarSrc[si] == _T('%')) {
+ if (swzVarSrc[si] == '%') {
si++;
v = 0;
while (si < iSourceLen && v < LABEL_LEN - 1) {
- if (swzVarSrc[si] == _T('%'))
+ if (swzVarSrc[si] == '%')
break;
swzVName[v] = swzVarSrc[si];
@@ -494,7 +494,7 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
}
if (v == 0) // bSubst len is 0 - just a % symbol
- swzDest[di] = _T('%');
+ swzDest[di] = '%';
else if (si < iSourceLen) // we found end %
{
swzVName[v] = 0;
@@ -502,7 +502,7 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
bool bAltSubst = false, bSubst = false;
// apply only to specific protocols
- TCHAR *p = _tcsrchr(swzVName, _T('^')); // use last '^', so if you want a ^ in swzAlt text, you can just put a '^' on the end
+ wchar_t *p = wcsrchr(swzVName, '^'); // use last '^', so if you want a ^ in swzAlt text, you can just put a '^' on the end
if (p) {
*p = 0;
p++;
@@ -519,7 +519,7 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
goto empty;
bool negate = false;
- if (*p == _T('!')) {
+ if (*p == '!') {
p++;
if (*p == 0) goto error;
negate = true;
@@ -529,11 +529,11 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
bool spec = false;
int len;
- TCHAR *last = _tcsrchr(p, _T(','));
+ wchar_t *last = wcsrchr(p, ',');
if (!last) last = p;
while (p <= last + 1) {
- len = (int)_tcscspn(p, L",");
+ len = (int)wcscspn(p, L",");
t2a(p, sproto, len);
sproto[len] = 0;
p += len + 1;
@@ -551,17 +551,17 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
// get alternate text, if bSubst fails
swzAlt[0] = 0;
- p = _tcschr(swzVName, _T('|')); // use first '|' - so you can use the '|' symbol in swzAlt text
+ p = wcschr(swzVName, '|'); // use first '|' - so you can use the '|' symbol in swzAlt text
if (p) {
*p = 0; // clip swzAlt from swzVName
p++;
- if (mir_tstrlen(p) > 4 && _tcsncmp(p, L"raw:", 4) == 0) { // raw db substitution
+ if (mir_tstrlen(p) > 4 && wcsncmp(p, L"raw:", 4) == 0) { // raw db substitution
char raw_spec[LABEL_LEN];
p += 4;
t2a(p, raw_spec, LABEL_LEN);
GetRawSubstText(hContact, raw_spec, swzAlt, VALUE_LEN);
}
- else if (mir_tstrlen(p) > 4 && _tcsncmp(p, L"sys:", 4) == 0) { // 'system' substitution
+ else if (mir_tstrlen(p) > 4 && wcsncmp(p, L"sys:", 4) == 0) { // 'system' substitution
p += 4;
GetSysSubstText(hContact, p, swzAlt, VALUE_LEN);
}
@@ -578,7 +578,7 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
if (ds_node)
GetSubstText(hContact, ds_node->ds, swzAlt, VALUE_LEN);
else {
- _tcsncpy(swzAlt, p, VALUE_LEN);
+ wcsncpy(swzAlt, p, VALUE_LEN);
bAltSubst = true;
}
}
@@ -588,13 +588,13 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
}
// get bSubst text
- if (v > 4 && _tcsncmp(swzVName, L"raw:", 4) == 0) // raw db substitution
+ if (v > 4 && wcsncmp(swzVName, L"raw:", 4) == 0) // raw db substitution
{
char raw_spec[LABEL_LEN];
t2a(&swzVName[4], raw_spec, LABEL_LEN);
bSubst = GetRawSubstText(hContact, raw_spec, swzRep, VALUE_LEN);
}
- else if (v > 4 && _tcsncmp(swzVName, L"sys:", 4) == 0) // 'system' substitution
+ else if (v > 4 && wcsncmp(swzVName, L"sys:", 4) == 0) // 'system' substitution
{
bSubst = GetSysSubstText(hContact, &swzVName[4], swzRep, VALUE_LEN);
}
@@ -616,12 +616,12 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
if (bSubst) {
size_t rep_len = mir_tstrlen(swzRep);
- _tcsncpy(&swzDest[di], swzRep, min(rep_len, iDestLen - di));
+ wcsncpy(&swzDest[di], swzRep, min(rep_len, iDestLen - di));
di += rep_len - 1; // -1 because we inc at bottom of loop
}
else if (bAltSubst) {
size_t alt_len = mir_tstrlen(swzAlt);
- _tcsncpy(&swzDest[di], swzAlt, min(alt_len, iDestLen - di));
+ wcsncpy(&swzDest[di], swzAlt, min(alt_len, iDestLen - di));
di += alt_len - 1; // -1 because we inc at bottom of loop
}
else goto empty; // empty value
@@ -640,14 +640,14 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
if (parseTipperVarsFirst) {
swzVarSrc = variables_parsedup(swzDest, 0, hContact);
- _tcsncpy(swzDest, swzVarSrc, iDestLen);
+ wcsncpy(swzDest, swzVarSrc, iDestLen);
mir_free(swzVarSrc);
}
// check for a 'blank' string - just spaces etc
for (si = 0; si <= di; si++) {
- if (swzDest[si] != 0 && swzDest[si] != _T(' ') && swzDest[si] != _T('\t') && swzDest[si] != _T('\r') && swzDest[si] != _T('\n'))
+ if (swzDest[si] != 0 && swzDest[si] != ' ' && swzDest[si] != '\t' && swzDest[si] != '\r' && swzDest[si] != '\n')
return true;
}
@@ -658,23 +658,23 @@ empty:
return false;
error:
- swzDest[0] = _T('*');
+ swzDest[0] = '*';
swzDest[1] = 0;
mir_free(swzVarSrc);
return true;
}
-bool GetLabelText(MCONTACT hContact, const DISPLAYITEM &di, TCHAR *buff, size_t bufflen)
+bool GetLabelText(MCONTACT hContact, const DISPLAYITEM &di, wchar_t *buff, size_t bufflen)
{
return ApplySubst(hContact, di.swzLabel, false, buff, bufflen);
}
-bool GetValueText(MCONTACT hContact, const DISPLAYITEM &di, TCHAR *buff, size_t bufflen)
+bool GetValueText(MCONTACT hContact, const DISPLAYITEM &di, wchar_t *buff, size_t bufflen)
{
return ApplySubst(hContact, di.swzValue, di.bParseTipperVarsFirst, buff, bufflen);
}
-void TruncateString(TCHAR *ptszText)
+void TruncateString(wchar_t *ptszText)
{
if (ptszText && opt.iLimitCharCount > 3) {
if ((int)mir_tstrlen(ptszText) > opt.iLimitCharCount) {
@@ -684,7 +684,7 @@ void TruncateString(TCHAR *ptszText)
}
}
-TCHAR* GetProtoStatusMessage(char *szProto, WORD wStatus)
+wchar_t* GetProtoStatusMessage(char *szProto, WORD wStatus)
{
if (!szProto || wStatus == ID_STATUS_OFFLINE)
return NULL;
@@ -694,9 +694,9 @@ TCHAR* GetProtoStatusMessage(char *szProto, WORD wStatus)
if (!(flags & Proto_Status2Flag(wStatus)))
return NULL;
- TCHAR *ptszText = (TCHAR *)CallProtoService(szProto, PS_GETMYAWAYMSG, 0, SGMA_TCHAR);
+ wchar_t *ptszText = (wchar_t *)CallProtoService(szProto, PS_GETMYAWAYMSG, 0, SGMA_TCHAR);
if ((INT_PTR)ptszText == CALLSERVICE_NOTFOUND)
- ptszText = (TCHAR *)CallService(MS_AWAYMSG_GETSTATUSMSGT, wStatus, (LPARAM)szProto);
+ ptszText = (wchar_t *)CallService(MS_AWAYMSG_GETSTATUSMSGT, wStatus, (LPARAM)szProto);
else if (ptszText == NULL) {
// try to use service without SGMA_TCHAR
@@ -719,14 +719,14 @@ TCHAR* GetProtoStatusMessage(char *szProto, WORD wStatus)
return ptszText;
}
-TCHAR* GetProtoExtraStatusTitle(char *szProto)
+wchar_t* GetProtoExtraStatusTitle(char *szProto)
{
if (!szProto)
return NULL;
- TCHAR *ptszText = db_get_tsa(0, szProto, "XStatusName");
+ wchar_t *ptszText = db_get_tsa(0, szProto, "XStatusName");
if (!ptszText) {
- TCHAR buff[256];
+ wchar_t buff[256];
if (EmptyXStatusToDefaultName(0, szProto, 0, buff, 256))
ptszText = mir_tstrdup(buff);
}
@@ -737,12 +737,12 @@ TCHAR* GetProtoExtraStatusTitle(char *szProto)
return ptszText;
}
-TCHAR* GetProtoExtraStatusMessage(char *szProto)
+wchar_t* GetProtoExtraStatusMessage(char *szProto)
{
if (!szProto)
return NULL;
- TCHAR *ptszText = db_get_tsa(0, szProto, "XStatusMsg");
+ wchar_t *ptszText = db_get_tsa(0, szProto, "XStatusMsg");
if (ptszText == NULL)
return NULL;
@@ -759,7 +759,7 @@ TCHAR* GetProtoExtraStatusMessage(char *szProto)
}
}
- TCHAR *tszParsed = variables_parse(ptszText, NULL, hContact);
+ wchar_t *tszParsed = variables_parse(ptszText, NULL, hContact);
if (tszParsed)
{
mir_free(ptszText);
@@ -773,26 +773,26 @@ TCHAR* GetProtoExtraStatusMessage(char *szProto)
return ptszText;
}
-TCHAR* GetListeningTo(char *szProto)
+wchar_t* GetListeningTo(char *szProto)
{
if (!szProto)
return NULL;
- TCHAR *ptszText = db_get_tsa(0, szProto, "ListeningTo");
+ wchar_t *ptszText = db_get_tsa(0, szProto, "ListeningTo");
if (opt.bLimitMsg)
TruncateString(ptszText);
return ptszText;
}
-TCHAR* GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *szValue)
+wchar_t* GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *szValue)
{
if (!szProto)
return NULL;
char szSetting[128];
mir_snprintf(szSetting, "%s/%s/%s", szProto, szSlot, szValue);
- TCHAR *ptszText = db_get_tsa(0, "AdvStatus", szSetting);
+ wchar_t *ptszText = db_get_tsa(0, "AdvStatus", szSetting);
if (opt.bLimitMsg)
TruncateString(ptszText);
diff --git a/plugins/TipperYM/src/subst.h b/plugins/TipperYM/src/subst.h
index 66b5712462..888ca5b9cb 100644
--- a/plugins/TipperYM/src/subst.h
+++ b/plugins/TipperYM/src/subst.h
@@ -21,25 +21,25 @@ Boston, MA 02111-1307, USA.
#ifndef _SUBST_INC
#define _SUBST_INC
-bool GetLabelText(MCONTACT hContact, const DISPLAYITEM &di, TCHAR *buff, size_t iBufflen);
-bool GetValueText(MCONTACT hContact, const DISPLAYITEM &di, TCHAR *buff, size_t iBufflen);
+bool GetLabelText(MCONTACT hContact, const DISPLAYITEM &di, wchar_t *buff, size_t iBufflen);
+bool GetValueText(MCONTACT hContact, const DISPLAYITEM &di, wchar_t *buff, size_t iBufflen);
bool CheckContactType(MCONTACT hContact, const DISPLAYITEM &di);
-void StripBBCodesInPlace(TCHAR *text);
+void StripBBCodesInPlace(wchar_t *text);
// can be used with hContact == 0 to get uid for a given proto
-bool UidName(char *szProto, TCHAR *buff, int bufflen);
-bool Uid(MCONTACT hContact, char *szProto, TCHAR *buff, int bufflen);
+bool UidName(char *szProto, wchar_t *buff, int bufflen);
+bool Uid(MCONTACT hContact, char *szProto, wchar_t *buff, int bufflen);
// get info for status and tray tooltip
-bool DBGetContactSettingAsString(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
+bool DBGetContactSettingAsString(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen);
bool CanRetrieveStatusMsg(MCONTACT hContact, char *szProto);
-TCHAR *GetProtoStatusMessage(char *szProto, WORD status);
-TCHAR *GetProtoExtraStatusTitle(char *szProto);
-TCHAR *GetProtoExtraStatusMessage(char *szProto);
-TCHAR *GetListeningTo(char *szProto);
-TCHAR *GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *szValue);
+wchar_t *GetProtoStatusMessage(char *szProto, WORD status);
+wchar_t *GetProtoExtraStatusTitle(char *szProto);
+wchar_t *GetProtoExtraStatusMessage(char *szProto);
+wchar_t *GetListeningTo(char *szProto);
+wchar_t *GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *szValue);
HICON GetJabberActivityIcon(MCONTACT hContact, char *szProto);
#endif
diff --git a/plugins/TipperYM/src/tipper.cpp b/plugins/TipperYM/src/tipper.cpp
index 125867150e..770d1348ce 100644
--- a/plugins/TipperYM/src/tipper.cpp
+++ b/plugins/TipperYM/src/tipper.cpp
@@ -33,7 +33,7 @@ HANDLE hShowTipService, hShowTipWService, hHideTipService;
HANDLE hReloadFonts = NULL;
HANDLE hFolderChanged, hSkinFolder;
-TCHAR SKIN_FOLDER[256];
+wchar_t SKIN_FOLDER[256];
CLIST_INTERFACE *pcli = NULL;
FI_INTERFACE *fii = NULL;
@@ -117,15 +117,15 @@ int EventDeleted(WPARAM wParam, LPARAM lParam)
int ReloadSkinFolder(WPARAM, LPARAM)
{
- FoldersGetCustomPathT(hSkinFolder, SKIN_FOLDER, _countof(SKIN_FOLDER), _T(DEFAULT_SKIN_FOLDER));
+ FoldersGetCustomPathT(hSkinFolder, SKIN_FOLDER, _countof(SKIN_FOLDER), DEFAULT_SKIN_FOLDER);
return 0;
}
void InitFonts()
{
colourBg.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colourBg.group, LPGENT("Tooltips"));
- mir_tstrcpy(colourBg.name, LPGENT("Background"));
+ mir_tstrcpy(colourBg.group, LPGENW("Tooltips"));
+ mir_tstrcpy(colourBg.name, LPGENW("Background"));
mir_strcpy(colourBg.dbSettingsGroup, MODULE);
mir_strcpy(colourBg.setting, "ColourBg");
colourBg.defcolour = RGB(219, 219, 219);
@@ -133,8 +133,8 @@ void InitFonts()
ColourRegisterT(&colourBg);
colourBorder.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colourBorder.group, LPGENT("Tooltips"));
- mir_tstrcpy(colourBorder.name, LPGENT("Border"));
+ mir_tstrcpy(colourBorder.group, LPGENW("Tooltips"));
+ mir_tstrcpy(colourBorder.name, LPGENW("Border"));
mir_strcpy(colourBorder.dbSettingsGroup, MODULE);
mir_strcpy(colourBorder.setting, "BorderCol");
colourBorder.defcolour = 0;
@@ -142,8 +142,8 @@ void InitFonts()
ColourRegisterT(&colourBorder);
colourAvatarBorder.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colourAvatarBorder.group, LPGENT("Tooltips"));
- mir_tstrcpy(colourAvatarBorder.name, LPGENT("Avatar border"));
+ mir_tstrcpy(colourAvatarBorder.group, LPGENW("Tooltips"));
+ mir_tstrcpy(colourAvatarBorder.name, LPGENW("Avatar border"));
mir_strcpy(colourAvatarBorder.dbSettingsGroup, MODULE);
mir_strcpy(colourAvatarBorder.setting, "AvBorderCol");
colourAvatarBorder.defcolour = 0;
@@ -151,8 +151,8 @@ void InitFonts()
ColourRegisterT(&colourAvatarBorder);
colourDivider.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colourDivider.group, LPGENT("Tooltips"));
- mir_tstrcpy(colourDivider.name, LPGENT("Dividers"));
+ mir_tstrcpy(colourDivider.group, LPGENW("Tooltips"));
+ mir_tstrcpy(colourDivider.name, LPGENW("Dividers"));
mir_strcpy(colourDivider.dbSettingsGroup, MODULE);
mir_strcpy(colourDivider.setting, "DividerCol");
colourDivider.defcolour = 0;
@@ -160,8 +160,8 @@ void InitFonts()
ColourRegisterT(&colourDivider);
colourSidebar.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colourSidebar.group, LPGENT("Tooltips"));
- mir_tstrcpy(colourSidebar.name, LPGENT("Sidebar"));
+ mir_tstrcpy(colourSidebar.group, LPGENW("Tooltips"));
+ mir_tstrcpy(colourSidebar.name, LPGENW("Sidebar"));
mir_strcpy(colourSidebar.dbSettingsGroup, MODULE);
mir_strcpy(colourSidebar.setting, "SidebarCol");
colourSidebar.defcolour = RGB(192, 192, 192);
@@ -170,12 +170,12 @@ void InitFonts()
fontTitle.cbSize = sizeof(FontIDT);
fontTitle.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(fontTitle.group, LPGENT("Tooltips"));
- mir_tstrcpy(fontTitle.name, LPGENT("Title"));
+ mir_tstrcpy(fontTitle.group, LPGENW("Tooltips"));
+ mir_tstrcpy(fontTitle.name, LPGENW("Title"));
mir_strcpy(fontTitle.dbSettingsGroup, MODULE);
mir_strcpy(fontTitle.prefix, "FontFirst");
- mir_tstrcpy(fontTitle.backgroundGroup, LPGENT("Tooltips"));
- mir_tstrcpy(fontTitle.backgroundName, LPGENT("Background"));
+ mir_tstrcpy(fontTitle.backgroundGroup, LPGENW("Tooltips"));
+ mir_tstrcpy(fontTitle.backgroundName, LPGENW("Background"));
fontTitle.order = 0;
fontTitle.deffontsettings.charset = DEFAULT_CHARSET;
@@ -186,12 +186,12 @@ void InitFonts()
fontLabels.cbSize = sizeof(FontIDT);
fontLabels.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(fontLabels.group, LPGENT("Tooltips"));
- mir_tstrcpy(fontLabels.name, LPGENT("Labels"));
+ mir_tstrcpy(fontLabels.group, LPGENW("Tooltips"));
+ mir_tstrcpy(fontLabels.name, LPGENW("Labels"));
mir_strcpy(fontLabels.dbSettingsGroup, MODULE);
mir_strcpy(fontLabels.prefix, "FontLabels");
- mir_tstrcpy(fontLabels.backgroundGroup, LPGENT("Tooltips"));
- mir_tstrcpy(fontLabels.backgroundName, LPGENT("Background"));
+ mir_tstrcpy(fontLabels.backgroundGroup, LPGENW("Tooltips"));
+ mir_tstrcpy(fontLabels.backgroundName, LPGENW("Background"));
fontLabels.order = 1;
fontLabels.deffontsettings.charset = DEFAULT_CHARSET;
@@ -202,12 +202,12 @@ void InitFonts()
fontValues.cbSize = sizeof(FontIDT);
fontValues.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(fontValues.group, LPGENT("Tooltips"));
- mir_tstrcpy(fontValues.name, LPGENT("Values"));
+ mir_tstrcpy(fontValues.group, LPGENW("Tooltips"));
+ mir_tstrcpy(fontValues.name, LPGENW("Values"));
mir_strcpy(fontValues.dbSettingsGroup, MODULE);
mir_strcpy(fontValues.prefix, "FontValues");
- mir_tstrcpy(fontValues.backgroundGroup, LPGENT("Tooltips"));
- mir_tstrcpy(fontValues.backgroundName, LPGENT("Background"));
+ mir_tstrcpy(fontValues.backgroundGroup, LPGENW("Tooltips"));
+ mir_tstrcpy(fontValues.backgroundName, LPGENW("Background"));
fontValues.order = 2;
fontValues.deffontsettings.charset = DEFAULT_CHARSET;
@@ -218,12 +218,12 @@ void InitFonts()
fontTrayTitle.cbSize = sizeof(FontIDT);
fontTrayTitle.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(fontTrayTitle.group, LPGENT("Tooltips"));
- mir_tstrcpy(fontTrayTitle.name, LPGENT("Tray title"));
+ mir_tstrcpy(fontTrayTitle.group, LPGENW("Tooltips"));
+ mir_tstrcpy(fontTrayTitle.name, LPGENW("Tray title"));
mir_strcpy(fontTrayTitle.dbSettingsGroup, MODULE);
mir_strcpy(fontTrayTitle.prefix, "FontTrayTitle");
- mir_tstrcpy(fontTrayTitle.backgroundGroup, LPGENT("Tooltips"));
- mir_tstrcpy(fontTrayTitle.backgroundName, LPGENT("Background"));
+ mir_tstrcpy(fontTrayTitle.backgroundGroup, LPGENW("Tooltips"));
+ mir_tstrcpy(fontTrayTitle.backgroundName, LPGENW("Background"));
fontTrayTitle.order = 0;
fontTrayTitle.deffontsettings.charset = DEFAULT_CHARSET;
@@ -254,8 +254,8 @@ int ModulesLoaded(WPARAM, LPARAM)
hFolderChanged = HookEvent(ME_FOLDERS_PATH_CHANGED, ReloadSkinFolder);
- hSkinFolder = FoldersRegisterCustomPathT(LPGEN("Skins"), LPGEN("Tipper"), MIRANDA_PATHT L"\\" _T(DEFAULT_SKIN_FOLDER));
- FoldersGetCustomPathT(hSkinFolder, SKIN_FOLDER, _countof(SKIN_FOLDER), _T(DEFAULT_SKIN_FOLDER));
+ hSkinFolder = FoldersRegisterCustomPathT(LPGEN("Skins"), LPGEN("Tipper"), MIRANDA_PATHT L"\\" DEFAULT_SKIN_FOLDER);
+ FoldersGetCustomPathT(hSkinFolder, SKIN_FOLDER, _countof(SKIN_FOLDER), DEFAULT_SKIN_FOLDER);
InitTipperSmileys();
LoadOptions();
@@ -298,7 +298,7 @@ static INT_PTR ReloadSkin(WPARAM wParam, LPARAM lParam)
LoadOptions();
opt.skinMode = (SkinMode)wParam;
if (lParam != 0)
- _tcscpy_s(opt.szSkinName, _A2T((char*)(lParam)));
+ wcscpy_s(opt.szSkinName, _A2T((char*)(lParam)));
ParseSkinFile(opt.szSkinName, false, false);
ReloadFont(0, 0);
SaveOptions();
diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp
index b89c3c2b07..87679f08a7 100644
--- a/plugins/TipperYM/src/translations.cpp
+++ b/plugins/TipperYM/src/translations.cpp
@@ -63,14 +63,14 @@ void AddTranslation(DBVTranslation *newTrans)
mir_free(szName);
}
-TCHAR *NullTranslation(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *NullTranslation(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
if (DBGetContactSettingAsString(hContact, szModuleName, szSettingName, buff, bufflen))
return buff;
return NULL;
}
-TCHAR* TimestampToShortDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t* TimestampToShortDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0)
@@ -79,7 +79,7 @@ TCHAR* TimestampToShortDate(MCONTACT hContact, const char *szModuleName, const c
return TimeZone_ToStringT(ts, L"d", buff, bufflen);
}
-TCHAR* TimestampToLongDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t* TimestampToLongDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0)
@@ -88,7 +88,7 @@ TCHAR* TimestampToLongDate(MCONTACT hContact, const char *szModuleName, const ch
return TimeZone_ToStringT(ts, L"D", buff, bufflen);
}
-TCHAR* TimestampToTime(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t* TimestampToTime(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0)
@@ -97,7 +97,7 @@ TCHAR* TimestampToTime(MCONTACT hContact, const char *szModuleName, const char *
return TimeZone_ToStringT(ts, L"s", buff, bufflen);
}
-TCHAR* TimestampToTimeNoSecs(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t* TimestampToTimeNoSecs(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0)
@@ -106,7 +106,7 @@ TCHAR* TimestampToTimeNoSecs(MCONTACT hContact, const char *szModuleName, const
return TimeZone_ToStringT(ts, L"t", buff, bufflen);
}
-TCHAR* TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t* TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
DWORD t = (DWORD)time(0);
@@ -126,7 +126,7 @@ TCHAR* TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName, co
return buff;
}
-TCHAR *SecondsToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *SecondsToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD diff = db_get_dw(hContact, szModuleName, szSettingName, 0);
int d = (diff / 60 / 60 / 24);
@@ -142,15 +142,15 @@ TCHAR *SecondsToTimeDifference(MCONTACT hContact, const char *szModuleName, cons
return buff;
}
-TCHAR *WordToStatusDesc(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *WordToStatusDesc(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
WORD wStatus = db_get_w(hContact, szModuleName, szSettingName, ID_STATUS_OFFLINE);
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(wStatus, 0);
- _tcsncpy_s(buff, bufflen, szStatus, _TRUNCATE);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(wStatus, 0);
+ wcsncpy_s(buff, bufflen, szStatus, _TRUNCATE);
return buff;
}
-TCHAR *ByteToYesNo(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *ByteToYesNo(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
@@ -158,9 +158,9 @@ TCHAR *ByteToYesNo(MCONTACT hContact, const char *szModuleName, const char *szSe
if (dbv.type == DBVT_BYTE)
{
if (dbv.bVal != 0)
- _tcsncpy(buff, L"Yes", bufflen);
+ wcsncpy(buff, L"Yes", bufflen);
else
- _tcsncpy(buff, L"No", bufflen);
+ wcsncpy(buff, L"No", bufflen);
buff[bufflen - 1] = 0;
db_free(&dbv);
return buff;
@@ -170,13 +170,13 @@ TCHAR *ByteToYesNo(MCONTACT hContact, const char *szModuleName, const char *szSe
return 0;
}
-TCHAR *ByteToGender(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *ByteToGender(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
BYTE val = (BYTE)db_get_b(hContact, szModuleName, szSettingName, 0);
if (val == 'F')
- _tcsncpy(buff, TranslateT("Female"), bufflen);
+ wcsncpy(buff, TranslateT("Female"), bufflen);
else if (val == 'M')
- _tcsncpy(buff, TranslateT("Male"), bufflen);
+ wcsncpy(buff, TranslateT("Male"), bufflen);
else
return 0;
@@ -184,7 +184,7 @@ TCHAR *ByteToGender(MCONTACT hContact, const char *szModuleName, const char *szS
return buff;
}
-TCHAR *WordToCountry(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *WordToCountry(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
char *szCountryName = 0;
WORD cid = (WORD)db_get_w(hContact, szModuleName, szSettingName, (WORD)-1);
@@ -199,7 +199,7 @@ TCHAR *WordToCountry(MCONTACT hContact, const char *szModuleName, const char *sz
return 0;
}
-TCHAR *DwordToIp(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *DwordToIp(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD ip = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ip) {
@@ -229,7 +229,7 @@ bool GetInt(const DBVARIANT &dbv, int *iVal)
return false;
}
-TCHAR *DayMonthYearToDate(MCONTACT hContact, const char *szModuleName, const char *prefix, TCHAR *buff, int bufflen)
+wchar_t *DayMonthYearToDate(MCONTACT hContact, const char *szModuleName, const char *prefix, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -259,7 +259,7 @@ TCHAR *DayMonthYearToDate(MCONTACT hContact, const char *szModuleName, const cha
time.tm_mon = month - 1;
time.tm_year = year - 1900;
- _tcsftime(buff, bufflen, L"%x", &time);
+ wcsftime(buff, bufflen, L"%x", &time);
return buff;
@@ -274,7 +274,7 @@ TCHAR *DayMonthYearToDate(MCONTACT hContact, const char *szModuleName, const cha
return 0;
}
-TCHAR *DayMonthYearToAge(MCONTACT hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+wchar_t *DayMonthYearToAge(MCONTACT hContact, const char *szModuleName, const char *szPrefix, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -323,7 +323,7 @@ TCHAR *DayMonthYearToAge(MCONTACT hContact, const char *szModuleName, const char
return 0;
}
-TCHAR *HoursMinutesSecondsToTime(MCONTACT hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+wchar_t *HoursMinutesSecondsToTime(MCONTACT hContact, const char *szModuleName, const char *szPrefix, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -367,7 +367,7 @@ TCHAR *HoursMinutesSecondsToTime(MCONTACT hContact, const char *szModuleName, co
return 0;
}
-TCHAR *HoursMinutesToTime(MCONTACT hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+wchar_t *HoursMinutesToTime(MCONTACT hContact, const char *szModuleName, const char *szPrefix, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -403,7 +403,7 @@ TCHAR *HoursMinutesToTime(MCONTACT hContact, const char *szModuleName, const cha
return 0;
}
-TCHAR *DmyToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+wchar_t *DmyToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szPrefix, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -505,7 +505,7 @@ TCHAR *DmyToTimeDifference(MCONTACT hContact, const char *szModuleName, const ch
return 0;
}
-TCHAR *DayMonthToDaysToNextBirthday(MCONTACT hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+wchar_t *DayMonthToDaysToNextBirthday(MCONTACT hContact, const char *szModuleName, const char *szPrefix, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -558,9 +558,9 @@ TCHAR *DayMonthToDaysToNextBirthday(MCONTACT hContact, const char *szModuleName,
}
-TCHAR *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
- TCHAR szDefaultName[1024];
+ wchar_t szDefaultName[1024];
CUSTOM_STATUS xstatus = {0};
DBVARIANT dbv;
@@ -569,7 +569,7 @@ TCHAR *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, co
{
if (!db_get_ts(hContact, szModuleName, szSettingName, &dbv))
{
- _tcsncpy(buff, TranslateTS(dbv.ptszVal), bufflen);
+ wcsncpy(buff, TranslateTS(dbv.ptszVal), bufflen);
buff[bufflen - 1] = 0;
return buff;
}
@@ -590,7 +590,7 @@ TCHAR *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, co
if (CallProtoService(szModuleName, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus))
return 0;
- _tcsncpy(buff, TranslateTS(szDefaultName), bufflen);
+ wcsncpy(buff, TranslateTS(szDefaultName), bufflen);
buff[bufflen - 1] = 0;
return buff;
}
@@ -598,7 +598,7 @@ TCHAR *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, co
return 0;
}
-TCHAR *TimezoneToTime(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *TimezoneToTime(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
int timezone = db_get_b(hContact,szModuleName,szSettingName,256);
if (timezone==256 || (char)timezone==-100)
@@ -623,7 +623,7 @@ TCHAR *TimezoneToTime(MCONTACT hContact, const char *szModuleName, const char *s
return buff;
}
-TCHAR *ByteToDay(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *ByteToDay(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
int iDay = db_get_w(hContact, szModuleName, szSettingName, -1);
if (iDay > -1 && iDay < 7)
@@ -636,7 +636,7 @@ TCHAR *ByteToDay(MCONTACT hContact, const char *szModuleName, const char *szSett
return 0;
}
-TCHAR *ByteToMonth(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *ByteToMonth(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
int iMonth = db_get_w(hContact, szModuleName, szSettingName, 0);
if (iMonth > 0 && iMonth < 13)
@@ -649,7 +649,7 @@ TCHAR *ByteToMonth(MCONTACT hContact, const char *szModuleName, const char *szSe
return 0;
}
-TCHAR *ByteToLanguage(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *ByteToLanguage(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
int iLang = db_get_b(hContact, szModuleName, szSettingName, 0);
if (iLang)
@@ -680,29 +680,29 @@ INT_PTR ServiceAddTranslation(WPARAM, LPARAM lParam)
static DBVTranslation internalTranslations[] =
{
- { NullTranslation, LPGENT("[No translation]") },
- { WordToStatusDesc, LPGENT("WORD to status description") },
- { TimestampToTime, LPGENT("DWORD timestamp to time") },
- { TimestampToTimeDifference, LPGENT("DWORD timestamp to time difference") },
- { ByteToYesNo, LPGENT("BYTE to Yes/No") },
- { ByteToGender, LPGENT("BYTE to Male/Female (ICQ)") },
- { WordToCountry, LPGENT("WORD to country name") },
- { DwordToIp, LPGENT("DWORD to IP address") },
- { DayMonthYearToDate, LPGENT("<prefix>Day|Month|Year to date") },
- { DayMonthYearToAge, LPGENT("<prefix>Day|Month|Year to age") },
- { HoursMinutesSecondsToTime, LPGENT("<prefix>Hours|Minutes|Seconds to time") },
- { DmyToTimeDifference, LPGENT("<prefix>Day|Month|Year|Hours|Minutes|Seconds to time difference") },
- { DayMonthToDaysToNextBirthday, LPGENT("<prefix>Day|Month to days to next birthday") },
- { TimestampToTimeNoSecs, LPGENT("DWORD timestamp to time (no seconds)") },
- { HoursMinutesToTime, LPGENT("<prefix>Hours|Minutes to time") },
- { TimestampToShortDate, LPGENT("DWORD timestamp to date (short)") },
- { TimestampToLongDate, LPGENT("DWORD timestamp to date (long)") },
- { EmptyXStatusToDefaultName, LPGENT("xStatus: empty xStatus name to default name") },
- { SecondsToTimeDifference, LPGENT("DWORD seconds to time difference") },
- { TimezoneToTime, LPGENT("BYTE timezone to time") },
- { ByteToDay, LPGENT("WORD to name of a day (0..6, 0 is Sunday)") },
- { ByteToMonth, LPGENT("WORD to name of a month (1..12, 1 is January)") },
- { ByteToLanguage, LPGENT("BYTE to language (ICQ)") },
+ { NullTranslation, LPGENW("[No translation]") },
+ { WordToStatusDesc, LPGENW("WORD to status description") },
+ { TimestampToTime, LPGENW("DWORD timestamp to time") },
+ { TimestampToTimeDifference, LPGENW("DWORD timestamp to time difference") },
+ { ByteToYesNo, LPGENW("BYTE to Yes/No") },
+ { ByteToGender, LPGENW("BYTE to Male/Female (ICQ)") },
+ { WordToCountry, LPGENW("WORD to country name") },
+ { DwordToIp, LPGENW("DWORD to IP address") },
+ { DayMonthYearToDate, LPGENW("<prefix>Day|Month|Year to date") },
+ { DayMonthYearToAge, LPGENW("<prefix>Day|Month|Year to age") },
+ { HoursMinutesSecondsToTime, LPGENW("<prefix>Hours|Minutes|Seconds to time") },
+ { DmyToTimeDifference, LPGENW("<prefix>Day|Month|Year|Hours|Minutes|Seconds to time difference") },
+ { DayMonthToDaysToNextBirthday, LPGENW("<prefix>Day|Month to days to next birthday") },
+ { TimestampToTimeNoSecs, LPGENW("DWORD timestamp to time (no seconds)") },
+ { HoursMinutesToTime, LPGENW("<prefix>Hours|Minutes to time") },
+ { TimestampToShortDate, LPGENW("DWORD timestamp to date (short)") },
+ { TimestampToLongDate, LPGENW("DWORD timestamp to date (long)") },
+ { EmptyXStatusToDefaultName, LPGENW("xStatus: empty xStatus name to default name") },
+ { SecondsToTimeDifference, LPGENW("DWORD seconds to time difference") },
+ { TimezoneToTime, LPGENW("BYTE timezone to time") },
+ { ByteToDay, LPGENW("WORD to name of a day (0..6, 0 is Sunday)") },
+ { ByteToMonth, LPGENW("WORD to name of a month (1..12, 1 is January)") },
+ { ByteToLanguage, LPGENW("BYTE to language (ICQ)") },
};
void InitTranslations()
diff --git a/plugins/TipperYM/src/translations.h b/plugins/TipperYM/src/translations.h
index 1ed2e8f53e..d981a2601c 100644
--- a/plugins/TipperYM/src/translations.h
+++ b/plugins/TipperYM/src/translations.h
@@ -117,9 +117,9 @@ static char *months[12] = {
void InitTranslations();
void DeinitTranslations();
-TCHAR *TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
-TCHAR *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
-TCHAR *WordToStatusDesc(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
+wchar_t *TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen);
+wchar_t *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen);
+wchar_t *WordToStatusDesc(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen);
#endif