This is the first in a series of MRs to get rid of the `HTMLDocument` basedoc struct and separate the `HTMLDocumentNode` and `HTMLDocumentObj`, as suggested. The other interfaces and fields will be done in follow-up MRs. It should be a no-op in general.
Some of the things are ugly but temporary (e.g. the chunk in `HTMLDocument_put_designMode` on first commit) until the entire transition is done, then they will be cleaned up.
For most of the interfaces, they all deal with doc objects in most cases, so the implementation on HTMLDocumentNode tends to just forward to that. There are exceptions of course, but care has been taken to have them mostly no-ops ("mostly" because there's cases where the previous code did not check for e.g. NULL node, so it would crash instead, which is bad and should be fixed now).
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmldoc.c | 64 ++++++++++++++++++++++++------------ dlls/mshtml/htmlwindow.c | 2 +- dlls/mshtml/mshtml_private.h | 4 +-- dlls/mshtml/mutation.c | 2 +- dlls/mshtml/persist.c | 2 +- 5 files changed, 48 insertions(+), 26 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 2a99316d129..72334088991 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -852,7 +852,8 @@ static HRESULT WINAPI HTMLDocument_put_designMode(IHTMLDocument2 *iface, BSTR v) if(FAILED(hres)) return hres;
- call_property_onchanged(&This->cp_container, DISPID_IHTMLDOCUMENT2_DESIGNMODE); + call_property_onchanged(This == &This->doc_obj->basedoc ? &This->doc_obj->cp_container : &This->doc_node->cp_container, + DISPID_IHTMLDOCUMENT2_DESIGNMODE); return S_OK; }
@@ -4769,12 +4770,12 @@ static const IDocumentEventVtbl DocumentEventVtbl = { DocumentEvent_createEvent };
-static void HTMLDocument_on_advise(IUnknown *iface, cp_static_data_t *cp) +static void HTMLDocumentNode_on_advise(IUnknown *iface, cp_static_data_t *cp) { - HTMLDocument *This = impl_from_IHTMLDocument2((IHTMLDocument2*)iface); + HTMLDocumentNode *This = CONTAINING_RECORD((IHTMLDocument2*)iface, HTMLDocumentNode, basedoc.IHTMLDocument2_iface);
- if(This->window) - update_doc_cp_events(This->doc_node, cp); + if(This->basedoc.window) + update_doc_cp_events(This, cp); }
static inline HTMLDocument *impl_from_ISupportErrorInfo(ISupportErrorInfo *iface) @@ -5640,8 +5641,6 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv) *ppv = &This->IOleControl_iface; else if(IsEqualGUID(&IID_IHlinkTarget, riid)) *ppv = &This->IHlinkTarget_iface; - else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) - *ppv = &This->cp_container.IConnectionPointContainer_iface; else if(IsEqualGUID(&IID_IPersistStreamInit, riid)) *ppv = &This->IPersistStreamInit_iface; else if(IsEqualGUID(&DIID_DispHTMLDocument, riid)) @@ -5694,14 +5693,14 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv) return TRUE; }
-static cp_static_data_t HTMLDocumentEvents_data = { HTMLDocumentEvents_tid, HTMLDocument_on_advise }; -static cp_static_data_t HTMLDocumentEvents2_data = { HTMLDocumentEvents2_tid, HTMLDocument_on_advise, TRUE }; +static cp_static_data_t HTMLDocumentNodeEvents_data = { HTMLDocumentEvents_tid, HTMLDocumentNode_on_advise }; +static cp_static_data_t HTMLDocumentNodeEvents2_data = { HTMLDocumentEvents2_tid, HTMLDocumentNode_on_advise, TRUE };
-static const cpc_entry_t HTMLDocument_cpc[] = { - {&IID_IDispatch, &HTMLDocumentEvents_data}, +static const cpc_entry_t HTMLDocumentNode_cpc[] = { + {&IID_IDispatch, &HTMLDocumentNodeEvents_data}, {&IID_IPropertyNotifySink}, - {&DIID_HTMLDocumentEvents, &HTMLDocumentEvents_data}, - {&DIID_HTMLDocumentEvents2, &HTMLDocumentEvents2_data}, + {&DIID_HTMLDocumentEvents, &HTMLDocumentNodeEvents_data}, + {&DIID_HTMLDocumentEvents2, &HTMLDocumentNodeEvents2_data}, {NULL} };
@@ -5730,8 +5729,6 @@ static void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex) HTMLDocument_OleCmd_Init(doc); HTMLDocument_OleObj_Init(doc); HTMLDocument_Service_Init(doc); - - ConnectionPointContainer_Init(&doc->cp_container, (IUnknown*)&doc->IHTMLDocument2_iface, HTMLDocument_cpc); }
static inline HTMLDocumentNode *impl_from_HTMLDOMNode(HTMLDOMNode *iface) @@ -5750,6 +5747,8 @@ static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
if(IsEqualGUID(&IID_IInternetHostSecurityManager, riid)) *ppv = &This->IInternetHostSecurityManager_iface; + else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) + *ppv = &This->cp_container.IConnectionPointContainer_iface; else return HTMLDOMNode_QI(&This->node, riid, ppv);
@@ -5809,7 +5808,7 @@ static void HTMLDocumentNode_destructor(HTMLDOMNode *iface) TRACE("(%p)\n", This);
heap_free(This->event_vector); - ConnectionPointContainer_Destroy(&This->basedoc.cp_container); + ConnectionPointContainer_Destroy(&This->cp_container); }
static HRESULT HTMLDocumentNode_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret) @@ -5846,7 +5845,7 @@ static const NodeImplVtbl HTMLDocumentNodeImplVtbl = { &CLSID_HTMLDocument, HTMLDocumentNode_QI, HTMLDocumentNode_destructor, - HTMLDocument_cpc, + HTMLDocumentNode_cpc, HTMLDocumentNode_clone, NULL, NULL, @@ -6028,7 +6027,7 @@ static ConnectionPointContainer *HTMLDocumentNode_get_cp_container(DispatchEx *d { HTMLDocumentNode *This = impl_from_DispatchEx(dispex); ConnectionPointContainer *container = This->basedoc.doc_obj - ? &This->basedoc.doc_obj->basedoc.cp_container : &This->basedoc.cp_container; + ? &This->basedoc.doc_obj->cp_container : &This->cp_container; IConnectionPointContainer_AddRef(&container->IConnectionPointContainer_iface); return container; } @@ -6068,7 +6067,7 @@ static const NodeImplVtbl HTMLDocumentFragmentImplVtbl = { &CLSID_HTMLDocument, HTMLDocumentNode_QI, HTMLDocumentNode_destructor, - HTMLDocument_cpc, + HTMLDocumentNode_cpc, HTMLDocumentFragment_clone };
@@ -6136,6 +6135,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo
init_doc(&doc->basedoc, (IUnknown*)&doc->node.IHTMLDOMNode_iface, &doc->node.event_target.dispex.IDispatchEx_iface); + ConnectionPointContainer_Init(&doc->cp_container, (IUnknown*)&doc->basedoc.IHTMLDocument2_iface, HTMLDocumentNode_cpc); HTMLDocumentNode_SecMgr_Init(doc);
list_init(&doc->selection_list); @@ -6162,7 +6162,7 @@ HRESULT create_document_node(nsIDOMHTMLDocument *nsdoc, GeckoBrowser *browser, H }
if(!doc_obj->basedoc.window || (window && is_main_content_window(window->base.outer_window))) - doc->basedoc.cp_container.forward_container = &doc_obj->basedoc.cp_container; + doc->cp_container.forward_container = &doc_obj->cp_container;
HTMLDOMNode_Init(doc, &doc->node, (nsIDOMNode*)nsdoc, &HTMLDocumentNode_dispex);
@@ -6256,6 +6256,8 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii *ppv = &This->IViewObjectEx_iface; }else if(IsEqualGUID(&IID_ITargetContainer, riid)) { *ppv = &This->ITargetContainer_iface; + }else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) { + *ppv = &This->cp_container.IConnectionPointContainer_iface; }else if(dispex_query_interface(&This->dispex, riid, ppv)) { return *ppv ? S_OK : E_NOINTERFACE; }else { @@ -6317,7 +6319,7 @@ static ULONG WINAPI HTMLDocumentObj_Release(IUnknown *iface) heap_free(This->mime);
remove_target_tasks(This->task_magic); - ConnectionPointContainer_Destroy(&This->basedoc.cp_container); + ConnectionPointContainer_Destroy(&This->cp_container); release_dispex(&This->dispex);
if(This->nscontainer) @@ -6401,6 +6403,25 @@ static const ICustomDocVtbl CustomDocVtbl = { CustomDoc_SetUIHandler };
+static void HTMLDocumentObj_on_advise(IUnknown *iface, cp_static_data_t *cp) +{ + HTMLDocumentObj *This = impl_from_IUnknown(iface); + + if(This->basedoc.window && This->basedoc.doc_node) + update_doc_cp_events(This->basedoc.doc_node, cp); +} + +static cp_static_data_t HTMLDocumentObjEvents_data = { HTMLDocumentEvents_tid, HTMLDocumentObj_on_advise }; +static cp_static_data_t HTMLDocumentObjEvents2_data = { HTMLDocumentEvents2_tid, HTMLDocumentObj_on_advise, TRUE }; + +static const cpc_entry_t HTMLDocumentObj_cpc[] = { + {&IID_IDispatch, &HTMLDocumentObjEvents_data}, + {&IID_IPropertyNotifySink}, + {&DIID_HTMLDocumentEvents, &HTMLDocumentObjEvents_data}, + {&DIID_HTMLDocumentEvents2, &HTMLDocumentObjEvents2_data}, + {NULL} +}; + static HRESULT HTMLDocumentObj_location_hook(DispatchEx *dispex, WORD flags, DISPPARAMS *dp, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) { @@ -6458,6 +6479,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii
init_dispatch(&doc->dispex, (IUnknown*)&doc->ICustomDoc_iface, &HTMLDocumentObj_dispex, COMPAT_MODE_QUIRKS); init_doc(&doc->basedoc, outer ? outer : &doc->IUnknown_inner, &doc->dispex.IDispatchEx_iface); + ConnectionPointContainer_Init(&doc->cp_container, &doc->IUnknown_inner, HTMLDocumentObj_cpc); TargetContainer_Init(doc); doc->is_mhtml = is_mhtml;
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 12f8a304d41..cc7c11c83c5 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -128,7 +128,7 @@ static void detach_inner_window(HTMLInnerWindow *window) }
if(outer_window && is_main_content_window(outer_window)) - window->doc->basedoc.cp_container.forward_container = NULL; + window->doc->cp_container.forward_container = NULL;
if(doc) detach_document_node(doc); diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 7ac4cea2e2b..d528c4b2999 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -679,8 +679,6 @@ struct HTMLDocument { HTMLDocumentNode *doc_node;
HTMLOuterWindow *window; - - ConnectionPointContainer cp_container; };
static inline HRESULT htmldoc_query_interface(HTMLDocument *This, REFIID riid, void **ppv) @@ -727,6 +725,7 @@ struct HTMLDocumentObj { IUnknown *browser_service; IOleAdviseHolder *advise_holder;
+ ConnectionPointContainer cp_container; DOCHOSTUIINFO hostinfo;
IOleUndoManager *undomgr; @@ -903,6 +902,7 @@ struct HTMLDocumentNode {
LONG ref;
+ ConnectionPointContainer cp_container; HTMLInnerWindow *window;
GeckoBrowser *browser; diff --git a/dlls/mshtml/mutation.c b/dlls/mshtml/mutation.c index 02b511e309e..0f1a083e616 100644 --- a/dlls/mshtml/mutation.c +++ b/dlls/mshtml/mutation.c @@ -280,7 +280,7 @@ static void parse_complete(HTMLDocumentObj *doc) call_explorer_69(doc); if(doc->view_sink) IAdviseSink_OnViewChange(doc->view_sink, DVASPECT_CONTENT, -1); - call_property_onchanged(&doc->basedoc.cp_container, 1005); + call_property_onchanged(&doc->cp_container, 1005); call_explorer_69(doc);
if(doc->webbrowser && doc->nscontainer->usermode != EDITMODE && !(doc->basedoc.window->load_flags & BINDING_REFRESH)) diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index 49e78ecfbc2..df88a093f5b 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c @@ -433,7 +433,7 @@ static void notif_readystate(HTMLOuterWindow *window) window->readystate_pending = FALSE;
if(is_main_content_window(window)) - call_property_onchanged(&window->browser->doc->basedoc.cp_container, DISPID_READYSTATE); + call_property_onchanged(&window->browser->doc->cp_container, DISPID_READYSTATE);
hres = create_document_event(window->base.inner_window->doc, EVENTID_READYSTATECHANGE, &event); if(SUCCEEDED(hres)) {
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmldoc.c | 9 ++- dlls/mshtml/htmlwindow.c | 2 +- dlls/mshtml/mshtml_private.h | 6 +- dlls/mshtml/service.c | 112 +++++++++++++++++++++++++---------- 4 files changed, 91 insertions(+), 38 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 72334088991..0ccfc07ea69 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -5633,8 +5633,6 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv) *ppv = &This->IOleInPlaceObjectWindowless_iface; else if(IsEqualGUID(&IID_IOleInPlaceObjectWindowless, riid)) *ppv = &This->IOleInPlaceObjectWindowless_iface; - else if(IsEqualGUID(&IID_IServiceProvider, riid)) - *ppv = &This->IServiceProvider_iface; else if(IsEqualGUID(&IID_IOleCommandTarget, riid)) *ppv = &This->IOleCommandTarget_iface; else if(IsEqualGUID(&IID_IOleControl, riid)) @@ -5728,7 +5726,6 @@ static void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex) HTMLDocument_Persist_Init(doc); HTMLDocument_OleCmd_Init(doc); HTMLDocument_OleObj_Init(doc); - HTMLDocument_Service_Init(doc); }
static inline HTMLDocumentNode *impl_from_HTMLDOMNode(HTMLDOMNode *iface) @@ -5747,6 +5744,8 @@ static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
if(IsEqualGUID(&IID_IInternetHostSecurityManager, riid)) *ppv = &This->IInternetHostSecurityManager_iface; + else if(IsEqualGUID(&IID_IServiceProvider, riid)) + *ppv = &This->IServiceProvider_iface; else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) *ppv = &This->cp_container.IConnectionPointContainer_iface; else @@ -6136,6 +6135,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo init_doc(&doc->basedoc, (IUnknown*)&doc->node.IHTMLDOMNode_iface, &doc->node.event_target.dispex.IDispatchEx_iface); ConnectionPointContainer_Init(&doc->cp_container, (IUnknown*)&doc->basedoc.IHTMLDocument2_iface, HTMLDocumentNode_cpc); + HTMLDocumentNode_Service_Init(doc); HTMLDocumentNode_SecMgr_Init(doc);
list_init(&doc->selection_list); @@ -6254,6 +6254,8 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii *ppv = &This->IViewObjectEx_iface; }else if(IsEqualGUID(&IID_IViewObjectEx, riid)) { *ppv = &This->IViewObjectEx_iface; + }else if(IsEqualGUID(&IID_IServiceProvider, riid)) { + *ppv = &This->IServiceProvider_iface; }else if(IsEqualGUID(&IID_ITargetContainer, riid)) { *ppv = &This->ITargetContainer_iface; }else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) { @@ -6480,6 +6482,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii init_dispatch(&doc->dispex, (IUnknown*)&doc->ICustomDoc_iface, &HTMLDocumentObj_dispex, COMPAT_MODE_QUIRKS); init_doc(&doc->basedoc, outer ? outer : &doc->IUnknown_inner, &doc->dispex.IDispatchEx_iface); ConnectionPointContainer_Init(&doc->cp_container, &doc->IUnknown_inner, HTMLDocumentObj_cpc); + HTMLDocumentObj_Service_Init(doc); TargetContainer_Init(doc); doc->is_mhtml = is_mhtml;
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index cc7c11c83c5..bdfcaca729c 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3742,7 +3742,7 @@ static HRESULT WINAPI HTMLWindowSP_QueryService(IServiceProvider *iface, REFGUID if(!This->outer_window || !This->outer_window->browser) return E_NOINTERFACE;
- return IServiceProvider_QueryService(&This->outer_window->browser->doc->basedoc.IServiceProvider_iface, + return IServiceProvider_QueryService(&This->outer_window->browser->doc->IServiceProvider_iface, guidService, riid, ppv); }
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index d528c4b2999..9747417932c 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -656,7 +656,6 @@ struct HTMLDocument { IOleDocument IOleDocument_iface; IOleInPlaceActiveObject IOleInPlaceActiveObject_iface; IOleInPlaceObjectWindowless IOleInPlaceObjectWindowless_iface; - IServiceProvider IServiceProvider_iface; IOleCommandTarget IOleCommandTarget_iface; IOleControl IOleControl_iface; IHlinkTarget IHlinkTarget_iface; @@ -703,6 +702,7 @@ struct HTMLDocumentObj { ICustomDoc ICustomDoc_iface; IOleDocumentView IOleDocumentView_iface; IViewObjectEx IViewObjectEx_iface; + IServiceProvider IServiceProvider_iface; ITargetContainer ITargetContainer_iface;
IWindowForBindingUI IWindowForBindingUI_iface; @@ -896,6 +896,7 @@ struct HTMLDocumentNode { HTMLDOMNode node; HTMLDocument basedoc;
+ IServiceProvider IServiceProvider_iface; IInternetHostSecurityManager IInternetHostSecurityManager_iface;
nsIDocumentObserver nsIDocumentObserver_iface; @@ -965,11 +966,12 @@ void detach_html_storage(IHTMLStorage*) DECLSPEC_HIDDEN; void HTMLDocument_Persist_Init(HTMLDocument*) DECLSPEC_HIDDEN; void HTMLDocument_OleCmd_Init(HTMLDocument*) DECLSPEC_HIDDEN; void HTMLDocument_OleObj_Init(HTMLDocument*) DECLSPEC_HIDDEN; -void HTMLDocument_Service_Init(HTMLDocument*) DECLSPEC_HIDDEN;
void HTMLDocument_View_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN; +void HTMLDocumentObj_Service_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN; void TargetContainer_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN;
+void HTMLDocumentNode_Service_Init(HTMLDocumentNode*) DECLSPEC_HIDDEN; void HTMLDocumentNode_SecMgr_Init(HTMLDocumentNode*) DECLSPEC_HIDDEN;
HRESULT HTMLCurrentStyle_Create(HTMLElement*,IHTMLCurrentStyle**) DECLSPEC_HIDDEN; diff --git a/dlls/mshtml/service.c b/dlls/mshtml/service.c index e937432c892..8f0fa0f691f 100644 --- a/dlls/mshtml/service.c +++ b/dlls/mshtml/service.c @@ -332,33 +332,76 @@ static IHTMLEditServices *create_editsvcs(void) * IServiceProvider implementation */
-static inline HTMLDocument *impl_from_IServiceProvider(IServiceProvider *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IServiceProvider(IServiceProvider *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IServiceProvider_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IServiceProvider_iface); }
-static HRESULT WINAPI ServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv) +static HRESULT WINAPI DocNodeServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IServiceProvider(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = HTMLDocumentNode_from_IServiceProvider(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static ULONG WINAPI ServiceProvider_AddRef(IServiceProvider *iface) +static ULONG WINAPI DocNodeServiceProvider_AddRef(IServiceProvider *iface) { - HTMLDocument *This = impl_from_IServiceProvider(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IServiceProvider(iface); + return htmldoc_addref(&This->basedoc); }
-static ULONG WINAPI ServiceProvider_Release(IServiceProvider *iface) +static ULONG WINAPI DocNodeServiceProvider_Release(IServiceProvider *iface) { - HTMLDocument *This = impl_from_IServiceProvider(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IServiceProvider(iface); + return htmldoc_release(&This->basedoc); }
-static HRESULT WINAPI ServiceProvider_QueryService(IServiceProvider *iface, REFGUID guidService, +static HRESULT WINAPI DocNodeServiceProvider_QueryService(IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IServiceProvider(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IServiceProvider(iface); + + if(IsEqualGUID(&SID_SContainerDispatch, guidService)) { + TRACE("SID_SContainerDispatch\n"); + return IHTMLDocument2_QueryInterface(&This->basedoc.IHTMLDocument2_iface, riid, ppv); + } + + return IServiceProvider_QueryService(&This->basedoc.doc_obj->IServiceProvider_iface, guidService, riid, ppv); +} + +static const IServiceProviderVtbl DocNodeServiceProviderVtbl = { + DocNodeServiceProvider_QueryInterface, + DocNodeServiceProvider_AddRef, + DocNodeServiceProvider_Release, + DocNodeServiceProvider_QueryService +}; + +static inline HTMLDocumentObj *HTMLDocumentObj_from_IServiceProvider(IServiceProvider *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IServiceProvider_iface); +} + +static HRESULT WINAPI DocObjServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IServiceProvider(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); +} + +static ULONG WINAPI DocObjServiceProvider_AddRef(IServiceProvider *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IServiceProvider(iface); + return htmldoc_addref(&This->basedoc); +} + +static ULONG WINAPI DocObjServiceProvider_Release(IServiceProvider *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IServiceProvider(iface); + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI DocObjServiceProvider_QueryService(IServiceProvider *iface, REFGUID guidService, + REFIID riid, void **ppv) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IServiceProvider(iface);
if(IsEqualGUID(&CLSID_CMarkup, guidService)) { FIXME("(%p)->(CLSID_CMarkup %s %p)\n", This, debugstr_guid(riid), ppv); @@ -368,43 +411,43 @@ static HRESULT WINAPI ServiceProvider_QueryService(IServiceProvider *iface, REFG if(IsEqualGUID(&SID_SOleUndoManager, guidService)) { TRACE("SID_SOleUndoManager\n");
- if(!This->doc_obj->undomgr) - This->doc_obj->undomgr = create_undomgr(); + if(!This->undomgr) + This->undomgr = create_undomgr();
- if (!This->doc_obj->undomgr) + if (!This->undomgr) return E_OUTOFMEMORY;
- return IOleUndoManager_QueryInterface(This->doc_obj->undomgr, riid, ppv); + return IOleUndoManager_QueryInterface(This->undomgr, riid, ppv); }
if(IsEqualGUID(&SID_SContainerDispatch, guidService)) { TRACE("SID_SContainerDispatch\n"); - return IHTMLDocument2_QueryInterface(&This->IHTMLDocument2_iface, riid, ppv); + return IHTMLDocument2_QueryInterface(&This->basedoc.IHTMLDocument2_iface, riid, ppv); }
if(IsEqualGUID(&IID_IWindowForBindingUI, guidService)) { TRACE("IID_IWindowForBindingUI\n"); - return IWindowForBindingUI_QueryInterface(&This->doc_obj->IWindowForBindingUI_iface, riid, ppv); + return IWindowForBindingUI_QueryInterface(&This->IWindowForBindingUI_iface, riid, ppv); }
if(IsEqualGUID(&SID_SHTMLEditServices, guidService)) { TRACE("SID_SHTMLEditServices\n");
- if(!This->doc_obj->editsvcs) - This->doc_obj->editsvcs = create_editsvcs(); + if(!This->editsvcs) + This->editsvcs = create_editsvcs();
- if (!This->doc_obj->editsvcs) + if (!This->editsvcs) return E_OUTOFMEMORY;
- return IHTMLEditServices_QueryInterface(This->doc_obj->editsvcs, riid, ppv); + return IHTMLEditServices_QueryInterface(This->editsvcs, riid, ppv); }
TRACE("(%p)->(%s %s %p)\n", This, debugstr_guid(guidService), debugstr_guid(riid), ppv);
- if(This->doc_obj->client) { + if(This->client) { HRESULT hres;
- hres = do_query_service((IUnknown*)This->doc_obj->client, guidService, riid, ppv); + hres = do_query_service((IUnknown*)This->client, guidService, riid, ppv); if(SUCCEEDED(hres)) return hres; } @@ -413,14 +456,19 @@ static HRESULT WINAPI ServiceProvider_QueryService(IServiceProvider *iface, REFG return E_NOINTERFACE; }
-static const IServiceProviderVtbl ServiceProviderVtbl = { - ServiceProvider_QueryInterface, - ServiceProvider_AddRef, - ServiceProvider_Release, - ServiceProvider_QueryService +static const IServiceProviderVtbl DocObjServiceProviderVtbl = { + DocObjServiceProvider_QueryInterface, + DocObjServiceProvider_AddRef, + DocObjServiceProvider_Release, + DocObjServiceProvider_QueryService };
-void HTMLDocument_Service_Init(HTMLDocument *This) +void HTMLDocumentNode_Service_Init(HTMLDocumentNode *This) +{ + This->IServiceProvider_iface.lpVtbl = &DocNodeServiceProviderVtbl; +} + +void HTMLDocumentObj_Service_Init(HTMLDocumentObj *This) { - This->IServiceProvider_iface.lpVtbl = &ServiceProviderVtbl; + This->IServiceProvider_iface.lpVtbl = &DocObjServiceProviderVtbl; }
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/binding.h | 2 +- dlls/mshtml/editor.c | 2 +- dlls/mshtml/htmldoc.c | 45 +- dlls/mshtml/mshtml_private.h | 21 +- dlls/mshtml/navigate.c | 2 +- dlls/mshtml/persist.c | 928 +++++++++++++++++++++++++---------- 6 files changed, 726 insertions(+), 274 deletions(-)
diff --git a/dlls/mshtml/binding.h b/dlls/mshtml/binding.h index 5d2915a836b..2034d12d816 100644 --- a/dlls/mshtml/binding.h +++ b/dlls/mshtml/binding.h @@ -144,7 +144,7 @@ HRESULT hlink_frame_navigate(HTMLDocument*,LPCWSTR,nsChannel*,DWORD,BOOL*) DECLS HRESULT create_doc_uri(IUri*,nsWineURI**) DECLSPEC_HIDDEN; HRESULT load_nsuri(HTMLOuterWindow*,nsWineURI*,nsIInputStream*,nsChannelBSC*,DWORD) DECLSPEC_HIDDEN; HRESULT set_moniker(HTMLOuterWindow*,IMoniker*,IUri*,IBindCtx*,nsChannelBSC*,BOOL) DECLSPEC_HIDDEN; -void prepare_for_binding(HTMLDocument*,IMoniker*,DWORD) DECLSPEC_HIDDEN; +void prepare_for_binding(HTMLDocumentObj*,IMoniker*,DWORD) DECLSPEC_HIDDEN; HRESULT super_navigate(HTMLOuterWindow*,IUri*,DWORD,const WCHAR*,BYTE*,DWORD) DECLSPEC_HIDDEN; HRESULT load_uri(HTMLOuterWindow*,IUri*,DWORD) DECLSPEC_HIDDEN; HRESULT navigate_new_window(HTMLOuterWindow*,IUri*,const WCHAR*,request_data_t*,IHTMLWindow2**) DECLSPEC_HIDDEN; diff --git a/dlls/mshtml/editor.c b/dlls/mshtml/editor.c index d21616288e6..ef7ade0116c 100644 --- a/dlls/mshtml/editor.c +++ b/dlls/mshtml/editor.c @@ -1249,7 +1249,7 @@ HRESULT setup_edit_mode(HTMLDocumentObj *doc) } }
- hres = IPersistMoniker_Load(&doc->basedoc.IPersistMoniker_iface, TRUE, mon, NULL, 0); + hres = IPersistMoniker_Load(&doc->IPersistMoniker_iface, TRUE, mon, NULL, 0); IMoniker_Release(mon); if(FAILED(hres)) return hres; diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 0ccfc07ea69..f1d887e5d08 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -5613,14 +5613,6 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv) *ppv = &This->IDocumentSelector_iface; else if(IsEqualGUID(&IID_IDocumentEvent, riid)) *ppv = &This->IDocumentEvent_iface; - else if(IsEqualGUID(&IID_IPersist, riid)) - *ppv = &This->IPersistFile_iface; - else if(IsEqualGUID(&IID_IPersistMoniker, riid)) - *ppv = &This->IPersistMoniker_iface; - else if(IsEqualGUID(&IID_IPersistFile, riid)) - *ppv = &This->IPersistFile_iface; - else if(IsEqualGUID(&IID_IMonikerProp, riid)) - *ppv = &This->IMonikerProp_iface; else if(IsEqualGUID(&IID_IOleObject, riid)) *ppv = &This->IOleObject_iface; else if(IsEqualGUID(&IID_IOleDocument, riid)) @@ -5637,16 +5629,10 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv) *ppv = &This->IOleCommandTarget_iface; else if(IsEqualGUID(&IID_IOleControl, riid)) *ppv = &This->IOleControl_iface; - else if(IsEqualGUID(&IID_IHlinkTarget, riid)) - *ppv = &This->IHlinkTarget_iface; - else if(IsEqualGUID(&IID_IPersistStreamInit, riid)) - *ppv = &This->IPersistStreamInit_iface; else if(IsEqualGUID(&DIID_DispHTMLDocument, riid)) *ppv = &This->IHTMLDocument2_iface; else if(IsEqualGUID(&IID_ISupportErrorInfo, riid)) *ppv = &This->ISupportErrorInfo_iface; - else if(IsEqualGUID(&IID_IPersistHistory, riid)) - *ppv = &This->IPersistHistory_iface; else if(IsEqualGUID(&IID_IObjectWithSite, riid)) *ppv = &This->IObjectWithSite_iface; else if(IsEqualGUID(&IID_IOleContainer, riid)) @@ -5723,7 +5709,6 @@ static void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex) doc->outer_unk = outer; doc->dispex = dispex;
- HTMLDocument_Persist_Init(doc); HTMLDocument_OleCmd_Init(doc); HTMLDocument_OleObj_Init(doc); } @@ -5744,6 +5729,20 @@ static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
if(IsEqualGUID(&IID_IInternetHostSecurityManager, riid)) *ppv = &This->IInternetHostSecurityManager_iface; + else if(IsEqualGUID(&IID_IPersist, riid)) + *ppv = &This->IPersistFile_iface; + else if(IsEqualGUID(&IID_IPersistMoniker, riid)) + *ppv = &This->IPersistMoniker_iface; + else if(IsEqualGUID(&IID_IPersistFile, riid)) + *ppv = &This->IPersistFile_iface; + else if(IsEqualGUID(&IID_IMonikerProp, riid)) + *ppv = &This->IMonikerProp_iface; + else if(IsEqualGUID(&IID_IPersistStreamInit, riid)) + *ppv = &This->IPersistStreamInit_iface; + else if(IsEqualGUID(&IID_IPersistHistory, riid)) + *ppv = &This->IPersistHistory_iface; + else if(IsEqualGUID(&IID_IHlinkTarget, riid)) + *ppv = &This->IHlinkTarget_iface; else if(IsEqualGUID(&IID_IServiceProvider, riid)) *ppv = &This->IServiceProvider_iface; else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) @@ -6135,6 +6134,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo init_doc(&doc->basedoc, (IUnknown*)&doc->node.IHTMLDOMNode_iface, &doc->node.event_target.dispex.IDispatchEx_iface); ConnectionPointContainer_Init(&doc->cp_container, (IUnknown*)&doc->basedoc.IHTMLDocument2_iface, HTMLDocumentNode_cpc); + HTMLDocumentNode_Persist_Init(doc); HTMLDocumentNode_Service_Init(doc); HTMLDocumentNode_SecMgr_Init(doc);
@@ -6254,6 +6254,20 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii *ppv = &This->IViewObjectEx_iface; }else if(IsEqualGUID(&IID_IViewObjectEx, riid)) { *ppv = &This->IViewObjectEx_iface; + }else if(IsEqualGUID(&IID_IPersist, riid)) { + *ppv = &This->IPersistFile_iface; + }else if(IsEqualGUID(&IID_IPersistMoniker, riid)) { + *ppv = &This->IPersistMoniker_iface; + }else if(IsEqualGUID(&IID_IPersistFile, riid)) { + *ppv = &This->IPersistFile_iface; + }else if(IsEqualGUID(&IID_IMonikerProp, riid)) { + *ppv = &This->IMonikerProp_iface; + }else if(IsEqualGUID(&IID_IPersistStreamInit, riid)) { + *ppv = &This->IPersistStreamInit_iface; + }else if(IsEqualGUID(&IID_IPersistHistory, riid)) { + *ppv = &This->IPersistHistory_iface; + }else if(IsEqualGUID(&IID_IHlinkTarget, riid)) { + *ppv = &This->IHlinkTarget_iface; }else if(IsEqualGUID(&IID_IServiceProvider, riid)) { *ppv = &This->IServiceProvider_iface; }else if(IsEqualGUID(&IID_ITargetContainer, riid)) { @@ -6482,6 +6496,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii init_dispatch(&doc->dispex, (IUnknown*)&doc->ICustomDoc_iface, &HTMLDocumentObj_dispex, COMPAT_MODE_QUIRKS); init_doc(&doc->basedoc, outer ? outer : &doc->IUnknown_inner, &doc->dispex.IDispatchEx_iface); ConnectionPointContainer_Init(&doc->cp_container, &doc->IUnknown_inner, HTMLDocumentObj_cpc); + HTMLDocumentObj_Persist_Init(doc); HTMLDocumentObj_Service_Init(doc); TargetContainer_Init(doc); doc->is_mhtml = is_mhtml; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 9747417932c..39bd7b72493 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -648,18 +648,12 @@ struct HTMLDocument { IHTMLDocument7 IHTMLDocument7_iface; IDocumentSelector IDocumentSelector_iface; IDocumentEvent IDocumentEvent_iface; - IPersistMoniker IPersistMoniker_iface; - IPersistFile IPersistFile_iface; - IPersistHistory IPersistHistory_iface; - IMonikerProp IMonikerProp_iface; IOleObject IOleObject_iface; IOleDocument IOleDocument_iface; IOleInPlaceActiveObject IOleInPlaceActiveObject_iface; IOleInPlaceObjectWindowless IOleInPlaceObjectWindowless_iface; IOleCommandTarget IOleCommandTarget_iface; IOleControl IOleControl_iface; - IHlinkTarget IHlinkTarget_iface; - IPersistStreamInit IPersistStreamInit_iface; IDispatchEx IDispatchEx_iface; ISupportErrorInfo ISupportErrorInfo_iface; IObjectWithSite IObjectWithSite_iface; @@ -702,6 +696,12 @@ struct HTMLDocumentObj { ICustomDoc ICustomDoc_iface; IOleDocumentView IOleDocumentView_iface; IViewObjectEx IViewObjectEx_iface; + IPersistMoniker IPersistMoniker_iface; + IPersistFile IPersistFile_iface; + IMonikerProp IMonikerProp_iface; + IPersistStreamInit IPersistStreamInit_iface; + IPersistHistory IPersistHistory_iface; + IHlinkTarget IHlinkTarget_iface; IServiceProvider IServiceProvider_iface; ITargetContainer ITargetContainer_iface;
@@ -896,6 +896,12 @@ struct HTMLDocumentNode { HTMLDOMNode node; HTMLDocument basedoc;
+ IPersistMoniker IPersistMoniker_iface; + IPersistFile IPersistFile_iface; + IMonikerProp IMonikerProp_iface; + IPersistStreamInit IPersistStreamInit_iface; + IPersistHistory IPersistHistory_iface; + IHlinkTarget IHlinkTarget_iface; IServiceProvider IServiceProvider_iface; IInternetHostSecurityManager IInternetHostSecurityManager_iface;
@@ -963,14 +969,15 @@ void detach_dom_implementation(IHTMLDOMImplementation*) DECLSPEC_HIDDEN; HRESULT create_html_storage(HTMLInnerWindow*,BOOL,IHTMLStorage**) DECLSPEC_HIDDEN; void detach_html_storage(IHTMLStorage*) DECLSPEC_HIDDEN;
-void HTMLDocument_Persist_Init(HTMLDocument*) DECLSPEC_HIDDEN; void HTMLDocument_OleCmd_Init(HTMLDocument*) DECLSPEC_HIDDEN; void HTMLDocument_OleObj_Init(HTMLDocument*) DECLSPEC_HIDDEN;
void HTMLDocument_View_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN; +void HTMLDocumentObj_Persist_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN; void HTMLDocumentObj_Service_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN; void TargetContainer_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN;
+void HTMLDocumentNode_Persist_Init(HTMLDocumentNode*) DECLSPEC_HIDDEN; void HTMLDocumentNode_Service_Init(HTMLDocumentNode*) DECLSPEC_HIDDEN; void HTMLDocumentNode_SecMgr_Init(HTMLDocumentNode*) DECLSPEC_HIDDEN;
diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c index 7b46065b9a1..5d7e4d38b77 100644 --- a/dlls/mshtml/navigate.c +++ b/dlls/mshtml/navigate.c @@ -2236,7 +2236,7 @@ HRESULT super_navigate(HTMLOuterWindow *window, IUri *uri, DWORD flags, const WC return hres; }
- prepare_for_binding(&window->browser->doc->basedoc, mon, flags); + prepare_for_binding(window->browser->doc, mon, flags);
hres = IUri_GetScheme(uri, &scheme); if(hres == S_OK && scheme == URL_SCHEME_JAVASCRIPT) { diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index df88a093f5b..691c9e6e17d 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c @@ -278,14 +278,14 @@ static void set_downloading_task_destr(task_t *_task) heap_free(task); }
-void prepare_for_binding(HTMLDocument *This, IMoniker *mon, DWORD flags) +void prepare_for_binding(HTMLDocumentObj *This, IMoniker *mon, DWORD flags) { HRESULT hres;
- if(This->doc_obj->client) { + if(This->client) { VARIANT silent, offline;
- hres = get_client_disp_property(This->doc_obj->client, DISPID_AMBIENT_SILENT, &silent); + hres = get_client_disp_property(This->client, DISPID_AMBIENT_SILENT, &silent); if(SUCCEEDED(hres)) { if(V_VT(&silent) != VT_BOOL) WARN("silent = %s\n", debugstr_variant(&silent)); @@ -293,8 +293,7 @@ void prepare_for_binding(HTMLDocument *This, IMoniker *mon, DWORD flags) FIXME("silent == true\n"); }
- hres = get_client_disp_property(This->doc_obj->client, - DISPID_AMBIENT_OFFLINEIFNOTCONNECTED, &offline); + hres = get_client_disp_property(This->client, DISPID_AMBIENT_OFFLINEIFNOTCONNECTED, &offline); if(SUCCEEDED(hres)) { if(V_VT(&offline) != VT_BOOL) WARN("offline = %s\n", debugstr_variant(&offline)); @@ -303,24 +302,23 @@ void prepare_for_binding(HTMLDocument *This, IMoniker *mon, DWORD flags) } }
- if(This->window->mon) { - update_doc(This->doc_obj, UPDATE_TITLE|UPDATE_UI); + if(This->basedoc.window->mon) { + update_doc(This, UPDATE_TITLE|UPDATE_UI); }else { - update_doc(This->doc_obj, UPDATE_TITLE); - set_current_mon(This->window, mon, flags); + update_doc(This, UPDATE_TITLE); + set_current_mon(This->basedoc.window, mon, flags); }
- if(This->doc_obj->client) { + if(This->client) { IOleCommandTarget *cmdtrg = NULL;
- hres = IOleClientSite_QueryInterface(This->doc_obj->client, &IID_IOleCommandTarget, - (void**)&cmdtrg); + hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget, (void**)&cmdtrg); if(SUCCEEDED(hres)) { VARIANT var, out;
if(flags & BINDING_NAVIGATED) { V_VT(&var) = VT_UNKNOWN; - V_UNKNOWN(&var) = (IUnknown*)&This->window->base.IHTMLWindow2_iface; + V_UNKNOWN(&var) = (IUnknown*)&This->basedoc.window->base.IHTMLWindow2_iface; V_VT(&out) = VT_EMPTY; hres = IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 63, 0, &var, &out); if(SUCCEEDED(hres)) @@ -541,48 +539,126 @@ static HRESULT get_doc_string(HTMLDocumentNode *This, char **str) * IPersistMoniker implementation */
-static inline HTMLDocument *impl_from_IPersistMoniker(IPersistMoniker *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IPersistMoniker(IPersistMoniker *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IPersistMoniker_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IPersistMoniker_iface); }
-static HRESULT WINAPI PersistMoniker_QueryInterface(IPersistMoniker *iface, REFIID riid, void **ppv) +static HRESULT WINAPI DocNodePersistMoniker_QueryInterface(IPersistMoniker *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IPersistMoniker(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistMoniker(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static ULONG WINAPI PersistMoniker_AddRef(IPersistMoniker *iface) +static ULONG WINAPI DocNodePersistMoniker_AddRef(IPersistMoniker *iface) { - HTMLDocument *This = impl_from_IPersistMoniker(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistMoniker(iface); + return htmldoc_addref(&This->basedoc); }
-static ULONG WINAPI PersistMoniker_Release(IPersistMoniker *iface) +static ULONG WINAPI DocNodePersistMoniker_Release(IPersistMoniker *iface) { - HTMLDocument *This = impl_from_IPersistMoniker(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistMoniker(iface); + return htmldoc_release(&This->basedoc); }
-static HRESULT WINAPI PersistMoniker_GetClassID(IPersistMoniker *iface, CLSID *pClassID) +static HRESULT WINAPI DocNodePersistMoniker_GetClassID(IPersistMoniker *iface, CLSID *pClassID) { - HTMLDocument *This = impl_from_IPersistMoniker(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistMoniker(iface); return IPersistFile_GetClassID(&This->IPersistFile_iface, pClassID); }
-static HRESULT WINAPI PersistMoniker_IsDirty(IPersistMoniker *iface) +static HRESULT WINAPI DocNodePersistMoniker_IsDirty(IPersistMoniker *iface) { - HTMLDocument *This = impl_from_IPersistMoniker(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistMoniker(iface);
TRACE("(%p)\n", This);
return IPersistStreamInit_IsDirty(&This->IPersistStreamInit_iface); }
-static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAvailable, +static HRESULT WINAPI DocNodePersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAvailable, IMoniker *pimkName, LPBC pibc, DWORD grfMode) { - HTMLDocument *This = impl_from_IPersistMoniker(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistMoniker(iface); + return IPersistMoniker_Load(&This->basedoc.doc_obj->IPersistMoniker_iface, fFullyAvailable, pimkName, pibc, grfMode); +} + +static HRESULT WINAPI DocNodePersistMoniker_Save(IPersistMoniker *iface, IMoniker *pimkName, + LPBC pbc, BOOL fRemember) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistMoniker(iface); + FIXME("(%p)->(%p %p %x)\n", This, pimkName, pbc, fRemember); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodePersistMoniker_SaveCompleted(IPersistMoniker *iface, IMoniker *pimkName, LPBC pibc) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistMoniker(iface); + FIXME("(%p)->(%p %p)\n", This, pimkName, pibc); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodePersistMoniker_GetCurMoniker(IPersistMoniker *iface, IMoniker **ppimkName) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistMoniker(iface); + return IPersistMoniker_GetCurMoniker(&This->basedoc.doc_obj->IPersistMoniker_iface, ppimkName); +} + +static const IPersistMonikerVtbl DocNodePersistMonikerVtbl = { + DocNodePersistMoniker_QueryInterface, + DocNodePersistMoniker_AddRef, + DocNodePersistMoniker_Release, + DocNodePersistMoniker_GetClassID, + DocNodePersistMoniker_IsDirty, + DocNodePersistMoniker_Load, + DocNodePersistMoniker_Save, + DocNodePersistMoniker_SaveCompleted, + DocNodePersistMoniker_GetCurMoniker +}; + +static inline HTMLDocumentObj *HTMLDocumentObj_from_IPersistMoniker(IPersistMoniker *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IPersistMoniker_iface); +} + +static HRESULT WINAPI DocObjPersistMoniker_QueryInterface(IPersistMoniker *iface, REFIID riid, void **ppv) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistMoniker(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); +} + +static ULONG WINAPI DocObjPersistMoniker_AddRef(IPersistMoniker *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistMoniker(iface); + return htmldoc_addref(&This->basedoc); +} + +static ULONG WINAPI DocObjPersistMoniker_Release(IPersistMoniker *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistMoniker(iface); + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI DocObjPersistMoniker_GetClassID(IPersistMoniker *iface, CLSID *pClassID) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistMoniker(iface); + return IPersistFile_GetClassID(&This->IPersistFile_iface, pClassID); +} + +static HRESULT WINAPI DocObjPersistMoniker_IsDirty(IPersistMoniker *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistMoniker(iface); + + TRACE("(%p)\n", This); + + return IPersistStreamInit_IsDirty(&This->IPersistStreamInit_iface); +} + +static HRESULT WINAPI DocObjPersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAvailable, + IMoniker *pimkName, LPBC pibc, DWORD grfMode) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistMoniker(iface); IMoniker *mon; HRESULT hres;
@@ -609,7 +685,7 @@ static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAva hres = IUnknown_QueryInterface(unk, &IID_IOleClientSite, (void**)&client); if(SUCCEEDED(hres)) { TRACE("Got client site %p\n", client); - IOleObject_SetClientSite(&This->IOleObject_iface, client); + IOleObject_SetClientSite(&This->basedoc.IOleObject_iface, client); IOleClientSite_Release(client); }
@@ -617,7 +693,7 @@ static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAva } }
- if(This->doc_obj->is_mhtml) { + if(This->is_mhtml) { IUnknown *unk;
hres = MimeOleObjectFromMoniker(0, pimkName, pibc, &IID_IUnknown, (void**)&unk, &mon); @@ -630,93 +706,129 @@ static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAva }
prepare_for_binding(This, mon, FALSE); - call_docview_84(This->doc_obj); - hres = set_moniker(This->window, mon, NULL, pibc, NULL, TRUE); + call_docview_84(This); + hres = set_moniker(This->basedoc.window, mon, NULL, pibc, NULL, TRUE); IMoniker_Release(mon); if(FAILED(hres)) return hres;
- return start_binding(This->window->pending_window, (BSCallback*)This->window->pending_window->bscallback, pibc); + return start_binding(This->basedoc.window->pending_window, (BSCallback*)This->basedoc.window->pending_window->bscallback, pibc); }
-static HRESULT WINAPI PersistMoniker_Save(IPersistMoniker *iface, IMoniker *pimkName, +static HRESULT WINAPI DocObjPersistMoniker_Save(IPersistMoniker *iface, IMoniker *pimkName, LPBC pbc, BOOL fRemember) { - HTMLDocument *This = impl_from_IPersistMoniker(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistMoniker(iface); FIXME("(%p)->(%p %p %x)\n", This, pimkName, pbc, fRemember); return E_NOTIMPL; }
-static HRESULT WINAPI PersistMoniker_SaveCompleted(IPersistMoniker *iface, IMoniker *pimkName, LPBC pibc) +static HRESULT WINAPI DocObjPersistMoniker_SaveCompleted(IPersistMoniker *iface, IMoniker *pimkName, LPBC pibc) { - HTMLDocument *This = impl_from_IPersistMoniker(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistMoniker(iface); FIXME("(%p)->(%p %p)\n", This, pimkName, pibc); return E_NOTIMPL; }
-static HRESULT WINAPI PersistMoniker_GetCurMoniker(IPersistMoniker *iface, IMoniker **ppimkName) +static HRESULT WINAPI DocObjPersistMoniker_GetCurMoniker(IPersistMoniker *iface, IMoniker **ppimkName) { - HTMLDocument *This = impl_from_IPersistMoniker(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistMoniker(iface);
TRACE("(%p)->(%p)\n", This, ppimkName);
- if(!This->window || !This->window->mon) + if(!This->basedoc.window || !This->basedoc.window->mon) return E_UNEXPECTED;
- IMoniker_AddRef(This->window->mon); - *ppimkName = This->window->mon; + IMoniker_AddRef(This->basedoc.window->mon); + *ppimkName = This->basedoc.window->mon; return S_OK; }
-static const IPersistMonikerVtbl PersistMonikerVtbl = { - PersistMoniker_QueryInterface, - PersistMoniker_AddRef, - PersistMoniker_Release, - PersistMoniker_GetClassID, - PersistMoniker_IsDirty, - PersistMoniker_Load, - PersistMoniker_Save, - PersistMoniker_SaveCompleted, - PersistMoniker_GetCurMoniker +static const IPersistMonikerVtbl DocObjPersistMonikerVtbl = { + DocObjPersistMoniker_QueryInterface, + DocObjPersistMoniker_AddRef, + DocObjPersistMoniker_Release, + DocObjPersistMoniker_GetClassID, + DocObjPersistMoniker_IsDirty, + DocObjPersistMoniker_Load, + DocObjPersistMoniker_Save, + DocObjPersistMoniker_SaveCompleted, + DocObjPersistMoniker_GetCurMoniker };
/********************************************************** * IMonikerProp implementation */
-static inline HTMLDocument *impl_from_IMonikerProp(IMonikerProp *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IMonikerProp(IMonikerProp *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentNode, IMonikerProp_iface); +} + +static HRESULT WINAPI DocNodeMonikerProp_QueryInterface(IMonikerProp *iface, REFIID riid, void **ppv) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMonikerProp(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); +} + +static ULONG WINAPI DocNodeMonikerProp_AddRef(IMonikerProp *iface) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMonikerProp(iface); + return htmldoc_addref(&This->basedoc); +} + +static ULONG WINAPI DocNodeMonikerProp_Release(IMonikerProp *iface) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMonikerProp(iface); + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI DocNodeMonikerProp_PutProperty(IMonikerProp *iface, MONIKERPROPERTY mkp, LPCWSTR val) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMonikerProp(iface); + return IMonikerProp_PutProperty(&This->basedoc.doc_obj->IMonikerProp_iface, mkp, val); +} + +static const IMonikerPropVtbl DocNodeMonikerPropVtbl = { + DocNodeMonikerProp_QueryInterface, + DocNodeMonikerProp_AddRef, + DocNodeMonikerProp_Release, + DocNodeMonikerProp_PutProperty +}; + +static inline HTMLDocumentObj *HTMLDocumentObj_from_IMonikerProp(IMonikerProp *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IMonikerProp_iface); + return CONTAINING_RECORD(iface, HTMLDocumentObj, IMonikerProp_iface); }
-static HRESULT WINAPI MonikerProp_QueryInterface(IMonikerProp *iface, REFIID riid, void **ppv) +static HRESULT WINAPI DocObjMonikerProp_QueryInterface(IMonikerProp *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IMonikerProp(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMonikerProp(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static ULONG WINAPI MonikerProp_AddRef(IMonikerProp *iface) +static ULONG WINAPI DocObjMonikerProp_AddRef(IMonikerProp *iface) { - HTMLDocument *This = impl_from_IMonikerProp(iface); - return htmldoc_addref(This); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMonikerProp(iface); + return htmldoc_addref(&This->basedoc); }
-static ULONG WINAPI MonikerProp_Release(IMonikerProp *iface) +static ULONG WINAPI DocObjMonikerProp_Release(IMonikerProp *iface) { - HTMLDocument *This = impl_from_IMonikerProp(iface); - return htmldoc_release(This); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMonikerProp(iface); + return htmldoc_release(&This->basedoc); }
-static HRESULT WINAPI MonikerProp_PutProperty(IMonikerProp *iface, MONIKERPROPERTY mkp, LPCWSTR val) +static HRESULT WINAPI DocObjMonikerProp_PutProperty(IMonikerProp *iface, MONIKERPROPERTY mkp, LPCWSTR val) { - HTMLDocument *This = impl_from_IMonikerProp(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMonikerProp(iface);
TRACE("(%p)->(%d %s)\n", This, mkp, debugstr_w(val));
switch(mkp) { case MIMETYPEPROP: - heap_free(This->doc_obj->mime); - This->doc_obj->mime = heap_strdupW(val); + heap_free(This->mime); + This->mime = heap_strdupW(val); break;
case CLASSIDPROP: @@ -730,72 +842,65 @@ static HRESULT WINAPI MonikerProp_PutProperty(IMonikerProp *iface, MONIKERPROPER return S_OK; }
-static const IMonikerPropVtbl MonikerPropVtbl = { - MonikerProp_QueryInterface, - MonikerProp_AddRef, - MonikerProp_Release, - MonikerProp_PutProperty +static const IMonikerPropVtbl DocObjMonikerPropVtbl = { + DocObjMonikerProp_QueryInterface, + DocObjMonikerProp_AddRef, + DocObjMonikerProp_Release, + DocObjMonikerProp_PutProperty };
/********************************************************** * IPersistFile implementation */
-static inline HTMLDocument *impl_from_IPersistFile(IPersistFile *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IPersistFile(IPersistFile *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IPersistFile_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IPersistFile_iface); }
-static HRESULT WINAPI PersistFile_QueryInterface(IPersistFile *iface, REFIID riid, void **ppv) +static HRESULT WINAPI DocNodePersistFile_QueryInterface(IPersistFile *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IPersistFile(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistFile(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static ULONG WINAPI PersistFile_AddRef(IPersistFile *iface) +static ULONG WINAPI DocNodePersistFile_AddRef(IPersistFile *iface) { - HTMLDocument *This = impl_from_IPersistFile(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistFile(iface); + return htmldoc_addref(&This->basedoc); }
-static ULONG WINAPI PersistFile_Release(IPersistFile *iface) +static ULONG WINAPI DocNodePersistFile_Release(IPersistFile *iface) { - HTMLDocument *This = impl_from_IPersistFile(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistFile(iface); + return htmldoc_release(&This->basedoc); }
-static HRESULT WINAPI PersistFile_GetClassID(IPersistFile *iface, CLSID *pClassID) +static HRESULT WINAPI DocNodePersistFile_GetClassID(IPersistFile *iface, CLSID *pClassID) { - HTMLDocument *This = impl_from_IPersistFile(iface); - - TRACE("(%p)->(%p)\n", This, pClassID); - - if(!pClassID) - return E_INVALIDARG; - - *pClassID = CLSID_HTMLDocument; - return S_OK; + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistFile(iface); + return IPersistFile_GetClassID(&This->basedoc.doc_obj->IPersistFile_iface, pClassID); }
-static HRESULT WINAPI PersistFile_IsDirty(IPersistFile *iface) +static HRESULT WINAPI DocNodePersistFile_IsDirty(IPersistFile *iface) { - HTMLDocument *This = impl_from_IPersistFile(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistFile(iface);
TRACE("(%p)\n", This);
return IPersistStreamInit_IsDirty(&This->IPersistStreamInit_iface); }
-static HRESULT WINAPI PersistFile_Load(IPersistFile *iface, LPCOLESTR pszFileName, DWORD dwMode) +static HRESULT WINAPI DocNodePersistFile_Load(IPersistFile *iface, LPCOLESTR pszFileName, DWORD dwMode) { - HTMLDocument *This = impl_from_IPersistFile(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistFile(iface); FIXME("(%p)->(%s %08lx)\n", This, debugstr_w(pszFileName), dwMode); return E_NOTIMPL; }
-static HRESULT WINAPI PersistFile_Save(IPersistFile *iface, LPCOLESTR pszFileName, BOOL fRemember) +static HRESULT WINAPI DocNodePersistFile_Save(IPersistFile *iface, LPCOLESTR pszFileName, BOOL fRemember) { - HTMLDocument *This = impl_from_IPersistFile(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistFile(iface); char *str; DWORD written=0; HANDLE file; @@ -810,7 +915,7 @@ static HRESULT WINAPI PersistFile_Save(IPersistFile *iface, LPCOLESTR pszFileNam return E_FAIL; }
- hres = get_doc_string(This->doc_node, &str); + hres = get_doc_string(This, &str); if(SUCCEEDED(hres)) WriteFile(file, str, strlen(str), &written, NULL);
@@ -818,105 +923,174 @@ static HRESULT WINAPI PersistFile_Save(IPersistFile *iface, LPCOLESTR pszFileNam return hres; }
-static HRESULT WINAPI PersistFile_SaveCompleted(IPersistFile *iface, LPCOLESTR pszFileName) +static HRESULT WINAPI DocNodePersistFile_SaveCompleted(IPersistFile *iface, LPCOLESTR pszFileName) { - HTMLDocument *This = impl_from_IPersistFile(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistFile(iface); FIXME("(%p)->(%s)\n", This, debugstr_w(pszFileName)); return E_NOTIMPL; }
-static HRESULT WINAPI PersistFile_GetCurFile(IPersistFile *iface, LPOLESTR *pszFileName) +static HRESULT WINAPI DocNodePersistFile_GetCurFile(IPersistFile *iface, LPOLESTR *pszFileName) { - HTMLDocument *This = impl_from_IPersistFile(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistFile(iface); FIXME("(%p)->(%p)\n", This, pszFileName); return E_NOTIMPL; }
-static const IPersistFileVtbl PersistFileVtbl = { - PersistFile_QueryInterface, - PersistFile_AddRef, - PersistFile_Release, - PersistFile_GetClassID, - PersistFile_IsDirty, - PersistFile_Load, - PersistFile_Save, - PersistFile_SaveCompleted, - PersistFile_GetCurFile +static const IPersistFileVtbl DocNodePersistFileVtbl = { + DocNodePersistFile_QueryInterface, + DocNodePersistFile_AddRef, + DocNodePersistFile_Release, + DocNodePersistFile_GetClassID, + DocNodePersistFile_IsDirty, + DocNodePersistFile_Load, + DocNodePersistFile_Save, + DocNodePersistFile_SaveCompleted, + DocNodePersistFile_GetCurFile };
-static inline HTMLDocument *impl_from_IPersistStreamInit(IPersistStreamInit *iface) +static inline HTMLDocumentObj *HTMLDocumentObj_from_IPersistFile(IPersistFile *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IPersistStreamInit_iface); + return CONTAINING_RECORD(iface, HTMLDocumentObj, IPersistFile_iface); }
-static HRESULT WINAPI PersistStreamInit_QueryInterface(IPersistStreamInit *iface, - REFIID riid, void **ppv) +static HRESULT WINAPI DocObjPersistFile_QueryInterface(IPersistFile *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IPersistStreamInit(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistFile(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static ULONG WINAPI PersistStreamInit_AddRef(IPersistStreamInit *iface) +static ULONG WINAPI DocObjPersistFile_AddRef(IPersistFile *iface) { - HTMLDocument *This = impl_from_IPersistStreamInit(iface); - return htmldoc_addref(This); + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistFile(iface); + return htmldoc_addref(&This->basedoc); }
-static ULONG WINAPI PersistStreamInit_Release(IPersistStreamInit *iface) +static ULONG WINAPI DocObjPersistFile_Release(IPersistFile *iface) { - HTMLDocument *This = impl_from_IPersistStreamInit(iface); - return htmldoc_release(This); + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistFile(iface); + return htmldoc_release(&This->basedoc); }
-static HRESULT WINAPI PersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *pClassID) +static HRESULT WINAPI DocObjPersistFile_GetClassID(IPersistFile *iface, CLSID *pClassID) { - HTMLDocument *This = impl_from_IPersistStreamInit(iface); - return IPersistFile_GetClassID(&This->IPersistFile_iface, pClassID); + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistFile(iface); + + TRACE("(%p)->(%p)\n", This, pClassID); + + if(!pClassID) + return E_INVALIDARG; + + *pClassID = CLSID_HTMLDocument; + return S_OK; }
-static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface) +static HRESULT WINAPI DocObjPersistFile_IsDirty(IPersistFile *iface) { - HTMLDocument *This = impl_from_IPersistStreamInit(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistFile(iface);
TRACE("(%p)\n", This);
- return browser_is_dirty(This->doc_obj->nscontainer); + return IPersistStreamInit_IsDirty(&This->IPersistStreamInit_iface); }
-static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, IStream *pStm) +static HRESULT WINAPI DocObjPersistFile_Load(IPersistFile *iface, LPCOLESTR pszFileName, DWORD dwMode) { - HTMLDocument *This = impl_from_IPersistStreamInit(iface); - IMoniker *mon; - HRESULT hres; + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistFile(iface); + FIXME("(%p)->(%s %08lx)\n", This, debugstr_w(pszFileName), dwMode); + return E_NOTIMPL; +}
- TRACE("(%p)->(%p)\n", This, pStm); +static HRESULT WINAPI DocObjPersistFile_Save(IPersistFile *iface, LPCOLESTR pszFileName, BOOL fRemember) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistFile(iface);
- hres = CreateURLMoniker(NULL, L"about:blank", &mon); - if(FAILED(hres)) { - WARN("CreateURLMoniker failed: %08lx\n", hres); - return hres; + if(!This->basedoc.doc_node) { + FIXME("No doc_node\n"); + return E_UNEXPECTED; } + return IPersistFile_Save(&This->basedoc.doc_node->IPersistFile_iface, pszFileName, fRemember); +}
- prepare_for_binding(This, mon, FALSE); - hres = set_moniker(This->window, mon, NULL, NULL, NULL, TRUE); - if(SUCCEEDED(hres)) - hres = channelbsc_load_stream(This->window->pending_window, mon, pStm); +static HRESULT WINAPI DocObjPersistFile_SaveCompleted(IPersistFile *iface, LPCOLESTR pszFileName) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistFile(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(pszFileName)); + return E_NOTIMPL; +}
- IMoniker_Release(mon); - return hres; +static HRESULT WINAPI DocObjPersistFile_GetCurFile(IPersistFile *iface, LPOLESTR *pszFileName) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistFile(iface); + FIXME("(%p)->(%p)\n", This, pszFileName); + return E_NOTIMPL; }
-static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, IStream *pStm, - BOOL fClearDirty) +static const IPersistFileVtbl DocObjPersistFileVtbl = { + DocObjPersistFile_QueryInterface, + DocObjPersistFile_AddRef, + DocObjPersistFile_Release, + DocObjPersistFile_GetClassID, + DocObjPersistFile_IsDirty, + DocObjPersistFile_Load, + DocObjPersistFile_Save, + DocObjPersistFile_SaveCompleted, + DocObjPersistFile_GetCurFile +}; + +static inline HTMLDocumentNode *HTMLDocumentNode_from_IPersistStreamInit(IPersistStreamInit *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentNode, IPersistStreamInit_iface); +} + +static HRESULT WINAPI DocNodePersistStreamInit_QueryInterface(IPersistStreamInit *iface, + REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IPersistStreamInit(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistStreamInit(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); +} + +static ULONG WINAPI DocNodePersistStreamInit_AddRef(IPersistStreamInit *iface) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistStreamInit(iface); + return htmldoc_addref(&This->basedoc); +} + +static ULONG WINAPI DocNodePersistStreamInit_Release(IPersistStreamInit *iface) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistStreamInit(iface); + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI DocNodePersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *pClassID) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistStreamInit(iface); + return IPersistFile_GetClassID(&This->IPersistFile_iface, pClassID); +} + +static HRESULT WINAPI DocNodePersistStreamInit_IsDirty(IPersistStreamInit *iface) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistStreamInit(iface); + return IPersistStreamInit_IsDirty(&This->basedoc.doc_obj->IPersistStreamInit_iface); +} + +static HRESULT WINAPI DocNodePersistStreamInit_Load(IPersistStreamInit *iface, IStream *pStm) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistStreamInit(iface); + return IPersistStreamInit_Load(&This->basedoc.doc_obj->IPersistStreamInit_iface, pStm); +} + +static HRESULT WINAPI DocNodePersistStreamInit_Save(IPersistStreamInit *iface, IStream *pStm, + BOOL fClearDirty) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistStreamInit(iface); char *str; DWORD written=0; HRESULT hres;
TRACE("(%p)->(%p %x)\n", This, pStm, fClearDirty);
- hres = get_doc_string(This->doc_node, &str); + hres = get_doc_string(This, &str); if(FAILED(hres)) return hres;
@@ -927,22 +1101,122 @@ static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, IStream heap_free(str);
if(fClearDirty) - set_dirty(This->doc_obj->nscontainer, VARIANT_FALSE); + set_dirty(This->basedoc.doc_obj->nscontainer, VARIANT_FALSE);
return S_OK; }
-static HRESULT WINAPI PersistStreamInit_GetSizeMax(IPersistStreamInit *iface, - ULARGE_INTEGER *pcbSize) +static HRESULT WINAPI DocNodePersistStreamInit_GetSizeMax(IPersistStreamInit *iface, + ULARGE_INTEGER *pcbSize) { - HTMLDocument *This = impl_from_IPersistStreamInit(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistStreamInit(iface); FIXME("(%p)->(%p)\n", This, pcbSize); return E_NOTIMPL; }
-static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface) +static HRESULT WINAPI DocNodePersistStreamInit_InitNew(IPersistStreamInit *iface) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistStreamInit(iface); + return IPersistStreamInit_InitNew(&This->basedoc.doc_obj->IPersistStreamInit_iface); +} + +static const IPersistStreamInitVtbl DocNodePersistStreamInitVtbl = { + DocNodePersistStreamInit_QueryInterface, + DocNodePersistStreamInit_AddRef, + DocNodePersistStreamInit_Release, + DocNodePersistStreamInit_GetClassID, + DocNodePersistStreamInit_IsDirty, + DocNodePersistStreamInit_Load, + DocNodePersistStreamInit_Save, + DocNodePersistStreamInit_GetSizeMax, + DocNodePersistStreamInit_InitNew +}; + +static inline HTMLDocumentObj *HTMLDocumentObj_from_IPersistStreamInit(IPersistStreamInit *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IPersistStreamInit_iface); +} + +static HRESULT WINAPI DocObjPersistStreamInit_QueryInterface(IPersistStreamInit *iface, + REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IPersistStreamInit(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistStreamInit(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); +} + +static ULONG WINAPI DocObjPersistStreamInit_AddRef(IPersistStreamInit *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistStreamInit(iface); + return htmldoc_addref(&This->basedoc); +} + +static ULONG WINAPI DocObjPersistStreamInit_Release(IPersistStreamInit *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistStreamInit(iface); + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI DocObjPersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *pClassID) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistStreamInit(iface); + return IPersistFile_GetClassID(&This->IPersistFile_iface, pClassID); +} + +static HRESULT WINAPI DocObjPersistStreamInit_IsDirty(IPersistStreamInit *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistStreamInit(iface); + + TRACE("(%p)\n", This); + + return browser_is_dirty(This->nscontainer); +} + +static HRESULT WINAPI DocObjPersistStreamInit_Load(IPersistStreamInit *iface, IStream *pStm) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistStreamInit(iface); + IMoniker *mon; + HRESULT hres; + + TRACE("(%p)->(%p)\n", This, pStm); + + hres = CreateURLMoniker(NULL, L"about:blank", &mon); + if(FAILED(hres)) { + WARN("CreateURLMoniker failed: %08lx\n", hres); + return hres; + } + + prepare_for_binding(This, mon, FALSE); + hres = set_moniker(This->basedoc.window, mon, NULL, NULL, NULL, TRUE); + if(SUCCEEDED(hres)) + hres = channelbsc_load_stream(This->basedoc.window->pending_window, mon, pStm); + + IMoniker_Release(mon); + return hres; +} + +static HRESULT WINAPI DocObjPersistStreamInit_Save(IPersistStreamInit *iface, IStream *pStm, + BOOL fClearDirty) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistStreamInit(iface); + + if(!This->basedoc.doc_node) { + FIXME("No doc_node\n"); + return E_UNEXPECTED; + } + return IPersistStreamInit_Save(&This->basedoc.doc_node->IPersistStreamInit_iface, pStm, fClearDirty); +} + +static HRESULT WINAPI DocObjPersistStreamInit_GetSizeMax(IPersistStreamInit *iface, + ULARGE_INTEGER *pcbSize) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistStreamInit(iface); + FIXME("(%p)->(%p)\n", This, pcbSize); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjPersistStreamInit_InitNew(IPersistStreamInit *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistStreamInit(iface); IMoniker *mon; HRESULT hres;
@@ -955,62 +1229,128 @@ static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface) }
prepare_for_binding(This, mon, FALSE); - hres = set_moniker(This->window, mon, NULL, NULL, NULL, FALSE); + hres = set_moniker(This->basedoc.window, mon, NULL, NULL, NULL, FALSE); if(SUCCEEDED(hres)) - hres = channelbsc_load_stream(This->window->pending_window, mon, NULL); + hres = channelbsc_load_stream(This->basedoc.window->pending_window, mon, NULL);
IMoniker_Release(mon); return hres; }
-static const IPersistStreamInitVtbl PersistStreamInitVtbl = { - PersistStreamInit_QueryInterface, - PersistStreamInit_AddRef, - PersistStreamInit_Release, - PersistStreamInit_GetClassID, - PersistStreamInit_IsDirty, - PersistStreamInit_Load, - PersistStreamInit_Save, - PersistStreamInit_GetSizeMax, - PersistStreamInit_InitNew +static const IPersistStreamInitVtbl DocObjPersistStreamInitVtbl = { + DocObjPersistStreamInit_QueryInterface, + DocObjPersistStreamInit_AddRef, + DocObjPersistStreamInit_Release, + DocObjPersistStreamInit_GetClassID, + DocObjPersistStreamInit_IsDirty, + DocObjPersistStreamInit_Load, + DocObjPersistStreamInit_Save, + DocObjPersistStreamInit_GetSizeMax, + DocObjPersistStreamInit_InitNew };
/********************************************************** * IPersistHistory implementation */
-static inline HTMLDocument *impl_from_IPersistHistory(IPersistHistory *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IPersistHistory(IPersistHistory *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentNode, IPersistHistory_iface); +} + +static HRESULT WINAPI DocNodePersistHistory_QueryInterface(IPersistHistory *iface, REFIID riid, void **ppv) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistHistory(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); +} + +static ULONG WINAPI DocNodePersistHistory_AddRef(IPersistHistory *iface) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistHistory(iface); + return htmldoc_addref(&This->basedoc); +} + +static ULONG WINAPI DocNodePersistHistory_Release(IPersistHistory *iface) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistHistory(iface); + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI DocNodePersistHistory_GetClassID(IPersistHistory *iface, CLSID *pClassID) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistHistory(iface); + return IPersistFile_GetClassID(&This->IPersistFile_iface, pClassID); +} + +static HRESULT WINAPI DocNodePersistHistory_LoadHistory(IPersistHistory *iface, IStream *pStream, IBindCtx *pbc) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistHistory(iface); + return IPersistHistory_LoadHistory(&This->basedoc.doc_obj->IPersistHistory_iface, pStream, pbc); +} + +static HRESULT WINAPI DocNodePersistHistory_SaveHistory(IPersistHistory *iface, IStream *pStream) { - return CONTAINING_RECORD(iface, HTMLDocument, IPersistHistory_iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistHistory(iface); + return IPersistHistory_SaveHistory(&This->basedoc.doc_obj->IPersistHistory_iface, pStream); }
-static HRESULT WINAPI PersistHistory_QueryInterface(IPersistHistory *iface, REFIID riid, void **ppv) +static HRESULT WINAPI DocNodePersistHistory_SetPositionCookie(IPersistHistory *iface, DWORD dwPositioncookie) { - HTMLDocument *This = impl_from_IPersistHistory(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistHistory(iface); + FIXME("(%p)->(%lx)\n", This, dwPositioncookie); + return E_NOTIMPL; }
-static ULONG WINAPI PersistHistory_AddRef(IPersistHistory *iface) +static HRESULT WINAPI DocNodePersistHistory_GetPositionCookie(IPersistHistory *iface, DWORD *pdwPositioncookie) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistHistory(iface); + FIXME("(%p)->(%p)\n", This, pdwPositioncookie); + return E_NOTIMPL; +} + +static const IPersistHistoryVtbl DocNodePersistHistoryVtbl = { + DocNodePersistHistory_QueryInterface, + DocNodePersistHistory_AddRef, + DocNodePersistHistory_Release, + DocNodePersistHistory_GetClassID, + DocNodePersistHistory_LoadHistory, + DocNodePersistHistory_SaveHistory, + DocNodePersistHistory_SetPositionCookie, + DocNodePersistHistory_GetPositionCookie +}; + +static inline HTMLDocumentObj *HTMLDocumentObj_from_IPersistHistory(IPersistHistory *iface) { - HTMLDocument *This = impl_from_IPersistHistory(iface); - return htmldoc_addref(This); + return CONTAINING_RECORD(iface, HTMLDocumentObj, IPersistHistory_iface); }
-static ULONG WINAPI PersistHistory_Release(IPersistHistory *iface) +static HRESULT WINAPI DocObjPersistHistory_QueryInterface(IPersistHistory *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IPersistHistory(iface); - return htmldoc_release(This); + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistHistory(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static HRESULT WINAPI PersistHistory_GetClassID(IPersistHistory *iface, CLSID *pClassID) +static ULONG WINAPI DocObjPersistHistory_AddRef(IPersistHistory *iface) { - HTMLDocument *This = impl_from_IPersistHistory(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistHistory(iface); + return htmldoc_addref(&This->basedoc); +} + +static ULONG WINAPI DocObjPersistHistory_Release(IPersistHistory *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistHistory(iface); + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI DocObjPersistHistory_GetClassID(IPersistHistory *iface, CLSID *pClassID) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistHistory(iface); return IPersistFile_GetClassID(&This->IPersistFile_iface, pClassID); }
-static HRESULT WINAPI PersistHistory_LoadHistory(IPersistHistory *iface, IStream *pStream, IBindCtx *pbc) +static HRESULT WINAPI DocObjPersistHistory_LoadHistory(IPersistHistory *iface, IStream *pStream, IBindCtx *pbc) { - HTMLDocument *This = impl_from_IPersistHistory(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistHistory(iface); ULONG str_len, read; WCHAR *uri_str; IUri *uri; @@ -1018,7 +1358,7 @@ static HRESULT WINAPI PersistHistory_LoadHistory(IPersistHistory *iface, IStream
TRACE("(%p)->(%p %p)\n", This, pStream, pbc);
- if(!This->window) { + if(!This->basedoc.window) { FIXME("No current window\n"); return E_UNEXPECTED; } @@ -1026,11 +1366,10 @@ static HRESULT WINAPI PersistHistory_LoadHistory(IPersistHistory *iface, IStream if(pbc) FIXME("pbc not supported\n");
- if(This->doc_obj->client) { + if(This->client) { IOleCommandTarget *cmdtrg = NULL;
- hres = IOleClientSite_QueryInterface(This->doc_obj->client, &IID_IOleCommandTarget, - (void**)&cmdtrg); + hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget, (void**)&cmdtrg); if(SUCCEEDED(hres)) { IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 138, 0, NULL, NULL); IOleCommandTarget_Release(cmdtrg); @@ -1058,28 +1397,28 @@ static HRESULT WINAPI PersistHistory_LoadHistory(IPersistHistory *iface, IStream if(FAILED(hres)) return hres;
- hres = load_uri(This->window, uri, BINDING_FROMHIST); + hres = load_uri(This->basedoc.window, uri, BINDING_FROMHIST); IUri_Release(uri); return hres; }
-static HRESULT WINAPI PersistHistory_SaveHistory(IPersistHistory *iface, IStream *pStream) +static HRESULT WINAPI DocObjPersistHistory_SaveHistory(IPersistHistory *iface, IStream *pStream) { - HTMLDocument *This = impl_from_IPersistHistory(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistHistory(iface); ULONG len, written; BSTR display_uri; HRESULT hres;
TRACE("(%p)->(%p)\n", This, pStream);
- if(!This->window || !This->window->uri) { + if(!This->basedoc.window || !This->basedoc.window->uri) { FIXME("No current URI\n"); return E_FAIL; }
/* NOTE: The format we store is *not* compatible with native MSHTML. We currently * store only URI of the page (as a length followed by a string) */ - hres = IUri_GetDisplayUri(This->window->uri, &display_uri); + hres = IUri_GetDisplayUri(This->basedoc.window->uri, &display_uri); if(FAILED(hres)) return hres;
@@ -1091,75 +1430,75 @@ static HRESULT WINAPI PersistHistory_SaveHistory(IPersistHistory *iface, IStream return hres; }
-static HRESULT WINAPI PersistHistory_SetPositionCookie(IPersistHistory *iface, DWORD dwPositioncookie) +static HRESULT WINAPI DocObjPersistHistory_SetPositionCookie(IPersistHistory *iface, DWORD dwPositioncookie) { - HTMLDocument *This = impl_from_IPersistHistory(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistHistory(iface); FIXME("(%p)->(%lx)\n", This, dwPositioncookie); return E_NOTIMPL; }
-static HRESULT WINAPI PersistHistory_GetPositionCookie(IPersistHistory *iface, DWORD *pdwPositioncookie) +static HRESULT WINAPI DocObjPersistHistory_GetPositionCookie(IPersistHistory *iface, DWORD *pdwPositioncookie) { - HTMLDocument *This = impl_from_IPersistHistory(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistHistory(iface); FIXME("(%p)->(%p)\n", This, pdwPositioncookie); return E_NOTIMPL; }
-static const IPersistHistoryVtbl PersistHistoryVtbl = { - PersistHistory_QueryInterface, - PersistHistory_AddRef, - PersistHistory_Release, - PersistHistory_GetClassID, - PersistHistory_LoadHistory, - PersistHistory_SaveHistory, - PersistHistory_SetPositionCookie, - PersistHistory_GetPositionCookie +static const IPersistHistoryVtbl DocObjPersistHistoryVtbl = { + DocObjPersistHistory_QueryInterface, + DocObjPersistHistory_AddRef, + DocObjPersistHistory_Release, + DocObjPersistHistory_GetClassID, + DocObjPersistHistory_LoadHistory, + DocObjPersistHistory_SaveHistory, + DocObjPersistHistory_SetPositionCookie, + DocObjPersistHistory_GetPositionCookie };
/********************************************************** * IHlinkTarget implementation */
-static inline HTMLDocument *impl_from_IHlinkTarget(IHlinkTarget *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IHlinkTarget(IHlinkTarget *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IHlinkTarget_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IHlinkTarget_iface); }
-static HRESULT WINAPI HlinkTarget_QueryInterface(IHlinkTarget *iface, REFIID riid, void **ppv) +static HRESULT WINAPI DocNodeHlinkTarget_QueryInterface(IHlinkTarget *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IHlinkTarget(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHlinkTarget(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static ULONG WINAPI HlinkTarget_AddRef(IHlinkTarget *iface) +static ULONG WINAPI DocNodeHlinkTarget_AddRef(IHlinkTarget *iface) { - HTMLDocument *This = impl_from_IHlinkTarget(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHlinkTarget(iface); + return htmldoc_addref(&This->basedoc); }
-static ULONG WINAPI HlinkTarget_Release(IHlinkTarget *iface) +static ULONG WINAPI DocNodeHlinkTarget_Release(IHlinkTarget *iface) { - HTMLDocument *This = impl_from_IHlinkTarget(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHlinkTarget(iface); + return htmldoc_release(&This->basedoc); }
-static HRESULT WINAPI HlinkTarget_SetBrowseContext(IHlinkTarget *iface, IHlinkBrowseContext *pihlbc) +static HRESULT WINAPI DocNodeHlinkTarget_SetBrowseContext(IHlinkTarget *iface, IHlinkBrowseContext *pihlbc) { - HTMLDocument *This = impl_from_IHlinkTarget(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHlinkTarget(iface); FIXME("(%p)->(%p)\n", This, pihlbc); return E_NOTIMPL; }
-static HRESULT WINAPI HlinkTarget_GetBrowseContext(IHlinkTarget *iface, IHlinkBrowseContext **ppihlbc) +static HRESULT WINAPI DocNodeHlinkTarget_GetBrowseContext(IHlinkTarget *iface, IHlinkBrowseContext **ppihlbc) { - HTMLDocument *This = impl_from_IHlinkTarget(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHlinkTarget(iface); FIXME("(%p)->(%p)\n", This, ppihlbc); return E_NOTIMPL; }
-static HRESULT WINAPI HlinkTarget_Navigate(IHlinkTarget *iface, DWORD grfHLNF, LPCWSTR pwzJumpLocation) +static HRESULT WINAPI DocNodeHlinkTarget_Navigate(IHlinkTarget *iface, DWORD grfHLNF, LPCWSTR pwzJumpLocation) { - HTMLDocument *This = impl_from_IHlinkTarget(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHlinkTarget(iface);
TRACE("(%p)->(%08lx %s)\n", This, grfHLNF, debugstr_w(pwzJumpLocation));
@@ -1168,12 +1507,93 @@ static HRESULT WINAPI HlinkTarget_Navigate(IHlinkTarget *iface, DWORD grfHLNF, L if(pwzJumpLocation) FIXME("JumpLocation not supported\n");
- if(!This->doc_obj->client) { + if(This->basedoc.doc_obj->client) + return IOleObject_DoVerb(&This->basedoc.IOleObject_iface, OLEIVERB_SHOW, NULL, NULL, -1, NULL, NULL); + + return IHlinkTarget_Navigate(&This->basedoc.doc_obj->IHlinkTarget_iface, grfHLNF, pwzJumpLocation); +} + +static HRESULT WINAPI DocNodeHlinkTarget_GetMoniker(IHlinkTarget *iface, LPCWSTR pwzLocation, DWORD dwAssign, + IMoniker **ppimkLocation) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IHlinkTarget(iface); + FIXME("(%p)->(%s %08lx %p)\n", This, debugstr_w(pwzLocation), dwAssign, ppimkLocation); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeHlinkTarget_GetFriendlyName(IHlinkTarget *iface, LPCWSTR pwzLocation, + LPWSTR *ppwzFriendlyName) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IHlinkTarget(iface); + FIXME("(%p)->(%s %p)\n", This, debugstr_w(pwzLocation), ppwzFriendlyName); + return E_NOTIMPL; +} + +static const IHlinkTargetVtbl DocNodeHlinkTargetVtbl = { + DocNodeHlinkTarget_QueryInterface, + DocNodeHlinkTarget_AddRef, + DocNodeHlinkTarget_Release, + DocNodeHlinkTarget_SetBrowseContext, + DocNodeHlinkTarget_GetBrowseContext, + DocNodeHlinkTarget_Navigate, + DocNodeHlinkTarget_GetMoniker, + DocNodeHlinkTarget_GetFriendlyName +}; + +static inline HTMLDocumentObj *HTMLDocumentObj_from_IHlinkTarget(IHlinkTarget *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IHlinkTarget_iface); +} + +static HRESULT WINAPI DocObjHlinkTarget_QueryInterface(IHlinkTarget *iface, REFIID riid, void **ppv) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHlinkTarget(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); +} + +static ULONG WINAPI DocObjHlinkTarget_AddRef(IHlinkTarget *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHlinkTarget(iface); + return htmldoc_addref(&This->basedoc); +} + +static ULONG WINAPI DocObjHlinkTarget_Release(IHlinkTarget *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHlinkTarget(iface); + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI DocObjHlinkTarget_SetBrowseContext(IHlinkTarget *iface, IHlinkBrowseContext *pihlbc) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHlinkTarget(iface); + FIXME("(%p)->(%p)\n", This, pihlbc); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjHlinkTarget_GetBrowseContext(IHlinkTarget *iface, IHlinkBrowseContext **ppihlbc) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHlinkTarget(iface); + FIXME("(%p)->(%p)\n", This, ppihlbc); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjHlinkTarget_Navigate(IHlinkTarget *iface, DWORD grfHLNF, LPCWSTR pwzJumpLocation) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHlinkTarget(iface); + + TRACE("(%p)->(%08lx %s)\n", This, grfHLNF, debugstr_w(pwzJumpLocation)); + + if(grfHLNF) + FIXME("Unsupported grfHLNF=%08lx\n", grfHLNF); + if(pwzJumpLocation) + FIXME("JumpLocation not supported\n"); + + if(!This->client) { HRESULT hres; BSTR uri;
- hres = IUri_GetAbsoluteUri(This->window->uri, &uri); - if (FAILED(hres)) + hres = IUri_GetAbsoluteUri(This->basedoc.window->uri, &uri); + if(FAILED(hres)) return hres;
if(hres == S_OK) @@ -1182,42 +1602,52 @@ static HRESULT WINAPI HlinkTarget_Navigate(IHlinkTarget *iface, DWORD grfHLNF, L return S_OK; }
- return IOleObject_DoVerb(&This->IOleObject_iface, OLEIVERB_SHOW, NULL, NULL, -1, NULL, NULL); + return IOleObject_DoVerb(&This->basedoc.IOleObject_iface, OLEIVERB_SHOW, NULL, NULL, -1, NULL, NULL); }
-static HRESULT WINAPI HlinkTarget_GetMoniker(IHlinkTarget *iface, LPCWSTR pwzLocation, DWORD dwAssign, +static HRESULT WINAPI DocObjHlinkTarget_GetMoniker(IHlinkTarget *iface, LPCWSTR pwzLocation, DWORD dwAssign, IMoniker **ppimkLocation) { - HTMLDocument *This = impl_from_IHlinkTarget(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IHlinkTarget(iface); FIXME("(%p)->(%s %08lx %p)\n", This, debugstr_w(pwzLocation), dwAssign, ppimkLocation); return E_NOTIMPL; }
-static HRESULT WINAPI HlinkTarget_GetFriendlyName(IHlinkTarget *iface, LPCWSTR pwzLocation, +static HRESULT WINAPI DocObjHlinkTarget_GetFriendlyName(IHlinkTarget *iface, LPCWSTR pwzLocation, LPWSTR *ppwzFriendlyName) { - HTMLDocument *This = impl_from_IHlinkTarget(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IHlinkTarget(iface); FIXME("(%p)->(%s %p)\n", This, debugstr_w(pwzLocation), ppwzFriendlyName); return E_NOTIMPL; }
-static const IHlinkTargetVtbl HlinkTargetVtbl = { - HlinkTarget_QueryInterface, - HlinkTarget_AddRef, - HlinkTarget_Release, - HlinkTarget_SetBrowseContext, - HlinkTarget_GetBrowseContext, - HlinkTarget_Navigate, - HlinkTarget_GetMoniker, - HlinkTarget_GetFriendlyName +static const IHlinkTargetVtbl DocObjHlinkTargetVtbl = { + DocObjHlinkTarget_QueryInterface, + DocObjHlinkTarget_AddRef, + DocObjHlinkTarget_Release, + DocObjHlinkTarget_SetBrowseContext, + DocObjHlinkTarget_GetBrowseContext, + DocObjHlinkTarget_Navigate, + DocObjHlinkTarget_GetMoniker, + DocObjHlinkTarget_GetFriendlyName };
-void HTMLDocument_Persist_Init(HTMLDocument *This) +void HTMLDocumentNode_Persist_Init(HTMLDocumentNode *This) +{ + This->IPersistMoniker_iface.lpVtbl = &DocNodePersistMonikerVtbl; + This->IPersistFile_iface.lpVtbl = &DocNodePersistFileVtbl; + This->IMonikerProp_iface.lpVtbl = &DocNodeMonikerPropVtbl; + This->IPersistStreamInit_iface.lpVtbl = &DocNodePersistStreamInitVtbl; + This->IPersistHistory_iface.lpVtbl = &DocNodePersistHistoryVtbl; + This->IHlinkTarget_iface.lpVtbl = &DocNodeHlinkTargetVtbl; +} + +void HTMLDocumentObj_Persist_Init(HTMLDocumentObj *This) { - This->IPersistMoniker_iface.lpVtbl = &PersistMonikerVtbl; - This->IPersistFile_iface.lpVtbl = &PersistFileVtbl; - This->IMonikerProp_iface.lpVtbl = &MonikerPropVtbl; - This->IPersistStreamInit_iface.lpVtbl = &PersistStreamInitVtbl; - This->IPersistHistory_iface.lpVtbl = &PersistHistoryVtbl; - This->IHlinkTarget_iface.lpVtbl = &HlinkTargetVtbl; + This->IPersistMoniker_iface.lpVtbl = &DocObjPersistMonikerVtbl; + This->IPersistFile_iface.lpVtbl = &DocObjPersistFileVtbl; + This->IMonikerProp_iface.lpVtbl = &DocObjMonikerPropVtbl; + This->IPersistStreamInit_iface.lpVtbl = &DocObjPersistStreamInitVtbl; + This->IPersistHistory_iface.lpVtbl = &DocObjPersistHistoryVtbl; + This->IHlinkTarget_iface.lpVtbl = &DocObjHlinkTargetVtbl; }
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/editor.c | 2 +- dlls/mshtml/htmldoc.c | 11 +-- dlls/mshtml/mshtml_private.h | 6 +- dlls/mshtml/olecmd.c | 126 +++++++++++++++++++++++++---------- dlls/mshtml/view.c | 2 +- 5 files changed, 105 insertions(+), 42 deletions(-)
diff --git a/dlls/mshtml/editor.c b/dlls/mshtml/editor.c index ef7ade0116c..6fa75398016 100644 --- a/dlls/mshtml/editor.c +++ b/dlls/mshtml/editor.c @@ -1266,7 +1266,7 @@ HRESULT setup_edit_mode(HTMLDocumentObj *doc)
if(doc->hostui) IDocHostUIHandler_ShowUI(doc->hostui, DOCHOSTUITYPE_AUTHOR, - &doc->basedoc.IOleInPlaceActiveObject_iface, &doc->basedoc.IOleCommandTarget_iface, + &doc->basedoc.IOleInPlaceActiveObject_iface, &doc->IOleCommandTarget_iface, doc->frame, doc->ip_window);
if(doc->ip_window) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index f1d887e5d08..37b8082fb8c 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -1562,7 +1562,7 @@ static HRESULT WINAPI HTMLDocument_execCommand(IHTMLDocument2 *iface, BSTR cmdID return OLECMDERR_E_NOTSUPPORTED;
V_VT(&ret) = VT_EMPTY; - hres = IOleCommandTarget_Exec(&This->IOleCommandTarget_iface, &CGID_MSHTML, cmdid, + hres = IOleCommandTarget_Exec(&This->doc_node->IOleCommandTarget_iface, &CGID_MSHTML, cmdid, showUI ? 0 : OLECMDEXECOPT_DONTPROMPTUSER, &value, &ret); if(FAILED(hres)) return hres; @@ -5625,8 +5625,6 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv) *ppv = &This->IOleInPlaceObjectWindowless_iface; else if(IsEqualGUID(&IID_IOleInPlaceObjectWindowless, riid)) *ppv = &This->IOleInPlaceObjectWindowless_iface; - else if(IsEqualGUID(&IID_IOleCommandTarget, riid)) - *ppv = &This->IOleCommandTarget_iface; else if(IsEqualGUID(&IID_IOleControl, riid)) *ppv = &This->IOleControl_iface; else if(IsEqualGUID(&DIID_DispHTMLDocument, riid)) @@ -5709,7 +5707,6 @@ static void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex) doc->outer_unk = outer; doc->dispex = dispex;
- HTMLDocument_OleCmd_Init(doc); HTMLDocument_OleObj_Init(doc); }
@@ -5743,6 +5740,8 @@ static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) *ppv = &This->IPersistHistory_iface; else if(IsEqualGUID(&IID_IHlinkTarget, riid)) *ppv = &This->IHlinkTarget_iface; + else if(IsEqualGUID(&IID_IOleCommandTarget, riid)) + *ppv = &This->IOleCommandTarget_iface; else if(IsEqualGUID(&IID_IServiceProvider, riid)) *ppv = &This->IServiceProvider_iface; else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) @@ -6136,6 +6135,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo ConnectionPointContainer_Init(&doc->cp_container, (IUnknown*)&doc->basedoc.IHTMLDocument2_iface, HTMLDocumentNode_cpc); HTMLDocumentNode_Persist_Init(doc); HTMLDocumentNode_Service_Init(doc); + HTMLDocumentNode_OleCmd_Init(doc); HTMLDocumentNode_SecMgr_Init(doc);
list_init(&doc->selection_list); @@ -6268,6 +6268,8 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii *ppv = &This->IPersistHistory_iface; }else if(IsEqualGUID(&IID_IHlinkTarget, riid)) { *ppv = &This->IHlinkTarget_iface; + }else if(IsEqualGUID(&IID_IOleCommandTarget, riid)) { + *ppv = &This->IOleCommandTarget_iface; }else if(IsEqualGUID(&IID_IServiceProvider, riid)) { *ppv = &This->IServiceProvider_iface; }else if(IsEqualGUID(&IID_ITargetContainer, riid)) { @@ -6498,6 +6500,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii ConnectionPointContainer_Init(&doc->cp_container, &doc->IUnknown_inner, HTMLDocumentObj_cpc); HTMLDocumentObj_Persist_Init(doc); HTMLDocumentObj_Service_Init(doc); + HTMLDocumentObj_OleCmd_Init(doc); TargetContainer_Init(doc); doc->is_mhtml = is_mhtml;
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 39bd7b72493..874b1b19a6f 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -652,7 +652,6 @@ struct HTMLDocument { IOleDocument IOleDocument_iface; IOleInPlaceActiveObject IOleInPlaceActiveObject_iface; IOleInPlaceObjectWindowless IOleInPlaceObjectWindowless_iface; - IOleCommandTarget IOleCommandTarget_iface; IOleControl IOleControl_iface; IDispatchEx IDispatchEx_iface; ISupportErrorInfo ISupportErrorInfo_iface; @@ -702,6 +701,7 @@ struct HTMLDocumentObj { IPersistStreamInit IPersistStreamInit_iface; IPersistHistory IPersistHistory_iface; IHlinkTarget IHlinkTarget_iface; + IOleCommandTarget IOleCommandTarget_iface; IServiceProvider IServiceProvider_iface; ITargetContainer ITargetContainer_iface;
@@ -902,6 +902,7 @@ struct HTMLDocumentNode { IPersistStreamInit IPersistStreamInit_iface; IPersistHistory IPersistHistory_iface; IHlinkTarget IHlinkTarget_iface; + IOleCommandTarget IOleCommandTarget_iface; IServiceProvider IServiceProvider_iface; IInternetHostSecurityManager IInternetHostSecurityManager_iface;
@@ -969,16 +970,17 @@ void detach_dom_implementation(IHTMLDOMImplementation*) DECLSPEC_HIDDEN; HRESULT create_html_storage(HTMLInnerWindow*,BOOL,IHTMLStorage**) DECLSPEC_HIDDEN; void detach_html_storage(IHTMLStorage*) DECLSPEC_HIDDEN;
-void HTMLDocument_OleCmd_Init(HTMLDocument*) DECLSPEC_HIDDEN; void HTMLDocument_OleObj_Init(HTMLDocument*) DECLSPEC_HIDDEN;
void HTMLDocument_View_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN; void HTMLDocumentObj_Persist_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN; void HTMLDocumentObj_Service_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN; +void HTMLDocumentObj_OleCmd_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN; void TargetContainer_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN;
void HTMLDocumentNode_Persist_Init(HTMLDocumentNode*) DECLSPEC_HIDDEN; void HTMLDocumentNode_Service_Init(HTMLDocumentNode*) DECLSPEC_HIDDEN; +void HTMLDocumentNode_OleCmd_Init(HTMLDocumentNode*) DECLSPEC_HIDDEN; void HTMLDocumentNode_SecMgr_Init(HTMLDocumentNode*) DECLSPEC_HIDDEN;
HRESULT HTMLCurrentStyle_Create(HTMLElement*,IHTMLCurrentStyle**) DECLSPEC_HIDDEN; diff --git a/dlls/mshtml/olecmd.c b/dlls/mshtml/olecmd.c index a044d24aea2..364a26ed769 100644 --- a/dlls/mshtml/olecmd.c +++ b/dlls/mshtml/olecmd.c @@ -89,9 +89,14 @@ static nsIClipboardCommands *get_clipboard_commands(HTMLDocumentNode *doc) * IOleCommandTarget implementation */
-static inline HTMLDocument *impl_from_IOleCommandTarget(IOleCommandTarget *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IOleCommandTarget(IOleCommandTarget *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IOleCommandTarget_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IOleCommandTarget_iface); +} + +static inline HTMLDocumentObj *HTMLDocumentObj_from_IOleCommandTarget(IOleCommandTarget *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IOleCommandTarget_iface); }
static HRESULT exec_open(HTMLDocumentNode *doc, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) @@ -793,22 +798,22 @@ static const cmdtable_t base_cmds[] = { {0,NULL,NULL} };
-static HRESULT WINAPI OleCommandTarget_QueryInterface(IOleCommandTarget *iface, REFIID riid, void **ppv) +static HRESULT WINAPI DocNodeOleCommandTarget_QueryInterface(IOleCommandTarget *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IOleCommandTarget(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleCommandTarget(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static ULONG WINAPI OleCommandTarget_AddRef(IOleCommandTarget *iface) +static ULONG WINAPI DocNodeOleCommandTarget_AddRef(IOleCommandTarget *iface) { - HTMLDocument *This = impl_from_IOleCommandTarget(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleCommandTarget(iface); + return htmldoc_addref(&This->basedoc); }
-static ULONG WINAPI OleCommandTarget_Release(IOleCommandTarget *iface) +static ULONG WINAPI DocNodeOleCommandTarget_Release(IOleCommandTarget *iface) { - HTMLDocument *This = impl_from_IOleCommandTarget(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleCommandTarget(iface); + return htmldoc_release(&This->basedoc); }
static HRESULT query_from_table(HTMLDocumentNode *doc, const cmdtable_t *cmdtable, OLECMD *cmd) @@ -826,17 +831,17 @@ static HRESULT query_from_table(HTMLDocumentNode *doc, const cmdtable_t *cmdtabl return iter->query(doc, cmd); }
-static HRESULT WINAPI OleCommandTarget_QueryStatus(IOleCommandTarget *iface, const GUID *pguidCmdGroup, +static HRESULT WINAPI DocNodeOleCommandTarget_QueryStatus(IOleCommandTarget *iface, const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText) { - HTMLDocument *This = impl_from_IOleCommandTarget(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleCommandTarget(iface); HRESULT hres;
TRACE("(%p)->(%s %ld %p %p)\n", This, debugstr_guid(pguidCmdGroup), cCmds, prgCmds, pCmdText);
if(pCmdText) FIXME("Unsupported pCmdText\n"); - if(!This->doc_node->browser) + if(!This->browser) return E_UNEXPECTED; if(!cCmds) return S_OK; @@ -854,8 +859,8 @@ static HRESULT WINAPI OleCommandTarget_QueryStatus(IOleCommandTarget *iface, con OLECMD olecmd;
prgCmds[i].cmdf = OLECMDF_SUPPORTED; - if(This->doc_obj->client) { - hres = IOleClientSite_QueryInterface(This->doc_obj->client, &IID_IOleCommandTarget, + if(This->basedoc.doc_obj->client) { + hres = IOleClientSite_QueryInterface(This->basedoc.doc_obj->client, &IID_IOleCommandTarget, (void**)&cmdtrg); if(SUCCEEDED(hres)) { olecmd.cmdID = prgCmds[i].cmdID; @@ -882,9 +887,9 @@ static HRESULT WINAPI OleCommandTarget_QueryStatus(IOleCommandTarget *iface, con ULONG i;
for(i=0; i<cCmds; i++) { - hres = query_from_table(This->doc_node, base_cmds, prgCmds+i); + hres = query_from_table(This, base_cmds, prgCmds+i); if(hres == OLECMDERR_E_NOTSUPPORTED) - hres = query_from_table(This->doc_node, editmode_cmds, prgCmds+i); + hres = query_from_table(This, editmode_cmds, prgCmds+i); if(hres == OLECMDERR_E_NOTSUPPORTED) FIXME("CGID_MSHTML: unsupported cmdID %ld\n", prgCmds[i].cmdID); } @@ -910,14 +915,14 @@ static HRESULT exec_from_table(HTMLDocumentNode *doc, const cmdtable_t *cmdtable return iter->exec(doc, cmdexecopt, in, out); }
-static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID *pguidCmdGroup, +static HRESULT WINAPI DocNodeOleCommandTarget_Exec(IOleCommandTarget *iface, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) { - HTMLDocument *This = impl_from_IOleCommandTarget(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleCommandTarget(iface);
TRACE("(%p)->(%s %ld %ld %s %p)\n", This, debugstr_guid(pguidCmdGroup), nCmdID, nCmdexecopt, wine_dbgstr_variant(pvaIn), pvaOut);
- if(!This->doc_node->browser) + if(!This->browser) return E_UNEXPECTED;
if(!pguidCmdGroup) { @@ -926,7 +931,7 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID return OLECMDERR_E_NOTSUPPORTED; }
- return exec_table[nCmdID].func(This->doc_node, nCmdexecopt, pvaIn, pvaOut); + return exec_table[nCmdID].func(This, nCmdexecopt, pvaIn, pvaOut); }else if(IsEqualGUID(&CGID_Explorer, pguidCmdGroup)) { FIXME("unsupported nCmdID %ld of CGID_Explorer group\n", nCmdID); TRACE("%p %p\n", pvaIn, pvaOut); @@ -935,9 +940,9 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID FIXME("unsupported nCmdID %ld of CGID_ShellDocView group\n", nCmdID); return OLECMDERR_E_NOTSUPPORTED; }else if(IsEqualGUID(&CGID_MSHTML, pguidCmdGroup)) { - HRESULT hres = exec_from_table(This->doc_node, base_cmds, nCmdID, nCmdexecopt, pvaIn, pvaOut); + HRESULT hres = exec_from_table(This, base_cmds, nCmdID, nCmdexecopt, pvaIn, pvaOut); if(hres == OLECMDERR_E_NOTSUPPORTED) - hres = exec_from_table(This->doc_node, editmode_cmds, nCmdID, + hres = exec_from_table(This, editmode_cmds, nCmdID, nCmdexecopt, pvaIn, pvaOut); if(hres == OLECMDERR_E_NOTSUPPORTED) FIXME("unsupported nCmdID %ld of CGID_MSHTML group\n", nCmdID); @@ -949,12 +954,60 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID return OLECMDERR_E_UNKNOWNGROUP; }
-static const IOleCommandTargetVtbl OleCommandTargetVtbl = { - OleCommandTarget_QueryInterface, - OleCommandTarget_AddRef, - OleCommandTarget_Release, - OleCommandTarget_QueryStatus, - OleCommandTarget_Exec +static const IOleCommandTargetVtbl DocNodeOleCommandTargetVtbl = { + DocNodeOleCommandTarget_QueryInterface, + DocNodeOleCommandTarget_AddRef, + DocNodeOleCommandTarget_Release, + DocNodeOleCommandTarget_QueryStatus, + DocNodeOleCommandTarget_Exec +}; + +static HRESULT WINAPI DocObjOleCommandTarget_QueryInterface(IOleCommandTarget *iface, REFIID riid, void **ppv) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleCommandTarget(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); +} + +static ULONG WINAPI DocObjOleCommandTarget_AddRef(IOleCommandTarget *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleCommandTarget(iface); + return htmldoc_addref(&This->basedoc); +} + +static ULONG WINAPI DocObjOleCommandTarget_Release(IOleCommandTarget *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleCommandTarget(iface); + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI DocObjOleCommandTarget_QueryStatus(IOleCommandTarget *iface, const GUID *pguidCmdGroup, + ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleCommandTarget(iface); + + if(!This->basedoc.doc_node) + return E_UNEXPECTED; + return IOleCommandTarget_QueryStatus(&This->basedoc.doc_node->IOleCommandTarget_iface, + pguidCmdGroup, cCmds, prgCmds, pCmdText); +} + +static HRESULT WINAPI DocObjOleCommandTarget_Exec(IOleCommandTarget *iface, const GUID *pguidCmdGroup, + DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleCommandTarget(iface); + + if(!This->basedoc.doc_node) + return E_UNEXPECTED; + return IOleCommandTarget_Exec(&This->basedoc.doc_node->IOleCommandTarget_iface, + pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut); +} + +static const IOleCommandTargetVtbl DocObjOleCommandTargetVtbl = { + DocObjOleCommandTarget_QueryInterface, + DocObjOleCommandTarget_AddRef, + DocObjOleCommandTarget_Release, + DocObjOleCommandTarget_QueryStatus, + DocObjOleCommandTarget_Exec };
void show_context_menu(HTMLDocumentObj *This, DWORD dwID, POINT *ppt, IDispatch *elem) @@ -963,7 +1016,7 @@ void show_context_menu(HTMLDocumentObj *This, DWORD dwID, POINT *ppt, IDispatch DWORD cmdid;
if(This->hostui && S_OK == IDocHostUIHandler_ShowContextMenu(This->hostui, - dwID, ppt, (IUnknown*)&This->basedoc.IOleCommandTarget_iface, elem)) + dwID, ppt, (IUnknown*)&This->IOleCommandTarget_iface, elem)) return;
menu_res = LoadMenuW(get_shdoclc(), MAKEINTRESOURCEW(IDR_BROWSE_CONTEXT_MENU)); @@ -974,11 +1027,16 @@ void show_context_menu(HTMLDocumentObj *This, DWORD dwID, POINT *ppt, IDispatch DestroyMenu(menu_res);
if(cmdid) - IOleCommandTarget_Exec(&This->basedoc.IOleCommandTarget_iface, &CGID_MSHTML, cmdid, 0, + IOleCommandTarget_Exec(&This->IOleCommandTarget_iface, &CGID_MSHTML, cmdid, 0, NULL, NULL); }
-void HTMLDocument_OleCmd_Init(HTMLDocument *This) +void HTMLDocumentNode_OleCmd_Init(HTMLDocumentNode *This) +{ + This->IOleCommandTarget_iface.lpVtbl = &DocNodeOleCommandTargetVtbl; +} + +void HTMLDocumentObj_OleCmd_Init(HTMLDocumentObj *This) { - This->IOleCommandTarget_iface.lpVtbl = &OleCommandTargetVtbl; + This->IOleCommandTarget_iface.lpVtbl = &DocObjOleCommandTargetVtbl; } diff --git a/dlls/mshtml/view.c b/dlls/mshtml/view.c index 782459566f4..239124012b4 100644 --- a/dlls/mshtml/view.c +++ b/dlls/mshtml/view.c @@ -625,7 +625,7 @@ static HRESULT WINAPI OleDocumentView_UIActivate(IOleDocumentView *iface, BOOL f if(This->hostui) { hres = IDocHostUIHandler_ShowUI(This->hostui, This->nscontainer->usermode == EDITMODE ? DOCHOSTUITYPE_AUTHOR : DOCHOSTUITYPE_BROWSE, - &This->basedoc.IOleInPlaceActiveObject_iface, &This->basedoc.IOleCommandTarget_iface, + &This->basedoc.IOleInPlaceActiveObject_iface, &This->IOleCommandTarget_iface, This->frame, This->ip_window); if(FAILED(hres)) IDocHostUIHandler_HideUI(This->hostui);
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/editor.c | 4 +- dlls/mshtml/htmldoc.c | 68 +- dlls/mshtml/mshtml_private.h | 28 +- dlls/mshtml/oleobj.c | 1424 ++++++++++++++++++++++++---------- dlls/mshtml/persist.c | 6 +- dlls/mshtml/pluginhost.c | 2 +- dlls/mshtml/view.c | 9 +- 7 files changed, 1105 insertions(+), 436 deletions(-)
diff --git a/dlls/mshtml/editor.c b/dlls/mshtml/editor.c index 6fa75398016..d70129ae533 100644 --- a/dlls/mshtml/editor.c +++ b/dlls/mshtml/editor.c @@ -1266,11 +1266,11 @@ HRESULT setup_edit_mode(HTMLDocumentObj *doc)
if(doc->hostui) IDocHostUIHandler_ShowUI(doc->hostui, DOCHOSTUITYPE_AUTHOR, - &doc->basedoc.IOleInPlaceActiveObject_iface, &doc->IOleCommandTarget_iface, + &doc->IOleInPlaceActiveObject_iface, &doc->IOleCommandTarget_iface, doc->frame, doc->ip_window);
if(doc->ip_window) - call_set_active_object(doc->ip_window, &doc->basedoc.IOleInPlaceActiveObject_iface); + call_set_active_object(doc->ip_window, &doc->IOleInPlaceActiveObject_iface);
SetRectEmpty(&rcBorderWidths); if(doc->frame) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 37b8082fb8c..57e922834d6 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -5613,30 +5613,10 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv) *ppv = &This->IDocumentSelector_iface; else if(IsEqualGUID(&IID_IDocumentEvent, riid)) *ppv = &This->IDocumentEvent_iface; - else if(IsEqualGUID(&IID_IOleObject, riid)) - *ppv = &This->IOleObject_iface; - else if(IsEqualGUID(&IID_IOleDocument, riid)) - *ppv = &This->IOleDocument_iface; - else if(IsEqualGUID(&IID_IOleInPlaceActiveObject, riid)) - *ppv = &This->IOleInPlaceActiveObject_iface; - else if(IsEqualGUID(&IID_IOleWindow, riid)) - *ppv = &This->IOleInPlaceActiveObject_iface; - else if(IsEqualGUID(&IID_IOleInPlaceObject, riid)) - *ppv = &This->IOleInPlaceObjectWindowless_iface; - else if(IsEqualGUID(&IID_IOleInPlaceObjectWindowless, riid)) - *ppv = &This->IOleInPlaceObjectWindowless_iface; - else if(IsEqualGUID(&IID_IOleControl, riid)) - *ppv = &This->IOleControl_iface; else if(IsEqualGUID(&DIID_DispHTMLDocument, riid)) *ppv = &This->IHTMLDocument2_iface; else if(IsEqualGUID(&IID_ISupportErrorInfo, riid)) *ppv = &This->ISupportErrorInfo_iface; - else if(IsEqualGUID(&IID_IObjectWithSite, riid)) - *ppv = &This->IObjectWithSite_iface; - else if(IsEqualGUID(&IID_IOleContainer, riid)) - *ppv = &This->IOleContainer_iface; - else if(IsEqualGUID(&IID_IObjectSafety, riid)) - *ppv = &This->IObjectSafety_iface; else if(IsEqualGUID(&IID_IProvideClassInfo, riid)) *ppv = &This->IProvideMultipleClassInfo_iface; else if(IsEqualGUID(&IID_IProvideClassInfo2, riid)) @@ -5706,8 +5686,6 @@ static void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex)
doc->outer_unk = outer; doc->dispex = dispex; - - HTMLDocument_OleObj_Init(doc); }
static inline HTMLDocumentNode *impl_from_HTMLDOMNode(HTMLDOMNode *iface) @@ -5742,6 +5720,26 @@ static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) *ppv = &This->IHlinkTarget_iface; else if(IsEqualGUID(&IID_IOleCommandTarget, riid)) *ppv = &This->IOleCommandTarget_iface; + else if(IsEqualGUID(&IID_IOleObject, riid)) + *ppv = &This->IOleObject_iface; + else if(IsEqualGUID(&IID_IOleDocument, riid)) + *ppv = &This->IOleDocument_iface; + else if(IsEqualGUID(&IID_IOleInPlaceActiveObject, riid)) + *ppv = &This->IOleInPlaceActiveObject_iface; + else if(IsEqualGUID(&IID_IOleWindow, riid)) + *ppv = &This->IOleInPlaceActiveObject_iface; + else if(IsEqualGUID(&IID_IOleInPlaceObject, riid)) + *ppv = &This->IOleInPlaceObjectWindowless_iface; + else if(IsEqualGUID(&IID_IOleInPlaceObjectWindowless, riid)) + *ppv = &This->IOleInPlaceObjectWindowless_iface; + else if(IsEqualGUID(&IID_IOleControl, riid)) + *ppv = &This->IOleControl_iface; + else if(IsEqualGUID(&IID_IObjectWithSite, riid)) + *ppv = &This->IObjectWithSite_iface; + else if(IsEqualGUID(&IID_IOleContainer, riid)) + *ppv = &This->IOleContainer_iface; + else if(IsEqualGUID(&IID_IObjectSafety, riid)) + *ppv = &This->IObjectSafety_iface; else if(IsEqualGUID(&IID_IServiceProvider, riid)) *ppv = &This->IServiceProvider_iface; else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) @@ -6136,6 +6134,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo HTMLDocumentNode_Persist_Init(doc); HTMLDocumentNode_Service_Init(doc); HTMLDocumentNode_OleCmd_Init(doc); + HTMLDocumentNode_OleObj_Init(doc); HTMLDocumentNode_SecMgr_Init(doc);
list_init(&doc->selection_list); @@ -6270,6 +6269,26 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii *ppv = &This->IHlinkTarget_iface; }else if(IsEqualGUID(&IID_IOleCommandTarget, riid)) { *ppv = &This->IOleCommandTarget_iface; + }else if(IsEqualGUID(&IID_IOleObject, riid)) { + *ppv = &This->IOleObject_iface; + }else if(IsEqualGUID(&IID_IOleDocument, riid)) { + *ppv = &This->IOleDocument_iface; + }else if(IsEqualGUID(&IID_IOleInPlaceActiveObject, riid)) { + *ppv = &This->IOleInPlaceActiveObject_iface; + }else if(IsEqualGUID(&IID_IOleWindow, riid)) { + *ppv = &This->IOleInPlaceActiveObject_iface; + }else if(IsEqualGUID(&IID_IOleInPlaceObject, riid)) { + *ppv = &This->IOleInPlaceObjectWindowless_iface; + }else if(IsEqualGUID(&IID_IOleInPlaceObjectWindowless, riid)) { + *ppv = &This->IOleInPlaceObjectWindowless_iface; + }else if(IsEqualGUID(&IID_IOleControl, riid)) { + *ppv = &This->IOleControl_iface; + }else if(IsEqualGUID(&IID_IObjectWithSite, riid)) { + *ppv = &This->IObjectWithSite_iface; + }else if(IsEqualGUID(&IID_IOleContainer, riid)) { + *ppv = &This->IOleContainer_iface; + }else if(IsEqualGUID(&IID_IObjectSafety, riid)) { + *ppv = &This->IObjectSafety_iface; }else if(IsEqualGUID(&IID_IServiceProvider, riid)) { *ppv = &This->IServiceProvider_iface; }else if(IsEqualGUID(&IID_ITargetContainer, riid)) { @@ -6318,11 +6337,11 @@ static ULONG WINAPI HTMLDocumentObj_Release(IUnknown *iface) if(This->view_sink) IAdviseSink_Release(This->view_sink); if(This->client) - IOleObject_SetClientSite(&This->basedoc.IOleObject_iface, NULL); + IOleObject_SetClientSite(&This->IOleObject_iface, NULL); if(This->hostui) ICustomDoc_SetUIHandler(&This->ICustomDoc_iface, NULL); if(This->in_place_active) - IOleInPlaceObjectWindowless_InPlaceDeactivate(&This->basedoc.IOleInPlaceObjectWindowless_iface); + IOleInPlaceObjectWindowless_InPlaceDeactivate(&This->IOleInPlaceObjectWindowless_iface); if(This->ipsite) IOleDocumentView_SetInPlaceSite(&This->IOleDocumentView_iface, NULL); if(This->undomgr) @@ -6501,6 +6520,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii HTMLDocumentObj_Persist_Init(doc); HTMLDocumentObj_Service_Init(doc); HTMLDocumentObj_OleCmd_Init(doc); + HTMLDocumentObj_OleObj_Init(doc); TargetContainer_Init(doc); doc->is_mhtml = is_mhtml;
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 874b1b19a6f..6b3310e55ab 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -648,16 +648,8 @@ struct HTMLDocument { IHTMLDocument7 IHTMLDocument7_iface; IDocumentSelector IDocumentSelector_iface; IDocumentEvent IDocumentEvent_iface; - IOleObject IOleObject_iface; - IOleDocument IOleDocument_iface; - IOleInPlaceActiveObject IOleInPlaceActiveObject_iface; - IOleInPlaceObjectWindowless IOleInPlaceObjectWindowless_iface; - IOleControl IOleControl_iface; IDispatchEx IDispatchEx_iface; ISupportErrorInfo ISupportErrorInfo_iface; - IObjectWithSite IObjectWithSite_iface; - IOleContainer IOleContainer_iface; - IObjectSafety IObjectSafety_iface; IProvideMultipleClassInfo IProvideMultipleClassInfo_iface; IMarkupServices IMarkupServices_iface; IMarkupContainer IMarkupContainer_iface; @@ -702,6 +694,14 @@ struct HTMLDocumentObj { IPersistHistory IPersistHistory_iface; IHlinkTarget IHlinkTarget_iface; IOleCommandTarget IOleCommandTarget_iface; + IOleObject IOleObject_iface; + IOleDocument IOleDocument_iface; + IOleControl IOleControl_iface; + IOleInPlaceActiveObject IOleInPlaceActiveObject_iface; + IOleInPlaceObjectWindowless IOleInPlaceObjectWindowless_iface; + IObjectWithSite IObjectWithSite_iface; + IOleContainer IOleContainer_iface; + IObjectSafety IObjectSafety_iface; IServiceProvider IServiceProvider_iface; ITargetContainer ITargetContainer_iface;
@@ -903,6 +903,14 @@ struct HTMLDocumentNode { IPersistHistory IPersistHistory_iface; IHlinkTarget IHlinkTarget_iface; IOleCommandTarget IOleCommandTarget_iface; + IOleObject IOleObject_iface; + IOleDocument IOleDocument_iface; + IOleControl IOleControl_iface; + IOleInPlaceActiveObject IOleInPlaceActiveObject_iface; + IOleInPlaceObjectWindowless IOleInPlaceObjectWindowless_iface; + IObjectWithSite IObjectWithSite_iface; + IOleContainer IOleContainer_iface; + IObjectSafety IObjectSafety_iface; IServiceProvider IServiceProvider_iface; IInternetHostSecurityManager IInternetHostSecurityManager_iface;
@@ -970,17 +978,17 @@ void detach_dom_implementation(IHTMLDOMImplementation*) DECLSPEC_HIDDEN; HRESULT create_html_storage(HTMLInnerWindow*,BOOL,IHTMLStorage**) DECLSPEC_HIDDEN; void detach_html_storage(IHTMLStorage*) DECLSPEC_HIDDEN;
-void HTMLDocument_OleObj_Init(HTMLDocument*) DECLSPEC_HIDDEN; - void HTMLDocument_View_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN; void HTMLDocumentObj_Persist_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN; void HTMLDocumentObj_Service_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN; void HTMLDocumentObj_OleCmd_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN; +void HTMLDocumentObj_OleObj_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN; void TargetContainer_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN;
void HTMLDocumentNode_Persist_Init(HTMLDocumentNode*) DECLSPEC_HIDDEN; void HTMLDocumentNode_Service_Init(HTMLDocumentNode*) DECLSPEC_HIDDEN; void HTMLDocumentNode_OleCmd_Init(HTMLDocumentNode*) DECLSPEC_HIDDEN; +void HTMLDocumentNode_OleObj_Init(HTMLDocumentNode*) 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 fe050c9cf0a..a9bd8a3d558 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -138,27 +138,216 @@ static const IEnumUnknownVtbl EnumUnknownVtbl = { * IOleObject implementation */
-static inline HTMLDocument *impl_from_IOleObject(IOleObject *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IOleObject(IOleObject *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IOleObject_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IOleObject_iface); }
-static HRESULT WINAPI OleObject_QueryInterface(IOleObject *iface, REFIID riid, void **ppv) +static HRESULT WINAPI DocNodeOleObject_QueryInterface(IOleObject *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IOleObject(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static ULONG WINAPI OleObject_AddRef(IOleObject *iface) +static ULONG WINAPI DocNodeOleObject_AddRef(IOleObject *iface) { - HTMLDocument *This = impl_from_IOleObject(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + return htmldoc_addref(&This->basedoc); }
-static ULONG WINAPI OleObject_Release(IOleObject *iface) +static ULONG WINAPI DocNodeOleObject_Release(IOleObject *iface) { - HTMLDocument *This = impl_from_IOleObject(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI DocNodeOleObject_SetClientSite(IOleObject *iface, IOleClientSite *pClientSite) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + return IOleObject_SetClientSite(&This->basedoc.doc_obj->IOleObject_iface, pClientSite); +} + +static HRESULT WINAPI DocNodeOleObject_GetClientSite(IOleObject *iface, IOleClientSite **ppClientSite) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + return IOleObject_GetClientSite(&This->basedoc.doc_obj->IOleObject_iface, ppClientSite); +} + +static HRESULT WINAPI DocNodeOleObject_SetHostNames(IOleObject *iface, LPCOLESTR szContainerApp, LPCOLESTR szContainerObj) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + FIXME("(%p)->(%s %s)\n", This, debugstr_w(szContainerApp), debugstr_w(szContainerObj)); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeOleObject_Close(IOleObject *iface, DWORD dwSaveOption) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + return IOleObject_Close(&This->basedoc.doc_obj->IOleObject_iface, dwSaveOption); +} + +static HRESULT WINAPI DocNodeOleObject_SetMoniker(IOleObject *iface, DWORD dwWhichMoniker, IMoniker *pmk) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + FIXME("(%p %ld %p)->()\n", This, dwWhichMoniker, pmk); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeOleObject_GetMoniker(IOleObject *iface, DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + FIXME("(%p)->(%ld %ld %p)\n", This, dwAssign, dwWhichMoniker, ppmk); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeOleObject_InitFromData(IOleObject *iface, IDataObject *pDataObject, BOOL fCreation, + DWORD dwReserved) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + FIXME("(%p)->(%p %x %ld)\n", This, pDataObject, fCreation, dwReserved); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeOleObject_GetClipboardData(IOleObject *iface, DWORD dwReserved, IDataObject **ppDataObject) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + FIXME("(%p)->(%ld %p)\n", This, dwReserved, ppDataObject); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeOleObject_DoVerb(IOleObject *iface, LONG iVerb, LPMSG lpmsg, IOleClientSite *pActiveSite, + LONG lindex, HWND hwndParent, LPCRECT lprcPosRect) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + return IOleObject_DoVerb(&This->basedoc.doc_obj->IOleObject_iface, iVerb, lpmsg, pActiveSite, lindex, hwndParent, lprcPosRect); +} + +static HRESULT WINAPI DocNodeOleObject_EnumVerbs(IOleObject *iface, IEnumOLEVERB **ppEnumOleVerb) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + FIXME("(%p)->(%p)\n", This, ppEnumOleVerb); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeOleObject_Update(IOleObject *iface) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeOleObject_IsUpToDate(IOleObject *iface) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeOleObject_GetUserClassID(IOleObject *iface, CLSID *pClsid) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + return IOleObject_GetUserClassID(&This->basedoc.doc_obj->IOleObject_iface, pClsid); +} + +static HRESULT WINAPI DocNodeOleObject_GetUserType(IOleObject *iface, DWORD dwFormOfType, LPOLESTR *pszUserType) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + FIXME("(%p)->(%ld %p)\n", This, dwFormOfType, pszUserType); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeOleObject_SetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + return IOleObject_SetExtent(&This->basedoc.doc_obj->IOleObject_iface, dwDrawAspect, psizel); +} + +static HRESULT WINAPI DocNodeOleObject_GetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + return IOleObject_GetExtent(&This->basedoc.doc_obj->IOleObject_iface, dwDrawAspect, psizel); +} + +static HRESULT WINAPI DocNodeOleObject_Advise(IOleObject *iface, IAdviseSink *pAdvSink, DWORD *pdwConnection) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + return IOleObject_Advise(&This->basedoc.doc_obj->IOleObject_iface, pAdvSink, pdwConnection); +} + +static HRESULT WINAPI DocNodeOleObject_Unadvise(IOleObject *iface, DWORD dwConnection) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + return IOleObject_Unadvise(&This->basedoc.doc_obj->IOleObject_iface, dwConnection); +} + +static HRESULT WINAPI DocNodeOleObject_EnumAdvise(IOleObject *iface, IEnumSTATDATA **ppenumAdvise) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + return IOleObject_EnumAdvise(&This->basedoc.doc_obj->IOleObject_iface, ppenumAdvise); +} + +static HRESULT WINAPI DocNodeOleObject_GetMiscStatus(IOleObject *iface, DWORD dwAspect, DWORD *pdwStatus) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + FIXME("(%p)->(%ld %p)\n", This, dwAspect, pdwStatus); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeOleObject_SetColorScheme(IOleObject *iface, LOGPALETTE *pLogpal) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); + FIXME("(%p)->(%p)\n", This, pLogpal); + return E_NOTIMPL; +} + +static const IOleObjectVtbl DocNodeOleObjectVtbl = { + DocNodeOleObject_QueryInterface, + DocNodeOleObject_AddRef, + DocNodeOleObject_Release, + DocNodeOleObject_SetClientSite, + DocNodeOleObject_GetClientSite, + DocNodeOleObject_SetHostNames, + DocNodeOleObject_Close, + DocNodeOleObject_SetMoniker, + DocNodeOleObject_GetMoniker, + DocNodeOleObject_InitFromData, + DocNodeOleObject_GetClipboardData, + DocNodeOleObject_DoVerb, + DocNodeOleObject_EnumVerbs, + DocNodeOleObject_Update, + DocNodeOleObject_IsUpToDate, + DocNodeOleObject_GetUserClassID, + DocNodeOleObject_GetUserType, + DocNodeOleObject_SetExtent, + DocNodeOleObject_GetExtent, + DocNodeOleObject_Advise, + DocNodeOleObject_Unadvise, + DocNodeOleObject_EnumAdvise, + DocNodeOleObject_GetMiscStatus, + DocNodeOleObject_SetColorScheme +}; + +static inline HTMLDocumentObj *HTMLDocumentObj_from_IOleObject(IOleObject *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IOleObject_iface); +} + +static HRESULT WINAPI DocObjOleObject_QueryInterface(IOleObject *iface, REFIID riid, void **ppv) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); +} + +static ULONG WINAPI DocObjOleObject_AddRef(IOleObject *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface); + return htmldoc_addref(&This->basedoc); +} + +static ULONG WINAPI DocObjOleObject_Release(IOleObject *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface); + return htmldoc_release(&This->basedoc); }
static void update_hostinfo(HTMLDocumentObj *This, DOCHOSTUIINFO *hostinfo) @@ -241,12 +430,12 @@ static void load_settings(HTMLDocumentObj *doc) set_viewer_zoom(doc->nscontainer, (float)val/100000); }
-static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite *pClientSite) +static HRESULT WINAPI DocObjOleObject_SetClientSite(IOleObject *iface, IOleClientSite *pClientSite) { - HTMLDocument *This = impl_from_IOleObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface); + IBrowserService *browser_service; IOleCommandTarget *cmdtrg = NULL; IOleWindow *ole_window; - IBrowserService *browser_service; BOOL hostui_setup; VARIANT silent; HWND hwnd; @@ -254,83 +443,83 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
TRACE("(%p)->(%p)\n", This, pClientSite);
- if(pClientSite == This->doc_obj->client) + if(pClientSite == This->client) return S_OK;
- if(This->doc_obj->client) { - IOleClientSite_Release(This->doc_obj->client); - This->doc_obj->client = NULL; - This->doc_obj->nscontainer->usermode = UNKNOWN_USERMODE; + if(This->client) { + IOleClientSite_Release(This->client); + This->client = NULL; + This->nscontainer->usermode = UNKNOWN_USERMODE; }
- if(This->doc_obj->client_cmdtrg) { - IOleCommandTarget_Release(This->doc_obj->client_cmdtrg); - This->doc_obj->client_cmdtrg = NULL; + if(This->client_cmdtrg) { + IOleCommandTarget_Release(This->client_cmdtrg); + This->client_cmdtrg = NULL; }
- if(This->doc_obj->hostui && !This->doc_obj->custom_hostui) { - IDocHostUIHandler_Release(This->doc_obj->hostui); - This->doc_obj->hostui = NULL; + if(This->hostui && !This->custom_hostui) { + IDocHostUIHandler_Release(This->hostui); + This->hostui = NULL; }
- if(This->doc_obj->doc_object_service) { - IDocObjectService_Release(This->doc_obj->doc_object_service); - This->doc_obj->doc_object_service = NULL; + if(This->doc_object_service) { + IDocObjectService_Release(This->doc_object_service); + This->doc_object_service = NULL; }
- if(This->doc_obj->webbrowser) { - IUnknown_Release(This->doc_obj->webbrowser); - This->doc_obj->webbrowser = NULL; + if(This->webbrowser) { + IUnknown_Release(This->webbrowser); + This->webbrowser = NULL; }
- if(This->doc_obj->browser_service) { - IUnknown_Release(This->doc_obj->browser_service); - This->doc_obj->browser_service = NULL; + if(This->browser_service) { + IUnknown_Release(This->browser_service); + This->browser_service = NULL; }
- if(This->doc_obj->travel_log) { - ITravelLog_Release(This->doc_obj->travel_log); - This->doc_obj->travel_log = NULL; + if(This->travel_log) { + ITravelLog_Release(This->travel_log); + This->travel_log = NULL; }
- memset(&This->doc_obj->hostinfo, 0, sizeof(DOCHOSTUIINFO)); + memset(&This->hostinfo, 0, sizeof(DOCHOSTUIINFO));
if(!pClientSite) return S_OK;
IOleClientSite_AddRef(pClientSite); - This->doc_obj->client = pClientSite; + This->client = pClientSite;
- hostui_setup = This->doc_obj->hostui_setup; + hostui_setup = This->hostui_setup;
- if(!This->doc_obj->hostui) { + if(!This->hostui) { IDocHostUIHandler *uihandler;
- This->doc_obj->custom_hostui = FALSE; + This->custom_hostui = FALSE;
hres = IOleClientSite_QueryInterface(pClientSite, &IID_IDocHostUIHandler, (void**)&uihandler); if(SUCCEEDED(hres)) - This->doc_obj->hostui = uihandler; + This->hostui = uihandler; }
- if(This->doc_obj->hostui) { + if(This->hostui) { DOCHOSTUIINFO hostinfo; LPOLESTR key_path = NULL, override_key_path = NULL; IDocHostUIHandler2 *uihandler2;
memset(&hostinfo, 0, sizeof(DOCHOSTUIINFO)); hostinfo.cbSize = sizeof(DOCHOSTUIINFO); - hres = IDocHostUIHandler_GetHostInfo(This->doc_obj->hostui, &hostinfo); + hres = IDocHostUIHandler_GetHostInfo(This->hostui, &hostinfo); if(SUCCEEDED(hres)) { TRACE("hostinfo = {%lu %08lx %08lx %s %s}\n", hostinfo.cbSize, hostinfo.dwFlags, hostinfo.dwDoubleClick, debugstr_w(hostinfo.pchHostCss), debugstr_w(hostinfo.pchHostNS)); - update_hostinfo(This->doc_obj, &hostinfo); - This->doc_obj->hostinfo = hostinfo; + update_hostinfo(This, &hostinfo); + This->hostinfo = hostinfo; }
if(!hostui_setup) { - hres = IDocHostUIHandler_GetOptionKeyPath(This->doc_obj->hostui, &key_path, 0); + hres = IDocHostUIHandler_GetOptionKeyPath(This->hostui, &key_path, 0); if(hres == S_OK && key_path) { if(key_path[0]) { /* FIXME: use key_path */ @@ -339,7 +528,7 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite CoTaskMemFree(key_path); }
- hres = IDocHostUIHandler_QueryInterface(This->doc_obj->hostui, &IID_IDocHostUIHandler2, + hres = IDocHostUIHandler_QueryInterface(This->hostui, &IID_IDocHostUIHandler2, (void**)&uihandler2); if(SUCCEEDED(hres)) { hres = IDocHostUIHandler2_GetOverrideKeyPath(uihandler2, &override_key_path, 0); @@ -353,11 +542,11 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite IDocHostUIHandler2_Release(uihandler2); }
- This->doc_obj->hostui_setup = TRUE; + This->hostui_setup = TRUE; } }
- load_settings(This->doc_obj); + load_settings(This);
/* Native calls here GetWindow. What is it for? * We don't have anything to do with it here (yet). */ @@ -372,11 +561,11 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite if(SUCCEEDED(hres)) { ITravelLog *travel_log;
- This->doc_obj->browser_service = (IUnknown*)browser_service; + This->browser_service = (IUnknown*)browser_service;
hres = IBrowserService_GetTravelLog(browser_service, &travel_log); if(SUCCEEDED(hres)) - This->doc_obj->travel_log = travel_log; + This->travel_log = travel_log; }else { browser_service = NULL; } @@ -386,19 +575,19 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite VARIANT var; OLECMD cmd = {OLECMDID_SETPROGRESSTEXT, 0};
- This->doc_obj->client_cmdtrg = cmdtrg; + This->client_cmdtrg = cmdtrg;
if(!hostui_setup) { IDocObjectService *doc_object_service; IWebBrowser2 *wb;
- set_document_navigation(This->doc_obj, TRUE); + set_document_navigation(This, TRUE);
if(browser_service) { hres = IBrowserService_QueryInterface(browser_service, &IID_IDocObjectService, (void**)&doc_object_service); if(SUCCEEDED(hres)) { - This->doc_obj->doc_object_service = doc_object_service; + This->doc_object_service = doc_object_service;
/* * Some embedding routines, esp. in regards to use of IDocObjectService, differ if @@ -406,12 +595,12 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite */ hres = do_query_service((IUnknown*)pClientSite, &IID_IWebBrowserApp, &IID_IWebBrowser2, (void**)&wb); if(SUCCEEDED(hres)) - This->doc_obj->webbrowser = (IUnknown*)wb; + This->webbrowser = (IUnknown*)wb; } } }
- call_docview_84(This->doc_obj); + call_docview_84(This);
IOleCommandTarget_QueryStatus(cmdtrg, NULL, 1, &cmd, NULL);
@@ -423,13 +612,13 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL); }
- if(This->doc_obj->nscontainer->usermode == UNKNOWN_USERMODE) + if(This->nscontainer->usermode == UNKNOWN_USERMODE) IOleControl_OnAmbientPropertyChange(&This->IOleControl_iface, DISPID_AMBIENT_USERMODE);
IOleControl_OnAmbientPropertyChange(&This->IOleControl_iface, DISPID_AMBIENT_OFFLINEIFNOTCONNECTED);
- hres = get_client_disp_property(This->doc_obj->client, DISPID_AMBIENT_SILENT, &silent); + hres = get_client_disp_property(This->client, DISPID_AMBIENT_SILENT, &silent); if(SUCCEEDED(hres)) { if(V_VT(&silent) != VT_BOOL) WARN("silent = %s\n", debugstr_variant(&silent)); @@ -443,141 +632,141 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite return S_OK; }
-static HRESULT WINAPI OleObject_GetClientSite(IOleObject *iface, IOleClientSite **ppClientSite) +static HRESULT WINAPI DocObjOleObject_GetClientSite(IOleObject *iface, IOleClientSite **ppClientSite) { - HTMLDocument *This = impl_from_IOleObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface);
TRACE("(%p)->(%p)\n", This, ppClientSite);
if(!ppClientSite) return E_INVALIDARG;
- if(This->doc_obj->client) - IOleClientSite_AddRef(This->doc_obj->client); - *ppClientSite = This->doc_obj->client; + if(This->client) + IOleClientSite_AddRef(This->client); + *ppClientSite = This->client;
return S_OK; }
-static HRESULT WINAPI OleObject_SetHostNames(IOleObject *iface, LPCOLESTR szContainerApp, LPCOLESTR szContainerObj) +static HRESULT WINAPI DocObjOleObject_SetHostNames(IOleObject *iface, LPCOLESTR szContainerApp, LPCOLESTR szContainerObj) { - HTMLDocument *This = impl_from_IOleObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface); FIXME("(%p)->(%s %s)\n", This, debugstr_w(szContainerApp), debugstr_w(szContainerObj)); return E_NOTIMPL; }
-static HRESULT WINAPI OleObject_Close(IOleObject *iface, DWORD dwSaveOption) +static HRESULT WINAPI DocObjOleObject_Close(IOleObject *iface, DWORD dwSaveOption) { - HTMLDocument *This = impl_from_IOleObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface);
TRACE("(%p)->(%08lx)\n", This, dwSaveOption);
if(dwSaveOption == OLECLOSE_PROMPTSAVE) FIXME("OLECLOSE_PROMPTSAVE not implemented\n");
- if(This->doc_obj->in_place_active) + if(This->in_place_active) IOleInPlaceObjectWindowless_InPlaceDeactivate(&This->IOleInPlaceObjectWindowless_iface);
- HTMLDocument_LockContainer(This->doc_obj, FALSE); + HTMLDocument_LockContainer(This, FALSE); + + if(This->advise_holder) + IOleAdviseHolder_SendOnClose(This->advise_holder);
- if(This->doc_obj->advise_holder) - IOleAdviseHolder_SendOnClose(This->doc_obj->advise_holder); - return S_OK; }
-static HRESULT WINAPI OleObject_SetMoniker(IOleObject *iface, DWORD dwWhichMoniker, IMoniker *pmk) +static HRESULT WINAPI DocObjOleObject_SetMoniker(IOleObject *iface, DWORD dwWhichMoniker, IMoniker *pmk) { - HTMLDocument *This = impl_from_IOleObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface); FIXME("(%p %ld %p)->()\n", This, dwWhichMoniker, pmk); return E_NOTIMPL; }
-static HRESULT WINAPI OleObject_GetMoniker(IOleObject *iface, DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk) +static HRESULT WINAPI DocObjOleObject_GetMoniker(IOleObject *iface, DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk) { - HTMLDocument *This = impl_from_IOleObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface); FIXME("(%p)->(%ld %ld %p)\n", This, dwAssign, dwWhichMoniker, ppmk); return E_NOTIMPL; }
-static HRESULT WINAPI OleObject_InitFromData(IOleObject *iface, IDataObject *pDataObject, BOOL fCreation, - DWORD dwReserved) +static HRESULT WINAPI DocObjOleObject_InitFromData(IOleObject *iface, IDataObject *pDataObject, BOOL fCreation, + DWORD dwReserved) { - HTMLDocument *This = impl_from_IOleObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface); FIXME("(%p)->(%p %x %ld)\n", This, pDataObject, fCreation, dwReserved); return E_NOTIMPL; }
-static HRESULT WINAPI OleObject_GetClipboardData(IOleObject *iface, DWORD dwReserved, IDataObject **ppDataObject) +static HRESULT WINAPI DocObjOleObject_GetClipboardData(IOleObject *iface, DWORD dwReserved, IDataObject **ppDataObject) { - HTMLDocument *This = impl_from_IOleObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface); FIXME("(%p)->(%ld %p)\n", This, dwReserved, ppDataObject); return E_NOTIMPL; }
-static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG iVerb, LPMSG lpmsg, IOleClientSite *pActiveSite, - LONG lindex, HWND hwndParent, LPCRECT lprcPosRect) +static HRESULT WINAPI DocObjOleObject_DoVerb(IOleObject *iface, LONG iVerb, LPMSG lpmsg, IOleClientSite *pActiveSite, + LONG lindex, HWND hwndParent, LPCRECT lprcPosRect) { - HTMLDocument *This = impl_from_IOleObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface); IOleDocumentSite *pDocSite; HRESULT hres;
TRACE("(%p)->(%ld %p %p %ld %p %p)\n", This, iVerb, lpmsg, pActiveSite, lindex, hwndParent, lprcPosRect);
- if(iVerb != OLEIVERB_SHOW && iVerb != OLEIVERB_UIACTIVATE && iVerb != OLEIVERB_INPLACEACTIVATE) { + if(iVerb != OLEIVERB_SHOW && iVerb != OLEIVERB_UIACTIVATE && iVerb != OLEIVERB_INPLACEACTIVATE) { FIXME("iVerb = %ld not supported\n", iVerb); return E_NOTIMPL; }
if(!pActiveSite) - pActiveSite = This->doc_obj->client; + pActiveSite = This->client;
hres = IOleClientSite_QueryInterface(pActiveSite, &IID_IOleDocumentSite, (void**)&pDocSite); if(SUCCEEDED(hres)) { - HTMLDocument_LockContainer(This->doc_obj, TRUE); + HTMLDocument_LockContainer(This, TRUE);
/* FIXME: Create new IOleDocumentView. See CreateView for more info. */ - hres = IOleDocumentSite_ActivateMe(pDocSite, &This->doc_obj->IOleDocumentView_iface); + hres = IOleDocumentSite_ActivateMe(pDocSite, &This->IOleDocumentView_iface); IOleDocumentSite_Release(pDocSite); }else { - hres = IOleDocumentView_UIActivate(&This->doc_obj->IOleDocumentView_iface, TRUE); + hres = IOleDocumentView_UIActivate(&This->IOleDocumentView_iface, TRUE); if(SUCCEEDED(hres)) { if(lprcPosRect) { RECT rect; /* We need to pass rect as not const pointer */ rect = *lprcPosRect; - IOleDocumentView_SetRect(&This->doc_obj->IOleDocumentView_iface, &rect); + IOleDocumentView_SetRect(&This->IOleDocumentView_iface, &rect); } - IOleDocumentView_Show(&This->doc_obj->IOleDocumentView_iface, TRUE); + IOleDocumentView_Show(&This->IOleDocumentView_iface, TRUE); } }
return hres; }
-static HRESULT WINAPI OleObject_EnumVerbs(IOleObject *iface, IEnumOLEVERB **ppEnumOleVerb) +static HRESULT WINAPI DocObjOleObject_EnumVerbs(IOleObject *iface, IEnumOLEVERB **ppEnumOleVerb) { - HTMLDocument *This = impl_from_IOleObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface); FIXME("(%p)->(%p)\n", This, ppEnumOleVerb); return E_NOTIMPL; }
-static HRESULT WINAPI OleObject_Update(IOleObject *iface) +static HRESULT WINAPI DocObjOleObject_Update(IOleObject *iface) { - HTMLDocument *This = impl_from_IOleObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface); FIXME("(%p)\n", This); return E_NOTIMPL; }
-static HRESULT WINAPI OleObject_IsUpToDate(IOleObject *iface) +static HRESULT WINAPI DocObjOleObject_IsUpToDate(IOleObject *iface) { - HTMLDocument *This = impl_from_IOleObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface); FIXME("(%p)\n", This); return E_NOTIMPL; }
-static HRESULT WINAPI OleObject_GetUserClassID(IOleObject *iface, CLSID *pClsid) +static HRESULT WINAPI DocObjOleObject_GetUserClassID(IOleObject *iface, CLSID *pClsid) { - HTMLDocument *This = impl_from_IOleObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface);
TRACE("(%p)->(%p)\n", This, pClsid);
@@ -588,42 +777,42 @@ static HRESULT WINAPI OleObject_GetUserClassID(IOleObject *iface, CLSID *pClsid) return S_OK; }
-static HRESULT WINAPI OleObject_GetUserType(IOleObject *iface, DWORD dwFormOfType, LPOLESTR *pszUserType) +static HRESULT WINAPI DocObjOleObject_GetUserType(IOleObject *iface, DWORD dwFormOfType, LPOLESTR *pszUserType) { - HTMLDocument *This = impl_from_IOleObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface); FIXME("(%p)->(%ld %p)\n", This, dwFormOfType, pszUserType); return E_NOTIMPL; }
-static HRESULT WINAPI OleObject_SetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel) +static HRESULT WINAPI DocObjOleObject_SetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel) { - HTMLDocument *This = impl_from_IOleObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface);
TRACE("(%p)->(%ld %p)\n", This, dwDrawAspect, psizel);
if (dwDrawAspect != DVASPECT_CONTENT) return E_INVALIDARG;
- This->doc_obj->extent = *psizel; + This->extent = *psizel; return S_OK; }
-static HRESULT WINAPI OleObject_GetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel) +static HRESULT WINAPI DocObjOleObject_GetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel) { - HTMLDocument *This = impl_from_IOleObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface);
TRACE("(%p)->(%ld %p)\n", This, dwDrawAspect, psizel);
if (dwDrawAspect != DVASPECT_CONTENT) return E_INVALIDARG;
- *psizel = This->doc_obj->extent; + *psizel = This->extent; return S_OK; }
-static HRESULT WINAPI OleObject_Advise(IOleObject *iface, IAdviseSink *pAdvSink, DWORD *pdwConnection) +static HRESULT WINAPI DocObjOleObject_Advise(IOleObject *iface, IAdviseSink *pAdvSink, DWORD *pdwConnection) { - HTMLDocument *This = impl_from_IOleObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface); TRACE("(%p)->(%p %p)\n", This, pAdvSink, pdwConnection);
if(!pdwConnection) @@ -634,110 +823,164 @@ static HRESULT WINAPI OleObject_Advise(IOleObject *iface, IAdviseSink *pAdvSink, return E_INVALIDARG; }
- if(!This->doc_obj->advise_holder) { - CreateOleAdviseHolder(&This->doc_obj->advise_holder); - if(!This->doc_obj->advise_holder) + if(!This->advise_holder) { + CreateOleAdviseHolder(&This->advise_holder); + if(!This->advise_holder) return E_OUTOFMEMORY; }
- return IOleAdviseHolder_Advise(This->doc_obj->advise_holder, pAdvSink, pdwConnection); + return IOleAdviseHolder_Advise(This->advise_holder, pAdvSink, pdwConnection); }
-static HRESULT WINAPI OleObject_Unadvise(IOleObject *iface, DWORD dwConnection) +static HRESULT WINAPI DocObjOleObject_Unadvise(IOleObject *iface, DWORD dwConnection) { - HTMLDocument *This = impl_from_IOleObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface); TRACE("(%p)->(%ld)\n", This, dwConnection);
- if(!This->doc_obj->advise_holder) + if(!This->advise_holder) return OLE_E_NOCONNECTION;
- return IOleAdviseHolder_Unadvise(This->doc_obj->advise_holder, dwConnection); + return IOleAdviseHolder_Unadvise(This->advise_holder, dwConnection); }
-static HRESULT WINAPI OleObject_EnumAdvise(IOleObject *iface, IEnumSTATDATA **ppenumAdvise) +static HRESULT WINAPI DocObjOleObject_EnumAdvise(IOleObject *iface, IEnumSTATDATA **ppenumAdvise) { - HTMLDocument *This = impl_from_IOleObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface);
- if(!This->doc_obj->advise_holder) { + if(!This->advise_holder) { *ppenumAdvise = NULL; return S_OK; }
- return IOleAdviseHolder_EnumAdvise(This->doc_obj->advise_holder, ppenumAdvise); + return IOleAdviseHolder_EnumAdvise(This->advise_holder, ppenumAdvise); }
-static HRESULT WINAPI OleObject_GetMiscStatus(IOleObject *iface, DWORD dwAspect, DWORD *pdwStatus) +static HRESULT WINAPI DocObjOleObject_GetMiscStatus(IOleObject *iface, DWORD dwAspect, DWORD *pdwStatus) { - HTMLDocument *This = impl_from_IOleObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface); FIXME("(%p)->(%ld %p)\n", This, dwAspect, pdwStatus); return E_NOTIMPL; }
-static HRESULT WINAPI OleObject_SetColorScheme(IOleObject *iface, LOGPALETTE *pLogpal) +static HRESULT WINAPI DocObjOleObject_SetColorScheme(IOleObject *iface, LOGPALETTE *pLogpal) { - HTMLDocument *This = impl_from_IOleObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface); FIXME("(%p)->(%p)\n", This, pLogpal); return E_NOTIMPL; }
-static const IOleObjectVtbl OleObjectVtbl = { - OleObject_QueryInterface, - OleObject_AddRef, - OleObject_Release, - OleObject_SetClientSite, - OleObject_GetClientSite, - OleObject_SetHostNames, - OleObject_Close, - OleObject_SetMoniker, - OleObject_GetMoniker, - OleObject_InitFromData, - OleObject_GetClipboardData, - OleObject_DoVerb, - OleObject_EnumVerbs, - OleObject_Update, - OleObject_IsUpToDate, - OleObject_GetUserClassID, - OleObject_GetUserType, - OleObject_SetExtent, - OleObject_GetExtent, - OleObject_Advise, - OleObject_Unadvise, - OleObject_EnumAdvise, - OleObject_GetMiscStatus, - OleObject_SetColorScheme +static const IOleObjectVtbl DocObjOleObjectVtbl = { + DocObjOleObject_QueryInterface, + DocObjOleObject_AddRef, + DocObjOleObject_Release, + DocObjOleObject_SetClientSite, + DocObjOleObject_GetClientSite, + DocObjOleObject_SetHostNames, + DocObjOleObject_Close, + DocObjOleObject_SetMoniker, + DocObjOleObject_GetMoniker, + DocObjOleObject_InitFromData, + DocObjOleObject_GetClipboardData, + DocObjOleObject_DoVerb, + DocObjOleObject_EnumVerbs, + DocObjOleObject_Update, + DocObjOleObject_IsUpToDate, + DocObjOleObject_GetUserClassID, + DocObjOleObject_GetUserType, + DocObjOleObject_SetExtent, + DocObjOleObject_GetExtent, + DocObjOleObject_Advise, + DocObjOleObject_Unadvise, + DocObjOleObject_EnumAdvise, + DocObjOleObject_GetMiscStatus, + DocObjOleObject_SetColorScheme };
/********************************************************** * IOleDocument implementation */
-static inline HTMLDocument *impl_from_IOleDocument(IOleDocument *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IOleDocument(IOleDocument *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IOleDocument_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IOleDocument_iface); }
-static HRESULT WINAPI OleDocument_QueryInterface(IOleDocument *iface, REFIID riid, void **ppv) +static HRESULT WINAPI DocNodeOleDocument_QueryInterface(IOleDocument *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IOleDocument(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleDocument(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static ULONG WINAPI OleDocument_AddRef(IOleDocument *iface) +static ULONG WINAPI DocNodeOleDocument_AddRef(IOleDocument *iface) { - HTMLDocument *This = impl_from_IOleDocument(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleDocument(iface); + return htmldoc_addref(&This->basedoc); }
-static ULONG WINAPI OleDocument_Release(IOleDocument *iface) +static ULONG WINAPI DocNodeOleDocument_Release(IOleDocument *iface) { - HTMLDocument *This = impl_from_IOleDocument(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleDocument(iface); + return htmldoc_release(&This->basedoc); }
-static HRESULT WINAPI OleDocument_CreateView(IOleDocument *iface, IOleInPlaceSite *pIPSite, IStream *pstm, - DWORD dwReserved, IOleDocumentView **ppView) +static HRESULT WINAPI DocNodeOleDocument_CreateView(IOleDocument *iface, IOleInPlaceSite *pIPSite, IStream *pstm, + DWORD dwReserved, IOleDocumentView **ppView) { - HTMLDocument *This = impl_from_IOleDocument(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleDocument(iface); + return IOleDocument_CreateView(&This->basedoc.doc_obj->IOleDocument_iface, pIPSite, pstm, dwReserved, ppView); +} + +static HRESULT WINAPI DocNodeOleDocument_GetDocMiscStatus(IOleDocument *iface, DWORD *pdwStatus) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleDocument(iface); + FIXME("(%p)->(%p)\n", This, pdwStatus); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeOleDocument_EnumViews(IOleDocument *iface, IEnumOleDocumentViews **ppEnum, + IOleDocumentView **ppView) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleDocument(iface); + FIXME("(%p)->(%p %p)\n", This, ppEnum, ppView); + return E_NOTIMPL; +} + +static const IOleDocumentVtbl DocNodeOleDocumentVtbl = { + DocNodeOleDocument_QueryInterface, + DocNodeOleDocument_AddRef, + DocNodeOleDocument_Release, + DocNodeOleDocument_CreateView, + DocNodeOleDocument_GetDocMiscStatus, + DocNodeOleDocument_EnumViews +}; + +static inline HTMLDocumentObj *HTMLDocumentObj_from_IOleDocument(IOleDocument *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IOleDocument_iface); +} + +static HRESULT WINAPI DocObjOleDocument_QueryInterface(IOleDocument *iface, REFIID riid, void **ppv) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleDocument(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); +} + +static ULONG WINAPI DocObjOleDocument_AddRef(IOleDocument *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleDocument(iface); + return htmldoc_addref(&This->basedoc); +} + +static ULONG WINAPI DocObjOleDocument_Release(IOleDocument *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleDocument(iface); + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI DocObjOleDocument_CreateView(IOleDocument *iface, IOleInPlaceSite *pIPSite, IStream *pstm, + DWORD dwReserved, IOleDocumentView **ppView) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleDocument(iface); HRESULT hres;
TRACE("(%p)->(%p %p %ld %p)\n", This, pIPSite, pstm, dwReserved, ppView); @@ -753,7 +996,7 @@ static HRESULT WINAPI OleDocument_CreateView(IOleDocument *iface, IOleInPlaceSit */
if(pIPSite) { - hres = IOleDocumentView_SetInPlaceSite(&This->doc_obj->IOleDocumentView_iface, pIPSite); + hres = IOleDocumentView_SetInPlaceSite(&This->IOleDocumentView_iface, pIPSite); if(FAILED(hres)) return hres; } @@ -761,72 +1004,132 @@ static HRESULT WINAPI OleDocument_CreateView(IOleDocument *iface, IOleInPlaceSit if(pstm) FIXME("pstm is not supported\n");
- IOleDocumentView_AddRef(&This->doc_obj->IOleDocumentView_iface); - *ppView = &This->doc_obj->IOleDocumentView_iface; + IOleDocumentView_AddRef(&This->IOleDocumentView_iface); + *ppView = &This->IOleDocumentView_iface; return S_OK; }
-static HRESULT WINAPI OleDocument_GetDocMiscStatus(IOleDocument *iface, DWORD *pdwStatus) +static HRESULT WINAPI DocObjOleDocument_GetDocMiscStatus(IOleDocument *iface, DWORD *pdwStatus) { - HTMLDocument *This = impl_from_IOleDocument(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleDocument(iface); FIXME("(%p)->(%p)\n", This, pdwStatus); return E_NOTIMPL; }
-static HRESULT WINAPI OleDocument_EnumViews(IOleDocument *iface, IEnumOleDocumentViews **ppEnum, - IOleDocumentView **ppView) +static HRESULT WINAPI DocObjOleDocument_EnumViews(IOleDocument *iface, IEnumOleDocumentViews **ppEnum, + IOleDocumentView **ppView) { - HTMLDocument *This = impl_from_IOleDocument(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleDocument(iface); FIXME("(%p)->(%p %p)\n", This, ppEnum, ppView); return E_NOTIMPL; }
-static const IOleDocumentVtbl OleDocumentVtbl = { - OleDocument_QueryInterface, - OleDocument_AddRef, - OleDocument_Release, - OleDocument_CreateView, - OleDocument_GetDocMiscStatus, - OleDocument_EnumViews +static const IOleDocumentVtbl DocObjOleDocumentVtbl = { + DocObjOleDocument_QueryInterface, + DocObjOleDocument_AddRef, + DocObjOleDocument_Release, + DocObjOleDocument_CreateView, + DocObjOleDocument_GetDocMiscStatus, + DocObjOleDocument_EnumViews };
/********************************************************** * IOleControl implementation */
-static inline HTMLDocument *impl_from_IOleControl(IOleControl *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IOleControl(IOleControl *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentNode, IOleControl_iface); +} + +static HRESULT WINAPI DocNodeOleControl_QueryInterface(IOleControl *iface, REFIID riid, void **ppv) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleControl(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); +} + +static ULONG WINAPI DocNodeOleControl_AddRef(IOleControl *iface) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleControl(iface); + return htmldoc_addref(&This->basedoc); +} + +static ULONG WINAPI DocNodeOleControl_Release(IOleControl *iface) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleControl(iface); + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI DocNodeOleControl_GetControlInfo(IOleControl *iface, CONTROLINFO *pCI) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleControl(iface); + FIXME("(%p)->(%p)\n", This, pCI); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeOleControl_OnMnemonic(IOleControl *iface, MSG *pMsg) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleControl(iface); + FIXME("(%p)->(%p)\n", This, pMsg); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeOleControl_OnAmbientPropertyChange(IOleControl *iface, DISPID dispID) { - return CONTAINING_RECORD(iface, HTMLDocument, IOleControl_iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleControl(iface); + return IOleControl_OnAmbientPropertyChange(&This->basedoc.doc_obj->IOleControl_iface, dispID); }
-static HRESULT WINAPI OleControl_QueryInterface(IOleControl *iface, REFIID riid, void **ppv) +static HRESULT WINAPI DocNodeOleControl_FreezeEvents(IOleControl *iface, BOOL bFreeze) { - HTMLDocument *This = impl_from_IOleControl(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleControl(iface); + FIXME("(%p)->(%x)\n", This, bFreeze); + return E_NOTIMPL; }
-static ULONG WINAPI OleControl_AddRef(IOleControl *iface) +static const IOleControlVtbl DocNodeOleControlVtbl = { + DocNodeOleControl_QueryInterface, + DocNodeOleControl_AddRef, + DocNodeOleControl_Release, + DocNodeOleControl_GetControlInfo, + DocNodeOleControl_OnMnemonic, + DocNodeOleControl_OnAmbientPropertyChange, + DocNodeOleControl_FreezeEvents +}; + +static inline HTMLDocumentObj *HTMLDocumentObj_from_IOleControl(IOleControl *iface) { - HTMLDocument *This = impl_from_IOleControl(iface); - return htmldoc_addref(This); + return CONTAINING_RECORD(iface, HTMLDocumentObj, IOleControl_iface); }
-static ULONG WINAPI OleControl_Release(IOleControl *iface) +static HRESULT WINAPI DocObjOleControl_QueryInterface(IOleControl *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IOleControl(iface); - return htmldoc_release(This); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleControl(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static HRESULT WINAPI OleControl_GetControlInfo(IOleControl *iface, CONTROLINFO *pCI) +static ULONG WINAPI DocObjOleControl_AddRef(IOleControl *iface) { - HTMLDocument *This = impl_from_IOleControl(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleControl(iface); + return htmldoc_addref(&This->basedoc); +} + +static ULONG WINAPI DocObjOleControl_Release(IOleControl *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleControl(iface); + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI DocObjOleControl_GetControlInfo(IOleControl *iface, CONTROLINFO *pCI) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleControl(iface); FIXME("(%p)->(%p)\n", This, pCI); return E_NOTIMPL; }
-static HRESULT WINAPI OleControl_OnMnemonic(IOleControl *iface, MSG *pMsg) +static HRESULT WINAPI DocObjOleControl_OnMnemonic(IOleControl *iface, MSG *pMsg) { - HTMLDocument *This = impl_from_IOleControl(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleControl(iface); FIXME("(%p)->(%p)\n", This, pMsg); return E_NOTIMPL; } @@ -854,26 +1157,26 @@ HRESULT get_client_disp_property(IOleClientSite *client, DISPID dispid, VARIANT return hres; }
-static HRESULT on_change_dlcontrol(HTMLDocument *This) +static HRESULT on_change_dlcontrol(HTMLDocumentObj *This) { VARIANT res; HRESULT hres; - - hres = get_client_disp_property(This->doc_obj->client, DISPID_AMBIENT_DLCONTROL, &res); + + hres = get_client_disp_property(This->client, DISPID_AMBIENT_DLCONTROL, &res); if(SUCCEEDED(hres)) FIXME("unsupported dlcontrol %08lx\n", V_I4(&res));
return S_OK; }
-static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DISPID dispID) +static HRESULT WINAPI DocObjOleControl_OnAmbientPropertyChange(IOleControl *iface, DISPID dispID) { - HTMLDocument *This = impl_from_IOleControl(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleControl(iface); IOleClientSite *client; VARIANT res; HRESULT hres;
- client = This->doc_obj->client; + client = This->client; if(!client) { TRACE("client = NULL\n"); return S_OK; @@ -888,10 +1191,10 @@ static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DIS
if(V_VT(&res) == VT_BOOL) { if(V_BOOL(&res)) { - This->doc_obj->nscontainer->usermode = BROWSEMODE; + This->nscontainer->usermode = BROWSEMODE; }else { FIXME("edit mode is not supported\n"); - This->doc_obj->nscontainer->usermode = EDITMODE; + This->nscontainer->usermode = EDITMODE; } }else { FIXME("usermode=%s\n", debugstr_variant(&res)); @@ -953,226 +1256,406 @@ static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DIS return E_FAIL; }
-static HRESULT WINAPI OleControl_FreezeEvents(IOleControl *iface, BOOL bFreeze) +static HRESULT WINAPI DocObjOleControl_FreezeEvents(IOleControl *iface, BOOL bFreeze) { - HTMLDocument *This = impl_from_IOleControl(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleControl(iface); FIXME("(%p)->(%x)\n", This, bFreeze); return E_NOTIMPL; }
-static const IOleControlVtbl OleControlVtbl = { - OleControl_QueryInterface, - OleControl_AddRef, - OleControl_Release, - OleControl_GetControlInfo, - OleControl_OnMnemonic, - OleControl_OnAmbientPropertyChange, - OleControl_FreezeEvents +static const IOleControlVtbl DocObjOleControlVtbl = { + DocObjOleControl_QueryInterface, + DocObjOleControl_AddRef, + DocObjOleControl_Release, + DocObjOleControl_GetControlInfo, + DocObjOleControl_OnMnemonic, + DocObjOleControl_OnAmbientPropertyChange, + DocObjOleControl_FreezeEvents };
/********************************************************** * IOleInPlaceActiveObject implementation */
-static inline HTMLDocument *impl_from_IOleInPlaceActiveObject(IOleInPlaceActiveObject *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IOleInPlaceActiveObject(IOleInPlaceActiveObject *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentNode, IOleInPlaceActiveObject_iface); +} + +static HRESULT WINAPI DocNodeOleInPlaceActiveObject_QueryInterface(IOleInPlaceActiveObject *iface, REFIID riid, void **ppv) { - return CONTAINING_RECORD(iface, HTMLDocument, IOleInPlaceActiveObject_iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceActiveObject(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static HRESULT WINAPI OleInPlaceActiveObject_QueryInterface(IOleInPlaceActiveObject *iface, REFIID riid, void **ppv) +static ULONG WINAPI DocNodeOleInPlaceActiveObject_AddRef(IOleInPlaceActiveObject *iface) { - HTMLDocument *This = impl_from_IOleInPlaceActiveObject(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceActiveObject(iface); + return htmldoc_addref(&This->basedoc); }
-static ULONG WINAPI OleInPlaceActiveObject_AddRef(IOleInPlaceActiveObject *iface) +static ULONG WINAPI DocNodeOleInPlaceActiveObject_Release(IOleInPlaceActiveObject *iface) { - HTMLDocument *This = impl_from_IOleInPlaceActiveObject(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceActiveObject(iface); + return htmldoc_release(&This->basedoc); }
-static ULONG WINAPI OleInPlaceActiveObject_Release(IOleInPlaceActiveObject *iface) +static HRESULT WINAPI DocNodeOleInPlaceActiveObject_GetWindow(IOleInPlaceActiveObject *iface, HWND *phwnd) { - HTMLDocument *This = impl_from_IOleInPlaceActiveObject(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceActiveObject(iface); + return IOleInPlaceActiveObject_GetWindow(&This->basedoc.doc_obj->IOleInPlaceActiveObject_iface, phwnd); }
-static HRESULT WINAPI OleInPlaceActiveObject_GetWindow(IOleInPlaceActiveObject *iface, HWND *phwnd) +static HRESULT WINAPI DocNodeOleInPlaceActiveObject_ContextSensitiveHelp(IOleInPlaceActiveObject *iface, BOOL fEnterMode) { - HTMLDocument *This = impl_from_IOleInPlaceActiveObject(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceActiveObject(iface); + FIXME("(%p)->(%x)\n", This, fEnterMode); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeOleInPlaceActiveObject_TranslateAccelerator(IOleInPlaceActiveObject *iface, LPMSG lpmsg) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceActiveObject(iface); + FIXME("(%p)->(%p)\n", This, lpmsg); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeOleInPlaceActiveObject_OnFrameWindowActivate(IOleInPlaceActiveObject *iface, + BOOL fActivate) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceActiveObject(iface); + return IOleInPlaceActiveObject_OnFrameWindowActivate(&This->basedoc.doc_obj->IOleInPlaceActiveObject_iface, fActivate); +} + +static HRESULT WINAPI DocNodeOleInPlaceActiveObject_OnDocWindowActivate(IOleInPlaceActiveObject *iface, BOOL fActivate) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceActiveObject(iface); + FIXME("(%p)->(%x)\n", This, fActivate); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeOleInPlaceActiveObject_ResizeBorder(IOleInPlaceActiveObject *iface, LPCRECT prcBorder, + IOleInPlaceUIWindow *pUIWindow, BOOL fFrameWindow) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceActiveObject(iface); + FIXME("(%p)->(%p %p %x)\n", This, prcBorder, pUIWindow, fFrameWindow); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeOleInPlaceActiveObject_EnableModeless(IOleInPlaceActiveObject *iface, BOOL fEnable) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceActiveObject(iface); + FIXME("(%p)->(%x)\n", This, fEnable); + return E_NOTIMPL; +} + +static const IOleInPlaceActiveObjectVtbl DocNodeOleInPlaceActiveObjectVtbl = { + DocNodeOleInPlaceActiveObject_QueryInterface, + DocNodeOleInPlaceActiveObject_AddRef, + DocNodeOleInPlaceActiveObject_Release, + DocNodeOleInPlaceActiveObject_GetWindow, + DocNodeOleInPlaceActiveObject_ContextSensitiveHelp, + DocNodeOleInPlaceActiveObject_TranslateAccelerator, + DocNodeOleInPlaceActiveObject_OnFrameWindowActivate, + DocNodeOleInPlaceActiveObject_OnDocWindowActivate, + DocNodeOleInPlaceActiveObject_ResizeBorder, + DocNodeOleInPlaceActiveObject_EnableModeless +}; + +static inline HTMLDocumentObj *HTMLDocumentObj_from_IOleInPlaceActiveObject(IOleInPlaceActiveObject *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IOleInPlaceActiveObject_iface); +} + +static HRESULT WINAPI DocObjOleInPlaceActiveObject_QueryInterface(IOleInPlaceActiveObject *iface, REFIID riid, void **ppv) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceActiveObject(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); +} + +static ULONG WINAPI DocObjOleInPlaceActiveObject_AddRef(IOleInPlaceActiveObject *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceActiveObject(iface); + return htmldoc_addref(&This->basedoc); +} + +static ULONG WINAPI DocObjOleInPlaceActiveObject_Release(IOleInPlaceActiveObject *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceActiveObject(iface); + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI DocObjOleInPlaceActiveObject_GetWindow(IOleInPlaceActiveObject *iface, HWND *phwnd) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceActiveObject(iface);
TRACE("(%p)->(%p)\n", This, phwnd);
if(!phwnd) return E_INVALIDARG;
- if(!This->doc_obj->in_place_active) { + if(!This->in_place_active) { *phwnd = NULL; return E_FAIL; }
- *phwnd = This->doc_obj->hwnd; + *phwnd = This->hwnd; return S_OK; }
-static HRESULT WINAPI OleInPlaceActiveObject_ContextSensitiveHelp(IOleInPlaceActiveObject *iface, BOOL fEnterMode) +static HRESULT WINAPI DocObjOleInPlaceActiveObject_ContextSensitiveHelp(IOleInPlaceActiveObject *iface, BOOL fEnterMode) { - HTMLDocument *This = impl_from_IOleInPlaceActiveObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceActiveObject(iface); FIXME("(%p)->(%x)\n", This, fEnterMode); return E_NOTIMPL; }
-static HRESULT WINAPI OleInPlaceActiveObject_TranslateAccelerator(IOleInPlaceActiveObject *iface, LPMSG lpmsg) +static HRESULT WINAPI DocObjOleInPlaceActiveObject_TranslateAccelerator(IOleInPlaceActiveObject *iface, LPMSG lpmsg) { - HTMLDocument *This = impl_from_IOleInPlaceActiveObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceActiveObject(iface); FIXME("(%p)->(%p)\n", This, lpmsg); return E_NOTIMPL; }
-static HRESULT WINAPI OleInPlaceActiveObject_OnFrameWindowActivate(IOleInPlaceActiveObject *iface, +static HRESULT WINAPI DocObjOleInPlaceActiveObject_OnFrameWindowActivate(IOleInPlaceActiveObject *iface, BOOL fActivate) { - HTMLDocument *This = impl_from_IOleInPlaceActiveObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceActiveObject(iface);
TRACE("(%p)->(%x)\n", This, fActivate);
- if(This->doc_obj->hostui) - IDocHostUIHandler_OnFrameWindowActivate(This->doc_obj->hostui, fActivate); + if(This->hostui) + IDocHostUIHandler_OnFrameWindowActivate(This->hostui, fActivate);
return S_OK; }
-static HRESULT WINAPI OleInPlaceActiveObject_OnDocWindowActivate(IOleInPlaceActiveObject *iface, BOOL fActivate) +static HRESULT WINAPI DocObjOleInPlaceActiveObject_OnDocWindowActivate(IOleInPlaceActiveObject *iface, BOOL fActivate) { - HTMLDocument *This = impl_from_IOleInPlaceActiveObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceActiveObject(iface); FIXME("(%p)->(%x)\n", This, fActivate); return E_NOTIMPL; }
-static HRESULT WINAPI OleInPlaceActiveObject_ResizeBorder(IOleInPlaceActiveObject *iface, LPCRECT prcBorder, - IOleInPlaceUIWindow *pUIWindow, BOOL fFrameWindow) +static HRESULT WINAPI DocObjOleInPlaceActiveObject_ResizeBorder(IOleInPlaceActiveObject *iface, LPCRECT prcBorder, + IOleInPlaceUIWindow *pUIWindow, BOOL fFrameWindow) { - HTMLDocument *This = impl_from_IOleInPlaceActiveObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceActiveObject(iface); FIXME("(%p)->(%p %p %x)\n", This, prcBorder, pUIWindow, fFrameWindow); return E_NOTIMPL; }
-static HRESULT WINAPI OleInPlaceActiveObject_EnableModeless(IOleInPlaceActiveObject *iface, BOOL fEnable) +static HRESULT WINAPI DocObjOleInPlaceActiveObject_EnableModeless(IOleInPlaceActiveObject *iface, BOOL fEnable) { - HTMLDocument *This = impl_from_IOleInPlaceActiveObject(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceActiveObject(iface); FIXME("(%p)->(%x)\n", This, fEnable); return E_NOTIMPL; }
-static const IOleInPlaceActiveObjectVtbl OleInPlaceActiveObjectVtbl = { - OleInPlaceActiveObject_QueryInterface, - OleInPlaceActiveObject_AddRef, - OleInPlaceActiveObject_Release, - OleInPlaceActiveObject_GetWindow, - OleInPlaceActiveObject_ContextSensitiveHelp, - OleInPlaceActiveObject_TranslateAccelerator, - OleInPlaceActiveObject_OnFrameWindowActivate, - OleInPlaceActiveObject_OnDocWindowActivate, - OleInPlaceActiveObject_ResizeBorder, - OleInPlaceActiveObject_EnableModeless +static const IOleInPlaceActiveObjectVtbl DocObjOleInPlaceActiveObjectVtbl = { + DocObjOleInPlaceActiveObject_QueryInterface, + DocObjOleInPlaceActiveObject_AddRef, + DocObjOleInPlaceActiveObject_Release, + DocObjOleInPlaceActiveObject_GetWindow, + DocObjOleInPlaceActiveObject_ContextSensitiveHelp, + DocObjOleInPlaceActiveObject_TranslateAccelerator, + DocObjOleInPlaceActiveObject_OnFrameWindowActivate, + DocObjOleInPlaceActiveObject_OnDocWindowActivate, + DocObjOleInPlaceActiveObject_ResizeBorder, + DocObjOleInPlaceActiveObject_EnableModeless };
/********************************************************** * IOleInPlaceObjectWindowless implementation */
-static inline HTMLDocument *impl_from_IOleInPlaceObjectWindowless(IOleInPlaceObjectWindowless *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IOleInPlaceObjectWindowless(IOleInPlaceObjectWindowless *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IOleInPlaceObjectWindowless_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IOleInPlaceObjectWindowless_iface); }
-static HRESULT WINAPI OleInPlaceObjectWindowless_QueryInterface(IOleInPlaceObjectWindowless *iface, +static HRESULT WINAPI DocNodeOleInPlaceObjectWindowless_QueryInterface(IOleInPlaceObjectWindowless *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IOleInPlaceObjectWindowless(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceObjectWindowless(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static ULONG WINAPI OleInPlaceObjectWindowless_AddRef(IOleInPlaceObjectWindowless *iface) +static ULONG WINAPI DocNodeOleInPlaceObjectWindowless_AddRef(IOleInPlaceObjectWindowless *iface) { - HTMLDocument *This = impl_from_IOleInPlaceObjectWindowless(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceObjectWindowless(iface); + return htmldoc_addref(&This->basedoc); }
-static ULONG WINAPI OleInPlaceObjectWindowless_Release(IOleInPlaceObjectWindowless *iface) +static ULONG WINAPI DocNodeOleInPlaceObjectWindowless_Release(IOleInPlaceObjectWindowless *iface) { - HTMLDocument *This = impl_from_IOleInPlaceObjectWindowless(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceObjectWindowless(iface); + return htmldoc_release(&This->basedoc); }
-static HRESULT WINAPI OleInPlaceObjectWindowless_GetWindow(IOleInPlaceObjectWindowless *iface, +static HRESULT WINAPI DocNodeOleInPlaceObjectWindowless_GetWindow(IOleInPlaceObjectWindowless *iface, HWND *phwnd) { - HTMLDocument *This = impl_from_IOleInPlaceObjectWindowless(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceObjectWindowless(iface); return IOleInPlaceActiveObject_GetWindow(&This->IOleInPlaceActiveObject_iface, phwnd); }
-static HRESULT WINAPI OleInPlaceObjectWindowless_ContextSensitiveHelp(IOleInPlaceObjectWindowless *iface, +static HRESULT WINAPI DocNodeOleInPlaceObjectWindowless_ContextSensitiveHelp(IOleInPlaceObjectWindowless *iface, BOOL fEnterMode) { - HTMLDocument *This = impl_from_IOleInPlaceObjectWindowless(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceObjectWindowless(iface); return IOleInPlaceActiveObject_ContextSensitiveHelp(&This->IOleInPlaceActiveObject_iface, fEnterMode); }
-static HRESULT WINAPI OleInPlaceObjectWindowless_InPlaceDeactivate(IOleInPlaceObjectWindowless *iface) +static HRESULT WINAPI DocNodeOleInPlaceObjectWindowless_InPlaceDeactivate(IOleInPlaceObjectWindowless *iface) { - HTMLDocument *This = impl_from_IOleInPlaceObjectWindowless(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceObjectWindowless(iface); + return IOleInPlaceObjectWindowless_InPlaceDeactivate(&This->basedoc.doc_obj->IOleInPlaceObjectWindowless_iface); +} + +static HRESULT WINAPI DocNodeOleInPlaceObjectWindowless_UIDeactivate(IOleInPlaceObjectWindowless *iface) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceObjectWindowless(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeOleInPlaceObjectWindowless_SetObjectRects(IOleInPlaceObjectWindowless *iface, + const RECT *pos, const RECT *clip) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceObjectWindowless(iface); + return IOleInPlaceObjectWindowless_SetObjectRects(&This->basedoc.doc_obj->IOleInPlaceObjectWindowless_iface, pos, clip); +} + +static HRESULT WINAPI DocNodeOleInPlaceObjectWindowless_ReactivateAndUndo(IOleInPlaceObjectWindowless *iface) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceObjectWindowless(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeOleInPlaceObjectWindowless_OnWindowMessage(IOleInPlaceObjectWindowless *iface, + UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *lpResult) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceObjectWindowless(iface); + FIXME("(%p)->(%u %Iu %Iu %p)\n", This, msg, wParam, lParam, lpResult); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeOleInPlaceObjectWindowless_GetDropTarget(IOleInPlaceObjectWindowless *iface, + IDropTarget **ppDropTarget) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceObjectWindowless(iface); + FIXME("(%p)->(%p)\n", This, ppDropTarget); + return E_NOTIMPL; +} + +static const IOleInPlaceObjectWindowlessVtbl DocNodeOleInPlaceObjectWindowlessVtbl = { + DocNodeOleInPlaceObjectWindowless_QueryInterface, + DocNodeOleInPlaceObjectWindowless_AddRef, + DocNodeOleInPlaceObjectWindowless_Release, + DocNodeOleInPlaceObjectWindowless_GetWindow, + DocNodeOleInPlaceObjectWindowless_ContextSensitiveHelp, + DocNodeOleInPlaceObjectWindowless_InPlaceDeactivate, + DocNodeOleInPlaceObjectWindowless_UIDeactivate, + DocNodeOleInPlaceObjectWindowless_SetObjectRects, + DocNodeOleInPlaceObjectWindowless_ReactivateAndUndo, + DocNodeOleInPlaceObjectWindowless_OnWindowMessage, + DocNodeOleInPlaceObjectWindowless_GetDropTarget +}; + +static inline HTMLDocumentObj *HTMLDocumentObj_from_IOleInPlaceObjectWindowless(IOleInPlaceObjectWindowless *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IOleInPlaceObjectWindowless_iface); +} + +static HRESULT WINAPI DocObjOleInPlaceObjectWindowless_QueryInterface(IOleInPlaceObjectWindowless *iface, + REFIID riid, void **ppv) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceObjectWindowless(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); +} + +static ULONG WINAPI DocObjOleInPlaceObjectWindowless_AddRef(IOleInPlaceObjectWindowless *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceObjectWindowless(iface); + return htmldoc_addref(&This->basedoc); +} + +static ULONG WINAPI DocObjOleInPlaceObjectWindowless_Release(IOleInPlaceObjectWindowless *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceObjectWindowless(iface); + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI DocObjOleInPlaceObjectWindowless_GetWindow(IOleInPlaceObjectWindowless *iface, + HWND *phwnd) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceObjectWindowless(iface); + return IOleInPlaceActiveObject_GetWindow(&This->IOleInPlaceActiveObject_iface, phwnd); +} + +static HRESULT WINAPI DocObjOleInPlaceObjectWindowless_ContextSensitiveHelp(IOleInPlaceObjectWindowless *iface, + BOOL fEnterMode) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceObjectWindowless(iface); + return IOleInPlaceActiveObject_ContextSensitiveHelp(&This->IOleInPlaceActiveObject_iface, fEnterMode); +} + +static HRESULT WINAPI DocObjOleInPlaceObjectWindowless_InPlaceDeactivate(IOleInPlaceObjectWindowless *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceObjectWindowless(iface);
TRACE("(%p)\n", This);
- if(This->doc_obj->ui_active) - IOleDocumentView_UIActivate(&This->doc_obj->IOleDocumentView_iface, FALSE); - This->doc_obj->window_active = FALSE; + if(This->ui_active) + IOleDocumentView_UIActivate(&This->IOleDocumentView_iface, FALSE); + This->window_active = FALSE;
- if(!This->doc_obj->in_place_active) + if(!This->in_place_active) return S_OK;
- if(This->doc_obj->frame) { - IOleInPlaceFrame_Release(This->doc_obj->frame); - This->doc_obj->frame = NULL; + if(This->frame) { + IOleInPlaceFrame_Release(This->frame); + This->frame = NULL; }
- if(This->doc_obj->hwnd) { - ShowWindow(This->doc_obj->hwnd, SW_HIDE); - SetWindowPos(This->doc_obj->hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); + if(This->hwnd) { + ShowWindow(This->hwnd, SW_HIDE); + SetWindowPos(This->hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); }
- This->doc_obj->focus = FALSE; - notif_focus(This->doc_obj); + This->focus = FALSE; + notif_focus(This);
- This->doc_obj->in_place_active = FALSE; - if(This->doc_obj->ipsite) { + This->in_place_active = FALSE; + if(This->ipsite) { IOleInPlaceSiteEx *ipsiteex; HRESULT hres;
- hres = IOleInPlaceSite_QueryInterface(This->doc_obj->ipsite, &IID_IOleInPlaceSiteEx, (void**)&ipsiteex); + hres = IOleInPlaceSite_QueryInterface(This->ipsite, &IID_IOleInPlaceSiteEx, (void**)&ipsiteex); if(SUCCEEDED(hres)) { IOleInPlaceSiteEx_OnInPlaceDeactivateEx(ipsiteex, TRUE); IOleInPlaceSiteEx_Release(ipsiteex); }else { - IOleInPlaceSite_OnInPlaceDeactivate(This->doc_obj->ipsite); + IOleInPlaceSite_OnInPlaceDeactivate(This->ipsite); } }
return S_OK; }
-static HRESULT WINAPI OleInPlaceObjectWindowless_UIDeactivate(IOleInPlaceObjectWindowless *iface) +static HRESULT WINAPI DocObjOleInPlaceObjectWindowless_UIDeactivate(IOleInPlaceObjectWindowless *iface) { - HTMLDocument *This = impl_from_IOleInPlaceObjectWindowless(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceObjectWindowless(iface); FIXME("(%p)\n", This); return E_NOTIMPL; }
-static HRESULT WINAPI OleInPlaceObjectWindowless_SetObjectRects(IOleInPlaceObjectWindowless *iface, +static HRESULT WINAPI DocObjOleInPlaceObjectWindowless_SetObjectRects(IOleInPlaceObjectWindowless *iface, const RECT *pos, const RECT *clip) { - HTMLDocument *This = impl_from_IOleInPlaceObjectWindowless(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceObjectWindowless(iface); RECT r;
TRACE("(%p)->(%s %s)\n", This, wine_dbgstr_rect(pos), wine_dbgstr_rect(clip)); @@ -1181,133 +1664,231 @@ static HRESULT WINAPI OleInPlaceObjectWindowless_SetObjectRects(IOleInPlaceObjec FIXME("Ignoring clip rect %s\n", wine_dbgstr_rect(clip));
r = *pos; - return IOleDocumentView_SetRect(&This->doc_obj->IOleDocumentView_iface, &r); + return IOleDocumentView_SetRect(&This->IOleDocumentView_iface, &r); }
-static HRESULT WINAPI OleInPlaceObjectWindowless_ReactivateAndUndo(IOleInPlaceObjectWindowless *iface) +static HRESULT WINAPI DocObjOleInPlaceObjectWindowless_ReactivateAndUndo(IOleInPlaceObjectWindowless *iface) { - HTMLDocument *This = impl_from_IOleInPlaceObjectWindowless(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceObjectWindowless(iface); FIXME("(%p)\n", This); return E_NOTIMPL; }
-static HRESULT WINAPI OleInPlaceObjectWindowless_OnWindowMessage(IOleInPlaceObjectWindowless *iface, +static HRESULT WINAPI DocObjOleInPlaceObjectWindowless_OnWindowMessage(IOleInPlaceObjectWindowless *iface, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *lpResult) { - HTMLDocument *This = impl_from_IOleInPlaceObjectWindowless(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceObjectWindowless(iface); FIXME("(%p)->(%u %Iu %Iu %p)\n", This, msg, wParam, lParam, lpResult); return E_NOTIMPL; }
-static HRESULT WINAPI OleInPlaceObjectWindowless_GetDropTarget(IOleInPlaceObjectWindowless *iface, +static HRESULT WINAPI DocObjOleInPlaceObjectWindowless_GetDropTarget(IOleInPlaceObjectWindowless *iface, IDropTarget **ppDropTarget) { - HTMLDocument *This = impl_from_IOleInPlaceObjectWindowless(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceObjectWindowless(iface); FIXME("(%p)->(%p)\n", This, ppDropTarget); return E_NOTIMPL; }
-static const IOleInPlaceObjectWindowlessVtbl OleInPlaceObjectWindowlessVtbl = { - OleInPlaceObjectWindowless_QueryInterface, - OleInPlaceObjectWindowless_AddRef, - OleInPlaceObjectWindowless_Release, - OleInPlaceObjectWindowless_GetWindow, - OleInPlaceObjectWindowless_ContextSensitiveHelp, - OleInPlaceObjectWindowless_InPlaceDeactivate, - OleInPlaceObjectWindowless_UIDeactivate, - OleInPlaceObjectWindowless_SetObjectRects, - OleInPlaceObjectWindowless_ReactivateAndUndo, - OleInPlaceObjectWindowless_OnWindowMessage, - OleInPlaceObjectWindowless_GetDropTarget +static const IOleInPlaceObjectWindowlessVtbl DocObjOleInPlaceObjectWindowlessVtbl = { + DocObjOleInPlaceObjectWindowless_QueryInterface, + DocObjOleInPlaceObjectWindowless_AddRef, + DocObjOleInPlaceObjectWindowless_Release, + DocObjOleInPlaceObjectWindowless_GetWindow, + DocObjOleInPlaceObjectWindowless_ContextSensitiveHelp, + DocObjOleInPlaceObjectWindowless_InPlaceDeactivate, + DocObjOleInPlaceObjectWindowless_UIDeactivate, + DocObjOleInPlaceObjectWindowless_SetObjectRects, + DocObjOleInPlaceObjectWindowless_ReactivateAndUndo, + DocObjOleInPlaceObjectWindowless_OnWindowMessage, + DocObjOleInPlaceObjectWindowless_GetDropTarget };
/********************************************************** * IObjectWithSite implementation */
-static inline HTMLDocument *impl_from_IObjectWithSite(IObjectWithSite *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IObjectWithSite(IObjectWithSite *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentNode, IObjectWithSite_iface); +} + +static HRESULT WINAPI DocNodeObjectWithSite_QueryInterface(IObjectWithSite *iface, REFIID riid, void **ppv) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IObjectWithSite(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); +} + +static ULONG WINAPI DocNodeObjectWithSite_AddRef(IObjectWithSite *iface) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IObjectWithSite(iface); + return htmldoc_addref(&This->basedoc); +} + +static ULONG WINAPI DocNodeObjectWithSite_Release(IObjectWithSite *iface) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IObjectWithSite(iface); + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI DocNodeObjectWithSite_SetSite(IObjectWithSite *iface, IUnknown *pUnkSite) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IObjectWithSite(iface); + FIXME("(%p)->(%p)\n", This, pUnkSite); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeObjectWithSite_GetSite(IObjectWithSite* iface, REFIID riid, PVOID *ppvSite) { - return CONTAINING_RECORD(iface, HTMLDocument, IObjectWithSite_iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IObjectWithSite(iface); + FIXME("(%p)->(%p)\n", This, ppvSite); + return E_NOTIMPL; }
-static HRESULT WINAPI ObjectWithSite_QueryInterface(IObjectWithSite *iface, REFIID riid, void **ppv) +static const IObjectWithSiteVtbl DocNodeObjectWithSiteVtbl = { + DocNodeObjectWithSite_QueryInterface, + DocNodeObjectWithSite_AddRef, + DocNodeObjectWithSite_Release, + DocNodeObjectWithSite_SetSite, + DocNodeObjectWithSite_GetSite +}; + +static inline HTMLDocumentObj *HTMLDocumentObj_from_IObjectWithSite(IObjectWithSite *iface) { - HTMLDocument *This = impl_from_IObjectWithSite(iface); - return htmldoc_query_interface(This, riid, ppv); + return CONTAINING_RECORD(iface, HTMLDocumentObj, IObjectWithSite_iface); }
-static ULONG WINAPI ObjectWithSite_AddRef(IObjectWithSite *iface) +static HRESULT WINAPI DocObjObjectWithSite_QueryInterface(IObjectWithSite *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IObjectWithSite(iface); - return htmldoc_addref(This); + HTMLDocumentObj *This = HTMLDocumentObj_from_IObjectWithSite(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static ULONG WINAPI ObjectWithSite_Release(IObjectWithSite *iface) +static ULONG WINAPI DocObjObjectWithSite_AddRef(IObjectWithSite *iface) { - HTMLDocument *This = impl_from_IObjectWithSite(iface); - return htmldoc_release(This); + HTMLDocumentObj *This = HTMLDocumentObj_from_IObjectWithSite(iface); + return htmldoc_addref(&This->basedoc); }
-static HRESULT WINAPI ObjectWithSite_SetSite(IObjectWithSite *iface, IUnknown *pUnkSite) +static ULONG WINAPI DocObjObjectWithSite_Release(IObjectWithSite *iface) { - HTMLDocument *This = impl_from_IObjectWithSite(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IObjectWithSite(iface); + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI DocObjObjectWithSite_SetSite(IObjectWithSite *iface, IUnknown *pUnkSite) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IObjectWithSite(iface); FIXME("(%p)->(%p)\n", This, pUnkSite); return E_NOTIMPL; }
-static HRESULT WINAPI ObjectWithSite_GetSite(IObjectWithSite* iface, REFIID riid, PVOID *ppvSite) +static HRESULT WINAPI DocObjObjectWithSite_GetSite(IObjectWithSite* iface, REFIID riid, PVOID *ppvSite) { - HTMLDocument *This = impl_from_IObjectWithSite(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IObjectWithSite(iface); FIXME("(%p)->(%p)\n", This, ppvSite); return E_NOTIMPL; }
-static const IObjectWithSiteVtbl ObjectWithSiteVtbl = { - ObjectWithSite_QueryInterface, - ObjectWithSite_AddRef, - ObjectWithSite_Release, - ObjectWithSite_SetSite, - ObjectWithSite_GetSite +static const IObjectWithSiteVtbl DocObjObjectWithSiteVtbl = { + DocObjObjectWithSite_QueryInterface, + DocObjObjectWithSite_AddRef, + DocObjObjectWithSite_Release, + DocObjObjectWithSite_SetSite, + DocObjObjectWithSite_GetSite };
/********************************************************** * IOleContainer implementation */
-static inline HTMLDocument *impl_from_IOleContainer(IOleContainer *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IOleContainer(IOleContainer *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentNode, IOleContainer_iface); +} + +static HRESULT WINAPI DocNodeOleContainer_QueryInterface(IOleContainer *iface, REFIID riid, void **ppv) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleContainer(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); +} + +static ULONG WINAPI DocNodeOleContainer_AddRef(IOleContainer *iface) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleContainer(iface); + return htmldoc_addref(&This->basedoc); +} + +static ULONG WINAPI DocNodeOleContainer_Release(IOleContainer *iface) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleContainer(iface); + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI DocNodeOleContainer_ParseDisplayName(IOleContainer *iface, IBindCtx *pbc, LPOLESTR pszDisplayName, + ULONG *pchEaten, IMoniker **ppmkOut) { - return CONTAINING_RECORD(iface, HTMLDocument, IOleContainer_iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleContainer(iface); + FIXME("(%p)->(%p %s %p %p)\n", This, pbc, debugstr_w(pszDisplayName), pchEaten, ppmkOut); + return E_NOTIMPL; }
-static HRESULT WINAPI OleContainer_QueryInterface(IOleContainer *iface, REFIID riid, void **ppv) +static HRESULT WINAPI DocNodeOleContainer_EnumObjects(IOleContainer *iface, DWORD grfFlags, IEnumUnknown **ppenum) { - HTMLDocument *This = impl_from_IOleContainer(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleContainer(iface); + return IOleContainer_EnumObjects(&This->basedoc.doc_obj->IOleContainer_iface, grfFlags, ppenum); }
-static ULONG WINAPI OleContainer_AddRef(IOleContainer *iface) +static HRESULT WINAPI DocNodeOleContainer_LockContainer(IOleContainer *iface, BOOL fLock) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IOleContainer(iface); + FIXME("(%p)->(%x)\n", This, fLock); + return E_NOTIMPL; +} + +static const IOleContainerVtbl DocNodeOleContainerVtbl = { + DocNodeOleContainer_QueryInterface, + DocNodeOleContainer_AddRef, + DocNodeOleContainer_Release, + DocNodeOleContainer_ParseDisplayName, + DocNodeOleContainer_EnumObjects, + DocNodeOleContainer_LockContainer +}; + +static inline HTMLDocumentObj *HTMLDocumentObj_from_IOleContainer(IOleContainer *iface) { - HTMLDocument *This = impl_from_IOleContainer(iface); - return htmldoc_addref(This); + return CONTAINING_RECORD(iface, HTMLDocumentObj, IOleContainer_iface); }
-static ULONG WINAPI OleContainer_Release(IOleContainer *iface) +static HRESULT WINAPI DocObjOleContainer_QueryInterface(IOleContainer *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IOleContainer(iface); - return htmldoc_release(This); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleContainer(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static HRESULT WINAPI OleContainer_ParseDisplayName(IOleContainer *iface, IBindCtx *pbc, LPOLESTR pszDisplayName, +static ULONG WINAPI DocObjOleContainer_AddRef(IOleContainer *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleContainer(iface); + return htmldoc_addref(&This->basedoc); +} + +static ULONG WINAPI DocObjOleContainer_Release(IOleContainer *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleContainer(iface); + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI DocObjOleContainer_ParseDisplayName(IOleContainer *iface, IBindCtx *pbc, LPOLESTR pszDisplayName, ULONG *pchEaten, IMoniker **ppmkOut) { - HTMLDocument *This = impl_from_IOleContainer(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleContainer(iface); FIXME("(%p)->(%p %s %p %p)\n", This, pbc, debugstr_w(pszDisplayName), pchEaten, ppmkOut); return E_NOTIMPL; }
-static HRESULT WINAPI OleContainer_EnumObjects(IOleContainer *iface, DWORD grfFlags, IEnumUnknown **ppenum) +static HRESULT WINAPI DocObjOleContainer_EnumObjects(IOleContainer *iface, DWORD grfFlags, IEnumUnknown **ppenum) { - HTMLDocument *This = impl_from_IOleContainer(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleContainer(iface); EnumUnknown *ret;
TRACE("(%p)->(%lx %p)\n", This, grfFlags, ppenum); @@ -1323,20 +1904,20 @@ static HRESULT WINAPI OleContainer_EnumObjects(IOleContainer *iface, DWORD grfFl return S_OK; }
-static HRESULT WINAPI OleContainer_LockContainer(IOleContainer *iface, BOOL fLock) +static HRESULT WINAPI DocObjOleContainer_LockContainer(IOleContainer *iface, BOOL fLock) { - HTMLDocument *This = impl_from_IOleContainer(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IOleContainer(iface); FIXME("(%p)->(%x)\n", This, fLock); return E_NOTIMPL; }
-static const IOleContainerVtbl OleContainerVtbl = { - OleContainer_QueryInterface, - OleContainer_AddRef, - OleContainer_Release, - OleContainer_ParseDisplayName, - OleContainer_EnumObjects, - OleContainer_LockContainer +static const IOleContainerVtbl DocObjOleContainerVtbl = { + DocObjOleContainer_QueryInterface, + DocObjOleContainer_AddRef, + DocObjOleContainer_Release, + DocObjOleContainer_ParseDisplayName, + DocObjOleContainer_EnumObjects, + DocObjOleContainer_LockContainer };
static inline HTMLDocumentObj *impl_from_ITargetContainer(ITargetContainer *iface) @@ -1376,8 +1957,8 @@ static HRESULT WINAPI TargetContainer_GetFramesContainer(ITargetContainer *iface TRACE("(%p)->(%p)\n", This, ppContainer);
/* NOTE: we should return wrapped interface here */ - IOleContainer_AddRef(&This->basedoc.IOleContainer_iface); - *ppContainer = &This->basedoc.IOleContainer_iface; + IOleContainer_AddRef(&This->IOleContainer_iface); + *ppContainer = &This->IOleContainer_iface; return S_OK; }
@@ -1398,41 +1979,88 @@ void TargetContainer_Init(HTMLDocumentObj *This) * IObjectSafety implementation */
-static inline HTMLDocument *impl_from_IObjectSafety(IObjectSafety *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IObjectSafety(IObjectSafety *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentNode, IObjectSafety_iface); +} + +static HRESULT WINAPI DocNodeObjectSafety_QueryInterface(IObjectSafety *iface, REFIID riid, void **ppv) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IObjectSafety(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); +} + +static ULONG WINAPI DocNodeObjectSafety_AddRef(IObjectSafety *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IObjectSafety_iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IObjectSafety(iface); + return htmldoc_addref(&This->basedoc); }
-static HRESULT WINAPI ObjectSafety_QueryInterface(IObjectSafety *iface, REFIID riid, void **ppv) +static ULONG WINAPI DocNodeObjectSafety_Release(IObjectSafety *iface) { - HTMLDocument *This = impl_from_IObjectSafety(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = HTMLDocumentNode_from_IObjectSafety(iface); + return htmldoc_release(&This->basedoc); }
-static ULONG WINAPI ObjectSafety_AddRef(IObjectSafety *iface) +static HRESULT WINAPI DocNodeObjectSafety_GetInterfaceSafetyOptions(IObjectSafety *iface, + REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions) { - HTMLDocument *This = impl_from_IObjectSafety(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IObjectSafety(iface); + FIXME("(%p)->(%s %p %p)\n", This, debugstr_guid(riid), pdwSupportedOptions, pdwEnabledOptions); + return E_NOTIMPL; }
-static ULONG WINAPI ObjectSafety_Release(IObjectSafety *iface) +static HRESULT WINAPI DocNodeObjectSafety_SetInterfaceSafetyOptions(IObjectSafety *iface, + REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IObjectSafety(iface); + return IObjectSafety_SetInterfaceSafetyOptions(&This->basedoc.doc_obj->IObjectSafety_iface, + riid, dwOptionSetMask, dwEnabledOptions); +} + +static const IObjectSafetyVtbl DocNodeObjectSafetyVtbl = { + DocNodeObjectSafety_QueryInterface, + DocNodeObjectSafety_AddRef, + DocNodeObjectSafety_Release, + DocNodeObjectSafety_GetInterfaceSafetyOptions, + DocNodeObjectSafety_SetInterfaceSafetyOptions +}; + +static inline HTMLDocumentObj *HTMLDocumentObj_from_IObjectSafety(IObjectSafety *iface) { - HTMLDocument *This = impl_from_IObjectSafety(iface); - return htmldoc_release(This); + return CONTAINING_RECORD(iface, HTMLDocumentObj, IObjectSafety_iface); }
-static HRESULT WINAPI ObjectSafety_GetInterfaceSafetyOptions(IObjectSafety *iface, +static HRESULT WINAPI DocObjObjectSafety_QueryInterface(IObjectSafety *iface, REFIID riid, void **ppv) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IObjectSafety(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); +} + +static ULONG WINAPI DocObjObjectSafety_AddRef(IObjectSafety *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IObjectSafety(iface); + return htmldoc_addref(&This->basedoc); +} + +static ULONG WINAPI DocObjObjectSafety_Release(IObjectSafety *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IObjectSafety(iface); + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI DocObjObjectSafety_GetInterfaceSafetyOptions(IObjectSafety *iface, REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions) { - HTMLDocument *This = impl_from_IObjectSafety(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IObjectSafety(iface); FIXME("(%p)->(%s %p %p)\n", This, debugstr_guid(riid), pdwSupportedOptions, pdwEnabledOptions); return E_NOTIMPL; }
-static HRESULT WINAPI ObjectSafety_SetInterfaceSafetyOptions(IObjectSafety *iface, +static HRESULT WINAPI DocObjObjectSafety_SetInterfaceSafetyOptions(IObjectSafety *iface, REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions) { - HTMLDocument *This = impl_from_IObjectSafety(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IObjectSafety(iface); FIXME("(%p)->(%s %lx %lx)\n", This, debugstr_guid(riid), dwOptionSetMask, dwEnabledOptions);
if(IsEqualGUID(&IID_IPersistMoniker, riid) && @@ -1443,12 +2071,12 @@ static HRESULT WINAPI ObjectSafety_SetInterfaceSafetyOptions(IObjectSafety *ifac return E_NOTIMPL; }
-static const IObjectSafetyVtbl ObjectSafetyVtbl = { - ObjectSafety_QueryInterface, - ObjectSafety_AddRef, - ObjectSafety_Release, - ObjectSafety_GetInterfaceSafetyOptions, - ObjectSafety_SetInterfaceSafetyOptions +static const IObjectSafetyVtbl DocObjObjectSafetyVtbl = { + DocObjObjectSafety_QueryInterface, + DocObjObjectSafety_AddRef, + DocObjObjectSafety_Release, + DocObjObjectSafety_GetInterfaceSafetyOptions, + DocObjObjectSafety_SetInterfaceSafetyOptions };
void HTMLDocument_LockContainer(HTMLDocumentObj *This, BOOL fLock) @@ -1467,16 +2095,30 @@ void HTMLDocument_LockContainer(HTMLDocumentObj *This, BOOL fLock) } }
-void HTMLDocument_OleObj_Init(HTMLDocument *This) -{ - This->IOleObject_iface.lpVtbl = &OleObjectVtbl; - This->IOleDocument_iface.lpVtbl = &OleDocumentVtbl; - This->IOleControl_iface.lpVtbl = &OleControlVtbl; - This->IOleInPlaceActiveObject_iface.lpVtbl = &OleInPlaceActiveObjectVtbl; - This->IOleInPlaceObjectWindowless_iface.lpVtbl = &OleInPlaceObjectWindowlessVtbl; - This->IObjectWithSite_iface.lpVtbl = &ObjectWithSiteVtbl; - This->IOleContainer_iface.lpVtbl = &OleContainerVtbl; - This->IObjectSafety_iface.lpVtbl = &ObjectSafetyVtbl; - This->doc_obj->extent.cx = 1; - This->doc_obj->extent.cy = 1; +void HTMLDocumentNode_OleObj_Init(HTMLDocumentNode *This) +{ + This->IOleObject_iface.lpVtbl = &DocNodeOleObjectVtbl; + This->IOleDocument_iface.lpVtbl = &DocNodeOleDocumentVtbl; + This->IOleControl_iface.lpVtbl = &DocNodeOleControlVtbl; + This->IOleInPlaceActiveObject_iface.lpVtbl = &DocNodeOleInPlaceActiveObjectVtbl; + This->IOleInPlaceObjectWindowless_iface.lpVtbl = &DocNodeOleInPlaceObjectWindowlessVtbl; + This->IObjectWithSite_iface.lpVtbl = &DocNodeObjectWithSiteVtbl; + This->IOleContainer_iface.lpVtbl = &DocNodeOleContainerVtbl; + This->IObjectSafety_iface.lpVtbl = &DocNodeObjectSafetyVtbl; + This->basedoc.doc_obj->extent.cx = 1; + This->basedoc.doc_obj->extent.cy = 1; +} + +void HTMLDocumentObj_OleObj_Init(HTMLDocumentObj *This) +{ + This->IOleObject_iface.lpVtbl = &DocObjOleObjectVtbl; + This->IOleDocument_iface.lpVtbl = &DocObjOleDocumentVtbl; + This->IOleControl_iface.lpVtbl = &DocObjOleControlVtbl; + This->IOleInPlaceActiveObject_iface.lpVtbl = &DocObjOleInPlaceActiveObjectVtbl; + This->IOleInPlaceObjectWindowless_iface.lpVtbl = &DocObjOleInPlaceObjectWindowlessVtbl; + This->IObjectWithSite_iface.lpVtbl = &DocObjObjectWithSiteVtbl; + This->IOleContainer_iface.lpVtbl = &DocObjOleContainerVtbl; + This->IObjectSafety_iface.lpVtbl = &DocObjObjectSafetyVtbl; + This->extent.cx = 1; + This->extent.cy = 1; } diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index 691c9e6e17d..1f8e47b936f 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c @@ -685,7 +685,7 @@ static HRESULT WINAPI DocObjPersistMoniker_Load(IPersistMoniker *iface, BOOL fFu hres = IUnknown_QueryInterface(unk, &IID_IOleClientSite, (void**)&client); if(SUCCEEDED(hres)) { TRACE("Got client site %p\n", client); - IOleObject_SetClientSite(&This->basedoc.IOleObject_iface, client); + IOleObject_SetClientSite(&This->IOleObject_iface, client); IOleClientSite_Release(client); }
@@ -1508,7 +1508,7 @@ static HRESULT WINAPI DocNodeHlinkTarget_Navigate(IHlinkTarget *iface, DWORD grf FIXME("JumpLocation not supported\n");
if(This->basedoc.doc_obj->client) - return IOleObject_DoVerb(&This->basedoc.IOleObject_iface, OLEIVERB_SHOW, NULL, NULL, -1, NULL, NULL); + return IOleObject_DoVerb(&This->IOleObject_iface, OLEIVERB_SHOW, NULL, NULL, -1, NULL, NULL);
return IHlinkTarget_Navigate(&This->basedoc.doc_obj->IHlinkTarget_iface, grfHLNF, pwzJumpLocation); } @@ -1602,7 +1602,7 @@ static HRESULT WINAPI DocObjHlinkTarget_Navigate(IHlinkTarget *iface, DWORD grfH return S_OK; }
- return IOleObject_DoVerb(&This->basedoc.IOleObject_iface, OLEIVERB_SHOW, NULL, NULL, -1, NULL, NULL); + return IOleObject_DoVerb(&This->IOleObject_iface, OLEIVERB_SHOW, NULL, NULL, -1, NULL, NULL); }
static HRESULT WINAPI DocObjHlinkTarget_GetMoniker(IHlinkTarget *iface, LPCWSTR pwzLocation, DWORD dwAssign, diff --git a/dlls/mshtml/pluginhost.c b/dlls/mshtml/pluginhost.c index 043f9bad3a0..444834043d4 100644 --- a/dlls/mshtml/pluginhost.c +++ b/dlls/mshtml/pluginhost.c @@ -1602,7 +1602,7 @@ static HRESULT WINAPI PHClientSite_GetContainer(IOleClientSite *iface, IOleConta return E_UNEXPECTED; }
- *ppContainer = &This->doc->basedoc.IOleContainer_iface; + *ppContainer = &This->doc->IOleContainer_iface; IOleContainer_AddRef(*ppContainer); return S_OK; } diff --git a/dlls/mshtml/view.c b/dlls/mshtml/view.c index 239124012b4..b66d6653ee0 100644 --- a/dlls/mshtml/view.c +++ b/dlls/mshtml/view.c @@ -541,7 +541,7 @@ static HRESULT WINAPI OleDocumentView_Show(IOleDocumentView *iface, BOOL fShow) ShowWindow(This->hwnd, SW_HIDE);
if(This->in_place_active) - IOleInPlaceObjectWindowless_InPlaceDeactivate(&This->basedoc.IOleInPlaceObjectWindowless_iface); + IOleInPlaceObjectWindowless_InPlaceDeactivate(&This->IOleInPlaceObjectWindowless_iface);
if(This->ip_window) { IOleInPlaceUIWindow_Release(This->ip_window); @@ -612,8 +612,7 @@ static HRESULT WINAPI OleDocumentView_UIActivate(IOleDocumentView *iface, BOOL f
hres = IOleInPlaceSite_OnUIActivate(This->ipsite); if(SUCCEEDED(hres)) { - call_set_active_object((IOleInPlaceUIWindow*)This->frame, - &This->basedoc.IOleInPlaceActiveObject_iface); + call_set_active_object((IOleInPlaceUIWindow*)This->frame, &This->IOleInPlaceActiveObject_iface); }else { FIXME("OnUIActivate failed: %08lx\n", hres); IOleInPlaceFrame_Release(This->frame); @@ -625,14 +624,14 @@ static HRESULT WINAPI OleDocumentView_UIActivate(IOleDocumentView *iface, BOOL f if(This->hostui) { hres = IDocHostUIHandler_ShowUI(This->hostui, This->nscontainer->usermode == EDITMODE ? DOCHOSTUITYPE_AUTHOR : DOCHOSTUITYPE_BROWSE, - &This->basedoc.IOleInPlaceActiveObject_iface, &This->IOleCommandTarget_iface, + &This->IOleInPlaceActiveObject_iface, &This->IOleCommandTarget_iface, This->frame, This->ip_window); if(FAILED(hres)) IDocHostUIHandler_HideUI(This->hostui); }
if(This->ip_window) - call_set_active_object(This->ip_window, &This->basedoc.IOleInPlaceActiveObject_iface); + call_set_active_object(This->ip_window, &This->IOleInPlaceActiveObject_iface);
SetRectEmpty(&rcBorderWidths); IOleInPlaceFrame_SetBorderSpace(This->frame, &rcBorderWidths);
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=125052
Your paranoid android.
=== debian11 (32 bit report) ===
ddraw: ddraw7.c:15663: Test failed: Expected unsynchronised map for flags 0x1000. ddraw7.c:15663: Test failed: Expected unsynchronised map for flags 0x3000.
=== debian11 (build log) ===
Use of uninitialized value $Flaky in addition (+) at /home/testbot/lib/WineTestBot/LogUtils.pm line 720, <$LogFile> line 24755. Use of uninitialized value $Flaky in addition (+) at /home/testbot/lib/WineTestBot/LogUtils.pm line 720, <$LogFile> line 24755. Use of uninitialized value $Flaky in addition (+) at /home/testbot/lib/WineTestBot/LogUtils.pm line 720, <$LogFile> line 24755.
This merge request was approved by Jacek Caban.