[Wine-patches] [eter-1.0.9] mshtml: Add support of IHTMLBaseElement (fix eterbugs #3343, #2517, #3025, #3107, #3168)
Konstantin Kondratyuk
=?iso-8859-1?q?kondratyuk_=CE=C1_etersoft=2Eru?=
Ср Фев 11 15:19:30 MSK 2009
Специально для багфикс-сборки 1.0.9. Для current-сборок - адаптированный патч.
--
Best regards,
Konstantin Kondratyuk.
----------- следующая часть -----------
From a45f2f4d5e778fdaf810dd25501e3cdc2b62984c Mon Sep 17 00:00:00 2001
From: Konstantin Kondratyuk <kondratyuk на etersoft.ru>
Date: Wed, 11 Feb 2009 15:14:31 +0300
Subject: [PATCH] [eter-1.0.9] mshtml: Add support of IHTMLBaseElement (maybe fix eterbugs #3343, #2517, #3025, #3107, #3168)
---
dlls/mshtml/Makefile.in | 1 +
dlls/mshtml/baseelement.c | 181 ++++++++++++++++++++++++++++++++++++++++++
dlls/mshtml/htmldoc.c | 1 +
dlls/mshtml/htmlnode.c | 4 +
dlls/mshtml/mshtml_private.h | 2 +
include/mshtmdid.h | 5 +
include/mshtml.idl | 24 ++++++
7 files changed, 218 insertions(+), 0 deletions(-)
create mode 100644 dlls/mshtml/baseelement.c
diff --git a/dlls/mshtml/Makefile.in b/dlls/mshtml/Makefile.in
index 5a26669..8d9f5a7 100644
--- a/dlls/mshtml/Makefile.in
+++ b/dlls/mshtml/Makefile.in
@@ -8,6 +8,7 @@ IMPORTS = strmiids uuid urlmon shlwapi ole32 oleaut32 user32 gdi32 advapi32 ke
EXTRADEFS = -DCOM_NO_WINDOWS_H
C_SRCS = \
+ baseelement.c \
conpoint.c \
dispex.c \
editor.c \
diff --git a/dlls/mshtml/baseelement.c b/dlls/mshtml/baseelement.c
new file mode 100644
index 0000000..6d1430c
--- /dev/null
+++ b/dlls/mshtml/baseelement.c
@@ -0,0 +1,181 @@
+/*
+ * Copyright 2009 Konstantin Kondratyuk
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "config.h"
+
+#include <stdarg.h>
+#include <stdio.h>
+
+#define COBJMACROS
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "ole2.h"
+
+#include "wine/debug.h"
+
+#include "mshtml_private.h"
+#include "htmlevent.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
+
+#define HTMLBASEELEM_THIS(iface) DEFINE_THIS(HTMLDocument, HTMLBaseElement, iface)
+
+ /*** IUnknown methods ***/
+static HRESULT WINAPI HTMLBaseElement_QueryInterface(
+ IHTMLBaseElement* iface,
+ REFIID riid,
+ void **ppvObject)
+/*
+{
+ HTMLDocument *This = HTMLBASEELEM_THIS(iface);
+ return IHTMLDocument2_QueryInterface(This, riid, ppvObject);
+}
+*/
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static ULONG WINAPI HTMLBaseElement_AddRef(
+ IHTMLBaseElement* iface)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+/*
+{
+ HTMLDocument *This = HTMLBASEELEM_THIS(iface);
+ return IHTMLDocument2_AddRef(This);
+}
+*/
+
+static ULONG WINAPI HTMLBaseElement_Release(
+ IHTMLBaseElement* iface)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+/*
+{
+ HTMLDocument *This = HTMLBASEELEM_THIS(iface);
+ return IHTMLDocument2_Release(This);
+}
+*/
+
+ /*** IDispatch methods ***/
+static HRESULT WINAPI HTMLBaseElement_GetTypeInfoCount(
+ IHTMLBaseElement* iface,
+ UINT *pctinfo)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLBaseElement_GetTypeInfo(
+ IHTMLBaseElement* iface,
+ UINT iTInfo,
+ LCID lcid,
+ ITypeInfo **ppTInfo)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLBaseElement_GetIDsOfNames(
+ IHTMLBaseElement* iface,
+ REFIID riid,
+ LPOLESTR *rgszNames,
+ UINT cNames,
+ LCID lcid,
+ DISPID *rgDispId)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLBaseElement_Invoke(
+ IHTMLBaseElement* iface,
+ DISPID dispIdMember,
+ REFIID riid,
+ LCID lcid,
+ WORD wFlags,
+ DISPPARAMS *pDispParams,
+ VARIANT *pVarResult,
+ EXCEPINFO *pExcepInfo,
+ UINT *puArgErr)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+ /*** IHTMLBaseElement methods ***/
+static HRESULT WINAPI HTMLBaseElement_put_href(
+ IHTMLBaseElement* iface,
+ BSTR v)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLBaseElement_get_href(
+ IHTMLBaseElement* iface,
+ BSTR *p)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLBaseElement_put_target(
+ IHTMLBaseElement* iface,
+ BSTR v)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLBaseElement_get_target(
+ IHTMLBaseElement* iface,
+ BSTR *p)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+#undef HTMLBASEELEM_THIS
+
+static const IHTMLBaseElementVtbl HTMLBaseElementVtbl = {
+ HTMLBaseElement_QueryInterface,
+ HTMLBaseElement_AddRef,
+ HTMLBaseElement_Release,
+ HTMLBaseElement_GetTypeInfoCount,
+ HTMLBaseElement_GetTypeInfo,
+ HTMLBaseElement_GetIDsOfNames,
+ HTMLBaseElement_Invoke,
+ HTMLBaseElement_put_href,
+ HTMLBaseElement_get_href,
+ HTMLBaseElement_put_target,
+ HTMLBaseElement_get_target,
+};
+
+
+void HTMLDocument_BaseElement_Init(HTMLDocument *This)
+{
+ This->lpHTMLBaseElementVtbl = &HTMLBaseElementVtbl;
+}
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index eebcdee..f213813 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -1635,6 +1635,7 @@ static HRESULT alloc_doc(HTMLDocument **ret)
HTMLDocument_Service_Init(doc);
HTMLDocument_Hlink_Init(doc);
HTMLDocument_Markup_Init(doc);
+ HTMLDocument_BaseElement_Init(doc);
ConnectionPointContainer_Init(&doc->cp_container, (IUnknown*)HTMLDOC(doc));
ConnectionPoint_Init(&doc->cp_propnotif, &doc->cp_container, &IID_IPropertyNotifySink);
diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c
index bee0376..305c76b 100644
--- a/dlls/mshtml/htmlnode.c
+++ b/dlls/mshtml/htmlnode.c
@@ -842,6 +842,10 @@ HRESULT HTMLDOMNode_QI(HTMLDOMNode *This, REFIID riid, void **ppv)
}else if(IsEqualGUID(&IID_IHTMLDOMNode2, riid)) {
TRACE("(%p)->(IID_IHTMLDOMNode2 %p)\n", This, ppv);
*ppv = HTMLDOMNODE2(This);
+ }else if(IsEqualGUID(&IID_IHTMLBaseElement, riid)) {
+ HTMLDocument* This2 = This->doc;
+ FIXME("(%p)->(IID_IHTMLBaseElement %p)\n", This2, ppv);
+ *ppv = HTMLBASEELEM(This2);
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
return *ppv ? S_OK : E_NOINTERFACE;
}
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index 4e02e20..be81f4d 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -239,6 +239,7 @@ struct HTMLDocument {
const IProvideClassInfoVtbl *lpInfoVtbl;
const IPersistPropertyBagVtbl *lpPersistPropertyBagVtbl;
const IMarkupServicesVtbl *lpMarkupServicesVtbl;
+ const IHTMLBaseElementVtbl *lpHTMLBaseElementVtbl;
LONG ref;
@@ -452,6 +453,7 @@ typedef struct {
#define HTMLELEM3(x) ((IHTMLElement3*) &(x)->lpHTMLElement3Vtbl)
#define HTMLDOMNODE(x) ((IHTMLDOMNode*) &(x)->lpHTMLDOMNodeVtbl)
#define HTMLDOMNODE2(x) ((IHTMLDOMNode2*) &(x)->lpHTMLDOMNode2Vtbl)
+#define HTMLBASEELEM(x) ((IHTMLBaseElement*) &(x)->lpHTMLBaseElementVtbl)
#define HTMLTEXTCONT(x) ((IHTMLTextContainer*) &(x)->lpHTMLTextContainerVtbl)
diff --git a/include/mshtmdid.h b/include/mshtmdid.h
index 3a9b81a..546c2f6 100644
--- a/include/mshtmdid.h
+++ b/include/mshtmdid.h
@@ -96,6 +96,7 @@
#define DISPID_DOMIMPLEMENTATION DISPID_NORMAL_FIRST
#define DISPID_ILINEINFO DISPID_NORMAL_FIRST
#define DISPID_IHTMLCOMPUTEDSTYLE DISPID_NORMAL_FIRST
+#define DISPID_HEDELEMS DISPID_NORMAL_FIRST
#define DISPID_COLLECTION (DISPID_NORMAL_FIRST+500)
#define DISPID_OPTIONS_COL (DISPID_NORMAL_FIRST+500)
@@ -2443,4 +2444,8 @@
#define DISPID_IHTMLCOMPUTEDSTYLE_BLOCKDIRECTION DISPID_IHTMLCOMPUTEDSTYLE+17
#define DISPID_IHTMLCOMPUTEDSTYLE_OL DISPID_IHTMLCOMPUTEDSTYLE+18
+/* IHTMLBaseElement */
+#define DISPID_IHTMLBASEELEMENT_HREF DISPID_HEDELEMS+3
+#define DISPID_IHTMLBASEELEMENT_TARGET DISPID_HEDELEMS+4
+
#endif /* __MSHTMDID_H__ */
diff --git a/include/mshtml.idl b/include/mshtml.idl
index d9b1dad..75fab0f 100644
--- a/include/mshtml.idl
+++ b/include/mshtml.idl
@@ -20833,4 +20833,28 @@ interface IHTMLEditServices : IUnknown
[in] SELECTION_TYPE eType);
}
+/*****************************************************************************
+ * IHTMLBaseElement interface
+ */
+[
+ odl,
+ oleautomation,
+ dual,
+ uuid(3050f204-98b5-11cf-bb82-00aa00bdce0b)
+]
+interface IHTMLBaseElement : IDispatch
+{
+ [propput, id(DISPID_IHTMLBASEELEMENT_HREF), displaybind, bindable]
+ HRESULT href([in] BSTR v);
+
+ [propget, id(DISPID_IHTMLBASEELEMENT_HREF), displaybind, bindable]
+ HRESULT href([retval, out] BSTR * p);
+
+ [propput, id(DISPID_IHTMLBASEELEMENT_TARGET), displaybind, bindable]
+ HRESULT target([in] BSTR v);
+
+ [propget, id(DISPID_IHTMLBASEELEMENT_TARGET), displaybind, bindable]
+ HRESULT target([retval, out] BSTR * p);
+};
+
} /* library MSHTML */
--
1.6.1.1.GIT
Подробная информация о списке рассылки Wine-patches