From 0371739fc832cee61a77c52ae1b9c3d862616697 Mon Sep 17 00:00:00 2001 From: Konstantin Kondratyuk Date: Fri, 14 Jan 2011 18:59:56 +0300 Subject: [PATCH] mshtml: Implement IMarkupServices interface Conflicts: dlls/mshtml/mshtml_private.h --- dlls/mshtml/Makefile.in | 1 + dlls/mshtml/htmldoc.c | 4 + dlls/mshtml/markup.c | 291 +++++++++++++++++++++++++++++++++++ dlls/mshtml/mshtml_private.h | 5 + 4 files changed, 301 insertions(+) create mode 100644 dlls/mshtml/markup.c diff --git a/dlls/mshtml/Makefile.in b/dlls/mshtml/Makefile.in index 3b4da26d0c..6119b5e6e3 100644 --- a/dlls/mshtml/Makefile.in +++ b/dlls/mshtml/Makefile.in @@ -53,6 +53,7 @@ C_SRCS = \ loadopts.c \ main.c \ mutation.c \ + markup.c \ navigate.c \ npplugin.c \ nsembed.c \ diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index fabfc8e5f8..e47d729163 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -1804,6 +1804,9 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv) }else if(IsEqualGUID(&IID_IPersistHistory, riid)) { TRACE("(%p)->(IID_IPersistHistory %p)\n", This, ppv); *ppv = &This->IPersistHistory_iface; + }else if(IsEqualGUID(&IID_IMarkupServices, riid)) { + TRACE("(%p)->(IID_IMarkupServices %p)\n", This, ppv); + *ppv = MRKUPSRV(This); }else if(IsEqualGUID(&CLSID_CMarkup, riid)) { FIXME("(%p)->(CLSID_CMarkup %p)\n", This, ppv); *ppv = NULL; @@ -1858,6 +1861,7 @@ static void init_doc(HTMLDocument *doc, IUnknown *unk_impl, IDispatchEx *dispex) HTMLDocument_Window_Init(doc); HTMLDocument_Service_Init(doc); HTMLDocument_Hlink_Init(doc); + HTMLDocument_Markup_Init(doc); ConnectionPointContainer_Init(&doc->cp_container, (IUnknown*)&doc->IHTMLDocument2_iface); ConnectionPoint_Init(&doc->cp_dispatch, &doc->cp_container, &IID_IDispatch, NULL); diff --git a/dlls/mshtml/markup.c b/dlls/mshtml/markup.c new file mode 100644 index 0000000000..4e094934e2 --- /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 +#include + +#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 htmldoc_query_interface(This, riid, ppvObject); +} + +static ULONG WINAPI MarkupServices_AddRef( + IMarkupServices* iface) +{ + HTMLDocument *This = MRKUPSRV_THIS(iface); + return htmldoc_addref(This); +} + +static ULONG WINAPI MarkupServices_Release( + IMarkupServices* iface) +{ + HTMLDocument *This = MRKUPSRV_THIS(iface); + return htmldoc_release(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 1f3caa8fa1..06f653a438 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -365,6 +365,8 @@ struct HTMLDocument { IHlinkTarget IHlinkTarget_iface; IPersistStreamInit IPersistStreamInit_iface; const IDispatchExVtbl *lpIDispatchExVtbl; + const IMarkupServicesVtbl *lpMarkupServicesVtbl; + ISupportErrorInfo ISupportErrorInfo_iface; IObjectWithSite IObjectWithSite_iface; IOleContainer IOleContainer_iface; @@ -662,6 +664,8 @@ struct HTMLDocumentNode { #define HOSTSECMGR(x) ((IInternetHostSecurityManager*) &(x)->lpIInternetHostSecurityManagerVtbl) +#define MRKUPSRV(x) ((IMarkupServices*) &(x)->lpMarkupServicesVtbl) + #define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl))) HRESULT HTMLDocument_Create(IUnknown*,REFIID,void**); @@ -689,6 +693,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*); void HTMLDocumentNode_SecMgr_Init(HTMLDocumentNode*); -- 2.33.8