[Wine-patches] 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:20:21 MSK 2009


-- 
Best regards,
Konstantin Kondratyuk.
----------- следующая часть -----------
From 05dc3864d3e1c06314e57681d3729a7a8f7baafa Mon Sep 17 00:00:00 2001
From: Konstantin Kondratyuk <kondratyuk на etersoft.ru>
Date: Wed, 11 Feb 2009 14:39:49 +0300
Subject: [PATCH] mshtml: Add IHTMLBaseElement stubs (for eterbug #3343)

---
 dlls/mshtml/Makefile.in      |    1 +
 dlls/mshtml/baseelement.c    |  180 ++++++++++++++++++++++++++++++++++++++++++
 dlls/mshtml/htmldoc.c        |    1 +
 dlls/mshtml/htmlnode.c       |    4 +
 dlls/mshtml/mshtml_private.h |    2 +
 5 files changed, 188 insertions(+), 0 deletions(-)
 create mode 100644 dlls/mshtml/baseelement.c

diff --git a/dlls/mshtml/Makefile.in b/dlls/mshtml/Makefile.in
index b59c0f4..258ecc1 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..1b37d93
--- /dev/null
+++ b/dlls/mshtml/baseelement.c
@@ -0,0 +1,180 @@
+/*
+ * 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 1654149..7f04595 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -1811,6 +1811,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 a9b0e3a..6390eb9 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -242,6 +242,7 @@ struct HTMLDocument {
     const IPersistPropertyBagVtbl         *lpPersistPropertyBagVtbl;
     const IMarkupServicesVtbl             *lpMarkupServicesVtbl;
     const ISupportErrorInfoVtbl           *lpSupportErrorInfoVtbl;
+    const IHTMLBaseElementVtbl            *lpHTMLBaseElementVtbl;
 
     LONG ref;
 
@@ -473,6 +474,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)
 
-- 
1.6.1.1.GIT



Подробная информация о списке рассылки Wine-patches