diff options
Diffstat (limited to 'plugins/TabSRMM/src')
49 files changed, 495 insertions, 928 deletions
diff --git a/plugins/TabSRMM/src/ImageDataObject.cpp b/plugins/TabSRMM/src/ImageDataObject.cpp index 492dee835f..0955527398 100644 --- a/plugins/TabSRMM/src/ImageDataObject.cpp +++ b/plugins/TabSRMM/src/ImageDataObject.cpp @@ -43,8 +43,6 @@ extern void ImageDataInsertBitmap(IRichEditOle *ole, HBITMAP hBm) int CacheIconToBMP(TLogIcon *theIcon, HICON hIcon, COLORREF backgroundColor, int sizeX, int sizeY)
{
- bool succeeded = false;
-
int IconSizeX = sizeX;
int IconSizeY = sizeY;
diff --git a/plugins/TabSRMM/src/ImageDataObject.h b/plugins/TabSRMM/src/ImageDataObject.h index 2c83b1c27d..f05df9fa69 100644 --- a/plugins/TabSRMM/src/ImageDataObject.h +++ b/plugins/TabSRMM/src/ImageDataObject.h @@ -75,7 +75,7 @@ public: }
// IDataObject Interface
- STDMETHOD(GetData)(FORMATETC *pformatetcIn, STGMEDIUM *pmedium) {
+ STDMETHOD(GetData)(FORMATETC*, STGMEDIUM *pmedium) {
HANDLE hDst;
hDst = ::OleDuplicateData(m_stgmed.hBitmap, CF_BITMAP, 0);
if (hDst == NULL)
@@ -88,39 +88,37 @@ public: return S_OK;
}
- STDMETHOD(GetDataHere)(FORMATETC* pformatetc, STGMEDIUM* pmedium ) {
+ STDMETHOD(GetDataHere)(FORMATETC*, STGMEDIUM*) {
return E_NOTIMPL;
}
- STDMETHOD(QueryGetData)(FORMATETC* pformatetc ) {
+ STDMETHOD(QueryGetData)(FORMATETC*) {
return E_NOTIMPL;
}
- STDMETHOD(GetCanonicalFormatEtc)(FORMATETC* pformatectIn ,FORMATETC* pformatetcOut ) {
+ STDMETHOD(GetCanonicalFormatEtc)(FORMATETC*, FORMATETC*) {
return E_NOTIMPL;
}
- STDMETHOD(SetData)(FORMATETC* pformatetc , STGMEDIUM* pmedium , BOOL fRelease ) {
+ STDMETHOD(SetData)(FORMATETC* pformatetc, STGMEDIUM* pmedium, BOOL) {
m_format = *pformatetc;
m_stgmed = *pmedium;
-
return S_OK;
}
- STDMETHOD(EnumFormatEtc)(DWORD dwDirection , IEnumFORMATETC** ppenumFormatEtc ) {
+ STDMETHOD(EnumFormatEtc)(DWORD, IEnumFORMATETC**) {
return E_NOTIMPL;
}
- STDMETHOD(DAdvise)(FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink,
- DWORD *pdwConnection) {
+ STDMETHOD(DAdvise)(FORMATETC*, DWORD, IAdviseSink*, DWORD*) {
return E_NOTIMPL;
}
- STDMETHOD(DUnadvise)(DWORD dwConnection) {
+ STDMETHOD(DUnadvise)(DWORD) {
return E_NOTIMPL;
}
- STDMETHOD(EnumDAdvise)(IEnumSTATDATA **ppenumAdvise) {
+ STDMETHOD(EnumDAdvise)(IEnumSTATDATA**) {
return E_NOTIMPL;
}
diff --git a/plugins/TabSRMM/src/TSButton.cpp b/plugins/TabSRMM/src/TSButton.cpp index 6d55592f95..8c5c6cdcbc 100644 --- a/plugins/TabSRMM/src/TSButton.cpp +++ b/plugins/TabSRMM/src/TSButton.cpp @@ -109,8 +109,10 @@ static void PaintWorker(TSButtonCtrl *ctl, HDC hdcPaint) GetClientRect(ctl->hwnd, const_cast<RECT *>(&rcClient));
CopyRect(&rcContent, &rcClient);
- if (CMimAPI::m_haveBufferedPaint)
+ if (CMimAPI::m_haveBufferedPaint) {
hbp = CMimAPI::m_pfnBeginBufferedPaint(hdcPaint, &rcContent, BPBF_TOPDOWNDIB, NULL, &hdcMem);
+ hbmMem = hOld = 0;
+ }
else {
hdcMem = CreateCompatibleDC(hdcPaint);
hbmMem = CreateCompatibleBitmap(hdcPaint, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top);
diff --git a/plugins/TabSRMM/src/buttonbar.h b/plugins/TabSRMM/src/buttonbar.h index 67cab5bb7e..cc313c0945 100644 --- a/plugins/TabSRMM/src/buttonbar.h +++ b/plugins/TabSRMM/src/buttonbar.h @@ -42,10 +42,9 @@ static INT_PTR CB_RemoveButton(WPARAM wParam, LPARAM lParam); static INT_PTR CB_AddButton(WPARAM wParam, LPARAM lParam);
static INT_PTR CB_GetButtonState(WPARAM wParam, LPARAM lParam);
static INT_PTR CB_SetButtonState(WPARAM wParam, LPARAM lParam);
-static void CB_GetButtonSettings(MCONTACT hContact,CustomButtonData *cbd);
+static void CB_GetButtonSettings(MCONTACT hContact, CustomButtonData *cbd);
-void CB_WriteButtonSettings(MCONTACT hContact,CustomButtonData *cbd);
-int sstSortButtons(const void * vmtbi1, const void * vmtbi2);
+void CB_WriteButtonSettings(MCONTACT hContact, CustomButtonData *cbd);
void CB_DeInitCustomButtons();
void CB_InitCustomButtons();
@@ -53,10 +52,10 @@ void CB_InitDefaultButtons(); void CB_ReInitCustomButtons();
/* MinGW doesn't like this struct declatations below */
-void BB_UpdateIcons(HWND hdlg,TWindowData *dat);
+void BB_UpdateIcons(HWND hdlg);
void BB_RefreshTheme(const TWindowData *dat);
-void CB_DestroyAllButtons(HWND hwndDlg,TWindowData *dat);
-void CB_DestroyButton(HWND hwndDlg,TWindowData *dat,DWORD dwButtonCID,DWORD dwFlags);
-void CB_ChangeButton(HWND hwndDlg,TWindowData *dat,CustomButtonData* cbd);
+void CB_DestroyAllButtons(HWND hwndDlg);
+void CB_DestroyButton(HWND hwndDlg, TWindowData *dat, DWORD dwButtonCID, DWORD dwFlags);
+void CB_ChangeButton(HWND hwndDlg, TWindowData *dat, CustomButtonData* cbd);
#endif
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index d384f9721d..2b412e2ed4 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -57,7 +57,7 @@ void CB_DeInitCustomButtons() DestroyServiceFunction(hButtonsBarSetButtonState); } -void CB_DestroyAllButtons(HWND hwndDlg, TWindowData *dat) +void CB_DestroyAllButtons(HWND hwndDlg) { HWND hwndBtn = NULL; for (int i=0; i < LButtonsList.getCount(); i++) { @@ -384,7 +384,7 @@ static INT_PTR CB_ModifyButton(WPARAM, LPARAM lParam) return 0; } -void BB_UpdateIcons(HWND hdlg, TWindowData *dat) +void BB_UpdateIcons(HWND hdlg) { HWND hwndBtn = NULL; @@ -420,16 +420,12 @@ void TSAPI BB_InitDlgButtons(TWindowData *dat) if (hdlg == 0) return; RECT rect; - int i; int lwidth = 0, rwidth = 0; RECT rcSplitter; POINT ptSplitter; int splitterY; BYTE gap = DPISCALEX_S(PluginConfig.g_iButtonsBarGap); BOOL isThemed = TRUE; - int cx = 0, cy = 0; - int lcount = LButtonsList.getCount(); - int rcount = RButtonsList.getCount(); if (CSkin::m_skinEnabled && !SkinItems[ID_EXTBKBUTTONSNPRESSED].IGNORED && !SkinItems[ID_EXTBKBUTTONSPRESSED].IGNORED && !SkinItems[ID_EXTBKBUTTONSMOUSEOVER].IGNORED) { @@ -446,7 +442,7 @@ void TSAPI BB_InitDlgButtons(TWindowData *dat) HWND hwndBtn = NULL; - for (i = 0; i < RButtonsList.getCount(); i++) { + for (int i = 0; i < RButtonsList.getCount(); i++) { CustomButtonData *cbd = RButtonsList[i]; if (((dat->bType == SESSIONTYPE_IM && cbd->bIMButton) || (dat->bType == SESSIONTYPE_CHAT && cbd->bChatButton))) { if (!cbd->bHidden) @@ -485,7 +481,7 @@ void TSAPI BB_InitDlgButtons(TWindowData *dat) hwndBtn = NULL; - for (i = 0; i < LButtonsList.getCount(); i++) { + for (int i = 0; i < LButtonsList.getCount(); i++) { CustomButtonData *cbd = LButtonsList[i]; if (((dat->bType == SESSIONTYPE_IM && cbd->bIMButton) || (dat->bType == SESSIONTYPE_CHAT && cbd->bChatButton))) { if (!cbd->bSeparator && !GetDlgItem(hdlg, cbd->dwButtonCID)) { diff --git a/plugins/TabSRMM/src/chat/chat.h b/plugins/TabSRMM/src/chat/chat.h index 52c2067274..6b56d1e20e 100644 --- a/plugins/TabSRMM/src/chat/chat.h +++ b/plugins/TabSRMM/src/chat/chat.h @@ -111,7 +111,7 @@ extern CHAT_MANAGER saveCI; //////////////////////////////////////////////////////////////////////////////////
// log.c
-void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedraw, bool bPhaseTwo);
+void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedraw);
char* Log_CreateRtfHeader(MODULEINFO *mi);
// window.c
@@ -122,10 +122,10 @@ int GetTextPixelSize(TCHAR* pszText, HFONT hFont, bool bWidth); enum { FONTSECTION_AUTO, FONTSECTION_IM, FONTSECTION_IP };
void LoadMsgDlgFont(int section, int i, LOGFONT * lf, COLORREF * colour, char* szMod);
void AddIcons(void);
-HICON LoadIconEx(int iIndex, char * pszIcoLibName, int iX, int iY);
+HICON LoadIconEx(char *pszIcoLibName);
// services.c
-void ShowRoom(SESSION_INFO *si, WPARAM wp, BOOL bSetForeground);
+void ShowRoom(SESSION_INFO *si, WPARAM wp, BOOL);
HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateTab, BOOL bPopupContainer, BOOL bWantPopup);
diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp index f59c466ecb..8287eda7bd 100644 --- a/plugins/TabSRMM/src/chat/log.cpp +++ b/plugins/TabSRMM/src/chat/log.cpp @@ -418,33 +418,6 @@ static int EventToIcon(LOGINFO * lin) return 0;
}
-/* replace pattern `ptrn' with the string `rplc' in string `src' points to */
-static TCHAR * _tcsrplc(TCHAR **src, const TCHAR *ptrn, const TCHAR *rplc)
-{
- size_t lSrc, lPtrn, lRplc;
- TCHAR *tszFound, *tszTail;
-
- lSrc = mir_tstrlen(*src);
- lPtrn = mir_tstrlen(ptrn);
- lRplc = mir_tstrlen(rplc);
- if (lPtrn && lSrc && lSrc >= lPtrn && (tszFound = _tcsstr(*src, ptrn)) != NULL) {
- if (lRplc > lPtrn)
- *src = (TCHAR*) mir_realloc((void*) * src,
- sizeof(TCHAR) * (lSrc + lRplc - lPtrn + 1));
- if (tszTail = (TCHAR*) mir_alloc(sizeof(TCHAR) *
- (lSrc - (tszFound - *src) - lPtrn + 1))) {
- /* save tail */
- _tcscpy(tszTail, tszFound + lPtrn);
- /* write replacement string */
- _tcscpy(tszFound, rplc);
- /* write tail */
- _tcscpy(tszFound + lRplc, tszTail);
- mir_free((void*) tszTail);
- }
- }
- return *src;
-}
-
/*
* replace pattern `ptrn' with the string `rplc' in string `src',
* `src' is supposed to be `n' character long (or no checking is done if n < 0).
@@ -786,7 +759,6 @@ char* Log_CreateRtfHeader(MODULEINFO *mi) static char* Log_CreateRTF(LOGSTREAMDATA *streamData)
{
- int me = 0;
LOGINFO *lin = streamData->lin;
MODULEINFO *mi = pci->MM_FindModule(streamData->si->pszModule);
@@ -954,7 +926,7 @@ static DWORD CALLBACK Log_StreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG return 0;
}
-void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedraw, bool bPhaseTwo)
+void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedraw)
{
CHARRANGE oldsel, sel, newsel;
POINT point = {0};
diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp index 2f1517a33e..0256e0e614 100644 --- a/plugins/TabSRMM/src/chat/main.cpp +++ b/plugins/TabSRMM/src/chat/main.cpp @@ -42,14 +42,6 @@ static void OnAddLog(SESSION_INFO *si, int isOk) SendMessage(si->hWnd, GC_REDRAWLOG2, 0, 0);
}
-static void OnGetLogName(SESSION_INFO *si, LPCTSTR ptszParsedName)
-{
- if (!PathIsAbsoluteT(ptszParsedName))
- mir_sntprintf(si->pszLogFileName, SIZEOF(si->pszLogFileName), _T("%s%s"), M.getChatLogPath(), ptszParsedName);
- else
- _tcsncpy_s(si->pszLogFileName, ptszParsedName, _TRUNCATE);
-}
-
static void OnCreateSession(SESSION_INFO *si, MODULEINFO *mi)
{
Chat_SetFilters(si);
@@ -122,7 +114,7 @@ static void OnChangeNick(SESSION_INFO *si) }
}
-static void OnSetStatus(SESSION_INFO *si, int wStatus)
+static void OnSetStatus(SESSION_INFO *si, int)
{
PostMessage(si->hWnd, GC_FIXTABICONS, 0, 0);
}
@@ -205,7 +197,7 @@ static void OnLoadSettings() void Chat_ModulesLoaded()
{
- g_Settings.hIconOverlay = LoadIconEx(IDI_OVERLAY, "overlay", 16, 16);
+ g_Settings.hIconOverlay = LoadIconEx("overlay");
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/TabSRMM/src/chat/message.cpp b/plugins/TabSRMM/src/chat/message.cpp index afc1503f53..fd20f7e7a5 100644 --- a/plugins/TabSRMM/src/chat/message.cpp +++ b/plugins/TabSRMM/src/chat/message.cpp @@ -83,7 +83,7 @@ static int ReadInteger(const char* p, int* result) TCHAR* Chat_DoRtfToTags(char* pszText, SESSION_INFO *si)
{
- int i, iRemoveChars, cp = CP_ACP;
+ int i, iRemoveChars;
char InsertThis[50];
BOOL bJustRemovedRTF = TRUE;
BOOL bTextHasStarted = FALSE;
diff --git a/plugins/TabSRMM/src/chat/muchighlight.cpp b/plugins/TabSRMM/src/chat/muchighlight.cpp index ff9945c390..819d0e5041 100644 --- a/plugins/TabSRMM/src/chat/muchighlight.cpp +++ b/plugins/TabSRMM/src/chat/muchighlight.cpp @@ -282,8 +282,6 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L */
INT_PTR CALLBACK CMUCHighlight::dlgProcAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- UINT uCmd = ::GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
-
switch(msg) {
case WM_INITDIALOG:
{
@@ -319,8 +317,6 @@ INT_PTR CALLBACK CMUCHighlight::dlgProcAdd(HWND hwndDlg, UINT msg, WPARAM wParam case WM_CTLCOLORSTATIC:
{
HWND hwndChild = (HWND)lParam;
- UINT id = ::GetDlgCtrlID(hwndChild);
-
if (hwndChild == ::GetDlgItem(hwndDlg, IDC_ADDHIGHLIGHTTITLE))
::SetTextColor((HDC)wParam, RGB(60, 60, 150));
::SetBkColor((HDC)wParam, ::GetSysColor(COLOR_WINDOW));
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp index d4fb1228dc..10581f86e9 100644 --- a/plugins/TabSRMM/src/chat/options.cpp +++ b/plugins/TabSRMM/src/chat/options.cpp @@ -288,57 +288,7 @@ static void SaveBranch(HWND hwndTree, branch_t *branch, int nValues) }
}
-static void CheckHeading(HWND hwndTree, HTREEITEM hHeading)
-{
- if (hHeading == 0)
- return;
-
- BOOL bChecked = TRUE;
-
- TVITEM tvi;
- tvi.mask = TVIF_HANDLE | TVIF_STATE;
- tvi.hItem = TreeView_GetNextItem(hwndTree, hHeading, TVGN_CHILD);
- while (tvi.hItem && bChecked) {
- if (tvi.hItem != branch1[0].hItem && tvi.hItem != branch1[1].hItem) {
- TreeView_GetItem(hwndTree, &tvi);
- if (((tvi.state&TVIS_STATEIMAGEMASK) >> 12 == 2))
- bChecked = FALSE;
- }
- tvi.hItem = TreeView_GetNextSibling(hwndTree, tvi.hItem);
- }
- tvi.stateMask = TVIS_STATEIMAGEMASK;
- tvi.state = INDEXTOSTATEIMAGEMASK(1); //bChecked ? 3 : 2);
- tvi.hItem = hHeading;
- TreeView_SetItem(hwndTree, &tvi);
-}
-
-static void CheckBranches(HWND hwndTree, HTREEITEM hHeading)
-{
- if (hHeading == 0)
- return;
-
- BOOL bChecked = TRUE;
-
- TVITEM tvi;
- tvi.mask = TVIF_HANDLE | TVIF_STATE;
- tvi.hItem = hHeading;
- TreeView_GetItem(hwndTree, &tvi);
- if (((tvi.state&TVIS_STATEIMAGEMASK) >> 12 == 3) || ((tvi.state & TVIS_STATEIMAGEMASK) >> 12 == 1))
- bChecked = FALSE;
-
- tvi.stateMask = TVIS_STATEIMAGEMASK;
- tvi.state = INDEXTOSTATEIMAGEMASK(bChecked ? 2 : 1);
- TreeView_SetItem(hwndTree, &tvi);
- tvi.hItem = TreeView_GetNextItem(hwndTree, hHeading, TVGN_CHILD);
- while (tvi.hItem) {
- tvi.state = INDEXTOSTATEIMAGEMASK(bChecked ? 3 : 2);
- if (tvi.hItem != branch1[0].hItem && tvi.hItem != branch1[1].hItem)
- TreeView_SetItem(hwndTree, &tvi);
- tvi.hItem = TreeView_GetNextSibling(hwndTree, tvi.hItem);
- }
-}
-
-static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData)
+static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM)
{
char szDir[MAX_PATH];
switch (uMsg) {
@@ -397,7 +347,7 @@ void Chat_AddIcons(void) * get icon by name from the core icon library service
*/
-HICON LoadIconEx(int iIndex, char * pszIcoLibName, int iX, int iY)
+HICON LoadIconEx(char *pszIcoLibName)
{
char szTemp[256];
mir_snprintf(szTemp, SIZEOF(szTemp), "chat_%s", pszIcoLibName);
@@ -905,9 +855,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM case WM_NOTIFY:
if (((LPNMHDR)lParam)->idFrom == 0 && ((LPNMHDR)lParam)->code == PSN_APPLY) {
- TCHAR *p2 = NULL;
- char *pszText = NULL;
- TCHAR *ptszPath = NULL;
+ char *pszText = NULL;
int iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_LOGDIRECTORY));
if (iLen > 0) {
@@ -1029,7 +977,7 @@ static UINT _eventorder[] = * @return
*/
-INT_PTR CALLBACK DlgProcOptions3(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgProcOptions3(HWND hwndDlg, UINT uMsg, WPARAM, LPARAM lParam)
{
switch (uMsg) {
case WM_INITDIALOG:
diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp index d7af61c6bf..9de06558f3 100644 --- a/plugins/TabSRMM/src/chat/services.cpp +++ b/plugins/TabSRMM/src/chat/services.cpp @@ -35,7 +35,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT return 0;
if (hContact != 0 && M.GetByte("limittabs", 0) && !_tcsncmp(pContainer->szName, _T("default"), 6)) {
- if ((pContainer = FindMatchingContainer(_T("default"), hContact)) == NULL) {
+ if ((pContainer = FindMatchingContainer(_T("default"))) == NULL) {
TCHAR szName[CONTAINER_NAMELEN + 1];
mir_sntprintf(szName, SIZEOF(szName), _T("default"));
if ((pContainer = CreateContainer(szName, CNT_CREATEFLAG_CLONED, hContact)) == NULL)
@@ -153,7 +153,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT return hwndNew; // return handle of the new dialog
}
-void ShowRoom(SESSION_INFO *si, WPARAM wp, BOOL bSetForeground)
+void ShowRoom(SESSION_INFO *si, WPARAM, BOOL)
{
if (si == NULL)
return;
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index 275036ead9..3c8e9d4c9e 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -92,7 +92,7 @@ BOOL DoTrayIcon(SESSION_INFO *si, GCEVENT *gce) return TRUE;
}
-int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, TCHAR* pszRoomName, COLORREF crBkg, const TCHAR* fmt, ...)
+int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, TCHAR*, COLORREF crBkg, const TCHAR* fmt, ...)
{
POPUPDATAT pd = { 0 };
va_list marker;
@@ -110,7 +110,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa if (hIcon)
pd.lchIcon = hIcon;
else
- pd.lchIcon = LoadIconEx(IDI_CHANMGR, "window", 0, 0);
+ pd.lchIcon = LoadIconEx("window");
PROTOACCOUNT *pa = ProtoGetAccount(pszProtoName);
mir_sntprintf(pd.lptzContactName, SIZEOF(pd.lptzContactName), _T("%s - %s"),
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index 1f320d304a..aa3a51607e 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -51,75 +51,7 @@ struct MESSAGESUBDATA SESSION_INFO *lastSession; }; -static const CLSID IID_ITextDocument= { 0x8CC497C0,0xA1DF,0x11CE, { 0x80,0x98, 0x00,0xAA, 0x00,0x47,0xBE,0x5D} }; - -static void Chat_SetMessageLog(TWindowData *dat) -{ - unsigned int iLogMode = M.GetByte(CHAT_MODULE, "useIEView", 0); - - if (iLogMode == WANT_IEVIEW_LOG && dat->hwndIEView == 0) { - IEVIEWWINDOW ieWindow; - IEVIEWEVENT iee; - - //CheckAndDestroyHPP(dat); - memset(&ieWindow, 0, sizeof(ieWindow)); - memset(&iee, 0, sizeof(iee)); - ieWindow.cbSize = sizeof(ieWindow); - ieWindow.iType = IEW_CREATE; - ieWindow.dwFlags = 0; - ieWindow.dwMode = IEWM_TABSRMM; - ieWindow.parent = dat->hwnd; - ieWindow.x = 0; - ieWindow.y = 0; - ieWindow.cx = 200; - ieWindow.cy = 300; - CallService(MS_IEVIEW_WINDOW, 0, (LPARAM)&ieWindow); - dat->hwndIEView = ieWindow.hwnd; - - memset(&iee, 0, sizeof(iee)); - iee.cbSize = sizeof(iee); - iee.iType = IEE_CLEAR_LOG; - iee.hwnd = dat->hwndIEView; - iee.hContact = dat->hContact; - iee.codepage = dat->codePage; - - SESSION_INFO *si = dat->si; - - iee.pszProto = si->pszModule; - CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&iee); - - Utils::showDlgControl(dat->hwnd, IDC_CHAT_LOG, SW_HIDE); - Utils::enableDlgControl(dat->hwnd, IDC_CHAT_LOG, FALSE); - } - else if (iLogMode == WANT_HPP_LOG && dat->hwndHPP == 0) { - IEVIEWWINDOW ieWindow; - - memset(&ieWindow, 0, sizeof(ieWindow)); - //CheckAndDestroyIEView(dat); - ieWindow.cbSize = sizeof(IEVIEWWINDOW); - ieWindow.iType = IEW_CREATE; - ieWindow.dwFlags = 0; - ieWindow.dwMode = IEWM_MUCC; - ieWindow.parent = dat->hwnd; - ieWindow.x = 0; - ieWindow.y = 0; - ieWindow.cx = 10; - ieWindow.cy = 10; - CallService(MS_HPP_EG_WINDOW, 0, (LPARAM)&ieWindow); - dat->hwndHPP = ieWindow.hwnd; - Utils::showDlgControl(dat->hwnd, IDC_CHAT_LOG, SW_HIDE); - Utils::enableDlgControl(dat->hwnd, IDC_CHAT_LOG, FALSE); - } - else { - if (iLogMode != WANT_IEVIEW_LOG) - CheckAndDestroyIEView(dat); - Utils::showDlgControl(dat->hwnd, IDC_CHAT_LOG, SW_SHOW); - Utils::enableDlgControl(dat->hwnd, IDC_CHAT_LOG, TRUE); - dat->hwndIEView = 0; - dat->hwndIWebBrowserControl = 0; - dat->hwndHPP = 0; - } -} +const CLSID IID_ITextDocument = { 0x8CC497C0, 0xA1DF, 0x11CE, { 0x80, 0x98, 0x00, 0xAA, 0x00, 0x47, 0xBE, 0x5D } }; /* * checking if theres's protected text at the point @@ -385,7 +317,6 @@ static int RoomWndResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *urc) rc.bottom = rc.top = rc.left = rc.right = 0; GetClientRect(hwndDlg, &rcTabs); - int TabHeight = rcTabs.bottom - rcTabs.top; if (dat->bIsAutosizingInput) Utils::showDlgControl(hwndDlg, IDC_SPLITTERY, SW_HIDE); @@ -620,7 +551,6 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, { MODULEINFO *mi = pci->MM_FindModule(Parentsi->pszModule); CHARRANGE sel, all = { 0, -1}; - int iPrivateBG = M.GetByte(mwdat->hContact, "private_bg", 0); int idFrom = IDC_CHAT_MESSAGE; POINT pt; @@ -1120,7 +1050,7 @@ static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP case WM_CLOSE: if (wParam == 1 && lParam == 1) { int iFlags = 0, i; - DWORD dwMask = 0, dwFlags = 0; + DWORD dwMask = 0; for (i=0; i < SIZEOF(_eventorder); i++) { int result = IsDlgButtonChecked(hwndDlg, IDC_1 + i); @@ -1343,7 +1273,7 @@ static LRESULT CALLBACK LogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR * show the userinfo - tooltip. */ -static void ProcessNickListHovering(HWND hwnd, int hoveredItem, POINT * pt, SESSION_INFO * parentdat) +static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO *parentdat) { static int currentHovered = -1; static HWND hwndToolTip = NULL; @@ -1606,7 +1536,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndParent, GWLP_USERDATA); SESSION_INFO *parentdat = dat->si; - int height; + int height = 0; TVHITTESTINFO hti; hti.pt.x = (short) LOWORD(lParam); hti.pt.y = (short) HIWORD(lParam); @@ -1715,7 +1645,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, if (nItemUnderMouse != -1) SetTimer(hwnd, 1, 450, 0); } - else ProcessNickListHovering(hwnd, (int)nItemUnderMouse, &pt, parentdat); + else ProcessNickListHovering(hwnd, (int)nItemUnderMouse, parentdat); } else { if (M.GetByte("adv_TipperTooltip", 1) && ServiceExists("mToolTip/HideTip")) { @@ -1725,7 +1655,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, isToolTip = FALSE; } } - else ProcessNickListHovering(hwnd, -1, &pt, NULL); + else ProcessNickListHovering(hwnd, -1, NULL); } } break; @@ -1790,7 +1720,7 @@ int GetTextPixelSize(TCHAR* pszText, HFONT hFont, bool bWidth) HFONT hOldFont = (HFONT)SelectObject(hdc, hFont); RECT rc = {0}; - int i = DrawText(hdc, pszText , -1, &rc, DT_CALCRECT); + DrawText(hdc, pszText , -1, &rc, DT_CALCRECT); SelectObject(hdc, hOldFont); ReleaseDC(NULL, hdc); @@ -1960,7 +1890,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar break; case DM_LOADBUTTONBARICONS: - BB_UpdateIcons(hwndDlg, dat); + BB_UpdateIcons(hwndDlg); return 0; case GC_SETWNDPROPS: @@ -1999,7 +1929,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar } TCHAR szTemp[100]; - HICON hIcon; + HICON hIcon = 0; switch (si->iType) { case GCW_CHATROOM: @@ -2017,7 +1947,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar break; case GCW_SERVER: mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%s: Server"), szNick); - hIcon = LoadIconEx(IDI_CHANMGR, "window", 16, 16); + hIcon = LoadIconEx("window"); break; } @@ -2160,10 +2090,10 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if ((si->iType != GCW_CHATROOM && si->iType != GCW_PRIVMESS) || !si->bFilterEnabled || (si->iLogFilterFlags&pLog->iType) != 0) index++; } - Log_StreamInEvent(hwndDlg, pLog, si, TRUE, FALSE); + Log_StreamInEvent(hwndDlg, pLog, si, TRUE); mir_forkthread(phase2, si); } - else Log_StreamInEvent(hwndDlg, si->pLogEnd, si, TRUE, FALSE); + else Log_StreamInEvent(hwndDlg, si->pLogEnd, si, TRUE); } else SendMessage(hwndDlg, GC_EVENT_CONTROL + WM_USER + 500, WINDOW_CLEARLOG, 0); break; @@ -2171,13 +2101,13 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case GC_REDRAWLOG2: si->LastTime = 0; if (si->pLog) - Log_StreamInEvent(hwndDlg, si->pLogEnd, si, TRUE, FALSE); + Log_StreamInEvent(hwndDlg, si->pLogEnd, si, TRUE); break; case GC_REDRAWLOG3: si->LastTime = 0; if (si->pLog) - Log_StreamInEvent(hwndDlg, si->pLogEnd, si, TRUE, TRUE); + Log_StreamInEvent(hwndDlg, si->pLogEnd, si, TRUE); break; case GC_ADDLOG: @@ -2196,7 +2126,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar } if (si->pLogEnd) - Log_StreamInEvent(hwndDlg, si->pLog, si, FALSE, FALSE); + Log_StreamInEvent(hwndDlg, si->pLog, si, FALSE); else SendMessage(hwndDlg, GC_EVENT_CONTROL + WM_USER + 500, WINDOW_CLEARLOG, 0); } @@ -2444,7 +2374,7 @@ LABEL_SHOWWINDOW: if (si->iSplitterY > rc.bottom - rc.top - DPISCALEY_S(40)) si->iSplitterY = rc.bottom - rc.top - DPISCALEY_S(40); g_Settings.iSplitterY = si->iSplitterY; - CSkin::UpdateToolbarBG(dat, RDW_ALLCHILDREN); + CSkin::UpdateToolbarBG(dat); SendMessage(dat->hwnd, WM_SIZE, 0, 0); } else if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_PANELSPLITTER)) { @@ -2626,8 +2556,6 @@ LABEL_SHOWWINDOW: if (iCharIndex < 0) break; - int iLineIndex = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_EXLINEFROMCHAR, 0, iCharIndex); - int iChars = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_LINEINDEX, iLineIndex, 0); int start = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_FINDWORDBREAK, WB_LEFT, iCharIndex); int end = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_FINDWORDBREAK, WB_RIGHT, iCharIndex); @@ -2819,7 +2747,6 @@ LABEL_SHOWWINDOW: return TRUE; } else if (msg == WM_LBUTTONUP) { - USERINFO *ui = si->pUsers; SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_EXGETSEL, 0, (LPARAM)&chr); size_t bufSize = mir_tstrlen(tr.lpstrText) + mir_tstrlen(tszAplTmpl) + 3; tszTmp = tszAppeal = (TCHAR*)mir_alloc(bufSize * sizeof(TCHAR)); @@ -3203,7 +3130,6 @@ LABEL_SHOWWINDOW: UINT item_ids[3] = {ID_EXTBKUSERLIST, ID_EXTBKHISTORY, ID_EXTBKINPUTAREA}; UINT ctl_ids[3] = {IDC_LIST, IDC_CHAT_LOG, IDC_CHAT_MESSAGE}; bool bAero = M.isAero(); - bool bInfoPanel = dat->Panel->isActive(); HANDLE hbp = 0; HDC hdcMem = 0; HBITMAP hbm, hbmOld; @@ -3212,8 +3138,10 @@ LABEL_SHOWWINDOW: LONG cx = rcClient.right - rcClient.left; LONG cy = rcClient.bottom - rcClient.top; - if (CMimAPI::m_haveBufferedPaint) + if (CMimAPI::m_haveBufferedPaint) { hbp = CSkin::InitiateBufferedPaint(hdc, rcClient, hdcMem); + hbm = hbmOld = 0; + } else { hdcMem = CreateCompatibleDC(hdc); hbm = CSkin::CreateAeroCompatibleBitmap(rcClient, hdc); @@ -3276,7 +3204,7 @@ LABEL_SHOWWINDOW: case WM_PAINT: { PAINTSTRUCT ps; - HDC hdc = BeginPaint(hwndDlg, &ps); + BeginPaint(hwndDlg, &ps); EndPaint(hwndDlg, &ps); } return 0; @@ -3508,7 +3436,7 @@ LABEL_SHOWWINDOW: if (lParam) CB_DestroyButton(hwndDlg, dat, (DWORD)wParam, (DWORD)lParam); else - CB_DestroyAllButtons(hwndDlg, dat); + CB_DestroyAllButtons(hwndDlg); break; case DM_CONFIGURETOOLBAR: diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index 488165ad14..7ca4e06c94 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -274,7 +274,7 @@ void CContactCache::setWindowData(const HWND hwnd, TWindowData *dat) * 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 lParam) +void CContactCache::saveHistory(WPARAM wParam, LPARAM) { size_t iLength = 0, iStreamLength = 0; int oldTop = 0; diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 8c5425d422..fcb498da2e 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -36,21 +36,10 @@ TContainerData *pFirstContainer = 0; // the linked list of struct ContainerWindowData TContainerData *pLastActiveContainer = NULL; -static bool fForceOverlayIcons = false; +static TContainerData* TSAPI AppendToContainerList(TContainerData*); +static TContainerData* TSAPI RemoveContainerFromList(TContainerData*); -static int ServiceParamsOK(ButtonItem *item, WPARAM *wParam, LPARAM *lParam, MCONTACT hContact) -{ - if (item->dwFlags & BUTTON_PASSHCONTACTW || item->dwFlags & BUTTON_PASSHCONTACTL || item->dwFlags & BUTTON_ISCONTACTDBACTION) { - if (hContact == 0) - return 0; - if (item->dwFlags & BUTTON_PASSHCONTACTW) - *wParam = hContact; - else if (item->dwFlags & BUTTON_PASSHCONTACTL) - *lParam = hContact; - return 1; - } - return 1; // doesn't need a paramter -} +static bool fForceOverlayIcons = false; // Windows Vista+ // extend the glassy area to get aero look for the status bar, tab bar, info panel @@ -120,68 +109,6 @@ void TSAPI SetAeroMargins(TContainerData *pContainer) } } -// CreateContainer MUST allocate a ContainerWindowData and pass its address -// to CreateDialogParam() via the LPARAM. It also adds the struct to the linked list -// of containers. -// -// The WM_DESTROY handler of the container DlgProc is responsible for mir_free()'ing the -// pointer and for removing the struct from the linked list. - -TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, MCONTACT hContactFrom) -{ - if (CMimAPI::m_shutDown) - return NULL; - - TContainerData *pContainer = (TContainerData*)mir_calloc(sizeof(TContainerData)); - _tcsncpy(pContainer->szName, name, CONTAINER_NAMELEN + 1); - AppendToContainerList(pContainer); - - if (M.GetByte("limittabs", 0) && !_tcscmp(name, _T("default"))) - iTemp |= CNT_CREATEFLAG_CLONED; - - // save container name to the db - if (!M.GetByte("singlewinmode", 0)) { - int iFirstFree = -1, iFound = FALSE, i = 0; - do { - char szCounter[10]; - itoa(i, szCounter, 10); - ptrT tszName(db_get_tsa(NULL, CONTAINER_KEY, szCounter)); - if (tszName == NULL) { - if (iFirstFree != -1) { - pContainer->iContainerIndex = iFirstFree; - itoa(iFirstFree, szCounter, 10); - } - else pContainer->iContainerIndex = i; - - db_set_ts(NULL, CONTAINER_KEY, szCounter, name); - BuildContainerMenu(); - break; - } - - if (!_tcsncmp(tszName, name, CONTAINER_NAMELEN)) { - pContainer->iContainerIndex = i; - iFound = TRUE; - } - else if (!_tcsncmp(tszName, _T("**mir_free**"), CONTAINER_NAMELEN)) - iFirstFree = i; - } - while (++i && iFound == FALSE); - } - else { - iTemp |= CNT_CREATEFLAG_CLONED; - pContainer->iContainerIndex = 1; - } - - if (iTemp & CNT_CREATEFLAG_MINIMIZED) - pContainer->dwFlags = CNT_CREATE_MINIMIZED; - if (iTemp & CNT_CREATEFLAG_CLONED) { - pContainer->dwFlags |= CNT_CREATE_CLONED; - pContainer->hContactFrom = hContactFrom; - } - pContainer->hwnd = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSGCONTAINER), NULL, DlgProcContainer, (LPARAM)pContainer); - return pContainer; -} - static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { TContainerData *pContainer = (TContainerData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); @@ -207,14 +134,12 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, HDC dcFrame = GetDCEx(hwndDlg, 0, DCX_WINDOW|/*DCX_INTERSECTRGN|*/0x10000); // GetWindowDC(hwndDlg); POINT pt, pt1; LONG clip_top, clip_left; - HRGN rgn = 0; CSkinItem *item; TCHAR szWindowText[512]; RECT rcText; HDC dcMem = CreateCompatibleDC(pContainer->cachedDC ? pContainer->cachedDC : dcFrame); HBITMAP hbmMem, hbmOld; int i; - DRAWITEMSTRUCT dis = {0}; GetWindowRect(hwndDlg, &rcWindow); GetClientRect(hwndDlg, &rcClient); @@ -277,7 +202,7 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, for (i=0; i < 3; i++) { RECT *rc = 0; - HICON hIcon; + HICON hIcon = 0; switch (i) { case 0: @@ -402,7 +327,7 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, for (i=0; i < 3; i++) { if (pContainer->buttons[i].isHot != pContainer->oldbuttons[i].isHot) { RECT *rc = 0; - HICON hIcon; + HICON hIcon = 0; switch (i) { case 0: @@ -486,7 +411,6 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, { RECT r; POINT pt; - int k = 0; int clip = CSkin::m_bClipBorder; if (!pContainer) @@ -543,22 +467,17 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, switch (msg) { case WM_INITDIALOG: - { - bool bAero = M.isAero(); - BOOL isFlat = M.GetByte("tbflat", 1); - BOOL isThemed = !M.GetByte("nlflat", 0); - - fHaveTipper = ServiceExists("mToolTip/ShowTip"); - fForceOverlayIcons = M.GetByte("forceTaskBarStatusOverlays", 0) ? true : false; + fHaveTipper = ServiceExists("mToolTip/ShowTip"); + fForceOverlayIcons = M.GetByte("forceTaskBarStatusOverlays", 0) ? true : false; - pContainer = (TContainerData*)lParam; - SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) pContainer); - mir_subclassWindow(hwndDlg, ContainerWndProc); + pContainer = (TContainerData*)lParam; + SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) pContainer); + mir_subclassWindow(hwndDlg, ContainerWndProc); - pContainer->hwnd = hwndDlg; + pContainer->hwnd = hwndDlg; + { DWORD dwCreateFlags = pContainer->dwFlags; - - pContainer->isCloned = (pContainer->dwFlags & CNT_CREATE_CLONED); + pContainer->isCloned = (dwCreateFlags & CNT_CREATE_CLONED); pContainer->fPrivateThemeChanged = FALSE; SendMessage(hwndDlg, DM_OPTIONSAPPLIED, 0, 0); // set options... @@ -704,7 +623,6 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, else { RECT rcClient, rcUnadjusted; TCITEM item = {0}; - POINT pt = {0}; GetClientRect(hwndDlg, &rcClient); pContainer->MenuBar->getClientRect(); @@ -723,7 +641,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, CopyRect(&pContainer->rcSaved, &rcClient); rcUnadjusted = rcClient; - pContainer->MenuBar->Resize(LOWORD(lParam), HIWORD(lParam), FALSE); + pContainer->MenuBar->Resize(LOWORD(lParam)); LONG rebarHeight = pContainer->MenuBar->getHeight(); pContainer->MenuBar->Show((pContainer->dwFlags & CNT_NOMENUBAR) ? SW_HIDE : SW_SHOW); @@ -817,7 +735,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, case NM_RCLICK: RECT rc; NMMOUSE *nm = (NMMOUSE*)lParam; - int nPanel, nParts = SendMessage(pContainer->hwndStatus, SB_GETPARTS, 0, 0); + int nPanel; if (nm->dwItemSpec == 0xFFFFFFFE) { nPanel = 2; SendMessage(pContainer->hwndStatus, SB_GETRECT, nPanel, (LPARAM)&rc); @@ -832,7 +750,7 @@ panel_found: TWindowData *dat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA); SendMessage(pContainer->hwndStatus, SB_GETRECT, nPanel, (LPARAM)&rc); if (dat) - CheckStatusIconClick(dat, pContainer->hwndStatus, nm->pt, rc, 2, ((LPNMHDR)lParam)->code); + CheckStatusIconClick(dat, nm->pt, rc, 2, ((LPNMHDR)lParam)->code); } else if (((LPNMHDR)lParam)->code == NM_RCLICK) { POINT pt; @@ -906,7 +824,6 @@ panel_found: int iSelection = TrackPopupMenu(subMenu, TPM_RETURNCMD, pt1.x, pt1.y, 0, hwndDlg, NULL); if (iSelection >= IDM_CONTAINERMENU) { - DBVARIANT dbv = {0}; char szIndex[10]; itoa(iSelection - IDM_CONTAINERMENU, szIndex, 10); if (iSelection - IDM_CONTAINERMENU >= 0) { @@ -973,12 +890,8 @@ panel_found: MCONTACT hContact; TWindowData *dat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA); DWORD dwOldFlags = pContainer->dwFlags; - ButtonItem *pItem = pContainer->buttonItems; if (dat) { - DWORD dwOldMsgWindowFlags = dat->dwFlags; - DWORD dwOldEventIsShown = dat->dwFlagsEx; - if (fProcessContactMenu) return(CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)dat->hContact)); else if (fProcessMainMenu) { @@ -995,11 +908,9 @@ panel_found: case IDC_TOGGLESIDEBAR: { RECT rc; - LONG dwNewLeft; - BOOL skinnedMode = bSkinned | (IsThemeActive() ? 1 : 0); - GetWindowRect(hwndDlg, &rc); + LONG dwNewLeft; bool fVisible = pContainer->SideBar->isVisible(); if (fVisible) { dwNewLeft = pContainer->SideBar->getWidth(); @@ -1254,9 +1165,9 @@ panel_found: break; iNewTab = lParam - 1; } + else iNewTab = -1; if (iNewTab != iCurrent) { - TabControlData *tabdat = (TabControlData *)GetWindowLongPtr(hwndTab, GWLP_USERDATA); memset(&item, 0, sizeof(item)); item.mask = TCIF_PARAM; if (TabCtrl_GetItem(hwndTab, iNewTab, &item)) { @@ -1389,7 +1300,7 @@ panel_found: case WM_PAINT: if (bSkinned || M.isAero()) { PAINTSTRUCT ps; - HDC hdc = BeginPaint(hwndDlg, &ps); + BeginPaint(hwndDlg, &ps); EndPaint(hwndDlg, &ps); return 0; } @@ -1487,9 +1398,7 @@ panel_found: DWORD ws, wsold, ex = 0, exold = 0; HMENU hSysmenu = GetSystemMenu(hwndDlg, FALSE); MCONTACT hContact = 0; - int i=0; UINT sBarHeight; - bool bAero = M.isAero(); ws = wsold = GetWindowLongPtr(hwndDlg, GWL_STYLE); if (!CSkin::m_frameSkins) { @@ -1586,7 +1495,7 @@ panel_found: int iItems = TabCtrl_GetItemCount(hwndTab); TCITEM item = {0}; - DWORD dwTimestamp, dwMostRecent = 0; + DWORD dwTimestamp; RECENTINFO *ri = (RECENTINFO *)lParam; ri->iFirstIndex = ri->iMostRecent = -1; @@ -1702,10 +1611,6 @@ panel_found: case WM_DRAWITEM: { DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)lParam; - int cx = PluginConfig.m_smcxicon; - int cy = PluginConfig.m_smcyicon; - int id = LOWORD(dis->itemID); - if (dis->hwndItem == pContainer->hwndStatus && !(pContainer->dwFlags & CNT_NOSTATUSBAR)) { TWindowData *dat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA); if (dat) @@ -1882,6 +1787,68 @@ panel_found: return FALSE; } +///////////////////////////////////////////////////////////////////////////////////////// +// CreateContainer MUST allocate a ContainerWindowData and pass its address +// to CreateDialogParam() via the LPARAM. It also adds the struct to the linked list +// of containers. +// +// The WM_DESTROY handler of the container DlgProc is responsible for mir_free()'ing the +// pointer and for removing the struct from the linked list. + +TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, MCONTACT hContactFrom) +{ + if (CMimAPI::m_shutDown) + return NULL; + + TContainerData *pContainer = (TContainerData*)mir_calloc(sizeof(TContainerData)); + _tcsncpy(pContainer->szName, name, CONTAINER_NAMELEN + 1); + AppendToContainerList(pContainer); + + if (M.GetByte("limittabs", 0) && !_tcscmp(name, _T("default"))) + iTemp |= CNT_CREATEFLAG_CLONED; + + // save container name to the db + if (!M.GetByte("singlewinmode", 0)) { + int iFirstFree = -1, iFound = FALSE, i = 0; + do { + char szCounter[10]; + itoa(i, szCounter, 10); + ptrT tszName(db_get_tsa(NULL, CONTAINER_KEY, szCounter)); + if (tszName == NULL) { + if (iFirstFree != -1) { + pContainer->iContainerIndex = iFirstFree; + itoa(iFirstFree, szCounter, 10); + } + else pContainer->iContainerIndex = i; + + db_set_ts(NULL, CONTAINER_KEY, szCounter, name); + BuildContainerMenu(); + break; + } + + if (!_tcsncmp(tszName, name, CONTAINER_NAMELEN)) { + pContainer->iContainerIndex = i; + iFound = TRUE; + } + else if (!_tcsncmp(tszName, _T("**mir_free**"), CONTAINER_NAMELEN)) + iFirstFree = i; + } while (++i && iFound == FALSE); + } + else { + iTemp |= CNT_CREATEFLAG_CLONED; + pContainer->iContainerIndex = 1; + } + + if (iTemp & CNT_CREATEFLAG_MINIMIZED) + pContainer->dwFlags = CNT_CREATE_MINIMIZED; + if (iTemp & CNT_CREATEFLAG_CLONED) { + pContainer->dwFlags |= CNT_CREATE_CLONED; + pContainer->hContactFrom = hContactFrom; + } + pContainer->hwnd = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSGCONTAINER), NULL, DlgProcContainer, (LPARAM)pContainer); + return pContainer; +} + // search the list of tabs and return the tab (by index) which "belongs" to the given // hwnd. The hwnd is the handle of a message dialog childwindow. At creation, // the dialog handle is stored in the TCITEM.lParam field, because we need @@ -2070,8 +2037,6 @@ void TSAPI AdjustTabClientRect(TContainerData *pContainer, RECT *rc) RECT rcTab, rcTabOrig; GetClientRect(hwndTab, &rcTab); - DWORD dwBottom = rcTab.bottom; - DWORD dwTop = rcTab.top; if (!(pContainer->dwFlags & CNT_SIDEBAR) && (pContainer->iChilds > 1 || !(pContainer->dwFlags & CNT_HIDETABS))) { rcTabOrig = rcTab; TabCtrl_AdjustRect(hwndTab, FALSE, &rcTab); diff --git a/plugins/TabSRMM/src/containeroptions.cpp b/plugins/TabSRMM/src/containeroptions.cpp index 032dde2b0e..ee98bcbc75 100644 --- a/plugins/TabSRMM/src/containeroptions.cpp +++ b/plugins/TabSRMM/src/containeroptions.cpp @@ -57,7 +57,6 @@ static void ReloadGlobalContainerSettings(bool fForceReconfig) */
void TSAPI ApplyContainerSetting(TContainerData *pContainer, DWORD flags, UINT mode, bool fForceResize)
{
- DWORD dwOld = pContainer->dwFlags;
bool isEx = (mode & 0xffff0000) ? true : false;
bool set = (mode & 0x01) ? true : false;
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp index db00db12b9..10c8237cb1 100644 --- a/plugins/TabSRMM/src/controls.cpp +++ b/plugins/TabSRMM/src/controls.cpp @@ -146,7 +146,7 @@ LONG CMenuBar::getHeight() const // @return LRESULT: message processing result. Win32 conform. // -1 means: nothing processed, caller should continue as usual. -LONG_PTR CMenuBar::processMsg(const UINT msg, const WPARAM wParam, const LPARAM lParam) +LONG_PTR CMenuBar::processMsg(const UINT msg, const WPARAM, const LPARAM lParam) { if (msg == WM_NOTIFY) { NMHDR *pNMHDR = (NMHDR*)lParam; @@ -166,7 +166,7 @@ LONG_PTR CMenuBar::processMsg(const UINT msg, const WPARAM wParam, const LPARAM { NMTBHOTITEM *nmtb = (NMTBHOTITEM *)lParam; if (nmtb->idNew != 0 && m_fTracking && nmtb->idNew != m_activeID && m_activeID != 0) { - cancel(0); + cancel(); return 0; } else if (m_fTracking == true && m_activeID == 0 && nmtb->idNew != 0) { @@ -371,9 +371,7 @@ LONG_PTR CMenuBar::Handle(const NMTOOLBAR *nmtb) if (nmtb->hdr.hwndFrom != m_hwndToolbar) return TBDDRET_NODEFAULT; - const int index = idToIndex(nmtb->iItem); invoke(nmtb->iItem); - return TBDDRET_DEFAULT; } @@ -411,7 +409,7 @@ void CMenuBar::invoke(const int id) ::ClientToScreen(m_hwndToolbar, &pt); if (m_activeID) - cancel(0); + cancel(); m_activeMenu = hMenu; m_activeSubMenu = 0; @@ -423,7 +421,7 @@ void CMenuBar::invoke(const int id) ::TrackPopupMenu(hMenu, 0, pt.x, pt.y, 0, m_pContainer->hwnd, 0); } -void CMenuBar::cancel(const int id) +void CMenuBar::cancel() { releaseHook(); if (m_activeID) @@ -436,7 +434,7 @@ void CMenuBar::cancel(const int id) void CMenuBar::Cancel(void) { - cancel(0); + cancel(); m_fTracking = false; autoShow(0); } @@ -664,7 +662,7 @@ LRESULT CALLBACK CMenuBar::MessageHook(int nCode, WPARAM wParam, LPARAM lParam) ::SendMessage(m_Owner->m_hwndToolbar, TB_SETHOTITEM, (WPARAM)iIndex, 0); ::SetFocus(m_Owner->m_hwndToolbar); ::SendMessage(m_Owner->m_hwndToolbar, TB_SETSTATE, (WPARAM)m_Owner->m_activeID, TBSTATE_ENABLED | TBSTATE_PRESSED); - m_Owner->cancel(0); + m_Owner->cancel(); m_Owner->m_fTracking = false; } } @@ -747,8 +745,10 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR HBITMAP hbm, hbmOld; HANDLE hbp = 0; HDC hdcMem; - if (CMimAPI::m_haveBufferedPaint) + if (CMimAPI::m_haveBufferedPaint) { hbp = CMimAPI::m_pfnBeginBufferedPaint(hdc, &rcClient, BPBF_TOPDOWNDIB, NULL, &hdcMem); + hbm = hbmOld = 0; + } else { hdcMem = CreateCompatibleDC(hdc); hbm = CSkin::CreateAeroCompatibleBitmap(rcClient, hdc); @@ -837,7 +837,6 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR } int height = itemRect.bottom - itemRect.top; - int width = itemRect.right - itemRect.left; HICON hIcon = (HICON)SendMessage(hWnd, SB_GETICON, i, 0); TCHAR szText[1024]; szText[0] = 0; diff --git a/plugins/TabSRMM/src/controls.h b/plugins/TabSRMM/src/controls.h index f30a06fac6..0e75db87bc 100644 --- a/plugins/TabSRMM/src/controls.h +++ b/plugins/TabSRMM/src/controls.h @@ -42,12 +42,11 @@ public: ~CMenuBar();
const RECT& getClientRect();
- void Resize(WORD wWidth, WORD wHeight, BOOL redraw) const
+ void Resize(WORD wWidth) const
{
- ::SetWindowPos(m_hwndToolbar, 0, 4, 0, wWidth, m_size_y, SWP_NOZORDER | SWP_NOACTIVATE |
- SWP_NOCOPYBITS|SWP_NOREDRAW);
-
+ ::SetWindowPos(m_hwndToolbar, 0, 4, 0, wWidth, m_size_y, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOCOPYBITS | SWP_NOREDRAW);
}
+
LONG getHeight() const;
void Show(int showCmd) const
{
@@ -120,7 +119,7 @@ private: LONG_PTR customDrawWorker(NMCUSTOMDRAW *nm);
void updateState(const HMENU hMenu) const;
void invoke(const int id);
- void cancel(const int id);
+ void cancel();
void obtainHook();
void releaseHook();
void checkButtons();
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index 4a890d2ac6..0687539f67 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -36,6 +36,8 @@ #include "commonheaders.h"
+static int TSAPI PopupPreview(NEN_OPTIONS *pluginOptions);
+
static LIST<PLUGIN_DATAT> arPopupList(10, NumericKeySortT);
BOOL bWmNotify = TRUE;
@@ -818,7 +820,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro return 0;
}
-int tabSRMM_ShowPopup(MCONTACT hContact, HANDLE hDbEvent, WORD eventType, int windowOpen, TContainerData *pContainer, HWND hwndChild, const char *szProto, TWindowData *dat)
+int tabSRMM_ShowPopup(MCONTACT hContact, HANDLE hDbEvent, WORD eventType, int windowOpen, TContainerData *pContainer, HWND hwndChild, const char *szProto)
{
if (nen_options.iDisable) // no popups at all. Period
return 0;
diff --git a/plugins/TabSRMM/src/functions.h b/plugins/TabSRMM/src/functions.h index 0f522f1387..4cdb08213e 100644 --- a/plugins/TabSRMM/src/functions.h +++ b/plugins/TabSRMM/src/functions.h @@ -49,7 +49,6 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP int TSAPI NEN_ReadOptions(NEN_OPTIONS *options);
int TSAPI NEN_WriteOptions(NEN_OPTIONS *options);
int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szProto, const TCHAR *szStatus, MCONTACT hContact, DWORD fromEvent);
-int TSAPI PopupPreview(NEN_OPTIONS *pluginOptions);
void TSAPI DeletePopupsForContact(MCONTACT hContact, DWORD dwMask);
/*
@@ -76,7 +75,7 @@ int TSAPI ActivateTabFromHWND(HWND hwndTab, HWND hwnd); void TSAPI FlashContainer(TContainerData *pContainer, int iMode, int iNum);
void TSAPI CreateImageList(BOOL bInitial);
-TContainerData* TSAPI FindMatchingContainer(const TCHAR *szName, MCONTACT hContact);
+TContainerData* TSAPI FindMatchingContainer(const TCHAR *szName);
TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, MCONTACT hContactFrom);
TContainerData* TSAPI FindContainerByName(const TCHAR *name);
@@ -88,9 +87,6 @@ int TSAPI ActivateTabFromHWND(HWND hwndTab, HWND hwnd); void TSAPI AdjustTabClientRect(TContainerData *pContainer, RECT *rc);
void TSAPI ReflashContainer(TContainerData *pContainer);
-TContainerData* TSAPI AppendToContainerList(TContainerData *pContainer);
-TContainerData* TSAPI RemoveContainerFromList(TContainerData *pContainer);
-
void TSAPI CloseAllContainers();
void TSAPI DeleteContainer(int iIndex);
void TSAPI RenameContainer(int iIndex, const TCHAR *newName);
@@ -118,19 +114,15 @@ void TSAPI DrawAlpha(HDC hdcwnd, PRECT rc, DWORD basecolor, int alpha, DWORD ba void TSAPI CacheMsgLogIcons();
void TSAPI CacheLogFonts();
-void TSAPI InitAPI();
void TSAPI LoadIconTheme();
-int TSAPI LoadFromIconLib();
-int TSAPI SetupIconLibConfig();
void TSAPI RTF_CTableInit();
INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
int DbEventIsForMsgWindow(DBEVENTINFO *dbei);
int TSAPI InitOptions(void);
-int TSAPI DbEventIsShown(TWindowData *dat, DBEVENTINFO *dbei);
+int TSAPI DbEventIsShown(DBEVENTINFO *dbei);
void TSAPI StreamInEvents(HWND hwndDlg,HANDLE hDbEventFirst,int count,int fAppend, DBEVENTINFO *dbei_s);
void TSAPI LoadLogfont(int i,LOGFONTA *lf,COLORREF *colour, char *szModule);
@@ -154,16 +146,13 @@ int _DebugMessage(HWND hwndDlg, TWindowData *dat, const char *fmt, ...); // themes
const TCHAR* TSAPI GetThemeFileName(int iMode);
-void TSAPI LoadLogfontFromINI(int i, char *szKey, LOGFONTA *lf, COLORREF *colour, const char *szIniFilename);
int TSAPI CheckThemeVersion(const TCHAR *szIniFilename);
void TSAPI WriteThemeToINI(const TCHAR *szIniFilename, TWindowData *dat);
void TSAPI ReadThemeFromINI(const TCHAR *szIniFilename, TContainerData *dat, int noAdvanced, DWORD dwFlags);
-// compatibility
-
// user prefs
-int TSAPI LoadLocalFlags(HWND hwnd, TWindowData *dat);
+int TSAPI LoadLocalFlags(TWindowData *dat);
//TypingNotify
int TN_ModuleInit();
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index ab9071715f..4f3f4c9bc6 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -455,7 +455,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer, case ID_SENDMENU_SENDTOMULTIPLEUSERS: dat->sendMode ^= SMODE_MULTIPLE; if (dat->sendMode & SMODE_MULTIPLE) - HWND hwndClist = DM_CreateClist(dat); + DM_CreateClist(dat); else if (IsWindow(GetDlgItem(hwndDlg, IDC_CLIST))) DestroyWindow(GetDlgItem(hwndDlg, IDC_CLIST)); break; @@ -608,11 +608,8 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer, return 1; } -static INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM) { - COLORREF url_visited = RGB(128, 0, 128); - COLORREF url_unvisited = RGB(0, 0, 255); - switch (msg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); @@ -1081,7 +1078,7 @@ void TSAPI DM_UpdateLastMessage(const TWindowData *dat) ///////////////////////////////////////////////////////////////////////////////////////// // save current keyboard layout for the given contact -void TSAPI DM_SaveLocale(TWindowData *dat, WPARAM wParam, LPARAM lParam) +void TSAPI DM_SaveLocale(TWindowData *dat, WPARAM, LPARAM lParam) { if (!dat) return; @@ -1336,7 +1333,7 @@ void TSAPI DM_NotifyTyping(TWindowData *dat, int mode) CallService(MS_PROTO_SELFISTYPING, hContact, dat->nTypeMode); } -void TSAPI DM_OptionsApplied(TWindowData *dat, WPARAM wParam, LPARAM lParam) +void TSAPI DM_OptionsApplied(TWindowData *dat, WPARAM, LPARAM lParam) { if (dat == 0) return; @@ -1349,7 +1346,7 @@ void TSAPI DM_OptionsApplied(TWindowData *dat, WPARAM wParam, LPARAM lParam) LoadThemeDefaults(dat->pContainer); dat->dwFlags = dat->pContainer->theme.dwFlags; } - LoadLocalFlags(hwndDlg, dat); + LoadLocalFlags(dat); LoadTimeZone(dat); @@ -1468,7 +1465,6 @@ int TSAPI DM_SplitterGlobalEvent(TWindowData *dat, WPARAM wParam, LPARAM lParam) { RECT rcWin; short newMessagePos; - LONG newPos; TWindowData *srcDat = PluginConfig.lastSPlitterPos.pSrcDat; TContainerData *srcCnt = PluginConfig.lastSPlitterPos.pSrcContainer; bool fCntGlobal = (!dat->pContainer->settings->fPrivate ? true : false); @@ -1478,6 +1474,7 @@ int TSAPI DM_SplitterGlobalEvent(TWindowData *dat, WPARAM wParam, LPARAM lParam) GetWindowRect(dat->hwnd, &rcWin); + LONG newPos; if (wParam == 0 && lParam == 0) { if ((dat->dwFlagsEx & MWF_SHOW_SPLITTEROVERRIDE) && dat != srcDat) return 0; @@ -1488,6 +1485,8 @@ int TSAPI DM_SplitterGlobalEvent(TWindowData *dat, WPARAM wParam, LPARAM lParam) newPos = PluginConfig.lastSPlitterPos.pos + PluginConfig.lastSPlitterPos.off_im; else if (srcDat->bType == SESSIONTYPE_CHAT && dat->bType == SESSIONTYPE_IM) newPos = PluginConfig.lastSPlitterPos.pos + PluginConfig.lastSPlitterPos.off_im; + else + newPos = 0; if (dat == srcDat) { if (dat->bType == SESSIONTYPE_IM) { @@ -1558,7 +1557,6 @@ int TSAPI DM_SplitterGlobalEvent(TWindowData *dat, WPARAM wParam, LPARAM lParam) void TSAPI DM_EventAdded(TWindowData *dat, WPARAM hContact, LPARAM lParam) { TContainerData *m_pContainer = dat->pContainer; - DWORD dwTimestamp = 0; HWND hwndDlg = dat->hwnd, hwndContainer = m_pContainer->hwnd, hwndTab = GetParent(dat->hwnd); HANDLE hDbEvent = (HANDLE)lParam; @@ -1570,7 +1568,7 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM hContact, LPARAM lParam) bool bIsStatusChangeEvent = IsStatusEvent(dbei.eventType); bool bDisableNotify = (dbei.eventType == EVENTTYPE_MESSAGE && (dbei.flags & DBEF_READ)); - if (!DbEventIsShown(dat, &dbei)) + if (!DbEventIsShown(&dbei)) return; if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & (DBEF_SENT))) { @@ -1602,7 +1600,7 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM hContact, LPARAM lParam) } } if (!bDisableNotify) - tabSRMM_ShowPopup(hContact, hDbEvent, dbei.eventType, m_pContainer->fHidden ? 0 : 1, m_pContainer, hwndDlg, dat->cache->getActiveProto(), dat); + tabSRMM_ShowPopup(hContact, hDbEvent, dbei.eventType, m_pContainer->fHidden ? 0 : 1, m_pContainer, hwndDlg, dat->cache->getActiveProto()); if (IsWindowVisible(m_pContainer->hwnd)) m_pContainer->fHidden = false; } @@ -1729,7 +1727,7 @@ void TSAPI DM_HandleAutoSizeRequest(TWindowData *dat, REQRESIZE* rr) DM_ScrollToBottom(dat, 1, 0); } -void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM wParam, LPARAM lParam) +void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam) { TCHAR newtitle[128], newcontactname[128]; DWORD dwOldIdle = dat->idle; @@ -1753,7 +1751,6 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM wParam, LPARAM lParam) if (dat->szProto) { szActProto = dat->cache->getProto(); - MCONTACT hActContact = dat->hContact; bool bHasName = (dat->cache->getUIN()[0] != 0); dat->idle = dat->cache->getIdleTS(); @@ -1905,7 +1902,7 @@ void DrawStatusIcons(TWindowData *dat, HDC hDC, const RECT &rc, int gap) } } -void CheckStatusIconClick(TWindowData *dat, HWND hwndFrom, POINT pt, const RECT &rc, int gap, int code) +void CheckStatusIconClick(TWindowData *dat, POINT pt, const RECT &rc, int gap, int code) { if (dat && (code == NM_CLICK || code == NM_RCLICK)) { POINT ptScreen; @@ -1914,7 +1911,7 @@ void CheckStatusIconClick(TWindowData *dat, HWND hwndFrom, POINT pt, const RECT return; } - UINT iconNum = (pt.x - (rc.left + 0)) / (PluginConfig.m_smcxicon + gap), list_icons = 0; + UINT iconNum = (pt.x - (rc.left + 0)) / (PluginConfig.m_smcxicon + gap); StatusIconData *si = Srmm_GetNthIcon((dat) ? dat->hContact : 0, iconNum); if (si == NULL) return; diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index 4435efb0e2..235f53172c 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -71,9 +71,6 @@ bool CGlobals::m_exAllowContinue = false; */
void CGlobals::reloadSystemStartup()
{
- HDC hScrnDC;
- DBVARIANT dbv = {0};
-
m_WinVerMajor = WinVerMajor();
m_WinVerMinor = WinVerMinor();
m_bIsVista = IsWinVerVistaPlus() != 0;
@@ -99,9 +96,9 @@ void CGlobals::reloadSystemStartup() if (hCurHyperlinkHand == NULL)
hCurHyperlinkHand = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_HYPERLINKHAND));
- hScrnDC = GetDC(0);
- g_DPIscaleX = GetDeviceCaps(hScrnDC, LOGPIXELSX) / 96.0;
- g_DPIscaleY = GetDeviceCaps(hScrnDC, LOGPIXELSY) / 96.0;
+ HDC hScrnDC = GetDC(0);
+ g_DPIscaleX = GetDeviceCaps(hScrnDC, LOGPIXELSX) / 96.0;
+ g_DPIscaleY = GetDeviceCaps(hScrnDC, LOGPIXELSY) / 96.0;
ReleaseDC(0, hScrnDC);
reloadSettings(false);
@@ -159,8 +156,6 @@ void CGlobals::reloadSettings(bool fReloadSkins) m_ncm.cbSize = sizeof(NONCLIENTMETRICS);
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &m_ncm, 0);
- DWORD dwFlags = M.GetDword("mwflags", MWF_LOG_DEFAULT);
-
m_SendOnShiftEnter = M.GetByte("sendonshiftenter", 0);
m_SendOnEnter = M.GetByte(SRMSGSET_SENDONENTER, SRMSGDEFSET_SENDONENTER);
m_SendOnDblEnter = M.GetByte("SendOnDblEnter", 0);
@@ -473,7 +468,7 @@ int CGlobals::DBSettingChanged(WPARAM hContact, LPARAM lParam) /////////////////////////////////////////////////////////////////////////////////////////
// event fired when a contact has been deleted. Make sure to close its message session
-int CGlobals::DBContactDeleted(WPARAM hContact, LPARAM lParam)
+int CGlobals::DBContactDeleted(WPARAM hContact, LPARAM)
{
if (hContact) {
CContactCache *c = CContactCache::getContactCache(hContact);
@@ -488,7 +483,7 @@ int CGlobals::DBContactDeleted(WPARAM hContact, LPARAM lParam) // our contact cache and, if a message window exists, tell it to update
// relevant information.
-int CGlobals::MetaContactEvent(WPARAM hContact, LPARAM lParam)
+int CGlobals::MetaContactEvent(WPARAM hContact, LPARAM)
{
if (hContact) {
CContactCache *c = CContactCache::getContactCache(hContact);
@@ -504,7 +499,7 @@ int CGlobals::MetaContactEvent(WPARAM hContact, LPARAM lParam) return 0;
}
-int CGlobals::PreshutdownSendRecv(WPARAM wParam, LPARAM lParam)
+int CGlobals::PreshutdownSendRecv(WPARAM, LPARAM)
{
g_bShutdown = true;
@@ -533,7 +528,7 @@ int CGlobals::PreshutdownSendRecv(WPARAM wParam, LPARAM lParam) return 0;
}
-int CGlobals::OkToExit(WPARAM wParam, LPARAM lParam)
+int CGlobals::OkToExit(WPARAM, LPARAM)
{
::CreateSystrayIcon(0);
::CreateTrayMenus(0);
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index 190922f3ce..084244107a 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -80,7 +80,7 @@ LRESULT ProcessHotkeysByMsgFilter(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa return SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)&mf);
}
-static INT_PTR HotkeyProcessor(WPARAM wParam, LPARAM lParam)
+static INT_PTR HotkeyProcessor(WPARAM, LPARAM lParam)
{
if (lParam == TABSRMM_HK_LASTUNREAD)
PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_TRAYICONNOTIFY, 101, WM_MBUTTONDOWN);
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp index 68d8d58d04..6ef1090c5f 100644 --- a/plugins/TabSRMM/src/infopanel.cpp +++ b/plugins/TabSRMM/src/infopanel.cpp @@ -382,7 +382,6 @@ void CInfoPanel::renderContent(const HDC hdc) void CInfoPanel::RenderIPNickname(const HDC hdc, RECT &rcItem)
{
const TCHAR *szStatusMsg = NULL;
- CSkinItem *item = &SkinItems[ID_EXTBKINFOPANEL];
const TCHAR *szTextToShow = 0;
bool fShowUin = false;
COLORREF clr = 0;
@@ -527,7 +526,6 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem) void CInfoPanel::RenderIPStatus(const HDC hdc, RECT& rcItem)
{
- const char *szProto = m_dat->cache->getActiveProto();
SIZE sProto = { 0 }, sStatus = { 0 }, sTime = { 0 };
DWORD oldPanelStatusCX = m_dat->panelStatusCX;
@@ -994,10 +992,10 @@ LRESULT CALLBACK CInfoPanel::avatarParentSubclass(HWND hwnd, UINT msg, WPARAM wP FillRect(hdc, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH));
else {
if (CSkin::m_pCurrentAeroEffect->m_finalAlpha == 0)
- CSkin::ApplyAeroEffect(hdc, &rc, CSkin::AERO_EFFECT_AREA_INFOPANEL, 0);
+ CSkin::ApplyAeroEffect(hdc, &rc, CSkin::AERO_EFFECT_AREA_INFOPANEL);
else {
FillRect(hdc, &rc, CSkin::m_BrushBack);
- CSkin::ApplyAeroEffect(hdc, &rc, CSkin::AERO_EFFECT_AREA_INFOPANEL, 0);
+ CSkin::ApplyAeroEffect(hdc, &rc, CSkin::AERO_EFFECT_AREA_INFOPANEL);
}
}
BitBlt(dcWin, 0, 0, cx, cy, hdc, 0, 0, SRCCOPY);
@@ -1524,7 +1522,7 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam HBRUSH br = ::CreateSolidBrush(PluginConfig.m_ipBackgroundGradientHigh);
if (M.isAero()) {
::FillRect(hdcMem, &rc, reinterpret_cast<HBRUSH>(::GetStockObject(BLACK_BRUSH)));
- CSkin::ApplyAeroEffect(hdcMem, &rcText, CSkin::AERO_EFFECT_AREA_MENUBAR, 0);
+ CSkin::ApplyAeroEffect(hdcMem, &rcText, CSkin::AERO_EFFECT_AREA_MENUBAR);
::FillRect(hdcMem, &m_rcRich, br);
hTheme = OpenThemeData(m_hwnd, L"BUTTON");
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index e0e46dd76d..a8442ef26f 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -81,7 +81,7 @@ INT_PTR CMimAPI::RemoveWindow(HWND hWnd) ///////////////////////////////////////////////////////////////////////////////////////// -int CMimAPI::FoldersPathChanged(WPARAM wParam, LPARAM lParam) +int CMimAPI::FoldersPathChanged(WPARAM, LPARAM) { return M.foldersPathChanged(); } @@ -228,7 +228,7 @@ void CMimAPI::InitAPI() int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode) { - int issplit = 1, foundWin = 0, preTyping = 0; + int foundWin = 0, preTyping = 0; BOOL fShowOnClist = TRUE; HWND hwnd = M.FindWindow(hContact); @@ -329,13 +329,12 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode) // // ACKTYPE_AVATAR no longer handled here, because we have avs services now. -int CMimAPI::ProtoAck(WPARAM wParam, LPARAM lParam) +int CMimAPI::ProtoAck(WPARAM, LPARAM lParam) { ACKDATA *pAck = (ACKDATA*)lParam; if (lParam == 0) return 0; - HWND hwndDlg = 0; int i = 0, iFound = SendQueue::NR_SENDJOBS; SendJob *jobs = sendQueue->getJobByIndex(0); @@ -365,7 +364,7 @@ int CMimAPI::ProtoAck(WPARAM wParam, LPARAM lParam) return 0; } -int CMimAPI::PrebuildContactMenu(WPARAM hContact, LPARAM lParam) +int CMimAPI::PrebuildContactMenu(WPARAM hContact, LPARAM) { if (hContact == NULL) return NULL; @@ -477,7 +476,7 @@ int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM lParam) return 0; case EVENTTYPE_FILE: - tabSRMM_ShowPopup(hContact, hDbEvent, dbei.eventType, 0, 0, 0, dbei.szModule, 0); + tabSRMM_ShowPopup(hContact, hDbEvent, dbei.eventType, 0, 0, 0, dbei.szModule); return 0; } } @@ -520,7 +519,7 @@ int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM lParam) TContainerData *pContainer = FindContainerByName(szName); if (pContainer != NULL) { if (M.GetByte("limittabs", 0) && !wcsncmp(pContainer->szName, L"default", 6)) { - if ((pContainer = FindMatchingContainer(L"default", hContact)) != NULL) { + if ((pContainer = FindMatchingContainer(L"default")) != NULL) { CreateNewTabForContact(pContainer, hContact, 0, NULL, bActivate, bPopup, TRUE, hDbEvent); return 0; } @@ -558,7 +557,7 @@ nowindowcreate: cle.ptszTooltip = toolTip; CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle); } - tabSRMM_ShowPopup(hContact, hDbEvent, dbei.eventType, 0, 0, 0, dbei.szModule, 0); + tabSRMM_ShowPopup(hContact, hDbEvent, dbei.eventType, 0, 0, 0, dbei.szModule); } return 0; } diff --git a/plugins/TabSRMM/src/modplus.cpp b/plugins/TabSRMM/src/modplus.cpp index bfd1cdb387..ec8c5b76e3 100644 --- a/plugins/TabSRMM/src/modplus.cpp +++ b/plugins/TabSRMM/src/modplus.cpp @@ -47,7 +47,7 @@ static TCHAR* getMenuEntry(int i) return db_get_tsa(NULL, "tabmodplus", MEntry);
}
-static int RegisterCustomButton(WPARAM wParam, LPARAM lParam)
+static int RegisterCustomButton(WPARAM, LPARAM)
{
if (!ServiceExists(MS_BB_ADDBUTTON))
return 1;
@@ -162,7 +162,7 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam) return 1;
}
-int ModPlus_Init(WPARAM wparam, LPARAM lparam)
+int ModPlus_Init(WPARAM, LPARAM)
{
HookEvent(ME_MSG_BUTTONPRESSED, CustomButtonPressed);
HookEvent(ME_MSG_TOOLBARLOADED, RegisterCustomButton);
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 66516aae72..682fb6b67a 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -90,7 +90,6 @@ static void ShowPopupMenu(TWindowData *dat, int idFrom, HWND hwndFrom, POINT pt) { CHARRANGE sel, all = { 0, -1}; int oldCodepage = dat->codePage; - int iPrivateBG = M.GetByte(dat->hContact, "private_bg", 0); HWND hwndDlg = dat->hwnd; HMENU hSubMenu, hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_CONTEXT)); @@ -203,13 +202,13 @@ static void ShowPopupMenu(TWindowData *dat, int idFrom, HWND hwndFrom, POINT pt) if (idFrom == IDC_LOG) RemoveMenu(hSubMenu, 7, MF_BYPOSITION); DestroyMenu(hMenu); - if (dat->codePage != oldCodepage) { + if (dat->codePage != (UINT)oldCodepage) { SendMessage(hwndDlg, DM_REMAKELOG, 0, 0); SendMessage(hwndDlg, DM_UPDATETITLE, 0, 1); } } -static void ResizeIeView(const TWindowData *dat, DWORD px, DWORD py, DWORD cx, DWORD cy) +static void ResizeIeView(const TWindowData *dat) { RECT rcRichEdit; GetWindowRect(GetDlgItem(dat->hwnd, IDC_LOG), &rcRichEdit); @@ -413,8 +412,6 @@ void TSAPI ShowMultipleControls(HWND hwndDlg, const UINT *controls, int cControl void TSAPI SetDialogToType(HWND hwndDlg) { TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - int showToolbar = dat->pContainer->dwFlags & CNT_HIDETOOLBAR ? 0 : 1; - if (dat->hContact) { if (db_get_b(dat->hContact, "CList", "NotOnList", 0)) { dat->bNotOnList = TRUE; @@ -925,14 +922,15 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case ID_SPLITTERCONTEXT_SAVEGLOBALFORALLSESSIONS: { - RECT rcWin; BYTE bSync = M.GetByte(CHAT_MODULE, "SyncSplitter", 0); DWORD dwOff_IM = 0, dwOff_CHAT = 0; dwOff_CHAT = -(2 + (PluginConfig.g_DPIscaleY > 1.0 ? 1 : 0)); dwOff_IM = 2 + (PluginConfig.g_DPIscaleY > 1.0 ? 1 : 0); + RECT rcWin; GetWindowRect(hwndParent, &rcWin); + PluginConfig.lastSPlitterPos.pSrcDat = dat; PluginConfig.lastSPlitterPos.pSrcContainer = dat->pContainer; PluginConfig.lastSPlitterPos.lParam = rc.bottom; @@ -979,10 +977,10 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL * BOOL bBottomToolbar = dat->pContainer->dwFlags & CNT_BOTTOMTOOLBAR ? 1 : 0; static LONG rcLogBottom; - int panelHeight = dat->Panel->getHeight() + 1; - int s_offset = 0; - bool bInfoPanel = dat->Panel->isActive(); - bool fErrorState = (dat->dwFlags & MWF_ERRORSTATE) ? true : false; + int panelHeight = dat->Panel->getHeight() + 1; + int s_offset = 0; + bool bInfoPanel = dat->Panel->isActive(); + bool fErrorState = (dat->dwFlags & MWF_ERRORSTATE) ? true : false; GetClientRect(GetDlgItem(hwndDlg, IDC_LOG), &rc); GetClientRect(GetDlgItem(hwndDlg, IDC_PROTOCOL), &rcButton); @@ -997,6 +995,7 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL * urc->rcItem.bottom = panelHeight; urc->rcItem.top = panelHeight - 2; return RD_ANCHORX_WIDTH | RD_ANCHORY_TOP; + case IDC_LOG: if (dat->dwFlags & MWF_ERRORSTATE) urc->rcItem.bottom -= ERRORPANEL_HEIGHT; @@ -1158,10 +1157,12 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); HWND hwndTab = GetParent(hwndDlg), hwndContainer; POINT pt, tmp, cur; + RECT rc; if (dat == 0) { if (msg == WM_ACTIVATE || msg == WM_SETFOCUS) return 0; + hwndContainer = NULL; } else { m_pContainer = dat->pContainer; @@ -1270,7 +1271,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP // consider per-contact message setting overrides if (dat->hContact && M.GetDword(dat->hContact, "mwmask", 0)) - LoadLocalFlags(hwndDlg, dat); + LoadLocalFlags(dat); DM_InitTip(dat); dat->Panel->getVisibility(); @@ -1286,9 +1287,6 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP dat->bShowAvatar = GetAvatarVisibility(hwndDlg, dat); - RECT rc; - GetWindowRect(GetDlgItem(hwndDlg, IDC_SMILEYBTN), &rc); - Utils::showDlgControl(hwndDlg, IDC_MULTISPLITTER, SW_HIDE); GetWindowRect(GetDlgItem(hwndDlg, IDC_SPLITTER), &rc); @@ -1462,7 +1460,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP DBEVENTINFO dbei = { sizeof(dbei) }; newData->bWantPopup = FALSE; db_event_get(newData->hdbEvent, &dbei); - tabSRMM_ShowPopup(dat->hContact, newData->hdbEvent, dbei.eventType, 0, 0, hwndDlg, dat->cache->getActiveProto(), dat); + tabSRMM_ShowPopup(dat->hContact, newData->hdbEvent, dbei.eventType, 0, 0, hwndDlg, dat->cache->getActiveProto()); } if (m_pContainer->dwFlags & CNT_CREATE_MINIMIZED) { m_pContainer->dwFlags &= ~CNT_CREATE_MINIMIZED; @@ -1473,10 +1471,9 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP } case WM_ERASEBKGND: + RECT rcClient, rcWindow; { HDC hdc = (HDC)wParam; - - RECT rcClient, rcWindow, rc; HDC hdcMem = 0; HBITMAP hbm, hbmOld; HANDLE hpb = 0; @@ -1485,15 +1482,16 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP DWORD cx = rcClient.right - rcClient.left; DWORD cy = rcClient.bottom - rcClient.top; - if (CMimAPI::m_haveBufferedPaint) + if (CMimAPI::m_haveBufferedPaint) { hpb = CMimAPI::m_pfnBeginBufferedPaint(hdc, &rcClient, BPBF_TOPDOWNDIB, 0, &hdcMem); + hbm = hbmOld = 0; + } else { hdcMem = CreateCompatibleDC(hdc); hbm = CSkin::CreateAeroCompatibleBitmap(rcClient, hdc); hbmOld = (HBITMAP)SelectObject(hdcMem, hbm); } - bool bInfoPanel = dat->Panel->isActive(); bool bAero = M.isAero(); if (CSkin::m_skinEnabled) { @@ -1568,7 +1566,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP // this allows border-less textboxes to appear "skinned" and blended with the background { PAINTSTRUCT ps; - HDC hdc = BeginPaint(hwndDlg, &ps); + BeginPaint(hwndDlg, &ps); EndPaint(hwndDlg, &ps); } return 0; @@ -1595,7 +1593,6 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP CalcDynamicAvatarSize(dat, &bminfo); } - RECT rc; GetClientRect(hwndDlg, &rc); UTILRESIZEDIALOG urd = { sizeof(urd) }; @@ -1656,7 +1653,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP } if (GetDlgItem(hwndDlg, IDC_CLIST) != 0) { - RECT rc, rcClient, rcLog; + RECT rcLog; GetClientRect(hwndDlg, &rcClient); GetClientRect(GetDlgItem(hwndDlg, IDC_LOG), &rcLog); rc.top = 0; @@ -1669,7 +1666,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP } if (dat->hwndIEView || dat->hwndHPP) - ResizeIeView(dat, 0, 0, 0, 0); + ResizeIeView(dat); DetermineMinHeight(dat); } @@ -1706,8 +1703,6 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP message.wParam = wp; if (msg == WM_SYSKEYUP) { - UINT ctrlId = 0; - if (wp == VK_MENU) if (!dat->fkeyProcessed && !(GetKeyState(VK_CONTROL) & 0x8000) && !(GetKeyState(VK_SHIFT) & 0x8000) && !(lp & (1 << 24))) m_pContainer->MenuBar->autoShow(); @@ -1755,7 +1750,6 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case TABSRMM_HK_TOGGLERTL: { DWORD dwGlobal = M.GetDword("mwflags", MWF_LOG_DEFAULT); - DWORD dwOldFlags = dat->dwFlags; DWORD dwMask = M.GetDword(dat->hContact, "mwmask", 0); DWORD dwFlags = M.GetDword(dat->hContact, "mwflags", 0); @@ -1928,7 +1922,6 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP } if (msg == WM_MOUSEWHEEL && (((NMHDR*)lParam)->idFrom == IDC_LOG || ((NMHDR*)lParam)->idFrom == IDC_MESSAGE)) { - RECT rc; GetCursorPos(&pt); GetWindowRect(GetDlgItem(hwndDlg, IDC_LOG), &rc); if (PtInRect(&rc, pt)) { @@ -2168,7 +2161,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SendDlgItemMessage(hwndDlg, buttonicons[i].id, BUTTONSETCONTAINER, (LPARAM)m_pContainer, 0); } - BB_UpdateIcons(hwndDlg, dat); + BB_UpdateIcons(hwndDlg); SendMessage(hwndDlg, DM_UPDATEWINICON, 0, 0); return 0; @@ -2221,8 +2214,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP return 0; case DM_SPLITTERMOVED: - if ((HWND) lParam == GetDlgItem(hwndDlg, IDC_MULTISPLITTER)) { - RECT rc; + if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_MULTISPLITTER)) { GetClientRect(hwndDlg, &rc); pt.x = wParam; pt.y = 0; @@ -2236,23 +2228,21 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP dat->multiSplitterX = oldSplitterX; SendMessage(dat->hwnd, WM_SIZE, 0, 0); } - else if ((HWND) lParam == GetDlgItem(hwndDlg, IDC_SPLITTER)) { - int oldSplitterY, oldDynaSplitter; - int bottomtoolbarH=0; - RECT rc; + else if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_SPLITTER)) { GetClientRect(hwndDlg, &rc); rc.top += (dat->Panel->isActive() ? dat->Panel->getHeight() + 40 : 30); pt.x = 0; pt.y = wParam; ScreenToClient(hwndDlg, &pt); - oldSplitterY = dat->splitterY; - oldDynaSplitter = dat->dynaSplitter; + int oldSplitterY = dat->splitterY; + int oldDynaSplitter = dat->dynaSplitter; - dat->splitterY = rc.bottom - pt.y +DPISCALEY_S(23); + dat->splitterY = rc.bottom - pt.y + DPISCALEY_S(23); // attempt to fix splitter troubles.. // hardcoded limits... better solution is possible, but this works for now + int bottomtoolbarH = 0; if (dat->pContainer->dwFlags & CNT_BOTTOMTOOLBAR) bottomtoolbarH = 22; @@ -2274,7 +2264,6 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SendMessage(dat->hwnd, WM_SIZE, 0, 0); } else if ((HWND) lParam == GetDlgItem(hwndDlg, IDC_PANELSPLITTER)) { - RECT rc; GetClientRect(GetDlgItem(hwndDlg, IDC_LOG), &rc); POINT pt = { 0, wParam }; @@ -2383,9 +2372,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case HM_DBEVENTADDED: // this is called whenever a new event has been added to the database. // this CAN be posted (some sanity checks required). - if (!dat) - return 0; - if (dat->hContact) + if (dat && dat->hContact) DM_EventAdded(dat, dat->hContact, lParam); return 0; @@ -2469,7 +2456,6 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP } if (resent) { - int iNextFailed; SendJob *job = sendQueue->getJobByIndex(dat->iCurrentQueueError); SetTimer(hwndDlg, TIMERID_MSGSEND + dat->iCurrentQueueError, PluginConfig.m_MsgTimeout, NULL); @@ -2478,7 +2464,9 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP sendQueue->showErrorControls(dat, FALSE); SetDlgItemText(hwndDlg, IDC_MESSAGE, _T("")); sendQueue->checkQueue(dat); - if ((iNextFailed = sendQueue->findNextFailed(dat)) >= 0) + + int iNextFailed = sendQueue->findNextFailed(dat); + if (iNextFailed >= 0) sendQueue->handleError(dat, iNextFailed); } } @@ -2543,7 +2531,6 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP DM_UpdateLastMessage(dat); } - RECT rcClient; SendMessage(hwndContainer, DM_QUERYCLIENTAREA, 0, (LPARAM)&rcClient); MoveWindow(hwndDlg, rcClient.left, rcClient.top, (rcClient.right - rcClient.left), (rcClient.bottom - rcClient.top), TRUE); if (dat->dwFlags & MWF_WASBACKGROUNDCREATE) { @@ -2598,7 +2585,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case WM_RBUTTONUP: { - RECT rcPicture, rcPanelNick = {0}; + RECT rcPicture, rcPanelNick = { 0 }; int menuID = 0; GetWindowRect(GetDlgItem(hwndDlg, IDC_CONTACTPIC), &rcPicture); @@ -2858,7 +2845,7 @@ quote_from_last: iAlloced = true; } else { - if (iSize != dbei.cbBlob) + if (iSize != (int)dbei.cbBlob) szConverted = (TCHAR*)&dbei.pBlob[iSize]; else { szConverted = (TCHAR*)mir_alloc(sizeof(TCHAR) * iSize); @@ -3119,7 +3106,7 @@ quote_from_last: if (lParam) CB_DestroyButton(hwndDlg, dat, (DWORD)wParam, (DWORD)lParam); else - CB_DestroyAllButtons(hwndDlg, dat); + CB_DestroyAllButtons(hwndDlg); return 0; case WM_DROPFILES: @@ -3161,7 +3148,7 @@ quote_from_last: if (ServiceExists(MS_HTTPSERVER_ADDFILENAME)) { for (int i = 0; i < totalCount; i++) { char* szFileName = mir_t2a(ppFiles[i]); - char *szTemp = (char*)CallService(MS_HTTPSERVER_ADDFILENAME, (WPARAM)szFileName, 0); + CallService(MS_HTTPSERVER_ADDFILENAME, (WPARAM)szFileName, 0); mir_free(szFileName); } char *szHTTPText = "DEBUG"; @@ -3244,7 +3231,6 @@ quote_from_last: m_pContainer->hwndActive = (HWND)item.lParam; - RECT rc; SendMessage(hwndContainer, DM_QUERYCLIENTAREA, 0, (LPARAM)&rc); SetWindowPos(m_pContainer->hwndActive, HWND_TOP, rc.left, rc.top, (rc.right - rc.left), (rc.bottom - rc.top), SWP_SHOWWINDOW); ShowWindow((HWND)item.lParam, SW_SHOW); diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 22b2c87cf5..e084a2dcf2 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -101,7 +101,7 @@ 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 wParam, LPARAM lParam)
+static UINT_PTR CALLBACK OpenFileSubclass(HWND hwnd, UINT msg, WPARAM, LPARAM lParam)
{
switch (msg) {
case WM_INITDIALOG:
@@ -223,7 +223,6 @@ void TSAPI CalcDynamicAvatarSize(TWindowData *dat, BITMAP *bminfo) BOOL bBottomToolBar = dat->pContainer->dwFlags & CNT_BOTTOMTOOLBAR;
BOOL bToolBar = dat->pContainer->dwFlags & CNT_HIDETOOLBAR ? 0 : 1;
- bool bInfoPanel = dat->Panel->isActive();
int iSplitOffset = dat->bIsAutosizingInput ? 1 : 0;
double picAspect = (bminfo->bmWidth == 0 || bminfo->bmHeight == 0) ? 1.0 : (double)(bminfo->bmWidth / (double)bminfo->bmHeight);
@@ -252,13 +251,9 @@ void TSAPI CalcDynamicAvatarSize(TWindowData *dat, BITMAP *bminfo) int TSAPI MsgWindowUpdateMenu(TWindowData *dat, HMENU submenu, int menuID)
{
- HWND hwndDlg = dat->hwnd;
- bool bInfoPanel = dat->Panel->isActive();
+ bool bInfoPanel = dat->Panel->isActive();
if (menuID == MENU_TABCONTEXT) {
- SESSION_INFO *si = dat->si;
- int iTabs = TabCtrl_GetItemCount(GetParent(hwndDlg));
-
EnableMenuItem(submenu, ID_TABMENU_ATTACHTOCONTAINER, M.GetByte("useclistgroups", 0) || M.GetByte("singlewinmode", 0) ? MF_GRAYED : MF_ENABLED);
EnableMenuItem(submenu, ID_TABMENU_CLEARSAVEDTABPOSITION, (M.GetDword(dat->hContact, "tabindex", -1) != -1) ? MF_ENABLED : MF_GRAYED);
}
@@ -352,10 +347,10 @@ int TSAPI MsgWindowMenuHandler(TWindowData *dat, int selection, int menuId) BYTE avOverrideMode;
if (selection == ID_VISIBILITY_DEFAULT)
avOverrideMode = -1;
- else if (selection == ID_VISIBILITY_HIDDENFORTHISCONTACT)
- avOverrideMode = 0;
else if (selection == ID_VISIBILITY_VISIBLEFORTHISCONTACT)
avOverrideMode = 1;
+ else
+ avOverrideMode = 0;
db_set_b(dat->hContact, SRMSGMOD_T, "hideavatar", avOverrideMode);
}
@@ -401,12 +396,6 @@ int TSAPI MsgWindowMenuHandler(TWindowData *dat, int selection, int menuId) }
}
else if (menuId == MENU_LOGMENU) {
- int iLocalTime = 0;
- int iRtl = (PluginConfig.m_RTLDefault == 0 ? M.GetByte(dat->hContact, "RTL", 0) : M.GetByte(dat->hContact, "RTL", 1));
- int iLogStatus = (PluginConfig.m_LogStatusChanges != 0) && M.GetByte(dat->hContact, "logstatuschanges", 0);
-
- DWORD dwOldFlags = dat->dwFlags;
-
switch (selection) {
case ID_MESSAGELOGSETTINGS_GLOBAL:
{
@@ -509,7 +498,6 @@ void TSAPI UpdateStatusBar(const TWindowData *dat) void TSAPI HandleIconFeedback(TWindowData *dat, HICON iIcon)
{
TCITEM item = { 0 };
- HICON iOldIcon = dat->hTabIcon;
if (iIcon == (HICON)-1) { // restore status image
if (dat->dwFlags & MWF_ERRORSTATE)
@@ -867,7 +855,6 @@ BOOL TSAPI DoRtfToTags(TCHAR *pszText, const TWindowData *dat) // used to filter out attributes which are already set for the default message input area font
LOGFONTA lf = dat->pContainer->theme.logFonts[MSGFONTID_MESSAGEAREA];
- COLORREF color = dat->pContainer->theme.fontColors[MSGFONTID_MESSAGEAREA];
// create an index of colors in the module and map them to
// corresponding colors in the RTF color table
@@ -1114,7 +1101,7 @@ void TSAPI GetMYUIN(TWindowData *dat) static int g_IEViewAvail = -1;
static int g_HPPAvail = -1;
-UINT TSAPI GetIEViewMode(HWND hwndDlg, MCONTACT hContact)
+UINT TSAPI GetIEViewMode(MCONTACT hContact)
{
int iWantIEView = 0, iWantHPP = 0;
@@ -1139,7 +1126,7 @@ UINT TSAPI GetIEViewMode(HWND hwndDlg, MCONTACT hContact) void TSAPI SetMessageLog(TWindowData *dat)
{
HWND hwndDlg = dat->hwnd;
- unsigned int iLogMode = GetIEViewMode(hwndDlg, dat->hContact);
+ unsigned int iLogMode = GetIEViewMode(dat->hContact);
if (iLogMode == WANT_IEVIEW_LOG && dat->hwndIEView == 0) {
IEVIEWWINDOW ieWindow;
@@ -1210,7 +1197,7 @@ void TSAPI FindFirstEvent(TWindowData *dat) dbei.cbBlob = 0;
dat->hDbEventFirst = hPrevEvent;
db_event_get(dat->hDbEventFirst, &dbei);
- if (!DbEventIsShown(dat, &dbei))
+ if (!DbEventIsShown(&dbei))
i++;
}
}
@@ -1325,7 +1312,7 @@ void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName) WORD wCtype2[3];
PARAFORMAT2 pf2;
BOOL fLocaleNotSet;
- char szTest[4] = { (char)0xe4, (char)0xf6, (char)0xfc, 0 };
+ BYTE szTest[4] = { 0xe4, 0xf6, 0xfc, 0 };
szLI[0] = szLI[1] = 0;
@@ -1361,7 +1348,7 @@ void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName) }
fLocaleNotSet = (dat->lcID[0] == 0 && dat->lcID[1] == 0);
mir_sntprintf(dat->lcID, SIZEOF(dat->lcID), szLI);
- GetStringTypeA(dat->lcid, CT_CTYPE2, szTest, 3, wCtype2);
+ GetStringTypeA(dat->lcid, CT_CTYPE2, (char*)szTest, 3, wCtype2);
pf2.cbSize = sizeof(pf2);
pf2.dwMask = PFM_RTLPARA;
SendDlgItemMessage(dat->hwnd, IDC_MESSAGE, EM_GETPARAFORMAT, 0, (LPARAM)&pf2);
@@ -1463,14 +1450,12 @@ void TSAPI HandlePasteAndSend(const TWindowData *dat) int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat)
{
- LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
-
if (!dat)
return 0;
- bool bAero = M.isAero();
HWND hwndDlg = dat->hwnd;
+ LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
if (dis->CtlType == ODT_MENU && dis->hwndItem == (HWND)GetSubMenu(PluginConfig.g_hMenuContext, 7)) {
RECT rc = { 0 };
HBRUSH old, col;
@@ -1524,11 +1509,9 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat) if (hbmAvatar == NULL)
return TRUE;
- int iMaxHeight = 0, top, cx, cy;
+ int top, cx, cy;
RECT rcClient, rcFrame;
bool bPanelPic = dis->hwndItem == hwndDlg;
- bool bDrawOwnAvatar = dat->Panel->isActive() && dat->pContainer->avatarMode != 3;
-
if (bPanelPic && !dat->bShowInfoAvatar)
return TRUE;
@@ -2040,7 +2023,7 @@ void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp) ii.fif = FIF_JPEG;
CallService(MS_IMG_SAVE, (WPARAM)&ii, IMGL_TCHAR);
- int fileCount = 1, totalCount = 0;
+ int totalCount = 0;
TCHAR** ppFiles = NULL;
Utils::AddToFileList(&ppFiles, &totalCount, filename);
diff --git a/plugins/TabSRMM/src/msgdlgutils.h b/plugins/TabSRMM/src/msgdlgutils.h index 9dbd13b8be..c8dc0cb49d 100644 --- a/plugins/TabSRMM/src/msgdlgutils.h +++ b/plugins/TabSRMM/src/msgdlgutils.h @@ -49,7 +49,7 @@ BOOL TSAPI DoRtfToTags(TCHAR * pszText, const TWindowData *dat); void TSAPI GetMYUIN(TWindowData *dat);
void TSAPI SetMessageLog(TWindowData *dat);
void TSAPI SwitchMessageLog(TWindowData *dat, int iMode);
-UINT TSAPI GetIEViewMode(HWND hwndDlg, MCONTACT hContact);
+UINT TSAPI GetIEViewMode(MCONTACT hContact);
void TSAPI FindFirstEvent(TWindowData *dat);
void TSAPI SaveSplitter(TWindowData *dat);
void TSAPI LoadSplitter(TWindowData *dat);
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index c1127ca645..d215ed30fb 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -308,112 +308,6 @@ static int AppendUnicodeToBuffer(char *&buffer, size_t &cbBufferEnd, size_t &cbB }
/////////////////////////////////////////////////////////////////////////////////////////
-// same as above but does "\r\n"->"\\par " and "\t"->"\\tab " too
-
-static int AppendToBufferWithRTF(int mode, char **buffer, int *cbBufferEnd, int *cbBufferAlloced, const char *fmt, ...)
-{
- va_list va;
- int charsDone, i;
-
- va_start(va, fmt);
- for (;;) {
- charsDone = mir_vsnprintf(*buffer + *cbBufferEnd, *cbBufferAlloced - *cbBufferEnd, fmt, va);
- if (charsDone >= 0)
- break;
- *cbBufferAlloced += 1024;
- *buffer = (char *)mir_realloc(*buffer, *cbBufferAlloced);
- }
- va_end(va);
- *cbBufferEnd += charsDone;
- for (i = *cbBufferEnd - charsDone; (*buffer)[i]; i++) {
-
- if (1) {
- if ((*buffer)[i] == '' && (*buffer)[i + 1] != 0) {
- char code = (*buffer)[i + 2];
- char tag = (*buffer)[i + 1];
-
- if (((code == '0' || code == '1') && (*buffer)[i + 3] == ' ') || (tag == 'c' && (code == 'x' || code == '0'))) {
- int begin = (code == '1');
-
- if (*cbBufferEnd + 5 > *cbBufferAlloced) {
- *cbBufferAlloced += 1024;
- *buffer = (char *)mir_realloc(*buffer, *cbBufferAlloced);
- }
- switch (tag) {
- case 'b':
- memcpy(*buffer + i, begin ? "\\b1 " : "\\b0 ", 4);
- continue;
- case 'i':
- memcpy(*buffer + i, begin ? "\\i1 " : "\\i0 ", 4);
- continue;
- case 'u':
- memmove(*buffer + i + 2, *buffer + i + 1, *cbBufferEnd - i);
- memcpy(*buffer + i, begin ? "\\ul1 " : "\\ul0 ", 5);
- *cbBufferEnd += 1;
- continue;
- case 's':
- *cbBufferAlloced += 20;
- *buffer = (char *)mir_realloc(*buffer, *cbBufferAlloced);
- memmove(*buffer + i + 6, *buffer + i + 1, (*cbBufferEnd - i) + 1);
- memcpy(*buffer + i, begin ? "\\strike1 " : "\\strike0 ", begin ? 9 : 9);
- *cbBufferEnd += 5;
- continue;
- case 'c':
- begin = (code == 'x');
- memcpy(*buffer + i, "\\cf", 3);
- if (!begin) {
- char szTemp[10];
- int colindex = GetColorIndex(GetRTFFont(LOWORD(mode) ? (MSGFONTID_MYMSG + (HIWORD(mode) ? 8 : 0)) : (MSGFONTID_YOURMSG + (HIWORD(mode) ? 8 : 0))));
- mir_snprintf(szTemp, SIZEOF(szTemp), "%02d", colindex);
- (*buffer)[i + 3] = szTemp[0];
- (*buffer)[i + 4] = szTemp[1];
- }
- continue;
- }
- }
- }
- }
-
- if ((*buffer)[i] == '\r' && (*buffer)[i + 1] == '\n') {
- if (*cbBufferEnd + 5 > *cbBufferAlloced) {
- *cbBufferAlloced += 1024;
- *buffer = (char *)mir_realloc(*buffer, *cbBufferAlloced);
- }
- memmove(*buffer + i + 6, *buffer + i + 2, *cbBufferEnd - i - 1);
- memcpy(*buffer + i, "\\line ", 6);
- *cbBufferEnd += 4;
- }
- else if ((*buffer)[i] == '\n') {
- if (*cbBufferEnd + 6 > *cbBufferAlloced) {
- *cbBufferAlloced += 1024;
- *buffer = (char *)mir_realloc(*buffer, *cbBufferAlloced);
- }
- memmove(*buffer + i + 6, *buffer + i + 1, *cbBufferEnd - i);
- memcpy(*buffer + i, "\\line ", 6);
- *cbBufferEnd += 5;
- }
- else if ((*buffer)[i] == '\t') {
- if (*cbBufferEnd + 5 > *cbBufferAlloced) {
- *cbBufferAlloced += 1024;
- *buffer = (char *)mir_realloc(*buffer, *cbBufferAlloced);
- }
- memmove(*buffer + i + 5, *buffer + i + 1, *cbBufferEnd - i);
- memcpy(*buffer + i, "\\tab ", 5);
- *cbBufferEnd += 4;
- }
- else if ((*buffer)[i] == '\\' || (*buffer)[i] == '{' || (*buffer)[i] == '}') {
- if (*cbBufferEnd + 2 > *cbBufferAlloced) {
- *cbBufferAlloced += 1024;
- *buffer = (char *)mir_realloc(*buffer, *cbBufferAlloced);
- }
- memmove(*buffer + i + 1, *buffer + i, *cbBufferEnd - i + 1);
- (*buffer)[i] = '\\';
- ++*cbBufferEnd;
- i++;
- }
- }
- return (int)(_mbslen((unsigned char *)*buffer + *cbBufferEnd));
-}
static void Build_RTF_Header(char *&buffer, size_t &bufferEnd, size_t &bufferAlloced, TWindowData *dat)
{
@@ -501,7 +395,7 @@ static void AppendTimeStamp(TCHAR *szFinalTimestamp, int isSent, char *&buffer, }
}
-static TCHAR* Template_MakeRelativeDate(TWindowData *dat, HANDLE hTimeZone, time_t check, int groupBreak, TCHAR code)
+static TCHAR* Template_MakeRelativeDate(HANDLE hTimeZone, time_t check, TCHAR code)
{
static TCHAR szResult[100];
const TCHAR *szFormat;
@@ -526,7 +420,7 @@ static TCHAR* Template_MakeRelativeDate(TWindowData *dat, HANDLE hTimeZone, time }
// mir_free() the return value
-static char *CreateRTFTail(TWindowData *dat)
+static char *CreateRTFTail()
{
size_t bufferEnd = 0, bufferAlloced = 1024;
char *buffer = (char*)mir_alloc(bufferAlloced);
@@ -535,7 +429,7 @@ static char *CreateRTFTail(TWindowData *dat) return buffer;
}
-int TSAPI DbEventIsShown(TWindowData *dat, DBEVENTINFO *dbei)
+int TSAPI DbEventIsShown(DBEVENTINFO *dbei)
{
if (!IsCustomEvent(dbei->eventType) || DbEventIsForMsgWindow(dbei))
return 1;
@@ -549,9 +443,9 @@ int DbEventIsForMsgWindow(DBEVENTINFO *dbei) return et && (et->flags & DETF_MSGWINDOW);
}
-static char *Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, HANDLE hDbEvent, int prefixParaBreak, LogStreamData *streamData)
+static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, HANDLE hDbEvent, LogStreamData *streamData)
{
- HANDLE hTimeZone;
+ HANDLE hTimeZone = NULL;
BOOL skipToNext = FALSE, skipFont = FALSE;
struct tm event_time;
BOOL isBold = FALSE, isItalic = FALSE, isUnderline = FALSE;
@@ -572,7 +466,7 @@ static char *Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, }
dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob);
db_event_get(hDbEvent, &dbei);
- if (!DbEventIsShown(dat, &dbei)) {
+ if (!DbEventIsShown(&dbei)) {
mir_free(dbei.pBlob);
mir_free(buffer);
return NULL;
@@ -778,14 +672,14 @@ static char *Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, break;
case 'D': // long date
if (showTime && showDate) {
- TCHAR *szFinalTimestamp = Template_MakeRelativeDate(dat, hTimeZone, dbei.timestamp, g_groupBreak, (TCHAR)'D');
+ TCHAR *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, 'D');
AppendTimeStamp(szFinalTimestamp, isSent, buffer, bufferEnd, bufferAlloced, skipFont, dat, iFontIDOffset);
}
else skipToNext = TRUE;
break;
case 'E': // short date...
if (showTime && showDate) {
- TCHAR *szFinalTimestamp = Template_MakeRelativeDate(dat, hTimeZone, dbei.timestamp, g_groupBreak, (TCHAR)'E');
+ TCHAR *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, 'E');
AppendTimeStamp(szFinalTimestamp, isSent, buffer, bufferEnd, bufferAlloced, skipFont, dat, iFontIDOffset);
}
else skipToNext = TRUE;
@@ -810,7 +704,7 @@ static char *Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, else skipToNext = TRUE;
break;
case 's': //second
- if (showTime && dwEffectiveFlags & MWF_LOG_SHOWSECONDS) {
+ if (showTime && (dwEffectiveFlags & MWF_LOG_SHOWSECONDS)) {
if (skipFont)
AppendToBuffer(buffer, bufferEnd, bufferAlloced, "%02d", event_time.tm_sec);
else
@@ -879,7 +773,7 @@ static char *Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, case 'R':
case 'r': // long date
if (showTime && showDate) {
- TCHAR *szFinalTimestamp = Template_MakeRelativeDate(dat, hTimeZone, dbei.timestamp, g_groupBreak, cc);
+ TCHAR *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, cc);
AppendTimeStamp(szFinalTimestamp, isSent, buffer, bufferEnd, bufferAlloced, skipFont, dat, iFontIDOffset);
}
else skipToNext = TRUE;
@@ -887,29 +781,29 @@ static char *Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, case 't':
case 'T':
if (showTime) {
- TCHAR *szFinalTimestamp = Template_MakeRelativeDate(dat, hTimeZone, dbei.timestamp, g_groupBreak, (TCHAR)((dwEffectiveFlags & MWF_LOG_SHOWSECONDS) ? cc : (TCHAR)'t'));
+ TCHAR *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, (TCHAR)((dwEffectiveFlags & MWF_LOG_SHOWSECONDS) ? cc : (TCHAR)'t'));
AppendTimeStamp(szFinalTimestamp, isSent, buffer, bufferEnd, bufferAlloced, skipFont, dat, iFontIDOffset);
}
else skipToNext = TRUE;
break;
case 'S': // symbol
if (dwEffectiveFlags & MWF_LOG_SYMBOLS) {
- char c;
+ int c;
if ((dwEffectiveFlags & MWF_LOG_INOUTICONS) && dbei.eventType == EVENTTYPE_MESSAGE)
c = isSent ? 0x37 : 0x38;
else {
switch (dbei.eventType) {
case EVENTTYPE_MESSAGE:
- c = (char)0xaa;
+ c = 0xaa;
break;
case EVENTTYPE_FILE:
- c = (char)0xcd;
+ c = 0xcd;
break;
case EVENTTYPE_ERRMSG:
- c = (char)0x72;
+ c = 0x72;
break;
default:
- c = (char)0xaa;
+ c = 0xaa;
break;
}
if (bIsStatusChangeEvent)
@@ -1141,7 +1035,7 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG if (dat->eventsToInsert) {
do {
mir_free(dat->buffer);
- dat->buffer = Template_CreateRTFFromDbEvent(dat->dlgDat, dat->hContact, dat->hDbEvent, !dat->isEmpty, dat);
+ dat->buffer = Template_CreateRTFFromDbEvent(dat->dlgDat, dat->hContact, dat->hDbEvent, dat);
if (dat->buffer)
dat->hDbEventLast = dat->hDbEvent;
dat->hDbEvent = db_event_next(dat->hContact, dat->hDbEvent);
@@ -1158,7 +1052,7 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG //fall through
case STREAMSTAGE_TAIL:
mir_free(dat->buffer);
- dat->buffer = CreateRTFTail(dat->dlgDat);
+ dat->buffer = CreateRTFTail();
dat->stage = STREAMSTAGE_STOP;
break;
@@ -1312,7 +1206,6 @@ void TSAPI StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAp TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
CHARRANGE oldSel, sel;
POINT pt = { 0 };
- BOOL wasFirstAppend = (dat->isAutoRTL & 2) ? TRUE : FALSE;
// calc time limit for grouping
HWND hwndrtf = dat->hwndIEView ? dat->hwndIWebBrowserControl : GetDlgItem(hwndDlg, IDC_LOG);
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index 8278c24e7b..6e6874acf8 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -57,12 +57,6 @@ HIMAGELIST CreateStateImageList() return g_himlStates;
}
-
-static BYTE MsgDlgGetFontDefaultCharset(const char* szFont)
-{
- return DEFAULT_CHARSET;
-}
-
void TSAPI LoadLogfont(int i, LOGFONTA * lf, COLORREF * colour, char *szModule)
{
LOGFONT lfResult;
@@ -395,8 +389,6 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
- DWORD dwFlags = db_get_dw(NULL, SRMSGMOD_T, "mwflags", MWF_LOG_DEFAULT);
-
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_WINDOWOPTIONS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_WINDOWOPTIONS), GWL_STYLE) | (TVS_NOHSCROLL | TVS_CHECKBOXES));
g_himlOptions = (HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_WINDOWOPTIONS, TVM_SETIMAGELIST, TVSIL_STATE, (LPARAM)CreateStateImageList());
@@ -1570,7 +1562,7 @@ static INT_PTR CALLBACK DlgProcTabSrmmModernOptions(HWND hwndDlg, UINT msg, WPAR return FALSE;
}
-static int ModernOptInitialise(WPARAM wParam, LPARAM lParam)
+static int ModernOptInitialise(WPARAM wParam, LPARAM)
{
static int iBoldControls[] =
{
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 962f95da2f..8db04c4f7e 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -393,92 +393,6 @@ int MyAvatarChanged(WPARAM wParam, LPARAM lParam) return 0; } -int IcoLibIconsChanged(WPARAM, LPARAM) -{ - LoadFromIconLib(); - CacheMsgLogIcons(); - return 0; -} - -int IconsChanged(WPARAM, LPARAM) -{ - CreateImageList(FALSE); - CacheMsgLogIcons(); - M.BroadcastMessage(DM_OPTIONSAPPLIED, 0, 0); - M.BroadcastMessage(DM_UPDATEWINICON, 0, 0); - return 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// initialises the internal API, services, events etc... - -static void TSAPI InitAPI() -{ - CreateServiceFunction(MS_MSG_SENDMESSAGE, SendMessageCommand); - CreateServiceFunction(MS_MSG_SENDMESSAGE "W", SendMessageCommand_W); - CreateServiceFunction(MS_MSG_GETWINDOWAPI, GetWindowAPI); - CreateServiceFunction(MS_MSG_GETWINDOWCLASS, GetWindowClass); - CreateServiceFunction(MS_MSG_GETWINDOWDATA, GetWindowData); - CreateServiceFunction(MS_MSG_SETSTATUSTEXT, SetStatusText); - - CreateServiceFunction("SRMsg/ReadMessage", ReadMessageCommand); - CreateServiceFunction("SRMsg/TypingMessage", TypingMessageCommand); - CreateServiceFunction(MS_TABMSG_SETUSERPREFS, SetUserPrefs); - CreateServiceFunction(MS_TABMSG_TRAYSUPPORT, Service_OpenTrayMenu); - CreateServiceFunction(MS_TABMSG_SLQMGR, CSendLater::svcQMgr); - - CreateServiceFunction(MS_MSG_MOD_GETWINDOWFLAGS, GetMessageWindowFlags); - CreateServiceFunction(MS_MSG_MOD_MESSAGEDIALOGOPENED, MessageWindowOpened); - - SI_InitStatusIcons(); - CB_InitCustomButtons(); - - // the event API - PluginConfig.m_event_MsgWin = CreateHookableEvent(ME_MSG_WINDOWEVENT); - PluginConfig.m_event_MsgPopup = CreateHookableEvent(ME_MSG_WINDOWPOPUP); - PluginConfig.m_event_WriteEvent = CreateHookableEvent(ME_MSG_PRECREATEEVENT); -} - -int LoadSendRecvMessageModule(void) -{ - if (FIF == 0) { - MessageBox(0, TranslateT("The image service plugin (advaimg.dll) is not properly installed.\n\nTabSRMM is disabled."), TranslateT("TabSRMM fatal error"), MB_OK | MB_ICONERROR); - return 1; - } - - INITCOMMONCONTROLSEX icex; - icex.dwSize = sizeof(INITCOMMONCONTROLSEX); - icex.dwICC = ICC_COOL_CLASSES | ICC_BAR_CLASSES | ICC_LISTVIEW_CLASSES; - InitCommonControlsEx(&icex); - - Utils::loadSystemLibrary(L"\\Msftedit.dll"); - - mREOLECallback = new REOLECallback; - Win7Taskbar = new CTaskbarInteract; - Win7Taskbar->updateMetrics(); - - memset(&nen_options, 0, sizeof(nen_options)); - M.m_hMessageWindowList = WindowList_Create(); - PluginConfig.hUserPrefsWindowList = WindowList_Create(); - sendQueue = new SendQueue; - Skin = new CSkin; - sendLater = new CSendLater; - - InitOptions(); - - InitAPI(); - - PluginConfig.reloadSystemStartup(); - ReloadTabConfig(); - NEN_ReadOptions(&nen_options); - - db_set_b(0, TEMPLATES_MODULE, "setup", 2); - LoadDefaultTemplates(); - - BuildCodePageList(); - return 0; -} - STDMETHODIMP REOLECallback::GetNewStorage(LPSTORAGE FAR *lplpstg) { LPLOCKBYTES lpLockBytes = NULL; @@ -549,8 +463,6 @@ int TSAPI ActivateExistingTab(TContainerData *pContainer, HWND hwndChild) HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, int isSend, const char *pszInitialText, BOOL bActivateTab, BOOL bPopupContainer, BOOL bWantPopup, HANDLE hdbEvent) { - DBVARIANT dbv = { 0 }; - if (M.FindWindow(hContact) != 0) { _DebugPopup(hContact, _T("Warning: trying to create duplicate window")); return 0; @@ -558,7 +470,7 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, // if we have a max # of tabs/container set and want to open something in the default container... if (hContact != 0 && M.GetByte("limittabs", 0) && !_tcsncmp(pContainer->szName, _T("default"), 6)) { - if ((pContainer = FindMatchingContainer(_T("default"), hContact)) == NULL) { + if ((pContainer = FindMatchingContainer(_T("default"))) == NULL) { TCHAR szName[CONTAINER_NAMELEN + 1]; mir_sntprintf(szName, SIZEOF(szName), _T("default")); if ((pContainer = CreateContainer(szName, CNT_CREATEFLAG_CLONED, hContact)) == NULL) @@ -589,7 +501,6 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, } else _tcsncpy_s(newcontactname, _T("_U_"), _TRUNCATE); - WORD wStatus = (szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE)); TCHAR *szStatus = pcli->pfnGetStatusModeDescription(szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE), 0); if (M.GetByte("tabstatus", 1)) @@ -707,7 +618,7 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, // it searches a container with "room" for the new tabs or otherwise creates // a new (cloned) one. -TContainerData* TSAPI FindMatchingContainer(const TCHAR *szName, MCONTACT hContact) +TContainerData* TSAPI FindMatchingContainer(const TCHAR *szName) { int iMaxTabs = M.GetDword("maxtabs", 0); if (iMaxTabs > 0 && M.GetByte("limittabs", 0) && !_tcsncmp(szName, _T("default"), 6)) { @@ -726,9 +637,6 @@ TContainerData* TSAPI FindMatchingContainer(const TCHAR *szName, MCONTACT hConta void TSAPI CreateImageList(BOOL bInitial) { - int cxIcon = GetSystemMetrics(SM_CXSMICON); - int cyIcon = GetSystemMetrics(SM_CYSMICON); - // the imagelist is now a fake. It is still needed to provide the tab control with a // image list handle. This will make sure that the tab control will reserve space for // an icon on each tab. This is a blank and empty icon @@ -995,3 +903,91 @@ static void UnloadIcons() if (PluginConfig.m_AnimTrayIcons[i]) DestroyIcon(PluginConfig.m_AnimTrayIcons[i]); } + +///////////////////////////////////////////////////////////////////////////////////////// + +int IcoLibIconsChanged(WPARAM, LPARAM) +{ + LoadFromIconLib(); + CacheMsgLogIcons(); + return 0; +} + +int IconsChanged(WPARAM, LPARAM) +{ + CreateImageList(FALSE); + CacheMsgLogIcons(); + M.BroadcastMessage(DM_OPTIONSAPPLIED, 0, 0); + M.BroadcastMessage(DM_UPDATEWINICON, 0, 0); + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// initialises the internal API, services, events etc... + +static void TSAPI InitAPI() +{ + CreateServiceFunction(MS_MSG_SENDMESSAGE, SendMessageCommand); + CreateServiceFunction(MS_MSG_SENDMESSAGE "W", SendMessageCommand_W); + CreateServiceFunction(MS_MSG_GETWINDOWAPI, GetWindowAPI); + CreateServiceFunction(MS_MSG_GETWINDOWCLASS, GetWindowClass); + CreateServiceFunction(MS_MSG_GETWINDOWDATA, GetWindowData); + CreateServiceFunction(MS_MSG_SETSTATUSTEXT, SetStatusText); + + CreateServiceFunction("SRMsg/ReadMessage", ReadMessageCommand); + CreateServiceFunction("SRMsg/TypingMessage", TypingMessageCommand); + CreateServiceFunction(MS_TABMSG_SETUSERPREFS, SetUserPrefs); + CreateServiceFunction(MS_TABMSG_TRAYSUPPORT, Service_OpenTrayMenu); + CreateServiceFunction(MS_TABMSG_SLQMGR, CSendLater::svcQMgr); + + CreateServiceFunction(MS_MSG_MOD_GETWINDOWFLAGS, GetMessageWindowFlags); + CreateServiceFunction(MS_MSG_MOD_MESSAGEDIALOGOPENED, MessageWindowOpened); + + SI_InitStatusIcons(); + CB_InitCustomButtons(); + + // the event API + PluginConfig.m_event_MsgWin = CreateHookableEvent(ME_MSG_WINDOWEVENT); + PluginConfig.m_event_MsgPopup = CreateHookableEvent(ME_MSG_WINDOWPOPUP); + PluginConfig.m_event_WriteEvent = CreateHookableEvent(ME_MSG_PRECREATEEVENT); +} + +int LoadSendRecvMessageModule(void) +{ + if (FIF == 0) { + MessageBox(0, TranslateT("The image service plugin (advaimg.dll) is not properly installed.\n\nTabSRMM is disabled."), TranslateT("TabSRMM fatal error"), MB_OK | MB_ICONERROR); + return 1; + } + + INITCOMMONCONTROLSEX icex; + icex.dwSize = sizeof(INITCOMMONCONTROLSEX); + icex.dwICC = ICC_COOL_CLASSES | ICC_BAR_CLASSES | ICC_LISTVIEW_CLASSES; + InitCommonControlsEx(&icex); + + Utils::loadSystemLibrary(L"\\Msftedit.dll"); + + mREOLECallback = new REOLECallback; + Win7Taskbar = new CTaskbarInteract; + Win7Taskbar->updateMetrics(); + + memset(&nen_options, 0, sizeof(nen_options)); + M.m_hMessageWindowList = WindowList_Create(); + PluginConfig.hUserPrefsWindowList = WindowList_Create(); + sendQueue = new SendQueue; + Skin = new CSkin; + sendLater = new CSendLater; + + InitOptions(); + + InitAPI(); + + PluginConfig.reloadSystemStartup(); + ReloadTabConfig(); + NEN_ReadOptions(&nen_options); + + db_set_b(0, TEMPLATES_MODULE, "setup", 2); + LoadDefaultTemplates(); + + BuildCodePageList(); + return 0; +} diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index 36b0280310..0df153eaf8 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -636,16 +636,16 @@ public: return (E_NOINTERFACE);
}
- STDMETHOD(ContextSensitiveHelp) (BOOL fEnterMode) { return (E_NOTIMPL);}
- STDMETHOD(DeleteObject) (LPOLEOBJECT lpoleobj) { return (E_NOTIMPL);}
- STDMETHOD(GetClipboardData) (CHARRANGE FAR *lpchrg, DWORD reco, LPDATAOBJECT FAR *lplpdataobj) { return (E_NOTIMPL);}
- STDMETHOD(GetContextMenu) (WORD seltype, LPOLEOBJECT lpoleobj, CHARRANGE FAR *lpchrg, HMENU FAR *lphmenu) { return (E_NOTIMPL);}
- STDMETHOD(GetDragDropEffect) (BOOL fDrag, DWORD grfKeyState, LPDWORD pdwEffect) { return (E_NOTIMPL);}
- STDMETHOD(GetInPlaceContext) (LPOLEINPLACEFRAME FAR *lplpFrame, LPOLEINPLACEUIWINDOW FAR *lplpDoc, LPOLEINPLACEFRAMEINFO lpFrameInfo) { return (E_NOTIMPL);}
- STDMETHOD(GetNewStorage) (LPSTORAGE FAR *lplpstg);
- STDMETHOD(QueryAcceptData) (LPDATAOBJECT lpdataobj, CLIPFORMAT FAR *lpcfFormat, DWORD reco, BOOL fReally, HGLOBAL hMetaPict) { return (E_NOTIMPL);}
- STDMETHOD(QueryInsertObject) (LPCLSID lpclsid, LPSTORAGE lpstg, LONG cp) { return (S_OK);}
- STDMETHOD(ShowContainerUI) (BOOL fShow) { return (E_NOTIMPL);}
+ STDMETHOD(ContextSensitiveHelp) (BOOL) { return (E_NOTIMPL); }
+ STDMETHOD(DeleteObject) (LPOLEOBJECT) { return (E_NOTIMPL); }
+ STDMETHOD(GetClipboardData) (CHARRANGE*, DWORD, LPDATAOBJECT*) { return (E_NOTIMPL); }
+ STDMETHOD(GetContextMenu) (WORD, LPOLEOBJECT, CHARRANGE*, HMENU*) { return (E_NOTIMPL); }
+ STDMETHOD(GetDragDropEffect) (BOOL, DWORD, LPDWORD) { return (E_NOTIMPL); }
+ STDMETHOD(GetInPlaceContext) (LPOLEINPLACEFRAME*, LPOLEINPLACEUIWINDOW*, LPOLEINPLACEFRAMEINFO) { return (E_NOTIMPL); }
+ STDMETHOD(GetNewStorage) (LPSTORAGE*);
+ STDMETHOD(QueryAcceptData) (LPDATAOBJECT, CLIPFORMAT*, DWORD, BOOL, HGLOBAL) { return (E_NOTIMPL); }
+ STDMETHOD(QueryInsertObject) (LPCLSID, LPSTORAGE, LONG) { return (S_OK); }
+ STDMETHOD(ShowContainerUI) (BOOL) { return (E_NOTIMPL); }
private:
UINT mRefCounter;
};
@@ -982,7 +982,7 @@ int SI_DeinitStatusIcons(); int GetStatusIconsCount();
void DrawStatusIcons(TWindowData *dat, HDC hdc, const RECT &r, int gap);
-void CheckStatusIconClick(TWindowData *dat, HWND hwndFrom, POINT pt, const RECT &rc, int gap, int code);
+void CheckStatusIconClick(TWindowData *dat, POINT pt, const RECT &rc, int gap, int code);
struct SKINDESC
{
diff --git a/plugins/TabSRMM/src/nen.h b/plugins/TabSRMM/src/nen.h index 31dc1c59be..1a5b5e45dd 100644 --- a/plugins/TabSRMM/src/nen.h +++ b/plugins/TabSRMM/src/nen.h @@ -39,7 +39,7 @@ #define MODULE "tabSRMM_NEN"
-int tabSRMM_ShowPopup(MCONTACT hContact, HANDLE hDbEvent, WORD eventType, int windowOpen, TContainerData *pContainer, HWND hwndChild, const char *szProto, TWindowData *dat);
+int tabSRMM_ShowPopup(MCONTACT hContact, HANDLE hDbEvent, WORD eventType, int windowOpen, TContainerData *pContainer, HWND hwndChild, const char *szProto);
#define DEFAULT_COLBACK RGB(255,255,128)
#define DEFAULT_COLTEXT RGB(0,0,0)
diff --git a/plugins/TabSRMM/src/selectcontainer.cpp b/plugins/TabSRMM/src/selectcontainer.cpp index 81d7576d7f..12365c4a0f 100644 --- a/plugins/TabSRMM/src/selectcontainer.cpp +++ b/plugins/TabSRMM/src/selectcontainer.cpp @@ -38,7 +38,6 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L case WM_INITDIALOG: {
TCHAR szNewTitle[128];
RECT rc, rcParent;
- TContainerData *pContainer = 0;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) lParam);
hwndMsgDlg = (HWND) lParam;
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index 4d15647c1c..25d604590e 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -400,7 +400,6 @@ int CSendLater::sendIt(CSendLaterJob *job) return 0;
WORD wMyStatus = (WORD)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
- WORD wContactStatus = c->getActiveStatus();
// status mode checks
if (wMyStatus == ID_STATUS_OFFLINE) {
@@ -872,7 +871,7 @@ void CSendLater::invokeQueueMgrDlg() // service function to invoke the queue manager
//
-INT_PTR CSendLater::svcQMgr(WPARAM wParam, LPARAM lParam)
+INT_PTR CSendLater::svcQMgr(WPARAM, LPARAM)
{
sendLater->invokeQueueMgrDlg();
return 0;
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index 53165fdb39..662f5389c7 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -147,7 +147,6 @@ static void DoSplitSendW(LPVOID param) MCONTACT hContact = job->hContact; DWORD dwFlags = job->dwFlags; size_t chunkSize = job->chunkSize / 2; - char *szProto = GetContactProto(hContact); size_t iLen = mir_strlen(job->szSendBuffer); WCHAR *wszBegin = (WCHAR*) & job->szSendBuffer[iLen + 1]; @@ -750,7 +749,7 @@ inform_and_discard: return 0; } -LRESULT SendQueue::WarnPendingJobs(unsigned int uNrMessages) +LRESULT SendQueue::WarnPendingJobs(unsigned int) { return MessageBox(0, TranslateT("There are unsent messages waiting for confirmation.\nIf you close the window now, Miranda will try to send them but may be unable to inform you about possible delivery errors.\nDo you really want to close the window(s)?"), diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp index 9c42674cf6..bcca9540e4 100644 --- a/plugins/TabSRMM/src/sidebar.cpp +++ b/plugins/TabSRMM/src/sidebar.cpp @@ -171,12 +171,10 @@ const SIZE& CSideBarButton::measureItem() */
void CSideBarButton::RenderThis(const HDC hdc) const
{
- RECT rc;
- LONG cx, cy;
- HDC hdcMem = 0;
- bool fVertical = (m_sideBarLayout->dwFlags & CSideBar::SIDEBARLAYOUT_VERTICALORIENTATION) ? true : false;
- HBITMAP hbmMem, hbmOld;
- HANDLE hbp = 0;
+ RECT rc;
+ LONG cx, cy;
+ bool fVertical = (m_sideBarLayout->dwFlags & CSideBar::SIDEBARLAYOUT_VERTICALORIENTATION) ? true : false;
+ HBITMAP hbmMem, hbmOld;
::GetClientRect(m_hwnd, &rc);
@@ -192,15 +190,14 @@ void CSideBarButton::RenderThis(const HDC hdc) const cy = rc.bottom;
}
- hdcMem = ::CreateCompatibleDC(hdc);
+ HDC hdcMem = ::CreateCompatibleDC(hdc);
if (fVertical) {
RECT rcFlipped = {0,0,cx,cy};
hbmMem = CSkin::CreateAeroCompatibleBitmap(rcFlipped, hdcMem);
rc = rcFlipped;
}
- else
- hbmMem = CSkin::CreateAeroCompatibleBitmap(rc, hdcMem);
+ else hbmMem = CSkin::CreateAeroCompatibleBitmap(rc, hdcMem);
hbmOld = reinterpret_cast<HBITMAP>(::SelectObject(hdcMem, hbmMem));
@@ -368,7 +365,7 @@ CSideBar::CSideBar(TContainerData *pContainer) : m_activeItem = 0;
m_isVisible = true;
- Init(true);
+ Init();
}
CSideBar::~CSideBar()
@@ -379,7 +376,7 @@ CSideBar::~CSideBar() ::DestroyWindow(m_hwndScrollWnd);
}
-void CSideBar::Init(const bool fForce)
+void CSideBar::Init()
{
m_iTopButtons = m_iBottomButtons = 0;
m_topHeight = m_bottomHeight = 0;
@@ -600,7 +597,7 @@ HRESULT CSideBar::removeSession(const TWindowData *dat) */
void CSideBar::scrollIntoView(const CSideBarButton *item)
{
- LONG spaceUsed = 0, itemHeight;
+ LONG spaceUsed = 0, itemHeight = 0;
bool fNeedLayout = false;
if (!m_isActive)
@@ -728,8 +725,6 @@ void CSideBar::Layout(const RECT *rc, bool fOnlyCalc) HDWP hdwp = ::BeginDeferWindowPos(1);
- int topCount = 0, bottomCount = 0;
- size_t j = 0;
BOOL topEnabled = FALSE, bottomEnabled = FALSE;
HWND hwnd;
LONG spaceUsed = 0;
@@ -866,7 +861,7 @@ void CSideBar::processScrollerButtons(UINT commandID) Layout(0);
}
-void CSideBar::resizeScrollWnd(LONG x, LONG y, LONG width, LONG height) const
+void CSideBar::resizeScrollWnd(LONG x, LONG y, LONG, LONG height) const
{
if (!m_isVisible || !m_isActive) {
::ShowWindow(m_hwndScrollWnd, SW_HIDE);
@@ -913,8 +908,10 @@ LRESULT CALLBACK CSideBar::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP HANDLE hbp = 0;
HBITMAP hbm, hbmOld;
- if (CMimAPI::m_haveBufferedPaint)
+ if (CMimAPI::m_haveBufferedPaint) {
hbp = CSkin::InitiateBufferedPaint(hdc, rc, hdcMem);
+ hbm = hbmOld = 0;
+ }
else {
hdcMem = ::CreateCompatibleDC(hdc);
hbm = CSkin::CreateAeroCompatibleBitmap(rc, hdcMem);
@@ -1058,12 +1055,9 @@ void __fastcall CSideBar::m_DefaultBackgroundRenderer(const HDC hdc, const RECT void __fastcall CSideBar::m_DefaultContentRenderer(const HDC hdc, const RECT *rcBox,
const CSideBarButton *item)
{
- UINT id = item->getID();
- const TWindowData* dat = item->getDat();
- int stateID = item->m_buttonControl->stateId;
-
- LONG cx = rcBox->right - rcBox->left;
- LONG cy = rcBox->bottom - rcBox->top;
+ const TWindowData *dat = item->getDat();
+ UINT id = item->getID();
+ int stateID = item->m_buttonControl->stateId;
if (id == IDC_SIDEBARUP || id == IDC_SIDEBARDOWN) {
::DrawIconEx(hdc, (rcBox->left + rcBox->right) / 2 - 8, (rcBox->top + rcBox->bottom) / 2 - 8, id == IDC_SIDEBARUP ? PluginConfig.g_buttonBarIcons[26] : PluginConfig.g_buttonBarIcons[16],
@@ -1082,9 +1076,8 @@ void __fastcall CSideBar::m_DefaultContentRenderer(const HDC hdc, const RECT *rc void __fastcall CSideBar::m_AdvancedContentRenderer(const HDC hdc, const RECT *rcBox,
const CSideBarButton *item)
{
- UINT id = item->getID();
- const TWindowData* dat = item->getDat();
- int stateID = item->m_buttonControl->stateId;
+ const TWindowData *dat = item->getDat();
+ UINT id = item->getID();
LONG cx = rcBox->right - rcBox->left;
LONG cy = rcBox->bottom - rcBox->top;
diff --git a/plugins/TabSRMM/src/sidebar.h b/plugins/TabSRMM/src/sidebar.h index b38c9a17ed..5e138b7e87 100644 --- a/plugins/TabSRMM/src/sidebar.h +++ b/plugins/TabSRMM/src/sidebar.h @@ -129,7 +129,7 @@ public: CSideBar(TContainerData *pContainer);
~CSideBar();
- void Init(const bool fForce = false);
+ void Init();
void addSession(const TWindowData *dat, int position);
HRESULT removeSession(const TWindowData *dat);
void updateSession(const TWindowData *dat);
diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp index 15eb8d0094..8002a44cca 100644 --- a/plugins/TabSRMM/src/srmm.cpp +++ b/plugins/TabSRMM/src/srmm.cpp @@ -53,13 +53,13 @@ PLUGININFOEX pluginInfo = { {0x6ca5f042, 0x7a7f, 0x47cc, {0xa7, 0x15, 0xfc, 0x8c, 0x46, 0xfb, 0xf4, 0x34}} }; -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) { g_hInst = hinstDLL; return TRUE; } -extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion) +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { return &pluginInfo; } diff --git a/plugins/TabSRMM/src/tabctrl.cpp b/plugins/TabSRMM/src/tabctrl.cpp index b90419cf5e..d610f788eb 100644 --- a/plugins/TabSRMM/src/tabctrl.cpp +++ b/plugins/TabSRMM/src/tabctrl.cpp @@ -225,7 +225,7 @@ static void DrawItem(TabControlData *tabdat, HDC dc, RECT *rcItem, int nHint, in static RECT rcTabPage = { 0 };
-static void DrawItemRect(TabControlData *tabdat, HDC dc, RECT *rcItem, int nHint, int iItem, const TWindowData *dat)
+static void DrawItemRect(TabControlData *tabdat, HDC dc, RECT *rcItem, int nHint, const TWindowData *dat)
{
POINT pt;
DWORD dwStyle = tabdat->dwStyle;
@@ -428,7 +428,7 @@ static HRESULT DrawThemesPart(const TabControlData *tabdat, HDC hDC, int iPartId // draw a themed tab item. either a tab or the body pane
// handles image mirroring for tabs at the bottom
-static void DrawThemesXpTabItem(HDC pDC, int ixItem, RECT *rcItem, UINT uiFlag, TabControlData *tabdat, TWindowData *dat)
+static void DrawThemesXpTabItem(HDC pDC, RECT *rcItem, UINT uiFlag, TabControlData *tabdat, TWindowData *dat)
{
BOOL bBody = (uiFlag & 1) ? TRUE : FALSE;
BOOL bSel = (uiFlag & 2) ? TRUE : FALSE;
@@ -589,7 +589,6 @@ static void PaintWorker(HWND hwnd, TabControlData *tabdat) UINT uiFlags = 1;
UINT uiBottom = 0;
TCHITTESTINFO hti;
- HBITMAP bmpMem, bmpOld;
bool isAero = M.isAero();
HANDLE hpb = 0;
BOOL bClassicDraw = !isAero && (tabdat->m_VisualStyles == FALSE || CSkin::m_skinEnabled);
@@ -634,8 +633,11 @@ static void PaintWorker(HWND hwnd, TabControlData *tabdat) int cy = rctPage.bottom - rctPage.top;
// draw everything to a memory dc to avoid flickering
- if (CMimAPI::m_haveBufferedPaint)
+ HBITMAP bmpMem, bmpOld;
+ if (CMimAPI::m_haveBufferedPaint) {
hpb = tabdat->hbp = CSkin::InitiateBufferedPaint(hdcreal, rctPage, hdc);
+ bmpMem = bmpOld = 0;
+ }
else {
hdc = CreateCompatibleDC(hdcreal);
bmpMem = tabdat->fAeroTabs ? CSkin::CreateAeroCompatibleBitmap(rctPage, hdcreal) : CreateCompatibleBitmap(hdcreal, cx, cy);
@@ -698,7 +700,7 @@ static void PaintWorker(HWND hwnd, TabControlData *tabdat) if (PluginConfig.m_fillColor)
DrawCustomTabPage(hdc, rcClient);
else
- DrawThemesXpTabItem(hdc, -1, &rcClient, uiFlags, tabdat, 0); // TABP_PANE=9,0,'TAB'
+ DrawThemesXpTabItem(hdc, &rcClient, uiFlags, tabdat, 0); // TABP_PANE=9,0,'TAB'
if (tabdat->bRefreshWithoutClip)
goto skip_tabs;
}
@@ -838,14 +840,14 @@ page_done: if (IntersectRect(&rectTemp, &rcItem, &ps.rcPaint) || bClassicDraw) {
int nHint = 0;
if (!bClassicDraw && !(dwStyle & TCS_BUTTONS)) {
- DrawThemesXpTabItem(hdc, i, &rcItem, uiFlags | uiBottom | (i == hotItem ? 4 : 0), tabdat, dat);
+ DrawThemesXpTabItem(hdc, &rcItem, uiFlags | uiBottom | (i == hotItem ? 4 : 0), tabdat, dat);
DrawItem(tabdat, hdc, &rcItem, nHint | (i == hotItem ? HINT_HOTTRACK : 0), i, dat);
}
else {
if (tabdat->fAeroTabs && !CSkin::m_skinEnabled && !(dwStyle & TCS_BUTTONS))
DrawThemesPartWithAero(tabdat, hdc, 0, (i == hotItem ? PBS_HOT : PBS_NORMAL), &rcItem, dat);
else
- DrawItemRect(tabdat, hdc, &rcItem, nHint | (i == hotItem ? HINT_HOTTRACK : 0), i, dat);
+ DrawItemRect(tabdat, hdc, &rcItem, nHint | (i == hotItem ? HINT_HOTTRACK : 0), dat);
DrawItem(tabdat, hdc, &rcItem, nHint | (i == hotItem ? HINT_HOTTRACK : 0), i, dat);
}
}
@@ -868,7 +870,7 @@ page_done: if (!bClassicDraw && !(dwStyle & TCS_BUTTONS)) {
InflateRect(&rcItem, 2, 2);
- DrawThemesXpTabItem(hdc, iActive, &rcItem, 2 | uiBottom, tabdat, dat);
+ DrawThemesXpTabItem(hdc, &rcItem, 2 | uiBottom, tabdat, dat);
DrawItem(tabdat, hdc, &rcItem, nHint | HINT_ACTIVE_ITEM, iActive, dat);
}
else {
@@ -886,7 +888,7 @@ page_done: rcItem.top -= 2;
DrawThemesPartWithAero(tabdat, hdc, 0, PBS_PRESSED, &rcItem, dat);
}
- else DrawItemRect(tabdat, hdc, &rcItem, HINT_ACTIVATE_RIGHT_SIDE | HINT_ACTIVE_ITEM | nHint, iActive, dat);
+ else DrawItemRect(tabdat, hdc, &rcItem, HINT_ACTIVATE_RIGHT_SIDE | HINT_ACTIVE_ITEM | nHint, dat);
DrawItem(tabdat, hdc, &rcItem, HINT_ACTIVE_ITEM | nHint, iActive, dat);
}
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index 571498fcd0..ed9c8119b1 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -126,14 +126,13 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP teInfo = (TemplateEditorInfo *)dat->pContainer; tSet = teInfo->rtl ? dat->pContainer->rtl_templates : dat->pContainer->ltr_templates; } + else tSet = NULL; switch (msg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); { TemplateEditorNew *teNew = (TemplateEditorNew *)lParam; - COLORREF url_visited = RGB(128, 0, 128); - COLORREF url_unvisited = RGB(0, 0, 255); dat = (TWindowData*)mir_calloc( sizeof(TWindowData)); dat->pContainer = (TContainerData*)mir_alloc(sizeof(TContainerData)); memset(dat->pContainer, 0, sizeof(TContainerData)); diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index 502404f187..4721f218fa 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -625,7 +625,7 @@ void __fastcall CImageItem::Render(const HDC hdc, const RECT *rc, bool fIgnoreGl BOOL isGlyph = ((m_dwFlags & IMAGE_GLYPH) && Skin->haveGlyphItem());
BOOL fCleanUp = TRUE;
HDC hdcSrc = 0;
- HBITMAP hbmOld;
+ HBITMAP hbmOld = 0;
LONG srcOrigX = isGlyph ? m_glyphMetrics[0] : 0;
LONG srcOrigY = isGlyph ? m_glyphMetrics[1] : 0;
@@ -1528,8 +1528,6 @@ void CSkin::LoadItems() TCHAR *p, *p1;
TIconDesc tmpIconDesc = { 0 };
- CImageItem *pItem = m_ImageItems;
-
if (m_skinIcons == NULL)
m_skinIcons = (TIconDescW *)mir_calloc(sizeof(TIconDescW) * NR_MAXSKINICONS);
@@ -2323,7 +2321,7 @@ void CSkin::FinalizeBufferedPaint(HANDLE hbp, RECT *rc) // default is none, needed forsome special
// effects. default paramenter is 0
-void CSkin::ApplyAeroEffect(const HDC hdc, const RECT *rc, int iEffectArea, HANDLE hbp)
+void CSkin::ApplyAeroEffect(const HDC hdc, const RECT *rc, int iEffectArea)
{
if (m_pCurrentAeroEffect == 0 || m_aeroEffect == AERO_EFFECT_NONE)
return;
@@ -2457,31 +2455,31 @@ void CSkin::extractSkinsAndLogo(bool fForceOverwrite) const /////////////////////////////////////////////////////////////////////////////////////////
// redraw the splitter area between the message input and message log area only
-void CSkin::UpdateToolbarBG(TWindowData *dat, DWORD dwRdwOptFlags)
+void CSkin::UpdateToolbarBG(TWindowData *dat)
{
- RECT rcUpdate, rcTmp;
- POINT pt;
-
- if (dat) {
- ::GetWindowRect(::GetDlgItem(dat->hwnd, dat->bType == SESSIONTYPE_IM ? IDC_LOG : IDC_CHAT_LOG), &rcTmp);
-
- pt.x = rcTmp.left;
- pt.y = rcTmp.top;
- ::ScreenToClient(dat->hwnd, &pt);
-
- rcUpdate.left = 0;
- rcUpdate.top = pt.y;
+ if (dat == NULL)
+ return;
- ::GetClientRect(dat->hwnd, &rcTmp);
- rcUpdate.right = rcTmp.right;
- rcUpdate.bottom = rcTmp.bottom;
+ RECT rcUpdate, rcTmp;
+ ::GetWindowRect(::GetDlgItem(dat->hwnd, dat->bType == SESSIONTYPE_IM ? IDC_LOG : IDC_CHAT_LOG), &rcTmp);
- if (M.isAero() || M.isDwmActive())
- dat->fLimitedUpdate = true; // skip unrelevant window updates when we have buffered paint avail
- ::RedrawWindow(dat->hwnd, &rcUpdate, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW);
- ::BB_RedrawButtons(dat);
- dat->fLimitedUpdate = false;
- }
+ POINT pt;
+ pt.x = rcTmp.left;
+ pt.y = rcTmp.top;
+ ::ScreenToClient(dat->hwnd, &pt);
+
+ rcUpdate.left = 0;
+ rcUpdate.top = pt.y;
+
+ ::GetClientRect(dat->hwnd, &rcTmp);
+ rcUpdate.right = rcTmp.right;
+ rcUpdate.bottom = rcTmp.bottom;
+
+ if (M.isAero() || M.isDwmActive())
+ dat->fLimitedUpdate = true; // skip unrelevant window updates when we have buffered paint avail
+ ::RedrawWindow(dat->hwnd, &rcUpdate, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW);
+ ::BB_RedrawButtons(dat);
+ dat->fLimitedUpdate = false;
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/TabSRMM/src/themes.h b/plugins/TabSRMM/src/themes.h index 1dbe7b9dfe..e83dbf2561 100644 --- a/plugins/TabSRMM/src/themes.h +++ b/plugins/TabSRMM/src/themes.h @@ -294,13 +294,13 @@ public: static void TSAPI MapClientToParent(HWND hwndClient, HWND hwndParent, RECT &rc);
static void TSAPI RenderToolbarBG(const TWindowData *dat, HDC hdc, const RECT &rcWindow);
static HBITMAP TSAPI ResizeBitmap(HBITMAP hBmpSrc, LONG width, LONG height, bool &mustFree);
- static void TSAPI ApplyAeroEffect(const HDC hdc, const RECT* rc, int iEffectArea, HANDLE hbp = 0);
+ static void TSAPI ApplyAeroEffect(const HDC hdc, const RECT* rc, int iEffectArea);
static void TSAPI setAeroEffect(const LRESULT effect);
static void TSAPI initAeroEffect();
static HANDLE TSAPI InitiateBufferedPaint(const HDC hdcSrc, RECT& rc, HDC& hdcOut);
static void TSAPI FinalizeBufferedPaint(HANDLE hbp, RECT *rc);
static bool __fastcall DrawItem(const HDC hdc, const RECT *rc, const CSkinItem *item);
- static void TSAPI UpdateToolbarBG(TWindowData *dat, DWORD dwRdwOptFlags = 0);
+ static void TSAPI UpdateToolbarBG(TWindowData *dat);
static void TSAPI FillBack(const HDC hdc, RECT* rc);
public:
diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp index 31eb776712..9ac0f29aa5 100644 --- a/plugins/TabSRMM/src/trayicon.cpp +++ b/plugins/TabSRMM/src/trayicon.cpp @@ -35,7 +35,7 @@ HANDLE g_hEvent = 0; static TCHAR g_eventName[100];
-static void TrayAnimThread(LPVOID vParam)
+static void TrayAnimThread(LPVOID)
{
int iAnimMode = (PluginConfig.m_AnimTrayIcons[0] && PluginConfig.m_AnimTrayIcons[1] && PluginConfig.m_AnimTrayIcons[2] &&
PluginConfig.m_AnimTrayIcons[3]);
@@ -154,39 +154,6 @@ void TSAPI CreateSystrayIcon(int create) }
}
-static BOOL CALLBACK FindTrayWnd(HWND hwnd, LPARAM lParam)
-{
- TCHAR szClassName[256];
- GetClassName(hwnd, szClassName, 255);
-
- if (_tcscmp(szClassName, _T("TrayNotifyWnd")) == 0) {
- RECT *pRect = (RECT *) lParam;
- GetWindowRect(hwnd, pRect);
- return TRUE;
- }
- if (_tcscmp(szClassName, _T("TrayClockWClass")) == 0) {
- RECT *pRect = (RECT *) lParam;
- RECT rectClock;
- GetWindowRect(hwnd, &rectClock);
- if (rectClock.bottom < pRect->bottom - 5) // 10 = random fudge factor.
- pRect->top = rectClock.bottom;
- else
- pRect->right = rectClock.left;
- return FALSE;
- }
- return TRUE;
-}
-
-static void GetTrayWindowRect(LPRECT lprect)
-{
- HWND hShellTrayWnd = FindWindow(_T("Shell_TrayWnd"), NULL);
- if (hShellTrayWnd) {
- GetWindowRect(hShellTrayWnd, lprect);
- EnumChildWindows(hShellTrayWnd, FindTrayWnd, (LPARAM)lprect);
- return;
- }
-}
-
/*
* flash the tray icon
* mode = 0 - continue to flash
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp index 414636501e..1583ffb114 100644 --- a/plugins/TabSRMM/src/typingnotify.cpp +++ b/plugins/TabSRMM/src/typingnotify.cpp @@ -41,7 +41,7 @@ static colorPicker[4] = { IDC_TYPEOFF_TX, "OFF_TX", RGB(0,0,0)}
};
-static INT_PTR EnableDisableMenuCommand(WPARAM wParam,LPARAM lParam)
+static INT_PTR EnableDisableMenuCommand(WPARAM, LPARAM)
{
Disabled = !Disabled;
@@ -52,7 +52,8 @@ static INT_PTR EnableDisableMenuCommand(WPARAM wParam,LPARAM lParam) if (!Disabled) {
mi.pszName = LPGEN("Disable &typing notification");
mi.hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_ENABLED));
- } else {
+ }
+ else {
mi.pszName = LPGEN("Enable &typing notification");
mi.hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_DISABLED));
}
@@ -78,7 +79,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA PUDeletePopup(hWnd);
return 1;
- case UM_INITPOPUP:
+ case UM_INITPOPUP:
WindowList_Add(hPopupsList, hWnd, PUGetContact(hWnd));
return 1;
@@ -92,7 +93,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA void TN_TypingMessage(MCONTACT hContact, int iMode)
{
// hidden & ignored contacts check
- if (db_get_b(hContact, "CList", "Hidden", 0) || (db_get_dw(hContact, "Ignore", "Mask1",0) & 1)) // 9 - online notification
+ if (db_get_b(hContact, "CList", "Hidden", 0) || (db_get_dw(hContact, "Ignore", "Mask1", 0) & 1)) // 9 - online notification
return;
if (!PluginConfig.g_PopupAvail || Disabled)
@@ -131,8 +132,8 @@ void TN_TypingMessage(MCONTACT hContact, int iMode) switch (ColorMode) {
case COLOR_OWN:
- ppd.colorBack = colorPicker[2* notyping ].color;
- ppd.colorText = colorPicker[2* notyping + 1].color;
+ ppd.colorBack = colorPicker[2 * notyping].color;
+ ppd.colorText = colorPicker[2 * notyping + 1].color;
break;
case COLOR_WINDOWS:
ppd.colorBack = GetSysColor(COLOR_BTNFACE);
@@ -156,7 +157,7 @@ void TN_TypingMessage(MCONTACT hContact, int iMode) default:
ppd.iSeconds = 0;
break;
- }
+ }
else
switch (TimeoutMode) {
case TIMEOUT_CUSTOM:
@@ -172,7 +173,7 @@ void TN_TypingMessage(MCONTACT hContact, int iMode) default:
ppd.iSeconds = 0;
break;
- }
+ }
ppd.lchIcon = PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING];
ppd.lchContact = hContact;
@@ -201,7 +202,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA CheckDlgButton(hwndDlg, IDC_USEPOPUPCOLORS, BST_CHECKED);
}
- for (i=0; i < SIZEOF(colorPicker); i++) {
+ for (i = 0; i < SIZEOF(colorPicker); i++) {
SendDlgItemMessage(hwndDlg, colorPicker[i].res, CPM_SETCOLOUR, 0, colorPicker[i].color);
Utils::enableDlgControl(hwndDlg, colorPicker[i].res, (ColorMode == COLOR_OWN));
}
@@ -259,7 +260,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA bEnableOthers = TRUE;
}
- for (i=0; i < SIZEOF(colorPicker); i++)
+ for (i = 0; i < SIZEOF(colorPicker); i++)
Utils::enableDlgControl(hwndDlg, colorPicker[i].res, bEnableOthers);
Utils::enableDlgControl(hwndDlg, IDC_USEPOPUPCOLORS, bEnableOthers);
@@ -281,7 +282,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 (i = 0; i < sizeof(colorPicker) / sizeof(colorPicker[0]); i++)
Utils::enableDlgControl(hwndDlg, colorPicker[i].res, bEnableOthers);
Utils::enableDlgControl(hwndDlg, IDC_USEWINCOLORS, bEnableOthers);
@@ -304,7 +305,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_PREVIEW:
if (PluginConfig.g_PopupAvail) {
POPUPDATAT ppd = { 0 };
- for (i=0; i < 2; i++) {
+ for (i = 0; i < 2; i++) {
int notyping;
if (i == PROTOTYPE_CONTACTTYPING_OFF) {
_tcsncpy_s(ppd.lptzContactName, TranslateT("Contact"), _TRUNCATE);
@@ -319,8 +320,8 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA switch (newColorMode) {
case COLOR_OWN:
- ppd.colorText = SendDlgItemMessage(hwndDlg, colorPicker[2*notyping + 1].res, CPM_GETCOLOUR, 0, 0);
- ppd.colorBack = SendDlgItemMessage(hwndDlg, colorPicker[2*notyping ].res, CPM_GETCOLOUR, 0, 0);
+ ppd.colorText = SendDlgItemMessage(hwndDlg, colorPicker[2 * notyping + 1].res, CPM_GETCOLOUR, 0, 0);
+ ppd.colorBack = SendDlgItemMessage(hwndDlg, colorPicker[2 * notyping].res, CPM_GETCOLOUR, 0, 0);
break;
case COLOR_WINDOWS:
ppd.colorBack = GetSysColor(COLOR_BTNFACE);
@@ -429,36 +430,34 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_TIMEOUT_VALUE:
case IDC_TIMEOUT_VALUE2:
- {
- int newValue = GetDlgItemInt(hwndDlg, idCtrl, NULL, 0);
-
- if (wNotifyCode == EN_KILLFOCUS) {
- int oldValue;
-
- if (idCtrl == IDC_TIMEOUT_VALUE)
- oldValue = newTimeout;
- else
- oldValue = newTimeout2;
-
- if (newValue != oldValue)
- SetDlgItemInt(hwndDlg, idCtrl, oldValue, 0);
- return TRUE;
- }
- if (wNotifyCode != EN_CHANGE || (HWND) lParam != GetFocus())
- return TRUE;
+ int newValue = GetDlgItemInt(hwndDlg, idCtrl, NULL, 0);
- if (newValue > TIMEOUT_MAXVALUE)
- newValue = TIMEOUT_MAXVALUE;
- else if (newValue < TIMEOUT_MINVALUE)
- newValue = TIMEOUT_MINVALUE;
+ if (wNotifyCode == EN_KILLFOCUS) {
+ int oldValue;
if (idCtrl == IDC_TIMEOUT_VALUE)
- newTimeout = newValue;
+ oldValue = newTimeout;
else
- newTimeout2 = newValue;
+ oldValue = newTimeout2;
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ if (newValue != oldValue)
+ SetDlgItemInt(hwndDlg, idCtrl, oldValue, 0);
+ return TRUE;
}
+ if (wNotifyCode != EN_CHANGE || (HWND)lParam != GetFocus())
+ return TRUE;
+
+ if (newValue > TIMEOUT_MAXVALUE)
+ newValue = TIMEOUT_MAXVALUE;
+ else if (newValue < TIMEOUT_MINVALUE)
+ newValue = TIMEOUT_MINVALUE;
+
+ if (idCtrl == IDC_TIMEOUT_VALUE)
+ newTimeout = newValue;
+ else
+ newTimeout2 = newValue;
+
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
}
break;
@@ -466,9 +465,9 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case WM_NOTIFY:
switch (((LPNMHDR)lParam)->idFrom) {
case 0:
- switch (((LPNMHDR) lParam)->code) {
+ switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- for (i=0; i < sizeof(colorPicker) / sizeof(colorPicker[0]); i++) {
+ for (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);
}
@@ -487,12 +486,12 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA db_set_b(0, Module, SET_ONEPOPUP, OnePopup);
db_set_b(0, Module, SET_SHOWDISABLEMENU, ShowMenu);
- db_set_b(0, Module, SET_DISABLED, (BYTE) (StartDisabled | StopDisabled));
+ db_set_b(0, Module, SET_DISABLED, (BYTE)(StartDisabled | StopDisabled));
db_set_b(0, Module, SET_COLOR_MODE, ColorMode);
db_set_b(0, Module, SET_TIMEOUT_MODE, TimeoutMode);
- db_set_b(0, Module, SET_TIMEOUT, (BYTE) Timeout);
+ db_set_b(0, Module, SET_TIMEOUT, (BYTE)Timeout);
db_set_b(0, Module, SET_TIMEOUT_MODE2, TimeoutMode2);
- db_set_b(0, Module, SET_TIMEOUT2, (BYTE) Timeout2);
+ db_set_b(0, Module, SET_TIMEOUT2, (BYTE)Timeout2);
return TRUE;
}
}
@@ -501,9 +500,9 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA return FALSE;
}
-int TN_OptionsInitialize(WPARAM wParam, LPARAM lParam)
+int TN_OptionsInitialize(WPARAM wParam, LPARAM)
{
- if ( ServiceExists(MS_POPUP_ADDPOPUPT)) {
+ if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
odp.position = 100000000;
odp.hInstance = g_hInst;
@@ -537,8 +536,8 @@ int TN_ModuleInit() Timeout2 = M.GetByte(Module, SET_TIMEOUT2, DEF_TIMEOUT2);
if (!(M.GetDword(Module, colorPicker[0].desc, 1) && !M.GetDword(Module, colorPicker[0].desc, 0)))
- for (i=0; i < SIZEOF(colorPicker); i++)
- colorPicker[i].color = M.GetDword(Module,colorPicker[i].desc,0);
+ for (i = 0; i < SIZEOF(colorPicker); i++)
+ colorPicker[i].color = M.GetDword(Module, colorPicker[i].desc, 0);
mir_sntprintf(szStart, SIZEOF(szStart), TranslateT("...is typing a message."));
mir_sntprintf(szStop, SIZEOF(szStop), TranslateT("...has stopped typing."));
@@ -561,13 +560,13 @@ int TN_ModuleInit() }
SkinAddNewSoundEx("TNStart", LPGEN("Instant messages"), LPGEN("Contact started typing"));
- SkinAddNewSoundEx("TNStop", LPGEN("Instant messages"), LPGEN("Contact stopped typing"));
+ SkinAddNewSoundEx("TNStop", LPGEN("Instant messages"), LPGEN("Contact stopped typing"));
return 0;
}
int TN_ModuleDeInit()
{
WindowList_Destroy(hPopupsList);
- db_set_b(0, Module, SET_DISABLED, (BYTE) (Disabled | StartDisabled | StopDisabled));
+ db_set_b(0, Module, SET_DISABLED, (BYTE)(Disabled | StartDisabled | StopDisabled));
return 0;
}
diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp index 676a9012b5..f9ab9e37ac 100644 --- a/plugins/TabSRMM/src/userprefs.cpp +++ b/plugins/TabSRMM/src/userprefs.cpp @@ -64,13 +64,9 @@ static INT_PTR CALLBACK DlgProcUserPrefs(HWND hwndDlg, UINT msg, WPARAM wParam, BYTE bIEView = M.GetByte(hContact, "ieview", 0);
BYTE bHPP = M.GetByte(hContact, "hpplog", 0);
int iLocalFormat = M.GetDword(hContact, "sendformat", 0);
- BYTE bRTL = M.GetByte(hContact, "RTL", 0);
- BYTE bLTR = M.GetByte(hContact, "RTL", 1);
BYTE bSplit = M.GetByte(hContact, "splitoverride", 0);
BYTE bInfoPanel = M.GetByte(hContact, "infopanel", 0);
BYTE bAvatarVisible = M.GetByte(hContact, "hideavatar", -1);
- char *szProto = GetContactProto(hContact);
- int def_log_index = 1, hpp_log_index = 1, ieview_log_index = 1;
have_ieview = ServiceExists(MS_IEVIEW_WINDOW);
have_hpp = ServiceExists("History++/ExtGrid/NewWindow");
@@ -166,7 +162,7 @@ static INT_PTR CALLBACK DlgProcUserPrefs(HWND hwndDlg, UINT msg, WPARAM wParam, DWORD *pdwActionToTake = (DWORD *)lParam;
int iIndex = CB_ERR, iMode = -1;
DWORD newCodePage;
- unsigned int iOldIEView;
+ unsigned int iOldIEView = 0;
HWND hWnd = M.FindWindow(hContact);
DWORD sCodePage = M.GetDword(hContact, "ANSIcodepage", 0);
BYTE bInfoPanel, bOldInfoPanel = M.GetByte(hContact, "infopanel", 0);
@@ -175,7 +171,7 @@ static INT_PTR CALLBACK DlgProcUserPrefs(HWND hwndDlg, UINT msg, WPARAM wParam, if (hWnd) {
dat = (TWindowData*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
if (dat)
- iOldIEView = GetIEViewMode(hWnd, dat->hContact);
+ iOldIEView = GetIEViewMode(dat->hContact);
}
iIndex = SendDlgItemMessage(hwndDlg, IDC_IEVIEWMODE, CB_GETCURSEL, 0, 0);
iMode = SendDlgItemMessage(hwndDlg, IDC_IEVIEWMODE, CB_GETITEMDATA, iIndex, 0);
@@ -202,7 +198,7 @@ static INT_PTR CALLBACK DlgProcUserPrefs(HWND hwndDlg, UINT msg, WPARAM wParam, break;
}
if (hWnd && dat) {
- iNewIEView = GetIEViewMode(hWnd, dat->hContact);
+ iNewIEView = GetIEViewMode(dat->hContact);
if (iNewIEView != iOldIEView) {
if (pdwActionToTake)
*pdwActionToTake |= UPREF_ACTION_SWITCHLOGVIEWER;
@@ -321,7 +317,7 @@ checkboxes[] = { // ALWAYS mask dat->dwFlags with MWF_LOG_ALL to only affect real flag bits and
// ignore temporary bits.
-int TSAPI LoadLocalFlags(HWND hwnd, TWindowData *dat)
+int TSAPI LoadLocalFlags(TWindowData *dat)
{
if (dat == NULL)
return NULL;
@@ -530,7 +526,7 @@ INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (dat) {
DWORD dwOldFlags = (dat->dwFlags & MWF_LOG_ALL);
SetDialogToType(hwnd);
- LoadLocalFlags(hwnd, dat);
+ LoadLocalFlags(dat);
if ((dat->dwFlags & MWF_LOG_ALL) != dwOldFlags) {
bool fShouldHide = true;
if (IsIconic(dat->pContainer->hwnd))
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index 80bded6da8..9ea194614a 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -58,7 +58,7 @@ LRESULT _dlgReturn(HWND hWnd, LRESULT result) TCHAR* Utils::FilterEventMarkers(TCHAR *wszText)
{
tstring text(wszText);
- INT_PTR beginmark = 0, endmark = 0;
+ size_t beginmark = 0, endmark = 0;
while (true) {
if ((beginmark = text.find(_T("~-+"))) != text.npos) {
@@ -96,10 +96,10 @@ TCHAR* Utils::FilterEventMarkers(TCHAR *wszText) const TCHAR* Utils::FormatRaw(TWindowData *dat, const TCHAR *msg, int flags, BOOL isSent)
{
bool clr_was_added = false, was_added;
- static tstring message(msg);
- INT_PTR beginmark = 0, endmark = 0, tempmark = 0, index;
- int i, endindex;
- TCHAR endmarker;
+ static tstring message(msg);
+ size_t beginmark = 0, endmark = 0, tempmark = 0, index;
+ int i, endindex;
+ TCHAR endmarker;
DWORD dwFlags = dat->dwFlags;
message.assign(msg);
@@ -330,8 +330,7 @@ TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat) break;
}
case 'x': {
- TCHAR *szFinalStatus = NULL;
- BYTE xStatus = dat->cache->getXStatusId();
+ BYTE xStatus = dat->cache->getXStatusId();
if (dat->wStatus != ID_STATUS_OFFLINE && xStatus > 0 && xStatus <= 31) {
DBVARIANT dbv = {0};
@@ -406,7 +405,7 @@ TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat) char* Utils::FilterEventMarkers(char *szText)
{
std::string text(szText);
- INT_PTR beginmark = 0, endmark = 0;
+ size_t beginmark = 0, endmark = 0;
while (true) {
if ((beginmark = text.find("~-+")) != text.npos) {
@@ -440,7 +439,7 @@ const TCHAR* Utils::DoubleAmpersands(TCHAR *pszText) {
tstring text(pszText);
- INT_PTR textPos = 0;
+ size_t textPos = 0;
while (true) {
if ((textPos = text.find(_T("&"),textPos)) != text.npos) {
@@ -464,17 +463,19 @@ const TCHAR* Utils::DoubleAmpersands(TCHAR *pszText) TCHAR* Utils::GetPreviewWithEllipsis(TCHAR *szText, size_t iMaxLen)
{
- size_t uRequired;
- TCHAR* p = 0, cSaved;
+ size_t uRequired;
+ TCHAR *p = 0, cSaved;
bool fEllipsis = false;
- if (_tcslen(szText) <= iMaxLen)
+ if (_tcslen(szText) <= iMaxLen) {
uRequired = _tcslen(szText) + 4;
+ cSaved = 0;
+ }
else {
TCHAR *p = &szText[iMaxLen - 1];
fEllipsis = true;
- while(p >= szText && *p != ' ')
+ while (p >= szText && *p != ' ')
p--;
if (p == szText)
p = szText + iMaxLen - 1;
@@ -568,8 +569,6 @@ void Utils::CreateColorMap(TCHAR *Text) for (i=0; i < RTF_CTABLE_DEFSIZE; i++)
rtf_ctable[i].index = 0;
- COLORREF default_color = (COLORREF)M.GetDword(FONTMODULE, "Font16Col", 0);
-
while (p2 && p2 < pEnd) {
if (_stscanf(p2, lpszFmt, &szRed, &szGreen, &szBlue) > 0) {
int i;
@@ -876,16 +875,12 @@ int Utils::mustPlaySound(const TWindowData *dat) return(dat->pContainer->dwFlagsEx & CNT_EX_SOUNDS_MINIMIZED ? 1 : 0);
// window in foreground
- if (fActiveWindow) {
- if (fActiveTab)
- return(dat->pContainer->dwFlagsEx & CNT_EX_SOUNDS_FOCUSED ? 1 : 0);
- else
- return(dat->pContainer->dwFlagsEx & CNT_EX_SOUNDS_INACTIVETABS ? 1 : 0);
- }
- else
+ if (!fActiveWindow)
return(dat->pContainer->dwFlagsEx & CNT_EX_SOUNDS_UNFOCUSED ? 1 : 0);
- return 1;
+ if (fActiveTab)
+ return(dat->pContainer->dwFlagsEx & CNT_EX_SOUNDS_FOCUSED ? 1 : 0);
+ return(dat->pContainer->dwFlagsEx & CNT_EX_SOUNDS_INACTIVETABS ? 1 : 0);
}
/////////////////////////////////////////////////////////////////////////////////////////
|