Module: wine Branch: master Commit: b18ff8b3b0c697556107e515281a42b1b6422dcd URL: http://source.winehq.org/git/wine.git/?a=commit;h=b18ff8b3b0c697556107e51528...
Author: Jacek Caban jacek@codeweavers.com Date: Wed Jan 18 19:52:34 2012 +0100
mshtml: Added ITargetContainer stub implementation.
---
dlls/mshtml/htmldoc.c | 4 +++ dlls/mshtml/mshtml_private.h | 4 +++ dlls/mshtml/oleobj.c | 50 ++++++++++++++++++++++++++++++++++++++++++ dlls/mshtml/tests/dom.c | 2 + 4 files changed, 60 insertions(+), 0 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 45a7986..039893e 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -2249,6 +2249,9 @@ static HRESULT WINAPI CustomDoc_QueryInterface(ICustomDoc *iface, REFIID riid, v if(IsEqualGUID(&IID_ICustomDoc, riid)) { TRACE("(%p)->(IID_ICustomDoc %p)\n", This, ppv); *ppv = &This->ICustomDoc_iface; + }else if(IsEqualGUID(&IID_ITargetContainer, riid)) { + TRACE("(%p)->(IID_ITargetContainer %p)\n", This, ppv); + *ppv = &This->ITargetContainer_iface; }else if(dispex_query_interface(&This->dispex, riid, ppv)) { return *ppv ? S_OK : E_NOINTERFACE; }else { @@ -2386,6 +2389,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
init_dispex(&doc->dispex, (IUnknown*)&doc->ICustomDoc_iface, &HTMLDocumentObj_dispex); init_doc(&doc->basedoc, (IUnknown*)&doc->ICustomDoc_iface, &doc->dispex.IDispatchEx_iface); + TargetContainer_Init(doc);
doc->ICustomDoc_iface.lpVtbl = &CustomDocVtbl; doc->ref = 1; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 5480435..684d396 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -26,6 +26,7 @@ #include "perhist.h" #include "dispex.h" #include "objsafe.h" +#include "htiframe.h"
#include "wine/list.h" #include "wine/unicode.h" @@ -437,6 +438,7 @@ struct HTMLDocumentObj { HTMLDocument basedoc; DispatchEx dispex; ICustomDoc ICustomDoc_iface; + ITargetContainer ITargetContainer_iface;
LONG ref;
@@ -638,6 +640,8 @@ void HTMLDocument_Window_Init(HTMLDocument*) DECLSPEC_HIDDEN; void HTMLDocument_Service_Init(HTMLDocument*) DECLSPEC_HIDDEN; void HTMLDocument_Hlink_Init(HTMLDocument*) DECLSPEC_HIDDEN;
+void TargetContainer_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN; + void HTMLDocumentNode_SecMgr_Init(HTMLDocumentNode*) DECLSPEC_HIDDEN;
HRESULT HTMLCurrentStyle_Create(HTMLElement*,IHTMLCurrentStyle**) DECLSPEC_HIDDEN; diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index e207066..9d50347 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -891,6 +891,56 @@ static const IOleContainerVtbl OleContainerVtbl = { OleContainer_LockContainer };
+static inline HTMLDocumentObj *impl_from_ITargetContainer(ITargetContainer *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, ITargetContainer_iface); +} + +static HRESULT WINAPI TargetContainer_QueryInterface(ITargetContainer *iface, REFIID riid, void **ppv) +{ + HTMLDocumentObj *This = impl_from_ITargetContainer(iface); + return ICustomDoc_QueryInterface(&This->ICustomDoc_iface, riid, ppv); +} + +static ULONG WINAPI TargetContainer_AddRef(ITargetContainer *iface) +{ + HTMLDocumentObj *This = impl_from_ITargetContainer(iface); + return ICustomDoc_AddRef(&This->ICustomDoc_iface); +} + +static ULONG WINAPI TargetContainer_Release(ITargetContainer *iface) +{ + HTMLDocumentObj *This = impl_from_ITargetContainer(iface); + return ICustomDoc_Release(&This->ICustomDoc_iface); +} + +static HRESULT WINAPI TargetContainer_GetFrameUrl(ITargetContainer *iface, LPWSTR *ppszFrameSrc) +{ + HTMLDocumentObj *This = impl_from_ITargetContainer(iface); + FIXME("(%p)->(%p)\n", This, ppszFrameSrc); + return E_NOTIMPL; +} + +static HRESULT WINAPI TargetContainer_GetFramesContainer(ITargetContainer *iface, IOleContainer **ppContainer) +{ + HTMLDocumentObj *This = impl_from_ITargetContainer(iface); + FIXME("(%p)->(%p)\n", This, ppContainer); + return E_NOTIMPL; +} + +static const ITargetContainerVtbl TargetContainerVtbl = { + TargetContainer_QueryInterface, + TargetContainer_AddRef, + TargetContainer_Release, + TargetContainer_GetFrameUrl, + TargetContainer_GetFramesContainer +}; + +void TargetContainer_Init(HTMLDocumentObj *This) +{ + This->ITargetContainer_iface.lpVtbl = &TargetContainerVtbl; +} + /********************************************************** * IObjectSafety implementation */ diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 6cc1733..710b1f5 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -33,6 +33,7 @@ #include "dispex.h" #include "mshtml_test.h" #include "objsafe.h" +#include "htiface.h"
static INT (WINAPI *pLCIDToLocaleName)(LCID,LPWSTR,INT,DWORD); static LANGID (WINAPI *pGetUserDefaultUILanguage)(void); @@ -148,6 +149,7 @@ static const IID * const doc_obj_iids[] = { &IID_IOleContainer, &IID_IObjectSafety, &IID_IProvideClassInfo, + &IID_ITargetContainer, NULL };