diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-29 14:19:12 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-29 14:19:12 +0000 |
commit | c1840425166576b1cf187076a9344a78a20375b6 (patch) | |
tree | 7c7e1d66219c7b2ed6b57a397ac67b3541aa127e /plugins/TabSRMM | |
parent | d80ee102fba0f99ad2ab0e0e734267f76b3b639e (diff) |
minor code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@686 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM')
48 files changed, 1649 insertions, 1675 deletions
diff --git a/plugins/TabSRMM/chat/clist.cpp b/plugins/TabSRMM/chat/clist.cpp index 540997aa87..cd19765bdf 100644 --- a/plugins/TabSRMM/chat/clist.cpp +++ b/plugins/TabSRMM/chat/clist.cpp @@ -55,13 +55,13 @@ static HANDLE Clist_GroupExists(TCHAR *tszGroup) if (!result) {
match = (!_tcscmp(tszGroup, &dbv.ptszVal[1]) && (lstrlen(tszGroup) == lstrlen(&dbv.ptszVal[1])));
DBFreeVariant(&dbv);
- if(match)
+ if (match)
return((HANDLE)(i + 1));
}
i++;
}
while(result == 0);
- return(0);
+ return 0;
}
HANDLE CList_AddRoom(const char* pszModule, const TCHAR* pszRoom, const TCHAR* pszDisplayName, int iType)
@@ -170,9 +170,9 @@ int CList_RoomDoubleclicked(WPARAM wParam, LPARAM lParam) fCreate = true;
ShowRoom(si, WINDOW_VISIBLE, TRUE);
- if(lParam && fCreate) {
+ if (lParam && fCreate) {
SendMessage(si->hWnd, DM_ACTIVATEME, 0, 0);
- if(si->dat)
+ if (si->dat)
SetForegroundWindow(si->dat->pContainer->hwnd);
}
}
@@ -260,10 +260,10 @@ void CList_CreateGroup(TCHAR* group) g_Settings.hGroup = Clist_GroupExists(group);
- if(g_Settings.hGroup == 0) {
+ if (g_Settings.hGroup == 0) {
g_Settings.hGroup = (HANDLE)CallService(MS_CLIST_GROUPCREATE, 0, (LPARAM)group);
- if(g_Settings.hGroup) {
+ if (g_Settings.hGroup) {
CallService(MS_CLUI_GROUPADDED, (WPARAM)g_Settings.hGroup, 0);
CallService(MS_CLIST_GROUPSETEXPANDED, (WPARAM)g_Settings.hGroup, 1);
}
diff --git a/plugins/TabSRMM/chat/log.cpp b/plugins/TabSRMM/chat/log.cpp index d0fcf2e299..70178ada75 100644 --- a/plugins/TabSRMM/chat/log.cpp +++ b/plugins/TabSRMM/chat/log.cpp @@ -770,7 +770,7 @@ static char* Log_CreateRTF(LOGSTREAMDATA *streamData) // ### RTF HEADER
- if(0 == mi->pszHeader)
+ if (0 == mi->pszHeader)
mi->pszHeader = Log_CreateRtfHeader(mi);
header = mi->pszHeader;
diff --git a/plugins/TabSRMM/chat/main.cpp b/plugins/TabSRMM/chat/main.cpp index b4d40e20ef..bf57bd0bb0 100644 --- a/plugins/TabSRMM/chat/main.cpp +++ b/plugins/TabSRMM/chat/main.cpp @@ -56,12 +56,12 @@ char *pszActiveWndModule = 0; int Chat_Load()
{
- if(M->GetByte("forceDisableMUC", 0)) {
+ if (M->GetByte("forceDisableMUC", 0)) {
PluginConfig.m_chat_enabled = false;
- return(0);
+ return 0;
}
g_hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_MENU));
- if(CreateServiceFunctions()) {
+ if (CreateServiceFunctions()) {
HookEvents();
CreateHookableEvents();
OptionsInit();
diff --git a/plugins/TabSRMM/chat/manager.cpp b/plugins/TabSRMM/chat/manager.cpp index d1c2a27aa3..1859ade1a9 100644 --- a/plugins/TabSRMM/chat/manager.cpp +++ b/plugins/TabSRMM/chat/manager.cpp @@ -80,7 +80,7 @@ SESSION_INFO* SM_AddSession(const TCHAR* pszID, const char* pszModule) MODULEINFO *mi = MM_FindModule(pszModule);
- if(mi) {
+ if (mi) {
mi->idleTimeStamp = time(0);
SM_BroadcastMessage(pszModule, GC_UPDATESTATUSBAR, 0, 1, TRUE);
}
@@ -687,7 +687,7 @@ BOOL SM_ChangeNick(const TCHAR* pszID, const char* pszModule, GCEVENT * gce) SM_MoveUser(pTemp->ptszID, pTemp->pszModule, ui->pszUID);
if (pTemp->hWnd) {
SendMessage(pTemp->hWnd, GC_UPDATENICKLIST, 0, 0);
- if(pTemp->dat)
+ if (pTemp->dat)
GetMyNick(pTemp->dat);
SendMessage(pTemp->hWnd, GC_UPDATESTATUSBAR, 0, 0);
}
@@ -1040,7 +1040,7 @@ BOOL MM_RemoveAll(void) MODULEINFO *pLast = m_ModList->next;
mir_free(m_ModList->pszModule);
mir_free(m_ModList->ptszModDispName);
- if(m_ModList->pszHeader)
+ if (m_ModList->pszHeader)
mir_free(m_ModList->pszHeader);
mir_free(m_ModList->crColors);
diff --git a/plugins/TabSRMM/chat/muchighlight.cpp b/plugins/TabSRMM/chat/muchighlight.cpp index 806a8544e8..dd06f27d74 100644 --- a/plugins/TabSRMM/chat/muchighlight.cpp +++ b/plugins/TabSRMM/chat/muchighlight.cpp @@ -38,16 +38,16 @@ void CMUCHighlight::cleanup()
{
- if(m_NickPatternString)
+ if (m_NickPatternString)
mir_free(m_NickPatternString);
- if(m_TextPatternString)
+ if (m_TextPatternString)
mir_free(m_TextPatternString);
m_TextPatternString = m_NickPatternString = 0;
- if(m_NickPatterns)
+ if (m_NickPatterns)
mir_free(m_NickPatterns);
- if(m_TextPatterns)
+ if (m_TextPatterns)
mir_free(m_TextPatterns);
m_iNickPatterns = m_iTextPatterns = 0;
@@ -58,18 +58,18 @@ void CMUCHighlight::init() {
DBVARIANT dbv = {0};
- if(m_fInitialized)
+ if (m_fInitialized)
cleanup(); // clean up first, if we were already initialized
m_fInitialized = true;
- if(0 == M->GetTString(0, "Chat", "HighlightWords", &dbv)) {
+ if (0 == M->GetTString(0, "Chat", "HighlightWords", &dbv)) {
m_TextPatternString = dbv.ptszVal;
_wsetlocale(LC_ALL, L"");
wcslwr(m_TextPatternString);
}
- if(0 == M->GetTString(0, "Chat", "HighlightNames", &dbv))
+ if (0 == M->GetTString(0, "Chat", "HighlightNames", &dbv))
m_NickPatternString = dbv.ptszVal;
m_dwFlags = M->GetByte("Chat", "HighlightEnabled", MATCH_TEXT);
@@ -86,7 +86,7 @@ void CMUCHighlight::init() void CMUCHighlight::tokenize(TCHAR *tszString, TCHAR**& patterns, UINT& nr)
{
- if(tszString == 0)
+ if (tszString == 0)
return;
TCHAR *p = tszString;
@@ -133,8 +133,8 @@ int CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dwF {
int result = 0, nResult = 0;
- if(pgce == 0 || m_Valid == false)
- return(0);
+ if (pgce == 0 || m_Valid == false)
+ return 0;
__try {
if ((m_dwFlags & MATCH_TEXT) && (dwFlags & MATCH_TEXT) && (m_fHighlightMe || m_iTextPatterns > 0) && psi != 0) {
@@ -148,14 +148,14 @@ int CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dwF UINT i = 0;
TCHAR *tszMe = ((psi && psi->pMe) ? mir_tstrdup(psi->pMe->pszNick) : 0);
- if(tszMe) {
+ if (tszMe) {
_wsetlocale(LC_ALL, L"");
wcslwr(tszMe);
}
- if(m_fHighlightMe && tszMe) {
+ if (m_fHighlightMe && tszMe) {
result = wcsstr(p, tszMe) ? MATCH_TEXT : 0;
- if(0 == m_iTextPatterns)
+ if (0 == m_iTextPatterns)
goto skip_textpatterns;
}
while(p && !result) {
@@ -175,7 +175,7 @@ int CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dwF for(i = 0; i < m_iTextPatterns && !result; i++)
result = wildmatch(m_TextPatterns[i], p) ? MATCH_TEXT : 0;
- if(p1) {
+ if (p1) {
*p1 = ' ';
p = p1 + 1;
}
@@ -192,13 +192,13 @@ skip_textpatterns: #ifdef __HLT_PERFSTATS
M->stopTimer(0);
- if(psi && psi->dat) {
+ if (psi && psi->dat) {
mir_sntprintf(psi->dat->szStatusBar, 100, _T("PERF text match: %d ticks = %f msec (%d words, %d patterns)"), (int)M->getTicks(), M->getMsec(), words, m_iTextPatterns);
- if(psi->dat->pContainer->hwndStatus)
+ if (psi->dat->pContainer->hwndStatus)
::SendMessage(psi->dat->pContainer->hwndStatus, SB_SETTEXT, 0, (LPARAM)psi->dat->szStatusBar);
}
#endif
- if(tszMe)
+ if (tszMe)
mir_free(tszMe);
}
@@ -207,7 +207,7 @@ skip_textpatterns: */
if ((m_dwFlags & MATCH_NICKNAME) && (dwFlags & MATCH_NICKNAME) && pgce->ptszNick && m_iNickPatterns > 0) {
for(UINT i = 0; i < m_iNickPatterns && !nResult; i++) {
- if(pgce->ptszNick)
+ if (pgce->ptszNick)
nResult = wildmatch(m_NickPatterns[i], pgce->ptszNick) ? MATCH_NICKNAME : 0;
if ((m_dwFlags & MATCH_UIN) && pgce->ptszUserInfo)
nResult = wildmatch(m_NickPatterns[i], pgce->ptszUserInfo) ? MATCH_NICKNAME : 0;
@@ -218,9 +218,9 @@ skip_textpatterns: }
__except(CGlobals::Ex_ShowDialog(GetExceptionInformation(), __FILE__, __LINE__, L"MUC_HIGHLIGHT_EXCEPTION", false)) {
m_Valid = false;
- return(0);
+ return 0;
}
- return(0);
+ return 0;
}
int CMUCHighlight::wildmatch(const TCHAR *pattern, const TCHAR *tszString) {
@@ -272,12 +272,12 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L TranslateDialogDefault(hwndDlg);
- if(0 == M->GetTString(0, "Chat", "HighlightWords", &dbv)) {
+ if (0 == M->GetTString(0, "Chat", "HighlightWords", &dbv)) {
::SetDlgItemTextW(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN, dbv.ptszVal);
::DBFreeVariant(&dbv);
}
- if(0 == M->GetTString(0, "Chat", "HighlightNames", &dbv)) {
+ if (0 == M->GetTString(0, "Chat", "HighlightNames", &dbv)) {
::SetDlgItemTextW(hwndDlg, IDC_HIGHLIGHTNICKPATTERN, dbv.ptszVal);
::DBFreeVariant(&dbv);
}
@@ -326,14 +326,14 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L wchar_t* szBuf = 0;
int iLen = ::GetWindowTextLengthW(::GetDlgItem(hwndDlg, IDC_HIGHLIGHTNICKPATTERN));
- if(iLen) {
+ if (iLen) {
szBuf = reinterpret_cast<wchar_t *>(mir_alloc((iLen + 2) * sizeof(wchar_t)));
::GetDlgItemTextW(hwndDlg, IDC_HIGHLIGHTNICKPATTERN, szBuf, iLen + 1);
M->WriteTString(0, "Chat", "HighlightNames",szBuf);
}
iLen = ::GetWindowTextLengthW(::GetDlgItem(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN));
- if(iLen) {
+ if (iLen) {
szBuf = reinterpret_cast<TCHAR *>(mir_realloc(szBuf, sizeof(wchar_t) * (iLen + 2)));
::GetDlgItemTextW(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN, szBuf, iLen + 1);
M->WriteTString(0, "Chat", "HighlightWords", szBuf);
@@ -345,7 +345,7 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L BYTE dwFlags = (::IsDlgButtonChecked(hwndDlg, IDC_HIGHLIGHTNICKENABLE) ? MATCH_NICKNAME : 0) |
(::IsDlgButtonChecked(hwndDlg, IDC_HIGHLIGHTTEXTENABLE) ? MATCH_TEXT : 0);
- if(dwFlags & MATCH_NICKNAME)
+ if (dwFlags & MATCH_NICKNAME)
dwFlags |= (::IsDlgButtonChecked(hwndDlg, IDC_HIGHLIGHTNICKUID) ? MATCH_UIN : 0);
M->WriteByte("Chat", "HighlightEnabled", dwFlags);
@@ -384,7 +384,7 @@ INT_PTR CALLBACK CMUCHighlight::dlgProcAdd(HWND hwndDlg, UINT msg, WPARAM wParam hFont = ::CreateFontIndirectW(&lf);
::SendDlgItemMessage(hwndDlg, IDC_ADDHIGHLIGHTTITLE, WM_SETFONT, (WPARAM)hFont, FALSE);
- if(the->uCmd == THighLightEdit::CMD_ADD) {
+ if (the->uCmd == THighLightEdit::CMD_ADD) {
Utils::showDlgControl(hwndDlg, IDC_ADDHIGHLIGHTEDITLIST, SW_HIDE);
::SetDlgItemTextW(hwndDlg, IDC_ADDHIGHLIGHTTITLE, TranslateT("Add user to highlight list"));
::SendDlgItemMessageW(hwndDlg, IDC_ADDHIGHLIGHTNAME, CB_INSERTSTRING, -1, (LPARAM)the->ui->pszNick);
@@ -404,14 +404,14 @@ INT_PTR CALLBACK CMUCHighlight::dlgProcAdd(HWND hwndDlg, UINT msg, WPARAM wParam HWND hwndChild = (HWND)lParam;
UINT id = ::GetDlgCtrlID(hwndChild);
- if(hwndChild == ::GetDlgItem(hwndDlg, IDC_ADDHIGHLIGHTTITLE))
+ if (hwndChild == ::GetDlgItem(hwndDlg, IDC_ADDHIGHLIGHTTITLE))
::SetTextColor((HDC)wParam, RGB(60, 60, 150));
::SetBkColor((HDC)wParam, ::GetSysColor(COLOR_WINDOW));
return (INT_PTR)::GetSysColorBrush(COLOR_WINDOW);
}
case WM_COMMAND: {
- if(LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
+ if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
::DestroyWindow(hwndDlg);
break;
}
diff --git a/plugins/TabSRMM/chat/options.cpp b/plugins/TabSRMM/chat/options.cpp index 77f6cb0f82..94278328a5 100644 --- a/plugins/TabSRMM/chat/options.cpp +++ b/plugins/TabSRMM/chat/options.cpp @@ -259,7 +259,7 @@ void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szM lf->lfOrientation = 0;
wsprintfA(str, "Font%dSty", i);
style = M->GetByte(szMod, str, fol[j].defStyle);
- if(i == MSGFONTID_MESSAGEAREA && section == FONTSECTION_IM && M->GetByte(0, SRMSGMOD_T, "inputFontFix", 1) == 1) {
+ if (i == MSGFONTID_MESSAGEAREA && section == FONTSECTION_IM && M->GetByte(0, SRMSGMOD_T, "inputFontFix", 1) == 1) {
lf->lfWeight = FW_NORMAL;
lf->lfItalic = 0;
lf->lfUnderline = 0;
@@ -781,7 +781,7 @@ void RegisterFontServiceFonts() { fid.flags = fid.flags & ~FIDF_CLASSMASK | (fid.deffontsettings.style&FONTF_BOLD ? FIDF_CLASSHEADER : FIDF_CLASSGENERAL);
fid.deffontsettings.charset = lf.lfCharSet;
_tcsncpy(fid.deffontsettings.szFace, lf.lfFaceName, LF_FACESIZE);
- if(i==IPFONTCOUNT-1){
+ if (i==IPFONTCOUNT-1){
_tcsncpy(fid.backgroundGroup, _T(""), SIZEOF(fid.backgroundGroup));
_tcsncpy(fid.backgroundName, _T(""), SIZEOF(fid.backgroundName));
_tcsncpy(fid.group, _T("TabSRMM"), SIZEOF(fid.group));
@@ -808,7 +808,7 @@ void RegisterFontServiceFonts() { _tcsncpy(fid.deffontsettings.szFace, lf.lfFaceName, LF_FACESIZE);
_tcsncpy(fid.backgroundGroup, _T("TabSRMM/Group Chats"), SIZEOF(fid.backgroundGroup));
_tcsncpy(fid.backgroundName, _T("Group chat log background"), SIZEOF(fid.backgroundName));
- if(i == 18 || i == 19)
+ if (i == 18 || i == 19)
_tcsncpy(fid.backgroundName, _T("Userlist background"), SIZEOF(fid.backgroundName));
FontRegisterT(&fid);
}
@@ -850,7 +850,7 @@ void RegisterFontServiceFonts() { _tcsncpy(cid.group, _clrs[i].tszGroup, SIZEOF(fid.group));
_tcsncpy(cid.name, _clrs[i].tszName, SIZEOF(cid.name));
strncpy(cid.setting, _clrs[i].szSetting, SIZEOF(cid.setting));
- if(_clrs[i].def & 0xff000000)
+ if (_clrs[i].def & 0xff000000)
cid.defcolour = GetSysColor(_clrs[i].def & 0x000000ff);
else
cid.defcolour = _clrs[i].def;
@@ -867,7 +867,7 @@ void RegisterFontServiceFonts() { _tcsncpy(cid.group, _tabclrs[i].tszGroup, SIZEOF(fid.group));
_tcsncpy(cid.name, _tabclrs[i].tszName, SIZEOF(cid.name));
strncpy(cid.setting, _tabclrs[i].szSetting, SIZEOF(cid.setting));
- if(_tabclrs[i].def & 0xff000000)
+ if (_tabclrs[i].def & 0xff000000)
cid.defcolour = GetSysColor(_tabclrs[i].def & 0x000000ff);
else
cid.defcolour = _tabclrs[i].def;
@@ -1025,7 +1025,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM }
mir_sntprintf(tszInitialDir, MAX_PATH, _T("%s%s"), M->getChatLogPath(), p);
- if(PathFileExists(tszInitialDir))
+ if (PathFileExists(tszInitialDir))
ofn.lpstrInitialDir = tszInitialDir;
else {
mir_sntprintf(tszInitialDir, MAX_PATH, _T("%s"), M->getChatLogPath());
@@ -1192,7 +1192,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM }
break;
case WM_TIMER:
- if(IsWindow(hPathTip))
+ if (IsWindow(hPathTip))
KillTimer(hPathTip, 4); // It will prevent tooltip autoclosing
break;
case WM_DESTROY:
@@ -1247,7 +1247,7 @@ INT_PTR CALLBACK DlgProcOptions3(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM DWORD dwLogFlags = M->GetDword("Chat", "DiskLogFlags", GC_EVENT_ALL);
for(int i = 0; _eventorder[i]; i++) {
- if(_eventorder[i] != GC_EVENT_HIGHLIGHT) {
+ if (_eventorder[i] != GC_EVENT_HIGHLIGHT) {
CheckDlgButton(hwndDlg, IDC_1 + i, dwFilterFlags & _eventorder[i] ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_L1 + i, dwLogFlags & _eventorder[i] ? BST_CHECKED : BST_UNCHECKED);
}
@@ -1279,7 +1279,7 @@ INT_PTR CALLBACK DlgProcOptions3(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM dwPopupFlags = 0, dwLogFlags = 0;
for(int i = 0; _eventorder[i]; i++) {
- if(_eventorder[i] != GC_EVENT_HIGHLIGHT) {
+ if (_eventorder[i] != GC_EVENT_HIGHLIGHT) {
dwFilterFlags |= (IsDlgButtonChecked(hwndDlg, IDC_1 + i) ? _eventorder[i] : 0);
dwLogFlags |= (IsDlgButtonChecked(hwndDlg, IDC_L1 + i) ? _eventorder[i] : 0);
}
@@ -1391,7 +1391,7 @@ void LoadGlobalSettings(void) // nicklist
- if(g_Settings.UserListFont) {
+ if (g_Settings.UserListFont) {
DeleteObject(g_Settings.UserListFont);
DeleteObject(g_Settings.UserListHeadingsFont);
}
@@ -1426,7 +1426,7 @@ static void FreeGlobalSettings(void) mir_free(g_Settings.pszTimeStampLog);
mir_free(g_Settings.pszIncomingNick);
mir_free(g_Settings.pszOutgoingNick);
- if(g_Settings.UserListFont) {
+ if (g_Settings.UserListFont) {
DeleteObject(g_Settings.UserListFont);
DeleteObject(g_Settings.UserListHeadingsFont);
}
@@ -1451,10 +1451,10 @@ int OptionsInit(void) ZeroMemory(&g_Settings, sizeof(TMUCSettings));
g_Settings.NameFont = CreateFontIndirect(&lf);
g_Settings.iSplitterX = DBGetContactSettingWord(NULL, "Chat", "SplitterX", 105);
- if(g_Settings.iSplitterX <= 50)
+ if (g_Settings.iSplitterX <= 50)
g_Settings.iSplitterX = 105;
g_Settings.iSplitterY = DBGetContactSettingWord(NULL, "Chat", "splitY", 50);
- if(g_Settings.iSplitterY <= 20)
+ if (g_Settings.iSplitterY <= 20)
g_Settings.iSplitterY = 50;
g_Settings.hGroup = 0;
LoadGlobalSettings();
diff --git a/plugins/TabSRMM/chat/services.cpp b/plugins/TabSRMM/chat/services.cpp index 7f256f3d30..8a8800ed05 100644 --- a/plugins/TabSRMM/chat/services.cpp +++ b/plugins/TabSRMM/chat/services.cpp @@ -39,40 +39,26 @@ #include "../src/commonheaders.h"
// defs
-extern HICON hIcons[30];
-
-HANDLE hSendEvent;
-HANDLE hBuildMenuEvent;
-HANDLE hJoinMenuItem, hLeaveMenuItem;
-HANDLE g_hHookPrebuildMenu;
-CRITICAL_SECTION cs;
-
-static HANDLE hServiceRegister = NULL,
- hServiceNewChat = NULL,
- hServiceAddEvent = NULL,
- hServiceGetAddEventPtr = NULL,
- hServiceGetInfo = NULL,
- hServiceGetCount = NULL,
- hEventPrebuildMenu = NULL,
- hEventDoubleclicked = NULL,
- hEventJoinChat = NULL,
- hEventLeaveChat = NULL;
-
-#ifdef _WIN64
-
-#define SIZEOF_STRUCT_GCREGISTER_V1 40
-#define SIZEOF_STRUCT_GCWINDOW_V1 48
-#define SIZEOF_STRUCT_GCEVENT_V1 76
-#define SIZEOF_STRUCT_GCEVENT_V2 80
-
-#else
-
-#define SIZEOF_STRUCT_GCREGISTER_V1 28
-#define SIZEOF_STRUCT_GCWINDOW_V1 32
-#define SIZEOF_STRUCT_GCEVENT_V1 44
-#define SIZEOF_STRUCT_GCEVENT_V2 48
-
-#endif
+extern HICON hIcons[30];
+
+CRITICAL_SECTION cs;
+
+HANDLE hSendEvent;
+HANDLE hBuildMenuEvent;
+HANDLE hJoinMenuItem, hLeaveMenuItem;
+HANDLE g_hHookPrebuildMenu;
+
+static HANDLE
+ hServiceRegister = NULL,
+ hServiceNewChat = NULL,
+ hServiceAddEvent = NULL,
+ hServiceGetAddEventPtr = NULL,
+ hServiceGetInfo = NULL,
+ hServiceGetCount = NULL,
+ hEventPrebuildMenu = NULL,
+ hEventDoubleclicked = NULL,
+ hEventJoinChat = NULL,
+ hEventLeaveChat = NULL;
int Chat_ModulesLoaded(WPARAM wParam, LPARAM lParam)
{
@@ -184,7 +170,7 @@ INT_PTR Service_Register(WPARAM wParam, LPARAM lParam) if (gcr == NULL)
return GC_REGISTER_ERROR;
- if (gcr->cbSize != SIZEOF_STRUCT_GCREGISTER_V1)
+ if (gcr->cbSize != sizeof(GCREGISTER))
return GC_REGISTER_WRONGVER;
EnterCriticalSection(&cs);
@@ -225,7 +211,7 @@ INT_PTR Service_NewChat(WPARAM wParam, LPARAM lParam) if (gcw == NULL)
return GC_NEWSESSION_ERROR;
- if (gcw->cbSize != SIZEOF_STRUCT_GCWINDOW_V1)
+ if (gcw->cbSize != sizeof(GCSESSION))
return GC_NEWSESSION_WRONGVER;
EnterCriticalSection(&cs);
@@ -274,7 +260,8 @@ INT_PTR Service_NewChat(WPARAM wParam, LPARAM lParam) DBWriteContactSettingString(si->hContact, si->pszModule, "StatusBar", "");
if (si->hContact)
Chat_SetFilters(si);
- } else {
+ }
+ else {
SESSION_INFO* si2 = SM_FindSession(ptszID, gcw->pszModule);
if (si2) {
@@ -302,115 +289,116 @@ INT_PTR Service_NewChat(WPARAM wParam, LPARAM lParam) static int DoControl(GCEVENT * gce, WPARAM wp)
{
- if (gce->pDest->iType == GC_EVENT_CONTROL) {
+ SESSION_INFO* si;
+
+ switch(gce->pDest->iType) {
+ case GC_EVENT_CONTROL:
switch (wp) {
case WINDOW_HIDDEN:
- {
- SESSION_INFO* si = SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
- if (si) {
- si->bInitDone = TRUE;
- SetActiveSession(si->ptszID, si->pszModule);
- if (si->hWnd)
- ShowRoom(si, wp, FALSE);
- }
+ si = SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
+ if (si) {
+ si->bInitDone = TRUE;
+ SetActiveSession(si->ptszID, si->pszModule);
+ if (si->hWnd)
+ ShowRoom(si, wp, FALSE);
}
return 0;
- case WINDOW_MINIMIZE:
- case WINDOW_MAXIMIZE:
- case WINDOW_VISIBLE:
+ case WINDOW_MINIMIZE:
+ case WINDOW_MAXIMIZE:
+ case WINDOW_VISIBLE:
case SESSION_INITDONE:
- {
- SESSION_INFO* si = SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
- if (si) {
- si->bInitDone = TRUE;
- if (wp != SESSION_INITDONE || M->GetByte("Chat", "PopupOnJoin", 0) == 0)
- ShowRoom(si, wp, TRUE);
- return 0;
- } }
+ si = SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
+ if (si) {
+ si->bInitDone = TRUE;
+ if (wp != SESSION_INITDONE || M->GetByte("Chat", "PopupOnJoin", 0) == 0)
+ ShowRoom(si, wp, TRUE);
+ return 0;
+ }
break;
- case SESSION_OFFLINE:
- SM_SetOffline(gce->pDest->ptszID, gce->pDest->pszModule);
- // fall through
+ case SESSION_OFFLINE:
+ SM_SetOffline(gce->pDest->ptszID, gce->pDest->pszModule);
+ // fall through
- case SESSION_ONLINE:
- SM_SetStatus(gce->pDest->ptszID, gce->pDest->pszModule, wp == SESSION_ONLINE ? ID_STATUS_ONLINE : ID_STATUS_OFFLINE);
- break;
+ case SESSION_ONLINE:
+ SM_SetStatus(gce->pDest->ptszID, gce->pDest->pszModule, wp == SESSION_ONLINE ? ID_STATUS_ONLINE : ID_STATUS_OFFLINE);
+ break;
case WINDOW_CLEARLOG:
- {
- SESSION_INFO* si = SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
- if (si) {
- LM_RemoveAll(&si->pLog, &si->pLogEnd);
- si->iEventCount = 0;
- si->LastTime = 0;
- }
- break;
+ si = SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
+ if (si) {
+ LM_RemoveAll(&si->pLog, &si->pLogEnd);
+ si->iEventCount = 0;
+ si->LastTime = 0;
}
- case SESSION_TERMINATE:
- return SM_RemoveSession(gce->pDest->ptszID, gce->pDest->pszModule, (gce->dwFlags & GCEF_REMOVECONTACT) != 0);
+ break;
+
+ case SESSION_TERMINATE:
+ return SM_RemoveSession(gce->pDest->ptszID, gce->pDest->pszModule, (gce->dwFlags & GCEF_REMOVECONTACT) != 0);
}
SM_SendMessage(gce->pDest->ptszID, gce->pDest->pszModule, GC_EVENT_CONTROL + WM_USER + 500, wp, 0);
- }
+ break;
- else if (gce->pDest->iType == GC_EVENT_CHUID && gce->pszText)
- {
- SM_ChangeUID(gce->pDest->ptszID, gce->pDest->pszModule, gce->ptszNick, gce->ptszText);
- }
+ case GC_EVENT_CHUID:
+ if (gce->pszText)
+ SM_ChangeUID(gce->pDest->ptszID, gce->pDest->pszModule, gce->ptszNick, gce->ptszText);
+ break;
- else if (gce->pDest->iType == GC_EVENT_CHANGESESSIONAME && gce->pszText)
- {
- SESSION_INFO* si = SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
- if (si) {
- replaceStr(&si->ptszName, gce->ptszText);
- if (si->hWnd)
- SendMessage(si->hWnd, GC_UPDATETITLE, 0, 0);
+ case GC_EVENT_CHANGESESSIONAME:
+ if (gce->pszText) {
+ si = SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
+ if (si) {
+ replaceStr(&si->ptszName, gce->ptszText);
+ if (si->hWnd)
+ SendMessage(si->hWnd, GC_UPDATETITLE, 0, 0);
+ }
}
- }
+ break;
- else if (gce->pDest->iType == GC_EVENT_SETITEMDATA) {
- SESSION_INFO* si = SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
+ case GC_EVENT_SETITEMDATA:
+ si = SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
if (si)
si->dwItemData = gce->dwItemData;
- }
+ break;
- else if (gce->pDest->iType == GC_EVENT_GETITEMDATA) {
- SESSION_INFO* si = SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
+ case GC_EVENT_GETITEMDATA:
+ si = SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
if (si) {
gce->dwItemData = si->dwItemData;
return si->dwItemData;
}
return 0;
- }
- else if (gce->pDest->iType == GC_EVENT_SETSBTEXT)
- {
- SESSION_INFO* si = SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
+
+ case GC_EVENT_SETSBTEXT:
+ si = SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
if (si) {
replaceStr(&si->ptszStatusbarText, gce->ptszText);
if (si->ptszStatusbarText)
M->WriteTString(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
else
DBWriteContactSettingString(si->hContact, si->pszModule, "StatusBar", "");
- if (si->hWnd) {
+ if (si->hWnd)
SendMessage(si->hWnd, GC_UPDATESTATUSBAR, 0, 0);
- }
}
- }
- else if (gce->pDest->iType == GC_EVENT_ACK)
- {
+ break;
+
+ case GC_EVENT_ACK:
SM_SendMessage(gce->pDest->ptszID, gce->pDest->pszModule, GC_ACKMESSAGE, 0, 0);
- }
- else if (gce->pDest->iType == GC_EVENT_SENDMESSAGE && gce->pszText)
- {
- SM_SendUserMessage(gce->pDest->ptszID, gce->pDest->pszModule, gce->ptszText);
- }
- else if (gce->pDest->iType == GC_EVENT_SETSTATUSEX)
- {
+ break;
+
+ case GC_EVENT_SENDMESSAGE:
+ if (gce->pszText)
+ SM_SendUserMessage(gce->pDest->ptszID, gce->pDest->pszModule, gce->ptszText);
+ break;
+
+ case GC_EVENT_SETSTATUSEX:
SM_SetStatusEx(gce->pDest->ptszID, gce->pDest->pszModule, gce->ptszText, gce->dwItemData);
+ break;
+
+ default:
+ return 1;
}
- else return 1;
-
return 0;
}
@@ -431,7 +419,7 @@ static void AddUser(GCEVENT * gce) if (si->hWnd) {
SendMessage(si->hWnd, GC_UPDATENICKLIST, (WPARAM)0, (LPARAM)0);
- if(si->dat)
+ if (si->dat)
GetMyNick(si->dat);
}
}
@@ -440,19 +428,10 @@ static void AddUser(GCEVENT * gce) HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateTab, BOOL bPopupContainer, BOOL bWantPopup)
{
- TCHAR *contactName = NULL, newcontactname[128];
- char *szProto, *szStatus;
- WORD wStatus;
- int newItem;
- HWND hwndNew = 0;
- struct TNewWindowData newData = {
- 0
- };
HANDLE hContact = si->hContact;
- HWND hwndTab;
-
if (M->FindWindow(hContact) != 0)
return 0;
+
if (hContact != 0 && M->GetByte("limittabs", 0) && !_tcsncmp(pContainer->szName, _T("default"), 6)) {
if ((pContainer = FindMatchingContainer(_T("default"), hContact)) == NULL) {
TCHAR szName[CONTAINER_NAMELEN + 1];
@@ -461,38 +440,39 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT pContainer = CreateContainer(szName, CNT_CREATEFLAG_CLONED, hContact);
}
}
+
+ TNewWindowData newData = { 0 };
newData.hContact = hContact;
newData.isWchar = 0;
newData.szInitialText = NULL;
- szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) newData.hContact, 0);
-
- ZeroMemory((void *)&newData.item, sizeof(newData.item));
+ memset(&newData.item, 0, sizeof(newData.item));
- contactName = (TCHAR *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM) newData.hContact, GCDNF_TCHAR);
+ TCHAR *contactName = (TCHAR *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM) newData.hContact, GCDNF_TCHAR);
/*
* cut nickname if larger than x chars...
*/
- if (contactName && lstrlen(contactName) > 0) {
+ TCHAR newcontactname[128];
+ if ( lstrlen(contactName) > 0) {
if (M->GetByte("cuttitle", 0))
CutContactName(contactName, newcontactname, safe_sizeof(newcontactname));
else {
lstrcpyn(newcontactname, contactName, safe_sizeof(newcontactname));
newcontactname[127] = 0;
}
- } else
- lstrcpyn(newcontactname, _T("_U_"), sizeof(newcontactname) / sizeof(TCHAR));
+ }
+ else lstrcpyn(newcontactname, _T("_U_"), SIZEOF(newcontactname));
- wStatus = szProto == NULL ? ID_STATUS_OFFLINE : DBGetContactSettingWord((HANDLE) newData.hContact, szProto, "Status", ID_STATUS_OFFLINE);
- szStatus = (char *) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, szProto == NULL ? ID_STATUS_OFFLINE : DBGetContactSettingWord((HANDLE)newData.hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
+ char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) newData.hContact, 0);
+ WORD wStatus = szProto == NULL ? ID_STATUS_OFFLINE : DBGetContactSettingWord((HANDLE) newData.hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ char *szStatus = (char *) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, szProto == NULL ? ID_STATUS_OFFLINE : DBGetContactSettingWord((HANDLE)newData.hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
newData.item.pszText = newcontactname;
-
newData.item.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM;
newData.item.iImage = 0;
- hwndTab = GetDlgItem(pContainer->hwnd, 1159);
+ HWND hwndTab = GetDlgItem(pContainer->hwnd, 1159);
// hide the active tab
if (pContainer->hwndActive && bActivateTab)
@@ -523,7 +503,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT }
}
- newItem = TabCtrl_InsertItem(hwndTab, pContainer->iTabIndex, &newData.item);
+ int newItem = TabCtrl_InsertItem(hwndTab, pContainer->iTabIndex, &newData.item);
SendMessage(hwndTab, EM_REFRESHWITHOUTCLIP, 0, 0);
if (bActivateTab)
TabCtrl_SetCurSel(hwndTab, newItem);
@@ -534,10 +514,10 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT pContainer->iChilds++;
newData.bWantPopup = bWantPopup;
newData.hdbEvent = (HANDLE)si;
- hwndNew = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CHANNEL), GetDlgItem(pContainer->hwnd, 1159), RoomWndProc, (LPARAM) & newData);
- if(pContainer->dwFlags & CNT_SIDEBAR) {
+ HWND hwndNew = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CHANNEL), GetDlgItem(pContainer->hwnd, 1159), RoomWndProc, (LPARAM) & newData);
+ if (pContainer->dwFlags & CNT_SIDEBAR) {
TWindowData *dat = (TWindowData *)GetWindowLongPtr(hwndNew, GWLP_USERDATA);
- if(dat)
+ if (dat)
pContainer->SideBar->addSession(dat, pContainer->iTabIndex);
}
SendMessage(pContainer->hwnd, WM_SIZE, 0, 0);
@@ -546,7 +526,8 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT if (bPopupContainer) {
SendMessage(pContainer->hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
SetFocus(pContainer->hwndActive);
- } else {
+ }
+ else {
if (pContainer->dwFlags & CNT_NOFLASH)
SendMessage(pContainer->hwnd, DM_SETICON, 0, (LPARAM)LoadSkinnedIcon(SKINICON_EVENT_MESSAGE));
else
@@ -560,10 +541,10 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT GetWindowPlacement(pContainer->hwnd, &wp);
BroadCastContainer(pContainer, DM_CHECKSIZE, 0, 0); // make sure all tabs will re-check layout on activation
- if(wp.showCmd == SW_SHOWMAXIMIZED)
+ if (wp.showCmd == SW_SHOWMAXIMIZED)
ShowWindow(pContainer->hwnd, SW_SHOWMAXIMIZED);
else {
- if(bPopupContainer)
+ if (bPopupContainer)
ShowWindow(pContainer->hwnd, SW_SHOWNORMAL);
else
ShowWindow(pContainer->hwnd, SW_SHOWMINNOACTIVE);
@@ -579,7 +560,8 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT SetForegroundWindow(pContainer->hwnd);
}
}
- if(PluginConfig.m_bIsWin7 && PluginConfig.m_useAeroPeek && CSkin::m_skinEnabled && !M->GetByte("forceAeroPeek", 0))
+
+ if (PluginConfig.m_bIsWin7 && PluginConfig.m_useAeroPeek && CSkin::m_skinEnabled && !M->GetByte("forceAeroPeek", 0))
CWarning::show(CWarning::WARN_AEROPEEK_SKIN, MB_ICONWARNING|MB_OK);
return hwndNew; // return handle of the new dialog
}
@@ -589,23 +571,25 @@ void ShowRoom(SESSION_INFO* si, WPARAM wp, BOOL bSetForeground) if (!si)
return;
- if (si->hWnd == NULL) {
- TCHAR szName[CONTAINER_NAMELEN + 2];
- struct TContainerData *pContainer = si->pContainer;
-
- szName[0] = 0;
- if (pContainer == NULL) {
- GetContainerNameForContact(si->hContact, szName, CONTAINER_NAMELEN);
- if (!g_Settings.OpenInDefault && !_tcscmp(szName, _T("default")))
- _tcsncpy(szName, _T("Chat Rooms"), CONTAINER_NAMELEN);
- szName[CONTAINER_NAMELEN] = 0;
- pContainer = FindContainerByName(szName);
- }
- if (pContainer == NULL)
- pContainer = CreateContainer(szName, FALSE, si->hContact);
- si->hWnd = CreateNewRoom(pContainer, si, TRUE, TRUE, FALSE);
- } else
+ if (si->hWnd != NULL) {
ActivateExistingTab(si->pContainer, si->hWnd);
+ return;
+ }
+
+ TCHAR szName[CONTAINER_NAMELEN + 2];
+ TContainerData *pContainer = si->pContainer;
+
+ szName[0] = 0;
+ if (pContainer == NULL) {
+ GetContainerNameForContact(si->hContact, szName, CONTAINER_NAMELEN);
+ if (!g_Settings.OpenInDefault && !_tcscmp(szName, _T("default")))
+ _tcsncpy(szName, _T("Chat Rooms"), CONTAINER_NAMELEN);
+ szName[CONTAINER_NAMELEN] = 0;
+ pContainer = FindContainerByName(szName);
+ }
+ if (pContainer == NULL)
+ pContainer = CreateContainer(szName, FALSE, si->hContact);
+ si->hWnd = CreateNewRoom(pContainer, si, TRUE, TRUE, FALSE);
}
INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam)
@@ -632,7 +616,7 @@ INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam) if (gcd == NULL)
return GC_EVENT_ERROR;
- if (gce->cbSize != SIZEOF_STRUCT_GCEVENT_V1 && gce->cbSize != SIZEOF_STRUCT_GCEVENT_V2)
+ if (gce->cbSize != sizeof(GCEVENT))
return GC_EVENT_WRONGVER;
if (!IsEventSupported(gcd->iType))
@@ -665,90 +649,81 @@ INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam) iRetVal = 0;
goto LBL_Exit;
- case GC_EVENT_CHUID:
- case GC_EVENT_CHANGESESSIONAME:
- case GC_EVENT_SETITEMDATA:
- case GC_EVENT_GETITEMDATA:
- case GC_EVENT_CONTROL:
- case GC_EVENT_SETSBTEXT:
- case GC_EVENT_ACK:
- case GC_EVENT_SENDMESSAGE :
- case GC_EVENT_SETSTATUSEX :
- iRetVal = DoControl(gce, wParam);
- goto LBL_Exit;
+ case GC_EVENT_CHUID:
+ case GC_EVENT_CHANGESESSIONAME:
+ case GC_EVENT_SETITEMDATA:
+ case GC_EVENT_GETITEMDATA:
+ case GC_EVENT_CONTROL:
+ case GC_EVENT_SETSBTEXT:
+ case GC_EVENT_ACK:
+ case GC_EVENT_SENDMESSAGE :
+ case GC_EVENT_SETSTATUSEX :
+ iRetVal = DoControl(gce, wParam);
+ goto LBL_Exit;
- case GC_EVENT_SETCONTACTSTATUS:
- iRetVal = SM_SetContactStatus(gce->pDest->ptszID, gce->pDest->pszModule, gce->ptszUID, (WORD)gce->dwItemData);
- goto LBL_Exit;
+ case GC_EVENT_SETCONTACTSTATUS:
+ iRetVal = SM_SetContactStatus(gce->pDest->ptszID, gce->pDest->pszModule, gce->ptszUID, (WORD)gce->dwItemData);
+ goto LBL_Exit;
- case GC_EVENT_TOPIC: {
- si = SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
- if (si) {
- if (gce->pszText) {
- replaceStr(&si->ptszTopic, RemoveFormatting(gce->ptszText));
- M->WriteTString(si->hContact, si->pszModule , "Topic", /*RemoveFormatting*/(si->ptszTopic));
- if (M->GetByte("Chat", "TopicOnClist", 1))
- M->WriteTString(si->hContact, "CList" , "StatusMsg", /*RemoveFormatting*/(si->ptszTopic));
- if(si->hWnd)
- SendMessage(si->hWnd, DM_INVALIDATEPANEL, 0, 0);
- }
+ case GC_EVENT_TOPIC:
+ si = SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
+ if (si) {
+ if (gce->pszText) {
+ replaceStr(&si->ptszTopic, RemoveFormatting(gce->ptszText));
+ M->WriteTString(si->hContact, si->pszModule , "Topic", /*RemoveFormatting*/(si->ptszTopic));
+ if (M->GetByte("Chat", "TopicOnClist", 1))
+ M->WriteTString(si->hContact, "CList" , "StatusMsg", /*RemoveFormatting*/(si->ptszTopic));
+ if (si->hWnd)
+ SendMessage(si->hWnd, DM_INVALIDATEPANEL, 0, 0);
}
- break;
}
- case GC_EVENT_ADDSTATUS:
- SM_GiveStatus(gce->pDest->ptszID, gce->pDest->pszModule, gce->ptszUID, gce->ptszStatus);
- if (!gce->bIsMe) {
- bIsHighlighted = g_Settings.Highlight->match(gce, 0, CMUCHighlight::MATCH_NICKNAME);
- }
- break;
+ break;
- case GC_EVENT_REMOVESTATUS:
- SM_TakeStatus(gce->pDest->ptszID, gce->pDest->pszModule, gce->ptszUID, gce->ptszStatus);
- if (!gce->bIsMe) {
- bIsHighlighted = g_Settings.Highlight->match(gce, 0, CMUCHighlight::MATCH_NICKNAME);
- }
- break;
+ case GC_EVENT_ADDSTATUS:
+ SM_GiveStatus(gce->pDest->ptszID, gce->pDest->pszModule, gce->ptszUID, gce->ptszStatus);
+ if (!gce->bIsMe)
+ bIsHighlighted = g_Settings.Highlight->match(gce, 0, CMUCHighlight::MATCH_NICKNAME);
+ break;
- case GC_EVENT_MESSAGE:
- case GC_EVENT_ACTION: {
- si = SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
- if (!(gce->dwFlags & GC_UNICODE)) {
- fFreeText = TRUE;
- if (si)
- gce->ptszText = a2tf(gce->ptszText, gce->dwFlags, M->GetDword(si->hContact, "ANSIcodepage", 0));
- else
- gce->ptszText = a2tf(gce->ptszText, gce->dwFlags);
- }
- if (!gce->bIsMe && gce->pDest->pszID && gce->pszText) {
- if (si)
- bIsHighlighted = si->Highlight->match(gce, si, CMUCHighlight::MATCH_TEXT | CMUCHighlight::MATCH_NICKNAME);
- }
- }
+ case GC_EVENT_REMOVESTATUS:
+ SM_TakeStatus(gce->pDest->ptszID, gce->pDest->pszModule, gce->ptszUID, gce->ptszStatus);
+ if (!gce->bIsMe)
+ bIsHighlighted = g_Settings.Highlight->match(gce, 0, CMUCHighlight::MATCH_NICKNAME);
break;
- case GC_EVENT_NICK:
- SM_ChangeNick(gce->pDest->ptszID, gce->pDest->pszModule, gce);
- if (!gce->bIsMe) {
- bIsHighlighted = g_Settings.Highlight->match(gce, 0, CMUCHighlight::MATCH_NICKNAME);
- }
+ case GC_EVENT_MESSAGE:
+ case GC_EVENT_ACTION:
+ si = SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
+ if (!(gce->dwFlags & GC_UNICODE)) {
+ fFreeText = TRUE;
+ if (si)
+ gce->ptszText = a2tf(gce->ptszText, gce->dwFlags, M->GetDword(si->hContact, "ANSIcodepage", 0));
+ else
+ gce->ptszText = a2tf(gce->ptszText, gce->dwFlags);
+ }
+ if (!gce->bIsMe && gce->pDest->pszID && gce->pszText && si)
+ bIsHighlighted = si->Highlight->match(gce, si, CMUCHighlight::MATCH_TEXT | CMUCHighlight::MATCH_NICKNAME);
+ break;
- break;
+ case GC_EVENT_NICK:
+ SM_ChangeNick(gce->pDest->ptszID, gce->pDest->pszModule, gce);
+ if (!gce->bIsMe)
+ bIsHighlighted = g_Settings.Highlight->match(gce, 0, CMUCHighlight::MATCH_NICKNAME);
+ break;
- case GC_EVENT_JOIN:
- AddUser(gce);
- if (!gce->bIsMe) {
- bIsHighlighted = g_Settings.Highlight->match(gce, 0, CMUCHighlight::MATCH_NICKNAME);
- }
- break;
+ case GC_EVENT_JOIN:
+ AddUser(gce);
+ if (!gce->bIsMe)
+ bIsHighlighted = g_Settings.Highlight->match(gce, 0, CMUCHighlight::MATCH_NICKNAME);
+ break;
- case GC_EVENT_PART:
- case GC_EVENT_QUIT:
- case GC_EVENT_KICK:
- bRemoveFlag = TRUE;
- if (!gce->bIsMe) {
- bIsHighlighted = g_Settings.Highlight->match(gce, 0, CMUCHighlight::MATCH_NICKNAME);
- }
- break;
+ case GC_EVENT_PART:
+ case GC_EVENT_QUIT:
+ case GC_EVENT_KICK:
+ bRemoveFlag = TRUE;
+ if (!gce->bIsMe)
+ bIsHighlighted = g_Settings.Highlight->match(gce, 0, CMUCHighlight::MATCH_NICKNAME);
+ break;
}
// Decide which window (log) should have the event
@@ -773,7 +748,7 @@ INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam) if (!bRemoveFlag) {
iRetVal = 0;
goto LBL_Exit;
- } }
+ } }
// add to log
if (pWnd) {
@@ -806,7 +781,7 @@ INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam) if (!bRemoveFlag) {
iRetVal = 0;
goto LBL_Exit;
- } }
+ } }
if (bRemoveFlag)
iRetVal = (SM_RemoveUser(gce->pDest->ptszID, gce->pDest->pszModule, gce->ptszUID) == 0) ? 1 : 0;
@@ -858,11 +833,11 @@ int CreateServiceFunctions(void) {
PluginConfig.m_chat_enabled = false;
- if(ServiceExists(MS_GC_REGISTER)) {
+ if (ServiceExists(MS_GC_REGISTER)) {
LRESULT result = CWarning::show(CWarning::WARN_CHAT_ENABLED, CWarning::CWF_NOALLOWHIDE | MB_YESNOCANCEL | MB_ICONQUESTION);
- if(result == IDYES)
- M->WriteByte("PluginDisable", "chat.dll", 1);
- return(0);
+ if (result == IDYES)
+ M->WriteByte("PluginDisable", "chat.dll", 1);
+ return 0;
}
PluginConfig.m_chat_enabled = true;
@@ -877,7 +852,7 @@ int CreateServiceFunctions(void) hEventPrebuildMenu = CreateServiceFunction("GChat/PrebuildMenuEvent", CList_PrebuildContactMenuSvc);
hEventJoinChat = CreateServiceFunction("GChat/JoinChat", CList_JoinChat);
hEventLeaveChat = CreateServiceFunction("GChat/LeaveChat", CList_LeaveChat);
- return(1);
+ return 1;
}
void DestroyServiceFunctions(void)
@@ -905,4 +880,3 @@ void DestroyHookableEvents(void) DestroyHookableEvent(hSendEvent);
DestroyHookableEvent(hBuildMenuEvent);
}
-
diff --git a/plugins/TabSRMM/chat/tools.cpp b/plugins/TabSRMM/chat/tools.cpp index 04fba1aa40..f9b0bb786c 100644 --- a/plugins/TabSRMM/chat/tools.cpp +++ b/plugins/TabSRMM/chat/tools.cpp @@ -73,7 +73,7 @@ TCHAR* RemoveFormatting(const TCHAR* pszWord, bool fToLower, bool fStripCR, TCHA TCHAR* szTemp = 0;
size_t _buflen = 0;
- if(0 == buf) {
+ if (0 == buf) {
szTemp = _szTemp;
_buflen = 20000;
} else {
@@ -124,8 +124,8 @@ TCHAR* RemoveFormatting(const TCHAR* pszWord, bool fToLower, bool fStripCR, TCHA break;
}
} else {
- if(fStripCR) {
- if(0x0a == pszWord[i] || 0x0c == pszWord[i]) {
+ if (fStripCR) {
+ if (0x0a == pszWord[i] || 0x0c == pszWord[i]) {
szTemp[j++] = ' ';
i++;
continue;
@@ -136,7 +136,7 @@ TCHAR* RemoveFormatting(const TCHAR* pszWord, bool fToLower, bool fStripCR, TCHA i++;
}
}
- if(fToLower) {
+ if (fToLower) {
_wsetlocale(LC_ALL, L"");
wcslwr(szTemp);
}
@@ -174,8 +174,8 @@ static INT_PTR CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA if (HIWORD(wParam) == STN_CLICKED) {
SESSION_INFO* si = (SESSION_INFO*)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd, (LPARAM)0);;
- if(si) {
- if(nen_options.maskActL & MASK_OPEN)
+ if (si) {
+ if (nen_options.maskActL & MASK_OPEN)
Chat_OpenPopup(si, hWnd);
else
Chat_DismissPopup(si, hWnd);
@@ -186,8 +186,8 @@ static INT_PTR CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA case WM_CONTEXTMENU: {
SESSION_INFO* si = (SESSION_INFO*)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd, (LPARAM)0);
- if(si && si->hContact) {
- if(nen_options.maskActR & MASK_OPEN)
+ if (si && si->hContact) {
+ if (nen_options.maskActR & MASK_OPEN)
Chat_OpenPopup(si, hWnd);
else
Chat_DismissPopup(si, hWnd);
@@ -338,10 +338,10 @@ static BOOL DoPopup(SESSION_INFO* si, GCEVENT* gce, struct TWindowData* dat) if (dat && pContainer != 0) { // message window is open, need to check the container config if we want to see a popup nonetheless
if (nen_options.bWindowCheck) { // no popups at all for open windows... no exceptions
if (!PluginConfig.m_HideOnClose)
- return(0);
- if(pContainer->fHidden)
+ return 0;
+ if (pContainer->fHidden)
goto passed;
- return(0);
+ return 0;
}
if (pContainer->dwFlags & CNT_DONTREPORT && IsIconic(pContainer->hwnd)) // in tray counts as "minimised"
goto passed;
@@ -442,7 +442,7 @@ void TSAPI DoFlashAndSoundWorker(FLASH_PARAMS* p) SESSION_INFO* si = SM_FindSessionByHCONTACT(p->hContact);
TWindowData* dat = 0;
- if(si == 0)
+ if (si == 0)
return;
if (si->hWnd) {
@@ -454,7 +454,7 @@ void TSAPI DoFlashAndSoundWorker(FLASH_PARAMS* p) if (p->sound && Utils::mustPlaySound(si->dat))
SkinPlaySound(p->sound);
}
- else if(p->sound)
+ else if (p->sound)
SkinPlaySound(p->sound);
if (dat) {
@@ -473,7 +473,7 @@ void TSAPI DoFlashAndSoundWorker(FLASH_PARAMS* p) SetTimer(si->hWnd, TIMERID_FLASHWND, TIMEOUT_FLASHWND, NULL);
}
}
- if(dat->pWnd) {
+ if (dat->pWnd) {
dat->pWnd->updateIcon(p->hNotifyIcon);
dat->pWnd->setOverlayIcon(p->hNotifyIcon, true);
}
@@ -539,7 +539,7 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO* si, GCEVENT * gce, BOOL bHighligh params = (FLASH_PARAMS*)calloc(1, sizeof(FLASH_PARAMS));
params->hContact = si->hContact;
params->bInactive = TRUE;
- if(si->hWnd && si->dat) {
+ if (si->hWnd && si->dat) {
dat = si->dat;
if ((si->hWnd == si->dat->pContainer->hwndActive) && GetForegroundWindow() == si->dat->pContainer->hwnd)
params->bInactive = FALSE;
@@ -560,10 +560,10 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO* si, GCEVENT * gce, BOOL bHighligh /* TODO fix for 3.0 final !!! */
#if !defined(__DELAYED_FOR_3_1)
- if(g_Settings.CreateWindowOnHighlight && 0 == dat)
+ if (g_Settings.CreateWindowOnHighlight && 0 == dat)
wParamForHighLight = 1;
- if(dat && g_Settings.AnnoyingHighlight && params->bInactive && dat->pContainer->hwnd != GetForegroundWindow()) {
+ if (dat && g_Settings.AnnoyingHighlight && params->bInactive && dat->pContainer->hwnd != GetForegroundWindow()) {
wParamForHighLight = 2;
params->hWnd = dat->hwnd;
}
@@ -580,7 +580,7 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO* si, GCEVENT * gce, BOOL bHighligh // do blinking icons in tray
if (params->bInactive || !g_Settings.TrayIconInactiveOnly) {
DoTrayIcon(si, gce);
- if(params->iEvent == GC_EVENT_MESSAGE)
+ if (params->iEvent == GC_EVENT_MESSAGE)
fFlagUnread = true;
}
// stupid thing to not create multiple popups for a QUIT event for instance
@@ -687,9 +687,9 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO* si, GCEVENT * gce, BOOL bHighligh params->hNotifyIcon = hIcons[ICON_MESSAGE];
}
}
- if(dat && fFlagUnread) {
+ if (dat && fFlagUnread) {
dat->dwUnread++;
- if(dat->pWnd)
+ if (dat->pWnd)
dat->pWnd->Invalidate();
}
PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_MUCFLASHWORKER, wParamForHighLight, (LPARAM)params);
@@ -1284,13 +1284,13 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime) TCHAR *tszNow = MakeTimeStamp(_T("%a%d%m%Y"), tTime);
- if(_tcscmp(tszOldTimeStamp, tszNow)) {
+ if (_tcscmp(tszOldTimeStamp, tszNow)) {
_tcsncpy(tszOldTimeStamp, tszNow, 30);
tszOldTimeStamp[29] = 0;
fReparse = true;
}
- if(fReparse || 0 == si->pszLogFileName[0]) {
+ if (fReparse || 0 == si->pszLogFileName[0]) {
rva[0].lptzKey = _T("d");
rva[0].lptzValue = mir_tstrdup(MakeTimeStamp(_T("%#d"), tTime));
// day 01-31
diff --git a/plugins/TabSRMM/chat/window.cpp b/plugins/TabSRMM/chat/window.cpp index 0925f5209b..668428cdf2 100644 --- a/plugins/TabSRMM/chat/window.cpp +++ b/plugins/TabSRMM/chat/window.cpp @@ -262,7 +262,7 @@ static void Chat_UpdateWindowState(TWindowData *dat, UINT msg) }
}
- if(si->hwndFilter) {
+ if (si->hwndFilter) {
POINT pt;
RECT rcFilter;
@@ -275,14 +275,14 @@ static void Chat_UpdateWindowState(TWindowData *dat, UINT msg) }
#if defined(__FEAT_EXP_AUTOSPLITTER)
- if(dat->fIsAutosizingInput && dat->iInputAreaHeight == -1) {
+ if (dat->fIsAutosizingInput && dat->iInputAreaHeight == -1) {
dat->iInputAreaHeight = 0;
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_REQUESTRESIZE, 0, 0);
}
#endif
dat->Panel->dismissConfig();
dat->dwUnread = 0;
- if(dat->pWnd) {
+ if (dat->pWnd) {
dat->pWnd->activateTab();
dat->pWnd->setOverlayIcon(0, true);
}
@@ -365,13 +365,13 @@ static void Chat_UpdateWindowState(TWindowData *dat, UINT msg) }
*/
}
- if(M->isAero())
+ if (M->isAero())
InvalidateRect(hwndTab, NULL, FALSE);
- if(dat->pContainer->dwFlags & CNT_SIDEBAR)
+ if (dat->pContainer->dwFlags & CNT_SIDEBAR)
dat->pContainer->SideBar->setActiveItem(dat);
BB_SetButtonsPos(dat);
- if(dat->pWnd)
+ if (dat->pWnd)
dat->pWnd->Invalidate();
}
@@ -450,7 +450,7 @@ static int RoomWndResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *urc) GetClientRect(hwndDlg, &rcTabs);
TabHeight = rcTabs.bottom - rcTabs.top;
- if(dat->fIsAutosizingInput)
+ if (dat->fIsAutosizingInput)
Utils::showDlgControl(hwndDlg, IDC_SPLITTERY, SW_HIDE);
if (si->iType != GCW_SERVER) {
@@ -541,7 +541,7 @@ static int RoomWndResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *urc) urc->rcItem.bottom = urc->dlgNewSize.cy; // - 1 ;
msgBottom = urc->rcItem.bottom;
- if(dat->fIsAutosizingInput)
+ if (dat->fIsAutosizingInput)
urc->rcItem.top -= DPISCALEY_S(1);
msgTop = urc->rcItem.top;
@@ -578,13 +578,13 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, dat = (MESSAGESUBDATA *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
- if(mwdat->fkeyProcessed && (msg == WM_KEYUP)) {
+ if (mwdat->fkeyProcessed && (msg == WM_KEYUP)) {
GetKeyboardState(mwdat->kstate);
- if(mwdat->kstate[VK_CONTROL] & 0x80 || mwdat->kstate[VK_SHIFT] & 0x80)
- return(0);
+ if (mwdat->kstate[VK_CONTROL] & 0x80 || mwdat->kstate[VK_SHIFT] & 0x80)
+ return 0;
else {
mwdat->fkeyProcessed = false;
- return(0);
+ return 0;
}
}
switch (msg) {
@@ -675,24 +675,24 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, }
case WM_SYSKEYUP:
- if(wParam == VK_MENU) {
+ if (wParam == VK_MENU) {
ProcessHotkeysByMsgFilter(hwnd, msg, wParam, lParam, IDC_CHAT_MESSAGE);
- return(0);
+ return 0;
}
break;
case WM_SYSKEYDOWN:
mwdat->fkeyProcessed = false;
- if(ProcessHotkeysByMsgFilter(hwnd, msg, wParam, lParam, IDC_CHAT_MESSAGE)) {
+ if (ProcessHotkeysByMsgFilter(hwnd, msg, wParam, lParam, IDC_CHAT_MESSAGE)) {
mwdat->fkeyProcessed = true;
- return(0);
+ return 0;
}
break;
case WM_SYSCHAR: {
- if(mwdat->fkeyProcessed) {
+ if (mwdat->fkeyProcessed) {
mwdat->fkeyProcessed = false; // preceeding key event has been processed by miranda hotkey service
- return(0);
+ return 0;
}
BOOL isMenu = GetKeyState(VK_MENU) & 0x8000;
@@ -715,7 +715,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, KbdState(mwdat, isShift, isCtrl, isAlt);
//MAD: sound on typing..
- if(PluginConfig.g_bSoundOnTyping && !isAlt &&!isCtrl&&!(mwdat->pContainer->dwFlags&CNT_NOSOUND)&&wParam!=VK_ESCAPE&&!(wParam==VK_TAB&&PluginConfig.m_AllowTab))
+ if (PluginConfig.g_bSoundOnTyping && !isAlt &&!isCtrl&&!(mwdat->pContainer->dwFlags&CNT_NOSOUND)&&wParam!=VK_ESCAPE&&!(wParam==VK_TAB&&PluginConfig.m_AllowTab))
SkinPlaySound("SoundOnTyping");
//MAD
@@ -733,24 +733,24 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, SendMessage(hwnd, WM_KEYDOWN, mwdat->dwFlags & MWF_LOG_RTL ? VK_RIGHT : VK_LEFT, 0);
return 0;
}
- if(isCtrl && !isAlt && !isShift) {
+ if (isCtrl && !isAlt && !isShift) {
MODULEINFO* mi = MM_FindModule(Parentsi->pszModule);
switch(wParam) {
case 0x09: // ctrl-i (italics)
- if(mi && mi->bItalics) {
+ if (mi && mi->bItalics) {
CheckDlgButton(hwndParent, IDC_ITALICS, IsDlgButtonChecked(hwndParent, IDC_ITALICS) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_ITALICS, 0), 0);
}
- return(0);
+ return 0;
case 0x02: // ctrl-b (bold)
- if(mi && mi->bBold) {
+ if (mi && mi->bBold) {
CheckDlgButton(hwndParent, IDC_CHAT_BOLD, IsDlgButtonChecked(hwndParent, IDC_CHAT_BOLD) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_CHAT_BOLD, 0), 0);
}
return 0;
case 0x20: // ctrl-space clear formatting
- if(mi && mi->bBold && mi->bItalics && mi->bUnderline) {
+ if (mi && mi->bBold && mi->bItalics && mi->bUnderline) {
CheckDlgButton(hwndParent, IDC_BKGCOLOR, BST_UNCHECKED);
CheckDlgButton(hwndParent, IDC_COLOR, BST_UNCHECKED);
CheckDlgButton(hwndParent, IDC_CHAT_BOLD, BST_UNCHECKED);
@@ -764,19 +764,19 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, }
return 0;
case 0x0c: // ctrl-l background color
- if(mi && mi->bBkgColor) {
+ if (mi && mi->bBkgColor) {
CheckDlgButton(hwndParent, IDC_BKGCOLOR, IsDlgButtonChecked(hwndParent, IDC_BKGCOLOR) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_BKGCOLOR, 0), 0);
}
return 0;
case 0x15: // ctrl-u underlined
- if(mi && mi->bUnderline) {
+ if (mi && mi->bUnderline) {
CheckDlgButton(hwndParent, IDC_CHAT_UNDERLINE, IsDlgButtonChecked(hwndParent, IDC_CHAT_UNDERLINE) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_CHAT_UNDERLINE, 0), 0);
}
return 0; // ctrl-k color
case 0x0b:
- if(mi && mi->bColor) {
+ if (mi && mi->bColor) {
CheckDlgButton(hwndParent, IDC_COLOR, IsDlgButtonChecked(hwndParent, IDC_COLOR) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_COLOR, 0), 0);
}
@@ -796,7 +796,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, KbdState(mwdat, isShift, isCtrl, isAlt);
//MAD: sound on typing..
- if(PluginConfig.g_bSoundOnTyping&&!isAlt&&wParam == VK_DELETE)
+ if (PluginConfig.g_bSoundOnTyping&&!isAlt&&wParam == VK_DELETE)
SkinPlaySound("SoundOnTyping");
//
if (wParam == VK_INSERT && !isShift && !isCtrl && !isAlt) {
@@ -906,7 +906,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, SendMessage(hwnd, EM_GETTEXTEX, (WPARAM)>, (LPARAM)pszText);
- if(start > 1 && pszText[start-1] == ' ' && pszText[start-2] == ':')
+ if (start > 1 && pszText[start-1] == ' ' && pszText[start-2] == ':')
start--;
while( start > 0 && pszText[start-1] != ' ' && pszText[start-1] != 13 && pszText[start-1] != VK_TAB)
@@ -915,7 +915,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, while (end < iLen && pszText[end] != ' ' && pszText[end] != 13 && pszText[end-1] != VK_TAB)
end ++;
- if(pszText[start] == '#')
+ if (pszText[start] == '#')
isRoom = TRUE;
else {
topicStart = (int)start;
@@ -965,7 +965,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, SendMessage(hwnd, EM_SETSEL, start, end);
SendMessage(hwnd, EM_REPLACESEL, TRUE, (LPARAM)pszName);
}
- if(pszText)
+ if (pszText)
mir_free(pszText);
fCompleted = true;
}
@@ -1132,7 +1132,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, if (mi && mi->bUnderline) {
u = IsDlgButtonChecked(hwndParent, IDC_CHAT_UNDERLINE);
- if(cf.dwEffects & CFE_UNDERLINE && (cf.bUnderlineType & CFU_UNDERLINE || cf.bUnderlineType & CFU_UNDERLINEWORD)) {
+ if (cf.dwEffects & CFE_UNDERLINE && (cf.bUnderlineType & CFU_UNDERLINE || cf.bUnderlineType & CFU_UNDERLINEWORD)) {
if (u == BST_UNCHECKED )
CheckDlgButton(hwndParent, IDC_CHAT_UNDERLINE, BST_CHECKED);
}
@@ -1373,7 +1373,7 @@ static LRESULT CALLBACK LogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR POINT pt={LOWORD(lParam), HIWORD(lParam)};
CheckCustomLink(hwnd, &pt, msg, wParam, lParam, TRUE);
}
- if(true || M->GetByte("autocopy", 0)) {
+ if (true || M->GetByte("autocopy", 0)) {
SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM) &sel);
if (sel.cpMin != sel.cpMax) {
SendMessage(hwnd, WM_COPY, 0, 0);
@@ -1393,24 +1393,24 @@ static LRESULT CALLBACK LogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR break;
case WM_SYSKEYUP:
- if(wParam == VK_MENU) {
+ if (wParam == VK_MENU) {
ProcessHotkeysByMsgFilter(hwnd, msg, wParam, lParam, IDC_CHAT_LOG);
- return(0);
+ return 0;
}
break;
case WM_SYSKEYDOWN:
mwdat->fkeyProcessed = false;
- if(ProcessHotkeysByMsgFilter(hwnd, msg, wParam, lParam, IDC_CHAT_LOG)) {
+ if (ProcessHotkeysByMsgFilter(hwnd, msg, wParam, lParam, IDC_CHAT_LOG)) {
mwdat->fkeyProcessed = true;
- return(0);
+ return 0;
}
break;
case WM_SYSCHAR: {
- if(mwdat->fkeyProcessed) {
+ if (mwdat->fkeyProcessed) {
mwdat->fkeyProcessed = false;
- return(0);
+ return 0;
}
break;
}
@@ -1759,7 +1759,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, RECT rc, rcWnd;
THighLightEdit the = {THighLightEdit::CMD_ADD, parentdat, ui};
- if(parentdat && ui) {
+ if (parentdat && ui) {
HWND hwnd = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_ADDHIGHLIGHT), parentdat->dat->pContainer->hwnd, CMUCHighlight::dlgProcAdd, (LPARAM)&the);
TranslateDialogDefault(hwnd);
GetClientRect(parentdat->pContainer->hwnd, &rcWnd);
@@ -1987,13 +1987,13 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (!dat->pContainer->settings->fPrivate)
psi->iSplitterY = g_Settings.iSplitterY;
else {
- if(M->GetByte("Chat", "SyncSplitter", 0))
+ if (M->GetByte("Chat", "SyncSplitter", 0))
psi->iSplitterY = dat->pContainer->settings->splitterPos - DPISCALEY_S(23);
else
psi->iSplitterY = g_Settings.iSplitterY;
}
#if defined(__FEAT_EXP_AUTOSPLITTER)
- if(dat->fIsAutosizingInput)
+ if (dat->fIsAutosizingInput)
psi->iSplitterY = GetDefaultMinimumInputHeight(dat);
#endif
dat->pWnd = 0;
@@ -2122,8 +2122,8 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar BOOL fNoCopy = TRUE;
const TCHAR* szNick = dat->cache->getNick();
- if(dat->bWasDeleted)
- return(0);
+ if (dat->bWasDeleted)
+ return 0;
dat->wStatus = si->wStatus;
@@ -2156,7 +2156,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar break;
}
- if(dat->pWnd) {
+ if (dat->pWnd) {
dat->pWnd->updateTitle(dat->newtitle);
dat->pWnd->updateIcon(hIcon);
}
@@ -2186,8 +2186,8 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar break;
case GC_UPDATESTATUSBAR:
- if(dat->bWasDeleted)
- return(0);
+ if (dat->bWasDeleted)
+ return 0;
if (dat->pContainer->hwndActive != hwndDlg || dat->pContainer->hwndStatus == 0 || CMimAPI::m_shutDown || dat->szStatusBar[0])
break;
@@ -2207,15 +2207,15 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar x += GetTextPixelSize(mi->ptszModDispName, (HFONT)SendMessage(dat->pContainer->hwndStatus, WM_GETFONT, 0, 0), TRUE);
x += GetSystemMetrics(SM_CXSMICON);
- if(dat->Panel->isActive()) {
+ if (dat->Panel->isActive()) {
time_t now = time(0);
DWORD diff = (now - mi->idleTimeStamp) / 60;
if ((diff >= 1 && diff != mi->lastIdleCheck) || lParam) {
mi->lastIdleCheck = diff;
- if(diff == 0)
+ if (diff == 0)
mi->tszIdleMsg[0] = 0;
- else if(diff > 59) {
+ else if (diff > 59) {
DWORD hours = diff / 60;
DWORD minutes = diff % 60;
mir_sntprintf(mi->tszIdleMsg, 60, TranslateT(", %d %s, %d %s idle"), hours, hours > 1 ?
@@ -2238,7 +2238,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar SendMessage(dat->pContainer->hwndStatus, SB_SETTEXT, 0, (LPARAM)szFinalStatusBarText);
UpdateStatusBar(dat);
dat->Panel->Invalidate();
- if(dat->pWnd)
+ if (dat->pWnd)
dat->pWnd->Invalidate();
return TRUE;
}
@@ -2359,7 +2359,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar MEASUREITEMSTRUCT *mis = (MEASUREITEMSTRUCT *) lParam;
if (mis->CtlType == ODT_MENU) {
- if(dat->Panel->isHovered()) {
+ if (dat->Panel->isHovered()) {
mis->itemHeight = 0;
mis->itemWidth = 6;
return(TRUE);
@@ -2375,7 +2375,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *) lParam;
if (dis->CtlType == ODT_MENU) {
- if(dat->Panel->isHovered()) {
+ if (dat->Panel->isHovered()) {
DrawMenuItem(dis, (HICON)dis->itemData, 0);
return(TRUE);
}
@@ -2491,7 +2491,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case WM_CONTEXTMENU:{
//mad
DWORD idFrom=GetDlgCtrlID((HWND)wParam);
- if(idFrom>=MIN_CBUTTONID&&idFrom<=MAX_CBUTTONID)
+ if (idFrom>=MIN_CBUTTONID&&idFrom<=MAX_CBUTTONID)
BB_CustomButtonClick(dat,idFrom,(HWND) wParam,1);
}break;
//
@@ -2612,7 +2612,7 @@ LABEL_SHOWWINDOW: dat->Panel->setHeight(pt.y + 2);
dat->panelWidth = -1;
RedrawWindow(hwndDlg, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
- if(M->isAero())
+ if (M->isAero())
InvalidateRect(GetParent(hwndDlg), NULL, FALSE);
SendMessage(hwndDlg, WM_SIZE, DM_SPLITTERMOVED, 0);
break;
@@ -2659,7 +2659,7 @@ LABEL_SHOWWINDOW: case DM_SPLITTERGLOBALEVENT: {
DM_SplitterGlobalEvent(dat, wParam, lParam);
- return(0);
+ return 0;
}
case GC_SHOWCOLORCHOOSER: {
@@ -2718,22 +2718,22 @@ LABEL_SHOWWINDOW: message.lParam = lp;
message.wParam = wp;
- if(msg == WM_SYSKEYUP) {
- if(wp == VK_MENU) {
+ if (msg == WM_SYSKEYUP) {
+ if (wp == VK_MENU) {
if (!dat->fkeyProcessed && !(GetKeyState(VK_CONTROL) & 0x8000) && !(GetKeyState(VK_SHIFT) & 0x8000) && !(lp & (1 << 24)))
dat->pContainer->MenuBar->autoShow();
}
return(_dlgReturn(hwndDlg, 0));
}
- if(msg == WM_MOUSEMOVE) {
+ if (msg == WM_MOUSEMOVE) {
POINT pt;
GetCursorPos(&pt);
DM_DismissTip(dat, pt);
dat->Panel->trackMouse(pt);
break;
}
- if(msg == WM_KEYDOWN) {
+ if (msg == WM_KEYDOWN) {
if ((wp == VK_INSERT && isShift && !isCtrl && !isMenu) || (wp == 'V' && !isShift && !isMenu && isCtrl)) {
SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_PASTESPECIAL, CF_TEXTT, 0);
((MSGFILTER *) lParam)->msg = WM_NULL;
@@ -2743,18 +2743,18 @@ LABEL_SHOWWINDOW: }
}
- if(msg == WM_LBUTTONDOWN || msg == WM_RBUTTONDOWN || msg == WM_MBUTTONDOWN)
+ if (msg == WM_LBUTTONDOWN || msg == WM_RBUTTONDOWN || msg == WM_MBUTTONDOWN)
dat->pContainer->MenuBar->Cancel();
if ((msg == WM_KEYDOWN || msg == WM_SYSKEYDOWN) && !(GetKeyState(VK_RMENU) & 0x8000)) {
- if(DM_GenericHotkeysCheck(&message, dat)) {
+ if (DM_GenericHotkeysCheck(&message, dat)) {
dat->fkeyProcessed = true;
return(_dlgReturn(hwndDlg, 1));
}
LRESULT mim_hotkey_check = CallService(MS_HOTKEY_CHECK, (WPARAM)&message, (LPARAM)(TABSRMM_HK_SECTION_GC));
- if(mim_hotkey_check)
+ if (mim_hotkey_check)
dat->fkeyProcessed = true;
switch(mim_hotkey_check) { // nothing (yet) FIXME
case TABSRMM_HK_CHANNELMGR:
@@ -2768,7 +2768,7 @@ LABEL_SHOWWINDOW: SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_SHOWNICKLIST, BN_CLICKED), 0);
return(_dlgReturn(hwndDlg, 1));
case TABSRMM_HK_MUC_SHOWSERVER:
- if(si->iType != GCW_SERVER)
+ if (si->iType != GCW_SERVER)
DoEventHookAsync(hwndDlg, si->ptszID, si->pszModule, GC_USER_MESSAGE, NULL, L"/servershow", (LPARAM)NULL);
return(_dlgReturn(hwndDlg, 1));
default:
@@ -2776,7 +2776,7 @@ LABEL_SHOWWINDOW: }
}
- if(msg == WM_KEYDOWN && wp == VK_TAB) {
+ if (msg == WM_KEYDOWN && wp == VK_TAB) {
if (((NMHDR *)lParam)->idFrom == IDC_CHAT_LOG) {
SetFocus(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
return(_dlgReturn(hwndDlg, 1));
@@ -2896,7 +2896,7 @@ LABEL_SHOWWINDOW: }
case EN_REQUESTRESIZE: {
- if(pNmhdr->idFrom == IDC_CHAT_MESSAGE) {
+ if (pNmhdr->idFrom == IDC_CHAT_MESSAGE) {
REQRESIZE *rr = (REQRESIZE *)lParam;
DM_HandleAutoSizeRequest(dat, rr);
}
@@ -3084,7 +3084,7 @@ LABEL_SHOWWINDOW: POINT tmp; //+ Protogenes
POINTS cur; //+ Protogenes
GetCursorPos(&tmp); //+ Protogenes
- if(dat->Panel->isHovered())
+ if (dat->Panel->isHovered())
dat->Panel->handleClick(tmp);
else {
cur.x = (SHORT)tmp.x; //+ Protogenes
@@ -3112,7 +3112,7 @@ LABEL_SHOWWINDOW: case WM_COMMAND:
//mad
- if(LOWORD(wParam)>=MIN_CBUTTONID&&LOWORD(wParam)<=MAX_CBUTTONID){
+ if (LOWORD(wParam)>=MIN_CBUTTONID&&LOWORD(wParam)<=MAX_CBUTTONID){
BB_CustomButtonClick(dat,LOWORD(wParam) ,GetDlgItem(hwndDlg,LOWORD(wParam)),0);
break;
}
@@ -3176,14 +3176,14 @@ LABEL_SHOWWINDOW: ptszText = Chat_DoRtfToTags(pszRtf, si);
DoTrimMessage(ptszText);
- if(mi && mi->bAckMsg) {
+ if (mi && mi->bAckMsg) {
Utils::enableDlgControl(hwndDlg, IDC_CHAT_MESSAGE, FALSE);
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_SETREADONLY, TRUE, 0);
} else SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, WM_SETTEXT, 0, (LPARAM)_T(""));
Utils::enableDlgControl(hwndDlg, IDOK, FALSE);
- if(ptszText[0] == '/' || si->iType == GCW_SERVER)
+ if (ptszText[0] == '/' || si->iType == GCW_SERVER)
fSound = false;
DoEventHookAsync(hwndDlg, si->ptszID, si->pszModule, GC_USER_MESSAGE, NULL, ptszText, (LPARAM)NULL);
mi->idleTimeStamp = time(0);
@@ -3403,7 +3403,7 @@ LABEL_SHOWWINDOW: LONG cx = rcClient.right - rcClient.left;
LONG cy = rcClient.bottom - rcClient.top;
- if(CMimAPI::m_haveBufferedPaint)
+ if (CMimAPI::m_haveBufferedPaint)
hbp = CSkin::InitiateBufferedPaint(hdc, rcClient, hdcMem);
else {
hdcMem = CreateCompatibleDC(hdc);
@@ -3411,7 +3411,7 @@ LABEL_SHOWWINDOW: hbmOld = (HBITMAP)SelectObject(hdcMem, hbm);
}
- if(CSkin::m_skinEnabled && !fAero) {
+ if (CSkin::m_skinEnabled && !fAero) {
CSkin::SkinDrawBG(hwndDlg, dat->pContainer->hwnd, dat->pContainer, &rcClient, hdcMem);
for (i = 0; i < 3; i++) {
item = &SkinItems[item_ids[i]];
@@ -3432,7 +3432,7 @@ LABEL_SHOWWINDOW: else {
CSkin::FillBack(hdcMem, &rcClient);
- if(M->isAero()) {
+ if (M->isAero()) {
LONG temp = rcClient.bottom;
rcClient.bottom = dat->Panel->isActive() ? dat->Panel->getHeight() + 5 : 5;
FillRect(hdcMem, &rcClient, (HBRUSH)GetStockObject(BLACK_BRUSH));
@@ -3449,7 +3449,7 @@ LABEL_SHOWWINDOW: if (!CSkin::m_skinEnabled)
CSkin::RenderToolbarBG(dat, hdcMem, rcClient);
- if(hbp)
+ if (hbp)
CSkin::FinalizeBufferedPaint(hbp, &rcClient);
else {
BitBlt(hdc, 0, 0, cx, cy, hdcMem, 0, 0, SRCCOPY);
@@ -3459,7 +3459,7 @@ LABEL_SHOWWINDOW: }
if (!dat->fLimitedUpdate)
SetAeroMargins(dat->pContainer);
- return(1);
+ return 1;
}
case WM_NCPAINT:
@@ -3475,12 +3475,12 @@ LABEL_SHOWWINDOW: case DM_SETINFOPANEL:
CInfoPanel::setPanelHandler(dat, wParam, lParam);
- return(0);
+ return 0;
case DM_INVALIDATEPANEL:
- if(dat->Panel)
+ if (dat->Panel)
dat->Panel->Invalidate(true);
- return(0);
+ return 0;
case WM_RBUTTONUP: {
POINT pt;
@@ -3491,7 +3491,7 @@ LABEL_SHOWWINDOW: GetCursorPos(&pt);
- if(dat->Panel->invokeConfigDialog(pt))
+ if (dat->Panel->invokeConfigDialog(pt))
break;
subMenu = GetSubMenu(dat->pContainer->hMenuContext, 0);
@@ -3525,10 +3525,10 @@ LABEL_SHOWWINDOW: case WM_CLOSE:
if (wParam == 0 && lParam == 0) {
- if(PluginConfig.m_EscapeCloses == 1) {
+ if (PluginConfig.m_EscapeCloses == 1) {
SendMessage(dat->pContainer->hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
return(TRUE);
- } else if(PluginConfig.m_HideOnClose && PluginConfig.m_EscapeCloses == 2) {
+ } else if (PluginConfig.m_HideOnClose && PluginConfig.m_EscapeCloses == 2) {
ShowWindow(dat->pContainer->hwnd, SW_HIDE);
return(TRUE);
}
@@ -3630,7 +3630,7 @@ LABEL_SHOWWINDOW: if (dat->dwFlags & MWF_WASBACKGROUNDCREATE)
break;
if (dat->pContainer->hwndActive == hwndDlg && PluginConfig.m_AutoLocaleSupport && dat->hContact != 0 && dat->pContainer->hwnd == GetForegroundWindow() && dat->pContainer->hwnd == GetActiveWindow()) {
- if(lParam)
+ if (lParam)
dat->hkl = (HKL)lParam;
if (dat->hkl)
@@ -3656,8 +3656,8 @@ LABEL_SHOWWINDOW: dat->dwFlags &= ~MWF_WASBACKGROUNDCREATE;
SendMessage(hwndDlg, WM_SIZE, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_SETSCROLLPOS, 0, (LPARAM)&pt);
- if(PluginConfig.m_AutoLocaleSupport) {
- if(dat->hkl == 0)
+ if (PluginConfig.m_AutoLocaleSupport) {
+ if (dat->hkl == 0)
DM_LoadLocale(dat);
else
PostMessage(hwndDlg, DM_SETLOCALE, 0, 0);
@@ -3707,7 +3707,7 @@ LABEL_SHOWWINDOW: //mad: bb-api
case DM_BBNEEDUPDATE:{
- if(lParam)
+ if (lParam)
CB_ChangeButton(hwndDlg,dat,(CustomButtonData*)lParam);
else
BB_InitDlgButtons(dat);
@@ -3716,7 +3716,7 @@ LABEL_SHOWWINDOW: }break;
case DM_CBDESTROY:{
- if(lParam)
+ if (lParam)
CB_DestroyButton(hwndDlg,dat,(DWORD)wParam,(DWORD)lParam);
else
CB_DestroyAllButtons(hwndDlg,dat);
@@ -3756,18 +3756,18 @@ LABEL_SHOWWINDOW: case DM_SAVEMESSAGELOG:
DM_SaveLogAsRTF(dat);
- return(0);
+ return 0;
case DM_CHECKAUTOHIDE:
DM_CheckAutoHide(dat, wParam, lParam);
- return(0);
+ return 0;
case WM_NCDESTROY:
if (dat) {
memset((void *)&dat->pContainer->mOld, -1000, sizeof(MARGINS));
PostMessage(dat->pContainer->hwnd, WM_SIZE, 0, 1);
delete dat->Panel;
- if(dat->pContainer->dwFlags & CNT_SIDEBAR)
+ if (dat->pContainer->dwFlags & CNT_SIDEBAR)
dat->pContainer->SideBar->removeSession(dat);
free(dat);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
@@ -3800,7 +3800,7 @@ LABEL_SHOWWINDOW: if (!dat->fIsAutosizingInput)
DBWriteContactSettingWord(NULL, "Chat", "SplitterX", (WORD)g_Settings.iSplitterX);
- if(dat->pContainer->settings->fPrivate && !IsAutoSplitEnabled(dat))
+ if (dat->pContainer->settings->fPrivate && !IsAutoSplitEnabled(dat))
DBWriteContactSettingWord(NULL, "Chat", "splitY", (WORD)g_Settings.iSplitterY);
DM_FreeTheme(dat);
@@ -3825,7 +3825,7 @@ LABEL_SHOWWINDOW: BroadCastContainer(dat->pContainer, DM_REFRESHTABINDEX, 0, 0);
dat->iTabID = -1;
}
- if(dat->pWnd) {
+ if (dat->pWnd) {
delete dat->pWnd;
dat->pWnd = 0;
}
diff --git a/plugins/TabSRMM/include/controls.h b/plugins/TabSRMM/include/controls.h index f20dbf076a..da7544beb4 100644 --- a/plugins/TabSRMM/include/controls.h +++ b/plugins/TabSRMM/include/controls.h @@ -86,7 +86,7 @@ public: const int idToIndex(const int id) const
{
for(int i = 0; i < NR_BUTTONS; i++) {
- if(m_TbButtons[i].idCommand == id )
+ if (m_TbButtons[i].idCommand == id )
return(i);
}
return(-1);
diff --git a/plugins/TabSRMM/include/globals.h b/plugins/TabSRMM/include/globals.h index f399fbe359..6896304d5d 100644 --- a/plugins/TabSRMM/include/globals.h +++ b/plugins/TabSRMM/include/globals.h @@ -88,7 +88,7 @@ public: ~CGlobals()
{
- if(m_MenuBar)
+ if (m_MenuBar)
::DestroyMenu(m_MenuBar);
CContactCache* c = CContactCache::m_cCache, *cTemp;
diff --git a/plugins/TabSRMM/include/infopanel.h b/plugins/TabSRMM/include/infopanel.h index 47e7345f53..85a38adbdd 100644 --- a/plugins/TabSRMM/include/infopanel.h +++ b/plugins/TabSRMM/include/infopanel.h @@ -79,7 +79,7 @@ public: CTip (const HWND hwndParent, const HANDLE hContact, const TCHAR *pszText = 0, const CInfoPanel *panel = 0);
~CTip()
{
- if(m_pszText)
+ if (m_pszText)
mir_free(m_pszText);
}
void show (const RECT& rc, POINT& pt, const HICON hIcon = 0, const TCHAR *szTitle = 0);
@@ -135,7 +135,7 @@ public: };
CInfoPanel(TWindowData *dat)
{
- if(dat) {
+ if (dat) {
m_dat = dat;
m_isChat = dat->bType == SESSIONTYPE_CHAT ? true : false;
}
@@ -148,7 +148,7 @@ public: ~CInfoPanel()
{
- if(m_hwndConfig)
+ if (m_hwndConfig)
::DestroyWindow(m_hwndConfig);
saveHeight(true);
}
diff --git a/plugins/TabSRMM/include/mim.h b/plugins/TabSRMM/include/mim.h index 9ce72e3e69..9bee54ffbd 100644 --- a/plugins/TabSRMM/include/mim.h +++ b/plugins/TabSRMM/include/mim.h @@ -117,7 +117,7 @@ public: if (m_haveBufferedPaint)
m_pfnBufferedPaintUninit();
- if(m_hChatLogLock != INVALID_HANDLE_VALUE)
+ if (m_hChatLogLock != INVALID_HANDLE_VALUE)
CloseHandle(m_hChatLogLock);
}
@@ -292,7 +292,7 @@ inline void CMimAPI::stopTimer(const char *szMsg) {
::QueryPerformanceCounter((LARGE_INTEGER *)&m_tStop);
- if(szMsg)
+ if (szMsg)
timerMsg(szMsg);
}
diff --git a/plugins/TabSRMM/include/sendlater.h b/plugins/TabSRMM/include/sendlater.h index b4ce12880f..fc3bb4d087 100644 --- a/plugins/TabSRMM/include/sendlater.h +++ b/plugins/TabSRMM/include/sendlater.h @@ -108,7 +108,7 @@ public: void flushQueue() { m_last_sendlater_processed = 0; }
bool haveJobs() const
{
- if(m_sendLaterJobList.empty() || m_jobIterator == m_sendLaterJobList.end())
+ if (m_sendLaterJobList.empty() || m_jobIterator == m_sendLaterJobList.end())
return(false);
else
return(true);
diff --git a/plugins/TabSRMM/include/sendqueue.h b/plugins/TabSRMM/include/sendqueue.h index 9914e241f8..a829b8ab82 100644 --- a/plugins/TabSRMM/include/sendqueue.h +++ b/plugins/TabSRMM/include/sendqueue.h @@ -79,7 +79,7 @@ public: ~SendQueue()
{
for(int i = 0; i < NR_SENDJOBS; i++) {
- if(m_jobs[i].sendBuffer)
+ if (m_jobs[i].sendBuffer)
free(m_jobs[i].sendBuffer);
}
}
diff --git a/plugins/TabSRMM/include/sidebar.h b/plugins/TabSRMM/include/sidebar.h index 4cc60be747..5cd4d4aa80 100644 --- a/plugins/TabSRMM/include/sidebar.h +++ b/plugins/TabSRMM/include/sidebar.h @@ -161,7 +161,7 @@ public: {
CSideBarButton *oldItem = m_activeItem;
m_activeItem = const_cast<CSideBarButton *>(newItem);
- if(oldItem)
+ if (oldItem)
::InvalidateRect(oldItem->getHwnd(), NULL, FALSE);
::InvalidateRect(m_activeItem->getHwnd(), NULL, FALSE);
scrollIntoView(m_activeItem);
diff --git a/plugins/TabSRMM/include/taskbar.h b/plugins/TabSRMM/include/taskbar.h index 1b1725d48f..5f48fdd756 100644 --- a/plugins/TabSRMM/include/taskbar.h +++ b/plugins/TabSRMM/include/taskbar.h @@ -142,10 +142,10 @@ public: m_IconSize = 0;
m_isEnabled = IsWinVer7Plus() ? true : false;
- if(m_isEnabled) {
+ if (m_isEnabled) {
::CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_ALL, IID_ITaskbarList3, (void**)&m_pTaskbarInterface);
updateMetrics();
- if(0 == m_pTaskbarInterface)
+ if (0 == m_pTaskbarInterface)
m_isEnabled = false;
}
@@ -164,7 +164,7 @@ public: ~CTaskbarInteract()
{
- if(m_isEnabled && m_pTaskbarInterface) {
+ if (m_isEnabled && m_pTaskbarInterface) {
m_pTaskbarInterface->Release();
m_pTaskbarInterface = 0;
m_isEnabled = false;
diff --git a/plugins/TabSRMM/include/utils.h b/plugins/TabSRMM/include/utils.h index fd101c0aca..1d66a0c650 100644 --- a/plugins/TabSRMM/include/utils.h +++ b/plugins/TabSRMM/include/utils.h @@ -120,7 +120,7 @@ public: HGLOBAL hData;
if (!OpenClipboard(hwndOwner) || _t == 0)
- return(0);
+ return 0;
std::basic_string<T> *s = new std::basic_string<T>(_t);
size_t _s = sizeof(T);
@@ -144,7 +144,7 @@ public: *pppFiles = (T**)mir_realloc(*pppFiles, (++*totalCount + 1) * sizeof(T*));
(*pppFiles)[*totalCount] = NULL;
- if(_s == 1)
+ if (_s == 1)
(*pppFiles)[*totalCount-1] = reinterpret_cast<T *>(mir_t2a(szFilename));
else
(*pppFiles)[*totalCount-1] = reinterpret_cast<T *>(mir_tstrdup(szFilename));
@@ -184,8 +184,8 @@ public: while(s < maxlen && *(src++))
s++;
- if(s >= maxlen && *src != 0)
- return(0);
+ if (s >= maxlen && *src != 0)
+ return 0;
else
return(s);
}
diff --git a/plugins/TabSRMM/src/TSButton.cpp b/plugins/TabSRMM/src/TSButton.cpp index 2c911bc849..79fcf44d62 100644 --- a/plugins/TabSRMM/src/TSButton.cpp +++ b/plugins/TabSRMM/src/TSButton.cpp @@ -171,7 +171,7 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint) GetClientRect(ctl->hwnd, const_cast<RECT *>(&rcClient));
CopyRect(&rcContent, &rcClient);
- if(CMimAPI::m_haveBufferedPaint)
+ if (CMimAPI::m_haveBufferedPaint)
hbp = CMimAPI::m_pfnBeginBufferedPaint(hdcPaint, &rcContent, BPBF_TOPDOWNDIB, NULL, &hdcMem);
else {
hdcMem = CreateCompatibleDC(hdcPaint);
@@ -208,7 +208,7 @@ flat_themed: int state = IsWindowEnabled(ctl->hwnd) ? (ctl->stateId == PBS_NORMAL && ctl->defbutton ? PBS_DEFAULTED : ctl->stateId) : PBS_DISABLED;
if (ctl->bToolbarButton) {
- if(dat) {
+ if (dat) {
RECT rcWin;
GetWindowRect(ctl->hwnd, &rcWin);
POINT pt;
@@ -219,14 +219,14 @@ flat_themed: }
}
if (ctl->hThemeToolbar && ctl->bThemed && 1 == dat->pContainer->bTBRenderingMode) {
- if(fAero || PluginConfig.m_WinVerMajor >= 6)
+ if (fAero || PluginConfig.m_WinVerMajor >= 6)
CMimAPI::m_pfnDrawThemeBackground(ctl->hThemeToolbar, hdcMem, 8, RBStateConvert2Flat(state), &rcClient, &rcClient);
else
CMimAPI::m_pfnDrawThemeBackground(ctl->hThemeToolbar, hdcMem, TP_BUTTON, TBStateConvert2Flat(state), &rcClient, &rcClient);
} else {
CSkin::m_switchBarItem->setAlphaFormat(AC_SRC_ALPHA, state == PBS_HOT ? 220 : 180);
- if(state == PBS_HOT || state == PBS_PRESSED) {
- if(state == PBS_PRESSED) {
+ if (state == PBS_HOT || state == PBS_PRESSED) {
+ if (state == PBS_PRESSED) {
RECT rc = rcClient;
InflateRect(&rc, -1, -1);
HBRUSH bBack = CreateSolidBrush(PluginConfig.m_tbBackgroundLow ? PluginConfig.m_tbBackgroundLow : GetSysColor(COLOR_3DDKSHADOW));
@@ -265,7 +265,7 @@ nonflat_themed: CMimAPI::m_pfnGetThemeBackgroundContentRect(ctl->hThemeToolbar, hdcMem, BP_PUSHBUTTON, PBS_NORMAL, &rcClient, &rcContent);
} else {
CSkin::m_switchBarItem->setAlphaFormat(AC_SRC_ALPHA, state == PBS_NORMAL ? 140 : 240);
- if(state == PBS_PRESSED) {
+ if (state == PBS_PRESSED) {
RECT rc = rcClient;
InflateRect(&rc, -1, -1);
HBRUSH bBack = CreateSolidBrush(PluginConfig.m_tbBackgroundLow ? PluginConfig.m_tbBackgroundLow : GetSysColor(COLOR_3DDKSHADOW));
@@ -315,13 +315,13 @@ nonflat_themed: else {
if (ctl->stateId != PBS_DISABLED || CMimAPI::m_MyAlphaBlend == 0) {
DrawIconEx(hdcMem, ix, iy, hIconNew, 16, 16, 0, 0, DI_NORMAL);
- if(ctl->overlay)
+ if (ctl->overlay)
DrawIconEx(hdcMem, ix, iy, ctl->overlay, 16, 16, 0, 0, DI_NORMAL);
}
else {
BitBlt(hdc_buttonglyph, 0, 0, 16, 16, hdcMem, ix, iy, SRCCOPY);
DrawIconEx(hdc_buttonglyph, 0, 0, hIconNew, 16, 16, 0, 0, DI_NORMAL);
- if(ctl->overlay)
+ if (ctl->overlay)
DrawIconEx(hdc_buttonglyph, 0, 0, ctl->overlay, 16, 16, 0, 0, DI_NORMAL);
CMimAPI::m_MyAlphaBlend(hdcMem, ix, iy, PluginConfig.m_smcxicon, PluginConfig.m_smcyicon, hdc_buttonglyph, 0, 0, 16, 16, bf_buttonglyph);
}
@@ -340,7 +340,7 @@ nonflat_themed: if (ctl->pContainer && CSkin::m_skinEnabled)
SetTextColor(hdcMem, IsWindowEnabled(ctl->hwnd) ? CSkin::m_DefaultFontColor : GetSysColor(COLOR_GRAYTEXT));
else {
- if(PluginConfig.m_genericTxtColor)
+ if (PluginConfig.m_genericTxtColor)
SetTextColor(hdcMem, PluginConfig.m_genericTxtColor);
else
SetTextColor(hdcMem, IsWindowEnabled(ctl->hwnd) || !ctl->hThemeButton ? GetSysColor(COLOR_BTNTEXT) : GetSysColor(COLOR_GRAYTEXT));
@@ -358,7 +358,7 @@ nonflat_themed: DrawState(hdcMem, NULL, NULL, (LPARAM)szText, lstrlen(szText), (rcText.right - rcText.left - sz.cx) / 2 + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), ctl->hThemeButton ? (rcText.bottom - rcText.top - sz.cy) / 2 : (rcText.bottom - rcText.top - sz.cy) / 2 - (ctl->stateId == PBS_PRESSED ? 0 : 1), sz.cx, sz.cy, IsWindowEnabled(ctl->hwnd) || ctl->hThemeButton ? DST_PREFIXTEXT | DSS_NORMAL : DST_PREFIXTEXT | DSS_DISABLED);
SelectObject(hdcMem, hOldFont);
}
- if(hbp)
+ if (hbp)
CMimAPI::m_pfnEndBufferedPaint(hbp, TRUE);
else {
BitBlt(hdcPaint, 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top, hdcMem, 0, 0, SRCCOPY);
@@ -470,7 +470,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, break;
}
case WM_NCPAINT:
- return(0);
+ return 0;
case WM_PAINT: {
PAINTSTRUCT ps;
@@ -478,13 +478,13 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, hdcPaint = BeginPaint(hwndDlg, &ps);
if (hdcPaint) {
- if(bct->sitem)
+ if (bct->sitem)
bct->sitem->RenderThis(hdcPaint);
else
PaintWorker(bct, hdcPaint);
EndPaint(hwndDlg, &ps);
}
- return(0);
+ return 0;
}
case BM_SETIMAGE:
if (wParam == IMAGE_ICON) {
@@ -627,13 +627,13 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, }
case WM_CONTEXTMENU:
- if(bct->sitem)
+ if (bct->sitem)
bct->sitem->invokeContextMenu();
break;
case WM_MBUTTONUP:
- if(bct->sitem) {
- if(bct->sitem->getDat())
+ if (bct->sitem) {
+ if (bct->sitem->getDat())
SendMessage(bct->sitem->getDat()->hwnd, WM_CLOSE, 1, 0);
}
break;
@@ -641,8 +641,8 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, case WM_LBUTTONDOWN: {
RECT rc;
- if(bct->sitem) {
- if(bct->sitem->testCloseButton() != -1)
+ if (bct->sitem) {
+ if (bct->sitem->testCloseButton() != -1)
return(TRUE);
bct->stateId = PBS_PRESSED;
InvalidateRect(bct->hwnd, NULL, TRUE);
@@ -653,8 +653,8 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, GetClientRect(bct->hwnd, &rc);
if (LOWORD(lParam) < rc.right - 12 && bct->stateId != PBS_DISABLED)
bct->stateId = PBS_PRESSED;
- else if(LOWORD(lParam) > rc.right - 12) {
- if(GetDlgCtrlID(hwndDlg) == IDOK || bct->stateId != PBS_DISABLED) {
+ else if (LOWORD(lParam) > rc.right - 12) {
+ if (GetDlgCtrlID(hwndDlg) == IDOK || bct->stateId != PBS_DISABLED) {
WORD w = (WORD)((int)bct->arrow & 0x0000ffff);
SendMessage(GetParent(hwndDlg), WM_COMMAND, MAKELONG(w, BN_CLICKED), (LPARAM)hwndDlg);
}
@@ -670,7 +670,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, int showClick = 0;
if (bct->sitem) {
- if(bct->sitem->testCloseButton() != -1) {
+ if (bct->sitem->testCloseButton() != -1) {
SendMessage(bct->sitem->getDat()->hwnd, WM_CLOSE, 1, 0);
return(TRUE);
}
@@ -680,7 +680,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, else bct->pbState = 1;
}
if (bct->stateId != PBS_DISABLED) { // don't change states if disabled
- if(bct->stateId == PBS_PRESSED)
+ if (bct->stateId == PBS_PRESSED)
showClick = 1;
if (msg == WM_LBUTTONUP)
bct->stateId = PBS_HOT;
@@ -688,7 +688,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, bct->stateId = PBS_NORMAL;
InvalidateRect(bct->hwnd, NULL, TRUE);
}
- if(showClick)
+ if (showClick)
SendMessage(GetParent(hwndDlg), WM_COMMAND, MAKELONG(GetDlgCtrlID(hwndDlg), BN_CLICKED), (LPARAM)hwndDlg);
break;
}
@@ -701,9 +701,9 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, }
// Call timer, used to start cheesy TrackMouseEvent faker
SetTimer(hwndDlg, BUTTON_POLLID, BUTTON_POLLDELAY, NULL);
- if(bct->sitem) {
- if(bct->sitem->testCloseButton() != -1) {
- if(bct->sitem->m_sideBar->getHoveredClose() != bct->sitem) {
+ if (bct->sitem) {
+ if (bct->sitem->testCloseButton() != -1) {
+ if (bct->sitem->m_sideBar->getHoveredClose() != bct->sitem) {
bct->sitem->m_sideBar->setHoveredClose(bct->sitem);
InvalidateRect(hwndDlg, 0, FALSE);
}
@@ -723,7 +723,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, if (!PtInRect(&rc, pt)) { // mouse must be gone, trigger mouse leave
PostMessage(hwndDlg, WM_MOUSELEAVE, 0, 0L);
KillTimer(hwndDlg, BUTTON_POLLID);
- if(bct->sitem) {
+ if (bct->sitem) {
bct->sitem->m_sideBar->setHoveredClose(0);
InvalidateRect(hwndDlg, 0, FALSE);
}
@@ -732,7 +732,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, break;
}
case WM_ERASEBKGND:
- return(1);
+ return 1;
}
return DefWindowProc(hwndDlg, msg, wParam, lParam);
}
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index 8822e094fd..56120e9336 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -640,22 +640,22 @@ void TSAPI BB_RedrawButtons(TWindowData *dat) for (i = 0; i < LButtonsList->realCount; i++) {
cbd = reinterpret_cast<CustomButtonData *>(LButtonsList->items[i]);
- if(cbd) {
+ if (cbd) {
hwnd = GetDlgItem(dat->hwnd, cbd->dwButtonCID);
- if(hwnd)
+ if (hwnd)
InvalidateRect(hwnd, 0, TRUE);
}
}
for (i = 0; i < RButtonsList->realCount; i++) {
cbd = reinterpret_cast<CustomButtonData *>(RButtonsList->items[i]);
- if(cbd) {
+ if (cbd) {
hwnd = GetDlgItem(dat->hwnd, cbd->dwButtonCID);
- if(hwnd)
+ if (hwnd)
InvalidateRect(hwnd, 0, TRUE);
}
}
HWND hwndToggleSideBar = GetDlgItem(dat->hwnd, dat->bType == SESSIONTYPE_IM ? IDC_TOGGLESIDEBAR : IDC_CHAT_TOGGLESIDEBAR);
- if(hwndToggleSideBar && IsWindow(hwndToggleSideBar))
+ if (hwndToggleSideBar && IsWindow(hwndToggleSideBar))
InvalidateRect(hwndToggleSideBar, 0, TRUE);
}
diff --git a/plugins/TabSRMM/src/commonheaders.h b/plugins/TabSRMM/src/commonheaders.h index e9ea841762..7dff93ad70 100644 --- a/plugins/TabSRMM/src/commonheaders.h +++ b/plugins/TabSRMM/src/commonheaders.h @@ -262,7 +262,7 @@ extern NEN_OPTIONS nen_options; #endif
#if defined(__GNUG__)
-#define __except(x) if(x)
+#define __except(x) if (x)
#define __try
#define __finally
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index 0c743b8a81..116303b85b 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -50,9 +50,9 @@ CContactCache::CContactCache(const HANDLE hContact) m_szStatusMsg = m_ListeningInfo = m_xStatusMsg = 0;
m_nMax = 0;
- if(hContact) {
+ if (hContact) {
m_szProto = reinterpret_cast<char *>(::CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)m_hContact, 0));
- if(m_szProto)
+ if (m_szProto)
m_tszProto = mir_a2t(m_szProto);
initPhaseTwo();
}
@@ -74,17 +74,17 @@ void CContactCache::initPhaseTwo() PROTOACCOUNT* acc = 0;
m_szAccount = 0;
- if(m_szProto) {
+ if (m_szProto) {
acc = reinterpret_cast<PROTOACCOUNT *>(::CallService(MS_PROTO_GETACCOUNT, (WPARAM)0, (LPARAM)m_szProto));
- if(acc && acc->tszAccountName)
+ if (acc && acc->tszAccountName)
m_szAccount = acc->tszAccountName;
}
m_Valid = (m_szProto != 0 && m_szAccount != 0) ? true : false;
- if(m_Valid) {
+ if (m_Valid) {
m_isMeta = (PluginConfig.bMetaEnabled && !strcmp(m_szProto, PluginConfig.szMetaName)) ? true : false;
m_isSubcontact = (M->GetByte(m_hContact, PluginConfig.szMetaName, "IsSubcontact", 0) ? true : false);
- if(m_isMeta)
+ if (m_isMeta)
updateMeta(true);
updateState();
updateFavorite();
@@ -116,7 +116,7 @@ void CContactCache::resetMeta() */
void CContactCache::closeWindow()
{
- if(m_hwnd)
+ if (m_hwnd)
::SendMessage(m_hwnd, WM_CLOSE, 1, 2);
}
@@ -135,9 +135,9 @@ bool CContactCache::updateNick() {
bool fChanged = false;
- if(m_Valid) {
+ if (m_Valid) {
TCHAR *tszNick = reinterpret_cast<TCHAR *>(::CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)m_hContact, GCDNF_TCHAR));
- if(tszNick)
+ if (tszNick)
fChanged = (_tcscmp(m_szNick, tszNick) ? true : false);
mir_sntprintf(m_szNick, 80, _T("%s"), tszNick ? tszNick : _T("<undef>"));
}
@@ -150,7 +150,7 @@ bool CContactCache::updateNick() */
bool CContactCache::updateStatus()
{
- if(m_Valid) {
+ if (m_Valid) {
m_wOldStatus = m_wStatus;
m_wStatus = (WORD)DBGetContactSettingWord(m_hContact, m_szProto, "Status", ID_STATUS_OFFLINE);
@@ -167,14 +167,14 @@ bool CContactCache::updateStatus() */
void CContactCache::updateMeta(bool fForce)
{
- if(m_Valid) {
+ if (m_Valid) {
HANDLE hSubContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)m_hContact, 0);
if (hSubContact && (hSubContact != m_hSubContact || fForce)) {
m_hSubContact = hSubContact;
m_szMetaProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)m_hSubContact, 0);
if (m_szMetaProto) {
PROTOACCOUNT *acc = reinterpret_cast<PROTOACCOUNT *>(::CallService(MS_PROTO_GETACCOUNT, (WPARAM)0, (LPARAM)m_szMetaProto));
- if(acc && acc->tszAccountName)
+ if (acc && acc->tszAccountName)
m_szAccount = acc->tszAccountName;
m_wMetaStatus = DBGetContactSettingWord(m_hSubContact, m_szMetaProto, "Status", ID_STATUS_OFFLINE);
MultiByteToWideChar(CP_ACP, 0, m_szMetaProto, -1, m_tszMetaProto, 40);
@@ -196,7 +196,7 @@ bool CContactCache::updateUIN() {
bool fChanged = false;
- if(m_Valid) {
+ if (m_Valid) {
CONTACTINFO ci = {0};
ci.hContact = getActiveContact();
@@ -229,12 +229,12 @@ bool CContactCache::updateUIN() void CContactCache::updateStats(int iType, size_t value)
{
- if(m_stats == 0)
+ if (m_stats == 0)
allocStats();
switch(iType) {
case TSessionStats::UPDATE_WITH_LAST_RCV:
- if(m_stats->lastReceivedChars) {
+ if (m_stats->lastReceivedChars) {
m_stats->iReceived++;
m_stats->messageCount++;
}
@@ -259,7 +259,7 @@ void CContactCache::updateStats(int iType, size_t value) void CContactCache::allocStats()
{
- if(m_stats == 0) {
+ if (m_stats == 0) {
m_stats = new TSessionStats;
::ZeroMemory(m_stats, sizeof(TSessionStats));
}
@@ -277,21 +277,21 @@ void CContactCache::setWindowData(const HWND hwnd, TWindowData *dat) {
m_hwnd = hwnd;
m_dat = dat;
- if(hwnd && dat && m_history == 0)
+ if (hwnd && dat && m_history == 0)
allocHistory();
- if(hwnd)
+ if (hwnd)
updateStatusMsg();
else {
/* release memory - not needed when window isn't open */
- if(m_szStatusMsg) {
+ if (m_szStatusMsg) {
mir_free(m_szStatusMsg);
m_szStatusMsg = 0;
}
- if(m_ListeningInfo) {
+ if (m_ListeningInfo) {
mir_free(m_ListeningInfo);
m_ListeningInfo = 0;
}
- if(m_xStatusMsg) {
+ if (m_xStatusMsg) {
mir_free(m_xStatusMsg);
m_xStatusMsg = 0;
}
@@ -309,7 +309,7 @@ void CContactCache::saveHistory(WPARAM wParam, LPARAM lParam) int oldTop = 0;
char* szFromStream = NULL;
- if(m_hwnd == 0 || m_dat == 0)
+ if (m_hwnd == 0 || m_dat == 0)
return;
if (wParam) {
@@ -361,7 +361,7 @@ void CContactCache::saveHistory(WPARAM wParam, LPARAM lParam) */
void CContactCache::inputHistoryEvent(WPARAM wParam)
{
- if(m_hwnd == 0 || m_dat == 0)
+ if (m_hwnd == 0 || m_dat == 0)
return;
if (m_history != NULL && m_history[0].szText != NULL) { // at least one entry needs to be alloced, otherwise we get a nice infinite loop ;)
@@ -432,7 +432,7 @@ void CContactCache::releaseAlloced() {
int i;
- if(m_stats) {
+ if (m_stats) {
delete m_stats;
m_stats = 0;
}
@@ -460,7 +460,7 @@ void CContactCache::releaseAlloced() void CContactCache::deletedHandler()
{
m_Valid = false;
- if(m_hwnd)
+ if (m_hwnd)
::SendMessage(m_hwnd, WM_CLOSE, 1, 2);
releaseAlloced();
@@ -492,32 +492,32 @@ void CContactCache::updateStatusMsg(const char *szKey) if (!m_Valid)
return;
- if(szKey == 0 || (szKey && !strcmp("StatusMsg", szKey))) {
- if(m_szStatusMsg)
+ if (szKey == 0 || (szKey && !strcmp("StatusMsg", szKey))) {
+ if (m_szStatusMsg)
mir_free(m_szStatusMsg);
m_szStatusMsg = 0;
res = M->GetTString(m_hContact, "CList", "StatusMsg", &dbv);
- if(res == 0) {
+ if (res == 0) {
m_szStatusMsg = (lstrlen(dbv.ptszVal) > 0 ? getNormalizedStatusMsg(dbv.ptszVal) : 0);
DBFreeVariant(&dbv);
}
}
- if(szKey == 0 || (szKey && !strcmp("ListeningTo", szKey))) {
- if(m_ListeningInfo)
+ if (szKey == 0 || (szKey && !strcmp("ListeningTo", szKey))) {
+ if (m_ListeningInfo)
mir_free(m_ListeningInfo);
m_ListeningInfo = 0;
res = M->GetTString(m_hContact, m_szProto, "ListeningTo", &dbv);
- if(res == 0) {
+ if (res == 0) {
m_ListeningInfo = (lstrlen(dbv.ptszVal) > 0 ? mir_tstrdup(dbv.ptszVal) : 0);
DBFreeVariant(&dbv);
}
}
- if(szKey == 0 || (szKey && !strcmp("XStatusMsg", szKey))) {
- if(m_xStatusMsg)
+ if (szKey == 0 || (szKey && !strcmp("XStatusMsg", szKey))) {
+ if (m_xStatusMsg)
mir_free(m_xStatusMsg);
m_xStatusMsg = 0;
res = M->GetTString(m_hContact, m_szProto, "XStatusMsg", &dbv);
- if(res == 0) {
+ if (res == 0) {
m_xStatusMsg = (lstrlen(dbv.ptszVal) > 0 ? mir_tstrdup(dbv.ptszVal) : 0);
DBFreeVariant(&dbv);
}
@@ -542,14 +542,14 @@ CContactCache* CContactCache::getContactCache(const HANDLE hContact) while(c) {
cTemp = c;
- if(c->m_hContact == hContact) {
+ if (c->m_hContact == hContact) {
c->inc();
return(c);
}
c = c->m_next;
}
CContactCache* _c = new CContactCache(hContact);
- if(cTemp) {
+ if (cTemp) {
cTemp->m_next = _c;
return(_c);
}
@@ -568,16 +568,16 @@ TCHAR* CContactCache::getNormalizedStatusMsg(const TCHAR *src, bool fStripAll) size_t k = 0, i = 0;
TCHAR* tszResult = 0;
- if(src == 0 || lstrlen(src) < 2)
- return(0);
+ if (src == 0 || lstrlen(src) < 2)
+ return 0;
tstring dest;
for(i = 0; i < _tcslen(src); i++) {
- if(src[i] == 0x0d || src[i] == '\t')
+ if (src[i] == 0x0d || src[i] == '\t')
continue;
- if(i && src[i] == (TCHAR)0x0a) {
- if(fStripAll) {
+ if (i && src[i] == (TCHAR)0x0a) {
+ if (fStripAll) {
dest.append(_T(" "));
continue;
}
@@ -587,7 +587,7 @@ TCHAR* CContactCache::getNormalizedStatusMsg(const TCHAR *src, bool fStripAll) dest += src[i];
}
- if(i) {
+ if (i) {
tszResult = (TCHAR *)mir_alloc((dest.length() + 1) * sizeof(TCHAR));
_tcscpy(tszResult, dest.c_str());
tszResult[dest.length()] = 0;
@@ -602,7 +602,7 @@ HICON CContactCache::getIcon(int& iSize) const {
HICON hIcon;
- if(m_dat && m_hwnd) {
+ if (m_dat && m_hwnd) {
if (m_dat->dwFlags & MWF_ERRORSTATE)
hIcon = PluginConfig.g_iconErr;
else if (m_dat->mayFlashTab)
@@ -638,15 +638,15 @@ int CContactCache::getMaxMessageLength() m_nMax = CallProtoService(szProto, PS_GETCAPS, PFLAG_MAXLENOFMESSAGE, reinterpret_cast<LPARAM>(hContact));
if (m_nMax) {
if (M->GetByte("autosplit", 0)) {
- if(m_hwnd)
+ if (m_hwnd)
::SendDlgItemMessage(m_hwnd, IDC_MESSAGE, EM_EXLIMITTEXT, 0, 20000);
}
else {
- if(m_hwnd)
+ if (m_hwnd)
::SendDlgItemMessage(m_hwnd, IDC_MESSAGE, EM_EXLIMITTEXT, 0, (LPARAM)m_nMax);
}
} else {
- if(m_hwnd)
+ if (m_hwnd)
::SendDlgItemMessage(m_hwnd, IDC_MESSAGE, EM_EXLIMITTEXT, 0, 20000);
m_nMax = 20000;
}
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 5181022eac..d29de5f3ca 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -67,22 +67,22 @@ static int ServiceParamsOK(ButtonItem *item, WPARAM *wParam, LPARAM *lParam, HAN void TSAPI SetAeroMargins(TContainerData *pContainer)
{
- if(M->isAero() && pContainer && !CSkin::m_skinEnabled) {
+ if (M->isAero() && pContainer && !CSkin::m_skinEnabled) {
MARGINS m;
TWindowData *dat = (TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
RECT rcWnd;
POINT pt;
LONG sbar_left = 0, sbar_right = 0;
- if(dat) {
- if(dat->bType == SESSIONTYPE_IM) {
- if(dat->Panel->isActive())
+ if (dat) {
+ if (dat->bType == SESSIONTYPE_IM) {
+ if (dat->Panel->isActive())
GetWindowRect(GetDlgItem(dat->hwnd, IDC_LOG), &rcWnd);
else
GetWindowRect(dat->hwnd, &rcWnd);
}
else {
- if(dat->Panel->isActive())
+ if (dat->Panel->isActive())
GetWindowRect(GetDlgItem(dat->hwnd, IDC_CHAT_LOG), &rcWnd);
else
GetWindowRect(dat->hwnd, &rcWnd);
@@ -111,7 +111,7 @@ void TSAPI SetAeroMargins(TContainerData *pContainer) GetClientRect(pContainer->hwnd, &rcWnd);
m.cyBottomHeight = (rcWnd.bottom - pt.y);
- if(m.cyBottomHeight < 0 || m.cyBottomHeight >= rcWnd.bottom)
+ if (m.cyBottomHeight < 0 || m.cyBottomHeight >= rcWnd.bottom)
m.cyBottomHeight = 0;
m.cxLeftWidth = pContainer->tBorder_outer_left;
@@ -119,7 +119,7 @@ void TSAPI SetAeroMargins(TContainerData *pContainer) m.cxLeftWidth += sbar_left;
m.cxRightWidth += sbar_right;
- if(memcmp(&m, &pContainer->mOld, sizeof(MARGINS)) != 0) {
+ if (memcmp(&m, &pContainer->mOld, sizeof(MARGINS)) != 0) {
pContainer->mOld = m;
CMimAPI::m_pfnDwmExtendFrameIntoClientArea(pContainer->hwnd, &m);
}
@@ -604,7 +604,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, LoadOverrideTheme(pContainer);
ws = GetWindowLongPtr(hwndTab, GWL_STYLE);
- if(pContainer->dwFlagsEx & TCF_FLAT)
+ if (pContainer->dwFlagsEx & TCF_FLAT)
ws |= TCS_BUTTONS;
memset((void *)&pContainer->mOld, -1000, sizeof(MARGINS));
@@ -663,7 +663,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, LONG x_pad = M->GetByte("x-pad", 3) + (pContainer->dwFlagsEx & TCF_CLOSEBUTTON ? 7 : 0);
LONG y_pad = M->GetByte("y-pad", 3) + ((pContainer->dwFlags & CNT_TABSBOTTOM) ? 1 : 0);
- if(pContainer->dwFlagsEx & TCF_FLAT)
+ if (pContainer->dwFlagsEx & TCF_FLAT)
y_pad += 1; //(pContainer->dwFlags & CNT_TABSBOTTOM ? 1 : 2);
TabCtrl_SetPadding(GetDlgItem(hwndDlg, IDC_MSGTABS), x_pad, y_pad);
@@ -715,7 +715,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, /*
* prevent ugly back background being visible while tabbed clients are created
*/
- if(M->isAero()) {
+ if (M->isAero()) {
MARGINS m = {-1};
CMimAPI::m_pfnDwmExtendFrameIntoClientArea(hwndDlg, &m);
}
@@ -751,7 +751,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, }
}
}
- return(0);
+ return 0;
}
case WM_SIZE: {
@@ -885,9 +885,9 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, }
case WM_NOTIFY: {
- if(pContainer->MenuBar) {
+ if (pContainer->MenuBar) {
LRESULT processed = pContainer->MenuBar->processMsg(msg, wParam, lParam);
- if(processed != -1) {
+ if (processed != -1) {
SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, processed);
return(processed);
}
@@ -974,7 +974,7 @@ panel_found: pt1 = pt;
subMenu = GetSubMenu(pContainer->hMenuContext, 0);
- if(pNMHDR->idFrom == IDC_MSGTABS) {
+ if (pNMHDR->idFrom == IDC_MSGTABS) {
if ((iItem = GetTabItemFromMouse(hwndTab, &pt)) == -1)
break;
@@ -986,7 +986,7 @@ panel_found: /*
* sent from a sidebar button (RMB click) instead of the tab control
*/
- else if(pNMHDR->idFrom == 5000) {
+ else if (pNMHDR->idFrom == 5000) {
TSideBarNotify* n = reinterpret_cast<TSideBarNotify *>(lParam);
dat = const_cast<TWindowData *>(n->dat);
fFromSidebar = true;
@@ -1011,7 +1011,7 @@ panel_found: }
switch (iSelection) {
case ID_TABMENU_CLOSETAB:
- if(fFromSidebar)
+ if (fFromSidebar)
SendMessage(dat->hwnd, WM_CLOSE, 1, 0);
else
SendMessage(hwndDlg, DM_CLOSETABATMOUSE, 0, (LPARAM)&pt1);
@@ -1073,9 +1073,9 @@ panel_found: DWORD dwOldMsgWindowFlags = dat->dwFlags;
DWORD dwOldEventIsShown = dat->dwFlagsEx;
- if(fProcessContactMenu)
+ if (fProcessContactMenu)
return(CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)dat->hContact));
- else if(fProcessMainMenu) {
+ else if (fProcessMainMenu) {
return(CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_MAINMENU), 0));
}
else if (MsgWindowMenuHandler(dat, LOWORD(wParam), MENU_PICMENU) == 1)
@@ -1197,7 +1197,7 @@ buttons_done: GetWindowRect(hwndDlg, &rc);
bool fVisible = pContainer->SideBar->isVisible();
- if(fVisible) {
+ if (fVisible) {
dwNewLeft = pContainer->SideBar->getWidth();
pContainer->SideBar->setVisible(false);
}
@@ -1217,7 +1217,7 @@ buttons_done: case IDC_SIDEBARUP: {
HWND hwnd = GetFocus();
pContainer->SideBar->processScrollerButtons(LOWORD(wParam));
- //if(lParam)
+ //if (lParam)
//SetFocus(GetDlgItem(pContainer->hwndActive, lParam));
SetFocus(hwnd);
break;
@@ -1266,7 +1266,7 @@ buttons_done: mmi->ptMinTrackSize.x = 275;
mmi->ptMinTrackSize.y = 130;
GetClientRect(GetDlgItem(hwndDlg, IDC_MSGTABS), &rc);
- if(pContainer->hwndActive) // at container creation time, there is no hwndActive yet..
+ if (pContainer->hwndActive) // at container creation time, there is no hwndActive yet..
GetClientRect(pContainer->hwndActive, &rcClient);
GetWindowRect(hwndDlg, &rcWindow);
pt.y = rc.top;
@@ -1276,7 +1276,7 @@ buttons_done: * so let's add the container's vertical padding (title bar, tab bar,
* window border, status bar) to this value
*/
- if(pContainer->hwndActive)
+ if (pContainer->hwndActive)
mmi->ptMinTrackSize.y = pContainer->uChildMinHeight + (pContainer->hwndActive ? ((rcWindow.bottom - rcWindow.top) - rcClient.bottom) : 0);
if (pContainer->dwFlags & CNT_VERTICALMAX || (GetKeyState(VK_CONTROL) & 0x8000)) {
@@ -1314,7 +1314,7 @@ buttons_done: /*
* protect against invalid values...
*/
- if(mmi->ptMinTrackSize.y < 50 || mmi->ptMinTrackSize.y > rcDesktop.bottom)
+ if (mmi->ptMinTrackSize.y < 50 || mmi->ptMinTrackSize.y > rcDesktop.bottom)
mmi->ptMinTrackSize.y = 130;
if (PluginConfig.m_MathModAvail) {
@@ -1353,7 +1353,7 @@ buttons_done: SetWindowText(hwndDlg, szText);
if (dat)
SendMessage(hwndDlg, DM_SETICON, (WPARAM)dat, (LPARAM)(dat->hTabIcon != dat->hTabStatusIcon ? dat->hTabIcon : dat->hTabStatusIcon));
- return(0);
+ return 0;
}
if (wParam == 0) { // no hContact given - obtain the hContact for the active tab
if (pContainer->hwndActive && IsWindow(pContainer->hwndActive))
@@ -1415,19 +1415,19 @@ buttons_done: mir_free(hwndClients);
}
*/
- if(GetForegroundWindow() != hwndDlg && (pContainer->settings->autoCloseSeconds > 0) && !pContainer->fHidden) {
+ if (GetForegroundWindow() != hwndDlg && (pContainer->settings->autoCloseSeconds > 0) && !pContainer->fHidden) {
BOOL fResult = TRUE;
BroadCastContainer(pContainer, DM_CHECKAUTOHIDE, (WPARAM)pContainer->settings->autoCloseSeconds, (LPARAM)&fResult);
- if(fResult && 0 == pContainer->hWndOptions)
+ if (fResult && 0 == pContainer->hWndOptions)
PostMessage(hwndDlg, WM_CLOSE, 1, 0);
}
dat = (TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
- if(dat && dat->bType == SESSIONTYPE_IM) {
+ if (dat && dat->bType == SESSIONTYPE_IM) {
if (dat->idle && pContainer->hwndActive && IsWindow(pContainer->hwndActive))
dat->Panel->Invalidate(TRUE);
}
- else if(dat)
+ else if (dat)
SendMessage(dat->hwnd, GC_UPDATESTATUSBAR, 0, 0);
}
else if (wParam == TIMERID_HOVER) {
@@ -1465,7 +1465,7 @@ buttons_done: break;
case SC_MINIMIZE: {
TWindowData* dat = reinterpret_cast<TWindowData *>(GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA));
- if(dat) {
+ if (dat) {
//GetWindowRect(GetDlgItem(pContainer->hwndActive, dat->bType == SESSIONTYPE_IM ? IDC_LOG : IDC_CHAT_LOG), &pContainer->rcLogSaved);
GetWindowRect(pContainer->hwndActive, &pContainer->rcLogSaved);
pContainer->ptLogSaved.x = pContainer->rcLogSaved.left;
@@ -1536,7 +1536,7 @@ buttons_done: */
case WM_NCACTIVATE:
- if(IsWindowVisible(hwndDlg))
+ if (IsWindowVisible(hwndDlg))
pContainer->fHidden = false;
break;
@@ -1546,7 +1546,7 @@ buttons_done: if (LOWORD(wParam == WA_INACTIVE)) {
BroadCastContainer(pContainer, DM_CHECKINFOTIP, wParam, lParam);
- if(PluginConfig.m_MathModAvail)
+ if (PluginConfig.m_MathModAvail)
CallService(MTH_HIDE, 0, 0);
}
@@ -1677,11 +1677,11 @@ buttons_done: CSkin::FinalizeBufferedPaint(hbp, &rc);
}
else {
- if(CSkin::m_skinEnabled)
+ if (CSkin::m_skinEnabled)
CSkin::DrawItem(hdc, &rc, &SkinItems[ID_EXTBKCONTAINER]);
else {
CSkin::FillBack(hdc, &rc);
- if(pContainer->SideBar->isActive() && pContainer->SideBar->isVisible()) {
+ if (pContainer->SideBar->isActive() && pContainer->SideBar->isVisible()) {
HPEN hPen = ::CreatePen(PS_SOLID, 1, PluginConfig.m_cRichBorders ? PluginConfig.m_cRichBorders : ::GetSysColor(COLOR_3DSHADOW));
HPEN hOldPen = reinterpret_cast<HPEN>(::SelectObject(hdc, hPen));
@@ -1708,7 +1708,7 @@ buttons_done: szTitleFormat[0] = 0;
if (pContainer->isCloned && pContainer->hContactFrom != 0) {
- //if(pContainer->settings == 0)
+ //if (pContainer->settings == 0)
// pContainer->settings = (TContainerSettings *)malloc(sizeof(TContainerSettings));
//CopyMemory((void *)pContainer->settings, (void *)&PluginConfig.globalContainerSettings, sizeof(TContainerSettings));
@@ -1751,7 +1751,7 @@ buttons_done: RedrawWindow(hwndDlg, NULL, NULL, RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN);
if (pContainer->hwndStatus != 0 && pContainer->hwndActive != 0)
PostMessage(pContainer->hwndActive, DM_STATUSBARCHANGED, 0, 0);
- return(0);
+ return 0;
}
case DM_CONFIGURECONTAINER: {
DWORD ws, wsold, ex = 0, exold = 0;
@@ -1783,7 +1783,7 @@ buttons_done: ex = exold = GetWindowLongPtr(hwndDlg, GWL_EXSTYLE);
ex = (pContainer->dwFlags & CNT_TRANSPARENCY && (!CSkin::m_skinEnabled || fTransAllowed)) ? ex | WS_EX_LAYERED : ex & ~(WS_EX_LAYERED);
- //if(fAero && !pContainer->bSkinned && IsWinVerVistaPlus())
+ //if (fAero && !pContainer->bSkinned && IsWinVerVistaPlus())
// ex = ex | (WS_EX_COMPOSITED);//|WS_EX_LAYERED); // | WS_EX_COMPOSITED); // faster/smoother redrawing on Vista+, especially with skins
SetWindowLongPtr(hwndDlg, GWL_EXSTYLE, ex);
@@ -1849,7 +1849,7 @@ buttons_done: }
SendMessage(hwndDlg, WM_SIZE, 0, 1);
BroadCastContainer(pContainer, DM_CONFIGURETOOLBAR, 0, 1);
- return(0);
+ return 0;
}
/*
* search the first and most recent unread events in all client tabs...
@@ -1883,7 +1883,7 @@ buttons_done: }
}
}
- return(0);
+ return 0;
}
/*
* search tab with either next or most recent unread message and select it
@@ -1903,7 +1903,7 @@ buttons_done: TabCtrl_SetCurSel(hwndTab, ri.iMostRecent);
SendMessage(hwndDlg, WM_NOTIFY, 0, (LPARAM) &nmhdr);
}
- return(0);
+ return 0;
}
case DM_SETICON: {
@@ -1911,19 +1911,19 @@ buttons_done: TWindowData* dat = (TWindowData *)wParam;
HICON hIconBig = (dat && dat->cache) ? LoadSkinnedProtoIconBig(dat->cache->getActiveProto(), dat->cache->getActiveStatus()) : 0;
- if(Win7Taskbar->haveLargeIcons()) {
+ if (Win7Taskbar->haveLargeIcons()) {
if ((HICON)lParam == PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING] || (HICON)lParam == hIconMsg) {
Win7Taskbar->setOverlayIcon(hwndDlg, lParam);
- if(GetForegroundWindow() != hwndDlg)
+ if (GetForegroundWindow() != hwndDlg)
SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, lParam);
if ((HICON)lParam == hIconMsg)
pContainer->hIconTaskbarOverlay = hIconMsg;
break;
}
- if(dat) {
- if(dat->hTaskbarIcon == 0)
+ if (dat) {
+ if (dat->hTaskbarIcon == 0)
dat->hTaskbarIcon = ((dat->pContainer->dwFlags & CNT_AVATARSONTASKBAR) ? Utils::iconFromAvatar(dat) : 0);
else {
if (!(dat->pContainer->dwFlags & CNT_AVATARSONTASKBAR)) {
@@ -1932,25 +1932,25 @@ buttons_done: }
}
- if(dat->hTaskbarIcon) {
+ if (dat->hTaskbarIcon) {
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)dat->hTaskbarIcon);
SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, lParam);
Win7Taskbar->setOverlayIcon(hwndDlg, (LPARAM)(dat->hTabIcon ? (LPARAM)dat->hTabIcon : lParam));
}
else {
- if(0 == hIconBig || (HICON)CALLSERVICE_NOTFOUND == hIconBig)
+ if (0 == hIconBig || (HICON)CALLSERVICE_NOTFOUND == hIconBig)
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)lParam);
else
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIconBig);
SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, lParam);
- if(dat->pContainer->hIconTaskbarOverlay)
+ if (dat->pContainer->hIconTaskbarOverlay)
Win7Taskbar->setOverlayIcon(hwndDlg, (LPARAM)dat->pContainer->hIconTaskbarOverlay);
- else if(Win7Taskbar->haveAlwaysGroupingMode() && fForceOverlayIcons)
+ else if (Win7Taskbar->haveAlwaysGroupingMode() && fForceOverlayIcons)
Win7Taskbar->setOverlayIcon(hwndDlg, lParam);
else
Win7Taskbar->clearOverlayIcon(hwndDlg);
}
- return(0);
+ return 0;
}
}
/*
@@ -1961,7 +1961,7 @@ buttons_done: SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, lParam);
break;
}
- if(reinterpret_cast<HICON>(lParam) == hIconMsg)
+ if (reinterpret_cast<HICON>(lParam) == hIconMsg)
hIconBig = LoadSkinnedIconBig(SKINICON_EVENT_MESSAGE);
if (pContainer->hIcon == STICK_ICON_MSG && (HICON)lParam != hIconMsg && pContainer->dwFlags & CNT_NEED_UPDATETITLE) {
@@ -1969,10 +1969,10 @@ buttons_done: hIconBig = LoadSkinnedIconBig(SKINICON_EVENT_MESSAGE);
}
SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, lParam);
- if(0 != hIconBig && reinterpret_cast<HICON>(CALLSERVICE_NOTFOUND) != hIconBig)
+ if (0 != hIconBig && reinterpret_cast<HICON>(CALLSERVICE_NOTFOUND) != hIconBig)
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, reinterpret_cast<LPARAM>(hIconBig));
pContainer->hIcon = (lParam == (LPARAM)hIconMsg) ? STICK_ICON_MSG : 0;
- return(0);
+ return 0;
}
case WM_DRAWITEM: {
int cx = PluginConfig.m_smcxicon;
@@ -1993,14 +1993,14 @@ buttons_done: }
case DM_QUERYCLIENTAREA: {
RECT *rc = (RECT *)lParam;
- if(rc) {
+ if (rc) {
if (!IsIconic(hwndDlg))
GetClientRect(hwndDlg, rc);
else
CopyRect(rc, &pContainer->rcSaved);
AdjustTabClientRect(pContainer, rc);
}
- return(0);
+ return 0;
}
case WM_DESTROY: {
int i = 0;
@@ -2023,7 +2023,7 @@ buttons_done: DestroyWindow(pContainer->hwndStatus);
// free private theme...
- if(pContainer->theme.isPrivate) {
+ if (pContainer->theme.isPrivate) {
free(pContainer->ltr_templates);
free(pContainer->rtl_templates);
free(pContainer->theme.logFonts);
@@ -2047,7 +2047,7 @@ buttons_done: DeleteObject(pContainer->cachedHBM);
DeleteDC(pContainer->cachedDC);
}
- if(pContainer->cachedToolbarDC) {
+ if (pContainer->cachedToolbarDC) {
SelectObject(pContainer->cachedToolbarDC, pContainer->oldhbmToolbarBG);
DeleteObject(pContainer->hbmToolbarBG);
DeleteDC(pContainer->cachedToolbarDC);
@@ -2060,7 +2060,7 @@ buttons_done: if (pContainer) {
delete pContainer->MenuBar;
delete pContainer->SideBar;
- if(pContainer->settings != &PluginConfig.globalContainerSettings)
+ if (pContainer->settings != &PluginConfig.globalContainerSettings)
free(pContainer->settings);
free(pContainer);
}
@@ -2077,9 +2077,9 @@ buttons_done: char szCName[40];
char *szSetting = "CNTW_";
- if(TabCtrl_GetItemCount(hwndTab) > 1) {
+ if (TabCtrl_GetItemCount(hwndTab) > 1) {
LRESULT res = CWarning::show(CWarning::WARN_CLOSEWINDOW, MB_YESNOCANCEL|MB_ICONQUESTION);
- if(IDNO == res || IDCANCEL == res)
+ if (IDNO == res || IDCANCEL == res)
break;
}
@@ -2166,7 +2166,7 @@ buttons_done: mir_snprintf(szCName, 40, "%s_theme", szSetting);
if (lstrlen(pContainer->szRelThemeFile) > 1) {
- if(pContainer->fPrivateThemeChanged == TRUE) {
+ if (pContainer->fPrivateThemeChanged == TRUE) {
M->pathToRelative(pContainer->szRelThemeFile, pContainer->szAbsThemeFile);
M->WriteTString(hContact, SRMSGMOD_T, szCName, pContainer->szRelThemeFile);
pContainer->fPrivateThemeChanged = FALSE;
@@ -2617,7 +2617,7 @@ HMENU TSAPI BuildMCProtocolMenu(HWND hwndDlg) { tzProtoName = dbv.pszVal;
PROTOACCOUNT *acc = (PROTOACCOUNT *)CallService(MS_PROTO_GETACCOUNT, (WPARAM)0, (LPARAM)tzProtoName);
- if(acc && acc->tszAccountName) {
+ if (acc && acc->tszAccountName) {
mir_snprintf(szTemp, sizeof(szTemp), "Handle%d", i);
if ((handle = (HANDLE)M->GetDword(dat->hContact, PluginConfig.szMetaName, szTemp, 0)) != 0) {
nick = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)handle, GCDNF_TCHAR);
@@ -2722,11 +2722,11 @@ void TSAPI BroadCastContainer(const TContainerData *pContainer, UINT message, WP for (i = 0; i < nCount; i++) {
TabCtrl_GetItem(hwndTab, i, &item);
if (IsWindow((HWND)item.lParam)) {
- if(bType == SESSIONTYPE_ANY)
+ if (bType == SESSIONTYPE_ANY)
SendMessage((HWND)item.lParam, message, wParam, lParam);
else {
TWindowData *dat = (TWindowData *)GetWindowLongPtr((HWND)item.lParam, GWLP_USERDATA);
- if(dat && dat->bType == bType)
+ if (dat && dat->bType == bType)
SendMessage((HWND)item.lParam, message, wParam, lParam);
}
}
diff --git a/plugins/TabSRMM/src/containeroptions.cpp b/plugins/TabSRMM/src/containeroptions.cpp index 48b1e41e42..305c0bdb8b 100644 --- a/plugins/TabSRMM/src/containeroptions.cpp +++ b/plugins/TabSRMM/src/containeroptions.cpp @@ -47,7 +47,7 @@ static void ReloadGlobalContainerSettings(bool fForceReconfig) while (pC) {
if (!pC->settings->fPrivate) {
Utils::SettingsToContainer(pC);
- if(fForceReconfig)
+ if (fForceReconfig)
SendMessage(pC->hwnd, DM_CONFIGURECONTAINER, 0, 0);
else
SendMessage(pC->hwnd, WM_SIZE, 0, 1);
@@ -106,7 +106,7 @@ void TSAPI ApplyContainerSetting(TContainerData *pContainer, DWORD flags, UINT m BroadCastContainer(pContainer, DM_SETINFOPANEL, 0, 0);
}
- if(fForceResize)
+ if (fForceResize)
SendMessage(pContainer->hwnd, WM_SIZE, 0, 1);
BroadCastContainer(pContainer, DM_BBNEEDUPDATE, 0, 0);
@@ -147,10 +147,10 @@ static void ShowPage(HWND hwndDlg, int iPage, BOOL fShow) Utils::showDlgControl(hwndDlg, IDC_O_EXPLAINGLOBALNOTIFY, (iPage == 3 && nen_options.bWindowCheck) ? SW_SHOW : SW_HIDE);
#if !defined(__FEAT_EXP_AUTOSPLITTER)
- if(iPage == 0)
+ if (iPage == 0)
Utils::showDlgControl(hwndDlg, IDC_AUTOSPLITTER, SW_HIDE);
#endif
- if(iPage == 8 && !IsWinVer7Plus())
+ if (iPage == 8 && !IsWinVer7Plus())
Utils::showDlgControl(hwndDlg, IDC_AVATARSONTASKBAR, SW_HIDE);
}
@@ -239,7 +239,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam, SendDlgItemMessage(hwndDlg, IDC_TITLEBOX, WM_SETFONT, (WPARAM)hFont, TRUE);
- if(pContainer->isCloned && pContainer->hContactFrom != 0) {
+ if (pContainer->isCloned && pContainer->hContactFrom != 0) {
Utils::showDlgControl(hwndDlg, IDC_CNTPRIVATE, SW_HIDE);
Utils::showDlgControl(hwndDlg, IDC_O_CNTPRIVATE, SW_HIDE);
}
@@ -252,11 +252,11 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam, HWND hwndChild = (HWND)lParam;
UINT id = GetDlgCtrlID(hwndChild);
- if(hwndChild == GetDlgItem(hwndDlg, IDC_TITLEBOX)) {
+ if (hwndChild == GetDlgItem(hwndDlg, IDC_TITLEBOX)) {
::SetTextColor((HDC)wParam, RGB(60, 60, 150));
- } else if(hwndChild == GetDlgItem(hwndDlg, IDC_DESC))
+ } else if (hwndChild == GetDlgItem(hwndDlg, IDC_DESC))
::SetTextColor((HDC)wParam, RGB(160, 50, 50));
- if(id == IDC_TSLABEL_REOPENWARN)
+ if (id == IDC_TSLABEL_REOPENWARN)
break;
SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
return (INT_PTR)GetSysColorBrush(COLOR_WINDOW);
@@ -272,7 +272,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam, break;
case WM_HSCROLL:
- if((HWND)lParam == GetDlgItem(hwndDlg, IDC_TRANSPARENCY_ACTIVE) || (HWND)lParam == GetDlgItem(hwndDlg, IDC_TRANSPARENCY_INACTIVE))
+ if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_TRANSPARENCY_ACTIVE) || (HWND)lParam == GetDlgItem(hwndDlg, IDC_TRANSPARENCY_INACTIVE))
Utils::enableDlgControl(hwndDlg, IDC_APPLY, TRUE);
break;
@@ -280,12 +280,12 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam, switch (LOWORD(wParam)) {
case IDC_CNTPRIVATE: {
- if(IsDlgButtonChecked(hwndDlg, IDC_CNTPRIVATE)) {
+ if (IsDlgButtonChecked(hwndDlg, IDC_CNTPRIVATE)) {
Utils::ReadPrivateContainerSettings(pContainer, true);
pContainer->settings->fPrivate = true;
}
else {
- if(pContainer->settings != &PluginConfig.globalContainerSettings) {
+ if (pContainer->settings != &PluginConfig.globalContainerSettings) {
char szCname[40];
mir_snprintf(szCname, 40, "%s%d_Blob", CNT_BASEKEYNAME, pContainer->iContainerIndex);
pContainer->settings->fPrivate = false;
@@ -364,7 +364,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam, szFilename[MAX_PATH - 1] = 0;
M->pathToAbsolute(szFilename, szFinalThemeFile);
- if(_tcscmp(szFilename, pContainer->szRelThemeFile))
+ if (_tcscmp(szFilename, pContainer->szRelThemeFile))
pContainer->fPrivateThemeChanged = TRUE;
if (PathFileExists(szFinalThemeFile))
@@ -425,7 +425,7 @@ do_apply: int isTrans;
BOOL fAllowTrans = FALSE;
- if(PluginConfig.m_WinVerMajor >= 6)
+ if (PluginConfig.m_WinVerMajor >= 6)
fAllowTrans = TRUE;
else
fAllowTrans = (!CSkin::m_skinEnabled);
@@ -512,7 +512,7 @@ do_apply: Utils::enableDlgControl(hwndDlg, IDC_O_SOUNDSUNFOCUSED, enable);
Utils::enableDlgControl(hwndDlg, IDC_O_SOUNDSMINIMIZED, enable);
Utils::enableDlgControl(hwndDlg, IDC_O_SOUNDSFOCUSED, enable);
- return(0);
+ return 0;
}
case DM_SC_BUILDLIST: {
@@ -549,7 +549,7 @@ do_apply: dwNewFlagsEx = 0;
- if(iTabMode < 2)
+ if (iTabMode < 2)
dwNewFlags = ((iTabMode == 1) ? (dwNewFlags | CNT_TABSBOTTOM) : (dwNewFlags & ~CNT_TABSBOTTOM));
else {
dwNewFlags &= ~CNT_TABSBOTTOM;
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp index cbe2f9b6a1..9425ebf53d 100644 --- a/plugins/TabSRMM/src/controls.cpp +++ b/plugins/TabSRMM/src/controls.cpp @@ -49,7 +49,7 @@ CMenuBar::CMenuBar(HWND hwndParent, const TContainerData *pContainer) {
m_pContainer = const_cast<TContainerData *>(pContainer);
- if(m_MimIcon == 0) {
+ if (m_MimIcon == 0) {
HDC hdc = ::GetDC(m_pContainer->hwnd);
HANDLE hIcon = LoadSkinnedIconHandle(SKINICON_OTHER_MIRANDA);
@@ -72,7 +72,7 @@ CMenuBar::CMenuBar(HWND hwndParent, const TContainerData *pContainer) ::SendMessage(m_hwndToolbar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);
- if(m_buttonsInit == false) {
+ if (m_buttonsInit == false) {
::ZeroMemory(m_TbButtons, sizeof(m_TbButtons));
m_TbButtons[0].iBitmap = 0;//I_IMAGENONE;
@@ -164,7 +164,7 @@ CMenuBar::~CMenuBar() ::DestroyWindow(m_hwndToolbar);
releaseHook();
m_MimIconRefCount--;
- if(m_MimIconRefCount == 0) {
+ if (m_MimIconRefCount == 0) {
::DeleteObject(m_MimIcon);
m_MimIcon = 0;
}
@@ -185,14 +185,14 @@ const RECT& CMenuBar::getClientRect() void CMenuBar::obtainHook()
{
releaseHook();
- if(m_hHook == 0)
+ if (m_hHook == 0)
m_hHook = ::SetWindowsHookEx(WH_MSGFILTER, CMenuBar::MessageHook, g_hInst, 0);
m_Owner = this;
}
void CMenuBar::releaseHook()
{
- if(m_hHook) {
+ if (m_hHook) {
::UnhookWindowsHookEx(m_hHook);
m_hHook = 0;
}
@@ -220,7 +220,7 @@ LONG CMenuBar::getHeight() const */
LONG_PTR CMenuBar::processMsg(const UINT msg, const WPARAM wParam, const LPARAM lParam)
{
- if(msg == WM_NOTIFY) {
+ if (msg == WM_NOTIFY) {
NMHDR* pNMHDR = (NMHDR*)lParam;
switch(pNMHDR->code) {
case NM_CUSTOMDRAW: {
@@ -237,13 +237,13 @@ LONG_PTR CMenuBar::processMsg(const UINT msg, const WPARAM wParam, const LPARAM case TBN_HOTITEMCHANGE: {
NMTBHOTITEM *nmtb = (NMTBHOTITEM *)lParam;
- if(nmtb->idNew != 0 && m_fTracking && nmtb->idNew != m_activeID && m_activeID != 0) {
+ if (nmtb->idNew != 0 && m_fTracking && nmtb->idNew != m_activeID && m_activeID != 0) {
cancel(0);
- return(0);
+ return 0;
}
- else if(m_fTracking == true && m_activeID == 0 && nmtb->idNew != 0) {
+ else if (m_fTracking == true && m_activeID == 0 && nmtb->idNew != 0) {
invoke(nmtb->idNew);
- return(0);
+ return 0;
}
break;
}
@@ -251,7 +251,7 @@ LONG_PTR CMenuBar::processMsg(const UINT msg, const WPARAM wParam, const LPARAM return(-1);
}
}
- else if(msg == WM_LBUTTONDOWN) {
+ else if (msg == WM_LBUTTONDOWN) {
if (m_pContainer->dwFlags & CNT_NOTITLE) {
POINT pt;
@@ -273,9 +273,9 @@ LRESULT CALLBACK CMenuBar::wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP switch(msg) {
case WM_SYSKEYUP: {
- if(wParam == VK_MENU) {
+ if (wParam == VK_MENU) {
menuBar->Cancel();
- return(0);
+ return 0;
}
break;
}
@@ -300,13 +300,13 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm) {
bool fMustDraw = true;
- if(nm->hdr.hwndFrom == m_hwndToolbar) {
+ if (nm->hdr.hwndFrom == m_hwndToolbar) {
NMTBCUSTOMDRAW *nmtb = (NMTBCUSTOMDRAW *)(nm);
switch(nmtb->nmcd.dwDrawStage) {
case CDDS_PREPAINT:
- if(fMustDraw) {
- if(nmtb->nmcd.dwItemSpec == 0) {
+ if (fMustDraw) {
+ if (nmtb->nmcd.dwItemSpec == 0) {
m_hdcDraw = ::CreateCompatibleDC(nmtb->nmcd.hdc);
//m_rcItem = nmtb->nmcd.rc;
::GetClientRect(m_hwndToolbar, &m_rcItem);
@@ -315,27 +315,27 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm) m_hbmOld = reinterpret_cast<HBITMAP>(::SelectObject(m_hdcDraw, m_hbmDraw));
m_hTheme = M->isAero() || M->isVSThemed() ? CMimAPI::m_pfnOpenThemeData(m_hwndToolbar, L"REBAR") : 0;
m_hOldFont = reinterpret_cast<HFONT>(::SelectObject(m_hdcDraw, reinterpret_cast<HFONT>(::GetStockObject(DEFAULT_GUI_FONT))));
- if(m_isAero) {
+ if (m_isAero) {
nm->rc.bottom--;
CSkin::ApplyAeroEffect(m_hdcDraw, &m_rcItem, CSkin::AERO_EFFECT_AREA_MENUBAR);
nm->rc.bottom++;
}
else if ((PluginConfig.m_fillColor || M->isVSThemed()) && !CSkin::m_skinEnabled) {
- if(PluginConfig.m_fillColor && PluginConfig.m_tbBackgroundHigh && PluginConfig.m_tbBackgroundLow) {
+ if (PluginConfig.m_fillColor && PluginConfig.m_tbBackgroundHigh && PluginConfig.m_tbBackgroundLow) {
::DrawAlpha(m_hdcDraw, &m_rcItem, PluginConfig.m_tbBackgroundHigh, 100, PluginConfig.m_tbBackgroundLow, 0,
GRADIENT_TB, 0, 0, 0);
}
else {
m_rcItem.bottom--;
- if(PluginConfig.m_fillColor)
+ if (PluginConfig.m_fillColor)
CSkin::FillBack(m_hdcDraw, &m_rcItem);
- else if(M->isVSThemed())
+ else if (M->isVSThemed())
M->m_pfnDrawThemeBackground(m_hTheme, m_hdcDraw, 6, 1, &m_rcItem, &m_rcItem);
else
FillRect(m_hdcDraw, &m_rcItem, GetSysColorBrush(COLOR_3DFACE));
}
}
- else if(CSkin::m_MenuBGBrush)
+ else if (CSkin::m_MenuBGBrush)
::FillRect(m_hdcDraw, &nm->rc, CSkin::m_MenuBGBrush);
else
::FillRect(m_hdcDraw, &nm->rc, GetSysColorBrush(COLOR_3DFACE));
@@ -348,51 +348,51 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm) }
case CDDS_ITEMPREPAINT:
- if(fMustDraw) {
+ if (fMustDraw) {
TCHAR *szText = 0;
bool fDraw = true;
int iIndex = idToIndex(nmtb->nmcd.dwItemSpec);
- if(iIndex >= 0 && iIndex < NR_BUTTONS)
+ if (iIndex >= 0 && iIndex < NR_BUTTONS)
szText = reinterpret_cast<TCHAR *>(m_TbButtons[iIndex].iString);
UINT uState = nmtb->nmcd.uItemState;
nmtb->nmcd.rc.bottom--;
- if(CSkin::m_skinEnabled) {
+ if (CSkin::m_skinEnabled) {
CSkinItem *item = 0;
::FillRect(m_hdcDraw, &nmtb->nmcd.rc, CSkin::m_MenuBGBrush);
- if(uState & CDIS_MARKED || uState & CDIS_CHECKED || uState & CDIS_SELECTED)
+ if (uState & CDIS_MARKED || uState & CDIS_CHECKED || uState & CDIS_SELECTED)
item = &SkinItems[ID_EXTBKBUTTONSPRESSED];
- else if(uState & CDIS_HOT)
+ else if (uState & CDIS_HOT)
item = &SkinItems[ID_EXTBKBUTTONSMOUSEOVER];
- if(item)
+ if (item)
fDraw = !CSkin::DrawItem(m_hdcDraw, &nmtb->nmcd.rc, item);
else
fDraw = false;
}
- if(fDraw) {
+ if (fDraw) {
COLORREF clr = ::GetSysColor(COLOR_HOTLIGHT);
COLORREF clrRev = clr;
- if(uState & CDIS_MARKED || uState & CDIS_CHECKED) {
+ if (uState & CDIS_MARKED || uState & CDIS_CHECKED) {
::DrawAlpha(m_hdcDraw, &nmtb->nmcd.rc, clrRev, 80, clrRev, 0, 9,
31, 4, 0);
}
- if(uState & CDIS_SELECTED) {
+ if (uState & CDIS_SELECTED) {
::DrawAlpha(m_hdcDraw, &nmtb->nmcd.rc, clrRev, 80, clrRev, 0, 9,
31, 4, 0);
}
- if(uState & CDIS_HOT) {
+ if (uState & CDIS_HOT) {
::DrawAlpha(m_hdcDraw, &nmtb->nmcd.rc, clrRev, 80, clrRev, 0, 9,
31, 4, 0);
}
}
- if(szText) {
+ if (szText) {
COLORREF clr = CSkin::m_skinEnabled ? CSkin::m_DefaultFontColor :
(PluginConfig.m_fillColor ? PluginConfig.m_genericTxtColor :
(uState & (CDIS_SELECTED | CDIS_HOT | CDIS_MARKED)) ? ::GetSysColor(COLOR_HIGHLIGHTTEXT) : ::GetSysColor(COLOR_BTNTEXT));
@@ -401,7 +401,7 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm) CSkin::RenderText(m_hdcDraw, m_hTheme, szText, &nmtb->nmcd.rc, DT_SINGLELINE | DT_VCENTER | DT_CENTER,
CSkin::m_glowSize, clr);
}
- if(iIndex == 0) {
+ if (iIndex == 0) {
::DrawIconEx(m_hdcDraw, (nmtb->nmcd.rc.left + nmtb->nmcd.rc.right) / 2 - 8,
(nmtb->nmcd.rc.top + nmtb->nmcd.rc.bottom) / 2 - 8, LoadSkinnedIcon(SKINICON_OTHER_MIRANDA),
16, 16, 0, 0, DI_NORMAL);
@@ -421,7 +421,7 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm) return(fMustDraw ? CDRF_SKIPDEFAULT : CDRF_DODEFAULT);
case CDDS_POSTPAINT:
- if(nmtb->nmcd.dwItemSpec == 0 && m_hdcDraw) {
+ if (nmtb->nmcd.dwItemSpec == 0 && m_hdcDraw) {
::BitBlt(nmtb->nmcd.hdc, 0, 0, m_rcItem.right - m_rcItem.left, m_rcItem.bottom - m_rcItem.top,
m_hdcDraw, 0, 0, SRCCOPY);
::SelectObject(m_hdcDraw, m_hbmOld);
@@ -429,7 +429,7 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm) ::SelectObject(m_hdcDraw, m_hOldFont);
::DeleteDC(m_hdcDraw);
m_hdcDraw = 0;
- if(m_hTheme)
+ if (m_hTheme)
CMimAPI::m_pfnCloseThemeData(m_hTheme);
return(CDRF_SKIPDEFAULT);
}
@@ -440,9 +440,9 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm) return(CDRF_DODEFAULT);
}
- return(0);
+ return 0;
}
- return(0);
+ return 0;
}
/**
@@ -455,7 +455,7 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm) */
LONG_PTR CMenuBar::Handle(const NMTOOLBAR *nmtb)
{
- if(nmtb->hdr.hwndFrom != m_hwndToolbar)
+ if (nmtb->hdr.hwndFrom != m_hwndToolbar)
return(TBDDRET_NODEFAULT);
const int index = idToIndex(nmtb->iItem);
@@ -481,10 +481,10 @@ void CMenuBar::invoke(const int id) HANDLE hContact = dat ? dat->hContact : 0;
- if(index == 3 && hContact != 0) {
+ if (index == 3 && hContact != 0) {
hMenu = reinterpret_cast<HMENU>(::CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)hContact, 0));
m_isContactMenu = true;
- } else if(index == 0) {
+ } else if (index == 0) {
hMenu = reinterpret_cast<HMENU>(::CallService(MS_CLIST_MENUBUILDMAIN, 0, 0));
m_isMainMenu = true;
} else
@@ -497,7 +497,7 @@ void CMenuBar::invoke(const int id) pt.y = rcButton.bottom;
::ClientToScreen(m_hwndToolbar, &pt);
- if(m_activeID)
+ if (m_activeID)
cancel(0);
m_activeMenu = hMenu;
@@ -513,7 +513,7 @@ void CMenuBar::invoke(const int id) void CMenuBar::cancel(const int id)
{
releaseHook();
- if(m_activeID)
+ if (m_activeID)
::SendMessage(m_hwndToolbar, TB_SETSTATE, (WPARAM)m_activeID, TBSTATE_ENABLED);
m_activeID = 0;
m_activeMenu = 0;
@@ -535,7 +535,7 @@ void CMenuBar::updateState(const HMENU hMenu) const {
TWindowData *dat = (TWindowData *)GetWindowLongPtr(m_pContainer->hwndActive, GWLP_USERDATA);
- if(dat) {
+ if (dat) {
::CheckMenuItem(hMenu, ID_VIEW_SHOWMENUBAR, MF_BYCOMMAND | m_pContainer->dwFlags & CNT_NOMENUBAR ? MF_UNCHECKED : MF_CHECKED);
::CheckMenuItem(hMenu, ID_VIEW_SHOWSTATUSBAR, MF_BYCOMMAND | m_pContainer->dwFlags & CNT_NOSTATUSBAR ? MF_UNCHECKED : MF_CHECKED);
::CheckMenuItem(hMenu, ID_VIEW_SHOWAVATAR, MF_BYCOMMAND | dat->showPic ? MF_CHECKED : MF_UNCHECKED);
@@ -577,7 +577,7 @@ void CMenuBar::configureMenu() const BOOL fDisable = FALSE;
- if(dat) {
+ if (dat) {
bool fChat = (dat->bType == SESSIONTYPE_CHAT);
::SendMessage(m_hwndToolbar, TB_SETSTATE, 103, fChat ? TBSTATE_HIDDEN : TBSTATE_ENABLED);
@@ -595,19 +595,19 @@ void CMenuBar::configureMenu() const */
void CMenuBar::autoShow(const int showcmd)
{
- if(m_mustAutoHide && !(m_pContainer->dwFlags & CNT_NOMENUBAR)) {
+ if (m_mustAutoHide && !(m_pContainer->dwFlags & CNT_NOMENUBAR)) {
m_pContainer->dwFlags |= CNT_NOMENUBAR;
m_mustAutoHide = false;
::SendMessage(m_pContainer->hwnd, WM_SIZE, 0, 1);
releaseHook();
}
- if(showcmd == 0) {
+ if (showcmd == 0) {
::SetFocus(m_pContainer->hwndActive);
return;
}
- if(m_pContainer->dwFlags & CNT_NOMENUBAR) {
+ if (m_pContainer->dwFlags & CNT_NOMENUBAR) {
m_mustAutoHide = true;
m_pContainer->dwFlags &= ~CNT_NOMENUBAR;
::SendMessage(m_pContainer->hwnd, WM_SIZE, 0, 1);
@@ -638,7 +638,7 @@ LRESULT CALLBACK CMenuBar::MessageHook(int nCode, WPARAM wParam, LPARAM lParam) MSG *pMsg = reinterpret_cast<MSG *>(lParam);
bool fCancel = false;
- if(nCode == MSGF_MENU) {
+ if (nCode == MSGF_MENU) {
switch(pMsg->message) {
case WM_KEYDOWN:
switch(pMsg->wParam) {
@@ -652,7 +652,7 @@ LRESULT CALLBACK CMenuBar::MessageHook(int nCode, WPARAM wParam, LPARAM lParam) break;
case WM_SYSKEYUP:
- if(pMsg->wParam == VK_MENU)
+ if (pMsg->wParam == VK_MENU)
fCancel = true;
break;
@@ -662,12 +662,12 @@ LRESULT CALLBACK CMenuBar::MessageHook(int nCode, WPARAM wParam, LPARAM lParam) ::GetCursorPos(&pt);
if (::MenuItemFromPoint(0, m_Owner->m_activeMenu, pt) >= 0) // inside menu
break;
- if(m_Owner->m_activeSubMenu && ::MenuItemFromPoint(0, m_Owner->m_activeSubMenu, pt) >= 0)
+ if (m_Owner->m_activeSubMenu && ::MenuItemFromPoint(0, m_Owner->m_activeSubMenu, pt) >= 0)
break;
else { // anywhere else, cancel the menu
::CallNextHookEx(m_hHook, nCode, wParam, lParam);
m_Owner->Cancel();
- return(0);
+ return 0;
}
}
/*
@@ -688,9 +688,9 @@ LRESULT CALLBACK CMenuBar::MessageHook(int nCode, WPARAM wParam, LPARAM lParam) /*
* some key event requested to cancel the menu
*/
- if(fCancel) {
+ if (fCancel) {
int iIndex = m_Owner->idToIndex(m_Owner->m_activeID);
- if(iIndex != -1)
+ if (iIndex != -1)
::SendMessage(m_Owner->m_hwndToolbar, TB_SETHOTITEM, (WPARAM)iIndex, 0);
::SetFocus(m_Owner->m_hwndToolbar);
::SendMessage(m_Owner->m_hwndToolbar, TB_SETSTATE, (WPARAM)m_Owner->m_activeID, TBSTATE_ENABLED | TBSTATE_PRESSED);
@@ -779,12 +779,12 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR HANDLE hTheme = fAero ? CMimAPI::m_pfnOpenThemeData(hWnd, L"ButtonStyle") : 0;
TWindowData* dat = 0;
- if(pContainer)
+ if (pContainer)
dat = (TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
GetClientRect(hWnd, &rcClient);
- if(CMimAPI::m_haveBufferedPaint)
+ if (CMimAPI::m_haveBufferedPaint)
hbp = CMimAPI::m_pfnBeginBufferedPaint(hdc, &rcClient, BPBF_TOPDOWNDIB, NULL, &hdcMem);
else {
hdcMem = CreateCompatibleDC(hdc);
@@ -800,13 +800,13 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR if (pContainer && CSkin::m_skinEnabled)
CSkin::SkinDrawBG(hWnd, GetParent(hWnd), pContainer, &rcClient, hdcMem);
- else if(fAero) {
+ else if (fAero) {
FillRect(hdcMem, &rcClient, CSkin::m_BrushBack);
CSkin::ApplyAeroEffect(hdcMem, &rcClient, CSkin::AERO_EFFECT_AREA_STATUSBAR);
} else {
CSkin::FillBack(hdcMem, &rcClient);
RECT rcFrame = rcClient;
- if(PluginConfig.m_fillColor == 0) {
+ if (PluginConfig.m_fillColor == 0) {
InflateRect(&rcFrame, -2, -1);
DrawEdge(hdcMem, &rcClient, BDR_RAISEDINNER | BDR_SUNKENOUTER, BF_RECT);
}
@@ -829,7 +829,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR if (PluginConfig.m_visualMessageSizeIndicator && i == 0) {
- if(dat && dat->bType == SESSIONTYPE_IM) {
+ if (dat && dat->bType == SESSIONTYPE_IM) {
HBRUSH br = CreateSolidBrush(RGB(0, 255, 0));
HBRUSH brOld = (HBRUSH)SelectObject(hdcMem, br);
RECT rc = itemRect;
@@ -887,8 +887,8 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR if (hIcon) {
if (LOWORD(result) > 1) { // we have a text
DrawIconEx(hdcMem, itemRect.left + 3, (height / 2 - 8) + itemRect.top, hIcon, 16, 16, 0, 0, DI_NORMAL);
- if(dat) {
- if(dat->showTyping == 2)
+ if (dat) {
+ if (dat->showTyping == 2)
DrawIconEx(hdcMem, itemRect.left + 3, (height / 2 - 8) + itemRect.top, PluginConfig.g_iconOverlayEnabled, 16, 16, 0, 0, DI_NORMAL);
}
itemRect.left += 20;
@@ -906,7 +906,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR }
}
}
- if(hbp)
+ if (hbp)
CSkin::FinalizeBufferedPaint(hbp, &rcClient);
else {
BitBlt(hdc, 0, 0, rcClient.right, rcClient.bottom, hdcMem, 0, 0, SRCCOPY);
@@ -916,7 +916,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR DeleteDC(hdcMem);
}
- if(hTheme)
+ if (hTheme)
CMimAPI::m_pfnCloseThemeData(hTheme);
EndPaint(hWnd, &ps);
@@ -938,7 +938,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR while (current && dat) {
flags=current->sid.flags;
- if(current->sid.flags&MBF_OWNERSTATE){
+ if (current->sid.flags&MBF_OWNERSTATE){
struct TStatusBarIconNode *currentSIN = dat->pSINod;
while (currentSIN) {
@@ -1043,7 +1043,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR DWORD flags;
while (current) {
- if(current->sid.flags&MBF_OWNERSTATE&&dat->pSINod){
+ if (current->sid.flags&MBF_OWNERSTATE&&dat->pSINod){
TStatusBarIconNode *currentSIN = dat->pSINod;
flags=current->sid.flags;
while (currentSIN) {
@@ -1065,7 +1065,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR current = current->next;
}
- if(clicked&&clicked->sid.flags&MBF_OWNERSTATE) {
+ if (clicked&&clicked->sid.flags&MBF_OWNERSTATE) {
currentSIN=dat->pSINod;
while (currentSIN) {
if (strcmp(currentSIN->sid.szModule, clicked->sid.szModule) == 0 && currentSIN->sid.dwId == clicked->sid.dwId) {
@@ -1125,22 +1125,22 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR CallService(szTTService, (WPARAM)wBuf, (LPARAM)&ti);
}
//MAD
- if(SendMessage(dat->pContainer->hwndStatus, SB_GETTEXT, 0, (LPARAM)szStatusBarText)) {
+ if (SendMessage(dat->pContainer->hwndStatus, SB_GETTEXT, 0, (LPARAM)szStatusBarText)) {
HDC hdc;
int iLen=SendMessage(dat->pContainer->hwndStatus,SB_GETTEXTLENGTH,0,0);
SendMessage(hWnd, SB_GETRECT, 0, (LPARAM)&rc);
GetTextExtentPoint32( hdc=GetDC( dat->pContainer->hwndStatus), szStatusBarText, iLen, &size );
ReleaseDC (dat->pContainer->hwndStatus,hdc);
- if(dat && PtInRect(&rc,pt)&&((rc.right-rc.left)<size.cx)) {
+ if (dat && PtInRect(&rc,pt)&&((rc.right-rc.left)<size.cx)) {
DBVARIANT dbv={0};
- if(dat->bType == SESSIONTYPE_CHAT)
+ if (dat->bType == SESSIONTYPE_CHAT)
M->GetTString(dat->hContact,dat->szProto,"Topic",&dbv);
tooltip_active = TRUE;
CallService(szTTService, (WPARAM)dbv.ptszVal, (LPARAM)&ti);
- if(dbv.pszVal)
+ if (dbv.pszVal)
DBFreeVariant(&dbv);
}
}
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index 0ba639cf09..8d3796fbb9 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -54,7 +54,7 @@ BOOL bWmNotify = TRUE; static const PLUGIN_DATAT* PU_GetByContact(const HANDLE hContact)
{
- if(PopupList.size()) {
+ if (PopupList.size()) {
PopupListIterator it = PopupList.begin();
while(it != PopupList.end()) {
if ((*it)->hContact == hContact)
@@ -62,7 +62,7 @@ static const PLUGIN_DATAT* PU_GetByContact(const HANDLE hContact) it++;
}
}
- return(0);
+ return 0;
}
/**
@@ -72,10 +72,10 @@ static const PLUGIN_DATAT* PU_GetByContact(const HANDLE hContact) */
static void PU_CleanUp()
{
- if(PopupList.size()) {
+ if (PopupList.size()) {
PopupListIterator it = PopupList.begin();
while(it != PopupList.end()) {
- if(PopupList.size() == 0)
+ if (PopupList.size() == 0)
break;
if ((*it)->hContact == 0) {
//_DebugTraceW(_T("found stale popup %s"), (*it)->eventData->szText);
@@ -285,9 +285,9 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa }
default: {
- if(IsDlgButtonChecked(hWnd, IDC_CHKDEFAULTCOL_MUC))
+ if (IsDlgButtonChecked(hWnd, IDC_CHKDEFAULTCOL_MUC))
g_Settings.iPopupStyle = 2;
- else if(IsDlgButtonChecked(hWnd, IDC_MUC_LOGCOLORS))
+ else if (IsDlgButtonChecked(hWnd, IDC_MUC_LOGCOLORS))
g_Settings.iPopupStyle = 1;
else
g_Settings.iPopupStyle = 3;
@@ -501,7 +501,7 @@ static BOOL CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM GetCursorPos(&pt);
GetWindowRect(hWnd, &rc);
- if(PtInRect(&rc, pt))
+ if (PtInRect(&rc, pt))
break;
if (pdata->iSeconds > 0)
@@ -532,15 +532,15 @@ static TCHAR *GetPreviewT(WORD eventType, DBEVENTINFO* dbe) int iPreviewLimit = nen_options.iLimitPreview;
- if(iPreviewLimit > 500 || iPreviewLimit == 0)
+ if (iPreviewLimit > 500 || iPreviewLimit == 0)
iPreviewLimit = 500;
switch (eventType) {
case EVENTTYPE_MESSAGE:
if (pBlob) {
- if(nen_options.bPreview) {
+ if (nen_options.bPreview) {
TCHAR* buf = DbGetEventTextT(dbe, CP_ACP);
- if(lstrlen(buf) > iPreviewLimit) {
+ if (lstrlen(buf) > iPreviewLimit) {
fAddEllipsis = true;
int iIndex = iPreviewLimit;
int iWordThreshold = 20;
@@ -550,7 +550,7 @@ static TCHAR *GetPreviewT(WORD eventType, DBEVENTINFO* dbe) buf[iIndex] = 0;
}
buf = (TCHAR *)mir_realloc(buf, (lstrlen(buf) + 5) * sizeof(TCHAR));
- if(fAddEllipsis)
+ if (fAddEllipsis)
_tcscat(buf, _T("..."));
return(buf);
}
@@ -558,17 +558,17 @@ static TCHAR *GetPreviewT(WORD eventType, DBEVENTINFO* dbe) commentFix = mir_tstrdup(TranslateT("Message"));
break;
case EVENTTYPE_FILE:
- if(pBlob) {
+ if (pBlob) {
if (!nen_options.bPreview) {
commentFix = mir_tstrdup(TranslateT("Incoming file"));
break;
}
- if(dbe->cbBlob > 5) { // min valid size = (sizeof(DWORD) + 1 character file name + terminating 0)
+ if (dbe->cbBlob > 5) { // min valid size = (sizeof(DWORD) + 1 character file name + terminating 0)
char* szFileName = (char *)dbe->pBlob + sizeof(DWORD);
char* szDescr = 0;
size_t namelength = Utils::safe_strlen(szFileName, dbe->cbBlob - sizeof(DWORD));
- if(dbe->cbBlob > (sizeof(DWORD) + namelength + 1))
+ if (dbe->cbBlob > (sizeof(DWORD) + namelength + 1))
szDescr = szFileName + namelength + 1;
TCHAR* tszFileName = DbGetEventStringT(dbe, szFileName );
@@ -577,7 +577,7 @@ static TCHAR *GetPreviewT(WORD eventType, DBEVENTINFO* dbe) if (szDescr && Utils::safe_strlen(szDescr, dbe->cbBlob - sizeof(DWORD) - namelength - 1) > 0) {
TCHAR* tszDescr = DbGetEventStringT(dbe, szDescr);
- if(tszFileName && tszDescr) {
+ if (tszFileName && tszDescr) {
size_t uRequired = sizeof(TCHAR) * (_tcslen(TranslateT("Incoming file")) + namelength + _tcslen(tszDescr) + 10);
buf = (TCHAR *)mir_alloc(uRequired);
mir_sntprintf(buf, uRequired, _T("%s: %s (%s)"), TranslateT("Incoming file"),
@@ -588,7 +588,7 @@ static TCHAR *GetPreviewT(WORD eventType, DBEVENTINFO* dbe) }
}
- if(tszFileName) {
+ if (tszFileName) {
size_t uRequired = sizeof(TCHAR) * (_tcslen(TranslateT("Incoming file")) + namelength +
_tcslen(TranslateT("No description given")) + 10);
buf = (TCHAR *)mir_alloc(uRequired);
@@ -596,7 +596,7 @@ static TCHAR *GetPreviewT(WORD eventType, DBEVENTINFO* dbe) tszFileName, TranslateT("No description given"));
mir_free(tszFileName);
}
- if(buf)
+ if (buf)
return(buf);
}
}
@@ -624,7 +624,7 @@ static int PopupUpdateT(HANDLE hContact, HANDLE hEvent) pdata = const_cast<PLUGIN_DATAT *>(PU_GetByContact(hContact));
if (!pdata)
- return(1);
+ return 1;
ZeroMemory((void *)&dbe, sizeof(dbe));
@@ -687,7 +687,7 @@ static int PopupUpdateT(HANDLE hContact, HANDLE hEvent) CallService(MS_POPUP_CHANGETEXTT, (WPARAM)pdata->hWnd, (LPARAM)lpzText);
}
- return(0);
+ return 0;
}
static int PopupShowT(NEN_OPTIONS *pluginOptions, HANDLE hContact, HANDLE hEvent, UINT eventType, HWND hContainer)
@@ -699,7 +699,7 @@ static int PopupShowT(NEN_OPTIONS *pluginOptions, HANDLE hContact, HANDLE hEvent TCHAR *szPreview = NULL;
//there has to be a maximum number of popups shown at the same time
- if(PopupList.size() >= MAX_POPUPS)
+ if (PopupList.size() >= MAX_POPUPS)
return(2);
if (!PluginConfig.g_PopupAvail)
@@ -734,7 +734,7 @@ static int PopupShowT(NEN_OPTIONS *pluginOptions, HANDLE hContact, HANDLE hEvent dbe.cbBlob = 0;
CallService(MS_DB_EVENT_GET, (WPARAM)hEvent, (LPARAM)&dbe);
- if(hEvent == 0 && hContact == 0)
+ if (hEvent == 0 && hContact == 0)
dbe.szModule = Translate("Unknown module or contact");
pdata = (PLUGIN_DATAT *)mir_alloc(sizeof(PLUGIN_DATAT));
@@ -856,8 +856,8 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro tszFinalProto = (acc && acc->tszAccountName ? acc->tszAccountName : 0);
- if(tszFinalProto == 0)
- return(0); // should also NOT happen
+ if (tszFinalProto == 0)
+ return 0; // should also NOT happen
wMyStatus = (wStatus == 0) ? DBGetContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE) : wStatus;
szMyStatus = (szStatus == NULL) ? (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)wMyStatus, GSMDF_TCHAR) : szStatus;
@@ -913,7 +913,7 @@ int tabSRMM_ShowPopup(WPARAM wParam, LPARAM lParam, WORD eventType, int windowOp int heFlags;
if (nen_options.iDisable) // no popups at all. Period
- return(0);
+ return 0;
PU_CleanUp();
@@ -922,7 +922,7 @@ int tabSRMM_ShowPopup(WPARAM wParam, LPARAM lParam, WORD eventType, int windowOp return 0;
if (nen_options.bDisableNonMessage && eventType != EVENTTYPE_MESSAGE)
- return(0);
+ return 0;
/*
* check the status mode against the status mask
@@ -941,7 +941,7 @@ int tabSRMM_ShowPopup(WPARAM wParam, LPARAM lParam, WORD eventType, int windowOp //
if (windowOpen && pContainer != 0) { // message window is open, need to check the container config if we want to see a popup nonetheless
if (nen_options.bWindowCheck && windowOpen) // no popups at all for open windows... no exceptions
- return(0);
+ return 0;
if (pContainer->dwFlags & CNT_DONTREPORT && (IsIconic(pContainer->hwnd))) // in tray counts as "minimised"
goto passed;
if (pContainer->dwFlags & CNT_DONTREPORTUNFOCUSED) {
@@ -963,8 +963,8 @@ passed: if (!(PluginConfig.g_PopupAvail && PluginConfig.g_PopupWAvail))
return 0;
- if(PU_GetByContact((HANDLE)wParam) && nen_options.bMergePopup && eventType == EVENTTYPE_MESSAGE) {
- if(PopupUpdateT((HANDLE)wParam, (HANDLE)lParam) != 0)
+ if (PU_GetByContact((HANDLE)wParam) && nen_options.bMergePopup && eventType == EVENTTYPE_MESSAGE) {
+ if (PopupUpdateT((HANDLE)wParam, (HANDLE)lParam) != 0)
PopupShowT(&nen_options, (HANDLE)wParam, (HANDLE)lParam, (UINT)eventType, pContainer ? pContainer->hwnd : 0);
}
else
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index d889bb2bca..c3ae93facb 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -60,7 +60,7 @@ void TSAPI DM_SaveLogAsRTF(const TWindowData* dat) event.count = 0;
event.codepage = 0;
CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&event);
- } else if(dat) {
+ } else if (dat) {
TCHAR szInitialDir[MAX_PATH + 2];
mir_sntprintf(szFilter, SIZEOF(szFilter), _T("%s%c*.rtf%c%c"), TranslateT("Rich Edit file"), 0, 0, 0);
@@ -99,14 +99,14 @@ void TSAPI DM_SaveLogAsRTF(const TWindowData* dat) */
void TSAPI DM_CheckAutoHide(const TWindowData* dat, WPARAM wParam, LPARAM lParam)
{
- if(dat && lParam) {
+ if (dat && lParam) {
BOOL *fResult = (BOOL *)lParam;
- if(GetWindowTextLengthA(GetDlgItem(dat->hwnd, dat->bType == SESSIONTYPE_IM ? IDC_MESSAGE : IDC_CHAT_MESSAGE)) > 0) {
+ if (GetWindowTextLengthA(GetDlgItem(dat->hwnd, dat->bType == SESSIONTYPE_IM ? IDC_MESSAGE : IDC_CHAT_MESSAGE)) > 0) {
*fResult = FALSE;
return; // text entered in the input area -> prevent autohide/cose
}
- if(dat->dwUnread) {
+ if (dat->dwUnread) {
*fResult = FALSE;
return; // unread events, do not hide or close the container
}
@@ -127,10 +127,10 @@ void TSAPI DM_DismissTip(TWindowData *dat, const POINT& pt) return;
GetWindowRect(dat->hwndTip, &rc);
- if(PtInRect(&rc, pt))
+ if (PtInRect(&rc, pt))
return;
- if(abs(pt.x - dat->ptTipActivation.x) > 5 || abs(pt.y - dat->ptTipActivation.y) > 5) {
+ if (abs(pt.x - dat->ptTipActivation.x) > 5 || abs(pt.y - dat->ptTipActivation.y) > 5) {
SendMessage(dat->hwndTip, TTM_TRACKACTIVATE, FALSE, 0);
dat->ptTipActivation.x = dat->ptTipActivation.y = 0;
}
@@ -168,42 +168,42 @@ LRESULT TSAPI DM_GenericHotkeysCheck(MSG *message, TWindowData *dat) switch(mim_hotkey_check) {
case TABSRMM_HK_PASTEANDSEND:
HandlePasteAndSend(dat);
- return(1);
+ return 1;
case TABSRMM_HK_HISTORY:
SendMessage(hwndDlg, WM_COMMAND, IDC_HISTORY, 0);
- return(1);
+ return 1;
case TABSRMM_HK_CONTAINEROPTIONS:
if (dat->pContainer->hWndOptions == 0)
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CONTAINEROPTIONS), dat->pContainer->hwnd,
DlgProcContainerOptions, (LPARAM)dat->pContainer);
- return(1);
+ return 1;
case TABSRMM_HK_SEND:
if (!(GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MESSAGE), GWL_STYLE) & ES_READONLY)) {
PostMessage(hwndDlg, WM_COMMAND, IDOK, 0);
- return(1);
+ return 1;
}
break;
case TABSRMM_HK_TOGGLEINFOPANEL:
dat->Panel->setActive(dat->Panel->isActive() ? FALSE : TRUE);
dat->Panel->showHide();
- return(1);
+ return 1;
case TABSRMM_HK_EMOTICONS:
SendMessage(hwndDlg, WM_COMMAND, IDC_SMILEYBTN, 0);
- return(1);
+ return 1;
case TABSRMM_HK_TOGGLETOOLBAR:
SendMessage(hwndDlg, WM_COMMAND, IDC_TOGGLETOOLBAR, 0);
- return(1);
+ return 1;
case TABSRMM_HK_CLEARLOG:
ClearLog(dat);
- return(1);
+ return 1;
case TABSRMM_HK_TOGGLESIDEBAR:
- if(dat->pContainer->SideBar->isActive())
+ if (dat->pContainer->SideBar->isActive())
SendMessage(hwndDlg, WM_COMMAND, IDC_TOGGLESIDEBAR, 0);
- return(1);
+ return 1;
default:
break;
}
- return(0);
+ return 0;
}
LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer, TWindowData *dat, UINT cmd, WPARAM wParam, LPARAM lParam)
@@ -518,7 +518,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer, dat->sendMode ^= SMODE_FORCEANSI;
break;
case ID_SENDMENU_SENDLATER:
- if(sendLater->isAvail())
+ if (sendLater->isAvail())
dat->sendMode ^= SMODE_SENDLATER;
else
CWarning::show(CWarning::WARN_NO_SENDLATER, MB_OK|MB_ICONINFORMATION, TranslateT("Configuration issue|The unattended send feature is disabled. The \\b1 send later\\b0 and \\b1 send to multiple contacts\\b0 features depend on it.\n\nYou must enable it under \\b1Options->Message Sessions->Advanced tweaks\\b0. Changing this option requires a restart."));
@@ -562,9 +562,9 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer, GetClientRect(hwndDlg, &rc);
dat->fEditNotesActive = !dat->fEditNotesActive;
- if(dat->fEditNotesActive) {
+ if (dat->fEditNotesActive) {
int iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE));
- if(iLen != 0) {
+ if (iLen != 0) {
SendMessage(hwndDlg, DM_ACTIVATETOOLTIP, IDC_MESSAGE, (LPARAM)TranslateT("You cannot edit user notes when there are unsent messages"));
dat->fEditNotesActive = false;
break;
@@ -578,7 +578,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer, DBVARIANT dbv = {0};
- if(0 == M->GetTString(dat->hContact, "UserInfo", "MyNotes", &dbv)) {
+ if (0 == M->GetTString(dat->hContact, "UserInfo", "MyNotes", &dbv)) {
SetDlgItemText(hwndDlg, IDC_MESSAGE, dbv.ptszVal);
mir_free(dbv.ptszVal);
}
@@ -601,7 +601,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer, SWP_NOMOVE|SWP_NOSIZE|SWP_NOCOPYBITS);
RedrawWindow(hwndDlg, 0, 0, RDW_INVALIDATE|RDW_ERASE|RDW_FRAME|RDW_UPDATENOW|RDW_ALLCHILDREN);
- if(dat->fEditNotesActive)
+ if (dat->fEditNotesActive)
CWarning::show(CWarning::WARN_EDITUSERNOTES, MB_OK|MB_ICONINFORMATION);
break;
}
@@ -613,13 +613,13 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer, int iSel = 0;
HMENU hMenu = (HMENU) CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM) dat->hContact, 0);
- if(lParam == 0)
+ if (lParam == 0)
GetWindowRect(GetDlgItem(hwndDlg, IDC_PROTOCOL/*IDC_NAME*/), &rc);
else
GetWindowRect((HWND)lParam, &rc);
iSel = TrackPopupMenu(hMenu, TPM_RETURNCMD, rc.left, rc.bottom, 0, hwndDlg, NULL);
- if(iSel)
+ if (iSel)
CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(iSel), MPCF_CONTACTMENU), (LPARAM) dat->hContact);
DestroyMenu(hMenu);
@@ -647,15 +647,15 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer, }
break;
default:
- return(0);
+ return 0;
}
- return(1);
+ return 1;
}
LRESULT TSAPI DM_ContainerCmdHandler(TContainerData *pContainer, UINT cmd, WPARAM wParam, LPARAM lParam)
{
if (!pContainer)
- return(0);
+ return 0;
HWND hwndDlg = pContainer->hwnd;
@@ -753,7 +753,7 @@ LRESULT TSAPI DM_ContainerCmdHandler(TContainerData *pContainer, UINT cmd, WPARA }
case ID_VIEW_INFOPANEL: {
TWindowData *dat = (TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
- if(dat) {
+ if (dat) {
RECT rc;
POINT pt;
GetWindowRect(pContainer->hwndActive, &rc);
@@ -761,7 +761,7 @@ LRESULT TSAPI DM_ContainerCmdHandler(TContainerData *pContainer, UINT cmd, WPARA pt.y = rc.top + dat->Panel->getHeight() - 10;
dat->Panel->invokeConfigDialog(pt);
}
- return(0);
+ return 0;
}
/*
* commands from the message log popup will be routed to the
@@ -771,9 +771,9 @@ LRESULT TSAPI DM_ContainerCmdHandler(TContainerData *pContainer, UINT cmd, WPARA case ID_MESSAGELOGSETTINGS_GLOBAL: {
struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
- if(dat) {
+ if (dat) {
MsgWindowMenuHandler(dat, (int)LOWORD(wParam), MENU_LOGMENU);
- return(1);
+ return 1;
}
break;
}
@@ -781,9 +781,9 @@ LRESULT TSAPI DM_ContainerCmdHandler(TContainerData *pContainer, UINT cmd, WPARA CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_ABOUT), 0, DlgProcAbout, 0);
break;
default:
- return(0); // not handled
+ return 0; // not handled
}
- return(1); // handled
+ return 1; // handled
}
/**
@@ -818,7 +818,7 @@ void TSAPI DM_InitRichEdit(TWindowData *dat) SendMessage(hwndLog, EM_SETBKGNDCOLOR, 0, colour);
SendMessage(hwndEdit, EM_SETBKGNDCOLOR, 0, dat->inputbg);
- if(fIsChat)
+ if (fIsChat)
LoadLogfont(MSGFONTID_MESSAGEAREA, &lf, &inputcharcolor, FONTMODULE);
else {
lf = dat->pContainer->theme.logFonts[MSGFONTID_MESSAGEAREA];
@@ -833,7 +833,7 @@ void TSAPI DM_InitRichEdit(TWindowData *dat) inputcharcolor = RGB(GetRValue(inputcharcolor), GetGValue(inputcharcolor), GetBValue(inputcharcolor) == 0 ? GetBValue(inputcharcolor) + 1 : GetBValue(inputcharcolor) - 1);
}
}
- if(fIsChat) {
+ if (fIsChat) {
cf2.dwMask = CFM_COLOR | CFM_FACE | CFM_CHARSET | CFM_SIZE | CFM_WEIGHT | CFM_ITALIC | CFM_BACKCOLOR;
cf2.cbSize = sizeof(cf2);
cf2.crTextColor = inputcharcolor;
@@ -1140,7 +1140,7 @@ static unsigned __stdcall LoadKLThread(LPVOID vParam) PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_SETLOCALE, (WPARAM)hContact, (LPARAM)hkl);
DBFreeVariant(&dbv);
}
- return(0);
+ return 0;
}
@@ -1315,7 +1315,7 @@ HWND TSAPI DM_CreateClist(TWindowData *dat) if (!sendLater->isAvail()) {
CWarning::show(CWarning::WARN_NO_SENDLATER, MB_OK|MB_ICONINFORMATION, TranslateT("Configuration issue|The unattended send feature is disabled. The \\b1 send later\\b0 and \\b1 send to multiple contacts\\b0 features depend on it.\n\nYou must enable it under \\b1Options->Message Sessions->Advanced tweaks\\b0. Changing this option requires a restart."));
dat->sendMode &= ~SMODE_MULTIPLE;
- return(0);
+ return 0;
}
HWND hwndClist = CreateWindowExA(0, "CListControl", "", WS_TABSTOP | WS_VISIBLE | WS_CHILD | 0x248,
184, 0, 30, 30, dat->hwnd, (HMENU)IDC_CLIST, g_hInst, NULL);
@@ -1345,7 +1345,7 @@ HWND TSAPI DM_CreateClist(TWindowData *dat) SendMessage(hwndClist, CLM_SETHIDEEMPTYGROUPS, (WPARAM) FALSE, 0);
SendMessage(hwndClist, CLM_FIRST + 106, 0, 1);
SendMessage(hwndClist, CLM_AUTOREBUILD, 0, 0);
- if(hwndClist)
+ if (hwndClist)
RedrawWindow(hwndClist, 0, 0, RDW_INVALIDATE|RDW_ERASE|RDW_UPDATENOW);
return hwndClist;
}
@@ -1378,7 +1378,7 @@ LRESULT TSAPI DM_MouseWheelHandler(HWND hwnd, HWND hwndParent, struct TWindowDat GetWindowRect(GetDlgItem(mwdat->hwnd, IDC_LIST), &rcNicklist);
if (PtInRect(&rcNicklist, pt)) {
SendMessage(GetDlgItem(mwdat->hwnd, IDC_LIST), WM_MOUSEWHEEL, wParam, lParam);
- return(0);
+ return 0;
}
}
if (mwdat->hwndIEView)
@@ -1416,17 +1416,17 @@ LRESULT TSAPI DM_MouseWheelHandler(HWND hwnd, HWND hwndParent, struct TWindowDat void TSAPI DM_FreeTheme(TWindowData *dat)
{
- if(dat) {
+ if (dat) {
if (CMimAPI::m_pfnCloseThemeData) {
- if(dat->hTheme) {
+ if (dat->hTheme) {
CMimAPI::m_pfnCloseThemeData(dat->hTheme);
dat->hTheme = 0;
}
- if(dat->hThemeIP) {
+ if (dat->hThemeIP) {
CMimAPI::m_pfnCloseThemeData(dat->hThemeIP);
dat->hThemeIP = 0;
}
- if(dat->hThemeToolbar) {
+ if (dat->hThemeToolbar) {
CMimAPI::m_pfnCloseThemeData(dat->hThemeToolbar);
dat->hThemeToolbar = 0;
}
@@ -1477,7 +1477,7 @@ void TSAPI DM_NotifyTyping(struct TWindowData *dat, int mode) if (dat && dat->hContact) {
DeletePopupsForContact(dat->hContact, PU_REMOVE_ON_TYPE);
- if(dat->bIsMeta){
+ if (dat->bIsMeta){
szProto = dat->cache->getActiveProto();
hContact = dat->cache->getActiveContact();
}
@@ -1489,7 +1489,7 @@ void TSAPI DM_NotifyTyping(struct TWindowData *dat, int mode) /*
* editing user notes or preparing a message for queued delivery -> don't send MTN
*/
- if(dat->fEditNotesActive || dat->sendMode & SMODE_SENDLATER)
+ if (dat->fEditNotesActive || dat->sendMode & SMODE_SENDLATER)
return;
/*
@@ -1538,7 +1538,7 @@ void TSAPI DM_NotifyTyping(struct TWindowData *dat, int mode) void TSAPI DM_OptionsApplied(TWindowData *dat, WPARAM wParam, LPARAM lParam)
{
- if(dat == 0)
+ if (dat == 0)
return;
HWND hwndDlg = dat->hwnd;
@@ -1591,7 +1591,7 @@ void TSAPI DM_OptionsApplied(TWindowData *dat, WPARAM wParam, LPARAM lParam) void TSAPI DM_Typing(TWindowData *dat, bool fForceOff)
{
- if(dat == 0)
+ if (dat == 0)
return;
HWND hwndDlg = dat->hwnd;
@@ -1615,7 +1615,7 @@ void TSAPI DM_Typing(TWindowData *dat, bool fForceOff) mir_sntprintf(dat->szStatusBar, safe_sizeof(dat->szStatusBar),
TranslateT("%s has entered text."), dat->cache->getNick());
- if(hwndStatus && dat->pContainer->hwndActive == hwndDlg)
+ if (hwndStatus && dat->pContainer->hwndActive == hwndDlg)
SendMessage(hwndStatus, SB_SETTEXT, 0, (LPARAM) dat->szStatusBar);
}
SendMessage(hwndDlg, DM_UPDATEWINICON, 0, 0);
@@ -1628,7 +1628,7 @@ void TSAPI DM_Typing(TWindowData *dat, bool fForceOff) if (!(dat->pContainer->dwFlags & CNT_NOFLASH) && PluginConfig.m_FlashOnMTN)
ReflashContainer(dat->pContainer);
}
- } else if(dat->showTyping == 2) {
+ } else if (dat->showTyping == 2) {
if (dat->nTypeSecs > 0)
dat->nTypeSecs--;
else {
@@ -1685,53 +1685,53 @@ int TSAPI DM_SplitterGlobalEvent(TWindowData *dat, WPARAM wParam, LPARAM lParam) bool fCntGlobal = (!dat->pContainer->settings->fPrivate ? true : false);
#if defined(__FEAT_EXP_AUTOSPLITTER)
- if(dat->fIsAutosizingInput)
- return(0);
+ if (dat->fIsAutosizingInput)
+ return 0;
#endif
GetWindowRect(dat->hwnd, &rcWin);
- if(wParam == 0 && lParam == 0) {
+ if (wParam == 0 && lParam == 0) {
if ((dat->dwFlagsEx & MWF_SHOW_SPLITTEROVERRIDE) && dat != srcDat)
- return(0);
+ return 0;
- if(srcDat->bType == dat->bType)
+ if (srcDat->bType == dat->bType)
newPos = PluginConfig.lastSPlitterPos.pos;
- else if(srcDat->bType == SESSIONTYPE_IM && dat->bType == SESSIONTYPE_CHAT)
+ else if (srcDat->bType == SESSIONTYPE_IM && dat->bType == SESSIONTYPE_CHAT)
newPos = PluginConfig.lastSPlitterPos.pos + PluginConfig.lastSPlitterPos.off_im;
- else if(srcDat->bType == SESSIONTYPE_CHAT && dat->bType == SESSIONTYPE_IM)
+ else if (srcDat->bType == SESSIONTYPE_CHAT && dat->bType == SESSIONTYPE_IM)
newPos = PluginConfig.lastSPlitterPos.pos + PluginConfig.lastSPlitterPos.off_im;
- if(dat == srcDat) {
- if(dat->bType == SESSIONTYPE_IM) {
+ if (dat == srcDat) {
+ if (dat->bType == SESSIONTYPE_IM) {
dat->pContainer->settings->splitterPos = dat->splitterY;
- if(fCntGlobal) {
+ if (fCntGlobal) {
SaveSplitter(dat);
- if(PluginConfig.lastSPlitterPos.bSync)
+ if (PluginConfig.lastSPlitterPos.bSync)
g_Settings.iSplitterY = dat->splitterY - DPISCALEY_S(23);
}
}
- if(dat->bType == SESSIONTYPE_CHAT) {
+ if (dat->bType == SESSIONTYPE_CHAT) {
SESSION_INFO *si = dat->si;
- if(si) {
+ if (si) {
dat->pContainer->settings->splitterPos = si->iSplitterY + DPISCALEY_S(23);
- if(fCntGlobal) {
+ if (fCntGlobal) {
g_Settings.iSplitterY = si->iSplitterY;
- if(PluginConfig.lastSPlitterPos.bSync)
+ if (PluginConfig.lastSPlitterPos.bSync)
M->WriteDword(SRMSGMOD_T, "splitsplity", (DWORD)si->iSplitterY + DPISCALEY_S(23));
}
}
}
- return(0);
+ return 0;
}
if (!fCntGlobal && dat->pContainer != srcCnt)
- return(0);
- if(srcCnt->settings->fPrivate && dat->pContainer != srcCnt)
- return(0);
+ return 0;
+ if (srcCnt->settings->fPrivate && dat->pContainer != srcCnt)
+ return 0;
if (!PluginConfig.lastSPlitterPos.bSync && dat->bType != srcDat->bType)
- return(0);
+ return 0;
/*
* for inactive sessions, delay the splitter repositioning until they become
@@ -1741,7 +1741,7 @@ int TSAPI DM_SplitterGlobalEvent(TWindowData *dat, WPARAM wParam, LPARAM lParam) dat->dwFlagsEx |= MWF_EX_DELAYEDSPLITTER;
dat->wParam = newPos;
dat->lParam = PluginConfig.lastSPlitterPos.lParam;
- return(0);
+ return 0;
}
}
else
@@ -1749,23 +1749,23 @@ int TSAPI DM_SplitterGlobalEvent(TWindowData *dat, WPARAM wParam, LPARAM lParam) newMessagePos = (short)rcWin.bottom - (short)newPos;
- if(dat->bType == SESSIONTYPE_IM) {
+ if (dat->bType == SESSIONTYPE_IM) {
LoadSplitter(dat);
AdjustBottomAvatarDisplay(dat);
DM_RecalcPictureSize(dat);
SendMessage(dat->hwnd, WM_SIZE, 0, 0);
DM_ScrollToBottom(dat, 1,1);
- if(dat != srcDat)
+ if (dat != srcDat)
CSkin::UpdateToolbarBG(dat);
}
else {
SESSION_INFO *si = dat->si;
- if(si) {
+ if (si) {
si->iSplitterY = g_Settings.iSplitterY;
SendMessage(dat->hwnd, WM_SIZE, 0, 0);
}
}
- return(0);
+ return 0;
}
/**
@@ -1803,13 +1803,13 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM wParam, LPARAM lParam) if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & (DBEF_SENT))) {
dat->lastMessage = dbei.timestamp;
dat->szStatusBar[0] = 0;
- if(dat->showTyping) {
+ if (dat->showTyping) {
dat->nTypeSecs = 0;
DM_Typing(dat, true);
dat->showTyping = 0;
}
HandleIconFeedback(dat, (HICON)-1);
- if(m_pContainer->hwndStatus)
+ if (m_pContainer->hwndStatus)
PostMessage(hwndDlg, DM_UPDATELASTMESSAGE, 0, 0);
}
/*
@@ -1830,7 +1830,7 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM wParam, LPARAM lParam) }
}
tabSRMM_ShowPopup(wParam, lParam, dbei.eventType, m_pContainer->fHidden ? 0 : 1, m_pContainer, hwndDlg, dat->cache->getActiveProto(), dat);
- if(IsWindowVisible(m_pContainer->hwnd))
+ if (IsWindowVisible(m_pContainer->hwnd))
m_pContainer->fHidden = false;
}
dat->cache->updateStats(TSessionStats::UPDATE_WITH_LAST_RCV, 0);
@@ -1885,7 +1885,7 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM wParam, LPARAM lParam) * never switch for status changes...
*/
if (!(dbei.flags & DBEF_SENT) && !fIsStatusChangeEvent) {
- if(PluginConfig.haveAutoSwitch() && m_pContainer->hwndActive != hwndDlg) {
+ if (PluginConfig.haveAutoSwitch() && m_pContainer->hwndActive != hwndDlg) {
if ((IsIconic(hwndContainer) && !IsZoomed(hwndContainer)) || (PluginConfig.m_HideOnClose && !IsWindowVisible(m_pContainer->hwnd))) {
int iItem = GetTabIndexFromHWND(GetParent(hwndDlg), hwndDlg);
if (iItem >= 0) {
@@ -1913,37 +1913,37 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM wParam, LPARAM lParam) if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & (DBEF_SENT)))
PostMessage(hwndDlg, DM_PLAYINCOMINGSOUND, 0, 0);
- if(dat->pWnd)
+ if (dat->pWnd)
dat->pWnd->Invalidate();
}
}
void TSAPI DM_HandleAutoSizeRequest(TWindowData *dat, REQRESIZE* rr)
{
- if(dat && rr && GetForegroundWindow() == dat->pContainer->hwnd) {
- if(dat->fIsAutosizingInput && dat->iInputAreaHeight != -1) {
+ if (dat && rr && GetForegroundWindow() == dat->pContainer->hwnd) {
+ if (dat->fIsAutosizingInput && dat->iInputAreaHeight != -1) {
LONG heightLimit = M->GetDword("autoSplitMinLimit", 0);
LONG iNewHeight = rr->rc.bottom - rr->rc.top;
- if(CSkin::m_skinEnabled && !SkinItems[ID_EXTBKINPUTAREA].IGNORED)
+ if (CSkin::m_skinEnabled && !SkinItems[ID_EXTBKINPUTAREA].IGNORED)
iNewHeight += (SkinItems[ID_EXTBKINPUTAREA].MARGIN_TOP + SkinItems[ID_EXTBKINPUTAREA].MARGIN_BOTTOM - 2);
- if(heightLimit && iNewHeight < heightLimit)
+ if (heightLimit && iNewHeight < heightLimit)
iNewHeight = heightLimit;
- if(iNewHeight != dat->iInputAreaHeight) {
+ if (iNewHeight != dat->iInputAreaHeight) {
RECT rc;
GetClientRect(dat->hwnd, &rc);
LONG cy = rc.bottom - rc.top;
LONG panelHeight = (dat->Panel->isActive() ? dat->Panel->getHeight() : 0);
- if(iNewHeight > (cy - panelHeight) / 2)
+ if (iNewHeight > (cy - panelHeight) / 2)
iNewHeight = (cy - panelHeight) / 2;
- if(dat->bType == SESSIONTYPE_IM) {
+ if (dat->bType == SESSIONTYPE_IM) {
dat->dynaSplitter = rc.bottom - (rc.bottom - iNewHeight + DPISCALEY_S(2));
- if(dat->pContainer->dwFlags & CNT_BOTTOMTOOLBAR)
+ if (dat->pContainer->dwFlags & CNT_BOTTOMTOOLBAR)
dat->dynaSplitter += DPISCALEY_S(22);
dat->splitterY = dat->dynaSplitter + DPISCALEY_S(34);
DM_RecalcPictureSize(dat);
@@ -2043,12 +2043,12 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM wParam, LPARAM lParam) _tcsncpy(dat->newtitle, newtitle, safe_sizeof(dat->newtitle));
dat->newtitle[127] = 0;
item.cchTextMax = 127;
- if(dat->pWnd)
+ if (dat->pWnd)
dat->pWnd->updateTitle(dat->cache->getNick());
}
if (dat->iTabID >= 0) {
TabCtrl_SetItem(hwndTab, dat->iTabID, &item);
- if(m_pContainer->dwFlags & CNT_SIDEBAR)
+ if (m_pContainer->dwFlags & CNT_SIDEBAR)
m_pContainer->SideBar->updateSession(dat);
}
if (m_pContainer->hwndActive == hwndDlg && lParam)
@@ -2064,7 +2064,7 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM wParam, LPARAM lParam) }
dat->Panel->Invalidate();
- if(dat->pWnd)
+ if (dat->pWnd)
dat->pWnd->Invalidate();
if (PluginConfig.g_FlashAvatarAvail) {
@@ -2375,9 +2375,9 @@ void SI_CheckStatusIconClick(struct TWindowData *dat, HWND hwndFrom, POINT pt, R SendMessage(dat->pContainer->hwndActive, WM_COMMAND, IDC_SELFTYPING, 0);
InvalidateRect(dat->pContainer->hwndStatus, NULL, TRUE);
} else if ((int)iconNum == list_icons + 2) {
- if(code == NM_CLICK)
+ if (code == NM_CLICK)
PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_TRAYICONNOTIFY, 101, WM_LBUTTONUP);
- else if(code == NM_RCLICK)
+ else if (code == NM_RCLICK)
PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_TRAYICONNOTIFY, 101, WM_RBUTTONUP);
} else if (clicked) {
sicd.cbSize = sizeof(StatusIconClickData);
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index aa242d977c..4c4d6721d4 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -235,7 +235,7 @@ void CGlobals::reloadSystemModulesChanged() g_MetaContactsAvail = (ServiceExists(MS_MC_GETDEFAULTCONTACT) ? 1 : 0);
- if(g_MetaContactsAvail) {
+ if (g_MetaContactsAvail) {
mir_snprintf(szMetaName, 256, "%s", (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0));
bMetaEnabled = abs(M->GetByte(0, szMetaName, "Enabled", -1));
}
@@ -313,23 +313,23 @@ void CGlobals::reloadSettings(bool fReloadSkins) m_visualMessageSizeIndicator = M->GetByte("msgsizebar", 0);
m_autoSplit = M->GetByte("autosplit", 0);
m_FlashOnMTN = M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINFLASH, SRMSGDEFSET_SHOWTYPINGWINFLASH);
- if(m_MenuBar == 0) {
+ if (m_MenuBar == 0) {
m_MenuBar = ::LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_MENUBAR));
TranslateMenu(m_MenuBar);
}
m_ipBackgroundGradient = M->GetDword(FONTMODULE, "ipfieldsbg", 0x62caff);
- if(0 == m_ipBackgroundGradient)
+ if (0 == m_ipBackgroundGradient)
m_ipBackgroundGradient = 0x62caff;
m_ipBackgroundGradientHigh = M->GetDword(FONTMODULE, "ipfieldsbgHigh", 0xf0f0f0);
- if(0 == m_ipBackgroundGradientHigh)
+ if (0 == m_ipBackgroundGradientHigh)
m_ipBackgroundGradientHigh = 0xf0f0f0;
m_tbBackgroundHigh = M->GetDword(FONTMODULE, "tbBgHigh", 0);
m_tbBackgroundLow = M->GetDword(FONTMODULE, "tbBgLow", 0);
m_fillColor = M->GetDword(FONTMODULE, "fillColor", 0);
- if(CSkin::m_BrushFill) {
+ if (CSkin::m_BrushFill) {
::DeleteObject(CSkin::m_BrushFill);
CSkin::m_BrushFill = 0;
}
@@ -339,7 +339,7 @@ void CGlobals::reloadSettings(bool fReloadSkins) ::CopyMemory(&globalContainerSettings, &_cnt_default, sizeof(TContainerSettings));
Utils::ReadContainerSettingsFromDB(0, &globalContainerSettings);
globalContainerSettings.fPrivate = false;
- if(fReloadSkins)
+ if (fReloadSkins)
Skin->setupAeroSkins();
}
@@ -353,7 +353,7 @@ void CGlobals::reloadAdv() m_dontUseDefaultKbd = M->GetByte("adv_leaveKeyboardAlone", 1);
g_bClientInStatusBar = M->GetByte("adv_ClientIconInStatusBar", 0);
- if(g_bSoundOnTyping && m_TypingSoundAdded == false) {
+ if (g_bSoundOnTyping && m_TypingSoundAdded == false) {
SkinAddNewSoundEx("SoundOnTyping", LPGEN("Other"), LPGEN("TABSRMM: Typing"));
m_TypingSoundAdded = true;
}
@@ -362,7 +362,7 @@ void CGlobals::reloadAdv() const HMENU CGlobals::getMenuBar()
{
- if(m_MenuBar == 0) {
+ if (m_MenuBar == 0) {
m_MenuBar = ::LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_MENUBAR));
TranslateMenu(m_MenuBar);
}
@@ -446,7 +446,7 @@ int CGlobals::ModulesLoaded(WPARAM wParam, LPARAM lParam) mi.pszService = MS_TABMSG_SETUSERPREFS;
PluginConfig.m_UserMenuItem = Menu_AddContactMenuItem(&mi);
- if(sendLater->isAvail()) {
+ if (sendLater->isAvail()) {
mi.cbSize = sizeof(mi);
mi.position = -500050006;
mi.hIcon = 0;
@@ -462,7 +462,7 @@ int CGlobals::ModulesLoaded(WPARAM wParam, LPARAM lParam) ::RegisterFontServiceFonts();
::CacheLogFonts();
::Chat_ModulesLoaded(wParam, lParam);
- if(PluginConfig.g_PopupWAvail||PluginConfig.g_PopupAvail)
+ if (PluginConfig.g_PopupWAvail||PluginConfig.g_PopupAvail)
TN_ModuleInit();
m_event_SettingChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, DBSettingChanged);
@@ -470,7 +470,7 @@ int CGlobals::ModulesLoaded(WPARAM wParam, LPARAM lParam) m_event_Dispatch = HookEvent(ME_DB_EVENT_ADDED, CMimAPI::DispatchNewEvent);
m_event_EventAdded = HookEvent(ME_DB_EVENT_ADDED, CMimAPI::MessageEventAdded);
- if(PluginConfig.g_MetaContactsAvail) {
+ if (PluginConfig.g_MetaContactsAvail) {
m_event_ME_MC_SUBCONTACTSCHANGED = HookEvent(ME_MC_SUBCONTACTSCHANGED, MetaContactEvent);
m_event_ME_MC_FORCESEND = HookEvent(ME_MC_FORCESEND, MetaContactEvent);
m_event_ME_MC_UNFORCESEND = HookEvent(ME_MC_UNFORCESEND, MetaContactEvent);
@@ -499,25 +499,25 @@ int CGlobals::DBSettingChanged(WPARAM wParam, LPARAM lParam) if (hwnd == 0 && wParam != 0) { // we are not interested in this event if there is no open message window/tab
if (!strcmp(setting, "Status") || !strcmp(setting, "MyHandle") || !strcmp(setting, "Nick") || !strcmp(cws->szModule, SRMSGMOD_T)) {
c = CContactCache::getContactCache((HANDLE)wParam);
- if(c) {
+ if (c) {
fChanged = c->updateStatus();
- if(strcmp(setting, "Status"))
+ if (strcmp(setting, "Status"))
c->updateNick();
if (!strcmp(setting, "isFavorite") || !strcmp(setting, "isRecent"))
c->updateFavorite();
}
}
- return(0);
+ return 0;
}
if (wParam == 0 && !strcmp("Nick", setting)) {
M->BroadcastMessage(DM_OWNNICKCHANGED, 0, (LPARAM)cws->szModule);
- return(0);
+ return 0;
}
- if(wParam) {
+ if (wParam) {
c = CContactCache::getContactCache((HANDLE)wParam);
- if(c) {
+ if (c) {
szProto = c->getProto();
if (!strcmp(cws->szModule, SRMSGMOD_T)) { // catch own relevant settings
if (!strcmp(setting, "isFavorite") || !strcmp(setting, "isRecent"))
@@ -526,29 +526,29 @@ int CGlobals::DBSettingChanged(WPARAM wParam, LPARAM lParam) }
}
- if(wParam == 0 && !lstrcmpA(setting, "Enabled")) {
- if(PluginConfig.g_MetaContactsAvail && !lstrcmpA(cws->szModule, PluginConfig.szMetaName)) { // catch the disabled meta contacts
+ if (wParam == 0 && !lstrcmpA(setting, "Enabled")) {
+ if (PluginConfig.g_MetaContactsAvail && !lstrcmpA(cws->szModule, PluginConfig.szMetaName)) { // catch the disabled meta contacts
PluginConfig.bMetaEnabled = abs(M->GetByte(0, PluginConfig.szMetaName, "Enabled", -1));
cacheUpdateMetaChanged();
}
}
if (lstrcmpA(cws->szModule, "CList") && (szProto == NULL || lstrcmpA(cws->szModule, szProto)))
- return(0);
+ return 0;
if (PluginConfig.g_MetaContactsAvail && !lstrcmpA(cws->szModule, PluginConfig.szMetaName)) {
- if(wParam != 0 && !lstrcmpA(setting, "Nick")) // filter out this setting to avoid infinite loops while trying to obtain the most online contact
- return(0);
+ if (wParam != 0 && !lstrcmpA(setting, "Nick")) // filter out this setting to avoid infinite loops while trying to obtain the most online contact
+ return 0;
}
if (hwnd) {
- if(c) {
+ if (c) {
fChanged = c->updateStatus();
fNickChanged = c->updateNick();
}
if (lstrlenA(setting) > 6 && lstrlenA(setting) < 9 && !strncmp(setting, "Status", 6)) {
fChanged = true;
- if(c) {
+ if (c) {
c->updateMeta(true);
c->updateUIN();
}
@@ -556,35 +556,35 @@ int CGlobals::DBSettingChanged(WPARAM wParam, LPARAM lParam) else if (!strcmp(setting, "MirVer"))
PostMessage(hwnd, DM_CLIENTCHANGED, 0, 0);
else if (!strcmp(setting, "display_uid")) {
- if(c)
+ if (c)
c->updateUIN();
PostMessage(hwnd, DM_UPDATEUIN, 0, 0);
}
- else if(lstrlenA(setting) > 6 && strstr("StatusMsg,XStatusMsg,XStatusName,XStatusId,ListeningTo", setting)) {
- if(c) {
+ else if (lstrlenA(setting) > 6 && strstr("StatusMsg,XStatusMsg,XStatusName,XStatusId,ListeningTo", setting)) {
+ if (c) {
c->updateStatusMsg(setting);
fExtendedStatusChange = true;
}
}
- if(fChanged || fNickChanged || fExtendedStatusChange)
+ if (fChanged || fNickChanged || fExtendedStatusChange)
PostMessage(hwnd, DM_UPDATETITLE, 0, 1);
- if(fExtendedStatusChange)
+ if (fExtendedStatusChange)
PostMessage(hwnd, DM_UPDATESTATUSMSG, 0, 0);
- if(fChanged) {
- if(c && c->getStatus() == ID_STATUS_OFFLINE) { // clear typing notification in the status bar when contact goes offline
+ if (fChanged) {
+ if (c && c->getStatus() == ID_STATUS_OFFLINE) { // clear typing notification in the status bar when contact goes offline
TWindowData* dat = c->getDat();
- if(dat) {
+ if (dat) {
dat->nTypeSecs = 0;
dat->showTyping = 0;
dat->szStatusBar[0] = 0;
PostMessage(c->getHwnd(), DM_UPDATELASTMESSAGE, 0, 0);
}
}
- if(c)
+ if (c)
PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_LOGSTATUSCHANGE, MAKELONG(c->getStatus(), c->getOldStatus()), (LPARAM)c);
}
}
- return(0);
+ return 0;
}
/**
@@ -593,9 +593,9 @@ int CGlobals::DBSettingChanged(WPARAM wParam, LPARAM lParam) int CGlobals::DBContactDeleted(WPARAM wParam, LPARAM lParam)
{
- if(wParam) {
+ if (wParam) {
CContactCache *c = CContactCache::getContactCache((HANDLE)wParam);
- if(c)
+ if (c)
c->deletedHandler();
}
return 0;
@@ -608,17 +608,17 @@ int CGlobals::DBContactDeleted(WPARAM wParam, LPARAM lParam) */
int CGlobals::MetaContactEvent(WPARAM wParam, LPARAM lParam)
{
- if(wParam) {
+ if (wParam) {
CContactCache *c = CContactCache::getContactCache((HANDLE)wParam);
- if(c) {
+ if (c) {
c->updateMeta(true);
- if(c->getHwnd()) {
+ if (c->getHwnd()) {
c->updateUIN(); // only do this for open windows, not needed normally
::PostMessage(c->getHwnd(), DM_UPDATETITLE, 0, 0);
}
}
}
- return(0);
+ return 0;
}
int CGlobals::PreshutdownSendRecv(WPARAM wParam, LPARAM lParam)
@@ -647,7 +647,7 @@ int CGlobals::PreshutdownSendRecv(WPARAM wParam, LPARAM lParam) }
for(i = 0; i < SERVICE_LAST; i++) {
- if(PluginConfig.hSvc[i])
+ if (PluginConfig.hSvc[i])
DestroyServiceFunction(PluginConfig.hSvc[i]);
}
@@ -671,7 +671,7 @@ int CGlobals::PreshutdownSendRecv(WPARAM wParam, LPARAM lParam) #if defined(__USE_EX_HANDLERS)
}
__except(CGlobals::Ex_ShowDialog(GetExceptionInformation(), __FILE__, __LINE__, L"SHUTDOWN_STAGE2", false)) {
- return(0);
+ return 0;
}
#endif
return 0;
@@ -702,16 +702,16 @@ int CGlobals::OkToExit(WPARAM wParam, LPARAM lParam) UnhookEvent(m_event_IcoLibChanged);
UnhookEvent(m_event_IconsChanged);
- if(m_event_SmileyAdd)
+ if (m_event_SmileyAdd)
UnhookEvent(m_event_SmileyAdd);
- if(m_event_IEView)
+ if (m_event_IEView)
UnhookEvent(m_event_IEView);
- if(m_event_FoldersChanged)
+ if (m_event_FoldersChanged)
UnhookEvent(m_event_FoldersChanged);
- if(m_event_ME_MC_FORCESEND) {
+ if (m_event_ME_MC_FORCESEND) {
UnhookEvent(m_event_ME_MC_FORCESEND);
UnhookEvent(m_event_ME_MC_SUBCONTACTSCHANGED);
UnhookEvent(m_event_ME_MC_UNFORCESEND);
@@ -722,7 +722,7 @@ int CGlobals::OkToExit(WPARAM wParam, LPARAM lParam) #if defined(__USE_EX_HANDLERS)
}
__except(CGlobals::Ex_ShowDialog(GetExceptionInformation(), __FILE__, __LINE__, L"SHUTDOWN_STAGE1", false)) {
- return(0);
+ return 0;
}
#endif
return 0;
@@ -753,7 +753,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void) hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while (hContact) {
- if(M->GetDword(hContact, "SendLater", "count", 0))
+ if (M->GetDword(hContact, "SendLater", "count", 0))
sendLater->addContact(hContact);
hDbEvent = (HANDLE) CallService(MS_DB_EVENT_FINDFIRSTUNREAD, (WPARAM) hContact, 0);
@@ -780,7 +780,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void) void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c)
{
- if(c == 0)
+ if (c == 0)
return;
HANDLE hContact = c->getContact();
@@ -791,11 +791,11 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c) bool fLocal = ((dwMask & MWF_LOG_STATUSCHANGES) ? (dwFlags & MWF_LOG_STATUSCHANGES ? true : false) : false);
- if(fGlobal || fLocal) {
+ if (fGlobal || fLocal) {
/*
* don't log them if WE are logging off
*/
- if(CallProtoService(c->getProto(), PS_GETSTATUS, 0, 0) == ID_STATUS_OFFLINE)
+ if (CallProtoService(c->getProto(), PS_GETSTATUS, 0, 0) == ID_STATUS_OFFLINE)
return;
WORD wStatus, wOldStatus;
@@ -803,7 +803,7 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c) wStatus = LOWORD(wParam);
wOldStatus = HIWORD(wParam);
- if(wStatus == wOldStatus)
+ if (wStatus == wOldStatus)
return;
DBEVENTINFO dbei;
@@ -813,7 +813,7 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c) TCHAR* szOldStatus = (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)wOldStatus, GSMDF_TCHAR);
TCHAR* szNewStatus = (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)wStatus, GSMDF_TCHAR);
- if(szOldStatus == 0 || szNewStatus == 0)
+ if (szOldStatus == 0 || szNewStatus == 0)
return;
if (c->isValid()) {
@@ -853,19 +853,19 @@ void CGlobals::cacheUpdateMetaChanged() bool fMetaActive = (PluginConfig.g_MetaContactsAvail && PluginConfig.bMetaEnabled) ? true : false;
while(c) {
- if(c->isMeta() && PluginConfig.bMetaEnabled == false) {
+ if (c->isMeta() && PluginConfig.bMetaEnabled == false) {
c->closeWindow();
c->resetMeta();
}
// meta contacts are enabled, but current contact is a subcontact - > close window
- if(fMetaActive && c->isSubContact())
+ if (fMetaActive && c->isSubContact())
c->closeWindow();
// reset meta contact information, if metacontacts protocol became avail
- if(fMetaActive && !strcmp(c->getProto(), PluginConfig.szMetaName))
+ if (fMetaActive && !strcmp(c->getProto(), PluginConfig.szMetaName))
c->resetMeta();
c = c->m_next;
@@ -880,8 +880,8 @@ void CGlobals::cacheUpdateMetaChanged() */
bool CGlobals::haveAutoSwitch()
{
- if(m_bIsWin7) {
- if(m_useAeroPeek && !CSkin::m_skinEnabled)
+ if (m_bIsWin7) {
+ if (m_useAeroPeek && !CSkin::m_skinEnabled)
return(false);
}
return(m_AutoSwitchTabs ? true : false);
@@ -961,7 +961,7 @@ int CGlobals::Ex_ShowDialog(EXCEPTION_POINTERS *ep, const char *szFile, int line m_exLine = line;
m_exLastResult = DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_EXCEPTION), 0, CGlobals::Ex_DlgProc, 0);
m_exAllowContinue = fAllowContinue;
- if(IDCANCEL == m_exLastResult)
+ if (IDCANCEL == m_exLastResult)
ExitProcess(1);
return 1;
}
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index 65f8da6228..2394ee5cf9 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -290,7 +290,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP SetForegroundWindow(pLastActiveContainer->hwnd);
SetFocus(GetDlgItem(pLastActiveContainer->hwndActive, IDC_MESSAGE));
} else {
- if(PluginConfig.m_HideOnClose)
+ if (PluginConfig.m_HideOnClose)
ShowWindow(pLastActiveContainer->hwnd, SW_HIDE);
else
SendMessage(pLastActiveContainer->hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
@@ -395,7 +395,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP * if lParam == NULL, don't consider clist events, just open the message tab
*/
- if(lParam == 0) {
+ if (lParam == 0) {
HandleMenuEntryFromhContact((int)wParam);
break;
}
@@ -454,20 +454,20 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendMessageCommand_W(wParam, lParam);
if (lParam)
free((void *)lParam);
- return(0);
+ return 0;
case DM_SENDMESSAGECOMMAND:
SendMessageCommand(wParam, lParam);
if (lParam)
free((void *)lParam);
- return(0);
+ return 0;
/*
* sent from the popup to "dismiss" the event. we should do this in the main thread
*/
case DM_REMOVECLISTEVENT:
CallService(MS_CLIST_REMOVEEVENT, wParam, lParam);
CallService(MS_DB_EVENT_MARKREAD, wParam, lParam);
- return(0);
+ return 0;
case DM_SETLOCALE: {
HKL hkl = (HKL)lParam;
@@ -475,23 +475,23 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP HWND hWnd = M->FindWindow(hContact);
- if(hWnd) {
+ if (hWnd) {
TWindowData *dat = (TWindowData *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
- if(dat) {
+ if (dat) {
DBVARIANT dbv;
- if(hkl) {
+ if (hkl) {
dat->hkl = hkl;
PostMessage(dat->hwnd, DM_SETLOCALE, 0, 0);
}
- if(0 == M->GetTString(hContact, SRMSGMOD_T, "locale", &dbv)) {
+ if (0 == M->GetTString(hContact, SRMSGMOD_T, "locale", &dbv)) {
GetLocaleID(dat, dbv.ptszVal);
DBFreeVariant(&dbv);
UpdateReadChars(dat);
}
}
}
- return(0);
+ return 0;
}
/*
* react to changes in the desktop composition state
@@ -504,15 +504,15 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP TContainerData *pContainer = pFirstContainer;
while (pContainer) {
- if(fNewAero)
+ if (fNewAero)
SetAeroMargins(pContainer);
else {
MARGINS m = {0};
- if(M->m_pfnDwmExtendFrameIntoClientArea)
+ if (M->m_pfnDwmExtendFrameIntoClientArea)
M->m_pfnDwmExtendFrameIntoClientArea(pContainer->hwnd, &m);
}
- if(pContainer->SideBar->isActive())
+ if (pContainer->SideBar->isActive())
RedrawWindow(GetDlgItem(pContainer->hwnd, 5000), NULL, NULL, RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW); // the container for the sidebar buttons
RedrawWindow(pContainer->hwnd, NULL, NULL, RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW|RDW_ALLCHILDREN);
pContainer = pContainer->pNextContainer;
@@ -576,26 +576,26 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP case DM_LOGSTATUSCHANGE:
CGlobals::logStatusChange(wParam, reinterpret_cast<CContactCache *>(lParam));
- return(0);
+ return 0;
case DM_MUCFLASHWORKER: {
FLASH_PARAMS *p = reinterpret_cast<FLASH_PARAMS*>(lParam);
- if(1 == wParam) {
+ if (1 == wParam) {
CallService(MS_CLIST_CONTACTDOUBLECLICKED, (WPARAM)p->hContact, 1);
p->bActiveTab = TRUE;
p->bInactive = FALSE;
p->bMustAutoswitch = p->bMustFlash = FALSE;
}
- if(2 == wParam) {
+ if (2 == wParam) {
p->bActiveTab = TRUE;
p->bInactive = FALSE;
p->bMustAutoswitch = p->bMustFlash = FALSE;
SendMessage(p->hWnd, DM_ACTIVATEME, 0, 0);
}
DoFlashAndSoundWorker(p);
- return(0);
+ return 0;
}
case WM_POWERBROADCAST:
@@ -625,7 +625,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP return 0;
case WM_TIMER:
- if(wParam == TIMERID_SENDLATER) {
+ if (wParam == TIMERID_SENDLATER) {
/*
* send heartbeat to each open container (to manage autoclose
* feature)
@@ -642,7 +642,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP /*
* process send later contacts and jobs, if enough time has elapsed
*/
- if(sendLater->isAvail() && !sendLater->isInteractive() && (time(0) - sendLater->lastProcessed()) > CSendLater::SENDLATER_PROCESS_INTERVAL) {
+ if (sendLater->isAvail() && !sendLater->isInteractive() && (time(0) - sendLater->lastProcessed()) > CSendLater::SENDLATER_PROCESS_INTERVAL) {
sendLater->setLastProcessed(time(0));
/*
@@ -666,7 +666,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP * TODO better timings, possibly slow down when many jobs are in the
* queue.
*/
- else if(wParam == TIMERID_SENDLATER_TICK) {
+ else if (wParam == TIMERID_SENDLATER_TICK) {
if (!sendLater->haveJobs()) {
KillTimer(hwndDlg, wParam);
SetTimer(hwndDlg, TIMERID_SENDLATER, TIMEOUT_SENDLATER, 0);
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp index 95b5375132..0dde6d3eda 100644 --- a/plugins/TabSRMM/src/infopanel.cpp +++ b/plugins/TabSRMM/src/infopanel.cpp @@ -47,29 +47,29 @@ WNDPROC CTip::m_OldMessageEditProc = 0; int CInfoPanel::setPanelHandler(TWindowData *dat, WPARAM wParam, LPARAM lParam)
{
- if(wParam == 0 && lParam == 0) {
+ if (wParam == 0 && lParam == 0) {
dat->Panel->getVisibility();
dat->Panel->loadHeight();
dat->Panel->showHide();
}
else {
TWindowData *srcDat = (TWindowData *)wParam;
- if(lParam == 0)
+ if (lParam == 0)
dat->Panel->loadHeight();
else {
- if(srcDat && lParam && dat != srcDat && !dat->Panel->isPrivateHeight()) {
- if(srcDat->bType != dat->bType && M->GetByte("syncAllPanels", 0) == 0)
- return(0);
+ if (srcDat && lParam && dat != srcDat && !dat->Panel->isPrivateHeight()) {
+ if (srcDat->bType != dat->bType && M->GetByte("syncAllPanels", 0) == 0)
+ return 0;
- if(dat->pContainer->settings->fPrivate && srcDat->pContainer != dat->pContainer)
- return(0);
+ if (dat->pContainer->settings->fPrivate && srcDat->pContainer != dat->pContainer)
+ return 0;
dat->panelWidth = -1;
dat->Panel->setHeight((LONG)lParam);
}
}
SendMessage(dat->hwnd, WM_SIZE, 0, 0);
}
- return(0);
+ return 0;
}
void CInfoPanel::setActive(const int newActive)
@@ -86,8 +86,8 @@ void CInfoPanel::loadHeight() m_height = M->GetDword(m_dat->hContact, "panelheight", -1);
- if(m_height == -1 || HIWORD(m_height) == 0) {
- if(m_dat->pContainer->settings->fPrivate)
+ if (m_height == -1 || HIWORD(m_height) == 0) {
+ if (m_dat->pContainer->settings->fPrivate)
m_height = m_dat->pContainer->settings->panelheight;
else
m_height = bSync ? m_defaultHeight : (m_isChat ? m_defaultMUCHeight : m_defaultHeight);
@@ -114,22 +114,22 @@ void CInfoPanel::saveHeight(bool fFlush) if (m_height < 110 && m_height >= MIN_PANELHEIGHT) { // only save valid panel splitter positions
if (!m_fPrivateHeight) {
if (!m_isChat || bSync) {
- if(m_dat->pContainer->settings->fPrivate)
+ if (m_dat->pContainer->settings->fPrivate)
m_dat->pContainer->settings->panelheight = m_height;
else {
PluginConfig.m_panelHeight = m_height;
m_defaultHeight = m_height;
- if(fFlush)
+ if (fFlush)
M->WriteDword(SRMSGMOD_T, "panelheight", m_height);
}
}
- else if(m_isChat && !bSync) {
- if(m_dat->pContainer->settings->fPrivate)
+ else if (m_isChat && !bSync) {
+ if (m_dat->pContainer->settings->fPrivate)
m_dat->pContainer->settings->panelheight = m_height;
else {
PluginConfig.m_MUCpanelHeight = m_height;
m_defaultMUCHeight = m_height;
- if(fFlush)
+ if (fFlush)
M->WriteDword("Chat", "panelheight", m_height);
}
}
@@ -149,12 +149,12 @@ void CInfoPanel::saveHeight(bool fFlush) */
void CInfoPanel::setHeight(LONG newHeight, bool fBroadcast)
{
- if(newHeight < MIN_PANELHEIGHT || newHeight > 100)
+ if (newHeight < MIN_PANELHEIGHT || newHeight > 100)
return;
m_height = newHeight;
- if(fBroadcast) {
+ if (fBroadcast) {
if (!m_fPrivateHeight) {
if (!m_dat->pContainer->settings->fPrivate)
M->BroadcastMessage(DM_SETINFOPANEL, (WPARAM)m_dat, (LPARAM)newHeight);
@@ -185,7 +185,7 @@ void CInfoPanel::showHide() const ::CalcDynamicAvatarSize(m_dat, &bm);
if (m_active) {
- if(m_dat->hwndContactPic) {
+ if (m_dat->hwndContactPic) {
::DestroyWindow(m_dat->hwndContactPic);
m_dat->hwndContactPic=NULL;
}
@@ -197,7 +197,7 @@ void CInfoPanel::showHide() const ::SendMessage(hwndDlg, WM_SIZE, 0, 0);
::InvalidateRect(GetDlgItem(hwndDlg, IDC_CONTACTPIC), NULL, TRUE);
::SetAeroMargins(m_dat->pContainer);
- if(M->isAero())
+ if (M->isAero())
::InvalidateRect(GetParent(hwndDlg), NULL, FALSE);
::DM_ScrollToBottom(m_dat, 0, 1);
}
@@ -211,7 +211,7 @@ void CInfoPanel::showHide() const ::SendMessage(hwndDlg, WM_SIZE, 0, 0);
::SetAeroMargins(m_dat->pContainer);
- if(M->isAero())
+ if (M->isAero())
::InvalidateRect(GetParent(hwndDlg), NULL, FALSE);
::DM_ScrollToBottom(m_dat, 0, 1);
}
@@ -274,23 +274,23 @@ HFONT CInfoPanel::setUnderlinedFont(const HDC hdc, HFONT hFontOrig) */
void CInfoPanel::renderBG(const HDC hdc, RECT& rc, CSkinItem *item, bool fAero, bool fAutoCalc) const
{
- if(m_active) {
+ if (m_active) {
- if(fAutoCalc)
+ if (fAutoCalc)
rc.bottom = m_height + 1;
- if(fAero) {
+ if (fAero) {
RECT rcBlack = rc;
rc.bottom -= 2;
::FillRect(hdc, &rc, CSkin::m_BrushBack);
CSkin::ApplyAeroEffect(hdc, &rc, CSkin::AERO_EFFECT_AREA_INFOPANEL);
rcBlack.top = rc.bottom;// + 1;
rcBlack.bottom = rcBlack.top + 2;
- if(CSkin::m_pCurrentAeroEffect && CSkin::m_pCurrentAeroEffect->m_clrBack != 0)
+ if (CSkin::m_pCurrentAeroEffect && CSkin::m_pCurrentAeroEffect->m_clrBack != 0)
::DrawAlpha(hdc, &rcBlack, CSkin::m_pCurrentAeroEffect->m_clrBack, 90, CSkin::m_pCurrentAeroEffect->m_clrBack, 0,
0, 0, 1, 0);
}
else {
- if(CSkin::m_skinEnabled) {
+ if (CSkin::m_skinEnabled) {
rc.bottom -= 2;
CSkin::SkinDrawBG(m_dat->hwnd, m_dat->pContainer->hwnd, m_dat->pContainer, &rc, hdc);
item = &SkinItems[ID_EXTBKINFOPANELBG];
@@ -304,7 +304,7 @@ void CInfoPanel::renderBG(const HDC hdc, RECT& rc, CSkinItem *item, bool fAero, rc.bottom -= 2;
::DrawAlpha(hdc, &rc, PluginConfig.m_ipBackgroundGradient, 100, PluginConfig.m_ipBackgroundGradientHigh, 0, 17,
0, 0, 0);
- if(fAutoCalc) {
+ if (fAutoCalc) {
rc.top = rc.bottom - 1;
rc.left--; rc.right++;
}
@@ -322,7 +322,7 @@ void CInfoPanel::renderBG(const HDC hdc, RECT& rc, CSkinItem *item, bool fAero, */
void CInfoPanel::renderContent(const HDC hdc)
{
- if(m_active) {
+ if (m_active) {
if (!m_isChat) {
RECT rc;
@@ -341,11 +341,11 @@ void CInfoPanel::renderContent(const HDC hdc) }
rc = m_dat->rcNick;
- if(m_height >= DEGRADE_THRESHOLD) {
+ if (m_height >= DEGRADE_THRESHOLD) {
rc.top -= 2;// rc.bottom += 6;
}
RenderIPNickname(hdc, rc);
- if(m_height >= DEGRADE_THRESHOLD) {
+ if (m_height >= DEGRADE_THRESHOLD) {
rc = m_dat->rcUIN;
RenderIPUIN(hdc, rc);
}
@@ -356,11 +356,11 @@ void CInfoPanel::renderContent(const HDC hdc) RECT rc;
rc = m_dat->rcNick;
- if(m_height >= DEGRADE_THRESHOLD)
+ if (m_height >= DEGRADE_THRESHOLD)
rc.top -= 2; rc.bottom -= 2;
Chat_RenderIPNickname(hdc, rc);
- if(m_height >= DEGRADE_THRESHOLD) {
+ if (m_height >= DEGRADE_THRESHOLD) {
rc = m_dat->rcUIN;
Chat_RenderIPSecondLine(hdc, rc);
}
@@ -388,7 +388,7 @@ void CInfoPanel::RenderIPNickname(const HDC hdc, RECT& rcItem) bool fShowUin = false;
COLORREF clr = 0;
- if(m_height < DEGRADE_THRESHOLD) {
+ if (m_height < DEGRADE_THRESHOLD) {
szTextToShow = m_dat->cache->getUIN();
fShowUin = true;
} else
@@ -411,7 +411,7 @@ void CInfoPanel::RenderIPNickname(const HDC hdc, RECT& rcItem) rcItem.left += 21;
}
- if(fShowUin) {
+ if (fShowUin) {
hOldFont = reinterpret_cast<HFONT>(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_UIN]));
clr = m_ipConfig.clrs[IPFONTID_UIN];
}
@@ -434,13 +434,13 @@ void CInfoPanel::RenderIPNickname(const HDC hdc, RECT& rcItem) dtFlagsNick |= DT_VCENTER;
mapRealRect(rcItem, m_rcNick, m_szNick);
- if(m_hoverFlags & HOVER_NICK)
+ if (m_hoverFlags & HOVER_NICK)
setUnderlinedFont(hdc, fShowUin ? m_ipConfig.hFonts[IPFONTID_UIN] : m_ipConfig.hFonts[IPFONTID_NICK]);
CSkin::RenderText(hdc, m_dat->hThemeIP, szTextToShow, &rcItem, dtFlagsNick, CSkin::m_glowSize, clr);
HFONT hFont = reinterpret_cast<HFONT>(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_STATUS]));
- if(m_hoverFlags & HOVER_NICK)
+ if (m_hoverFlags & HOVER_NICK)
::DeleteObject(hFont);
clr = m_ipConfig.clrs[IPFONTID_STATUS];
@@ -459,10 +459,10 @@ void CInfoPanel::RenderIPNickname(const HDC hdc, RECT& rcItem) } else {
GetTextExtentPoint32(hdc, szTextToShow, lstrlen(szTextToShow), &m_szNick);
mapRealRect(rcItem, m_rcNick, m_szNick);
- if(m_hoverFlags & HOVER_NICK)
+ if (m_hoverFlags & HOVER_NICK)
setUnderlinedFont(hdc, fShowUin ? m_ipConfig.hFonts[IPFONTID_UIN] : m_ipConfig.hFonts[IPFONTID_NICK]);
CSkin::RenderText(hdc, m_dat->hThemeIP, szTextToShow, &rcItem, DT_SINGLELINE | DT_VCENTER | DT_WORD_ELLIPSIS | DT_NOPREFIX, CSkin::m_glowSize, clr);
- if(m_hoverFlags & HOVER_NICK)
+ if (m_hoverFlags & HOVER_NICK)
::DeleteObject(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_UIN]));
}
if (hOldFont)
@@ -488,7 +488,7 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem) rcItem.left += 2;
- if(m_hoverFlags & HOVER_UIN)
+ if (m_hoverFlags & HOVER_UIN)
hOldFont = setUnderlinedFont(hdc, m_ipConfig.hFonts[IPFONTID_UIN]);
else
hOldFont = reinterpret_cast<HFONT>(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_UIN]));
@@ -517,7 +517,7 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem) mapRealRect(rcItem, m_rcUIN, sUIN);
CSkin::RenderText(hdc, m_dat->hThemeIP, szBuf, &rcItem, DT_SINGLELINE | DT_VCENTER, CSkin::m_glowSize, clr);
}
- if(m_hoverFlags & HOVER_UIN)
+ if (m_hoverFlags & HOVER_UIN)
::DeleteObject(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_UIN]));
if (hOldFont)
@@ -562,7 +562,7 @@ void CInfoPanel::RenderIPStatus(const HDC hdc, RECT& rcItem) m_dat->panelStatusCX = 3 + sStatus.cx + sProto.cx + 14 + (m_dat->hClientIcon ? 20 : 0) + sTime.cx + 13;;
- if(m_dat->panelStatusCX != oldPanelStatusCX) {
+ if (m_dat->panelStatusCX != oldPanelStatusCX) {
SendMessage(m_dat->hwnd, WM_SIZE, 0, 0);
rcItem = m_dat->rcStatus;
}
@@ -572,7 +572,7 @@ void CInfoPanel::RenderIPStatus(const HDC hdc, RECT& rcItem) rc.left += 2;
rc.right -=3;
- if(szResult[0]) {
+ if (szResult[0]) {
HFONT oldFont = 0;
::DrawIconEx(hdc, rcItem.left, (rcItem.bottom - rcItem.top) / 2 - 8 + rcItem.top, PluginConfig.g_iconClock, 16, 16, 0, 0, DI_NORMAL);
@@ -592,10 +592,10 @@ void CInfoPanel::RenderIPStatus(const HDC hdc, RECT& rcItem) SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_STATUS]);
clr = m_ipConfig.clrs[IPFONTID_STATUS];
mapRealRect(rc, m_rcStatus, sStatus);
- if(m_hoverFlags & HOVER_STATUS)
+ if (m_hoverFlags & HOVER_STATUS)
setUnderlinedFont(hdc, m_ipConfig.hFonts[IPFONTID_STATUS]);
CSkin::RenderText(hdc, m_dat->hThemeIP, m_dat->szStatus, &rc, DT_SINGLELINE | DT_VCENTER, CSkin::m_glowSize, clr);
- if(m_hoverFlags & HOVER_STATUS)
+ if (m_hoverFlags & HOVER_STATUS)
::DeleteObject(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_STATUS]));
}
if (szFinalProto) {
@@ -624,13 +624,13 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem) HFONT hOldFont = 0;
- if(si == 0)
+ if (si == 0)
return;
::SetBkMode(hdc, TRANSPARENT);
m_szNick.cx = m_szNick.cy = 0;
- if(m_height < DEGRADE_THRESHOLD) {
+ if (m_height < DEGRADE_THRESHOLD) {
TCHAR tszText[2048];
mir_sntprintf(tszText, safe_sizeof(tszText), TranslateT("Topic is: %s"), si->ptszTopic ? si->ptszTopic :
@@ -646,23 +646,23 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem) ::GetTextExtentPoint32(hdc, tszNick, lstrlen(tszNick), &m_szNick);
mapRealRect(rcItem, m_rcNick, m_szNick);
- if(m_hoverFlags & HOVER_NICK)
+ if (m_hoverFlags & HOVER_NICK)
setUnderlinedFont(hdc, m_ipConfig.hFonts[IPFONTID_NICK]);
CSkin::RenderText(hdc, m_dat->hThemeIP, tszNick, &rcItem, DT_SINGLELINE | DT_NOPREFIX | DT_VCENTER,
CSkin::m_glowSize, m_ipConfig.clrs[IPFONTID_NICK]);
- if(m_hoverFlags & HOVER_NICK)
+ if (m_hoverFlags & HOVER_NICK)
::DeleteObject(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_NICK]));
rcItem.left += (m_szNick.cx + 4);
::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_STATUS]);
- if(si->ptszStatusbarText) {
+ if (si->ptszStatusbarText) {
TCHAR *pTmp = _tcschr(si->ptszStatusbarText, ']');
pTmp += 2;
TCHAR tszTemp[30];
- if(si->ptszStatusbarText[0] == '[' && pTmp > si->ptszStatusbarText && ((pTmp - si->ptszStatusbarText) < (size_t)30)) {
+ if (si->ptszStatusbarText[0] == '[' && pTmp > si->ptszStatusbarText && ((pTmp - si->ptszStatusbarText) < (size_t)30)) {
mir_sntprintf(tszTemp, pTmp - si->ptszStatusbarText, _T("%s"), si->ptszStatusbarText);
CSkin::RenderText(hdc, m_dat->hThemeIP, tszTemp, &rcItem, DT_SINGLELINE | DT_END_ELLIPSIS | DT_NOPREFIX | DT_VCENTER,
CSkin::m_glowSize, m_ipConfig.clrs[IPFONTID_STATUS]);
@@ -686,7 +686,7 @@ void CInfoPanel::Chat_RenderIPSecondLine(const HDC hdc, RECT& rcItem) SESSION_INFO *si = reinterpret_cast<SESSION_INFO *>(m_dat->si);
- if(si == 0)
+ if (si == 0)
return;
hOldFont = reinterpret_cast<HFONT>(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_UIN]));
@@ -696,19 +696,19 @@ void CInfoPanel::Chat_RenderIPSecondLine(const HDC hdc, RECT& rcItem) mir_sntprintf(szPrefix, 100, szTopicTitle, _T(""));
::GetTextExtentPoint32(hdc, szPrefix, lstrlen(szPrefix), &szTitle);
mapRealRect(rcItem, m_rcUIN, szTitle);
- if(m_hoverFlags & HOVER_UIN)
+ if (m_hoverFlags & HOVER_UIN)
setUnderlinedFont(hdc, m_ipConfig.hFonts[IPFONTID_UIN]);
rcItem.right -= 3;
CSkin::RenderText(hdc, m_dat->hThemeIP, szPrefix, &rcItem, DT_SINGLELINE | DT_NOPREFIX | DT_TOP, CSkin::m_glowSize, clr);
rcItem.left += (szTitle.cx + 4);
- if(m_hoverFlags & HOVER_UIN)
+ if (m_hoverFlags & HOVER_UIN)
::DeleteObject(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_UIN]));
- if(si->ptszTopic && lstrlen(si->ptszTopic) > 1)
+ if (si->ptszTopic && lstrlen(si->ptszTopic) > 1)
CSkin::RenderText(hdc, m_dat->hThemeIP, si->ptszTopic, &rcItem, DT_WORDBREAK | DT_END_ELLIPSIS | DT_NOPREFIX | DT_TOP, CSkin::m_glowSize, clr);
else
CSkin::RenderText(hdc, m_dat->hThemeIP, TranslateT("no topic set."), &rcItem, DT_TOP| DT_SINGLELINE | DT_NOPREFIX, CSkin::m_glowSize, clr);
- if(hOldFont)
+ if (hOldFont)
::SelectObject(hdc, hOldFont);
}
/**
@@ -718,7 +718,7 @@ void CInfoPanel::Invalidate(BOOL fErase) const {
RECT rc;
- if(m_active) {
+ if (m_active) {
::GetClientRect(m_dat->hwnd, &rc);
rc.bottom = m_height;
::InvalidateRect(m_dat->hwnd, &rc, fErase);
@@ -738,11 +738,11 @@ HMENU CInfoPanel::constructContextualMenu() const mii.hbmpItem = HBMMENU_CALLBACK;
if (!(m_hoverFlags & HOVER_NICK))
- return(0);
+ return 0;
HMENU m = ::CreatePopupMenu();
- if(m_hoverFlags & HOVER_NICK) {
+ if (m_hoverFlags & HOVER_NICK) {
Utils::addMenuItem(m, mii, ::LoadSkinnedIcon(SKINICON_OTHER_USERDETAILS), TranslateT("Open User Details..."),
IDC_NAME, 0);
Utils::addMenuItem(m, mii, ::LoadSkinnedIcon(SKINICON_OTHER_HISTORY), TranslateT("Open History..."),
@@ -752,7 +752,7 @@ HMENU CInfoPanel::constructContextualMenu() const ID_MESSAGELOGSETTINGS_FORTHISCONTACT, 1);
else {
::AppendMenu(m, MF_STRING, IDC_CHANMGR, TranslateT("Room Settings..."));
- if(GCW_SERVER & m_dat->si->iType)
+ if (GCW_SERVER & m_dat->si->iType)
::EnableMenuItem(m, IDC_CHANMGR, MF_BYCOMMAND | MF_GRAYED);
}
::AppendMenu(m, MF_SEPARATOR, 1000, 0);
@@ -777,18 +777,18 @@ LRESULT CInfoPanel::cmdHandler(UINT cmd) {
switch(cmd) {
case CMD_IP_COPY:
- if(m_hoverFlags & HOVER_NICK) {
+ if (m_hoverFlags & HOVER_NICK) {
Utils::CopyToClipBoard(const_cast<wchar_t *>(m_dat->cache->getNick()), m_dat->hwnd);
return(S_OK);
}
- else if(m_hoverFlags & HOVER_UIN) {
+ else if (m_hoverFlags & HOVER_UIN) {
Utils::CopyToClipBoard(m_isChat ? m_dat->si->ptszTopic : const_cast<wchar_t *>(m_dat->cache->getUIN()), m_dat->hwnd);
return(S_OK);
}
break;
case IDC_CHAT_HISTORY:
case IDC_CHANMGR:
- if(m_isChat) {
+ if (m_isChat) {
SendMessage(m_dat->hwnd, WM_COMMAND, cmd, 0);
return(S_OK);
}
@@ -814,11 +814,11 @@ void CInfoPanel::handleClick(const POINT& pt) m_dat->dwFlagsEx &= ~MWF_SHOW_AWAYMSGTIMER;
}
HMENU m = constructContextualMenu();
- if(m) {
+ if (m) {
LRESULT r = ::TrackPopupMenu(m, TPM_RETURNCMD, pt.x, pt.y, 0, m_dat->hwnd, NULL);
::DestroyMenu(m);
- if(S_OK != cmdHandler(r))
+ if (S_OK != cmdHandler(r))
Utils::CmdDispatcher(Utils::CMD_INFOPANEL, m_dat->hwnd, r, 0, 0, m_dat, m_dat->pContainer);
}
m_hoverFlags = 0;
@@ -878,15 +878,15 @@ void CInfoPanel::trackMouse(POINT& pt) break;
}
- if(m_hoverFlags) {
+ if (m_hoverFlags) {
if (!(m_dat->dwFlagsEx & MWF_SHOW_AWAYMSGTIMER)) {
::SetTimer(m_dat->hwnd, TIMERID_AWAYMSG, 1000, 0);
m_dat->dwFlagsEx |= MWF_SHOW_AWAYMSGTIMER;
}
}
- if(dwOldHovering != m_hoverFlags)
+ if (dwOldHovering != m_hoverFlags)
Invalidate(TRUE);
- if(m_hoverFlags == 0)
+ if (m_hoverFlags == 0)
m_dat->dwFlagsEx &= ~MWF_SHOW_AWAYMSGTIMER;
}
@@ -913,7 +913,7 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam) size_t pos;
BYTE xStatus = 0;
- if(m_hwndConfig)
+ if (m_hwndConfig)
return;
mir_sntprintf(temp, 1024, RTF_DEFAULT_HEADER, 0, 0, 0, 30*15);
@@ -926,27 +926,27 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam) if ((xStatus = m_dat->cache->getXStatusId())) {
TCHAR *tszXStatusName = 0;
- if(0 == M->GetTString(m_dat->cache->getContact(), m_dat->cache->getProto(), "XStatusName", &dbv))
+ if (0 == M->GetTString(m_dat->cache->getContact(), m_dat->cache->getProto(), "XStatusName", &dbv))
tszXStatusName = dbv.ptszVal;
- else if(xStatus > 0 && xStatus <= 31)
+ else if (xStatus > 0 && xStatus <= 31)
tszXStatusName = xStatusDescr[xStatus - 1];
- if(tszXStatusName) {
+ if (tszXStatusName) {
str->append(TranslateT("\\par\\par\\tab \\ul\\b Extended status information:\\ul0\\b0 \\par "));
mir_sntprintf(temp, 1024, _T("%s%s%s"), tszXStatusName, m_dat->cache->getXStatusMsg() ? _T(" / ") : _T(""),
m_dat->cache->getXStatusMsg() ? m_dat->cache->getXStatusMsg() : _T(""));
str->append(temp);
- if(dbv.ptszVal)
+ if (dbv.ptszVal)
mir_free(dbv.ptszVal);
}
}
- if(m_dat->cache->getListeningInfo()) {
+ if (m_dat->cache->getListeningInfo()) {
mir_sntprintf(temp, 1024, TranslateT("\\par\\par\\tab \\ul\\b Listening to:\\ul0\\b0 \\par %s"), m_dat->cache->getListeningInfo());
str->append(temp);
}
- if(0 == M->GetTString(m_dat->cache->getActiveContact(), m_dat->cache->getActiveProto(), "MirVer", &dbv)) {
+ if (0 == M->GetTString(m_dat->cache->getActiveContact(), m_dat->cache->getActiveProto(), "MirVer", &dbv)) {
mir_sntprintf(temp, 1024, TranslateT("\\par\\par\\ul\\b Client:\\ul0\\b0 %s"), dbv.ptszVal);
::DBFreeVariant(&dbv);
str->append(temp);
@@ -993,8 +993,8 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam) */
void CInfoPanel::hideTip(const HWND hwndNew)
{
- if(m_tip) {
- if(hwndNew == m_tip->getHwnd())
+ if (m_tip) {
+ if (hwndNew == m_tip->getHwnd())
return;
if (::IsWindow(m_tip->getHwnd()))
::DestroyWindow(m_tip->getHwnd());
@@ -1019,7 +1019,7 @@ INT_PTR CALLBACK CInfoPanel::avatarParentSubclass(HWND hwnd, UINT msg, WPARAM wP RECT rc, rcItem;
TWindowData* dat = (TWindowData *)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
- if(dat == 0)
+ if (dat == 0)
break;
GetClientRect(hwnd, &rcItem);
@@ -1029,7 +1029,7 @@ INT_PTR CALLBACK CInfoPanel::avatarParentSubclass(HWND hwnd, UINT msg, WPARAM wP HDC dcWin = (HDC)wParam;
- if(M->isAero()) {
+ if (M->isAero()) {
HDC hdc;
HBITMAP hbm, hbmOld;
LONG cx = rcItem.right - rcItem.left;
@@ -1042,10 +1042,10 @@ INT_PTR CALLBACK CInfoPanel::avatarParentSubclass(HWND hwnd, UINT msg, WPARAM wP hbm = CSkin::CreateAeroCompatibleBitmap(rc, dcWin);
hbmOld = (HBITMAP)SelectObject(hdc, hbm);
- if(CSkin::m_pCurrentAeroEffect == 0)
+ if (CSkin::m_pCurrentAeroEffect == 0)
FillRect(hdc, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH));
else {
- if(CSkin::m_pCurrentAeroEffect->m_finalAlpha == 0)
+ if (CSkin::m_pCurrentAeroEffect->m_finalAlpha == 0)
CSkin::ApplyAeroEffect(hdc, &rc, CSkin::AERO_EFFECT_AREA_INFOPANEL, 0);
else {
FillRect(hdc, &rc, CSkin::m_BrushBack);
@@ -1062,10 +1062,10 @@ INT_PTR CALLBACK CInfoPanel::avatarParentSubclass(HWND hwnd, UINT msg, WPARAM wP rc.left -= 3; rc.right += 3;
dat->Panel->renderBG(dcWin, rc, &SkinItems[ID_EXTBKINFOPANELBG], M->isAero(), false);
}
- if(CSkin::m_bAvatarBorderType == 1) {
+ if (CSkin::m_bAvatarBorderType == 1) {
HRGN clipRgn = 0;
- if(dat->hwndPanelPic) {
+ if (dat->hwndPanelPic) {
RECT rcPic;
GetClientRect(dat->hwndPanelPic, &rcPic);
LONG ix = ((rcItem.right - rcItem.left) - rcPic.right) / 2 - 1;
@@ -1098,7 +1098,7 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProcStub(HWND hwnd, UINT msg, WPARAM wPara {
CInfoPanel *infoPanel = reinterpret_cast<CInfoPanel *>(::GetWindowLongPtr(hwnd, GWLP_USERDATA));
- if(infoPanel)
+ if (infoPanel)
return(infoPanel->ConfigDlgProc(hwnd, msg, wParam, lParam));
switch(msg) {
@@ -1166,7 +1166,7 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L HWND hwndChild = (HWND)lParam;
UINT id = ::GetDlgCtrlID(hwndChild);
- if(m_configDlgFont == 0) {
+ if (m_configDlgFont == 0) {
HFONT hFont = (HFONT)::SendDlgItemMessage(hwnd, IDC_IPCONFIG_TITLE, WM_GETFONT, 0, 0);
LOGFONT lf = {0};
@@ -1179,12 +1179,12 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L ::SendDlgItemMessage(hwnd, IDC_IPCONFIG_TITLE, WM_SETFONT, (WPARAM)m_configDlgFont, FALSE);
}
- if(hwndChild == ::GetDlgItem(hwnd, IDC_IPCONFIG_TITLE)) {
+ if (hwndChild == ::GetDlgItem(hwnd, IDC_IPCONFIG_TITLE)) {
::SetTextColor((HDC)wParam, RGB(60, 60, 150));
::SendMessage(hwndChild, WM_SETFONT, (WPARAM)m_configDlgFont, FALSE);
- } else if(id == IDC_IPCONFIG_FOOTER || id == IDC_SIZE_TIP || id == IDC_IPCONFIG_PRIVATECONTAINER)
+ } else if (id == IDC_IPCONFIG_FOOTER || id == IDC_SIZE_TIP || id == IDC_IPCONFIG_PRIVATECONTAINER)
::SetTextColor((HDC)wParam, RGB(160, 50, 50));
- else if(id == IDC_GROUP_SIZE || id == IDC_GROUP_SCOPE || id == IDC_GROUP_OTHER)
+ else if (id == IDC_GROUP_SIZE || id == IDC_GROUP_SCOPE || id == IDC_GROUP_OTHER)
::SendMessage(hwndChild, WM_SETFONT, (WPARAM)m_configDlgBoldFont, FALSE);
::SetBkColor((HDC)wParam, ::GetSysColor(COLOR_WINDOW));
@@ -1198,13 +1198,13 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L case IDC_PANELSIZE: {
LRESULT iResult = ::SendDlgItemMessage(hwnd, IDC_PANELSIZE, CB_GETCURSEL, 0, 0);
- if(iResult == 0) {
- if(m_fPrivateHeight) {
+ if (iResult == 0) {
+ if (m_fPrivateHeight) {
M->WriteDword(m_dat->hContact, SRMSGMOD_T, "panelheight", m_height);
loadHeight();
}
}
- else if(iResult == 1) {
+ else if (iResult == 1) {
M->WriteDword(m_dat->hContact, SRMSGMOD_T, "panelheight",
MAKELONG(M->GetDword(m_dat->hContact, "panelheight", m_height), 0xffff));
loadHeight();
@@ -1217,8 +1217,8 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L LRESULT iResult = ::SendDlgItemMessage(hwnd, IDC_PANELPICTUREVIS, CB_GETCURSEL, 0, 0);
BYTE vNew = (iResult == 0 ? (BYTE)-1 : (iResult == 1 ? 1 : 0));
- if(vNew != vOld) {
- if(vNew == (BYTE)-1)
+ if (vNew != vOld) {
+ if (vNew == (BYTE)-1)
DBDeleteContactSetting(m_dat->hContact, SRMSGMOD_T, "hideavatar");
else
M->WriteByte(m_dat->hContact, SRMSGMOD_T, "hideavatar", vNew);
@@ -1235,7 +1235,7 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L LRESULT iResult = ::SendDlgItemMessage(hwnd, IDC_PANELVISIBILITY, CB_GETCURSEL, 0, 0);
BYTE vNew = (iResult == 0 ? 0 : (iResult == 1 ? (BYTE)-1 : 1));
- if(vNew != vOld) {
+ if (vNew != vOld) {
M->WriteByte(m_dat->hContact, SRMSGMOD_T, "infopanel", vNew);
getVisibility();
showHide();
@@ -1271,7 +1271,7 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L }
break;
}
- if(m_height != lOldHeight) {
+ if (m_height != lOldHeight) {
::SendMessage(m_dat->hwnd, WM_SIZE, 0, 0);
m_dat->panelWidth = -1;
::SetAeroMargins(m_dat->pContainer);
@@ -1282,7 +1282,7 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L }
case WM_CLOSE:
- if(wParam == 1 && lParam == 1) {
+ if (wParam == 1 && lParam == 1) {
::DestroyWindow(hwnd);
}
break;
@@ -1310,20 +1310,20 @@ int CInfoPanel::invokeConfigDialog(const POINT& pt) POINT ptTest = pt;
if (!m_active)
- return(0);
+ return 0;
::GetWindowRect(m_dat->hwnd, &rc);
rc.bottom = rc.top + m_height;
rc.right -= m_dat->panelWidth;
if (!::PtInRect(&rc, ptTest))
- return(0);
+ return 0;
- if(m_hwndConfig == 0) {
+ if (m_hwndConfig == 0) {
m_configDlgBoldFont = m_configDlgFont = 0;
m_hwndConfig = ::CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_INFOPANEL), 0 /*m_dat->pContainer->hwnd */,
ConfigDlgProcStub, (LPARAM)this);
- if(m_hwndConfig) {
+ if (m_hwndConfig) {
RECT rc, rcLog;
POINT pt;
@@ -1337,10 +1337,10 @@ int CInfoPanel::invokeConfigDialog(const POINT& pt) m_fDialogCreated = true;
::SetWindowPos(m_hwndConfig, HWND_TOP, pt.x + 10, pt.y - (m_active ? 10 : 0), 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW);
- return(1);
+ return 1;
}
}
- return(0);
+ return 0;
}
/**
@@ -1350,7 +1350,7 @@ int CInfoPanel::invokeConfigDialog(const POINT& pt) */
void CInfoPanel::dismissConfig(bool fForced)
{
- if(m_hwndConfig == 0)
+ if (m_hwndConfig == 0)
return;
POINT pt;
@@ -1359,7 +1359,7 @@ void CInfoPanel::dismissConfig(bool fForced) if (!m_fDialogCreated) {
::GetCursorPos(&pt);
::GetWindowRect(m_hwndConfig, &rc);
- if(fForced || !PtInRect(&rc, pt)) {
+ if (fForced || !PtInRect(&rc, pt)) {
SendMessage(m_hwndConfig, WM_CLOSE, 1, 1);
m_hwndConfig = 0;
}
@@ -1388,7 +1388,7 @@ CTip::CTip(const HWND hwndParent, const HANDLE hContact, const TCHAR *pszText, c ::SendMessage(m_hRich, WM_SETFONT, (WPARAM)CInfoPanel::m_ipConfig.hFonts[IPFONTID_STATUS], 0);
m_hContact = hContact;
- if(pszText)
+ if (pszText)
m_pszText = mir_utf8encodeT(pszText);
else
m_pszText = 0;
@@ -1433,7 +1433,7 @@ void CTip::show(const RECT& rc, POINT& pt, const HICON hIcon, const TCHAR *szTit SMADD_RICHEDIT3 smadd;
CContactCache* c = CContactCache::getContactCache(m_hContact);
::SendMessage(m_hRich, EM_SETBKGNDCOLOR, 0, (LPARAM)PluginConfig.m_ipBackgroundGradientHigh);
- if(c) {
+ if (c) {
ZeroMemory(&smadd, sizeof(smadd));
smadd.cbSize = sizeof(smadd);
@@ -1448,7 +1448,7 @@ void CTip::show(const RECT& rc, POINT& pt, const HICON hIcon, const TCHAR *szTit }
::GetWindowRect(m_hwndParent, &rcParent);
- if(pt.x + rc.right > rcParent.right)
+ if (pt.x + rc.right > rcParent.right)
pt.x = rcParent.right - rc.right - 5;
m_rcRich = rc;
@@ -1513,7 +1513,7 @@ INT_PTR CALLBACK CTip::RichEditProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l break;
case WM_ERASEBKGND:
- return(1);
+ return 1;
case WM_NCCALCSIZE:
SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) & ~WS_VSCROLL);
@@ -1522,7 +1522,7 @@ INT_PTR CALLBACK CTip::RichEditProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l break;
case WM_VSCROLL:
- return(0);
+ return 0;
}
return(::CallWindowProc(m_OldMessageEditProc, hwnd, msg, wParam, lParam));
}
@@ -1535,7 +1535,7 @@ INT_PTR CALLBACK CTip::WndProcStub(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP {
CTip *tip = reinterpret_cast<CTip *>(::GetWindowLongPtr(hwnd, GWLP_USERDATA));
- if(tip)
+ if (tip)
return(tip->WndProc(hwnd, msg, wParam, lParam));
switch(msg) {
@@ -1560,7 +1560,7 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ::KillTimer(hwnd, 1000);
::SetTimer(hwnd, 1000, 200, 0);
- if(msg == WM_ACTIVATE && LOWORD(wParam) == WA_INACTIVE)
+ if (msg == WM_ACTIVATE && LOWORD(wParam) == WA_INACTIVE)
::DestroyWindow(hwnd);
break;
@@ -1583,7 +1583,7 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam mir_sntprintf(szTitle, 128, m_szTitle ? _T("%s (%s)") : _T("%s%s"), c->getNick(), m_szTitle ? m_szTitle : _T(""));
- if(m_panel) {
+ if (m_panel) {
HDC hdcMem = ::CreateCompatibleDC(hdc);
HBITMAP hbm = ::CSkin::CreateAeroCompatibleBitmap(rc, hdc);
HBITMAP hbmOld = reinterpret_cast<HBITMAP>(::SelectObject(hdcMem, hbm));
@@ -1594,7 +1594,7 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam rc.bottom += 2;
rc.left -= 4;rc.right += 4;
HBRUSH br = ::CreateSolidBrush(PluginConfig.m_ipBackgroundGradientHigh);
- if(M->isAero()) {
+ if (M->isAero()) {
::FillRect(hdcMem, &rc, reinterpret_cast<HBRUSH>(::GetStockObject(BLACK_BRUSH)));
CSkin::ApplyAeroEffect(hdcMem, &rcText, CSkin::AERO_EFFECT_AREA_MENUBAR, 0);
::FillRect(hdcMem, &m_rcRich, br);
@@ -1617,19 +1617,19 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam LONG dy = 4;
- if(m_hIcon) {
+ if (m_hIcon) {
::DrawIconEx(hdcMem, 2, dy, m_hIcon, 16, 16, 0, 0, DI_NORMAL);
dy = TOP_BORDER + 4;
}
- if(m_panel->getDat()->hXStatusIcon) {
+ if (m_panel->getDat()->hXStatusIcon) {
::DrawIconEx(hdcMem, 2, dy, m_panel->getDat()->hXStatusIcon, 16, 16, 0, 0, DI_NORMAL);
dy += 18;
}
- if(m_panel->getDat()->hClientIcon)
+ if (m_panel->getDat()->hClientIcon)
::DrawIconEx(hdcMem, 2, dy, m_panel->getDat()->hClientIcon, 16, 16, 0, 0, DI_NORMAL);
CSkin::RenderText(hdcMem, hTheme, szTitle, &rcText, DT_SINGLELINE|DT_END_ELLIPSIS|DT_VCENTER, CSkin::m_glowSize, clr);
- if(hTheme)
+ if (hTheme)
CMimAPI::m_pfnCloseThemeData(hTheme);
::SelectObject(hdcMem, hOldFont);
::BitBlt(hdc, 0, 0, cx, cy, hdcMem, 0, 0, SRCCOPY);
@@ -1637,7 +1637,7 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ::DeleteObject(hbm);
::DeleteDC(hdcMem);
}
- return(1);
+ return 1;
}
case WM_NOTIFY: {
@@ -1649,7 +1649,7 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ENLINK* e = reinterpret_cast<ENLINK *>(lParam);
const TCHAR* tszUrl = Utils::extractURLFromRichEdit(e, m_hRich);
- if(tszUrl) {
+ if (tszUrl) {
char* szUrl = mir_t2a(tszUrl);
CallService(MS_UTILS_OPENURL, 1, (LPARAM)szUrl);
@@ -1674,7 +1674,7 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam }
case WM_TIMER:
- if(wParam == 1000) {
+ if (wParam == 1000) {
POINT pt;
RECT rc;
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index dd4999d480..bab0647150 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -195,25 +195,25 @@ const TCHAR* CMimAPI::StriStr(const TCHAR *szString, const TCHAR *szSearchFor) {
assert(szString != 0 && szSearchFor != 0);
- if(szString && *szString) {
+ if (szString && *szString) {
if (0 == szSearchFor || 0 == *szSearchFor)
return(szString);
for (; *szString; ++szString) {
- if(_totupper(*szString) == _totupper(*szSearchFor)) {
+ if (_totupper(*szString) == _totupper(*szSearchFor)) {
const TCHAR *h, *n;
for(h = szString, n = szSearchFor; *h && *n; ++h, ++n) {
- if(_totupper(*h) != _totupper(*n))
+ if (_totupper(*h) != _totupper(*n))
break;
}
if (!*n)
return(szString);
}
}
- return(0);
+ return 0;
}
else
- return(0);
+ return 0;
}
int CMimAPI::pathIsAbsolute(const TCHAR *path) const
@@ -240,7 +240,7 @@ size_t CMimAPI::pathToRelative(const TCHAR *pSrc, TCHAR *pOut, const TCHAR *szBa mir_sntprintf(szTmp, SIZEOF(szTmp), _T("%s"), pSrc);
if (StriStr(szTmp, tszBase)) {
- if(tszBase[lstrlen(tszBase) - 1] == '\\')
+ if (tszBase[lstrlen(tszBase) - 1] == '\\')
mir_sntprintf(pOut, MAX_PATH, _T("%s"), pSrc + lstrlen(tszBase));
else {
mir_sntprintf(pOut, MAX_PATH, _T("%s"), pSrc + lstrlen(tszBase) + 1 );
@@ -337,7 +337,7 @@ INT_PTR CMimAPI::foldersPathChanged() {
TCHAR szTemp[MAX_PATH + 2] = {'\0'};
- if(m_hDataPath) {
+ if (m_hDataPath) {
FoldersGetCustomPathT(m_hDataPath, szTemp, MAX_PATH, const_cast<TCHAR *>(getDataPath()));
mir_sntprintf(m_szProfilePath, MAX_PATH, _T("%s"), szTemp);
@@ -367,7 +367,7 @@ INT_PTR CMimAPI::foldersPathChanged() #if defined(_FOLDER_LOCKING)
mir_sntprintf(szTemp, MAX_PATH, L"%sfolder.lck", m_szChatLogsPath);
- if(m_hChatLogLock != INVALID_HANDLE_VALUE)
+ if (m_hChatLogLock != INVALID_HANDLE_VALUE)
CloseHandle(m_hChatLogLock);
m_hChatLogLock = CreateFile(szTemp, GENERIC_WRITE, 0, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_HIDDEN, 0);
@@ -380,7 +380,7 @@ INT_PTR CMimAPI::foldersPathChanged() const TCHAR* CMimAPI::getUserDir()
{
- if(m_userDir[0] == 0) {
+ if (m_userDir[0] == 0) {
wchar_t* userdata;
if (ServiceExists(MS_FOLDERS_REGISTER_PATH))
userdata = L"%%miranda_userdata%%";
@@ -413,7 +413,7 @@ bool CMimAPI::getAeroState() {
BOOL result = FALSE;
m_isAero = m_DwmActive = false;
- if(IsWinVerVistaPlus()) {
+ if (IsWinVerVistaPlus()) {
m_DwmActive = (m_pfnDwmIsCompositionEnabled && (m_pfnDwmIsCompositionEnabled(&result) == S_OK) && result) ? true : false;
m_isAero = (CSkin::m_skinEnabled == false) && GetByte("useAero", 1) && CSkin::m_fAeroSkinsValid && m_DwmActive;
@@ -490,7 +490,7 @@ void CMimAPI::InitAPI() /*
* additional uxtheme APIs (Vista+)
*/
- if(m_hUxTheme) {
+ if (m_hUxTheme) {
m_pfnDrawThemeTextEx = (PDTTE)GetProcAddress(m_hUxTheme, "DrawThemeTextEx");
m_pfnBeginBufferedPaint = (BBP)GetProcAddress(m_hUxTheme, "BeginBufferedPaint");
m_pfnEndBufferedPaint = (EBP)GetProcAddress(m_hUxTheme, "EndBufferedPaint");
@@ -498,7 +498,7 @@ void CMimAPI::InitAPI() m_pfnBufferedPaintUninit = (BPU)GetProcAddress(m_hUxTheme, "BufferedPaintUnInit");
m_pfnBufferedPaintSetAlpha = (BPSA)GetProcAddress(m_hUxTheme, "BufferedPaintSetAlpha");
m_haveBufferedPaint = (m_pfnBeginBufferedPaint != 0 && m_pfnEndBufferedPaint != 0) ? true : false;
- if(m_haveBufferedPaint)
+ if (m_haveBufferedPaint)
m_pfnBufferedPaintInit();
}
m_pfnGetLocaleInfoEx = (GLIX)GetProcAddress(GetModuleHandleA("kernel32"), "GetLocaleInfoEx");
@@ -518,7 +518,7 @@ int CMimAPI::TypingMessage(WPARAM wParam, LPARAM lParam) struct TContainerData *pContainer = NULL;
BOOL fShowOnClist = TRUE;
- if(wParam) {
+ if (wParam) {
if ((hwnd = M->FindWindow((HANDLE) wParam)) && M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPING, SRMSGDEFSET_SHOWTYPING))
preTyping = SendMessage(hwnd, DM_TYPING, 0, lParam);
@@ -529,16 +529,16 @@ int CMimAPI::TypingMessage(WPARAM wParam, LPARAM lParam) foundWin = 0;
- if(hwnd) {
+ if (hwnd) {
SendMessage(hwnd, DM_QUERYCONTAINER, 0, (LPARAM)&pContainer);
- if(pContainer == NULL)
+ if (pContainer == NULL)
return 0; // should never happen
}
- if(M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGCLIST, SRMSGDEFSET_SHOWTYPINGCLIST)) {
+ if (M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGCLIST, SRMSGDEFSET_SHOWTYPINGCLIST)) {
if (!hwnd && !M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGNOWINOPEN, 1))
fShowOnClist = FALSE;
- if(hwnd && !M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINOPEN, 1))
+ if (hwnd && !M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINOPEN, 1))
fShowOnClist = FALSE;
}
else
@@ -551,7 +551,7 @@ int CMimAPI::TypingMessage(WPARAM wParam, LPARAM lParam) SkinPlaySound("TNStop");
}
- if(M->GetByte(SRMSGMOD, "ShowTypingPopup", 0)) {
+ if (M->GetByte(SRMSGMOD, "ShowTypingPopup", 0)) {
BOOL fShow = FALSE;
int iMode = M->GetByte("MTN_PopupMode", 0);
@@ -564,19 +564,19 @@ int CMimAPI::TypingMessage(WPARAM wParam, LPARAM lParam) fShow = TRUE;
break;
case 2:
- if(hwnd == 0)
+ if (hwnd == 0)
fShow = TRUE;
else {
- if(PluginConfig.m_HideOnClose) {
+ if (PluginConfig.m_HideOnClose) {
struct TContainerData *pContainer = 0;
SendMessage(hwnd, DM_QUERYCONTAINER, 0, (LPARAM)&pContainer);
- if(pContainer && pContainer->fHidden)
+ if (pContainer && pContainer->fHidden)
fShow = TRUE;
}
}
break;
}
- if(fShow)
+ if (fShow)
TN_TypingMessage(wParam, lParam);
}
@@ -594,7 +594,7 @@ int CMimAPI::TypingMessage(WPARAM wParam, LPARAM lParam) tn.uTimeout = 1000 * 4;
CallService(MS_CLIST_SYSTRAY_NOTIFY, 0, (LPARAM) & tn);
}
- if(fShowOnClist) {
+ if (fShowOnClist) {
CLISTEVENT cle;
ZeroMemory(&cle, sizeof(cle));
@@ -740,7 +740,7 @@ int CMimAPI::MessageEventAdded(WPARAM wParam, LPARAM lParam) wp.length = sizeof(wp);
SendMessage(hwnd, DM_QUERYCONTAINER, 0, (LPARAM)&pTargetContainer);
- if(pTargetContainer && PluginConfig.m_HideOnClose && !IsWindowVisible(pTargetContainer->hwnd)) {
+ if (pTargetContainer && PluginConfig.m_HideOnClose && !IsWindowVisible(pTargetContainer->hwnd)) {
GetWindowPlacement(pTargetContainer->hwnd, &wp);
GetContainerNameForContact((HANDLE) wParam, szName, CONTAINER_NAMELEN);
@@ -753,8 +753,8 @@ int CMimAPI::MessageEventAdded(WPARAM wParam, LPARAM lParam) if (bAutoPopup || bAutoCreate) {
BOOL bActivate = TRUE, bPopup = TRUE;
- if(bAutoPopup) {
- if(wp.showCmd == SW_SHOWMAXIMIZED)
+ if (bAutoPopup) {
+ if (wp.showCmd == SW_SHOWMAXIMIZED)
ShowWindow(pTargetContainer->hwnd, SW_SHOWMAXIMIZED);
else
ShowWindow(pTargetContainer->hwnd, SW_SHOWNOACTIVATE);
@@ -765,14 +765,14 @@ int CMimAPI::MessageEventAdded(WPARAM wParam, LPARAM lParam) bPopup = (BOOL) M->GetByte("cpopup", 0);
pContainer = FindContainerByName(szName);
if (pContainer != NULL) {
- if(bAutoContainer) {
+ if (bAutoContainer) {
ShowWindow(pTargetContainer->hwnd, SW_SHOWMINNOACTIVE);
return 0;
}
else goto nowindowcreate;
}
else {
- if(bAutoContainer) {
+ if (bAutoContainer) {
ShowWindow(pTargetContainer->hwnd, SW_SHOWMINNOACTIVE);
return 0;
}
@@ -783,9 +783,9 @@ int CMimAPI::MessageEventAdded(WPARAM wParam, LPARAM lParam) else
return 0;
} else {
- if(dbei.eventType == EVENTTYPE_FILE) {
+ if (dbei.eventType == EVENTTYPE_FILE) {
tabSRMM_ShowPopup(wParam, lParam, dbei.eventType, 0, 0, 0, dbei.szModule, 0);
- return(0);
+ return 0;
}
}
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 5699b03e3c..b76eba793d 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -225,7 +225,7 @@ static void ShowPopupMenu(TWindowData *dat, int idFrom, HWND hwndFrom, POINT pt) M->WriteByte(SRMSGMOD_T, "msgsizebar", (BYTE)PluginConfig.m_visualMessageSizeIndicator);
M->BroadcastMessage(DM_CONFIGURETOOLBAR, 0, 0);
SendMessage(hwndDlg, WM_SIZE, 0, 0);
- if(dat->pContainer->hwndStatus)
+ if (dat->pContainer->hwndStatus)
RedrawWindow(dat->pContainer->hwndStatus, 0, 0, RDW_INVALIDATE | RDW_UPDATENOW);
break;
case ID_EDITOR_PASTEANDSENDIMMEDIATELY:
@@ -289,7 +289,7 @@ LRESULT CALLBACK HPPKFSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP {
struct TWindowData *mwdat = (struct TWindowData *)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
- if(mwdat) {
+ if (mwdat) {
BOOL isCtrl, isShift, isAlt;
KbdState(mwdat, isShift, isCtrl, isAlt);
@@ -341,12 +341,12 @@ static void MsgWindowUpdateState(TWindowData *dat, UINT msg) }
}
#if defined(__FEAT_EXP_AUTOSPLITTER)
- if(dat->fIsAutosizingInput && dat->iInputAreaHeight == -1) {
+ if (dat->fIsAutosizingInput && dat->iInputAreaHeight == -1) {
dat->iInputAreaHeight = 0;
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_REQUESTRESIZE, 0, 0);
}
#endif
- if(dat->pWnd)
+ if (dat->pWnd)
dat->pWnd->activateTab();
dat->Panel->dismissConfig();
dat->dwUnread = 0;
@@ -402,7 +402,7 @@ static void MsgWindowUpdateState(TWindowData *dat, UINT msg) CallService(MTH_Set_ToolboxEditHwnd, 0, (LPARAM)GetDlgItem(hwndDlg, IDC_MESSAGE));
MTH_updateMathWindow(dat);
}
- if(dat->pContainer->hwndActive == hwndDlg)
+ if (dat->pContainer->hwndActive == hwndDlg)
PostMessage(hwndDlg, DM_REMOVEPOPUPS, PU_REMOVE_ON_FOCUS, 0);
dat->Panel->Invalidate();
@@ -452,12 +452,12 @@ static void MsgWindowUpdateState(TWindowData *dat, UINT msg) PostMessage(hwndDlg, DM_UPDATEPICLAYOUT, 0, 0);
}
BB_SetButtonsPos(dat);
- if(M->isAero())
+ if (M->isAero())
InvalidateRect(hwndTab, NULL, FALSE);
- if(dat->pContainer->dwFlags & CNT_SIDEBAR)
+ if (dat->pContainer->dwFlags & CNT_SIDEBAR)
dat->pContainer->SideBar->setActiveItem(dat);
- if(dat->pWnd)
+ if (dat->pWnd)
dat->pWnd->Invalidate();
}
}
@@ -537,7 +537,7 @@ static LRESULT CALLBACK MessageLogSubclassProc(HWND hwnd, UINT msg, WPARAM wPara switch (msg) {
case WM_KILLFOCUS: {
- if(wParam != (WPARAM)hwnd && 0 != wParam) {
+ if (wParam != (WPARAM)hwnd && 0 != wParam) {
CHARRANGE cr;
SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)&cr);
if (cr.cpMax != cr.cpMin) {
@@ -551,30 +551,30 @@ static LRESULT CALLBACK MessageLogSubclassProc(HWND hwnd, UINT msg, WPARAM wPara case WM_CHAR:
if (wParam == 0x03 &&isCtrl)
return SendMessage(hwnd, WM_COPY, 0, 0);
- if(wParam == 0x11 && isCtrl)
+ if (wParam == 0x11 && isCtrl)
SendMessage(mwdat->hwnd,WM_COMMAND, IDC_QUOTE, 0);
break;
case WM_SYSKEYUP:
- if(wParam == VK_MENU) {
+ if (wParam == VK_MENU) {
ProcessHotkeysByMsgFilter(hwnd, msg, wParam, lParam, IDC_LOG);
- return(0);
+ return 0;
}
break;
case WM_SYSKEYDOWN:
mwdat->fkeyProcessed = false;
- if(ProcessHotkeysByMsgFilter(hwnd, msg, wParam, lParam, IDC_LOG)) {
+ if (ProcessHotkeysByMsgFilter(hwnd, msg, wParam, lParam, IDC_LOG)) {
mwdat->fkeyProcessed = true;
- return(0);
+ return 0;
}
break;
case WM_SYSCHAR: {
- if(mwdat->fkeyProcessed) {
+ if (mwdat->fkeyProcessed) {
mwdat->fkeyProcessed = false;
- return(0);
+ return 0;
}
break;
}
@@ -620,7 +620,7 @@ static LRESULT CALLBACK MessageLogSubclassProc(HWND hwnd, UINT msg, WPARAM wPara return TRUE;
}
case WM_NCDESTROY:
- if(OldMessageLogProc)
+ if (OldMessageLogProc)
SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) OldMessageLogProc);
break;
@@ -638,13 +638,13 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar * prevent the rich edit from switching text direction or keyboard layout when
* using hotkeys with ctrl-shift or alt-shift modifiers
*/
- if(mwdat->fkeyProcessed && (msg == WM_KEYUP)) {
+ if (mwdat->fkeyProcessed && (msg == WM_KEYUP)) {
GetKeyboardState(mwdat->kstate);
- if(mwdat->kstate[VK_CONTROL] & 0x80 || mwdat->kstate[VK_SHIFT] & 0x80)
- return(0);
+ if (mwdat->kstate[VK_CONTROL] & 0x80 || mwdat->kstate[VK_SHIFT] & 0x80)
+ return 0;
else {
mwdat->fkeyProcessed = false;
- return(0);
+ return 0;
}
}
switch (msg) {
@@ -659,7 +659,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar BOOL isCtrl, isShift, isAlt;
KbdState(mwdat, isShift, isCtrl, isAlt);
//MAD: sound on typing..
- if(PluginConfig.g_bSoundOnTyping&&!isAlt&&!isCtrl&&!(mwdat->pContainer->dwFlags&CNT_NOSOUND)&&wParam!=VK_ESCAPE&&!(wParam==VK_TAB&&PluginConfig.m_AllowTab))
+ if (PluginConfig.g_bSoundOnTyping&&!isAlt&&!isCtrl&&!(mwdat->pContainer->dwFlags&CNT_NOSOUND)&&wParam!=VK_ESCAPE&&!(wParam==VK_TAB&&PluginConfig.m_AllowTab))
SkinPlaySound("SoundOnTyping");
//MAD
if (wParam == 0x0d && isCtrl && PluginConfig.m_MathModAvail) {
@@ -712,7 +712,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar case EM_PASTESPECIAL: {
if (OpenClipboard(hwnd)) {
HANDLE hClip;
- if(hClip = GetClipboardData(CF_TEXT)) {
+ if (hClip = GetClipboardData(CF_TEXT)) {
if (lstrlenA((char *)hClip) > mwdat->nMax) {
TCHAR szBuffer[512];
if (M->GetByte("autosplit", 0))
@@ -722,7 +722,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar SendMessage(hwndParent, DM_ACTIVATETOOLTIP, IDC_MESSAGE, (LPARAM)szBuffer);
}
}
- else if(hClip = GetClipboardData(CF_BITMAP))
+ else if (hClip = GetClipboardData(CF_BITMAP))
SendHBitmapAsFile(mwdat, (HBITMAP)hClip);
CloseClipboard();
@@ -734,7 +734,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar KbdState(mwdat, isShift, isCtrl, isAlt);
//MAD: sound on typing..
- if(PluginConfig.g_bSoundOnTyping&&!isAlt&&!(mwdat->pContainer->dwFlags&CNT_NOSOUND)&&wParam == VK_DELETE)
+ if (PluginConfig.g_bSoundOnTyping&&!isAlt&&!(mwdat->pContainer->dwFlags&CNT_NOSOUND)&&wParam == VK_DELETE)
SkinPlaySound("SoundOnTyping");
//
@@ -746,7 +746,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), EN_CHANGE), (LPARAM) hwnd);
if (wParam == VK_RETURN) {
- if(mwdat->fEditNotesActive)
+ if (mwdat->fEditNotesActive)
break;
if (isShift) {
@@ -830,23 +830,23 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar }
case WM_SYSKEYDOWN:
mwdat->fkeyProcessed = false;
- if(ProcessHotkeysByMsgFilter(hwnd, msg, wParam, lParam, IDC_MESSAGE)) {
+ if (ProcessHotkeysByMsgFilter(hwnd, msg, wParam, lParam, IDC_MESSAGE)) {
mwdat->fkeyProcessed = true;
- return(0);
+ return 0;
}
break;
case WM_SYSKEYUP:
- if(wParam == VK_MENU) {
+ if (wParam == VK_MENU) {
ProcessHotkeysByMsgFilter(hwnd, msg, wParam, lParam, IDC_MESSAGE);
- return(0);
+ return 0;
}
break;
case WM_SYSCHAR: {
- if(mwdat->fkeyProcessed) {
+ if (mwdat->fkeyProcessed) {
mwdat->fkeyProcessed = false;
- return(0);
+ return 0;
}
HWND hwndDlg = hwndParent;
BOOL isCtrl, isShift, isAlt;
@@ -878,7 +878,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar if (PluginConfig.m_AutoLocaleSupport && GetFocus() == hwnd && mwdat->pContainer->hwndActive == hwndParent && GetForegroundWindow() == mwdat->pContainer->hwnd && GetActiveWindow() == mwdat->pContainer->hwnd) {
DM_SaveLocale(mwdat, wParam, lParam);
SendMessage(hwnd, EM_SETLANGOPTIONS, 0, (LPARAM) SendMessage(hwnd, EM_GETLANGOPTIONS, 0, 0) & ~IMF_AUTOKEYBOARD);
- return(1);
+ return 1;
}
break;
@@ -909,7 +909,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar return TRUE;
}
case WM_NCDESTROY:
- if(OldMessageEditProc)
+ if (OldMessageEditProc)
SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) OldMessageEditProc);
break;
@@ -976,7 +976,7 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM }
return 0;
case WM_ERASEBKGND:
- return(1);
+ return 1;
case WM_PAINT: {
RECT rc;
PAINTSTRUCT ps;
@@ -987,10 +987,10 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (dat && CSkin::m_skinEnabled)
CSkin::SkinDrawBG(hwnd, dat->pContainer->hwnd, dat->pContainer, &rc, dc);
- else if(M->isAero() || M->isVSThemed()) {
- if(ctrlId == IDC_PANELSPLITTER) {
+ else if (M->isAero() || M->isVSThemed()) {
+ if (ctrlId == IDC_PANELSPLITTER) {
EndPaint(hwnd, &ps);
- return(0);
+ return 0;
}
CSkin::FillBack(dc, &rc);
}
@@ -1022,7 +1022,7 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break;
GetCursorPos(&pt);
#if defined(__FEAT_EXP_AUTOSPLITTER)
- if(dat->fIsAutosizingInput)
+ if (dat->fIsAutosizingInput)
selection = ID_SPLITTERCONTEXT_SETPOSITIONFORTHISSESSION;
else
selection = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndParent, NULL);
@@ -1041,7 +1041,7 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM }
case ID_SPLITTERCONTEXT_SETPOSITIONFORTHISSESSION:
#if defined(__FEAT_EXP_AUTOSPLITTER)
- if(dat->fIsAutosizingInput) {
+ if (dat->fIsAutosizingInput) {
RECT rc;
GetWindowRect(GetDlgItem(dat->hwnd, IDC_MESSAGE), &rc);
dat->iInputAreaHeight = 0;
@@ -1158,9 +1158,9 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL * } else
dat->fMustOffset = FALSE;
- if(showToolbar && bBottomToolbar && (PluginConfig.m_AlwaysFullToolbarWidth || ((dat->pic.cy - DPISCALEY_S(6)) < rc.bottom))) {
+ if (showToolbar && bBottomToolbar && (PluginConfig.m_AlwaysFullToolbarWidth || ((dat->pic.cy - DPISCALEY_S(6)) < rc.bottom))) {
urc->rcItem.bottom -= DPISCALEY_S(22);
- if(dat->fIsAutosizingInput) {
+ if (dat->fIsAutosizingInput) {
urc->rcItem.left--;
urc->rcItem.top--;
}
@@ -1201,7 +1201,7 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL * if (bBottomToolbar&&showToolbar)
urc->rcItem.bottom -= DPISCALEY_S(22);
- if(dat->fIsAutosizingInput)
+ if (dat->fIsAutosizingInput)
urc->rcItem.top -= DPISCALEY_S(1);
msgTop = urc->rcItem.top;
@@ -1257,7 +1257,7 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL * case IDC_RETRY:
case IDC_CANCELSEND:
case IDC_MSGSENDLATER:
- if(fErrorState) {
+ if (fErrorState) {
urc->rcItem.bottom = msgTop - 5 - (bBottomToolbar ? 0 : 28) - ((dat->bNotOnList || dat->dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED) ? 20 : 0);
urc->rcItem.top = msgTop - 25 - (bBottomToolbar ? 0 : 28) - ((dat->bNotOnList || dat->dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED) ? 20 : 0);
}
@@ -1268,7 +1268,7 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL * return RD_ANCHORX_LEFT | RD_ANCHORY_BOTTOM;
case IDC_STATICTEXT:
case IDC_STATICERRORICON:
- if(fErrorState) {
+ if (fErrorState) {
urc->rcItem.bottom = msgTop - 28 - (bBottomToolbar ? 0 : 28) - ((dat->bNotOnList || dat->dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED) ? 20 : 0);
urc->rcItem.top = msgTop - 45 - (bBottomToolbar ? 0 : 28) - ((dat->bNotOnList || dat->dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED) ? 20 : 0);
}
@@ -1350,7 +1350,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP CProxyWindow::add(dat);
dat->szProto = const_cast<char *>(dat->cache->getProto());
dat->bIsMeta = dat->cache->isMeta() ? TRUE : FALSE;
- if(dat->bIsMeta)
+ if (dat->bIsMeta)
dat->cache->updateMeta(true);
dat->cache->updateUIN();
@@ -1644,7 +1644,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP dat->dwFlags &= ~MWF_INITMODE;
TABSRMM_FireEvent(dat->hContact, hwndDlg, MSG_WINDOW_EVT_OPEN, 0);
- if(PluginConfig.g_bClientInStatusBar)
+ if (PluginConfig.g_bClientInStatusBar)
ChangeClientIconInStatusBar(dat);
/*
@@ -1676,7 +1676,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP cx = rcClient.right - rcClient.left;
cy = rcClient.bottom - rcClient.top;
- if(CMimAPI::m_haveBufferedPaint)
+ if (CMimAPI::m_haveBufferedPaint)
hpb = CMimAPI::m_pfnBeginBufferedPaint(hdc, &rcClient, BPBF_TOPDOWNDIB, 0, &hdcMem);
else {
hdcMem = CreateCompatibleDC(hdc);
@@ -1725,7 +1725,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP else {
CSkin::FillBack(hdcMem, &rcClient);
- if(M->isAero()) {
+ if (M->isAero()) {
LONG temp = rcClient.bottom;
rcClient.bottom = dat->Panel->isActive() ? dat->Panel->getHeight() + 5 : 5;
FillRect(hdcMem, &rcClient, (HBRUSH)GetStockObject(BLACK_BRUSH));
@@ -1751,7 +1751,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP */
dat->Panel->renderContent(hdcMem);
- if(hpb) {
+ if (hpb) {
CSkin::FinalizeBufferedPaint(hpb, &rcClient);
} else {
BitBlt(hdc, 0, 0, cx, cy, hdcMem, 0, 0, SRCCOPY);
@@ -1761,7 +1761,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
if (!dat->fLimitedUpdate)
SetAeroMargins(dat->pContainer);
- return(1);
+ return 1;
}
case WM_NCPAINT:
return 0;
@@ -1842,11 +1842,11 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP CallService(MS_FAVATAR_RESIZE, (WPARAM)&fa, (LPARAM)&rc1);
}
}
- if(dat->showInfoPic && (dat->hwndPanelPic || dat->hwndFlash)) {
+ if (dat->showInfoPic && (dat->hwndPanelPic || dat->hwndFlash)) {
SetWindowPos(dat->hwndPanelPicParent, HWND_TOP, rc.left - 2, rc.top, rc.right - rc.left, (rc.bottom - rc.top) + 1, 0);
ShowWindow(dat->hwndPanelPicParent, (dat->panelWidth == -1) || !dat->Panel->isActive() ? SW_HIDE : SW_SHOW);
}
- else if(dat->hwndPanelPicParent)
+ else if (dat->hwndPanelPicParent)
ShowWindow(dat->hwndPanelPicParent, SW_HIDE);
dat->rcPic = rc;
@@ -1926,10 +1926,10 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP message.lParam = lp;
message.wParam = wp;
- if(msg == WM_SYSKEYUP) {
+ if (msg == WM_SYSKEYUP) {
UINT ctrlId = 0;
- if(wp == VK_MENU) {
+ if (wp == VK_MENU) {
if (!dat->fkeyProcessed && !(GetKeyState(VK_CONTROL) & 0x8000) && !(GetKeyState(VK_SHIFT) & 0x8000) && !(lp & (1 << 24)))
m_pContainer->MenuBar->autoShow();
}
@@ -1938,7 +1938,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if ((msg == WM_KEYDOWN || msg == WM_SYSKEYDOWN) && !(GetKeyState(VK_RMENU) & 0x8000)) {
LRESULT mim_hotkey_check = CallService(MS_HOTKEY_CHECK, (WPARAM)&message, (LPARAM)(TABSRMM_HK_SECTION_IM));
- if(mim_hotkey_check)
+ if (mim_hotkey_check)
dat->fkeyProcessed = true;
switch(mim_hotkey_check) {
case TABSRMM_HK_SETUSERPREFS:
@@ -1963,7 +1963,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP PostMessage(hwndDlg, WM_COMMAND, MAKELONG(IDC_PIC, BN_CLICKED), 0);
return(_dlgReturn(hwndDlg, 1));
case TABSRMM_HK_TOGGLESENDLATER:
- if(sendLater->isAvail()) {
+ if (sendLater->isAvail()) {
dat->sendMode ^= SMODE_SENDLATER;
SetWindowPos(GetDlgItem(hwndDlg, IDC_MESSAGE), 0, 0, 0, 0, 0, SWP_DRAWFRAME|SWP_FRAMECHANGED|SWP_NOZORDER|
SWP_NOMOVE|SWP_NOSIZE|SWP_NOCOPYBITS);
@@ -1988,7 +1988,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP dwMask &= ~MWF_LOG_RTL;
dwFlags &= ~MWF_LOG_RTL;
}
- if(dwMask) {
+ if (dwMask) {
M->WriteDword(dat->hContact, SRMSGMOD_T, "mwmask", dwMask);
M->WriteDword(dat->hContact, SRMSGMOD_T, "mwflags", dwFlags);
}
@@ -2027,7 +2027,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP default:
break;
}
- if(DM_GenericHotkeysCheck(&message, dat)) {
+ if (DM_GenericHotkeysCheck(&message, dat)) {
dat->fkeyProcessed = true;
return(_dlgReturn(hwndDlg, 1));
}
@@ -2088,7 +2088,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
}
if (msg == WM_SYSKEYDOWN && isAlt) {
- if(wp == 0x52) {
+ if (wp == 0x52) {
SendMessage(hwndDlg, DM_QUERYPENDING, DM_QUERY_MOSTRECENT, 0);
return(_dlgReturn(hwndDlg, 1));
}
@@ -2126,8 +2126,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP return(_dlgReturn(hwndDlg, 1));
}
//MAD: tabulation mod
- if(msg == WM_KEYDOWN && wp == VK_TAB) {
- if(PluginConfig.m_AllowTab) {
+ if (msg == WM_KEYDOWN && wp == VK_TAB) {
+ if (PluginConfig.m_AllowTab) {
if (((NMHDR *)lParam)->idFrom == IDC_MESSAGE)
SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)"\t");
_clrMsgFilter(lParam);
@@ -2137,7 +2137,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
else {
if (((NMHDR *)lParam)->idFrom == IDC_MESSAGE) {
- if(GetSendButtonState(hwndDlg) != PBS_DISABLED && !(dat->pContainer->dwFlags & CNT_HIDETOOLBAR)) {
+ if (GetSendButtonState(hwndDlg) != PBS_DISABLED && !(dat->pContainer->dwFlags & CNT_HIDETOOLBAR)) {
SetFocus(GetDlgItem(hwndDlg, IDOK));
return(_dlgReturn(hwndDlg, 1));
}
@@ -2366,7 +2366,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP int preTyping = dat->nTypeSecs != 0;
dat->nTypeSecs = (int) lParam > 0 ? (int) lParam : 0;
- if(dat->nTypeSecs)
+ if (dat->nTypeSecs)
dat->showTyping = 0;
SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, preTyping);
@@ -2394,7 +2394,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (m_pContainer->hwndActive == hwndDlg)
SendMessage(t_hwnd, DM_SETICON, (WPARAM)dat, (LPARAM)(dat->hXStatusIcon ? dat->hXStatusIcon : dat->hTabIcon));
- if(dat->pWnd)
+ if (dat->pWnd)
dat->pWnd->updateIcon(dat->hXStatusIcon ? dat->hXStatusIcon : dat->hTabIcon);
}
return 0;
@@ -2434,10 +2434,10 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
case DM_OPTIONSAPPLIED:
DM_OptionsApplied(dat, wParam, lParam);
- return(0);
+ return 0;
case DM_UPDATETITLE: {
DM_UpdateTitle(dat, wParam, lParam);
- return(0);
+ return 0;
}
case DM_UPDATESTATUSMSG:
@@ -2492,7 +2492,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case DM_SPLITTERGLOBALEVENT: {
DM_SplitterGlobalEvent(dat, wParam, lParam);
- return(0);
+ return 0;
}
case DM_SPLITTERMOVED: {
@@ -2531,7 +2531,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP * hardcoded limits... better solution is possible, but this works for now
*/
//mad
- if(dat->pContainer->dwFlags & CNT_BOTTOMTOOLBAR)
+ if (dat->pContainer->dwFlags & CNT_BOTTOMTOOLBAR)
bottomtoolbarH = 22;
//
if (dat->splitterY < (DPISCALEY_S(MINSPLITTERY) + 5 + bottomtoolbarH)) { // min splitter size
@@ -2563,7 +2563,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP dat->panelWidth = -1;
//SetAeroMargins(dat->pContainer);
RedrawWindow(hwndDlg, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
- if(M->isAero())
+ if (M->isAero())
InvalidateRect(GetParent(hwndDlg), NULL, FALSE);
break;
}
@@ -2670,7 +2670,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (dat->hContact == NULL)
return 0;
DM_EventAdded(dat, wParam, lParam);
- return(0);
+ return 0;
case WM_TIMER:
/*
* timer to control info panel hovering
@@ -2782,7 +2782,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (dat->dwFlags & MWF_WASBACKGROUNDCREATE)
break;
if (m_pContainer->hwndActive == hwndDlg && PluginConfig.m_AutoLocaleSupport && hwndContainer == GetForegroundWindow() && hwndContainer == GetActiveWindow()) {
- if(lParam)
+ if (lParam)
dat->hkl = (HKL)lParam;
if (dat->hkl)
@@ -2836,15 +2836,15 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP dat->dwFlags &= ~MWF_WASBACKGROUNDCREATE;
SendMessage(hwndDlg, WM_SIZE, 0, 0);
PostMessage(hwndDlg, DM_UPDATEPICLAYOUT, 0, 0);
- if(PluginConfig.m_AutoLocaleSupport) {
- if(dat->hkl == 0)
+ if (PluginConfig.m_AutoLocaleSupport) {
+ if (dat->hkl == 0)
DM_LoadLocale(dat);
else
PostMessage(hwndDlg, DM_SETLOCALE, 0, 0);
}
if (dat->hwndIEView != 0)
SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
- if(dat->pContainer->dwFlags & CNT_SIDEBAR)
+ if (dat->pContainer->dwFlags & CNT_SIDEBAR)
dat->pContainer->SideBar->Layout();
} else {
SendMessage(hwndDlg, WM_SIZE, 0, 0);
@@ -2877,7 +2877,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP POINT tmp; //+ Protogenes
POINTS cur; //+ Protogenes
GetCursorPos(&tmp); //+ Protogenes
- if(dat->Panel->isHovered())
+ if (dat->Panel->isHovered())
dat->Panel->handleClick(tmp);
else {
cur.x = (SHORT)tmp.x; //+ Protogenes
@@ -2899,7 +2899,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP rcPanelNick.left = rcPanelNick.right - 30;
GetCursorPos(&pt);
- if(dat->Panel->invokeConfigDialog(pt))
+ if (dat->Panel->invokeConfigDialog(pt))
break;
if (PtInRect(&rcPicture, pt))
@@ -2948,7 +2948,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
case WM_MEASUREITEM: {
LPMEASUREITEMSTRUCT lpmi = (LPMEASUREITEMSTRUCT) lParam;
- if(dat->Panel->isHovered()) {
+ if (dat->Panel->isHovered()) {
lpmi->itemHeight = 0;
lpmi->itemWidth = 6;
return(TRUE);
@@ -2974,16 +2974,16 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (!dat)
break;
// custom button handling
- if(LOWORD(wParam)>=MIN_CBUTTONID&&LOWORD(wParam)<=MAX_CBUTTONID) {
+ if (LOWORD(wParam)>=MIN_CBUTTONID&&LOWORD(wParam)<=MAX_CBUTTONID) {
BB_CustomButtonClick(dat,LOWORD(wParam) ,GetDlgItem(hwndDlg,LOWORD(wParam)),0);
break;
}
switch (LOWORD(wParam)) {
case IDOK: {
- if(dat->fEditNotesActive) {
+ if (dat->fEditNotesActive) {
SendMessage(hwndDlg, DM_ACTIVATETOOLTIP, IDC_PIC, (LPARAM)TranslateT("You are editing the user notes. Click the button again or use the hotkey (default: Alt-N) to save the notes and return to normal messaging mode"));
- return(0);
+ return 0;
}
int bufSize = 0, memRequired = 0, flags = 0;
char *streamOut = NULL;
@@ -3259,7 +3259,7 @@ quote_from_last: //mad
DWORD idFrom=GetDlgCtrlID((HWND)wParam);
- if(idFrom>=MIN_CBUTTONID&&idFrom<=MAX_CBUTTONID) {
+ if (idFrom>=MIN_CBUTTONID&&idFrom<=MAX_CBUTTONID) {
BB_CustomButtonClick(dat,idFrom,(HWND) wParam,1);
break;
}
@@ -3353,7 +3353,7 @@ quote_from_last: */
case DM_SETINFOPANEL:
CInfoPanel::setPanelHandler(dat, wParam, lParam);
- return(0);
+ return 0;
/*
* show the balloon tooltip control.
@@ -3377,7 +3377,7 @@ quote_from_last: */
case DM_SAVEMESSAGELOG:
DM_SaveLogAsRTF(dat);
- return(0);
+ return 0;
/*
* sent from the containers heartbeat timer
@@ -3400,7 +3400,7 @@ quote_from_last: */
case DM_CHECKAUTOHIDE:
DM_CheckAutoHide(dat, wParam, lParam);
- return(0);
+ return 0;
// metacontact support
@@ -3458,16 +3458,16 @@ quote_from_last: GetClientIcon(dat);
if (dat->hClientIcon && dat->Panel->isActive())
InvalidateRect(hwndDlg, NULL, TRUE);
- if(PluginConfig.g_bClientInStatusBar)
+ if (PluginConfig.g_bClientInStatusBar)
ChangeClientIconInStatusBar(dat);
return 0;
}
case DM_UPDATEUIN:
- if(dat->Panel->isActive())
+ if (dat->Panel->isActive())
dat->Panel->Invalidate();
- if(dat->pContainer->dwFlags & CNT_UINSTATUSBAR)
+ if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR)
UpdateStatusBar(dat);
- return(0);
+ return 0;
case DM_REMOVEPOPUPS:
DeletePopupsForContact(dat->hContact, (DWORD)wParam);
@@ -3492,7 +3492,7 @@ quote_from_last: return 0;
//mad: bb-api
case DM_BBNEEDUPDATE:{
- if(lParam)
+ if (lParam)
CB_ChangeButton(hwndDlg,dat,(CustomButtonData*)lParam);
else
BB_InitDlgButtons(dat);
@@ -3502,7 +3502,7 @@ quote_from_last: }
case DM_CBDESTROY:{
- if(lParam)
+ if (lParam)
CB_DestroyButton(hwndDlg,dat,(DWORD)wParam,(DWORD)lParam);
else
CB_DestroyAllButtons(hwndDlg,dat);
@@ -3585,10 +3585,10 @@ quote_from_last: }
if (wParam == 0 && lParam == 0) {
- if(PluginConfig.m_EscapeCloses == 1) {
+ if (PluginConfig.m_EscapeCloses == 1) {
SendMessage(hwndContainer, WM_SYSCOMMAND, SC_MINIMIZE, 0);
return(TRUE);
- } else if(PluginConfig.m_HideOnClose && PluginConfig.m_EscapeCloses == 2) {
+ } else if (PluginConfig.m_HideOnClose && PluginConfig.m_EscapeCloses == 2) {
ShowWindow(hwndContainer, SW_HIDE);
return(TRUE);
}
@@ -3674,17 +3674,17 @@ quote_from_last: CallService(MS_FAVATAR_DESTROY, (WPARAM)&fa, 0);
}
- if(dat->hwndContactPic)
+ if (dat->hwndContactPic)
DestroyWindow(dat->hwndContactPic);
- if(dat->hwndPanelPic)
+ if (dat->hwndPanelPic)
DestroyWindow(dat->hwndPanelPic);
- if(dat->hClientIcon)
+ if (dat->hClientIcon)
DestroyIcon(dat->hClientIcon);
- if(dat->hwndPanelPicParent) {
- if(oldAvatarParentWndProc)
+ if (dat->hwndPanelPicParent) {
+ if (oldAvatarParentWndProc)
SetWindowLongPtr(dat->hwndPanelPicParent, GWLP_WNDPROC, (LONG_PTR)oldAvatarParentWndProc);
DestroyWindow(dat->hwndPanelPicParent);
}
@@ -3818,7 +3818,7 @@ quote_from_last: }
CallService(MS_HPP_EG_WINDOW, 0, (LPARAM)&ieWindow);
}
- if(dat->pWnd) {
+ if (dat->pWnd) {
delete dat->pWnd;
dat->pWnd = 0;
}
@@ -3831,17 +3831,17 @@ quote_from_last: case DM_FORCEREDRAW:
RedrawWindow(hwndDlg, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW);
- return(0);
+ return 0;
case DM_CHECKINFOTIP:
dat->Panel->hideTip(reinterpret_cast<HWND>(lParam));
- return(0);
+ return 0;
case WM_NCDESTROY:
if (dat) {
memset((void *)&dat->pContainer->mOld, -1000, sizeof(MARGINS));
PostMessage(dat->pContainer->hwnd, WM_SIZE, 0, 1);
- if(m_pContainer->dwFlags & CNT_SIDEBAR)
+ if (m_pContainer->dwFlags & CNT_SIDEBAR)
m_pContainer->SideBar->removeSession(dat);
dat->cache->setWindowData();
if (dat->cache->isValid() && !dat->fIsReattach && dat->hContact && M->GetByte("deletetemp", 0)) {
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index de5b221208..2c933a61cb 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -233,7 +233,7 @@ void TSAPI FlashTab(struct TWindowData *dat, HWND hwndTab, int iTabindex, BOOL * dat->hTabIcon = origImage;
item.iImage = 0;
TabCtrl_SetItem(hwndTab, iTabindex, &item);
- if(dat->pContainer->dwFlags & CNT_SIDEBAR)
+ if (dat->pContainer->dwFlags & CNT_SIDEBAR)
dat->pContainer->SideBar->updateSession(dat);
}
@@ -383,8 +383,8 @@ int TSAPI MsgWindowUpdateMenu(TWindowData *dat, HMENU submenu, int menuID) int TSAPI MsgWindowMenuHandler(TWindowData *dat, int selection, int menuId)
{
- if(dat == 0)
- return(0);
+ if (dat == 0)
+ return 0;
HWND hwndDlg = dat->hwnd;
@@ -508,7 +508,7 @@ int TSAPI MsgWindowMenuHandler(TWindowData *dat, int selection, int menuId) void TSAPI UpdateReadChars(const TWindowData *dat)
{
- if(dat && (dat->pContainer->hwndStatus && dat->pContainer->hwndActive == dat->hwnd)) {
+ if (dat && (dat->pContainer->hwndStatus && dat->pContainer->hwndActive == dat->hwnd)) {
TCHAR buf[128];
int len;
TCHAR szIndicators[20];
@@ -542,7 +542,7 @@ void TSAPI UpdateReadChars(const TWindowData *dat) mir_sntprintf(buf, safe_sizeof(buf), _T("%s%s %d/%d"), szIndicators, dat->lcID, dat->iOpenJobs, len);
SendMessage(dat->pContainer->hwndStatus, SB_SETTEXT, 1, (LPARAM) buf);
- if(PluginConfig.m_visualMessageSizeIndicator)
+ if (PluginConfig.m_visualMessageSizeIndicator)
InvalidateRect(dat->pContainer->hwndStatus, NULL, FALSE);
}
}
@@ -555,7 +555,7 @@ void TSAPI UpdateStatusBar(const TWindowData *dat) {
if (dat && dat->pContainer->hwndStatus && dat->pContainer->hwndActive == dat->hwnd) {
if (dat->bType == SESSIONTYPE_IM) {
- if(dat->szStatusBar[0]) {
+ if (dat->szStatusBar[0]) {
SendMessage(dat->pContainer->hwndStatus, SB_SETICON, 0, (LPARAM)PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING]);
SendMessage(dat->pContainer->hwndStatus, SB_SETTEXT, 0, (LPARAM)dat->szStatusBar);
}
@@ -595,7 +595,7 @@ void TSAPI HandleIconFeedback(TWindowData *dat, HICON iIcon) dat->hTabIcon = iIcon;
item.iImage = 0;
item.mask = TCIF_IMAGE;
- if(dat->pContainer->dwFlags & CNT_SIDEBAR)
+ if (dat->pContainer->dwFlags & CNT_SIDEBAR)
dat->pContainer->SideBar->updateSession(dat);
else
TabCtrl_SetItem(GetDlgItem(dat->pContainer->hwnd, IDC_MSGTABS), dat->iTabID, &item);
@@ -648,7 +648,7 @@ int TSAPI GetAvatarVisibility(HWND hwndDlg, struct TWindowData *dat) FLASHAVATAR fa = {0};
HBITMAP hbm = ((dat->ace && !(dat->ace->dwFlags & AVS_HIDEONCLIST)) ? dat->ace->hbmPic : 0);
- if(0 == hbm && 0 == bAvatarMode && !PluginConfig.g_bDisableAniAvatars) {
+ if (0 == hbm && 0 == bAvatarMode && !PluginConfig.g_bDisableAniAvatars) {
dat->showInfoPic = 0;
break;
}
@@ -669,10 +669,10 @@ int TSAPI GetAvatarVisibility(HWND hwndDlg, struct TWindowData *dat) }
if (!PluginConfig.g_bDisableAniAvatars && fa.hWindow == NULL && !dat->hwndPanelPic) {
dat->hwndPanelPic = CreateWindowEx(WS_EX_TOPMOST, AVATAR_CONTROL_CLASS, _T(""), WS_VISIBLE | WS_CHILD, 1, 1, 1, 1, dat->hwndPanelPicParent, (HMENU)7000, NULL, NULL);
- if(dat->hwndPanelPic)
+ if (dat->hwndPanelPic)
SendMessage(dat->hwndPanelPic, AVATAR_SETAEROCOMPATDRAWING, 0, TRUE);
}
- if(bAvatarMode != 0) {
+ if (bAvatarMode != 0) {
if ((hbm && hbm != PluginConfig.g_hbmUnknown) || (fa.hWindow != NULL))
dat->showInfoPic = 1;
else
@@ -767,7 +767,7 @@ int TSAPI CheckValidSmileyPack(const char *szProto, HANDLE hContact) smainfo.Protocolname = const_cast<char *>(szProto);
smainfo.hContact = hContact;
CallService(MS_SMILEYADD_GETINFO2, 0, (LPARAM)&smainfo);
- if(smainfo.ButtonIcon)
+ if (smainfo.ButtonIcon)
DestroyIcon(smainfo.ButtonIcon);
return smainfo.NumberOfVisibleSmileys;
} else
@@ -837,7 +837,7 @@ TCHAR* TSAPI QuoteText(const TCHAR *text, int charsPerLine, int removeExistingQu void TSAPI AdjustBottomAvatarDisplay(TWindowData *dat)
{
- if(dat) {
+ if (dat) {
bool fInfoPanel = dat->Panel->isActive();
HBITMAP hbm = (fInfoPanel && dat->pContainer->avatarMode != 3) ? dat->hOwnPic : (dat->ace ? dat->ace->hbmPic : PluginConfig.g_hbmUnknown);
HWND hwndDlg = dat->hwnd;
@@ -1318,7 +1318,7 @@ static void CheckAndDestroyHPP(struct TWindowData *dat) ieWindow.cbSize = sizeof(IEVIEWWINDOW);
ieWindow.iType = IEW_DESTROY;
ieWindow.hwnd = dat->hwndHPP;
- if(dat->oldIEViewProc) {
+ if (dat->oldIEViewProc) {
SetWindowLongPtr(dat->hwndHPP, GWLP_WNDPROC, (LONG_PTR)dat->oldIEViewProc);
dat->oldIEViewProc = 0;
}
@@ -1442,7 +1442,7 @@ void TSAPI FindFirstEvent(TWindowData *dat) dat->hDbEventFirst = (HANDLE) CallService(MS_DB_EVENT_FINDFIRSTUNREAD, (WPARAM) dat->hContact, 0);
- if(dat->bActualHistory)
+ if (dat->bActualHistory)
historyMode = LOADHISTORY_COUNT;
switch (historyMode) {
@@ -1510,11 +1510,11 @@ void TSAPI SaveSplitter(TWindowData *dat) * group chats save their normal splitter position independently
*/
- if(dat->bType == SESSIONTYPE_CHAT)
+ if (dat->bType == SESSIONTYPE_CHAT)
return;
#if defined(__FEAT_EXP_AUTOSPLITTER)
- if(dat->fIsAutosizingInput)
+ if (dat->fIsAutosizingInput)
return;
#endif
if (dat->splitterY < DPISCALEY_S(MINSPLITTERY) || dat->splitterY < 0)
@@ -1523,7 +1523,7 @@ void TSAPI SaveSplitter(TWindowData *dat) if (dat->dwFlagsEx & MWF_SHOW_SPLITTEROVERRIDE)
M->WriteDword(dat->hContact, SRMSGMOD_T, "splitsplity", dat->splitterY);
else {
- if(dat->pContainer->settings->fPrivate)
+ if (dat->pContainer->settings->fPrivate)
dat->pContainer->settings->splitterPos = dat->splitterY;
else
M->WriteDword(SRMSGMOD_T, "splitsplity", dat->splitterY);
@@ -1608,15 +1608,15 @@ void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName) /*
* Vista+: read ISO locale names from the registry
*/
- if(PluginConfig.m_bIsVista) {
+ if (PluginConfig.m_bIsVista) {
HKEY hKey = 0;
TCHAR szKey[20];
DWORD dwLID = _tcstoul(szKLName, &stopped, 16);
mir_sntprintf(szKey, 20, _T("%04.04x"), LOWORD(dwLID));
- if(ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, _T("MIME\\Database\\Rfc1766"), 0, KEY_READ, &hKey)) {
+ if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, _T("MIME\\Database\\Rfc1766"), 0, KEY_READ, &hKey)) {
DWORD dwLength = 255;
- if(ERROR_SUCCESS == RegQueryValueEx(hKey, szKey, 0, 0, (unsigned char *)szLI, &dwLength)) {
+ if (ERROR_SUCCESS == RegQueryValueEx(hKey, szKey, 0, 0, (unsigned char *)szLI, &dwLength)) {
TCHAR* p;
szLI[255] = 0;
@@ -1658,7 +1658,7 @@ void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName) void TSAPI LoadContactAvatar(TWindowData *dat)
{
- if(dat)
+ if (dat)
dat->ace = Utils::loadAvatarFromAVS(dat->hContact);
if (dat && (!(dat->Panel->isActive()) || dat->pContainer->avatarMode == 3)) {
@@ -1873,7 +1873,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat) }
GetClientRect(hwndDlg, &rc);
- if(bPanelPic) {
+ if (bPanelPic) {
rcClient = dis->rcItem;
cx = (rcClient.right - rcClient.left);
cy = (rcClient.bottom - rcClient.top) + 1;
@@ -1904,7 +1904,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat) }
if (dat->panelWidth == -1) {
dat->panelWidth = (int)dNewWidth;
- return(0);
+ return 0;
}
} else {
@@ -1944,7 +1944,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat) DeleteObject(br);
}
else {
- if(fAero && CSkin::m_pCurrentAeroEffect) {
+ if (fAero && CSkin::m_pCurrentAeroEffect) {
COLORREF clr = PluginConfig.m_tbBackgroundHigh ? PluginConfig.m_tbBackgroundHigh :
(CSkin::m_pCurrentAeroEffect ? CSkin::m_pCurrentAeroEffect->m_clrToolbar : 0xf0f0f0);
@@ -2002,7 +2002,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat) * prepare border drawing (if avatar is rendered by ACC, the parent control will be responsible for
* the border, so skip it here)
*/
- if(dat->hwndPanelPic == 0) {
+ if (dat->hwndPanelPic == 0) {
OffsetRect(&rcClient, -2, 0);
if (CSkin::m_bAvatarBorderType == 1)
clipRgn = CreateRectRgn(rcClient.left + rcFrame.left, rcClient.top + rcFrame.top, rcClient.left + rcFrame.right,
@@ -2014,7 +2014,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat) }
}
- if(dat->hwndPanelPic) {
+ if (dat->hwndPanelPic) {
/*
* paint avatar using ACC
*/
@@ -2023,7 +2023,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat) rb.max_width, rb.max_height, SWP_SHOWWINDOW | SWP_ASYNCWINDOWPOS | SWP_DEFERERASE | SWP_NOSENDCHANGING);
}
else {
- if(CMimAPI::m_MyAlphaBlend) {
+ if (CMimAPI::m_MyAlphaBlend) {
CMimAPI::m_MyAlphaBlend(dis->hDC, rcClient.left + rcFrame.left + border_off, rcClient.top + rcFrame.top + border_off,
rb.max_width, rb.max_height, hdcMem, 0, 0,
rb.max_width, rb.max_height, CSkin::m_default_bf);
@@ -2035,7 +2035,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat) SelectObject(hdcMem, hbmMem);
//DeleteObject(hbmMem);
DeleteDC(hdcMem);
- if(hbmNew != hbmAvatar)
+ if (hbmNew != hbmAvatar)
DeleteObject(hbmNew);
} else {
hbmMem = (HBITMAP)SelectObject(hdcMem, hbmAvatar);
@@ -2056,7 +2056,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat) }
if (clipRgn) {
HBRUSH hbr = CreateSolidBrush(CSkin::m_avatarBorderClr);
- if(bPanelPic)
+ if (bPanelPic)
FrameRgn(dis->hDC, clipRgn, hbr, 1, 1);
else
FrameRgn(hdcDraw, clipRgn, hbr, 1, 1);
@@ -2167,7 +2167,7 @@ void TSAPI LoadOverrideTheme(TContainerData *pContainer) pContainer->theme.left_indent *= 15;
pContainer->theme.right_indent *= 15;
pContainer->theme.isPrivate = true;
- if(CSkin::m_skinEnabled)
+ if (CSkin::m_skinEnabled)
pContainer->theme.bg = SkinItems[ID_EXTBKCONTAINER].COLOR;
else
pContainer->theme.bg = PluginConfig.m_fillColor ? PluginConfig.m_fillColor : GetSysColor(COLOR_WINDOW);
@@ -2212,7 +2212,7 @@ LRESULT TSAPI GetSendButtonState(HWND hwnd) {
HWND hwndIDok=GetDlgItem(hwnd, IDOK);
- if(hwndIDok)
+ if (hwndIDok)
return(SendMessage(hwndIDok, BUTTONGETSTATEID, TRUE, 0));
else
return 0;
@@ -2246,7 +2246,7 @@ void TSAPI GetClientIcon(TWindowData *dat) {
DBVARIANT dbv = {0};
- if(dat->hClientIcon)
+ if (dat->hClientIcon)
DestroyIcon(dat->hClientIcon);
dat->hClientIcon = 0;
@@ -2352,7 +2352,7 @@ void TSAPI KbdState(TWindowData *dat, BOOL& isShift, BOOL& isControl, BOOL& isAl */
void TSAPI ClearLog(TWindowData *dat)
{
- if(dat && dat->bType == SESSIONTYPE_IM) {
+ if (dat && dat->bType == SESSIONTYPE_IM) {
if (dat->hwndIEView || dat->hwndHPP) {
IEVIEWEVENT event;
event.cbSize = sizeof(IEVIEWEVENT);
@@ -2370,7 +2370,7 @@ void TSAPI ClearLog(TWindowData *dat) SetDlgItemText(dat->hwnd, IDC_LOG, _T(""));
dat->hDbEventFirst = NULL;
}
- else if(dat && dat->bType == SESSIONTYPE_CHAT && dat->si) {
+ else if (dat && dat->bType == SESSIONTYPE_CHAT && dat->si) {
SESSION_INFO* si = reinterpret_cast<SESSION_INFO *>(dat->si);
SESSION_INFO* s = SM_FindSession(si->ptszID, si->pszModule);
if (s) {
@@ -2396,7 +2396,7 @@ void TSAPI ClearLog(TWindowData *dat) */
void TSAPI DetermineMinHeight(TWindowData* dat)
{
- if(dat) {
+ if (dat) {
RECT rc;
LONG height = (dat->Panel->isActive() ? dat->Panel->getHeight() + 2 : 0);
@@ -2424,13 +2424,13 @@ LONG TSAPI GetDefaultMinimumInputHeight(const TWindowData* dat) {
LONG height = MINSPLITTERY;
- if(dat) {
- if(dat->bType == SESSIONTYPE_IM)
+ if (dat) {
+ if (dat->bType == SESSIONTYPE_IM)
height = ((dat->pContainer->dwFlags & CNT_BOTTOMTOOLBAR) ? DPISCALEY_S(46 + 22) : DPISCALEY_S(46));
else
height = ((dat->pContainer->dwFlags & CNT_BOTTOMTOOLBAR) ? DPISCALEY_S(22 + 46) : DPISCALEY_S(46)) - DPISCALEY_S(23);
- if(CSkin::m_skinEnabled && !SkinItems[ID_EXTBKINPUTAREA].IGNORED)
+ if (CSkin::m_skinEnabled && !SkinItems[ID_EXTBKINPUTAREA].IGNORED)
height += (SkinItems[ID_EXTBKINPUTAREA].MARGIN_BOTTOM + SkinItems[ID_EXTBKINPUTAREA].MARGIN_TOP - 2);
}
return(height);
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index 4e4e95c037..aa2cd878b7 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -696,7 +696,7 @@ static char *Template_CreateRTFFromDbEvent(struct TWindowData *dat, HANDLE hCont AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "\\ltrpar");
/* OnO: highlight start */
- if(fIsStatusChangeEvent)
+ if (fIsStatusChangeEvent)
AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "\\highlight%d\\cf%d", MSGDLGFONTCOUNT + 7, MSGDLGFONTCOUNT + 7);
else
AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "\\highlight%d\\cf%d", MSGDLGFONTCOUNT + (dat->isHistory?5:1) + ((isSent) ? 1 : 0), MSGDLGFONTCOUNT + (dat->isHistory?5:1) + ((isSent) ? 1 : 0));
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index fb904634c0..35f146beff 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -129,17 +129,17 @@ static int TSAPI ScanSkinDir(const TCHAR* tszFolder, HWND hwndCombobox) HANDLE h = FindFirstFile(tszMask, &fd);
while(h != INVALID_HANDLE_VALUE) {
- if(lstrlen(fd.cFileName) >= 5 && !_tcsnicmp(fd.cFileName + lstrlen(fd.cFileName) - 4, _T(".tsk"), 4)) {
+ if (lstrlen(fd.cFileName) >= 5 && !_tcsnicmp(fd.cFileName + lstrlen(fd.cFileName) - 4, _T(".tsk"), 4)) {
fValid = true;
break;
}
- if(FindNextFile(h, &fd) == 0)
+ if (FindNextFile(h, &fd) == 0)
break;
}
- if(h != INVALID_HANDLE_VALUE)
+ if (h != INVALID_HANDLE_VALUE)
FindClose(h);
- if(fValid) {
+ if (fValid) {
TCHAR tszFinalName[MAX_PATH], tszRel[MAX_PATH];
LRESULT lr;
TCHAR szBuf[255];
@@ -160,7 +160,7 @@ static int TSAPI ScanSkinDir(const TCHAR* tszFolder, HWND hwndCombobox) SendMessage(hwndCombobox, CB_SETITEMDATA, lr, (LPARAM)idata);
}
}
- return(0);
+ return 0;
}
/**
@@ -189,25 +189,25 @@ static int TSAPI RescanSkins(HWND hwndCombobox) HANDLE h = FindFirstFile(tszFindMask, &fd);
while (h != INVALID_HANDLE_VALUE) {
- if(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY && fd.cFileName[0] != '.') {
+ if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY && fd.cFileName[0] != '.') {
TCHAR tszSubDir[MAX_PATH];
mir_sntprintf(tszSubDir, MAX_PATH, _T("%s%s\\"), tszSkinRoot, fd.cFileName);
ScanSkinDir(tszSubDir, hwndCombobox);
}
- if(FindNextFile(h, &fd) == 0)
+ if (FindNextFile(h, &fd) == 0)
break;
}
- if(h != INVALID_HANDLE_VALUE)
+ if (h != INVALID_HANDLE_VALUE)
FindClose(h);
SendMessage(hwndCombobox, CB_SETCURSEL, 0, 0);
- if(0 == M->GetTString(0, SRMSGMOD_T, "ContainerSkin", &dbv)) {
+ if (0 == M->GetTString(0, SRMSGMOD_T, "ContainerSkin", &dbv)) {
LRESULT lr = SendMessage(hwndCombobox, CB_GETCOUNT, 0, 0);
for(int i = 1; i < lr; i++) {
TCHAR* idata = (TCHAR *)SendMessage(hwndCombobox, CB_GETITEMDATA, i, 0);
- if(idata && idata != (TCHAR *)CB_ERR) {
+ if (idata && idata != (TCHAR *)CB_ERR) {
if (!_tcsicmp(dbv.ptszVal, idata)) {
SendMessage(hwndCombobox, CB_SETCURSEL, i, 0);
break;
@@ -216,7 +216,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox) }
DBFreeVariant(&dbv);
}
- return(0);
+ return 0;
}
/**
@@ -230,7 +230,7 @@ static void TSAPI FreeComboData(HWND hwndCombobox) for(int i = 1; i < lr; i++) {
void *idata = (void *)SendMessage(hwndCombobox, CB_GETITEMDATA, i, 0);
- if(idata && idata != (void *)CB_ERR)
+ if (idata && idata != (void *)CB_ERR)
free(idata);
}
}
@@ -261,7 +261,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L case WM_CTLCOLORSTATIC:
if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_SKIN_WARN)) {
SetTextColor((HDC)wParam, RGB(255, 50, 50));
- return(0);
+ return 0;
}
break;
@@ -280,11 +280,11 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L }
Utils::showDlgControl(hwndDlg, IDC_SKIN_WARN, fWindowsOpen ? SW_SHOW : SW_HIDE);
Utils::showDlgControl(hwndDlg, IDC_SKIN_CLOSENOW, fWindowsOpen ? SW_SHOW : SW_HIDE);
- return(0);
+ return 0;
}
case WM_TIMER:
- if(wParam == 1000)
+ if (wParam == 1000)
SendMessage(hwndDlg, WM_USER + 100, 0, 0);
break;
@@ -334,15 +334,15 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L case IDC_THEMEIMPORT: {
LRESULT r;
- if(CSkin::m_skinEnabled) {
+ if (CSkin::m_skinEnabled) {
r = CWarning::show(CWarning::WARN_THEME_OVERWRITE, MB_YESNOCANCEL|MB_ICONQUESTION);
- if(r == IDNO || r == IDCANCEL)
- return(0);
+ if (r == IDNO || r == IDCANCEL)
+ return 0;
}
r = CWarning::show(CWarning::WARN_OPTION_CLOSE, MB_YESNOCANCEL|MB_ICONQUESTION);
- if(r == IDNO || r == IDCANCEL)
- return(0);
+ if (r == IDNO || r == IDCANCEL)
+ return 0;
const wchar_t* szFilename = GetThemeFileName(0);
DWORD dwFlags = THEME_READ_FONTS;
@@ -377,7 +377,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L PluginConfig.m_HideOnClose = FALSE;
while(pFirstContainer) {
- if(pFirstContainer->hwnd)
+ if (pFirstContainer->hwnd)
SendMessage(pFirstContainer->hwnd, WM_CLOSE, 0, 1);
}
@@ -385,20 +385,20 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L break;
}
case IDC_SKINNAME: {
- if(HIWORD(wParam) == CBN_SELCHANGE) {
+ if (HIWORD(wParam) == CBN_SELCHANGE) {
LRESULT lr = SendDlgItemMessage(hwndDlg, IDC_SKINNAME, CB_GETCURSEL, 0 ,0);
- if(lr != CB_ERR && lr > 0) {
+ if (lr != CB_ERR && lr > 0) {
TCHAR *tszRelPath = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_SKINNAME, CB_GETITEMDATA, lr, 0);
- if(tszRelPath && tszRelPath != (TCHAR *)CB_ERR)
+ if (tszRelPath && tszRelPath != (TCHAR *)CB_ERR)
M->WriteTString(0, SRMSGMOD_T, "ContainerSkin", tszRelPath);
SendMessage(hwndDlg, WM_COMMAND, IDC_RELOADSKIN, 0);
}
- else if(lr == 0) { // selected the <no skin> entry
+ else if (lr == 0) { // selected the <no skin> entry
DBDeleteContactSetting(0, SRMSGMOD_T, "ContainerSkin");
Skin->Unload();
SendMessage(hwndTabConfig, WM_USER + 100, 0, 0);
}
- return(0);
+ return 0;
}
break;
}
@@ -691,7 +691,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, Utils::showDlgControl(hwndDlg, IDC_LOGOPTIONS, r == 0 ? SW_SHOW : SW_HIDE);
for(i = 0; i < safe_sizeof(__ctrls); i++)
Utils::enableDlgControl(hwndDlg, __ctrls[i], r == 0 ? TRUE : FALSE);
- return(0);
+ return 0;
}
case WM_COMMAND:
switch (LOWORD(wParam)) {
@@ -1189,7 +1189,7 @@ static INT_PTR CALLBACK DlgProcContainerSettings(HWND hwndDlg, UINT msg, WPARAM Utils::enableDlgControl(hwndDlg, IDC_AEROEFFECT, PluginConfig.m_bIsVista ? TRUE : FALSE);
Utils::enableDlgControl(hwndDlg, IDC_USEAERO, PluginConfig.m_bIsVista ? TRUE : FALSE);
Utils::enableDlgControl(hwndDlg, IDC_USEAEROPEEK, PluginConfig.m_bIsWin7 ? TRUE : FALSE);
- if(PluginConfig.m_bIsVista)
+ if (PluginConfig.m_bIsVista)
Utils::enableDlgControl(hwndDlg, IDC_AEROEFFECT, IsDlgButtonChecked(hwndDlg, IDC_USEAERO) ? 1 : 0);
return TRUE;
@@ -1233,7 +1233,7 @@ static INT_PTR CALLBACK DlgProcContainerSettings(HWND hwndDlg, UINT msg, WPARAM M->WriteByte(0, SRMSGMOD_T, "useAeroPeek", IsDlgButtonChecked(hwndDlg, IDC_USEAEROPEEK) ? 1 : 0);
CSkin::setAeroEffect(SendDlgItemMessage(hwndDlg, IDC_AEROEFFECT, CB_GETCURSEL, 0, 0));
- if(M->getAeroState() != fOldAeroState) {
+ if (M->getAeroState() != fOldAeroState) {
SendMessage(PluginConfig.g_hwndHotkeyHandler, WM_DWMCOMPOSITIONCHANGED, 0, 0); // simulate aero state change
SendMessage(PluginConfig.g_hwndHotkeyHandler, WM_DWMCOLORIZATIONCOLORCHANGED, 0, 0); // simulate aero state change
}
@@ -1274,7 +1274,7 @@ struct { static int OptInitialise(WPARAM wParam, LPARAM lParam)
{
- if(PluginConfig.g_PopupWAvail||PluginConfig.g_PopupAvail)
+ if (PluginConfig.g_PopupWAvail||PluginConfig.g_PopupAvail)
TN_OptionsInitialize(wParam, lParam);
OPTIONSDIALOGPAGE odp = { 0 };
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index e1081ab5c3..5b7a995893 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -447,7 +447,7 @@ int SplitmsgShutdown(void) #if defined(__USE_EX_HANDLERS)
}
__except(CGlobals::Ex_ShowDialog(GetExceptionInformation(), __FILE__, __LINE__, L"SHUTDOWN_STAGE3", false)) {
- return(0);
+ return 0;
}
#endif
return 0;
@@ -480,13 +480,13 @@ int AvatarChanged(WPARAM wParam, LPARAM lParam) struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (dat) {
dat->ace = ace;
- if(dat->hTaskbarIcon)
+ if (dat->hTaskbarIcon)
DestroyIcon(dat->hTaskbarIcon);
dat->hTaskbarIcon = 0;
DM_RecalcPictureSize(dat);
if (dat->showPic == 0 || dat->showInfoPic == 0)
GetAvatarVisibility(hwnd, dat);
- if(dat->hwndPanelPic) {
+ if (dat->hwndPanelPic) {
dat->panelWidth = -1; // force new size calculations (not for flash avatars)
SendMessage(dat->hwnd, WM_SIZE, 0, 1);
}
@@ -569,9 +569,9 @@ int LoadSendRecvMessageModule(void) {
INITCOMMONCONTROLSEX icex;
- if(FIF == 0) {
+ if (FIF == 0) {
MessageBox(0, TranslateT("The image service plugin (advaimg.dll) is not properly installed.\n\nTabSRMM is disabled."), TranslateT("TabSRMM fatal error"), MB_OK | MB_ICONERROR);
- return(1);
+ return 1;
}
icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
icex.dwICC = ICC_COOL_CLASSES | ICC_BAR_CLASSES | ICC_LISTVIEW_CLASSES;;
@@ -658,7 +658,7 @@ int TSAPI ActivateExistingTab(TContainerData *pContainer, HWND hwndChild) * the container was hidden can make this necessary
*/
BroadCastContainer(pContainer, DM_CHECKSIZE, 0, 0);
- if(wp.showCmd == SW_SHOWMAXIMIZED)
+ if (wp.showCmd == SW_SHOWMAXIMIZED)
ShowWindow(pContainer->hwnd, SW_SHOWMAXIMIZED);
else {
ShowWindow(pContainer->hwnd, SW_SHOWNA);
@@ -790,9 +790,9 @@ HWND TSAPI CreateNewTabForContact(struct TContainerData *pContainer, HANDLE hCon /*
* switchbar support
*/
- if(pContainer->dwFlags & CNT_SIDEBAR) {
+ if (pContainer->dwFlags & CNT_SIDEBAR) {
TWindowData *dat = (TWindowData *)GetWindowLongPtr(hwndNew, GWLP_USERDATA);
- if(dat)
+ if (dat)
pContainer->SideBar->addSession(dat, pContainer->iTabIndex);
}
SendMessage(pContainer->hwnd, WM_SIZE, 0, 0);
@@ -831,21 +831,21 @@ HWND TSAPI CreateNewTabForContact(struct TContainerData *pContainer, HANDLE hCon GetWindowPlacement(pContainer->hwnd, &wp);
BroadCastContainer(pContainer, DM_CHECKSIZE, 0, 0); // make sure all tabs will re-check layout on activation
- if(wp.showCmd == SW_SHOWMAXIMIZED)
+ if (wp.showCmd == SW_SHOWMAXIMIZED)
ShowWindow(pContainer->hwnd, SW_SHOWMAXIMIZED);
else {
- if(bPopupContainer)
+ if (bPopupContainer)
ShowWindow(pContainer->hwnd, SW_SHOWNORMAL);
else
ShowWindow(pContainer->hwnd, SW_SHOWMINNOACTIVE);
}
SendMessage(pContainer->hwndActive, WM_SIZE, 0, 0);
}
- if(PluginConfig.m_bIsWin7 && PluginConfig.m_useAeroPeek && CSkin::m_skinEnabled) // && !M->GetByte("forceAeroPeek", 0))
+ if (PluginConfig.m_bIsWin7 && PluginConfig.m_useAeroPeek && CSkin::m_skinEnabled) // && !M->GetByte("forceAeroPeek", 0))
CWarning::show(CWarning::WARN_AEROPEEK_SKIN, MB_ICONWARNING|MB_OK);
- if(ServiceExists(MS_HPP_EG_EVENT) && ServiceExists(MS_IEVIEW_EVENT) && M->GetByte(0, "HistoryPlusPlus", "IEViewAPI", 0)) {
- if(IDYES == CWarning::show(CWarning::WARN_HPP_APICHECK, MB_ICONWARNING|MB_YESNO))
+ if (ServiceExists(MS_HPP_EG_EVENT) && ServiceExists(MS_IEVIEW_EVENT) && M->GetByte(0, "HistoryPlusPlus", "IEViewAPI", 0)) {
+ if (IDYES == CWarning::show(CWarning::WARN_HPP_APICHECK, MB_ICONWARNING|MB_YESNO))
M->WriteByte(0, "HistoryPlusPlus", "IEViewAPI", 0);
}
return hwndNew; // return handle of the new dialog
@@ -1075,7 +1075,7 @@ static int TSAPI SetupIconLibConfig() sid.pszDescription = ICONBLOCKS[n].idesc[i].szDesc;
sid.iDefaultIndex = ICONBLOCKS[n].idesc[i].uId == -IDI_HISTORY ? 0 : ICONBLOCKS[n].idesc[i].uId; // workaround problem /w icoLib and a resource id of 1 (actually, a Windows problem)
i++;
- if(n>0&&n<4)
+ if (n>0&&n<4)
PluginConfig.g_buttonBarIconHandles[j++] = Skin_AddIcon(&sid);
else
Skin_AddIcon(&sid);
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index 1cc4a68785..2d6a02a07c 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -59,10 +59,10 @@ bool CSendLaterJob::isPersistentJob() */
bool CSendLaterJob::mustDelete()
{
- if(fSuccess)
+ if (fSuccess)
return(true);
- else if(fFailed) {
- if(bCode == JOB_REMOVABLE)
+ else if (fFailed) {
+ if (bCode == JOB_REMOVABLE)
return(true);
}
return(false);
@@ -73,12 +73,12 @@ bool CSendLaterJob::mustDelete() */
void CSendLaterJob::cleanDB()
{
- if(isPersistentJob()) {
+ if (isPersistentJob()) {
char szKey[100];
DBDeleteContactSetting(hContact, "SendLater", szId);
int iCount = M->GetDword(hContact, "SendLater", "count", 0);
- if(iCount)
+ if (iCount)
iCount--;
M->WriteDword(hContact, "SendLater", "count", iCount);
/*
@@ -95,14 +95,14 @@ void CSendLaterJob::cleanDB() */
void CSendLaterJob::readFlags()
{
- if(isPersistentJob()) {
+ if (isPersistentJob()) {
char szKey[100];
DWORD localFlags;
mir_snprintf(szKey, 100, "$%s", szId);
localFlags = M->GetDword(hContact, "SendLater", szKey, 0);
- if(localFlags & SLF_SUSPEND)
+ if (localFlags & SLF_SUSPEND)
bCode = JOB_HOLD;
}
}
@@ -113,7 +113,7 @@ void CSendLaterJob::readFlags() */
void CSendLaterJob::writeFlags()
{
- if(isPersistentJob()) {
+ if (isPersistentJob()) {
DWORD localFlags = (bCode == JOB_HOLD ? SLF_SUSPEND : 0);
char szKey[100];
@@ -127,13 +127,13 @@ void CSendLaterJob::writeFlags() */
CSendLaterJob::~CSendLaterJob()
{
- if(fSuccess || fFailed) {
+ if (fSuccess || fFailed) {
POPUPDATAT_V2 ppd = {0};
if ((sendLater->haveErrorPopups() && fFailed) || (sendLater->haveSuccessPopups() && fSuccess)) {
bool fShowPopup = true;
- if(fFailed && bCode == JOB_REMOVABLE) // no popups for jobs removed on user's request
+ if (fFailed && bCode == JOB_REMOVABLE) // no popups for jobs removed on user's request
fShowPopup = false;
/*
* show a popup notification, unless they are disabled
@@ -146,12 +146,12 @@ CSendLaterJob::~CSendLaterJob() ppd.cbSize = sizeof(ppd);
mir_sntprintf(ppd.lptzContactName, MAX_CONTACTNAME, _T("%s"), tszName ? tszName : TranslateT("'(Unknown Contact)'"));
TCHAR *msgPreview = Utils::GetPreviewWithEllipsis(reinterpret_cast<TCHAR *>(&pBuf[lstrlenA((char *)pBuf) + 1]), 100);
- if(fSuccess) {
+ if (fSuccess) {
mir_sntprintf(ppd.lptzText, MAX_SECONDLINE, TranslateT("A send later job completed successfully.\nThe original message: %s"),
msgPreview);
mir_free(msgPreview);
}
- else if(fFailed) {
+ else if (fFailed) {
mir_sntprintf(ppd.lptzText, MAX_SECONDLINE, TranslateT("A send later job failed to complete.\nThe original message: %s"),
msgPreview);
mir_free(msgPreview);
@@ -168,7 +168,7 @@ CSendLaterJob::~CSendLaterJob() CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&ppd, 0);
}
}
- if(fFailed && (bCode == JOB_AGE || bCode == JOB_REMOVABLE) && szId[0] == 'S')
+ if (fFailed && (bCode == JOB_AGE || bCode == JOB_REMOVABLE) && szId[0] == 'S')
cleanDB();
mir_free(sendBuffer);
mir_free(pBuf);
@@ -194,10 +194,10 @@ CSendLater::CSendLater() */
CSendLater::~CSendLater()
{
- if(m_hwndDlg)
+ if (m_hwndDlg)
::DestroyWindow(m_hwndDlg);
- if(m_sendLaterJobList.empty())
+ if (m_sendLaterJobList.empty())
return;
SendLaterJobIterator it = m_sendLaterJobList.begin();
@@ -232,7 +232,7 @@ void CSendLater::startJobListProcess() */
bool CSendLater::processCurrentJob()
{
- if(m_sendLaterJobList.empty() || m_jobIterator == m_sendLaterJobList.end())
+ if (m_sendLaterJobList.empty() || m_jobIterator == m_sendLaterJobList.end())
return(false);
if ((*m_jobIterator)->fSuccess || (*m_jobIterator)->fFailed) {
@@ -269,7 +269,7 @@ void CSendLater::processSingleContact(const HANDLE hContact) {
int iCount = M->GetDword(hContact, "SendLater", "count", 0);
- if(iCount) {
+ if (iCount) {
DBCONTACTENUMSETTINGS ces = {0};
ces.pfnEnumProc = CSendLater::addStub;
@@ -286,7 +286,7 @@ void CSendLater::processSingleContact(const HANDLE hContact) */
void CSendLater::processContacts()
{
- if(m_fAvail && !m_sendLaterContactList.empty()) {
+ if (m_fAvail && !m_sendLaterContactList.empty()) {
std::vector<HANDLE>::iterator it = m_sendLaterContactList.begin();
while(it != m_sendLaterContactList.end()) {
processSingleContact(*it);
@@ -314,10 +314,10 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam) char *szOrig_Utf = 0;
if (!m_fAvail || !szSetting || !strcmp(szSetting, "count") || lstrlenA(szSetting) < 8)
- return(0);
+ return 0;
- if(szSetting[0] != 'S' && szSetting[0] != 'M')
- return(0);
+ if (szSetting[0] != 'S' && szSetting[0] != 'M')
+ return 0;
SendLaterJobIterator it = m_sendLaterJobList.begin();
@@ -326,26 +326,26 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam) */
while(it != m_sendLaterJobList.end()) {
if ((*it)->hContact == hContact && !strcmp((*it)->szId, szSetting)) {
- return(0);
+ return 0;
}
it++;
}
- if(szSetting[0] == 'S') {
- if(0 == DBGetContactSettingString(hContact, "SendLater", szSetting, &dbv))
+ if (szSetting[0] == 'S') {
+ if (0 == DBGetContactSettingString(hContact, "SendLater", szSetting, &dbv))
szOrig_Utf = dbv.pszVal;
else
- return(0);
+ return 0;
}
- else if(szSetting[0] == 'M') {
+ else if (szSetting[0] == 'M') {
char *szSep = strchr(const_cast<char *>(szSetting), '|');
if (!szSep)
- return(0);
+ return 0;
*szSep = 0;
szOrig_Utf = szSep + 1;
}
else
- return(0);
+ return 0;
CSendLaterJob *job = new CSendLaterJob;
@@ -369,7 +369,7 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam) szAnsi = mir_utf8decodecp(szOrig_Utf, CP_ACP, &szWchar);
iLen = lstrlenA(szAnsi);
- if(szWchar)
+ if (szWchar)
required = iLen + 1 + ((lstrlenW(szWchar) + 1) * sizeof(wchar_t));
else
required = iLen + 1;
@@ -378,17 +378,17 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam) strncpy((char *)job->pBuf, szAnsi, iLen);
job->pBuf[iLen] = 0;
- if(szWchar)
+ if (szWchar)
wcsncpy((wchar_t *)&job->pBuf[iLen + 1], szWchar, lstrlenW(szWchar));
- if(szSetting[0] == 'S')
+ if (szSetting[0] == 'S')
DBFreeVariant(&dbv);
mir_free(szWchar);
job->readFlags();
m_sendLaterJobList.push_back(job);
qMgrUpdate();
- return(1);
+ return 1;
}
/**
@@ -405,44 +405,44 @@ int CSendLater::sendIt(CSendLaterJob *job) const char* szProto = 0;
- if(job->bCode == CSendLaterJob::JOB_HOLD || job->bCode == CSendLaterJob::JOB_DEFERRED || job->fSuccess || job->fFailed || job->lastSent > now)
- return(0); // this one is frozen or done (will be removed soon), don't process it now.
+ if (job->bCode == CSendLaterJob::JOB_HOLD || job->bCode == CSendLaterJob::JOB_DEFERRED || job->fSuccess || job->fFailed || job->lastSent > now)
+ return 0; // this one is frozen or done (will be removed soon), don't process it now.
- if(now - job->created > SENDLATER_AGE_THRESHOLD) { // too old, this will be discarded and user informed by popup
+ if (now - job->created > SENDLATER_AGE_THRESHOLD) { // too old, this will be discarded and user informed by popup
job->fFailed = true;
job->bCode = CSendLaterJob::JOB_AGE;
- return(0);
+ return 0;
}
/*
* mark job as deferred (5 unsuccessful sends). Job will not be removed, but
* the user must manually reset it in order to trigger a new send attempt.
*/
- if(job->iSendCount == 5) {
+ if (job->iSendCount == 5) {
job->bCode = CSendLaterJob::JOB_DEFERRED;
- return(0);
+ return 0;
}
- if(job->iSendCount > 0 && (now - job->lastSent < SENDLATER_RESEND_THRESHOLD)) {
+ if (job->iSendCount > 0 && (now - job->lastSent < SENDLATER_RESEND_THRESHOLD)) {
//_DebugTraceA("Send it: message %s for %s RESEND but not old enough", job->szId, (char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, 0));
- return(0); // this one was sent, but probably failed. Resend it after a while
+ return 0; // this one was sent, but probably failed. Resend it after a while
}
CContactCache *c = CContactCache::getContactCache(hContact);
if (!c)
- return(0); // should not happen
+ return 0; // should not happen
if (!c->isValid()) {
job->fFailed = true;
job->bCode = CSendLaterJob::INVALID_CONTACT;
- return(0); // can happen (contact has been deleted). mark the job as failed
+ return 0; // can happen (contact has been deleted). mark the job as failed
}
hContact = c->getActiveContact();
szProto = c->getActiveProto();
if (!hContact || szProto == 0)
- return(0);
+ return 0;
WORD wMyStatus = (WORD)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
WORD wContactStatus = c->getActiveStatus();
@@ -450,19 +450,19 @@ int CSendLater::sendIt(CSendLaterJob *job) /*
* status mode checks
*/
- if(wMyStatus == ID_STATUS_OFFLINE) {
+ if (wMyStatus == ID_STATUS_OFFLINE) {
job->bCode = CSendLaterJob::JOB_MYSTATUS;
- return(0);
+ return 0;
}
- if(job->szId[0] == 'S') {
+ if (job->szId[0] == 'S') {
if (!(wMyStatus == ID_STATUS_ONLINE || wMyStatus == ID_STATUS_FREECHAT)) {
job->bCode = CSendLaterJob::JOB_MYSTATUS;
- return(0);
+ return 0;
}
}
- if(wContactStatus == ID_STATUS_OFFLINE) {
+ if (wContactStatus == ID_STATUS_OFFLINE) {
job->bCode = CSendLaterJob::JOB_STATUS;
- return(0);
+ return 0;
}
dwFlags = IsUtfSendAvailable(hContact) ? PREF_UTF : U_PREF_UNICODE;
@@ -474,11 +474,11 @@ int CSendLater::sendIt(CSendLaterJob *job) job->hTargetContact = hContact;
job->bCode = CSendLaterJob::JOB_WAITACK;
- if(dwFlags & PREF_UTF)
+ if (dwFlags & PREF_UTF)
job->hProcess = (HANDLE)CallContactService(hContact, svcName, dwFlags, (LPARAM)job->sendBuffer);
else
job->hProcess = (HANDLE)CallContactService(hContact, svcName, dwFlags, (LPARAM)job->pBuf);
- return(0);
+ return 0;
}
/*
@@ -494,7 +494,7 @@ void CSendLater::addContact(const HANDLE hContact) std::vector<HANDLE>::iterator it = m_sendLaterContactList.begin();
- if(m_sendLaterContactList.empty()) {
+ if (m_sendLaterContactList.empty()) {
m_sendLaterContactList.push_back(hContact);
m_last_sendlater_processed = 0; // force processing at next tick
return;
@@ -522,8 +522,8 @@ void CSendLater::addContact(const HANDLE hContact) */
HANDLE CSendLater::processAck(const ACKDATA *ack)
{
- if(m_sendLaterJobList.empty() || !m_fAvail)
- return(0);
+ if (m_sendLaterJobList.empty() || !m_fAvail)
+ return 0;
SendLaterJobIterator it = m_sendLaterJobList.begin();
@@ -548,11 +548,11 @@ HANDLE CSendLater::processAck(const ACKDATA *ack) (*it)->hProcess = (HANDLE)-1;
(*it)->bCode = '-';
qMgrUpdate();
- return(0);
+ return 0;
}
it++;
}
- return(0);
+ return 0;
}
/*
@@ -561,8 +561,8 @@ HANDLE CSendLater::processAck(const ACKDATA *ack) void CSendLater::qMgrUpdate(bool fReEnable)
{
- if(m_hwndDlg) {
- if(fReEnable)
+ if (m_hwndDlg) {
+ if (fReEnable)
Utils::enableDlgControl(m_hwndDlg, IDC_QMGR_LIST, true);
::SendMessage(m_hwndDlg, WM_USER + 100, 0, 0); // if qmgr is open, tell it to update
}
@@ -573,10 +573,10 @@ LRESULT CSendLater::qMgrAddFilter(const HANDLE hContact, const TCHAR* tszNick) LRESULT lr;
lr = ::SendMessage(m_hwndFilter, CB_FINDSTRING, 0, reinterpret_cast<LPARAM>(tszNick));
- if(lr == CB_ERR) {
+ if (lr == CB_ERR) {
lr = ::SendMessage(m_hwndFilter, CB_INSERTSTRING, -1, reinterpret_cast<LPARAM>(tszNick));
::SendMessage(m_hwndFilter, CB_SETITEMDATA, lr, reinterpret_cast<LPARAM>(hContact));
- if(hContact == m_hFilter)
+ if (hContact == m_hFilter)
m_sel = lr;
}
return(m_sel);
@@ -598,7 +598,7 @@ void CSendLater::qMgrFillList(bool fClear) const TCHAR* tszStatusText = 0;
BYTE bCode = '-';
- if(fClear) {
+ if (fClear) {
::SendMessage(m_hwndList, LVM_DELETEALLITEMS, 0, 0);
::SendMessage(m_hwndFilter, CB_RESETCONTENT, 0, 0);
}
@@ -615,11 +615,11 @@ void CSendLater::qMgrFillList(bool fClear) while(it != m_sendLaterJobList.end()) {
c = CContactCache::getContactCache((*it)->hContact);
- if(c) {
+ if (c) {
const TCHAR* tszNick = c->getNick();
TCHAR tszBuf[255];
- if(m_hFilter && m_hFilter != (*it)->hContact) {
+ if (m_hFilter && m_hFilter != (*it)->hContact) {
qMgrAddFilter(c->getContact(), tszNick);
it++;
continue;
@@ -690,7 +690,7 @@ void CSendLater::qMgrFillList(bool fClear) }
it++;
}
- if(m_hFilter == 0)
+ if (m_hFilter == 0)
::SendMessage(m_hwndFilter, CB_SETCURSEL, 0, 0);
else
::SendMessage(m_hwndFilter, CB_SETCURSEL, m_sel, 0);
@@ -715,7 +715,7 @@ void CSendLater::qMgrSetupColumns() ::GetWindowRect(m_hwndList, &rcList);
cxList = rcList.right - rcList.left;
- if(0 == M->GetString(0, SRMSGMOD_T, "qmgrListColumns", &dbv)) {
+ if (0 == M->GetString(0, SRMSGMOD_T, "qmgrListColumns", &dbv)) {
sscanf(dbv.pszVal, szColFormat, &nWidths[0], &nWidths[1], &nWidths[2], &nWidths[3], &nWidths[4]);
DBFreeVariant(&dbv);
}
@@ -768,7 +768,7 @@ INT_PTR CALLBACK CSendLater::DlgProcStub(HWND hwnd, UINT msg, WPARAM wParam, LPA {
CSendLater *s = reinterpret_cast<CSendLater *>(::GetWindowLongPtr(hwnd, GWLP_USERDATA));
- if(s)
+ if (s)
return(s->DlgProc(hwnd, msg, wParam, lParam));
switch(msg) {
@@ -797,7 +797,7 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM ::SendMessage(m_hwndList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|LVS_EX_LABELTIP|LVS_EX_DOUBLEBUFFER);
qMgrSetupColumns();
qMgrFillList();
- if(PluginConfig.g_PopupAvail) {
+ if (PluginConfig.g_PopupAvail) {
::CheckDlgButton(m_hwndDlg, IDC_QMGR_SUCCESSPOPUPS, m_fSuccessPopups ? BST_CHECKED : BST_UNCHECKED);
::CheckDlgButton(m_hwndDlg, IDC_QMGR_ERRORPOPUPS, m_fErrorPopups ? BST_CHECKED : BST_UNCHECKED);
}
@@ -811,7 +811,7 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case WM_NOTIFY: {
NMHDR* pNMHDR = reinterpret_cast<NMHDR *>(lParam);
- if(pNMHDR->hwndFrom == m_hwndList) {
+ if (pNMHDR->hwndFrom == m_hwndList) {
switch(pNMHDR->code) {
case NM_RCLICK: {
HMENU hMenu = ::LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_TABCONTEXT));
@@ -828,7 +828,7 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM m_fIsInteractive = true;
int selection = ::TrackPopupMenu(hSubMenu, TPM_RETURNCMD, pt.x, pt.y, 0, m_hwndDlg, NULL);
- if(selection == ID_QUEUEMANAGER_CANCELALLMULTISENDJOBS) {
+ if (selection == ID_QUEUEMANAGER_CANCELALLMULTISENDJOBS) {
SendLaterJobIterator it = m_sendLaterJobList.begin();
while(it != m_sendLaterJobList.end()) {
if ((*it)->szId[0] == 'M') {
@@ -838,7 +838,7 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM it++;
}
}
- else if(selection != 0) {
+ else if (selection != 0) {
::SendMessage(hwnd, WM_COMMAND, MAKEWPARAM(IDC_QMGR_REMOVE, LOWORD(selection)), 0);
m_last_sendlater_processed = 0; // force a queue check
}
@@ -854,9 +854,9 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM }
case WM_COMMAND:
- if(HIWORD(wParam) == CBN_SELCHANGE && reinterpret_cast<HWND>(lParam) == m_hwndFilter) {
+ if (HIWORD(wParam) == CBN_SELCHANGE && reinterpret_cast<HWND>(lParam) == m_hwndFilter) {
LRESULT lr = ::SendMessage(m_hwndFilter, CB_GETCURSEL, 0, 0);
- if(lr != CB_ERR) {
+ if (lr != CB_ERR) {
m_hFilter = reinterpret_cast<HANDLE>(::SendMessage(m_hwndFilter, CB_GETITEMDATA, lr, 0));
qMgrFillList();
}
@@ -894,17 +894,17 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM item.mask = LVIF_STATE|LVIF_PARAM;
item.stateMask = LVIS_SELECTED;
- if(HIWORD(wParam) != ID_QUEUEMANAGER_COPYMESSAGETOCLIPBOARD) {
- if(MessageBox(0, TranslateT("You are about to modify the state of one or more items in the\nunattended send queue. The requested action(s) will be executed at the next scheduled queue processing.\n\nThis action cannot be made undone."), TranslateT("Queue manager"),
+ if (HIWORD(wParam) != ID_QUEUEMANAGER_COPYMESSAGETOCLIPBOARD) {
+ if (MessageBox(0, TranslateT("You are about to modify the state of one or more items in the\nunattended send queue. The requested action(s) will be executed at the next scheduled queue processing.\n\nThis action cannot be made undone."), TranslateT("Queue manager"),
MB_ICONQUESTION | MB_OKCANCEL) == IDCANCEL)
break;
}
for(LRESULT i = 0; i < items; i++) {
item.iItem = i;
::SendMessage(m_hwndList, LVM_GETITEM, 0, reinterpret_cast<LPARAM>(&item));
- if(item.state & LVIS_SELECTED) {
+ if (item.state & LVIS_SELECTED) {
CSendLaterJob* job = reinterpret_cast<CSendLaterJob *>(item.lParam);
- if(job) {
+ if (job) {
switch(HIWORD(wParam)) {
case ID_QUEUEMANAGER_MARKSELECTEDFORREMOVAL:
job->bCode = CSendLaterJob::JOB_REMOVABLE;
@@ -929,11 +929,11 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM * so they can be resent at next processing
*/
case ID_QUEUEMANAGER_RESETSELECTED: {
- if(job->bCode == CSendLaterJob::JOB_DEFERRED) {
+ if (job->bCode == CSendLaterJob::JOB_DEFERRED) {
job->iSendCount = 0;
job->bCode = '-';
}
- else if(job->bCode == CSendLaterJob::JOB_AGE) {
+ else if (job->bCode == CSendLaterJob::JOB_AGE) {
job->fFailed = false;
job->bCode = '-';
job->created = time(0);
@@ -970,7 +970,7 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM */
void CSendLater::invokeQueueMgrDlg()
{
- if(m_hwndDlg == 0)
+ if (m_hwndDlg == 0)
m_hwndDlg = ::CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_SENDLATER_QMGR), 0, CSendLater::DlgProcStub,
reinterpret_cast<LPARAM>(this));
}
@@ -982,7 +982,7 @@ void CSendLater::invokeQueueMgrDlg() INT_PTR CSendLater::svcQMgr(WPARAM wParam, LPARAM lParam)
{
sendLater->invokeQueueMgrDlg();
- return(0);
+ return 0;
}
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index e3d22eb415..176ff25c14 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -59,7 +59,7 @@ char *SendQueue::MsgServiceName(const HANDLE hContact = 0, const TWindowData *da if (szProto == NULL)
return pss_msg;
- if(dat) {
+ if (dat) {
if (dat->sendMode & SMODE_FORCEANSI || !(dwFlags & PREF_UNICODE))
return pss_msg;
}
@@ -79,7 +79,7 @@ char *SendQueue::MsgServiceName(const HANDLE hContact = 0, const TWindowData *da int SendQueue::findNextFailed(const TWindowData *dat) const
{
- if(dat) {
+ if (dat) {
int i;
for (i = 0; i < NR_SENDJOBS; i++) {
@@ -92,7 +92,7 @@ int SendQueue::findNextFailed(const TWindowData *dat) const }
void SendQueue::handleError(TWindowData *dat, const int iEntry) const
{
- if(dat) {
+ if (dat) {
TCHAR szErrorMsg[500];
dat->iCurrentQueueError = iEntry;
@@ -358,7 +358,7 @@ static void DoSplitSendA(LPVOID param) */
int SendQueue::getSendLength(const int iEntry, int sendMode)
{
- if(m_jobs[iEntry].dwFlags & PREF_UNICODE && !(sendMode & SMODE_FORCEANSI)) {
+ if (m_jobs[iEntry].dwFlags & PREF_UNICODE && !(sendMode & SMODE_FORCEANSI)) {
int iLen;
WCHAR *wszBuf;
char *utf8;
@@ -397,18 +397,18 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry) hItem = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM) hContact, 0);
if (hItem && SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM) hItem, 0)) {
c = CContactCache::getContactCache(hContact);
- if(c)
+ if (c)
iMinLength = (iMinLength == 0 ? c->getMaxMessageLength() : min(c->getMaxMessageLength(), iMinLength));
}
} while (hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0));
- if(iSendLength >= iMinLength) {
+ if (iSendLength >= iMinLength) {
TCHAR tszError[256];
mir_sntprintf(tszError, 256, TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), iMinLength);
::SendMessage(dat->hwnd, DM_ACTIVATETOOLTIP, IDC_MESSAGE, reinterpret_cast<LPARAM>(tszError));
sendQueue->clearJob(iEntry);
- return(0);
+ return 0;
}
hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
@@ -421,9 +421,9 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry) } while (hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0));
sendQueue->clearJob(iEntry);
- if(iJobs)
+ if (iJobs)
sendLater->flushQueue(); // force queue processing
- return(0);
+ return 0;
}
else {
if (dat->hContact == NULL)
@@ -443,7 +443,7 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry) /*
* determine send buffer length
*/
- if(getSendLength(iEntry, dat->sendMode) >= dat->nMax)
+ if (getSendLength(iEntry, dat->sendMode) >= dat->nMax)
fSplit = true;
if (!fSplit)
@@ -473,19 +473,19 @@ send_unsplitted: m_jobs[iEntry].hwndOwner = hwndDlg;
m_jobs[iEntry].iStatus = SQ_INPROGRESS;
m_jobs[iEntry].iAcksNeeded = 1;
- if(dat->sendMode & SMODE_SENDLATER) {
+ if (dat->sendMode & SMODE_SENDLATER) {
TCHAR tszError[256];
int iSendLength = getSendLength(iEntry, dat->sendMode);
- if(iSendLength >= dat->nMax) {
+ if (iSendLength >= dat->nMax) {
mir_sntprintf(tszError, 256, TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), dat->nMax);
SendMessage(dat->hwnd, DM_ACTIVATETOOLTIP, IDC_MESSAGE, reinterpret_cast<LPARAM>(tszError));
clearJob(iEntry);
- return(0);
+ return 0;
}
doSendLater(iEntry, dat);
clearJob(iEntry);
- return(0);
+ return 0;
}
m_jobs[iEntry].hSendId = (HANDLE) CallContactService(dat->hContact, MsgServiceName(dat->hContact, dat, m_jobs[iEntry].dwFlags), (dat->sendMode & SMODE_FORCEANSI) ? (m_jobs[iEntry].dwFlags & ~PREF_UNICODE) : m_jobs[iEntry].dwFlags, (LPARAM) m_jobs[iEntry].sendBuffer);
@@ -540,7 +540,7 @@ void SendQueue::clearJob(const int iIndex) void SendQueue::checkQueue(const TWindowData *dat) const
{
- if(dat) {
+ if (dat) {
HWND hwndDlg = dat->hwnd;
if (dat->iOpenJobs == 0) {
@@ -564,7 +564,7 @@ void SendQueue::logError(const TWindowData *dat, int iSendJobIndex, const TCHAR DBEVENTINFO dbei = {0};
int iMsgLen;
- if(dat == 0)
+ if (dat == 0)
return;
dbei.eventType = EVENTTYPE_ERRMSG;
@@ -599,7 +599,7 @@ void SendQueue::logError(const TWindowData *dat, int iSendJobIndex, const TCHAR void SendQueue::EnableSending(const TWindowData *dat, const int iMode)
{
- if(dat) {
+ if (dat) {
HWND hwndDlg = dat->hwnd;
::SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETREADONLY, (WPARAM) iMode ? FALSE : TRUE, 0);
Utils::enableDlgControl(hwndDlg, IDC_CLIST, iMode ? TRUE : FALSE);
@@ -645,7 +645,7 @@ void SendQueue::recallFailed(const TWindowData *dat, int iEntry) const {
int iLen = GetWindowTextLengthA(GetDlgItem(dat->hwnd, IDC_MESSAGE));
- if(dat) {
+ if (dat) {
NotifyDeliveryFailure(dat);
if (iLen == 0) { // message area is empty, so we can recall the failed message...
SETTEXTEX stx = {ST_DEFAULT, 1200};
@@ -663,7 +663,7 @@ void SendQueue::recallFailed(const TWindowData *dat, int iEntry) const void SendQueue::UpdateSaveAndSendButton(TWindowData *dat)
{
- if(dat) {
+ if (dat) {
int len;
HWND hwndDlg = dat->hwnd;
@@ -698,7 +698,7 @@ void SendQueue::NotifyDeliveryFailure(const TWindowData *dat) POPUPDATAT_V2 ppd = {0};
int ibsize = 1023;
- if(M->GetByte("adv_noErrorPopups", 0))
+ if (M->GetByte("adv_noErrorPopups", 0))
return;
if (CallService(MS_POPUP_QUERY, PUQS_GETSTATUS, 0) == 1) {
@@ -816,7 +816,7 @@ inform_and_discard: dat->cache->updateStats(TSessionStats::BYTES_SENT, dbei.cbBlob - 1);
else {
CContactCache *c = CContactCache::getContactCache(m_jobs[iFound].hOwner);
- if(c)
+ if (c)
c->updateStats(TSessionStats::BYTES_SENT, dbei.cbBlob - 1);
}
@@ -861,7 +861,7 @@ inform_and_discard: //MAD: close on send mode
else {
if (M->GetByte("AutoClose", 0)) {
- if(M->GetByte("adv_AutoClose_2", 0))
+ if (M->GetByte("adv_AutoClose_2", 0))
SendMessage(dat->hwnd, WM_CLOSE, 0, 1);
else
SendMessage(dat->pContainer->hwnd, WM_CLOSE, 0, 0);
@@ -895,8 +895,8 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, HANDLE hContact, boo const TCHAR *szNote = 0;
- if(fIsSendLater && dat) {
- if(fAvail)
+ if (fIsSendLater && dat) {
+ if (fAvail)
szNote = TranslateT("Message successfully queued for later delivery.\nIt will be sent as soon as possible and a popup will inform you about the result.");
else
szNote = TranslateT("The send later feature is not available on this protocol.");
@@ -923,16 +923,16 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, HANDLE hContact, boo mir_free(utfText);
if (!fAvail)
- return(0);
+ return 0;
}
- if(iJobIndex >= 0 && iJobIndex < NR_SENDJOBS) {
+ if (iJobIndex >= 0 && iJobIndex < NR_SENDJOBS) {
SendJob* job = &m_jobs[iJobIndex];
char szKeyName[20];
TCHAR tszTimestamp[30], tszHeader[150];
time_t now = time(0);
- if(fIsSendLater) {
+ if (fIsSendLater) {
TCHAR *formatTime = _T("%Y.%m.%d - %H:%M");
_tcsftime(tszTimestamp, 30, formatTime, _localtime32((__time32_t *)&now));
tszTimestamp[29] = 0;
@@ -942,12 +942,12 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, HANDLE hContact, boo else
mir_sntprintf(tszHeader, safe_sizeof(tszHeader), _T("M%d|"), time(0));
- if(job->dwFlags & PREF_UTF || !(job->dwFlags & PREF_UNICODE)) {
+ if (job->dwFlags & PREF_UTF || !(job->dwFlags & PREF_UNICODE)) {
char *utf_header = mir_utf8encodeT(tszHeader);
UINT required = lstrlenA(utf_header) + lstrlenA(job->sendBuffer) + 10;
char *tszMsg = reinterpret_cast<char *>(mir_alloc(required));
- if(fIsSendLater) {
+ if (fIsSendLater) {
mir_snprintf(tszMsg, required, "%s%s", job->sendBuffer, utf_header);
DBWriteContactSettingString(hContact ? hContact : job->hOwner, "SendLater", szKeyName, tszMsg);
}
@@ -958,26 +958,26 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, HANDLE hContact, boo mir_free(utf_header);
mir_free(tszMsg);
}
- else if(job->dwFlags & PREF_UNICODE) {
+ else if (job->dwFlags & PREF_UNICODE) {
int iLen = lstrlenA(job->sendBuffer);
wchar_t *wszMsg = (wchar_t *)&job->sendBuffer[iLen + 1];
UINT required = sizeof(TCHAR) * (lstrlen(tszHeader) + lstrlenW(wszMsg) + 10);
TCHAR *tszMsg = reinterpret_cast<TCHAR *>(mir_alloc(required));
- if(fIsSendLater)
+ if (fIsSendLater)
mir_sntprintf(tszMsg, required, _T("%s%s"), wszMsg, tszHeader);
else
mir_sntprintf(tszMsg, required, _T("%s%s"), tszHeader, wszMsg);
char *utf = mir_utf8encodeT(tszMsg);
- if(fIsSendLater)
+ if (fIsSendLater)
DBWriteContactSettingString(hContact ? hContact : job->hOwner, "SendLater", szKeyName, utf);
else
sendLater->addJob(utf, (LPARAM)hContact);
mir_free(utf);
mir_free(tszMsg);
}
- if(fIsSendLater) {
+ if (fIsSendLater) {
int iCount = M->GetDword(hContact ? hContact : job->hOwner, "SendLater", "count", 0);
iCount++;
M->WriteDword(hContact ? hContact : job->hOwner, "SendLater", "count", iCount);
diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp index f3c514c588..6988b6c1d3 100644 --- a/plugins/TabSRMM/src/sidebar.cpp +++ b/plugins/TabSRMM/src/sidebar.cpp @@ -109,7 +109,7 @@ void CSideBarButton::_create() m_hwnd = ::CreateWindowEx(0, _T("TSButtonClass"), _T(""), WS_CHILD | WS_TABSTOP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
0, 0, 40, 40, m_sideBar->getScrollWnd(), reinterpret_cast<HMENU>(m_id), g_hInst, NULL);
- if(m_hwnd) {
+ if (m_hwnd) {
::SendMessage(m_hwnd, BUTTONSETASSIDEBARBUTTON, (WPARAM)this, 0);
::SendMessage(m_hwnd, BUTTONSETASFLATBTN, FALSE, 0);
::SendMessage(m_hwnd, BUTTONSETASTHEMEDBTN, TRUE, 0);
@@ -119,13 +119,13 @@ void CSideBarButton::_create() else
delete this;
- if(m_id == IDC_SIDEBARUP || m_id == IDC_SIDEBARDOWN)
+ if (m_id == IDC_SIDEBARUP || m_id == IDC_SIDEBARDOWN)
::SetParent(m_hwnd, m_sideBar->getContainer()->hwnd);
}
CSideBarButton::~CSideBarButton()
{
- if(m_hwnd) {
+ if (m_hwnd) {
::SendMessage(m_hwnd, BUTTONSETASSIDEBARBUTTON, 0, 0); // make sure, the button will no longer call us back
::DestroyWindow(m_hwnd);
}
@@ -148,7 +148,7 @@ const SIZE& CSideBarButton::measureItem() {
SIZE sz;
- if(m_sideBarLayout->pfnMeasureItem)
+ if (m_sideBarLayout->pfnMeasureItem)
m_sideBarLayout->pfnMeasureItem(this); // use the current layout's function, if available, else use default
else {
HDC dc = ::GetDC(m_hwnd);
@@ -160,10 +160,10 @@ const SIZE& CSideBarButton::measureItem() ::GetTextExtentPoint32(dc, tszLabel, lstrlen(tszLabel), &sz);
sz.cx += 28;
- if(m_dat->pContainer->dwFlagsEx & TCF_CLOSEBUTTON)
+ if (m_dat->pContainer->dwFlagsEx & TCF_CLOSEBUTTON)
sz.cx += 20;
- if(m_sideBarLayout->dwFlags & CSideBar::SIDEBARLAYOUT_VERTICALORIENTATION)
+ if (m_sideBarLayout->dwFlags & CSideBar::SIDEBARLAYOUT_VERTICALORIENTATION)
m_sz.cy = sz.cx;
else
m_sz.cx = sz.cx;
@@ -190,10 +190,10 @@ void CSideBarButton::RenderThis(const HDC hdc) const ::GetClientRect(m_hwnd, &rc);
- if(m_id == IDC_SIDEBARUP || m_id == IDC_SIDEBARDOWN)
+ if (m_id == IDC_SIDEBARUP || m_id == IDC_SIDEBARDOWN)
fVertical = false;
- if(fVertical) {
+ if (fVertical) {
cx = rc.bottom;
cy = rc.right;
}
@@ -204,7 +204,7 @@ void CSideBarButton::RenderThis(const HDC hdc) const hdcMem = ::CreateCompatibleDC(hdc);
- if(fVertical) {
+ if (fVertical) {
RECT rcFlipped = {0,0,cx,cy};
hbmMem = CSkin::CreateAeroCompatibleBitmap(rcFlipped, hdcMem);
rc = rcFlipped;
@@ -226,7 +226,7 @@ void CSideBarButton::RenderThis(const HDC hdc) const * final bitmap back to it's original orientation
*/
- if(fVertical) {
+ if (fVertical) {
::SelectObject(hdcMem, hbmOld);
FIBITMAP *fib = FIF->FI_CreateDIBFromHBITMAP(hbmMem);
@@ -266,7 +266,7 @@ void CSideBarButton::renderIconAndNick(const HDC hdc, const RECT *rcItem) const int iSize = 16;
const TContainerData *pContainer = m_sideBar->getContainer();
- if(m_dat && pContainer) {
+ if (m_dat && pContainer) {
hIcon = m_dat->cache->getIcon(iSize);
if (m_dat->mayFlashTab == FALSE || (m_dat->mayFlashTab == TRUE && m_dat->bTabFlash != 0) || !(pContainer->dwFlagsEx & TCF_FLASHICON)) {
@@ -283,8 +283,8 @@ void CSideBarButton::renderIconAndNick(const HDC hdc, const RECT *rcItem) const /*
* draw the close button if enabled
*/
- if(m_sideBar->getContainer()->dwFlagsEx & TCF_CLOSEBUTTON) {
- if(m_sideBar->getHoveredClose() != this)
+ if (m_sideBar->getContainer()->dwFlagsEx & TCF_CLOSEBUTTON) {
+ if (m_sideBar->getHoveredClose() != this)
CSkin::m_default_bf.SourceConstantAlpha = 150;
CMimAPI::m_MyAlphaBlend(hdc, rc.right - 20, (rc.bottom + rc.top - 16) / 2, 16, 16, CSkin::m_tabCloseHDC,
@@ -319,27 +319,27 @@ void CSideBarButton::renderIconAndNick(const HDC hdc, const RECT *rcItem) const */
int CSideBarButton::testCloseButton() const
{
- if(m_id == IDC_SIDEBARUP || m_id == IDC_SIDEBARDOWN) // scroller buttons don't have a close button
+ if (m_id == IDC_SIDEBARUP || m_id == IDC_SIDEBARDOWN) // scroller buttons don't have a close button
return(-1);
- if(m_sideBar->getContainer()->dwFlagsEx & TCF_CLOSEBUTTON && !(getLayout()->dwFlags & CSideBar::SIDEBARLAYOUT_NOCLOSEBUTTONS)) {
+ if (m_sideBar->getContainer()->dwFlagsEx & TCF_CLOSEBUTTON && !(getLayout()->dwFlags & CSideBar::SIDEBARLAYOUT_NOCLOSEBUTTONS)) {
POINT pt;
::GetCursorPos(&pt);
::ScreenToClient(m_hwnd, &pt);
RECT rc;
::GetClientRect(m_hwnd, &rc);
- if(getLayout()->dwFlags & CSideBar::SIDEBARLAYOUT_VERTICALORIENTATION) {
+ if (getLayout()->dwFlags & CSideBar::SIDEBARLAYOUT_VERTICALORIENTATION) {
rc.bottom = rc.top + 18; rc.top += 2;
rc.left += 2; rc.right -= 2;
if (::PtInRect(&rc, pt))
- return(1);
+ return 1;
}
else {
rc.bottom -= 4; rc.top += 4;
rc.right -= 3; rc.left = rc.right - 16;
if (::PtInRect(&rc, pt))
- return(1);
+ return 1;
}
}
return(-1);
@@ -349,7 +349,7 @@ int CSideBarButton::testCloseButton() const */
void CSideBarButton::activateSession() const
{
- if(m_dat)
+ if (m_dat)
::SendMessage(m_dat->hwnd, DM_ACTIVATEME, 0, 0); // the child window will activate itself
}
@@ -360,7 +360,7 @@ void CSideBarButton::invokeContextMenu() {
const TContainerData* pContainer = m_sideBar->getContainer();
- if(pContainer) {
+ if (pContainer) {
TSideBarNotify tsn = {0};
tsn.nmHdr.code = NM_RCLICK;
tsn.nmHdr.idFrom = 5000;
@@ -387,7 +387,7 @@ CSideBar::~CSideBar() destroyScroller();
m_buttonlist.clear();
- if(m_hwndScrollWnd)
+ if (m_hwndScrollWnd)
::DestroyWindow(m_hwndScrollWnd);
}
@@ -408,8 +408,8 @@ void CSideBar::Init(const bool fForce) m_dwFlags = (m_pContainer->dwFlagsEx & TCF_SBARLEFT ? m_dwFlags | SIDEBARORIENTATION_LEFT : m_dwFlags & ~SIDEBARORIENTATION_LEFT);
m_dwFlags = (m_pContainer->dwFlagsEx & TCF_SBARRIGHT ? m_dwFlags | SIDEBARORIENTATION_RIGHT : m_dwFlags & ~SIDEBARORIENTATION_RIGHT);
- if(m_pContainer->dwFlags & CNT_SIDEBAR) {
- if(m_hwndScrollWnd == 0)
+ if (m_pContainer->dwFlags & CNT_SIDEBAR) {
+ if (m_hwndScrollWnd == 0)
m_hwndScrollWnd = ::CreateWindowEx(0, _T("TS_SideBarClass"), _T(""), WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE | WS_CHILD,
0, 0, m_width, 40, m_pContainer->hwnd, reinterpret_cast<HMENU>(5000), g_hInst, this);
@@ -420,7 +420,7 @@ void CSideBar::Init(const bool fForce) m_elementWidth = m_currentLayout->width;
m_width = m_elementWidth + 4;
populateAll();
- if(m_activeItem)
+ if (m_activeItem)
setActiveItem(m_activeItem);
}
else {
@@ -430,7 +430,7 @@ void CSideBar::Init(const bool fForce) m_activeItem = 0;
removeAll();
- if(m_hwndScrollWnd)
+ if (m_hwndScrollWnd)
::DestroyWindow(m_hwndScrollWnd);
m_hwndScrollWnd = 0;
}
@@ -465,9 +465,9 @@ void CSideBar::setVisible(bool fNewVisible) */
void CSideBar::createScroller()
{
- if(m_up == 0)
+ if (m_up == 0)
m_up = new CSideBarButton(IDC_SIDEBARUP, this);
- if(m_down == 0)
+ if (m_down == 0)
m_down = new CSideBarButton(IDC_SIDEBARDOWN, this);
m_up->setLayout(m_currentLayout);
@@ -479,11 +479,11 @@ void CSideBar::createScroller() */
void CSideBar::destroyScroller()
{
- if(m_up) {
+ if (m_up) {
delete m_up;
m_up = 0;
}
- if(m_down) {
+ if (m_down) {
delete m_down;
m_down = 0;
}
@@ -517,7 +517,7 @@ void CSideBar::populateAll() {
HWND hwndTab = ::GetDlgItem(m_pContainer->hwnd, IDC_MSGTABS);
- if(hwndTab) {
+ if (hwndTab) {
int iItems = (int)TabCtrl_GetItemCount(hwndTab);
TCITEM item = {0};
@@ -528,14 +528,14 @@ void CSideBar::populateAll() for(int i = 0; i < iItems; i++) {
TabCtrl_GetItem(hwndTab, i, &item);
- if(item.lParam && ::IsWindow((HWND)item.lParam)) {
+ if (item.lParam && ::IsWindow((HWND)item.lParam)) {
TWindowData *dat = (TWindowData *)::GetWindowLongPtr((HWND)item.lParam, GWLP_USERDATA);
- if(dat) {
+ if (dat) {
if ((b_item = findSession(dat)) == m_buttonlist.end())
addSession(dat, i);
else {
(*b_item)->setLayout(m_currentLayout);
- if(m_dwFlags & SIDEBARLAYOUT_VERTICALORIENTATION) {
+ if (m_dwFlags & SIDEBARLAYOUT_VERTICALORIENTATION) {
(*b_item)->measureItem();
m_topHeight += ((*b_item)->getHeight() + 1);
}
@@ -563,7 +563,7 @@ void CSideBar::addSession(const TWindowData *dat, int position) item->setLayout(m_currentLayout);
- if(m_dwFlags & SIDEBARLAYOUT_DYNHEIGHT) {
+ if (m_dwFlags & SIDEBARLAYOUT_DYNHEIGHT) {
SIZE sz = item->measureItem();
m_topHeight += (sz.cy + 1);
}
@@ -571,7 +571,7 @@ void CSideBar::addSession(const TWindowData *dat, int position) m_topHeight += (m_elementHeight + 1);
m_iTopButtons++;
- if(position == -1 || (size_t)position >= m_buttonlist.size())
+ if (position == -1 || (size_t)position >= m_buttonlist.size())
m_buttonlist.push_back(item);
else {
ButtonIterator it = m_buttonlist.begin() + position;
@@ -590,12 +590,12 @@ void CSideBar::addSession(const TWindowData *dat, int position) */
HRESULT CSideBar::removeSession(const TWindowData *dat)
{
- if(dat) {
+ if (dat) {
std::vector<CSideBarButton *>::iterator item = findSession(dat);
- if(item != m_buttonlist.end()) {
+ if (item != m_buttonlist.end()) {
m_iTopButtons--;
- if(m_dwFlags & SIDEBARLAYOUT_DYNHEIGHT) {
+ if (m_dwFlags & SIDEBARLAYOUT_DYNHEIGHT) {
SIZE sz = (*item)->getSize();
m_topHeight -= (sz.cy + 1);
}
@@ -623,7 +623,7 @@ void CSideBar::scrollIntoView(const CSideBarButton *item) if (!m_isActive)
return;
- if(item == 0)
+ if (item == 0)
item = m_activeItem;
ButtonIterator it = m_buttonlist.begin();
@@ -639,17 +639,17 @@ void CSideBar::scrollIntoView(const CSideBarButton *item) RECT rc;
GetClientRect(m_hwndScrollWnd, &rc);
- if(m_topHeight <= rc.bottom) {
+ if (m_topHeight <= rc.bottom) {
m_firstVisibleOffset = 0;
Layout();
return;
}
- if(it == m_buttonlist.end() || (it == m_buttonlist.begin() && m_firstVisibleOffset == 0)) {
+ if (it == m_buttonlist.end() || (it == m_buttonlist.begin() && m_firstVisibleOffset == 0)) {
Layout();
return; // do nothing for the first item and .end() should not really happen
}
- if(spaceUsed <= rc.bottom && spaceUsed - (itemHeight + 1) >= m_firstVisibleOffset) {
+ if (spaceUsed <= rc.bottom && spaceUsed - (itemHeight + 1) >= m_firstVisibleOffset) {
Layout();
return; // item fully visible, do nothing
}
@@ -657,17 +657,17 @@ void CSideBar::scrollIntoView(const CSideBarButton *item) /*
* button partially or not at all visible at the top
*/
- if(spaceUsed < m_firstVisibleOffset || spaceUsed - (itemHeight + 1) < m_firstVisibleOffset) {
+ if (spaceUsed < m_firstVisibleOffset || spaceUsed - (itemHeight + 1) < m_firstVisibleOffset) {
m_firstVisibleOffset = spaceUsed - (itemHeight + 1);
fNeedLayout = true;
} else {
- if(spaceUsed > rc.bottom) { // partially or not at all visible at the bottom
+ if (spaceUsed > rc.bottom) { // partially or not at all visible at the bottom
fNeedLayout = true;
m_firstVisibleOffset = spaceUsed - rc.bottom;
}
}
- //if(fNeedLayout)
+ //if (fNeedLayout)
Layout();
}
/**
@@ -681,13 +681,13 @@ void CSideBar::updateSession(const TWindowData *dat) return;
ButtonIterator item = findSession(dat);
- if(item != m_buttonlist.end()) {
- if(m_dwFlags & SIDEBARLAYOUT_DYNHEIGHT) {
+ if (item != m_buttonlist.end()) {
+ if (m_dwFlags & SIDEBARLAYOUT_DYNHEIGHT) {
LONG oldHeight = (*item)->getHeight();
m_topHeight -= (oldHeight + 1);
SIZE sz = (*item)->measureItem();
m_topHeight += (sz.cy + 1);
- if(sz.cy != oldHeight) {
+ if (sz.cy != oldHeight) {
Invalidate();
::InvalidateRect((*item)->getHwnd(), NULL, TRUE);
}
@@ -711,10 +711,10 @@ void CSideBar::updateSession(const TWindowData *dat) const CSideBarButton* CSideBar::setActiveItem(const TWindowData *dat)
{
ButtonIterator item = findSession(dat);
- if(item != m_buttonlist.end()) {
+ if (item != m_buttonlist.end()) {
return(setActiveItem(*item));
}
- return(0);
+ return 0;
}
/**
@@ -739,7 +739,7 @@ void CSideBar::Layout(const RECT *rc, bool fOnlyCalc) rc = &rcWnd;
::GetClientRect(m_hwndScrollWnd, &rcWnd);
- if(m_currentLayout->pfnLayout) {
+ if (m_currentLayout->pfnLayout) {
m_currentLayout->pfnLayout(this, const_cast<RECT *>(rc));
return;
}
@@ -765,10 +765,10 @@ void CSideBar::Layout(const RECT *rc, bool fOnlyCalc) while (item != m_buttonlist.end()) {
hwnd = (*item)->getHwnd();
- if(m_dwFlags & SIDEBARLAYOUT_DYNHEIGHT)
+ if (m_dwFlags & SIDEBARLAYOUT_DYNHEIGHT)
height = (*item)->getHeight();
- if(spaceUsed > iSpaceAvail || m_totalItemHeight + height < m_firstVisibleOffset) {
+ if (spaceUsed > iSpaceAvail || m_totalItemHeight + height < m_firstVisibleOffset) {
::ShowWindow(hwnd, SW_HIDE);
item++;
m_totalItemHeight += (height + 1);
@@ -776,7 +776,7 @@ void CSideBar::Layout(const RECT *rc, bool fOnlyCalc) }
if ((*item)->isTopAligned()) {
- if(m_totalItemHeight <= m_firstVisibleOffset) { // partially visible
+ if (m_totalItemHeight <= m_firstVisibleOffset) { // partially visible
if (!fOnlyCalc)
hdwp = ::DeferWindowPos(hdwp, hwnd, 0, 2, -(m_firstVisibleOffset - m_totalItemHeight),
m_elementWidth, height, SWP_SHOWWINDOW | dwFlags);
@@ -844,10 +844,10 @@ void CSideBar::showAll(int showCmd) */
ButtonIterator CSideBar::findSession(const TWindowData *dat)
{
- if(dat) {
+ if (dat) {
std::vector<CSideBarButton *>::iterator item = m_buttonlist.begin();
- if(m_buttonlist.size() > 0) {
+ if (m_buttonlist.size() > 0) {
while(item != m_buttonlist.end()) {
if ((*item)->getDat() == dat)
return(item);
@@ -868,10 +868,10 @@ ButtonIterator CSideBar::findSession(const TWindowData *dat) */
ButtonIterator CSideBar::findSession(const HANDLE hContact)
{
- if(hContact) {
+ if (hContact) {
std::vector<CSideBarButton *>::iterator item = m_buttonlist.begin();
- if(m_buttonlist.size() > 0) {
+ if (m_buttonlist.size() > 0) {
while(item != m_buttonlist.end()) {
if ((*item)->getContactHandle() == hContact)
return(item);
@@ -887,9 +887,9 @@ void CSideBar::processScrollerButtons(UINT commandID) if (!m_isActive || m_down == 0)
return;
- if(commandID == IDC_SIDEBARDOWN && ::IsWindowEnabled(m_down->getHwnd()))
+ if (commandID == IDC_SIDEBARDOWN && ::IsWindowEnabled(m_down->getHwnd()))
m_firstVisibleOffset += 10;
- else if(commandID == IDC_SIDEBARUP && ::IsWindowEnabled(m_up->getHwnd()))
+ else if (commandID == IDC_SIDEBARUP && ::IsWindowEnabled(m_up->getHwnd()))
m_firstVisibleOffset = max(0, m_firstVisibleOffset - 10);
Layout(0);
@@ -907,10 +907,10 @@ void CSideBar::resizeScrollWnd(LONG x, LONG y, LONG width, LONG height) const void CSideBar::invalidateButton(const TWindowData* dat)
{
- if(m_isActive && m_isVisible) {
+ if (m_isActive && m_isVisible) {
ButtonIterator it = findSession(dat);
- if(it != this->m_buttonlist.end())
+ if (it != this->m_buttonlist.end())
RedrawWindow((*it)->m_buttonControl->hwnd, 0, 0, RDW_INVALIDATE | RDW_UPDATENOW);
}
}
@@ -932,7 +932,7 @@ LRESULT CALLBACK CSideBar::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP if (CSkin::m_skinEnabled) {
CSkinItem *item = &SkinItems[ID_EXTBKSIDEBARBG];
- if(item->IGNORED)
+ if (item->IGNORED)
CSkin::SkinDrawBG(hwnd, m_pContainer->hwnd, m_pContainer, &rc, hdc);
else
CSkin::DrawItem(hdc, &rc, item);
@@ -942,7 +942,7 @@ LRESULT CALLBACK CSideBar::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP HANDLE hbp = 0;
HBITMAP hbm, hbmOld;
- if(CMimAPI::m_haveBufferedPaint)
+ if (CMimAPI::m_haveBufferedPaint)
hbp = CSkin::InitiateBufferedPaint(hdc, rc, hdcMem);
else {
hdcMem = ::CreateCompatibleDC(hdc);
@@ -950,12 +950,12 @@ LRESULT CALLBACK CSideBar::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP hbmOld = reinterpret_cast<HBITMAP>(::SelectObject(hdcMem, hbm));
}
- if(M->isAero())
+ if (M->isAero())
::FillRect(hdcMem, &rc, CSkin::m_BrushBack);
else
CSkin::FillBack(hdcMem, &rc);
- if(hbp)
+ if (hbp)
CSkin::FinalizeBufferedPaint(hbp, &rc);
else {
::BitBlt(hdc, 0, 0, rc.right, rc.bottom, hdcMem, 0, 0, SRCCOPY);
@@ -966,7 +966,7 @@ LRESULT CALLBACK CSideBar::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP }
else
::FillRect(hdc, &rc, ::GetSysColorBrush(COLOR_3DFACE));
- return(1);
+ return 1;
}
default:
break;
@@ -978,7 +978,7 @@ LRESULT CALLBACK CSideBar::wndProcStub(HWND hwnd, UINT msg, WPARAM wParam, LPARA {
CSideBar *sideBar = (CSideBar *)::GetWindowLongPtr(hwnd, GWLP_USERDATA);
- if(sideBar)
+ if (sideBar)
return(sideBar->wndProc(hwnd, msg, wParam, lParam));
switch(msg) {
@@ -1007,15 +1007,15 @@ void __fastcall CSideBar::m_DefaultBackgroundRenderer(const HDC hdc, const RECT int stateId = item->m_buttonControl->stateId;
bool fIsActiveItem = (item->m_sideBar->getActiveItem() == item);
- if(CSkin::m_skinEnabled) {
+ if (CSkin::m_skinEnabled) {
TContainerData* pContainer = const_cast<TContainerData *>(item->m_sideBar->getContainer());
int id = stateId == PBS_PRESSED || fIsActiveItem ? ID_EXTBKBUTTONSPRESSED : (stateId == PBS_HOT ? ID_EXTBKBUTTONSMOUSEOVER : ID_EXTBKBUTTONSNPRESSED);
CSkinItem* skinItem = &SkinItems[id];
HWND hwnd;
- if(id == IDC_SIDEBARUP)
+ if (id == IDC_SIDEBARUP)
hwnd = item->m_sideBar->getScrollUp()->m_buttonControl->hwnd;
- else if(id == IDC_SIDEBARDOWN)
+ else if (id == IDC_SIDEBARDOWN)
hwnd = item->m_sideBar->getScrollDown()->m_buttonControl->hwnd;
else
hwnd = item->m_buttonControl->hwnd;
@@ -1023,14 +1023,14 @@ void __fastcall CSideBar::m_DefaultBackgroundRenderer(const HDC hdc, const RECT CSkin::SkinDrawBG(hwnd, pContainer->hwnd, pContainer, const_cast<RECT *>(rc), hdc);
CSkin::DrawItem(hdc, rc, skinItem);
}
- else if(M->isAero() || PluginConfig.m_fillColor) {
- if(id == IDC_SIDEBARUP || id == IDC_SIDEBARDOWN) {
- if(M->isAero())
+ else if (M->isAero() || PluginConfig.m_fillColor) {
+ if (id == IDC_SIDEBARUP || id == IDC_SIDEBARDOWN) {
+ if (M->isAero())
::FillRect(hdc, const_cast<RECT *>(rc), CSkin::m_BrushBack);
else
CSkin::FillBack(hdc, const_cast<RECT *>(rc));
- if(stateId == PBS_HOT || stateId == PBS_PRESSED)
+ if (stateId == PBS_HOT || stateId == PBS_PRESSED)
DrawAlpha(hdc, const_cast<RECT *>(rc), 0xf0f0f0, 70, 0x000000, 0, 9,
31, 4, 0);
else
@@ -1038,13 +1038,13 @@ void __fastcall CSideBar::m_DefaultBackgroundRenderer(const HDC hdc, const RECT 31, 4, 0);
}
else {
- if(PluginConfig.m_fillColor)
+ if (PluginConfig.m_fillColor)
FillTabBackground(hdc, stateId, item->getDat(), const_cast<RECT *>(rc));
CSkin::m_switchBarItem->setAlphaFormat(AC_SRC_ALPHA,
(stateId == PBS_HOT && !fIsActiveItem) ? 250 : (fIsActiveItem || stateId == PBS_PRESSED ? 250 : 230));
CSkin::m_switchBarItem->Render(hdc, rc, true);
- if(stateId == PBS_HOT || stateId == PBS_PRESSED || fIsActiveItem) {
+ if (stateId == PBS_HOT || stateId == PBS_PRESSED || fIsActiveItem) {
RECT rcGlow = *rc;
rcGlow.top += 1;
rcGlow.bottom -= 2;
@@ -1054,9 +1054,9 @@ void __fastcall CSideBar::m_DefaultBackgroundRenderer(const HDC hdc, const RECT }
}
}
- else if(M->isVSThemed()) {
+ else if (M->isVSThemed()) {
RECT *rcDraw = const_cast<RECT *>(rc);
- if(id == IDC_SIDEBARUP || id == IDC_SIDEBARDOWN) {
+ if (id == IDC_SIDEBARUP || id == IDC_SIDEBARDOWN) {
::FillRect(hdc, rc, stateId == PBS_HOT ? ::GetSysColorBrush(COLOR_HOTLIGHT) : ::GetSysColorBrush(COLOR_3DFACE));
::InflateRect(rcDraw, -2, 0);
::DrawEdge(hdc, rcDraw, EDGE_ETCHED, BF_SOFT|BF_RECT|BF_FLAT);
@@ -1064,10 +1064,10 @@ void __fastcall CSideBar::m_DefaultBackgroundRenderer(const HDC hdc, const RECT else {
CSkin::FillBack(hdc, rcDraw);
- if(CMimAPI::m_pfnIsThemeBackgroundPartiallyTransparent(item->m_buttonControl->hThemeToolbar, TP_BUTTON, stateId))
+ if (CMimAPI::m_pfnIsThemeBackgroundPartiallyTransparent(item->m_buttonControl->hThemeToolbar, TP_BUTTON, stateId))
CMimAPI::m_pfnDrawThemeParentBackground(item->getHwnd(), hdc, rcDraw);
- if(M->isAero() || PluginConfig.m_WinVerMajor >= 6) {
+ if (M->isAero() || PluginConfig.m_WinVerMajor >= 6) {
stateId = (fIsActiveItem ? PBS_PRESSED : PBS_HOT);
CMimAPI::m_pfnDrawThemeBackground(item->m_buttonControl->hThemeToolbar, hdc, 8, RBStateConvert2Flat(stateId), rcDraw, rcDraw);
}
@@ -1102,13 +1102,13 @@ void __fastcall CSideBar::m_DefaultContentRenderer(const HDC hdc, const RECT *rc LONG cx = rcBox->right - rcBox->left;
LONG cy = rcBox->bottom - rcBox->top;
- if(id == IDC_SIDEBARUP || id == IDC_SIDEBARDOWN) {
+ if (id == IDC_SIDEBARUP || id == IDC_SIDEBARDOWN) {
::DrawIconEx(hdc, (rcBox->left + rcBox->right) / 2 - 8, (rcBox->top + rcBox->bottom) / 2 - 8, id == IDC_SIDEBARUP ? PluginConfig.g_buttonBarIcons[26] : PluginConfig.g_buttonBarIcons[16],
16, 16, 0, 0, DI_NORMAL);
if (!M->isAero() && stateID == PBS_HOT)
::DrawEdge(hdc, const_cast<RECT *>(rcBox), BDR_INNER, BF_RECT | BF_SOFT | BF_FLAT);
}
- else if(dat)
+ else if (dat)
item->renderIconAndNick(hdc, rcBox);
}
@@ -1127,12 +1127,12 @@ void __fastcall CSideBar::m_AdvancedContentRenderer(const HDC hdc, const RECT *r LONG cy = rcBox->bottom - rcBox->top;
SIZE szFirstLine, szSecondLine;
- if(id == IDC_SIDEBARUP || id == IDC_SIDEBARDOWN)
+ if (id == IDC_SIDEBARUP || id == IDC_SIDEBARDOWN)
m_DefaultContentRenderer(hdc, rcBox, item);
- else if(dat) {
+ else if (dat) {
RECT rc = *rcBox;
- if(dat->ace && dat->ace->hbmPic) { // we have an avatar
+ if (dat->ace && dat->ace->hbmPic) { // we have an avatar
double dNewHeight, dNewWidth;
LONG maxHeight = cy - 8;
bool fFree = false;
@@ -1148,7 +1148,7 @@ void __fastcall CSideBar::m_AdvancedContentRenderer(const HDC hdc, const RECT *r CMimAPI::m_MyAlphaBlend(hdc, xOff, yOff, (LONG)dNewWidth, (LONG)dNewHeight, dc, 0, 0, (LONG)dNewWidth, (LONG)dNewHeight, CSkin::m_default_bf);
::SelectObject(dc, hbmOld);
- if(hbmResized != dat->ace->hbmPic)
+ if (hbmResized != dat->ace->hbmPic)
::DeleteObject(hbmResized);
::DeleteDC(dc);
rc.right -= (maxHeight + 6);
@@ -1177,7 +1177,7 @@ void __fastcall CSideBar::m_AdvancedContentRenderer(const HDC hdc, const RECT *r CSkin::RenderText(hdc, dat->hThemeIP, dat->cache->getNick(), &rc,
dtFlags, CSkin::m_glowSize, CInfoPanel::m_ipConfig.clrs[IPFONTID_NICK]);
- if(fSecondLine) {
+ if (fSecondLine) {
int iSize;
HICON hIcon = dat->cache->getIcon(iSize);
@@ -1207,10 +1207,10 @@ const SIZE& __fastcall CSideBar::m_measureAdvancedVertical(CSideBarButton* item) SIZE sz = {0};
- if(dat) {
+ if (dat) {
SIZE szFirstLine, szSecondLine;
- if(dat->ace && dat->ace->hbmPic)
+ if (dat->ace && dat->ace->hbmPic)
sz.cy = item->getLayout()->width;
HDC dc = ::GetDC(dat->hwnd);
diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp index 0b72e80ccf..877734f49f 100644 --- a/plugins/TabSRMM/src/srmm.cpp +++ b/plugins/TabSRMM/src/srmm.cpp @@ -127,7 +127,7 @@ extern "C" int __declspec(dllexport) Unload(void) #if defined(__USE_EX_HANDLERS)
}
__except(CGlobals::Ex_ShowDialog(GetExceptionInformation(), __FILE__, __LINE__, L"SHUTDOWN_STAGE_UNLOAD", false)) {
- return(0);
+ return 0;
}
#endif
return iRet;
diff --git a/plugins/TabSRMM/src/tabctrl.cpp b/plugins/TabSRMM/src/tabctrl.cpp index 4f9827e733..10ac3c39e4 100644 --- a/plugins/TabSRMM/src/tabctrl.cpp +++ b/plugins/TabSRMM/src/tabctrl.cpp @@ -103,14 +103,14 @@ static int TabCtrl_TestForCloseButton(const TabControlData *tabdat, HWND hwnd, P ScreenToClient(hwnd, &tci.pt);
iTab = TabCtrl_HitTest(hwnd, &tci);
- if(iTab != -1) {
+ if (iTab != -1) {
RECT rcTab;
- if(tci.flags & TCHT_NOWHERE)
+ if (tci.flags & TCHT_NOWHERE)
return(-1);
TabCtrl_GetItemRect(hwnd, iTab, &rcTab);
- if(tabdat->dwStyle & TCS_BUTTONS) {
+ if (tabdat->dwStyle & TCS_BUTTONS) {
rcTab.right -= 1;
rcTab.left = rcTab.right - 18;
}
@@ -120,7 +120,7 @@ static int TabCtrl_TestForCloseButton(const TabControlData *tabdat, HWND hwnd, P }
rcTab.bottom -= 4;
rcTab.top += 4;
- if(PtInRect(&rcTab, tci.pt))
+ if (PtInRect(&rcTab, tci.pt))
return(iTab);
}
return(-1);
@@ -197,12 +197,12 @@ void TSAPI FillTabBackground(const HDC hdc, int iStateId, const TWindowData* dat {
unsigned clrIndex;
- if(dat && dat->mayFlashTab)
+ if (dat && dat->mayFlashTab)
clrIndex = 7;
else
clrIndex = (iStateId == PBS_PRESSED ? 5 : (iStateId == PBS_HOT ? 6 : 4));
- if(PluginConfig.tabConfig.colors[clrIndex] != PluginConfig.m_fillColor)
+ if (PluginConfig.tabConfig.colors[clrIndex] != PluginConfig.m_fillColor)
FillRect(hdc, rc, PluginConfig.tabConfig.m_brushes[clrIndex - 4]);
else
CSkin::FillBack(hdc, rc);
@@ -231,7 +231,7 @@ static void DrawItem(TabControlData *tabdat, HDC dc, RECT *rcItem, int nHint, in InflateRect(rcItem, -2, -2);
- if(dat->mayFlashTab)
+ if (dat->mayFlashTab)
clrIndex = 3;
else
clrIndex = (nHint & HINT_ACTIVE_ITEM ? 1 : (nHint & HINT_HOTTRACK ? 2 : 0));
@@ -272,8 +272,8 @@ static void DrawItem(TabControlData *tabdat, HDC dc, RECT *rcItem, int nHint, in rcItem->left += (iSize + 2 + tabdat->m_xpad);
- if(tabdat->fCloseButton) {
- if(tabdat->iHoveredCloseIcon != nItem)
+ if (tabdat->fCloseButton) {
+ if (tabdat->iHoveredCloseIcon != nItem)
CSkin::m_default_bf.SourceConstantAlpha = 150;
CMimAPI::m_MyAlphaBlend(dc, rcItem->right - 16 - tabdat->m_xpad, (rcItem->bottom + rcItem->top - 16) / 2, 16, 16, CSkin::m_tabCloseHDC,
@@ -324,12 +324,12 @@ static void DrawItemRect(struct TabControlData *tabdat, HDC dc, RECT *rcItem, in rcItem->top++;
rcItem->right += 6;
- if(tabdat->fAeroTabs) {
- if(M->isAero()) {
+ if (tabdat->fAeroTabs) {
+ if (M->isAero()) {
InflateRect(rcItem, 2, 0);
FillRect(dc, rcItem, CSkin::m_BrushBack);
}
- else if(dat) {
+ else if (dat) {
int iStateId = (nHint & HINT_ACTIVE_ITEM ? PBS_PRESSED : 0) | (nHint & HINT_HOTTRACK ? PBS_HOT : 0);
InflateRect(rcItem, 1, 0);
@@ -339,10 +339,10 @@ static void DrawItemRect(struct TabControlData *tabdat, HDC dc, RECT *rcItem, in CSkin::m_switchBarItem->Render(dc, rcItem, true);
- if(nHint & HINT_ACTIVE_ITEM || nHint & HINT_HOTTRACK) {
+ if (nHint & HINT_ACTIVE_ITEM || nHint & HINT_HOTTRACK) {
RECT rcGlow = *rcItem;
- if(dwStyle & TCS_BOTTOM)
+ if (dwStyle & TCS_BOTTOM)
rcGlow.top++;
else
rcGlow.bottom--;
@@ -351,7 +351,7 @@ static void DrawItemRect(struct TabControlData *tabdat, HDC dc, RECT *rcItem, in tabdat->helperGlowItem->Render(dc, &rcGlow, true);
}
}
- else if(bClassicDraw) {
+ else if (bClassicDraw) {
if (CSkin::m_skinEnabled) {
CSkinItem *item = nHint & HINT_ACTIVE_ITEM ? &SkinItems[ID_EXTBKBUTTONSPRESSED] : (nHint & HINT_HOTTRACK ? &SkinItems[ID_EXTBKBUTTONSMOUSEOVER] : &SkinItems[ID_EXTBKBUTTONSNPRESSED]);
@@ -370,7 +370,7 @@ b_nonskinned: DrawEdge(dc, rcItem, EDGE_RAISED, BF_RECT | BF_SOFT);
}
} else {
- if(M->isAero() && !(dwStyle & TCS_BOTTOM))
+ if (M->isAero() && !(dwStyle & TCS_BOTTOM))
FillRect(dc, rcItem, CSkin::m_BrushBack);
else
CSkin::FillBack(dc, rcItem);
@@ -463,25 +463,25 @@ static HRESULT DrawThemesPartWithAero(const TabControlData *tabdat, HDC hDC, int HRESULT hResult = 0;
bool fAero = M->isAero();
- if(tabdat->fAeroTabs) {
- if(tabdat->dwStyle & TCS_BOTTOM)
+ if (tabdat->fAeroTabs) {
+ if (tabdat->dwStyle & TCS_BOTTOM)
prcBox->top += (fAero ? 2 : iStateId == PBS_PRESSED ? (M->isVSThemed() ? 1 : -1) : 0);
else if (!fAero)
prcBox->bottom -= (iStateId == PBS_PRESSED ? (M->isVSThemed() ? 1 : -1) : 0);
- if(fAero)
+ if (fAero)
FillRect(hDC, prcBox, CSkin::m_BrushBack);
- else if(dat)
+ else if (dat)
FillTabBackground(hDC, iStateId, dat, prcBox);
tabdat->helperItem->setAlphaFormat(AC_SRC_ALPHA, iStateId == PBS_PRESSED ? 255 : (fAero ? 240 : 255));
tabdat->helperItem->Render(hDC, prcBox, true);
tabdat->helperGlowItem->setAlphaFormat(AC_SRC_ALPHA, iStateId == PBS_PRESSED ? 220 : 180);
- if(iStateId != PBS_NORMAL)
+ if (iStateId != PBS_NORMAL)
tabdat->helperGlowItem->Render(hDC, prcBox, true);
}
- else if(CMimAPI::m_pfnDrawThemeBackground) {
+ else if (CMimAPI::m_pfnDrawThemeBackground) {
if (tabdat->hTheme != 0)
hResult = CMimAPI::m_pfnDrawThemeBackground(tabdat->hTheme, hDC, iPartId, iStateId, prcBox, NULL);
}
@@ -535,7 +535,7 @@ static void DrawThemesXpTabItem(HDC pDC, int ixItem, RECT *rcItem, UINT uiFlag, if (!bBottom) {
if (bBody) {
- if(PluginConfig.m_bIsVista) {
+ if (PluginConfig.m_bIsVista) {
rcItem->right += 2; // hide right tab sheet shadow (only draw the actual border line)
rcItem->bottom += 1;
}
@@ -546,7 +546,7 @@ static void DrawThemesXpTabItem(HDC pDC, int ixItem, RECT *rcItem, UINT uiFlag, }
return;
}
- else if(tabdat->fAeroTabs && !bBody) {
+ else if (tabdat->fAeroTabs && !bBody) {
int iStateId = bSel ? 3 : (bHot ? 2 : 1); // leftmost item has different part id
DrawThemesPartWithAero(tabdat, pDC, rcItem->left < 20 ? 2 : 1, iStateId, rcItem, dat);
return;
@@ -638,7 +638,7 @@ static void DrawThemesXpTabItem(HDC pDC, int ixItem, RECT *rcItem, UINT uiFlag, CImageItem tempItem(10, 10, 10, 10, hdcTemp, 0, IMAGE_FLAG_DIVIDED | IMAGE_FILLSOLID,
GetSysColorBrush(COLOR_3DFACE), 255, 30, 80, 50, 100);
- if(PluginConfig.m_bIsVista) { // hide right tab sheet shadow (only draw the actual border line)
+ if (PluginConfig.m_bIsVista) { // hide right tab sheet shadow (only draw the actual border line)
rcItem->right += 2;
}
@@ -782,7 +782,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara }
break;
case WM_NCDESTROY:
- if(tabdat) {
+ if (tabdat) {
mir_free(tabdat);
SetWindowLongPtr(hwnd, GWLP_USERDATA, 0L);
}
@@ -807,7 +807,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara tabdat->fTipActive = FALSE;
}
KillTimer(hwnd, TIMERID_HOVER_T);
- if(tabdat->pContainer && (!tabdat->pContainer->SideBar->isActive() && (TabCtrl_GetItemCount(hwnd) > 1 || !(tabdat->pContainer->dwFlags & CNT_HIDETABS))))
+ if (tabdat->pContainer && (!tabdat->pContainer->SideBar->isActive() && (TabCtrl_GetItemCount(hwnd) > 1 || !(tabdat->pContainer->dwFlags & CNT_HIDETABS))))
SetTimer(hwnd, TIMERID_HOVER_T, 750, 0);
break;
}
@@ -929,11 +929,11 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara }
}
}
- if(tabdat->fCloseButton) {
+ if (tabdat->fCloseButton) {
POINT pt;
GetCursorPos(&pt);
- if(TabCtrl_TestForCloseButton(tabdat, hwnd, pt) != -1)
+ if (TabCtrl_TestForCloseButton(tabdat, hwnd, pt) != -1)
return(TRUE);
}
}
@@ -959,13 +959,13 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara ScreenToClient(hwnd, &tci.pt);
ImageList_DragMove(tci.pt.x, tci.pt.y);
}
- if(tabdat->fCloseButton) {
+ if (tabdat->fCloseButton) {
POINT pt;
GetCursorPos(&pt);
int iOldHovered = tabdat->iHoveredCloseIcon;
tabdat->iHoveredCloseIcon = TabCtrl_TestForCloseButton(tabdat, hwnd, pt);
- if(tabdat->iHoveredCloseIcon != iOldHovered)
+ if (tabdat->iHoveredCloseIcon != iOldHovered)
InvalidateRect(hwnd, NULL, FALSE);
}
}
@@ -995,12 +995,12 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara tabdat->himlDrag = 0;
}
}
- if(tabdat->fCloseButton) {
+ if (tabdat->fCloseButton) {
POINT pt;
GetCursorPos(&pt);
int iItem = TabCtrl_TestForCloseButton(tabdat, hwnd, pt);
- if(iItem != -1)
+ if (iItem != -1)
SendMessage(GetParent(hwnd), DM_CLOSETABATMOUSE, 0, (LPARAM)&pt);
}
}
@@ -1009,7 +1009,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara case WM_ERASEBKGND:
if (tabdat->pContainer && (CSkin::m_skinEnabled || M->isAero()))
return TRUE;
- return(0);
+ return 0;
case WM_PAINT: {
PAINTSTRUCT ps;
HDC hdcreal, hdc;
@@ -1029,7 +1029,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara bool isAero = M->isAero();
HANDLE hpb = 0;
BOOL bClassicDraw = !isAero && (tabdat->m_VisualStyles == FALSE || CSkin::m_skinEnabled);
- if(GetUpdateRect(hwnd, NULL, TRUE) == 0)
+ if (GetUpdateRect(hwnd, NULL, TRUE) == 0)
break;
item.mask = TCIF_PARAM;
@@ -1039,9 +1039,9 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara tabdat->helperDat = 0;
- if(tabdat->fAeroTabs && tabdat->pContainer) {
+ if (tabdat->fAeroTabs && tabdat->pContainer) {
TWindowData *dat = (TWindowData *)GetWindowLongPtr(tabdat->pContainer->hwndActive, GWLP_USERDATA);
- if(dat) {
+ if (dat) {
tabdat->helperDat = dat;
}
else
@@ -1062,10 +1062,10 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara */
if ((tabdat->pContainer->dwFlags & CNT_SIDEBAR) || (nCount == 1 && tabdat->pContainer->dwFlags & CNT_HIDETABS)) {
- if(nCount == 0)
+ if (nCount == 0)
FillRect(hdcreal, &ps.rcPaint, GetSysColorBrush(COLOR_3DFACE)); // avoid flickering/ugly black background during container creation
EndPaint(hwnd, &ps);
- return(0);
+ return 0;
}
GetClientRect(hwnd, &rctPage);
@@ -1079,7 +1079,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara * draw everything to a memory dc to avoid flickering
*/
- if(CMimAPI::m_haveBufferedPaint)
+ if (CMimAPI::m_haveBufferedPaint)
hpb = tabdat->hbp = CSkin::InitiateBufferedPaint(hdcreal, rctPage, hdc);
else {
hdc = CreateCompatibleDC(hdcreal);
@@ -1139,7 +1139,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara uiFlags |= uiBottom;
} else
rcClient.top = rctPage.top;
- if(PluginConfig.m_fillColor)
+ if (PluginConfig.m_fillColor)
DrawCustomTabPage(hdc, rcClient);
else
DrawThemesXpTabItem(hdc, -1, &rcClient, uiFlags, tabdat, 0); // TABP_PANE=9,0,'TAB'
@@ -1169,7 +1169,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara rectTemp.bottom--;
rectTemp.top++;
}
- if(PluginConfig.m_fillColor)
+ if (PluginConfig.m_fillColor)
DrawCustomTabPage(hdc, rectTemp);
else {
MoveToEx(hdc, rectTemp.left, rectTemp.bottom, &pt);
@@ -1181,7 +1181,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara }
} else {
rectTemp = rctPage;
- if(PluginConfig.m_fillColor)
+ if (PluginConfig.m_fillColor)
DrawCustomTabPage(hdc, rectTemp);
else {
MoveToEx(hdc, rectTemp.left, rectTemp.bottom - 1, &pt);
@@ -1236,12 +1236,12 @@ page_done: * if aero is active _and_ the infopanel is visible in the current window, we "flatten" out the top area
* of the tab page by overpainting it black (thus it will appear transparent)
*/
- if(isAero && tabdat->helperDat) {
+ if (isAero && tabdat->helperDat) {
RECT rcLog, rcPage;
POINT pt;
GetClientRect(hwnd, &rcPage);
- if(dwStyle & TCS_BOTTOM) {
+ if (dwStyle & TCS_BOTTOM) {
GetWindowRect(tabdat->helperDat->hwnd, &rcLog);
pt.y = rcLog.bottom;
pt.x = rcLog.left;
@@ -1275,7 +1275,7 @@ page_done: if (i != iActive) {
TabCtrl_GetItem(hwnd, i, &item);
- if(item.lParam)
+ if (item.lParam)
dat = (TWindowData *)GetWindowLongPtr((HWND)item.lParam, GWLP_USERDATA);
TabCtrl_GetItemRect(hwnd, i, &rcItem);
if (!bClassicDraw && uiBottom) {
@@ -1288,7 +1288,7 @@ page_done: DrawThemesXpTabItem(hdc, i, &rcItem, uiFlags | uiBottom | (i == hotItem ? 4 : 0), tabdat, dat);
DrawItem(tabdat, hdc, &rcItem, nHint | (i == hotItem ? HINT_HOTTRACK : 0), i, dat);
} else {
- if(tabdat->fAeroTabs && !CSkin::m_skinEnabled && !(dwStyle & TCS_BUTTONS))
+ if (tabdat->fAeroTabs && !CSkin::m_skinEnabled && !(dwStyle & TCS_BUTTONS))
DrawThemesPartWithAero(tabdat, hdc, 0, (i == hotItem ? PBS_HOT : PBS_NORMAL), &rcItem, dat);
else
DrawItemRect(tabdat, hdc, &rcItem, nHint | (i == hotItem ? HINT_HOTTRACK : 0), i, dat);
@@ -1310,7 +1310,7 @@ page_done: rcItem = rctActive;
TabCtrl_GetItem(hwnd, iActive, &item);
- if(item.lParam)
+ if (item.lParam)
dat = (TWindowData *)GetWindowLongPtr((HWND)item.lParam, GWLP_USERDATA);
if (!bClassicDraw && !(dwStyle & TCS_BUTTONS)) {
@@ -1325,8 +1325,8 @@ page_done: } else
InflateRect(&rcItem, 2, 0);
}
- if(tabdat->fAeroTabs && !CSkin::m_skinEnabled && !(dwStyle & TCS_BUTTONS)) {
- if(dwStyle & TCS_BOTTOM)
+ if (tabdat->fAeroTabs && !CSkin::m_skinEnabled && !(dwStyle & TCS_BUTTONS)) {
+ if (dwStyle & TCS_BOTTOM)
rcItem.bottom+= 2;
else
rcItem.top-= 2;
@@ -1348,7 +1348,7 @@ skip_tabs: if (!tabdat->bRefreshWithoutClip)
ExcludeClipRect(hdcreal, rctClip.left, rctClip.top, rctClip.right, rctClip.bottom);
- if(hpb)
+ if (hpb)
CSkin::FinalizeBufferedPaint(hpb, &rctOrig);
//CMimAPI::m_pfnEndBufferedPaint(hpb, TRUE);
else {
@@ -1455,20 +1455,20 @@ void TSAPI FreeTabConfig() {
int i;
- if(PluginConfig.tabConfig.m_hPenItemShadow)
+ if (PluginConfig.tabConfig.m_hPenItemShadow)
DeleteObject(PluginConfig.tabConfig.m_hPenItemShadow);
- if(PluginConfig.tabConfig.m_hPenLight)
+ if (PluginConfig.tabConfig.m_hPenLight)
DeleteObject(PluginConfig.tabConfig.m_hPenLight);
- if(PluginConfig.tabConfig.m_hPenShadow)
+ if (PluginConfig.tabConfig.m_hPenShadow)
DeleteObject(PluginConfig.tabConfig.m_hPenShadow);
- if(PluginConfig.tabConfig.m_hMenuFont)
+ if (PluginConfig.tabConfig.m_hMenuFont)
DeleteObject(PluginConfig.tabConfig.m_hMenuFont);
for(i = 0; i < 4; i++) {
- if(PluginConfig.tabConfig.m_brushes[i]) {
+ if (PluginConfig.tabConfig.m_brushes[i]) {
DeleteObject(PluginConfig.tabConfig.m_brushes[i]);
PluginConfig.tabConfig.m_brushes[i] = 0;
}
@@ -1580,7 +1580,7 @@ INT_PTR CALLBACK DlgProcTabConfig(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM break;
}
- if(tconfig_init)
+ if (tconfig_init)
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
diff --git a/plugins/TabSRMM/src/taskbar.cpp b/plugins/TabSRMM/src/taskbar.cpp index e01414aedb..a30dbd8727 100644 --- a/plugins/TabSRMM/src/taskbar.cpp +++ b/plugins/TabSRMM/src/taskbar.cpp @@ -153,7 +153,7 @@ LONG CTaskbarInteract::updateMetrics() */
void CTaskbarInteract::registerTab(const HWND hwndTab, const HWND hwndContainer) const
{
- if(m_isEnabled) {
+ if (m_isEnabled) {
m_pTaskbarInterface->RegisterTab(hwndTab, hwndContainer);
m_pTaskbarInterface->SetTabOrder(hwndTab, 0);
}
@@ -166,7 +166,7 @@ void CTaskbarInteract::registerTab(const HWND hwndTab, const HWND hwndContainer) */
void CTaskbarInteract::unRegisterTab(const HWND hwndTab) const
{
- if(m_isEnabled)
+ if (m_isEnabled)
m_pTaskbarInterface->UnregisterTab(hwndTab);
}
@@ -182,7 +182,7 @@ void CTaskbarInteract::unRegisterTab(const HWND hwndTab) const */
void CTaskbarInteract::SetTabActive(const HWND hwndTab, const HWND hwndGroup) const
{
- if(m_isEnabled)
+ if (m_isEnabled)
m_pTaskbarInterface->SetTabActive(hwndTab, hwndGroup, 0);
}
@@ -196,7 +196,7 @@ void CTaskbarInteract::SetTabActive(const HWND hwndTab, const HWND hwndGroup) co */
void CProxyWindow::add(TWindowData *dat)
{
- if(PluginConfig.m_bIsWin7 && PluginConfig.m_useAeroPeek) // && (!CSkin::m_skinEnabled || M->GetByte("forceAeroPeek", 0)))
+ if (PluginConfig.m_bIsWin7 && PluginConfig.m_useAeroPeek) // && (!CSkin::m_skinEnabled || M->GetByte("forceAeroPeek", 0)))
dat->pWnd = new CProxyWindow(dat);
else
dat->pWnd = 0;
@@ -212,10 +212,10 @@ void CProxyWindow::add(TWindowData *dat) */
void CProxyWindow::verify(TWindowData *dat)
{
- if(PluginConfig.m_bIsWin7 && PluginConfig.m_useAeroPeek) {
- if(0 == dat->pWnd) {
+ if (PluginConfig.m_bIsWin7 && PluginConfig.m_useAeroPeek) {
+ if (0 == dat->pWnd) {
dat->pWnd = new CProxyWindow(dat);
- if(dat->pWnd) {
+ if (dat->pWnd) {
dat->pWnd->updateIcon(dat->hTabStatusIcon);
dat->pWnd->updateTitle(dat->cache->getNick());
}
@@ -227,7 +227,7 @@ void CProxyWindow::verify(TWindowData *dat) * this should not happens, but who knows...
*/
else {
- if(dat->pWnd) {
+ if (dat->pWnd) {
delete dat->pWnd;
dat->pWnd = 0;
}
@@ -252,7 +252,7 @@ CProxyWindow::CProxyWindow(const TWindowData *dat) _DebugTraceW(_T("create proxy object for: %s"), m_dat->cache->getNick());
#endif
Win7Taskbar->registerTab(m_hwndProxy, m_dat->pContainer->hwnd);
- if(CMimAPI::m_pfnDwmSetWindowAttribute) {
+ if (CMimAPI::m_pfnDwmSetWindowAttribute) {
BOOL fIconic = TRUE;
BOOL fHasIconicBitmap = TRUE;
@@ -269,7 +269,7 @@ CProxyWindow::~CProxyWindow() #if defined(__LOGDEBUG_)
_DebugTraceW(_T("destroy proxy object for: %s"), m_dat->cache->getNick());
#endif
- if(m_thumb) {
+ if (m_thumb) {
delete m_thumb;
m_thumb = 0;
}
@@ -282,7 +282,7 @@ CProxyWindow::~CProxyWindow() void CProxyWindow::verifyDwmState()
{
if (!M->isDwmActive()) {
- if(m_thumb) {
+ if (m_thumb) {
delete m_thumb;
m_thumb = 0;
}
@@ -305,20 +305,20 @@ void CProxyWindow::verifyDwmState() */
void CProxyWindow::sendThumb(LONG width, LONG height)
{
- if(0 == m_thumb) {
+ if (0 == m_thumb) {
m_width = width;
m_height = height;
- if(m_dat->bType == SESSIONTYPE_IM)
+ if (m_dat->bType == SESSIONTYPE_IM)
m_thumb = new CThumbIM(this);
else
m_thumb = new CThumbMUC(this);
}
- else if(width != m_width || height != m_height || !m_thumb->isValid()) {
+ else if (width != m_width || height != m_height || !m_thumb->isValid()) {
m_width = width;
m_height = height;
m_thumb->update();
}
- if(m_thumb)
+ if (m_thumb)
CMimAPI::m_pfnDwmSetIconicThumbnail(m_hwndProxy, m_thumb->getHBM(), DWM_SIT_DISPLAYFRAME);
}
@@ -342,12 +342,12 @@ void CProxyWindow::sendPreview() bool fIsChat = m_dat->bType == SESSIONTYPE_IM ? false : true;
TWindowData* dat_active = reinterpret_cast<TWindowData *>(::GetWindowLongPtr(m_dat->pContainer->hwndActive, GWLP_USERDATA));
- if(m_thumb && dat_active) {
+ if (m_thumb && dat_active) {
HWND hwndRich = ::GetDlgItem(m_dat->hwnd, fIsChat ? IDC_CHAT_LOG : IDC_LOG);
LONG cx, cy;
POINT ptOrigin = {0}, ptBottom;
- if(m_dat->dwFlags & MWF_NEEDCHECKSIZE) {
+ if (m_dat->dwFlags & MWF_NEEDCHECKSIZE) {
RECT rcClient;
::SendMessage(m_dat->pContainer->hwnd, DM_QUERYCLIENTAREA, 0, (LPARAM)&rcClient);
@@ -410,9 +410,9 @@ void CProxyWindow::sendPreview() ::FillRect(hdcRich, &rcRich, br);
::DeleteObject(br);
- if(m_dat->hwndIEView)
+ if (m_dat->hwndIEView)
::SendMessage(m_dat->hwndIEView, WM_PRINT, reinterpret_cast<WPARAM>(hdcRich), PRF_CLIENT | PRF_NONCLIENT);
- else if(m_dat->hwndHPP) {
+ else if (m_dat->hwndHPP) {
CSkin::RenderText(hdcRich, m_dat->hTheme, TranslateT("Previews not availble when using History++ plugin for message log display."),
&rcRich, DT_VCENTER | DT_CENTER | DT_WORDBREAK, 10, m_dat->pContainer->theme.fontColors[MSGFONTID_MYMSG], false);
}
@@ -440,7 +440,7 @@ void CProxyWindow::sendPreview() ::SelectObject(hdc, hbmOld);
::DeleteDC(hdc);
- if(CSkin::m_skinEnabled && CSkin::m_frameSkins) {
+ if (CSkin::m_skinEnabled && CSkin::m_frameSkins) {
pt.x = CSkin::m_SkinnedFrame_left;
pt.y = CSkin::m_SkinnedFrame_caption + CSkin::m_SkinnedFrame_bottom;
}
@@ -465,7 +465,7 @@ void CProxyWindow::sendPreview() void CProxyWindow::setBigIcon(const HICON hIcon, bool fInvalidate)
{
m_hBigIcon = hIcon;
- if(fInvalidate)
+ if (fInvalidate)
Invalidate();
}
@@ -481,7 +481,7 @@ void CProxyWindow::setBigIcon(const HICON hIcon, bool fInvalidate) void CProxyWindow::setOverlayIcon(const HICON hIcon, bool fInvalidate)
{
m_hOverlayIcon = hIcon;
- if(fInvalidate)
+ if (fInvalidate)
Invalidate();
}
@@ -491,7 +491,7 @@ void CProxyWindow::setOverlayIcon(const HICON hIcon, bool fInvalidate) */
void CProxyWindow::updateIcon(const HICON hIcon) const
{
- if(m_hwndProxy && hIcon)
+ if (m_hwndProxy && hIcon)
::SendMessage(m_hwndProxy, WM_SETICON, ICON_SMALL, reinterpret_cast<LPARAM>(hIcon));
}
@@ -515,7 +515,7 @@ void CProxyWindow::activateTab() const */
void CProxyWindow::Invalidate() const
{
- if(m_thumb) {
+ if (m_thumb) {
m_thumb->setValid(false);
/*
* tell the DWM to request a new thumbnail for the proxy window m_hwnd
@@ -531,7 +531,7 @@ void CProxyWindow::Invalidate() const */
void CProxyWindow::updateTitle(const TCHAR *tszTitle) const
{
- if(m_hwndProxy && tszTitle)
+ if (m_hwndProxy && tszTitle)
::SetWindowText(m_hwndProxy, tszTitle);
}
@@ -545,7 +545,7 @@ LRESULT CALLBACK CProxyWindow::stubWndProc(HWND hWnd, UINT msg, WPARAM wParam, L {
CProxyWindow* pWnd = reinterpret_cast<CProxyWindow *>(::GetWindowLongPtr(hWnd, GWLP_USERDATA));
- if(pWnd)
+ if (pWnd)
return(pWnd->wndProc(hWnd, msg, wParam, lParam));
switch(msg) {
@@ -576,13 +576,13 @@ LRESULT CALLBACK CProxyWindow::wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARA case WM_CLOSE: {
TContainerData* pC = m_dat->pContainer;
- if(m_dat->hwnd != pC->hwndActive)
+ if (m_dat->hwnd != pC->hwndActive)
SendMessage(m_dat->hwnd, WM_CLOSE, 1, 3);
else
SendMessage(m_dat->hwnd, WM_CLOSE, 1, 2);
if (!IsIconic(pC->hwnd))
SetForegroundWindow(pC->hwnd);
- return(0);
+ return 0;
}
/*
@@ -590,10 +590,10 @@ LRESULT CALLBACK CProxyWindow::wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARA * to the real message window.
*/
case WM_ACTIVATE:
- if(WA_ACTIVE == wParam) {
- if(IsWindow(m_dat->hwnd))
+ if (WA_ACTIVE == wParam) {
+ if (IsWindow(m_dat->hwnd))
::PostMessage(m_dat->hwnd, DM_ACTIVATEME, 0, 0);
- return(0); // no default processing, avoid flickering.
+ return 0; // no default processing, avoid flickering.
}
break;
@@ -606,11 +606,11 @@ LRESULT CALLBACK CProxyWindow::wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARA case WM_DWMSENDICONICTHUMBNAIL:
sendThumb(HIWORD(lParam), LOWORD(lParam));
- return(0);
+ return 0;
case WM_DWMSENDICONICLIVEPREVIEWBITMAP:
sendPreview();
- return(0);
+ return 0;
default:
break;
@@ -657,7 +657,7 @@ void CThumbBase::renderBase() m_rc.bottom = m_height;
m_rc.left = m_rc.top = 0;
- if(m_hbmThumb) {
+ if (m_hbmThumb) {
::DeleteObject(m_hbmThumb);
m_hbmThumb = 0;
}
@@ -687,9 +687,9 @@ void CThumbBase::renderBase() setupRect();
hIcon = m_pWnd->getBigIcon();
- if(0 == hIcon) {
- if(m_dat->dwUnread) {
- if(PluginConfig.g_IconMsgEventBig)
+ if (0 == hIcon) {
+ if (m_dat->dwUnread) {
+ if (PluginConfig.g_IconMsgEventBig)
hIcon = PluginConfig.g_IconMsgEventBig;
else {
hIcon = PluginConfig.g_IconMsgEvent;
@@ -698,7 +698,7 @@ void CThumbBase::renderBase() }
else {
hIcon = reinterpret_cast<HICON>(LoadSkinnedProtoIconBig(m_dat->cache->getActiveProto(), m_dat->cache->getActiveStatus()));
- if(0 == hIcon || reinterpret_cast<HICON>(CALLSERVICE_NOTFOUND) == hIcon) {
+ if (0 == hIcon || reinterpret_cast<HICON>(CALLSERVICE_NOTFOUND) == hIcon) {
hIcon = reinterpret_cast<HICON>(LoadSkinnedProtoIcon(m_dat->cache->getActiveProto(), m_dat->cache->getActiveStatus()));
lIconSize = 16;
}
@@ -706,12 +706,12 @@ void CThumbBase::renderBase() }
::DrawIconEx(m_hdc, m_rcIcon.right / 2 - lIconSize / 2, m_rcIcon.top, hIcon, lIconSize, lIconSize, 0, 0, DI_NORMAL);
hIcon = m_pWnd->getOverlayIcon();
- if(hIcon)
+ if (hIcon)
::DrawIconEx(m_hdc, m_rcIcon.right - 16, m_rcIcon.top + 16, hIcon, 16, 16, 0, 0, DI_NORMAL);
m_rcIcon.top += (lIconSize + 3);
CSkin::RenderText(m_hdc, m_dat->hTheme, m_dat->szStatus, &m_rcIcon, m_dtFlags | DT_CENTER | DT_WORD_ELLIPSIS, 10, 0, true);
- if(m_dat->dwUnread && SESSIONTYPE_IM == m_dat->bType) {
+ if (m_dat->dwUnread && SESSIONTYPE_IM == m_dat->bType) {
wchar_t tszTemp[30];
m_rcIcon.top += m_sz.cy;
@@ -730,7 +730,7 @@ void CThumbBase::renderBase() */
void CThumbBase::setupRect()
{
- if(SESSIONTYPE_IM == m_pWnd->getDat()->bType) {
+ if (SESSIONTYPE_IM == m_pWnd->getDat()->bType) {
m_rcTop = m_rc;
m_rcBottom = m_rc;
m_rcBottom.top = m_rc.bottom - ( 2 * (m_rcBottom.bottom / 5)) - 2;
@@ -756,7 +756,7 @@ void CThumbBase::setupRect() */
CThumbBase::~CThumbBase()
{
- if(m_hbmThumb) {
+ if (m_hbmThumb) {
::DeleteObject(m_hbmThumb);
m_hbmThumb = 0;
m_isValid = false;
@@ -822,7 +822,7 @@ void CThumbIM::renderContent() ::DeleteObject(hRgn);
::SelectObject(dc, hbmOldAv);
- if(hbmResized != hbmAvatar)
+ if (hbmResized != hbmAvatar)
::DeleteObject(hbmResized);
::DeleteDC(dc);
@@ -837,7 +837,7 @@ void CThumbIM::renderContent() m_rcBottom.bottom -= ((m_rcBottom.bottom - m_rcBottom.top) % m_sz.cy); // adjust to a multiple of line height
- if(0 == (tszStatusMsg = m_dat->cache->getStatusMsg()))
+ if (0 == (tszStatusMsg = m_dat->cache->getStatusMsg()))
tszStatusMsg = TranslateT("No status message");
CSkin::RenderText(m_hdc, m_dat->hTheme, tszStatusMsg, &m_rcBottom, DT_WORD_ELLIPSIS | DT_END_ELLIPSIS | m_dtFlags, 10, 0, true);
@@ -852,7 +852,7 @@ void CThumbIM::renderContent() * m_hbm is deleted when a new thumbnail is generated on dwm's request.
* this is not a leak!
*/
- if(m_hOldFont)
+ if (m_hOldFont)
::SelectObject(m_hdc, m_hOldFont);
::SelectObject(m_hdc, m_hbmOld);
@@ -887,18 +887,18 @@ void CThumbMUC::update() */
void CThumbMUC::renderContent()
{
- if(m_dat->si) {
+ if (m_dat->si) {
const MODULEINFO* mi = MM_FindModule(m_dat->si->pszModule);
wchar_t szTemp[250];
const wchar_t* szStatusMsg = 0;
- if(mi) {
- if(m_dat->dwUnread) {
+ if (mi) {
+ if (m_dat->dwUnread) {
mir_sntprintf(szTemp, 30, TranslateT("%d Unread"), m_dat->dwUnread);
CSkin::RenderText(m_hdc, m_dat->hTheme, szTemp, &m_rcIcon, m_dtFlags | DT_SINGLELINE | DT_RIGHT, 10, 0, true);
m_rcIcon.top += m_sz.cy;
}
- if(m_dat->si->iType != GCW_SERVER) {
+ if (m_dat->si->iType != GCW_SERVER) {
wchar_t* _p = NULL;
if ( m_dat->si->ptszStatusbarText )
_p = wcschr(m_dat->si->ptszStatusbarText, ']');
@@ -919,7 +919,7 @@ void CThumbMUC::renderContent() else {
mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("Server window"));
CSkin::RenderText(m_hdc, m_dat->hTheme, szTemp, &m_rcIcon, m_dtFlags | DT_SINGLELINE | DT_RIGHT, 10, 0, true);
- if(mi->tszIdleMsg[0] && _tcslen(mi->tszIdleMsg) > 2) {
+ if (mi->tszIdleMsg[0] && _tcslen(mi->tszIdleMsg) > 2) {
m_rcIcon.top += m_sz.cy;
CSkin::RenderText(m_hdc, m_dat->hTheme, &mi->tszIdleMsg[2], &m_rcIcon, m_dtFlags | DT_SINGLELINE | DT_RIGHT, 10, 0, true);
}
@@ -931,11 +931,11 @@ void CThumbMUC::renderContent() m_rcBottom.bottom -= ((m_rcBottom.bottom - m_rcBottom.top) % m_sz.cy); // adjust to a multiple of line height
- if(m_dat->si->iType != GCW_SERVER) {
- if(0 == (szStatusMsg = m_dat->si->ptszTopic))
+ if (m_dat->si->iType != GCW_SERVER) {
+ if (0 == (szStatusMsg = m_dat->si->ptszTopic))
szStatusMsg = TranslateT("no topic set.");
}
- else if(mi) {
+ else if (mi) {
mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("%s on %s%s"), m_dat->szMyNickname, mi->ptszModDispName, L"");
szStatusMsg = szTemp;
}
@@ -948,7 +948,7 @@ void CThumbMUC::renderContent() * m_hbm is deleted when a new thumbnail is generated on dwm's request.
* this is not a leak!
*/
- if(m_hOldFont)
+ if (m_hOldFont)
::SelectObject(m_hdc, m_hOldFont);
::SelectObject(m_hdc, m_hbmOld);
diff --git a/plugins/TabSRMM/src/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp index b5998c2fe9..031d6d88be 100644 --- a/plugins/TabSRMM/src/themeio.cpp +++ b/plugins/TabSRMM/src/themeio.cpp @@ -329,7 +329,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in GetPrivateProfileIntA(_extSettings[i].szIniSection, _extSettings[i].szIniName, _extSettings[i].dwDef, szIniFilename));
}
- if(version >= 5) {
+ if (version >= 5) {
for(i = 0; i < safe_sizeof(_extSettings_v5); i++) {
M->WriteDword(_extSettings_v5[i].szDbModule, _extSettings_v5[i].szDbSetting,
GetPrivateProfileIntA(_extSettings_v5[i].szIniSection, _extSettings_v5[i].szIniName, _extSettings_v5[i].dwDef, szIniFilename));
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index 6ad5700dd0..031eec0328 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -666,7 +666,7 @@ void __fastcall CImageItem::Render(const HDC hdc, const RECT *rc, bool fIgnoreGl hdcSrc = CreateCompatibleDC(hdc);
hbmOld = (HBITMAP)SelectObject(hdcSrc, isGlyph ? Skin->getGlyphItem()->getHbm() : m_hbm);
} else {
- if(fIgnoreGlyph)
+ if (fIgnoreGlyph)
hdcSrc = m_hdc;
else
hdcSrc = isGlyph ? Skin->getGlyphItem()->getDC() : m_hdc;
@@ -883,7 +883,7 @@ TCHAR* CImageItem::Read(const TCHAR *szFilename) m_dwFlags |= IMAGE_PERPIXEL_ALPHA;
m_bf.AlphaFormat = AC_SRC_ALPHA;
if (m_inner_height <= 0 || m_inner_width <= 0) {
- if(szFinalName) {
+ if (szFinalName) {
delete[] szFinalName;
szFinalName = 0;
}
@@ -925,14 +925,14 @@ TCHAR* CImageItem::Read(const TCHAR *szFilename) */
void CImageItem::Free()
{
- if(m_hdc ) {
+ if (m_hdc ) {
::SelectObject(m_hdc, m_hbmOld);
::DeleteDC(m_hdc);
}
- if(m_hbm)
+ if (m_hbm)
::DeleteObject(m_hbm);
- if(m_fillBrush)
+ if (m_fillBrush)
::DeleteObject(m_fillBrush);
ZeroMemory(this, sizeof(CImageItem));
@@ -1067,7 +1067,7 @@ HBITMAP TSAPI CImageItem::LoadPNG(const TCHAR *szFilename) void CSkin::setFileName()
{
DBVARIANT dbv;
- if(0 == M->GetTString(0, SRMSGMOD_T, "ContainerSkin", &dbv)) {
+ if (0 == M->GetTString(0, SRMSGMOD_T, "ContainerSkin", &dbv)) {
M->pathToAbsolute(dbv.ptszVal, m_tszFileName, M->getSkinPath());
m_tszFileName[MAX_PATH - 1] = 0;
DBFreeVariant(&dbv);
@@ -1101,7 +1101,7 @@ void CSkin::Init(bool fStartup) setFileName();
m_aeroEffect = M->GetDword("aerostyle", AERO_EFFECT_MILK);
- if(m_fLoadOnStartup && fStartup)
+ if (m_fLoadOnStartup && fStartup)
Load();
}
@@ -1133,27 +1133,27 @@ bool CSkin::warnToClose() const */
void CSkin::UnloadAeroTabs()
{
- if(m_tabTop) {
+ if (m_tabTop) {
delete m_tabTop;
m_tabTop = NULL;
}
- if(m_tabBottom) {
+ if (m_tabBottom) {
delete m_tabBottom;
m_tabBottom = NULL;
}
- if(m_tabGlowTop) {
+ if (m_tabGlowTop) {
delete m_tabGlowTop;
m_tabGlowTop = NULL;
}
- if(m_tabGlowBottom) {
+ if (m_tabGlowBottom) {
delete m_tabGlowBottom;
m_tabGlowTop = NULL;
}
- if(m_switchBarItem) {
+ if (m_switchBarItem) {
delete m_switchBarItem;
m_switchBarItem = NULL;
}
@@ -1175,7 +1175,7 @@ void CSkin::Unload() * delete all image items
*/
- if(warnToClose() == false)
+ if (warnToClose() == false)
return; // do nothing when user decides to not close any window
m_skinEnabled = m_frameSkins = false;
@@ -1189,18 +1189,18 @@ void CSkin::Unload() m_ImageItems = 0;
m_glyphItem.Free();
- if(m_ContainerColorKeyBrush)
+ if (m_ContainerColorKeyBrush)
::DeleteObject(m_ContainerColorKeyBrush);
- if(m_MenuBGBrush)
+ if (m_MenuBGBrush)
::DeleteObject(m_MenuBGBrush);
m_ContainerColorKeyBrush = m_MenuBGBrush = 0;
- if(m_SkinLightShadowPen)
+ if (m_SkinLightShadowPen)
::DeleteObject(m_SkinLightShadowPen);
m_SkinLightShadowPen = 0;
- if(m_SkinDarkShadowPen)
+ if (m_SkinDarkShadowPen)
::DeleteObject(m_SkinDarkShadowPen);
m_SkinDarkShadowPen = 0;
@@ -1227,17 +1227,17 @@ void CSkin::Unload() m_ContainerColorKeyBrush = m_MenuBGBrush = 0;
m_skinEnabled = m_frameSkins = false;
- if(m_closeIcon)
+ if (m_closeIcon)
::DestroyIcon(m_closeIcon);
- if(m_maxIcon)
+ if (m_maxIcon)
::DestroyIcon(m_maxIcon);
- if(m_minIcon)
+ if (m_minIcon)
::DestroyIcon(m_minIcon);
m_closeIcon = m_maxIcon = m_minIcon = 0;
for(i = 0; i < m_nrSkinIcons; i++) {
- if(m_skinIcons[i].phIcon )
+ if (m_skinIcons[i].phIcon )
::DestroyIcon(*(m_skinIcons[i].phIcon));
}
M->getAeroState(); // refresh after unload
@@ -1377,7 +1377,7 @@ void CSkin::ReadImageItem(const TCHAR *itemname) for (int i = 0; i <= ID_EXTBK_LAST; i++) {
if (!_tcsicmp(SkinItems[i].szName[0] == '{' ? &SkinItems[i].szName[3] : SkinItems[i].szName, buffer)) {
if (!(tmpItem.getFlags() & IMAGE_GLYPH)) {
- if(szImageFileName)
+ if (szImageFileName)
tmpItem.Create(szImageFileName);
else {
tmpItem.Clear();
@@ -1401,7 +1401,7 @@ void CSkin::ReadImageItem(const TCHAR *itemname) }
}
tmpItem.Clear();
- if(szImageFileName)
+ if (szImageFileName)
delete szImageFileName;
}
@@ -1634,17 +1634,17 @@ create_it: */
void CSkin::Load(void)
{
- if(warnToClose() == false)
+ if (warnToClose() == false)
return;
- if(m_skinEnabled) {
+ if (m_skinEnabled) {
Unload();
m_skinEnabled = false;
}
m_fHaveGlyph = false;
- if(m_tszFileName[0]) {
+ if (m_tszFileName[0]) {
if (::PathFileExists(m_tszFileName)) {
TCHAR *p;
TCHAR *szSections = (TCHAR *)malloc(6004);
@@ -1711,7 +1711,7 @@ void CSkin::Load(void) m_avatarBorderClr = (COLORREF)HexStringToLong(buffer);
GetPrivateProfileString(_T("Global"), _T("SideBarBG"), _T("None"), buffer, 20, m_tszFileName);
- if(_tcscmp(buffer, _T("None")))
+ if (_tcscmp(buffer, _T("None")))
m_sideBarContainerBG = (COLORREF)HexStringToLong(buffer);
else
m_sideBarContainerBG = SkinItems[ID_EXTBKSIDEBARBG].COLOR;
@@ -1883,13 +1883,13 @@ void CSkin::LoadItems() */
void CSkin::setupTabCloseBitmap(bool fDeleteOnly)
{
- if(m_tabCloseHDC || fDeleteOnly) {
- if(m_tabCloseHDC) {
+ if (m_tabCloseHDC || fDeleteOnly) {
+ if (m_tabCloseHDC) {
::SelectObject(m_tabCloseHDC, m_tabCloseOldBitmap);
::DeleteObject(m_tabCloseBitmap);
::DeleteDC(m_tabCloseHDC);
}
- if(fDeleteOnly)
+ if (fDeleteOnly)
return;
}
@@ -1898,14 +1898,14 @@ void CSkin::setupTabCloseBitmap(bool fDeleteOnly) HDC dc = ::GetDC(PluginConfig.g_hwndHotkeyHandler);
m_tabCloseHDC = ::CreateCompatibleDC(dc);
- if(M->isAero())
+ if (M->isAero())
m_tabCloseBitmap = CreateAeroCompatibleBitmap(rc, m_tabCloseHDC);
else
m_tabCloseBitmap = ::CreateCompatibleBitmap(dc, 20, 20);
m_tabCloseOldBitmap = reinterpret_cast<HBITMAP>(::SelectObject(m_tabCloseHDC, m_tabCloseBitmap));
- if(M->isVSThemed() || M->isAero()) {
+ if (M->isVSThemed() || M->isAero()) {
::FillRect(m_tabCloseHDC, &rc, M->isAero() ? reinterpret_cast<HBRUSH>(::GetStockObject(BLACK_BRUSH)) : ::GetSysColorBrush(COLOR_3DFACE));
HANDLE hTheme = CMimAPI::m_pfnOpenThemeData(PluginConfig.g_hwndHotkeyHandler, L"BUTTON");
@@ -1915,7 +1915,7 @@ void CSkin::setupTabCloseBitmap(bool fDeleteOnly) CMimAPI::m_pfnDrawThemeBackground(hTheme, m_tabCloseHDC, 1, 1, &rc, &rc);
CMimAPI::m_pfnCloseThemeData(hTheme);
}
- else if(CSkin::m_skinEnabled)
+ else if (CSkin::m_skinEnabled)
CSkin::DrawItem(m_tabCloseHDC, &rc, &SkinItems[ID_EXTBKBUTTONSNPRESSED]);
else {
::FillRect(m_tabCloseHDC, &rc, ::GetSysColorBrush(COLOR_3DFACE));
@@ -1964,13 +1964,13 @@ void CSkin::setupAeroSkins() return;
mir_sntprintf(tszBasePath, MAX_PATH, _T("%s"), M->getDataPath());
- if(tszBasePath[lstrlen(tszBasePath) - 1] != '\\')
+ if (tszBasePath[lstrlen(tszBasePath) - 1] != '\\')
_tcscat(tszBasePath, _T("\\"));
/*
* load unknown avatar..
*/
- if(0 == PluginConfig.g_hbmUnknown) {
+ if (0 == PluginConfig.g_hbmUnknown) {
mir_sntprintf(tszFilename, MAX_PATH, _T("%scustom_unknown.png"), tszBasePath);
if (!PathFileExists(tszFilename))
mir_sntprintf(tszFilename, MAX_PATH, _T("%sunknown.png"), tszBasePath);
@@ -1986,7 +1986,7 @@ void CSkin::setupAeroSkins() if (!PathFileExists(tszFilename))
mir_sntprintf(tszFilename, MAX_PATH, _T("%stabskin_aero.png"), tszBasePath);
- if(CMimAPI::m_pfnDwmGetColorizationColor && M->isAero())
+ if (CMimAPI::m_pfnDwmGetColorizationColor && M->isAero())
CMimAPI::m_pfnDwmGetColorizationColor(&m_dwmColor, &isOpaque);
else
m_dwmColor = PluginConfig.m_fillColor;
@@ -2008,12 +2008,12 @@ void CSkin::setupAeroSkins() if (!isOpaque && alphafactor > 150 && !(fr == fg && fg == fb)) {
float fmax = max(max(fr,fg), fb);
- if(fmax == fr) {
+ if (fmax == fr) {
fr *= (alphafactor / 100 * 2.2);
fr = min(fr, 255);
fb = min(fb * alphafactor / 100, 255);
fg = min(fg * alphafactor / 100, 255);
- } else if(fmax == fg) {
+ } else if (fmax == fg) {
fg *= (alphafactor / 100 * 2.2);
fg = min(fg, 255);
fr = min(fr * alphafactor / 100, 255);
@@ -2270,10 +2270,10 @@ UINT CSkin::NcCalcRichEditFrame(HWND hwnd, const TWindowData *mwdat, UINT skinID EnableScrollBar(hwnd, SB_VERT, ESB_DISABLE_BOTH);
ShowScrollBar(hwnd, SB_VERT, FALSE);
}
- if(OldWndProc)
+ if (OldWndProc)
orig = CallWindowProc(OldWndProc, hwnd, msg, wParam, lParam);
- if(0 == mwdat)
+ if (0 == mwdat)
return(orig);
if (CSkin::m_skinEnabled) {
@@ -2315,7 +2315,7 @@ UINT CSkin::DrawRichEditFrame(HWND hwnd, const TWindowData *mwdat, UINT skinID, CSkinItem *item = &SkinItems[skinID];
LRESULT result = 0;
- if(OldWndProc)
+ if (OldWndProc)
result = CallWindowProc(OldWndProc, hwnd, msg, wParam, lParam); // do default processing (otherwise, NO scrollbar as it is painted in NC_PAINT)
if (0 == mwdat)
@@ -2362,7 +2362,7 @@ UINT CSkin::DrawRichEditFrame(HWND hwnd, const TWindowData *mwdat, UINT skinID, FillRect(hdc, &rcWindow, br);
DeleteObject(br);
} else {
- if(PluginConfig.m_cRichBorders) {
+ if (PluginConfig.m_cRichBorders) {
HBRUSH br = CreateSolidBrush(PluginConfig.m_cRichBorders);
FillRect(hdc, &rcWindow, br);
DeleteObject(br);
@@ -2410,7 +2410,7 @@ int CSkin::RenderText(HDC hdc, HANDLE hTheme, const TCHAR *szText, RECT *rc, DWO if ((PluginConfig.m_bIsVista && !CSkin::m_skinEnabled && hTheme) || fForceAero) {
DTTOPTS dto = {0};
dto.dwSize = sizeof(dto);
- if(iGlowSize && (M->isAero() || fForceAero)) {
+ if (iGlowSize && (M->isAero() || fForceAero)) {
dto.iGlowSize = iGlowSize;
dto.dwFlags = DTT_COMPOSITED|DTT_GLOWSIZE;
}
@@ -2445,7 +2445,7 @@ HBITMAP CSkin::ResizeBitmap(HBITMAP hBmpSrc, LONG width, LONG height, bool &must BITMAP bm;
GetObject(hBmpSrc, sizeof(bm), &bm);
- if(bm.bmHeight != height || bm.bmWidth != width) {
+ if (bm.bmHeight != height || bm.bmWidth != width) {
::ResizeBitmap rb;
rb.size = sizeof(rb);
rb.fit = RESIZEBITMAP_STRETCH;
@@ -2454,7 +2454,7 @@ HBITMAP CSkin::ResizeBitmap(HBITMAP hBmpSrc, LONG width, LONG height, bool &must rb.hBmp = hBmpSrc;
HBITMAP hbmNew = (HBITMAP)CallService("IMG/ResizeBitmap", (WPARAM)&rb, 0);
- if(hbmNew != hBmpSrc)
+ if (hbmNew != hBmpSrc)
mustFree = true;
return(hbmNew);
}
@@ -2547,8 +2547,8 @@ void CSkin::MapClientToParent(HWND hwndClient, HWND hwndParent, RECT &rc) */
void CSkin::RenderToolbarBG(const TWindowData *dat, HDC hdc, const RECT &rcWindow)
{
- if(dat) {
- if(dat->pContainer->dwFlags & CNT_HIDETOOLBAR)
+ if (dat) {
+ if (dat->pContainer->dwFlags & CNT_HIDETOOLBAR)
return;
bool fAero = M->isAero();
@@ -2566,10 +2566,10 @@ void CSkin::RenderToolbarBG(const TWindowData *dat, HDC hdc, const RECT &rcWindo rcToolbar.left = 0;
rcToolbar.right = rcWindow.right;
- if(dat->bType == SESSIONTYPE_IM) {
- if(dat->dwFlags & MWF_ERRORSTATE)
+ if (dat->bType == SESSIONTYPE_IM) {
+ if (dat->dwFlags & MWF_ERRORSTATE)
rcToolbar.top += ERRORPANEL_HEIGHT;
- if(dat->dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED || dat->bNotOnList) {
+ if (dat->dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED || dat->bNotOnList) {
rcToolbar.top += 20;
RECT rcAdd;
rcAdd.left = 0; rcAdd.right = rcToolbar.right - rcToolbar.left;
@@ -2600,11 +2600,11 @@ void CSkin::RenderToolbarBG(const TWindowData *dat, HDC hdc, const RECT &rcWindo rcCachedToolbar.right = cx;
rcCachedToolbar.bottom = cy;
- if(dat->pContainer->cachedToolbarDC == 0)
+ if (dat->pContainer->cachedToolbarDC == 0)
dat->pContainer->cachedToolbarDC = ::CreateCompatibleDC(hdc);
- if(dat->pContainer->szOldToolbarSize.cx != cx || dat->pContainer->szOldToolbarSize.cy != cy) {
- if(dat->pContainer->oldhbmToolbarBG) {
+ if (dat->pContainer->szOldToolbarSize.cx != cx || dat->pContainer->szOldToolbarSize.cy != cy) {
+ if (dat->pContainer->oldhbmToolbarBG) {
::SelectObject(dat->pContainer->cachedToolbarDC, dat->pContainer->oldhbmToolbarBG);
::DeleteObject(dat->pContainer->hbmToolbarBG);
}
@@ -2658,7 +2658,7 @@ HANDLE CSkin::InitiateBufferedPaint(const HDC hdcSrc, RECT& rc, HDC& hdcOut) */
void CSkin::FinalizeBufferedPaint(HANDLE hbp, RECT *rc)
{
- if(m_pCurrentAeroEffect && m_pCurrentAeroEffect->m_finalAlpha > 0)
+ if (m_pCurrentAeroEffect && m_pCurrentAeroEffect->m_finalAlpha > 0)
CMimAPI::m_pfnBufferedPaintSetAlpha(hbp, rc, m_pCurrentAeroEffect->m_finalAlpha);
CMimAPI::m_pfnEndBufferedPaint(hbp, TRUE);
}
@@ -2679,10 +2679,10 @@ void CSkin::FinalizeBufferedPaint(HANDLE hbp, RECT *rc) void CSkin::ApplyAeroEffect(const HDC hdc, const RECT *rc, int iEffectArea, HANDLE hbp)
{
- if(m_pCurrentAeroEffect == 0 || m_aeroEffect == AERO_EFFECT_NONE)
+ if (m_pCurrentAeroEffect == 0 || m_aeroEffect == AERO_EFFECT_NONE)
return;
- if(m_pCurrentAeroEffect->pfnEffectRenderer)
+ if (m_pCurrentAeroEffect->pfnEffectRenderer)
m_pCurrentAeroEffect->pfnEffectRenderer(hdc, rc, iEffectArea);
}
@@ -2692,9 +2692,9 @@ void CSkin::ApplyAeroEffect(const HDC hdc, const RECT *rc, int iEffectArea, HAND void CSkin::AeroEffectCallback_Milk(const HDC hdc, const RECT *rc, int iEffectArea)
{
- if(iEffectArea < 0x1000) {
+ if (iEffectArea < 0x1000) {
int alpha = (iEffectArea == AERO_EFFECT_AREA_INFOPANEL) ? m_pCurrentAeroEffect->m_baseAlpha : 40;
- if(iEffectArea == AERO_EFFECT_AREA_MENUBAR)
+ if (iEffectArea == AERO_EFFECT_AREA_MENUBAR)
alpha = 90;
BYTE color2_trans = (iEffectArea == AERO_EFFECT_AREA_MENUBAR) ? 0 : 1;
DWORD corner = (iEffectArea == AERO_EFFECT_AREA_INFOPANEL) ? m_pCurrentAeroEffect->m_cornerRadius : 6;
@@ -2706,7 +2706,7 @@ void CSkin::AeroEffectCallback_Milk(const HDC hdc, const RECT *rc, int iEffectAr void CSkin::AeroEffectCallback_Carbon(const HDC hdc, const RECT *rc, int iEffectArea)
{
- if(iEffectArea < 0x1000)
+ if (iEffectArea < 0x1000)
DrawAlpha(hdc, const_cast<RECT *>(rc), m_pCurrentAeroEffect->m_baseColor, m_pCurrentAeroEffect->m_baseAlpha,
m_pCurrentAeroEffect->m_gradientColor, 0, m_pCurrentAeroEffect->m_gradientType,
m_pCurrentAeroEffect->m_cornerType, m_pCurrentAeroEffect->m_cornerRadius, 0);
@@ -2714,8 +2714,8 @@ void CSkin::AeroEffectCallback_Carbon(const HDC hdc, const RECT *rc, int iEffect void CSkin::AeroEffectCallback_Solid(const HDC hdc, const RECT *rc, int iEffectArea)
{
- if(iEffectArea < 0x1000) {
- if(iEffectArea == AERO_EFFECT_AREA_SIDEBAR_LEFT)
+ if (iEffectArea < 0x1000) {
+ if (iEffectArea == AERO_EFFECT_AREA_SIDEBAR_LEFT)
::DrawAlpha(hdc, const_cast<RECT *>(rc), m_pCurrentAeroEffect->m_baseColor, m_pCurrentAeroEffect->m_baseAlpha,
m_pCurrentAeroEffect->m_gradientColor, 0, GRADIENT_TB + 1,
0, 2, 0);
@@ -2734,27 +2734,27 @@ void CSkin::AeroEffectCallback_Solid(const HDC hdc, const RECT *rc, int iEffectA void CSkin::initAeroEffect()
{
- if(m_BrushBack) {
+ if (m_BrushBack) {
::DeleteObject(m_BrushBack);
m_BrushBack = 0;
}
- if(PluginConfig.m_bIsVista && m_aeroEffect > AERO_EFFECT_NONE && m_aeroEffect < AERO_EFFECT_LAST) {
+ if (PluginConfig.m_bIsVista && m_aeroEffect > AERO_EFFECT_NONE && m_aeroEffect < AERO_EFFECT_LAST) {
m_currentAeroEffect = m_aeroEffects[m_aeroEffect];
m_pCurrentAeroEffect = &m_currentAeroEffect;
m_glowSize = m_pCurrentAeroEffect->m_glowSize;
- if(m_pCurrentAeroEffect->m_clrToolbar == -1)
+ if (m_pCurrentAeroEffect->m_clrToolbar == -1)
m_pCurrentAeroEffect->m_clrToolbar = PluginConfig.m_ipBackgroundGradientHigh;
- if(m_pCurrentAeroEffect->m_clrToolbar2 == -1)
+ if (m_pCurrentAeroEffect->m_clrToolbar2 == -1)
m_pCurrentAeroEffect->m_clrToolbar2 = PluginConfig.m_ipBackgroundGradient;
- else if(m_pCurrentAeroEffect->m_clrToolbar2 == 0)
+ else if (m_pCurrentAeroEffect->m_clrToolbar2 == 0)
m_pCurrentAeroEffect->m_clrToolbar2 = m_dwmColorRGB;
- if(m_aeroEffect == AERO_EFFECT_CUSTOM || m_aeroEffect == AERO_EFFECT_SOLID) {
+ if (m_aeroEffect == AERO_EFFECT_CUSTOM || m_aeroEffect == AERO_EFFECT_SOLID) {
m_pCurrentAeroEffect->m_baseColor = PluginConfig.m_ipBackgroundGradientHigh;
m_pCurrentAeroEffect->m_gradientColor = PluginConfig.m_ipBackgroundGradient;
- if(m_aeroEffect == AERO_EFFECT_CUSTOM)
+ if (m_aeroEffect == AERO_EFFECT_CUSTOM)
m_pCurrentAeroEffect->m_clrBack = PluginConfig.m_ipBackgroundGradientHigh;
}
@@ -2770,7 +2770,7 @@ void CSkin::initAeroEffect() while (pContainer) {
InvalidateRect(GetDlgItem(pContainer->hwnd, IDC_MSGTABS), NULL, TRUE);
InvalidateRect(pContainer->hwnd, NULL, TRUE);
- if(IsWindow(GetDlgItem(pContainer->hwnd, 5000)))
+ if (IsWindow(GetDlgItem(pContainer->hwnd, 5000)))
InvalidateRect(GetDlgItem(pContainer->hwnd, 5000), NULL, TRUE);
pContainer = pContainer->pNextContainer;
}
@@ -2778,10 +2778,10 @@ void CSkin::initAeroEffect() void CSkin::setAeroEffect(LRESULT effect)
{
- if(effect == -1)
+ if (effect == -1)
effect = static_cast<LRESULT>(M->GetDword(SRMSGMOD_T, "aerostyle", AERO_EFFECT_NONE));
- if(effect >= 0 && effect < AERO_EFFECT_LAST)
+ if (effect >= 0 && effect < AERO_EFFECT_LAST)
m_aeroEffect = (UINT)effect;
else
m_aeroEffect = AERO_EFFECT_NONE;
@@ -2800,7 +2800,7 @@ void CSkin::extractSkinsAndLogo(bool fForceOverwrite) const TCHAR tszBasePath[MAX_PATH];
mir_sntprintf(tszBasePath, MAX_PATH, _T("%s"), M->getDataPath());
- if(tszBasePath[lstrlen(tszBasePath) - 1] != '\\')
+ if (tszBasePath[lstrlen(tszBasePath) - 1] != '\\')
_tcscat(tszBasePath, _T("\\"));
CallService(MS_UTILS_CREATEDIRTREET, 0, (LPARAM)tszBasePath);
@@ -2826,7 +2826,7 @@ void CSkin::UpdateToolbarBG(TWindowData* dat, DWORD dwRdwOptFlags) RECT rcUpdate, rcTmp;
POINT pt;
- if(dat) {
+ if (dat) {
::GetWindowRect(::GetDlgItem(dat->hwnd, dat->bType == SESSIONTYPE_IM ? IDC_LOG : IDC_CHAT_LOG), &rcTmp);
pt.x = rcTmp.left;
@@ -2840,7 +2840,7 @@ void CSkin::UpdateToolbarBG(TWindowData* dat, DWORD dwRdwOptFlags) rcUpdate.right = rcTmp.right;
rcUpdate.bottom = rcTmp.bottom;
- if(M->isAero() || M->isDwmActive())
+ if (M->isAero() || M->isDwmActive())
dat->fLimitedUpdate = true; // skip unrelevant window updates when we have buffered paint avail
::RedrawWindow(dat->hwnd, &rcUpdate, 0, RDW_INVALIDATE|RDW_ERASE|RDW_UPDATENOW);
::BB_RedrawButtons(dat);
@@ -2857,12 +2857,12 @@ void CSkin::UpdateToolbarBG(TWindowData* dat, DWORD dwRdwOptFlags) */
void CSkin::FillBack(const HDC hdc, RECT* rc)
{
- if(0 == CSkin::m_BrushFill) {
- if(PluginConfig.m_fillColor)
+ if (0 == CSkin::m_BrushFill) {
+ if (PluginConfig.m_fillColor)
CSkin::m_BrushFill = ::CreateSolidBrush(PluginConfig.m_fillColor);
}
- if(PluginConfig.m_fillColor)
+ if (PluginConfig.m_fillColor)
::FillRect(hdc, rc, CSkin::m_BrushFill);
else
::FillRect(hdc, rc, GetSysColorBrush(COLOR_3DFACE));
diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp index 7e3bcd2439..51affe1520 100644 --- a/plugins/TabSRMM/src/trayicon.cpp +++ b/plugins/TabSRMM/src/trayicon.cpp @@ -267,7 +267,7 @@ void TSAPI AddContactToFavorites(HANDLE hContact, const TCHAR *szNickname, const PROTOACCOUNT *acc = (PROTOACCOUNT *)CallService(MS_PROTO_GETACCOUNT, (WPARAM)0, (LPARAM)szProto);
- if(acc && acc->tszAccountName) {
+ if (acc && acc->tszAccountName) {
mii.cbSize = sizeof(mii);
mir_sntprintf(szMenuEntry, safe_sizeof(szMenuEntry), _T("%s: %s (%s)"), acc->tszAccountName, szFinalNick, szStatus);
if (mode) {
diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp index c44b70b547..1fc6ffdd39 100644 --- a/plugins/TabSRMM/src/userprefs.cpp +++ b/plugins/TabSRMM/src/userprefs.cpp @@ -110,12 +110,12 @@ static INT_PTR CALLBACK DlgProcUserPrefs(HWND hwndDlg, UINT msg, WPARAM wParam, SendDlgItemMessage(hwndDlg, IDC_IEVIEWMODE, CB_SETITEMDATA, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_IEVIEWMODE, CB_SETITEMDATA, 1, 1);
- if(have_hpp) {
+ if (have_hpp) {
SendDlgItemMessage(hwndDlg, IDC_IEVIEWMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Force History++"));
SendDlgItemMessage(hwndDlg, IDC_IEVIEWMODE, CB_SETITEMDATA, 2, 2);
}
- if(have_ieview) {
+ if (have_ieview) {
SendDlgItemMessage(hwndDlg, IDC_IEVIEWMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Force IEView"));
SendDlgItemMessage(hwndDlg, IDC_IEVIEWMODE, CB_SETITEMDATA, have_hpp ? 3 : 2, 3);
}
@@ -125,9 +125,9 @@ static INT_PTR CALLBACK DlgProcUserPrefs(HWND hwndDlg, UINT msg, WPARAM wParam, else if (bIEView == 0xff && bHPP == 0xff)
SendDlgItemMessage(hwndDlg, IDC_IEVIEWMODE, CB_SETCURSEL, 1, 0);
else {
- if(bHPP == 1)
+ if (bHPP == 1)
SendDlgItemMessage(hwndDlg, IDC_IEVIEWMODE, CB_SETCURSEL, have_hpp ? 2 : 0, 0);
- if(bIEView == 1)
+ if (bIEView == 1)
SendDlgItemMessage(hwndDlg, IDC_IEVIEWMODE, CB_SETCURSEL, (have_hpp && have_ieview) ? 3 : (have_ieview ? 2 : 0), 0);
}
@@ -224,7 +224,7 @@ static INT_PTR CALLBACK DlgProcUserPrefs(HWND hwndDlg, UINT msg, WPARAM wParam, if (hWnd && dat) {
iNewIEView = GetIEViewMode(hWnd, dat->hContact);
if (iNewIEView != iOldIEView) {
- if(pdwActionToTake)
+ if (pdwActionToTake)
*pdwActionToTake |= UPREF_ACTION_SWITCHLOGVIEWER;
}
}
@@ -261,7 +261,7 @@ static INT_PTR CALLBACK DlgProcUserPrefs(HWND hwndDlg, UINT msg, WPARAM wParam, M->WriteByte(hContact, RTLTEMPLATES_MODULE, "enabled", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_RTLTEMPLOVERRIDE)));
bAvatarVisible = (BYTE)SendDlgItemMessage(hwndDlg, IDC_SHOWAVATAR, CB_GETCURSEL, 0, 0);
- if(bAvatarVisible == 0)
+ if (bAvatarVisible == 0)
DBDeleteContactSetting(hContact, SRMSGMOD_T, "hideavatar");
else
M->WriteByte(hContact, SRMSGMOD_T, "hideavatar", (BYTE)(bAvatarVisible == 1 ? 1 : 0));
@@ -352,15 +352,15 @@ int TSAPI LoadLocalFlags(HWND hwnd, struct TWindowData *dat) DWORD dwGlobal = M->GetDword("mwflags", 0);
DWORD maskval;
- if(dat) {
+ if (dat) {
dat->dwFlags &= ~MWF_LOG_ALL;
- if(dat->pContainer->theme.isPrivate)
+ if (dat->pContainer->theme.isPrivate)
dat->dwFlags |= (dat->pContainer->theme.dwFlags & MWF_LOG_ALL);
else
dat->dwFlags |= (dwGlobal & MWF_LOG_ALL);
while(checkboxes[i].uId) {
maskval = checkboxes[i].uFlag;
- if(dwMask & maskval)
+ if (dwMask & maskval)
dat->dwFlags = (dwLocal & maskval) ? dat->dwFlags | maskval : dat->dwFlags & ~maskval;
i++;
}
@@ -401,7 +401,7 @@ static INT_PTR CALLBACK DlgProcUserPrefsLogOptions(HWND hwndDlg, UINT msg, WPARA while(checkboxes[i].uId) {
maskval = checkboxes[i].uFlag;
- if(dwLocalMask & maskval)
+ if (dwLocalMask & maskval)
CheckDlgButton(hwndDlg, checkboxes[i].uId, (dwLocalFlags & maskval) ? BST_CHECKED : BST_UNCHECKED);
else
CheckDlgButton(hwndDlg, checkboxes[i].uId, BST_INDETERMINATE);
@@ -416,20 +416,20 @@ static INT_PTR CALLBACK DlgProcUserPrefsLogOptions(HWND hwndDlg, UINT msg, WPARA struct TWindowData *dat = NULL;
DWORD *dwActionToTake = (DWORD *)lParam, dwMask = 0, dwFlags = 0, maskval;
- if(hwnd)
+ if (hwnd)
dat = (struct TWindowData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
while(checkboxes[i].uId) {
maskval = checkboxes[i].uFlag;
state = IsDlgButtonChecked(hwndDlg, checkboxes[i].uId);
- if(state != BST_INDETERMINATE) {
+ if (state != BST_INDETERMINATE) {
dwMask |= maskval;
dwFlags = (state == BST_CHECKED) ? (dwFlags | maskval) : (dwFlags & ~maskval);
}
i++;
}
- if(dwMask) {
+ if (dwMask) {
M->WriteDword(hContact, SRMSGMOD_T, "mwmask", dwMask);
M->WriteDword(hContact, SRMSGMOD_T, "mwflags", dwFlags);
}
@@ -437,8 +437,8 @@ static INT_PTR CALLBACK DlgProcUserPrefsLogOptions(HWND hwndDlg, UINT msg, WPARA DBDeleteContactSetting(hContact, SRMSGMOD_T, "mwmask");
DBDeleteContactSetting(hContact, SRMSGMOD_T, "mwflags");
}
- if(hwnd && dat) {
- if(dwMask)
+ if (hwnd && dat) {
+ if (dwMask)
*dwActionToTake |= (DWORD)UPREF_ACTION_REMAKELOG;
if ((dat->dwFlags & MWF_LOG_RTL) != (dwFlags & MWF_LOG_RTL))
*dwActionToTake |= (DWORD)UPREF_ACTION_APPLYOPTIONS;
@@ -549,14 +549,14 @@ INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LP TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_OPTIONSTAB), i, &tci);
SendMessage((HWND)tci.lParam, WM_COMMAND, WM_USER + 100, (LPARAM)&dwActionToTake);
}
- if(hwnd) {
+ if (hwnd) {
struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- if(dat) {
+ if (dat) {
DWORD dwOldFlags = (dat->dwFlags & MWF_LOG_ALL);
SetDialogToType(hwnd);
#if defined(__FEAT_DEPRECATED_DYNAMICSWITCHLOGVIEWER)
- if(dwActionToTake & UPREF_ACTION_SWITCHLOGVIEWER) {
+ if (dwActionToTake & UPREF_ACTION_SWITCHLOGVIEWER) {
unsigned int mode = GetIEViewMode(hwndDlg, dat->hContact);
SwitchMessageLog(dat, mode);
}
@@ -565,13 +565,13 @@ INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LP if ((dat->dwFlags & MWF_LOG_ALL) != dwOldFlags) {
BOOL fShouldHide = TRUE;
- if(IsIconic(dat->pContainer->hwnd))
+ if (IsIconic(dat->pContainer->hwnd))
fShouldHide = FALSE;
else
ShowWindow(dat->pContainer->hwnd, SW_HIDE);
SendMessage(hwnd, DM_OPTIONSAPPLIED, 0, 0);
SendMessage(hwnd, DM_DEFERREDREMAKELOG, (WPARAM)hwnd, 0);
- if(fShouldHide)
+ if (fShouldHide)
ShowWindow(dat->pContainer->hwnd, SW_SHOWNORMAL);
}
}
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index bfe5f0cb7b..e87fb10a13 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -67,7 +67,7 @@ void* Utils::safeAlloc(const size_t size) return(reinterpret_cast<void*>(_p));
}
__except(CGlobals::Ex_ShowDialog(GetExceptionInformation(), __FILE__, __LINE__, L"MEMORY_ALLOCATION", false)) {
- return(0);
+ return 0;
}
}
@@ -79,7 +79,7 @@ void* Utils::safeCalloc(const size_t size) return(_p);
}
__except(CGlobals::Ex_ShowDialog(GetExceptionInformation(), __FILE__, __LINE__, L"MEMORY_ALLOCATION", false)) {
- return(0);
+ return 0;
}
}
@@ -92,7 +92,7 @@ void* Utils::safeMirAlloc(const size_t size) return(reinterpret_cast<void*>(_p));
}
__except(CGlobals::Ex_ShowDialog(GetExceptionInformation(), __FILE__, __LINE__, L"MIR_MEMORY_ALLOCATION", false)) {
- return(0);
+ return 0;
}
}
@@ -104,7 +104,7 @@ void* Utils::safeMirCalloc(const size_t size) return(_p);
}
__except(CGlobals::Ex_ShowDialog(GetExceptionInformation(), __FILE__, __LINE__, L"MIR_MEMORY_ALLOCATION", false)) {
- return(0);
+ return 0;
}
}
@@ -164,7 +164,7 @@ const TCHAR* Utils::FormatRaw(TWindowData *dat, const TCHAR *msg, int flags, BOO if (haveMathMod && mathModDelimiter[0] && message.find(mathModDelimiter) != message.npos)
return(message.c_str());
- if(dwFlags & MWF_LOG_BBCODE) {
+ if (dwFlags & MWF_LOG_BBCODE) {
if (haveMathMod && mathModDelimiter[0]) {
INT_PTR mark = 0;
int nrDelims = 0;
@@ -339,19 +339,19 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat INT_PTR tempmark = 0;
TCHAR szTemp[512];
- if(dat == 0)
- return(0);
+ if (dat == 0)
+ return 0;
tstring title(szFormat);
for ( size_t curpos = 0; curpos < title.length(); ) {
- if(title[curpos] != '%') {
+ if (title[curpos] != '%') {
curpos++;
continue;
}
tempmark = curpos;
curpos++;
- if(title[curpos] == 0)
+ if (title[curpos] == 0)
break;
switch (title[curpos]) {
@@ -457,17 +457,17 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat case 'T': {
TCHAR *tszStatusMsg = dat->cache->getNormalizedStatusMsg(dat->cache->getStatusMsg(), true);
- if(tszStatusMsg) {
+ if (tszStatusMsg) {
title.insert(tempmark + 2, tszStatusMsg);
curpos = tempmark + lstrlen(tszStatusMsg);
}
- else if(title[curpos] == 't') {
+ else if (title[curpos] == 't') {
const TCHAR* tszStatusMsg = TranslateT("No status message");
title.insert(tempmark + 2, tszStatusMsg);
curpos = tempmark + lstrlen(tszStatusMsg);
}
title.erase(tempmark, 2);
- if(tszStatusMsg)
+ if (tszStatusMsg)
mir_free(tszStatusMsg);
break;
}
@@ -551,7 +551,7 @@ TCHAR* Utils::GetPreviewWithEllipsis(TCHAR *szText, size_t iMaxLen) TCHAR* p = 0, cSaved;
bool fEllipsis = false;
- if(_tcslen(szText) <= iMaxLen)
+ if (_tcslen(szText) <= iMaxLen)
uRequired = _tcslen(szText) + 4;
else {
TCHAR *p = &szText[iMaxLen - 1];
@@ -559,7 +559,7 @@ TCHAR* Utils::GetPreviewWithEllipsis(TCHAR *szText, size_t iMaxLen) while(p >= szText && *p != ' ')
p--;
- if(p == szText)
+ if (p == szText)
p = szText + iMaxLen - 1;
cSaved = *p;
@@ -569,7 +569,7 @@ TCHAR* Utils::GetPreviewWithEllipsis(TCHAR *szText, size_t iMaxLen) TCHAR *szResult = reinterpret_cast<TCHAR *>(mir_alloc(uRequired * sizeof(TCHAR)));
mir_sntprintf(szResult, uRequired, fEllipsis ? _T("%s...") : _T("%s"), szText);
- if(p)
+ if (p)
*p = cSaved;
return(szResult);
@@ -726,28 +726,28 @@ int Utils::ReadContainerSettingsFromDB(const HANDLE hContact, TContainerSettings CopyMemory(cs, &PluginConfig.globalContainerSettings, sizeof(TContainerSettings));
- if(0 == DBGetContactSetting(hContact, SRMSGMOD_T, szKey ? szKey : CNT_KEYNAME, &dbv)) {
- if(dbv.type == DBVT_BLOB && dbv.cpbVal > 0 && dbv.cpbVal <= sizeof(TContainerSettings)) {
+ if (0 == DBGetContactSetting(hContact, SRMSGMOD_T, szKey ? szKey : CNT_KEYNAME, &dbv)) {
+ if (dbv.type == DBVT_BLOB && dbv.cpbVal > 0 && dbv.cpbVal <= sizeof(TContainerSettings)) {
::CopyMemory((void *)cs, (void *)dbv.pbVal, dbv.cpbVal);
::DBFreeVariant(&dbv);
- if(hContact == 0 && szKey == 0)
+ if (hContact == 0 && szKey == 0)
cs->fPrivate = false;
- return(0);
+ return 0;
}
cs->fPrivate = false;
DBFreeVariant(&dbv);
- return(1);
+ return 1;
}
else {
cs->fPrivate = false;
- return(1);
+ return 1;
}
}
int Utils::WriteContainerSettingsToDB(const HANDLE hContact, TContainerSettings *cs, const char *szKey)
{
DBWriteContactSettingBlob(hContact, SRMSGMOD_T, szKey ? szKey : CNT_KEYNAME, cs, sizeof(TContainerSettings));
- return(0);
+ return 0;
}
void Utils::SettingsToContainer(TContainerData *pContainer)
@@ -779,8 +779,8 @@ void Utils::ReadPrivateContainerSettings(TContainerData *pContainer, bool fForce mir_snprintf(szCname, 40, "%s%d_Blob", CNT_BASEKEYNAME, pContainer->iContainerIndex);
Utils::ReadContainerSettingsFromDB(0, &csTemp, szCname);
- if(csTemp.fPrivate || fForce) {
- if(pContainer->settings == 0 || pContainer->settings == &PluginConfig.globalContainerSettings)
+ if (csTemp.fPrivate || fForce) {
+ if (pContainer->settings == 0 || pContainer->settings == &PluginConfig.globalContainerSettings)
pContainer->settings = (TContainerSettings *)malloc(sizeof(TContainerSettings));
CopyMemory((void *)pContainer->settings, (void *)&csTemp, sizeof(TContainerSettings));
pContainer->settings->fPrivate = true;
@@ -794,13 +794,13 @@ void Utils::SaveContainerSettings(TContainerData *pContainer, const char *szSett char szCName[50];
pContainer->dwFlags &= ~(CNT_DEFERREDCONFIGURE | CNT_CREATE_MINIMIZED | CNT_DEFERREDSIZEREQUEST | CNT_CREATE_CLONED);
- if(pContainer->settings->fPrivate) {
+ if (pContainer->settings->fPrivate) {
_snprintf(szCName, 40, "%s%d_Blob", szSetting, pContainer->iContainerIndex);
WriteContainerSettingsToDB(0, pContainer->settings, szCName);
}
mir_snprintf(szCName, 40, "%s%d_theme", szSetting, pContainer->iContainerIndex);
if (lstrlen(pContainer->szRelThemeFile) > 1) {
- if(pContainer->fPrivateThemeChanged == TRUE) {
+ if (pContainer->fPrivateThemeChanged == TRUE) {
M->pathToRelative(pContainer->szRelThemeFile, pContainer->szAbsThemeFile);
M->WriteTString(NULL, SRMSGMOD_T, szCName, pContainer->szAbsThemeFile);
pContainer->fPrivateThemeChanged = FALSE;
@@ -857,13 +857,13 @@ HICON Utils::iconFromAvatar(const TWindowData *dat) HICON hIcon = 0;
if (!ServiceExists(MS_AV_GETAVATARBITMAP))
- return(0);
+ return 0;
- if(dat) {
+ if (dat) {
AVATARCACHEENTRY *ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)dat->hContact, 0);
LONG lIconSize = Win7Taskbar->getIconSize();
- if(ace && ace->hbmPic) {
+ if (ace && ace->hbmPic) {
scaleAvatarHeightLimited(ace->hbmPic, dNewWidth, dNewHeight, lIconSize);
/*
* resize picture to fit it on the task bar, use an image list for converting it to
@@ -898,7 +898,7 @@ HICON Utils::iconFromAvatar(const TWindowData *dat) ::DeleteDC(dc);
::SelectObject(dcResized, hbmOldResized);
- if(hbmResized != ace->hbmPic)
+ if (hbmResized != ace->hbmPic)
::DeleteObject(hbmResized);
::DeleteDC(dcResized);
hIcon = ::ImageList_GetIcon(hIml_c, 0, ILD_NORMAL);
@@ -911,10 +911,10 @@ HICON Utils::iconFromAvatar(const TWindowData *dat) AVATARCACHEENTRY* Utils::loadAvatarFromAVS(const HANDLE hContact)
{
- if(ServiceExists(MS_AV_GETAVATARBITMAP))
+ if (ServiceExists(MS_AV_GETAVATARBITMAP))
return(reinterpret_cast<AVATARCACHEENTRY *>(CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hContact, 0)));
else
- return(0);
+ return 0;
}
void Utils::getIconSize(HICON hIcon, int& sizeX, int& sizeY)
@@ -956,13 +956,13 @@ void Utils::addMenuItem(const HMENU& m, MENUITEMINFO& mii, HICON hIcon, const TC int TSAPI Utils::mustPlaySound(const TWindowData *dat)
{
if (!dat)
- return(0);
+ return 0;
- if(dat->pContainer->fHidden) // hidden container is treated as closed, so play the sound
- return(1);
+ if (dat->pContainer->fHidden) // hidden container is treated as closed, so play the sound
+ return 1;
- if(dat->pContainer->dwFlags & CNT_NOSOUND || nen_options.iNoSounds)
- return(0);
+ if (dat->pContainer->dwFlags & CNT_NOSOUND || nen_options.iNoSounds)
+ return 0;
bool fActiveWindow = (dat->pContainer->hwnd == ::GetForegroundWindow() ? true : false);
bool fActiveTab = (dat->pContainer->hwndActive == dat->hwnd ? true : false);
@@ -971,14 +971,14 @@ int TSAPI Utils::mustPlaySound(const TWindowData *dat) /*
* window minimized, check if sound has to be played
*/
- if(fIconic)
+ if (fIconic)
return(dat->pContainer->dwFlagsEx & CNT_EX_SOUNDS_MINIMIZED ? 1 : 0);
/*
* window in foreground
*/
- if(fActiveWindow) {
- if(fActiveTab)
+ if (fActiveWindow) {
+ if (fActiveTab)
return(dat->pContainer->dwFlagsEx & CNT_EX_SOUNDS_FOCUSED ? 1 : 0);
else
return(dat->pContainer->dwFlagsEx & CNT_EX_SOUNDS_INACTIVETABS ? 1 : 0);
@@ -986,7 +986,7 @@ int TSAPI Utils::mustPlaySound(const TWindowData *dat) else
return(dat->pContainer->dwFlagsEx & CNT_EX_SOUNDS_UNFOCUSED ? 1 : 0);
- return(1);
+ return 1;
}
/**
@@ -1036,15 +1036,15 @@ void TSAPI Utils::extractResource(const HMODULE h, const UINT uID, const TCHAR * hRes = FindResource(h, MAKEINTRESOURCE(uID), tszName);
- if(hRes) {
+ if (hRes) {
hResource = LoadResource(h, hRes);
- if(hResource) {
+ if (hResource) {
HANDLE hFile;
char *pData = (char *)LockResource(hResource);
DWORD dwSize = SizeofResource(g_hInst, hRes), written = 0;
mir_sntprintf(szFilename, MAX_PATH, _T("%s%s"), tszPath, tszFilename);
if (!fForceOverwrite) {
- if(PathFileExists(szFilename))
+ if (PathFileExists(szFilename))
return;
}
if ((hFile = CreateFile(szFilename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)) != INVALID_HANDLE_VALUE) {
@@ -1070,7 +1070,7 @@ const wchar_t* Utils::extractURLFromRichEdit(const ENLINK* _e, const HWND hwndRi ::SendMessageW(hwndRich, EM_EXGETSEL, 0, (LPARAM) & sel);
if (sel.cpMin != sel.cpMax)
- return(0);
+ return 0;
tr.chrg = _e->chrg;
tr.lpstrText = (wchar_t *)mir_alloc(2 * (tr.chrg.cpMax - tr.chrg.cpMin + 8));
@@ -1090,20 +1090,20 @@ LRESULT Utils::CmdDispatcher(UINT uType, HWND hwndDlg, UINT cmd, WPARAM wParam, {
switch(uType) {
case CMD_CONTAINER:
- if(pContainer && hwndDlg)
+ if (pContainer && hwndDlg)
return(DM_ContainerCmdHandler(pContainer, cmd, wParam, lParam));
break;
case CMD_MSGDIALOG:
- if(pContainer && hwndDlg && dat)
+ if (pContainer && hwndDlg && dat)
return(DM_MsgWindowCmdHandler(hwndDlg, pContainer, dat, cmd, wParam, lParam));
break;
case CMD_INFOPANEL:
- if(MsgWindowMenuHandler(dat, cmd, MENU_LOGMENU) == 0) {
+ if (MsgWindowMenuHandler(dat, cmd, MENU_LOGMENU) == 0) {
return(DM_MsgWindowCmdHandler(hwndDlg, pContainer, dat, cmd, wParam, lParam));
}
break;
}
- return(0);
+ return 0;
}
/**
@@ -1131,7 +1131,7 @@ void Utils::sanitizeFilename(wchar_t* tszFilename) */
void Utils::ensureTralingBackslash(wchar_t *szPathname)
{
- if(szPathname[lstrlenW(szPathname) - 1] != '\\')
+ if (szPathname[lstrlenW(szPathname) - 1] != '\\')
wcscat(szPathname, L"\\");
}
@@ -1147,21 +1147,21 @@ HMODULE Utils::loadSystemLibrary(const wchar_t* szFilename) HMODULE _h = 0;
try {
- if(0 == ::GetSystemDirectoryW(sysPathName, MAX_PATH))
+ if (0 == ::GetSystemDirectoryW(sysPathName, MAX_PATH))
throw(CRTException("Error while loading system library", szFilename));
sysPathName[MAX_PATH - 1] = 0;
- if(wcslen(sysPathName) + wcslen(szFilename) >= MAX_PATH)
+ if (wcslen(sysPathName) + wcslen(szFilename) >= MAX_PATH)
throw(CRTException("Error while loading system library", szFilename));
lstrcatW(sysPathName, szFilename);
_h = LoadLibraryW(sysPathName);
- if(0 == _h)
+ if (0 == _h)
throw(CRTException("Error while loading system library", szFilename));
}
catch(CRTException& ex) {
ex.display();
- return(0);
+ return 0;
}
return(_h);
}
@@ -1218,7 +1218,7 @@ CWarning::~CWarning() delete m_szText;
delete m_szTitle;
- if(m_hFontCaption)
+ if (m_hFontCaption)
::DeleteObject(m_hFontCaption);
#if defined(__LOGDEBUG_)
@@ -1230,7 +1230,7 @@ LRESULT CWarning::ShowDialog() const {
if (!m_fIsModal) {
::CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_WARNING), 0, stubDlgProc, reinterpret_cast<LPARAM>(this));
- return(0);
+ return 0;
}
else {
LRESULT res = ::DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_WARNING), 0, stubDlgProc, reinterpret_cast<LPARAM>(this));
@@ -1258,7 +1258,7 @@ __int64 CWarning::getMask() */
void CWarning::destroyAll()
{
- if(hWindowList)
+ if (hWindowList)
WindowList_Broadcast(hWindowList, WM_COMMAND, MAKEWPARAM(IDCANCEL, 0), 0);
}
/**
@@ -1273,21 +1273,21 @@ LRESULT CWarning::show(const int uId, DWORD dwFlags, const wchar_t* tszTxt) LRESULT result = 0;
wchar_t* _s = 0;
- if(0 == hWindowList)
+ if (0 == hWindowList)
hWindowList = reinterpret_cast<HANDLE>(::CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0));
/*
* don't open new warnings when shutdown was initiated (modal ones will otherwise
* block the shutdown)
*/
- if(CMimAPI::m_shutDown)
+ if (CMimAPI::m_shutDown)
return(-1);
- if(tszTxt)
+ if (tszTxt)
_s = const_cast<wchar_t *>(tszTxt);
else {
- if(uId != -1) {
- if(dwFlags & CWF_UNTRANSLATED)
+ if (uId != -1) {
+ if (dwFlags & CWF_UNTRANSLATED)
_s = TranslateTS(warnings[uId]);
else {
/*
@@ -1296,7 +1296,7 @@ LRESULT CWarning::show(const int uId, DWORD dwFlags, const wchar_t* tszTxt) */
_s = TranslateTS(warnings[uId]);
- if(wcslen(_s) < 3 || 0 == wcschr(_s, '|'))
+ if (wcslen(_s) < 3 || 0 == wcschr(_s, '|'))
_s = TranslateTS(warnings[uId]);
}
}
@@ -1310,20 +1310,20 @@ LRESULT CWarning::show(const int uId, DWORD dwFlags, const wchar_t* tszTxt) if ((wcslen(_s) > 3) && ((separator_pos = wcschr(_s, '|')) != 0)) {
- if(uId >= 0) {
+ if (uId >= 0) {
mask = getMask();
val = ((__int64)1L) << uId;
}
else
mask = val = 0;
- if(0 == (mask & val) || dwFlags & CWF_NOALLOWHIDE) {
+ if (0 == (mask & val) || dwFlags & CWF_NOALLOWHIDE) {
wchar_t *s = reinterpret_cast<wchar_t *>(mir_alloc((wcslen(_s) + 1) * 2));
wcscpy(s, _s);
separator_pos = wcschr(s, '|');
- if(separator_pos) {
+ if (separator_pos) {
separator_pos[0] = 0;
CWarning *w = new CWarning(s, &separator_pos[1], uId, dwFlags);
@@ -1350,13 +1350,13 @@ LRESULT CWarning::show(const int uId, DWORD dwFlags, const wchar_t* tszTxt) INT_PTR CALLBACK CWarning::stubDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
CWarning *w = reinterpret_cast<CWarning *>(::GetWindowLongPtr(hwnd, GWLP_USERDATA));
- if(w)
+ if (w)
return(w->dlgProc(hwnd, msg, wParam, lParam));
switch(msg) {
case WM_INITDIALOG: {
w = reinterpret_cast<CWarning *>(lParam);
- if(w) {
+ if (w) {
::SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam);
return(w->dlgProc(hwnd, msg, wParam, lParam));
}
@@ -1419,9 +1419,9 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP ::SetDlgItemTextW(hwnd, IDC_CAPTION, m_szTitle->c_str());
- if(m_dwFlags & CWF_NOALLOWHIDE)
+ if (m_dwFlags & CWF_NOALLOWHIDE)
Utils::showDlgControl(hwnd, IDC_DONTSHOWAGAIN, SW_HIDE);
- if(m_dwFlags & MB_YESNO || m_dwFlags & MB_YESNOCANCEL) {
+ if (m_dwFlags & MB_YESNO || m_dwFlags & MB_YESNOCANCEL) {
Utils::showDlgControl(hwnd, IDOK, SW_HIDE);
::SetFocus(::GetDlgItem(hwnd, IDCANCEL));
}
@@ -1431,16 +1431,16 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP Utils::showDlgControl(hwnd, IDNO, SW_HIDE);
::SetFocus(::GetDlgItem(hwnd, IDOK));
}
- if(m_dwFlags & MB_ICONERROR || m_dwFlags & MB_ICONHAND)
+ if (m_dwFlags & MB_ICONERROR || m_dwFlags & MB_ICONHAND)
uResId = 32513;
- else if(m_dwFlags & MB_ICONEXCLAMATION || m_dwFlags & MB_ICONWARNING)
+ else if (m_dwFlags & MB_ICONEXCLAMATION || m_dwFlags & MB_ICONWARNING)
uResId = 32515;
- else if(m_dwFlags & MB_ICONASTERISK || m_dwFlags & MB_ICONINFORMATION)
+ else if (m_dwFlags & MB_ICONASTERISK || m_dwFlags & MB_ICONINFORMATION)
uResId = 32516;
- else if(m_dwFlags & MB_ICONQUESTION)
+ else if (m_dwFlags & MB_ICONQUESTION)
uResId = 32514;
- if(uResId)
+ if (uResId)
hIcon = reinterpret_cast<HICON>(::LoadImage(0, MAKEINTRESOURCE(uResId), IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE));
else
hIcon = ::LoadSkinnedIconBig(SKINICON_EVENT_MESSAGE);
@@ -1456,7 +1456,7 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP case WM_CTLCOLORSTATIC: {
HWND hwndChild = reinterpret_cast<HWND>(lParam);
UINT id = ::GetDlgCtrlID(hwndChild);
- if(0 == m_hFontCaption) {
+ if (0 == m_hFontCaption) {
HFONT hFont = reinterpret_cast<HFONT>(::SendDlgItemMessage(hwnd, IDC_CAPTION, WM_GETFONT, 0, 0));
LOGFONT lf = {0};
@@ -1466,12 +1466,12 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP ::SendDlgItemMessage(hwnd, IDC_CAPTION, WM_SETFONT, (WPARAM)m_hFontCaption, FALSE);
}
- if(IDC_CAPTION == id) {
+ if (IDC_CAPTION == id) {
::SetTextColor(reinterpret_cast<HDC>(wParam), ::GetSysColor(COLOR_HIGHLIGHT));
::SendMessage(hwndChild, WM_SETFONT, (WPARAM)m_hFontCaption, FALSE);
}
- if(IDC_WARNGROUP != id && IDC_DONTSHOWAGAIN != id) {
+ if (IDC_WARNGROUP != id && IDC_DONTSHOWAGAIN != id) {
::SetBkColor((HDC)wParam, ::GetSysColor(COLOR_WINDOW));
return reinterpret_cast<INT_PTR>(::GetSysColorBrush(COLOR_WINDOW));
}
@@ -1524,7 +1524,7 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP ENLINK* e = reinterpret_cast<ENLINK *>(lParam);
const wchar_t* wszUrl = Utils::extractURLFromRichEdit(e, ::GetDlgItem(hwnd, IDC_WARNTEXT));
- if(wszUrl) {
+ if (wszUrl) {
char* szUrl = mir_t2a(wszUrl);
CallService(MS_UTILS_OPENURL, 1, (LPARAM)szUrl);
diff --git a/plugins/TabSRMM/tabmodplus/msgoptions_plus.cpp b/plugins/TabSRMM/tabmodplus/msgoptions_plus.cpp index ecacf9af49..9e69904228 100644 --- a/plugins/TabSRMM/tabmodplus/msgoptions_plus.cpp +++ b/plugins/TabSRMM/tabmodplus/msgoptions_plus.cpp @@ -160,15 +160,15 @@ INT_PTR CALLBACK PlusOptionsProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lPar break;
case WM_COMMAND:
- if(LOWORD(wParam) == IDC_PLUS_HELP) {
+ if (LOWORD(wParam) == IDC_PLUS_HELP) {
CallService(MS_UTILS_OPENURL, 0, (LPARAM)"http://wiki.miranda.or.at/TabSRMM/AdvancedTweaks");
break;
}
- else if(LOWORD(wParam) == IDC_PLUS_REVERT) { // revert to defaults...
+ else if (LOWORD(wParam) == IDC_PLUS_REVERT) { // revert to defaults...
TOptionListItem *lvItems = CTranslator::getTree(CTranslator::TREE_MODPLUS);
for (int i=0; lvItems[i].szName; i++)
- if(lvItems[i].uType == LOI_TYPE_SETTING)
+ if (lvItems[i].uType == LOI_TYPE_SETTING)
M->WriteByte(SRMSGMOD_T, (char *)lvItems[i].lParam, (BYTE)lvItems[i].id);
TreeView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_PLUS_CHECKTREE));
|