From 86ffbe56a77e202ee195bc48a8d61b454e256b84 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Fri, 28 Aug 2015 20:30:29 +0000 Subject: TabSEMM: - minor leak fixed - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@15073 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/TSButton.cpp | 1 - plugins/TabSRMM/src/buttonsbar.cpp | 5 ++-- plugins/TabSRMM/src/chat/muchighlight.cpp | 1 - plugins/TabSRMM/src/chat/options.cpp | 8 +----- plugins/TabSRMM/src/chat/tools.cpp | 2 -- plugins/TabSRMM/src/chat/window.cpp | 8 +++--- plugins/TabSRMM/src/contactcache.cpp | 17 ++++++------- plugins/TabSRMM/src/controls.cpp | 4 +-- plugins/TabSRMM/src/eventpopups.cpp | 16 +++--------- plugins/TabSRMM/src/hotkeyhandler.cpp | 18 ++++++-------- plugins/TabSRMM/src/infopanel.cpp | 31 ----------------------- plugins/TabSRMM/src/mim.cpp | 6 ----- plugins/TabSRMM/src/msgdialog.cpp | 5 ---- plugins/TabSRMM/src/msgdlgutils.cpp | 30 +++------------------- plugins/TabSRMM/src/msglog.cpp | 1 - plugins/TabSRMM/src/msgoptions.cpp | 10 -------- plugins/TabSRMM/src/msgs.cpp | 33 +++++-------------------- plugins/TabSRMM/src/sendlater.cpp | 18 -------------- plugins/TabSRMM/src/sendqueue.cpp | 9 ------- plugins/TabSRMM/src/sidebar.cpp | 14 +++-------- plugins/TabSRMM/src/srmm.cpp | 1 - plugins/TabSRMM/src/tabctrl.cpp | 12 ++------- plugins/TabSRMM/src/taskbar.cpp | 21 +++++++--------- plugins/TabSRMM/src/templates.cpp | 24 +++++++----------- plugins/TabSRMM/src/themes.cpp | 41 +------------------------------ plugins/TabSRMM/src/trayicon.cpp | 7 ++---- plugins/TabSRMM/src/typingnotify.cpp | 12 ++++----- plugins/TabSRMM/src/userprefs.cpp | 5 +--- plugins/TabSRMM/src/utils.cpp | 28 +-------------------- 29 files changed, 71 insertions(+), 317 deletions(-) (limited to 'plugins/TabSRMM/src') diff --git a/plugins/TabSRMM/src/TSButton.cpp b/plugins/TabSRMM/src/TSButton.cpp index b23255df43..3f6feaa5b5 100644 --- a/plugins/TabSRMM/src/TSButton.cpp +++ b/plugins/TabSRMM/src/TSButton.cpp @@ -82,7 +82,6 @@ int TSAPI RBStateConvert2Flat(int state) * * @return int: state item id */ - static void PaintWorker(TSButtonCtrl *ctl, HDC hdcPaint) { if (hdc_buttonglyph == 0) { diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index db8b222025..af20410a10 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -1324,7 +1324,6 @@ BOOL BB_SetButtonsPos(TWindowData *dat) void BB_CustomButtonClick(TWindowData *dat, DWORD idFrom, HWND hwndFrom, BOOL code) { RECT rc; - int i; BOOL bFromArrow = 0; CustomButtonClickData cbcd = { 0 }; @@ -1332,7 +1331,7 @@ void BB_CustomButtonClick(TWindowData *dat, DWORD idFrom, HWND hwndFrom, BOOL co cbcd.pt.x = rc.left; cbcd.pt.y = rc.bottom; - for (i = 0; i < LButtonsList.getCount(); i++) { + for (int i = 0; i < LButtonsList.getCount(); i++) { CustomButtonData* cbd = LButtonsList[i]; if (cbd->m_dwButtonCID == idFrom) { cbcd.pszModule = cbd->m_pszModuleName; @@ -1346,7 +1345,7 @@ void BB_CustomButtonClick(TWindowData *dat, DWORD idFrom, HWND hwndFrom, BOOL co } if (!cbcd.pszModule) - for (i = 0; i < RButtonsList.getCount(); i++) { + for (int i = 0; i < RButtonsList.getCount(); i++) { CustomButtonData* cbd = RButtonsList[i]; if (cbd->m_dwButtonCID == idFrom) { cbcd.pszModule = cbd->m_pszModuleName; diff --git a/plugins/TabSRMM/src/chat/muchighlight.cpp b/plugins/TabSRMM/src/chat/muchighlight.cpp index cef2d0b66e..aae914e5a4 100644 --- a/plugins/TabSRMM/src/chat/muchighlight.cpp +++ b/plugins/TabSRMM/src/chat/muchighlight.cpp @@ -181,7 +181,6 @@ skip_textpatterns: * * @param Standard Windows dialog procedure parameters */ - INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp index 8b857c7eb2..9adb9f46dc 100644 --- a/plugins/TabSRMM/src/chat/options.cpp +++ b/plugins/TabSRMM/src/chat/options.cpp @@ -345,7 +345,6 @@ void Chat_AddIcons(void) /* * get icon by name from the core icon library service */ - HICON LoadIconEx(char *pszIcoLibName) { char szTemp[256]; @@ -936,12 +935,7 @@ static UINT _eventorder[] = GC_EVENT_PART | GC_EVENT_TOPIC | GC_EVENT_ADDSTATUS | GC_EVENT_INFORMATION | GC_EVENT_QUIT | \ GC_EVENT_KICK | GC_EVENT_NOTICE) -/** - * Dialog procedure for group chat options tab #3 (event filter configuration) - * - * @return - */ - +// Dialog procedure for group chat options tab #3 (event filter configuration) INT_PTR CALLBACK DlgProcOptions3(HWND hwndDlg, UINT uMsg, WPARAM, LPARAM lParam) { switch (uMsg) { diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index 5b82f8b8e4..265c7937d8 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -491,7 +491,6 @@ TCHAR* my_strstri(const TCHAR* s1, const TCHAR* s2) * log the event to the log file * allows selective logging of wanted events */ - BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) { if (!si || !gce) @@ -609,7 +608,6 @@ void DestroyGCMenu(HMENU *hMenu, int iIndex) * set all filters and notification config for a session * uses per channel mask + filterbits, default config as backup */ - void Chat_SetFilters(SESSION_INFO *si) { if (si == NULL) diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index a7490efb38..fbaf36318c 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -885,8 +885,6 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, dat->lastEnterTime = 0; return 0; } - if (wParam == VK_RETURN) - break; // fall through case WM_LBUTTONDOWN: @@ -1522,11 +1520,13 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, return FALSE; case WM_CONTEXTMENU: - TVHITTESTINFO hti; { SESSION_INFO *parentdat = dat->si; + if (parentdat == NULL) + break; int height = 0; + TVHITTESTINFO hti; hti.pt.x = GET_X_LPARAM(lParam); hti.pt.y = GET_Y_LPARAM(lParam); if (hti.pt.x == -1 && hti.pt.y == -1) { @@ -1559,7 +1559,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, break; case 20020: // add to highlight... - if (parentdat && ui) { + { THighLightEdit the = { THighLightEdit::CMD_ADD, parentdat, ui }; HWND hwndDlg = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_ADDHIGHLIGHT), parentdat->dat->pContainer->hwnd, CMUCHighlight::dlgProcAdd, (LPARAM)&the); TranslateDialogDefault(hwndDlg); diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index e6e829119b..a9c3a81940 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -115,12 +115,11 @@ void CContactCache::updateState() */ bool CContactCache::updateNick() { - bool fChanged = false; - + bool fChanged = false; if (m_Valid) { - TCHAR *tszNick = pcli->pfnGetContactDisplayName(getActiveContact(), 0); - if (tszNick) - fChanged = (mir_tstrcmp(m_szNick, tszNick) ? true : false); + TCHAR *tszNick = pcli->pfnGetContactDisplayName(getActiveContact(), 0); + if (tszNick && mir_tstrcmp(m_szNick, tszNick)) + fChanged = true; _tcsncpy_s(m_szNick, (tszNick ? tszNick : _T("")), _TRUNCATE); } return fChanged; @@ -272,12 +271,9 @@ void CContactCache::setWindowData(const HWND hwnd, TWindowData *dat) * saves message to the input history. * it's using streamout in UTF8 format - no unicode "issues" and all RTF formatting is saved to the history. */ - void CContactCache::saveHistory(WPARAM wParam, LPARAM) { - size_t iLength = 0, iStreamLength = 0; - int oldTop = 0; - char* szFromStream = NULL; + int oldTop = 0; if (m_hwnd == 0 || m_dat == 0) return; @@ -287,8 +283,9 @@ void CContactCache::saveHistory(WPARAM wParam, LPARAM) m_iHistoryTop = (int)wParam; } - szFromStream = ::Message_GetFromStream(GetDlgItem(m_hwnd, IDC_MESSAGE), SF_RTFNOOBJS | SFF_PLAINRTF | SF_NCRFORNONASCII); + char *szFromStream = ::Message_GetFromStream(GetDlgItem(m_hwnd, IDC_MESSAGE), SF_RTFNOOBJS | SFF_PLAINRTF | SF_NCRFORNONASCII); if (szFromStream != NULL) { + size_t iLength = 0, iStreamLength = 0; iLength = iStreamLength = (mir_strlen(szFromStream) + 1); if (iLength > 0 && m_history != NULL) { // XXX: iLength > 1 ? diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp index 2b756b52f0..957f8604eb 100644 --- a/plugins/TabSRMM/src/controls.cpp +++ b/plugins/TabSRMM/src/controls.cpp @@ -967,9 +967,9 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR if (!mir_strcmp(sid->szModule, MSG_ICON_MODULE)) { if (sid->dwId == MSG_ICON_SOUND) mir_sntprintf(wBuf, TranslateT("Sounds are %s. Click to toggle status, hold SHIFT and click to set for all open containers"), - pContainer->dwFlags & CNT_NOSOUND ? TranslateT("disabled") : TranslateT("enabled")); + pContainer->dwFlags & CNT_NOSOUND ? TranslateT("disabled") : TranslateT("enabled")); - else if (sid->dwId == MSG_ICON_UTN && dat && (dat->bType == SESSIONTYPE_IM || dat->si->iType == GCW_PRIVMESS)) { + else if (sid->dwId == MSG_ICON_UTN && (dat->bType == SESSIONTYPE_IM || dat->si->iType == GCW_PRIVMESS)) { int mtnStatus = db_get_b(dat->hContact, SRMSGMOD, SRMSGSET_TYPING, M.GetByte(SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW)); mir_sntprintf(wBuf, TranslateT("Sending typing notifications is %s."), mtnStatus ? TranslateT("enabled") : TranslateT("disabled")); diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index 83c12082e3..8acc0cc29f 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -651,10 +651,8 @@ static int TSAPI PopupPreview(NEN_OPTIONS *pluginOptions) return 0; } -/* -* updates the menu entry... -* bForced is used to only update the status, nickname etc. and does NOT update the unread count -*/ +// updates the menu entry... +// bForced is used to only update the status, nickname etc. and does NOT update the unread count void TSAPI UpdateTrayMenuState(TWindowData *dat, BOOL bForced) { if (PluginConfig.g_hMenuTrayUnread == 0 || dat->hContact == NULL) @@ -685,10 +683,7 @@ void TSAPI UpdateTrayMenuState(TWindowData *dat, BOOL bForced) SetMenuItemInfo(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)dat->hContact, FALSE, &mii); } -/* - * if we want tray support, add the contact to the list of unread sessions in the tray menu - */ - +// if we want tray support, add the contact to the list of unread sessions in the tray menu int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szProto, const TCHAR *szStatus, MCONTACT hContact, DWORD fromEvent) { if (!PluginConfig.g_hMenuTrayUnread || hContact == 0 || szProto == NULL) @@ -810,10 +805,7 @@ passed: return 0; } -/** -* remove all popups for hContact, but only if the mask matches the current "mode" -*/ - +// remove all popups for hContact, but only if the mask matches the current "mode" void TSAPI DeletePopupsForContact(MCONTACT hContact, DWORD dwMask) { if (!(dwMask & nen_options.dwRemoveMask) || nen_options.iDisable || !PluginConfig.g_bPopupAvail) diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index 2df19095ab..ddab303cd4 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -146,8 +146,6 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP return 0; } - TContainerData *pCont; - switch (msg) { case WM_CREATE: for (int i = 0; i < _countof(_hotkeydescs); i++) { @@ -211,7 +209,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP HICON hIcon; if (dis->itemData > 0) - hIcon = dis->itemData & 0x10000000 ? pci->hIcons[ICON_HIGHLIGHT] : PluginConfig.g_IconMsgEvent; + hIcon = (dis->itemData & 0x10000000) ? pci->hIcons[ICON_HIGHLIGHT] : PluginConfig.g_IconMsgEvent; else if (dat != NULL) { hIcon = MY_GetContactIcon(dat, 0); idle = dat->idle; @@ -323,11 +321,11 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP nen_options.iNoAutoPopup ^= 1; break; case ID_TRAYCONTEXT_HIDEALLMESSAGECONTAINERS: - for (pCont = pFirstContainer; pCont; pCont = pCont->pNext) + for (TContainerData *pCont = pFirstContainer; pCont; pCont = pCont->pNext) ShowWindow(pCont->hwnd, SW_HIDE); break; case ID_TRAYCONTEXT_RESTOREALLMESSAGECONTAINERS: - for (pCont = pFirstContainer; pCont; pCont = pCont->pNext) + for (TContainerData *pCont = pFirstContainer; pCont; pCont = pCont->pNext) ShowWindow(pCont->hwnd, SW_SHOW); break; case ID_TRAYCONTEXT_BE: @@ -335,7 +333,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP nen_options.iNoSounds = 1; nen_options.iNoAutoPopup = 1; - for (pCont = pFirstContainer; pCont; pCont = pCont->pNext) + for (TContainerData *pCont = pFirstContainer; pCont; pCont = pCont->pNext) SendMessage(pCont->hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 1); break; } @@ -458,7 +456,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP { bool bNewAero = M.getAeroState(); // refresh dwm state - for (pCont = pFirstContainer; pCont; pCont = pCont->pNext) { + for (TContainerData *pCont = pFirstContainer; pCont; pCont = pCont->pNext) { if (bNewAero) SetAeroMargins(pCont); else { @@ -496,7 +494,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP FreeTabConfig(); ReloadTabConfig(); - for (pCont = pFirstContainer; pCont; pCont = pCont->pNext) { + for (TContainerData *pCont = pFirstContainer; pCont; pCont = pCont->pNext) { SendDlgItemMessage(pCont->hwnd, IDC_MSGTABS, EM_THEMECHANGED, 0, 0); BroadCastContainer(pCont, EM_THEMECHANGED, 0, 0); } @@ -547,7 +545,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_POWERBROADCAST: case WM_DISPLAYCHANGE: - for (pCont = pFirstContainer; pCont; pCont = pCont->pNext) + for (TContainerData *pCont = pFirstContainer; pCont; pCont = pCont->pNext) if (CSkin::m_skinEnabled) { // invalidate cached background DCs for skinned containers pCont->oldDCSize.cx = pCont->oldDCSize.cy = 0; SelectObject(pCont->cachedDC, pCont->oldHBM); @@ -570,7 +568,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (wParam == TIMERID_SENDLATER) { // send heartbeat to each container, they use this to update // dynamic content (i.e. local time in the info panel). - for (pCont = pFirstContainer; pCont; pCont = pCont->pNext) + for (TContainerData *pCont = pFirstContainer; pCont; pCont = pCont->pNext) SendMessage(pCont->hwnd, WM_TIMER, TIMERID_HEARTBEAT, 0); // process send later contacts and jobs, if enough time has elapsed diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp index 5b2cccb984..6314e59e0e 100644 --- a/plugins/TabSRMM/src/infopanel.cpp +++ b/plugins/TabSRMM/src/infopanel.cpp @@ -74,7 +74,6 @@ void CInfoPanel::setActive(const int newActive) ///////////////////////////////////////////////////////////////////////////////////////// // Load height. Private panel height is indicated by 0xffff for the high word - void CInfoPanel::loadHeight() { BYTE bSync = M.GetByte("syncAllPanels", 0); // sync muc <> im panels @@ -101,7 +100,6 @@ void CInfoPanel::loadHeight() // Save current panel height to the database // // @param fFlush bool: flush values to database (usually only requested by destructor) - void CInfoPanel::saveHeight(bool fFlush) { BYTE bSync = M.GetByte("syncAllPanels", 0); @@ -140,7 +138,6 @@ void CInfoPanel::saveHeight(bool fFlush) // @param newHeight LONG: the new height. // @param fBroadcast bool: broadcast the new height to all open sessions, respect // container's private setting flag. - void CInfoPanel::setHeight(LONG newHeight, bool fBroadcast) { if (newHeight < MIN_PANELHEIGHT || newHeight > 100) @@ -222,7 +219,6 @@ void CInfoPanel::showHide() const // if applicable, local (per contact) override. // // @return bool: panel is visible for this session - bool CInfoPanel::getVisibility() { if (m_dat->hContact == 0) { @@ -261,7 +257,6 @@ void CInfoPanel::mapRealRectOnTop(const RECT& rcSrc, RECT& rcDest, const SIZE& s // returns the previosuly selected font // // caller should not forget to delete the font! - HFONT CInfoPanel::setUnderlinedFont(const HDC hdc, HFONT hFontOrig) { LOGFONT lf; @@ -279,7 +274,6 @@ HFONT CInfoPanel::setUnderlinedFont(const HDC hdc, HFONT hFontOrig) // @param rc RECT&: target rectangle // @param item CSkinItem *: The item to render in non-aero mode // @param bAero bool: aero active - void CInfoPanel::renderBG(const HDC hdc, RECT& rc, CSkinItem *item, bool bAero, bool fAutoCalc) const { if (!m_active) @@ -325,7 +319,6 @@ void CInfoPanel::renderBG(const HDC hdc, RECT& rc, CSkinItem *item, bool bAero, // message window's WM_SIZE handler). // // @param hdc HDC: target device context - void CInfoPanel::renderContent(const HDC hdc) { if (!m_active) @@ -380,7 +373,6 @@ void CInfoPanel::renderContent(const HDC hdc) // @param hdc HDC: target DC for drawing // // @param rcItem RECT &: target rectangle - void CInfoPanel::RenderIPNickname(const HDC hdc, RECT &rcItem) { const TCHAR *szStatusMsg = NULL; @@ -474,7 +466,6 @@ void CInfoPanel::RenderIPNickname(const HDC hdc, RECT &rcItem) // // @param hdc HDC: device context for drawing. // @param rcItem RECT &: target rectangle for drawing - void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem) { ::SetBkMode(hdc, TRANSPARENT); @@ -525,7 +516,6 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem) ///////////////////////////////////////////////////////////////////////////////////////// // Render the info panel status field. Usually in the 2nd line, right aligned // @param hdc : target device context - void CInfoPanel::RenderIPStatus(const HDC hdc, RECT& rcItem) { SIZE sProto = { 0 }, sStatus = { 0 }, sTime = { 0 }; @@ -599,7 +589,6 @@ void CInfoPanel::RenderIPStatus(const HDC hdc, RECT& rcItem) // // @param hdc HDC: device context for drawing. // @param rcItem RECT &: target rectangle for drawing - void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem) { SESSION_INFO *si = reinterpret_cast(m_dat->si); @@ -658,7 +647,6 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem) // Draw 2nd line of text in the info panel. // @param hdc : target device context // @param rcItem : target rectangle - void CInfoPanel::Chat_RenderIPSecondLine(const HDC hdc, RECT& rcItem) { SESSION_INFO *si = reinterpret_cast(m_dat->si); @@ -691,7 +679,6 @@ void CInfoPanel::Chat_RenderIPSecondLine(const HDC hdc, RECT& rcItem) ///////////////////////////////////////////////////////////////////////////////////////// // Invalidate the info panel rectangle - void CInfoPanel::Invalidate(BOOL fErase) const { if (m_active) { @@ -705,7 +692,6 @@ void CInfoPanel::Invalidate(BOOL fErase) const ///////////////////////////////////////////////////////////////////////////////////////// // build the left click contextual menu for the info panel // @return HMENU: menu handle for the fully prepared menu - HMENU CInfoPanel::constructContextualMenu() const { MENUITEMINFO mii = { 0 }; @@ -744,7 +730,6 @@ HMENU CInfoPanel::constructContextualMenu() const // // @param cmd command id // @return 0 if command was processed, != 0 otherwise - LRESULT CInfoPanel::cmdHandler(UINT cmd) { switch (cmd) { @@ -774,7 +759,6 @@ LRESULT CInfoPanel::cmdHandler(UINT cmd) // handle mouse clicks on the info panel. // // @param pt: mouse cursor pos - void CInfoPanel::handleClick(const POINT& pt) { if (!m_active || m_hoverFlags == 0) @@ -802,7 +786,6 @@ void CInfoPanel::handleClick(const POINT& pt) // // @param pt POINT (in screen coordinates) // @return Hit test result or 0 if none applies. - int CInfoPanel::hitTest(POINT pt) { ::ScreenToClient(m_dat->hwnd, &pt); @@ -822,7 +805,6 @@ int CInfoPanel::hitTest(POINT pt) // and to hover the info panel fields. // // @param pt : mouse coordinates (screen) - void CInfoPanel::trackMouse(POINT &pt) { if (!m_active) @@ -866,7 +848,6 @@ void CInfoPanel::trackMouse(POINT &pt) // activate a tooltip // @param ctrlId : control id // @param lParam : typically a TCHAR * for the tooltip text - void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam) { if (!m_active || !m_dat->hwndTip) @@ -940,7 +921,6 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam) // this is only used from outside (i.e. container window dialog) // // hwndNew = window to become active (as reported by WM_ACTIVATE). - void CInfoPanel::hideTip(const HWND hwndNew) { if (m_tip) { @@ -957,7 +937,6 @@ void CInfoPanel::hideTip(const HWND hwndNew) // (ACC window class). Only required when support for animated avatars is enabled because // native avatar rendering does not support animated images. // To avoid clipping issues, this is done during WM_ERASEBKGND. - LRESULT CALLBACK CInfoPanel::avatarParentSubclass(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { @@ -1035,7 +1014,6 @@ LRESULT CALLBACK CInfoPanel::avatarParentSubclass(HWND hwnd, UINT msg, WPARAM wP // our userdata. Real processing is done by ConfigDlgProc() // // @params Like a normal dialog procedure - INT_PTR CALLBACK CInfoPanel::ConfigDlgProcStub(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { CInfoPanel *infoPanel = reinterpret_cast(::GetWindowLongPtr(hwnd, GWLP_USERDATA)); @@ -1054,7 +1032,6 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProcStub(HWND hwnd, UINT msg, WPARAM wPara ///////////////////////////////////////////////////////////////////////////////////////// // dialog procedure for the info panel config popup - INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { @@ -1242,7 +1219,6 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L // invoke info panel config popup dialog // @param pt : mouse coordinates (screen) // @return : always 0 - int CInfoPanel::invokeConfigDialog(const POINT &pt) { if (!m_active) @@ -1281,7 +1257,6 @@ int CInfoPanel::invokeConfigDialog(const POINT &pt) // remove the info panel configuration dialog // @param fForced: bool, if true, dismiss it under any circumstances, even // with the pointer still inside the dialog. - void CInfoPanel::dismissConfig(bool fForced) { if (m_hwndConfig == 0) @@ -1308,7 +1283,6 @@ void CInfoPanel::dismissConfig(bool fForced) // @param hContact HANDLE contact handle // @param pszText TCHAR* the content of the rich edit control // @param panel CInfoPanel* the panel which owns it - CTip::CTip(const HWND hwndParent, const MCONTACT hContact, const TCHAR *pszText, const CInfoPanel* panel) { m_hwnd = ::CreateWindowEx(WS_EX_TOOLWINDOW, _T("RichEditTipClass"), _T(""), (M.isAero() ? WS_THICKFRAME : WS_BORDER) | WS_POPUPWINDOW | WS_TABSTOP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, @@ -1338,7 +1312,6 @@ CTip::CTip(const HWND hwndParent, const MCONTACT hContact, const TCHAR *pszText, // @param pt point in screen coordinates // @param hIcon optional icon to display in the tip header // @param szTitle optional title to display in the tip header - void CTip::show(const RECT& rc, POINT& pt, const HICON hIcon, const TCHAR *szTitle) { HDC hdc = ::GetDC(m_hwnd); @@ -1411,7 +1384,6 @@ void CTip::show(const RECT& rc, POINT& pt, const HICON hIcon, const TCHAR *szTit ///////////////////////////////////////////////////////////////////////////////////////// // register richedit tooltip window class - void CTip::registerClass() { WNDCLASSEX wc = { 0 }; @@ -1427,7 +1399,6 @@ void CTip::registerClass() ///////////////////////////////////////////////////////////////////////////////////////// // subclass the rich edit control inside the tip. Needed to hide the blinking // caret and prevent all scrolling actions. - LRESULT CALLBACK CTip::RichEditProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { @@ -1453,7 +1424,6 @@ LRESULT CALLBACK CTip::RichEditProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l ///////////////////////////////////////////////////////////////////////////////////////// // stub for the tip control window procedure. Just handle WM_CREATE and set the // this pointer. - LRESULT CALLBACK CTip::WndProcStub(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { CTip *tip = reinterpret_cast(::GetWindowLongPtr(hwnd, GWLP_USERDATA)); @@ -1470,7 +1440,6 @@ LRESULT CALLBACK CTip::WndProcStub(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP ///////////////////////////////////////////////////////////////////////////////////////// // the window procedure for the tooltip window. - INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { POINT pt; diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index 0672bb15f9..0b9ddfe22d 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -53,7 +53,6 @@ bool CMimAPI::m_haveBufferedPaint = false; ///////////////////////////////////////////////////////////////////////////////////////// // window list functions - void CMimAPI::BroadcastMessage(UINT msg, WPARAM wParam, LPARAM lParam) { WindowList_Broadcast(m_hMessageWindowList, msg, wParam, lParam); @@ -183,7 +182,6 @@ bool CMimAPI::getAeroState() ///////////////////////////////////////////////////////////////////////////////////////// // Initialize various Win32 API functions which are not common to all versions of Windows. // We have to work with functions pointers here. - void CMimAPI::InitAPI() { DWORD dwVer = LOWORD(GetVersion()); @@ -228,7 +226,6 @@ void CMimAPI::InitAPI() ///////////////////////////////////////////////////////////////////////////////////////// // hook subscriber function for incoming message typing events - int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode) { int foundWin = 0, preTyping = 0; @@ -331,7 +328,6 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode) // it to the owners window // // ACKTYPE_AVATAR no longer handled here, because we have avs services now. - int CMimAPI::ProtoAck(WPARAM, LPARAM lParam) { ACKDATA *pAck = (ACKDATA*)lParam; @@ -387,7 +383,6 @@ int CMimAPI::PrebuildContactMenu(WPARAM hContact, LPARAM) // // this handler POSTs the event to the message window procedure - so it is fast and can exit quickly which will // improve the overall responsiveness when receiving messages. - int CMimAPI::DispatchNewEvent(WPARAM hContact, LPARAM hDbEvent) { if (hContact) { @@ -407,7 +402,6 @@ int CMimAPI::DispatchNewEvent(WPARAM hContact, LPARAM hDbEvent) // session(tab) must be created. // // if a session is already created, it just does nothing and DispatchNewEvent() will take care. - int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM hDbEvent) { TCHAR szName[CONTAINER_NAMELEN + 1]; diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index e5b790f142..a69d9e87e8 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -79,7 +79,6 @@ static void _clrMsgFilter(LPARAM lParam) // @param idFrom dlg ctrl id // @param hwndFrom src window handle // @param pt mouse pointer position - static void ShowPopupMenu(TWindowData *dat, int idFrom, HWND hwndFrom, POINT pt) { CHARRANGE sel, all = { 0, -1 }; @@ -214,7 +213,6 @@ LRESULT CALLBACK IEViewSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l ///////////////////////////////////////////////////////////////////////////////////////// // sublassing procedure for the h++ based message log viewer - LRESULT CALLBACK HPPKFSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { TWindowData *mwdat = (TWindowData*)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA); @@ -252,7 +250,6 @@ LRESULT CALLBACK HPPKFSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP // // it protects itself from being called more than once per session activation and is valid for // normal IM sessions *only*. Group chat sessions have their own activation handler (see chat/window.c) - static void MsgWindowUpdateState(TWindowData *dat, UINT msg) { if (dat == NULL || dat->iTabID < 0) @@ -771,7 +768,6 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar ///////////////////////////////////////////////////////////////////////////////////////// // subclasses the avatar display controls, needed for skinning and to prevent // it from flickering during resize/move operations. - static LRESULT CALLBACK AvatarSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { @@ -937,7 +933,6 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM ///////////////////////////////////////////////////////////////////////////////////////// // resizer proc for the "new" layout. - static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL * urc) { TWindowData *dat = (TWindowData*)lParam; diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 2bae8fe5e1..fa6753fd89 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -70,7 +70,6 @@ bool TSAPI IsCustomEvent(int eventType) // reorder tabs within a container. fSavePos indicates whether the new position should // be saved to the contacts db record (if so, the container will try to open the tab // at the saved position later) - void TSAPI RearrangeTab(HWND hwndDlg, const TWindowData *dat, int iMode, BOOL fSavePos) { if (dat == NULL || !IsWindow(hwndDlg)) @@ -100,7 +99,6 @@ void TSAPI RearrangeTab(HWND hwndDlg, const TWindowData *dat, int iMode, BOOL fS ///////////////////////////////////////////////////////////////////////////////////////// // subclassing for the save as file dialog (needed to set it to thumbnail view on Windows 2000 // or later - static UINT_PTR CALLBACK OpenFileSubclass(HWND hwnd, UINT msg, WPARAM, LPARAM lParam) { switch (msg) { @@ -126,7 +124,6 @@ static UINT_PTR CALLBACK OpenFileSubclass(HWND hwnd, UINT msg, WPARAM, LPARAM lP // saves a contact picture to disk // takes hbm (bitmap handle) and bool isOwnPic (1 == save the picture as your own avatar) // requires AVS and ADVAIMG services (Miranda 0.7+) - static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic) { TCHAR szFinalFilename[MAX_PATH]; @@ -194,7 +191,6 @@ static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic) ///////////////////////////////////////////////////////////////////////////////////////// // flash a tab icon if mode = true, otherwise restore default icon // store flashing state into bState - void TSAPI FlashTab(TWindowData *dat, HWND hwndTab, int iTabindex, BOOL *bState, BOOL mode, HICON origImage) { if (mode) @@ -212,7 +208,6 @@ void TSAPI FlashTab(TWindowData *dat, HWND hwndTab, int iTabindex, BOOL *bState, ///////////////////////////////////////////////////////////////////////////////////////// // calculates avatar layouting, based on splitter position to find the optimal size // for the avatar w/o disturbing the toolbar too much. - void TSAPI CalcDynamicAvatarSize(TWindowData *dat, BITMAP *bminfo) { if (dat->dwFlags & MWF_WASBACKGROUNDCREATE || dat->pContainer->dwFlags & CNT_DEFERREDCONFIGURE || dat->pContainer->dwFlags & CNT_CREATE_MINIMIZED || IsIconic(dat->pContainer->hwnd)) @@ -420,7 +415,6 @@ int TSAPI MsgWindowMenuHandler(TWindowData *dat, int selection, int menuId) ///////////////////////////////////////////////////////////////////////////////////////// // update the status bar field which displays the number of characters in the input area // and various indicators (caps lock, num lock, insert mode). - void TSAPI UpdateReadChars(const TWindowData *dat) { if (dat && (dat->pContainer->hwndStatus && dat->pContainer->hwndActive == dat->hwnd)) { @@ -460,7 +454,6 @@ void TSAPI UpdateReadChars(const TWindowData *dat) ///////////////////////////////////////////////////////////////////////////////////////// // update all status bar fields and force a redraw of the status bar. - void TSAPI UpdateStatusBar(const TWindowData *dat) { if (dat && dat->pContainer->hwndStatus && dat->pContainer->hwndActive == dat->hwnd) { @@ -497,7 +490,6 @@ void TSAPI UpdateStatusBar(const TWindowData *dat) // // NOT used for typing notification feedback as this is handled directly from the // MTN handler. - void TSAPI HandleIconFeedback(TWindowData *dat, HICON iIcon) { TCITEM item = { 0 }; @@ -520,7 +512,6 @@ void TSAPI HandleIconFeedback(TWindowData *dat, HICON iIcon) ///////////////////////////////////////////////////////////////////////////////////////// // catches notifications from the AVS controls - void TSAPI ProcessAvatarChange(HWND hwnd, LPARAM lParam) { if (((LPNMHDR)lParam)->code == NM_AVATAR_CHANGED) { @@ -541,7 +532,6 @@ void TSAPI ProcessAvatarChange(HWND hwnd, LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////// // retrieve the visiblity of the avatar window, depending on the global setting // and local mode - bool TSAPI GetAvatarVisibility(HWND hwndDlg, TWindowData *dat) { BYTE bAvatarMode = dat->pContainer->avatarMode; @@ -627,7 +617,6 @@ bool TSAPI GetAvatarVisibility(HWND hwndDlg, TWindowData *dat) ///////////////////////////////////////////////////////////////////////////////////////// // checks, if there is a valid smileypack installed for the given protocol - int TSAPI CheckValidSmileyPack(const char *szProto, MCONTACT hContact) { if (!PluginConfig.g_SmileyAddAvail) @@ -645,7 +634,6 @@ int TSAPI CheckValidSmileyPack(const char *szProto, MCONTACT hContact) ///////////////////////////////////////////////////////////////////////////////////////// // return value MUST be mir_free()'d by caller. - TCHAR* TSAPI QuoteText(const TCHAR *text) { int outChar, lineChar; @@ -789,7 +777,6 @@ void TSAPI FlashOnClist(HWND hwndDlg, TWindowData *dat, MEVENT hEvent, DBEVENTIN // typed message before sending it. // caller must mir_free the returned pointer. // UNICODE version returns UTF-8 encoded string. - static DWORD CALLBACK Message_StreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb) { static DWORD dwRead; @@ -832,10 +819,6 @@ char* TSAPI Message_GetFromStream(HWND hwndRtf, DWORD dwPassedFlags) return pszText; // pszText contains the text } -///////////////////////////////////////////////////////////////////////////////////////// -// convert rich edit code to bbcode (if wanted). Otherwise, strip all RTF formatting -// tags and return plain text - static TCHAR tszRtfBreaks[] = _T(" \\\n\r"); static void CreateColorMap(CMString &Text, int iCount, COLORREF *pSrc, int *pDst) @@ -881,6 +864,9 @@ static int GetRtfIndex(int iCol, int iCount, int *pIndex) return -1; } +///////////////////////////////////////////////////////////////////////////////////////// +// convert rich edit code to bbcode (if wanted). Otherwise, strip all RTF formatting +// tags and return plain text BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors, COLORREF *pColors) { if (pszText.IsEmpty()) @@ -1034,7 +1020,6 @@ BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors ///////////////////////////////////////////////////////////////////////////////////////// // retrieve both buddys and my own UIN for a message session and store them in the message window *dat // respects metacontacts and uses the current protocol if the contact is a MC - void TSAPI GetMYUIN(TWindowData *dat) { CONTACTINFO ci = { sizeof(ci) }; @@ -1241,7 +1226,6 @@ void TSAPI PlayIncomingSound(const TWindowData *dat) ///////////////////////////////////////////////////////////////////////////////////////// // reads send format and configures the toolbar buttons // if mode == 0, int only configures the buttons and does not change send format - void TSAPI GetSendFormat(TWindowData *dat) { UINT controls[5] = { IDC_FONTBOLD, IDC_FONTITALIC, IDC_FONTUNDERLINE, IDC_FONTSTRIKEOUT, IDC_FONTFACE }; @@ -1262,7 +1246,6 @@ void TSAPI GetSendFormat(TWindowData *dat) // keyboard layout. // // GetLocaleInfo() should no longer be used on Vista and later - void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName) { TCHAR szLI[256], *stopped = NULL; @@ -1387,7 +1370,6 @@ void TSAPI LoadTimeZone(TWindowData *dat) } // paste contents of the clipboard into the message input area and send it immediately - void TSAPI HandlePasteAndSend(const TWindowData *dat) { UINT ctrlID = dat->bType == SESSIONTYPE_IM ? IDC_MESSAGE : IDC_CHAT_MESSAGE; @@ -1405,7 +1387,6 @@ void TSAPI HandlePasteAndSend(const TWindowData *dat) ///////////////////////////////////////////////////////////////////////////////////////// // draw various elements of the message window, like avatar(s), info panel fields // and the color formatting menu - int TSAPI MsgWindowDrawHandler(WPARAM, LPARAM lParam, TWindowData *dat) { if (!dat) @@ -1792,7 +1773,6 @@ HICON TSAPI MY_GetContactIcon(const TWindowData *dat, LPCSTR szSetting) ///////////////////////////////////////////////////////////////////////////////////////// // read keyboard state and return the state of the modifier keys - void TSAPI KbdState(TWindowData *dat, BOOL& isShift, BOOL& isControl, BOOL& isAlt) { GetKeyboardState(dat->kstate); @@ -1804,7 +1784,6 @@ void TSAPI KbdState(TWindowData *dat, BOOL& isShift, BOOL& isControl, BOOL& isAl ///////////////////////////////////////////////////////////////////////////////////////// // clear the message log // code needs to distuingish between IM and MUC sessions. - void TSAPI ClearLog(TWindowData *dat) { if (dat && dat->bType == SESSIONTYPE_IM) { @@ -1849,7 +1828,6 @@ void TSAPI ClearLog(TWindowData *dat) // // the container will use this in its WM_GETMINMAXINFO handler to set // minimum tracking height. - void TSAPI DetermineMinHeight(TWindowData *dat) { if (!dat) @@ -1890,7 +1868,6 @@ LONG TSAPI GetDefaultMinimumInputHeight(const TWindowData *dat) static LIST vTempFilenames(5); // send a pasted bitmap by file transfer. - void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp) { const wchar_t* mirandatempdir = L"Miranda"; @@ -1992,7 +1969,6 @@ void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp) } // remove all temporary files created by the "send clipboard as file" feature. - void TSAPI CleanTempFiles() { for (int i = 0; i < vTempFilenames.getCount(); i++) { diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index a02cbf2f66..c7fceb93a2 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -107,7 +107,6 @@ __forceinline char *GetRTFFont(DWORD dwIndex) * the highlight code (individual background colors). * Doesn't touch the message for sure, but empty lines at the end are ugly anyway. */ - static void TrimMessage(TCHAR *msg) { size_t iLen = mir_tstrlen(msg) - 1; diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index d1930bc4da..e62592ec27 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -92,7 +92,6 @@ static HWND hwndTabConfig = 0; // will be used as the name of the skin. // // [Global]/Name property is new in TabSRMM version 3. - static int TSAPI ScanSkinDir(const TCHAR* tszFolder, HWND hwndCombobox) { bool fValid = false; @@ -144,7 +143,6 @@ static int TSAPI ScanSkinDir(const TCHAR* tszFolder, HWND hwndCombobox) // // By default, $SKINS_ROOT is set to %miranda_userdata% or custom folder // selected by the folders plugin. - static int TSAPI RescanSkins(HWND hwndCombobox) { DBVARIANT dbv = { 0 }; @@ -191,7 +189,6 @@ static int TSAPI RescanSkins(HWND hwndCombobox) ///////////////////////////////////////////////////////////////////////////////////////// // mir_free the item extra data (used to store the skin filenames for each entry). - static void TSAPI FreeComboData(HWND hwndCombobox) { LRESULT lr = SendMessage(hwndCombobox, CB_GETCOUNT, 0, 0); @@ -207,7 +204,6 @@ static void TSAPI FreeComboData(HWND hwndCombobox) ///////////////////////////////////////////////////////////////////////////////////////// // controls to disable when loading or unloading a skin is not possible (because // of at least one message window being open). - static UINT _ctrls[] = { IDC_SKINNAME, IDC_RESCANSKIN, IDC_RESCANSKIN, IDC_RELOADSKIN, 0 }; static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) @@ -563,8 +559,6 @@ BOOL TreeViewHandleClick(HWND hwndDlg, HWND hwndTree, WPARAM, LPARAM lParam) return TRUE; } - - static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { @@ -838,7 +832,6 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, ///////////////////////////////////////////////////////////////////////////////////////// // typing notify options - static void ResetCList(HWND hwndDlg) { if (CallService(MS_CLUI_GETCAPS, 0, 0) & CLUIF_DISABLEGROUPS && !M.GetByte("CList", "UseGroups", SETTING_USEGROUPS_DEFAULT)) @@ -992,7 +985,6 @@ static INT_PTR CALLBACK DlgProcTypeOptions(HWND hwndDlg, UINT msg, WPARAM wParam ///////////////////////////////////////////////////////////////////////////////////////// // options for tabbed messaging got their own page.. finally :) - static INT_PTR CALLBACK DlgProcTabbedOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { @@ -1070,7 +1062,6 @@ static INT_PTR CALLBACK DlgProcTabbedOptions(HWND hwndDlg, UINT msg, WPARAM wPar ///////////////////////////////////////////////////////////////////////////////////////// // container options - static INT_PTR CALLBACK DlgProcContainerSettings(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { @@ -1159,7 +1150,6 @@ static INT_PTR CALLBACK DlgProcContainerSettings(HWND hwndDlg, UINT msg, WPARAM return FALSE; } - INT_PTR CALLBACK PlusOptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index fc987b266e..48954f3a24 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -31,9 +31,9 @@ #define IDI_CORE_LOAD 132 // icon id for the "connecting" icon -NEN_OPTIONS nen_options; -static HANDLE hUserPrefsWindowLis = 0; -HMODULE g_hIconDLL = 0; +NEN_OPTIONS nen_options; +static HANDLE hUserPrefsWindowLis = 0; +HMODULE g_hIconDLL = 0, g_hMsftedit; static void UnloadIcons(); @@ -41,7 +41,6 @@ void Chat_AddIcons(void); ///////////////////////////////////////////////////////////////////////////////////////// // fired event when user changes IEView plugin options. Apply them to all open tabs - int IEViewOptionsChanged(WPARAM, LPARAM) { M.BroadcastMessage(DM_IEVIEWOPTIONSCHANGED, 0, 0); @@ -50,7 +49,6 @@ int IEViewOptionsChanged(WPARAM, LPARAM) ///////////////////////////////////////////////////////////////////////////////////////// // fired event when user changes smileyadd options. Notify all open tabs about the changes - int SmileyAddOptionsChanged(WPARAM, LPARAM) { M.BroadcastMessage(DM_SMILEYOPTIONSCHANGED, 0, 0); @@ -60,7 +58,6 @@ int SmileyAddOptionsChanged(WPARAM, LPARAM) ///////////////////////////////////////////////////////////////////////////////////////// // Message API 0.0.0.3 services - static INT_PTR GetWindowClass(WPARAM wParam, LPARAM lParam) { char *szBuf = (char*)wParam; @@ -73,7 +70,6 @@ static INT_PTR GetWindowClass(WPARAM wParam, LPARAM lParam) // wparam = (MessageWindowInputData*) // lparam = (MessageWindowData*) // returns 0 on success and returns non-zero (1) on error or if no window data exists for that hcontact - static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam) { MessageWindowInputData *mwid = (MessageWindowInputData*)wParam; @@ -116,7 +112,6 @@ static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////// // service function. Sets a status bar text for a contact - static void SetStatusTextWorker(TWindowData *dat, StatusTextData *st) { if (!dat) @@ -153,7 +148,6 @@ static INT_PTR SetStatusText(WPARAM hContact, LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////// // service function. Invoke the user preferences dialog for the contact given (by handle) in wParam - static INT_PTR SetUserPrefs(WPARAM wParam, LPARAM) { HWND hWnd = WindowList_Find(PluginConfig.hUserPrefsWindowList, wParam); @@ -167,7 +161,6 @@ static INT_PTR SetUserPrefs(WPARAM wParam, LPARAM) ///////////////////////////////////////////////////////////////////////////////////////// // service function - open the tray menu from the TTB button - static INT_PTR Service_OpenTrayMenu(WPARAM, LPARAM lParam) { SendMessage(PluginConfig.g_hwndHotkeyHandler, DM_TRAYICONNOTIFY, 101, lParam == 0 ? WM_LBUTTONUP : WM_RBUTTONUP); @@ -179,7 +172,6 @@ static INT_PTR Service_OpenTrayMenu(WPARAM, LPARAM lParam) // wParam == hContact of the window to find // lParam == window handle (set it to 0 if you want search for hcontact, otherwise it // is directly used as the handle for the target window - static INT_PTR GetMessageWindowFlags(WPARAM wParam, LPARAM lParam) { HWND hwndTarget = (HWND)lParam; @@ -195,7 +187,6 @@ static INT_PTR GetMessageWindowFlags(WPARAM wParam, LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////// // return the version of the window api supported - static INT_PTR GetWindowAPI(WPARAM, LPARAM) { return PLUGIN_MAKE_VERSION(0, 0, 0, 2); @@ -207,12 +198,11 @@ static INT_PTR GetWindowAPI(WPARAM, LPARAM) // thanks to bio for the suggestion of this service // if wParam == 0, then lParam is considered to be a valid window handle and // the function tests the popup mode of the target container - +// // returns the hwnd if there is an open window or tab for the given hcontact (wParam), // or (if lParam was specified) the hwnd if the window exists. // 0 if there is none (or the popup mode of the target container was configured to "hide" // the window.. - INT_PTR MessageWindowOpened(WPARAM wParam, LPARAM lParam) { HWND hwnd = 0; @@ -252,7 +242,6 @@ INT_PTR MessageWindowOpened(WPARAM wParam, LPARAM lParam) // ReadMessageCommand is executed whenever the user wants to manually open a window. // This can happen when double clicking a contact on the clist OR when opening a new // message (clicking on a popup, clicking the flashing tray icon and so on). - static INT_PTR ReadMessageCommand(WPARAM, LPARAM lParam) { MCONTACT hContact = ((CLISTEVENT *)lParam)->hContact; @@ -277,7 +266,6 @@ static INT_PTR ReadMessageCommand(WPARAM, LPARAM lParam) // e.g. it is called when user double clicks a contact on the contact list // it is implemented as a service, so external plugins can use it to open a message window. // contacts handle must be passed in wParam. - INT_PTR SendMessageCommand_Worker(MCONTACT hContact, LPCSTR pszMsg, bool isWchar) { // make sure that only the main UI thread will handle window creation @@ -335,7 +323,6 @@ INT_PTR SendMessageCommand_W(WPARAM hContact, LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////// // open a window when user clicks on the flashing "typing message" tray icon. // just calls SendMessageCommand() for the given contact. - static INT_PTR TypingMessageCommand(WPARAM, LPARAM lParam) { CLISTEVENT *cle = (CLISTEVENT*)lParam; @@ -353,7 +340,7 @@ int SplitmsgShutdown(void) DestroyCursor(PluginConfig.hCurHyperlinkHand); DestroyCursor(PluginConfig.hCurSplitWE); - FreeLibrary(GetModuleHandleA("Msftedit.dll")); + FreeLibrary(g_hMsftedit); if (g_hIconDLL) { FreeLibrary(g_hIconDLL); @@ -395,7 +382,6 @@ int MyAvatarChanged(WPARAM wParam, LPARAM lParam) // // this function searches and activates the tab belonging to the given hwnd (which is the // hwnd of a message dialog window) - int TSAPI ActivateExistingTab(TContainerData *pContainer, HWND hwndChild) { TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndChild, GWLP_USERDATA); // needed to obtain the hContact for the message window @@ -444,7 +430,6 @@ int TSAPI ActivateExistingTab(TContainerData *pContainer, HWND hwndChild) // this function creates and activates a new tab within the given container. // bActivateTab: make the new tab the active one // bPopupContainer: restore container if it was minimized, otherwise flash it... - HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, int isSend, const char *pszInitialText, BOOL bActivateTab, BOOL bPopupContainer, BOOL bWantPopup, MEVENT hdbEvent) { if (M.FindWindow(hContact) != 0) { @@ -597,7 +582,6 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, // this is used by the 2nd containermode (limit tabs on default containers). // it searches a container with "room" for the new tabs or otherwise creates // a new (cloned) one. - TContainerData* TSAPI FindMatchingContainer(const TCHAR *szName) { int iMaxTabs = M.GetDword("maxtabs", 0); @@ -614,7 +598,6 @@ TContainerData* TSAPI FindMatchingContainer(const TCHAR *szName) ///////////////////////////////////////////////////////////////////////////////////////// // load some global icons. - void TSAPI CreateImageList(BOOL bInitial) { // the imagelist is now a fake. It is still needed to provide the tab control with a @@ -775,7 +758,6 @@ static int GetIconPackVersion(HMODULE hDLL) ///////////////////////////////////////////////////////////////////////////////////////// // setup default icons for the IcoLib service. This needs to be done every time the // plugin is loaded default icons are taken from the icon pack in either \icons or \plugins - static int TSAPI SetupIconLibConfig() { int j = 2, version = 0; @@ -833,7 +815,6 @@ static int TSAPI SetupIconLibConfig() } // load the icon theme from IconLib - check if it exists... - static int TSAPI LoadFromIconLib() { for (int n = 0; n < _countof(ICONBLOCKS); n++) @@ -865,7 +846,6 @@ static int TSAPI LoadFromIconLib() ///////////////////////////////////////////////////////////////////////////////////////// // load icon theme from either icon pack or IcoLib - void TSAPI LoadIconTheme() { if (SetupIconLibConfig() == 0) @@ -913,7 +893,6 @@ int IconsChanged(WPARAM, LPARAM) ///////////////////////////////////////////////////////////////////////////////////////// // initialises the internal API, services, events etc... - static void TSAPI InitAPI() { CreateServiceFunction(MS_MSG_SENDMESSAGE, SendMessageCommand); @@ -953,7 +932,7 @@ int LoadSendRecvMessageModule(void) icex.dwICC = ICC_COOL_CLASSES | ICC_BAR_CLASSES | ICC_LISTVIEW_CLASSES; InitCommonControlsEx(&icex); - Utils::loadSystemLibrary(L"\\Msftedit.dll"); + g_hMsftedit = Utils::loadSystemLibrary(L"\\Msftedit.dll"); Win7Taskbar = new CTaskbarInteract; Win7Taskbar->updateMetrics(); diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index 508d2b7aa8..6d7a304bd8 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -31,7 +31,6 @@ CSendLater *sendLater = 0; // implementation of the CSendLaterJob class -// CSendLaterJob::CSendLaterJob() { memset(this, 0, sizeof(CSendLaterJob)); @@ -40,14 +39,12 @@ CSendLaterJob::CSendLaterJob() // return true if this job is persistent (saved to the database). // such a job will survive a restart of Miranda -// bool CSendLaterJob::isPersistentJob() { return(szId[0] == 'S' ? true : false); } // check conditions for deletion -// bool CSendLaterJob::mustDelete() { if (fSuccess) @@ -60,7 +57,6 @@ bool CSendLaterJob::mustDelete() } // clean database entries for a persistent job (currently: manual send later jobs) -// void CSendLaterJob::cleanDB() { if (isPersistentJob()) { @@ -80,7 +76,6 @@ void CSendLaterJob::cleanDB() // read flags for a persistent jobs from the db // flag key name is the job id with a "$" prefix. -// void CSendLaterJob::readFlags() { if (isPersistentJob()) { @@ -97,7 +92,6 @@ void CSendLaterJob::readFlags() // write flags for a persistent jobs from the db // flag key name is the job id with a "$" prefix. -// void CSendLaterJob::writeFlags() { if (isPersistentJob()) { @@ -110,7 +104,6 @@ void CSendLaterJob::writeFlags() } // delete a send later job -// CSendLaterJob::~CSendLaterJob() { if (fSuccess || fFailed) { @@ -174,7 +167,6 @@ m_currJob(-1) // clear all open send jobs. Only called on system shutdown to remove // the jobs from memory. Must _NOT_ delete any sendlater related stuff from // the database (only successful sends may do this). -// CSendLater::~CSendLater() { if (m_hwndDlg) @@ -209,7 +201,6 @@ void CSendLater::startJobListProcess() // hotkeyhandler.cpp. // // returns true if more jobs are awaiting processing, false otherwise. -// bool CSendLater::processCurrentJob() { if (!m_sendLaterJobList.getCount() || m_currJob == -1) @@ -241,7 +232,6 @@ bool CSendLater::processCurrentJob() // stub used as enum proc for the database enumeration, collecting // all entries in the SendLater module // (static function) -// int _cdecl CSendLater::addStub(const char *szSetting, LPARAM lParam) { return(sendLater->addJob(szSetting, lParam)); @@ -251,7 +241,6 @@ int _cdecl CSendLater::addStub(const char *szSetting, LPARAM lParam) // enum the "SendLater" module and add all jobs to the list of open jobs. // addJob() will deal with possible duplicates // @param hContact HANDLE: contact's handle -// void CSendLater::processSingleContact(const MCONTACT hContact) { int iCount = db_get_dw(hContact, "SendLater", "count", 0); @@ -268,7 +257,6 @@ void CSendLater::processSingleContact(const MCONTACT hContact) // called periodically from a timer, check if new contacts were added // and process them -// void CSendLater::processContacts() { if (m_fAvail && m_sendLaterContactList.getCount() != 0) { @@ -288,7 +276,6 @@ void CSendLater::processContacts() // // @param lParam: a contact handle for which the job should be scheduled // @return 0 on failure, 1 otherwise -// int CSendLater::addJob(const char *szSetting, LPARAM lParam) { MCONTACT hContact = lParam; @@ -451,7 +438,6 @@ void CSendLater::addContact(const MCONTACT hContact) // // Add the message to the database and mark it as successful. The job will be // removed later by the job list processing code. -// HANDLE CSendLater::processAck(const ACKDATA *ack) { if (m_sendLaterJobList.getCount() == 0 || !m_fAvail) @@ -507,7 +493,6 @@ LRESULT CSendLater::qMgrAddFilter(const MCONTACT hContact, const TCHAR* tszNick) // fills the list of jobs with current contents of the job queue // filters by m_hFilter (contact handle) -// void CSendLater::qMgrFillList(bool fClear) { TCHAR *formatTime = _T("%Y.%m.%d - %H:%M"); @@ -664,7 +649,6 @@ void CSendLater::qMgrSetupColumns() } // save user defined column widths to the database -// void CSendLater::qMgrSaveColumns() { char szColFormatNew[100]; @@ -857,7 +841,6 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM } // invoke queue manager dialog - do nothing if this dialog is already open -// void CSendLater::invokeQueueMgrDlg() { if (m_hwndDlg == 0) @@ -865,7 +848,6 @@ void CSendLater::invokeQueueMgrDlg() } // service function to invoke the queue manager -// INT_PTR CSendLater::svcQMgr(WPARAM, LPARAM) { sendLater->invokeQueueMgrDlg(); diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index dc6407bf1d..452b3faaf1 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -34,7 +34,6 @@ SendQueue *sendQueue = 0; // searches the queue for a message belonging to the given contact which has been marked // as "failed" by either the ACKRESULT_FAILED or a timeout handler // returns: zero-based queue index or -1 if none was found - int SendQueue::findNextFailed(const TWindowData *dat) const { if (dat) @@ -62,7 +61,6 @@ void SendQueue::handleError(TWindowData *dat, const int iEntry) const ///////////////////////////////////////////////////////////////////////////////////////// //add a message to the sending queue. // iLen = required size of the memory block to hold the message - int SendQueue::addTo(TWindowData *dat, size_t iLen, int dwFlags) { int i; @@ -178,7 +176,6 @@ static void DoSplitSendA(LPVOID param) ///////////////////////////////////////////////////////////////////////////////////////// // return effective length of the message in bytes (utf-8 encoded) - size_t SendQueue::getSendLength(const int iEntry) { SendJob &p = m_jobs[iEntry]; @@ -320,7 +317,6 @@ void SendQueue::clearJob(const int iIndex) // ) a delivery has completed successfully // ) user decided to cancel a failed send // it removes the completed / canceled send job from the queue and schedules the next job to send (if any) - void SendQueue::checkQueue(const TWindowData *dat) const { if (dat) { @@ -339,7 +335,6 @@ void SendQueue::checkQueue(const TWindowData *dat) const ///////////////////////////////////////////////////////////////////////////////////////// // logs an error message to the message window.Optionally, appends the original message // from the given sendJob (queue index) - void SendQueue::logError(const TWindowData *dat, int iSendJobIndex, const TCHAR *szErrMsg) const { if (dat == 0) @@ -369,7 +364,6 @@ void SendQueue::logError(const TWindowData *dat, int iSendJobIndex, const TCHAR // ) input area // ) multisend contact list instance // ) send button - void SendQueue::EnableSending(const TWindowData *dat, const int iMode) { if (dat) { @@ -382,7 +376,6 @@ void SendQueue::EnableSending(const TWindowData *dat, const int iMode) ///////////////////////////////////////////////////////////////////////////////////////// // show or hide the error control button bar on top of the window - void SendQueue::showErrorControls(TWindowData *dat, const int showCmd) const { UINT myerrorControls[] = { IDC_STATICERRORICON, IDC_STATICTEXT, IDC_RETRY, IDC_CANCELSEND, IDC_MSGSENDLATER }; @@ -487,7 +480,6 @@ void SendQueue::NotifyDeliveryFailure(const TWindowData *dat) ///////////////////////////////////////////////////////////////////////////////////////// // searches string for characters typical for RTL text(hebrew and other RTL languages - int SendQueue::RTL_Detect(const WCHAR *pszwText) { int i, n = 0; @@ -633,7 +625,6 @@ LRESULT SendQueue::WarnPendingJobs(unsigned int) // hContact : contact to which the job should be added (default = hOwner of the send job) // // @return the index on success, -1 on failure - int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, MCONTACT hContact, bool fIsSendLater) { bool fAvail = sendLater->isAvail(); diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp index bf6ef9a345..e680da3e16 100644 --- a/plugins/TabSRMM/src/sidebar.cpp +++ b/plugins/TabSRMM/src/sidebar.cpp @@ -87,9 +87,7 @@ CSideBarButton::CSideBarButton(const UINT id, CSideBar *sideBar) _create(); } -/** - * Internal method to create the button item and configure the associated button control - */ +// Internal method to create the button item and configure the associated button control void CSideBarButton::_create() { m_hwnd = 0; @@ -330,18 +328,15 @@ int CSideBarButton::testCloseButton() const } return -1; } -/** - * call back from the button window procedure. Activate my session - */ + +// call back from the button window procedure. Activate my session void CSideBarButton::activateSession() const { if (m_dat) ::SendMessage(m_dat->hwnd, DM_ACTIVATEME, 0, 0); // the child window will activate itself } -/** - * show the context menu (same as on tabs - */ +// show the context menu (same as on tabs void CSideBarButton::invokeContextMenu() { const TContainerData *pContainer = m_sideBar->getContainer(); @@ -479,7 +474,6 @@ void CSideBar::destroyScroller() * Does not remove the sessions. This is basically only used when switching * from a sidebar to a tabbed interface */ - void CSideBar::removeAll() { m_buttonlist.destroy(); diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp index 9f06fa6957..897e216d0b 100644 --- a/plugins/TabSRMM/src/srmm.cpp +++ b/plugins/TabSRMM/src/srmm.cpp @@ -141,7 +141,6 @@ int _DebugTraceW(const wchar_t *fmt, ...) * can display the message either as systray notification (baloon popup) or using the * popup plugin. */ - int _DebugPopup(MCONTACT hContact, const TCHAR *fmt, ...) { va_list va; diff --git a/plugins/TabSRMM/src/tabctrl.cpp b/plugins/TabSRMM/src/tabctrl.cpp index 49e90e2020..f693c3ee92 100644 --- a/plugins/TabSRMM/src/tabctrl.cpp +++ b/plugins/TabSRMM/src/tabctrl.cpp @@ -36,7 +36,6 @@ static WNDPROC OldTabControlClassProc; // returns the index of the tab under the mouse pointer. Used for // context menu popup and tooltips // pt: mouse coordinates, obtained from GetCursorPos() - int TSAPI GetTabItemFromMouse(HWND hwndTab, POINT *pt) { TCHITTESTINFO tch; @@ -79,7 +78,6 @@ static int TabCtrl_TestForCloseButton(const TabControlData *tabdat, HWND hwnd, P ///////////////////////////////////////////////////////////////////////////////////////// // tabctrl helper function // Finds leftmost down item. - static UINT FindLeftDownItem(HWND hwnd) { RECT rctLeft = { 100000, 0, 0, 0 }, rctCur; @@ -100,7 +98,6 @@ static UINT FindLeftDownItem(HWND hwnd) ///////////////////////////////////////////////////////////////////////////////////////// // tab control color definitions, including the database setting key names - static struct colOptions { UINT defclr; @@ -120,7 +117,6 @@ static struct colOptions ///////////////////////////////////////////////////////////////////////////////////////// // hints for drawing functions - #define HINT_ACTIVATE_RIGHT_SIDE 1 #define HINT_ACTIVE_ITEM 2 #define FLOAT_ITEM_HEIGHT_SHIFT 2 @@ -160,7 +156,6 @@ void TSAPI FillTabBackground(const HDC hdc, int iStateId, const TWindowData *dat // it obtains the label and icon handle directly from the message window data // no image list is used and necessary, the message window dialog procedure has to provide a valid // icon handle in dat->hTabIcon - static void DrawItem(TabControlData *tabdat, HDC dc, RECT *rcItem, int nHint, int nItem, TWindowData *dat) { if (dat == NULL) @@ -1310,7 +1305,6 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara ///////////////////////////////////////////////////////////////////////////////////////// // load the tab control configuration data (colors, fonts, flags... - void TSAPI ReloadTabConfig() { PluginConfig.tabConfig.m_hPenLight = CreatePen(PS_SOLID, 1, GetSysColor(COLOR_3DHILIGHT)); @@ -1357,11 +1351,10 @@ void TSAPI FreeTabConfig() memset(&PluginConfig.tabConfig, 0, sizeof(PluginConfig.tabConfig)); } -///////////////////////////////////////////////////////////////////////////////////////// -// options dialog for setting up tab options - static bool tconfig_init = false; +///////////////////////////////////////////////////////////////////////////////////////// +// options dialog for setting up tab options INT_PTR CALLBACK DlgProcTabConfig(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { @@ -1461,7 +1454,6 @@ INT_PTR CALLBACK DlgProcTabConfig(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ///////////////////////////////////////////////////////////////////////////////////////// // register the new tab control as a window class (TSTabCtrlClass) - int TSAPI RegisterTabCtrlClass(void) { WNDCLASSEX wc = { 0 }; diff --git a/plugins/TabSRMM/src/taskbar.cpp b/plugins/TabSRMM/src/taskbar.cpp index 9021ba569c..0726917226 100644 --- a/plugins/TabSRMM/src/taskbar.cpp +++ b/plugins/TabSRMM/src/taskbar.cpp @@ -766,25 +766,21 @@ void CThumbIM::update() */ void CThumbIM::renderContent() { - HBITMAP hbmAvatar, hbmOldAv; - double dNewWidth = 0.0, dNewHeight = 0.0; - bool fFree = false; - HRGN hRgn = 0; - HDC dc; - const wchar_t* tszStatusMsg = 0; - - hbmAvatar = (m_dat->ace && m_dat->ace->hbmPic) ? m_dat->ace->hbmPic : PluginConfig.g_hbmUnknown; + double dNewWidth = 0.0, dNewHeight = 0.0; + bool fFree = false; + + HBITMAP hbmAvatar = (m_dat->ace && m_dat->ace->hbmPic) ? m_dat->ace->hbmPic : PluginConfig.g_hbmUnknown; Utils::scaleAvatarHeightLimited(hbmAvatar, dNewWidth, dNewHeight, m_rcIcon.bottom - m_rcIcon.top); HBITMAP hbmResized = CSkin::ResizeBitmap(hbmAvatar, dNewWidth, dNewHeight, fFree); - dc = CreateCompatibleDC(m_hdc); - hbmOldAv = reinterpret_cast(::SelectObject(dc, hbmResized)); + HDC dc = CreateCompatibleDC(m_hdc); + HBITMAP hbmOldAv = reinterpret_cast(::SelectObject(dc, hbmResized)); LONG xOff = m_rcIcon.right - (LONG)dNewWidth - 2; LONG yOff = (m_cy - (LONG)dNewHeight) / 2 + m_rcIcon.top; - hRgn = ::CreateRectRgn(xOff - 1, yOff - 1, xOff + (LONG)dNewWidth + 2, yOff + (LONG)dNewHeight + 2); + HRGN hRgn = ::CreateRectRgn(xOff - 1, yOff - 1, xOff + (LONG)dNewWidth + 2, yOff + (LONG)dNewHeight + 2); CSkin::m_default_bf.SourceConstantAlpha = 150; GdiAlphaBlend(m_hdc, xOff, yOff, (LONG)dNewWidth, (LONG)dNewHeight, dc, 0, 0, (LONG)dNewWidth, (LONG)dNewHeight, CSkin::m_default_bf); CSkin::m_default_bf.SourceConstantAlpha = 255; @@ -808,7 +804,8 @@ 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())) + const wchar_t *tszStatusMsg = m_dat->cache->getStatusMsg(); + if (tszStatusMsg == 0) 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); diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index 0177193eb7..5e1760cc49 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -79,10 +79,8 @@ static int helpActive = 0; static void LoadTemplatesFrom(TTemplateSet *tSet, MCONTACT hContact, int rtl) { - DBVARIANT dbv = { 0 }; - int i; - - for (i = 0; i <= TMPL_ERRMSG; i++) { + for (int i = 0; i <= TMPL_ERRMSG; i++) { + DBVARIANT dbv = { 0 }; if (db_get_ts(hContact, rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, TemplateNames[i], &dbv)) continue; if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR) @@ -93,18 +91,16 @@ static void LoadTemplatesFrom(TTemplateSet *tSet, MCONTACT hContact, int rtl) void LoadDefaultTemplates() { - int i; - LTR_Active = LTR_Default; RTL_Active = RTL_Default; if (M.GetByte(RTLTEMPLATES_MODULE, "setup", 0) < 2) { - for (i = 0; i <= TMPL_ERRMSG; i++) + for (int i = 0; i <= TMPL_ERRMSG; i++) db_set_ts(NULL, RTLTEMPLATES_MODULE, TemplateNames[i], RTL_Default.szTemplates[i]); db_set_b(0, RTLTEMPLATES_MODULE, "setup", 2); } if (M.GetByte(TEMPLATES_MODULE, "setup", 0) < 2) { - for (i = 0; i <= TMPL_ERRMSG; i++) + for (int i = 0; i <= TMPL_ERRMSG; i++) db_set_ts(NULL, TEMPLATES_MODULE, TemplateNames[i], LTR_Default.szTemplates[i]); db_set_b(0, TEMPLATES_MODULE, "setup", 2); } @@ -116,7 +112,6 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP { TemplateEditorInfo *teInfo = 0; TTemplateSet *tSet; - int i; TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); /* * since this dialog needs a MessageWindowData * but has no container, we can store @@ -173,7 +168,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP Utils::enableDlgControl(hwndDlg, IDC_SAVETEMPLATE, FALSE); Utils::enableDlgControl(hwndDlg, IDC_REVERT, FALSE); Utils::enableDlgControl(hwndDlg, IDC_FORGET, FALSE); - for (i = 0; i <= TMPL_ERRMSG; i++) { + for (int i = 0; i <= TMPL_ERRMSG; i++) { SendDlgItemMessageA(hwndDlg, IDC_TEMPLATELIST, LB_ADDSTRING, 0, (LPARAM)Translate(TemplateNames[i])); SendDlgItemMessage(hwndDlg, IDC_TEMPLATELIST, LB_SETITEMDATA, i, (LPARAM)i); } @@ -196,11 +191,11 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP break; case IDC_RESETALLTEMPLATES: - if (MessageBox(0, TranslateT("This will reset the template set to the default built-in templates. Are you sure you want to do this?"), + if (MessageBox(hwndDlg, TranslateT("This will reset the template set to the default built-in templates. Are you sure you want to do this?"), TranslateT("Template set editor"), MB_YESNO | MB_ICONQUESTION) == IDYES) { db_set_b(0, teInfo->rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, "setup", 0); LoadDefaultTemplates(); - MessageBox(0, TranslateT("Template set was successfully reset, please close and reopen all message windows. This template editor window will now close."), + MessageBox(hwndDlg, TranslateT("Template set was successfully reset, please close and reopen all message windows. This template editor window will now close."), TranslateT("Template set editor"), MB_OK); DestroyWindow(hwndDlg); } @@ -310,13 +305,12 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP { DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)lParam; int iItem = dis->itemData; - HBRUSH bkg, oldBkg; SetBkMode(dis->hDC, TRANSPARENT); FillRect(dis->hDC, &dis->rcItem, GetSysColorBrush(COLOR_WINDOW)); if (dis->itemState & ODS_SELECTED) { if (teInfo->updateInfo[iItem] == TRUE) { - bkg = CreateSolidBrush(RGB(255, 0, 0)); - oldBkg = (HBRUSH)SelectObject(dis->hDC, bkg); + HBRUSH bkg = CreateSolidBrush(RGB(255, 0, 0)); + HBRUSH oldBkg = (HBRUSH)SelectObject(dis->hDC, bkg); FillRect(dis->hDC, &dis->rcItem, bkg); SelectObject(dis->hDC, oldBkg); DeleteObject(bkg); diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index a45aaa2923..ba9625a4ab 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -315,7 +315,6 @@ static DWORD __inline argb_from_cola(COLORREF col, UINT32 alpha) return((BYTE)percent_to_byte(alpha) << 24 | col); } - void TSAPI DrawAlpha(HDC hDC, PRECT rc, DWORD clr_base, int alpha, DWORD clr_dest, BYTE clr_dest_trans, BYTE bGradient, BYTE bCorner, DWORD dwRadius, CImageItem *imageItem) { @@ -586,8 +585,6 @@ void __inline gradientHorizontal(UCHAR *ubRedFinal, UCHAR *ubGreenFinal, UCHAR * void __inline gradientVertical(UCHAR *ubRedFinal, UCHAR *ubGreenFinal, UCHAR *ubBlueFinal, ULONG ulBitmapHeight, UCHAR ubRed, UCHAR ubGreen, UCHAR ubBlue, UCHAR ubRed2, UCHAR ubGreen2, UCHAR ubBlue2, DWORD FLG_GRADIENT, BOOL transparent, UINT32 y, UCHAR *ubAlpha) { - FLOAT fSolidMulti, fInvSolidMulti; - // solid to transparent if (transparent) { *ubAlpha = (UCHAR)((float)y / (float)ulBitmapHeight * 255); @@ -597,6 +594,7 @@ void __inline gradientVertical(UCHAR *ubRedFinal, UCHAR *ubGreenFinal, UCHAR *ub *ubBlueFinal = ubBlue; } else { // solid to solid2 + FLOAT fSolidMulti, fInvSolidMulti; if (FLG_GRADIENT & GRADIENT_BT) { fSolidMulti = ((float)y / (float)ulBitmapHeight); fInvSolidMulti = 1 - fSolidMulti; @@ -621,7 +619,6 @@ void __inline gradientVertical(UCHAR *ubRedFinal, UCHAR *ubGreenFinal, UCHAR *ub // @param rc RECT *: client rectangle inside the target DC. // @param fIgnoreGlyph: bool: will ignore any glyph item. Set it to true when // using this function from _outside_ a skin - void __fastcall CImageItem::Render(const HDC hdc, const RECT *rc, bool fIgnoreGlyph) const { BYTE l = m_bLeft, r = m_bRight, t = m_bTop, b = m_bBottom; @@ -796,7 +793,6 @@ void CImageItem::Create(const TCHAR *szImageFile) // // @return char*: full path and filename to the .png image which represents this image item. // caller MUST delete it. - TCHAR* CImageItem::Read(const TCHAR *szFilename) { TCHAR buffer[501]; @@ -886,7 +882,6 @@ TCHAR* CImageItem::Read(const TCHAR *szFilename) ///////////////////////////////////////////////////////////////////////////////////////// // Free all resources allocated by an image item - void CImageItem::Free() { if (m_hdc) { @@ -908,7 +903,6 @@ void CImageItem::Free() // @param hBitmap bitmap handle // @param bAlpha new alpha value (0 -> fully transparent, 255 -> opaque) // default value is 255 - void CImageItem::SetBitmap32Alpha(HBITMAP hBitmap, BYTE bAlpha) { BITMAP bmp; @@ -1000,7 +994,6 @@ void CImageItem::Colorize(HBITMAP hBitmap, BYTE dr, BYTE dg, BYTE db, BYTE alpha ///////////////////////////////////////////////////////////////////////////////////////// // load PNG image using core service(advaimg) - HBITMAP TSAPI CImageItem::LoadPNG(const TCHAR *szFilename) { HBITMAP hBitmap = 0; @@ -1008,13 +1001,11 @@ HBITMAP TSAPI CImageItem::LoadPNG(const TCHAR *szFilename) return hBitmap; } - ///////////////////////////////////////////////////////////////////////////////////////// // set filename and load parameters from the database // called on: // ) init // ) manual loading on user's request - void CSkin::setFileName() { DBVARIANT dbv; @@ -1030,7 +1021,6 @@ void CSkin::setFileName() ///////////////////////////////////////////////////////////////////////////////////////// // initialize the skin object - void CSkin::Init(bool fStartup) { m_ImageItems = 0; @@ -1056,8 +1046,6 @@ void CSkin::Init(bool fStartup) // throws a warning to close all message windows before a skin can // be loaded. user can cancel it // @return: bool: true if windows were closed (or none was open) -> skin can be loaded -// - bool CSkin::warnToClose() const { if (::pFirstContainer == NULL) @@ -1076,7 +1064,6 @@ bool CSkin::warnToClose() const // mir_free the aero tab bitmaps // only called on exit, NOT when a skin is unloaded as these elements // are always needed (even without a skin) - void CSkin::UnloadAeroTabs() { if (m_tabTop) { @@ -1110,7 +1097,6 @@ void CSkin::UnloadAeroTabs() // Called when: // * user unloads the skin from the dialog box // * a new skin is loaded by user's request. - void CSkin::Unload() { // do nothing when user decides to not close any window @@ -1227,7 +1213,6 @@ void CSkin::LoadIcon(const TCHAR *szSection, const TCHAR *name, HICON &hIcon) // @param id int: zero-based index into the table of predefined skin items // @param szItem char *: the section name in the ini file which holds the definition for this // item. - void CSkin::ReadItem(const int id, const TCHAR *szItem) { TCHAR buffer[512]; @@ -1294,7 +1279,6 @@ void CSkin::ReadItem(const int id, const TCHAR *szItem) // The real work is done by the CImageItem::Read(). // // @param itemname char *: image item name, also section name in the .tsk file - void CSkin::ReadImageItem(const TCHAR *itemname) { TCHAR buffer[512], szItemNr[30]; @@ -1356,7 +1340,6 @@ void CSkin::ReadImageItem(const TCHAR *itemname) // It reads and initializes all static values for the skin. Afterwards // it calls ReadItems() to read additional skin information like image items, // buttons and icons. - void CSkin::Load(void) { if (warnToClose() == false) @@ -1524,7 +1507,6 @@ void CSkin::Load(void) ///////////////////////////////////////////////////////////////////////////////////////// // Load additional skin items (like image items, buttons, icons etc.) // This is called AFTER ReadItems() has read the basic skin items - void CSkin::LoadItems() { TCHAR *szSections = NULL; @@ -1592,7 +1574,6 @@ void CSkin::LoadItems() // ) icons change (via ico lib service) // // @param fDeleteOnly: only delete GDI resources (this is ONLY used at plugin shutdown) - void CSkin::setupTabCloseBitmap(bool fDeleteOnly) { if (m_tabCloseHDC || fDeleteOnly) { @@ -1661,7 +1642,6 @@ void CSkin::setupTabCloseBitmap(bool fDeleteOnly) // ) dwm mode changes // ) aero effect is changed by the user // ) glow colorization is changed by user's request - void CSkin::setupAeroSkins() { M.getAeroState(); @@ -1832,7 +1812,6 @@ void CSkin::setupAeroSkins() ///////////////////////////////////////////////////////////////////////////////////////// // Calculate window frame borders for a skin with the ability to paint the window frame. // Uses system metrics to determine predefined window borders and caption bar size. - void CSkin::SkinCalcFrameWidth() { int xBorder = GetSystemMetrics(SM_CXSIZEFRAME); @@ -1853,7 +1832,6 @@ void CSkin::SkinCalcFrameWidth() // @param pContainer ContainerWindowData *: needed to access the cached DC of the container window // @param rcClient RECT *: client rectangle (target area) // @param hdcTarget HDC: device context of the target window - void CSkin::SkinDrawBG(HWND hwndClient, HWND hwnd, TContainerData *pContainer, RECT *rcClient, HDC hdcTarget) { RECT rcWindow; @@ -1886,7 +1864,6 @@ void CSkin::SkinDrawBG(HWND hwndClient, HWND hwnd, TContainerData *pContainer, R // @param pContainer ContainerWindowData *: needed to access the cached DC of the container window // @param rcClient RECT *: client rectangle (target area) // @param hdcTarget HDC: device context of the target window - void CSkin::SkinDrawBGFromDC(HWND hwndClient, HWND hwnd, RECT *rcClient, HDC hdcTarget) { RECT rcWindow; @@ -1905,7 +1882,6 @@ void CSkin::SkinDrawBGFromDC(HWND hwndClient, HWND hwnd, RECT *rcClient, HDC hdc ///////////////////////////////////////////////////////////////////////////////////////// // draw an icon "Dimmed" (small amount of transparency applied) - void CSkin::DrawDimmedIcon(HDC hdc, LONG left, LONG top, LONG dx, LONG dy, HICON hIcon, BYTE alpha) { HDC dcMem = ::CreateCompatibleDC(hdc); @@ -1971,7 +1947,6 @@ UINT CSkin::NcCalcRichEditFrame(HWND hwnd, const TWindowData *mwdat, UINT skinID ///////////////////////////////////////////////////////////////////////////////////////// // process WM_NCPAINT for the rich edit control. Draws a visual style border and avoid // classic static edge / client edge may also draw a colorized border around the control - UINT CSkin::DrawRichEditFrame(HWND hwnd, const TWindowData *mwdat, UINT skinID, UINT msg, WPARAM wParam, LPARAM lParam, WNDPROC OldWndProc) { // do default processing (otherwise, NO scrollbar as it is painted in NC_PAINT) @@ -2043,7 +2018,6 @@ UINT CSkin::DrawRichEditFrame(HWND hwnd, const TWindowData *mwdat, UINT skinID, // "f3e355" // // @return COLORREF representation of the string value. - DWORD __fastcall CSkin::HexStringToLong(const TCHAR *szSource) { TCHAR *stopped; @@ -2056,7 +2030,6 @@ DWORD __fastcall CSkin::HexStringToLong(const TCHAR *szSource) ///////////////////////////////////////////////////////////////////////////////////////// // Render text to the given HDC. This function is aero aware and will use uxtheme DrawThemeTextEx() when needed. // Paramaters are pretty much comparable to GDI DrawText() API - int CSkin::RenderText(HDC hdc, HANDLE hTheme, const TCHAR *szText, RECT *rc, DWORD dtFlags, const int iGlowSize, COLORREF clr, bool fForceAero) { if ((PluginConfig.m_bIsVista && !CSkin::m_skinEnabled && hTheme) || fForceAero) { @@ -2090,7 +2063,6 @@ int CSkin::RenderText(HDC hdc, HANDLE hTheme, const TCHAR *szText, RECT *rc, DWO //bitmap should be freed. // // @return HBTIAMP: handle to a bitmap with the desired size. - HBITMAP CSkin::ResizeBitmap(HBITMAP hBmpSrc, LONG width, LONG height, bool &mustFree) { BITMAP bm; @@ -2124,7 +2096,6 @@ HBITMAP CSkin::ResizeBitmap(HBITMAP hBmpSrc, LONG width, LONG height, bool &must // // @return bool: true if the item has been painted, false if not // (only reason: the ignore flag in the item is set). - bool __fastcall CSkin::DrawItem(const HDC hdc, const RECT *rc, const CSkinItem *item) { if (!item->IGNORED) { @@ -2146,7 +2117,6 @@ bool __fastcall CSkin::DrawItem(const HDC hdc, const RECT *rc, const CSkinItem * // @param dc The device context for which the bitmap should be created. // // @return HBITMAP: handle to the bitmap created. - HBITMAP CSkin::CreateAeroCompatibleBitmap(const RECT &rc, HDC dc) { BITMAPINFO dib = { 0 }; @@ -2170,7 +2140,6 @@ HBITMAP CSkin::CreateAeroCompatibleBitmap(const RECT &rc, HDC dc) // @param rc RECT &: Rectangular area within the client area of hwndClient. // //It will receive the transformed coordinates, relative to the client area of hwndParent - void CSkin::MapClientToParent(HWND hwndClient, HWND hwndParent, RECT &rc) { POINT pt; @@ -2195,7 +2164,6 @@ void CSkin::MapClientToParent(HWND hwndClient, HWND hwndParent, RECT &rc) // // @param hdc HDC: handle to the device context in which painting should occur. // @param rcWindow RECT &: The window rectangle of the message dialog window - void CSkin::RenderToolbarBG(const TWindowData *dat, HDC hdc, const RECT &rcWindow) { if (dat) { @@ -2291,7 +2259,6 @@ void CSkin::RenderToolbarBG(const TWindowData *dat, HDC hdc, const RECT &rcWindo // @param hdcSrc The source device context (usually obtained by BeginPaint()) // @param rc RECT&: the target rectangle that receives the painting // @param hdcOut HDC& (out) receives the buffered device context handle - HANDLE CSkin::InitiateBufferedPaint(const HDC hdcSrc, RECT& rc, HDC& hdcOut) { return CMimAPI::m_pfnBeginBufferedPaint(hdcSrc, &rc, BPBF_TOPDOWNDIB, NULL, &hdcOut); @@ -2302,7 +2269,6 @@ HANDLE CSkin::InitiateBufferedPaint(const HDC hdcSrc, RECT& rc, HDC& hdcOut) // // @param hbp HANDLE: handle of the buffered paint context // @param rc RECT*: target rectangly where alpha value should be applied - void CSkin::FinalizeBufferedPaint(HANDLE hbp, RECT *rc) { if (m_pCurrentAeroEffect && m_pCurrentAeroEffect->m_finalAlpha > 0) @@ -2323,7 +2289,6 @@ void CSkin::FinalizeBufferedPaint(HANDLE hbp, RECT *rc) // @param hbp HANDLE: handle to a buffered paint identifier. // default is none, needed forsome special // effects. default paramenter is 0 - void CSkin::ApplyAeroEffect(const HDC hdc, const RECT *rc, int iEffectArea) { if (m_pCurrentAeroEffect == 0 || m_aeroEffect == AERO_EFFECT_NONE) @@ -2335,7 +2300,6 @@ void CSkin::ApplyAeroEffect(const HDC hdc, const RECT *rc, int iEffectArea) ///////////////////////////////////////////////////////////////////////////////////////// // aero effect callbacks - void CSkin::AeroEffectCallback_Milk(const HDC hdc, const RECT *rc, int iEffectArea) { if (iEffectArea < 0x1000) { @@ -2438,7 +2402,6 @@ void CSkin::setAeroEffect(LRESULT effect) // extract the aero skin images from the DLL and store them in // the private data folder. // runs at every startup - void CSkin::extractSkinsAndLogo(bool fForceOverwrite) const { TCHAR tszBasePath[MAX_PATH]; @@ -2457,7 +2420,6 @@ void CSkin::extractSkinsAndLogo(bool fForceOverwrite) const ///////////////////////////////////////////////////////////////////////////////////////// // redraw the splitter area between the message input and message log area only - void CSkin::UpdateToolbarBG(TWindowData *dat) { if (dat == NULL) @@ -2491,7 +2453,6 @@ void CSkin::UpdateToolbarBG(TWindowData *dat) // // @param hdc: device context // @param rc: area to fill. - void CSkin::FillBack(const HDC hdc, RECT* rc) { if (0 == CSkin::m_BrushFill) { diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp index 9db2c36379..59109ece07 100644 --- a/plugins/TabSRMM/src/trayicon.cpp +++ b/plugins/TabSRMM/src/trayicon.cpp @@ -126,10 +126,10 @@ void TSAPI CreateTrayMenus(int mode) } } } + /* * create a system tray icon, create all necessary submenus */ - void TSAPI CreateSystrayIcon(int create) { NOTIFYICONDATA nim; @@ -158,7 +158,6 @@ void TSAPI CreateSystrayIcon(int create) * mode = 0 - continue to flash * mode = 1 - restore the original icon */ - void TSAPI FlashTrayIcon(HICON hIcon) { NOTIFYICONDATA nim; @@ -188,7 +187,6 @@ void TSAPI FlashTrayIcon(HICON hIcon) * maximum number of allowed entries (20 at the moment). The oldest (topmost) entry * is deleted, if necessary. */ - void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, const char *szProto, TCHAR *szStatus, WORD wStatus, HICON hIcon, BOOL mode, HMENU hMenu) { TCHAR szMenuEntry[80]; @@ -203,7 +201,7 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, con szProto = GetContactProto(hContact); if (szProto) { if (wStatus == 0) - wStatus = db_get_w((MCONTACT)hContact, szProto, "Status", ID_STATUS_OFFLINE); + wStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE); if (szStatus == NULL) szStatus = pcli->pfnGetStatusModeDescription(wStatus, 0); } @@ -277,7 +275,6 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, con * at runtime. * scans the contact db for favorites or recent session entries and builds the menus. */ - typedef struct _recentEntry { DWORD dwTimestamp; MCONTACT hContact; diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp index 083d35f76e..20c6e02210 100644 --- a/plugins/TabSRMM/src/typingnotify.cpp +++ b/plugins/TabSRMM/src/typingnotify.cpp @@ -174,8 +174,6 @@ void TN_TypingMessage(MCONTACT hContact, int iMode) static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { - int i; - switch (msg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); @@ -193,7 +191,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA CheckDlgButton(hwndDlg, IDC_USEPOPUPCOLORS, BST_CHECKED); } - for (i = 0; i < _countof(colorPicker); i++) { + for (int i = 0; i < _countof(colorPicker); i++) { SendDlgItemMessage(hwndDlg, colorPicker[i].res, CPM_SETCOLOUR, 0, colorPicker[i].color); Utils::enableDlgControl(hwndDlg, colorPicker[i].res, (ColorMode == COLOR_OWN)); } @@ -251,7 +249,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA bEnableOthers = true; } - for (i = 0; i < _countof(colorPicker); i++) + for (int i = 0; i < _countof(colorPicker); i++) Utils::enableDlgControl(hwndDlg, colorPicker[i].res, bEnableOthers); Utils::enableDlgControl(hwndDlg, IDC_USEPOPUPCOLORS, bEnableOthers); @@ -273,7 +271,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA bEnableOthers = true; } - for (i = 0; i < sizeof(colorPicker) / sizeof(colorPicker[0]); i++) + for (int i = 0; i < sizeof(colorPicker) / sizeof(colorPicker[0]); i++) Utils::enableDlgControl(hwndDlg, colorPicker[i].res, bEnableOthers); Utils::enableDlgControl(hwndDlg, IDC_USEWINCOLORS, bEnableOthers); @@ -296,7 +294,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_PREVIEW: if (PluginConfig.g_bPopupAvail) { POPUPDATAT ppd = { 0 }; - for (i = 0; i < 2; i++) { + for (int i = 0; i < 2; i++) { int notyping; if (i == PROTOTYPE_CONTACTTYPING_OFF) { _tcsncpy_s(ppd.lptzContactName, TranslateT("Contact"), _TRUNCATE); @@ -458,7 +456,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case 0: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: - for (i = 0; i < sizeof(colorPicker) / sizeof(colorPicker[0]); i++) { + for (int i = 0; i < sizeof(colorPicker) / sizeof(colorPicker[0]); i++) { colorPicker[i].color = SendDlgItemMessage(hwndDlg, colorPicker[i].res, CPM_GETCOLOUR, 0, 0); db_set_dw(0, Module, colorPicker[i].desc, colorPicker[i].color); } diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp index fe153c1bc8..417c88cc4a 100644 --- a/plugins/TabSRMM/src/userprefs.cpp +++ b/plugins/TabSRMM/src/userprefs.cpp @@ -1,7 +1,7 @@ ///////////////////////////////////////////////////////////////////////////////////////// // Miranda NG: the free IM client for Microsoft* Windows* // -// Copyright (ñ) 2012-15 Miranda NG project, +// Copyright (c) 2012-15 Miranda NG project, // Copyright (c) 2000-09 Miranda ICQ/IM project, // all portions of this codebase are copyrighted to the people // listed in contributors.txt. @@ -271,7 +271,6 @@ checkboxes[] = { // // ALWAYS mask dat->dwFlags with MWF_LOG_ALL to only affect real flag bits and // ignore temporary bits. - int TSAPI LoadLocalFlags(TWindowData *dat) { if (dat == NULL) @@ -302,7 +301,6 @@ int TSAPI LoadLocalFlags(TWindowData *dat) // // @params: Win32 window procedure conform // @return LRESULT - static INT_PTR CALLBACK DlgProcUserPrefsLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); @@ -397,7 +395,6 @@ static INT_PTR CALLBACK DlgProcUserPrefsLogOptions(HWND hwndDlg, UINT msg, WPARA // @params: like any Win32 window procedure // // @return LRESULT (ignored for dialog procs, use DWLP_MSGRESULT) - INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index 403622be5e..178c944282 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -99,7 +99,6 @@ TCHAR* Utils::FilterEventMarkers(TCHAR *wszText) // this translates formatting tags into rtf sequences... // flags: loword = words only for simple * /_ formatting // hiword = bbcode support (strip bbcodes if 0) - const TCHAR* Utils::FormatRaw(TWindowData *dat, const TCHAR *msg, int flags, BOOL isSent) { bool clr_was_added = false, was_added; @@ -266,7 +265,6 @@ ok: ///////////////////////////////////////////////////////////////////////////////////////// // format the title bar string for IM chat sessions using placeholders. // the caller must mir_free() the returned string - TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat) { INT_PTR tempmark = 0; @@ -470,7 +468,6 @@ const TCHAR* Utils::DoubleAmpersands(TCHAR *pszText) // @param szText source text // @param iMaxLen max length of the preview // @return TCHAR* result (caller must mir_free() it) - TCHAR* Utils::GetPreviewWithEllipsis(TCHAR *szText, size_t iMaxLen) { size_t uRequired; @@ -506,7 +503,6 @@ TCHAR* Utils::GetPreviewWithEllipsis(TCHAR *szText, size_t iMaxLen) ///////////////////////////////////////////////////////////////////////////////////////// // returns != 0 when one of the installed keyboard layouts belongs to an rtl language // used to find out whether we need to configure the message input box for bidirectional mode - int Utils::FindRTLLocale(TWindowData *dat) { HKL layouts[20]; @@ -532,7 +528,6 @@ int Utils::FindRTLLocale(TWindowData *dat) ///////////////////////////////////////////////////////////////////////////////////////// // init default color table. the table may grow when using custom colors via bbcodes - void Utils::RTF_CTableInit() { int iSize = sizeof(TRTFColorTable) * RTF_CTABLE_DEFSIZE; @@ -545,7 +540,6 @@ void Utils::RTF_CTableInit() ///////////////////////////////////////////////////////////////////////////////////////// // add a color to the global rtf color table - void Utils::RTF_ColorAdd(const TCHAR *tszColname, size_t length) { TCHAR *stopped; @@ -562,7 +556,6 @@ void Utils::RTF_ColorAdd(const TCHAR *tszColname, size_t length) ///////////////////////////////////////////////////////////////////////////////////////// // generic error popup dialog procedure - LRESULT CALLBACK Utils::PopupDlgProcError(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { MCONTACT hContact = PUGetContact(hWnd); @@ -589,7 +582,6 @@ LRESULT CALLBACK Utils::PopupDlgProcError(HWND hWnd, UINT message, WPARAM wParam // @param hContact: contact handle (0 = read global) // @param cs TContainerSettings* target structure // @return 0 on success, 1 failure (blob does not exist OR is not a valid private setting structure - int Utils::ReadContainerSettingsFromDB(const MCONTACT hContact, TContainerSettings *cs, const char *szKey) { memcpy(cs, &PluginConfig.globalContainerSettings, sizeof(TContainerSettings)); @@ -639,7 +631,6 @@ void Utils::ContainerToSettings(TContainerData *pContainer) // // @param pContainer container window info struct // @param fForce true -> force them private, even if they were not marked as private in the db - void Utils::ReadPrivateContainerSettings(TContainerData *pContainer, bool fForce) { char szCname[50]; @@ -684,7 +675,6 @@ void Utils::SaveContainerSettings(TContainerData *pContainer, const char *szSett // // @param: maxHeight - determines maximum height for the picture, width will // be scaled accordingly. - void Utils::scaleAvatarHeightLimited(const HBITMAP hBm, double& dNewWidth, double& dNewHeight, LONG maxHeight) { BITMAP bm; @@ -716,7 +706,6 @@ void Utils::scaleAvatarHeightLimited(const HBITMAP hBm, double& dNewWidth, doubl // // @param dat: _MessageWindowData* pointer to the window data // @return HICON: the icon handle - HICON Utils::iconFromAvatar(const TWindowData *dat) { if (!ServiceExists(MS_AV_GETAVATARBITMAP) || dat == NULL) @@ -805,7 +794,6 @@ void Utils::getIconSize(HICON hIcon, int& sizeX, int& sizeY) // @param szText menu item text (must NOT be 0) // @param uID the item command id // @param pos zero-based position index - void Utils::addMenuItem(const HMENU& m, MENUITEMINFO &mii, HICON hIcon, const TCHAR *szText, UINT uID, UINT pos) { mii.wID = uID; @@ -819,7 +807,6 @@ void Utils::addMenuItem(const HMENU& m, MENUITEMINFO &mii, HICON hIcon, const TC ///////////////////////////////////////////////////////////////////////////////////////// // return != 0 when the sound effect must be played for the given // session. Uses container sound settings - int Utils::mustPlaySound(const TWindowData *dat) { if (!dat) @@ -850,7 +837,6 @@ int Utils::mustPlaySound(const TWindowData *dat) ///////////////////////////////////////////////////////////////////////////////////////// // enable or disable a dialog control - void Utils::enableDlgControl(const HWND hwnd, UINT id, bool fEnable) { ::EnableWindow(::GetDlgItem(hwnd, id), fEnable); @@ -858,7 +844,6 @@ void Utils::enableDlgControl(const HWND hwnd, UINT id, bool fEnable) ///////////////////////////////////////////////////////////////////////////////////////// // show or hide a dialog control - void Utils::showDlgControl(const HWND hwnd, UINT id, int showCmd) { ::ShowWindow(::GetDlgItem(hwnd, id), showCmd); @@ -866,7 +851,6 @@ void Utils::showDlgControl(const HWND hwnd, UINT id, int showCmd) ///////////////////////////////////////////////////////////////////////////////////////// // stream function to write the contents of the message log to an rtf file - DWORD CALLBACK Utils::StreamOut(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG * pcb) { TCHAR *szFilename = (TCHAR*)dwCookie; @@ -884,8 +868,7 @@ DWORD CALLBACK Utils::StreamOut(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG ///////////////////////////////////////////////////////////////////////////////////////// // extract a resource from the given module -// tszPath must end with \ - +// tszPath must end with \ bool Utils::extractResource(const HMODULE h, const UINT uID, const TCHAR *tszName, const TCHAR *tszPath, const TCHAR *tszFilename, bool fForceOverwrite) { @@ -918,7 +901,6 @@ bool Utils::extractResource(const HMODULE h, const UINT uID, const TCHAR *tszNam // caller MUST mir_free() the returned string // @param hwndRich - rich edit window handle // @return wchar_t* extracted URL - TCHAR* Utils::extractURLFromRichEdit(const ENLINK* _e, const HWND hwndRich) { CHARRANGE sel = { 0 }; @@ -940,7 +922,6 @@ TCHAR* Utils::extractURLFromRichEdit(const ENLINK* _e, const HWND hwndRich) ///////////////////////////////////////////////////////////////////////////////////////// // generic command dispatcher // used in various places (context menus, info panel menus etc.) - LRESULT Utils::CmdDispatcher(UINT uType, HWND hwndDlg, UINT cmd, WPARAM wParam, LPARAM lParam, TWindowData *dat, TContainerData *pContainer) { switch (uType) { @@ -967,7 +948,6 @@ LRESULT Utils::CmdDispatcher(UINT uType, HWND hwndDlg, UINT cmd, WPARAM wParam, // or folder name. All invalid characters will be replaced by spaces. // // @param tszFilename - string to filter. - void Utils::sanitizeFilename(wchar_t* tszFilename) { static wchar_t *forbiddenCharacters = L"%/\\':|\"<>?"; @@ -984,7 +964,6 @@ void Utils::sanitizeFilename(wchar_t* tszFilename) ///////////////////////////////////////////////////////////////////////////////////////// // ensure that a path name ends on a trailing backslash // @param szPathname - pathname to check - void Utils::ensureTralingBackslash(wchar_t *szPathname) { if (szPathname[mir_wstrlen(szPathname) - 1] != '\\') @@ -996,7 +975,6 @@ void Utils::ensureTralingBackslash(wchar_t *szPathname) // handle. // // return 0 and throw an exception if something goes wrong. - HMODULE Utils::loadSystemLibrary(const wchar_t* szFilename) { wchar_t sysPathName[MAX_PATH + 2]; @@ -1017,7 +995,6 @@ HMODULE Utils::loadSystemLibrary(const wchar_t* szFilename) ///////////////////////////////////////////////////////////////////////////////////////// // setting avatar's contact - void Utils::setAvatarContact(HWND hWnd, MCONTACT hContact) { MCONTACT hSub = db_mc_getSrmmSub(hContact); @@ -1026,7 +1003,6 @@ void Utils::setAvatarContact(HWND hWnd, MCONTACT hContact) ///////////////////////////////////////////////////////////////////////////////////////// // stub for copying data to clipboard - size_t Utils::CopyToClipBoard(const wchar_t *str, const HWND hwndOwner) { if (!OpenClipboard(hwndOwner) || str == 0) @@ -1046,7 +1022,6 @@ size_t Utils::CopyToClipBoard(const wchar_t *str, const HWND hwndOwner) ///////////////////////////////////////////////////////////////////////////////////////// // file list handler - void Utils::AddToFileList(TCHAR ***pppFiles, int *totalCount, LPCTSTR szFilename) { *pppFiles = (TCHAR**)mir_realloc(*pppFiles, (++*totalCount + 1) * sizeof(TCHAR*)); @@ -1092,7 +1067,6 @@ void Utils::AddToFileList(TCHAR ***pppFiles, int *totalCount, LPCTSTR szFilename * * Entries that do not use the LPGENT() macro are NOT TRANSLATABLE, so don't bother translating them. */ - static wchar_t* warnings[] = { LPGENT("Important release notes|A test warning message"), /* WARN_TEST */ /* reserved for important notes after upgrade - NOT translatable */ LPGENT("Icon pack version check|The installed icon pack is outdated and might be incompatible with TabSRMM version 3.\n\n\\b1Missing or misplaced icons are possible issues with the currently installed icon pack.\\b0"), /* WARN_ICONPACKVERSION */ -- cgit v1.2.3