mshtml: Make IConnectionPointContainer more flexible.
This commit is contained in:
parent
440af17322
commit
a1bdef2d62
|
@ -93,7 +93,7 @@ static HRESULT WINAPI ConnectionPoint_GetConnectionInterface(IConnectionPoint *i
|
||||||
if(!pIID)
|
if(!pIID)
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
|
|
||||||
memcpy(pIID, &This->iid, sizeof(IID));
|
memcpy(pIID, This->iid, sizeof(IID));
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,8 +122,8 @@ static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *
|
||||||
|
|
||||||
TRACE("(%p)->(%p %p)\n", This, pUnkSink, pdwCookie);
|
TRACE("(%p)->(%p %p)\n", This, pUnkSink, pdwCookie);
|
||||||
|
|
||||||
hres = IUnknown_QueryInterface(pUnkSink, &This->iid, (void**)&sink);
|
hres = IUnknown_QueryInterface(pUnkSink, This->iid, (void**)&sink);
|
||||||
if(FAILED(hres) && !IsEqualGUID(&IID_IPropertyNotifySink, &This->iid))
|
if(FAILED(hres) && !IsEqualGUID(&IID_IPropertyNotifySink, This->iid))
|
||||||
hres = IUnknown_QueryInterface(pUnkSink, &IID_IDispatch, (void**)&sink);
|
hres = IUnknown_QueryInterface(pUnkSink, &IID_IDispatch, (void**)&sink);
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
return CONNECT_E_CANNOTCONNECT;
|
return CONNECT_E_CANNOTCONNECT;
|
||||||
|
@ -184,18 +184,17 @@ static const IConnectionPointVtbl ConnectionPointVtbl =
|
||||||
ConnectionPoint_EnumConnections
|
ConnectionPoint_EnumConnections
|
||||||
};
|
};
|
||||||
|
|
||||||
void ConnectionPoint_Init(ConnectionPoint *cp, IConnectionPointContainer *container,
|
void ConnectionPoint_Init(ConnectionPoint *cp, ConnectionPointContainer *container, REFIID riid)
|
||||||
REFIID riid, ConnectionPoint *prev)
|
|
||||||
{
|
{
|
||||||
cp->lpConnectionPointVtbl = &ConnectionPointVtbl;
|
cp->lpConnectionPointVtbl = &ConnectionPointVtbl;
|
||||||
cp->container = container;
|
cp->container = CONPTCONT(container);
|
||||||
cp->sinks = NULL;
|
cp->sinks = NULL;
|
||||||
cp->sinks_size = 0;
|
cp->sinks_size = 0;
|
||||||
cp->iid = *riid;
|
cp->iid = riid;
|
||||||
cp->next = NULL;
|
cp->next = NULL;
|
||||||
|
|
||||||
if(prev)
|
cp->next = container->cp_list;
|
||||||
prev->next = cp;
|
container->cp_list = cp;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ConnectionPoint_Destroy(ConnectionPoint *This)
|
static void ConnectionPoint_Destroy(ConnectionPoint *This)
|
||||||
|
@ -250,7 +249,7 @@ static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPo
|
||||||
*ppCP = NULL;
|
*ppCP = NULL;
|
||||||
|
|
||||||
for(iter = This->cp_list; iter; iter = iter->next) {
|
for(iter = This->cp_list; iter; iter = iter->next) {
|
||||||
if(IsEqualGUID(&iter->iid, riid))
|
if(IsEqualGUID(iter->iid, riid))
|
||||||
*ppCP = CONPOINT(iter);
|
*ppCP = CONPOINT(iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,11 +272,10 @@ static const IConnectionPointContainerVtbl ConnectionPointContainerVtbl = {
|
||||||
|
|
||||||
#undef CONPTCONT_THIS
|
#undef CONPTCONT_THIS
|
||||||
|
|
||||||
void ConnectionPointContainer_Init(ConnectionPointContainer *This, ConnectionPoint *cp_list,
|
void ConnectionPointContainer_Init(ConnectionPointContainer *This, IUnknown *outer)
|
||||||
IUnknown *outer)
|
|
||||||
{
|
{
|
||||||
This->lpConnectionPointContainerVtbl = &ConnectionPointContainerVtbl;
|
This->lpConnectionPointContainerVtbl = &ConnectionPointContainerVtbl;
|
||||||
This->cp_list = cp_list;
|
This->cp_list = NULL;
|
||||||
This->outer = outer;
|
This->outer = outer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -506,11 +506,9 @@ HTMLElement *HTMLBodyElement_Create(nsIDOMHTMLElement *nselem)
|
||||||
|
|
||||||
HTMLTextContainer_Init(&ret->textcont);
|
HTMLTextContainer_Init(&ret->textcont);
|
||||||
|
|
||||||
ConnectionPoint_Init(&ret->cp_propnotif, CONPTCONT(&ret->cp_container),
|
ConnectionPointContainer_Init(&ret->cp_container, (IUnknown*)HTMLBODY(ret));
|
||||||
&IID_IPropertyNotifySink, NULL);
|
ConnectionPoint_Init(&ret->cp_propnotif, &ret->cp_container, &IID_IPropertyNotifySink);
|
||||||
ConnectionPoint_Init(&ret->cp_txtcontevents, CONPTCONT(&ret->cp_container),
|
ConnectionPoint_Init(&ret->cp_txtcontevents, &ret->cp_container, &DIID_HTMLTextContainerEvents);
|
||||||
&DIID_HTMLTextContainerEvents, &ret->cp_propnotif);
|
|
||||||
ConnectionPointContainer_Init(&ret->cp_container, &ret->cp_propnotif, (IUnknown*)HTMLBODY(ret));
|
|
||||||
|
|
||||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLBodyElement,
|
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLBodyElement,
|
||||||
(void**)&ret->nsbody);
|
(void**)&ret->nsbody);
|
||||||
|
|
|
@ -1207,13 +1207,10 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
|
||||||
HTMLDocument_Service_Init(ret);
|
HTMLDocument_Service_Init(ret);
|
||||||
HTMLDocument_Hlink_Init(ret);
|
HTMLDocument_Hlink_Init(ret);
|
||||||
|
|
||||||
ConnectionPoint_Init(&ret->cp_propnotif, CONPTCONT(&ret->cp_container),
|
ConnectionPointContainer_Init(&ret->cp_container, (IUnknown*)HTMLDOC(ret));
|
||||||
&IID_IPropertyNotifySink, NULL);
|
ConnectionPoint_Init(&ret->cp_propnotif, &ret->cp_container, &IID_IPropertyNotifySink);
|
||||||
ConnectionPoint_Init(&ret->cp_htmldocevents, CONPTCONT(&ret->cp_container),
|
ConnectionPoint_Init(&ret->cp_htmldocevents, &ret->cp_container, &DIID_HTMLDocumentEvents);
|
||||||
&DIID_HTMLDocumentEvents, &ret->cp_propnotif);
|
ConnectionPoint_Init(&ret->cp_htmldocevents2, &ret->cp_container, &DIID_HTMLDocumentEvents2);
|
||||||
ConnectionPoint_Init(&ret->cp_htmldocevents2, CONPTCONT(&ret->cp_container),
|
|
||||||
&DIID_HTMLDocumentEvents2, &ret->cp_htmldocevents);
|
|
||||||
ConnectionPointContainer_Init(&ret->cp_container, &ret->cp_propnotif, (IUnknown*)HTMLDOC(ret));
|
|
||||||
|
|
||||||
ret->nscontainer = NSContainer_Create(ret, NULL);
|
ret->nscontainer = NSContainer_Create(ret, NULL);
|
||||||
ret->window = HTMLWindow_Create(ret);
|
ret->window = HTMLWindow_Create(ret);
|
||||||
|
|
|
@ -90,7 +90,7 @@ struct ConnectionPoint {
|
||||||
} *sinks;
|
} *sinks;
|
||||||
DWORD sinks_size;
|
DWORD sinks_size;
|
||||||
|
|
||||||
IID iid;
|
const IID *iid;
|
||||||
|
|
||||||
ConnectionPoint *next;
|
ConnectionPoint *next;
|
||||||
};
|
};
|
||||||
|
@ -372,8 +372,8 @@ void HTMLDocument_Window_Init(HTMLDocument*);
|
||||||
void HTMLDocument_Service_Init(HTMLDocument*);
|
void HTMLDocument_Service_Init(HTMLDocument*);
|
||||||
void HTMLDocument_Hlink_Init(HTMLDocument*);
|
void HTMLDocument_Hlink_Init(HTMLDocument*);
|
||||||
|
|
||||||
void ConnectionPoint_Init(ConnectionPoint*,IConnectionPointContainer*,REFIID,ConnectionPoint*);
|
void ConnectionPoint_Init(ConnectionPoint*,ConnectionPointContainer*,REFIID);
|
||||||
void ConnectionPointContainer_Init(ConnectionPointContainer*,ConnectionPoint*,IUnknown*);
|
void ConnectionPointContainer_Init(ConnectionPointContainer*,IUnknown*);
|
||||||
void ConnectionPointContainer_Destroy(ConnectionPointContainer*);
|
void ConnectionPointContainer_Destroy(ConnectionPointContainer*);
|
||||||
|
|
||||||
NSContainer *NSContainer_Create(HTMLDocument*,NSContainer*);
|
NSContainer *NSContainer_Create(HTMLDocument*,NSContainer*);
|
||||||
|
|
Loading…
Reference in New Issue