diff --git a/mozilla/java/plugins/dist/build.xml b/mozilla/java/plugins/dist/build.xml index e25906e951b..45f7f929b0c 100644 --- a/mozilla/java/plugins/dist/build.xml +++ b/mozilla/java/plugins/dist/build.xml @@ -275,7 +275,12 @@ file="${objdir}/java/plugins/jni/${so.prefix}plugletjni.${so.extension}" /> - + + + + + + @@ -372,6 +377,15 @@ + + + + + + + + + diff --git a/mozilla/java/plugins/dist/netbeans/build.xml b/mozilla/java/plugins/dist/netbeans/build.xml index abe673cb2b4..a9ea96cafbb 100644 --- a/mozilla/java/plugins/dist/netbeans/build.xml +++ b/mozilla/java/plugins/dist/netbeans/build.xml @@ -220,6 +220,7 @@ in which the file "prefs.js" resides? The current value of this + diff --git a/mozilla/java/plugins/dist/netbeans/pluglet.properties b/mozilla/java/plugins/dist/netbeans/pluglet.properties index 797132c58e0..f0950df0204 100644 --- a/mozilla/java/plugins/dist/netbeans/pluglet.properties +++ b/mozilla/java/plugins/dist/netbeans/pluglet.properties @@ -1,8 +1,8 @@ -bin.artifacts.pattern=${so.prefix}plugletjni.${so.extension},components/${so.prefix}pluglet.${so.extension},components/pluglet.xpt,plugins/np${so.prefix}pluglet.${so.extension},plugins/SimplePluglet.jar,plugins/jmfplayer.jar +bin.artifacts.pattern=${so.prefix}plugletjni.${so.extension},components/${so.prefix}pluglet.${so.extension},components/*luglet*.xpt,plugins/np${so.prefix}pluglet.${so.extension},plugins/SimplePluglet.jar,plugins/jmfplayer.jar #debug.jvm.args=-Xdebug -Xrunjdwp:transport=dt_shmem,address=jdbconn,server=y,suspend=y #Make this point to the bin directory of your firefox installation -browser.bin.dir=C:\\Projects\\mozilla\\MOZILLA_NIH\\FIREFOX_2_0_0_3_RELEASE\\mozilla\\firefox-win32_d.obj\\dist\\bin -user.profile.dir=${user.home}/APPLIC~1/Mozilla/Firefox/Profiles/2t6hklzc.default +browser.bin.dir=F:\\Projects\\mozilla\\MOZILLA_NIH\\FIREFOX_2_0_0_3_RELEASE\\mozilla\\firefox-win32_d.obj\\dist\\bin +user.profile.dir=${user.home}/APPLIC~1/Mozilla/Firefox/Profiles/69lpopfc.default #Make this point at your JDKHOME without spaces jdkhome.nospaces=C:\\PROGRA~1\\Java\\jdk1.5.0_12 diff --git a/mozilla/java/plugins/examples/simple/src/main/web/index.html b/mozilla/java/plugins/examples/simple/src/main/web/index.html index 2db8e9863a1..890c71322f6 100755 --- a/mozilla/java/plugins/examples/simple/src/main/web/index.html +++ b/mozilla/java/plugins/examples/simple/src/main/web/index.html @@ -3,5 +3,21 @@ + + + +
+ +
+ diff --git a/mozilla/java/plugins/mozilla/Makefile.in b/mozilla/java/plugins/mozilla/Makefile.in index 04eac95d946..90645dc1450 100644 --- a/mozilla/java/plugins/mozilla/Makefile.in +++ b/mozilla/java/plugins/mozilla/Makefile.in @@ -60,7 +60,7 @@ CPPSRCS = nsScriptablePeer.cpp \ npAPInsIInputStreamShim.cpp \ $(NULL) -XPIDLSRCS = nsISimplePlugin.idl +XPIDLSRCS = nsIPluglet.idl SHARED_LIBRARY_LIBS = $(PLUGIN_SDK_OBJDIR)/samples/common/$(LIB_PREFIX)plugingate_s.$(LIB_SUFFIX) ../src/$(LIB_PREFIX)pluglet.$(LIB_SUFFIX) $(XPCOM_LIBS) $(NSPR_LIBS) diff --git a/mozilla/java/plugins/mozilla/nppluglet.cpp b/mozilla/java/plugins/mozilla/nppluglet.cpp index 60e7f72fa5b..f8eae0ec25d 100644 --- a/mozilla/java/plugins/mozilla/nppluglet.cpp +++ b/mozilla/java/plugins/mozilla/nppluglet.cpp @@ -55,7 +55,7 @@ #include "prlog.h" -static PRLogModuleInfo* log = NULL; +PRLogModuleInfo* log = NULL; // declared in nppluglet.h // service manager which will give the access to all public browser services // we will use memory service as an illustration @@ -353,7 +353,7 @@ NS_IMETHODIMP nsPluginInstance::HasPlugletForMimeType(const char *aMimeType, nsresult rv = NS_ERROR_FAILURE; *outResult = PR_FALSE; nsCOMPtr plugletEngine = nsnull; - nsIID scriptableIID = NS_ISIMPLEPLUGIN_IID; + nsIID scriptableIID = NS_IPLUGLET_IID; if (!mPluglet) { plugletEngine = do_GetService(PLUGLETENGINE_ContractID, &rv); @@ -428,7 +428,7 @@ NPError nsPluginInstance::GetValue(NPPVariable aVariable, void *aValue) switch (aVariable) { case NPPVpluginScriptableInstance: { // addref happens in getter, so we don't addref here - nsISimplePlugin * scriptablePeer = getScriptablePeer(); + nsIPluglet * scriptablePeer = getScriptablePeer(); if (scriptablePeer) { *(nsISupports **)aValue = scriptablePeer; } else @@ -437,7 +437,7 @@ NPError nsPluginInstance::GetValue(NPPVariable aVariable, void *aValue) break; case NPPVpluginScriptableIID: { - static nsIID scriptableIID = NS_ISIMPLEPLUGIN_IID; + static nsIID scriptableIID = NS_IPLUGLET_IID; nsIID* ptr = (nsIID *)NPN_MemAlloc(sizeof(nsIID)); if (ptr) { *ptr = scriptableIID; diff --git a/mozilla/java/plugins/mozilla/nppluglet.h b/mozilla/java/plugins/mozilla/nppluglet.h index 9a44d3d481f..5360a7edbab 100644 --- a/mozilla/java/plugins/mozilla/nppluglet.h +++ b/mozilla/java/plugins/mozilla/nppluglet.h @@ -43,6 +43,9 @@ #include "nsCOMPtr.h" #include "nsIPluginInstance.h" +#include "prlog.h" +extern PRLogModuleInfo *log; // defined in nppluglet.cpp + class nsPluginInstance : public nsPluginInstanceBase { public: diff --git a/mozilla/java/plugins/mozilla/nsISimplePlugin.idl b/mozilla/java/plugins/mozilla/nsIPluglet.idl old mode 100644 new mode 100755 similarity index 90% rename from mozilla/java/plugins/mozilla/nsISimplePlugin.idl rename to mozilla/java/plugins/mozilla/nsIPluglet.idl index e8ffc58d238..3df91e48994 --- a/mozilla/java/plugins/mozilla/nsISimplePlugin.idl +++ b/mozilla/java/plugins/mozilla/nsIPluglet.idl @@ -39,6 +39,9 @@ #include "nsISupports.idl" [scriptable, uuid(482e1890-1fe5-11d5-9cf8-0060b0fbd8ac)] -interface nsISimplePlugin : nsISupports { +interface nsIPluglet : nsISupports { boolean hasPlugletForMimeType(in string aMimeType); + void callPlugletMethod(in string methodName, + in PRUint32 inArgc, + [array, size_is(inArgc)] in string inArgv); }; diff --git a/mozilla/java/plugins/mozilla/nsScriptablePeer.cpp b/mozilla/java/plugins/mozilla/nsScriptablePeer.cpp index 18c41c4a0ba..300dab09c58 100644 --- a/mozilla/java/plugins/mozilla/nsScriptablePeer.cpp +++ b/mozilla/java/plugins/mozilla/nsScriptablePeer.cpp @@ -47,7 +47,7 @@ // #include "nppluglet.h" -static NS_DEFINE_IID(kISimplePluginIID, NS_ISIMPLEPLUGIN_IID); +static NS_DEFINE_IID(kIPlugletIID, NS_IPLUGLET_IID); static NS_DEFINE_IID(kIClassInfoIID, NS_ICLASSINFO_IID); static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); @@ -86,8 +86,8 @@ NS_IMETHODIMP nsScriptablePeer::QueryInterface(const nsIID& aIID, void** aInstan if(!aInstancePtr) return NS_ERROR_NULL_POINTER; - if(aIID.Equals(kISimplePluginIID)) { - *aInstancePtr = static_cast(this); + if(aIID.Equals(kIPlugletIID)) { + *aInstancePtr = static_cast(this); AddRef(); return NS_OK; } @@ -99,7 +99,7 @@ NS_IMETHODIMP nsScriptablePeer::QueryInterface(const nsIID& aIID, void** aInstan } if(aIID.Equals(kISupportsIID)) { - *aInstancePtr = static_cast((static_cast(this))); + *aInstancePtr = static_cast((static_cast(this))); AddRef(); return NS_OK; } @@ -132,3 +132,12 @@ NS_IMETHODIMP nsScriptablePeer::HasPlugletForMimeType(const char *aMimeType, PRB } +NS_IMETHODIMP nsScriptablePeer::CallPlugletMethod(const char *methodName, + PRUint32 inArgc, const char **inArgv) +{ + nsresult rv = NS_OK; + PR_LOG(log, PR_LOG_DEBUG, + ("nppluglet CallPlugletMethod: methodName: %s\n", methodName)); + return rv; +} + diff --git a/mozilla/java/plugins/mozilla/nsScriptablePeer.h b/mozilla/java/plugins/mozilla/nsScriptablePeer.h index 61100d8cf7f..b2afb5526c7 100644 --- a/mozilla/java/plugins/mozilla/nsScriptablePeer.h +++ b/mozilla/java/plugins/mozilla/nsScriptablePeer.h @@ -45,7 +45,7 @@ #ifndef __nsScriptablePeer_h__ #define __nsScriptablePeer_h__ -#include "nsISimplePlugin.h" +#include "nsIPluglet.h" #include "nsIClassInfo.h" class nsPluginInstance; @@ -78,7 +78,7 @@ class nsClassInfoMixin : public nsIClassInfo {return NS_ERROR_NOT_IMPLEMENTED;} }; -class nsScriptablePeer : public nsISimplePlugin, +class nsScriptablePeer : public nsIPluglet, public nsClassInfoMixin { public: @@ -96,7 +96,7 @@ protected: public: // native methods callable from JavaScript - NS_DECL_NSISIMPLEPLUGIN + NS_DECL_NSIPLUGLET void SetInstance(nsPluginInstance* plugin);