summaryrefslogtreecommitdiff
path: root/plugins/Clist_blind/src/init.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Clist_blind/src/init.cpp')
-rw-r--r--plugins/Clist_blind/src/init.cpp82
1 files changed, 41 insertions, 41 deletions
diff --git a/plugins/Clist_blind/src/init.cpp b/plugins/Clist_blind/src/init.cpp
index 2bc79bdbed..30ccfa6c0c 100644
--- a/plugins/Clist_blind/src/init.cpp
+++ b/plugins/Clist_blind/src/init.cpp
@@ -176,11 +176,11 @@ extern "C" int __declspec(dllexport) Unload(void)
/////////////////////////////////////////////////////////////////////////////////////////
-TCHAR* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char* setting, TCHAR* out, size_t len, TCHAR *def)
+wchar_t* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char* setting, wchar_t* out, size_t len, wchar_t *def)
{
DBVARIANT dbv;
- out[0] = _T('\0');
+ out[0] = '\0';
if (!db_get_ts(hContact, module, setting, &dbv)) {
if (dbv.type == DBVT_ASCIIZ)
@@ -206,13 +206,13 @@ TCHAR* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char* setti
typedef struct
{
- TCHAR *text;
+ wchar_t *text;
size_t allocated;
size_t used;
} StringHelper;
-int CopyData(StringHelper *str, const TCHAR *text, size_t len)
+int CopyData(StringHelper *str, const wchar_t *text, size_t len)
{
size_t totalSize;
@@ -228,7 +228,7 @@ int CopyData(StringHelper *str, const TCHAR *text, size_t len)
totalSize += DATA_BLOCK - (totalSize % DATA_BLOCK);
if (str->text != NULL) {
- TCHAR *tmp = (TCHAR *)mir_realloc(str->text, sizeof(TCHAR) * totalSize);
+ wchar_t *tmp = (wchar_t *)mir_realloc(str->text, sizeof(wchar_t) * totalSize);
if (tmp == NULL) {
mir_free(str->text);
@@ -238,7 +238,7 @@ int CopyData(StringHelper *str, const TCHAR *text, size_t len)
str->text = tmp;
}
else {
- str->text = (TCHAR *)mir_alloc(sizeof(TCHAR) * totalSize);
+ str->text = (wchar_t *)mir_alloc(sizeof(wchar_t) * totalSize);
if (str->text == NULL) {
return -2;
@@ -248,7 +248,7 @@ int CopyData(StringHelper *str, const TCHAR *text, size_t len)
str->allocated = totalSize;
}
- memmove(&str->text[str->used], text, sizeof(TCHAR) * len);
+ memmove(&str->text[str->used], text, sizeof(wchar_t) * len);
str->used += len;
str->text[str->used] = '\0';
@@ -256,9 +256,9 @@ int CopyData(StringHelper *str, const TCHAR *text, size_t len)
}
-TCHAR * ParseText(const TCHAR *text,
- const TCHAR **variables, size_t variablesSize,
- const TCHAR **data, size_t dataSize)
+wchar_t * ParseText(const wchar_t *text,
+ const wchar_t **variables, size_t variablesSize,
+ const wchar_t **data, size_t dataSize)
{
size_t length = mir_tstrlen(text);
size_t nextPos = 0;
@@ -267,13 +267,13 @@ TCHAR * ParseText(const TCHAR *text,
// length - 1 because a % in last char will be a % and point
for (i = 0; i < length - 1; i++) {
- if (text[i] == _T('%')) {
+ if (text[i] == '%') {
BOOL found = FALSE;
if (CopyData(&ret, &text[nextPos], i - nextPos))
return NULL;
- if (text[i + 1] == _T('%')) {
+ if (text[i + 1] == '%') {
if (CopyData(&ret, L"%", 1))
return NULL;
@@ -289,7 +289,7 @@ TCHAR * ParseText(const TCHAR *text,
for (j = 0; j < size; j++) {
size_t vlen = mir_tstrlen(variables[j]);
- if (_tcsnicmp(&text[i], variables[j], vlen) == 0) {
+ if (wcsnicmp(&text[i], variables[j], vlen) == 0) {
if (CopyData(&ret, data[j], mir_tstrlen(data[j])))
return NULL;
@@ -407,18 +407,18 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
return coreCli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
}
-TCHAR status_name[128];
-TCHAR* GetStatusName(struct ClcContact *item)
+wchar_t status_name[128];
+wchar_t* GetStatusName(struct ClcContact *item)
{
int status;
- status_name[0] = _T('\0');
+ status_name[0] = '\0';
if (item->hContact == NULL || item->proto == NULL)
return status_name;
// Get XStatusName
MyDBGetContactSettingTString(item->hContact, item->proto, "XStatusName", status_name, _countof(status_name), NULL);
- if (status_name[0] != _T('\0'))
+ if (status_name[0] != '\0')
return status_name;
// Get status name
@@ -429,16 +429,16 @@ TCHAR* GetStatusName(struct ClcContact *item)
}
-TCHAR status_message[256];
-TCHAR* GetStatusMessage(struct ClcContact *item)
+wchar_t status_message[256];
+wchar_t* GetStatusMessage(struct ClcContact *item)
{
- status_message[0] = _T('\0');
+ status_message[0] = '\0';
if (item->hContact == NULL || item->proto == NULL)
return status_message;
// Get XStatusMsg
MyDBGetContactSettingTString(item->hContact, item->proto, "XStatusMsg", status_message, _countof(status_message), NULL);
- if (status_message[0] != _T('\0'))
+ if (status_message[0] != '\0')
return status_message;
// Get status message
@@ -448,8 +448,8 @@ TCHAR* GetStatusMessage(struct ClcContact *item)
}
-TCHAR proto_name[128];
-TCHAR* GetProtoName(struct ClcContact *item)
+wchar_t proto_name[128];
+wchar_t* GetProtoName(struct ClcContact *item)
{
#ifdef UNICODE
char description[128];
@@ -480,12 +480,12 @@ TCHAR* GetProtoName(struct ClcContact *item)
void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig)
{
ClcData *dat = (ClcData*)tmp_dat;
- TCHAR tmp[1024];
- TCHAR count[128];
- TCHAR template_contact[1024];
- TCHAR template_group[1024];
- TCHAR template_divider[1024];
- TCHAR template_info[1024];
+ wchar_t tmp[1024];
+ wchar_t count[128];
+ wchar_t template_contact[1024];
+ wchar_t template_group[1024];
+ wchar_t template_divider[1024];
+ wchar_t template_info[1024];
int selection = dat->selection;
BOOL has_focus = (GetFocus() == dat->hwnd_list || GetFocus() == hwnd);
@@ -509,7 +509,7 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig)
ClcGroup *group = &dat->list;
group->scanIndex = 0;
- TCHAR *text = tmp;
+ wchar_t *text = tmp;
size_t size = _countof(tmp);
while (true) {
if (group->scanIndex == group->cl.getCount()) {
@@ -522,17 +522,17 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig)
}
ClcContact *item = group->cl[group->scanIndex];
- text[0] = _T('\0');
+ text[0] = '\0';
switch (item->type) {
case CLCIT_GROUP:
{
- TCHAR *szCounts = pcli->pfnGetGroupCountsText(dat, item);
- const TCHAR *t[] = {
+ wchar_t *szCounts = pcli->pfnGetGroupCountsText(dat, item);
+ const wchar_t *t[] = {
L"%name%",
L"%count%",
L"%mode%"
};
- const TCHAR *v[] = {
+ const wchar_t *v[] = {
item->szText,
count,
item->group->expanded ? TranslateT("Expanded") : TranslateT("Collapsed")
@@ -541,9 +541,9 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig)
if (szCounts[0] != '\0')
mir_sntprintf(count, L"%s ", szCounts);
else
- count[0] = _T('\0');
+ count[0] = '\0';
- TCHAR *txt = ParseText(template_group, t, _countof(t), v, _countof(v));
+ wchar_t *txt = ParseText(template_group, t, _countof(t), v, _countof(v));
if (txt != NULL)
mir_tstrncpy(text, txt, size);
mir_free(txt);
@@ -552,20 +552,20 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig)
case CLCIT_CONTACT:
{
- const TCHAR *t[] = {
+ const wchar_t *t[] = {
L"%name%",
L"%status%",
L"%protocol%",
L"%status_message%"
};
- const TCHAR *v[] = {
+ const wchar_t *v[] = {
item->szText,
GetStatusName(item),
GetProtoName(item),
GetStatusMessage(item)
};
- TCHAR *txt = ParseText(template_contact, t, _countof(t), v, _countof(v));
+ wchar_t *txt = ParseText(template_contact, t, _countof(t), v, _countof(v));
if (txt != NULL)
mir_tstrncpy(text, txt, size);
mir_free(txt);
@@ -585,8 +585,8 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig)
if (item->type == CLCIT_GROUP && item->group->expanded) {
group = item->group;
- text[0] = _T(' ');
- text[1] = _T(' ');
+ text[0] = ' ';
+ text[1] = ' ';
text += 2;
size -= 2;
group->scanIndex = 0;