diff options
Diffstat (limited to 'plugins')
46 files changed, 739 insertions, 882 deletions
diff --git a/plugins/TabSRMM/src/ImageDataObject.cpp b/plugins/TabSRMM/src/ImageDataObject.cpp index 9d6b6f2ddf..c3965f02e3 100644 --- a/plugins/TabSRMM/src/ImageDataObject.cpp +++ b/plugins/TabSRMM/src/ImageDataObject.cpp @@ -43,7 +43,7 @@ extern void ImageDataInsertBitmap(IRichEditOle *ole, HBITMAP hBm) CImageDataObject::InsertBitmap(ole, hBm);
}
-int CacheIconToBMP(struct TLogIcon *theIcon, HICON hIcon, COLORREF backgroundColor, int sizeX, int sizeY)
+int CacheIconToBMP(TLogIcon *theIcon, HICON hIcon, COLORREF backgroundColor, int sizeX, int sizeY)
{
bool succeeded = false;
@@ -81,7 +81,7 @@ int CacheIconToBMP(struct TLogIcon *theIcon, HICON hIcon, COLORREF backgroundCol return TRUE;
}
-void DeleteCachedIcon(struct TLogIcon *theIcon)
+void DeleteCachedIcon(TLogIcon *theIcon)
{
DeleteDC(theIcon->hdcMem);
DeleteObject(theIcon->hBmp);
diff --git a/plugins/TabSRMM/src/TSButton.cpp b/plugins/TabSRMM/src/TSButton.cpp index c6a68d6877..55f5e781cc 100644 --- a/plugins/TabSRMM/src/TSButton.cpp +++ b/plugins/TabSRMM/src/TSButton.cpp @@ -166,7 +166,7 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint) bool fVSThemed = (!CSkin::m_skinEnabled && M.isVSThemed());
HANDLE hbp = 0;
- TWindowData *dat = (TWindowData *)GetWindowLongPtr(GetParent(ctl->hwnd), GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(GetParent(ctl->hwnd), GWLP_USERDATA);
GetClientRect(ctl->hwnd, const_cast<RECT *>(&rcClient));
CopyRect(&rcContent, &rcClient);
diff --git a/plugins/TabSRMM/src/buttonbar.h b/plugins/TabSRMM/src/buttonbar.h index 9be67e965b..c50b1dc76e 100644 --- a/plugins/TabSRMM/src/buttonbar.h +++ b/plugins/TabSRMM/src/buttonbar.h @@ -45,10 +45,10 @@ void CB_InitDefaultButtons(); void CB_ReInitCustomButtons();
/* MinGW doesn't like this struct declatations below */
-void BB_UpdateIcons(HWND hdlg,struct TWindowData *dat);
+void BB_UpdateIcons(HWND hdlg,TWindowData *dat);
void BB_RefreshTheme(const TWindowData *dat);
-void CB_DestroyAllButtons(HWND hwndDlg,struct TWindowData *dat);
-void CB_DestroyButton(HWND hwndDlg,struct TWindowData *dat,DWORD dwButtonCID,DWORD dwFlags);
-void CB_ChangeButton(HWND hwndDlg,struct TWindowData *dat,CustomButtonData* cbd);
+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);
#endif
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index 25e4d49fb5..58fed2cc7a 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -91,7 +91,7 @@ struct RemoveSettings { static int DBRemoveEnumProc(const char *szSetting, LPARAM lParam)
{
- struct RemoveSettings *rs = (struct RemoveSettings *)lParam;
+ RemoveSettings *rs = (RemoveSettings *)lParam;
if (!rs->szPrefix || !strncmp(szSetting, rs->szPrefix, strlen(rs->szPrefix))) {
rs->szSettings = (char **)realloc(rs->szSettings, (rs->count + 1) * sizeof(char *));
@@ -104,14 +104,14 @@ static int DBRemoveEnumProc(const char *szSetting, LPARAM lParam) static int Hlp_RemoveDatabaseSettings(HANDLE hContact, char *szModule, char *szPrefix)
{
DBCONTACTENUMSETTINGS dbces;
- struct RemoveSettings rs;
+ RemoveSettings rs;
int i, count;
- ZeroMemory(&rs, sizeof(struct RemoveSettings));
+ ZeroMemory(&rs, sizeof(RemoveSettings));
rs.szPrefix = szPrefix;
ZeroMemory(&dbces, sizeof(DBCONTACTENUMSETTINGS));
dbces.pfnEnumProc = DBRemoveEnumProc;
- dbces.lParam = (LPARAM)& rs;
+ dbces.lParam = (LPARAM)&rs;
dbces.szModule = szModule;
if (CallService(MS_DB_CONTACT_ENUMSETTINGS, (WPARAM)(HANDLE)hContact, (LPARAM)&dbces) == -1) {
@@ -166,7 +166,7 @@ void CB_DeInitCustomButtons() DestroyServiceFunction(hButtonsBarSetButtonState);
}
-void CB_DestroyAllButtons(HWND hwndDlg, struct TWindowData *dat)
+void CB_DestroyAllButtons(HWND hwndDlg, TWindowData *dat)
{
int i;
HWND hwndBtn = NULL;
@@ -187,7 +187,7 @@ void CB_DestroyAllButtons(HWND hwndDlg, struct TWindowData *dat) }
}
-void CB_DestroyButton(HWND hwndDlg, struct TWindowData *dat, DWORD dwButtonCID, DWORD dwFlags)
+void CB_DestroyButton(HWND hwndDlg, TWindowData *dat, DWORD dwButtonCID, DWORD dwFlags)
{
HWND hwndBtn = GetDlgItem(hwndDlg, dwButtonCID);
RECT rc = {0};
@@ -203,7 +203,7 @@ void CB_DestroyButton(HWND hwndDlg, struct TWindowData *dat, DWORD dwButtonCID, }
}
-void CB_ChangeButton(HWND hwndDlg, struct TWindowData *dat, CustomButtonData* cbd)
+void CB_ChangeButton(HWND hwndDlg, TWindowData *dat, CustomButtonData* cbd)
{
HWND hwndBtn = GetDlgItem(hwndDlg, cbd->dwButtonCID);
if (hwndBtn) {
@@ -489,7 +489,7 @@ static INT_PTR CB_ModifyButton(WPARAM wParam, LPARAM lParam) return 0;
}
-void BB_UpdateIcons(HWND hdlg, struct TWindowData *dat)
+void BB_UpdateIcons(HWND hdlg, TWindowData *dat)
{
int i;
HWND hwndBtn = NULL;
@@ -798,7 +798,7 @@ BOOL TSAPI BB_SetButtonsPos(TWindowData *dat) return EndDeferWindowPos(hdwp);
}
-void TSAPI BB_CustomButtonClick(struct TWindowData *dat, DWORD idFrom, HWND hwndFrom, BOOL code)
+void TSAPI BB_CustomButtonClick(TWindowData *dat, DWORD idFrom, HWND hwndFrom, BOOL code)
{
RECT rc;
int i;
diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp index deb7bae5b8..37930006af 100644 --- a/plugins/TabSRMM/src/chat/log.cpp +++ b/plugins/TabSRMM/src/chat/log.cpp @@ -963,7 +963,7 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedr SCROLLINFO scroll;
WPARAM wp;
HWND hwndRich;
- TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (hwndDlg == 0 || lin == 0 || si == 0 || dat == 0)
return;
@@ -996,7 +996,7 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedr //set the insertion point at the bottom
sel.cpMin = sel.cpMax = GetRichTextLength(hwndRich);
- SendMessage(hwndRich, EM_EXSETSEL, 0, (LPARAM)& sel);
+ SendMessage(hwndRich, EM_EXSETSEL, 0, (LPARAM)&sel);
// fix for the indent... must be a M$ bug
if (sel.cpMax == 0)
@@ -1020,7 +1020,7 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedr // stream in the event(s)
streamData.lin = lin;
streamData.bRedraw = bRedraw;
- SendMessage(hwndRich, EM_STREAMIN, wp, (LPARAM)& stream);
+ SendMessage(hwndRich, EM_STREAMIN, wp, (LPARAM)&stream);
//SendMessage(hwndRich, EM_EXGETSEL, 0, (LPARAM)&newsel);
@@ -1150,7 +1150,7 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedr // do we need to restore the selection
if (oldsel.cpMax != oldsel.cpMin) {
- SendMessage(hwndRich, EM_EXSETSEL, 0, (LPARAM)& oldsel);
+ SendMessage(hwndRich, EM_EXSETSEL, 0, (LPARAM)&oldsel);
SendMessage(hwndRich, WM_SETREDRAW, TRUE, 0);
InvalidateRect(hwndRich, NULL, TRUE);
}
@@ -1158,7 +1158,7 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedr // need to invalidate the window
if (bFlag) {
sel.cpMin = sel.cpMax = GetRichTextLength(hwndRich);
- SendMessage(hwndRich, EM_EXSETSEL, 0, (LPARAM)& sel);
+ SendMessage(hwndRich, EM_EXSETSEL, 0, (LPARAM)&sel);
SendMessage(hwndRich, WM_SETREDRAW, TRUE, 0);
InvalidateRect(hwndRich, NULL, TRUE);
}
diff --git a/plugins/TabSRMM/src/chat/manager.cpp b/plugins/TabSRMM/src/chat/manager.cpp index 86aed75e95..986cabdc47 100644 --- a/plugins/TabSRMM/src/chat/manager.cpp +++ b/plugins/TabSRMM/src/chat/manager.cpp @@ -97,7 +97,6 @@ int SM_RemoveSession(const TCHAR* pszID, const char* pszModule, bool removeConta SESSION_INFO* pTemp = s_WndList, *pLast = NULL;
while (pTemp != NULL) {
if ((!pszID && pTemp->iType != GCW_SERVER || !lstrcmpi(pTemp->ptszID, pszID)) && !lstrcmpiA(pTemp->pszModule, pszModule)) { // match
- COMMAND_INFO *pCurComm;
DWORD dw = pTemp->dwItemData;
if (pTemp->hWnd)
@@ -116,11 +115,9 @@ int SM_RemoveSession(const TCHAR* pszID, const char* pszModule, bool removeConta pTemp->iStatusCount = 0;
pTemp->nUsersInNicklist = 0;
- if (pTemp->hContact) {
+ if (pTemp->hContact)
CList_SetOffline(pTemp->hContact, pTemp->iType == GCW_CHATROOM ? TRUE : FALSE);
- //if (pTemp->iType != GCW_SERVER)
- //db_set_b(0, pTemp->hContact, "CList", "Hidden", 1);
- }
+
db_set_s(pTemp->hContact, pTemp->pszModule , "Topic", "");
db_set_s(pTemp->hContact, pTemp->pszModule, "StatusBar", "");
db_unset(pTemp->hContact, "CList", "StatusMsg");
@@ -137,7 +134,7 @@ int SM_RemoveSession(const TCHAR* pszID, const char* pszModule, bool removeConta mir_free(pTemp->pszName);
// delete commands
- pCurComm = pTemp->lpCommands;
+ COMMAND_INFO *pCurComm = pTemp->lpCommands;
while (pCurComm != NULL) {
COMMAND_INFO *pNext = pCurComm->next;
mir_free(pCurComm->lpCommand);
diff --git a/plugins/TabSRMM/src/chat/message.cpp b/plugins/TabSRMM/src/chat/message.cpp index c681cf49a9..8a564fb0e7 100644 --- a/plugins/TabSRMM/src/chat/message.cpp +++ b/plugins/TabSRMM/src/chat/message.cpp @@ -328,6 +328,6 @@ char* Chat_Message_GetFromStream(HWND hwndDlg, SESSION_INFO *si) stream.dwCookie = (DWORD_PTR) & pszText; // pass pointer to pointer
dwFlags = SF_RTFNOOBJS | SFF_PLAINRTF | SF_USECODEPAGE | (CP_UTF8 << 16);
- SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_STREAMOUT, dwFlags, (LPARAM)& stream);
+ SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_STREAMOUT, dwFlags, (LPARAM)&stream);
return pszText; // pszText contains the text
}
diff --git a/plugins/TabSRMM/src/chat/muchighlight.cpp b/plugins/TabSRMM/src/chat/muchighlight.cpp index c860988b25..c0d11ae716 100644 --- a/plugins/TabSRMM/src/chat/muchighlight.cpp +++ b/plugins/TabSRMM/src/chat/muchighlight.cpp @@ -300,7 +300,7 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L Utils::enableDlgControl(hwndDlg, IDC_HIGHLIGHTME,
::IsDlgButtonChecked(hwndDlg, IDC_HIGHLIGHTTEXTENABLE) ? TRUE : FALSE);
- return(FALSE);
+ return FALSE;
case WM_COMMAND:
if ((LOWORD(wParam) == IDC_HIGHLIGHTNICKPATTERN
@@ -351,7 +351,7 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L }
break;
}
- return(FALSE);
+ return FALSE;
}
/**
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp index 4e06c0ff24..2f042a249e 100644 --- a/plugins/TabSRMM/src/chat/options.cpp +++ b/plugins/TabSRMM/src/chat/options.cpp @@ -39,7 +39,8 @@ #define FONTF_BOLD 1
#define FONTF_ITALIC 2
-struct FontOptionsList {
+struct FontOptionsList
+{
TCHAR* szDescr;
COLORREF defColour;
TCHAR* szDefFace;
@@ -51,7 +52,8 @@ struct FontOptionsList { char size;
};
-struct ColorOptionsList {
+struct ColorOptionsList
+{
int order;
TCHAR* tszGroup;
TCHAR* tszName;
@@ -167,7 +169,7 @@ struct branch_t { BYTE bDefault;
HTREEITEM hItem;
};
-static struct branch_t branch1[] = {
+static branch_t branch1[] = {
{LPGENT("Open new chat rooms in the default container"), "DefaultContainer", 0, 1, NULL},
{LPGENT("Flash window when someone speaks"), "FlashWindow", 0, 0, NULL},
{LPGENT("Flash window when a word is highlighted"), "FlashWindowHighlight", 0, 1, NULL},
@@ -192,7 +194,7 @@ static struct branch_t branch1[] = { {LPGENT("Use alternative sorting method in member list"), "AlternativeSorting", 0, 1, NULL},
};
-static struct branch_t branch2[] = {
+static branch_t branch2[] = {
{LPGENT("Prefix all events with a timestamp"), "ShowTimeStamp", 0, 1, NULL},
{LPGENT("Timestamp only when event time differs"), "ShowTimeStampIfChanged", 0, 0, NULL},
{LPGENT("Timestamp has same color as the event"), "TimeStampEventColour", 0, 0, NULL},
@@ -222,7 +224,7 @@ void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szM DBVARIANT dbv;
int j = (i >= 100 ? i - 100 : i);
- struct FontOptionsList *fol = fontOptionsList;
+ FontOptionsList *fol = fontOptionsList;
switch (section) {
case FONTSECTION_CHAT: fol = CHAT_fontOptionsList; break;
case FONTSECTION_IM: fol = IM_fontOptionsList; break;
@@ -287,7 +289,7 @@ static HTREEITEM InsertBranch(HWND hwndTree, TCHAR* pszDescr, BOOL bExpanded) return TreeView_InsertItem(hwndTree, &tvis);
}
-static void FillBranch(HWND hwndTree, HTREEITEM hParent, struct branch_t *branch, int nValues, DWORD defaultval)
+static void FillBranch(HWND hwndTree, HTREEITEM hParent, branch_t *branch, int nValues, DWORD defaultval)
{
if (hParent == 0)
return;
@@ -310,7 +312,7 @@ static void FillBranch(HWND hwndTree, HTREEITEM hParent, struct branch_t *branch }
}
-static void SaveBranch(HWND hwndTree, struct branch_t *branch, int nValues)
+static void SaveBranch(HWND hwndTree, branch_t *branch, int nValues)
{
TVITEM tvi;
BYTE bChecked;
diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp index 5eba351bc9..4af30980bb 100644 --- a/plugins/TabSRMM/src/chat/services.cpp +++ b/plugins/TabSRMM/src/chat/services.cpp @@ -470,7 +470,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT item.mask = TCIF_PARAM;
TabCtrl_GetItem(hwndTab, i, &item);
HWND hwnd = (HWND)item.lParam;
- TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (dat) {
int relPos = M.GetDword(dat->hContact, "tabindex", i * 100);
if (iTabIndex_wanted <= relPos)
@@ -490,9 +490,9 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT pContainer->iChilds++;
newData.bWantPopup = bWantPopup;
newData.hdbEvent = (HANDLE)si;
- HWND hwndNew = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CHANNEL), GetDlgItem(pContainer->hwnd, 1159), RoomWndProc, (LPARAM)& newData);
+ HWND hwndNew = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CHANNEL), GetDlgItem(pContainer->hwnd, 1159), RoomWndProc, (LPARAM)&newData);
if (pContainer->dwFlags & CNT_SIDEBAR) {
- TWindowData *dat = (TWindowData *)GetWindowLongPtr(hwndNew, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndNew, GWLP_USERDATA);
if (dat)
pContainer->SideBar->addSession(dat, pContainer->iTabIndex);
}
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index f3157bd33f..835f1acc60 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -1,7 +1,4 @@ /*
- * astyle --force-indent=tab=4 --brackets=linux --indent-switches
- * --pad=oper --one-line=keep-blocks --unpad=paren
- *
* Miranda NG: the free IM client for Microsoft* Windows*
*
* Copyright 2000-2009 Miranda ICQ/IM project,
@@ -39,7 +36,6 @@ int GetRichTextLength(HWND hwnd)
{
GETTEXTLENGTHEX gtl;
-
gtl.flags = GTL_PRECISE;
gtl.codepage = CP_ACP ;
return (int) SendMessage(hwnd, EM_GETTEXTLENGTHEX, (WPARAM)>l, 0);
@@ -67,7 +63,8 @@ TCHAR* RemoveFormatting(const TCHAR* pszWord, bool fToLower, bool fStripCR, TCHA if (0 == buf) {
szTemp = _szTemp;
_buflen = 20000;
- } else {
+ }
+ else {
szTemp = buf;
_buflen = len;
szTemp[len - 1] = 0;
@@ -292,7 +289,7 @@ static BOOL DoTrayIcon(SESSION_INFO *si, GCEVENT *gce) return TRUE;
}
-static BOOL DoPopup(SESSION_INFO *si, GCEVENT* gce, struct TWindowData *dat)
+static BOOL DoPopup(SESSION_INFO *si, GCEVENT* gce, TWindowData *dat)
{
int iEvent = gce->pDest->iType;
TContainerData *pContainer = dat ? dat->pContainer : NULL;
@@ -1157,15 +1154,13 @@ TCHAR* a2tf(const TCHAR* str, int flags, DWORD cp) void Chat_SetFilters(SESSION_INFO *si)
{
- DWORD dwFlags_default = 0, dwMask = 0, dwFlags_local = 0;
- int i;
-
if (si == NULL)
return;
- dwFlags_default = M.GetDword("Chat", "FilterFlags", 0x03E0);
- dwFlags_local = db_get_dw(si->hContact, "Chat", "FilterFlags", 0x03E0);
- dwMask = db_get_dw(si->hContact, "Chat", "FilterMask", 0);
+ int i;
+ DWORD dwFlags_default = M.GetDword("Chat", "FilterFlags", 0x03E0);
+ DWORD dwFlags_local = db_get_dw(si->hContact, "Chat", "FilterFlags", 0x03E0);
+ DWORD dwMask = db_get_dw(si->hContact, "Chat", "FilterMask", 0);
si->iLogFilterFlags = dwFlags_default;
for (int i=0; i < 32; i++)
@@ -1177,25 +1172,22 @@ void Chat_SetFilters(SESSION_INFO *si) dwMask = db_get_dw(si->hContact, "Chat", "PopupMask", 0);
si->iLogPopupFlags = dwFlags_default;
- for (i=0; i < 32; i++) {
+ for (i=0; i < 32; i++)
if (dwMask & (1 << i))
si->iLogPopupFlags = (dwFlags_local & (1 << i) ? si->iLogPopupFlags | (1 << i) : si->iLogPopupFlags & ~(1 << i));
- }
dwFlags_default = M.GetDword("Chat", "TrayIconFlags", 0x03E0);
dwFlags_local = db_get_dw(si->hContact, "Chat", "TrayIconFlags", 0x03E0);
dwMask = db_get_dw(si->hContact, "Chat", "TrayIconMask", 0);
si->iLogTrayFlags = dwFlags_default;
- for (i=0; i < 32; i++) {
+ for (i=0; i < 32; i++)
if (dwMask & (1 << i))
si->iLogTrayFlags = (dwFlags_local & (1 << i) ? si->iLogTrayFlags | (1 << i) : si->iLogTrayFlags & ~(1 << i));
- }
dwFlags_default = M.GetDword("Chat", "DiskLogFlags", 0xFFFF);
si->iDiskLogFlags = dwFlags_default;
-
if (si->iLogFilterFlags == 0)
si->bFilterEnabled = 0;
}
@@ -1204,12 +1196,6 @@ static TCHAR tszOldTimeStamp[30] = _T("\0"); TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime)
{
- REPLACEVARSARRAY rva[11];
- REPLACEVARSDATA dat = {0};
- TCHAR *p = 0, *tszParsedName = 0;
- int i;
- bool fReparse = false;
-
if (!tTime)
time(&tTime);
@@ -1220,13 +1206,15 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime) TCHAR *tszNow = MakeTimeStamp(_T("%a%d%m%Y"), tTime);
+ bool fReparse = false;
if (_tcscmp(tszOldTimeStamp, tszNow)) {
- _tcsncpy(tszOldTimeStamp, tszNow, 30);
- tszOldTimeStamp[29] = 0;
- fReparse = true;
+ _tcsncpy(tszOldTimeStamp, tszNow, 30);
+ tszOldTimeStamp[29] = 0;
+ fReparse = true;
}
if (fReparse || 0 == si->pszLogFileName[0]) {
+ REPLACEVARSARRAY rva[11];
rva[0].lptzKey = _T("d");
rva[0].lptzValue = mir_tstrdup(MakeTimeStamp(_T("%#d"), tTime));
// day 01-31
@@ -1263,11 +1251,11 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime) if (g_Settings.pszLogDir[lstrlen(g_Settings.pszLogDir)-1] == '\\')
_tcscat(g_Settings.pszLogDir, _T("%userid%.log"));
- dat.cbSize = sizeof(dat);
- dat.dwFlags = RVF_TCHAR;
- dat.hContact = si->hContact;
+ REPLACEVARSDATA dat = { sizeof(dat) };
+ dat.dwFlags = RVF_TCHAR;
+ dat.hContact = si->hContact;
dat.variables = rva;
- tszParsedName = (TCHAR*) CallService(MS_UTILS_REPLACEVARS, (WPARAM)g_Settings.pszLogDir, (LPARAM)&dat);
+ TCHAR *tszParsedName = (TCHAR*)CallService(MS_UTILS_REPLACEVARS, (WPARAM)g_Settings.pszLogDir, (LPARAM)&dat);
if (!M.pathIsAbsolute(tszParsedName))
mir_sntprintf(si->pszLogFileName, MAX_PATH, _T("%s%s"), M.getChatLogPath(), tszParsedName);
@@ -1276,13 +1264,12 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime) mir_free(tszParsedName);
- for (i=0; i < SIZEOF(rva);i++)
+ for (int i=0; i < SIZEOF(rva);i++)
mir_free(rva[i].lptzValue);
- for (p = si->pszLogFileName + 2; *p; ++p) {
+ for (TCHAR *p = si->pszLogFileName + 2; *p; ++p)
if (*p == ':' || *p == '*' || *p == '?' || *p == '"' || *p == '<' || *p == '>' || *p == '|' )
*p = _T('_');
- }
}
return si->pszLogFileName;
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index e6590138ef..1c1d5c0b11 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -36,9 +36,6 @@ #include "..\commonheaders.h"
-
-//#include "../m_MathModule.h"
-
// externs...
extern LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
extern HRESULT(WINAPI *MyCloseThemeData)(HANDLE);
@@ -46,7 +43,6 @@ extern REOLECallback *mREOLECallback; int g_cLinesPerPage=0;
int g_iWheelCarryover=0;
-//
extern HBRUSH hListBkgBrush;
extern HANDLE hSendEvent;
@@ -56,7 +52,7 @@ extern HMENU g_hMenu; static HKL hkl = NULL;
static HCURSOR hCurHyperlinkHand;
-typedef struct
+struct MESSAGESUBDATA
{
time_t lastEnterTime;
TCHAR* szSearchQuery;
@@ -64,7 +60,7 @@ typedef struct SESSION_INFO *lastSession;
TCHAR szTabSave[20];
BOOL iSavedSpaces;
-} MESSAGESUBDATA;
+};
static const CLSID IID_ITextDocument= { 0x8CC497C0,0xA1DF,0x11CE, { 0x80,0x98, 0x00,0xAA, 0x00,0x47,0xBE,0x5D} };
@@ -97,14 +93,15 @@ static void Chat_SetMessageLog(TWindowData *dat) iee.hContact = dat->hContact;
iee.codepage = dat->codePage;
- SESSION_INFO *si = (SESSION_INFO*)dat->si;
+ 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) {
+ }
+ else if (iLogMode == WANT_HPP_LOG && dat->hwndHPP == 0) {
IEVIEWWINDOW ieWindow;
ZeroMemory(&ieWindow, sizeof(ieWindow));
@@ -122,7 +119,8 @@ static void Chat_SetMessageLog(TWindowData *dat) dat->hwndHPP = ieWindow.hwnd;
Utils::showDlgControl(dat->hwnd, IDC_CHAT_LOG, SW_HIDE);
Utils::enableDlgControl(dat->hwnd, IDC_CHAT_LOG, FALSE);
- } else {
+ }
+ else {
if (iLogMode != WANT_IEVIEW_LOG)
CheckAndDestroyIEView(dat);
Utils::showDlgControl(dat->hwnd, IDC_CHAT_LOG, SW_SHOW);
@@ -133,11 +131,11 @@ static void Chat_SetMessageLog(TWindowData *dat) }
}
-
/*
* checking if theres's protected text at the point
* emulates EN_LINK WM_NOTIFY to parent to process links
*/
+
static BOOL CheckCustomLink(HWND hwndDlg, POINT* ptClient, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL bUrlNeeded)
{
long res = 0, cnt = 0;
@@ -212,24 +210,17 @@ static BOOL CheckCustomLink(HWND hwndDlg, POINT* ptClient, UINT uMsg, WPARAM wPa return bIsCustomLink;
}
-static BOOL IsStringValidLink(TCHAR* pszText)
+static bool IsStringValidLink(TCHAR* pszText)
{
- TCHAR *p = pszText;
-
if (pszText == NULL)
- return FALSE;
- if (lstrlen(pszText) < 5)
- return FALSE;
+ return false;
+ if (lstrlen(pszText) < 5 || _tcschr(pszText, '"'))
+ return false;
- while (*p) {
- if (*p == (TCHAR)'"')
- return FALSE;
- p++;
- }
if (_totlower(pszText[0]) == 'w' && _totlower(pszText[1]) == 'w' && _totlower(pszText[2]) == 'w' && pszText[3] == '.' && _istalnum(pszText[4]))
- return TRUE;
+ return true;
- return(_tcsstr(pszText, _T("://")) == NULL ? FALSE : TRUE);
+ return _tcsstr(pszText, _T("://")) != NULL;
}
/*
@@ -244,7 +235,7 @@ static void Chat_UpdateWindowState(TWindowData *dat, UINT msg) HWND hwndDlg = dat->hwnd;
HWND hwndTab = GetParent(hwndDlg);
- SESSION_INFO *si = (SESSION_INFO*)dat->si;
+ SESSION_INFO *si = dat->si;
if (msg == WM_ACTIVATE) {
if (dat->pContainer->dwFlags & CNT_TRANSPARENCY && CMimAPI::m_pSetLayeredWindowAttributes != NULL) {
@@ -395,21 +386,18 @@ static int RoomWndResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *urc) {
RECT rc, rcTabs;
SESSION_INFO *si = (SESSION_INFO*)lParam;
- struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- int TabHeight;
- BOOL bToolbar = !(dat->pContainer->dwFlags & CNT_HIDETOOLBAR);
- BOOL bBottomToolbar = dat->pContainer->dwFlags & CNT_BOTTOMTOOLBAR ? 1 : 0;
- int panelHeight = dat->Panel->getHeight() + 1;
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- BOOL bNick = si->iType != GCW_SERVER && si->bNicklistEnabled;
- int i = 0;
- static int msgBottom = 0, msgTop = 0;
- bool fInfoPanel = dat->Panel->isActive();
+ bool bToolbar = !(dat->pContainer->dwFlags & CNT_HIDETOOLBAR);
+ bool bBottomToolbar = dat->pContainer->dwFlags & CNT_BOTTOMTOOLBAR ? 1 : 0;
+ bool bNick = si->iType != GCW_SERVER && si->bNicklistEnabled;
+ bool bInfoPanel = dat->Panel->isActive();
+ int panelHeight = dat->Panel->getHeight() + 1;
rc.bottom = rc.top = rc.left = rc.right = 0;
GetClientRect(hwndDlg, &rcTabs);
- TabHeight = rcTabs.bottom - rcTabs.top;
+ int TabHeight = rcTabs.bottom - rcTabs.top;
if (dat->fIsAutosizingInput)
Utils::showDlgControl(hwndDlg, IDC_SPLITTERY, SW_HIDE);
@@ -447,8 +435,8 @@ static int RoomWndResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *urc) urc->rcItem.top = 0;
urc->rcItem.left = 0;
urc->rcItem.right = bNick ? urc->dlgNewSize.cx - si->iSplitterX : urc->dlgNewSize.cx;
- urc->rcItem.bottom = (bToolbar&&!bBottomToolbar) ? (urc->dlgNewSize.cy - si->iSplitterY - (PluginConfig.g_DPIscaleY > 1.0 ? DPISCALEY_S(24) : DPISCALEY_S(23))) : (urc->dlgNewSize.cy - si->iSplitterY - DPISCALEY_S(2));
- if (fInfoPanel)
+ urc->rcItem.bottom = (bToolbar && !bBottomToolbar) ? (urc->dlgNewSize.cy - si->iSplitterY - (PluginConfig.g_DPIscaleY > 1.0 ? DPISCALEY_S(24) : DPISCALEY_S(23))) : (urc->dlgNewSize.cy - si->iSplitterY - DPISCALEY_S(2));
+ if (bInfoPanel)
urc->rcItem.top += panelHeight;
if (CSkin::m_skinEnabled) {
CSkinItem *item = &SkinItems[ID_EXTBKHISTORY];
@@ -465,8 +453,8 @@ static int RoomWndResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *urc) urc->rcItem.top = 0;
urc->rcItem.right = urc->dlgNewSize.cx ;
urc->rcItem.left = urc->dlgNewSize.cx - si->iSplitterX + 2;
- urc->rcItem.bottom = (bToolbar&&!bBottomToolbar) ? (urc->dlgNewSize.cy - si->iSplitterY - DPISCALEY_S(23)) : (urc->dlgNewSize.cy - si->iSplitterY - DPISCALEY_S(2));
- if (fInfoPanel)
+ urc->rcItem.bottom = (bToolbar && !bBottomToolbar) ? (urc->dlgNewSize.cy - si->iSplitterY - DPISCALEY_S(23)) : (urc->dlgNewSize.cy - si->iSplitterY - DPISCALEY_S(2));
+ if (bInfoPanel)
urc->rcItem.top += panelHeight;
if (CSkin::m_skinEnabled) {
CSkinItem *item = &SkinItems[ID_EXTBKUSERLIST];
@@ -482,16 +470,16 @@ static int RoomWndResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *urc) case IDC_SPLITTERX:
urc->rcItem.right = urc->dlgNewSize.cx - si->iSplitterX + 2;
urc->rcItem.left = urc->dlgNewSize.cx - si->iSplitterX;
- urc->rcItem.bottom = (bToolbar&&!bBottomToolbar) ? (urc->dlgNewSize.cy - si->iSplitterY - DPISCALEY_S(23)) : (urc->dlgNewSize.cy - si->iSplitterY - DPISCALEY_S(2));
+ urc->rcItem.bottom = (bToolbar && !bBottomToolbar) ? (urc->dlgNewSize.cy - si->iSplitterY - DPISCALEY_S(23)) : (urc->dlgNewSize.cy - si->iSplitterY - DPISCALEY_S(2));
urc->rcItem.top = 0;
- if (fInfoPanel)
+ if (bInfoPanel)
urc->rcItem.top += panelHeight;
return RD_ANCHORX_CUSTOM | RD_ANCHORY_CUSTOM;
case IDC_SPLITTERY:
urc->rcItem.right = urc->dlgNewSize.cx;
- urc->rcItem.top = (bToolbar&&!bBottomToolbar) ? urc->dlgNewSize.cy - si->iSplitterY : urc->dlgNewSize.cy - si->iSplitterY;
- urc->rcItem.bottom = (bToolbar&&!bBottomToolbar) ? (urc->dlgNewSize.cy - si->iSplitterY + DPISCALEY_S(2)) : (urc->dlgNewSize.cy - si->iSplitterY + DPISCALEY_S(2));
+ urc->rcItem.top = (bToolbar && !bBottomToolbar) ? urc->dlgNewSize.cy - si->iSplitterY : urc->dlgNewSize.cy - si->iSplitterY;
+ urc->rcItem.bottom = (bToolbar && !bBottomToolbar) ? (urc->dlgNewSize.cy - si->iSplitterY + DPISCALEY_S(2)) : (urc->dlgNewSize.cy - si->iSplitterY + DPISCALEY_S(2));
urc->rcItem.left = 0;
urc->rcItem.bottom++;
urc->rcItem.top++;
@@ -501,13 +489,11 @@ static int RoomWndResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *urc) urc->rcItem.right = urc->dlgNewSize.cx ;
urc->rcItem.top = urc->dlgNewSize.cy - si->iSplitterY + 3;
urc->rcItem.bottom = urc->dlgNewSize.cy; // - 1 ;
- msgBottom = urc->rcItem.bottom;
if (dat->fIsAutosizingInput)
urc->rcItem.top -= DPISCALEY_S(1);
- msgTop = urc->rcItem.top;
- if (bBottomToolbar&&bToolbar)
+ if (bBottomToolbar && bToolbar)
urc->rcItem.bottom -= DPISCALEY_S(22);
if (CSkin::m_skinEnabled) {
CSkinItem *item = &SkinItems[ID_EXTBKINPUTAREA];
@@ -621,7 +607,7 @@ LBL_SkipEnd: static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
HWND hwndParent = GetParent(hwnd);
- TWindowData *mwdat = (struct TWindowData *)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
+ TWindowData *mwdat = (TWindowData*)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
SESSION_INFO *Parentsi = (SESSION_INFO*)mwdat->si;
MESSAGESUBDATA *dat = (MESSAGESUBDATA *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
@@ -662,7 +648,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, EnableMenuItem(hSubMenu, IDM_PASTEFORMATTED, MF_BYCOMMAND | ((mi && mi->bBold) ? MF_ENABLED : MF_GRAYED));
TranslateMenu(hSubMenu);
- SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)& sel);
+ SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)&sel);
if (sel.cpMin == sel.cpMax) {
EnableMenuItem(hSubMenu, IDM_COPY, MF_BYCOMMAND | MF_GRAYED);
if (idFrom == IDC_CHAT_MESSAGE)
@@ -697,12 +683,12 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, SendMessage(hwnd, EM_PASTESPECIAL, (iSelection == IDM_PASTE) ? CF_UNICODETEXT : 0, 0);
break;
case IDM_COPYALL:
- SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)& all);
+ SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)&all);
SendMessage(hwnd, WM_COPY, 0, 0);
- SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)& sel);
+ SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)&sel);
break;
case IDM_SELECTALL:
- SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)& all);
+ SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)&all);
break;
}
DestroyMenu(hMenu);
@@ -739,12 +725,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, if ((wParam >= '0' && wParam <= '9') && (GetKeyState(VK_MENU) & 0x8000)) { // ALT-1 -> ALT-0 direct tab selection
BYTE bChar = (BYTE)wParam;
- int iIndex;
-
- if (bChar == '0')
- iIndex = 10;
- else
- iIndex = bChar - (BYTE)'0';
+ int iIndex = (bChar == '0') ? 10 : bChar - (BYTE)'0';
SendMessage(mwdat->pContainer->hwnd, DM_SELECTTAB, DM_SELECT_BY_INDEX, (LPARAM)iIndex);
return 0;
}
@@ -1170,11 +1151,10 @@ static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP case WM_CLOSE:
if (wParam == 1 && lParam == 1) {
int iFlags = 0, i;
- UINT result;
DWORD dwMask = 0, dwFlags = 0;
for (i=0; i < SIZEOF(_eventorder); i++) {
- result = IsDlgButtonChecked(hwndDlg, IDC_1 + i);
+ int result = IsDlgButtonChecked(hwndDlg, IDC_1 + i);
dwMask |= (result != BST_INDETERMINATE ? _eventorder[i] : 0);
iFlags |= (result == BST_CHECKED ? _eventorder[i] : 0);
}
@@ -1196,7 +1176,7 @@ static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP dwMask = iFlags = 0;
for (i=0; i < SIZEOF(_eventorder); i++) {
- result = IsDlgButtonChecked(hwndDlg, IDC_P1 + i);
+ int result = IsDlgButtonChecked(hwndDlg, IDC_P1 + i);
dwMask |= (result != BST_INDETERMINATE ? _eventorder[i] : 0);
iFlags |= (result == BST_CHECKED ? _eventorder[i] : 0);
}
@@ -1218,7 +1198,7 @@ static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP dwMask = iFlags = 0;
for (i=0; i < SIZEOF(_eventorder); i++) {
- result = IsDlgButtonChecked(hwndDlg, IDC_T1 + i);
+ int result = IsDlgButtonChecked(hwndDlg, IDC_T1 + i);
dwMask |= (result != BST_INDETERMINATE ? _eventorder[i] : 0);
iFlags |= (result == BST_CHECKED ? _eventorder[i] : 0);
}
@@ -1242,11 +1222,12 @@ static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP }
DestroyWindow(hwndDlg);
break;
+
case WM_DESTROY:
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
break;
}
- return(FALSE);
+ return FALSE;
}
/**
@@ -1284,7 +1265,7 @@ static LRESULT CALLBACK ButtonSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, L static LRESULT CALLBACK LogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
HWND hwndParent = GetParent(hwnd);
- struct TWindowData *mwdat = (struct TWindowData *)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
+ TWindowData *mwdat = (TWindowData*)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
switch (msg) {
case WM_NCCALCSIZE:
@@ -1311,14 +1292,14 @@ static LRESULT CALLBACK LogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR case WM_RBUTTONDOWN:
case WM_RBUTTONDBLCLK:
if (g_Settings.bClickableNicks) {
- POINT pt={LOWORD(lParam), HIWORD(lParam)};
+ POINT pt = { LOWORD(lParam), HIWORD(lParam) };
CheckCustomLink(hwnd, &pt, msg, wParam, lParam, TRUE);
}
break;
case WM_LBUTTONUP:
if (g_Settings.bClickableNicks) {
- POINT pt={LOWORD(lParam), HIWORD(lParam)};
+ POINT pt = { LOWORD(lParam), HIWORD(lParam) };
CheckCustomLink(hwnd, &pt, msg, wParam, lParam, TRUE);
}
if (M.GetByte("autocopy", 1)) {
@@ -1327,7 +1308,7 @@ static LRESULT CALLBACK LogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR if (sel.cpMin != sel.cpMax) {
SendMessage(hwnd, WM_COPY, 0, 0);
sel.cpMin = sel.cpMax ;
- SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)& sel);
+ SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)&sel);
SetFocus(GetDlgItem(hwndParent, IDC_CHAT_MESSAGE));
}
}
@@ -1370,7 +1351,7 @@ static LRESULT CALLBACK LogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)&sel);
if (sel.cpMin != sel.cpMax) {
sel.cpMin = sel.cpMax ;
- SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)& sel);
+ SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)&sel);
}
}
break;
@@ -1418,11 +1399,11 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, POINT * pt, SESS bool bNewTip = false;
if (!hwndToolTip) {
+ bNewTip = true;
hwndToolTip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, NULL,
WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
hwnd, NULL, g_hInst, NULL);
- bNewTip = true;
}
RECT clientRect;
@@ -1467,7 +1448,7 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, POINT * pt, SESS static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
HWND hwndParent = GetParent(hwnd);
- struct TWindowData *mwdat = (struct TWindowData *)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
+ TWindowData *mwdat = (TWindowData*)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
static BOOL isToolTip = NULL;
static int currentHovered = -1;
@@ -1488,8 +1469,8 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, case WM_ERASEBKGND:
{
HDC dc = (HDC)wParam;
- struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
- SESSION_INFO *parentdat = (SESSION_INFO*)dat->si;
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
+ SESSION_INFO *parentdat = dat->si;
if (dc) {
int index = SendMessage(hwnd, LB_GETTOPINDEX, 0, 0);
if (index == LB_ERR || parentdat->nUsersInNicklist <= 0)
@@ -1581,7 +1562,8 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, si->szSearch[0] = 0;
si->iSearchItem = -1;
break;
- } else if (wParam == '\b' && si->szSearch[0]) // backspace
+ }
+ if (wParam == '\b' && si->szSearch[0]) // backspace
si->szSearch[lstrlen(si->szSearch) - 1] = '\0';
else if (wParam < ' ')
break;
@@ -1596,17 +1578,13 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, _tcscat(si->szSearch, szNew);
}
if (si->szSearch[0]) {
- int iItems = SendMessage(hwnd, LB_GETCOUNT, 0, 0);
- int i;
- USERINFO *ui;
-
/*
* iterate over the (sorted) list of nicknames and search for the
* string we have
*/
-
+ int i, iItems = SendMessage(hwnd, LB_GETCOUNT, 0, 0);
for (i=0; i < iItems; i++) {
- ui = UM_FindUserFromIndex(si->pUsers, i);
+ USERINFO *ui = UM_FindUserFromIndex(si->pUsers, i);
if (ui) {
if (!_tcsnicmp(ui->pszNick, si->szSearch, lstrlen(si->szSearch))) {
SendMessage(hwnd, LB_SETSEL, FALSE, -1);
@@ -1657,13 +1635,11 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, case WM_CONTEXTMENU:
{
- TVHITTESTINFO hti;
- int item;
- int height;
- USERINFO *ui;
- struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
- SESSION_INFO *parentdat = (SESSION_INFO*)dat->si;
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
+ SESSION_INFO *parentdat = dat->si;
+ int height;
+ TVHITTESTINFO hti;
hti.pt.x = (short) LOWORD(lParam);
hti.pt.y = (short) HIWORD(lParam);
if (hti.pt.x == -1 && hti.pt.y == -1) {
@@ -1672,46 +1648,44 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, height = SendMessage(hwnd, LB_GETITEMHEIGHT, 0, 0);
hti.pt.x = 4;
hti.pt.y = (index - top) * height + 1;
- } else
- ScreenToClient(hwnd, &hti.pt);
+ }
+ else ScreenToClient(hwnd, &hti.pt);
- item = (DWORD)(SendMessage(hwnd, LB_ITEMFROMPOINT, 0, MAKELPARAM(hti.pt.x, hti.pt.y)));
+ int item = (DWORD)(SendMessage(hwnd, LB_ITEMFROMPOINT, 0, MAKELPARAM(hti.pt.x, hti.pt.y)));
if ( HIWORD( item ) == 1 )
item = (DWORD)(-1);
else
item &= 0xFFFF;
- ui = SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, item);
- // ui = (USERINFO *)SendMessage(GetDlgItem(hwndParent, IDC_LIST), LB_GETITEMDATA, item, 0);
+ USERINFO *ui = SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, item);
if (ui) {
HMENU hMenu = 0;
- UINT uID;
USERINFO uinew;
-
memcpy(&uinew, ui, sizeof(USERINFO));
if (hti.pt.x == -1 && hti.pt.y == -1)
hti.pt.y += height - 4;
ClientToScreen(hwnd, &hti.pt);
- uID = CreateGCMenu(hwnd, &hMenu, 0, hti.pt, parentdat, uinew.pszUID, NULL);
-
+
+ UINT uID = CreateGCMenu(hwnd, &hMenu, 0, hti.pt, parentdat, uinew.pszUID, NULL);
switch (uID) {
case 0:
break;
- case 20020: { // add to highlight...
- RECT rc, rcWnd;
- THighLightEdit the = {THighLightEdit::CMD_ADD, parentdat, ui};
+ case 20020: // add to highlight...
+ {
+ THighLightEdit the = {THighLightEdit::CMD_ADD, parentdat, ui};
- if (parentdat && ui) {
- HWND hwnd = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_ADDHIGHLIGHT), parentdat->dat->pContainer->hwnd, CMUCHighlight::dlgProcAdd, (LPARAM)&the);
- TranslateDialogDefault(hwnd);
- GetClientRect(parentdat->pContainer->hwnd, &rcWnd);
- GetWindowRect(hwnd, &rc);
+ if (parentdat && ui) {
+ HWND hwnd = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_ADDHIGHLIGHT), parentdat->dat->pContainer->hwnd, CMUCHighlight::dlgProcAdd, (LPARAM)&the);
+ TranslateDialogDefault(hwnd);
- SetWindowPos(hwnd, HWND_TOP, (rcWnd.right - (rc.right - rc.left)) / 2, (rcWnd.bottom - (rc.bottom - rc.top)) / 2 , 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW);
+ RECT rc, rcWnd;
+ GetClientRect(parentdat->pContainer->hwnd, &rcWnd);
+ GetWindowRect(hwnd, &rc);
+ SetWindowPos(hwnd, HWND_TOP, (rcWnd.right - (rc.right - rc.left)) / 2, (rcWnd.bottom - (rc.bottom - rc.top)) / 2 , 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW);
+ }
}
break;
- }
case ID_MESS:
DoEventHookAsync(GetParent(hwnd), parentdat->ptszID, parentdat->pszModule, GC_USER_PRIVMESS, ui->pszUID, NULL, 0);
@@ -1721,17 +1695,12 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, int iCount = SendMessage(hwnd, LB_GETCOUNT, 0, 0);
if (iCount != LB_ERR) {
int iSelectedItems = SendMessage(hwnd, LB_GETSELCOUNT, 0, 0);
-
if (iSelectedItems != LB_ERR) {
int *pItems = (int *)malloc(sizeof(int) * (iSelectedItems + 1));
-
if (pItems) {
if (SendMessage(hwnd, LB_GETSELITEMS, (WPARAM)iSelectedItems, (LPARAM)pItems) != LB_ERR) {
- USERINFO *ui1 = NULL;
- int i;
-
- for (i=0; i < iSelectedItems; i++) {
- ui1 = SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, pItems[i]);
+ for (int i=0; i < iSelectedItems; i++) {
+ USERINFO *ui1 = SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, pItems[i]);
if (ui1)
DoEventHookAsync(hwndParent, parentdat->ptszID, parentdat->pszModule, GC_USER_NICKLISTMENU, ui1->pszUID, NULL, (LPARAM)uID);
}
@@ -1750,15 +1719,13 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, case WM_MOUSEMOVE:
{
- POINT pt;
+ POINT pt = { LOWORD(lParam), HIWORD(lParam) };
RECT clientRect;
- pt.x = LOWORD(lParam);
- pt.y = HIWORD(lParam);
GetClientRect(hwnd, &clientRect);
if (PtInRect(&clientRect, pt)) {
//hit test item under mouse
- struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
- SESSION_INFO *parentdat = (SESSION_INFO*)dat->si;
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
+ SESSION_INFO *parentdat = dat->si;
DWORD nItemUnderMouse = (DWORD)SendMessage(hwnd, LB_ITEMFROMPOINT, 0, lParam);
if (HIWORD(nItemUnderMouse) == 1)
@@ -1782,8 +1749,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, }
else ProcessNickListHovering(hwnd, (int)nItemUnderMouse, &pt, parentdat);
}
- else
- {
+ else {
if (M.GetByte("adv_TipperTooltip", 1) && ServiceExists("mToolTip/HideTip")) {
KillTimer(hwnd, 1);
if (isToolTip) {
@@ -1798,13 +1764,10 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, case WM_TIMER:
{
- CLCINFOTIP ti = {0};
- USERINFO *ui1 = NULL;
- POINT pt;
-
- struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
- SESSION_INFO * parentdat = dat->si;
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
+ SESSION_INFO *parentdat = dat->si;
+ POINT pt;
GetCursorPos(&pt);
ScreenToClient(hwnd, &pt);
@@ -1818,10 +1781,8 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, break;
}
- ui1 = SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, currentHovered);
+ USERINFO *ui1 = SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, currentHovered);
if (ui1) {
- ti.cbSize = sizeof(ti);
-
TCHAR tszBuf[1024]; tszBuf[0] = 0;
if (ProtoServiceExists(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT)) {
TCHAR *p = (TCHAR*)ProtoCallService(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)parentdat->ptszID, (LPARAM)ui1->pszUID);
@@ -1836,6 +1797,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, TranslateT("Unique id"), ui1->pszUID,
TranslateT("Status"), TM_WordToString(parentdat->pStatuses, ui1->Status));
+ CLCINFOTIP ti = { sizeof(ti) };
if (CallService("mToolTip/ShowTipW", (WPARAM)tszBuf, (LPARAM)&ti))
isToolTip = TRUE;
}
@@ -1885,14 +1847,15 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar {
SESSION_INFO *si = NULL;
HWND hwndTab = GetParent(hwndDlg);
- struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (dat)
- si = (SESSION_INFO*)dat->si;
+ si = dat->si;
if (dat == NULL && (uMsg == WM_ACTIVATE || uMsg == WM_SETFOCUS))
return 0;
CHARFORMAT2 cf;
+ POINT pt, tmp, cur;
switch (uMsg) {
case WM_INITDIALOG:
@@ -2052,7 +2015,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar break;
case DM_UPDATETITLE:
- return(SendMessage(hwndDlg, GC_UPDATETITLE, wParam, lParam));
+ return SendMessage(hwndDlg, GC_UPDATETITLE, wParam, lParam);
case GC_UPDATETITLE:
if (!dat->bWasDeleted) {
@@ -2100,9 +2063,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar dat->hTabIcon = dat->hTabStatusIcon;
if (dat->cache->getStatus() != dat->cache->getOldStatus()) {
- TCITEM item;
-
- ZeroMemory(&item, sizeof(item));
+ TCITEM item = { 0 };
item.mask = TCIF_TEXT;
lstrcpyn(dat->szStatus, (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)dat->wStatus, GSMDF_TCHAR), 50);
@@ -2156,9 +2117,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar TranslateT("hours") : TranslateT("hour"),
minutes, minutes > 1 ? TranslateT("minutes") : TranslateT("minute"));
}
- else
- mir_sntprintf(mi->tszIdleMsg, 60, TranslateT(", %d %s idle"),
- diff, diff > 1 ? TranslateT("minutes") : TranslateT("minute"));
+ else mir_sntprintf(mi->tszIdleMsg, 60, TranslateT(", %d %s idle"), diff, diff > 1 ? TranslateT("minutes") : TranslateT("minute"));
}
mir_sntprintf(szFinalStatusBarText, SIZEOF(szFinalStatusBarText), TranslateT("%s on %s%s"), dat->szMyNickname, mi->ptszModDispName, mi->tszIdleMsg);
}
@@ -2260,14 +2219,14 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case GC_ADDLOG:
{
- bool fInactive = (GetForegroundWindow() != dat->pContainer->hwnd || GetActiveWindow() != dat->pContainer->hwnd);
+ bool bInactive = (GetForegroundWindow() != dat->pContainer->hwnd || GetActiveWindow() != dat->pContainer->hwnd);
if (g_Settings.bUseDividers && g_Settings.bDividersUsePopupConfig) {
if (!MessageWindowOpened(0, (LPARAM)hwndDlg))
SendMessage(hwndDlg, DM_ADDDIVIDER, 0, 0);
}
else if (g_Settings.bUseDividers) {
- if (fInactive)
+ if (bInactive)
SendMessage(hwndDlg, DM_ADDDIVIDER, 0, 0);
else if (dat->pContainer->hwndActive != hwndDlg)
SendMessage(hwndDlg, DM_ADDDIVIDER, 0, 0);
@@ -2316,104 +2275,100 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar }
if (dis->CtlID == IDC_LIST) {
- int offset, x_offset = 0;
- int height;
+ int x_offset = 0;
int index = dis->itemID;
- USERINFO *ui = UM_FindUserFromIndex(si->pUsers, index);
char szIndicator = 0;
- if (ui) {
- height = dis->rcItem.bottom - dis->rcItem.top;
+ USERINFO *ui = UM_FindUserFromIndex(si->pUsers, index);
+ if (ui == NULL)
+ return TRUE;
- if (height&1)
- height++;
- if (height == 10)
- offset = 0;
- else
- offset = height / 2;
- HICON hIcon = SM_GetStatusIcon(si, ui, &szIndicator);
- HFONT hFont = g_Settings.UserListFonts[ui->iStatusEx];
- HFONT hOldFont = (HFONT) SelectObject(dis->hDC, hFont);
- SetBkMode(dis->hDC, TRANSPARENT);
-
- if (dis->itemState & ODS_SELECTED) {
- FillRect(dis->hDC, &dis->rcItem, g_Settings.SelectionBGBrush);
- SetTextColor(dis->hDC, g_Settings.nickColors[6]);
- }
- else {
- FillRect(dis->hDC, &dis->rcItem, hListBkgBrush);
- if (g_Settings.bColorizeNicks && szIndicator != 0) {
- COLORREF clr;
- switch (szIndicator) {
- case '@':
- clr = g_Settings.nickColors[0];
- break;
- case '%':
- clr = g_Settings.nickColors[1];
- break;
- case '+':
- clr = g_Settings.nickColors[2];
- break;
- case '!':
- clr = g_Settings.nickColors[3];
- break;
- case '*':
- clr = g_Settings.nickColors[4];
- break;
- }
- SetTextColor(dis->hDC, clr);
+ int height = dis->rcItem.bottom - dis->rcItem.top;
+ if (height & 1)
+ height++;
+ int offset = (height == 10) ? 0 : height/2;
+
+ HICON hIcon = SM_GetStatusIcon(si, ui, &szIndicator);
+ HFONT hFont = g_Settings.UserListFonts[ui->iStatusEx];
+ HFONT hOldFont = (HFONT) SelectObject(dis->hDC, hFont);
+ SetBkMode(dis->hDC, TRANSPARENT);
+
+ if (dis->itemState & ODS_SELECTED) {
+ FillRect(dis->hDC, &dis->rcItem, g_Settings.SelectionBGBrush);
+ SetTextColor(dis->hDC, g_Settings.nickColors[6]);
+ }
+ else {
+ FillRect(dis->hDC, &dis->rcItem, hListBkgBrush);
+ if (g_Settings.bColorizeNicks && szIndicator != 0) {
+ COLORREF clr;
+ switch (szIndicator) {
+ case '@':
+ clr = g_Settings.nickColors[0];
+ break;
+ case '%':
+ clr = g_Settings.nickColors[1];
+ break;
+ case '+':
+ clr = g_Settings.nickColors[2];
+ break;
+ case '!':
+ clr = g_Settings.nickColors[3];
+ break;
+ case '*':
+ clr = g_Settings.nickColors[4];
+ break;
}
- else SetTextColor(dis->hDC, g_Settings.UserListColors[ui->iStatusEx]);
+ SetTextColor(dis->hDC, clr);
}
- x_offset = 2;
+ else SetTextColor(dis->hDC, g_Settings.UserListColors[ui->iStatusEx]);
+ }
+ x_offset = 2;
- if (g_Settings.bShowContactStatus && g_Settings.bContactStatusFirst && ui->ContactStatus) {
- HICON hIcon = LoadSkinnedProtoIcon(si->pszModule, ui->ContactStatus);
- DrawIconEx(dis->hDC, x_offset, dis->rcItem.top + offset - 8, hIcon, 16, 16, 0, NULL, DI_NORMAL);
- Skin_ReleaseIcon(hIcon);
- x_offset += 18;
- }
+ if (g_Settings.bShowContactStatus && g_Settings.bContactStatusFirst && ui->ContactStatus) {
+ HICON hIcon = LoadSkinnedProtoIcon(si->pszModule, ui->ContactStatus);
+ DrawIconEx(dis->hDC, x_offset, dis->rcItem.top + offset - 8, hIcon, 16, 16, 0, NULL, DI_NORMAL);
+ Skin_ReleaseIcon(hIcon);
+ x_offset += 18;
+ }
- if (g_Settings.bClassicIndicators) {
- char szTemp[3];
+ if (g_Settings.bClassicIndicators) {
+ char szTemp[3];
+ szTemp[1] = 0;
+ szTemp[0] = szIndicator;
+ if (szTemp[0]) {
SIZE szUmode;
-
- szTemp[1] = 0;
- szTemp[0] = szIndicator;
- if (szTemp[0]) {
- GetTextExtentPoint32A(dis->hDC, szTemp, 1, &szUmode);
- TextOutA(dis->hDC, x_offset, dis->rcItem.top, szTemp, 1);
- x_offset += szUmode.cx + 2;
- } else x_offset += 8;
- } else {
- DrawIconEx(dis->hDC, x_offset, dis->rcItem.top + offset - 5, hIcon, 10, 10, 0, NULL, DI_NORMAL);
- x_offset += 12;
+ GetTextExtentPoint32A(dis->hDC, szTemp, 1, &szUmode);
+ TextOutA(dis->hDC, x_offset, dis->rcItem.top, szTemp, 1);
+ x_offset += szUmode.cx + 2;
}
+ else x_offset += 8;
+ }
+ else {
+ DrawIconEx(dis->hDC, x_offset, dis->rcItem.top + offset - 5, hIcon, 10, 10, 0, NULL, DI_NORMAL);
+ x_offset += 12;
+ }
- if (g_Settings.bShowContactStatus && !g_Settings.bContactStatusFirst && ui->ContactStatus) {
- HICON hIcon = LoadSkinnedProtoIcon(si->pszModule, ui->ContactStatus);
- DrawIconEx(dis->hDC, x_offset, dis->rcItem.top + offset - 8, hIcon, 16, 16, 0, NULL, DI_NORMAL);
- Skin_ReleaseIcon(hIcon);
- x_offset += 18;
- }
+ if (g_Settings.bShowContactStatus && !g_Settings.bContactStatusFirst && ui->ContactStatus) {
+ HICON hIcon = LoadSkinnedProtoIcon(si->pszModule, ui->ContactStatus);
+ DrawIconEx(dis->hDC, x_offset, dis->rcItem.top + offset - 8, hIcon, 16, 16, 0, NULL, DI_NORMAL);
+ Skin_ReleaseIcon(hIcon);
+ x_offset += 18;
+ }
- {
- SIZE sz;
-
- if (si->iSearchItem != -1 && si->iSearchItem == index && si->szSearch[0]) {
- COLORREF clr_orig = GetTextColor(dis->hDC);
- GetTextExtentPoint32(dis->hDC, ui->pszNick, lstrlen(si->szSearch), &sz);
- SetTextColor(dis->hDC, RGB(250, 250, 0));
- TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick, lstrlen(si->szSearch));
- SetTextColor(dis->hDC, clr_orig);
- x_offset += sz.cx;
- TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick + lstrlen(si->szSearch), lstrlen(ui->pszNick) - lstrlen(si->szSearch));
- } else {
- GetTextExtentPoint32(dis->hDC, ui->pszNick, lstrlen(ui->pszNick), &sz);
- TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick, lstrlen(ui->pszNick));
- SelectObject(dis->hDC, hOldFont);
- }
- }
+ SIZE sz;
+ if (si->iSearchItem != -1 && si->iSearchItem == index && si->szSearch[0]) {
+ COLORREF clr_orig = GetTextColor(dis->hDC);
+ GetTextExtentPoint32(dis->hDC, ui->pszNick, lstrlen(si->szSearch), &sz);
+ SetTextColor(dis->hDC, RGB(250, 250, 0));
+ TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick, lstrlen(si->szSearch));
+ SetTextColor(dis->hDC, clr_orig);
+ x_offset += sz.cx;
+ TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick + lstrlen(si->szSearch), lstrlen(ui->pszNick) - lstrlen(si->szSearch));
+ }
+ else {
+ GetTextExtentPoint32(dis->hDC, ui->pszNick, lstrlen(ui->pszNick), &sz);
+ TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick, lstrlen(ui->pszNick));
+ SelectObject(dis->hDC, hOldFont);
}
return TRUE;
}
@@ -2498,12 +2453,10 @@ LABEL_SHOWWINDOW: RECT rc, rcLog;
GetWindowRect(GetDlgItem(hwndDlg, IDC_CHAT_LOG), &rcLog);
if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_SPLITTERX)) {
- int oldSplitterX;
GetClientRect(hwndDlg, &rc);
POINT pt = { wParam, 0 };
ScreenToClient(hwndDlg, &pt);
- oldSplitterX = si->iSplitterX;
si->iSplitterX = rc.right - pt.x + 1;
if (si->iSplitterX < 35)
si->iSplitterX = 35;
@@ -2518,8 +2471,7 @@ LABEL_SHOWWINDOW: POINT pt = { 0, wParam };
ScreenToClient(hwndDlg, &pt);
- BOOL bFormat = TRUE; //IsWindowVisible(GetDlgItem(hwndDlg,IDC_SMILEY));
- int oldSplitterY = si->iSplitterY;
+ BOOL bFormat = TRUE;
si->iSplitterY = bFormat ? rc.bottom - pt.y + DPISCALEY_S(1) : rc.bottom - pt.y + DPISCALEY_S(20);
if (si->iSplitterY < DPISCALEY_S(23))
si->iSplitterY = DPISCALEY_S(23);
@@ -2547,7 +2499,7 @@ LABEL_SHOWWINDOW: case GC_FIREHOOK:
if (lParam) {
- GCHOOK* gch = (GCHOOK *) lParam;
+ GCHOOK* gch = (GCHOOK*) lParam;
NotifyEventHooks(hSendEvent, 0, (WPARAM)gch);
if (gch->pDest) {
mir_free(gch->pDest->pszID);
@@ -2585,20 +2537,18 @@ LABEL_SHOWWINDOW: case GC_SHOWCOLORCHOOSER:
{
- HWND ColorWindow;
- RECT rc;
bool bFG = (lParam == IDC_COLOR);
- COLORCHOOSER *pCC = (COLORCHOOSER *)mir_alloc(sizeof(COLORCHOOSER));
+ RECT rc;
GetWindowRect(GetDlgItem(hwndDlg, bFG ? IDC_COLOR : IDC_BKGCOLOR), &rc);
+ COLORCHOOSER *pCC = (COLORCHOOSER *)mir_alloc(sizeof(COLORCHOOSER));
pCC->hWndTarget = GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE);
pCC->pModule = MM_FindModule(si->pszModule);
pCC->xPosition = rc.left + 3;
pCC->yPosition = IsWindowVisible(GetDlgItem(hwndDlg, IDC_COLOR)) ? rc.top - 1 : rc.top + 20;
pCC->bForeground = bFG;
pCC->si = si;
-
- ColorWindow = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_COLORCHOOSER), hwndDlg, DlgProcColorToolWindow, (LPARAM)pCC);
+ CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_COLORCHOOSER), hwndDlg, DlgProcColorToolWindow, (LPARAM)pCC);
}
break;
@@ -2634,17 +2584,17 @@ LABEL_SHOWWINDOW: BOOL isShift, isCtrl, isMenu;
KbdState(dat, isShift, isCtrl, isMenu);
- MSG message;
+ MSG message;
message.hwnd = hwndDlg;
message.message = msg;
message.lParam = lp;
message.wParam = wp;
if (msg == WM_SYSKEYUP) {
- if (wp == VK_MENU) {
+ if (wp == VK_MENU)
if (!dat->fkeyProcessed && !(GetKeyState(VK_CONTROL) & 0x8000) && !(GetKeyState(VK_SHIFT) & 0x8000) && !(lp & (1 << 24)))
dat->pContainer->MenuBar->autoShow();
- }
+
return(_dlgReturn(hwndDlg, 0));
}
@@ -2704,56 +2654,47 @@ LABEL_SHOWWINDOW: if (((LPNMHDR)lParam)->idFrom == IDC_CHAT_LOG && ((MSGFILTER *) lParam)->msg == WM_RBUTTONUP) {
CHARRANGE sel, all = { 0, -1 };
- POINT pt;
- UINT uID = 0;
- HMENU hMenu = 0;
- TCHAR pszWord[4096];
- int pos;
- pt.x = (short) LOWORD(((ENLINK *) lParam)->lParam);
- pt.y = (short) HIWORD(((ENLINK *) lParam)->lParam);
+ POINT pt = { (short)LOWORD(((ENLINK *) lParam)->lParam), (short)HIWORD(((ENLINK *) lParam)->lParam) };
ClientToScreen(((LPNMHDR)lParam)->hwndFrom, &pt);
- { // fixing stuff for searches
- long iCharIndex, iLineIndex, iChars, start, end, iRes;
- POINTL ptl;
-
- pszWord[0] = '\0';
- ptl.x = (LONG)pt.x;
- ptl.y = (LONG)pt.y;
- ScreenToClient(GetDlgItem(hwndDlg, IDC_CHAT_LOG), (LPPOINT)&ptl);
- iCharIndex = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_CHARFROMPOS, 0, (LPARAM)& ptl);
- if (iCharIndex < 0)
- break;
- iLineIndex = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_EXLINEFROMCHAR, 0, (LPARAM)iCharIndex);
- iChars = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_LINEINDEX, (WPARAM)iLineIndex, 0);
- start = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_FINDWORDBREAK, WB_LEFT, iCharIndex);//-iChars;
- end = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_FINDWORDBREAK, WB_RIGHT, iCharIndex);//-iChars;
-
- if (end - start > 0) {
- TEXTRANGE tr;
- CHARRANGE cr;
- static char szTrimString[] = ":;,.!?\'\"><()[]- \r\n";
- ZeroMemory(&tr, sizeof(TEXTRANGE));
-
- cr.cpMin = start;
- cr.cpMax = end;
- tr.chrg = cr;
- tr.lpstrText = (TCHAR *)pszWord;
- iRes = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_GETTEXTRANGE, 0, (LPARAM)& tr);
-
- if (iRes > 0) {
- int iLen = lstrlen(pszWord) - 1;
- while (iLen >= 0 && strchr(szTrimString, pszWord[iLen])) {
- pszWord[iLen] = '\0';
- iLen--;
- }
+ // fixing stuff for searches
+ TCHAR *pszWord = (TCHAR*)alloca(8192);
+ pszWord[0] = '\0';
+ POINTL ptl = { pt.x, pt.y };
+ ScreenToClient(GetDlgItem(hwndDlg, IDC_CHAT_LOG), (LPPOINT)&ptl);
+ int iCharIndex = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_CHARFROMPOS, 0, (LPARAM)&ptl);
+ if (iCharIndex < 0)
+ break;
+
+ int iLineIndex = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_EXLINEFROMCHAR, 0, (LPARAM)iCharIndex);
+ int iChars = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_LINEINDEX, (WPARAM)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);
+
+ if (end - start > 0) {
+ static char szTrimString[] = ":;,.!?\'\"><()[]- \r\n";
+
+ CHARRANGE cr;
+ cr.cpMin = start;
+ cr.cpMax = end;
+
+ TEXTRANGE tr = { 0 };
+ tr.chrg = cr;
+ tr.lpstrText = (TCHAR *)pszWord;
+ int iRes = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_GETTEXTRANGE, 0, (LPARAM)&tr);
+
+ if (iRes > 0) {
+ int iLen = lstrlen(pszWord) - 1;
+ while (iLen >= 0 && strchr(szTrimString, pszWord[iLen])) {
+ pszWord[iLen] = '\0';
+ iLen--;
}
}
}
- uID = CreateGCMenu(hwndDlg, &hMenu, 1, pt, si, NULL, pszWord);
-
+ HMENU hMenu = 0;
+ UINT uID = CreateGCMenu(hwndDlg, &hMenu, 1, pt, si, NULL, pszWord);
if ((uID > 800 && uID < 1400) || uID == CP_UTF8 || uID == 20866) {
dat->codePage = uID;
db_set_dw(dat->hContact, SRMSGMOD_T, "ANSIcodepage", dat->codePage);
@@ -2768,10 +2709,10 @@ LABEL_SHOWWINDOW: break;
case ID_COPYALL:
- SendMessage(((LPNMHDR)lParam)->hwndFrom, EM_EXGETSEL, 0, (LPARAM)& sel);
- SendMessage(((LPNMHDR)lParam)->hwndFrom, EM_EXSETSEL, 0, (LPARAM)& all);
+ SendMessage(((LPNMHDR)lParam)->hwndFrom, EM_EXGETSEL, 0, (LPARAM)&sel);
+ SendMessage(((LPNMHDR)lParam)->hwndFrom, EM_EXSETSEL, 0, (LPARAM)&all);
SendMessage(((LPNMHDR)lParam)->hwndFrom, WM_COPY, 0, 0);
- SendMessage(((LPNMHDR)lParam)->hwndFrom, EM_EXSETSEL, 0, (LPARAM)& sel);
+ SendMessage(((LPNMHDR)lParam)->hwndFrom, EM_EXSETSEL, 0, (LPARAM)&sel);
PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0);
break;
@@ -2804,7 +2745,7 @@ LABEL_SHOWWINDOW: }
if (si->iType != GCW_SERVER && !(si->dwFlags & GC_UNICODE)) {
- pos = GetMenuItemCount(hMenu);
+ int pos = GetMenuItemCount(hMenu);
RemoveMenu(hMenu, pos - 1, MF_BYPOSITION);
RemoveMenu(PluginConfig.g_hMenuEncoding, 1, MF_BYPOSITION);
}
@@ -2814,17 +2755,14 @@ LABEL_SHOWWINDOW: break;
case EN_REQUESTRESIZE:
- if (((LPNMHDR)lParam)->idFrom == IDC_CHAT_MESSAGE) {
- REQRESIZE *rr = (REQRESIZE *)lParam;
- DM_HandleAutoSizeRequest(dat, rr);
- }
+ if (((LPNMHDR)lParam)->idFrom == IDC_CHAT_MESSAGE)
+ DM_HandleAutoSizeRequest(dat, (REQRESIZE *)lParam);
break;
case EN_LINK:
if (((LPNMHDR)lParam)->idFrom == IDC_CHAT_LOG) {
switch (((ENLINK *) lParam)->msg) {
case WM_SETCURSOR:
-
if (g_Settings.bClickableNicks) {
if (!hCurHyperlinkHand)
hCurHyperlinkHand = LoadCursor(NULL, IDC_HAND);
@@ -2838,27 +2776,24 @@ LABEL_SHOWWINDOW: case WM_LBUTTONUP:
case WM_LBUTTONDBLCLK:
{
- TEXTRANGE tr;
CHARRANGE sel;
- UINT msg = ((ENLINK *) lParam)->msg;
+ SendMessage(((LPNMHDR)lParam)->hwndFrom, EM_EXGETSEL, 0, (LPARAM)&sel);
+ if (sel.cpMin != sel.cpMax)
+ break;
+ UINT msg = ((ENLINK *) lParam)->msg;
dat->pContainer->MenuBar->Cancel();
+ TEXTRANGE tr;
tr.lpstrText = NULL;
- SendMessage(((LPNMHDR)lParam)->hwndFrom, EM_EXGETSEL, 0, (LPARAM)& sel);
- if (sel.cpMin != sel.cpMax)
- break;
tr.chrg = ((ENLINK *) lParam)->chrg;
tr.lpstrText = (TCHAR *)mir_alloc(sizeof(TCHAR) * (tr.chrg.cpMax - tr.chrg.cpMin + 2));
- SendMessage(((LPNMHDR)lParam)->hwndFrom, EM_GETTEXTRANGE, 0, (LPARAM)& tr);
+ SendMessage(((LPNMHDR)lParam)->hwndFrom, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
BOOL isLink = IsStringValidLink(tr.lpstrText);
if (isLink) {
if (((ENLINK *) lParam)->msg == WM_RBUTTONDOWN) {
- HMENU hSubMenu;
- POINT pt;
-
- hSubMenu = GetSubMenu(g_hMenu, 2);
+ HMENU hSubMenu = GetSubMenu(g_hMenu, 2);
TranslateMenu(hSubMenu);
pt.x = (short) LOWORD(((ENLINK *) lParam)->lParam);
pt.y = (short) HIWORD(((ENLINK *) lParam)->lParam);
@@ -2897,40 +2832,35 @@ LABEL_SHOWWINDOW: else if (g_Settings.bClickableNicks) { // clicked a nick name
CHARRANGE chr;
TEXTRANGE tr2;
- TCHAR tszAplTmpl[] = _T("%s:"),
- *tszAppeal, *tszTmp;
+ TCHAR tszAplTmpl[] = _T("%s:"), *tszAppeal, *tszTmp;
size_t st;
if (msg == WM_RBUTTONDOWN) {
- USERINFO *ui = si->pUsers;
- HMENU hMenu = 0;
- USERINFO uiNew;
- while (ui) {
- if (!lstrcmp(ui->pszNick, tr.lpstrText)) {
- POINT pt;
- UINT uID;
-
- pt.x = (short) LOWORD(((ENLINK *) lParam)->lParam);
- pt.y = (short) HIWORD(((ENLINK *) lParam)->lParam);
- ClientToScreen(((NMHDR *) lParam)->hwndFrom, &pt);
- CopyMemory(&uiNew, ui, sizeof(USERINFO));
- uID = CreateGCMenu(hwndDlg, &hMenu, 0, pt, si, uiNew.pszUID, NULL);
- switch (uID) {
- case 0:
- break;
-
- case ID_MESS:
- DoEventHookAsync(hwndDlg, si->ptszID, si->pszModule, GC_USER_PRIVMESS, ui->pszUID, NULL, 0);
- break;
-
- default:
- DoEventHookAsync(hwndDlg, si->ptszID, si->pszModule, GC_USER_NICKLISTMENU, ui->pszUID, NULL, (LPARAM)uID);
- break;
- }
- DestroyGCMenu(&hMenu, 1);
- return TRUE;
+ HMENU hMenu = 0;
+ USERINFO uiNew;
+ for (USERINFO *ui = si->pUsers; ui; ui = ui->next) {
+ if ( lstrcmp(ui->pszNick, tr.lpstrText))
+ continue;
+
+ pt.x = (short) LOWORD(((ENLINK *) lParam)->lParam);
+ pt.y = (short) HIWORD(((ENLINK *) lParam)->lParam);
+ ClientToScreen(((NMHDR *) lParam)->hwndFrom, &pt);
+ CopyMemory(&uiNew, ui, sizeof(USERINFO));
+ UINT uID = CreateGCMenu(hwndDlg, &hMenu, 0, pt, si, uiNew.pszUID, NULL);
+ switch (uID) {
+ case 0:
+ break;
+
+ case ID_MESS:
+ DoEventHookAsync(hwndDlg, si->ptszID, si->pszModule, GC_USER_PRIVMESS, ui->pszUID, NULL, 0);
+ break;
+
+ default:
+ DoEventHookAsync(hwndDlg, si->ptszID, si->pszModule, GC_USER_NICKLISTMENU, ui->pszUID, NULL, (LPARAM)uID);
+ break;
}
- ui = ui->next;
+ DestroyGCMenu(&hMenu, 1);
+ return TRUE;
}
return TRUE;
}
@@ -2984,40 +2914,29 @@ LABEL_SHOWWINDOW: break;
case WM_LBUTTONDOWN:
- {
- POINT tmp; //+ Protogenes
- POINTS cur; //+ Protogenes
- GetCursorPos(&tmp); //+ Protogenes
- if (!dat->Panel->isHovered()) {
- cur.x = (SHORT)tmp.x; //+ Protogenes
- cur.y = (SHORT)tmp.y; //+ Protogenes
- SendMessage(dat->pContainer->hwnd, WM_NCLBUTTONDOWN, HTCAPTION, *((LPARAM*)(&cur))); //+ Protogenes
- }
+ GetCursorPos(&tmp);
+ if (!dat->Panel->isHovered()) {
+ cur.x = (SHORT)tmp.x;
+ cur.y = (SHORT)tmp.y;
+ SendMessage(dat->pContainer->hwnd, WM_NCLBUTTONDOWN, HTCAPTION, *((LPARAM*)(&cur)));
}
break;
case WM_LBUTTONUP:
- {
- POINT tmp; //+ Protogenes
- POINTS cur; //+ Protogenes
- GetCursorPos(&tmp); //+ Protogenes
- if (dat->Panel->isHovered())
- dat->Panel->handleClick(tmp);
- else {
- cur.x = (SHORT)tmp.x; //+ Protogenes
- cur.y = (SHORT)tmp.y; //+ Protogenes
- SendMessage(dat->pContainer->hwnd, WM_NCLBUTTONUP, HTCAPTION, *((LPARAM*)(&cur))); //+ Protogenes
- }
+ GetCursorPos(&tmp);
+ if (dat->Panel->isHovered())
+ dat->Panel->handleClick(tmp);
+ else {
+ cur.x = (SHORT)tmp.x;
+ cur.y = (SHORT)tmp.y;
+ SendMessage(dat->pContainer->hwnd, WM_NCLBUTTONUP, HTCAPTION, *((LPARAM*)(&cur)));
}
break;
case WM_MOUSEMOVE:
- {
- POINT pt;
- GetCursorPos(&pt);
- DM_DismissTip(dat, pt);
- dat->Panel->trackMouse(pt);
- }
+ GetCursorPos(&pt);
+ DM_DismissTip(dat, pt);
+ dat->Panel->trackMouse(pt);
break;
case WM_APPCOMMAND:
@@ -3040,16 +2959,12 @@ LABEL_SHOWWINDOW: case IDC_LIST:
if (HIWORD(wParam) == LBN_DBLCLK) {
TVHITTESTINFO hti;
- int item;
- USERINFO *ui;
-
hti.pt.x = (short)LOWORD(GetMessagePos());
hti.pt.y = (short)HIWORD(GetMessagePos());
ScreenToClient(GetDlgItem(hwndDlg, IDC_LIST), &hti.pt);
- item = LOWORD(SendMessage(GetDlgItem(hwndDlg, IDC_LIST), LB_ITEMFROMPOINT, 0, MAKELPARAM(hti.pt.x, hti.pt.y)));
- ui = UM_FindUserFromIndex(si->pUsers, item);
- //ui = SM_GetUserFromIndex(si->pszID, si->pszModule, item);
+ int item = LOWORD(SendMessage(GetDlgItem(hwndDlg, IDC_LIST), LB_ITEMFROMPOINT, 0, MAKELPARAM(hti.pt.x, hti.pt.y)));
+ USERINFO *ui = UM_FindUserFromIndex(si->pUsers, item);
if (ui) {
if (g_Settings.bDoubleClick4Privat ? GetKeyState(VK_SHIFT) & 0x8000 : !(GetKeyState(VK_SHIFT) & 0x8000)) {
LRESULT lResult = (LRESULT)SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_GETSEL, 0, 0);
@@ -3063,11 +2978,12 @@ LABEL_SHOWWINDOW: SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_REPLACESEL, FALSE, (LPARAM)pszName);
PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0);
SetFocus(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
- } else DoEventHookAsync(hwndDlg, si->ptszID, si->pszModule, GC_USER_PRIVMESS, ui->pszUID, NULL, 0);
+ }
+ else DoEventHookAsync(hwndDlg, si->ptszID, si->pszModule, GC_USER_PRIVMESS, ui->pszUID, NULL, 0);
}
-
return TRUE;
- } else if (HIWORD(wParam) == LBN_KILLFOCUS)
+ }
+ if (HIWORD(wParam) == LBN_KILLFOCUS)
RedrawWindow(GetDlgItem(hwndDlg, IDC_LIST), NULL, NULL, RDW_INVALIDATE);
break;
@@ -3198,8 +3114,8 @@ LABEL_SHOWWINDOW: if (si->iLogFilterFlags == 0 && !si->bFilterEnabled) {
MessageBox(0, TranslateT("The filter canoot be enabled, because there are no event types selected either global or for this chat room"), TranslateT("Event filter error"), MB_OK);
si->bFilterEnabled = 0;
- } else
- si->bFilterEnabled = !si->bFilterEnabled;
+ }
+ else si->bFilterEnabled = !si->bFilterEnabled;
SendDlgItemMessage(hwndDlg, IDC_FILTER, BUTTONSETOVERLAYICON,
(LPARAM)(si->bFilterEnabled ? PluginConfig.g_iconOverlayEnabled : PluginConfig.g_iconOverlayDisabled), 0);
@@ -3251,9 +3167,9 @@ LABEL_SHOWWINDOW: cf.crTextColor = MM_FindModule(si->pszModule)->crColors[si->iFG];
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
}
- } else {
+ }
+ else {
COLORREF cr;
-
LoadLogfont(MSGFONTID_MESSAGEAREA, NULL, &cr, FONTMODULE);
cf.dwMask = CFM_COLOR;
cf.crTextColor = cr;
@@ -3297,12 +3213,10 @@ LABEL_SHOWWINDOW: HDC hdc = (HDC)wParam;
RECT rcClient, rcWindow, rc;
CSkinItem *item;
- POINT pt;
UINT item_ids[3] = {ID_EXTBKUSERLIST, ID_EXTBKHISTORY, ID_EXTBKINPUTAREA};
UINT ctl_ids[3] = {IDC_LIST, IDC_CHAT_LOG, IDC_CHAT_MESSAGE};
- int i;
bool fAero = M.isAero();
- bool fInfoPanel = dat->Panel->isActive();
+ bool bInfoPanel = dat->Panel->isActive();
HANDLE hbp = 0;
HDC hdcMem = 0;
HBITMAP hbm, hbmOld;
@@ -3321,10 +3235,9 @@ LABEL_SHOWWINDOW: if (CSkin::m_skinEnabled && !fAero) {
CSkin::SkinDrawBG(hwndDlg, dat->pContainer->hwnd, dat->pContainer, &rcClient, hdcMem);
- for (i=0; i < 3; i++) {
+ for (int i=0; i < 3; i++) {
item = &SkinItems[item_ids[i]];
if (!item->IGNORED) {
-
GetWindowRect(GetDlgItem(hwndDlg, ctl_ids[i]), &rcWindow);
pt.x = rcWindow.left;
pt.y = rcWindow.top;
@@ -3350,8 +3263,6 @@ LABEL_SHOWWINDOW: GetClientRect(hwndDlg, &rc);
dat->Panel->renderBG(hdcMem, rc, &SkinItems[ID_EXTBKINFOPANELBG], fAero);
-
-
dat->Panel->renderContent(hdcMem);
if (!CSkin::m_skinEnabled)
@@ -3378,7 +3289,7 @@ LABEL_SHOWWINDOW: case WM_PAINT:
{
PAINTSTRUCT ps;
- HDC hdc = BeginPaint(hwndDlg, &ps);
+ HDC hdc = BeginPaint(hwndDlg, &ps);
EndPaint(hwndDlg, &ps);
}
return 0;
@@ -3393,12 +3304,8 @@ LABEL_SHOWWINDOW: return 0;
case WM_RBUTTONUP:
- {
- POINT pt;
- GetCursorPos(&pt);
- if (dat->Panel->invokeConfigDialog(pt))
- break;
-
+ GetCursorPos(&pt);
+ if ( !dat->Panel->invokeConfigDialog(pt)) {
HMENU subMenu = GetSubMenu(dat->pContainer->hMenuContext, 0);
MsgWindowUpdateMenu(dat, subMenu, MENU_TABCONTEXT);
@@ -3475,19 +3382,13 @@ LABEL_SHOWWINDOW: case GC_CLOSEWINDOW:
{
- TCITEM item = {0};
- RECT rc;
TContainerData *pContainer = dat->pContainer;
- BOOL bForced = (lParam == 2);
+ bool bForced = (lParam == 2);
int iTabs = TabCtrl_GetItemCount(hwndTab);
- if (iTabs == 1) {
- if (/*!bForced && */CMimAPI::m_shutDown == 0) {
- //DestroyWindow(GetParent(GetParent(hwndDlg)));
- //PostMessage(hwndDlg, WM_CLOSE, 0, 1);
- SendMessage(GetParent(GetParent(hwndDlg)), WM_CLOSE, 0, 1);
- return 1;
- }
+ if (iTabs == 1 && CMimAPI::m_shutDown == 0) {
+ SendMessage(GetParent(GetParent(hwndDlg)), WM_CLOSE, 0, 1);
+ return 1;
}
dat->pContainer->iChilds--;
@@ -3505,10 +3406,13 @@ LABEL_SHOWWINDOW: else
i++;
TabCtrl_SetCurSel(hwndTab, i);
+
+ TCITEM item = {0};
item.mask = TCIF_PARAM;
TabCtrl_GetItem(hwndTab, i, &item); // retrieve dialog hwnd for the now active tab...
-
dat->pContainer->hwndActive = (HWND) item.lParam;
+
+ RECT rc;
SendMessage(dat->pContainer->hwnd, DM_QUERYCLIENTAREA, 0, (LPARAM)&rc);
SetWindowPos(dat->pContainer->hwndActive, HWND_TOP, rc.left, rc.top, (rc.right - rc.left), (rc.bottom - rc.top), SWP_SHOWWINDOW);
ShowWindow((HWND)item.lParam, SW_SHOW);
@@ -3551,10 +3455,10 @@ LABEL_SHOWWINDOW: MoveWindow(hwndDlg, rcClient.left, rcClient.top, (rcClient.right - rcClient.left), (rcClient.bottom - rcClient.top), TRUE);
}
if (dat->dwFlags & MWF_WASBACKGROUNDCREATE) {
- POINT pt = {0};;
-
dat->dwFlags &= ~MWF_WASBACKGROUNDCREATE;
SendMessage(hwndDlg, WM_SIZE, 0, 0);
+
+ POINT pt = {0};
SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_SETSCROLLPOS, 0, (LPARAM)&pt);
if (PluginConfig.m_AutoLocaleSupport) {
if (dat->hkl == 0)
@@ -3605,22 +3509,21 @@ LABEL_SHOWWINDOW: break;
//mad: bb-api
- case DM_BBNEEDUPDATE:{
+ case DM_BBNEEDUPDATE:
if (lParam)
CB_ChangeButton(hwndDlg,dat,(CustomButtonData*)lParam);
else
BB_InitDlgButtons(dat);
BB_SetButtonsPos(dat);
- }break;
+ break;
- case DM_CBDESTROY:{
+ case DM_CBDESTROY:
if (lParam)
CB_DestroyButton(hwndDlg,dat,(DWORD)wParam,(DWORD)lParam);
else
CB_DestroyAllButtons(hwndDlg,dat);
- }break;
- //
+ break;
case DM_CONFIGURETOOLBAR:
SendMessage(hwndDlg, WM_SIZE, 0, 0);
@@ -3677,8 +3580,9 @@ LABEL_SHOWWINDOW: CallService(MS_CLIST_REMOVEEVENT, (WPARAM)si->hContact, (LPARAM)szChatIconString);
si->wState &= ~STATE_TALK;
si->hWnd = NULL;
- si->dat = 0;
- si->pContainer = 0;
+ si->dat = NULL;
+ si->pContainer = NULL;
+ dat->si = NULL;
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_UNSUBCLASSED, 0, 0);
@@ -3722,5 +3626,5 @@ LABEL_SHOWWINDOW: TABSRMM_FireEvent(dat->hContact, hwndDlg, MSG_WINDOW_EVT_CLOSE, 0);
break;
}
- return(FALSE);
+ return FALSE;
}
diff --git a/plugins/TabSRMM/src/commonheaders.h b/plugins/TabSRMM/src/commonheaders.h index c87d5b674b..25c138b382 100644 --- a/plugins/TabSRMM/src/commonheaders.h +++ b/plugins/TabSRMM/src/commonheaders.h @@ -253,11 +253,11 @@ extern HINSTANCE hinstance; extern BOOL g_bIMGtagButton;
extern HIMAGELIST g_himlOptions;
extern HANDLE hHookToolBarLoadedEvt;
-extern struct TLogIcon msgLogIcons[NR_LOGICONS * 3];
+extern TLogIcon msgLogIcons[NR_LOGICONS * 3];
extern const TCHAR *pszIDCSAVE_save, *pszIDCSAVE_close;
extern char *TemplateNames[];
extern HANDLE hUserPrefsWindowList;
-extern struct TCpTable cpTable[];
+extern TCpTable cpTable[];
extern HGENMENU hJoinMenuItem, hLeaveMenuItem;
extern FONTINFO aFonts[OPTIONS_FONTCOUNT];
extern TCHAR *pszActiveWndID;
@@ -271,7 +271,7 @@ extern HANDLE hSendEvent; extern int LoadSendRecvMessageModule(void);
extern int SplitmsgShutdown(void);
-extern void LogErrorMessage(HWND hwndDlg, struct TWindowData *dat, int i, TCHAR *szMsg);
+extern void LogErrorMessage(HWND hwndDlg, TWindowData *dat, int i, TCHAR *szMsg);
extern int Chat_Load(), Chat_Unload();
extern void FreeLogFonts();
extern INT_PTR CALLBACK DlgProcSetupStatusModes(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -280,8 +280,8 @@ extern INT_PTR SendMessageCommand(WPARAM wParam, LPARAM lParam); extern INT_PTR SendMessageCommand_W(WPARAM wParam, LPARAM lParam);
extern void ReleaseRichEditOle(IRichEditOle *ole);
extern void ImageDataInsertBitmap(IRichEditOle *ole, HBITMAP hBm);
-extern int CacheIconToBMP(struct TLogIcon *theIcon, HICON hIcon, COLORREF backgroundColor, int sizeX, int sizeY);
-extern void DeleteCachedIcon(struct TLogIcon *theIcon);
+extern int CacheIconToBMP(TLogIcon *theIcon, HICON hIcon, COLORREF backgroundColor, int sizeX, int sizeY);
+extern void DeleteCachedIcon(TLogIcon *theIcon);
extern INT_PTR CALLBACK DlgProcPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
extern INT_PTR CALLBACK DlgProcTabConfig(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
extern INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index aa61df56c0..a824b421ca 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -197,7 +197,7 @@ bool CContactCache::updateUIN() ci.hContact = getActiveContact();
ci.szProto = const_cast<char *>(getActiveProto());
ci.dwFlag = CNF_DISPLAYUID | CNF_TCHAR;
- if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)& ci)) {
+ if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci)) {
switch (ci.type) {
case CNFT_ASCIIZ:
mir_sntprintf(m_szUIN, SIZEOF(m_szUIN), _T("%s"), reinterpret_cast<TCHAR *>(ci.pszVal));
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index d88ab05f03..62a25e84cb 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -65,7 +65,7 @@ void TSAPI SetAeroMargins(TContainerData *pContainer) return;
}
- TWindowData *dat = (TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
if (!dat)
return;
@@ -376,8 +376,8 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, GetCursorPos(&pt);
GetWindowRect(hwndDlg, &rcWindow);
- CopyMemory(&pContainer->oldbuttons[0], &pContainer->buttons[0], sizeof(struct TitleBtn) * 3);
- ZeroMemory(&pContainer->buttons[0], sizeof(struct TitleBtn) * 3);
+ CopyMemory(&pContainer->oldbuttons[0], &pContainer->buttons[0], sizeof(TitleBtn) * 3);
+ ZeroMemory(&pContainer->buttons[0], sizeof(TitleBtn) * 3);
isMin = isMax = isClose = FALSE;
if (pt.x >= (rcWindow.left + pContainer->rcMin.left) && pt.x <= (rcWindow.left + pContainer->rcClose.right) && pt.y < rcWindow.top + 24 && wParam != HTTOPRIGHT) {
@@ -760,7 +760,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, pContainer->MenuBar->getClientRect();
if (pContainer->hwndStatus) {
- TWindowData *dat = (TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
RECT rcs;
SendMessage(pContainer->hwndStatus, WM_USER + 101, 0, (LPARAM)dat);
@@ -824,7 +824,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, SetWindowPos((HWND)item.lParam, 0, rcClient.left, rcClient.top, (rcClient.right - rcClient.left), (rcClient.bottom - rcClient.top),
SWP_NOSENDCHANGING|SWP_NOACTIVATE/*|SWP_NOCOPYBITS*/);
if (!pContainer->bSizingLoop && sizeChanged) {
- TWindowData *dat = (TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
DM_ScrollToBottom(dat, 0, 1);
}
}
@@ -902,7 +902,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, nPanel = nm->dwItemSpec;
panel_found:
if (nPanel == 2) {
- struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
SendMessage(pContainer->hwndStatus, SB_GETRECT, nPanel, (LPARAM)&rc);
if (dat)
SI_CheckStatusIconClick(dat, pContainer->hwndStatus, nm->pt, rc, 2, ((LPNMHDR)lParam)->code);
@@ -956,7 +956,7 @@ panel_found: HMENU subMenu;
int iSelection, iItem;
TCITEM item = {0};
- struct TWindowData *dat = 0;
+ TWindowData *dat = 0;
bool fFromSidebar = false;
POINT pt, pt1;
@@ -971,7 +971,7 @@ panel_found: item.mask = TCIF_PARAM;
TabCtrl_GetItem(hwndTab, iItem, &item);
if (item.lParam && IsWindow((HWND)item.lParam))
- dat = (struct TWindowData *)GetWindowLongPtr((HWND)item.lParam, GWLP_USERDATA);
+ dat = (TWindowData*)GetWindowLongPtr((HWND)item.lParam, GWLP_USERDATA);
}
/*
* sent from a sidebar button (RMB click) instead of the tab control
@@ -1017,7 +1017,7 @@ panel_found: break;
case ID_TABMENU_LEAVECHATROOM:
if (dat && dat->bType == SESSIONTYPE_CHAT) {
- SESSION_INFO *si = (SESSION_INFO*)dat->si;
+ SESSION_INFO *si = dat->si;
if (si && dat->hContact) {
char *szProto = GetContactProto(dat->hContact);
if (szProto)
@@ -1054,7 +1054,7 @@ panel_found: pContainer->MenuBar->Cancel();
HANDLE hContact;
- TWindowData *dat = (TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
DWORD dwOldFlags = pContainer->dwFlags;
int i=0;
ButtonItem *pItem = pContainer->buttonItems;
@@ -1139,7 +1139,7 @@ panel_found: RECT rc;
GetClientRect(GetDlgItem(hwndDlg, IDC_MSGTABS), &rc);
if (!((rc.right - rc.left) == pContainer->oldSize.cx && (rc.bottom - rc.top) == pContainer->oldSize.cy)) {
- TWindowData *dat = (TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
DM_ScrollToBottom(dat, 0, 0);
SendMessage(pContainer->hwndActive, WM_SIZE, 0, 0);
}
@@ -1246,7 +1246,7 @@ panel_found: if (lParam) { // lParam != 0 means sent by a chat window
TCHAR szText[512];
- dat = (struct TWindowData *)GetWindowLongPtr((HWND)wParam, GWLP_USERDATA);
+ dat = (TWindowData*)GetWindowLongPtr((HWND)wParam, GWLP_USERDATA);
GetWindowText((HWND)wParam, szText, SIZEOF(szText));
szText[SIZEOF(szText)-1] = 0;
SetWindowText(hwndDlg, szText);
@@ -1259,7 +1259,7 @@ panel_found: SendMessage(pContainer->hwndActive, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
else
break;
- dat = (struct TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
+ dat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
}
else {
HWND hwnd = M.FindWindow((HANDLE)wParam);
@@ -1272,7 +1272,7 @@ panel_found: }
hContact = (HANDLE)wParam;
if (hwnd && hContact)
- dat = (struct TWindowData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ dat = (TWindowData*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
}
if (dat) {
SendMessage(hwndDlg, DM_SETICON, (WPARAM)dat, (LPARAM)(dat->hXStatusIcon ? dat->hXStatusIcon : dat->hTabStatusIcon));
@@ -1295,7 +1295,7 @@ panel_found: if (fResult && 0 == pContainer->hWndOptions)
PostMessage(hwndDlg, WM_CLOSE, 1, 0);
}
- dat = (TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
+ dat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
if (dat && dat->bType == SESSIONTYPE_IM) {
if (dat->idle && pContainer->hwndActive && IsWindow(pContainer->hwndActive))
dat->Panel->Invalidate(TRUE);
@@ -1376,7 +1376,7 @@ panel_found: }
if (iNewTab != iCurrent) {
- struct TabControlData *tabdat = (struct TabControlData *)GetWindowLongPtr(hwndTab, GWLP_USERDATA);
+ TabControlData *tabdat = (TabControlData *)GetWindowLongPtr(hwndTab, GWLP_USERDATA);
ZeroMemory((void*)&item, sizeof(item));
item.mask = TCIF_PARAM;
if (TabCtrl_GetItem(hwndTab, iNewTab, &item)) {
@@ -1676,7 +1676,7 @@ panel_found: SetWindowPos(hwndDlg, 0, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, SWP_NOACTIVATE | SWP_FRAMECHANGED | SWP_NOCOPYBITS);
RedrawWindow(hwndDlg, NULL, NULL, RDW_INVALIDATE | RDW_FRAME | RDW_UPDATENOW);
if (pContainer->hwndActive != 0) {
- TWindowData *dat = (TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
DM_ScrollToBottom(dat, 0, 0);
}
}
@@ -1781,7 +1781,7 @@ panel_found: case DM_SETICON:
{
HICON hIconMsg = PluginConfig.g_IconMsgEvent;
- TWindowData* dat = (TWindowData *)wParam;
+ TWindowData* dat = (TWindowData*)wParam;
HICON hIconBig = (dat && dat->cache) ? LoadSkinnedProtoIconBig(dat->cache->getActiveProto(), dat->cache->getActiveStatus()) : 0;
if (Win7Taskbar->haveLargeIcons()) {
@@ -1856,7 +1856,7 @@ panel_found: int id = LOWORD(dis->itemID);
if (dis->hwndItem == pContainer->hwndStatus && !(pContainer->dwFlags & CNT_NOSTATUSBAR)) {
- struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
if (dat)
DrawStatusIcons(dat, dis->hDC, dis->rcItem, 2);
return TRUE;
@@ -1883,7 +1883,7 @@ panel_found: case WM_DESTROY:
if (PluginConfig.g_FlashAvatarAvail) { // destroy own flash avatar
FLASHAVATAR fa = {0};
- struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
fa.id = 25367;
fa.cProto = dat ? dat->szProto : NULL;
@@ -2480,7 +2480,7 @@ HMENU TSAPI BuildContainerMenu() HMENU TSAPI BuildMCProtocolMenu(HWND hwndDlg)
{
- TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (dat == NULL)
return NULL;
@@ -2619,7 +2619,7 @@ void TSAPI BroadCastContainer(const TContainerData *pContainer, UINT message, WP if (bType == SESSIONTYPE_ANY)
SendMessage((HWND)item.lParam, message, wParam, lParam);
else {
- TWindowData *dat = (TWindowData *)GetWindowLongPtr((HWND)item.lParam, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr((HWND)item.lParam, GWLP_USERDATA);
if (dat && dat->bType == bType)
SendMessage((HWND)item.lParam, message, wParam, lParam);
}
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp index 5c0acceb0f..9a017aab4b 100644 --- a/plugins/TabSRMM/src/controls.cpp +++ b/plugins/TabSRMM/src/controls.cpp @@ -399,7 +399,7 @@ void CMenuBar::invoke(const int id) m_isContactMenu = m_isMainMenu = false;
- TWindowData *dat = (TWindowData *)GetWindowLongPtr(m_pContainer->hwndActive, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(m_pContainer->hwndActive, GWLP_USERDATA);
HANDLE hContact = dat ? dat->hContact : 0;
@@ -455,7 +455,7 @@ void CMenuBar::Cancel(void) void CMenuBar::updateState(const HMENU hMenu) const
{
- TWindowData *dat = (TWindowData *)GetWindowLongPtr(m_pContainer->hwndActive, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(m_pContainer->hwndActive, GWLP_USERDATA);
if (dat) {
::CheckMenuItem(hMenu, ID_VIEW_SHOWMENUBAR, MF_BYCOMMAND | m_pContainer->dwFlags & CNT_NOMENUBAR ? MF_UNCHECKED : MF_CHECKED);
@@ -495,7 +495,7 @@ void CMenuBar::updateState(const HMENU hMenu) const void CMenuBar::configureMenu() const
{
- TWindowData *dat = (TWindowData *)::GetWindowLongPtr(m_pContainer->hwndActive, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)::GetWindowLongPtr(m_pContainer->hwndActive, GWLP_USERDATA);
BOOL fDisable = FALSE;
@@ -774,7 +774,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR TWindowData *dat = 0;
if (pContainer)
- dat = (TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
+ dat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
GetClientRect(hWnd, &rcClient);
@@ -872,7 +872,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR szText[0] = 0;
result = SendMessage(hWnd, SB_GETTEXT, i, (LPARAM)szText);
if (i == 2 && pContainer) {
- TWindowData *dat = (TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
if (dat)
DrawStatusIcons(dat, hdcMem, itemRect, 2);
@@ -924,7 +924,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR case WM_USER + 101:
{
int list_icons = 0;
- struct TWindowData *dat = (struct TWindowData *)lParam;
+ TWindowData *dat = (TWindowData*)lParam;
if (dat)
while ( Srmm_GetNthIcon(dat->hContact, list_icons))
list_icons++;
@@ -998,7 +998,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR GetCursorPos(&pt);
if (pt.x == ptMouse.x && pt.y == ptMouse.y) {
RECT rc;
- struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
SIZE size;
TCHAR wBuf[512]; wBuf[0] = 0;
ti.ptCursor = pt;
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index 7388fba199..5ce262af33 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -752,7 +752,7 @@ static int TSAPI PopupPreview(NEN_OPTIONS *pluginOptions) * updates the menu entry...
* bForced is used to only update the status, nickname etc. and does NOT update the unread count
*/
-void TSAPI UpdateTrayMenuState(struct TWindowData *dat, BOOL bForced)
+void TSAPI UpdateTrayMenuState(TWindowData *dat, BOOL bForced)
{
MENUITEMINFO mii = {0};
TCHAR szMenuEntry[80];
@@ -858,7 +858,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro }
-int tabSRMM_ShowPopup(WPARAM wParam, LPARAM lParam, WORD eventType, int windowOpen, TContainerData *pContainer, HWND hwndChild, const char *szProto, struct TWindowData *dat)
+int tabSRMM_ShowPopup(WPARAM wParam, LPARAM lParam, WORD eventType, int windowOpen, TContainerData *pContainer, HWND hwndChild, const char *szProto, TWindowData *dat)
{
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 06855cd26a..be64f0916d 100644 --- a/plugins/TabSRMM/src/functions.h +++ b/plugins/TabSRMM/src/functions.h @@ -158,7 +158,7 @@ int TSAPI UnloadTSButtonModule(); int _DebugTraceW(const wchar_t *fmt, ...);
int _DebugTraceA(const char *fmt, ...);
int _DebugPopup(HANDLE hContact, const TCHAR *fmt, ...);
-int _DebugMessage(HWND hwndDlg, struct TWindowData *dat, const char *fmt, ...);
+int _DebugMessage(HWND hwndDlg, TWindowData *dat, const char *fmt, ...);
// themes
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 5c21fe093c..bb4be75475 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -77,7 +77,7 @@ void TSAPI DM_SaveLogAsRTF(const TWindowData *dat) stream.dwCookie = (DWORD_PTR)szFilename;
stream.dwError = 0;
stream.pfnCallback = Utils::StreamOut;
- SendDlgItemMessage(dat->hwnd, dat->bType == SESSIONTYPE_IM ? IDC_LOG : IDC_CHAT_LOG, EM_STREAMOUT, SF_RTF | SF_USECODEPAGE, (LPARAM)& stream);
+ SendDlgItemMessage(dat->hwnd, dat->bType == SESSIONTYPE_IM ? IDC_LOG : IDC_CHAT_LOG, EM_STREAMOUT, SF_RTF | SF_USECODEPAGE, (LPARAM)&stream);
}
}
}
@@ -627,7 +627,7 @@ LRESULT TSAPI DM_ContainerCmdHandler(TContainerData *pContainer, UINT cmd, WPARA return 0;
HWND hwndDlg = pContainer->hwnd;
- TWindowData *dat = (TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
switch(cmd) {
case IDC_CLOSE:
@@ -875,7 +875,7 @@ void TSAPI DM_InitRichEdit(TWindowData *dat) * set the states of defined database action buttons (only if button is a toggle)
*/
-void TSAPI DM_SetDBButtonStates(HWND hwndChild, struct TWindowData *dat)
+void TSAPI DM_SetDBButtonStates(HWND hwndChild, TWindowData *dat)
{
ButtonItem *buttonItem = dat->pContainer->buttonItems;
HANDLE hContact = dat->hContact, hFinalContact = 0;
@@ -1159,7 +1159,7 @@ HWND TSAPI DM_CreateClist(TWindowData *dat) return hwndClist;
}
-LRESULT TSAPI DM_MouseWheelHandler(HWND hwnd, HWND hwndParent, struct TWindowData *mwdat, WPARAM wParam, LPARAM lParam)
+LRESULT TSAPI DM_MouseWheelHandler(HWND hwnd, HWND hwndParent, TWindowData *mwdat, WPARAM wParam, LPARAM lParam)
{
RECT rc, rc1;
UINT uID = mwdat->bType == SESSIONTYPE_IM ? IDC_LOG : IDC_CHAT_LOG;
@@ -1275,7 +1275,7 @@ LRESULT TSAPI DM_ThemeChanged(TWindowData *dat) * send out message typing notifications (MTN) when the
* user is typing/editing text in the messgae input area.
*/
-void TSAPI DM_NotifyTyping(struct TWindowData *dat, int mode)
+void TSAPI DM_NotifyTyping(TWindowData *dat, int mode)
{
DWORD protoStatus;
DWORD protoCaps;
@@ -1415,7 +1415,7 @@ void TSAPI DM_Typing(TWindowData *dat, bool fForceOff) SendMessage(hwndDlg, DM_UPDATEWINICON, 0, 0);
}
else {
- struct TWindowData *dat_active = NULL;
+ TWindowData *dat_active = NULL;
if (!fForceOff) {
dat->showTyping = 2;
@@ -1428,7 +1428,7 @@ void TSAPI DM_Typing(TWindowData *dat, bool fForceOff) }
SendMessage(hwndDlg, DM_UPDATEWINICON, 0, 0);
HandleIconFeedback(dat, (HICON) - 1);
- dat_active = (struct TWindowData *)GetWindowLongPtr(dat->pContainer->hwndActive, GWLP_USERDATA);
+ dat_active = (TWindowData*)GetWindowLongPtr(dat->pContainer->hwndActive, GWLP_USERDATA);
if (dat_active && dat_active->bType == SESSIONTYPE_IM)
SendMessage(hwndContainer, DM_UPDATETITLE, 0, 0);
else
@@ -1906,7 +1906,7 @@ static int OnSrmmIconChanged(WPARAM wParam, LPARAM) return 0;
}
-void DrawStatusIcons(struct TWindowData *dat, HDC hDC, RECT r, int gap)
+void DrawStatusIcons(TWindowData *dat, HDC hDC, RECT r, int gap)
{
HICON hIcon = NULL;
int x = r.left;
@@ -1956,7 +1956,7 @@ void DrawStatusIcons(struct TWindowData *dat, HDC hDC, RECT r, int gap) }
}
-void SI_CheckStatusIconClick(struct TWindowData *dat, HWND hwndFrom, POINT pt, RECT r, int gap, int code)
+void SI_CheckStatusIconClick(TWindowData *dat, HWND hwndFrom, POINT pt, RECT r, int gap, int code)
{
if (dat && (code == NM_CLICK || code == NM_RCLICK)) {
POINT ptScreen;
diff --git a/plugins/TabSRMM/src/generic_msghandlers.h b/plugins/TabSRMM/src/generic_msghandlers.h index 3ca2707809..2829b42683 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.h +++ b/plugins/TabSRMM/src/generic_msghandlers.h @@ -30,7 +30,7 @@ *
*/
-void TSAPI DM_SetDBButtonStates(HWND hwndChild, struct TWindowData *dat);
+void TSAPI DM_SetDBButtonStates(HWND hwndChild, TWindowData *dat);
HWND TSAPI DM_CreateClist(TWindowData *dat);
void TSAPI DM_OptionsApplied(TWindowData *dat, WPARAM wParam, LPARAM lParam);
@@ -40,7 +40,7 @@ void TSAPI DM_LoadLocale(TWindowData *dat); void TSAPI DM_SaveLocale(TWindowData *dat, WPARAM wParam, LPARAM lParam);
void TSAPI DM_UpdateLastMessage(const TWindowData *dat);
LRESULT TSAPI DM_WMCopyHandler(HWND hwnd, WNDPROC oldWndProc, UINT uMsg, WPARAM wParam, LPARAM lParam);
-LRESULT TSAPI DM_MouseWheelHandler(HWND hwnd, HWND hwndParent, struct TWindowData *mwdat, WPARAM wParam, LPARAM lParam);
+LRESULT TSAPI DM_MouseWheelHandler(HWND hwnd, HWND hwndParent, TWindowData *mwdat, WPARAM wParam, LPARAM lParam);
LRESULT TSAPI DM_ThemeChanged(TWindowData *dat);
void TSAPI DM_Typing(TWindowData *dat, bool fForceOff = false);
void TSAPI DM_FreeTheme(TWindowData *dat);
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index f817a2acb3..be420b1552 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -146,8 +146,6 @@ void CGlobals::reloadSystemStartup() */
void CGlobals::reloadSystemModulesChanged()
{
- BOOL bIEView = FALSE;
-
m_MathModAvail = ServiceExists(MATH_RTF_REPLACE_FORMULAE);
/*
@@ -168,7 +166,7 @@ void CGlobals::reloadSystemModulesChanged() * ieView
*/
- bIEView = ServiceExists(MS_IEVIEW_WINDOW);
+ BOOL bIEView = ServiceExists(MS_IEVIEW_WINDOW);
if (bIEView) {
BOOL bOldIEView = M.GetByte("ieview_installed", 0);
if (bOldIEView != bIEView)
@@ -659,7 +657,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void) TCHAR toolTip[256];
mir_sntprintf(toolTip, SIZEOF(toolTip), TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
cle.ptszTooltip = toolTip;
- CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)& cle);
+ CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
hDbEvent = db_event_next(hDbEvent);
}
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index 5aefa2287c..565705a020 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -68,7 +68,7 @@ static HOTKEYDESC _hotkeydescs[] = { { 0, "tabsrmm_muc_filter", LPGEN("Toggle filter"), TABSRMM_HK_SECTION_GC, 0, HOTKEYCODE(HOTKEYF_SHIFT | HOTKEYF_CONTROL, 'F'), TABSRMM_HK_FILTERTOGGLE },
{ 0, "tabsrmm_muc_nick", LPGEN("Toggle nick list"), TABSRMM_HK_SECTION_GC, 0, HOTKEYCODE(HOTKEYF_SHIFT | HOTKEYF_CONTROL, 'N'), TABSRMM_HK_LISTTOGGLE },
{ 0, "tabsrmm_muc_server_show", LPGEN("Show server window"), TABSRMM_HK_SECTION_GC, 0, HOTKEYCODE(HOTKEYF_SHIFT | HOTKEYF_CONTROL, '1'), TABSRMM_HK_MUC_SHOWSERVER },
- { 0, "tabsrmm_close_other", LPGEN("Close Other Tabs"), TABSRMM_HK_SECTION_GENERIC, 0, HOTKEYCODE(HOTKEYF_ALT|HOTKEYF_CONTROL, 'W'), TABSRMM_HK_CLOSE_OTHER },
+ { 0, "tabsrmm_close_other", LPGEN("Close Other Tabs"), TABSRMM_HK_SECTION_GENERIC, 0, HOTKEYCODE(HOTKEYF_ALT|HOTKEYF_CONTROL, 'W'), TABSRMM_HK_CLOSE_OTHER },
};
static SendLaterJobIterator g_jobs;
@@ -84,7 +84,7 @@ LRESULT ProcessHotkeysByMsgFilter(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa mf.wParam = wParam;
mf.msg = msg;
- return(SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)&mf));
+ return SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)&mf);
}
static INT_PTR HotkeyProcessor(WPARAM wParam, LPARAM lParam)
@@ -199,7 +199,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_DRAWITEM:
{
LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT) lParam;
- struct TWindowData *dat = 0;
+ TWindowData *dat = 0;
if (dis->CtlType == ODT_MENU && (dis->hwndItem == (HWND)PluginConfig.g_hMenuFavorites || dis->hwndItem == (HWND)PluginConfig.g_hMenuRecent)) {
HICON hIcon = (HICON)dis->itemData;
@@ -216,7 +216,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
if (hWnd)
- dat = (struct TWindowData *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
+ dat = (TWindowData*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
if (dis->itemData >= 0) {
HICON hIcon;
@@ -455,7 +455,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP HWND hWnd = M.FindWindow(hContact);
if (hWnd) {
- TWindowData *dat = (TWindowData *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
if (dat) {
if (hkl) {
dat->hkl = hkl;
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp index 21fa97a159..3f76944e22 100644 --- a/plugins/TabSRMM/src/infopanel.cpp +++ b/plugins/TabSRMM/src/infopanel.cpp @@ -50,7 +50,7 @@ int CInfoPanel::setPanelHandler(TWindowData *dat, WPARAM wParam, LPARAM lParam) dat->Panel->showHide();
}
else {
- TWindowData *srcDat = (TWindowData *)wParam;
+ TWindowData *srcDat = (TWindowData*)wParam;
if (lParam == 0)
dat->Panel->loadHeight();
else {
@@ -1025,7 +1025,7 @@ LRESULT CALLBACK CInfoPanel::avatarParentSubclass(HWND hwnd, UINT msg, WPARAM wP * parent window of the infopanel ACC control
*/
RECT rc, rcItem;
- TWindowData *dat = (TWindowData *)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
if (dat == 0)
break;
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index 2fc4b861ea..1b13bdc5f1 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -479,7 +479,7 @@ int CMimAPI::TypingMessage(WPARAM wParam, LPARAM lParam) tn.tszInfo = szTip;
tn.dwInfoFlags = NIIF_INFO | NIIF_INTERN_UNICODE;
tn.uTimeout = 1000 * 4;
- CallService(MS_CLIST_SYSTRAY_NOTIFY, 0, (LPARAM)& tn);
+ CallService(MS_CLIST_SYSTRAY_NOTIFY, 0, (LPARAM)&tn);
}
if (fShowOnClist) {
CLISTEVENT cle = { sizeof(cle) };
@@ -490,7 +490,7 @@ int CMimAPI::TypingMessage(WPARAM wParam, LPARAM lParam) cle.pszService = "SRMsg/TypingMessage";
cle.ptszTooltip = szTip;
CallServiceSync(MS_CLIST_REMOVEEVENT, wParam, (LPARAM)1);
- CallServiceSync(MS_CLIST_ADDEVENT, wParam, (LPARAM)& cle);
+ CallServiceSync(MS_CLIST_ADDEVENT, wParam, (LPARAM)&cle);
}
}
}
@@ -518,7 +518,7 @@ int CMimAPI::ProtoAck(WPARAM wParam, LPARAM lParam) if (pAck->type == ACKTYPE_MESSAGE) {
for (j = 0; j < SendQueue::NR_SENDJOBS; j++) {
if (pAck->hProcess == jobs[j].hSendId && pAck->hContact == jobs[j].hOwner) {
- TWindowData *dat = jobs[j].hwndOwner ? (TWindowData *)GetWindowLongPtr(jobs[j].hwndOwner, GWLP_USERDATA) : NULL;
+ TWindowData *dat = jobs[j].hwndOwner ? (TWindowData*)GetWindowLongPtr(jobs[j].hwndOwner, GWLP_USERDATA) : NULL;
if (dat) {
if (dat->hContact == jobs[j].hOwner) {
iFound = j;
@@ -597,7 +597,7 @@ int CMimAPI::MessageEventAdded(WPARAM wParam, LPARAM lParam) TContainerData *pContainer = 0;
TCHAR szName[CONTAINER_NAMELEN + 1];
DWORD dwStatusMask = 0;
- struct TWindowData *mwdat=NULL;
+ TWindowData *mwdat=NULL;
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get((HANDLE)lParam, &dbei);
@@ -765,7 +765,7 @@ nowindowcreate: contactName = pcli->pfnGetContactDisplayName((HANDLE)wParam, 0);
mir_sntprintf(toolTip, SIZEOF(toolTip), TranslateT("Message from %s"), contactName);
cle.ptszTooltip = toolTip;
- CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)& cle);
+ CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
tabSRMM_ShowPopup(wParam, lParam, dbei.eventType, 0, 0, 0, dbei.szModule, 0);
}
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index ecb45b6d12..f48607bdc1 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -129,7 +129,7 @@ static void ShowPopupMenu(TWindowData *dat, int idFrom, HWND hwndFrom, POINT pt) EnableMenuItem(hSubMenu, ID_EDITOR_SHOWMESSAGELENGTHINDICATOR, MF_BYCOMMAND | (dat->pContainer->hwndStatus ? MF_ENABLED : MF_GRAYED));
}
TranslateMenu(hSubMenu);
- SendMessage(hwndFrom, EM_EXGETSEL, 0, (LPARAM)& sel);
+ SendMessage(hwndFrom, EM_EXGETSEL, 0, (LPARAM)&sel);
if (sel.cpMin == sel.cpMax) {
EnableMenuItem(hSubMenu, IDM_COPY, MF_BYCOMMAND | MF_GRAYED);
//MAD
@@ -195,9 +195,9 @@ static void ShowPopupMenu(TWindowData *dat, int idFrom, HWND hwndFrom, POINT pt) SendMessage(hwndFrom, EM_PASTESPECIAL, (iSelection == IDM_PASTE) ? CF_UNICODETEXT : 0, 0);
break;
case IDM_COPYALL:
- SendMessage(hwndFrom, EM_EXSETSEL, 0, (LPARAM)& all);
+ SendMessage(hwndFrom, EM_EXSETSEL, 0, (LPARAM)&all);
SendMessage(hwndFrom, WM_COPY, 0, 0);
- SendMessage(hwndFrom, EM_EXSETSEL, 0, (LPARAM)& sel);
+ SendMessage(hwndFrom, EM_EXSETSEL, 0, (LPARAM)&sel);
break;
//MAD
case IDM_QUOTE:
@@ -205,7 +205,7 @@ static void ShowPopupMenu(TWindowData *dat, int idFrom, HWND hwndFrom, POINT pt) break;
//MAD_
case IDM_SELECTALL:
- SendMessage(hwndFrom, EM_EXSETSEL, 0, (LPARAM)& all);
+ SendMessage(hwndFrom, EM_EXSETSEL, 0, (LPARAM)&all);
break;
case IDM_CLEAR:
ClearLog(dat);
@@ -263,7 +263,7 @@ static void ResizeIeView(const TWindowData *dat, DWORD px, DWORD py, DWORD cx, D LRESULT CALLBACK IEViewSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- struct TWindowData *mwdat = (struct TWindowData *)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
+ TWindowData *mwdat = (TWindowData*)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
switch (msg) {
case WM_NCCALCSIZE:
@@ -280,7 +280,7 @@ LRESULT CALLBACK IEViewSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l LRESULT CALLBACK HPPKFSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- struct TWindowData *mwdat = (struct TWindowData *)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
+ TWindowData *mwdat = (TWindowData*)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
if (mwdat) {
BOOL isCtrl, isShift, isAlt;
KbdState(mwdat, isShift, isCtrl, isAlt);
@@ -457,10 +457,10 @@ void TSAPI ShowMultipleControls(HWND hwndDlg, const UINT *controls, int cControl void TSAPI SetDialogToType(HWND hwndDlg)
{
- struct TWindowData *dat;
+ TWindowData *dat;
int showToolbar = 0;
- dat = (struct TWindowData *) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ dat = (TWindowData*) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
showToolbar = dat->pContainer->dwFlags & CNT_HIDETOOLBAR ? 0 : 1;
if (dat->hContact) {
@@ -517,7 +517,7 @@ void TSAPI SetDialogToType(HWND hwndDlg) static LRESULT CALLBACK MessageLogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
HWND hwndParent = GetParent(hwnd);
- TWindowData *mwdat = (TWindowData *)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
+ TWindowData *mwdat = (TWindowData*)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
BOOL isCtrl, isShift, isAlt;
KbdState(mwdat, isShift, isCtrl, isAlt);
@@ -582,7 +582,7 @@ static LRESULT CALLBACK MessageLogSubclassProc(HWND hwnd, UINT msg, WPARAM wPara if (lParam == 0xFFFFFFFF) {
CHARRANGE sel;
- SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)& sel);
+ SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)&sel);
SendMessage(hwnd, EM_POSFROMCHAR, (WPARAM)& pt, (LPARAM)sel.cpMax);
ClientToScreen(hwnd, &pt);
}
@@ -601,7 +601,7 @@ static LRESULT CALLBACK MessageLogSubclassProc(HWND hwnd, UINT msg, WPARAM wPara static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
HWND hwndParent = GetParent(hwnd);
- struct TWindowData *mwdat = (struct TWindowData *)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
+ TWindowData *mwdat = (TWindowData*)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
if (mwdat == NULL)
return 0;
@@ -864,7 +864,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar if (lParam == 0xFFFFFFFF) {
CHARRANGE sel;
- SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)& sel);
+ SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)&sel);
SendMessage(hwnd, EM_POSFROMCHAR, (WPARAM)& pt, (LPARAM)sel.cpMax);
ClientToScreen(hwnd, &pt);
} else {
@@ -897,7 +897,7 @@ static LRESULT CALLBACK AvatarSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, L LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
HWND hwndParent = GetParent(hwnd);
- TWindowData *dat = (TWindowData *)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
switch (msg) {
case WM_NCHITTEST:
@@ -919,10 +919,9 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM dat->savedSplitter = rc.right > rc.bottom ? (short) HIWORD(GetMessagePos()) + rc.bottom / 2 : (short) LOWORD(GetMessagePos()) + rc.right / 2;
if (dat->bType == SESSIONTYPE_IM)
dat->savedSplitY = dat->splitterY;
- else {
- SESSION_INFO *si = (SESSION_INFO*)dat->si;
- dat->savedSplitY = si->iSplitterY;
- }
+ else
+ dat->savedSplitY = dat->si->iSplitterY;
+
dat->savedDynaSplit = dat->dynaSplitter;
}
}
@@ -1044,9 +1043,9 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM dat->dynaSplitter = dat->savedDynaSplit;
DM_RecalcPictureSize(dat);
if (dat->bType == SESSIONTYPE_CHAT) {
- SESSION_INFO *si = (SESSION_INFO*)dat->si;
+ SESSION_INFO *si = dat->si;
si->iSplitterY = dat->savedSplitY;
- dat->splitterY =si->iSplitterY + DPISCALEY_S(22);
+ dat->splitterY = si->iSplitterY + DPISCALEY_S(22);
}
CSkin::UpdateToolbarBG(dat);
SendMessage(hwndParent, WM_SIZE, 0, 0);
@@ -1065,7 +1064,7 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL * urc)
{
- TWindowData* dat = (TWindowData *) lParam;
+ TWindowData* dat = (TWindowData*) lParam;
RECT rc, rcButton;
static int uinWidth, msgTop = 0, msgBottom = 0;
@@ -1075,7 +1074,7 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL * int panelHeight = dat->Panel->getHeight() + 1;
int s_offset = 0;
- bool fInfoPanel = dat->Panel->isActive();
+ bool bInfoPanel = dat->Panel->isActive();
bool fErrorState = (dat->dwFlags & MWF_ERRORSTATE) ? true : false;
GetClientRect(GetDlgItem(hwndDlg, IDC_LOG), &rc);
@@ -1101,7 +1100,7 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL * urc->rcItem.bottom -= dat->splitterY - dat->originalSplitterY;
if (!showToolbar||bBottomToolbar)
urc->rcItem.bottom += 21;
- if (fInfoPanel)
+ if (bInfoPanel)
urc->rcItem.top += panelHeight;
urc->rcItem.bottom += 3;
if (CSkin::m_skinEnabled) {
@@ -1144,7 +1143,7 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL * RECT rc = { urc->rcItem.left, urc->rcItem.top, urc->rcItem.right, urc->rcItem.bottom };
FLASHAVATAR fa = {0};
- fa.hContact = !fInfoPanel ? dat->hContact : NULL;
+ fa.hContact = !bInfoPanel ? dat->hContact : NULL;
fa.id = 25367;
fa.cProto = dat->szProto;
CallService(MS_FAVATAR_RESIZE, (WPARAM)&fa, (LPARAM)&rc);
@@ -1185,7 +1184,7 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL * }
return RD_ANCHORX_CUSTOM | RD_ANCHORY_BOTTOM;
case IDC_MULTISPLITTER:
- if (fInfoPanel)
+ if (bInfoPanel)
urc->rcItem.top += panelHeight;
urc->rcItem.left -= dat->multiSplitterX;
urc->rcItem.right -= dat->multiSplitterX;
@@ -1254,11 +1253,13 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP TContainerData *m_pContainer = 0;
TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
HWND hwndTab = GetParent(hwndDlg), hwndContainer;
+ POINT pt, tmp, cur;
if (dat == 0) {
if (msg == WM_ACTIVATE || msg == WM_SETFOCUS)
return 0;
- } else {
+ }
+ else {
m_pContainer = dat->pContainer;
hwndContainer = m_pContainer->hwnd;
}
@@ -1267,15 +1268,14 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case WM_INITDIALOG:
{
RECT rc;
- POINT pt;
int i;
BOOL isThemed = PluginConfig.m_bIsXP;
int dwLocalSmAdd = 0;
DBVARIANT dbv = {0};
- struct TNewWindowData *newData = (struct TNewWindowData *) lParam;
+ TNewWindowData *newData = (TNewWindowData *) lParam;
- dat = (TWindowData *)calloc(sizeof(TWindowData), 1);
+ dat = (TWindowData*)calloc(sizeof(TWindowData), 1);
if (newData->iTabID >= 0) {
dat->pContainer = newData->pContainer;
m_pContainer = dat->pContainer;
@@ -1613,13 +1613,13 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case WM_ERASEBKGND:
{
- HDC hdc = (HDC)wParam;
+ HDC hdc = (HDC)wParam;
- RECT rcClient, rcWindow, rc;
- HDC hdcMem = 0;
- HBITMAP hbm, hbmOld;
- DWORD cx, cy;
- HANDLE hpb = 0;
+ RECT rcClient, rcWindow, rc;
+ HDC hdcMem = 0;
+ HBITMAP hbm, hbmOld;
+ DWORD cx, cy;
+ HANDLE hpb = 0;
GetClientRect(hwndDlg, &rcClient);
cx = rcClient.right - rcClient.left;
@@ -1633,12 +1633,11 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP hbmOld = (HBITMAP)SelectObject(hdcMem, hbm);
}
- bool fInfoPanel = dat->Panel->isActive();
+ bool bInfoPanel = dat->Panel->isActive();
bool fAero = M.isAero();
if (CSkin::m_skinEnabled) {
CSkinItem *item;
- POINT pt;
UINT item_ids[2] = {ID_EXTBKHISTORY, ID_EXTBKINPUTAREA};
UINT ctl_ids[2] = {IDC_LOG, IDC_MESSAGE};
int i;
@@ -1760,7 +1759,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP urd.lParam = (LPARAM)dat;
urd.lpTemplate = MAKEINTRESOURCEA(IDD_MSGSPLITNEW);
urd.pfnResizer = MessageDialogResize;
- CallService(MS_UTILS_RESIZEDIALOG, 0, (LPARAM)& urd);
+ CallService(MS_UTILS_RESIZEDIALOG, 0, (LPARAM)&urd);
BB_SetButtonsPos(dat);
@@ -2101,8 +2100,6 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP //MAD_
if (msg == WM_MOUSEWHEEL && (((NMHDR *)lParam)->idFrom == IDC_LOG || ((NMHDR *)lParam)->idFrom == IDC_MESSAGE)) {
RECT rc;
- POINT pt;
-
GetCursorPos(&pt);
GetWindowRect(GetDlgItem(hwndDlg, IDC_LOG), &rc);
if (PtInRect(&rc, pt)) {
@@ -2248,23 +2245,20 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP TEXTRANGEA tr;
CHARRANGE sel;
- SendDlgItemMessage(hwndDlg, IDC_LOG, EM_EXGETSEL, 0, (LPARAM)& sel);
+ SendDlgItemMessage(hwndDlg, IDC_LOG, EM_EXGETSEL, 0, (LPARAM)&sel);
if (sel.cpMin != sel.cpMax)
break;
tr.chrg = ((ENLINK *) lParam)->chrg;
tr.lpstrText = (char *)mir_alloc(tr.chrg.cpMax - tr.chrg.cpMin + 8);
- SendDlgItemMessageA(hwndDlg, IDC_LOG, EM_GETTEXTRANGE, 0, (LPARAM)& tr);
+ SendDlgItemMessageA(hwndDlg, IDC_LOG, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
if (strchr(tr.lpstrText, '@') != NULL && strchr(tr.lpstrText, ':') == NULL && strchr(tr.lpstrText, '/') == NULL) {
MoveMemory(tr.lpstrText + 7, tr.lpstrText, tr.chrg.cpMax - tr.chrg.cpMin + 1);
CopyMemory(tr.lpstrText, _T("mailto:"), 7);
}
if (IsStringValidLinkA(tr.lpstrText)) {
if (((ENLINK *) lParam)->msg == WM_RBUTTONDOWN) {
- HMENU hMenu, hSubMenu;
- POINT pt;
-
- hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_CONTEXT));
- hSubMenu = GetSubMenu(hMenu, 1);
+ HMENU hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_CONTEXT));
+ HMENU hSubMenu = GetSubMenu(hMenu, 1);
TranslateMenu(hSubMenu);
pt.x = (short) LOWORD(((ENLINK *) lParam)->lParam);
pt.y = (short) HIWORD(((ENLINK *) lParam)->lParam);
@@ -2444,16 +2438,14 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case DM_SPLITTERMOVED:
{
- POINT pt;
RECT rc;
if ((HWND) lParam == GetDlgItem(hwndDlg, IDC_MULTISPLITTER)) {
- int oldSplitterX;
GetClientRect(hwndDlg, &rc);
pt.x = wParam;
pt.y = 0;
ScreenToClient(hwndDlg, &pt);
- oldSplitterX = dat->multiSplitterX;
+ int oldSplitterX = dat->multiSplitterX;
dat->multiSplitterX = rc.right - pt.x;
if (dat->multiSplitterX < 25)
dat->multiSplitterX = 25;
@@ -2634,8 +2626,6 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP * timer to control info panel hovering
*/
if (wParam == TIMERID_AWAYMSG) {
- POINT pt;
-
KillTimer(hwndDlg, wParam);
GetCursorPos(&pt);
@@ -2819,98 +2809,87 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SendMessage(hwndContainer, DM_QUERYPENDING, wParam, lParam);
return 0;
- case WM_LBUTTONDOWN: {
- POINT tmp; //+ Protogenes
- POINTS cur; //+ Protogenes
- GetCursorPos(&tmp); //+ Protogenes
- cur.x = (SHORT)tmp.x; //+ Protogenes
- cur.y = (SHORT)tmp.y; //+ Protogenes
+ case WM_LBUTTONDOWN:
+ GetCursorPos(&tmp);
+ cur.x = (SHORT)tmp.x;
+ cur.y = (SHORT)tmp.y;
if (!dat->Panel->isHovered())
- SendMessage(hwndContainer, WM_NCLBUTTONDOWN, HTCAPTION, *((LPARAM*)(&cur))); //+ Protogenes
+ SendMessage(hwndContainer, WM_NCLBUTTONDOWN, HTCAPTION, *((LPARAM*)(&cur)));
break;
- }
- case WM_LBUTTONUP: {
- POINT tmp; //+ Protogenes
- POINTS cur; //+ Protogenes
- GetCursorPos(&tmp); //+ Protogenes
+
+ case WM_LBUTTONUP:
+ GetCursorPos(&tmp);
if (dat->Panel->isHovered())
dat->Panel->handleClick(tmp);
else {
- cur.x = (SHORT)tmp.x; //+ Protogenes
- cur.y = (SHORT)tmp.y; //+ Protogenes
- SendMessage(hwndContainer, WM_NCLBUTTONUP, HTCAPTION, *((LPARAM*)(&cur))); //+ Protogenes
+ cur.x = (SHORT)tmp.x;
+ cur.y = (SHORT)tmp.y;
+ SendMessage(hwndContainer, WM_NCLBUTTONUP, HTCAPTION, *((LPARAM*)(&cur)));
}
break;
- }
- case WM_RBUTTONUP: {
- POINT pt;
- int iSelection;
- HMENU subMenu;
- int isHandled;
- RECT rcPicture, rcPanelNick = {0};
- int menuID = 0;
-
- GetWindowRect(GetDlgItem(hwndDlg, IDC_CONTACTPIC), &rcPicture);
- rcPanelNick.left = rcPanelNick.right - 30;
- GetCursorPos(&pt);
+ case WM_RBUTTONUP:
+ {
+ RECT rcPicture, rcPanelNick = {0};
+ int menuID = 0;
- if (dat->Panel->invokeConfigDialog(pt))
- break;
+ GetWindowRect(GetDlgItem(hwndDlg, IDC_CONTACTPIC), &rcPicture);
+ rcPanelNick.left = rcPanelNick.right - 30;
+ GetCursorPos(&pt);
- if (PtInRect(&rcPicture, pt))
- menuID = MENU_PICMENU;
+ if (dat->Panel->invokeConfigDialog(pt))
+ break;
- if ((menuID == MENU_PICMENU && ((dat->ace ? dat->ace->hbmPic : PluginConfig.g_hbmUnknown) || dat->hOwnPic) && dat->showPic != 0)) {
- int iSelection, isHandled;
- HMENU submenu = 0;
+ if (PtInRect(&rcPicture, pt))
+ menuID = MENU_PICMENU;
- submenu = GetSubMenu(m_pContainer->hMenuContext, menuID == MENU_PICMENU ? 1 : 11);
- GetCursorPos(&pt);
- MsgWindowUpdateMenu(dat, submenu, menuID);
- iSelection = TrackPopupMenu(submenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL);
- isHandled = MsgWindowMenuHandler(dat, iSelection, menuID);
- break;
- }
- subMenu = GetSubMenu(m_pContainer->hMenuContext, 0);
+ if ((menuID == MENU_PICMENU && ((dat->ace ? dat->ace->hbmPic : PluginConfig.g_hbmUnknown) || dat->hOwnPic) && dat->showPic != 0)) {
+ HMENU submenu = GetSubMenu(m_pContainer->hMenuContext, menuID == MENU_PICMENU ? 1 : 11);
+ GetCursorPos(&pt);
+ MsgWindowUpdateMenu(dat, submenu, menuID);
+ int iSelection = TrackPopupMenu(submenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL);
+ MsgWindowMenuHandler(dat, iSelection, menuID);
+ break;
+ }
- MsgWindowUpdateMenu(dat, subMenu, MENU_TABCONTEXT);
+ HMENU subMenu = GetSubMenu(m_pContainer->hMenuContext, 0);
+ MsgWindowUpdateMenu(dat, subMenu, MENU_TABCONTEXT);
- iSelection = TrackPopupMenu(subMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL);
- if (iSelection >= IDM_CONTAINERMENU) {
- DBVARIANT dbv = {0};
- char szIndex[10];
- char *szKey = "TAB_ContainersW";
+ int iSelection = TrackPopupMenu(subMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL);
+ if (iSelection >= IDM_CONTAINERMENU) {
+ DBVARIANT dbv = {0};
+ char szIndex[10];
+ char *szKey = "TAB_ContainersW";
- mir_snprintf(szIndex, SIZEOF(szIndex), "%d", iSelection - IDM_CONTAINERMENU);
- if (iSelection - IDM_CONTAINERMENU >= 0) {
- if (!db_get_ts(NULL, szKey, szIndex, &dbv)) {
- SendMessage(hwndDlg, DM_CONTAINERSELECTED, 0, (LPARAM)dbv.ptszVal);
- db_free(&dbv);
+ mir_snprintf(szIndex, SIZEOF(szIndex), "%d", iSelection - IDM_CONTAINERMENU);
+ if (iSelection - IDM_CONTAINERMENU >= 0) {
+ if (!db_get_ts(NULL, szKey, szIndex, &dbv)) {
+ SendMessage(hwndDlg, DM_CONTAINERSELECTED, 0, (LPARAM)dbv.ptszVal);
+ db_free(&dbv);
+ }
}
+ break;
}
-
- break;
+ MsgWindowMenuHandler(dat, iSelection, MENU_TABCONTEXT);
}
- isHandled = MsgWindowMenuHandler(dat, iSelection, MENU_TABCONTEXT);
break;
- }
- case WM_MOUSEMOVE: {
- POINT pt;
+
+ case WM_MOUSEMOVE:
GetCursorPos(&pt);
DM_DismissTip(dat, pt);
dat->Panel->trackMouse(pt);
break;
- }
- case WM_MEASUREITEM: {
- LPMEASUREITEMSTRUCT lpmi = (LPMEASUREITEMSTRUCT) lParam;
- if (dat->Panel->isHovered()) {
- lpmi->itemHeight = 0;
- lpmi->itemWidth = 6;
- return TRUE;
+
+ case WM_MEASUREITEM:
+ {
+ LPMEASUREITEMSTRUCT lpmi = (LPMEASUREITEMSTRUCT) lParam;
+ if (dat->Panel->isHovered()) {
+ lpmi->itemHeight = 0;
+ lpmi->itemWidth = 6;
+ return TRUE;
+ }
}
return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam);
- }
case WM_NCHITTEST:
SendMessage(hwndContainer, WM_NCHITTEST, wParam, lParam);
@@ -2951,18 +2930,18 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP FINDTEXTEXA fi = {0};
int final_sendformat = dat->SendFormat;
HWND hwndEdit = GetDlgItem(hwndDlg, IDC_MESSAGE);
- PARAFORMAT2 pf2;
// don't parse text formatting when the message contains curly braces - these are used by the rtf syntax
// and the parser currently cannot handle them properly in the text - XXX needs to be fixed later.
+ PARAFORMAT2 pf2;
ZeroMemory(&pf2, sizeof(PARAFORMAT2));
fi.chrg.cpMin = 0;
fi.chrg.cpMax = -1;
fi.lpstrText = "{";
- final_sendformat = SendDlgItemMessageA(hwndDlg, IDC_MESSAGE, EM_FINDTEXTEX, FR_DOWN, (LPARAM)& fi) == -1 ? final_sendformat : 0;
+ final_sendformat = SendDlgItemMessageA(hwndDlg, IDC_MESSAGE, EM_FINDTEXTEX, FR_DOWN, (LPARAM)&fi) == -1 ? final_sendformat : 0;
fi.lpstrText = "}";
- final_sendformat = SendDlgItemMessageA(hwndDlg, IDC_MESSAGE, EM_FINDTEXTEX, FR_DOWN, (LPARAM)& fi) == -1 ? final_sendformat : 0;
+ final_sendformat = SendDlgItemMessageA(hwndDlg, IDC_MESSAGE, EM_FINDTEXTEX, FR_DOWN, (LPARAM)&fi) == -1 ? final_sendformat : 0;
if (GetSendButtonState(hwndDlg) == PBS_DISABLED)
break;
@@ -3078,19 +3057,19 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (dat->hwndIEView || dat->hwndHPP) { // IEView quoting support..
TCHAR *selected = 0, *szQuoted = 0;
- IEVIEWEVENT event;
- ZeroMemory((void*)&event, sizeof(event));
- event.cbSize = sizeof(IEVIEWEVENT);
+
+ IEVIEWEVENT event = { sizeof(event) };
event.hContact = dat->hContact;
event.dwFlags = 0;
event.iType = IEE_GET_SELECTION;
if (dat->hwndIEView) {
event.hwnd = dat->hwndIEView;
- selected = (TCHAR *)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)& event);
- } else {
+ selected = (TCHAR *)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&event);
+ }
+ else {
event.hwnd = dat->hwndHPP;
- selected = (TCHAR *)CallService(MS_HPP_EG_EVENT, 0, (LPARAM)& event);
+ selected = (TCHAR *)CallService(MS_HPP_EG_EVENT, 0, (LPARAM)&event);
}
if (selected != NULL) {
@@ -3122,7 +3101,8 @@ quote_from_last: if (dbei.flags & DBEF_UTF) {
szConverted = mir_utf8decodeW((char*)szText);
iAlloced = TRUE;
- } else {
+ }
+ else {
if (iSize != dbei.cbBlob)
szConverted = (TCHAR *) & dbei.pBlob[iSize];
else {
@@ -3147,10 +3127,10 @@ quote_from_last: free(szQuoted);
if (iAlloced)
mir_free(szConverted);
- } else {
- wchar_t *converted = 0;
+ }
+ else {
szFromStream = Message_GetFromStream(GetDlgItem(hwndDlg, IDC_LOG), dat, SF_TEXT | SF_USECODEPAGE | SFF_SELECTION);
- converted = mir_utf8decodeW(szFromStream);
+ wchar_t *converted = mir_utf8decodeW(szFromStream);
Utils::FilterEventMarkers(converted);
szQuoted = QuoteText(converted, iCharsPerLine, 0);
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&stx, (LPARAM)szQuoted);
@@ -3168,7 +3148,7 @@ quote_from_last: acs.handle = dat->hContact;
acs.handleType = HANDLE_CONTACT;
acs.szProto = 0;
- CallService(MS_ADDCONTACT_SHOW, (WPARAM)hwndDlg, (LPARAM)& acs);
+ CallService(MS_ADDCONTACT_SHOW, (WPARAM)hwndDlg, (LPARAM)&acs);
if (!db_get_b(dat->hContact, "CList", "NotOnList", 0)) {
dat->bNotOnList = FALSE;
ShowMultipleControls(hwndDlg, addControls, 2, SW_HIDE);
@@ -3205,11 +3185,9 @@ quote_from_last: if (!(dat->dwFlags & MWF_INITMODE))
DM_NotifyTyping(dat, PROTOTYPE_SELFTYPING_ON);
}
- } else {
- if (dat->nTypeMode == PROTOTYPE_SELFTYPING_ON) {
- DM_NotifyTyping(dat, PROTOTYPE_SELFTYPING_OFF);
- }
}
+ else if (dat->nTypeMode == PROTOTYPE_SELFTYPING_ON)
+ DM_NotifyTyping(dat, PROTOTYPE_SELFTYPING_OFF);
}
}
break;
@@ -3222,20 +3200,15 @@ quote_from_last: case WM_CONTEXTMENU:
{
- //mad
- DWORD idFrom=GetDlgCtrlID((HWND)wParam);
-
- if (idFrom>=MIN_CBUTTONID&&idFrom<=MAX_CBUTTONID) {
+ DWORD idFrom = GetDlgCtrlID((HWND)wParam);
+ if (idFrom >= MIN_CBUTTONID && idFrom <= MAX_CBUTTONID) {
BB_CustomButtonClick(dat,idFrom,(HWND) wParam,1);
break;
}
- //
- if ((HWND)wParam == GetDlgItem(hwndDlg,IDC_NAME/* IDC_PROTOCOL*/) && dat->hContact != 0) {
- POINT pt;
- HMENU hMC;
+ if ((HWND)wParam == GetDlgItem(hwndDlg,IDC_NAME/* IDC_PROTOCOL*/) && dat->hContact != 0) {
GetCursorPos(&pt);
- hMC = BuildMCProtocolMenu(hwndDlg);
+ HMENU hMC = BuildMCProtocolMenu(hwndDlg);
if (hMC) {
int iSelection = 0;
iSelection = TrackPopupMenu(hMC, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL);
@@ -3245,15 +3218,17 @@ quote_from_last: db_set_dw(dat->hContact, SRMSGMOD_T, "tabSRMM_forced", -1);
else
_DebugPopup(dat->hContact, TranslateT("Unforce failed"));
- } else {
+ }
+ else {
if (CallService(MS_MC_FORCESENDCONTACTNUM, (WPARAM)dat->hContact, (LPARAM)(iSelection - 100)) == 0)
db_set_dw(dat->hContact, SRMSGMOD_T, "tabSRMM_forced", (DWORD)(iSelection - 100));
else
_DebugPopup(dat->hContact, TranslateT("The selected protocol cannot be forced at this time"));
}
- } else if (iSelection >= 1000) { // the "default" menu...
- CallService(MS_MC_SETDEFAULTCONTACTNUM, (WPARAM)dat->hContact, (LPARAM)(iSelection - 1000));
}
+ else if (iSelection >= 1000) // the "default" menu...
+ CallService(MS_MC_SETDEFAULTCONTACTNUM, (WPARAM)dat->hContact, (LPARAM)(iSelection - 1000));
+
DestroyMenu(hMC);
InvalidateRect(GetParent(hwndDlg), NULL, FALSE);
return TRUE;
@@ -3286,16 +3261,15 @@ quote_from_last: */
case DM_CONTAINERSELECTED:
{
- TContainerData *pNewContainer = 0;
TCHAR *szNewName = (TCHAR *)lParam;
-
if (!_tcscmp(szNewName, TranslateT("Default container")))
szNewName = CGlobals::m_default_container_name;
int iOldItems = TabCtrl_GetItemCount(hwndTab);
if (!_tcsncmp(m_pContainer->szName, szNewName, CONTAINER_NAMELEN))
break;
- pNewContainer = FindContainerByName(szNewName);
+
+ TContainerData *pNewContainer = FindContainerByName(szNewName);
if (pNewContainer == NULL)
pNewContainer = CreateContainer(szNewName, FALSE, dat->hContact);
db_set_ts(dat->hContact, SRMSGMOD_T, "containerW", szNewName);
@@ -3424,17 +3398,21 @@ quote_from_last: case DM_REMOVEPOPUPS:
DeletePopupsForContact(dat->hContact, (DWORD)wParam);
return 0;
+
case EM_THEMECHANGED:
DM_FreeTheme(dat);
return DM_ThemeChanged(dat);
+
case DM_PLAYINCOMINGSOUND:
if (!dat)
return 0;
PlayIncomingSound(dat);
return 0;
+
case DM_REFRESHTABINDEX:
dat->iTabID = GetTabIndexFromHWND(GetParent(hwndDlg), hwndDlg);
return 0;
+
case DM_STATUSICONCHANGE:
if (m_pContainer->hwndStatus) {
SendMessage(dat->pContainer->hwnd, WM_SIZE, 0, 0);
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 2960f10eda..b42674cd82 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -196,7 +196,7 @@ static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic) ofn.lpstrInitialDir = szFinalPath;
ofn.nMaxFile = MAX_PATH;
ofn.nMaxFileTitle = MAX_PATH;
- ofn.lCustData = (LPARAM)& setView;
+ ofn.lCustData = (LPARAM)&setView;
if (GetSaveFileName(&ofn)) {
if (PathFileExists(szFinalFilename)) {
if (MessageBox(0, TranslateT("The file exists. Do you want to overwrite it?"),
@@ -218,7 +218,7 @@ static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic) * store flashing state into bState
*/
-void TSAPI FlashTab(struct TWindowData *dat, HWND hwndTab, int iTabindex, BOOL *bState, BOOL mode, HICON origImage)
+void TSAPI FlashTab(TWindowData *dat, HWND hwndTab, int iTabindex, BOOL *bState, BOOL mode, HICON origImage)
{
TCITEM item;
@@ -247,14 +247,14 @@ void TSAPI CalcDynamicAvatarSize(TWindowData *dat, BITMAP *bminfo) double picProjectedWidth = 0;
BOOL bBottomToolBar=dat->pContainer->dwFlags & CNT_BOTTOMTOOLBAR;
BOOL bToolBar=dat->pContainer->dwFlags & CNT_HIDETOOLBAR?0:1;
- bool fInfoPanel = dat->Panel->isActive();
+ bool bInfoPanel = dat->Panel->isActive();
int iSplitOffset = dat->fIsAutosizingInput ? 1 : 0;
if (PluginConfig.g_FlashAvatarAvail) {
FLASHAVATAR fa = {0};
fa.cProto = dat->szProto;
fa.id = 25367;
- fa.hContact = fInfoPanel ? NULL : dat->hContact;
+ fa.hContact = bInfoPanel ? NULL : dat->hContact;
CallService(MS_FAVATAR_GETINFO, (WPARAM)&fa, 0);
if (fa.hWindow) {
bminfo->bmHeight = FAVATAR_HEIGHT;
@@ -300,10 +300,10 @@ void TSAPI CalcDynamicAvatarSize(TWindowData *dat, BITMAP *bminfo) int TSAPI MsgWindowUpdateMenu(TWindowData *dat, HMENU submenu, int menuID)
{
HWND hwndDlg = dat->hwnd;
- bool fInfoPanel = dat->Panel->isActive();
+ bool bInfoPanel = dat->Panel->isActive();
if (menuID == MENU_TABCONTEXT) {
- SESSION_INFO *si = (SESSION_INFO*)dat->si;
+ 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);
@@ -313,7 +313,7 @@ int TSAPI MsgWindowUpdateMenu(TWindowData *dat, HMENU submenu, int menuID) TCHAR *szText = NULL;
char avOverride = (char)M.GetByte(dat->hContact, "hideavatar", -1);
HMENU visMenu = GetSubMenu(submenu, 0);
- BOOL picValid = fInfoPanel ? (dat->hOwnPic != 0) : (dat->ace && dat->ace->hbmPic && dat->ace->hbmPic != PluginConfig.g_hbmUnknown);
+ BOOL picValid = bInfoPanel ? (dat->hOwnPic != 0) : (dat->ace && dat->ace->hbmPic && dat->ace->hbmPic != PluginConfig.g_hbmUnknown);
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_STRING;
@@ -324,7 +324,7 @@ int TSAPI MsgWindowUpdateMenu(TWindowData *dat, HMENU submenu, int menuID) CheckMenuItem(visMenu, ID_VISIBILITY_VISIBLEFORTHISCONTACT, MF_BYCOMMAND | (avOverride == 1 ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem(submenu, ID_PICMENU_ALWAYSKEEPTHEBUTTONBARATFULLWIDTH, MF_BYCOMMAND | (PluginConfig.m_AlwaysFullToolbarWidth ? MF_CHECKED : MF_UNCHECKED));
- if (!fInfoPanel) {
+ if (!bInfoPanel) {
EnableMenuItem(submenu, ID_PICMENU_SETTINGS, MF_BYCOMMAND | (ServiceExists(MS_AV_GETAVATARBITMAP) ? MF_ENABLED : MF_GRAYED));
szText = TranslateT("Contact Picture Settings...");
EnableMenuItem(submenu, 0, MF_BYPOSITION | MF_ENABLED);
@@ -380,7 +380,7 @@ int TSAPI MsgWindowMenuHandler(TWindowData *dat, int selection, int menuId) break;
case ID_TABMENU_LEAVECHATROOM: {
if (dat && dat->bType == SESSIONTYPE_CHAT) {
- SESSION_INFO *si = (SESSION_INFO*)dat->si;
+ SESSION_INFO *si = dat->si;
if ( (si != NULL) && (dat->hContact != NULL)) {
char *szProto = GetContactProto(dat->hContact);
if (szProto)
@@ -573,7 +573,7 @@ void TSAPI HandleIconFeedback(TWindowData *dat, HICON iIcon) * and local mode
*/
-int TSAPI GetAvatarVisibility(HWND hwndDlg, struct TWindowData *dat)
+int TSAPI GetAvatarVisibility(HWND hwndDlg, TWindowData *dat)
{
BYTE bAvatarMode = dat->pContainer->avatarMode;
BYTE bOwnAvatarMode = dat->pContainer->ownAvatarMode;
@@ -805,8 +805,8 @@ TCHAR* TSAPI QuoteText(const TCHAR *text, int charsPerLine, int removeExistingQu void TSAPI AdjustBottomAvatarDisplay(TWindowData *dat)
{
if (dat) {
- bool fInfoPanel = dat->Panel->isActive();
- HBITMAP hbm = (fInfoPanel && dat->pContainer->avatarMode != 3) ? dat->hOwnPic : (dat->ace ? dat->ace->hbmPic : PluginConfig.g_hbmUnknown);
+ bool bInfoPanel = dat->Panel->isActive();
+ HBITMAP hbm = (bInfoPanel && dat->pContainer->avatarMode != 3) ? dat->hOwnPic : (dat->ace ? dat->ace->hbmPic : PluginConfig.g_hbmUnknown);
HWND hwndDlg = dat->hwnd;
if (PluginConfig.g_FlashAvatarAvail) {
@@ -819,11 +819,11 @@ void TSAPI AdjustBottomAvatarDisplay(TWindowData *dat) CallService(MS_FAVATAR_GETINFO, (WPARAM)&fa, 0);
if (fa.hWindow) {
dat->hwndFlash = fa.hWindow;
- SetParent(dat->hwndFlash, fInfoPanel ? dat->hwndPanelPicParent : GetDlgItem(dat->hwnd, IDC_CONTACTPIC));
+ SetParent(dat->hwndFlash, bInfoPanel ? dat->hwndPanelPicParent : GetDlgItem(dat->hwnd, IDC_CONTACTPIC));
}
fa.hContact = 0;
fa.hWindow = 0;
- if (fInfoPanel) {
+ if (bInfoPanel) {
fa.hParentWindow = GetDlgItem(hwndDlg, IDC_CONTACTPIC);
CallService(MS_FAVATAR_MAKE, (WPARAM)&fa, 0);
if (fa.hWindow) {
@@ -888,7 +888,7 @@ void TSAPI ShowPicture(TWindowData *dat, BOOL showNewPic) }
-void TSAPI FlashOnClist(HWND hwndDlg, struct TWindowData *dat, HANDLE hEvent, DBEVENTINFO *dbei)
+void TSAPI FlashOnClist(HWND hwndDlg, TWindowData *dat, HANDLE hEvent, DBEVENTINFO *dbei)
{
CLISTEVENT cle;
@@ -912,7 +912,7 @@ void TSAPI FlashOnClist(HWND hwndDlg, struct TWindowData *dat, HANDLE hEvent, DB cle.hDbEvent = hEvent;
cle.hIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = "SRMsg/ReadMessage";
- CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)& cle);
+ CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
dat->dwFlagsEx |= MWF_SHOW_FLASHCLIST;
dat->hFlashingEvent = hEvent;
}
@@ -967,7 +967,7 @@ char* TSAPI Message_GetFromStream(HWND hwndRtf, const TWindowData *dat, DWORD dw dwFlags = (CP_UTF8 << 16) | (SF_RTFNOOBJS | SFF_PLAINRTF | SF_USECODEPAGE);
else
dwFlags = (CP_UTF8 << 16) | dwPassedFlags;
- SendMessage(hwndRtf, EM_STREAMOUT, (WPARAM)dwFlags, (LPARAM)& stream);
+ SendMessage(hwndRtf, EM_STREAMOUT, (WPARAM)dwFlags, (LPARAM)&stream);
return pszText; // pszText contains the text
}
@@ -1224,7 +1224,7 @@ void TSAPI GetMYUIN(TWindowData *dat) ci.szProto = const_cast<char *>(dat->cache->getActiveProto());
ci.dwFlag = CNF_TCHAR | CNF_DISPLAYUID;
- if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)& ci)) {
+ if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci)) {
switch (ci.type) {
case CNFT_ASCIIZ:
mir_sntprintf(dat->myUin, SIZEOF(dat->myUin), _T("%s"), reinterpret_cast<TCHAR *>(ci.pszVal));
@@ -1267,7 +1267,7 @@ UINT TSAPI GetIEViewMode(HWND hwndDlg, HANDLE hContact) }
#if defined(__FEAT_DEPRECATED_DYNAMICSWITCHLOGVIEWER)
-static void CheckAndDestroyHPP(struct TWindowData *dat)
+static void CheckAndDestroyHPP(TWindowData *dat)
{
if (dat->hwndHPP) {
IEVIEWWINDOW ieWindow;
@@ -1756,22 +1756,22 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat) HRGN clipRgn = 0;
int iRad = PluginConfig.m_WinVerMajor >= 5 ? 4 : 6;
BOOL flashAvatar = FALSE;
- bool fInfoPanel = dat->Panel->isActive();
+ bool bInfoPanel = dat->Panel->isActive();
if (PluginConfig.g_FlashAvatarAvail && (!bPanelPic || (bPanelPic && dat->showInfoPic == 1))) {
FLASHAVATAR fa = {0};
fa.id = 25367;
fa.cProto = dat->szProto;
- if (!bPanelPic && fInfoPanel) {
+ if (!bPanelPic && bInfoPanel) {
fa.hParentWindow = GetDlgItem(hwndDlg, IDC_CONTACTPIC);
CallService(MS_FAVATAR_MAKE, (WPARAM)&fa, 0);
Utils::enableDlgControl(hwndDlg, IDC_CONTACTPIC, fa.hWindow != 0);
} else {
fa.hContact = dat->hContact;
- fa.hParentWindow = fInfoPanel ? dat->hwndPanelPicParent : GetDlgItem(hwndDlg, IDC_CONTACTPIC);
+ fa.hParentWindow = bInfoPanel ? dat->hwndPanelPicParent : GetDlgItem(hwndDlg, IDC_CONTACTPIC);
CallService(MS_FAVATAR_MAKE, (WPARAM)&fa, 0);
- if (fInfoPanel) {
+ if (bInfoPanel) {
if (fa.hWindow != NULL&&dat->hwndPanelPic) {
DestroyWindow(dat->hwndPanelPic);
dat->hwndPanelPic = NULL;
@@ -1815,13 +1815,13 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat) return TRUE;
}
} else {
- if (!fInfoPanel || dat->pContainer->avatarMode == 3) {
+ if (!bInfoPanel || dat->pContainer->avatarMode == 3) {
if (dat->ace)
aceFlags = dat->ace->dwFlags;
} else if (dat->ownAce)
aceFlags = dat->ownAce->dwFlags;
- GetObject((fInfoPanel && dat->pContainer->avatarMode != 3) ? dat->hOwnPic : (dat->ace ? dat->ace->hbmPic : PluginConfig.g_hbmUnknown), sizeof(bminfo), &bminfo);
+ GetObject((bInfoPanel && dat->pContainer->avatarMode != 3) ? dat->hOwnPic : (dat->ace ? dat->ace->hbmPic : PluginConfig.g_hbmUnknown), sizeof(bminfo), &bminfo);
}
GetClientRect(hwndDlg, &rc);
@@ -1919,9 +1919,9 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat) }
}
- if ((((fInfoPanel && dat->pContainer->avatarMode != 3) ? dat->hOwnPic : (dat->ace ? dat->ace->hbmPic : PluginConfig.g_hbmUnknown)) && dat->showPic) || bPanelPic) {
+ if ((((bInfoPanel && dat->pContainer->avatarMode != 3) ? dat->hOwnPic : (dat->ace ? dat->ace->hbmPic : PluginConfig.g_hbmUnknown)) && dat->showPic) || bPanelPic) {
HDC hdcMem = CreateCompatibleDC(dis->hDC);
- HBITMAP hbmAvatar = bPanelPic ? (dat->ace ? dat->ace->hbmPic : PluginConfig.g_hbmUnknown) : ((fInfoPanel && dat->pContainer->avatarMode != 3) ? dat->hOwnPic : (dat->ace ? dat->ace->hbmPic : PluginConfig.g_hbmUnknown));
+ HBITMAP hbmAvatar = bPanelPic ? (dat->ace ? dat->ace->hbmPic : PluginConfig.g_hbmUnknown) : ((bInfoPanel && dat->pContainer->avatarMode != 3) ? dat->hOwnPic : (dat->ace ? dat->ace->hbmPic : PluginConfig.g_hbmUnknown));
HBITMAP hbmMem = 0;
if (bPanelPic) {
bool bBorder = (CSkin::m_bAvatarBorderType ? true : false);
@@ -2320,7 +2320,7 @@ void TSAPI ClearLog(TWindowData *dat) dat->hDbEventFirst = NULL;
}
else if (dat && dat->bType == SESSIONTYPE_CHAT && dat->si) {
- SESSION_INFO *si = reinterpret_cast<SESSION_INFO *>(dat->si);
+ SESSION_INFO *si = dat->si;
SESSION_INFO* s = SM_FindSession(si->ptszID, si->pszModule);
if (s) {
SetDlgItemText(dat->hwnd, IDC_CHAT_LOG, _T(""));
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index 7f5427354b..696445170f 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -60,8 +60,8 @@ wchar_t* months[12] = LPGENT("July"), LPGENT("August"), LPGENT("September"), LPGENT("October"), LPGENT("November"), LPGENT("December")
};
-static TCHAR *Template_MakeRelativeDate(struct TWindowData *dat, HANDLE hTimeZone, time_t check, int groupBreak, TCHAR code);
-static void ReplaceIcons(HWND hwndDlg, struct TWindowData *dat, LONG startAt, int fAppend, BOOL isSent);
+static TCHAR *Template_MakeRelativeDate(TWindowData *dat, HANDLE hTimeZone, time_t check, int groupBreak, TCHAR code);
+static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppend, BOOL isSent);
static time_t today;
@@ -100,7 +100,7 @@ struct LogStreamData { int eventsToInsert;
int isEmpty;
int isAppend;
- struct TWindowData *dlgDat;
+ TWindowData *dlgDat;
DBEVENTINFO *dbei;
};
@@ -231,7 +231,7 @@ static void AppendToBuffer(char **buffer, int *cbBufferEnd, int *cbBufferAlloced *cbBufferEnd += charsDone;
}
-static int AppendUnicodeToBuffer(char **buffer, int *cbBufferEnd, int *cbBufferAlloced, TCHAR * line, int mode)
+static int AppendUnicodeToBuffer(char **buffer, int *cbBufferEnd, int *cbBufferAlloced, const TCHAR * line, int mode)
{
DWORD textCharsCount = 0;
char *d;
@@ -247,52 +247,50 @@ static int AppendUnicodeToBuffer(char **buffer, int *cbBufferEnd, int *cbBufferA d += 6;
for (; *line; line++, textCharsCount++) {
-
- if (1) {
- if (*line == 127 && line[1] != 0) {
- TCHAR code = line[2];
- if (((code == '0' || code == '1') && line[3] == ' ') || (line[1] == 'c' && code == 'x')) {
- int begin = (code == '1');
- switch (line[1]) {
- case 'b':
- CopyMemory(d, begin ? "\\b " : "\\b0 ", begin ? 3 : 4);
- d += (begin ? 3 : 4);
- line += 3;
- continue;
- case 'i':
- CopyMemory(d, begin ? "\\i " : "\\i0 ", begin ? 3 : 4);
- d += (begin ? 3 : 4);
- line += 3;
- continue;
- case 'u':
- CopyMemory(d, begin ? "\\ul " : "\\ul0 ", begin ? 4 : 5);
- d += (begin ? 4 : 5);
- line += 3;
- continue;
- case 's':
- CopyMemory(d, begin ? "\\strike " : "\\strike0 ", begin ? 8 : 9);
- d += (begin ? 8 : 9);
- line += 3;
- continue;
- case 'c':
- begin = (code == 'x');
- CopyMemory(d, "\\cf", 3);
- if (begin) {
- d[3] = (char)line[3];
- d[4] = (char)line[4];
- d[5] = ' ';
- } else {
- char szTemp[10];
- int colindex = GetColorIndex(GetRTFFont(LOWORD(mode) ? (MSGFONTID_MYMSG + (HIWORD(mode) ? 8 : 0)) : (MSGFONTID_YOURMSG + (HIWORD(mode) ? 8 : 0))));
- mir_snprintf(szTemp, 4, "%02d", colindex);
- d[3] = szTemp[0];
- d[4] = szTemp[1];
- d[5] = ' ';
- }
- d += 6;
- line += (begin ? 6 : 3);
- continue;
+ if (*line == 127 && line[1] != 0) {
+ TCHAR code = line[2];
+ if (((code == '0' || code == '1') && line[3] == ' ') || (line[1] == 'c' && code == 'x')) {
+ int begin = (code == '1');
+ switch (line[1]) {
+ case 'b':
+ CopyMemory(d, begin ? "\\b " : "\\b0 ", begin ? 3 : 4);
+ d += (begin ? 3 : 4);
+ line += 3;
+ continue;
+ case 'i':
+ CopyMemory(d, begin ? "\\i " : "\\i0 ", begin ? 3 : 4);
+ d += (begin ? 3 : 4);
+ line += 3;
+ continue;
+ case 'u':
+ CopyMemory(d, begin ? "\\ul " : "\\ul0 ", begin ? 4 : 5);
+ d += (begin ? 4 : 5);
+ line += 3;
+ continue;
+ case 's':
+ CopyMemory(d, begin ? "\\strike " : "\\strike0 ", begin ? 8 : 9);
+ d += (begin ? 8 : 9);
+ line += 3;
+ continue;
+ case 'c':
+ begin = (code == 'x');
+ CopyMemory(d, "\\cf", 3);
+ if (begin) {
+ d[3] = (char)line[3];
+ d[4] = (char)line[4];
+ d[5] = ' ';
+ }
+ else {
+ char szTemp[10];
+ int colindex = GetColorIndex(GetRTFFont(LOWORD(mode) ? (MSGFONTID_MYMSG + (HIWORD(mode) ? 8 : 0)) : (MSGFONTID_YOURMSG + (HIWORD(mode) ? 8 : 0))));
+ mir_snprintf(szTemp, 4, "%02d", colindex);
+ d[3] = szTemp[0];
+ d[4] = szTemp[1];
+ d[5] = ' ';
}
+ d += 6;
+ line += (begin ? 6 : 3);
+ continue;
}
}
}
@@ -429,7 +427,7 @@ static int AppendToBufferWithRTF(int mode, char **buffer, int *cbBufferEnd, int return (int)(_mbslen((unsigned char *)*buffer + *cbBufferEnd));
}
-static void Build_RTF_Header(char **buffer, int *bufferEnd, int *bufferAlloced, struct TWindowData *dat)
+static void Build_RTF_Header(char **buffer, int *bufferEnd, int *bufferAlloced, TWindowData *dat)
{
COLORREF colour;
int i;
@@ -504,7 +502,7 @@ static void Build_RTF_Header(char **buffer, int *bufferEnd, int *bufferAlloced, //free() the return value
-static char *CreateRTFHeader(struct TWindowData *dat)
+static char *CreateRTFHeader(TWindowData *dat)
{
char *buffer;
int bufferAlloced, bufferEnd;
@@ -519,7 +517,7 @@ static char *CreateRTFHeader(struct TWindowData *dat) }
static void AppendTimeStamp(TCHAR *szFinalTimestamp, int isSent, char **buffer, int *bufferEnd, int *bufferAlloced, int skipFont,
- struct TWindowData *dat, int iFontIDOffset)
+ TWindowData *dat, int iFontIDOffset)
{
if (skipFont)
AppendUnicodeToBuffer(buffer, bufferEnd, bufferAlloced, szFinalTimestamp, MAKELONG(isSent, dat->isHistory));
@@ -530,7 +528,7 @@ static void AppendTimeStamp(TCHAR *szFinalTimestamp, int isSent, char **buffer, }
//free() the return value
-static char *CreateRTFTail(struct TWindowData *dat)
+static char *CreateRTFTail(TWindowData *dat)
{
char *buffer;
int bufferAlloced, bufferEnd;
@@ -543,7 +541,7 @@ static char *CreateRTFTail(struct TWindowData *dat) return buffer;
}
-int TSAPI DbEventIsShown(struct TWindowData *dat, DBEVENTINFO *dbei)
+int TSAPI DbEventIsShown(TWindowData *dat, DBEVENTINFO *dbei)
{
if (!IsCustomEvent(dbei->eventType))
return 1;
@@ -560,7 +558,7 @@ int DbEventIsForMsgWindow(DBEVENTINFO *dbei) return et && ( et->flags & DETF_MSGWINDOW );
}
-static char *Template_CreateRTFFromDbEvent(struct TWindowData *dat, HANDLE hContact, HANDLE hDbEvent, int prefixParaBreak, struct LogStreamData *streamData)
+static char *Template_CreateRTFFromDbEvent(TWindowData *dat, HANDLE hContact, HANDLE hDbEvent, int prefixParaBreak, LogStreamData *streamData)
{
char *buffer, c;
TCHAR ci, cc;
@@ -968,9 +966,9 @@ static char *Template_CreateRTFFromDbEvent(struct TWindowData *dat, HANDLE hCont if (!skipFont)
AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "%s ", GetRTFFont(isSent ? MSGFONTID_MYNAME + iFontIDOffset : MSGFONTID_YOURNAME + iFontIDOffset));
if (!isSent)
- AppendUnicodeToBuffer(&buffer, &bufferEnd, &bufferAlloced, (wchar_t *)dat->cache->getUIN(), MAKELONG(isSent, dat->isHistory));
+ AppendUnicodeToBuffer(&buffer, &bufferEnd, &bufferAlloced, dat->cache->getUIN(), MAKELONG(isSent, dat->isHistory));
else
- AppendUnicodeToBuffer(&buffer, &bufferEnd, &bufferAlloced, (wchar_t *)dat->myUin, MAKELONG(isSent, dat->isHistory));
+ AppendUnicodeToBuffer(&buffer, &bufferEnd, &bufferAlloced, dat->myUin, MAKELONG(isSent, dat->isHistory));
break;
case 'e': // error message
AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "%s ", GetRTFFont(MSGFONTID_ERROR));
@@ -1161,7 +1159,7 @@ static char *Template_CreateRTFFromDbEvent(struct TWindowData *dat, HANDLE hCont static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG * pcb)
{
- struct LogStreamData *dat = (struct LogStreamData *) dwCookie;
+ LogStreamData *dat = (LogStreamData *) dwCookie;
if (dat->buffer == NULL) {
dat->bufferOffset = 0;
@@ -1211,7 +1209,7 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG return 0;
}
-static void SetupLogFormatting(struct TWindowData *dat)
+static void SetupLogFormatting(TWindowData *dat)
{
if (dat->hHistoryEvents) {
mir_snprintf(dat->szMicroLf, sizeof(dat->szMicroLf), "%s", "\\v\\cf%d \\ ~-+%d+-~\\v0 ");
@@ -1223,8 +1221,8 @@ static void SetupLogFormatting(struct TWindowData *dat) void TSAPI StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAppend, DBEVENTINFO *dbei_s)
{
EDITSTREAM stream = { 0 };
- struct LogStreamData streamData = { 0 };
- struct TWindowData *dat = (struct TWindowData *) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ LogStreamData streamData = { 0 };
+ TWindowData *dat = (TWindowData*) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
CHARRANGE oldSel, sel;
HWND hwndrtf;
LONG startAt = 0;
@@ -1334,7 +1332,7 @@ void TSAPI StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAp szMyName = dat->szMyNickname;
SendDlgItemMessage(hwndDlg, IDC_LOG, EM_HIDESELECTION, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_LOG, EM_EXGETSEL, 0, (LPARAM)& oldSel);
+ SendDlgItemMessage(hwndDlg, IDC_LOG, EM_EXGETSEL, 0, (LPARAM)&oldSel);
streamData.hContact = dat->hContact;
streamData.hDbEvent = hDbEventFirst;
streamData.dlgDat = dat;
@@ -1351,7 +1349,7 @@ void TSAPI StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAp gtxl.flags = GTL_DEFAULT | GTL_PRECISE | GTL_NUMCHARS;
fi.chrg.cpMin = SendDlgItemMessage(hwndDlg, IDC_LOG, EM_GETTEXTLENGTHEX, (WPARAM)& gtxl, 0);
sel.cpMin = sel.cpMax = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_LOG));
- SendDlgItemMessage(hwndDlg, IDC_LOG, EM_EXSETSEL, 0, (LPARAM)& sel);
+ SendDlgItemMessage(hwndDlg, IDC_LOG, EM_EXSETSEL, 0, (LPARAM)&sel);
} else {
SetDlgItemText(hwndDlg, IDC_LOG, _T(""));
sel.cpMin = 0;
@@ -1364,9 +1362,9 @@ void TSAPI StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAp SendMessage(hwndrtf, WM_SETREDRAW, FALSE, 0);
- SendDlgItemMessage(hwndDlg, IDC_LOG, EM_STREAMIN, fAppend ? SFF_SELECTION | SF_RTF : SFF_SELECTION | SF_RTF, (LPARAM)& stream);
- //SendDlgItemMessage(hwndDlg, IDC_LOG, EM_STREAMIN, fAppend ? SFF_SELECTION | SF_RTF : SF_RTF, (LPARAM)& stream);
- SendDlgItemMessage(hwndDlg, IDC_LOG, EM_EXSETSEL, 0, (LPARAM)& oldSel);
+ SendDlgItemMessage(hwndDlg, IDC_LOG, EM_STREAMIN, fAppend ? SFF_SELECTION | SF_RTF : SFF_SELECTION | SF_RTF, (LPARAM)&stream);
+ //SendDlgItemMessage(hwndDlg, IDC_LOG, EM_STREAMIN, fAppend ? SFF_SELECTION | SF_RTF : SF_RTF, (LPARAM)&stream);
+ SendDlgItemMessage(hwndDlg, IDC_LOG, EM_EXSETSEL, 0, (LPARAM)&oldSel);
SendDlgItemMessage(hwndDlg, IDC_LOG, EM_HIDESELECTION, FALSE, 0);
dat->hDbEventLast = streamData.hDbEventLast;
@@ -1384,7 +1382,7 @@ void TSAPI StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAp ZeroMemory(&pf2, sizeof(PARAFORMAT2));
sel.cpMax = SendDlgItemMessage(hwndDlg, IDC_LOG, EM_GETTEXTLENGTHEX, (WPARAM)& gtxl, 0);
sel.cpMin = sel.cpMax - 1;
- SendDlgItemMessage(hwndDlg, IDC_LOG, EM_EXSETSEL, 0, (LPARAM)& sel);
+ SendDlgItemMessage(hwndDlg, IDC_LOG, EM_EXSETSEL, 0, (LPARAM)&sel);
SendDlgItemMessage(hwndDlg, IDC_LOG, EM_REPLACESEL, FALSE, (LPARAM)_T(""));
dat->isAutoRTL |= 2;
}
@@ -1407,7 +1405,7 @@ void TSAPI StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAp if (streamData.buffer) free(streamData.buffer);
}
-static void ReplaceIcons(HWND hwndDlg, struct TWindowData *dat, LONG startAt, int fAppend, BOOL isSent)
+static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppend, BOOL isSent)
{
FINDTEXTEXA fi;
CHARFORMAT2 cf2;
@@ -1415,7 +1413,7 @@ static void ReplaceIcons(HWND hwndDlg, struct TWindowData *dat, LONG startAt, in IRichEditOle *ole;
TEXTRANGEA tr;
COLORREF crDefault;
- struct TLogIcon theIcon;
+ TLogIcon theIcon;
char trbuffer[40];
DWORD dwScale = M.GetDword("iconscale", 0);
tr.lpstrText = trbuffer;
@@ -1572,7 +1570,7 @@ void TSAPI BuildCodePageList() EnumSystemCodePages(LangAddCallback, CP_INSTALLED);
}
-static TCHAR *Template_MakeRelativeDate(struct TWindowData *dat, HANDLE hTimeZone, time_t check, int groupBreak, TCHAR code)
+static TCHAR *Template_MakeRelativeDate(TWindowData *dat, HANDLE hTimeZone, time_t check, int groupBreak, TCHAR code)
{
static TCHAR szResult[100];
const TCHAR *szFormat;
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index ee81ad13c1..ca2427dc0a 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -893,9 +893,9 @@ static INT_PTR CALLBACK DlgProcTypeOptions(HWND hwndDlg, UINT msg, WPARAM wParam cii.cbSize = sizeof(cii);
cii.flags = CLCIIF_GROUPFONT | CLCIIF_CHECKBOX;
cii.pszText = TranslateT("** New contacts **");
- hItemNew = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM)& cii);
+ hItemNew = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
cii.pszText = TranslateT("** Unknown contacts **");
- hItemUnknown = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM)& cii);
+ hItemUnknown = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
}
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST), GWL_STYLE) | (CLS_SHOWHIDDEN));
ResetCList(hwndDlg);
@@ -1411,14 +1411,14 @@ DWORD OptCheckBox_LoadValue(struct OptCheckBox *cb) return cb->defValue;
}
-void OptCheckBox_Load(HWND hwnd, struct OptCheckBox *cb)
+void OptCheckBox_Load(HWND hwnd, OptCheckBox *cb)
{
DWORD value = OptCheckBox_LoadValue(cb);
if (cb->dwBit) value &= cb->dwBit;
CheckDlgButton(hwnd, cb->idc, value ? BST_CHECKED : BST_UNCHECKED);
}
-void OptCheckBox_Save(HWND hwnd, struct OptCheckBox *cb)
+void OptCheckBox_Save(HWND hwnd, OptCheckBox *cb)
{
DWORD value = IsDlgButtonChecked(hwnd, cb->idc) == BST_CHECKED;
@@ -1460,7 +1460,7 @@ void OptCheckBox_Save(HWND hwnd, struct OptCheckBox *cb) static INT_PTR CALLBACK DlgProcTabSrmmModernOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- struct OptCheckBox opts[] =
+ OptCheckBox opts[] =
{
//{IDC_, def, bit, dbtype, dbmodule, dbsetting, valtype, pval},
{IDC_CLOSEONESC, FALSE, 0, DBVT_BYTE, SRMSGMOD_T, "escmode"},
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 52697325d4..73bfba143d 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -206,7 +206,7 @@ static INT_PTR GetMessageWindowFlags(WPARAM wParam, LPARAM lParam) hwndTarget = M.FindWindow((HANDLE)wParam);
if (hwndTarget) {
- struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(hwndTarget, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndTarget, GWLP_USERDATA);
if (dat)
return (dat->dwFlags);
else
@@ -305,9 +305,7 @@ static INT_PTR ReadMessageCommand(WPARAM, LPARAM lParam) INT_PTR SendMessageCommand_W(WPARAM wParam, LPARAM lParam)
{
HANDLE hContact = (HANDLE) wParam;
- struct TNewWindowData newData = {
- 0
- };
+ TNewWindowData newData = { 0 };
int isSplit = 1;
/*
@@ -365,9 +363,7 @@ INT_PTR SendMessageCommand_W(WPARAM wParam, LPARAM lParam) INT_PTR SendMessageCommand(WPARAM wParam, LPARAM lParam)
{
HANDLE hContact = (HANDLE) wParam;
- struct TNewWindowData newData = {
- 0
- };
+ TNewWindowData newData = { 0 };
int isSplit = 1;
if (GetCurrentThreadId() != PluginConfig.dwThreadID) {
@@ -483,7 +479,7 @@ int MyAvatarChanged(WPARAM wParam, LPARAM lParam) int AvatarChanged(WPARAM wParam, LPARAM lParam)
{
- struct avatarCacheEntry *ace = (struct avatarCacheEntry *)lParam;
+ avatarCacheEntry *ace = (avatarCacheEntry *)lParam;
HWND hwnd = M.FindWindow((HANDLE)wParam);
if (wParam == 0) { // protocol picture has changed...
@@ -491,7 +487,7 @@ int AvatarChanged(WPARAM wParam, LPARAM lParam) return 0;
}
if (hwnd) {
- struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (dat) {
dat->ace = ace;
if (dat->hTaskbarIcon)
@@ -637,7 +633,7 @@ int TSAPI ActivateExistingTab(TContainerData *pContainer, HWND hwndChild) {
NMHDR nmhdr;
- struct TWindowData *dat = (struct TWindowData *) GetWindowLongPtr(hwndChild, GWLP_USERDATA); // needed to obtain the hContact for the message window
+ TWindowData *dat = (TWindowData*) GetWindowLongPtr(hwndChild, GWLP_USERDATA); // needed to obtain the hContact for the message window
if (dat && pContainer) {
ZeroMemory((void*)&nmhdr, sizeof(nmhdr));
nmhdr.code = TCN_SELCHANGE;
@@ -706,7 +702,7 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, HANDLE hContact, i }
}
- struct TNewWindowData newData = {0};
+ TNewWindowData newData = {0};
newData.hContact = hContact;
newData.isWchar = isSend;
newData.szInitialText = pszInitialText;
@@ -764,7 +760,7 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, HANDLE hContact, i item.mask = TCIF_PARAM;
TabCtrl_GetItem(hwndTab, i, &item);
HWND hwnd = (HWND)item.lParam;
- struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (dat) {
relPos = M.GetDword(dat->hContact, "tabindex", i * 100);
if (iTabIndex_wanted <= relPos)
@@ -784,12 +780,12 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, HANDLE hContact, i pContainer->iChilds++;
newData.bWantPopup = bWantPopup;
newData.hdbEvent = hdbEvent;
- HWND hwndNew = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSGSPLITNEW), GetDlgItem(pContainer->hwnd, IDC_MSGTABS), DlgProcMessage, (LPARAM)& newData);
+ HWND hwndNew = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSGSPLITNEW), GetDlgItem(pContainer->hwnd, IDC_MSGTABS), DlgProcMessage, (LPARAM)&newData);
/*
* switchbar support
*/
if (pContainer->dwFlags & CNT_SIDEBAR) {
- TWindowData *dat = (TWindowData *)GetWindowLongPtr(hwndNew, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndNew, GWLP_USERDATA);
if (dat)
pContainer->SideBar->addSession(dat, pContainer->iTabIndex);
}
@@ -908,7 +904,7 @@ int TABSRMM_FireEvent(HANDLE hContact, HWND hwnd, unsigned int type, unsigned in if (hContact == NULL || hwnd == NULL || !M.GetByte("_eventapi", 1))
return 0;
- struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
BYTE bType = dat ? dat->bType : SESSIONTYPE_IM;
MessageWindowEventData mwe = { sizeof(mwe) };
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index 7eb3d283b5..562ce342c5 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -265,7 +265,7 @@ struct TWindowData SESSION_INFO *si;
- RECT rcNick, rcUIN, rcStatus, rcPic;
+ RECT rcNick, rcUIN, rcStatus, rcPic;
HANDLE hDbEventFirst, hDbEventLast;
int sendMode;
int splitterY, originalSplitterY, dynaSplitter, savedSplitter, savedSplitY, savedDynaSplit;
@@ -833,8 +833,8 @@ struct SIDEBARITEM { DWORD dwFlags;
HICON *hIcon, *hIconPressed, *hIconHover;
TCHAR *szName;
- void (*pfnAction)(ButtonItem *item, HWND hwndDlg, struct TWindowData *dat, HWND hwndItem);
- void (*pfnCallback)(ButtonItem *item, HWND hwndDlg, struct TWindowData *dat, HWND hwndItem);
+ void (*pfnAction)(ButtonItem *item, HWND hwndDlg, TWindowData *dat, HWND hwndItem);
+ void (*pfnCallback)(ButtonItem *item, HWND hwndDlg, TWindowData *dat, HWND hwndItem);
TCHAR *tszTip;
};
@@ -942,7 +942,7 @@ typedef struct { //obtain the message window flags
//wParam = hContact - ignored if lParam is given.
//lParam = hwnd
-//returns struct MessageWindowData *dat, 0 if no window is found
+//returns MessageWindowData *dat, 0 if no window is found
#define MS_MSG_MOD_GETWINDOWFLAGS "SRMsg_MOD/GetWindowFlags"
// custom tabSRMM events
@@ -1012,13 +1012,14 @@ int SI_InitStatusIcons(); int SI_DeinitStatusIcons();
int GetStatusIconsCount();
-void DrawStatusIcons(struct TWindowData *dat, HDC hdc, RECT r, int gap);
-void SI_CheckStatusIconClick(struct TWindowData *dat, HWND hwndFrom, POINT pt, RECT rc, int gap, int code);
+void DrawStatusIcons(TWindowData *dat, HDC hdc, RECT r, int gap);
+void SI_CheckStatusIconClick(TWindowData *dat, HWND hwndFrom, POINT pt, RECT rc, int gap, int code);
-typedef struct _tagSKINDesc {
+struct SKINDESC
+{
ULONG ulID; // resource id
TCHAR tszName[30];
-} SKINDESC;
+};
#define SKIN_NR_ELEMENTS 6
#define SKIN_VERSION 2
diff --git a/plugins/TabSRMM/src/nen.h b/plugins/TabSRMM/src/nen.h index 9f51adca01..dfe3402bfa 100644 --- a/plugins/TabSRMM/src/nen.h +++ b/plugins/TabSRMM/src/nen.h @@ -43,7 +43,7 @@ #define MODULE "tabSRMM_NEN"
-int tabSRMM_ShowPopup(WPARAM wParam, LPARAM lParam, WORD eventType, int windowOpen, TContainerData *pContainer, HWND hwndChild, const char *szProto, struct TWindowData *dat);
+int tabSRMM_ShowPopup(WPARAM wParam, LPARAM lParam, WORD eventType, int windowOpen, TContainerData *pContainer, HWND hwndChild, const char *szProto, TWindowData *dat);
#define DEFAULT_COLBACK RGB(255,255,128)
@@ -97,7 +97,8 @@ int tabSRMM_ShowPopup(WPARAM wParam, LPARAM lParam, WORD eventType, int windowOp #define OPT_LIMITPREVIEW "LimitPreview"
#define OPT_REMOVEMASK "removemask"
-struct NEN_OPTIONS {
+struct NEN_OPTIONS
+{
BOOL bPreview;
BOOL bDefaultColorMsg;
BOOL bDefaultColorOthers;
diff --git a/plugins/TabSRMM/src/selectcontainer.cpp b/plugins/TabSRMM/src/selectcontainer.cpp index 49bf0971f5..515e6350a0 100644 --- a/plugins/TabSRMM/src/selectcontainer.cpp +++ b/plugins/TabSRMM/src/selectcontainer.cpp @@ -50,7 +50,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L TranslateDialogDefault(hwndDlg);
if (lParam) {
- struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr((HWND)lParam, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr((HWND)lParam, GWLP_USERDATA);
if (dat) {
mir_sntprintf(szNewTitle, SIZEOF(szNewTitle), TranslateT("Select container for %s"), dat->cache->getNick());
SetWindowText(hwndDlg, szNewTitle);
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index cbecb785da..41658aaf49 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -796,7 +796,7 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM Utils::showDlgControl(m_hwndDlg, IDC_QMGR_SUCCESSPOPUPS, SW_HIDE);
}
::ShowWindow(hwnd, SW_NORMAL);
- return(FALSE);
+ return FALSE;
case WM_NOTIFY:
if (((LPNMHDR)lParam)->hwndFrom == m_hwndList) {
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index 6256e89e70..676d0df6de 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -149,7 +149,7 @@ static int SendChunkA(char *chunk, HANDLE hContact, char *szSvc, DWORD dwFlags) static void DoSplitSendW(LPVOID param)
{
- struct SendJob *job = sendQueue->getJobByIndex((int)param);
+ SendJob *job = sendQueue->getJobByIndex((int)param);
BOOL fFirstSend = FALSE;
WCHAR *wszSaved, savedChar;
int iCur = 0, iSavedCur = 0, i;
@@ -223,7 +223,7 @@ static void DoSplitSendW(LPVOID param) static void DoSplitSendA(LPVOID param)
{
- struct SendJob *job = sendQueue->getJobByIndex((int)param);
+ SendJob *job = sendQueue->getJobByIndex((int)param);
int id;
BOOL fFirstSend = FALSE;
char *szBegin, *szTemp, *szSaved, savedChar;
diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp index 3c3a86d4e9..16210a08e3 100644 --- a/plugins/TabSRMM/src/sidebar.cpp +++ b/plugins/TabSRMM/src/sidebar.cpp @@ -523,7 +523,7 @@ void CSideBar::populateAll() for (int i=0; i < iItems; i++) {
TabCtrl_GetItem(hwndTab, i, &item);
if (item.lParam && ::IsWindow((HWND)item.lParam)) {
- TWindowData *dat = (TWindowData *)::GetWindowLongPtr((HWND)item.lParam, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)::GetWindowLongPtr((HWND)item.lParam, GWLP_USERDATA);
if (dat) {
if ((b_item = findSession(dat)) == m_buttonlist.end())
addSession(dat, i);
diff --git a/plugins/TabSRMM/src/sidebar.h b/plugins/TabSRMM/src/sidebar.h index c3c5578de6..32fd8669ea 100644 --- a/plugins/TabSRMM/src/sidebar.h +++ b/plugins/TabSRMM/src/sidebar.h @@ -33,13 +33,15 @@ #ifndef __SIDEBAR_H
#define __SIDEBAR_H
-struct TSideBarNotify {
+struct TSideBarNotify
+{
NMHDR nmHdr;
const TWindowData* dat;
};
-/* layout descrtiption structure */
+/* layout description structure */
-struct TSideBarLayout {
+struct TSideBarLayout
+{
TCHAR szName[50]; // everything wants a name...
LONG width; // width of the switchbar element (a single button)
LONG height; // height of a single switchbar element
diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp index 888c21dc6c..a85912ad55 100644 --- a/plugins/TabSRMM/src/srmm.cpp +++ b/plugins/TabSRMM/src/srmm.cpp @@ -212,7 +212,7 @@ int _DebugPopup(HANDLE hContact, const TCHAR *fmt, ...) tn.dwInfoFlags = NIIF_INFO;
tn.dwInfoFlags |= NIIF_INTERN_UNICODE;
tn.uTimeout = 1000 * 4;
- CallService(MS_CLIST_SYSTRAY_NOTIFY, 0, (LPARAM)& tn);
+ CallService(MS_CLIST_SYSTRAY_NOTIFY, 0, (LPARAM)&tn);
}
return 0;
}
diff --git a/plugins/TabSRMM/src/tabctrl.cpp b/plugins/TabSRMM/src/tabctrl.cpp index 5ddd545766..8fc0c9d176 100644 --- a/plugins/TabSRMM/src/tabctrl.cpp +++ b/plugins/TabSRMM/src/tabctrl.cpp @@ -245,7 +245,7 @@ static void DrawItem(TabControlData *tabdat, HDC dc, RECT *rcItem, int nHint, in static RECT rcTabPage = {0};
-static void DrawItemRect(struct TabControlData *tabdat, HDC dc, RECT *rcItem, int nHint, int iItem, const TWindowData *dat)
+static void DrawItemRect(TabControlData *tabdat, HDC dc, RECT *rcItem, int nHint, int iItem, const TWindowData *dat)
{
POINT pt;
DWORD dwStyle = tabdat->dwStyle;
@@ -452,7 +452,7 @@ static HRESULT DrawThemesPart(const TabControlData *tabdat, HDC hDC, int iPartId * handles image mirroring for tabs at the bottom
*/
-static void DrawThemesXpTabItem(HDC pDC, int ixItem, RECT *rcItem, UINT uiFlag, struct TabControlData *tabdat, TWindowData *dat)
+static void DrawThemesXpTabItem(HDC pDC, int ixItem, RECT *rcItem, UINT uiFlag, TabControlData *tabdat, TWindowData *dat)
{
BOOL bBody = (uiFlag & 1) ? TRUE : FALSE;
BOOL bSel = (uiFlag & 2) ? TRUE : FALSE;
@@ -649,7 +649,7 @@ static void PaintWorker(HWND hwnd, TabControlData *tabdat) tabdat->helperDat = 0;
if (tabdat->fAeroTabs && tabdat->pContainer) {
- TWindowData *dat = (TWindowData *)GetWindowLongPtr(tabdat->pContainer->hwndActive, GWLP_USERDATA);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(tabdat->pContainer->hwndActive, GWLP_USERDATA);
if (dat)
tabdat->helperDat = dat;
else
@@ -888,7 +888,7 @@ page_done: if (i != iActive) {
TabCtrl_GetItem(hwnd, i, &item);
if (item.lParam)
- dat = (TWindowData *)GetWindowLongPtr((HWND)item.lParam, GWLP_USERDATA);
+ dat = (TWindowData*)GetWindowLongPtr((HWND)item.lParam, GWLP_USERDATA);
TabCtrl_GetItemRect(hwnd, i, &rcItem);
if (!bClassicDraw && uiBottom) {
rcItem.top -= PluginConfig.tabConfig.m_bottomAdjust;
@@ -925,7 +925,7 @@ page_done: rcItem = rctActive;
TabCtrl_GetItem(hwnd, iActive, &item);
if (item.lParam)
- dat = (TWindowData *)GetWindowLongPtr((HWND)item.lParam, GWLP_USERDATA);
+ dat = (TWindowData*)GetWindowLongPtr((HWND)item.lParam, GWLP_USERDATA);
if (!bClassicDraw && !(dwStyle & TCS_BUTTONS)) {
InflateRect(&rcItem, 2, 2);
@@ -992,9 +992,8 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara GetClassInfoExA(g_hInst, "SysTabControl32", &wcl);
OldTabControlClassProc = wcl.lpfnWndProc;
- tabdat = (struct TabControlData *)mir_alloc(sizeof(struct TabControlData));
+ tabdat = (TabControlData *)mir_calloc(sizeof(TabControlData));
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)tabdat);
- ZeroMemory((void*)tabdat, sizeof(struct TabControlData));
tabdat->hwnd = hwnd;
tabdat->cx = GetSystemMetrics(SM_CXSMICON);
tabdat->cy = GetSystemMetrics(SM_CYSMICON);
@@ -1176,11 +1175,11 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara i = TabCtrl_HitTest(hwnd, &tci);
if (i != -1) {
TCITEM tc;
- struct TWindowData *dat = NULL;
+ TWindowData *dat = NULL;
tc.mask = TCIF_PARAM;
TabCtrl_GetItem(hwnd, i, &tc);
- dat = (struct TWindowData *)GetWindowLongPtr((HWND)tc.lParam, GWLP_USERDATA);
+ dat = (TWindowData*)GetWindowLongPtr((HWND)tc.lParam, GWLP_USERDATA);
if (dat) {
tabdat->bDragging = TRUE;
tabdat->iBeginIndex = i;
@@ -1214,7 +1213,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara tc.mask = TCIF_PARAM;
TabCtrl_GetItem(hwnd, i, &tc);
- dat = (TWindowData *)GetWindowLongPtr((HWND)tc.lParam, GWLP_USERDATA);
+ dat = (TWindowData*)GetWindowLongPtr((HWND)tc.lParam, GWLP_USERDATA);
if (dat) {
tabdat->bDragging = TRUE;
tabdat->iBeginIndex = i;
@@ -1333,7 +1332,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara */
TWindowData *dat = 0;
if (IsWindow((HWND)item.lParam) && item.lParam != 0)
- dat = (struct TWindowData *)GetWindowLongPtr((HWND)item.lParam, GWLP_USERDATA);
+ dat = (TWindowData*)GetWindowLongPtr((HWND)item.lParam, GWLP_USERDATA);
if (dat) {
tabdat->fTipActive = TRUE;
ti.isGroup = 0;
diff --git a/plugins/TabSRMM/src/taskbar.cpp b/plugins/TabSRMM/src/taskbar.cpp index 2b8c01a55c..719a7641dc 100644 --- a/plugins/TabSRMM/src/taskbar.cpp +++ b/plugins/TabSRMM/src/taskbar.cpp @@ -62,16 +62,6 @@ * used by getMUCBigICon()
*/
-/*
-struct TMUCLargeIconsMap {
- UINT eventType;
- char* szIconDesc;
-} MUCLargeIconMap[] = {
- { GC_EVENT_NICK, "chat_nick" },
- { GC_EVENT_PART, "chat_part" }
-};
-*/
-
CTaskbarInteract* Win7Taskbar = 0;
/**
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index b5e078e782..92c8ce0bf6 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -118,13 +118,13 @@ void LoadDefaultTemplates() INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- struct TWindowData *dat = 0;
+ TWindowData *dat = 0;
TemplateEditorInfo *teInfo = 0;
TTemplateSet *tSet;
int i;
- dat = (struct TWindowData *) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ dat = (TWindowData*) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
/*
- * since this dialog needs a struct MessageWindowData * but has no container, we can store
+ * since this dialog needs a MessageWindowData * but has no container, we can store
* the extended info struct in pContainer *)
*/
if (dat) {
@@ -140,8 +140,6 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP COLORREF url_visited = RGB(128, 0, 128);
COLORREF url_unvisited = RGB(0, 0, 255);
dat = (TWindowData*)calloc( sizeof(TWindowData), 1);
-
- ZeroMemory((void*) dat, sizeof(struct TWindowData));
dat->pContainer = (TContainerData *)malloc(sizeof(TContainerData));
ZeroMemory((void*)dat->pContainer, sizeof(TContainerData));
teInfo = (TemplateEditorInfo *)dat->pContainer;
@@ -393,5 +391,5 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
break;
}
- return(FALSE);
+ return FALSE;
}
diff --git a/plugins/TabSRMM/src/templates.h b/plugins/TabSRMM/src/templates.h index 71b84b4ac6..da64354204 100644 --- a/plugins/TabSRMM/src/templates.h +++ b/plugins/TabSRMM/src/templates.h @@ -23,20 +23,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. templates for the message log...
*/
-struct TemplateEditorInfo {
- BOOL rtl;
- BOOL changed; // template in edit field is changed
- BOOL selchanging;
- int inEdit; // template currently in editor
- BOOL updateInfo[TMPL_ERRMSG + 1]; // item states...
- HWND hwndParent;
- HANDLE hContact;
+struct TemplateEditorInfo
+{
+ BOOL rtl;
+ BOOL changed; // template in edit field is changed
+ BOOL selchanging;
+ int inEdit; // template currently in editor
+ BOOL updateInfo[TMPL_ERRMSG + 1]; // item states...
+ HWND hwndParent;
+ HANDLE hContact;
};
-struct TemplateEditorNew {
- HANDLE hContact;
- BOOL rtl;
- HWND hwndParent;
+struct TemplateEditorNew
+{
+ HANDLE hContact;
+ BOOL rtl;
+ HWND hwndParent;
};
BOOL CALLBACK DlgProcTemplateEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/TabSRMM/src/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp index da61c3bea8..834d7cc4d3 100644 --- a/plugins/TabSRMM/src/themeio.cpp +++ b/plugins/TabSRMM/src/themeio.cpp @@ -176,7 +176,7 @@ int TSAPI CheckThemeVersion(const TCHAR *szIniFilename) return 0;
}
-void TSAPI WriteThemeToINI(const TCHAR *szIniFilenameT, struct TWindowData *dat)
+void TSAPI WriteThemeToINI(const TCHAR *szIniFilenameT, TWindowData *dat)
{
int i, n = 0;
DBVARIANT dbv;
diff --git a/plugins/TabSRMM/src/themes.h b/plugins/TabSRMM/src/themes.h index 27ed9beb6c..f7f2ad8a57 100644 --- a/plugins/TabSRMM/src/themes.h +++ b/plugins/TabSRMM/src/themes.h @@ -41,7 +41,8 @@ HBITMAP IMG_LoadLogo(const TCHAR *szName); class CSideBarButton;
-typedef struct {
+struct MButtonCtrl
+{
HWND hwnd;
int stateId; // button state
int focus; // has focus (1 or 0)
@@ -61,9 +62,9 @@ typedef struct { int flatBtn;
int dimmed;
HICON overlay;
- struct TContainerData *pContainer;
+ TContainerData *pContainer;
CSideBarButton *sitem;
-} MButtonCtrl;
+};
#define BUTTONSETASDIMMED (BUTTONSETASFLATBTN + 11)
#define BUTTONSETCONTAINER (BUTTONSETASFLATBTN + 12)
@@ -74,7 +75,8 @@ typedef struct { #define BUTTONSETASSIDEBARBUTTON (BUTTONSETASFLATBTN + 22)
#define BUTTONSETOVERLAYICON (BUTTONSETASFLATBTN + 23)
-struct AeroEffect {
+struct AeroEffect
+{
TCHAR tszName[40];
DWORD m_baseColor;
DWORD m_gradientColor;
@@ -384,7 +386,8 @@ private: * window data for the tab control window class
*/
-struct TabControlData {
+struct TabControlData
+{
BOOL m_VisualStyles;
HWND hwnd;
DWORD dwStyle;
diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp index d176ed4dd9..54d4d334e9 100644 --- a/plugins/TabSRMM/src/userprefs.cpp +++ b/plugins/TabSRMM/src/userprefs.cpp @@ -171,7 +171,7 @@ static INT_PTR CALLBACK DlgProcUserPrefs(HWND hwndDlg, UINT msg, WPARAM wParam, Utils::enableDlgControl(hwndDlg, IDC_TRIM, IsDlgButtonChecked(hwndDlg, IDC_ALWAYSTRIM2));
break;
case WM_USER + 100: {
- struct TWindowData *dat = 0;
+ TWindowData *dat = 0;
DWORD *pdwActionToTake = (DWORD *)lParam;
int iIndex = CB_ERR, iMode = -1;
DWORD newCodePage;
@@ -182,7 +182,7 @@ static INT_PTR CALLBACK DlgProcUserPrefs(HWND hwndDlg, UINT msg, WPARAM wParam, BYTE bAvatarVisible = 0;
if (hWnd) {
- dat = (struct TWindowData *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
+ dat = (TWindowData*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
if (dat)
iOldIEView = GetIEViewMode(hWnd, dat->hContact);
}
@@ -330,7 +330,7 @@ static struct _checkboxes { * ignore temporary bits.
*/
-int TSAPI LoadLocalFlags(HWND hwnd, struct TWindowData *dat)
+int TSAPI LoadLocalFlags(HWND hwnd, TWindowData *dat)
{
int i = 0;
DWORD dwMask = M.GetDword(dat->hContact, "mwmask", 0);
@@ -403,11 +403,11 @@ static INT_PTR CALLBACK DlgProcUserPrefsLogOptions(HWND hwndDlg, UINT msg, WPARA int i=0;
LRESULT state;
HWND hwnd = M.FindWindow(hContact);
- struct TWindowData *dat = NULL;
+ TWindowData *dat = NULL;
DWORD *dwActionToTake = (DWORD *)lParam, dwMask = 0, dwFlags = 0, maskval;
if (hwnd)
- dat = (struct TWindowData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ dat = (TWindowData*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
while(checkboxes[i].uId) {
maskval = checkboxes[i].uFlag;
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index 11b33951c0..4f3c52e99b 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -309,7 +309,7 @@ ok: smbp.flag = SAFL_TCHAR | SAFL_PATH | (isSent ? SAFL_OUTGOING : 0);
smbp.str = (TCHAR *)smcode.c_str();
smbp.hContact = dat->hContact;
- smbpr = (SMADD_BATCHPARSERES *)CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)& smbp);
+ smbpr = (SMADD_BATCHPARSERES *)CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)&smbp);
if (smbpr) {
CallService(MS_SMILEYADD_BATCHFREE, 0, (LPARAM)smbpr);
beginmark = endmark + 1;
@@ -1063,13 +1063,13 @@ const wchar_t* Utils::extractURLFromRichEdit(const ENLINK* _e, const HWND hwndRi TEXTRANGEW tr = {0};
CHARRANGE sel = {0};
- ::SendMessageW(hwndRich, EM_EXGETSEL, 0, (LPARAM)& sel);
+ ::SendMessageW(hwndRich, EM_EXGETSEL, 0, (LPARAM)&sel);
if (sel.cpMin != sel.cpMax)
return 0;
tr.chrg = _e->chrg;
tr.lpstrText = (wchar_t *)mir_alloc(2 * (tr.chrg.cpMax - tr.chrg.cpMin + 8));
- ::SendMessageW(hwndRich, EM_GETTEXTRANGE, 0, (LPARAM)& tr);
+ ::SendMessageW(hwndRich, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
if (wcschr(tr.lpstrText, '@') != NULL && wcschr(tr.lpstrText, ':') == NULL && wcschr(tr.lpstrText, '/') == NULL) {
::MoveMemory(tr.lpstrText + 7, tr.lpstrText, sizeof(wchar_t) * (tr.chrg.cpMax - tr.chrg.cpMin + 1));
::CopyMemory(tr.lpstrText, L"mailto:", 7 * sizeof(wchar_t));
@@ -1363,7 +1363,7 @@ INT_PTR CALLBACK CWarning::stubDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA break;
#endif
}
- return(FALSE);
+ return FALSE;
}
/**
diff --git a/plugins/TabSRMM/src/utils.h b/plugins/TabSRMM/src/utils.h index 41284bcffb..8254dbf6dc 100644 --- a/plugins/TabSRMM/src/utils.h +++ b/plugins/TabSRMM/src/utils.h @@ -40,7 +40,8 @@ #define CNT_KEYNAME "CNTW_Def"
#define CNT_BASEKEYNAME "CNTW_"
-struct TRTFColorTable {
+struct TRTFColorTable
+{
TCHAR szName[10];
COLORREF clr;
int index;
|