Module: wine Branch: refs/heads/master Commit: 91369e20e756313f586de03da1354b4f621985fe URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=91369e20e756313f586de03d...
Author: Jacek Caban jacek@codeweavers.com Date: Mon Feb 27 19:08:23 2006 +0100
mshtml: Added nsIInterfaceRequestor implementation.
---
dlls/mshtml/mshtml_private.h | 2 ++ dlls/mshtml/nsembed.c | 49 +++++++++++++++++++++++++++++++++++++++++- dlls/mshtml/nsiface.idl | 29 ++++++++++++++++++++++++- 3 files changed, 78 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 59d1464..478c91d 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -84,6 +84,7 @@ struct NSContainer { const nsIContextMenuListenerVtbl *lpContextMenuListenerVtbl; const nsIURIContentListenerVtbl *lpURIContentListenerVtbl; const nsIEmbeddingSiteWindowVtbl *lpEmbeddingSiteWindowVtbl; + const nsIInterfaceRequestorVtbl *lpInterfaceRequestorVtbl;
nsIWebBrowser *webbrowser; nsIWebNavigation *navigation; @@ -125,6 +126,7 @@ struct NSContainer { #define NSCML(x) ((nsIContextMenuListener*) &(x)->lpContextMenuListenerVtbl) #define NSURICL(x) ((nsIURIContentListener*) &(x)->lpURIContentListenerVtbl) #define NSEMBWNDS(x) ((nsIEmbeddingSiteWindow*) &(x)->lpEmbeddingSiteWindowVtbl) +#define NSIFACEREQ(x) ((nsIInterfaceRequestor*) &(x)->lpInterfaceRequestorVtbl)
#define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index beffd86..25b44ad 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -1,5 +1,5 @@ /* - * Copyright 2005 Jacek Caban + * Copyright 2005-2006 Jacek Caban for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -457,6 +457,9 @@ static nsresult NSAPI nsWebBrowserChrome }else if(IsEqualGUID(&IID_nsIEmbeddingSiteWindow, riid)) { TRACE("(%p)->(IID_nsIEmbeddingSiteWindow %p)\n", This, result); *result = NSEMBWNDS(This); + }else if(IsEqualGUID(&IID_nsIInterfaceRequestor, riid)) { + TRACE("(%p)->(IID_nsIInterfaceRequestor %p)\n", This, result); + *result = NSIFACEREQ(This); }
if(*result) { @@ -916,6 +919,49 @@ static const nsIEmbeddingSiteWindowVtbl nsEmbeddingSiteWindow_GetSiteWindow };
+#define NSIFACEREQ_THIS(iface) DEFINE_THIS(NSContainer, InterfaceRequestor, iface) + +static nsresult NSAPI nsInterfaceRequestor_QueryInterface(nsIInterfaceRequestor *iface, + nsIIDRef riid, nsQIResult result) +{ + NSContainer *This = NSIFACEREQ_THIS(iface); + return nsIWebBrowserChrome_QueryInterface(NSWBCHROME(This), riid, result); +} + +static nsrefcnt NSAPI nsInterfaceRequestor_AddRef(nsIInterfaceRequestor *iface) +{ + NSContainer *This = NSIFACEREQ_THIS(iface); + return nsIWebBrowserChrome_AddRef(NSWBCHROME(This)); +} + +static nsrefcnt NSAPI nsInterfaceRequestor_Release(nsIInterfaceRequestor *iface) +{ + NSContainer *This = NSIFACEREQ_THIS(iface); + return nsIWebBrowserChrome_Release(NSWBCHROME(This)); +} + +static nsresult NSAPI nsInterfaceRequestor_GetInterface(nsIInterfaceRequestor *iface, + nsIIDRef riid, nsQIResult result) +{ + NSContainer *This = NSIFACEREQ_THIS(iface); + + if(IsEqualGUID(&IID_nsIDOMWindow, riid)) { + FIXME("(%p)->(IID_nsIDOMWindow %p)\n", This, result); + return NS_NOINTERFACE; + } + + return nsIWebBrowserChrome_QueryInterface(NSWBCHROME(This), riid, result); +} + +#undef NSIFACEREQ_THIS + +static const nsIInterfaceRequestorVtbl nsInterfaceRequestorVtbl = { + nsInterfaceRequestor_QueryInterface, + nsInterfaceRequestor_AddRef, + nsInterfaceRequestor_Release, + nsInterfaceRequestor_GetInterface +}; + void NSContainer_Create(HTMLDocument *doc) { nsIWebBrowserSetup *wbsetup; @@ -931,6 +977,7 @@ void NSContainer_Create(HTMLDocument *do ret->lpContextMenuListenerVtbl = &nsContextMenuListenerVtbl; ret->lpURIContentListenerVtbl = &nsURIContentListenerVtbl; ret->lpEmbeddingSiteWindowVtbl = &nsEmbeddingSiteWindowVtbl; + ret->lpInterfaceRequestorVtbl = &nsInterfaceRequestorVtbl;
ret->doc = doc; ret->ref = 1; diff --git a/dlls/mshtml/nsiface.idl b/dlls/mshtml/nsiface.idl index 8afca49..6c483aa 100644 --- a/dlls/mshtml/nsiface.idl +++ b/dlls/mshtml/nsiface.idl @@ -68,7 +68,6 @@ interface nsISupports
/* Currently we don't need a full declaration of these interfaces */ typedef nsISupports nsIWeakReference; -typedef nsISupports nsIDOMWindow; typedef nsISupports nsIDOMDocument; typedef nsISupports nsISHistory; typedef nsISupports nsISimpleEnumerator; @@ -81,6 +80,9 @@ typedef nsISupports nsIDOMAbstractView; typedef nsISupports nsIStreamListener; typedef nsISupports nsIHttpHeaderVisitor; typedef nsISupports nsIRequestObserver; +typedef nsISupports nsIDOMBarProp; +typedef nsISupports nsIDOMWindowCollection; +typedef nsISupports nsISelection;
[ object, @@ -297,6 +299,31 @@ interface nsIUploadChannel : nsISupports
[ object, + uuid(a6cf906b-15b3-11d2-932e-00805f8add32) +] +interface nsIDOMWindow : nsISupports +{ + nsresult GetDocument(nsIDOMDocument **aDocument); + nsresult GetParent(nsIDOMWindow **aParent); + nsresult GetTop(nsIDOMWindow **aTop); + nsresult GetScrollbars(nsIDOMBarProp **aScrollbars); + nsresult GetFrames(nsIDOMWindowCollection **aFrames); + nsresult GetName(nsAString *aName); + nsresult SetName(const nsAString *aName); + nsresult GetTextZoom(float *aTextZoom); + nsresult SetTextZoom(float aTextZoom); + nsresult GetScrollX(PRInt32 *aScrollX); + nsresult GetScrollY(PRInt32 *aScrollY); + nsresult ScrollTo(PRInt32 xScroll, PRInt32 yScroll); + nsresult ScrollBy(PRInt32 xScrollDif, PRInt32 yScrollDif); + nsresult GetSelection(nsISelection **_retval); + nsresult ScrollByLines(PRInt32 numLines); + nsresult ScrollByPages(PRInt32 numPages); + nsresult SizeToContent(); +} + +[ + object, uuid(94928ab3-8b63-11d3-989d-001083010e9b) ] interface nsIURIContentListener : nsISupports