From 58973a21a30bf95427fd43c456e41e35c386218c Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Fri, 15 Jun 2012 18:52:16 +0000 Subject: another portion of "#ifsef Unicode" removal git-svn-id: http://svn.miranda-ng.org/main/trunk@434 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_nicer/INCLUDE/clist.h | 7 ++----- plugins/Clist_nicer/SRC/clc.cpp | 8 ++++---- plugins/Clist_nicer/SRC/clcitems.cpp | 19 ++++++++----------- plugins/Clist_nicer/SRC/clcpaint.cpp | 19 ++++--------------- plugins/Clist_nicer/SRC/clcutils.cpp | 6 ++---- plugins/Clist_nicer/SRC/clistevents.cpp | 6 ++---- plugins/Clist_nicer/SRC/extBackg.cpp | 18 ++++++------------ plugins/Clist_nicer/SRC/init.cpp | 4 ++-- plugins/Clist_nicer/skineditor/skinedit.rc | 18 ++---------------- 9 files changed, 32 insertions(+), 73 deletions(-) (limited to 'plugins/Clist_nicer') diff --git a/plugins/Clist_nicer/INCLUDE/clist.h b/plugins/Clist_nicer/INCLUDE/clist.h index a4d956ba3c..f4cabd2419 100644 --- a/plugins/Clist_nicer/INCLUDE/clist.h +++ b/plugins/Clist_nicer/INCLUDE/clist.h @@ -47,10 +47,7 @@ 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 9e7e907bcc..439221be8d 100644 --- a/plugins/Clist_nicer/SRC/clc.cpp +++ b/plugins/Clist_nicer/SRC/clc.cpp @@ -449,9 +449,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; @@ -537,9 +537,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 (hfontInfo[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/extBackg.cpp b/plugins/Clist_nicer/SRC/extBackg.cpp index ce3295866b..0aa2b32265 100644 --- a/plugins/Clist_nicer/SRC/extBackg.cpp +++ b/plugins/Clist_nicer/SRC/extBackg.cpp @@ -1208,12 +1208,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; @@ -1318,13 +1316,11 @@ void LoadPerContactSkins(TCHAR *tszFileName) StatusItems_t *items = NULL, *this_item; HANDLE hContact; int i = 1; -#if defined(_UNICODE) + 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); @@ -1546,11 +1542,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 0c02af384e..e606f3320f 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, ...) { diff --git a/plugins/Clist_nicer/skineditor/skinedit.rc b/plugins/Clist_nicer/skineditor/skinedit.rc index 25f67d316c..760d20b00d 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 -- cgit v1.2.3