Jacek Caban : mshtml: Added GetMoniker and SetMoniker methods to nsIWineURI .

Alexandre Julliard julliard at wine.codeweavers.com
Wed Aug 9 10:37:23 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: f0ca85f78eebdefa4e65e5053aaed529cf38392e
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=f0ca85f78eebdefa4e65e5053aaed529cf38392e

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Aug  9 16:34:59 2006 +0200

mshtml: Added GetMoniker and SetMoniker methods to nsIWineURI.

---

 dlls/mshtml/nsiface.idl |    4 ++++
 dlls/mshtml/nsio.c      |   35 +++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/dlls/mshtml/nsiface.idl b/dlls/mshtml/nsiface.idl
index c1d5bb4..ee17638 100644
--- a/dlls/mshtml/nsiface.idl
+++ b/dlls/mshtml/nsiface.idl
@@ -69,6 +69,8 @@ interface nsILoadGroup;
 interface nsIDOMNode;
 interface nsIDOMDocument;
 
+interface IMoniker;
+
 [
     object,
     uuid(00000000-0000-0000-c000-000000000046)
@@ -1170,4 +1172,6 @@ interface nsIWineURI : nsIURI
 
     nsresult GetNSContainer(NSContainer **aNSContainer);
     nsresult SetNSContainer(NSContainer *aNSContainer);
+    nsresult GetMoniker(IMoniker **aMoniker);
+    nsresult SetMoniker(IMoniker *aMoniker);
 }
diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c
index fb578c4..67207bb 100644
--- a/dlls/mshtml/nsio.c
+++ b/dlls/mshtml/nsio.c
@@ -52,6 +52,7 @@ typedef struct {
 
     nsIURI *uri;
     NSContainer *container;
+    IMoniker *mon;
 } nsURI;
 
 #define NSURI(x)         ((nsIURI*)            &(x)->lpWineURIVtbl)
@@ -1436,6 +1437,37 @@ static nsresult NSAPI nsURI_SetNSContain
     return NS_OK;
 }
 
+static nsresult NSAPI nsURI_GetMoniker(nsIWineURI *iface, IMoniker **aMoniker)
+{
+    nsURI *This = NSURI_THIS(iface);
+
+    TRACE("(%p)->(%p)\n", This, aMoniker);
+
+    if(This->mon)
+        IMoniker_AddRef(This->mon);
+    *aMoniker = This->mon;
+
+    return NS_OK;
+}
+
+static nsresult NSAPI nsURI_SetMoniker(nsIWineURI *iface, IMoniker *aMoniker)
+{
+    nsURI *This = NSURI_THIS(iface);
+
+    TRACE("(%p)->(%p)\n", This, aMoniker);
+
+    if(This->mon) {
+        WARN("Moniker already set: %p\n", This->container);
+        IMoniker_Release(This->mon);
+    }
+
+    if(aMoniker)
+        IMoniker_AddRef(aMoniker);
+    This->mon = aMoniker;
+
+    return NS_OK;
+}
+
 #undef NSURI_THIS
 
 static const nsIWineURIVtbl nsWineURIVtbl = {
@@ -1470,6 +1502,8 @@ static const nsIWineURIVtbl nsWineURIVtb
     nsURI_GetOriginCharset,
     nsURI_GetNSContainer,
     nsURI_SetNSContainer,
+    nsURI_GetMoniker,
+    nsURI_SetMoniker
 };
 
 static nsresult create_uri(nsIURI *uri, NSContainer *container, nsIURI **_retval)
@@ -1480,6 +1514,7 @@ static nsresult create_uri(nsIURI *uri, 
     ret->ref = 1;
     ret->uri = uri;
     ret->container = container;
+    ret->mon = NULL;
 
     if(container)
         nsIWebBrowserChrome_AddRef(NSWBCHROME(container));




More information about the wine-cvs mailing list