[Wine-patches] mshtml: Implement IMarkupServices interface
Konstantin Kondratyuk
=?iso-8859-1?q?kondratyuk_=CE=C1_etersoft=2Eru?=
Пт Дек 12 20:22:31 MSK 2008
--
Best regards,
Konstantin Kondratyuk.
----------- следующая часть -----------
From ffb8b4aaa870e14328a163f8ef0b648346b9053a Mon Sep 17 00:00:00 2001
From: Konstantin Kondratyuk <kondratyuk на etersoft.ru>
Date: Fri, 12 Dec 2008 20:13:02 +0300
Subject: [PATCH] mshtml: Implement IMarkupServices interface
---
dlls/mshtml/Makefile.in | 1 +
dlls/mshtml/htmldoc.c | 4 +
dlls/mshtml/markup.c | 291 ++++++++++++++++++++++++++++++++++++++++++
dlls/mshtml/mshtml_private.h | 3 +
4 files changed, 299 insertions(+), 0 deletions(-)
create mode 100644 dlls/mshtml/markup.c
diff --git a/dlls/mshtml/Makefile.in b/dlls/mshtml/Makefile.in
index 016a75f..5a26669 100644
--- a/dlls/mshtml/Makefile.in
+++ b/dlls/mshtml/Makefile.in
@@ -46,6 +46,7 @@ C_SRCS = \
install.c \
loadopts.c \
main.c \
+ markup.c \
navigate.c \
nsembed.c \
nsevents.c \
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index 63e2f3b..5e205a4 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -138,6 +138,9 @@ static HRESULT WINAPI HTMLDocument_QueryInterface(IHTMLDocument2 *iface, REFIID
}else if(IsEqualGUID(&IID_IProvideClassInfo, riid)) {
TRACE("(%p)->(IID_IProvideClassInfo %p)\n", This, ppvObject);
*ppvObject = CLASSINFO1(This);
+ }else if(IsEqualGUID(&IID_IMarkupServices, riid)) {
+ TRACE("(%p)->(IID_IMarkupServices %p)\n", This, ppvObject);
+ *ppvObject = MRKUPSRV(This);
}else if(IsEqualGUID(&IID_IPersistPropertyBag, riid)) {
TRACE("(%p)->(IID_IPersistPropertyBag %p) returning NULL\n", This, ppvObject);
*ppvObject = PERPROPBAG(This);
@@ -1761,6 +1764,7 @@ static HRESULT alloc_doc(HTMLDocument **ret)
HTMLDocument_Window_Init(doc);
HTMLDocument_Service_Init(doc);
HTMLDocument_Hlink_Init(doc);
+ HTMLDocument_Markup_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/markup.c b/dlls/mshtml/markup.c
new file mode 100644
index 0000000..0119358
--- /dev/null
+++ b/dlls/mshtml/markup.c
@@ -0,0 +1,291 @@
+/*
+ * Copyright 2008 Konstantin Kondratyuk (Etersoft)
+ *
+ * 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 "mshtml.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
+
+/* IMarkupServices interface */
+
+typedef struct {
+ const IMarkupServicesVtbl *lpMarkupServicesVtbl;
+
+ LONG ref;
+} MarkupServices;
+
+#define MRKUPSRV_THIS(iface) DEFINE_THIS(HTMLDocument, MarkupServices, iface)
+
+static HRESULT WINAPI MarkupServices_QueryInterface(
+ IMarkupServices* iface,
+ REFIID riid,
+ void **ppvObject)
+{
+ HTMLDocument *This = MRKUPSRV_THIS(iface);
+ return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
+}
+
+static ULONG WINAPI MarkupServices_AddRef(
+ IMarkupServices* iface)
+{
+ HTMLDocument *This = MRKUPSRV_THIS(iface);
+ return IHTMLDocument2_AddRef(HTMLDOC(This));
+}
+
+static ULONG WINAPI MarkupServices_Release(
+ IMarkupServices* iface)
+{
+ HTMLDocument *This = MRKUPSRV_THIS(iface);
+ return IHTMLDocument2_Release(HTMLDOC(This));
+}
+
+ /*** IMarkupServices methods ***/
+static HRESULT WINAPI MarkupServices_CreateMarkupPointer(
+ IMarkupServices* iface,
+ IMarkupPointer **ppPointer)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI MarkupServices_CreateMarkupContainer(
+ IMarkupServices* iface,
+ IMarkupContainer **ppMarkupContainer)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI MarkupServices_CreateElement(
+ IMarkupServices* iface,
+ ELEMENT_TAG_ID tagID,
+ unsigned short *pchAttributes,
+ IHTMLElement **ppElement)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI MarkupServices_CloneElement(
+ IMarkupServices* iface,
+ IHTMLElement *pElemCloneThis,
+ IHTMLElement **ppElementTheClone)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI MarkupServices_InsertElement(
+ IMarkupServices* iface,
+ IHTMLElement *pElementInsert,
+ IMarkupPointer *pPointerStart,
+ IMarkupPointer *pPointerFinish)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI MarkupServices_RemoveElement(
+ IMarkupServices* iface,
+ IHTMLElement *pElementRemove)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI MarkupServices_Remove(
+ IMarkupServices* iface,
+ IMarkupPointer *pPointerStart,
+ IMarkupPointer *pPointerFinish)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI MarkupServices_Copy(
+ IMarkupServices* iface,
+ IMarkupPointer *pPointerSourceStart,
+ IMarkupPointer *pPointerSourceFinish,
+ IMarkupPointer *pPointerTarget)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI MarkupServices_Move(
+ IMarkupServices* iface,
+ IMarkupPointer *pPointerSourceStart,
+ IMarkupPointer *pPointerSourceFinish,
+ IMarkupPointer *pPointerTarget)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI MarkupServices_InsertText(
+ IMarkupServices* iface,
+ unsigned short *pchText,
+ long cch,
+ IMarkupPointer *pPointerTarget)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI MarkupServices_ParseString(
+ IMarkupServices* iface,
+ unsigned short *pchHTML,
+ unsigned long dwFlags,
+ IMarkupContainer **ppContainerResult,
+ IMarkupPointer *ppPointerStart,
+ IMarkupPointer *ppPointerFinish)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI MarkupServices_ParseGlobal(
+ IMarkupServices* iface,
+ wireHGLOBAL hglobalHTML,
+ unsigned long dwFlags,
+ IMarkupContainer **ppContainerResult,
+ IMarkupPointer *pPointerStart,
+ IMarkupPointer *pPointerFinish)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI MarkupServices_IsScopedElement(
+ IMarkupServices* iface,
+ IHTMLElement *pElement,
+ long *pfScoped)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI MarkupServices_GetElementTagId(
+ IMarkupServices* iface,
+ IHTMLElement *pElement,
+ ELEMENT_TAG_ID *ptagId)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI MarkupServices_GetTagIDForName(
+ IMarkupServices* iface,
+ BSTR bstrName,
+ ELEMENT_TAG_ID *ptagId)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI MarkupServices_GetNameForTagID(
+ IMarkupServices* iface,
+ ELEMENT_TAG_ID tagID,
+ BSTR *pbstrName)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI MarkupServices_MovePointersToRange(
+ IMarkupServices* iface,
+ IHTMLTxtRange *pIRange,
+ IMarkupPointer *pPointerStart,
+ IMarkupPointer *pPointerFinish)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI MarkupServices_MoveRangeToPointers(
+ IMarkupServices* iface,
+ IMarkupPointer *pPointerStart,
+ IMarkupPointer *pPointerFinish,
+ IHTMLTxtRange *pIRange)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI MarkupServices_BeginUndoUnit(
+ IMarkupServices* iface,
+ unsigned short *pchTitle)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI MarkupServices_EndUndoUnit(
+ IMarkupServices* iface)
+{
+ FIXME("is not implemented\n");
+ return E_NOTIMPL;
+}
+
+#undef MRKUPSRV_THIS
+
+static const IMarkupServicesVtbl MarkupServicesVtbl = {
+ MarkupServices_QueryInterface,
+ MarkupServices_AddRef,
+ MarkupServices_Release,
+ MarkupServices_CreateMarkupPointer,
+ MarkupServices_CreateMarkupContainer,
+ MarkupServices_CreateElement,
+ MarkupServices_CloneElement,
+ MarkupServices_InsertElement,
+ MarkupServices_RemoveElement,
+ MarkupServices_Remove,
+ MarkupServices_Copy,
+ MarkupServices_Move,
+ MarkupServices_InsertText,
+ MarkupServices_ParseString,
+ MarkupServices_ParseGlobal,
+ MarkupServices_IsScopedElement,
+ MarkupServices_GetElementTagId,
+ MarkupServices_GetTagIDForName,
+ MarkupServices_GetNameForTagID,
+ MarkupServices_MovePointersToRange,
+ MarkupServices_MoveRangeToPointers,
+ MarkupServices_BeginUndoUnit,
+ MarkupServices_EndUndoUnit
+};
+
+
+void HTMLDocument_Markup_Init(HTMLDocument *This)
+{
+ This->lpMarkupServicesVtbl = &MarkupServicesVtbl;
+}
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index 09d3e13..f8a0294 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -238,6 +238,7 @@ struct HTMLDocument {
const IDispatchExVtbl *lpIDispatchExVtbl;
const IProvideClassInfoVtbl *lpInfoVtbl;
const IPersistPropertyBagVtbl *lpPersistPropertyBagVtbl;
+ const IMarkupServicesVtbl *lpMarkupServicesVtbl;
LONG ref;
@@ -459,6 +460,7 @@ typedef struct {
#define DISPATCHEX(x) ((IDispatchEx*) &(x)->lpIDispatchExVtbl)
#define PERPROPBAG(x) ((IPersistPropertyBag*) &(x)->lpPersistPropertyBagVtbl)
+#define MRKUPSRV(x) ((IMarkupServices*) &(x)->lpMarkupServicesVtbl)
#define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc)))
#define DEFINE_THIS(cls,ifc,iface) DEFINE_THIS2(cls,lp ## ifc ## Vtbl,iface)
@@ -483,6 +485,7 @@ void HTMLDocument_View_Init(HTMLDocument*);
void HTMLDocument_Window_Init(HTMLDocument*);
void HTMLDocument_Service_Init(HTMLDocument*);
void HTMLDocument_Hlink_Init(HTMLDocument*);
+void HTMLDocument_Markup_Init(HTMLDocument*);
HRESULT HTMLCurrentStyle_Create(HTMLElement*,IHTMLCurrentStyle**);
--
1.6.0.2.GIT
Подробная информация о списке рассылки Wine-patches