summaryrefslogtreecommitdiff
path: root/plugins/IEView/src
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2014-06-14 12:48:26 +0000
committerKirill Volinsky <mataes2007@gmail.com>2014-06-14 12:48:26 +0000
commit674b73e4b757bdb7ffd619b5e998e0989bd05232 (patch)
treebcbc0ed956e73fd4c39bbe22001a5cb95293972d /plugins/IEView/src
parentbce0eecaadc3714bdc91ad375bb0da7544de4657 (diff)
fixed smiles and link not showing
git-svn-id: http://svn.miranda-ng.org/main/trunk@9467 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/IEView/src')
-rw-r--r--plugins/IEView/src/ChatHTMLBuilder.cpp12
-rw-r--r--plugins/IEView/src/HTMLBuilder.cpp7
-rw-r--r--plugins/IEView/src/HistoryHTMLBuilder.cpp21
-rw-r--r--plugins/IEView/src/IEView.cpp131
-rw-r--r--plugins/IEView/src/MUCCHTMLBuilder.cpp13
-rw-r--r--plugins/IEView/src/Options.cpp45
-rw-r--r--plugins/IEView/src/ScriverHTMLBuilder.cpp16
-rw-r--r--plugins/IEView/src/TabSRMMHTMLBuilder.cpp3
-rw-r--r--plugins/IEView/src/TextToken.cpp15
-rw-r--r--plugins/IEView/src/ieview_services.cpp9
10 files changed, 175 insertions, 97 deletions
diff --git a/plugins/IEView/src/ChatHTMLBuilder.cpp b/plugins/IEView/src/ChatHTMLBuilder.cpp
index 9610db95f0..6b262f8a92 100644
--- a/plugins/IEView/src/ChatHTMLBuilder.cpp
+++ b/plugins/IEView/src/ChatHTMLBuilder.cpp
@@ -38,12 +38,14 @@ static const char *classNames[] = {
".action", ".highlight"
};
-ChatHTMLBuilder::ChatHTMLBuilder() {
+ChatHTMLBuilder::ChatHTMLBuilder()
+{
setLastEventType(-1);
setLastEventTime(time(NULL));
}
-void ChatHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour) {
+void ChatHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour)
+{
char str[32];
int style;
DBVARIANT dbv;
@@ -248,7 +250,8 @@ void ChatHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event)
}
}
-void ChatHTMLBuilder::appendEvent(IEView *view, IEVIEWEVENT *event) {
+void ChatHTMLBuilder::appendEvent(IEView *view, IEVIEWEVENT *event)
+{
ProtocolSettings *protoSettings = getChatProtocolSettings(event->pszProto);
if (protoSettings == NULL) {
return;
@@ -260,6 +263,7 @@ void ChatHTMLBuilder::appendEvent(IEView *view, IEVIEWEVENT *event) {
// }
}
-bool ChatHTMLBuilder::isDbEventShown(DBEVENTINFO * dbei) {
+bool ChatHTMLBuilder::isDbEventShown(DBEVENTINFO * dbei)
+{
return true;
}
diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp
index 8545f34264..b0bebbb8f7 100644
--- a/plugins/IEView/src/HTMLBuilder.cpp
+++ b/plugins/IEView/src/HTMLBuilder.cpp
@@ -23,7 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
int HTMLBuilder::mimFlags = 0;
-HTMLBuilder::HTMLBuilder() {
+HTMLBuilder::HTMLBuilder()
+{
lastIEViewEvent.cbSize = sizeof (IEVIEWEVENT);
lastIEViewEvent.iType = IEE_LOG_MEM_EVENTS;
lastIEViewEvent.codepage = CP_ACP;
@@ -57,10 +58,10 @@ bool HTMLBuilder::encode(MCONTACT hContact, const char *proto, const wchar_t *te
break;
}
level++;
- case 3:
+ case 2:
token = TextToken::tokenizeLinks(text);
break;
- case 4:
+ case 3:
if ((flags & ENF_SMILEYS) || ((Options::getGeneralFlags() & Options::GENERAL_SMILEYINNAMES) && (flags & ENF_NAMESMILEYS)))
token = TextToken::tokenizeSmileys(hContact, proto, text, isSent);
break;
diff --git a/plugins/IEView/src/HistoryHTMLBuilder.cpp b/plugins/IEView/src/HistoryHTMLBuilder.cpp
index f7b08ae861..493531e2bc 100644
--- a/plugins/IEView/src/HistoryHTMLBuilder.cpp
+++ b/plugins/IEView/src/HistoryHTMLBuilder.cpp
@@ -62,7 +62,8 @@ static const char *dbSpanSettingNames[] = {
"ProfileDate", "ContactDate",
};
-HistoryHTMLBuilder::HistoryHTMLBuilder() {
+HistoryHTMLBuilder::HistoryHTMLBuilder()
+{
setLastEventType(-1);
setLastEventTime(time(NULL));
startedTime = time(NULL);
@@ -78,7 +79,8 @@ bool HistoryHTMLBuilder::isDbEventShown(DBEVENTINFO * dbei)
}
}
-char *HistoryHTMLBuilder::timestampToString(DWORD dwFlags, time_t check) {
+char *HistoryHTMLBuilder::timestampToString(DWORD dwFlags, time_t check)
+{
static char szResult[512];
char str[80];
DBTIMETOSTRING dbtts;
@@ -92,7 +94,8 @@ char *HistoryHTMLBuilder::timestampToString(DWORD dwFlags, time_t check) {
return szResult;
}
-void HistoryHTMLBuilder::loadMsgDlgFont(const char *dbSetting, LOGFONTA * lf, COLORREF * colour, COLORREF * bkgColour) {
+void HistoryHTMLBuilder::loadMsgDlgFont(const char *dbSetting, LOGFONTA * lf, COLORREF * colour, COLORREF * bkgColour)
+{
char str[128];
int style;
DBVARIANT dbv;
@@ -134,15 +137,18 @@ void HistoryHTMLBuilder::loadMsgDlgFont(const char *dbSetting, LOGFONTA * lf, CO
}
}
-const char *HistoryHTMLBuilder::getTemplateFilename(ProtocolSettings * protoSettings) {
+const char *HistoryHTMLBuilder::getTemplateFilename(ProtocolSettings * protoSettings)
+{
return protoSettings->getHistoryTemplateFilename();
}
-int HistoryHTMLBuilder::getFlags(ProtocolSettings * protoSettings) {
+int HistoryHTMLBuilder::getFlags(ProtocolSettings * protoSettings)
+{
return protoSettings->getHistoryFlags();
}
-void HistoryHTMLBuilder::buildHead(IEView *view, IEVIEWEVENT *event) {
+void HistoryHTMLBuilder::buildHead(IEView *view, IEVIEWEVENT *event)
+{
LOGFONTA lf;
int i;
COLORREF color, bkgColor;
@@ -286,7 +292,8 @@ void HistoryHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event
view->documentClose();
}
-void HistoryHTMLBuilder::appendEvent(IEView *view, IEVIEWEVENT *event) {
+void HistoryHTMLBuilder::appendEvent(IEView *view, IEVIEWEVENT *event)
+{
ProtocolSettings *protoSettings = getHistoryProtocolSettings(event->hContact);
if (protoSettings == NULL) {
return;
diff --git a/plugins/IEView/src/IEView.cpp b/plugins/IEView/src/IEView.cpp
index 8f340c3ce7..07f071e3eb 100644
--- a/plugins/IEView/src/IEView.cpp
+++ b/plugins/IEView/src/IEView.cpp
@@ -33,7 +33,8 @@ bool IEView::isInited = false;
-static LRESULT CALLBACK IEViewServerWindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
+static LRESULT CALLBACK IEViewServerWindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
IEView *view = IEView::get(GetParent(GetParent(hwnd)));
if (view != NULL) {
switch (message) {
@@ -80,7 +81,8 @@ static LRESULT CALLBACK IEViewServerWindowProcedure (HWND hwnd, UINT message, WP
return DefWindowProc (hwnd, message, wParam, lParam);
}
-static LRESULT CALLBACK IEViewDocWindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
+static LRESULT CALLBACK IEViewDocWindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
IEView *view = IEView::get(GetParent(hwnd));
if (view!=NULL) {
WNDPROC oldWndProc = view->getDocWndProc();
@@ -93,7 +95,8 @@ static LRESULT CALLBACK IEViewDocWindowProcedure (HWND hwnd, UINT message, WPARA
return DefWindowProc (hwnd, message, wParam, lParam);
}
-static LRESULT CALLBACK IEViewWindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
+static LRESULT CALLBACK IEViewWindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
IEView *view = IEView::get(hwnd);
if (view!=NULL) {
WNDPROC oldWndProc = view->getMainWndProc();
@@ -106,13 +109,15 @@ static LRESULT CALLBACK IEViewWindowProcedure (HWND hwnd, UINT message, WPARAM w
return DefWindowProc (hwnd, message, wParam, lParam);
}
-IEViewSink::IEViewSink(IEView *smptr) {
+IEViewSink::IEViewSink(IEView *smptr)
+{
ieWindow = smptr;
}
IEViewSink::~IEViewSink() {}
-STDMETHODIMP IEViewSink::QueryInterface(REFIID riid, PVOID *ppv) {
+STDMETHODIMP IEViewSink::QueryInterface(REFIID riid, PVOID *ppv)
+{
*ppv=NULL;
if (IID_IUnknown==riid) {
*ppv=(IUnknown *)this;
@@ -130,12 +135,14 @@ STDMETHODIMP IEViewSink::QueryInterface(REFIID riid, PVOID *ppv) {
return E_NOINTERFACE;
}
-STDMETHODIMP_(ULONG) IEViewSink::AddRef(void) {
+STDMETHODIMP_(ULONG) IEViewSink::AddRef(void)
+{
++m_cRef;
return m_cRef;
}
-STDMETHODIMP_(ULONG) IEViewSink::Release(void) {
+STDMETHODIMP_(ULONG) IEViewSink::Release(void)
+{
--m_cRef;
return m_cRef;
}
@@ -144,8 +151,8 @@ STDMETHODIMP IEViewSink::GetTypeInfoCount(UINT *ptr) { return E_NOTIMPL; }
STDMETHODIMP IEViewSink::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInfo) { return S_OK; }
STDMETHODIMP IEViewSink::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgDispId) { return S_OK; }
-STDMETHODIMP IEViewSink::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid , WORD wFlags,
- DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO*pExcepInfo, UINT*puArgErr) {
+STDMETHODIMP IEViewSink::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid , WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO*pExcepInfo, UINT*puArgErr)
+{
if (!pDispParams) return E_INVALIDARG;
switch (dispIdMember) {
case DISPID_BEFORENAVIGATE2:
@@ -169,8 +176,8 @@ void IEViewSink::DownloadBegin() {}
void IEViewSink::DownloadComplete() {}
void IEViewSink::TitleChange(BSTR text) {}
void IEViewSink::PropertyChange(BSTR text) {}
-void IEViewSink::BeforeNavigate2(IDispatch* pDisp,VARIANT* url,VARIANT* flags, VARIANT* targetFrameName,
- VARIANT* postData, VARIANT* headers, VARIANT_BOOL* cancel) {
+void IEViewSink::BeforeNavigate2(IDispatch* pDisp,VARIANT* url,VARIANT* flags, VARIANT* targetFrameName, VARIANT* postData, VARIANT* headers, VARIANT_BOOL* cancel)
+{
#ifndef GECKO
if (_tcscmp(url->bstrVal, _T("about:blank")))
{
@@ -203,14 +210,16 @@ void IEViewSink::FileDownload(VARIANT_BOOL* cancel) {}
#ifdef GECKO
-static void __cdecl StartThread(void *vptr) {
+static void __cdecl StartThread(void *vptr)
+{
IEView *iev = (IEView *) vptr;
iev->waitWhileBusy();
return;
}
#endif
-void IEView::waitWhileBusy() {
+void IEView::waitWhileBusy()
+{
VARIANT_BOOL busy;
pWebBrowser->get_Busy(&busy);
while (busy == VARIANT_TRUE) {
@@ -220,7 +229,8 @@ void IEView::waitWhileBusy() {
PostMessage(hwnd, WM_WAITWHILEBUSY, 0, 0);
}
-void IEView::setBorder() {
+void IEView::setBorder()
+{
LONG style = GetWindowLongPtr(hwnd, GWL_EXSTYLE);
LONG oldStyle = style;
if (Options::getGeneralFlags() & Options::GENERAL_NO_BORDER) {
@@ -237,7 +247,8 @@ void IEView::setBorder() {
// RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_FRAME | RDW_UPDATENOW);
}
-IEView::IEView(HWND parent, HTMLBuilder* builder, int x, int y, int cx, int cy) {
+IEView::IEView(HWND parent, HTMLBuilder* builder, int x, int y, int cx, int cy)
+{
MSG msg;
IOleObject* pOleObject = NULL;
IOleInPlaceObject *pOleInPlace;
@@ -449,8 +460,8 @@ STDMETHODIMP IEView::GetTypeInfoCount(UINT *ptr) { return E_NOTIMPL; }
STDMETHODIMP IEView::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInfo) { return S_OK; }
STDMETHODIMP IEView::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgDispId) { return S_OK; }
-STDMETHODIMP IEView::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid , WORD wFlags,
- DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO*pExcepInfo, UINT*puArgErr) {
+STDMETHODIMP IEView::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid , WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO*pExcepInfo, UINT*puArgErr)
+{
switch (dispIdMember) {
case DISPID_AMBIENT_DLCONTROL:
break;
@@ -487,9 +498,7 @@ STDMETHODIMP IEView::OnUIActivate(void)
return E_NOTIMPL;
}
-STDMETHODIMP IEView::GetWindowContext(IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc,
- LPRECT lprcPosRect, LPRECT lprcClipRect,
- LPOLEINPLACEFRAMEINFO lpFrameInfo)
+STDMETHODIMP IEView::GetWindowContext(IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
{
lprcPosRect->left = rcClient.left;
lprcPosRect->top = rcClient.top;
@@ -642,8 +651,8 @@ STDMETHODIMP IEView::GetHostInfo(DOCHOSTUIINFO *pInfo)
}
return S_OK;
}
-STDMETHODIMP IEView::ShowUI(DWORD dwID, IOleInPlaceActiveObject *pActiveObject, IOleCommandTarget *pCommandTarget,
- IOleInPlaceFrame *pFrame, IOleInPlaceUIWindow *pDoc)
+
+STDMETHODIMP IEView::ShowUI(DWORD dwID, IOleInPlaceActiveObject *pActiveObject, IOleCommandTarget *pCommandTarget, IOleInPlaceFrame *pFrame, IOleInPlaceUIWindow *pDoc)
{
return S_OK;
}
@@ -656,13 +665,15 @@ STDMETHODIMP IEView::OnFrameWindowActivate(BOOL fEnable) { return E_NOTIMPL; }
STDMETHODIMP IEView::ResizeBorder(LPCRECT prcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fRameWindow) {return E_NOTIMPL;}
STDMETHODIMP IEView::TranslateAccelerator(LPMSG lpMsg, const GUID *pguidCmdGroup, DWORD nCmdID) { return S_FALSE;}
STDMETHODIMP IEView::GetOptionKeyPath(LPOLESTR *pchKey, DWORD dw) { return E_NOTIMPL; }
-STDMETHODIMP IEView::GetDropTarget(IDropTarget *pDropTarget, IDropTarget **ppDropTarget) {
+STDMETHODIMP IEView::GetDropTarget(IDropTarget *pDropTarget, IDropTarget **ppDropTarget)
+{
*ppDropTarget = NULL;
return S_OK;
// return E_NOTIMPL;
}
-STDMETHODIMP IEView::GetExternal(IDispatch **ppDispatch) {
+STDMETHODIMP IEView::GetExternal(IDispatch **ppDispatch)
+{
*ppDispatch = NULL;
return S_FALSE;
}
@@ -671,7 +682,8 @@ STDMETHODIMP IEView::FilterDataObject(IDataObject *pDO, IDataObject **ppDORet) {
/* IServiceProvider */
-STDMETHODIMP IEView::QueryService(REFGUID guidService, REFIID riid, void** ppvObject) {
+STDMETHODIMP IEView::QueryService(REFGUID guidService, REFIID riid, void** ppvObject)
+{
if (guidService == SID_SInternetSecurityManager && riid == IID_IInternetSecurityManager) {
return (HRESULT)this->QueryInterface(riid, ppvObject);
} else {
@@ -682,15 +694,18 @@ STDMETHODIMP IEView::QueryService(REFGUID guidService, REFIID riid, void** ppvOb
/* IInternetSecurityManager */
-STDMETHODIMP IEView::SetSecuritySite(IInternetSecurityMgrSite *pSite) {
+STDMETHODIMP IEView::SetSecuritySite(IInternetSecurityMgrSite *pSite)
+{
return INET_E_DEFAULT_ACTION;
}
-STDMETHODIMP IEView::GetSecuritySite(IInternetSecurityMgrSite **ppSite) {
+STDMETHODIMP IEView::GetSecuritySite(IInternetSecurityMgrSite **ppSite)
+{
return INET_E_DEFAULT_ACTION;
}
-STDMETHODIMP IEView::MapUrlToZone(LPCWSTR pwszUrl, DWORD *pdwZone, DWORD dwFlags) {
+STDMETHODIMP IEView::MapUrlToZone(LPCWSTR pwszUrl, DWORD *pdwZone, DWORD dwFlags)
+{
if (pdwZone!=NULL && pwszUrl!=NULL && !wcscmp(pwszUrl, L"about:blank")) {
*pdwZone = URLZONE_LOCAL_MACHINE;
return S_OK;
@@ -698,11 +713,13 @@ STDMETHODIMP IEView::MapUrlToZone(LPCWSTR pwszUrl, DWORD *pdwZone, DWORD dwFlags
return INET_E_DEFAULT_ACTION;
}
-STDMETHODIMP IEView::GetSecurityId(LPCWSTR pwszUrl, BYTE *pbSecurityId, DWORD *pcbSecurityId, DWORD_PTR dwReserved) {
+STDMETHODIMP IEView::GetSecurityId(LPCWSTR pwszUrl, BYTE *pbSecurityId, DWORD *pcbSecurityId, DWORD_PTR dwReserved)
+{
return INET_E_DEFAULT_ACTION;
}
-STDMETHODIMP IEView::ProcessUrlAction(LPCWSTR pwszUrl, DWORD dwAction, BYTE *pPolicy, DWORD cbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwFlags, DWORD dwReserved) {
+STDMETHODIMP IEView::ProcessUrlAction(LPCWSTR pwszUrl, DWORD dwAction, BYTE *pPolicy, DWORD cbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwFlags, DWORD dwReserved)
+{
DWORD dwPolicy=URLPOLICY_ALLOW;
if (pwszUrl!=NULL && !wcscmp(pwszUrl, L"about:blank")) {
if (dwAction <= URLACTION_ACTIVEX_MAX && dwAction >= URLACTION_ACTIVEX_MIN) {
@@ -730,20 +747,24 @@ STDMETHODIMP IEView::ProcessUrlAction(LPCWSTR pwszUrl, DWORD dwAction, BYTE *pPo
return INET_E_DEFAULT_ACTION;
}
-STDMETHODIMP IEView::QueryCustomPolicy(LPCWSTR pwszUrl, REFGUID guidKey, BYTE **ppPolicy, DWORD *pcbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwReserved) {
+STDMETHODIMP IEView::QueryCustomPolicy(LPCWSTR pwszUrl, REFGUID guidKey, BYTE **ppPolicy, DWORD *pcbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwReserved)
+{
return INET_E_DEFAULT_ACTION;
}
-STDMETHODIMP IEView::SetZoneMapping(DWORD dwZone, LPCWSTR lpszPattern, DWORD dwFlags) {
+STDMETHODIMP IEView::SetZoneMapping(DWORD dwZone, LPCWSTR lpszPattern, DWORD dwFlags)
+{
return INET_E_DEFAULT_ACTION;
}
-STDMETHODIMP IEView::GetZoneMappings(DWORD dwZone, IEnumString **ppenumString, DWORD dwFlags) {
+STDMETHODIMP IEView::GetZoneMappings(DWORD dwZone, IEnumString **ppenumString, DWORD dwFlags)
+{
return INET_E_DEFAULT_ACTION;
}
-IHTMLDocument2 *IEView::getDocument() {
+IHTMLDocument2 *IEView::getDocument()
+{
HRESULT hr = S_OK;
IHTMLDocument2 *document = NULL;
IDispatch *dispatch = NULL;
@@ -754,7 +775,8 @@ IHTMLDocument2 *IEView::getDocument() {
return document;
}
-void IEView::setWindowPos(int x, int y, int cx, int cy) {
+void IEView::setWindowPos(int x, int y, int cx, int cy)
+{
rcClient.left = x;
rcClient.top = y;
rcClient.right = cx;
@@ -779,7 +801,8 @@ void IEView::setWindowPos(int x, int y, int cx, int cy) {
}
}
-void IEView::scrollToTop() {
+void IEView::scrollToTop()
+{
IHTMLDocument2 *document = getDocument();
if (document != NULL) {
IHTMLWindow2* pWindow = NULL;
@@ -791,7 +814,8 @@ void IEView::scrollToTop() {
}
}
-void IEView::scrollToBottomSoft() {
+void IEView::scrollToBottomSoft()
+{
IHTMLDocument2 *document = getDocument();
if (document != NULL) {
IHTMLWindow2* pWindow = NULL;
@@ -803,7 +827,8 @@ void IEView::scrollToBottomSoft() {
}
}
-void IEView::scrollToBottom() {/*
+void IEView::scrollToBottom()
+{/*
IHTMLDocument2 *document = getDocument();
if (document != NULL) {
wchar_t *p = NULL;
@@ -910,11 +935,13 @@ void IEView::navigate(const char *url)
delete tTemp;
}
-void IEView::navigate(const wchar_t *url) {
+void IEView::navigate(const wchar_t *url)
+{
pWebBrowser->Navigate((WCHAR *)url, NULL, NULL, NULL, NULL);
}
-void IEView::documentClose() {
+void IEView::documentClose()
+{
#ifdef GECKO
/*
@@ -928,7 +955,8 @@ void IEView::documentClose() {
#endif
}
-void IEView::appendEventOld(IEVIEWEVENT *event) {
+void IEView::appendEventOld(IEVIEWEVENT *event)
+{
if (clearRequired) {
clear(event);
}
@@ -938,7 +966,8 @@ void IEView::appendEventOld(IEVIEWEVENT *event) {
getFocus = false;
}
-void IEView::appendEvent(IEVIEWEVENT *event) {
+void IEView::appendEvent(IEVIEWEVENT *event)
+{
if (clearRequired) {
clear(event);
}
@@ -1067,7 +1096,8 @@ BSTR IEView::getSelection()
/**
* Returns the destination url (href) of the given anchor element (or parent anchor element)
**/
-BSTR IEView::getHrefFromAnchor(IHTMLElement *element) {
+BSTR IEView::getHrefFromAnchor(IHTMLElement *element)
+{
if (element != NULL) {
IHTMLAnchorElement * pAnchor;
if (SUCCEEDED(element->QueryInterface(IID_IHTMLAnchorElement, (void**)&pAnchor)) && (pAnchor!=NULL)) {
@@ -1097,14 +1127,16 @@ BSTR IEView::getHrefFromAnchor(IHTMLElement *element) {
return NULL;
}
-bool IEView::mouseActivate() {
+bool IEView::mouseActivate()
+{
if (GetFocus() != hwnd) {
getFocus = true;
}
return false;
}
-bool IEView::mouseClick(POINT pt) {
+bool IEView::mouseClick(POINT pt)
+{
bool result = false;
if (GetFocus() != hwnd) {
getFocus = true;
@@ -1136,7 +1168,8 @@ bool IEView::mouseClick(POINT pt) {
return result;
}
-bool IEView::setFocus(HWND prevFocus) {
+bool IEView::setFocus(HWND prevFocus)
+{
if (GetFocus() != hwnd && !getFocus) { // && IsChild(prevFocus, hwnd
SetFocus(GetParent(getHWND()));
// SetFocus(prevFocus);
@@ -1146,7 +1179,8 @@ bool IEView::setFocus(HWND prevFocus) {
return false;
}
-void IEView::saveDocument() {
+void IEView::saveDocument()
+{
IHTMLDocument2 *document = getDocument();
if (document != NULL) {
BSTR bCmd = SysAllocString(L"SaveAs");
@@ -1160,7 +1194,8 @@ void IEView::saveDocument() {
}
}
-void IEView::navigate(IEVIEWNAVIGATE * nav) {
+void IEView::navigate(IEVIEWNAVIGATE * nav)
+{
if (nav->dwFlags & IENF_UNICODE) {
navigate(nav->urlW);
} else {
diff --git a/plugins/IEView/src/MUCCHTMLBuilder.cpp b/plugins/IEView/src/MUCCHTMLBuilder.cpp
index ecfd10b7f2..d3e910663e 100644
--- a/plugins/IEView/src/MUCCHTMLBuilder.cpp
+++ b/plugins/IEView/src/MUCCHTMLBuilder.cpp
@@ -34,12 +34,14 @@ static const char *classNames[] = {
".error"
};
-MUCCHTMLBuilder::MUCCHTMLBuilder() {
+MUCCHTMLBuilder::MUCCHTMLBuilder()
+{
setLastEventType(-1);
setLastEventTime(time(NULL));
}
-void MUCCHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour) {
+void MUCCHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour)
+{
char str[32];
int style;
DBVARIANT dbv;
@@ -113,7 +115,8 @@ char *MUCCHTMLBuilder::timestampToString(DWORD dwData, time_t check)
return szResult;
}
-void MUCCHTMLBuilder::buildHead(IEView *view, IEVIEWEVENT *event) {
+void MUCCHTMLBuilder::buildHead(IEView *view, IEVIEWEVENT *event)
+{
LOGFONTA lf;
COLORREF color;
char *output = NULL;
@@ -180,8 +183,8 @@ void MUCCHTMLBuilder::buildHead(IEView *view, IEVIEWEVENT *event) {
setLastEventType(-1);
}
-void MUCCHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event) {
-
+void MUCCHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event)
+{
IEVIEWEVENTDATA* eventData = event->eventData;
for (int eventIdx = 0; eventData!=NULL && (eventIdx < event->count || event->count==-1); eventData = eventData->next, eventIdx++) {
DWORD dwData = eventData->dwData;
diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp
index a6b7ca5ca9..295a2419b0 100644
--- a/plugins/IEView/src/Options.cpp
+++ b/plugins/IEView/src/Options.cpp
@@ -87,7 +87,8 @@ static void SaveSRMMProtoSettings(HWND hwndDlg, ProtocolSettings *proto)
}
}
-static void SaveChatProtoSettings(HWND hwndDlg, ProtocolSettings *proto) {
+static void SaveChatProtoSettings(HWND hwndDlg, ProtocolSettings *proto)
+{
if (proto != NULL) {
char path[MAX_PATH];
int i = Options::MODE_COMPATIBLE;
@@ -198,7 +199,8 @@ static void UpdateTemplateIcons(HWND hwnd, const char *path)
}
}
-static void UpdateSRMMProtoInfo(HWND hwndDlg, ProtocolSettings *proto) {
+static void UpdateSRMMProtoInfo(HWND hwndDlg, ProtocolSettings *proto)
+{
if (proto != NULL) {
HWND hProtoList = GetDlgItem(hwndDlg, IDC_PROTOLIST);
TreeView_SetCheckState(hProtoList, TreeView_GetSelection(hProtoList), proto->isSRMMEnableTemp());
@@ -235,7 +237,8 @@ static void UpdateSRMMProtoInfo(HWND hwndDlg, ProtocolSettings *proto) {
}
}
-static void UpdateChatProtoInfo(HWND hwndDlg, ProtocolSettings *proto) {
+static void UpdateChatProtoInfo(HWND hwndDlg, ProtocolSettings *proto)
+{
if (proto != NULL) {
HWND hProtoList = GetDlgItem(hwndDlg, IDC_PROTOLIST);
TreeView_SetCheckState(hProtoList, TreeView_GetSelection(hProtoList), proto->isChatEnableTemp());
@@ -272,7 +275,8 @@ static void UpdateChatProtoInfo(HWND hwndDlg, ProtocolSettings *proto) {
}
}
-static void UpdateHistoryProtoInfo(HWND hwndDlg, ProtocolSettings *proto) {
+static void UpdateHistoryProtoInfo(HWND hwndDlg, ProtocolSettings *proto)
+{
if (proto != NULL) {
HWND hProtoList = GetDlgItem(hwndDlg, IDC_PROTOLIST);
TreeView_SetCheckState(hProtoList, TreeView_GetSelection(hProtoList), proto->isHistoryEnableTemp());
@@ -309,7 +313,8 @@ static void UpdateHistoryProtoInfo(HWND hwndDlg, ProtocolSettings *proto) {
}
}
-static void RefreshProtoIcons() {
+static void RefreshProtoIcons()
+{
int i;
ProtocolSettings *proto;
if (hProtocolImageList != NULL) {
@@ -337,7 +342,8 @@ static void RefreshProtoIcons() {
}
}
-static void RefreshIcons() {
+static void RefreshIcons()
+{
if (hImageList != NULL) {
ImageList_RemoveAll(hImageList);
} else {
@@ -349,7 +355,8 @@ static void RefreshIcons() {
ImageList_AddIcon(hImageList, (HICON) LoadImage(hInstance, MAKEINTRESOURCE(IDI_RTL_ON),IMAGE_ICON,0,0,0));
}
-static void RefreshProtoList(HWND hwndDlg, int mode, bool protoTemplates) {
+static void RefreshProtoList(HWND hwndDlg, int mode, bool protoTemplates)
+{
int i;
HTREEITEM hItem = NULL;
HWND hProtoList = GetDlgItem(hwndDlg, IDC_PROTOLIST);
@@ -396,7 +403,8 @@ static void RefreshProtoList(HWND hwndDlg, int mode, bool protoTemplates) {
TreeView_SelectItem(hProtoList, hItem);
}
-static bool BrowseFile(HWND hwndDlg, char *filter, char *defExt, char *path, int maxLen) {
+static bool BrowseFile(HWND hwndDlg, char *filter, char *defExt, char *path, int maxLen)
+{
OPENFILENAMEA ofn={0};
GetWindowTextA(hwndDlg, path, maxLen);
ofn.lStructSize = sizeof(OPENFILENAME);//_SIZE_VERSION_400;
@@ -441,7 +449,8 @@ int IEViewOptInit(WPARAM wParam, LPARAM lParam)
static int initialized = 0;
static int changed = 0;
-static void MarkInitialized(int i) {
+static void MarkInitialized(int i)
+{
if (initialized == 0) {
Options::resetProtocolSettings();
RefreshProtoIcons();
@@ -450,7 +459,8 @@ static void MarkInitialized(int i) {
initialized |= i;
}
-static void ApplyChanges(int i) {
+static void ApplyChanges(int i)
+{
changed &= ~i;
initialized &= ~i;
if (changed == 0) {
@@ -459,12 +469,14 @@ static void ApplyChanges(int i) {
}
}
-static void MarkChanges(int i, HWND hWnd) {
+static void MarkChanges(int i, HWND hWnd)
+{
SendMessage(GetParent(hWnd), PSM_CHANGED, 0, 0);
changed |= i;
}
-static INT_PTR CALLBACK IEViewGeneralOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
+static INT_PTR CALLBACK IEViewGeneralOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
int i;
switch (msg) {
case WM_INITDIALOG:
@@ -553,7 +565,8 @@ static INT_PTR CALLBACK IEViewGeneralOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w
return FALSE;
}
-static INT_PTR CALLBACK IEViewSRMMOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
+static INT_PTR CALLBACK IEViewSRMMOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
BOOL bChecked;
char path[MAX_PATH], filter[MAX_PATH];
switch (msg) {
@@ -688,7 +701,8 @@ static INT_PTR CALLBACK IEViewSRMMOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar
return FALSE;
}
-static INT_PTR CALLBACK IEViewHistoryOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
+static INT_PTR CALLBACK IEViewHistoryOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
BOOL bChecked = FALSE;
char path[MAX_PATH], filter[MAX_PATH];
switch (msg) {
@@ -822,7 +836,8 @@ static INT_PTR CALLBACK IEViewHistoryOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w
return FALSE;
}
-static INT_PTR CALLBACK IEViewGroupChatsOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
+static INT_PTR CALLBACK IEViewGroupChatsOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
BOOL bChecked;
char path[MAX_PATH], filter[MAX_PATH];
switch (msg) {
diff --git a/plugins/IEView/src/ScriverHTMLBuilder.cpp b/plugins/IEView/src/ScriverHTMLBuilder.cpp
index fd6293afbc..f1057dca36 100644
--- a/plugins/IEView/src/ScriverHTMLBuilder.cpp
+++ b/plugins/IEView/src/ScriverHTMLBuilder.cpp
@@ -61,7 +61,8 @@ static const char *classNames[] = {
".inputArea", ".notices"
};
-ScriverHTMLBuilder::ScriverHTMLBuilder() {
+ScriverHTMLBuilder::ScriverHTMLBuilder()
+{
setLastEventType(-1);
setLastEventTime(time(NULL));
startedTime = time(NULL);
@@ -81,7 +82,8 @@ bool ScriverHTMLBuilder::isDbEventShown(DBEVENTINFO * dbei)
}
}
-void ScriverHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour) {
+void ScriverHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour)
+{
char str[32];
int style;
DBVARIANT dbv;
@@ -118,7 +120,8 @@ void ScriverHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour)
}
}
-char *ScriverHTMLBuilder::timestampToString(DWORD dwFlags, time_t check, int mode) {
+char *ScriverHTMLBuilder::timestampToString(DWORD dwFlags, time_t check, int mode)
+{
static char szResult[512];
char str[80];
char format[20];
@@ -173,8 +176,8 @@ char *ScriverHTMLBuilder::timestampToString(DWORD dwFlags, time_t check, int mod
return szResult;
}
-
-void ScriverHTMLBuilder::buildHead(IEView *view, IEVIEWEVENT *event) {
+void ScriverHTMLBuilder::buildHead(IEView *view, IEVIEWEVENT *event)
+{
LOGFONTA lf;
COLORREF color;
char *output = NULL;
@@ -263,7 +266,8 @@ void ScriverHTMLBuilder::buildHead(IEView *view, IEVIEWEVENT *event) {
setLastEventType(-1);
}
-void ScriverHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event) {
+void ScriverHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event)
+{
bool showColon;
DWORD dwFlags = db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWTIME, 0) ? SMF_LOG_SHOWTIME : 0;
dwFlags |= !db_get_b(NULL, SRMMMOD, SRMSGSET_HIDENAMES, 0) ? SMF_LOG_SHOWNICK : 0;
diff --git a/plugins/IEView/src/TabSRMMHTMLBuilder.cpp b/plugins/IEView/src/TabSRMMHTMLBuilder.cpp
index 6b0b3ea6aa..c83abc7969 100644
--- a/plugins/IEView/src/TabSRMMHTMLBuilder.cpp
+++ b/plugins/IEView/src/TabSRMMHTMLBuilder.cpp
@@ -77,7 +77,8 @@ static const char *classNames[] = {
".inputArea", ".statusChange", ".dividers"
};
-TabSRMMHTMLBuilder::TabSRMMHTMLBuilder() {
+TabSRMMHTMLBuilder::TabSRMMHTMLBuilder()
+{
setLastEventType(-1);
setLastEventTime(time(NULL));
lastEventTime = time(NULL);
diff --git a/plugins/IEView/src/TextToken.cpp b/plugins/IEView/src/TextToken.cpp
index 40fb816bde..fa5e33f464 100644
--- a/plugins/IEView/src/TextToken.cpp
+++ b/plugins/IEView/src/TextToken.cpp
@@ -131,13 +131,15 @@ static int countNoWhitespace(const wchar_t *str)
return c;
}
-TextToken* TextToken::tokenizeBBCodes(const wchar_t *text) {
+TextToken* TextToken::tokenizeBBCodes(const wchar_t *text)
+{
return tokenizeBBCodes(text, (int)wcslen(text));
}
// TODO: Add the following BBCodes: code
#define BB_TAG_NUM 10
-TextToken* TextToken::tokenizeBBCodes(const wchar_t *text, int l) {
+TextToken* TextToken::tokenizeBBCodes(const wchar_t *text, int l)
+{
static const wchar_t *bbTagName[] = { L"b", L"i", L"u", L"s", L"img", L"color", L"size", L"bimg", L"url", L"code" };
static int bbTagNameLen[] = { 1, 1, 1, 1, 3, 5, 4, 4, 3, 4 };
static int bbTagArg[] = { 0, 0, 0, 0, 0, 1, 1, 0, 1, 0 };
@@ -292,7 +294,8 @@ TextToken* TextToken::tokenizeBBCodes(const wchar_t *text, int l) {
return firstToken;
}
-TextToken* TextToken::tokenizeLinks(const wchar_t *text) {
+TextToken* TextToken::tokenizeLinks(const wchar_t *text)
+{
TextToken *firstToken = NULL, *lastToken = NULL;
int textLen = 0;
int l = (int)wcslen(text);
@@ -351,7 +354,8 @@ TextToken* TextToken::tokenizeLinks(const wchar_t *text) {
return firstToken;
}
-TextToken* TextToken::tokenizeSmileys(MCONTACT hContact, const char *proto, const wchar_t *text, bool isSent) {
+TextToken* TextToken::tokenizeSmileys(MCONTACT hContact, const char *proto, const wchar_t *text, bool isSent)
+{
TextToken *firstToken = NULL, *lastToken = NULL;
SMADD_BATCHPARSE2 sp;
SMADD_BATCHPARSERES *spRes;
@@ -411,7 +415,8 @@ TextToken* TextToken::tokenizeSmileys(MCONTACT hContact, const char *proto, cons
return firstToken;
}
-TextToken* TextToken::tokenizeChatFormatting(const wchar_t *text) {
+TextToken* TextToken::tokenizeChatFormatting(const wchar_t *text)
+{
TextToken *firstToken = NULL, *lastToken = NULL;
int textLen = 0;
int l = (int)wcslen(text);
diff --git a/plugins/IEView/src/ieview_services.cpp b/plugins/IEView/src/ieview_services.cpp
index 70488c3054..089894acca 100644
--- a/plugins/IEView/src/ieview_services.cpp
+++ b/plugins/IEView/src/ieview_services.cpp
@@ -21,7 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "ieview_common.h"
-INT_PTR HandleIEWindow(WPARAM wParam, LPARAM lParam) {
+INT_PTR HandleIEWindow(WPARAM wParam, LPARAM lParam)
+{
IEVIEWWINDOW *window = (IEVIEWWINDOW *) lParam;
IEView::init();
Options::init();
@@ -71,7 +72,8 @@ INT_PTR HandleIEWindow(WPARAM wParam, LPARAM lParam) {
return 0;
}
-INT_PTR HandleIEEvent(WPARAM wParam, LPARAM lParam) {
+INT_PTR HandleIEEvent(WPARAM wParam, LPARAM lParam)
+{
IEVIEWEVENT *event = (IEVIEWEVENT *) lParam;
IEView::init();
Options::init();
@@ -91,7 +93,8 @@ INT_PTR HandleIEEvent(WPARAM wParam, LPARAM lParam) {
return 0;
}
-INT_PTR HandleIENavigate(WPARAM wParam, LPARAM lParam) {
+INT_PTR HandleIENavigate(WPARAM wParam, LPARAM lParam)
+{
IEVIEWNAVIGATE *navigate = (IEVIEWNAVIGATE *) lParam;
IEView::init();
Options::init();