summaryrefslogtreecommitdiff
path: root/plugins/Clist_nicer
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Clist_nicer')
-rw-r--r--plugins/Clist_nicer/INCLUDE/clist.h8
-rw-r--r--plugins/Clist_nicer/SRC/clc.cpp8
-rw-r--r--plugins/Clist_nicer/SRC/clcitems.cpp19
-rw-r--r--plugins/Clist_nicer/SRC/clcpaint.cpp19
-rw-r--r--plugins/Clist_nicer/SRC/clcutils.cpp6
-rw-r--r--plugins/Clist_nicer/SRC/clistevents.cpp6
-rw-r--r--plugins/Clist_nicer/SRC/clui.cpp21
-rw-r--r--plugins/Clist_nicer/SRC/extBackg.cpp23
-rw-r--r--plugins/Clist_nicer/SRC/init.cpp10
-rw-r--r--plugins/Clist_nicer/skineditor/skinedit.rc18
10 files changed, 41 insertions, 97 deletions
diff --git a/plugins/Clist_nicer/INCLUDE/clist.h b/plugins/Clist_nicer/INCLUDE/clist.h
index a4d956ba3c..79f0a29ec8 100644
--- a/plugins/Clist_nicer/INCLUDE/clist.h
+++ b/plugins/Clist_nicer/INCLUDE/clist.h
@@ -47,10 +47,4 @@ void SortContacts(void);
#define CLVM_INCLUDED_UNGROUPED 8
#define CLVM_USELASTMSG 16
-#if defined(_UNICODE)
- #define CLVM_MODULE "CLVM_W"
-#else
- #define CLVM_MODULE "CLVM"
-#endif
-
-
+#define CLVM_MODULE "CLVM_W"
diff --git a/plugins/Clist_nicer/SRC/clc.cpp b/plugins/Clist_nicer/SRC/clc.cpp
index 466f6a8e52..e32626a8b6 100644
--- a/plugins/Clist_nicer/SRC/clc.cpp
+++ b/plugins/Clist_nicer/SRC/clc.cpp
@@ -466,9 +466,9 @@ LBL_Def:
if (!FindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
break;
lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName((HANDLE)wParam, 0), safe_sizeof(contact->szText));
-#if defined(_UNICODE)
+
RTL_DetectAndSet(contact, 0);
-#endif
+
dat->bNeedSort = TRUE;
PostMessage(hwnd, INTM_SORTCLC, 0, 0);
goto LBL_Def;
@@ -554,9 +554,9 @@ LBL_Def:
contact->proto = (char*) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
CallService(MS_CLIST_INVALIDATEDISPLAYNAME, wParam, 0);
lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName((HANDLE)wParam, 0), safe_sizeof(contact->szText));
-#if defined(_UNICODE)
+
RTL_DetectAndSet(contact, 0);
-#endif
+
dat->bNeedSort = TRUE;
PostMessage(hwnd, INTM_SORTCLC, 0, 0);
goto LBL_Def;
diff --git a/plugins/Clist_nicer/SRC/clcitems.cpp b/plugins/Clist_nicer/SRC/clcitems.cpp
index 34b3a66405..009a57a36d 100644
--- a/plugins/Clist_nicer/SRC/clcitems.cpp
+++ b/plugins/Clist_nicer/SRC/clcitems.cpp
@@ -76,13 +76,10 @@ struct ClcGroup *AddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, D
{
struct ClcGroup *p = saveAddGroup( hwnd, dat, szName, flags, groupId, calcTotalMembers);
- #if defined(_UNICODE)
+
if ( p && p->parent )
RTL_DetectGroupName( p->parent->cl.items[ p->parent->cl.count-1] );
- #else
- if ( p && p->parent )
- p->parent->cl.items[ p->parent->cl.count -1]->isRtl = 0;
- #endif
+
return p;
}
@@ -166,9 +163,9 @@ int AddContactToGroup(struct ClcData *dat, struct ClcGroup *group, HANDLE hConta
// notify other plugins to re-supply their extra images (icq for xstatus, mBirthday etc...)
NotifyEventHooks(hExtraImageApplying, (WPARAM)hContact, 0);
}
-#if defined(_UNICODE)
+
RTL_DetectAndSet( p, p->hContact);
-#endif
+
p->avatarLeft = p->extraIconRightBegin = -1;
p->flags |= cfg::getByte(p->hContact, "CList", "Priority", 0) ? CONTACTF_PRIORITY : 0;
@@ -342,7 +339,7 @@ BYTE GetCachedStatusMsg(int iExtraCacheEntry, char *szProto)
if ( !result )
DBFreeVariant( &dbv );
-#if defined(_UNICODE)
+
if(cEntry->bStatusMsgValid != STATUSMSG_NOTFOUND) {
WORD infoTypeC2[12];
int iLen, i
@@ -358,7 +355,7 @@ BYTE GetCachedStatusMsg(int iExtraCacheEntry, char *szProto)
}
}
}
-#endif
+
if(cEntry->hTimeZone == NULL)
TZ_LoadTimeZone(hContact, cEntry, szProto);
return cEntry->bStatusMsgValid;;
@@ -397,7 +394,7 @@ void ReloadExtraInfo(HANDLE hContact)
* autodetect RTL property of the nickname, evaluates the first 10 characters of the nickname only
*/
-#if defined(_UNICODE)
+
void RTL_DetectAndSet(struct ClcContact *contact, HANDLE hContact)
{
WORD infoTypeC2[12];
@@ -447,7 +444,7 @@ void RTL_DetectGroupName(struct ClcContact *group)
}
}
}
-#endif
+
/*
* check for exteneded user information - email, phone numbers, homepage
* set extra icons accordingly
diff --git a/plugins/Clist_nicer/SRC/clcpaint.cpp b/plugins/Clist_nicer/SRC/clcpaint.cpp
index 7d3d799992..ef7cf12932 100644
--- a/plugins/Clist_nicer/SRC/clcpaint.cpp
+++ b/plugins/Clist_nicer/SRC/clcpaint.cpp
@@ -497,7 +497,7 @@ void __inline PaintItem(HDC hdcMem, struct ClcGroup *group, struct ClcContact *c
else
cEntry = cfg::eCache;
-#if defined(_UNICODE)
+
if(dat->bisEmbedded)
goto set_bg_l;
@@ -525,16 +525,7 @@ void __inline PaintItem(HDC hdcMem, struct ClcGroup *group, struct ClcContact *c
bg_indent_l = cfg::dat.bApplyIndentToBg ? indent * dat->groupIndent : 0;
set_bg_l:
-#else
- if(type == CLCIT_GROUP && cfg::dat.bGroupAlign == CLC_GROUPALIGN_RIGHT && !dat->bisEmbedded && API::pfnSetLayout != 0) {
- g_RTL = TRUE;
- bg_indent_r = cfg::dat.bApplyIndentToBg ? indent * dat->groupIndent : 0;
- }
- else {
- g_RTL = FALSE;
- bg_indent_l = cfg::dat.bApplyIndentToBg ? indent * dat->groupIndent : 0;
- }
-#endif
+
g_hottrack = dat->exStyle & CLS_EX_TRACKSELECT && type == CLCIT_CONTACT && dat->iHotTrack == index;
if (g_hottrack == selected)
@@ -1276,11 +1267,9 @@ nodisplay:
if ((dwFlags & CLUI_FRAME_SHOWSTATUSMSG && smsgValid > STATUSMSG_XSTATUSID) || smsgValid == STATUSMSG_XSTATUSNAME)
szText = cEntry->statusMsg;
else
-#if defined(_UNICODE)
+
szText = &statusNames[cstatus - ID_STATUS_OFFLINE][0];
-#else
- szText = statusNames[cstatus - ID_STATUS_OFFLINE];
-#endif
+
if(cEntry->dwCFlags & ECF_RTLSTATUSMSG && cfg::dat.bUseDCMirroring == 3)
dt_2ndrowflags |= (DT_RTLREADING | DT_RIGHT);
diff --git a/plugins/Clist_nicer/SRC/clcutils.cpp b/plugins/Clist_nicer/SRC/clcutils.cpp
index e4aee0fda9..f41b091517 100644
--- a/plugins/Clist_nicer/SRC/clcutils.cpp
+++ b/plugins/Clist_nicer/SRC/clcutils.cpp
@@ -542,7 +542,7 @@ void BeginRenameSelection(HWND hwnd, struct ClcData *dat)
for (i=0; i <= FONTID_LAST; i++)
if (h<dat->fontInfo[i].fontHeight+2) h=dat->fontInfo[i].fontHeight+2;
}
-#if defined(_UNICODE)
+
dat->hwndRenameEdit = CreateWindowEx(0, _T("RichEdit20W"),contact->szText,WS_CHILD|WS_BORDER|ES_MULTILINE|ES_AUTOHSCROLL,x,y,clRect.right-x,h,hwnd,NULL,g_hInst,NULL);
{
if ((contact->type == CLCIT_CONTACT && cfg::eCache[contact->extraCacheEntry].dwCFlags & ECF_RTLNICK) || (contact->type == CLCIT_GROUP && contact->isRtl)) {
@@ -556,9 +556,7 @@ void BeginRenameSelection(HWND hwnd, struct ClcData *dat)
SetWindowText(dat->hwndRenameEdit, contact->szText);
}
}
-#else
- dat->hwndRenameEdit = CreateWindow(_T("EDIT"),contact->szText,WS_CHILD|WS_BORDER|ES_MULTILINE|ES_AUTOHSCROLL,x,y,clRect.right-x,h,hwnd,NULL,g_hInst,NULL);
-#endif
+
//dat->hwndRenameEdit = CreateWindow(_T("EDIT"), contact->szText, WS_CHILD | WS_BORDER | ES_AUTOHSCROLL, x, y, clRect.right - x, dat->rowHeight, hwnd, NULL, g_hInst, NULL);
OldRenameEditWndProc = (WNDPROC) SetWindowLongPtr(dat->hwndRenameEdit, GWLP_WNDPROC, (LONG_PTR) RenameEditSubclassProc);
SendMessage(dat->hwndRenameEdit, WM_SETFONT, (WPARAM) (contact->type == CLCIT_GROUP ? dat->fontInfo[FONTID_GROUPS].hFont : dat->fontInfo[FONTID_CONTACTS].hFont), 0);
diff --git a/plugins/Clist_nicer/SRC/clistevents.cpp b/plugins/Clist_nicer/SRC/clistevents.cpp
index 953877c27d..93b90c34ce 100644
--- a/plugins/Clist_nicer/SRC/clistevents.cpp
+++ b/plugins/Clist_nicer/SRC/clistevents.cpp
@@ -283,14 +283,12 @@ struct CListEvent* AddEvent(CLISTEVENT *cle)
if (nmi) {
TCHAR szBuffer[128];
TCHAR* szStatus = pcli->pfnGetStatusModeDescription(cfg::getWord(p->cle.hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
-#if defined(_UNICODE)
+
TCHAR szwProto[64];
MultiByteToWideChar(CP_ACP, 0, szProto, -1, szwProto, 64);
szwProto[63] = 0;
_snwprintf(szBuffer, SIZEOF(szBuffer), L"%s: %s (%s)", szwProto, szName, szStatus);
-#else
- _snprintf(szBuffer, SIZEOF(szBuffer), "%s: %s (%s)", szProto, szName, szStatus);
-#endif
+
szBuffer[127] = 0;
AppendMenu(cfg::dat.hMenuNotify, MF_BYCOMMAND | MF_STRING, cfg::dat.wNextMenuID, szBuffer);
mii.hbmpItem = HBMMENU_CALLBACK;
diff --git a/plugins/Clist_nicer/SRC/clui.cpp b/plugins/Clist_nicer/SRC/clui.cpp
index 93fdd989d4..43e459a6c0 100644
--- a/plugins/Clist_nicer/SRC/clui.cpp
+++ b/plugins/Clist_nicer/SRC/clui.cpp
@@ -316,17 +316,12 @@ static int CluiModulesLoaded(WPARAM wParam, LPARAM lParam)
static Update upd = {0};
static const char *szPrefix = "clist_nicer_plus ";
-#if defined(_UNICODE)
+
static char *component = "CList Nicer+ (Unicode)";
static char szCurrentVersion[30];
static char *szVersionUrl = "http://download.miranda.or.at/clist_nicer/0.9/versionW.txt";
static char *szUpdateUrl = "http://download.miranda.or.at/clist_nicer/0.9/clist_nicer_plusW.zip";
-#else
- static char *component = "CList Nicer+";
- static char szCurrentVersion[30];
- static char *szVersionUrl = "http://download.miranda.or.at/clist_nicer/0.9/version.txt";
- static char *szUpdateUrl = "http://download.miranda.or.at/clist_nicer/0.9/clist_nicer_plus.zip";
-#endif
+
// updater plugin support
@@ -2314,11 +2309,9 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
{
char str[64];
DWORD v = pluginInfo.version;
-#if defined(_UNICODE)
+
mir_snprintf(str, sizeof(str), "%s %d.%d.%d.%d (Unicode)", Translate("Version"), HIBYTE(HIWORD(v)), LOBYTE(HIWORD(v)), HIBYTE(LOWORD(v)), LOBYTE(LOWORD(v)));
-#else
- mir_snprintf(str, sizeof(str), "%s %d.%d.%d.%d", Translate("Version"), HIBYTE(HIWORD(v)), LOBYTE(HIWORD(v)), HIBYTE(LOWORD(v)), LOBYTE(LOWORD(v)));
-#endif
+
SetDlgItemTextA(hwndDlg, IDC_VERSION, str);
mir_snprintf(str, sizeof(str), Translate("Built %s %s"), __DATE__, __TIME__);
SetDlgItemTextA(hwndDlg, IDC_BUILDTIME, str);
@@ -2335,11 +2328,9 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
DestroyWindow(hwndDlg);
return TRUE;
case IDC_SUPPORT:
-#if defined(_UNICODE)
+
CallService(MS_UTILS_OPENURL, 1, (LPARAM)"http://miranda-im.org/download/details.php?action=viewfile&id=2365");
-#else
- CallService(MS_UTILS_OPENURL, 1, (LPARAM)"http://miranda-im.org/download/details.php?action=viewfile&id=2189");
-#endif
+
break;
}
break;
diff --git a/plugins/Clist_nicer/SRC/extBackg.cpp b/plugins/Clist_nicer/SRC/extBackg.cpp
index f5af31a2fb..ea9f451651 100644
--- a/plugins/Clist_nicer/SRC/extBackg.cpp
+++ b/plugins/Clist_nicer/SRC/extBackg.cpp
@@ -1210,12 +1210,10 @@ static void BTN_ReadItem(char *itemName, char *file)
GetPrivateProfileStringA(itemName, "Tip", "None", szBuffer, 1000, file);
if(strcmp(szBuffer, "None")) {
-#if defined(_UNICODE)
+
MultiByteToWideChar(cfg::dat.langPackCP, 0, szBuffer, -1, tmpItem.szTip, 256);
tmpItem.szTip[255] = 0;
-#else
- mir_snprintf(tmpItem.szTip, 256, "%s", szBuffer);
-#endif
+
}
else
tmpItem.szTip[0] = 0;
@@ -1267,9 +1265,9 @@ void IMG_LoadItems()
* rewrite the skin loading in TCHAR manner
*/
-#if defined(_UNICODE)
+
WideCharToMultiByte(CP_ACP, 0, tszFileName, MAX_PATH, szFileName, MAX_PATH, 0, 0);
-#endif
+
DBFreeVariant(&dbv);
@@ -1335,13 +1333,10 @@ void LoadPerContactSkins(TCHAR *tszFileName)
StatusItems_t *items = NULL, *this_item;
HANDLE hContact;
int i = 1;
-#if defined(_UNICODE)
- char file[MAX_PATH];
+ char file[MAX_PATH];
WideCharToMultiByte(CP_ACP, 0, tszFileName, MAX_PATH, file, MAX_PATH, 0, 0);
file[MAX_PATH - 1] = 0;
-#else
- char *file = tszFileName;
-#endif
+
ReadItem(&default_item, "%Default", file);
ZeroMemory(szSections, 3000);
@@ -1573,11 +1568,9 @@ static void ApplyCLUISkin()
char szFinalName[MAX_PATH];
if (!cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) {
MY_pathToAbsolute(dbv.ptszVal, tszFinalName);
-#if defined(_UNICODE)
+
WideCharToMultiByte(CP_ACP, 0, tszFinalName, MAX_PATH, szFinalName, MAX_PATH, 0, 0);
-#else
- mir_sntprintf(szFinalName, MAX_PATH, _T("%s"), tszFinalName);
-#endif
+
if(cfg::getByte("CLUI", "skin_changed", 0)) {
extbk_import(szFinalName, 0);
SaveCompleteStructToDB();
diff --git a/plugins/Clist_nicer/SRC/init.cpp b/plugins/Clist_nicer/SRC/init.cpp
index 47c1e5c249..11d68d0012 100644
--- a/plugins/Clist_nicer/SRC/init.cpp
+++ b/plugins/Clist_nicer/SRC/init.cpp
@@ -118,7 +118,7 @@ PLUGININFOEX pluginInfo =
{0x8f79b4ee, 0xeb48, 0x4a03, { 0x87, 0x3e, 0x27, 0xbe, 0x6b, 0x7e, 0x9a, 0x25 }} //{8F79B4EE-EB48-4a03-873E-27BE6B7E9A25}
};
-#if defined(_UNICODE)
+
void _DebugTraceW(const wchar_t *fmt, ...)
{
#ifdef _DEBUG
@@ -133,7 +133,7 @@ void _DebugTraceW(const wchar_t *fmt, ...)
OutputDebugStringW(debug);
#endif
}
-#endif
+
void _DebugTraceA(const char *fmt, ...)
{
@@ -324,12 +324,10 @@ extern "C" int __declspec(dllexport) CListInitialise(PLUGINLINK * link)
CallService(MS_DB_GETPROFILEPATH, MAX_PATH, (LPARAM)szProfilePath);
-#if defined(_UNICODE)
+
MultiByteToWideChar(CP_ACP, 0, szProfilePath, MAX_PATH, cfg::dat.tszProfilePath, MAX_PATH);
cfg::dat.tszProfilePath[MAX_PATH - 1] = 0;
-#else
- mir_sntprintf(cfg::dat.tszProfilePath, MAX_PATH, "%s", szProfilePath);
-#endif
+
_tcslwr(cfg::dat.tszProfilePath);
diff --git a/plugins/Clist_nicer/skineditor/skinedit.rc b/plugins/Clist_nicer/skineditor/skinedit.rc
index 25f67d316c..66decd262f 100644
--- a/plugins/Clist_nicer/skineditor/skinedit.rc
+++ b/plugins/Clist_nicer/skineditor/skinedit.rc
@@ -101,7 +101,7 @@ VS_VERSION_INFO VERSIONINFO
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
-#if defined(UNICODE)
+
BEGIN
BLOCK "0c0704b0"
BEGIN
@@ -115,21 +115,7 @@ BEGIN
VALUE "ProductVersion", "0, 0, 0, 2"
END
END
-#else
- BEGIN
- BLOCK "0c0704b0"
- BEGIN
- VALUE "FileDescription", "Skin Editor (ANSI)"
- VALUE "FileVersion", "0, 0, 0, 2"
- VALUE "InternalName", "CLN SkinEdit (ANSI)"
- VALUE "LegalCopyright", "Copyright (C) 2006"
- VALUE "LegalTrademarks", "GPL"
- VALUE "OriginalFilename", "cln_skinedit.dll"
- VALUE "ProductName", "Clist Nicer+ skin editor"
- VALUE "ProductVersion", "0, 0, 0, 2"
- END
- END
-#endif
+
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0xc07, 1200