gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog plugin/plugin.cpp plugin/plugin.h


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog plugin/plugin.cpp plugin/plugin.h
Date: Wed, 27 Sep 2006 09:18:05 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  06/09/27 09:18:05

Modified files:
        .              : ChangeLog 
        plugin         : plugin.cpp plugin.h 

Log message:
        * plugin/plugin.cpp, plugin/plugin.h: added getCurrentPageURL method 
(still untested, but compiles fine).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.933&r2=1.934
http://cvs.savannah.gnu.org/viewcvs/gnash/plugin/plugin.cpp?cvsroot=gnash&r1=1.54&r2=1.55
http://cvs.savannah.gnu.org/viewcvs/gnash/plugin/plugin.h?cvsroot=gnash&r1=1.22&r2=1.23

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.933
retrieving revision 1.934
diff -u -b -r1.933 -r1.934
--- ChangeLog   27 Sep 2006 08:45:27 -0000      1.933
+++ ChangeLog   27 Sep 2006 09:18:05 -0000      1.934
@@ -1,3 +1,8 @@
+2006-09-27 Sandro Santilli  <address@hidden>
+
+       * plugin/plugin.cpp, plugin/plugin.h: added getCurrentPageURL
+       method (still untested, but compiles fine).
+
 2006-09-27 Vitaly Alexeev <address@hidden>
 
        * gui/Player.cpp,

Index: plugin/plugin.cpp
===================================================================
RCS file: /sources/gnash/gnash/plugin/plugin.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -b -r1.54 -r1.55
--- plugin/plugin.cpp   16 Sep 2006 23:17:26 -0000      1.54
+++ plugin/plugin.cpp   27 Sep 2006 09:18:05 -0000      1.55
@@ -653,6 +653,43 @@
     exit (-1);
 }
 
+const char*
+nsPluginInstance::getCurrentPageURL() const
+{
+       NPP npp = _instance;
+
+        NPObject *window;
+        NPIdentifier sDocument = NPN_GetStringIdentifier("document");
+        NPVariant vDoc;
+        NPN_GetValue(npp, NPNVWindowNPObject, &window);
+        NPN_GetProperty(npp, window, sDocument, &vDoc);
+        NPN_ReleaseObject(window);
+        if (!NPVARIANT_IS_OBJECT(vDoc))
+       {
+               return FALSE;
+       }
+        NPObject* npDoc = NPVARIANT_TO_OBJECT(vDoc);
+        NPIdentifier sLocation = NPN_GetStringIdentifier("location");
+        NPVariant vLoc;
+        NPN_GetProperty(npp, npDoc, sLocation, &vLoc);
+        NPN_ReleaseObject(npDoc);
+        if (!NPVARIANT_IS_OBJECT(vLoc))
+       {
+               return FALSE;
+       }
+        NPObject* npLoc = NPVARIANT_TO_OBJECT(vLoc);
+        NPIdentifier sProperty = NPN_GetStringIdentifier("href");
+        NPVariant vProp;
+        NPN_GetProperty(npp, npLoc, sProperty, &vProp);
+        NPN_ReleaseObject(npLoc);
+        if (!NPVARIANT_IS_STRING(vProp))
+       {
+               return FALSE;
+       }
+        const NPString& propValue = NPVARIANT_TO_STRING(vProp);
+        return propValue.utf8characters; // const char *
+}
+
 // Local Variables:
 // mode: C++
 // indent-tabs-mode: t

Index: plugin/plugin.h
===================================================================
RCS file: /sources/gnash/gnash/plugin/plugin.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- plugin/plugin.h     15 Sep 2006 03:34:20 -0000      1.22
+++ plugin/plugin.h     27 Sep 2006 09:18:05 -0000      1.23
@@ -113,6 +113,7 @@
     int                                _streamfd;
     pid_t                              _childpid;
 
+    const char* getCurrentPageURL() const;
 };
 
 // end of __PLUGIN_H__




reply via email to

[Prev in Thread] Current Thread [Next in Thread]