shdocvw: Move connection points to the new ConnectionPointContainer struct.

This commit is contained in:
Jacek Caban 2006-05-17 18:25:33 +02:00 committed by Alexandre Julliard
parent 6137e1b60a
commit 7c7603ca1e
5 changed files with 27 additions and 25 deletions

View File

@ -51,8 +51,8 @@ static void navigate_complete(DocHost *This)
V_VT(&url) = VT_BSTR;
V_BSTR(&url) = This->url;
call_sink(This->cp_wbe2, DISPID_NAVIGATECOMPLETE2, &dispparams);
call_sink(This->cp_wbe2, DISPID_DOCUMENTCOMPLETE, &dispparams);
call_sink(This->cps.wbe2, DISPID_NAVIGATECOMPLETE2, &dispparams);
call_sink(This->cps.wbe2, DISPID_DOCUMENTCOMPLETE, &dispparams);
if(disp)
IDispatch_Release(disp);

View File

@ -88,13 +88,13 @@ static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPo
if(IsEqualGUID(&DIID_DWebBrowserEvents2, riid)) {
TRACE("(%p)->(DIID_DWebBrowserEvents2 %p)\n", This, ppCP);
*ppCP = CONPOINT(This->doc_host.cp_wbe2);
*ppCP = CONPOINT(This->doc_host.cps.wbe2);
}else if(IsEqualGUID(&DIID_DWebBrowserEvents, riid)) {
TRACE("(%p)->(DIID_DWebBrowserEvents %p)\n", This, ppCP);
*ppCP = CONPOINT(This->doc_host.cp_wbe);
*ppCP = CONPOINT(This->doc_host.cps.wbe);
}else if(IsEqualGUID(&IID_IPropertyNotifySink, riid)) {
TRACE("(%p)->(IID_IPropertyNotifySink %p)\n", This, ppCP);
*ppCP = CONPOINT(This->doc_host.cp_pns);
*ppCP = CONPOINT(This->doc_host.cps.pns);
}
if(*ppCP) {
@ -299,23 +299,23 @@ static void ConnectionPoint_Destroy(ConnectionPoint *This)
void DocHost_Events_Init(DocHost *This)
{
ConnectionPoint_Create(This, &DIID_DWebBrowserEvents2, &This->cp_wbe2);
ConnectionPoint_Create(This, &DIID_DWebBrowserEvents, &This->cp_wbe);
ConnectionPoint_Create(This, &IID_IPropertyNotifySink, &This->cp_pns);
ConnectionPoint_Create(This, &DIID_DWebBrowserEvents2, &This->cps.wbe2);
ConnectionPoint_Create(This, &DIID_DWebBrowserEvents, &This->cps.wbe);
ConnectionPoint_Create(This, &IID_IPropertyNotifySink, &This->cps.pns);
}
void DocHost_Events_Release(DocHost *This)
{
ConnectionPoint_Destroy(This->cp_wbe2);
ConnectionPoint_Destroy(This->cp_wbe);
ConnectionPoint_Destroy(This->cp_pns);
ConnectionPoint_Destroy(This->cps.wbe2);
ConnectionPoint_Destroy(This->cps.wbe);
ConnectionPoint_Destroy(This->cps.pns);
}
void WebBrowser_Events_Init(WebBrowser *This)
{
This->lpConnectionPointContainerVtbl = &ConnectionPointContainerVtbl;
This->doc_host.cp_wbe2->container = CONPTCONT(This);
This->doc_host.cp_wbe->container = CONPTCONT(This);
This->doc_host.cp_pns->container = CONPTCONT(This);
This->doc_host.cps.wbe2->container = CONPTCONT(This);
This->doc_host.cps.wbe->container = CONPTCONT(This);
This->doc_host.cps.pns->container = CONPTCONT(This);
}

View File

@ -373,7 +373,7 @@ static void on_before_navigate2(DocHost *This, LPWSTR url, PBYTE post_data, ULON
V_VT(params+6) = (VT_DISPATCH);
V_DISPATCH(params+6) = This->disp;
call_sink(This->cp_wbe2, DISPID_BEFORENAVIGATE2, &dispparams);
call_sink(This->cps.wbe2, DISPID_BEFORENAVIGATE2, &dispparams);
SysFreeString(V_BSTR(&var_url));
if(post_data_len)

View File

@ -51,6 +51,12 @@ extern HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid,
typedef struct ConnectionPoint ConnectionPoint;
typedef struct {
ConnectionPoint *wbe2;
ConnectionPoint *wbe;
ConnectionPoint *pns;
} ConnectionPointContainer;
typedef struct {
const IOleClientSiteVtbl *lpOleClientSiteVtbl;
const IOleInPlaceSiteVtbl *lpOleInPlaceSiteVtbl;
@ -74,11 +80,7 @@ typedef struct {
LPOLESTR url;
/* Connection points */
ConnectionPoint *cp_wbe2;
ConnectionPoint *cp_wbe;
ConnectionPoint *cp_pns;
ConnectionPointContainer cps;
} DocHost;
typedef struct {

View File

@ -518,7 +518,7 @@ static HRESULT WINAPI WebBrowser_put_Visible(IWebBrowser2 *iface, VARIANT_BOOL V
V_VT(&arg) = VT_BOOL;
V_BOOL(&arg) = Value;
call_sink(This->doc_host.cp_wbe2, DISPID_ONVISIBLE, &dispparams);
call_sink(This->doc_host.cps.wbe2, DISPID_ONVISIBLE, &dispparams);
return S_OK;
}
@ -548,7 +548,7 @@ static HRESULT WINAPI WebBrowser_put_StatusBar(IWebBrowser2 *iface, VARIANT_BOOL
V_VT(&arg) = VT_BOOL;
V_BOOL(&arg) = Value;
call_sink(This->doc_host.cp_wbe2, DISPID_ONSTATUSBAR, &dispparams);
call_sink(This->doc_host.cps.wbe2, DISPID_ONSTATUSBAR, &dispparams);
return S_OK;
}
@ -592,7 +592,7 @@ static HRESULT WINAPI WebBrowser_put_ToolBar(IWebBrowser2 *iface, int Value)
V_VT(&arg) = VT_BOOL;
V_BOOL(&arg) = Value;
call_sink(This->doc_host.cp_wbe2, DISPID_ONTOOLBAR, &dispparams);
call_sink(This->doc_host.cps.wbe2, DISPID_ONTOOLBAR, &dispparams);
return S_OK;
}
@ -622,7 +622,7 @@ static HRESULT WINAPI WebBrowser_put_MenuBar(IWebBrowser2 *iface, VARIANT_BOOL V
V_VT(&arg) = VT_BOOL;
V_BOOL(&arg) = Value;
call_sink(This->doc_host.cp_wbe2, DISPID_ONMENUBAR, &dispparams);
call_sink(This->doc_host.cps.wbe2, DISPID_ONMENUBAR, &dispparams);
return S_OK;
}
@ -822,7 +822,7 @@ static HRESULT WINAPI WebBrowser_put_AddressBar(IWebBrowser2 *iface, VARIANT_BOO
V_VT(&arg) = VT_BOOL;
V_BOOL(&arg) = Value;
call_sink(This->doc_host.cp_wbe2, DISPID_ONADDRESSBAR, &dispparams);
call_sink(This->doc_host.cps.wbe2, DISPID_ONADDRESSBAR, &dispparams);
return S_OK;
}