diff options
author | George Hazan <george.hazan@gmail.com> | 2012-10-21 14:12:36 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-10-21 14:12:36 +0000 |
commit | d8eb1ed0d9f8a694629af5251840e9c6347c9eb3 (patch) | |
tree | 80e365f7c2840b1ad36af4dc39f984206e293fa2 /plugins/TabSRMM | |
parent | 5f135d78fc5f302ccefa1e8ee38d9bc83737fee2 (diff) |
fix for status line icons processing in tabSRMM
git-svn-id: http://svn.miranda-ng.org/main/trunk@2022 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM')
24 files changed, 320 insertions, 333 deletions
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index 0782165d39..1c52564e55 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -269,62 +269,61 @@ void CB_HardReInit() static INT_PTR CB_AddButton(WPARAM wParam, LPARAM lParam)
{
- BBButton * bbdi = (BBButton *)lParam;
+ BBButton *bbdi = (BBButton *)lParam;
bNeedResort = TRUE;
if (bbdi->cbSize != sizeof(BBButton))
return 1;
- {
- CustomButtonData *cbd = (CustomButtonData *)mir_alloc(sizeof(CustomButtonData));
- memset(cbd, 0, sizeof(CustomButtonData));
+ CustomButtonData *cbd = (CustomButtonData *)mir_alloc(sizeof(CustomButtonData));
+ memset(cbd, 0, sizeof(CustomButtonData));
- if (!bbdi->iButtonWidth && (bbdi->bbbFlags&BBBF_ISARROWBUTTON))
- cbd->iButtonWidth = DPISCALEX_S(34);
- else if (!bbdi->iButtonWidth)
- cbd->iButtonWidth = DPISCALEX_S(22);
- else cbd->iButtonWidth = DPISCALEX_S(bbdi->iButtonWidth);
+ if (!bbdi->iButtonWidth && (bbdi->bbbFlags & BBBF_ISARROWBUTTON))
+ cbd->iButtonWidth = DPISCALEX_S(34);
+ else if (!bbdi->iButtonWidth)
+ cbd->iButtonWidth = DPISCALEX_S(22);
+ else
+ cbd->iButtonWidth = DPISCALEX_S(bbdi->iButtonWidth);
- cbd->pszModuleName = mir_strdup(bbdi->pszModuleName);
+ cbd->pszModuleName = mir_strdup(bbdi->pszModuleName);
- if (bbdi->ptszTooltip) {
- if (bbdi->bbbFlags&BBBF_ANSITOOLTIP)
- cbd->ptszTooltip = mir_a2u(bbdi->pszTooltip);
- else
- cbd->ptszTooltip = mir_tstrdup(bbdi->ptszTooltip);
- } else cbd->ptszTooltip = NULL;
-
-
- cbd->dwButtonOrigID = bbdi->dwButtonID;
- cbd->hIcon = bbdi->hIcon;
- cbd->dwPosition = bbdi->dwDefPos;
- cbd->dwButtonCID = (bbdi->bbbFlags & BBBF_CREATEBYID) ? bbdi->dwButtonID : LastCID;
- //ugly workaround for smileys plugins
- cbd->dwArrowCID = (bbdi->bbbFlags & BBBF_ISARROWBUTTON) ? (cbd->dwButtonCID == IDOK ? IDC_SENDMENU : (cbd->dwButtonCID + 1)) : 0 ;
- cbd->bHidden = (bbdi->bbbFlags & BBBF_HIDDEN) ? 1 : 0;
- cbd->bLSided = (bbdi->bbbFlags & BBBF_ISLSIDEBUTTON) ? 1 : 0;
- cbd->bRSided = (bbdi->bbbFlags & BBBF_ISRSIDEBUTTON) ? 1 : 0;
- cbd->bCanBeHidden = (bbdi->bbbFlags & BBBF_CANBEHIDDEN) ? 1 : 0;
- cbd->bDummy = (bbdi->bbbFlags & BBBF_ISDUMMYBUTTON) ? 1 : 0;
- cbd->bChatButton = (bbdi->bbbFlags & BBBF_ISCHATBUTTON) ? 1 : 0;
- cbd->bIMButton = (bbdi->bbbFlags & BBBF_ISIMBUTTON) ? 1 : 0;
- cbd->bDisabled = (bbdi->bbbFlags & BBBF_DISABLED) ? 1 : 0;
- cbd->bPushButton = (bbdi->bbbFlags & BBBF_ISPUSHBUTTON) ? 1 : 0;
-
- CB_GetButtonSettings(NULL, cbd);
-
- if (cbd->bLSided)
- List_InsertPtr(LButtonsList, cbd);
- else if (cbd->bRSided)
- List_InsertPtr(RButtonsList, cbd);
- else return 1;
-
- if (cbd->dwButtonCID != cbd->dwButtonOrigID)
- LastCID++;
- if (cbd->dwArrowCID == LastCID)
- LastCID++;
-
- M->BroadcastMessage(DM_BBNEEDUPDATE, 0, 0);
+ if (bbdi->ptszTooltip) {
+ if (bbdi->bbbFlags & BBBF_ANSITOOLTIP)
+ cbd->ptszTooltip = mir_a2u(bbdi->pszTooltip);
+ else
+ cbd->ptszTooltip = mir_tstrdup(bbdi->ptszTooltip);
}
+ else cbd->ptszTooltip = NULL;
+
+ cbd->dwButtonOrigID = bbdi->dwButtonID;
+ cbd->hIcon = bbdi->hIcon;
+ cbd->dwPosition = bbdi->dwDefPos;
+ cbd->dwButtonCID = (bbdi->bbbFlags & BBBF_CREATEBYID) ? bbdi->dwButtonID : LastCID;
+ //ugly workaround for smileys plugins
+ cbd->dwArrowCID = (bbdi->bbbFlags & BBBF_ISARROWBUTTON) ? (cbd->dwButtonCID == IDOK ? IDC_SENDMENU : (cbd->dwButtonCID + 1)) : 0 ;
+ cbd->bHidden = (bbdi->bbbFlags & BBBF_HIDDEN) ? 1 : 0;
+ cbd->bLSided = (bbdi->bbbFlags & BBBF_ISLSIDEBUTTON) ? 1 : 0;
+ cbd->bRSided = (bbdi->bbbFlags & BBBF_ISRSIDEBUTTON) ? 1 : 0;
+ cbd->bCanBeHidden = (bbdi->bbbFlags & BBBF_CANBEHIDDEN) ? 1 : 0;
+ cbd->bDummy = (bbdi->bbbFlags & BBBF_ISDUMMYBUTTON) ? 1 : 0;
+ cbd->bChatButton = (bbdi->bbbFlags & BBBF_ISCHATBUTTON) ? 1 : 0;
+ cbd->bIMButton = (bbdi->bbbFlags & BBBF_ISIMBUTTON) ? 1 : 0;
+ cbd->bDisabled = (bbdi->bbbFlags & BBBF_DISABLED) ? 1 : 0;
+ cbd->bPushButton = (bbdi->bbbFlags & BBBF_ISPUSHBUTTON) ? 1 : 0;
+
+ CB_GetButtonSettings(NULL, cbd);
+
+ if (cbd->bLSided)
+ List_InsertPtr(LButtonsList, cbd);
+ else if (cbd->bRSided)
+ List_InsertPtr(RButtonsList, cbd);
+ else return 1;
+
+ if (cbd->dwButtonCID != cbd->dwButtonOrigID)
+ LastCID++;
+ if (cbd->dwArrowCID == LastCID)
+ LastCID++;
+
+ M->BroadcastMessage(DM_BBNEEDUPDATE, 0, 0);
return 0;
}
diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp index bdadea5bf5..7c8062c1d5 100644 --- a/plugins/TabSRMM/src/chat/log.cpp +++ b/plugins/TabSRMM/src/chat/log.cpp @@ -452,7 +452,7 @@ static TCHAR * _tcsrplc(TCHAR **src, const TCHAR *ptrn, const TCHAR *rplc) lRplc = lstrlen(rplc);
if (lPtrn && lSrc && lSrc >= lPtrn && (tszFound = _tcsstr(*src, ptrn)) != NULL) {
if (lRplc > lPtrn)
- *src = (TCHAR *) realloc((void *) * src,
+ *src = (TCHAR *) realloc((void*) * src,
sizeof(TCHAR) * (lSrc + lRplc - lPtrn + 1));
if (tszTail = (TCHAR *) malloc(sizeof(TCHAR) *
(lSrc - (tszFound - *src) - lPtrn + 1))) {
@@ -462,7 +462,7 @@ static TCHAR * _tcsrplc(TCHAR **src, const TCHAR *ptrn, const TCHAR *rplc) _tcscpy(tszFound, rplc);
/* write tail */
_tcscpy(tszFound + lRplc, tszTail);
- free((void *) tszTail);
+ free((void*) tszTail);
}
}
return *src;
@@ -492,7 +492,7 @@ static TCHAR * _tcsnrplc(TCHAR *src, size_t n, const TCHAR *ptrn, const TCHAR *r _tcscpy(tszFound, rplc);
/* write tail */
_tcscpy(tszFound + lRplc, tszTail);
- free((void *) tszTail);
+ free((void*) tszTail);
}
return src;
}
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index 7662aaf722..170c320299 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -1231,10 +1231,9 @@ void Chat_SetFilters(SESSION_INFO *si) dwMask = M->GetDword(si->hContact, "Chat", "FilterMask", 0);
si->iLogFilterFlags = dwFlags_default;
- for (i=0; i < 32; i++) {
+ for (int i=0; i < 32; i++)
if (dwMask & (1 << i))
si->iLogFilterFlags = (dwFlags_local & (1 << i) ? si->iLogFilterFlags | (1 << i) : si->iLogFilterFlags & ~(1 << i));
- }
dwFlags_default = M->GetDword("Chat", "PopupFlags", 0x03E0);
dwFlags_local = M->GetDword(si->hContact, "Chat", "PopupFlags", 0x03E0);
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index 77ee85f9b9..93173b8fb9 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -3045,8 +3045,8 @@ LABEL_SHOWWINDOW: tszAppeal[st++] = _T('\0');
}
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_REPLACESEL, FALSE, (LPARAM)tszAppeal);
- free((void *) tr2.lpstrText);
- free((void *) tszAppeal);
+ free((void*) tr2.lpstrText);
+ free((void*) tszAppeal);
}
}
SetFocus(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
@@ -3731,7 +3731,7 @@ LABEL_SHOWWINDOW: case WM_DWMCOMPOSITIONCHANGED:
BB_RefreshTheme(dat);
- memset((void *)&dat->pContainer->mOld, -1000, sizeof(MARGINS));
+ memset((void*)&dat->pContainer->mOld, -1000, sizeof(MARGINS));
CProxyWindow::verify(dat);
break;
@@ -3757,7 +3757,7 @@ LABEL_SHOWWINDOW: case WM_NCDESTROY:
if (dat) {
- memset((void *)&dat->pContainer->mOld, -1000, sizeof(MARGINS));
+ memset((void*)&dat->pContainer->mOld, -1000, sizeof(MARGINS));
PostMessage(dat->pContainer->hwnd, WM_SIZE, 0, 1);
delete dat->Panel;
if (dat->pContainer->dwFlags & CNT_SIDEBAR)
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index 28f51fe54b..eb5312b266 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -208,7 +208,7 @@ bool CContactCache::updateUIN() switch (ci.type) {
case CNFT_ASCIIZ:
mir_sntprintf(m_szUIN, safe_sizeof(m_szUIN), _T("%s"), reinterpret_cast<TCHAR *>(ci.pszVal));
- mir_free((void *)ci.pszVal);
+ mir_free((void*)ci.pszVal);
break;
case CNFT_DWORD:
mir_sntprintf(m_szUIN, safe_sizeof(m_szUIN), _T("%u"), ci.dVal);
@@ -325,7 +325,7 @@ void CContactCache::saveHistory(WPARAM wParam, LPARAM lParam) if ((m_iHistoryTop == m_iHistorySize) && oldTop == 0) { // shift the stack down...
TInputHistory ihTemp = m_history[0];
m_iHistoryTop--;
- ::MoveMemory((void *)&m_history[0], (void *)&m_history[1], (m_iHistorySize - 1) * sizeof(TInputHistory));
+ ::MoveMemory((void*)&m_history[0], (void*)&m_history[1], (m_iHistorySize - 1) * sizeof(TInputHistory));
m_history[m_iHistoryTop] = ihTemp;
}
if (iLength > m_history[m_iHistoryTop].lLen) {
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index afe5c85fd6..7d93aeed96 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -146,7 +146,7 @@ struct TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, HANDL struct TContainerData *pContainer = (struct TContainerData *)malloc(sizeof(struct TContainerData));
if (pContainer) {
- ZeroMemory((void *)pContainer, sizeof(struct TContainerData));
+ ZeroMemory((void*)pContainer, sizeof(struct TContainerData));
_tcsncpy(pContainer->szName, name, CONTAINER_NAMELEN + 1);
AppendToContainerList(pContainer);
@@ -607,7 +607,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, if (pContainer->dwFlagsEx & TCF_FLAT)
ws |= TCS_BUTTONS;
- memset((void *)&pContainer->mOld, -1000, sizeof(MARGINS));
+ memset((void*)&pContainer->mOld, -1000, sizeof(MARGINS));
if (pContainer->dwFlagsEx & TCF_SINGLEROWTABCONTROL) {
ws &= ~TCS_MULTILINE;
@@ -942,7 +942,7 @@ panel_found: }
switch (pNMHDR->code) {
case TCN_SELCHANGE: {
- ZeroMemory((void *)&item, sizeof(item));
+ ZeroMemory((void*)&item, sizeof(item));
iItem = TabCtrl_GetCurSel(hwndTab);
item.mask = TCIF_PARAM;
if (TabCtrl_GetItem(hwndTab, iItem, &item)) {
@@ -1036,7 +1036,7 @@ panel_found: case ID_TABMENU_ATTACHTOCONTAINER:
if ((iItem = GetTabItemFromMouse(hwndTab, &pt1)) == -1)
break;
- ZeroMemory((void *)&item, sizeof(item));
+ ZeroMemory((void*)&item, sizeof(item));
item.mask = TCIF_PARAM;
TabCtrl_GetItem(hwndTab, iItem, &item);
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_SELECTCONTAINER), hwndDlg, SelectContainerDlgProc, (LPARAM) item.lParam);
@@ -1380,7 +1380,7 @@ buttons_done: szNewTitle = Utils::FormatTitleBar(dat, pContainer->settings->szTitleFormat);
if (szNewTitle) {
SetWindowText(hwndDlg, szNewTitle);
- free((void *)szNewTitle);
+ free((void*)szNewTitle);
}
}
return 0;
@@ -1461,7 +1461,7 @@ buttons_done: break;
case SC_RESTORE:
pContainer->oldSize.cx = pContainer->oldSize.cy = 0;
- memset((void *)&pContainer->mOld, -1000, sizeof(MARGINS));
+ memset((void*)&pContainer->mOld, -1000, sizeof(MARGINS));
break;
case SC_MINIMIZE: {
TWindowData* dat = reinterpret_cast<TWindowData *>(GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA));
@@ -1504,7 +1504,7 @@ buttons_done: if (iNewTab != iCurrent) {
struct TabControlData *tabdat = (struct TabControlData *)GetWindowLongPtr(hwndTab, GWLP_USERDATA);
- ZeroMemory((void *)&item, sizeof(item));
+ ZeroMemory((void*)&item, sizeof(item));
item.mask = TCIF_PARAM;
if (TabCtrl_GetItem(hwndTab, iNewTab, &item)) {
TabCtrl_SetCurSel(hwndTab, iNewTab);
@@ -1579,7 +1579,7 @@ buttons_done: pContainer->dwFlags &= ~CNT_DEFERREDTABSELECT;
SendMessage(hwndDlg, WM_SYSCOMMAND, SC_RESTORE, 0);
- ZeroMemory((void *)&nmhdr, sizeof(nmhdr));
+ ZeroMemory((void*)&nmhdr, sizeof(nmhdr));
nmhdr.code = TCN_SELCHANGE;
nmhdr.hwndFrom = hwndTab;
nmhdr.idFrom = IDC_MSGTABS;
@@ -1603,7 +1603,7 @@ buttons_done: SendMessage(hwndDlg, DM_UPDATETITLE, (WPARAM)hContact, 0);
}
}
- ZeroMemory((void *)&item, sizeof(item));
+ ZeroMemory((void*)&item, sizeof(item));
item.mask = TCIF_PARAM;
if ((curItem = TabCtrl_GetCurSel(hwndTab)) >= 0)
TabCtrl_GetItem(hwndTab, curItem, &item);
@@ -1631,7 +1631,7 @@ buttons_done: hwndCurrent = pContainer->hwndActive;
if ((iItem = GetTabItemFromMouse(hwndTab, pt)) == -1)
break;
- ZeroMemory((void *)&item, sizeof(item));
+ ZeroMemory((void*)&item, sizeof(item));
item.mask = TCIF_PARAM;
TabCtrl_GetItem(hwndTab, iItem, &item);
if (item.lParam) {
@@ -1711,7 +1711,7 @@ buttons_done: //if (pContainer->settings == 0)
// pContainer->settings = (TContainerSettings *)malloc(sizeof(TContainerSettings));
- //CopyMemory((void *)pContainer->settings, (void *)&PluginConfig.globalContainerSettings, sizeof(TContainerSettings));
+ //CopyMemory((void*)pContainer->settings, (void*)&PluginConfig.globalContainerSettings, sizeof(TContainerSettings));
//Utils::ReadContainerSettingsFromDB(pContainer->hContactFrom, pContainer->settings);
pContainer->settings = &PluginConfig.globalContainerSettings;
@@ -2015,7 +2015,7 @@ buttons_done: fa.cProto = dat ? dat->szProto : NULL;
CallService(MS_FAVATAR_DESTROY, (WPARAM)&fa, 0);
}
- ZeroMemory((void *)&item, sizeof(item));
+ ZeroMemory((void*)&item, sizeof(item));
pContainer->hwnd = 0;
pContainer->hwndActive = 0;
pContainer->hMenuContext = 0;
@@ -2109,7 +2109,7 @@ buttons_done: }
}
- ZeroMemory((void *)&wp, sizeof(wp));
+ ZeroMemory((void*)&wp, sizeof(wp));
wp.length = sizeof(wp);
/*
* save geometry information to the database...
@@ -2213,7 +2213,7 @@ int TSAPI GetTabIndexFromHWND(HWND hwndTab, HWND hwnd) iItems = TabCtrl_GetItemCount(hwndTab);
- ZeroMemory((void *)&item, sizeof(item));
+ ZeroMemory((void*)&item, sizeof(item));
item.mask = TCIF_PARAM;
for (i=0; i < iItems; i++) {
@@ -2237,7 +2237,7 @@ int TSAPI ActivateTabFromHWND(HWND hwndTab, HWND hwnd) int iItem = GetTabIndexFromHWND(hwndTab, hwnd);
if (iItem >= 0) {
TabCtrl_SetCurSel(hwndTab, iItem);
- ZeroMemory((void *)&nmhdr, sizeof(nmhdr));
+ ZeroMemory((void*)&nmhdr, sizeof(nmhdr));
nmhdr.code = TCN_SELCHANGE;
SendMessage(GetParent(hwndTab), WM_NOTIFY, 0, (LPARAM) &nmhdr); // do it via a WM_NOTIFY / TCN_SELCHANGE to simulate user-activation
return iItem;
@@ -2714,7 +2714,7 @@ void TSAPI BroadCastContainer(const TContainerData *pContainer, UINT message, WP TCITEM item;
HWND hwndTab = GetDlgItem(pContainer->hwnd, IDC_MSGTABS);
- ZeroMemory((void *)&item, sizeof(item));
+ ZeroMemory((void*)&item, sizeof(item));
item.mask = TCIF_PARAM;
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp index 100a83fb9d..35c2acb11b 100644 --- a/plugins/TabSRMM/src/controls.cpp +++ b/plugins/TabSRMM/src/controls.cpp @@ -931,7 +931,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR struct TWindowData *dat = (struct TWindowData *)lParam;
RECT rcs;
int statwidths[5];
- struct TStatusBarIconNode *current = status_icon_list;
+ TStatusBarIconNode *current = status_icon_list;
int list_icons = 0;
char buff[100];
DWORD flags;
@@ -939,7 +939,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR while (current && dat) {
flags=current->sid.flags;
if (current->sid.flags&MBF_OWNERSTATE){
- struct TStatusBarIconNode *currentSIN = dat->pSINod;
+ TStatusBarIconNode *currentSIN = dat->pSINod;
while (currentSIN) {
if (strcmp(currentSIN->sid.szModule, current->sid.szModule) == 0 && currentSIN->sid.dwId == current->sid.dwId) {
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index c8eb8ce044..394979f280 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -610,7 +610,7 @@ static int PopupUpdateT(HANDLE hContact, HANDLE hEvent) if (!pdata)
return 1;
- ZeroMemory((void *)&dbe, sizeof(dbe));
+ ZeroMemory((void*)&dbe, sizeof(dbe));
if (hEvent) {
if (pdata->pluginOptions->bShowHeaders) {
@@ -722,7 +722,7 @@ static int PopupShowT(NEN_OPTIONS *pluginOptions, HANDLE hContact, HANDLE hEvent dbe.szModule = Translate("Unknown module or contact");
pdata = (PLUGIN_DATAT *)mir_alloc(sizeof(PLUGIN_DATAT));
- ZeroMemory((void *)pdata, sizeof(PLUGIN_DATAT));
+ ZeroMemory((void*)pdata, sizeof(PLUGIN_DATAT));
pdata->eventType = eventType;
pdata->hContact = hContact;
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 32d65a8671..2b04d1813c 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -144,7 +144,7 @@ void TSAPI DM_InitTip(TWindowData *dat) dat->hwndTip = CreateWindowEx(0, TOOLTIPS_CLASS, NULL, WS_POPUP | TTS_NOPREFIX | TTS_BALLOON, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, dat->hwnd, NULL, g_hInst, (LPVOID) NULL);
- ZeroMemory((void *)&dat->ti, sizeof(dat->ti));
+ ZeroMemory((void*)&dat->ti, sizeof(dat->ti));
dat->ti.cbSize = sizeof(dat->ti);
dat->ti.lpszText = PluginConfig.m_szNoStatus;
dat->ti.hinst = g_hInst;
@@ -1594,19 +1594,20 @@ void TSAPI DM_Typing(TWindowData *dat, bool fForceOff) if (dat == 0)
return;
- HWND hwndDlg = dat->hwnd;
- HWND hwndContainer = dat->pContainer->hwnd;
- HWND hwndStatus = dat->pContainer->hwndStatus;
+ HWND hwndDlg = dat->hwnd;
+ HWND hwndContainer = dat->pContainer->hwnd;
+ HWND hwndStatus = dat->pContainer->hwndStatus;
- if (dat->nTypeMode == PROTOTYPE_SELFTYPING_ON && GetTickCount() - dat->nLastTyping > TIMEOUT_TYPEOFF) {
+ if (dat->nTypeMode == PROTOTYPE_SELFTYPING_ON && GetTickCount() - dat->nLastTyping > TIMEOUT_TYPEOFF)
DM_NotifyTyping(dat, PROTOTYPE_SELFTYPING_OFF);
- }
+
if (dat->showTyping == 1) {
if (dat->nTypeSecs > 0) {
dat->nTypeSecs--;
if (GetForegroundWindow() == hwndContainer)
SendMessage(hwndDlg, DM_UPDATEWINICON, 0, 0);
- } else {
+ }
+ else {
struct TWindowData *dat_active = NULL;
if (!fForceOff) {
@@ -1977,7 +1978,7 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM wParam, LPARAM lParam) HWND hwndContainer = dat->pContainer->hwnd;
TContainerData* m_pContainer = dat->pContainer;
- ZeroMemory((void *)newcontactname, sizeof(newcontactname));
+ ZeroMemory((void*)newcontactname, sizeof(newcontactname));
dat->szStatus[0] = 0;
pszNewTitleEnd = _T("Message Session");
@@ -1985,7 +1986,7 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM wParam, LPARAM lParam) if (dat->iTabID == -1)
return;
- ZeroMemory((void *)&item, sizeof(item));
+ ZeroMemory((void*)&item, sizeof(item));
if (dat->hContact) {
int iHasName;
TCHAR fulluin[256];
@@ -2098,13 +2099,13 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM wParam, LPARAM lParam) */
static HANDLE hHookIconPressedEvt;
-struct TStatusBarIconNode *status_icon_list = 0;
+TStatusBarIconNode *status_icon_list = 0;
int status_icon_list_size = 0;
static INT_PTR SI_AddStatusIcon(WPARAM wParam, LPARAM lParam)
{
StatusIconData *sid = (StatusIconData *)lParam;
- struct TStatusBarIconNode *siln = (struct TStatusBarIconNode *)mir_alloc(sizeof(struct TStatusBarIconNode));
+ TStatusBarIconNode *siln = (TStatusBarIconNode *)mir_alloc(sizeof(TStatusBarIconNode));
siln->sid.cbSize = sid->cbSize;
siln->sid.szModule = mir_strdup(sid->szModule);
@@ -2112,9 +2113,7 @@ static INT_PTR SI_AddStatusIcon(WPARAM wParam, LPARAM lParam) siln->sid.hIcon = sid->hIcon;
siln->sid.hIconDisabled = sid->hIconDisabled;
siln->sid.flags = sid->flags;
- if (sid->szTooltip) siln->sid.szTooltip = mir_strdup(sid->szTooltip);
- else siln->sid.szTooltip = 0;
-
+ siln->sid.szTooltip = mir_strdup(sid->szTooltip);
siln->next = status_icon_list;
status_icon_list = siln;
status_icon_list_size++;
@@ -2126,7 +2125,7 @@ static INT_PTR SI_AddStatusIcon(WPARAM wParam, LPARAM lParam) static INT_PTR SI_RemoveStatusIcon(WPARAM wParam, LPARAM lParam)
{
StatusIconData *sid = (StatusIconData *)lParam;
- struct TStatusBarIconNode *current = status_icon_list, *prev = 0;
+ TStatusBarIconNode *current = status_icon_list, *prev = 0;
while (current) {
if (strcmp(current->sid.szModule, sid->szModule) == 0 && current->sid.dwId == sid->dwId) {
@@ -2137,8 +2136,9 @@ static INT_PTR SI_RemoveStatusIcon(WPARAM wParam, LPARAM lParam) mir_free(current->sid.szModule);
DestroyIcon(current->sid.hIcon);
- if (current->sid.hIconDisabled) DestroyIcon(current->sid.hIconDisabled);
- if (current->sid.szTooltip) mir_free(current->sid.szTooltip);
+ if (current->sid.hIconDisabled)
+ DestroyIcon(current->sid.hIconDisabled);
+ mir_free(current->sid.szTooltip);
mir_free(current);
M->BroadcastMessage(DM_STATUSICONCHANGE, 0, 0);
return 0;
@@ -2152,7 +2152,7 @@ static INT_PTR SI_RemoveStatusIcon(WPARAM wParam, LPARAM lParam) static void SI_RemoveAllStatusIcons(void)
{
- struct TStatusBarIconNode *current;
+ TStatusBarIconNode *current;
while (status_icon_list) {
current = status_icon_list;
@@ -2170,17 +2170,15 @@ static void SI_RemoveAllStatusIcons(void) static INT_PTR SI_ModifyStatusIcon(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
-
StatusIconData *sid = (StatusIconData *)lParam;
+ if ( !sid || !sid->szModule)
+ return 1;
- // return 0 on stupid calls :-P
- if(!hContact || !sid || !sid->szModule) return 0;
-
- struct TStatusBarIconNode *current = status_icon_list;
+ TStatusBarIconNode *current = status_icon_list;
+ HANDLE hContact = (HANDLE)wParam;
while (current) {
- if (strcmp(current->sid.szModule, sid->szModule) == 0 && current->sid.dwId == sid->dwId) {
+ if ( strcmp(current->sid.szModule, sid->szModule) == 0 && current->sid.dwId == sid->dwId) {
if (!hContact) {
current->sid.flags = sid->flags;
if (sid->hIcon) {
@@ -2191,25 +2189,23 @@ static INT_PTR SI_ModifyStatusIcon(WPARAM wParam, LPARAM lParam) DestroyIcon(current->sid.hIconDisabled);
current->sid.hIconDisabled = sid->hIconDisabled;
}
- if (sid->szTooltip) {
- if (current->sid.szTooltip) mir_free(current->sid.szTooltip);
- current->sid.szTooltip = mir_strdup(sid->szTooltip);
- }
+ if (sid->szTooltip)
+ replaceStr(current->sid.szTooltip, sid->szTooltip);
M->BroadcastMessage(DM_STATUSICONCHANGE, 0, 0);
- } else {
+ }
+ else {
char buff[256];
HWND hwnd;
- if (!(sid->flags&MBF_OWNERSTATE)) {
+ if ( !(sid->flags & MBF_OWNERSTATE)) {
sprintf(buff, "SRMMStatusIconFlags%d", (int)sid->dwId);
M->WriteByte(hContact, sid->szModule, buff, (BYTE)sid->flags);
}
if ((hwnd = M->FindWindow(hContact))) {
- if (sid->flags&MBF_OWNERSTATE) {
-
- struct TStatusBarIconNode *siln = NULL;
- struct TWindowData *dat = (struct TWindowData *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
- struct TStatusBarIconNode *psi = dat->pSINod;
+ if (sid->flags & MBF_OWNERSTATE) {
+ TStatusBarIconNode *siln = NULL;
+ TWindowData *dat = (TWindowData*) GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ TStatusBarIconNode *psi = dat->pSINod;
while (psi) {
if (strcmp(psi->sid.szModule, sid->szModule) == 0 && psi->sid.dwId == sid->dwId) {
siln = psi;
@@ -2218,7 +2214,7 @@ static INT_PTR SI_ModifyStatusIcon(WPARAM wParam, LPARAM lParam) psi = psi->next;
}
if (!siln) {
- siln = (struct TStatusBarIconNode *)mir_alloc(sizeof(struct TStatusBarIconNode));
+ siln = (TStatusBarIconNode *)mir_alloc(sizeof(TStatusBarIconNode));
siln->sid.szModule = mir_strdup(sid->szModule);
siln->sid.dwId = sid->dwId;
siln->sid.hIcon = sid->hIcon;
@@ -2230,7 +2226,8 @@ static INT_PTR SI_ModifyStatusIcon(WPARAM wParam, LPARAM lParam) siln->next = dat->pSINod;
dat->pSINod = siln;
- } else {
+ }
+ else {
siln->sid.hIcon = sid->hIcon;
siln->sid.hIconDisabled = sid->hIconDisabled;
siln->sid.flags = sid->flags;
@@ -2240,11 +2237,8 @@ static INT_PTR SI_ModifyStatusIcon(WPARAM wParam, LPARAM lParam) else siln->sid.szTooltip = 0;
}
-
-
- PostMessage(hwnd, DM_STATUSICONCHANGE, 0, 0);
- } else
- PostMessage(hwnd, DM_STATUSICONCHANGE, 0, 0);
+ }
+ PostMessage(hwnd, DM_STATUSICONCHANGE, 0, 0);
}
}
return 0;
@@ -2268,7 +2262,7 @@ void DrawStatusIcons(struct TWindowData *dat, HDC hDC, RECT r, int gap) SetBkMode(hDC, TRANSPARENT);
while (current) {
if (current->sid.flags&MBF_OWNERSTATE) {
- struct TStatusBarIconNode *currentSIN = dat->pSINod;
+ TStatusBarIconNode *currentSIN = dat->pSINod;
flags = current->sid.flags;
hIcon = current->sid.hIcon;
while (currentSIN) {
@@ -2300,23 +2294,23 @@ void DrawStatusIcons(struct TWindowData *dat, HDC hDC, RECT r, int gap) current = current->next;
}
DrawIconEx(hDC, x, y, PluginConfig.g_buttonBarIcons[ICON_DEFAULT_SOUNDS],
- cx_icon, cy_icon, 0, NULL, DI_NORMAL);
+ cx_icon, cy_icon, 0, NULL, DI_NORMAL);
DrawIconEx(hDC, x, y, dat->pContainer->dwFlags & CNT_NOSOUND ?
- PluginConfig.g_iconOverlayDisabled : PluginConfig.g_iconOverlayEnabled,
- cx_icon, cy_icon, 0, NULL, DI_NORMAL);
+ PluginConfig.g_iconOverlayDisabled : PluginConfig.g_iconOverlayEnabled,
+ cx_icon, cy_icon, 0, NULL, DI_NORMAL);
x += (cx_icon + gap);
if (dat->bType == SESSIONTYPE_IM) {
DrawIconEx(hDC, x, y,
- PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING], cx_icon, cy_icon, 0, NULL, DI_NORMAL);
+ PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING], cx_icon, cy_icon, 0, NULL, DI_NORMAL);
DrawIconEx(hDC, x, y, M->GetByte(dat->hContact, SRMSGMOD, SRMSGSET_TYPING, M->GetByte(SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW)) ?
- PluginConfig.g_iconOverlayEnabled : PluginConfig.g_iconOverlayDisabled, cx_icon, cy_icon, 0, NULL, DI_NORMAL);
+ PluginConfig.g_iconOverlayEnabled : PluginConfig.g_iconOverlayDisabled, cx_icon, cy_icon, 0, NULL, DI_NORMAL);
}
else
CSkin::DrawDimmedIcon(hDC, x, y, cx_icon, cy_icon,
- PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING], 50);
+ PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING], 50);
x += (cx_icon + gap);
DrawIconEx(hDC, x, y, PluginConfig.g_sideBarIcons[0], cx_icon, cy_icon, 0, NULL, DI_NORMAL);
@@ -2325,13 +2319,13 @@ 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)
{
StatusIconClickData sicd;
- struct TStatusBarIconNode *current = status_icon_list;
- struct TStatusBarIconNode *clicked = NULL;
+ TStatusBarIconNode *current = status_icon_list;
+ TStatusBarIconNode *clicked = NULL;
- unsigned int iconNum = (pt.x - (r.left + 0)) / (PluginConfig.m_smcxicon + gap);
- unsigned int list_icons = 0;
- char buff[100];
- DWORD flags;
+ UINT iconNum = (pt.x - (r.left + 0)) / (PluginConfig.m_smcxicon + gap);
+ UINT list_icons = 0;
+ char buff[100];
+ DWORD flags;
if (dat && (code == NM_CLICK || code == NM_RCLICK)) {
POINT ptScreen;
@@ -2340,9 +2334,10 @@ void SI_CheckStatusIconClick(struct TWindowData *dat, HWND hwndFrom, POINT pt, R if (!PtInRect(&rcLastStatusBarClick, ptScreen))
return;
}
+
while (current && dat) {
- if (current->sid.flags&MBF_OWNERSTATE) {
- struct TStatusBarIconNode *currentSIN = dat->pSINod;
+ if (current->sid.flags & MBF_OWNERSTATE) {
+ TStatusBarIconNode *currentSIN = dat->pSINod;
flags = current->sid.flags;
while (currentSIN) {
if (strcmp(currentSIN->sid.szModule, current->sid.szModule) == 0 && currentSIN->sid.dwId == current->sid.dwId) {
@@ -2355,7 +2350,7 @@ void SI_CheckStatusIconClick(struct TWindowData *dat, HWND hwndFrom, POINT pt, R sprintf(buff, "SRMMStatusIconFlags%d", (int)current->sid.dwId);
flags = M->GetByte(dat->hContact, current->sid.szModule, buff, current->sid.flags);
}
- if (!(flags & MBF_HIDDEN)) {
+ if ( !(flags & MBF_HIDDEN)) {
if (list_icons++ == iconNum)
clicked = current;
}
@@ -2394,25 +2389,19 @@ void SI_CheckStatusIconClick(struct TWindowData *dat, HWND hwndFrom, POINT pt, R }
}
-static HANDLE SI_hServiceIcon[3];
-
int SI_InitStatusIcons()
{
- SI_hServiceIcon[0] = CreateServiceFunction(MS_MSG_ADDICON, SI_AddStatusIcon);
- SI_hServiceIcon[1] = CreateServiceFunction(MS_MSG_REMOVEICON, SI_RemoveStatusIcon);
- SI_hServiceIcon[2] = CreateServiceFunction(MS_MSG_MODIFYICON, SI_ModifyStatusIcon);
+ CreateServiceFunction(MS_MSG_ADDICON, SI_AddStatusIcon);
+ CreateServiceFunction(MS_MSG_REMOVEICON, SI_RemoveStatusIcon);
+ CreateServiceFunction(MS_MSG_MODIFYICON, SI_ModifyStatusIcon);
hHookIconPressedEvt = CreateHookableEvent(ME_MSG_ICONPRESSED);
-
return 0;
}
int SI_DeinitStatusIcons()
{
- int i;
DestroyHookableEvent(hHookIconPressedEvt);
- for (i=0; i < 3; i++)
- DestroyServiceFunction(SI_hServiceIcon[i]);
SI_RemoveAllStatusIcons();
return 0;
}
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index 7e66d12bea..080538727b 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -453,13 +453,13 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP case DM_SENDMESSAGECOMMANDW:
SendMessageCommand_W(wParam, lParam);
if (lParam)
- free((void *)lParam);
+ free((void*)lParam);
return 0;
case DM_SENDMESSAGECOMMAND:
SendMessageCommand(wParam, lParam);
if (lParam)
- free((void *)lParam);
+ free((void*)lParam);
return 0;
/*
* sent from the popup to "dismiss" the event. we should do this in the main thread
diff --git a/plugins/TabSRMM/src/include/functions.h b/plugins/TabSRMM/src/include/functions.h index 49ae0f79ab..4efdc9662e 100644 --- a/plugins/TabSRMM/src/include/functions.h +++ b/plugins/TabSRMM/src/include/functions.h @@ -11,7 +11,7 @@ * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * of the License, or(at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -24,7 +24,7 @@ *
* part of tabSRMM messaging plugin for Miranda.
*
- * (C) 2005-2009 by silvercircle _at_ gmail _dot_ com and contributors
+ *(C) 2005-2009 by silvercircle _at_ gmail _dot_ com and contributors
*
* $Id: functions.h 11636 2010-04-27 22:08:16Z silvercircle $
*
@@ -35,79 +35,81 @@ #ifndef _TABSRMM_FUNCTIONS_H
#define _TABSRMM_FUNCTIONS_H
-int Chat_PreShutdown ();
-int Chat_ModulesLoaded (WPARAM wp, LPARAM lp);
-int AvatarChanged (WPARAM wParam, LPARAM lParam);
-int MyAvatarChanged (WPARAM wParam, LPARAM lParam);
-int IcoLibIconsChanged (WPARAM wParam, LPARAM lParam);
-int FontServiceFontsChanged (WPARAM wParam, LPARAM lParam);
-int SmileyAddOptionsChanged (WPARAM wParam, LPARAM lParam);
-int IEViewOptionsChanged (WPARAM wParam, LPARAM lParam);
-void RegisterFontServiceFonts ();
-int ModPlus_PreShutdown (WPARAM wparam, LPARAM lparam);
-int ModPlus_Init (WPARAM wparam, LPARAM lparam);
-LONG_PTR CALLBACK HotkeyHandlerDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+int Chat_PreShutdown();
+int Chat_ModulesLoaded(WPARAM wp, LPARAM lp);
+int AvatarChanged(WPARAM wParam, LPARAM lParam);
+int MyAvatarChanged(WPARAM wParam, LPARAM lParam);
+int IcoLibIconsChanged(WPARAM wParam, LPARAM lParam);
+int FontServiceFontsChanged(WPARAM wParam, LPARAM lParam);
+int SmileyAddOptionsChanged(WPARAM wParam, LPARAM lParam);
+int IEViewOptionsChanged(WPARAM wParam, LPARAM lParam);
+void RegisterFontServiceFonts();
+int ModPlus_PreShutdown(WPARAM wparam, LPARAM lparam);
+int ModPlus_Init(WPARAM wparam, LPARAM lparam);
+LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
/*
* nen / event popup stuff
*/
-int TSAPI NEN_ReadOptions (NEN_OPTIONS *options);
-int TSAPI NEN_WriteOptions (NEN_OPTIONS *options);
-int TSAPI UpdateTrayMenu (const TWindowData *dat, WORD wStatus, const char *szProto,
- const TCHAR *szStatus, HANDLE hContact, DWORD fromEvent);
-static int TSAPI PopupPreview (NEN_OPTIONS *pluginOptions);
-void TSAPI DeletePopupsForContact (HANDLE hContact, DWORD dwMask);
+int TSAPI NEN_ReadOptions(NEN_OPTIONS *options);
+int TSAPI NEN_WriteOptions(NEN_OPTIONS *options);
+int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szProto, const TCHAR *szStatus, HANDLE hContact, DWORD fromEvent);
+int TSAPI PopupPreview(NEN_OPTIONS *pluginOptions);
+void TSAPI DeletePopupsForContact(HANDLE hContact, DWORD dwMask);
/*
* tray stuff
*/
-void TSAPI CreateSystrayIcon (int create);
-void TSAPI FlashTrayIcon (HICON hIcon);
-void TSAPI UpdateTrayMenuState (TWindowData *dat, BOOL bForced);
-void TSAPI LoadFavoritesAndRecent ();
-void TSAPI AddContactToFavorites (HANDLE hContact, const TCHAR *szNickname, const char *szProto, TCHAR *szStatus,
- WORD wStatus, HICON hIcon, BOOL mode, HMENU hMenu);
-void TSAPI CreateTrayMenus (int mode);
-void TSAPI HandleMenuEntryFromhContact (int iSelection);
+void TSAPI CreateSystrayIcon(int create);
+void TSAPI FlashTrayIcon(HICON hIcon);
+void TSAPI UpdateTrayMenuState(TWindowData *dat, BOOL bForced);
+void TSAPI LoadFavoritesAndRecent();
+void TSAPI AddContactToFavorites(HANDLE hContact, const TCHAR *szNickname, const char *szProto, TCHAR *szStatus,
+ WORD wStatus, HICON hIcon, BOOL mode, HMENU hMenu);
+void TSAPI CreateTrayMenus(int mode);
+void TSAPI HandleMenuEntryFromhContact(int iSelection);
/*
- * gneric msgwindow functions (creation, container management etc.)
+ * gneric msgwindow functions(creation, container management etc.)
*/
-BOOL TSAPI IsUtfSendAvailable (HANDLE hContact);
-HWND TSAPI CreateNewTabForContact (TContainerData *pContainer, HANDLE hContact, int isSend,
- const char *pszInitialText, BOOL bActivateTAb, BOOL bPopupContainer, BOOL bWantPopup, HANDLE hdbEvent);
-int TSAPI ActivateTabFromHWND (HWND hwndTab, HWND hwnd);
-void TSAPI FlashContainer (TContainerData *pContainer, int iMode, int iNum);
-void TSAPI CreateImageList (BOOL bInitial);
+BOOL TSAPI IsUtfSendAvailable(HANDLE hContact);
+HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, HANDLE hContact, int isSend,
+ const char *pszInitialText, BOOL bActivateTAb, BOOL bPopupContainer, BOOL bWantPopup, HANDLE hdbEvent);
+int TSAPI ActivateTabFromHWND(HWND hwndTab, HWND hwnd);
+void TSAPI FlashContainer(TContainerData *pContainer, int iMode, int iNum);
+void TSAPI CreateImageList(BOOL bInitial);
+
TContainerData* TSAPI FindMatchingContainer(const TCHAR *szName, HANDLE hContact);
-TContainerData* TSAPI CreateContainer (const TCHAR *name, int iTemp, HANDLE hContactFrom);
-TContainerData* TSAPI FindContainerByName (const TCHAR *name);
-int TSAPI GetTabIndexFromHWND (HWND hwndTab, HWND hwnd);
-int TSAPI GetTabItemFromMouse (HWND hwndTab, POINT *pt);
-int TSAPI ActivateTabFromHWND (HWND hwndTab, HWND hwnd);
-void TSAPI AdjustTabClientRect (TContainerData *pContainer, RECT *rc);
-void TSAPI ReflashContainer (TContainerData *pContainer);
-HMENU TSAPI BuildMCProtocolMenu (HWND hwndDlg);
+TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, HANDLE hContactFrom);
+TContainerData* TSAPI FindContainerByName(const TCHAR *name);
+
+int TSAPI GetTabIndexFromHWND(HWND hwndTab, HWND hwnd);
+int TSAPI GetTabItemFromMouse(HWND hwndTab, POINT *pt);
+int TSAPI ActivateTabFromHWND(HWND hwndTab, HWND hwnd);
+void TSAPI AdjustTabClientRect(TContainerData *pContainer, RECT *rc);
+void TSAPI ReflashContainer(TContainerData *pContainer);
+HMENU TSAPI BuildMCProtocolMenu(HWND hwndDlg);
TContainerData* TSAPI AppendToContainerList(TContainerData *pContainer);
TContainerData* TSAPI RemoveContainerFromList(TContainerData *pContainer);
-void TSAPI DeleteContainer (int iIndex);
-void TSAPI RenameContainer (int iIndex, const TCHAR *newName);
-int TSAPI GetContainerNameForContact (HANDLE hContact, TCHAR *szName, int iNameLen);
-HMENU TSAPI BuildContainerMenu ();
-void TSAPI BuildCodePageList ();
-void TSAPI PreTranslateDates ();
-void TSAPI ApplyContainerSetting (TContainerData *pContainer, DWORD flags, UINT mode, bool fForceResize);
-void TSAPI BroadCastContainer (const TContainerData *pContainer, UINT message, WPARAM wParam, LPARAM lParam, BYTE iType = 0);
-void TSAPI GetDefaultContainerTitleFormat();
-INT_PTR MessageWindowOpened(WPARAM wParam, LPARAM lParam);
-void TSAPI SetAeroMargins (TContainerData *pContainer);
-int TABSRMM_FireEvent (HANDLE hContact, HWND hwnd, unsigned int type, unsigned int subType);
+void TSAPI DeleteContainer(int iIndex);
+void TSAPI RenameContainer(int iIndex, const TCHAR *newName);
+int TSAPI GetContainerNameForContact(HANDLE hContact, TCHAR *szName, int iNameLen);
+HMENU TSAPI BuildContainerMenu();
+void TSAPI BuildCodePageList();
+void TSAPI PreTranslateDates();
+void TSAPI ApplyContainerSetting(TContainerData *pContainer, DWORD flags, UINT mode, bool fForceResize);
+void TSAPI BroadCastContainer(const TContainerData *pContainer, UINT message, WPARAM wParam, LPARAM lParam, BYTE iType = 0);
+void TSAPI GetDefaultContainerTitleFormat();
+void TSAPI SetAeroMargins(TContainerData *pContainer);
+int TABSRMM_FireEvent(HANDLE hContact, HWND hwnd, unsigned int type, unsigned int subType);
+
+INT_PTR MessageWindowOpened(WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK IEViewSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK HPPKFSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -115,85 +117,84 @@ LRESULT CALLBACK HPPKFSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP /*
* skinning engine
*/
-void TSAPI DrawAlpha (HDC hdcwnd, PRECT rc, DWORD basecolor, int alpha, DWORD basecolor2,
- BYTE transparent, BYTE FLG_GRADIENT, BYTE FLG_CORNER, DWORD BORDERSTYLE, CImageItem *imageItem);
+void TSAPI DrawAlpha(HDC hdcwnd, PRECT rc, DWORD basecolor, int alpha, DWORD basecolor2,
+ BYTE transparent, BYTE FLG_GRADIENT, BYTE FLG_CORNER, DWORD BORDERSTYLE, CImageItem *imageItem);
// the cached message log icons
-void TSAPI CacheMsgLogIcons ();
-void TSAPI CacheLogFonts ();
-void TSAPI InitAPI ();
-void TSAPI LoadIconTheme ();
-int TSAPI LoadFromIconLib ();
-int TSAPI SetupIconLibConfig ();
-void TSAPI RTF_CTableInit ();
+void TSAPI CacheMsgLogIcons();
+void TSAPI CacheLogFonts();
+void TSAPI InitAPI();
+void TSAPI LoadIconTheme();
+int TSAPI LoadFromIconLib();
+int TSAPI SetupIconLibConfig();
+void TSAPI RTF_CTableInit();
INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-int TSAPI InitOptions (void);
-INT_PTR CALLBACK DlgProcContainer (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-int TSAPI DbEventIsShown (TWindowData *dat, DBEVENTINFO *dbei);
-void TSAPI StreamInEvents (HWND hwndDlg,HANDLE hDbEventFirst,int count,int fAppend, DBEVENTINFO *dbei_s);
-void TSAPI LoadLogfont (int i,LOGFONTA *lf,COLORREF *colour, char *szModule);
-
+int TSAPI InitOptions(void);
+int TSAPI DbEventIsShown(TWindowData *dat, DBEVENTINFO *dbei);
+void TSAPI StreamInEvents(HWND hwndDlg,HANDLE hDbEventFirst,int count,int fAppend, DBEVENTINFO *dbei_s);
+void TSAPI LoadLogfont(int i,LOGFONTA *lf,COLORREF *colour, char *szModule);
// custom tab control
-void TSAPI ReloadTabConfig ();
-void TSAPI FreeTabConfig ();
-int TSAPI RegisterTabCtrlClass (void);
+void TSAPI ReloadTabConfig();
+void TSAPI FreeTabConfig();
+int TSAPI RegisterTabCtrlClass(void);
// buttons
-int TSAPI LoadTSButtonModule (void);
-int TSAPI UnloadTSButtonModule ();
+int TSAPI LoadTSButtonModule(void);
+int TSAPI UnloadTSButtonModule();
/*
* debugging support
*/
-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 _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, ...);
// themes
-const TCHAR* TSAPI GetThemeFileName (int iMode);
-void TSAPI LoadLogfontFromINI (int i, char *szKey, LOGFONTA *lf, COLORREF *colour, const char *szIniFilename);
-int TSAPI CheckThemeVersion (const TCHAR *szIniFilename);
-void TSAPI WriteThemeToINI (const TCHAR *szIniFilename, TWindowData *dat);
-void TSAPI ReadThemeFromINI (const TCHAR *szIniFilename, TContainerData *dat, int noAdvanced, DWORD dwFlags);
+const TCHAR* TSAPI GetThemeFileName(int iMode);
+void TSAPI LoadLogfontFromINI(int i, char *szKey, LOGFONTA *lf, COLORREF *colour, const char *szIniFilename);
+int TSAPI CheckThemeVersion(const TCHAR *szIniFilename);
+void TSAPI WriteThemeToINI(const TCHAR *szIniFilename, TWindowData *dat);
+void TSAPI ReadThemeFromINI(const TCHAR *szIniFilename, TContainerData *dat, int noAdvanced, DWORD dwFlags);
// compatibility
// user prefs
-int TSAPI LoadLocalFlags (HWND hwnd, TWindowData *dat);
+int TSAPI LoadLocalFlags(HWND hwnd, TWindowData *dat);
//TypingNotify
-int TN_ModuleInit ();
-int TN_OptionsInitialize (WPARAM wParam, LPARAM lParam);
-int TN_ModuleDeInit ();
-int TN_TypingMessage (WPARAM wParam, LPARAM lParam);
+int TN_ModuleInit();
+int TN_OptionsInitialize(WPARAM wParam, LPARAM lParam);
+int TN_ModuleDeInit();
+int TN_TypingMessage(WPARAM wParam, LPARAM lParam);
// mod plus
-int ChangeClientIconInStatusBar (const TWindowData *dat);
+int ChangeClientIconInStatusBar(const TWindowData *dat);
// hotkeys
-LRESULT ProcessHotkeysByMsgFilter (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, UINT_PTR ctrlId);
+LRESULT ProcessHotkeysByMsgFilter(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, UINT_PTR ctrlId);
-void TSAPI DrawMenuItem (DRAWITEMSTRUCT *dis, HICON hIcon, DWORD dwIdle);
+void TSAPI DrawMenuItem(DRAWITEMSTRUCT *dis, HICON hIcon, DWORD dwIdle);
/*
* dialog procedures
*/
-INT_PTR CALLBACK SelectContainerDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-INT_PTR CALLBACK DlgProcContainerOptions (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-INT_PTR CALLBACK DlgProcAbout (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
#endif /* _TABSRMM_FUNCTIONS_H */
diff --git a/plugins/TabSRMM/src/include/msgs.h b/plugins/TabSRMM/src/include/msgs.h index 5f4adef350..23f8945138 100644 --- a/plugins/TabSRMM/src/include/msgs.h +++ b/plugins/TabSRMM/src/include/msgs.h @@ -253,38 +253,45 @@ struct TContainerData { CSideBar* SideBar;
};
+struct TStatusBarIconNode {
+ TStatusBarIconNode* next;
+ StatusIconData sid;
+};
+
struct SESSIONINFO_TYPE;
-struct TWindowData {
- UINT cbSize;
- BYTE bType;
- struct TContainerData *pContainer; // parent container description structure
- HWND hwnd;
- DWORD dwFlags;
- DWORD dwFlagsEx;
- HANDLE hContact;
- char *szProto;
- TCHAR szMyNickname[130];
- TCHAR szStatusBar[100];
- TCHAR newtitle[130]; // tab title...
- TCHAR szStatus[50];
- WORD wStatus;
- char *sendBuffer;
- int iSendBufferSize;
- int iSendLength; // message length in utf-8 octets
- HICON hTabIcon, hTabStatusIcon, hXStatusIcon, hClientIcon, hTaskbarIcon;
- HICON iFlashIcon;
- BOOL mayFlashTab;
- BOOL bTabFlash;
- HWND hwndIEView, hwndFlash, hwndIWebBrowserControl, hwndHPP;
- HWND hwndContactPic, hwndPanelPic, hwndPanelPicParent;
- UINT bbLSideWidth; //MAD
- UINT bbRSideWidth; //MAD
- BYTE kstate[256];
- struct TStatusBarIconNode *pSINod;
+struct TWindowData
+{
+ UINT cbSize;
+ BYTE bType;
+ struct TContainerData *pContainer; // parent container description structure
+ HWND hwnd;
+ DWORD dwFlags;
+ DWORD dwFlagsEx;
+ HANDLE hContact;
+ char *szProto;
+ TCHAR szMyNickname[130];
+ TCHAR szStatusBar[100];
+ TCHAR newtitle[130]; // tab title...
+ TCHAR szStatus[50];
+ WORD wStatus;
+ char *sendBuffer;
+ int iSendBufferSize;
+ int iSendLength; // message length in utf-8 octets
+ HICON hTabIcon, hTabStatusIcon, hXStatusIcon, hClientIcon, hTaskbarIcon;
+ HICON iFlashIcon;
+ BOOL mayFlashTab;
+ BOOL bTabFlash;
+ HWND hwndIEView, hwndFlash, hwndIWebBrowserControl, hwndHPP;
+ HWND hwndContactPic, hwndPanelPic, hwndPanelPicParent;
+ UINT bbLSideWidth; //MAD
+ UINT bbRSideWidth; //MAD
+ BYTE kstate[256];
+
+ TStatusBarIconNode *pSINod;
SESSIONINFO_TYPE* si;
- RECT rcNick, rcUIN, rcStatus, rcPic;
+ RECT rcNick, rcUIN, rcStatus, rcPic;
HANDLE hDbEventFirst, hDbEventLast;
int sendMode;
int splitterY, originalSplitterY, dynaSplitter, savedSplitter, savedSplitY, savedDynaSplit;
@@ -319,7 +326,7 @@ struct TWindowData { TCHAR myUin[80];
BOOL bNotOnList;
int SendFormat;
- HANDLE *hQueuedEvents;
+ HANDLE *hQueuedEvents;
int iNextQueuedEvent;
#define EVENT_QUEUE_SIZE 10
int iEventQueueSize;
@@ -332,8 +339,8 @@ struct TWindowData { HANDLE hTimeZone;
DWORD panelStatusCX;
COLORREF inputbg;
- struct avatarCacheEntry *ace, *ownAce;
- HANDLE *hHistoryEvents;
+ avatarCacheEntry *ace, *ownAce;
+ HANDLE *hHistoryEvents;
int maxHistory, curHistory;
HANDLE hTheme, hThemeIP, hThemeToolbar;
char szMicroLf[128];
@@ -348,19 +355,20 @@ struct TWindowData { LPARAM lParam;
int iHaveRTLLang;
BOOL fInsertMode;
- bool fkeyProcessed;
- bool fEditNotesActive;
+ bool fkeyProcessed;
+ bool fEditNotesActive;
+
CInfoPanel *Panel;
CContactCache *cache;
CProxyWindow *pWnd; // proxy window object (win7+, for taskbar support).
// ALWAYS check this pointer before using it, it is not guaranteed to exist.
- DWORD iSplitterSaved;
+ DWORD iSplitterSaved;
BYTE bWasDeleted;
- BOOL bActualHistory;
- POINT ptTipActivation;
- LONG iInputAreaHeight;
- bool fIsAutosizingInput;
- bool fLimitedUpdate;
+ BOOL bActualHistory;
+ POINT ptTipActivation;
+ LONG iInputAreaHeight;
+ bool fIsAutosizingInput;
+ bool fLimitedUpdate;
};
#define MESSAGE_WINDOW_DATA_SIZE offsetof(_MessageWindowData, hdbEventFirst);
@@ -904,11 +912,6 @@ struct SIDEBARITEM { #include "templates.h"
-struct TStatusBarIconNode {
- TStatusBarIconNode* next;
- StatusIconData sid;
-};
-
struct TABSRMM_SessionInfo {
unsigned int cbSize;
unsigned short evtCode;
diff --git a/plugins/TabSRMM/src/include/utils.h b/plugins/TabSRMM/src/include/utils.h index b2f2dab659..f3918c1c87 100644 --- a/plugins/TabSRMM/src/include/utils.h +++ b/plugins/TabSRMM/src/include/utils.h @@ -129,7 +129,7 @@ public: EmptyClipboard();
hData = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, i);
- CopyMemory((void *)GlobalLock(hData), (void *)_t, i);
+ CopyMemory((void*)GlobalLock(hData), (void*)_t, i);
GlobalUnlock(hData);
SetClipboardData(_s == sizeof(char) ? CF_TEXT : CF_UNICODETEXT, hData);
CloseClipboard();
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index b8f0265d73..9c261f2f30 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -1302,7 +1302,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP struct TNewWindowData *newData = (struct TNewWindowData *) lParam;
dat = (struct TWindowData *) malloc(sizeof(struct TWindowData));
- ZeroMemory((void *) dat, sizeof(struct TWindowData));
+ ZeroMemory((void*) dat, sizeof(struct TWindowData));
if (newData->iTabID >= 0) {
dat->pContainer = newData->pContainer;
m_pContainer = dat->pContainer;
@@ -3068,7 +3068,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP char *szFromStream = NULL;
szFromStream = Message_GetFromStream(GetDlgItem(hwndDlg, IDC_MESSAGE), dat, dat->SendFormat ? 0 : (CP_UTF8 << 16) | (SF_TEXT | SF_USECODEPAGE));
- ZeroMemory((void *)&tci, sizeof(tci));
+ ZeroMemory((void*)&tci, sizeof(tci));
tci.mask = TCIF_PARAM;
for (i=0; i < tabCount; i++) {
@@ -3117,7 +3117,7 @@ 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));
+ ZeroMemory((void*)&event, sizeof(event));
event.cbSize = sizeof(IEVIEWEVENT);
event.hContact = dat->hContact;
event.dwFlags = 0;
@@ -3773,7 +3773,7 @@ quote_from_last: if (hFont != NULL && hFont != (HFONT) SendDlgItemMessage(hwndDlg, IDOK, WM_GETFONT, 0, 0))
DeleteObject(hFont);
- ZeroMemory((void *)&item, sizeof(item));
+ ZeroMemory((void*)&item, sizeof(item));
item.mask = TCIF_PARAM;
i = GetTabIndexFromHWND(hwndTab, hwndDlg);
@@ -3819,7 +3819,7 @@ quote_from_last: break;
case WM_DWMCOMPOSITIONCHANGED:
BB_RefreshTheme(dat);
- memset((void *)&dat->pContainer->mOld, -1000, sizeof(MARGINS));
+ memset((void*)&dat->pContainer->mOld, -1000, sizeof(MARGINS));
CProxyWindow::verify(dat);
break;
@@ -3833,7 +3833,7 @@ quote_from_last: case WM_NCDESTROY:
if (dat) {
- memset((void *)&dat->pContainer->mOld, -1000, sizeof(MARGINS));
+ memset((void*)&dat->pContainer->mOld, -1000, sizeof(MARGINS));
PostMessage(dat->pContainer->hwnd, WM_SIZE, 0, 1);
if (m_pContainer->dwFlags & CNT_SIDEBAR)
m_pContainer->SideBar->removeSession(dat);
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index ef1eecb705..e22f366ec6 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -224,7 +224,7 @@ void TSAPI FlashTab(struct TWindowData *dat, HWND hwndTab, int iTabindex, BOOL * {
TCITEM item;
- ZeroMemory((void *)&item, sizeof(item));
+ ZeroMemory((void*)&item, sizeof(item));
item.mask = TCIF_IMAGE;
if (mode)
@@ -1257,7 +1257,7 @@ void TSAPI DoTrimMessage(TCHAR *msg) void TSAPI GetMYUIN(TWindowData *dat)
{
CONTACTINFO ci;
- ZeroMemory((void *)&ci, sizeof(ci));
+ ZeroMemory((void*)&ci, sizeof(ci));
/*
* get my uin
@@ -1272,7 +1272,7 @@ void TSAPI GetMYUIN(TWindowData *dat) switch (ci.type) {
case CNFT_ASCIIZ:
mir_sntprintf(dat->myUin, safe_sizeof(dat->myUin), _T("%s"), reinterpret_cast<TCHAR *>(ci.pszVal));
- mir_free((void *)ci.pszVal);
+ mir_free((void*)ci.pszVal);
break;
case CNFT_DWORD:
mir_sntprintf(dat->myUin, safe_sizeof(dat->myUin), _T("%u"), ci.dVal);
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index 86760e8bc9..7c97261957 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -144,7 +144,7 @@ void TSAPI CacheLogFonts() logPixelSY = GetDeviceCaps(hdc, LOGPIXELSY);
ReleaseDC(NULL, hdc);
- ZeroMemory((void *)logfonts, sizeof(LOGFONTA) * MSGDLGFONTCOUNT + 2);
+ ZeroMemory((void*)logfonts, sizeof(LOGFONTA) * MSGDLGFONTCOUNT + 2);
for (i=0; i < MSGDLGFONTCOUNT; i++) {
LoadLogfont(i, &logfonts[i], &fontcolors[i], FONTMODULE);
wsprintfA(rtfFontsGlobal[i], "\\f%u\\cf%u\\b%d\\i%d\\ul%d\\fs%u", i, i, logfonts[i].lfWeight >= FW_BOLD ? 1 : 0, logfonts[i].lfItalic,logfonts[i].lfUnderline, 2 * abs(logfonts[i].lfHeight) * 74 / logPixelSY);
@@ -1456,7 +1456,7 @@ static void ReplaceIcons(HWND hwndDlg, struct TWindowData *dat, LONG startAt, in CHARRANGE cr;
fi.lpstrText = "##col##";
fi.chrg.cpMax = -1;
- ZeroMemory((void *)&cf2, sizeof(cf2));
+ ZeroMemory((void*)&cf2, sizeof(cf2));
cf2.cbSize = sizeof(cf2);
cf2.dwMask = CFM_COLOR;
while (SendMessageA(hwndrtf, EM_FINDTEXTEX, FR_DOWN, (LPARAM)&fi) > -1) {
@@ -1487,7 +1487,7 @@ static void ReplaceIcons(HWND hwndDlg, struct TWindowData *dat, LONG startAt, in CHARRANGE cr;
fi.lpstrText = "#~#";
fi.chrg.cpMax = -1;
- ZeroMemory((void *)&cf2, sizeof(cf2));
+ ZeroMemory((void*)&cf2, sizeof(cf2));
cf2.cbSize = sizeof(cf2);
cf2.dwMask = CFM_BACKCOLOR;
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index ceb8d2fa33..a7f5e24766 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -228,9 +228,9 @@ static void TSAPI FreeComboData(HWND hwndCombobox) LRESULT lr = SendMessage(hwndCombobox, CB_GETCOUNT, 0, 0);
for (int i = 1; i < lr; i++) {
- void *idata = (void *)SendMessage(hwndCombobox, CB_GETITEMDATA, i, 0);
+ void *idata = (void*)SendMessage(hwndCombobox, CB_GETITEMDATA, i, 0);
- if (idata && idata != (void *)CB_ERR)
+ if (idata && idata != (void*)CB_ERR)
free(idata);
}
}
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 7f2379e228..4781a52903 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -452,7 +452,7 @@ int MyAvatarChanged(WPARAM wParam, LPARAM lParam) {
struct TContainerData *pContainer = pFirstContainer;
- if (wParam == 0 || IsBadReadPtr((void *)wParam, 4))
+ if (wParam == 0 || IsBadReadPtr((void*)wParam, 4))
return 0;
while (pContainer) {
@@ -577,7 +577,7 @@ int LoadSendRecvMessageModule(void) Win7Taskbar = new CTaskbarInteract;
Win7Taskbar->updateMetrics();
- ZeroMemory((void *)&nen_options, sizeof(nen_options));
+ ZeroMemory((void*)&nen_options, sizeof(nen_options));
M->m_hMessageWindowList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
PluginConfig.hUserPrefsWindowList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
sendQueue = new SendQueue;
@@ -628,7 +628,7 @@ int TSAPI ActivateExistingTab(TContainerData *pContainer, HWND hwndChild) dat = (struct TWindowData *) GetWindowLongPtr(hwndChild, GWLP_USERDATA); // needed to obtain the hContact for the message window
if (dat && pContainer) {
- ZeroMemory((void *)&nmhdr, sizeof(nmhdr));
+ ZeroMemory((void*)&nmhdr, sizeof(nmhdr));
nmhdr.code = TCN_SELCHANGE;
if (TabCtrl_GetItemCount(GetDlgItem(pContainer->hwnd, IDC_MSGTABS)) > 1 && !(pContainer->dwFlags & CNT_DEFERREDTABSELECT)) {
TabCtrl_SetCurSel(GetDlgItem(pContainer->hwnd, IDC_MSGTABS), GetTabIndexFromHWND(GetDlgItem(pContainer->hwnd, IDC_MSGTABS), hwndChild));
@@ -705,7 +705,7 @@ HWND TSAPI CreateNewTabForContact(struct TContainerData *pContainer, HANDLE hCon newData.szInitialText = pszInitialText;
szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) newData.hContact, 0);
- ZeroMemory((void *)&newData.item, sizeof(newData.item));
+ ZeroMemory((void*)&newData.item, sizeof(newData.item));
// obtain various status information about the contact
contactName = (TCHAR *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM) newData.hContact, GCDNF_TCHAR);
@@ -906,17 +906,13 @@ void TSAPI CreateImageList(BOOL bInitial) int TABSRMM_FireEvent(HANDLE hContact, HWND hwnd, unsigned int type, unsigned int subType)
{
- MessageWindowEventData mwe = { 0 };
- struct TABSRMM_SessionInfo se = { 0 };
+ if (hContact == NULL || hwnd == NULL || !M->GetByte("_eventapi", 1))
+ return 0;
+
struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
BYTE bType = dat ? dat->bType : SESSIONTYPE_IM;
- if (hContact == NULL || hwnd == NULL)
- return 0;
-
- if (!M->GetByte("_eventapi", 1))
- return 0;
- mwe.cbSize = sizeof(mwe);
+ MessageWindowEventData mwe = { sizeof(mwe) };
mwe.hContact = hContact;
mwe.hwndWindow = hwnd;
mwe.szModule = "tabSRMsgW";
@@ -925,15 +921,15 @@ int TABSRMM_FireEvent(HANDLE hContact, HWND hwnd, unsigned int type, unsigned in mwe.hwndLog = GetDlgItem(hwnd, bType == SESSIONTYPE_IM ? IDC_LOG : IDC_CHAT_LOG);
if (type == MSG_WINDOW_EVT_CUSTOM) {
- se.cbSize = sizeof(se);
+ TABSRMM_SessionInfo se = { sizeof(se) };
se.evtCode = HIWORD(subType);
se.hwnd = hwnd;
se.extraFlags = (unsigned int)(LOWORD(subType));
- se.local = (void *)dat->sendBuffer;
- mwe.local = (void *) & se;
- } else
- mwe.local = NULL;
- return(NotifyEventHooks(PluginConfig.m_event_MsgWin, 0, (LPARAM)&mwe));
+ se.local = (void*)dat->sendBuffer;
+ mwe.local = (void*) & se;
+ }
+
+ return NotifyEventHooks(PluginConfig.m_event_MsgWin, 0, (LPARAM)&mwe);
}
/*
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index a347d0b06d..804107d9c8 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -141,7 +141,7 @@ CSendLaterJob::~CSendLaterJob() if (PluginConfig.g_PopupAvail && fShowPopup) {
TCHAR *tszName = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR);
- ZeroMemory((void *)&ppd, sizeof(ppd));
+ ZeroMemory((void*)&ppd, sizeof(ppd));
ppd.lchContact = hContact;
ppd.cbSize = sizeof(ppd);
mir_sntprintf(ppd.lptzContactName, MAX_CONTACTNAME, _T("%s"), tszName ? tszName : TranslateT("'(Unknown Contact)'"));
@@ -163,7 +163,7 @@ CSendLaterJob::~CSendLaterJob() ppd.colorBack = fFailed ? RGB(191, 0, 0) : nen_options.colBackMsg;
ppd.PluginWindowProc = reinterpret_cast<WNDPROC>(Utils::PopupDlgProcError);
ppd.lchIcon = fFailed ? PluginConfig.g_iconErr : PluginConfig.g_IconMsgEvent;
- ppd.PluginData = (void *)hContact;
+ ppd.PluginData = (void*)hContact;
ppd.iSeconds = fFailed ? -1 : nen_options.iDelayMsg;
CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&ppd, 0);
}
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index a00b5a9445..d6b70ffc10 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -702,7 +702,7 @@ void SendQueue::NotifyDeliveryFailure(const TWindowData *dat) return;
if (CallService(MS_POPUP_QUERY, PUQS_GETSTATUS, 0) == 1) {
- ZeroMemory((void *)&ppd, sizeof(ppd));
+ ZeroMemory((void*)&ppd, sizeof(ppd));
ppd.lchContact = dat->hContact;
mir_sntprintf(ppd.lptzContactName, MAX_CONTACTNAME, _T("%s"), dat->cache->getNick());
mir_sntprintf(ppd.lptzText, MAX_SECONDLINE, _T("%s"), TranslateT("A message delivery has failed.\nClick to open the message window."));
@@ -715,7 +715,7 @@ void SendQueue::NotifyDeliveryFailure(const TWindowData *dat) ppd.colorText = ppd.colorBack = 0;
ppd.PluginWindowProc = reinterpret_cast<WNDPROC>(Utils::PopupDlgProcError);
ppd.lchIcon = PluginConfig.g_iconErr;
- ppd.PluginData = (void *)dat->hContact;
+ ppd.PluginData = (void*)dat->hContact;
ppd.iSeconds = (int)M->GetDword(MODULE, OPT_DELAY_ERR, (DWORD)DEFAULT_DELAY);
CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, 0);
}
diff --git a/plugins/TabSRMM/src/tabctrl.cpp b/plugins/TabSRMM/src/tabctrl.cpp index 44aaaa4f83..156c4d4ba7 100644 --- a/plugins/TabSRMM/src/tabctrl.cpp +++ b/plugins/TabSRMM/src/tabctrl.cpp @@ -699,7 +699,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara tabdat = (struct TabControlData *)mir_alloc(sizeof(struct TabControlData));
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)tabdat);
- ZeroMemory((void *)tabdat, sizeof(struct TabControlData));
+ ZeroMemory((void*)tabdat, sizeof(struct TabControlData));
tabdat->hwnd = hwnd;
tabdat->cx = GetSystemMetrics(SM_CXSMICON);
tabdat->cy = GetSystemMetrics(SM_CYSMICON);
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index d71a99dc60..6d40f928e1 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -144,11 +144,11 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP TranslateDialogDefault(hwndDlg);
- ZeroMemory((void *) dat, sizeof(struct TWindowData));
+ ZeroMemory((void*) dat, sizeof(struct TWindowData));
dat->pContainer = (struct TContainerData *)malloc(sizeof(struct TContainerData));
- ZeroMemory((void *)dat->pContainer, sizeof(struct TContainerData));
+ ZeroMemory((void*)dat->pContainer, sizeof(struct TContainerData));
teInfo = (TemplateEditorInfo *)dat->pContainer;
- ZeroMemory((void *)teInfo, sizeof(TemplateEditorInfo));
+ ZeroMemory((void*)teInfo, sizeof(TemplateEditorInfo));
teInfo->hContact = teNew->hContact;
teInfo->rtl = teNew->rtl;
teInfo->hwndParent = teNew->hwndParent;
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index 6e786e0eea..c003407376 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -1621,7 +1621,7 @@ create_it: newItem->nextItem = 0;
curItem->nextItem = newItem;
}
- mir_free((void *)szItemNameA);
+ mir_free((void*)szItemNameA);
return;
}
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index c21245f6fb..34f1914e6d 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -728,7 +728,7 @@ int Utils::ReadContainerSettingsFromDB(const HANDLE hContact, TContainerSettings if (0 == DBGetContactSetting(hContact, SRMSGMOD_T, szKey ? szKey : CNT_KEYNAME, &dbv)) {
if (dbv.type == DBVT_BLOB && dbv.cpbVal > 0 && dbv.cpbVal <= sizeof(TContainerSettings)) {
- ::CopyMemory((void *)cs, (void *)dbv.pbVal, dbv.cpbVal);
+ ::CopyMemory((void*)cs, (void*)dbv.pbVal, dbv.cpbVal);
::DBFreeVariant(&dbv);
if (hContact == 0 && szKey == 0)
cs->fPrivate = false;
@@ -782,7 +782,7 @@ void Utils::ReadPrivateContainerSettings(TContainerData *pContainer, bool fForce if (csTemp.fPrivate || fForce) {
if (pContainer->settings == 0 || pContainer->settings == &PluginConfig.globalContainerSettings)
pContainer->settings = (TContainerSettings *)malloc(sizeof(TContainerSettings));
- CopyMemory((void *)pContainer->settings, (void *)&csTemp, sizeof(TContainerSettings));
+ CopyMemory((void*)pContainer->settings, (void*)&csTemp, sizeof(TContainerSettings));
pContainer->settings->fPrivate = true;
}
else
@@ -1048,7 +1048,7 @@ void TSAPI Utils::extractResource(const HMODULE h, const UINT uID, const TCHAR * return;
}
if ((hFile = CreateFile(szFilename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)) != INVALID_HANDLE_VALUE) {
- WriteFile(hFile, (void *)pData, dwSize, &written, NULL);
+ WriteFile(hFile, (void*)pData, dwSize, &written, NULL);
CloseHandle(hFile);
}
else
|