From 3745f01628d8b9ac9980f08817ce9b348c958320 Mon Sep 17 00:00:00 2001 From: "edburns%acm.org" Date: Thu, 10 May 2001 18:43:03 +0000 Subject: [PATCH] directory_name_change git-svn-id: svn://10.0.0.236/trunk@94505 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/java/waterfall/wf/build/java/Defs.gmk | 30 - .../waterfall/wf/build/java/FileListCommon.mk | 48 - .../waterfall/wf/build/java/FileListUnix.mk | 27 - .../waterfall/wf/build/java/FileListWin.mk | 26 - .../java/waterfall/wf/build/java/GNUmakefile | 64 - .../java/waterfall/wf/build/java/Rules.gmk | 66 - mozilla/java/waterfall/wf/build/java/defs.mk | 29 - .../waterfall/wf/build/java/ext/GNUmakefile | 33 - .../wf/build/java/ext/jpav/FileListExt.mk | 46 - .../wf/build/java/ext/jpav/GNUmakefile | 49 - .../wf/build/java/ext/jpav/makefile.win | 61 - .../waterfall/wf/build/java/ext/makefile.win | 30 - .../wf/build/java/ext/moz6/FileListExt.mk | 29 - .../wf/build/java/ext/moz6/GNUmakefile | 46 - .../wf/build/java/ext/moz6/makefile.win | 50 - .../java/waterfall/wf/build/java/makefile.win | 66 - mozilla/java/waterfall/wf/build/java/rules.mk | 107 - mozilla/java/waterfall/wf/build/unix/Defs.gmk | 109 - .../java/waterfall/wf/build/unix/GNUmakefile | 183 -- mozilla/java/waterfall/wf/build/unix/dump.sh | 25 - .../java/waterfall/wf/build/unix/ext/jpav.jar | Bin 38000 -> 0 bytes .../java/waterfall/wf/build/unix/ext/moz6.jar | Bin 7400 -> 0 bytes .../java/waterfall/wf/build/unix/gtktest.c | 116 -- .../java/waterfall/wf/build/unix/set_paths | 69 - .../waterfall/wf/build/unix/set_paths.csh | 79 - .../java/waterfall/wf/build/win32/jvmp.def | 4 - .../waterfall/wf/build/win32/makefile.win | 192 -- .../waterfall/wf/build/win32/plugin.policy | 42 - .../java/waterfall/wf/build/win32/set_env.bat | 30 - .../waterfall/wf/build/win32/wfe_mozilla.def | 9 - .../waterfall/wf/build/win32/wfe_test.def | 6 - mozilla/java/waterfall/wf/doc/ChangeLog | 13 - mozilla/java/waterfall/wf/doc/TODO | 17 - mozilla/java/waterfall/wf/doc/build.txt | 54 - .../java/waterfall/wf/doc/live_connect.txt | 0 mozilla/java/waterfall/wf/doc/wf_mozilla.txt | 30 - .../java/waterfall/wf/include/awt_Plugin.h | 55 - .../include/sun_jvmp_generic_motif_Plugin.h | 21 - ..._jvmp_generic_motif_PthreadSynchroObject.h | 69 - .../wf/include/sun_jvmp_mozilla_JSObject.h | 102 - ..._jvmp_mozilla_JavaScriptProtectionDomain.h | 45 - .../sun_jvmp_mozilla_MozillaAppletPeer.h | 58 - .../sun_jvmp_mozilla_MozillaPeerFactory.h | 30 - mozilla/java/waterfall/wf/java/plugin.policy | 42 - .../wf/java/sun/jvmp/BrowserSupport.java | 41 - .../wf/java/sun/jvmp/ComponentException.java | 39 - .../wf/java/sun/jvmp/ComponentLoader.java | 121 -- .../wf/java/sun/jvmp/HostObjectPeer.java | 104 - .../java/sun/jvmp/HostObjectPeerFactory.java | 68 - .../waterfall/wf/java/sun/jvmp/IDList.java | 147 -- .../waterfall/wf/java/sun/jvmp/IDObject.java | 32 - .../wf/java/sun/jvmp/MultipleHashtable.java | 58 - .../wf/java/sun/jvmp/NativeFrame.java | 73 - .../wf/java/sun/jvmp/NativeThread.java | 71 - .../wf/java/sun/jvmp/ObjectFactory.java | 83 - .../wf/java/sun/jvmp/PluggableJVM.java | 1019 ---------- .../wf/java/sun/jvmp/SynchroObject.java | 51 - .../wf/java/sun/jvmp/WaterfallExtension.java | 229 --- .../jvmp/generic/GenericSynchroObject.java | 104 - .../java/sun/jvmp/generic/motif/Plugin.java | 124 -- .../generic/motif/PthreadSynchroObject.java | 47 - .../java/sun/jvmp/generic/win32/Plugin.java | 114 -- .../sun/jvmp/jpav/ActivatorAppletContext.java | 223 --- .../sun/jvmp/jpav/ActivatorAppletPanel.java | 737 ------- .../sun/jvmp/jpav/ActivatorClassLoader.java | 38 - .../sun/jvmp/jpav/ActivatorProxyHandler.java | 398 ---- .../sun/jvmp/jpav/AppletMessageHandler.java | 113 -- .../java/sun/jvmp/jpav/ClassLoaderInfo.java | 187 -- .../wf/java/sun/jvmp/jpav/CookieHandler.java | 39 - .../sun/jvmp/jpav/JavaPluginAVFactory.java | 287 --- .../wf/java/sun/jvmp/jpav/ProxyHandler.java | 41 - .../jvmp/jpav/RMIActivatorSocketFactory.java | 75 - .../jvmp/jpav/protocol/jdk12/ftp/Handler.java | 94 - .../jpav/protocol/jdk12/gopher/Handler.java | 67 - .../jpav/protocol/jdk12/http/Handler.java | 49 - .../jpav/protocol/jdk12/http/HttpClient.java | 97 - .../jdk12/http/HttpURLConnection.java | 292 --- .../jpav/protocol/jdk12/http/SocksSocket.java | 407 ---- .../jdk12/https/BrowserHttpsInputStream.java | 294 --- .../jdk12/https/BrowserHttpsOutputStream.java | 134 -- .../https/BrowserHttpsURLConnection.java | 378 ---- .../jpav/protocol/jdk12/https/Handler.java | 84 - .../jvmp/jpav/protocol/jdk12/jar/Handler.java | 47 - .../sun/jvmp/mozilla/MozillaAppletPeer.java | 265 --- .../jvmp/mozilla/MozillaHostObjectPeer.java | 107 - .../sun/jvmp/mozilla/MozillaPeerFactory.java | 237 --- .../jvmp/mozilla/MozillaSecurityManager.java | 54 - .../sun/jvmp/netscape4/MozillaAppletPeer.java | 248 --- .../jvmp/netscape4/MozillaHostObjectPeer.java | 109 - .../jvmp/netscape4/NetscapePeerFactory.java | 141 -- .../jvmp/security/AccessControlDecider.java | 49 - .../sun/jvmp/security/CallingContext.java | 48 - .../sun/jvmp/security/ExtSecurityManager.java | 52 - .../java/sun/jvmp/security/SecurityCaps.java | 103 - .../wf/java/sun/jvmp/security/WFPolicy.java | 83 - .../java/sun/jvmp/test/MyActionListener.java | 44 - .../wf/java/sun/jvmp/test/MyDialog.java | 54 - .../java/sun/jvmp/test/TestPeerFactory.java | 251 --- mozilla/java/waterfall/wf/public/jvmp.h | 314 --- .../java/waterfall/wf/public/jvmp_cap_vals.h | 38 - mozilla/java/waterfall/wf/public/jvmp_caps.h | 84 - .../java/waterfall/wf/public/jvmp_drawing.h | 81 - .../java/waterfall/wf/public/jvmp_errors.h | 53 - mozilla/java/waterfall/wf/public/jvmp_event.h | 42 - .../java/waterfall/wf/public/jvmp_extension.h | 108 - .../java/waterfall/wf/public/jvmp_security.h | 65 - .../java/waterfall/wf/public/jvmp_threading.h | 92 - .../java/waterfall/wf/public/jvmp_vendor.h | 58 - .../java/waterfall/wf/public/linux/jvmp_md.h | 32 - mozilla/java/waterfall/wf/public/shmtran.h | 149 -- .../waterfall/wf/public/solaris/jvmp_md.h | 32 - .../java/waterfall/wf/public/win32/jvmp_md.h | 38 - mozilla/java/waterfall/wf/src/host/host.cpp | 668 ------- .../waterfall/wf/src/host/test_extension.c | 114 -- .../waterfall/wf/src/plugin/java_plugin.c | 1768 ----------------- .../java/waterfall/wf/src/plugin/jpthreads.c | 175 -- .../java/waterfall/wf/src/plugin/jpthreads.h | 79 - .../wf/src/plugin/mozilla/XmHelper.c | 145 -- .../wf/src/plugin/mozilla/wf_moz6_common.h | 274 --- .../wf/src/plugin/mozilla/wfe_mozilla.c | 127 -- .../wf/src/plugin/mozilla/wfm6_native.c | 1649 --------------- .../wf/src/plugin/netscape4/Aptest.java | 112 -- .../wf/src/plugin/netscape4/JavaPlugin.c | 722 ------- .../wf/src/plugin/netscape4/Makefile | 71 - .../wf/src/plugin/netscape4/UnixShell.c | 329 --- .../wf/src/plugin/netscape4/common.h | 85 - .../waterfall/wf/src/plugin/netscape4/jri.h | 667 ------- .../wf/src/plugin/netscape4/jri_md.h | 196 -- .../wf/src/plugin/netscape4/jritypes.h | 193 -- .../waterfall/wf/src/plugin/netscape4/npapi.h | 438 ---- .../wf/src/plugin/netscape4/npapi.h.my | 420 ---- .../wf/src/plugin/netscape4/npunix.c | 436 ---- .../wf/src/plugin/netscape4/npunix.c.my | 436 ---- .../waterfall/wf/src/plugin/netscape4/npupp.h | 1020 ---------- .../wf/src/plugin/netscape4/npupp.h.my | 1021 ---------- .../waterfall/wf/src/plugin/netscape4/stubs.c | 40 - .../wf/src/plugin/netscape4/wfe_netscape4.c | 412 ---- .../waterfall/wf/src/plugin/unix/Makefile | 32 - .../wf/src/plugin/unix/java_plugin_shm.c | 590 ------ .../wf/src/plugin/unix/java_plugin_shm_host.c | 947 --------- .../waterfall/wf/src/plugin/unix/jvmp_exec.c | 89 - .../waterfall/wf/src/plugin/unix/native.c | 344 ---- .../waterfall/wf/src/plugin/unix/shmtran.c | 813 -------- .../waterfall/wf/src/plugin/win32/native.c | 27 - mozilla/java/waterfall/wf/tests/LC/LC.java | 112 -- mozilla/java/waterfall/wf/tests/LC/LC1.java | 134 -- .../java/waterfall/wf/tests/LC/example1.html | 20 - .../java/waterfall/wf/tests/LC/example2.html | 23 - .../java/waterfall/wf/tests/LC/example3.html | 16 - .../java/waterfall/wf/tests/LC/example4.html | 21 - .../java/waterfall/wf/tests/LC/example5.html | 23 - .../java/waterfall/wf/tests/LC/example6.html | 28 - .../wf/tests/https/SecureApplet.java | 138 -- .../java/waterfall/wf/tests/https/data1.dat | 3 - .../java/waterfall/wf/tests/https/data2.dat | 10 - .../waterfall/wf/tests/https/example1.html | 14 - mozilla/java/waterfall/wf_moz6/Makefile.in | 56 - mozilla/java/waterfall/wf_moz6/doc/README.txt | 95 - .../java/waterfall/wf_moz6/doc/set_env.bat | 33 - mozilla/java/waterfall/wf_moz6/doc/set_env.sh | 36 - mozilla/java/waterfall/wf_moz6/makefile.win | 28 - .../java/waterfall/wf_moz6/public/Makefile.in | 68 - .../waterfall/wf_moz6/public/makefile.win | 39 - .../wf_moz6/public/nsIBrowserJavaSupport.idl | 35 - .../wf_moz6/public/nsIJavaHTMLObject.idl | 129 -- .../wf_moz6/public/nsIJavaObjectInfo.idl | 72 - .../public/nsIJavaPluginInstanceProxy.idl | 89 - .../public/nsIJavaPluginInstanceWrapper.idl | 41 - .../wf_moz6/public/nsIPluggableJVM.idl | 152 -- .../wf_moz6/public/nsIWFInstanceWrapper.idl | 41 - .../java/waterfall/wf_moz6/public/nsoji2.idl | 85 - .../java/waterfall/wf_moz6/src/Makefile.in | 83 - .../java/waterfall/wf_moz6/src/makefile.win | 57 - .../wf_moz6/src/nsAppletHTMLObject.cpp | 459 ----- .../wf_moz6/src/nsAppletHTMLObject.h | 102 - .../waterfall/wf_moz6/src/nsCJVMFactory.cpp | 67 - .../wf_moz6/src/nsJavaHTMLObject.cpp | 219 -- .../waterfall/wf_moz6/src/nsJavaHTMLObject.h | 58 - .../wf_moz6/src/nsJavaHTMLObjectFactory.cpp | 719 ------- .../wf_moz6/src/nsJavaHTMLObjectFactory.h | 124 -- .../wf_moz6/src/nsJavaObjectInfo.cpp | 283 --- .../waterfall/wf_moz6/src/nsJavaObjectInfo.h | 54 - .../waterfall/wf_moz6/src/nsPluggableJVM.cpp | 459 ----- .../waterfall/wf_moz6/src/nsPluggableJVM.h | 72 - .../waterfall/wf_moz6/src/nsWFSecureEnv.cpp | 1186 ----------- .../waterfall/wf_moz6/src/nsWFSecureEnv.h | 271 --- .../wf_moz6/src/nsWFSecurityContext.cpp | 152 -- .../wf_moz6/src/nsWFSecurityContext.h | 71 - .../waterfall/wf_moz6/src/wf_moz6_common.h | 274 --- 189 files changed, 32534 deletions(-) delete mode 100644 mozilla/java/waterfall/wf/build/java/Defs.gmk delete mode 100644 mozilla/java/waterfall/wf/build/java/FileListCommon.mk delete mode 100644 mozilla/java/waterfall/wf/build/java/FileListUnix.mk delete mode 100644 mozilla/java/waterfall/wf/build/java/FileListWin.mk delete mode 100644 mozilla/java/waterfall/wf/build/java/GNUmakefile delete mode 100644 mozilla/java/waterfall/wf/build/java/Rules.gmk delete mode 100644 mozilla/java/waterfall/wf/build/java/defs.mk delete mode 100644 mozilla/java/waterfall/wf/build/java/ext/GNUmakefile delete mode 100644 mozilla/java/waterfall/wf/build/java/ext/jpav/FileListExt.mk delete mode 100644 mozilla/java/waterfall/wf/build/java/ext/jpav/GNUmakefile delete mode 100644 mozilla/java/waterfall/wf/build/java/ext/jpav/makefile.win delete mode 100644 mozilla/java/waterfall/wf/build/java/ext/makefile.win delete mode 100644 mozilla/java/waterfall/wf/build/java/ext/moz6/FileListExt.mk delete mode 100644 mozilla/java/waterfall/wf/build/java/ext/moz6/GNUmakefile delete mode 100644 mozilla/java/waterfall/wf/build/java/ext/moz6/makefile.win delete mode 100644 mozilla/java/waterfall/wf/build/java/makefile.win delete mode 100644 mozilla/java/waterfall/wf/build/java/rules.mk delete mode 100644 mozilla/java/waterfall/wf/build/unix/Defs.gmk delete mode 100644 mozilla/java/waterfall/wf/build/unix/GNUmakefile delete mode 100644 mozilla/java/waterfall/wf/build/unix/dump.sh delete mode 100644 mozilla/java/waterfall/wf/build/unix/ext/jpav.jar delete mode 100644 mozilla/java/waterfall/wf/build/unix/ext/moz6.jar delete mode 100644 mozilla/java/waterfall/wf/build/unix/gtktest.c delete mode 100644 mozilla/java/waterfall/wf/build/unix/set_paths delete mode 100644 mozilla/java/waterfall/wf/build/unix/set_paths.csh delete mode 100644 mozilla/java/waterfall/wf/build/win32/jvmp.def delete mode 100644 mozilla/java/waterfall/wf/build/win32/makefile.win delete mode 100644 mozilla/java/waterfall/wf/build/win32/plugin.policy delete mode 100644 mozilla/java/waterfall/wf/build/win32/set_env.bat delete mode 100644 mozilla/java/waterfall/wf/build/win32/wfe_mozilla.def delete mode 100644 mozilla/java/waterfall/wf/build/win32/wfe_test.def delete mode 100644 mozilla/java/waterfall/wf/doc/ChangeLog delete mode 100644 mozilla/java/waterfall/wf/doc/TODO delete mode 100644 mozilla/java/waterfall/wf/doc/build.txt delete mode 100644 mozilla/java/waterfall/wf/doc/live_connect.txt delete mode 100644 mozilla/java/waterfall/wf/doc/wf_mozilla.txt delete mode 100644 mozilla/java/waterfall/wf/include/awt_Plugin.h delete mode 100644 mozilla/java/waterfall/wf/include/sun_jvmp_generic_motif_Plugin.h delete mode 100644 mozilla/java/waterfall/wf/include/sun_jvmp_generic_motif_PthreadSynchroObject.h delete mode 100644 mozilla/java/waterfall/wf/include/sun_jvmp_mozilla_JSObject.h delete mode 100644 mozilla/java/waterfall/wf/include/sun_jvmp_mozilla_JavaScriptProtectionDomain.h delete mode 100644 mozilla/java/waterfall/wf/include/sun_jvmp_mozilla_MozillaAppletPeer.h delete mode 100644 mozilla/java/waterfall/wf/include/sun_jvmp_mozilla_MozillaPeerFactory.h delete mode 100644 mozilla/java/waterfall/wf/java/plugin.policy delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/BrowserSupport.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/ComponentException.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/ComponentLoader.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/HostObjectPeer.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/HostObjectPeerFactory.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/IDList.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/IDObject.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/MultipleHashtable.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/NativeFrame.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/NativeThread.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/ObjectFactory.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/PluggableJVM.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/SynchroObject.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/WaterfallExtension.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/generic/GenericSynchroObject.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/generic/motif/Plugin.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/generic/motif/PthreadSynchroObject.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/generic/win32/Plugin.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ActivatorAppletContext.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ActivatorAppletPanel.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ActivatorClassLoader.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ActivatorProxyHandler.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/jpav/AppletMessageHandler.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ClassLoaderInfo.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/jpav/CookieHandler.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/jpav/JavaPluginAVFactory.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ProxyHandler.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/jpav/RMIActivatorSocketFactory.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/ftp/Handler.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/gopher/Handler.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/http/Handler.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/http/HttpClient.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/http/HttpURLConnection.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/http/SocksSocket.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/https/BrowserHttpsInputStream.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/https/BrowserHttpsOutputStream.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/https/BrowserHttpsURLConnection.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/https/Handler.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/jar/Handler.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/mozilla/MozillaAppletPeer.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/mozilla/MozillaHostObjectPeer.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/mozilla/MozillaPeerFactory.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/mozilla/MozillaSecurityManager.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/netscape4/MozillaAppletPeer.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/netscape4/MozillaHostObjectPeer.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/netscape4/NetscapePeerFactory.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/security/AccessControlDecider.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/security/CallingContext.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/security/ExtSecurityManager.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/security/SecurityCaps.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/security/WFPolicy.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/test/MyActionListener.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/test/MyDialog.java delete mode 100644 mozilla/java/waterfall/wf/java/sun/jvmp/test/TestPeerFactory.java delete mode 100644 mozilla/java/waterfall/wf/public/jvmp.h delete mode 100644 mozilla/java/waterfall/wf/public/jvmp_cap_vals.h delete mode 100644 mozilla/java/waterfall/wf/public/jvmp_caps.h delete mode 100644 mozilla/java/waterfall/wf/public/jvmp_drawing.h delete mode 100644 mozilla/java/waterfall/wf/public/jvmp_errors.h delete mode 100644 mozilla/java/waterfall/wf/public/jvmp_event.h delete mode 100644 mozilla/java/waterfall/wf/public/jvmp_extension.h delete mode 100644 mozilla/java/waterfall/wf/public/jvmp_security.h delete mode 100644 mozilla/java/waterfall/wf/public/jvmp_threading.h delete mode 100644 mozilla/java/waterfall/wf/public/jvmp_vendor.h delete mode 100644 mozilla/java/waterfall/wf/public/linux/jvmp_md.h delete mode 100644 mozilla/java/waterfall/wf/public/shmtran.h delete mode 100644 mozilla/java/waterfall/wf/public/solaris/jvmp_md.h delete mode 100644 mozilla/java/waterfall/wf/public/win32/jvmp_md.h delete mode 100644 mozilla/java/waterfall/wf/src/host/host.cpp delete mode 100644 mozilla/java/waterfall/wf/src/host/test_extension.c delete mode 100644 mozilla/java/waterfall/wf/src/plugin/java_plugin.c delete mode 100644 mozilla/java/waterfall/wf/src/plugin/jpthreads.c delete mode 100644 mozilla/java/waterfall/wf/src/plugin/jpthreads.h delete mode 100644 mozilla/java/waterfall/wf/src/plugin/mozilla/XmHelper.c delete mode 100644 mozilla/java/waterfall/wf/src/plugin/mozilla/wf_moz6_common.h delete mode 100644 mozilla/java/waterfall/wf/src/plugin/mozilla/wfe_mozilla.c delete mode 100644 mozilla/java/waterfall/wf/src/plugin/mozilla/wfm6_native.c delete mode 100644 mozilla/java/waterfall/wf/src/plugin/netscape4/Aptest.java delete mode 100644 mozilla/java/waterfall/wf/src/plugin/netscape4/JavaPlugin.c delete mode 100644 mozilla/java/waterfall/wf/src/plugin/netscape4/Makefile delete mode 100644 mozilla/java/waterfall/wf/src/plugin/netscape4/UnixShell.c delete mode 100644 mozilla/java/waterfall/wf/src/plugin/netscape4/common.h delete mode 100644 mozilla/java/waterfall/wf/src/plugin/netscape4/jri.h delete mode 100644 mozilla/java/waterfall/wf/src/plugin/netscape4/jri_md.h delete mode 100644 mozilla/java/waterfall/wf/src/plugin/netscape4/jritypes.h delete mode 100644 mozilla/java/waterfall/wf/src/plugin/netscape4/npapi.h delete mode 100644 mozilla/java/waterfall/wf/src/plugin/netscape4/npapi.h.my delete mode 100644 mozilla/java/waterfall/wf/src/plugin/netscape4/npunix.c delete mode 100644 mozilla/java/waterfall/wf/src/plugin/netscape4/npunix.c.my delete mode 100644 mozilla/java/waterfall/wf/src/plugin/netscape4/npupp.h delete mode 100644 mozilla/java/waterfall/wf/src/plugin/netscape4/npupp.h.my delete mode 100644 mozilla/java/waterfall/wf/src/plugin/netscape4/stubs.c delete mode 100644 mozilla/java/waterfall/wf/src/plugin/netscape4/wfe_netscape4.c delete mode 100644 mozilla/java/waterfall/wf/src/plugin/unix/Makefile delete mode 100644 mozilla/java/waterfall/wf/src/plugin/unix/java_plugin_shm.c delete mode 100644 mozilla/java/waterfall/wf/src/plugin/unix/java_plugin_shm_host.c delete mode 100644 mozilla/java/waterfall/wf/src/plugin/unix/jvmp_exec.c delete mode 100644 mozilla/java/waterfall/wf/src/plugin/unix/native.c delete mode 100644 mozilla/java/waterfall/wf/src/plugin/unix/shmtran.c delete mode 100644 mozilla/java/waterfall/wf/src/plugin/win32/native.c delete mode 100644 mozilla/java/waterfall/wf/tests/LC/LC.java delete mode 100644 mozilla/java/waterfall/wf/tests/LC/LC1.java delete mode 100644 mozilla/java/waterfall/wf/tests/LC/example1.html delete mode 100644 mozilla/java/waterfall/wf/tests/LC/example2.html delete mode 100644 mozilla/java/waterfall/wf/tests/LC/example3.html delete mode 100644 mozilla/java/waterfall/wf/tests/LC/example4.html delete mode 100644 mozilla/java/waterfall/wf/tests/LC/example5.html delete mode 100644 mozilla/java/waterfall/wf/tests/LC/example6.html delete mode 100644 mozilla/java/waterfall/wf/tests/https/SecureApplet.java delete mode 100644 mozilla/java/waterfall/wf/tests/https/data1.dat delete mode 100644 mozilla/java/waterfall/wf/tests/https/data2.dat delete mode 100644 mozilla/java/waterfall/wf/tests/https/example1.html delete mode 100644 mozilla/java/waterfall/wf_moz6/Makefile.in delete mode 100644 mozilla/java/waterfall/wf_moz6/doc/README.txt delete mode 100644 mozilla/java/waterfall/wf_moz6/doc/set_env.bat delete mode 100644 mozilla/java/waterfall/wf_moz6/doc/set_env.sh delete mode 100644 mozilla/java/waterfall/wf_moz6/makefile.win delete mode 100644 mozilla/java/waterfall/wf_moz6/public/Makefile.in delete mode 100644 mozilla/java/waterfall/wf_moz6/public/makefile.win delete mode 100644 mozilla/java/waterfall/wf_moz6/public/nsIBrowserJavaSupport.idl delete mode 100644 mozilla/java/waterfall/wf_moz6/public/nsIJavaHTMLObject.idl delete mode 100644 mozilla/java/waterfall/wf_moz6/public/nsIJavaObjectInfo.idl delete mode 100644 mozilla/java/waterfall/wf_moz6/public/nsIJavaPluginInstanceProxy.idl delete mode 100644 mozilla/java/waterfall/wf_moz6/public/nsIJavaPluginInstanceWrapper.idl delete mode 100644 mozilla/java/waterfall/wf_moz6/public/nsIPluggableJVM.idl delete mode 100644 mozilla/java/waterfall/wf_moz6/public/nsIWFInstanceWrapper.idl delete mode 100644 mozilla/java/waterfall/wf_moz6/public/nsoji2.idl delete mode 100644 mozilla/java/waterfall/wf_moz6/src/Makefile.in delete mode 100644 mozilla/java/waterfall/wf_moz6/src/makefile.win delete mode 100644 mozilla/java/waterfall/wf_moz6/src/nsAppletHTMLObject.cpp delete mode 100644 mozilla/java/waterfall/wf_moz6/src/nsAppletHTMLObject.h delete mode 100644 mozilla/java/waterfall/wf_moz6/src/nsCJVMFactory.cpp delete mode 100644 mozilla/java/waterfall/wf_moz6/src/nsJavaHTMLObject.cpp delete mode 100644 mozilla/java/waterfall/wf_moz6/src/nsJavaHTMLObject.h delete mode 100644 mozilla/java/waterfall/wf_moz6/src/nsJavaHTMLObjectFactory.cpp delete mode 100644 mozilla/java/waterfall/wf_moz6/src/nsJavaHTMLObjectFactory.h delete mode 100644 mozilla/java/waterfall/wf_moz6/src/nsJavaObjectInfo.cpp delete mode 100644 mozilla/java/waterfall/wf_moz6/src/nsJavaObjectInfo.h delete mode 100644 mozilla/java/waterfall/wf_moz6/src/nsPluggableJVM.cpp delete mode 100644 mozilla/java/waterfall/wf_moz6/src/nsPluggableJVM.h delete mode 100644 mozilla/java/waterfall/wf_moz6/src/nsWFSecureEnv.cpp delete mode 100644 mozilla/java/waterfall/wf_moz6/src/nsWFSecureEnv.h delete mode 100644 mozilla/java/waterfall/wf_moz6/src/nsWFSecurityContext.cpp delete mode 100644 mozilla/java/waterfall/wf_moz6/src/nsWFSecurityContext.h delete mode 100644 mozilla/java/waterfall/wf_moz6/src/wf_moz6_common.h diff --git a/mozilla/java/waterfall/wf/build/java/Defs.gmk b/mozilla/java/waterfall/wf/build/java/Defs.gmk deleted file mode 100644 index da8e319dfda..00000000000 --- a/mozilla/java/waterfall/wf/build/java/Defs.gmk +++ /dev/null @@ -1,30 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: Defs.gmk,v 1.1.1.1 2001-05-09 17:29:48 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -MAKEFLAGS += --no-print-directory - -RM = rm -f -JAVAC_CMD = $(WFJDKHOME)/bin/javac -JAR_CMD = $(WFJDKHOME)/bin/jar -MV = mv diff --git a/mozilla/java/waterfall/wf/build/java/FileListCommon.mk b/mozilla/java/waterfall/wf/build/java/FileListCommon.mk deleted file mode 100644 index 72407e1de48..00000000000 --- a/mozilla/java/waterfall/wf/build/java/FileListCommon.mk +++ /dev/null @@ -1,48 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: FileListCommon.mk,v 1.1.1.1 2001-05-09 17:29:49 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -FILES_java = \ - sun/jvmp/HostObjectPeer.java \ - sun/jvmp/PluggableJVM.java \ - sun/jvmp/ObjectFactory.java \ - sun/jvmp/BrowserSupport.java \ - sun/jvmp/IDObject.java \ - sun/jvmp/IDList.java \ - sun/jvmp/NativeFrame.java \ - sun/jvmp/NativeThread.java \ - sun/jvmp/SynchroObject.java \ - sun/jvmp/WaterfallExtension.java \ - sun/jvmp/MultipleHashtable.java \ - sun/jvmp/ComponentException.java \ - sun/jvmp/HostObjectPeerFactory.java \ - sun/jvmp/ComponentLoader.java \ - sun/jvmp/test/MyDialog.java \ - sun/jvmp/test/MyActionListener.java \ - sun/jvmp/test/TestPeerFactory.java \ - sun/jvmp/security/SecurityCaps.java \ - sun/jvmp/security/ExtSecurityManager.java \ - sun/jvmp/security/AccessControlDecider.java \ - sun/jvmp/security/CallingContext.java \ - sun/jvmp/security/WFPolicy.java \ - sun/jvmp/generic/GenericSynchroObject.java diff --git a/mozilla/java/waterfall/wf/build/java/FileListUnix.mk b/mozilla/java/waterfall/wf/build/java/FileListUnix.mk deleted file mode 100644 index 9cac092a06e..00000000000 --- a/mozilla/java/waterfall/wf/build/java/FileListUnix.mk +++ /dev/null @@ -1,27 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: FileListUnix.mk,v 1.1.1.1 2001-05-09 17:29:49 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -FILES_java += \ - sun/jvmp/generic/motif/Plugin.java \ - sun/jvmp/generic/motif/PthreadSynchroObject.java diff --git a/mozilla/java/waterfall/wf/build/java/FileListWin.mk b/mozilla/java/waterfall/wf/build/java/FileListWin.mk deleted file mode 100644 index c45fd8cd238..00000000000 --- a/mozilla/java/waterfall/wf/build/java/FileListWin.mk +++ /dev/null @@ -1,26 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: FileListWin.mk,v 1.1.1.1 2001-05-09 17:29:49 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -FILES_java=$(FILES_java)\ - sun/jvmp/generic/win32/Plugin.java diff --git a/mozilla/java/waterfall/wf/build/java/GNUmakefile b/mozilla/java/waterfall/wf/build/java/GNUmakefile deleted file mode 100644 index d45c9bbb706..00000000000 --- a/mozilla/java/waterfall/wf/build/java/GNUmakefile +++ /dev/null @@ -1,64 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: GNUmakefile,v 1.1.1.1 2001-05-09 17:29:50 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -ifndef WFJDKHOME -all classes: - @echo - @echo "Set your WFJDKHOME to path to JDK!" - @echo -else - -BUILDDIR = . -JAVASRCDIR = ../../java -CLASSDESTDIR = ../unix/classes -ADDCLASSPATH = ../unix/classes -PATH_SEP=: -SUBDIRS = ext - -default: all - -include FileListCommon.mk -include FileListUnix.mk - -include $(BUILDDIR)/Defs.gmk -include $(BUILDDIR)/Rules.gmk -endif - -all: classes exts - -release: all wf.jar - -wf.jar: - @echo -n "Making JAR file....."; \ - cd $(CLASSDESTDIR); \ - $(JAR_CMD) cf wf.jar sun netscape ; \ - $(MV) wf.jar ..; \ - echo " done." - -exts: - @echo "Making Waterfall extension components" - @cd ext; \ - $(MAKE) all - -.PHONY : all classes clean exts diff --git a/mozilla/java/waterfall/wf/build/java/Rules.gmk b/mozilla/java/waterfall/wf/build/java/Rules.gmk deleted file mode 100644 index f08cf310972..00000000000 --- a/mozilla/java/waterfall/wf/build/java/Rules.gmk +++ /dev/null @@ -1,66 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: Rules.gmk,v 1.1.1.1 2001-05-09 17:29:50 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -$(CLASSDESTDIR): - @mkdir -p $@ - -.delete.classlist: - @$(RM) .classes.list - -.compile.classlist: - @if [ -s .classes.list ] ; \ - then echo "Compiling Java files"; cat .classes.list; \ - $(JAVAC_CMD) -d $(CLASSDESTDIR) -classpath $(CLASSDESTDIR)$(PATH_SEP)$(ADDCLASSPATH)$(PATH_SEP)$(CLASSPATH)\ - $(shell if [ -s .classes.list ] ; then cat .classes.list; fi ) ; \ - fi - -FILES_class = $(FILES_java:%.java=$(CLASSDESTDIR)/%.class) - -ifdef SUBDIRS -LOOP_OVER_DIRS = @for d in $(SUBDIRS); do \ - oldDir=`pwd`; \ - set -e; \ - cd $$d; $(MAKE) $@; cd $$oldDir; \ - set +e; \ - done -endif - - -$(CLASSDESTDIR)/%.class: $(JAVASRCDIR)/%.java - @echo $? >>.classes.list - -classes: $(CLASSES_INIT) $(CLASSDESTDIR) .delete.classlist $(FILES_class) .compile.classlist - -clean: - @echo "Removing compiled classfiles from $(CLASSDESTDIR)" - @$(RM) -r $(CLASSDESTDIR) .classes.list - $(LOOP_OVER_DIRS) - -.PHONY: .delete.classlist .compile.classlist - - - - - - diff --git a/mozilla/java/waterfall/wf/build/java/defs.mk b/mozilla/java/waterfall/wf/build/java/defs.mk deleted file mode 100644 index 7adf6212b13..00000000000 --- a/mozilla/java/waterfall/wf/build/java/defs.mk +++ /dev/null @@ -1,29 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: defs.mk,v 1.1.1.1 2001-05-09 17:29:48 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -DEL=del/f/q -DELTREE=rmdir/s/q -MV=move -JAVAC_CMD=$(WFJDKHOME)\bin\javac.exe -JAR_CMD = $(WFJDKHOME)\bin\jar.exe diff --git a/mozilla/java/waterfall/wf/build/java/ext/GNUmakefile b/mozilla/java/waterfall/wf/build/java/ext/GNUmakefile deleted file mode 100644 index e92d1849713..00000000000 --- a/mozilla/java/waterfall/wf/build/java/ext/GNUmakefile +++ /dev/null @@ -1,33 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: GNUmakefile,v 1.1.1.1 2001-05-09 17:29:51 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -SUBDIRS = jpav moz6 - -all clean: - @for i in $(SUBDIRS) ; do \ - echo ">>>Recursively making "$$i" "$@"..."; \ - cd $$i; $(MAKE) $@ \ - || exit 1; cd ..; \ - echo "<< - -FILES_java = \ - sun/jvmp/jpav/ActivatorAppletContext.java \ - sun/jvmp/jpav/ActivatorAppletPanel.java \ - sun/jvmp/jpav/AppletMessageHandler.java \ - sun/jvmp/jpav/ActivatorClassLoader.java \ - sun/jvmp/jpav/ClassLoaderInfo.java \ - sun/jvmp/jpav/ActivatorProxyHandler.java \ - sun/jvmp/jpav/CookieHandler.java \ - sun/jvmp/jpav/ProxyHandler.java \ - sun/jvmp/jpav/JavaPluginAVFactory.java \ - sun/jvmp/jpav/RMIActivatorSocketFactory.java \ - sun/jvmp/jpav/protocol/jdk12/http/HttpClient.java \ - sun/jvmp/jpav/protocol/jdk12/http/HttpURLConnection.java \ - sun/jvmp/jpav/protocol/jdk12/http/Handler.java \ - sun/jvmp/jpav/protocol/jdk12/http/SocksSocket.java \ - sun/jvmp/jpav/protocol/jdk12/https/BrowserHttpsInputStream.java \ - sun/jvmp/jpav/protocol/jdk12/https/BrowserHttpsOutputStream.java \ - sun/jvmp/jpav/protocol/jdk12/https/BrowserHttpsURLConnection.java \ - sun/jvmp/jpav/protocol/jdk12/https/Handler.java \ - sun/jvmp/jpav/protocol/jdk12/ftp/Handler.java \ - sun/jvmp/jpav/protocol/jdk12/gopher/Handler.java \ - sun/jvmp/jpav/protocol/jdk12/jar/Handler.java diff --git a/mozilla/java/waterfall/wf/build/java/ext/jpav/GNUmakefile b/mozilla/java/waterfall/wf/build/java/ext/jpav/GNUmakefile deleted file mode 100644 index 21784510806..00000000000 --- a/mozilla/java/waterfall/wf/build/java/ext/jpav/GNUmakefile +++ /dev/null @@ -1,49 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: GNUmakefile,v 1.1.1.1 2001-05-09 17:29:52 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -BUILDDIR = ../.. -JAVASRCDIR = ../../../../java -CLASSDESTDIR = ../../../unix/ext/jpav -ADDCLASSPATH=../../../unix/classes:../../../unix/ext/jpav -PATH_SEP=: - -include FileListExt.mk - -include $(BUILDDIR)/Defs.gmk -include $(BUILDDIR)/Rules.gmk - -all: jpav.jar - -jpav.jar: classes - @if [ -s .classes.list ]; then \ - echo -n "Creating jpav.jar..."; \ - cd $(CLASSDESTDIR); \ - $(RM) manifest.tmp; \ - echo "Factory-Class: sun.jvmp.jpav.JavaPluginAVFactory" >> manifest.tmp ; \ - echo "Protocol-Handlers: sun.jvmp.jpav.protocol.jdk12" >> manifest.tmp ; \ - $(JAR_CMD) cfm jpav.jar manifest.tmp sun ; \ - $(MV) jpav.jar .. ;\ - echo " done."; fi - - diff --git a/mozilla/java/waterfall/wf/build/java/ext/jpav/makefile.win b/mozilla/java/waterfall/wf/build/java/ext/jpav/makefile.win deleted file mode 100644 index f2438358a66..00000000000 --- a/mozilla/java/waterfall/wf/build/java/ext/jpav/makefile.win +++ /dev/null @@ -1,61 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: makefile.win,v 1.1.1.1 2001-05-09 17:29:52 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -BUILDDIR = ..\.. -JAVASRCDIR = ..\..\..\..\java -CLASSDESTDIR = ..\..\..\win32\ext\jpav -ADDCLASSPATH=..\..\..\win32\classes;..\..\..\win32\ext\jpav -EDBURNS=edburns -PATH_SEP=; - -PKG3=sun.jvmp.jpav -PKG4=sun.jvmp.jpav.protocol.jdk12.http -PKG15=sun.jvmp.jpav.protocol.jdk12.https -PKG16=sun.jvmp.jpav.protocol.jdk12.ftp -PKG17=sun.jvmp.jpav.protocol.jdk12.gopher -PKG18=sun.jvmp.jpav.protocol.jdk12.jar - -!include FileListExt.mk - -# ugly, but nmake is pretty stupid in substitutions -CLASSDESTDIR=..\..\..\win32\ext\jpav -FILES_class = $(FILES_java:sun/jvmp=../../../win32/ext/jpav/sun/jvmp) - -!include $(BUILDDIR)\defs.mk -!include $(BUILDDIR)\rules.mk - -all: jpav.jar - -jpav.jar: classes - @IF EXIST manifest.tmp $(DEL) manifest.tmp - @ echo Creating jpav.jar... - @ cd $(CLASSDESTDIR) - @$(JAR_CMD) cfm jpav.jar < - -all clean: - @ cd jpav - @ $(MAKE) -fmakefile.win -nologo $@ - @ cd ..\moz6 - @ $(MAKE) -fmakefile.win -nologo $@ - diff --git a/mozilla/java/waterfall/wf/build/java/ext/moz6/FileListExt.mk b/mozilla/java/waterfall/wf/build/java/ext/moz6/FileListExt.mk deleted file mode 100644 index 8b14ee94ba5..00000000000 --- a/mozilla/java/waterfall/wf/build/java/ext/moz6/FileListExt.mk +++ /dev/null @@ -1,29 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: FileListExt.mk,v 1.1.1.1 2001-05-09 17:29:53 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -FILES_java =\ - sun/jvmp/mozilla/MozillaAppletPeer.java \ - sun/jvmp/mozilla/MozillaHostObjectPeer.java \ - sun/jvmp/mozilla/MozillaPeerFactory.java \ - sun/jvmp/mozilla/MozillaSecurityManager.java diff --git a/mozilla/java/waterfall/wf/build/java/ext/moz6/GNUmakefile b/mozilla/java/waterfall/wf/build/java/ext/moz6/GNUmakefile deleted file mode 100644 index b5c8e4aa117..00000000000 --- a/mozilla/java/waterfall/wf/build/java/ext/moz6/GNUmakefile +++ /dev/null @@ -1,46 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: GNUmakefile,v 1.1.1.1 2001-05-09 17:29:53 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -BUILDDIR = ../.. -JAVASRCDIR = ../../../../java -CLASSDESTDIR = ../../../unix/ext/moz6 -ADDCLASSPATH=../../../unix/classes:../../../unix/ext/moz6 -PATH_SEP=: - -include FileListExt.mk - -include $(BUILDDIR)/Defs.gmk -include $(BUILDDIR)/Rules.gmk - -all: moz6.jar - -moz6.jar: classes - @if [ -s .classes.list ]; then \ - echo -n "Creating moz6.jar..." ;\ - cd $(CLASSDESTDIR) ;\ - $(JAR_CMD) cf moz6.jar sun ; \ - $(MV) moz6.jar .. ;\ - echo " done."; fi - - diff --git a/mozilla/java/waterfall/wf/build/java/ext/moz6/makefile.win b/mozilla/java/waterfall/wf/build/java/ext/moz6/makefile.win deleted file mode 100644 index c586b2b957f..00000000000 --- a/mozilla/java/waterfall/wf/build/java/ext/moz6/makefile.win +++ /dev/null @@ -1,50 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: makefile.win,v 1.1.1.1 2001-05-09 17:29:53 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -BUILDDIR = ..\.. -JAVASRCDIR = ..\..\..\..\java -CLASSDESTDIR = ..\..\..\win32\ext\moz6 -ADDCLASSPATH=..\..\..\win32\classes;..\..\..\win32\ext\moz6 -PATH_SEP=; - -PKG3=sun.jvmp.mozilla - -!include FileListExt.mk - -# ugly, but nmake is pretty stupid in substitutions -CLASSDESTDIR=..\..\..\win32\ext\moz6 -FILES_class = $(FILES_java:sun/jvmp=../../../win32/ext/moz6/sun/jvmp) - -!include $(BUILDDIR)\defs.mk -!include $(BUILDDIR)\rules.mk - -all: moz6.jar - -moz6.jar: classes - @ echo Creating moz6.jar... - @ cd $(CLASSDESTDIR) - @$(JAR_CMD) cf moz6.jar sun - -@$(DEL) ..\moz6.jar 2>NUL - @$(MV) moz6.jar .. - @ echo Done diff --git a/mozilla/java/waterfall/wf/build/java/makefile.win b/mozilla/java/waterfall/wf/build/java/makefile.win deleted file mode 100644 index 5caf29a3bd3..00000000000 --- a/mozilla/java/waterfall/wf/build/java/makefile.win +++ /dev/null @@ -1,66 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: makefile.win,v 1.1.1.1 2001-05-09 17:29:50 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -PKG=sun.jvmp -PKG6=sun.jvmp.mozilla -PKG7=sun.jvmp.netscape4 -PKG8=sun.jvmp.security -PKG11=sun.jvmp.generic.win32 -PKG12=sun.jvmp.test -PKG13=sun.jvmp.generic - -BUILDDIR=. -JAVASRCDIR=..\..\java -ADDCLASSPATH=..\win32\classes -PATH_SEP=; -SUBDIRS=ext - -!include FileListCommon.mk -!include FileListWin.mk - -# ugly, but nmake is pretty stupid in substitutions -CLASSDESTDIR=..\win32\classes -FILES_class = $(FILES_java:sun/jvmp=../win32/classes/sun/jvmp) -FILES_class = $(FILES_class:netscape/javascript=../win32/classes/netscape/javascript) -!include defs.mk -!include rules.mk - - -all: classes exts - -release: all wf.jar - -exts: - @ cd ext - @ $(MAKE) -f makefile.win -nologo all - -wf.jar: - @ echo "Creating wf.jar file" - @ cd $(CLASSDESTDIR) - -@ $(JAR_CMD) cf wf.jar sun netscape - -@$(DEL) ..\wf.jar - -@$(MV) wf.jar .. - -.PHONY : all classes clean release exts - diff --git a/mozilla/java/waterfall/wf/build/java/rules.mk b/mozilla/java/waterfall/wf/build/java/rules.mk deleted file mode 100644 index 8497226170b..00000000000 --- a/mozilla/java/waterfall/wf/build/java/rules.mk +++ /dev/null @@ -1,107 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: rules.mk,v 1.1.1.1 2001-05-09 17:29:51 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -# nmake isn't the best make program I know about -FILES_class = $(FILES_class:.java=.class) -FILES_class=$(FILES_class:/=\) -PKG1_DIR=$(PKG:.=\) -PKG2_DIR=$(PKG2:.=\) -PKG3_DIR=$(PKG3:.=\) -PKG4_DIR=$(PKG4:.=\) -PKG5_DIR=$(PKG5:.=\) -PKG6_DIR=$(PKG6:.=\) -PKG7_DIR=$(PKG7:.=\) -PKG8_DIR=$(PKG8:.=\) -PKG9_DIR=$(PKG9:.=\) -PKG10_DIR=$(PKG10:.=\) -PKG11_DIR=$(PKG11:.=\) -PKG12_DIR=$(PKG12:.=\) -PKG13_DIR=$(PKG13:.=\) -PKG14_DIR=$(PKG14:.=\) -PKG15_DIR=$(PKG15:.=\) -PKG16_DIR=$(PKG16:.=\) -PKG17_DIR=$(PKG17:.=\) -PKG18_DIR=$(PKG18:.=\) - -{$(JAVASRCDIR)\$(PKG1_DIR)\}.java{$(CLASSDESTDIR)\$(PKG1_DIR)\}.class: - @echo $(?) >>.classes.list -{$(JAVASRCDIR)\$(PKG2_DIR)\}.java{$(CLASSDESTDIR)\$(PKG2_DIR)\}.class: - @echo $(?) >>.classes.list -{$(JAVASRCDIR)\$(PKG3_DIR)\}.java{$(CLASSDESTDIR)\$(PKG3_DIR)\}.class: - @echo $(?) >>.classes.list -{$(JAVASRCDIR)\$(PKG4_DIR)\}.java{$(CLASSDESTDIR)\$(PKG4_DIR)\}.class: - @echo $(?) >>.classes.list -{$(JAVASRCDIR)\$(PKG5_DIR)\}.java{$(CLASSDESTDIR)\$(PKG5_DIR)\}.class: - @echo $(?) >>.classes.list -{$(JAVASRCDIR)\$(PKG6_DIR)\}.java{$(CLASSDESTDIR)\$(PKG6_DIR)\}.class: - @echo $(?) >>.classes.list -{$(JAVASRCDIR)\$(PKG7_DIR)\}.java{$(CLASSDESTDIR)\$(PKG7_DIR)\}.class: - @echo $(?) >>.classes.list -{$(JAVASRCDIR)\$(PKG8_DIR)\}.java{$(CLASSDESTDIR)\$(PKG8_DIR)\}.class: - @echo $(?) >>.classes.list -{$(JAVASRCDIR)\$(PKG9_DIR)\}.java{$(CLASSDESTDIR)\$(PKG9_DIR)\}.class: - @echo $(?) >>.classes.list -{$(JAVASRCDIR)\$(PKG10_DIR)\}.java{$(CLASSDESTDIR)\$(PKG10_DIR)\}.class: - @echo $(?) >>.classes.list -{$(JAVASRCDIR)\$(PKG11_DIR)\}.java{$(CLASSDESTDIR)\$(PKG11_DIR)\}.class: - @echo $(?) >>.classes.list -{$(JAVASRCDIR)\$(PKG12_DIR)\}.java{$(CLASSDESTDIR)\$(PKG12_DIR)\}.class: - @echo $(?) >>.classes.list -{$(JAVASRCDIR)\$(PKG13_DIR)\}.java{$(CLASSDESTDIR)\$(PKG13_DIR)\}.class: - @echo $(?) >>.classes.list -{$(JAVASRCDIR)\$(PKG14_DIR)\}.java{$(CLASSDESTDIR)\$(PKG14_DIR)\}.class: - @echo $(?) >>.classes.list -{$(JAVASRCDIR)\$(PKG15_DIR)\}.java{$(CLASSDESTDIR)\$(PKG15_DIR)\}.class: - @echo $(?) >>.classes.list -{$(JAVASRCDIR)\$(PKG16_DIR)\}.java{$(CLASSDESTDIR)\$(PKG16_DIR)\}.class: - @echo $(?) >>.classes.list -{$(JAVASRCDIR)\$(PKG17_DIR)\}.java{$(CLASSDESTDIR)\$(PKG17_DIR)\}.class: - @echo $(?) >>.classes.list -{$(JAVASRCDIR)\$(PKG18_DIR)\}.java{$(CLASSDESTDIR)\$(PKG18_DIR)\}.class: - @echo $(?) >>.classes.list - - -.SUFFIXES: -.SUFFIXES: .java .class - -classes: $(CLASSES_INIT) $(CLASSDESTDIR) delete.classlist $(FILES_class) compile.classlist - -$(CLASSDESTDIR): - @mkdir $@ - -delete.classlist: - @if exist .classes.list $(DEL) .classes.list - -compile.classlist: - @if exist .classes.list echo "Compiling Java classes" - @if exist .classes.list type .classes.list - @if exist .classes.list $(JAVAC_CMD) -d $(CLASSDESTDIR) -classpath $(CLASSDESTDIR)$(PATH_SEP)$(ADDCLASSPATH)$(PATH_SEP)$(CLASSPATH) \ - @.classes.list - -clean: - @ echo Remove classfiles from $(CLASSDESTDIR) - @ IF EXIST $(CLASSDESTDIR) $(DELTREE) $(CLASSDESTDIR) - @ IF EXIST .classes.list $(DEL) .classes.list - -.PHONY: delete.classlist compile.classlist classes diff --git a/mozilla/java/waterfall/wf/build/unix/Defs.gmk b/mozilla/java/waterfall/wf/build/unix/Defs.gmk deleted file mode 100644 index 45e20b3e906..00000000000 --- a/mozilla/java/waterfall/wf/build/unix/Defs.gmk +++ /dev/null @@ -1,109 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: Defs.gmk,v 1.1.1.1 2001-05-09 17:29:53 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -BUILDDIR=. -ROOTDIR=../.. - -MAKE = gmake -CXX = g++ -Wall -Wno-long-long -CC = gcc -pedantic -Wall -Wno-long-long -LD = gcc -CCOPT = -g -CP = cp -TAR = tar - -# type of really used JVM -# values: _JVMP_IBMJVM, _JVMP_SUNJVM -#JVMTYPE = _JVMP_IBMJVM -JVMTYPE = _JVMP_SUNJVM -JVMKIND = hotspot -#JVMKIND = classic -# using pthreads, should be defined by smth like configure -THREADTYPE = _JVMP_PTHREADS -USE_SHM = 0 - -uname = $(shell uname) -ifeq ($(uname), SunOS) -PLATFORM = solaris -endif -ifeq ($(uname), Linux) -PLATFORM = linux -endif - -archExpr = case "`uname -m`" in \ - i[3-6]86) \ - echo i386 \ - ;; \ - i86pc) \ - echo i386 \ - ;; \ - sparc*) \ - echo sparc \ - ;; \ - sun4u) \ - echo sparc \ - ;; \ - *) \ - uname -m \ - ;; \ - esac -ARCH = $(shell $(archExpr) ) - -CCDEBUG = -PICFLAGS = -fPIC -DPIC -INCLUDES = -I$(ROOTDIR)/include -I$(ROOTDIR)/include/$(PLATFORM) -I../../public -I../../public/$(PLATFORM) -I$(WFJDKHOME)/include -I$(WFJDKHOME)/include/$(PLATFORM) -EXTRA_CFLAGS = $(CCOPT) $(CCDEBUG) - -CFLAGS = -D_REENTRANT $(PICFLAGS) $(EXTRA_CFLAGS) $(INCLUDES) -D$(JVMTYPE) -D$(THREADTYPE) -DXP_UNIX -D_GNU_SOURCE -D_JVMP_IMPLEMENTATION -LIBFLAGS = -shared $(CCDEBUG) - -ifeq ($(PLATFORM),linux) -CFLAGS += -rdynamic -XLIBS= -L/usr/X11R6/lib -lXt -PLUGINLIBS=-ldl -HOSTLIBS= -ldl -lpthread $(GTKLIBS) -INCLUDES += -I/usr/X11R6/include -CXXFLAGS= -endif - -ifeq ($(PLATFORM),solaris) -XLIBS= -L/usr/openwin/lib -lXt -PLUGINLIBS=-ldl -lthread -HOSTLIBS= -ldl -lthread $(GTKLIBS) -INCLUDES += -I/usr/openwin/include -CXXFLAGS= -fpermissive -endif - -GTKLIBS = $(shell gtk-config --libs) -GTKCFLAGS = $(shell gtk-config --cflags) - - -CFLAGS += -DARCH="\"$(ARCH)\"" -DJVMKIND="\"$(JVMKIND)\"" -DPLATFORM="\"$(PLATFORM)\"" -CXXFLAGS += $(GTKCFLAGS) $(INCLUDES) -DXP_UNIX - -ifeq ($(USE_SHM), 1) -CFLAGS += -DJVMP_USE_SHM -else -PLUGINLIBS+=-lpthread -endif diff --git a/mozilla/java/waterfall/wf/build/unix/GNUmakefile b/mozilla/java/waterfall/wf/build/unix/GNUmakefile deleted file mode 100644 index ffedf256297..00000000000 --- a/mozilla/java/waterfall/wf/build/unix/GNUmakefile +++ /dev/null @@ -1,183 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: GNUmakefile,v 1.1.1.1 2001-05-09 17:29:53 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -include Defs.gmk -#___________________________________________________________________ -# sources of Java Plugin DLL -PLUGINCSRCDIR = ../../src/plugin -ifeq ($(USE_SHM), 1) -PLUGINCSRCS = shmtran.c java_plugin_shm.c -PLUGIN_DLL = libjvmp_shm.so -else -PLUGINCSRCS = jpthreads.c java_plugin.c -PLUGIN_DLL = libjvmp.so -endif - -# source of native methods og WF -PLUGINNATIVESRC=native.c - -# native methods of Waterfall itself -PLUGIN_NATIVE_DLL = libJVMPnatives.so - -# source of Mozilla-dependent module - should be separeated -MOZEXTSRCDIR = ../../src/plugin/mozilla -MOZEXTCSRC = wfe_mozilla.c wfm6_native.c -MOZEXT_DLL = libwf_moz6.so - -PRELOAD_HACK = Helper.libXm.so.4 - -TESTEXTSRCDIR = ../../src/host -TESTEXTCSRC = test_extension.c -TESTEXT_DLL = libwf_test.so - -# source of Netscape4x-dependent module - should be separeated -NCEXTSRCDIR = ../../src/plugin/netscape4 -NCEXTCSRC = wfe_netscape4.c shmtran.c -NCEXT_DLL = libwf_netscape4.so - -HOSTCPPSRCDIR = ../../src/host -HOSTCPPSRCS = host.cpp -HOSTPROG = plugin_host - -VPATH=$(PLUGINCSRCDIR):$(HOSTCPPSRCDIR):$(MOZEXTSRCDIR):$(NCEXTSRCDIR):$(TESTEXTSRCDIR):$(PLUGINCSRCDIR)/unix - - - -PLUGINOBJS=$(PLUGINCSRCS:%.c=%.o) -PLUGIN_NATIVE_OBJS=$(PLUGINNATIVESRC:%.c=%.o) -HOSTOBJS=$(HOSTCPPSRCS:%.cpp=%.o) -MOZEXTOBJS = $(MOZEXTCSRC:%.c=%.o) -NCEXTOBJS = $(NCEXTCSRC:%.c=%.o) -TESTEXTOBJS=$(TESTEXTCSRC:%.c=%.o) - -all: sane -release: all - @ cd ../java; $(MAKE) release - @ rm -rf wfrelease; mkdir wfrelease; mkdir wfrelease/ext - @ cp $(PRELOAD_HACK) wfrelease - @ cp wf.jar wfrelease - @ cp $(PLUGIN_DLL) wfrelease - @ cp $(MOZEXT_DLL) wfrelease - @ cp $(PLUGIN_NATIVE_DLL) wfrelease - @ cp plugin.policy wfrelease - @ cp set_paths wfrelease - @ cp ext/*.jar wfrelease/ext - @ $(TAR) czf wf-bin.tgz wfrelease - @ echo "Release is wf-bin.tgz" -.SUFFIXES: -.SUFFIXES: .cpp .c .o -.cpp.o: - $(CXX) $(CXXFLAGS) -c $< -.c.o: - $(CC) $(CFLAGS) -c $< - -ifndef WFJDKHOME -sane: - @echo - @echo "Set WFJDKHOME before" - @echo -else -sane: GNUmakefile plugin host_prog ext plugin.policy -endif - -natives: plugin_no_java host_prog -plugin_no_java: plugin_objs plugin_dll plugin_native_dll plugin_exec -plugin: plugin_no_java java -plugin_objs: $(PLUGINOBJS) $(PLUGIN_NATIVE_OBJS) -plugin_dll: $(PLUGIN_DLL) -ext: $(MOZEXT_DLL) $(NCEXT_DLL) $(TESTEXT_DLL) $(PRELOAD_HACK) -$(MOZEXT_DLL): $(MOZEXTOBJS) - $(LD) $(LIBFLAGS) -o $(MOZEXT_DLL) $(MOZEXTOBJS) - cp -f $(MOZEXT_DLL) libwf_moz6_g.so -$(PRELOAD_HACK): ../../src/plugin/mozilla/XmHelper.c - gcc -D_GNU_SOURCE -O2 -fPIC -shared ../../src/plugin/mozilla/XmHelper.c -o $(PRELOAD_HACK) -ldl -$(TESTEXT_DLL): $(TESTEXTOBJS) - $(LD) $(LIBFLAGS) -o $(TESTEXT_DLL) $(TESTEXTOBJS) - cp -f $(TESTEXT_DLL) libwf_test_g.so -ifeq ($(USE_SHM), 1) -$(NCEXT_DLL): $(NCEXTOBJS) - $(LD) $(LIBFLAGS) -o $(NCEXT_DLL) $(NCEXTOBJS) - cp -f $(NCEXT_DLL) libwf_netscape4_g.so -else -$(NCEXT_DLL): - @echo "Not building Netscape 4 extension if SHM disabled" -endif -$(PLUGIN_DLL): $(PLUGINOBJS) - $(LD) $(LIBFLAGS) -o $(PLUGIN_DLL) $(PLUGINOBJS) $(PLUGINLIBS) -plugin_native_dll: $(PLUGIN_NATIVE_DLL) -$(PLUGIN_NATIVE_DLL): $(PLUGIN_NATIVE_OBJS) - $(LD) $(LIBFLAGS) -o $(PLUGIN_NATIVE_DLL) $(PLUGIN_NATIVE_OBJS) $(JAVALIBS) $(XLIBS) - cp -f $(PLUGIN_NATIVE_DLL) libJVMPnatives_g.so -java: - @cd ../java; $(MAKE) all - -host_prog: $(HOSTOBJS) $(HOSTPROG) - -host_objs: $(HOSTOBJS) -$(HOSTPROG): $(HOSTOBJS) - $(CXX) -o $(HOSTPROG) $(HOSTOBJS) $(HOSTLIBS) - -clean: java_clean - rm -f $(HOSTPROG) $(PLUGINOBJS) $(HOSTOBJS) core *.so *.o $(PRELOAD_HACK) plugin.policy - -java_clean: - @cd ../java; $(MAKE) clean - -ifeq ($(USE_SHM), 1) -plugin_exec: jvmp_exec -jvmp_exec: java_plugin_shm_host.o shmtran.o - $(CC) $(CFLAGS) -o jvmp_exec java_plugin_shm_host.o shmtran.o $(PLUGINLIBS) -else -plugin_exec: -endif - -plugin.policy: ../../java/plugin.policy - @$(CP) -f ../../java/plugin.policy . -.PHONY: java clean all host_objs plugin_native_dll plugin_exec - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mozilla/java/waterfall/wf/build/unix/dump.sh b/mozilla/java/waterfall/wf/build/unix/dump.sh deleted file mode 100644 index 644a8d0be10..00000000000 --- a/mozilla/java/waterfall/wf/build/unix/dump.sh +++ /dev/null @@ -1,25 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: dump.sh,v 1.1.1.1 2001-05-09 17:29:53 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -tar czvf /tmp/jp.tgz /ws/M2308/mozilla/modules/jvmp/java/ /ws/M2308/mozilla/modules/jvmp/public/ /ws/M2308/mozilla/modules/jvmp/src/ /ws/M2308/mozilla/modules/jvmp/build/java/ /ws/M2308/mozilla/modules/jvmp/build/unix/GNUmakefile diff --git a/mozilla/java/waterfall/wf/build/unix/ext/jpav.jar b/mozilla/java/waterfall/wf/build/unix/ext/jpav.jar deleted file mode 100644 index 0f0bcf46d833bfa1bc3e6b77f82564f46c0c1ece..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 38000 zcmb5VW0WP)mMvVBS!vt0ZCBd1ZQHhOYaiLt0o#fJR(Kgzjtn#}D8ia*|-+|3Co! zJ526hUX1(~@xLyX7LXAa5mr>9l@`&Ss)OvOhxgm#iE|w-6^v17vC)7>fdt8~z&1~6 zJS#p-_`RbOEOUkTy@TJDdQ`-PwFXkI1QCpk#!NA&yn>rfHI%NWR)P_Nf!2BuP&H#K z3a|-OSe!Gc@8YfL8AOOMl`r2SO0>ud_g9s1F>odV_M})xSD^1Zr&74?IsYE%{E7Zn z$1O%M1ojUy?H3&8k$-<``QP&&WFY@Z?Ef5zUw^-Kbhe@U*9eGzM_9O6+x-tP*#8W( zu+w+>C-%P|{(r>c9}oTKE&quXFmy6^(RZ?S5U{heGIkQQwQ(|bbD}l0(sy)>R(*HG zQbqY1g=U*8jjd%ZNfo1@z;D)o50eHX{->V;-a9jhOqVr zD(*xgPikHS0csVe0vLfZCi!FF^7X^vyfD3>yi8X&dI+VLnR;DsIriLlo@9AGrhb1t zxta-LiRozwYYat&z^2`KYaC2hLOWtIrm5PC z)T*O!!0-gr=|Pdy=)+A{i~JNuk>QfSWYrUBMl*Jnp+6DMe}7F9`{;}SuviT+VRrkO z2H#~xoEX1H5}pJ^(1p)ZVCcx*8gS{%!}p~czeK?Il*T&#F)UQJ1Uv#x7RPY zQ(xdvO0LqA?IGJJNG6MkzQViVt#DEGS6Y@CMwkQWZP28lW(P&$w%lu zMTI6a)O0{>B=aUU)OTYcVsx#{}%qg6X{%jd%*I$#PcYF#siw}iznLe@P zi?BUecDf3qjbw&nqqdsD02H4KrAgk zoLlv&&)v{ek)7C{!EjV>ahWz|0ODNUA*`7o%QEqskc*9}i-@Do&PjCz2bkMsl$KT` zkS=d^nKM{W;me}BO@mDjrw^T)OnaGBwJ8bCYnCOF!BLLeuC)TIhpz>O$7!q3$|xKr zYTT^>0aHsrHt^5GcPb7S@}6_lMNxz^ZCjHW^92!0 z!4* z?Tu&ZJKsd0XZ)rbrz^nO_#v8RuWS`et!5XLHEP7umWn6~ItbV|0JX%_vP|`OgU%qK zZU@~RE|WdE?v)UfXnO^9nBYp9YSjZmz}OvPBcV@>U2XV@@rv9qv_1=3xIh07*j`6U znM+H6fk(H-UFYwJ03!6VpxxNyK`vJu&k~hc-N^nzXL&P+2mh3qoCKpy<>6k$ zW>R2;aD|~Y5+{|;)SB{4TlzoV`{vki_r1++_ek9U1XAc5X2m0nhr5;m(l-PE9)%YE z8wjCpKlgKlTRP(l=Po&JbiE8owu_Fa5#{=XM0oTB<1uZbe=9m_Pnh1W!-g@R^>PPy zjXsOciEJX9`IIJgW(x&OV;+oQ(FHX5q8GB=354r$1<)Pa*uxzmCIBbl)RJ)Sxh{OK zC=;E~|61D6 z{ofL^oW6~*6|uODxs$QOzh`GfYgr@#c%SCWxhIccjXIFqV!fqvd3GXaKTQ4B{& z8)Q4hF->9g)~dXGq)D{eyaU(_&a3^LfOq#acWTDN!`^u4DH&w2C;By*OZ`*gCk(q)AlYssH&Y$b31jvunsO`e#S>^n z9J*b+{Vg0?UQRAv^?E{BaB1Q4(yErR+Agvz`ojQ$>llN%gBqTpY#zGLyIFB;U~6g& zwU8-2D>>A0KKRWutWtv^eh@`aQk2QOX*t5w9XalX=WOzQgvUaO25&OE%R&qE@h&xR+)*U&bt~sDlQ}a|Z67IjA`yGB zs@wrdZ6TY?Z~IUED~UZ28_ozzK(_T;-FZ1f=a$Dzp7`FwX_Dn}k3ANp-QGS?zCZ=W zd~$@_tZ%X$z=)9o8>YS8_y@+DIbx793o5;q|66_85#`xJqXvn#`k!TjRrGX=rym@a z_IMdf+arUj4)SE?Vlg*NBqvFu!Z5&hi*kH2%(4mbiO-UdD}uPkb;k&pQWc!zq^0A=uKyBxK6v8ba(HB(%S{`KryLJ z69%GGsnAsB8yRd3mW0!UX!U>A-@O%JP=TtLj&5^HETN2_(@&OGqb19tk4KZI*wCH9 zZEpLK*)$b)236o!!h&|o(a;9_iaeg=JS>6)9(;hw@wFO?tps@X$(gw+XbpWfgWI}q z0KyQ46B-L6D>Lz7x%TH5!sm6TVm!I`SntT!NBf!?A}hnKvA9-Az82P!WHEa6R*I4J zr%vRF2}9hsmLJ=^>@qKNPG^Zw$nwwC#u?VS&VbR6fz}|MwH80{36<9K$?!uk-iSew zD3Dof>uJm={wVu&A!lZ_EPM1UOZIta-!>73;e!hYM+DfOVOou|YP&21d>=-_QNHYg zy@0(j>f}U0*Dg|2bnrRW%8#U-po@ccl3H zS?ByWA}FQA#DGf!=>d{FR9hmd06vkR8nrTJ0g>0z-Lo?J1fDYaL$NMP-F)iNkz;_S zb<+XA#xMPSwsshZuD@(QVG%i~efb7#%mQ z=Ua1s%ME+gD*>vCmeY2B<*k{HY%rdCUcXJU?%q>mQ&XDUcERUIxEm;4xbDP52J_q_ zn;9;e?SDp5gyX*8A5m2JAEQYA|CAQ~Er!V&5PC{Sx4Ew_i7jiL{AyzTKzpbOQ>5{V zQt&W)5u`sM-~+*I>SK+J8?ap2eqQKzX>3?rd+41nS=7#_2(m7!%~|wqyINXmZmbJh zRxIT#mw)ecK0i4re--S!$Gjfryqci)yuJm(B?kUkl3<%T=D?g;a?8nFzVl+^cxgnO zck>^HVyU)IjI`9gaCF3ZHU$BF}tImAz*PSg$#Nosda4ow(;L$l%R zYNS`i?MY!|7?~}*6-UlEC^iM_C1=hYI~pw$4p_9U{5fXnR0(meZ`mHg+I(pqTWe#q zr0Kihj^5Z(n#snrby6guUd36mDVfmBQmV%!#vE zA5CaK1l8gu5>(s&KG0voLkQ~F>I{8ue}(i(o!q8D+aV&~K0l^<^{#)$_3s!TQk{6l zjIME3q|+sfe1^(^8@20-z_RU(xsKi0q6PKc{{v;pzY8V!L`0b0=C@?Pu{F?#bC@lpyZL~)edGO%q8 z>e}B1(&D0R@D$yuYJb#b+8i7(aub^2CMVX6-K1Uc(1Lf5$KW9rnQHLSm3F#uukV3>sBsPt;6t0<`c8iXGWHiRA|XsMgqw z+={q4IBIJd1gn`D{Sph8nJ~O6b7O&xNTdM4a&yrG*nWW90s3lnOv&cwFBdY*m7!h? z{s@=QfbgH-^m;*WV2FOu&;}fQMDNCe{_!G_KA{M)U~kbd{$li2gLWGjV#InmkWkll zgvd6V@L_PoLQL!`bvh;H>YOQl(lC4tH3J9 zMrpM&m>nxkMuFhrav{7*%cvNbGWI(GdOpp#>7>SMLk}#Q6ld#L z{{2Y#yf5UIz-LFMIofB5pq_^iun#c? zC`tf$nsBW6-E{+%N{UX+1mLd+nh~umv!xqwR+wzX5Xtgy*CnoBzf66LLUuv>XBw39* z*PZT$(BRx?@#F})>Hq9k=fd)&V|qg@sU`*5!Q|pr0TU{{L%x&>;?EDik|Rdng0WmV z3=J*2>+9XtDV$Qe8+79x7iVchKN2zTQDZbygRl0<*Be%YD8ag*U$DX-)mD_V4*=2E zf6p===;mi{U?CAr+`xBH`t9Jb%rm!N;uq(G<=OS>k%|BX(w|Qil~*hi=_P4nrvez= z;LXBIEAU~Oo)>cfX`%^+W<~}N=TkK)^Yx~tXNLb1nfaDQj0qitxVt99f8!A@RWzIt z5Kq@4)Ti?FcVWh+sA4ywkKc(jCO^%eV;U>zlkfCHRN#fIc6es|f@97hz4z)=@OM&zFo18a!7g(VlSQR)+V}WGvAF?9 z2mXu1*mvz5JjhkVFi-?O)co`GL$z)U>Z4%Vx6stdCtP>=^}7BU?#mQ5H|5jWLuXWW zdXKMNbDJXiyZFB6m5;Nh|9k0G*`;XLVTURDdxY80o0;Jqk_a{1nwPAhZ~dZr(UZtb zXW_*;dq=K_N<~5y_Gs~p7-#+rV(z(;x`&l2$~lfE&iX}Mef#Iev!)JI;dk&?c^RQL z3YD}Xt#&fGw5kp5igMY!vvLWknMFbM_z;8+DsWOsZd-;%woV>ex`k}trb-uVfklFh zf!dLLqBBcyjsPg@f)KcQyV$DLyfVn)L8?-5b@`$a7r#^?k@mPK;9A@ZRdc#@!SbQK zx)V_nuG zBCC3DY@eZ#R}ow;qS`bLaAfEzDC3lVbykLpR|4*oU@2eFkE>NSn`%BN%NGFP&Bx;F z{=&^$@I6J5v!-VOPDS?YA<&!-X(e`wAaJ$lfT3l+UN4upD&BuzcD;4l!%CK!P9(NQ&pM3eqV znoia#t}wCB0Sl&hmQyKCo6+~5CeW^i4c~Km1NFYIBAH;U0HXVZk5H&h&E$I;MjFmj?p#~C*O|zb zZ((|sEwgCO!Ea0jg%jidzhO5Z^#o$ciV!m1o&)@d1RpxsX5GG%Yh{G@?Z&I=3`sCO2-4M6&0ny7r z)WV@8J*h#(#=5pomPeOufIFzrRmRzt3O-WMsZWf)00txlTXg!e2%3(O;FA4>N@9x?2M=1 zy(Uk{&c>g$bBNbW2mLrvATEHMs`B6Q)^8qdYl0_@8^-B04VkpCB^qaTN=mBtPkf)N zTqY~phypQeRG6E?UwI$B7-5C?$t&#W%w)!^XJNz8NU#r)p+vvKj%Poe{L;F`P!5X& zoxtx0?iT2A`riC2ALT0()z2BCP8;b{#Pp4>c#M3u=1DW&%@C)q3y)Kac9?o%H*}r6 zk9it@9zR3epQm6#=mHuYkKec+wC_JWNp(nga$kj;!fPZoxNaU5kxX$;KcjL6-%ixF zK&emX$$ioyX0XVrOtZ9j43+ln@e1dO&v-vhC>qE@&4GrArLha|h?vED;TDRB-D_p$ z53erX73;55i%65zS1MrB`DVU>3`tP*H$hd}%^|eKEKdm|=3ujUg?kz?x)QM2$t<3t z=ah1R*Pm|XGe`%VFic)#71r35pWRGi<|+?(zvVM7!R9!+-wK&mR9%yfjlpR}G$ou^ z;AsO{RTh3(6p!I^C0FNTIMLALo#z3b7tS7j@@vUTKL~6JO;|B8p|vZ&puU&H&V4}Z zw6u8w54It2$pV_V!@Tu<(y!68mvvH$Ktj#;#4}FII7FIwM9ucdQ49eC-z;J$_k64p z)iU3Pk0ajG#7p6lQv`TlMWd6%Fb8A;$BKI23+!DG05(OUt>2R7czHgFq}p)v2D^+q zz=vJQTHOXn#*jR|DHKuVS$3O9X@mzdFXI5{PULd^? z#9rZw`XZ;M=nOu*HT#S9|?Fc9=1!lpyI(4g$ee)W5WkG0N_1PX>YAm~`l?#a&2LnGkLA{C4UyHScV zOA8RYBM37gh~C2sH-!~~3e6b|#w%)QX1-vx5>$IO%rsDoPi&maBy5~;3}ofx6+7pk zh;usPDX$60lQGoxNBFz!u(Le+t(iL;E<%&xl9+;}EXdAFtVz$S<9yu>6IW>{dvh(R z1nxCt_jQ=7yyfi3Uv@H!pA=Q2v2awq7xQuqZxfuFKxld5Jaj=_`QUV?^q!j`4(s+` z^b{zZ&I6lP1+7d5yr%ZboagO5K2ST)JBCg0Eet(y(|@3#>+p+x1oHm=4x0IdTK)P( zE{U%y)0*OM$#2 zwss3zhduTniFD=3P0_>b9{=#{@oH5^{|0)cX(fqM^0ILdQMmE0uFXMH@AQjsBXDm8 z?Vy{D1R*rm;H?6U@-0lImP;`rqnS#x43-iv1v~Du2 zH;$ih>}1fmzLm$$o9G7LlRHPxKW6)30IK%cGe^uc6WV`T*gCCYIgq*{QBe*2DT zO>m2&y)fP5@-eQt$o|~sC$K5};M?ZlNU`|N;*b4>Fl0M;Fsa}asDo9TLA&M&e=1mSV!OMU09ZDjoxSSb zml`Kjz6DZcefMPI`uTQ4BVzNDpCkU<5!Xb~H3bUY8Kn13?60l_%qKlW8F0W;F#L{0 zvtGz#-}$Om%qtt>#?dnibY`uCw2TgeStf_9JHEq2eXau9xqZ4%ksUQ-m2Tin`<*7KEYHy-d^9qDzmkG(doBEGj?7QnsY9_87#u^}*I-+xT_yA0$`E==lO4}RTc*H>&+IqUpK%pqR z;vf6h+F~6ygHT?fXItVPvRnEdwh7gPeeaxk-4&c|W9q&Eo6h7W)x#ZGMV1*6H`7aQ z*<@xq*)5~rKeW%CBT{OhP=o6{deAWLfKyR}6P>(u^2^6dm89`wGsJY1Wtf(TGXUI; z{L-Yk8NVZyK(g~o<~hbCQ_C^*+SscW&zd>0bKs6C1g8R^%#S0}HRlNXyvS>o6@5+% zaKj|$!))twdmX)V;5PQOm0aN+w(%8hvrmSJy$>rf{=k-3IZpB?&+|silZfLbAB=O( zj3|uQyt7MwOS^H2(-2A1gzlQkrT=zNol+`OQE1|fJT6y0RHcFMOin3dX;i2xMs12= zEp;SFa}y;q|7=?^-ZPdYnRANabiEl?j?1PPTdPc=b~!{Jvsw{ouy= zD3C0#pF%4h)HTg2DQZDFLE2^-tOs&8SqlW8LPZ0fpccoQCs{i}A<-cB1oZ{tE{qhU z{6xi(px7;OA`-|u_rmi1Y+W!%TRP7LOCkD%DTd+AD$z5Ev-660E2oGnL!yh8PT?fG z1rc%C!O}jpWpMJnC1FEzU5QbG=~C#JCSK?bL)^631(ymz%JtgwAZ|v}A*q0O^r7vO zSwE?S`Ru)HwF1wU63K_xS2tY==h5swwn+F&I8f{lDy4i&AHj8=`5&2#;;WM2KRV^A zU}kl1jD!fXA)FGXR7z$RQLJS(vo4SLAWMRaH8F}pJQALZhEBzt;_r4oEpMoosyhIp zKY)i;j|4zQx$?!4`C&qjQ? z3bnM!Y{7vGZoVh?Gj2Y_0rUF78lT8BPCnhCt9EIPU11Qb9LRBmX-3m6^;`X!9jshy zZuhV9N25=q7T)iFHVGZ$*1VRZ{P@xOw^0ADtN8y-{r8`3I?~3Dj{2s?V)`~lR{!A# zW+z)ZE~vnV>=>S#yW{kL~J4|}= zy}^1JuYy%9`5cGli_njy4rNEdk?pw{7d74Sp1#6;z3k}u5+xvZ92Hfmp>jaN5=0WvF@C zYhMMnY1^oY(mnfBPTMn`mtvh;bF+gnzhzy0xm4MdcjU(6Q8me)gEYyAJ@xVaILH~; zxLWEE67Lx^qPnqRy!|#!+tFCC;wHD>ZM$+h^4faZ>ZNMPdZqbVqIHst&--x2pAQ^i z{UuxX^QdNM^qX1l0vzSZXTv3%CRBA`+MEf6%|elpD5IbzSX#$Lh-mWFWMS)k2uG8- zTN%C|RA#r*-;mvA7d!?NeIza79Mpt<*p7P==SI{YWr&tdW5Wf%Kq_Pa%-kHcv-!Nd zRbLO)5qbo+pRTc`*=?d%dXlL&z#oK~G3wpAMs8=#232Fu?kzY$_gtZd>w^u!0ZOv* zegHcadxvajo1KoQ{KjOLxwATp%~X&OBx&(ozHUUN=x zN9Cc#}q5}ItRgdjefkjo#rgdvLR;g~5(7|8T&f%I3@ ziI@o)R~%9CBYi?rz*Rzce5sp$rmV`A1nj1wv-olfE<(e67rrXaAdjEi3rBX#YBK zWiG@yTK`*ehFXb=QmL6TwSQ)X}Ni_OPgy|mLqDk{~8wNmtlv9vc^2DsVTZ|$OR z_v$MZQP?)LhB(;%^g!!(vf1a5IgD*MZ2JSF(H`ou{s>r#xq@%XEP4tCDbSn;OWZ|b zhTzrfawSzQr_qyz%*`N1X;*BzyMP_2T*Kjs5H4Bl<7C*nb)|aT^oc zf44PN&Q+C^k-xRk)Ak(P4>TbdjL_r6$G`*-2}xPI`32|~CMJKHqOu!T~!+DT62U_EBf`}9$4_rt(!%ZzZ9?V;N{uN3Pr1=xNk&>ZIL)`KZ2>B}jE zUa)p6G&{1BtN}=zMHEc8+%zf4 zHrWBaNKrvTxwvSMcff*gwO1`cmwc-TW=eU(LOo#+ROI`RNiHDO1Uw=R@(T3&SS7vy zT)f6dUPU?Hji_I-k?_WzD2JFS`dIDeS@Bua1Ak)WSe~VbH%-I*5Lm51t`5UL_Blv9 zgl1y~&1(FfoE*`-K?yy?GUQF8DMuevTp3DKNcq?N^uu|=?Q+9#;`VL|c4|xKcVPyR zQgmZQq)C_et=^p^)1sHAhi2{A|KLUZ8Te9Bj3wh4TF0OPo_&xjHN*sd3k$b1Qk&d6 zl*?Ng6A%b~=DQd(YsfSL)kHydKPkM_n#XJ)=`E8~YythqcA2aNO#lk?_}Bpf_qg?| z1wP9|Aah62-5o!=bf!-VCTh0^1Q1$aAy8cnb2+8fCZOe%sc4f&L0f9lg%?U}Zn~s*m+#WF&p=gTX ztQQR?fx>V&hzO}LQSA zi7(5uN?Ed5BSe)HvPQ@#Bk{EE?)A&VNzP_;yrG?yxm@x$U1UeZ9jNbcVv5h|d2;{h zoD;J_I0-dOe=mWK@Xd?aXs&X)H+=SR((sBbbTnqv7>S0f+KmIP4*Sk}(nR^70_agq zN0zH~v0)UC!mP+OmgmmMdr1Kq{08`U9(vB2MAX(^G?rzl9G;eCou5FBVMKAoYQ%^^ zHnSI8LcP(Xov2E*lT+-39)k3pu_4{|aq!5-C$@VzI97&PKjhjlNGIJ#%E91+VbrUO z8;?TRxwsTIG@!LrI22`fZSPe$m}O@-9E@7KT-}?69)N??+$_p=e{9f09?@zMRgcI; zFhL3?j$(tssTYpEVZIiQ(z?VB-2Z4xm?Yr%O#>3GMYX%vjxM_#-8;}+yoT<}94kW5Wck*FdS_73KXt*jBa29WeY0S$>w z(%f%5>cBJU#a@_p%{)odyll;SgX7>@z*F2A(NQUfnml2uT#s|yqUFl4QDi1OF57Gi z!Xy)W?rF65vxB8~-<17Mdb2or9<1_;U8g8?+|&2_%rQFOLB*5d(N7fm7R=x~tS<&W zL;iwvML3c29Bkd(|2J_R zt$OLGWQy|5v(`bUP79Bk;zZzoLm0FL1Emxfk_w3|fuC6vlnRf`KyZg5AXQ1v1TkAcezsiuS4ZneCZs1t02>m0#S~0~mPSwCmI3Um*H#AyzZ)x6*jsB=2b6 zFU@dt;cRrCw-IPNxBJR;-4$}#Q|W<#r<`$2$nvA7ZkFU0WS}ZhB;as0&iJ!PXN@+c z65GIjr_6ls-q9lkp3XzpU&QSTo0Bd!$dyW*%}nvvv1Ij~`%`H3>P({H`O97eNL-wD z+*lhKOtQz(S^!64teZS&Yo?*d^s2I`ITiM8>qCj^Q|}OCDx0x~49Iv9QM=(KSNrVa6rx?XjumbbBL!JWTqPwZH0P)TAWvJv zbt%&M3yLNMQLJ_6zwI#2Uij6nd7rR>PfrceS)}s%w-+G+9fq>+iQ0qNmm4mwf83xq z)E`|<+6^dCEXETyI$|-!W5V4PQ%9A=?MTxqA1mWL$qaDY>Z9hUI2;(1r?m9q(YReqI)dOE5{krblBjF&eB?|dL1%&*HfB!wE+}p zD})xyE7FA$rIHbJt7~O&6^9CAO7lDTL#VCSgfu-8RVzgeN<5{-=5PN{Ob#A%q6JfX z*ku`pu2*j9oLR2PtZXaQ=H9|blz>;iJs6qOb1}5Hx1#C4IiR85xV(PwccQRtV?g51 zSo?xFv6Jh&?`GDRKf_>m-+80u({^ziFcT+5eDSfF90S|Omq3Yaw&_*J;zTVp@c?a1 z$Hf3)uf3H*$k;p#Tmup3X2v2GQK$^;_)GU!K0yPlesvN<#ln2siit46hy|f$aEU{m_SFxyv$;k^nfoVAcWr?rd4I>>+ zdckXZra#R$E`bc;6KRQ?yhS9g_L`%AOf!Oaon2=i|X}98aI(%Mbi(G~@$G z^LB>%F4lZgbTzbRR<663M9{Skf@R-b3CFT{U5y(%JjQUzOj9vBR3AXw{gO7c^Cw}t z&1J*q_X}L}6QBDX9qU>TMT_C@D_;s_AiJEOHzKxc-C)b?`m-X1EPI5w+gh?{6+}wy zR*heTgw@U&O434*^vEduTvlHvEGUa+djTuFpB0u$ESBYKIL=EA%Nb1``MLv*VGXXK zjhSl54m(2HqqLG1&_P6xg!S799GnzBp6CpvXO;69Hx-zZDh=>Tj&guwgLp{&wv5;? zjj$yP2EMnHn+8LI9Jz_vGD5ur{CoqkGG+Gs<=rTcG+*~+Mp#+7YNXH=43O}YK6Y#; zL|v-z*oE_CLANaO&1K{lD|f`n_}{keThA9KbtS#)clNVqt9S07t3swx(ydL13#}J^ zB~N)G&IKx$g_2;kO3nn8u=;_VQm!$1!X)-$#q4xkbuC5?+1Ymdo>=GOh&;cQfe$xB zKS^ZHc=wz`clz4z@Sm7~(O?F7t{n)8&t*x)Wro9Rs{5K>vDo$!AFF|OlPB)2&gqoZslOT&}Zi&;^!pLy#iY`|u_XCFS%R~XG0x z(QReK`%|&^G?H^H(J+xE#|wZLZ2bqpqO5p<_Eu(Dz6$CVe!dF)Iw?G12%^9r{ZijW zm5YantRkQyproMidPe%c+T%b54fH?~q@b<-NfBS4GbiaUf#&~_BH4eTD53A7FK6X! zYHlN-BBF2jck874zf~KGRUzDzmQcRv(hs+!aEUR%;g|JU&ZEeINWg>m@#BJ$_~-MM zcuDETg3{d&JZ*tihiIFdGM!uGBCVT*HP`En{mJ)1Ev%a|mztNWs;tY_r>a#vuR0ox z)AWj8yE`4P+rD|8HygH?V!PZg*d64ij!z7sZItX1Gf$^%e%VLvZkF#t*&L3I*~IV| z+zErUw8`VA>mufM?K^e^&~?ZYuj$I)D93PZqQ`Q9+*@Mno~(}8qm67~@9e&mz&Gjk zwIF+O;W6Fd*x&tRgWZn{7zk)k^@<6T?ZI-S$3MKF>%|X2#zuKan>A4D7=B6%)r`uDGcCiyEXj~?$g~`4bj|m!|_$Tam|0{L;g_o`zqeuf!x-!0}04R z4FuGwo-cebaG~F|oc-LOw?w}yY{zI`HdlcY6vyPZv$EC{Ba`wEEMuEomkZM`7gG1Y zHvzrW{zBD&)=-%ZQwy4c5(#MD9_wvpYy}np*kCX)@1Rd#4*^>kN-FT2wltZ4|1rY8bDiZtM>a0$h`7xAmD81A^a>=h+EX}DBV0(Z)x6(GS9*>-j+znD1T8|T~j%j<{8j)pP zFPjJj1#0&bu8wH4Snxds1T-BCbe%JWnuoIS;av+*TgIrv@}6Y^YuJ+Ii;@FC@#ayf z96;TrzP5}yv`xtiG*?-zdi+i(NeUe!BlFR&v02&}@_=#zty}&_*{Qt10Ldq zJUV#8>yS|1v!q!unz^G<1N9(iO15!RN&Y|^Mt7K_Z1ab@-rIjIIO71M7C_OQu{KWRNIH#DwQY9G;1;0b3YEr_ODMAjODo@UXjRmkTX_`pbB%Skg#zg)xdl(j ztw|jlv)dY(*jiYW7Mr%ns#PZok#SK6PbsWfv62zcnZ01KmMlfJ5$c{qA*UoIeMvZf^kl9Wqkm)(x0F8+G?_U=-Q(oT zRICpdXUkD^#~6+fVSJ^ZEo3bCl&)F~n`VEHXw{ZsHZf&xyjA=bUAmLvv3fYWO*jEq zobA+?#ZThIe^LxUQ>|Ig*N_>Gpw@c;yALex|4?010Z=uGoJp9bWLH%=c_p!6o+j6x z!SfjV$E)is;6Hg}qd?k3I471@jou=ZNgtC0m{15`W{rMIn7!x=>VBl8!3$G|Wa+z01_fO}+yiQ?y@0Jb&xT>%W zp957${0akjF<$3Bcq^Ijk1H1gRCvY9k=2NCpQwt`KcWN-kzwkaaBu`X1L!+@>GWX< zKc%Fm$&4q-OeZCojujb?6^}mj?ldOk#dadaFDV%(9He?7CwnE53Q>70`-9E!uRNFy zfoTPaFxtbbH=``;5IpA+Oh7|ocMBg-OwuHhJm?PHN{Xq|PHI^fo()?$VIPM5W2`~x zd62dQc47~Z>>rQ|`r8d1o=kUX0oP>q(%7yf_KxAps@c6!$KG-&?W;dI30&bIDa&Jf zx%||V$>a~mYOs4Rw&coX2~u&;hqGWcvL(Ooe?@$q!0mSePeZgJ^D!Nm$`HKrquG0$ zhKkc^yK<$|34uZ(?JK@GX~lApQ~qLvf3`}z8Tc_SR$Ng2r;yx~-5>G}ESd`Asq+!i zyeW;}P@HbQ%dD(o(HZexLc7u2{E8P@HTk&28VSjC=d3(w&x_pdcdp`1EMWE-kp}Rq zv}9LT!oMd#$r9g)>;Eh5E1;`NmbD@7?n>OCUZuFX(5{3nv7I=XC5(CJ} zn+Iv-^m86)Fk60)xNicZ0vz?^?dq|s)K}C|J}z$Y1N>noNjO>u>a^fg+*Df`tnKP? z7?UJmMaVuZLHu3@<*W>92^h@8VEf2EutEHW24k@p%9CPtie8Q2%OghE(JyA z5Zb7;lt|zV{v`lxHKyg>`J^7s%-$9^9Pc|F!R6-gW;fuxHIboC>CLT_0)!=rq{fuy z2JjSHY})p;oi1Lej;6j9mlzxP@sZAYJW+^o*){g}j~F@Q2>m?4itPSm4522r@aerR zu1WP}>%7e}YnNb0CLFHs8&2O)^$1!r;u$m9MGyB|TWa6y7$Dl; zn~#G(^!{$wqa`1#ey#Pz^;zdB`072>t5+Uqf46SO`qQFT31DT*ukzbEHce6UIk6b! zDUW8UmO23n4MA9FOo4VElukTMyq#H~5GjO&7w#~}x@u|ZV5Ii!ljoQa!FU(`D!u|f zar$m8A#7L>yo2#}%6Xc@HW$;14DUN(6bskH4hS?B>Rg2OFk;6=rJ`cS!GXjqr-IQu5OQcgL}rBd*bK0uH=(fzD0UXAja@;egM?Nvp5Y3(y*82q?nB+ez$Y@$awVzZROHA$Q~4 z(pW6Trh~)El1NCzo}3D%nC~#0ef)k+pMTg%kXh_5Wq#=#KA6FA6~C4LWTbS%G~isF zald;(gCSz})=YqvpC}C4S8B{0*bZi#JBbTy(2IZba$ryD0ApM>(Cba=CIOekJD8hr z3~z*evP|@-T@ke$bz#{}UP5QzOvU&+lQue2b^;@F1fu0$Jw#J#i9TlI#!!+D<>DNJ zAw2&5&!%GKAOw@^w16ke=&mNd(E5%fnfT=nH%OK6$OGBPJP-*ccMf3k0&fX_az)=U zBCgiFwQDbyf_ZdP^!Ce@7i-?0K40*EPLP~?Cd>KjT`0|;tXV-?{NKKOMH@p4fa6aa zH9vXnmz-su?CoviM)fQ0O-0I0xiS%ib#znV;IWN-!Qw;oee&C?k7DFI;1}6hP2%uS zQ!uFw-xfI%l05i$bypC3AmJRl^tvFXnR6V!!r<=Djzvx*`eo`XcA^PhEILX#wIhsd zbHYSLFC@V9`|tJ@MJ>g7YdX>>T*Pyoc~lyJZJyMsw;oV9P{;1qEiU^gp^j&}DqsXw z1Pb;_;4IAQvtx(j94(NlezEmW-={jdJ=*Y93`$neS!f}!D)skYV!tXMwY@8AP%0U9 z!wd%=)wA^QTn%FQewhp7$5+VKE!QtBD4@odqYsBFScvGE5D{y38V-Xb3}z^wy&dG; zYALSCX(VA{LMzFB{m{sj!PTt=j!8XH{;}Is5g2l#Yk-+k#DtU&bdZne!vACmB?_H- zSS>bDmw_HFix89#0>6tE#sggWwd0PWI7|0{2-f$dz+6AQu8}KR z(8xVq9H$Il9>Y;}?LdfEp->%_GN(%aX6j&MAK!0f6HK6j#-YEkc!D8A`V>67O%0hn z&_aP}BBn1ssqM4E=+$rv+c)7|8w|Xozz|f$I8wkK0S&Y9ok*%%SS#92y&Dx_r8>AM zG0IN5+sO!%(Zldo<2lQh()!Kkby8z5?K-1H6*~|w7*Q{bcZS2p4oyJ*g6&_VGq=7i zEa_n^?!4Eo5uQj#X0cJ^)|!I#kLrNi;Y#IFAGAD4wJx^hyj|l_fUro42_Lu8mbEtj z`k>&)DXO>DXu;rUJ#57OU+=4h#ExP<+CgSg`*G*b;M||2;_GJ`{<`x?C0<9tJ4`eXgvU~#UVnqyR zk{985UpIU#^lWxhL_&%MFf$ku>>vYnB?;fL8SL;MAI}3_fz}uvBS@4GKAq!16&$KSklP7-0(7Po z`Y7=h(M{wm00Lc7-%#bY9U0Ue+zHvjZPXZ7P3 z;#kgsn6hQW>*}74#Da5tCm+>ZoXFE4^}n%MNTFjGDzfG3 zXNtR43Y{cZSXL!n33lx1rg^p5_#IXt3o{ZHf5%QQPk0;UxFNS|cuK0I$coYTzbtc9nex{cROG6M3&4N#4%y-8Q#tKqS!6VuN+Ev|cfU z17@?Y(-GT^xa}uaF$Xa7TA3*GWlrHcCc!R&@<6l7$j>;zM#Y1(22qH|=XMOv%6rvc zGClo=)-YAzG?|P{%4K$pjw<_2psM{*P@{5@D62nM^)L;o&Ki>4mQ$9Vx3sB+`)C1s z|I5&o9* z>=-n6X){Sp1s2$ZEyDD-VhAN6EI9=PMr$tlnZ_&2Y3p%^TJlz>j7 zy%H}|FO!%|oZme)-oAz&9k-S5PW9nRWYcdK#tmV`n^UVeO_YO-W+!bv+!UtnSbKx2 zzXvazOu`8nE#}*Du39FnyRUR$&(3jBo%H6JeD4M~v+$nMrkR*s6usg|vIGchrATcT z-k0B@xY97HR%T9$YgfF(NVMC&6~htWeBeSPQe3PT!!%qXvjgviczc?3vk03sfVX%^ z_d!ZJYO#m%o2YmcsJ$rW_9CAIofITI-ZXc;E%&0Iq2W>|axvmn&rXY7WC1}@TL1EA za>x)yH(G~|$(3}76q4A%jK0_}2z5>(D&HrQzmPGws17XWGyM@mDBf3u1Ko%QKwG$ zj^Lu%i*$nhGA&6bSD#fpTMN(MS_{Yj&02o9i)W8N$`+(IhEpPR^_ZcvBiRH6` z%XKx^+8*XBHpVVh*sRPEZs`x-A6C2`SH2%Q*zn$gNK~kevsCMQfNG4>4Wd?RQ4A`7 ztk?LmT(ph_>#bF^?uErXS2mHc@n~PK(+!J7x*?*@yV?uR!n{h#$Gh1Z0D2JxwHT_& zycisDcgn!Oyxn`~y-1J|F?frN)lpydah|t8e&M}8ZoOobw|AAn+F0>=b^biFMeF*oCVFDR^AXSg z2akJ{%XSlab5rJpnkrog|*9DiU$eqtTxJn3|R0jilY(44!ne%F_^6rL?~Ty_wb%Ai|d zfwNIo8)?rzRfybTI4cD8Cb<}nlYs*#ETyC%ohGlPeHMvGNVA2{dNW8(kpTL*X=($xN9XFQLG_j;J7k1Ir&$PST;7bxO<9(OAGAx_V)*UgF{4Rt|*LjdnE#s zabKLy2#Mc`l(Q$%n39+|F)w4x!(+?y)x_@-gbk9Q#%S#&1qamI9iyZrlbcWIy)HXS zp6No$HV7@pDiG24>p@Z+n~{%^gaX2y=~op+FE^vZYU+uuXi#P0NDZR5cKHnsTf7(EIvop0GgkH0l%~?<2)afl# zdeG>#InhLIojCP~x&?ob@BZZYfcb9xR24_zlnwV?FE%s5`Z6l+_xIWBpE#fV-tFJO zKNV%T0o8e05>S)Rqmw+@6uL^9kSU_19&ko76H##OT?B}zbMMK2jz!8Md^N5vo(MW@aYMR8?QuBp_3Y;oV1Cl$ZT%-Wh zp@AwMWFH)K!x%s16j5Y9yvTZMgCnE+5i^@k573(1H1b|1yvyBgop`(Y^LaOA>C*e{ zYY6mjF2$D75k(a9GkK^M?>CDBQx?Y2vLKxtn_? z&b|6ws+a-2H^C@(19gPohpzp#=l9FKnUO;)Y2^E_p=nl z+C+SWCc86|s>Z^qRP4R687j`sxP3Jd*5T~!xs0q4DHKi`Wc0KcJ#!3@8)zOd4)}-+ z?bTPK@5X=caNh2?rvtENQDFFt!0_4F66Nf4lEuNZ`1)&8oRbPp+7V&{VAmORN3b79?p0Me3oU zc=n;8j%8N0%zAGl(IAotaij2UNQnJ(!^qT6H^mv_wuZN%$U{`! z3RPcooxTV^>?Q(iwzkV6S$+Kjh0eLzQE1gS7EEzg$~4Tm#LW+Jgbq@}#&%jT{XQx= zBCV1oC{*IoeR1L43=w=C^RHq%$$W@fJsG(Kp4fTqF9#RCh3E+tS}N0DmZP4pLq z;KN3o0eQl*>vl2fvLPMneIyS4#1ndEaOUF#lp;NwpLffQuLc*F>}bvzpPZ*SL0$Zo z1*-yq>YQ1ntxLr_sK;#)^$5`3A}0!J&J4l+2?qV76i+SS%D2m%tDc8XJTcwl)46Qpq{ciRxd4086`Z(*ThC(rW>c!dncII zyi^NEt+$X$=vlcQB{-6I&Zy7`223 zo%j33F}PuBBbpTYz#EES^#)h~E1L~1zHVWq55WhP^YS^_GP_7+%a@l~7)$FPktTOw zzy>CBtu+43VA6(qu<)TU&ZiCn&W{6J7`WP+LR^YuL$l$WLweB~q z*>gl;ut--KHsw%w|~64ojYX#`da zs|ocxI5ZvUGNK^0^9p5fOO^fxY4FK_I=u%6r>np<-p)0g!8JWKKwX+H@|@(XWr)** zWt0zppE~N4t}7f;f8;6*tpFj>Jbpj%A}|#o~7n*0s=vOo~v+NurIx&KHfaUn0VNK2Ye}m;ppz zC)byOKm9AE@1ne{6zbXOHU7*~{@459KQn#)+yC{OE9+nWsGoz6 zP2H(A`;7$TUQnHjFpm?EZCmh?loJn)cHcWOU!wSQs1u8HL>3PUD_pAdVZFbX%m73-H_s27+Vmw+GzR9Tf zD%4afFp3G5KwLJW-x}(YCj|#+maUD%DjNH&YBhr}vUZR4pv}0r$AX+OGKWZ7>0aJ3 zaq{~`9?=Ntbm{6<6G{G?ZAOH!eOGds~L=9M}u4Dw@F2a#|(+t z=FRp&#bcP{(b2ba_sPM*yhmP(o7Fj{w0l;B*}u=1Hw^MLGrLu791yr`7U=_@pwcd@J7e8 z*UuMoc89f_h*G()y*^!EdwvejJjp`j*OjqbIF?Ff7Hc4x90)AZxruig$RE zSLY_wcl2!jk=yNkKO`jlz)dPP6khZxeHEVF#`(?1P&$d5XlyFmh)~hndjP4f{#jyZ zFXpW>DcRBu))(5fSZp0npMKX}g$~-|qlKnArmsxPOXxwqjR6=G5OUkI+G}F)=kW-RZ>nwHncA9qUcWUl zA~&iO72n12c;iS#L4MW?Qe1J~OXRh&mM&-1CxnAAc7rD*>pD|PXdKA^F3#1PzCTVn z>G^eMrV8w|`w)nj1#Qs0A@zOSxi}>9F7+7&lY#$gY)cB#u5X3n+nClsslr`X+p#{< zucx?cplZ^c#0w?8%uo$%QPYICllnAVIe0Qiy||4;g@8~HfNDnwk};^|CEWqPDm}J*3+eGnD3F>Fznxtla^{L6&_sS0D$nIm6 za$n~Y*r;cx(2AY>+NL;$F@lW=-6P_aD73TQ#R7k$)|iVGrX0=%!J9OL-_THbKfz~C zYG$@Lpe!{cN0__o=5v{ZL88;{BogEPoFxA>%W|h%15u9eTS3jod@}Pv2Jf=WIZLp4DLD%{K4sn`G0<3bsjZ=Q9FZl`mEtXH>HNG3Xzti7{J3$`^_@U`1Bc{2adyT{w3xW7a=XP%!>eO0X(wrH z4HMQP8O@N87=~^!!maNW|E$buONs)`u)4^)@iF0)wx$8i+NF!LBd(&Fq~B!RXx#5@_vF9_DVbcx_Wn>#)FC4$ z!HB*7RilHQX>1=+7$W5AollZzGt*BO#5-DoBEHQh!Yo;&G9_zNBBf zdaYifn{Ou%&LIMtV~32jZ-BpKC+RNKIu|TiI=;uLDBf_unJwQj9%gNHY4r6#gQ0~l zB{Ay>X@>lxRW8H;(s@WXP)XqD;}hbV*Jo48+$NLbLyrv1XTnzjotyr1TSFDnbGu>txTjRFt)VEuh zS1gi5O_xoQt~-6a;%{Hco7b(ro3sm>o|vcSm9W6iR)K&qly+;>eLlFF}Mp+-uu5XN23X|^w~7WkFl&1gv!<$cH~&tX4Hul&+MT*^@0mDn>2JoFp_9s^dUF7W>QvFs z6ePvbm*qWf$6S57s|;t~?5MlNC&zpmUwN}x9l{NxWkmVb#U}c%YM>o zW2RLS5>?ftXk1ZnMDoIiLy?=%B+`w&=5(&rGDpWf9GRG%TwJ$8XsG})U(kjvRm^8? zDK?~Qfh`r}I(C2paRpO`m6@5CSQ)I>DV{2e)g3MjKUaVLh!q87?YIcVX>V#Ohppk_)*h#+Tt)zBO zg^M^>c)f38_b9dmZd|?w#H!Pt2ba*R+_oKJAFyf1F;pRHkFrXJ*uNH~)BDDH!{NP2-*mx9{B;;v*Su{=4zV8=FS>?}G5}Er_Mr zbSNn4yg=_bf$7>f%I3SJ+NGIw{O=^>k}@{M+QN1CV~>VGQJO~PGny001+9Wp4tIuy zc9)dqHLx4Ik3>=c-$A^asHtbn6Pj`b!qbsR8p1BNNR_+otH(7hmn3I_)gco6Q18Z( zjr6nmJxuQ@H+QBKq8EhTb)VzgSWlQ5zGj;(3D1(iD2ikq5M4HQDq1ohBCJc-6$|lo z&t5W37f35a;H^y@XKfm9dTz|161^ZtQ8#RT4nn-v9^8^CYFS|K4%uG0u!=(G^B0k61GuumTDa&kk8rAStJ{5@NU&rHYS(;fbcqg1aj$e{N*o?R62w{`1( zKDYgI%JqL(w>tby?U}d#WTE9iCtz>m;sCIJIZ$;Fx3+b1RCIhk{jvIO)s?HXVuPZL z@^o~xls0!*J!VxWx1iu1X#F`JH8PhruvQFU@$L;M3d6V+S6lT$l9NkqRuFGuCF=;VRrEElb!}SQZl~9{?m(Ku~!4x|(kK=}K>E~(3sSd}FXP-u` z2?A+x!m}`!5Q}>!%*8}G4&=W+bD(ACcuBach>x1>1Q7;X!?ws{?7+2u7vHrL4gzQ&2!{qi#>G67N!=MXiX{$-VO8%JdI!!FX!NxiDg(5M^jS=JX;qm)-luPi*VAd5(Y!%)W0 z<${;lRxHkd5PLp$JrFOcW`o!2FUHIj5ZGE#g?GJ@VwFTAx(t(+Jq!_(FAQgKLOO?% zl+>#>VY!(UfRRWAQyTrDa5%?c%nh7{4Uva8BDs4S+SKf@`I2GX3SDkx{>nd^D3y*9 z+lRF##EKX@wPbr~ZeHXo1!e-ie%L4{?I`84L}u?6j8TRFmvChpSa?|@BVK`WoA&qCbAgSdZon3NVtyNIpgbkRdPQ@^pc`vdgLnJ+vb%PVgdI$QEdBM~ z)AKYb#E3^LEEDck-V39}E#exKHO6Un=3mXN!>K6`0gTZ@(g3z#q*iduYoeZ0sw3~= zC7ZS=#!{g2bD#l zZKvXm4_Ni>ACcBpcpZ((!L&|hD=+LytI!G0PEVD>!1dtMqHcE1~VN8$V(`ekC> zEl|cSd=6b2{aY#!q5u87`11+*@0A#G6|^OZ7*Kf3rshVbt!C)7TGeu(Ybr&&v?(S# zvgDK=X0IKw=0jPSNRxuUo1;&H;y=88B0n{b^g_5Q_>hv4y6AD#AfB#^_erkHrPwdA zO9~P>5tbp~_7(K&FCc0LiT1z%iv^hB@L}c%QB{fvMTYePaV;bgLA+~P7w6lyhRHLp zm_;=+xQFfa>Is?Z_$bAor*=8crYY+;X~BU`vSwS!FeP`c)!3~Vr1Rpkj7ppmgV_g# zRKpEBaF7(qQcOcrY@8Jski003qY+IExzVX7)csP#?h<_s$Hv=vxQ^$ z-zo_uWIac|IFXicMP`wOb*tVX#1K0KTlTofegWZwG9uu;Lo=SBH}>T=nIa%gOrK zet7md)c>u|LE!)MmjC`T{QdOt9YoSFJ+To10#X|Zjy0>gN_efrEAjV{Z;=Rtz6PoU zEX^5p8XKpj4QFOe%}-S6&`j!RWXwYsTV|Q%l95|k9WE7?wA9qjt7w+g)~>KIc@R^} z?h|p}x@>=cI(Bc}{}fZkcR`;=NFE=*s^Iyy=dzx^BaHEIsf&*7e1ZngGxD9y))p&d zokwIe!3JEC>k)N3$qfP>{x$%g?%wSdg3jgiOg{dR0TaKM%*YeTMY3L0gamGY-B(t! zUR8v}I@qq(hG2V&kL-C77EUYop1+LfMC4+dWBNn|Kz zsN_v_=o`%^0QW&V!_#B16q@IhPnp|^llKEy$So;duNw!!8X`PioE@CZ*}ZhLXGnrg z)znJVNh0`4T*Zg}gjJ8`+j`$)j}u_b6g!0u__ zbDCtV@u8fzPMVCl0gl5^u&}Ux^EE~ahfW2sK)HF&>JpL~a~n)fQ^Bz2*s$6&9V$a( zpj|2-3K-G?QLP^LGO&U%GgWw^DjTU46~VdA@(#?A z$VXQe`1eG`Cj5Yy+*yhgnZOPDb4t9vv`!#sqCjnUNA&#u?YbGOw?ujkUIZNb@FTX+RSALqn2S zS~Nbuk(rMKgz|huMgpy2P%KHmgri4ZYt{%$P<+_3qF5*zD1LBoYp8Tp{XxFN0qV(@ zPZ3DQxr72W%slTSF&HX$1UkwC=(}8Q%})5|d@w>Cgv5m5Kw6?^GQRu7=k$1LP)cVi zh;yV5d2fPsK)nJfc6#wZ?O@1VA%T&eN>}k+)jO!5o`O_CryXuD;o*n{9wDCzX6RuD zA+S&7-WiPs$7S+fQ8{XmB@`pPnv$imO2pnUXDlF@OP?WrkZf-~ZEX7p6DmyOXrtfHI&a8P|uwQ(no9F6#p zoKOLI_L*rI*g}{XHP!@SdubxxGzx=aER`!+DZv)O#Tq z&h*p5Q?3fO!o0j)9Ou19jlwu46=W3aBGv6+F8X0n2%(nHYi?<524bM5D zG#i_^nmjFiSyRg&PjVfhg6a5DJS%eOaM+?Xi0O{&QA-0U<)u5xQWTsC z%%dP-4TrI*!ytEENdnBisAUBDX>}122Qi_nA%}oS95nA%fvpGUx9jZj>64)fP=G@T zQ*Xmi3>%51(uUcqwy$RN}ya<1+#OM?Onj>d+=uS<&u*A5x@{+;0$`p&%D z$^6_T=kfyKTZ4ls`w#wXfjwP}y7$KOQh5%IiVUCVd#ipe9y*MrA&Nl zIge?WS3r&Lp=F8;3Pq$pGZ%huHO`FT?NZe?y#o~B4ca=BgI8XPxg>M@N9E+gvLlxa zw#Zc%aXK*+Zh<0OrHNVh!2}Bk0TC~L_Pe$mS|r{^u`P=GW|`f3I4m@fJ_Sv-9FXeW z)nJJ=nK_#n$iL(r300NwsC)Ry(`Nt)Tf4w*+InS4wsBVb-5TOBsg&di^BTvpiryD? z(X3OYN?E-|fD!lri2nl@5Yy1W+}M)nEB5R9N?)RcBbB8*tm)L*8WEvsU>R{1vekrEq!WN5>HX-;E|~p}&93OQr`o>n)Ea;P>Not9%a!sdIm4%ep~eJ77!II;)vXg0zsJn|TtzlQ@TlNg z2H)>1A~(#JdTo(?9I0$4Xzq(~Hs}(y4<%|LR`h0dfg{w}e2w~z^U8OQ=>n}a9~$L{ zAOf?=w{ofF>`|C*3sTYP=&FDeBMh#hin9RZnKdbsX|PW+G@b54Xj}}k7kZf(Jq8Rw zd?TZZ&4I_zrR%(^r{?yh2Kd3@q2t$DOLj_=4a<$TISej1aXcU7hp+{wM&6FgD{Wfl z6R>^IMhOks5%&}LkSM;EpZSWKtXvgwjN?&}-dEp!fPJJKTo~Jok}EuSBcHVV8*(wU z`<`e;xzDxFbDG|}FL%snHB-3hIj(_1aL6!3V)N#v>gBtnR*%Ho+qZ$4m^kb~l!_84M17ZJ*J6e?Pg>Z=;&N$FXs z%mz)2eoG2>Q$WWZh0?|=w2e1@=Lr1nbXd0dX*pC;MP4Mg1ML?`M!CJ2C-4+*`}$FW z#j&rzd&rgG6$0_HmWm*fCYy!Kbx2vtB9m3chb$cLp^m%}+eXw=2AKr{vLx7s z#;<9?qDCE*qZ{d>TfPBiH0bU!VcZkC2dhlRh@O;&a_-YQ zpZ`$bWH(;GaGsu#irw1{bHNopAGbLS2w2(|rsG%;9XTQ}*~mxaH234jy)pS21wn)m^C+JApcbAvSO5BOmj8dhFqd_5{MAXNs4j~v zkMd;wnclJfp#Dw9`aGOpMZG2n#YfhHEMe)`dZ`7-+FA#)s#nqvM9p{WRY7B2;5yO| z@;wfpsjb$1`~x@~M(tZYzj1wgx_dN)hsrC@$VC5UxYO>-jGp5mpDg)RYuXl6m8C0c zjJ!zFh0&ilFDFSwKfk_b47q+vSbsrfoDMogpY|JQt^8a*he$UA8%!_i7xLgjc?vIy zVGMk)mDA8rDpsCBFY2^}+r{xmW*?PVml7mkkIpd;&Dy~yoKArU*V!Odm~mnGN{l;u zz=Av0Bvkx;2elGKGzY1xN|p;sQ3nw{2`!J6S&=CR<9>k{gRQ9RQ@gUi61OS?n^b45 zXEtsTW?Ax8W5r$*z=NkHzMpiO5u||aA@;8hQ2vPhy z4lsK1CCu;%MrT|$rNzy9zXi%8+r@64aE4Ha9EPHG-d>z-4m`a`g2zvV)n{*l^~nJG zMtfgsRvV35c=#M6M@w;ng$08H%$@JoPm*E$p;8~3jH^laqhI&S@S>V+N08%n);hlbap-aD#=|j)banR|Jb@iHvz5rB%u_HQBH($U2?c!Lj z_Oupq_HDqIkP))}PZ(1a$Wbe_liH39xgXSys4l1QWJ#}$vM|SL8HilV&^YcGuix6^lb(6^8DL|Y+q)a}d>14}T@+s0u+li_R@qR@3W=a0g@UN<*(Y9ST z8P9uEs=tldr~hYa%7AhFX6&*$jcBc;MAblCHbP_YhHt1&!kG86xiflrmmSO z35Z!u=UWoBw7Q zooy5-sT+eW5x0`;D(MdAV&FAFZ=yEwLMR+-LzfuUg9FVipcT^Pk7=O zI3h@_1VV4;hQNqY2#boN3(I4vN#YX-VD#7NnOKrQ9w@Y$pXoW#-xi$pwc`WkY%qWz z{ls(cTaLU}X3Cm$pB^4Bv3W0^!$Mx;5^|mvqm7P}WMT6Fxi=hbtosGN$|BrDL`Fc5 zdK(?$jR+ihyO;Z(ACVsh5(ACCLyo5aGnr|4HKeB&^Wl6ueE>nq!oN|2eNp*P8lXxh znPyhd(`<%e-ZL)cLx3gyEjEh~yO7AHMOLMJMpDRsH)xQ|E0 zDYYBMkp>8CLm$)R6PQORX{dVAOXq=cGzEx~K|&>5{bru)l{B~4zlVg3Ni@J1L5JZ` z<*wdL%|!tWvf?rs?%7)(pRY!GuCm8BOJz}WKu#n^ouDDY@lp|lstnAu1Q`z$)O2rz znxBfjc0k%@Aklx#1cXLHeJXg2pdV;w?0uS@ovpd-MX1%-I}->fTzaRt1>WMpzht!VxJ=Pxxp2f5P-#TMe2_oRaB z%j~gmRPnhnH7HVjYv5@xH5$uHR$Eg%F66w7lZ%lI%)%|=6R1Q~io(o9l7T=Gw!QhE z31jZZDR_5>*`&|!n9H6C{k0-Unyh^h?RoGM#WUaiXG(eywYU70D#)v z-RTLzZG1kAPv+6X)fQyKV&LoF^!QBqmx$C4u{MY`$M*d2CIsOl)0^K;L1{|sWU?mR zK4HKMiyIRRY8j z@dzTP6WyfWGLjwk_-nIhDkDvj6Q?ulEO`9Da#+L&`gP?#bn_=2`A@RMpQ1|z?*BCl z((UeHEI-eJ48PBU|M|fq{%=o?iH)r(!2WNJz8L-?!q1Q2?@1>MS~xfp0@zSi;+g3A z4*St)r*8`-^50`ofC!n9xH`mG?X9}g^fsJOJP5lHXc6Pxw}}!MON&9|&YnG2cuuOS z+CP8nO|S{fcrT3$X6&TZ8%DfMU-o?1$dVJMtF#>-j$utT8SM{%rNUCdT-U6%0AGMX zWO8UjSc-CLr&q4fmbdzZ1NA-5X-Cdj!M$TCs+7w71C2J=L@{$oc(*p<$zwvCf-yA? zfh5dbjE=M`rKx;5*@Cw;cMWP$g++st=*@oNOdCMTyxwq?cA7a6jIqzW53?`3t$fbB zsdbAsSa!TwnVc$b9?`!Xv|wi$V-vbkhZol(hoYkm zO94{XMmd)b9=eqqwX$HD0M}w)Z$}=>^{ckr-~a)72I)=ZeUa6g`qe8)mvZbj7)Y&b zhGI#;H0<#Us~#V0nqUnkQ3USzXXTC69xa~f4Yr0}$43%(7n%S`LHZt`2%DXSdQvZd z-@k?Sr!v~mw-2L!G&7eU!`tN*@!m%!O|LM2g6a1>Vj@J&M;j@Zy9wO!$oWEe#VNYa z?xlerG+|j9A^90TyOoUB|vMDu=+Ph$NsqlvzAXoU9Ooi9D#AhcF=v%$3C z1T)nwztgB)4i^Rf{w{B(V4-(B3FNEivz?zr zT3CsnMqEaO?rGr9O&bq5%tD_3yzu$+93lFH@H}7tyQwt4jJSxfq7tpN$cu8QSO58@ z{;V46dF9~XWc@q^{dEh-A2hytMg4mVb7!lU?B~C3_FT692YJcweo^$VX6Cl~&i`ur z;|Tp&@1F99maksD`%~M0C+YM5tE$Cw)~6%D_4f?wUq}AO;^i+fw0{W3^EdmsPru;) zR;cE z$R9!n|4(p#J3#ss^~cf$zo3%*3H2}Qko=1JBcuP%s1VN-%zrVqKhXLA=f3{P@%$2+ z@`s2%5A@HdKY;yF8{pS&{>bY1+^-)b(7*qzry}Vr1<6s&{wba*nfrn z?`S`A783k~Hu9Xv_;V-!0~O=1o%@k3=7s3+52@h%749!-4}S&yk+kE5Xyy;`7ycFW zN7|WRaekzec%k_CLzKjR#rZFUA1}~R;IczYg7x8Tl{#6@N(OKf-$nzWR~P;#d416S1G~=?`)z{g>nS zV|K$c{?9QCf6DUzRppP_ys|$ieD%su?*FFpZ}Po=RsLgU$4kQS9}=bTe^UMzbJ`CH z3qQZ&fVBUSnjgzS{rVk#jPiTQdH6%3b^ZzXpE4j`6#Ugg_4AC}Xz~vfyo3(^yw>_L zeCF*R-F?2g|7U=I8%p@AwjU!mUP5yI5M--=)cqf|{cPNSu{ikAB`xrWy5}n}oBuzJ z|Jl5L^!f4sr05chuq_m8{!;!F5Lsz3ghuKwGz@N;i}-1ois7XFZ{e~9>xJN)z5I{N*W o4*#~5{JFP3?x%hp+p2#8_e)nn!Ct;C`SZWX=Oy%j|I2Ux56}g>)&Kwi diff --git a/mozilla/java/waterfall/wf/build/unix/ext/moz6.jar b/mozilla/java/waterfall/wf/build/unix/ext/moz6.jar deleted file mode 100644 index 7b18f1e52aef7378f75855c4ff56bd076de50040..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7400 zcmaJ`1z1$u+D1ZZ5QiZIq+#gpR6r0Ix>FkI8d?PD7#fC7X_W4kmQ-Ts5(Mc|8sUd~ z&%Jujf6n>#GtaYTp7;Isns4v5*So)08G?d}kA!i11gI1bc{O$@*gneza`_}BK}KO5Lc9ymQqt^Q;`0yFf=F+VPzY|fv_@-41KCr z<(S}JUUO!XQ(%!*7napetVj`&)r0@{xvE8Km7~T+h3us_UwO;!2APY?Pllr8|=^J0R9fMbMUgV zwKe`1{NL64^LZKm3a;>Pnz*B*t+|V`xw$i&sjV>-8mVRFp^hN-ao`f3qNSzftP;5A z*H3H4WYpd5PfJX@X=a7TjXLqeVjY~~!e_BZ`$o50B7YW*;9Y~M9WWm&4j|2B2{Wpk zJTaUz6x)rys2;qj+iyGtgR0(mX1;3UUOGS7P1paqk4_X5?RplEjWfObOjOlG7A6IP z^oFTKgpnnQPBXh*?s$AeBXScysCW|{y7tOsX1_C6fYOp2GoR$lbq1}FksNTAiS-|F8H<9g5rX9BqSXS5q)JlY- zn%mVtlsm1q$uEwY#SMyFf&zx zf}M#{lANP_D7@Cq9S~7O6)Ar%5~G}%yBT2-9Gu`+G&?)j3!Pi|Aw9>E(_5WAItQ{E ze#kK7U|GDCe^l^H8?O8)v>S0EZ~Ii?7$XPoy=2Mcn0!wrQ}AFapO21+(9~OFI`XKJ zYZcxyPI+$i0)#S{VD#joX;>jXPM*J}28)U<;GJxkbjq8G)JauLX-@>sjH|_LwH*^D zv#5q(rp>~DdH!eRsj?{7)N@|Wg%ZMu?yfLSIR#w$-X>nD!Gneg&?6OT0z>sM-1DYd zby~3r$`&}93Y0n_Y;&)StA9m)@3nzn@OcX1r?+EW(i8>G1FAV75rvS1ye&}8rZQ99 zgoVX|Y%t^Mpom7Z+c1JI$A|+@>uv1oEqppPX>%zjDOg0w0>5(%fp$90aATtz`O5hW z1aQKpF_^bfsm?EO%UAJ1WHktSs(iQdq z=FDrd5mD~uJUKH_<6I+@l&g9e%0sqYB-{Z3Zz%@Tny&O-T@CM*W@Oy+jc(4ZL@Z6H z?I#|RkA$1+_o7z0rNMDosO$*z&vdIkl{-(f$S6JvuzR1?YWr`%4|4>X-@sUM$b{V{nsKrg zMg#E*diG@IGvw)lRjq{#2A>dfcF)icU+-m>MTrqhN_>945u0NYqcUYMVi{ZH&>TlT z`D||B?2!&}dxwM7!q5@uXCej;gH@b(Uu5iH*cm@_Xeg_ZotPgQL&^$bZ;see<1M^TH4~+rw;m6 zVP#r%7J72vnDfwP6{};-yd1x5>oKzvA z-4un*4+KwLMV>#&k&^c%`{ehjHrbGLmMSNpnZ|p69pvWqN&HBNKIR)79J605|AE>~ z)8Saa7F6-7b+sb8i}PL~zXy3)8&q4J<)u?RKg^#63#PxH`?1*;8P<9ZVi1!|!4qnn zGyzWG)Z~&Vwv}RsGWy~2o6^iT1WXI*wuJF5O2M}JkL_GiCRyndFiO?i&L(PP(xT>v zYDq=GR;*+rG%OGE`iulu4dnEkE$}z&`8eMUH-ur)&4;`Q(3(YNHb*AitFwGD@71{KOHn_RMI$HK*hu5gz6EE{Fd%%OD*^*WpXorj z6;3_yO&RQi)`HMUfEmyaD=7NrGL zupUNZh|1TmA79gyu8TyBk2tzkQ8$Hdf~5tP1|j^R_ZFL&+)PlLV`#yV=#{uXJp$Rp z!Z{us{_q5>O1*eq9=k>Bkf$~s$)cJZ*lXjJpc|mp(Oo!Hli?VRu|6lwvC8e=_)NeF ztq!yS-?9sS4x!sfsP$TqP(rX?1wM`zuacJ#^$e%09EjL;7M)ncA`PhM@r*b=HFyC*QSu*jh^$Qw{r);ab`@ za(3I*+O3M{HvZ^#s>P-2orgECUCC`OncnwgvXqD+L#mq=osr?kC;EluriEJ5k(%}6 zmse`*Pm2)7LA=;m$)rEpJGsIfzG8Cb7g{c5yl>!}NS>S;bzLT#y<|giN^M`1Bpxv# z?iC~*iSvq^ps1Q;s~Qor=wn-6xk$h6uXM0RyUHv!!UKf#j_9zh~(8C9tLqQ}7 zrdlc-(@uUfmL?e}B5jb{&B_UlE;T<(|8nDBh+DOVgCnLUnUmw!6=={zCGaZsDnoV*|9BA_vlc`;L2Kq@o8G>v{Q8(z9 zE6gSmJBk6haIvrwZArN2NG|&ari}GTuOQQJB7Db~KLqD_bEe{WwIDq^8p~PfpKn&K zms+f@X>_`oQ&0&H?I)?Sa)iD@)I&I{vp`<;;2YdK*%{us^N#XXs`1_Gu)mj`jQ^mz z?(~+lv8juLv*#bOOB>Vsu?F#tQdQcFZQ)eirub|Xz8rrV7|80!N03^8xloZ72#(Ct z=rZG$tWC zlgOLqfTCV)B%K^b{oXL7wuc`?@5zS-vEM(Wi@?gsm6&SvpQm5FMrwQ94HlvN7~n60 z|Dj7fy_<%sjk@=Fz%*007`V3&?Y!jR98VmnQ(|htR%~zP;fyPxN(8{4f!NMx1sEVgdW7= zeFC@YRLbRO-h&yO%E^-CK&jxZyx>~0y&15^)TUYY9M&GIcETm^T;&iDv+%~Sf8_w# z3z4IXHdL>2rj* z$O1LEv-w>E>)3!gyf|IlKC04Y!4aKSnOVr19$}3}gpiSlAr~{v4VJ=jLchsmCwVQo z!gYc9IA#8Kp-Iq>N+GCn#3#uNs19J{UKZ3k+GG6`wAS>xyl00jO35LrO=X0XZJHYz z2lp$yy7Y=G`K$`I9{?uuMJLnusP1i5<9Ej@e~x;9COlf4jopl|j|J)FC-BB@rhV@- zbDt7lwA2XqMR_)QGl4hhQtY7t+EUl4)nd)Yc8OhI7>Cmq@zoo&B;45MnY`H%b^e$N zAGz;&n}QDXFshdU5fn^kK%b$pllwmUpTTF`>1xmr{4O#*Tt_a&f zUr({FkxUAmn;0XTGV7%~C=Lr{38(xsh`VI-Yelg2vQy=)hf-w>hBlPrFH<6Q{RDvV zv-+9h?GN5r_*zyr2V^@L54NH(6 z^C;clUPZ0EtEUC|sLd-o`;y()hCqTji;{iTwl=ZY!M&L)(on3YVVDbdIu(&ZOv2Se z*5rI&NKcsl_!H#Ry35;Wc74c6R#alxZRyu z$&>nr_CA=xXf(JNsn9CFBXtZ0lvWm@aAc2P?EWyAibNZycz`$115bEmRr&3xRGri2 zVY1%nYJaV5V&B@kUzd;%AZiGBs?Gof5em5CdooQ!|xpf z&k)2Zpuu7gLvwgJz@dw|>2u4;m~yumql5j)8&fZ4K;Ep9>pNH$^?BKs^|vN`(56hz4pD!tIOcCA`aL4ISteY1{*@&JyTlDm~qlQa28##}?; zX)%rvcuVTwu6$O;YS}}jULErL+lH}ljRk>7Lk!_FV**KLwr5C?o*)3Go%epy!IG*I zztS)}^%}3j7Kp!AxayN5AY5~G#1mWc>QD}B&`Gce6`32HK}kOseDJJ~N=lN>lp*q> zcNr#UdhmR(Pq`OIP?y!hc%-ur7^;}vQt0)#gL4SvEyn{p*I{X(z~;ZyyijyD&S!^7 z%?o1PSS+DRh^}foBSWG`_n?-BxP;%Q=x$$(U^4t;;Y_-Z*Pa{kiq5}*3y{83`Q%Us ztsuwIU+6Ua7MuBLgGaTK?_wN)!>Vk+t|N2RvLhMS9{3XTVr{iSS57|rExm3=PnDBc zbd-b@c4>mrGQO2d7efl9h^M3$!Zf2yH8^j`$6969&Xm3|OeCG{v8-&z%XLFL3=oB9 z^{PI^eFXW(*Bbn$;w}iQRc(X)C*fR%t?ivzNh^(T>ar8@g7k-D-66cD*r>kQ3HdTXpLbcX*^ty;0$+XHt&Xyu;8~i?q z`eQrNz%B|H8?byx6~zzG^dWMv0AEt8`&~VEYBIegvT$L;!=UWg^uhrZK5w%Ngn~52)a)?HSF;Al+lxoy-pfnOmRN z$DDX*AC<8F$mp_}vzGW~?&Q;2-l^q`ov3JJqofezpfW?J!xLpXXQ@!c*ls{om+${` zH+N62Umz7$Ntrq=X-kW1DoEbJBofYjAduD%vVE-d7E_6HPpNt$^Gh*5h%U4L9aLk7 zepxp>;GAVs50famc5=5RBH2h3d8yKJ?U8O2fz*+p#F3}O5n7ZMp0g+K$|pmw$3%~r zRn;I~aMFSLpa0U3`mbHscW*VMGU%T)B+EZ&NErvHi;{`8x#{oSJ2e9(kjg{R`dv3G z9c=0)^}Mw%H$TmD28j+C<(fQ7p!g{Ie4P!WZT+wt%&)tB{SCTj%rk$>m0aAm zv*-wDJu`ts?j=XH`^ivB3b(uO)x{BxB4D+SNGwpa0W~E}+&;L0xa>I!HTByUp$#e_ zX)hv-643h^h>3t8PO25c0Ot1CL5>R40O9sn75ShC*nq{W;2fsesuB_aS-+}IwEgZ^ z*eH5X+&M>Weu2U@wp^Ju)9zHq8!|tHf7gam3@yO_a}lN^^Y89kAL8XM%w!0#*4t40yAgj5)w0I-W1#ffh9~mQrbfe`L&Vp*CX6vjNtnf;C6W*Uxn2-pH4uXK$?H%Y%ypA0m zK`0;N-4f}~KTxQ~yq9TkbBWo_8^`-;qIk4$#F@M!;xBpfxP!5prlA4&Rh%m%&}d^t zU;tf0ogM?%tJs=CW0Ss@qf7#vkmVhe_DcFi%##i$N4YO`{=lk*1`A1=iGqNZXvw86 zR|a<#W<-_PyMC1k;|OW8LWTuY;Zu6l71Tu`)0VhxVUkADALxq9gpSKMMhdtHJQPjW zb~@CDE_SLVmMUD0bB%kzx3J~r!vQ% zzwcL6-v8kDeK}oZn`exB_5vDyk}&|H@kDL=`F&QV6YVj3sALXl{9DT>_t~cN4i4wR z)n?^-sX;y{cQ0>;zVp!(C`d>(X#ceESpQ++shOL)I$ODTDj3@vzx+?%+)iasvGXau zsANu$E}Dw>s!i_GJnRKy`3OvA6;K3tFWAXHAm4}rd_nJXpHx==?4D1;AtA{j0{qf` zU-aAj(B@^|HYv}J$#|fjK1nrrJ%*n%8Vv-~=BltYx@}D>mtj31uE|)TlRRp8MMKO* zKL9T@E@W)QUUVsn2i2?2XF#3$^p0dOHZK9^8S#9+%XM7~i3=DaYjq{D5Q}GtFP@*b zZ8ZUck~bkhFD8$gzOI~3TNg>CkE!8qr4!9c15O?^;HgFkq*d;#5mh8+@Oz3T_=#kp z)@DS*eN9&U3JaqJ{~$&bQo@2*<7sdSnaXam^^L<#M*l0(=l4%Eb}hB9j4gZ()BF=o zsoZ@+oF{D|Ky}y@022Gk_G&!QV(H3fuM_NY5ipwTCzV9cv-$2ReJ-~K$(!S1qh#8N zkYQE{EUJP%8gcd*)^B+1pEF~3k_J#Z*)<->c2cJ#$yUMuOguSfCLyKM;?XX}l_QVc zPGjDZC14>ihrE&Rt}LFxxq|OKBqZ-!OGp`V4;dfnf6b)-I7N46(*MSP-Jv^c>Ce>P zy`4KN=~sx}4*yI2%~-n2fQ9t;9?-80y|=@EJ3@cYxbuX5#m4RMj`4>>^o#aa9?>rv z?rmNEOZ(**{VLL(XY_kt)BJPh-|wTl=fJOUdi3|1|MIDz3_-hpN5{N9LT>Lr2+7^I F{{vw};f(+Q diff --git a/mozilla/java/waterfall/wf/build/unix/gtktest.c b/mozilla/java/waterfall/wf/build/unix/gtktest.c deleted file mode 100644 index 9bf47326c7d..00000000000 --- a/mozilla/java/waterfall/wf/build/unix/gtktest.c +++ /dev/null @@ -1,116 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: gtktest.c,v 1.1.1.1 2001-05-09 17:29:53 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include -#include -#include -#include - -void destroy( GtkWidget *widget, - gpointer data ) -{ - gtk_main_quit(); -} - -void my_exit() { - static int t=0; - fprintf(stderr, "My at exit called %d\n", t++); -} - -int g_argc; -char** g_argv; - - -void* thread_func(void* arg) { - GtkWidget* window; - char* name = (char*) arg; - GtkWidget* button; - static int s = 0; - - atexit(&my_exit); - if (s) { - return; - while (1) {usleep(100);} - putenv("DISPLAY=hercules:1"); - }; - s = 1; - - /* gtk_init(&g_argc, &g_argv); */ - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - - gtk_signal_connect (GTK_OBJECT (window), "destroy", - GTK_SIGNAL_FUNC (destroy), NULL); - - gtk_container_set_border_width (GTK_CONTAINER (window), 10); - - button = gtk_button_new_with_label (name); - /* - gtk_signal_connect (GTK_OBJECT (button), "clicked", - GTK_SIGNAL_FUNC (destroy), NULL); - gtk_signal_connect_object (GTK_OBJECT (button), "clicked", - GTK_SIGNAL_FUNC (gtk_widget_destroy), - GTK_OBJECT (window)); - */ - gtk_signal_connect_object (GTK_OBJECT (button), "clicked", - GTK_SIGNAL_FUNC (gtk_main_quit), - GTK_OBJECT (window)); - - - gtk_container_add (GTK_CONTAINER (window), button); - gtk_widget_show (button); - gtk_widget_show (window); - - gtk_main (); - return NULL; -} - - -int main(int argc, char** argv) { - pthread_t t[2]; - void* res; - - g_argc = argc; - g_argv = argv; - gtk_init(&g_argc, &g_argv); - atexit(&my_exit); - - if (pthread_create(&(t[0]), NULL, thread_func, "Frame one") != 0) { - fprintf(stderr, "Cannot create first thread\n"); - exit(1); - }; - if (1 && pthread_create(&(t[1]), NULL, thread_func, "Frame two") != 0) { - fprintf(stderr, "Cannot create second thread\n"); - exit(1); - }; - pthread_join(t[0], &res); - pthread_join(t[1], &res); - /*while (1) { - usleep(100); - fprintf(stderr, "."); - }; - */ - return 0; -} diff --git a/mozilla/java/waterfall/wf/build/unix/set_paths b/mozilla/java/waterfall/wf/build/unix/set_paths deleted file mode 100644 index f05ae317f80..00000000000 --- a/mozilla/java/waterfall/wf/build/unix/set_paths +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: set_paths,v 1.1.1.1 2001-05-09 17:29:53 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -WFHOME=`pwd` -# Customizable part -JVMTYPE=sun -#JVMTYPE=ibm -JVM_KIND=hotspot -#JVM_KIND=classic -XTXMMIX=1 -# End of customizable part - -case "`uname -m`" in \ - i[3-6]86) \ - ARCH=i386 \ - ;; \ - i86pc) \ - ARCH=i386 \ - ;; \ - sparc*) \ - ARCH=sparc \ - ;; \ - sun4u) \ - ARCH=sparc \ - ;; \ - *) \ - ARCH=uname -m \ - ;; \ - esac -# workaround for bug/feature in JDK - it resolving libjvm.so using -# dlopen("libjvm.so") - doesn't work if libjvm.so isn't in LD_LIBRARY_PATH - case $JVMTYPE in - sun) - LD_LIBRARY_PATH=${WFJDKHOME}/jre/lib/${ARCH}/${JVM_KIND}:${WFJDKHOME}/jre/lib/${ARCH}:${LD_LIBRARY_PATH} - ;; - ibm) - LD_LIBRARY_PATH=${WFJDKHOME}/jre/bin/${JVM_KIND}:${WFJDKHOME}/jre/bin:${LD_LIBRARY_PATH} - ;; - esac -if [ $XTXMMIX -eq 1 ]; then -# workaround for mixing of libXt.so and libXm.so in one application, if first -# loaded is libXt.so - as with Mozilla. -LD_PRELOAD=${WFHOME}/Helper.libXm.so.4 -fi - -export WFHOME LD_LIBRARY_PATH LD_PRELOAD diff --git a/mozilla/java/waterfall/wf/build/unix/set_paths.csh b/mozilla/java/waterfall/wf/build/unix/set_paths.csh deleted file mode 100644 index 27dcdc5fc00..00000000000 --- a/mozilla/java/waterfall/wf/build/unix/set_paths.csh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/csh -x - -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: set_paths.csh,v 1.1.1.1 2001-05-09 17:29:53 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -setenv WFHOME `pwd` -# Customizable part -setenv JVMTYPE sun -#setenv JVMTYPE ibm -setenv JVM_KIND hotspot -#setenv JVM_KIND classic -setenv XTXMMIX 1 -# End of customizable part - -switch (`uname -m`) - case i[3-6]86: - setenv ARCH i386 - breaksw - - case i86pc: - setenv ARCH i386 - breaksw - - case sparc*: - setenv ARCH sparc - breaksw - - case sun4u: - setenv ARCH sparc - breaksw - - default: - setenv ARCH `uname -m` - -endsw - -if ($?LD_LIBRARY_PATH) then -# me such a stupid - how to use negation in C shell -else - setenv LD_LIBRARY_PATH "" -endif - -# workaround for bug/feature in JDK - it resolving libjvm.so using -# dlopen("libjvm.so") - doesn't work if libjvm.so isn't in LD_LIBRARY_PATH -switch ($JVMTYPE) - case sun: - setenv LD_LIBRARY_PATH {$WFJDKHOME}/jre/lib/{$ARCH}/{$JVM_KIND}:{$WFJDKHOME}/jre/lib/{$ARCH}:{$LD_LIBRARY_PATH} - breaksw - case ibm: - setenv LD_LIBRARY_PATH $WFJDKHOME/jre/bin/$JVM_KIND:$WFJDKHOME/jre/bin/$ARCH:$LD_LIBRARY_PATH - breaksw -endsw - -if ($XTXMMIX == 1) then -# workaround for mixing of libXt.so and libXm.so in one application, if first -# loaded is libXt.so - as with Mozilla. - setenv LD_PRELOAD $WFHOME/Helper.libXm.so.4 -endif diff --git a/mozilla/java/waterfall/wf/build/win32/jvmp.def b/mozilla/java/waterfall/wf/build/win32/jvmp.def deleted file mode 100644 index 792d841ff71..00000000000 --- a/mozilla/java/waterfall/wf/build/win32/jvmp.def +++ /dev/null @@ -1,4 +0,0 @@ -LIBRARY jvmp - -EXPORTS - JVMP_GetPlugin @1 diff --git a/mozilla/java/waterfall/wf/build/win32/makefile.win b/mozilla/java/waterfall/wf/build/win32/makefile.win deleted file mode 100644 index 09ff09472d6..00000000000 --- a/mozilla/java/waterfall/wf/build/win32/makefile.win +++ /dev/null @@ -1,192 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: makefile.win,v 1.1.1.1 2001-05-09 17:29:53 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -BUILDDIR=. -ROOTDIR=..\.. - -CC=cl -CXX=cl -CP=copy -DEL=del/f/q -DELTREE=del/S/Q/F -MKDIR=mkdir -ZIP=zip -LD = link -MAKE=nmake -nologo - -# type of really used JVM -# values: _JVMP_IBMJVM, _JVMP_SUNJVM -#JVMTYPE = _JVMP_IBMJVM -JVMTYPE = _JVMP_SUNJVM -# kind of JVM: classic, hotspot -JVMKIND = hotspot -#JVMKIND = classic -THREADTYPE = _JVMP_WIN32THREADS -ARCH=win32 - - -CCDEBUG = -MDd -Zi -Od -#CCDEBUG = -INCLUDES = -I$(ROOTDIR)\include -I..\..\public -I..\..\public\$(ARCH) -I$(WFJDKHOME)\include -I$(WFJDKHOME)\include\$(ARCH) -# XXX: hardcoded platform -EXTRA_CFLAGS = $(CCDEBUG) -D$(JVMTYPE) -D$(THREADTYPE) -DXP_WIN32 -DARCH="\"win32\"" -DWIN32 -DJVMKIND="\"$(JVMKIND)\"" -DPLATFORM="\"i386\"" - -CFLAGS = -nologo -DWIN32 $(PICFLAGS) $(EXTRA_CFLAGS) $(INCLUDES) -WX -CXXFLAGS = $(CFLAGS) -I$(HOSTINCPATH) -I$(HOSTINCPATH)\glib -I$(HOSTINCPATH)\gdk -DXP_WIN32 -LIBFLAGS = -nologo -debug - -PLUGINCSRCDIR = ..\..\src\plugin -PLUGINMDDIR = ..\..\src\plugin\win32 - -PLUGINCSRCS = java_plugin.c jpthreads.c -# source of native methods for Plugin -PLUGINNATIVESRC = native.c -PLUGIN_DLL = jvmp.dll - -# well, just a hack -PLUGIN_NATIVE_DLL=JVMPnatives.dll - -# source of Mozilla-dependent module - should be separated -MOZEXTSRCDIR = ..\..\src\plugin\mozilla -MOZEXTCSRC = wfe_mozilla.c wfm6_native.c -MOZEXT_DLL = wf_moz6.dll -TESTEXTSRCDIR = ..\..\src\host -TESTEXTCSRC = test_extension.c -TESTEXT_DLL = wf_test.dll - -HOSTCPPSRCDIR = ..\..\src\host -HOSTCPPSRCS = host.cpp -HOSTPROG=plugin_host.exe - -PLUGINOBJS=$(PLUGINCSRCS:.c=.obj) -PLUGIN_NATIVE_OBJS=$(PLUGINNATIVESRC:.c=.obj) -HOSTOBJS=$(HOSTCPPSRCS:.cpp=.obj) -MOZEXTOBJS = $(MOZEXTCSRC:.c=.obj) -NCEXTOBJS = $(NCEXTCSRC:.c=.obj) -TESTEXTOBJS=$(TESTEXTCSRC:.c=.obj) -OBJDIR = - -INSTALLER = installer.exe -INSTSRCDIR = ..\..\src\plugin\win32 -INSTSRC = installer.c -INSTOBJS = $(INSTSRC:.c=.obj) - -PLUGINLIBS=user32.lib -INSTLIBS=user32.lib - -HOSTLIBS=$(HOSTLIBPATH)\glib-1.3.lib $(HOSTLIBPATH)\gtk-1.3.lib $(HOSTLIBPATH)\gdk-1.3.lib - -#instead of vpath -{$(PLUGINCSRCDIR)}.c{$(OBJDIR)}.obj: - @$(CC) $(CFLAGS) -D_JVMP_IMPLEMENTATION -c -Fo$@ $< -{$(PLUGINMDDIR)}.c{$(OBJDIR)}.obj: - @$(CC) $(CFLAGS) -D_JVMP_IMPLEMENTATION -c -Fo$@ $< -{$(HOSTCPPSRCDIR)}.cpp{$(OBJDIR)}.obj: - @echo $< - @$(CXX) $(CXXFLAGS) -c -Fo$@ $< -{$(MOZEXTSRCDIR)}.c{$(OBJDIR)}.obj: - @$(CC) $(CFLAGS) -c -Fo$@ $< -{$(TESTEXTSRCDIR)}.c{$(OBJDIR)}.obj: - @$(CC) $(CFLAGS) -c -Fo$@ $< -{$(INSTSRCDIR)}.c{$(OBJDIR)}.obj: - @$(CC) $(CFLAGS) -c -Fo$@ $< - - -all: makefile.win ext plugin -release: all - @ cd ..\java - @ $(MAKE) -fmakefile.win release - @ cd ..\win32 - @ IF NOT EXIST wfrelease $(MKDIR) wfrelease - @ $(DELTREE) wfrelease > NUL - @ $(MKDIR) wfrelease\ext - @ $(CP) wf.jar wfrelease > NUL - @ $(CP) $(PLUGIN_DLL) wfrelease > NUL - @ $(CP) $(MOZEXT_DLL) wfrelease > NUL - @ $(CP) $(PLUGIN_NATIVE_DLL) wfrelease > NUL - @ $(CP) plugin.policy wfrelease > NUL - @ $(CP) ext\*.jar wfrelease\ext\ - @ $(ZIP) -r wf-bin.zip wfrelease - @ echo "Release is wf-bin.zip" -.SUFFIXES: -.SUFFIXES: .cpp .c .obj - -.cpp.obj: - $(CXX) $(CFLAGS) -c $< -plugin_no_java: plugin_objs plugin_dll plugin_native_dll plugin_exec plugin.policy -#$(INSTALLER) -plugin: plugin_no_java java_classes -plugin_objs: $(PLUGINOBJS) $(PLUGIN_NATIVE_OBJS) -plugin_dll: $(PLUGIN_DLL) -ext: $(MOZEXT_DLL) $(TESTEXT_DLL) -$(MOZEXT_DLL): $(MOZEXTOBJS) - @echo linking $@ - @$(LD) $(LIBFLAGS) -dll -def:wfe_mozilla.def -out:$@ $(MOZEXTOBJS) -$(TESTEXT_DLL): $(TESTEXTOBJS) - @echo linking $< - @$(LD) $(LIBFLAGS) -dll -def:wfe_test.def -out:$(TESTEXT_DLL) $(TESTEXTOBJS) -$(PLUGIN_DLL): $(PLUGINOBJS) - @echo linking $@ - @$(LD) $(LIBFLAGS) -dll -def:jvmp.def -out:$@ $(PLUGINOBJS) $(PLUGINLIBS) -plugin_native_dll: $(PLUGIN_NATIVE_DLL) -$(PLUGIN_NATIVE_DLL): $(PLUGIN_NATIVE_OBJS) - @echo linking $@ - @$(LD) $(LIBFLAGS) -dll -out:$@ $(PLUGIN_NATIVE_OBJS) - @$(CP) $@ JVMPnatives_g.dll > NUL -plugin.policy: ..\..\java\plugin.policy - @$(CP) ..\..\java\plugin.policy . > NUL -java_classes: - @ cd ..\java - $(MAKE) -fmakefile.win all - - -host_prog: $(HOSTOBJS) $(HOSTPROG) - -host_objs: $(HOSTOBJS) -$(HOSTPROG): $(HOSTOBJS) - @echo linking $@ - @$(LD) $(LIBFLAGS) -out:$(HOSTPROG) $(HOSTOBJS) $(HOSTLIBS) - -clean: - @echo Removing compiled files.. - @-del/Q $(PLUGINOBJS) $(HOSTOBJS) *.exe *.dll *.obj *.ilk *.exp *.lib *.pdb - @rm -rf ext - @cd ..\java - @$(MAKE) -fmakefile.win clean - - -$(INSTALLER): $(INSTOBJS) - @echo Compiling installer - $(LD) $(LIBFLAGS) -out:$(INSTALLER) $(INSTOBJS) $(INSTLIBS) - -plugin_exec: -.PHONY: java_classes clean all host_objs plugin_native_dll plugin_exec release - - - - - - - - diff --git a/mozilla/java/waterfall/wf/build/win32/plugin.policy b/mozilla/java/waterfall/wf/build/win32/plugin.policy deleted file mode 100644 index 5d65ce49961..00000000000 --- a/mozilla/java/waterfall/wf/build/win32/plugin.policy +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: plugin.policy,v 1.1.1.1 2001-05-09 17:29:53 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -grant codeBase "file:${jvmp.home}/classes/" { - permission java.security.AllPermission; -}; -grant codeBase "file:${jvmp.home}/wf.jar" { - permission java.security.AllPermission; -}; - -grant { - permission java.lang.RuntimePermission "accessClassInPackage.sun.jvmp"; - permission java.lang.RuntimePermission "accessClassInPackage.sun.jvmp.applet"; - permission java.lang.RuntimePermission "accessClassInPackage.sun.security.action"; - permission java.lang.RuntimePermission "accessClassInPackage.sun.awt.image"; - permission java.lang.RuntimePermission "accessClassInPackage.sun.audio"; - permission java.lang.RuntimePermission "accessClassInPackage.sun.applet"; - permission java.lang.RuntimePermission "modifyThread"; -}; diff --git a/mozilla/java/waterfall/wf/build/win32/set_env.bat b/mozilla/java/waterfall/wf/build/win32/set_env.bat deleted file mode 100644 index 7bd06dad03c..00000000000 --- a/mozilla/java/waterfall/wf/build/win32/set_env.bat +++ /dev/null @@ -1,30 +0,0 @@ -@REM -@REM The contents of this file are subject to the Mozilla Public -@REM License Version 1.1 (the "License"); you may not use this file -@REM except in compliance with the License. You may obtain a copy of -@REM the License at http://www.mozilla.org/MPL/ -@REM -@REM Software distributed under the License is distributed on an "AS -@REM IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -@REM implied. See the License for the specific language governing -@REM rights and limitations under the License. -@REM -@REM The Original Code is The Waterfall Java Plugin Module -@REM -@REM The Initial Developer of the Original Code is Sun Microsystems Inc -@REM Portions created by Sun Microsystems Inc are Copyright (C) 2001 -@REM All Rights Reserved. -@REM -@REM $Id: set_env.bat,v 1.1.1.1 2001-05-09 17:29:53 edburns%acm.org Exp $ -@REM -@REM -@REM Contributor(s): -@REM -@REM Nikolay N. Igotti - -@echo off -echo Setting some variables for WF.... -set WFJDKHOME=c:\jdk1.3 -set HOSTINCPATH=d:\inn\libs\include -set HOSTLIBPATH=d:\inn\libs\lib -set PATH=%HOSTLIBPATH%;%PATH% diff --git a/mozilla/java/waterfall/wf/build/win32/wfe_mozilla.def b/mozilla/java/waterfall/wf/build/win32/wfe_mozilla.def deleted file mode 100644 index 86e7185d1ad..00000000000 --- a/mozilla/java/waterfall/wf/build/win32/wfe_mozilla.def +++ /dev/null @@ -1,9 +0,0 @@ -LIBRARY wf_moz6 - -EXPORTS - JVMP_GetExtension - Java_sun_jvmp_mozilla_MozillaAppletPeer_getParams - Java_sun_jvmp_mozilla_MozillaAppletPeer_nativeShowDocument - Java_sun_jvmp_mozilla_MozillaAppletPeer_nativeShowStatus - - diff --git a/mozilla/java/waterfall/wf/build/win32/wfe_test.def b/mozilla/java/waterfall/wf/build/win32/wfe_test.def deleted file mode 100644 index 64fa989430f..00000000000 --- a/mozilla/java/waterfall/wf/build/win32/wfe_test.def +++ /dev/null @@ -1,6 +0,0 @@ -LIBRARY wf_test - -EXPORTS - JVMP_GetExtension - - diff --git a/mozilla/java/waterfall/wf/doc/ChangeLog b/mozilla/java/waterfall/wf/doc/ChangeLog deleted file mode 100644 index 46428b4989d..00000000000 --- a/mozilla/java/waterfall/wf/doc/ChangeLog +++ /dev/null @@ -1,13 +0,0 @@ -Mon Apr 2 16:43:40 2001: - Started ChangeLog. - Major clean up of build system - No more jni.h, jni_md.h in Waterfall tree - Added "release" target to makefile - allows binary-only release bundling - Waterfall classes now in JAR - -Thu Apr 26 02:48:51 2001: - Minor build system updates. - Fixed crashers on Solaris by simple - reordering of some entries in LD_LIBRARY_PATH. - Added support for x86 Solaris, but it sometimes crashes - - almost sure not Waterfall fault. diff --git a/mozilla/java/waterfall/wf/doc/TODO b/mozilla/java/waterfall/wf/doc/TODO deleted file mode 100644 index e3de174054f..00000000000 --- a/mozilla/java/waterfall/wf/doc/TODO +++ /dev/null @@ -1,17 +0,0 @@ -1. Netscape 4 build is broken, as I see no reasons to work on it (very tight - in time). - If someone wishes to do it - please note that on Unix you need to run JVM - in separate process. It's bad for speed. Also you need to complete remote - bridge shmtran.[ch] as it shouldn't work for calls like - NC->Java->NC for now. It's not too hard, you just need to poll on proper - SHM queue - when waiting for completion of the call, and if something has come - - process it. - -2. Rewrite code borrowed from Java Plugin and remove dead code. - -3. Add handler for access to browser-provided protocols from applets - (most obvious HTTPS). - -4. Complete Waterfall own security model - maybe just get rid of capabilies - at all, if I'll see no use of it. diff --git a/mozilla/java/waterfall/wf/doc/build.txt b/mozilla/java/waterfall/wf/doc/build.txt deleted file mode 100644 index a4c0ec5788e..00000000000 --- a/mozilla/java/waterfall/wf/doc/build.txt +++ /dev/null @@ -1,54 +0,0 @@ -How to build Waterfall: - -Requirments: - Linux/Solaris: - gcc, pthreads, JDK1.3, LessTif/Motif headers only - glib, gtk+ - only for test program, not used in Waterfall - - Win32: - Visual C++ 5.0, 6.0, JDK1.3 - glib, gtk+ - only for test program - - can be found at http://user.sgic.fi/~tml/gimp/win32/ - -Build, run: - Linux/Solaris: - - get CVS tree - - cd build/unix - - export/setenv WFJDKHOME= - - edit Defs.gmk to select desired JVM type/vendor (default is Sun Hotspot - JVM) - - gmake - - edit set_path script according to selected JVM type/vendor - - source ./set_path - - ./plugin_host - runs test program - It allows - - to start/stop JVM, stop hangs up program, as not implemented by JDK - - obtain capabilities (required to perform other actions) - - show/hide Java console - - get Waterfall module description - - load test extension and interact with it - - register native window and test it using test extension - - test Java/native thread interaction - Win32: - - get CVS tree - - set WFJDKHOME= - - cd build\win32 - - edit makefile.win to select desired JVM type/vendor(default is Sun - Hotspot JVM) - - if you wish to build test program - - make folder for GTK/GDK libs - - mkdir include and copy GTK/GDK/GLIB headers there - - mkdir lib and copy GTK/GDK/GLIB libs there - - set env variables HOSTINCPATH and HOSTLIBPATH pointing on include and lib respectively - - type nmake -f makefile.win host_prog - - nmake -f makefile.win - - set WFHOME= - - plugin_host.exe - runs test program - - to start/stop JVM, stop hangs up program, as not implemented by JDK - - obtain capabilities (required to perform other actions) - - show/hide Java console - - get Waterfall module description - - load test extension and interact with it - - register native window and test it using test extension - - test Java/native thread interaction - not yet implemented - on Win32 diff --git a/mozilla/java/waterfall/wf/doc/live_connect.txt b/mozilla/java/waterfall/wf/doc/live_connect.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/mozilla/java/waterfall/wf/doc/wf_mozilla.txt b/mozilla/java/waterfall/wf/doc/wf_mozilla.txt deleted file mode 100644 index c7ac264df2c..00000000000 --- a/mozilla/java/waterfall/wf/doc/wf_mozilla.txt +++ /dev/null @@ -1,30 +0,0 @@ - Here follows short description of building and running Waterfall binaries -with Mozilla web browser. - - Unix (Solaris, Linux) - -1. export/setenv WFJDKHOME='JDK_1_3_directory' -2. checkout wf_moz6 CVS module -3. put resulting wf_moz6 directory to $(MOZILLA)/modules -4. cd $(MOZILLA)/modules/wf_moz6 -5. edit src/Makefile.in and set WF variable to point to the - top of WF tree (I hope you already checkouted and built WF tree, - if not - read building.txt). -6. gmake -7. pushd $(WF)/build/unix; source set_paths; popd -8. run Mozilla from the same command line prompt - - Windows - -1. set WFJDKHOME='JDK_1_3_directory' -2. checkout wf_moz6 CVS module -3. put resulting wf_moz6 directory to $(MOZILLA)\modules -4. cd $(MOZILLA)\modules\wf_moz6 -5. edit src\makefile.win and set WF variable to point to the - top of WF tree (I hope you already checkouted and built WF tree, - if not - read building.txt). -6. make -fmakefile.win -7. set WFHOME=$(WF)\build\win32 -8. run Mozilla - - diff --git a/mozilla/java/waterfall/wf/include/awt_Plugin.h b/mozilla/java/waterfall/wf/include/awt_Plugin.h deleted file mode 100644 index a60d24b2e3a..00000000000 --- a/mozilla/java/waterfall/wf/include/awt_Plugin.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: awt_Plugin.h,v 1.1.1.1 2001-05-09 17:29:53 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* - * Export functions for Netscape to use to get AWT info - */ - -#ifndef _AWT_PLUGIN_H_ -#define _AWT_PLUGIN_H_ - -#include -#include -#include - -void getAwtLockFunctions(void (**AwtLock)(JNIEnv *), - void (**AwtUnlock)(JNIEnv *), - void (**AwtNoFlushUnlock)(JNIEnv *), - void *); - -void getExtAwtData(Display *, - int, - int *, /* awt_depth */ - Colormap *, /* awt_cmap */ - Visual **, /* awt_visInfo.visual */ - int *, /* awt_num_colors */ - void *); - -void getAwtData(int *, Colormap *, Visual **, int *, void *); - -Display *getAwtDisplay(void); - -#endif /* _AWT_PLUGIN_H_ */ diff --git a/mozilla/java/waterfall/wf/include/sun_jvmp_generic_motif_Plugin.h b/mozilla/java/waterfall/wf/include/sun_jvmp_generic_motif_Plugin.h deleted file mode 100644 index 2a96862af4d..00000000000 --- a/mozilla/java/waterfall/wf/include/sun_jvmp_generic_motif_Plugin.h +++ /dev/null @@ -1,21 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class sun_plugin_generic_motif_Plugin */ - -#ifndef _Included_sun_jvmp_generic_motif_Plugin -#define _Included_sun_jvmp_generic_motif_Plugin -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: sun_jvmp_generic_motif_Plugin - * Method: getWidget - * Signature: (IIIII)I - */ -JNIEXPORT jlong JNICALL Java_sun_jvmp_generic_motif_Plugin_getWidget - (JNIEnv *, jclass, jint, jint, jint, jint, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/mozilla/java/waterfall/wf/include/sun_jvmp_generic_motif_PthreadSynchroObject.h b/mozilla/java/waterfall/wf/include/sun_jvmp_generic_motif_PthreadSynchroObject.h deleted file mode 100644 index 33428b02bb9..00000000000 --- a/mozilla/java/waterfall/wf/include/sun_jvmp_generic_motif_PthreadSynchroObject.h +++ /dev/null @@ -1,69 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class sun_jvmp_generic_motif_PthreadSynchroObject */ - -#ifndef _Included_sun_jvmp_generic_motif_PthreadSynchroObject -#define _Included_sun_jvmp_generic_motif_PthreadSynchroObject -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: sun_jvmp_generic_motif_PthreadSynchroObject - * Method: checkHandle - * Signature: (J)I - */ -JNIEXPORT jint JNICALL Java_sun_jvmp_generic_motif_PthreadSynchroObject_checkHandle - (JNIEnv *, jobject, jlong); - -/* - * Class: sun_jvmp_generic_motif_PthreadSynchroObject - * Method: doDestroy - * Signature: (J)I - */ -JNIEXPORT jint JNICALL Java_sun_jvmp_generic_motif_PthreadSynchroObject_doDestroy - (JNIEnv *, jobject, jlong); - -/* - * Class: sun_jvmp_generic_motif_PthreadSynchroObject - * Method: doLock - * Signature: (J)I - */ -JNIEXPORT jint JNICALL Java_sun_jvmp_generic_motif_PthreadSynchroObject_doLock - (JNIEnv *, jobject, jlong); - -/* - * Class: sun_jvmp_generic_motif_PthreadSynchroObject - * Method: doNotify - * Signature: (J)I - */ -JNIEXPORT jint JNICALL Java_sun_jvmp_generic_motif_PthreadSynchroObject_doNotify - (JNIEnv *, jobject, jlong); - -/* - * Class: sun_jvmp_generic_motif_PthreadSynchroObject - * Method: doNotifyAll - * Signature: (J)I - */ -JNIEXPORT jint JNICALL Java_sun_jvmp_generic_motif_PthreadSynchroObject_doNotifyAll - (JNIEnv *, jobject, jlong); - -/* - * Class: sun_jvmp_generic_motif_PthreadSynchroObject - * Method: doUnlock - * Signature: (J)I - */ -JNIEXPORT jint JNICALL Java_sun_jvmp_generic_motif_PthreadSynchroObject_doUnlock - (JNIEnv *, jobject, jlong); - -/* - * Class: sun_jvmp_generic_motif_PthreadSynchroObject - * Method: doWait - * Signature: (JI)I - */ -JNIEXPORT jint JNICALL Java_sun_jvmp_generic_motif_PthreadSynchroObject_doWait - (JNIEnv *, jobject, jlong, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/mozilla/java/waterfall/wf/include/sun_jvmp_mozilla_JSObject.h b/mozilla/java/waterfall/wf/include/sun_jvmp_mozilla_JSObject.h deleted file mode 100644 index 81be0b9c28b..00000000000 --- a/mozilla/java/waterfall/wf/include/sun_jvmp_mozilla_JSObject.h +++ /dev/null @@ -1,102 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class sun_jvmp_mozilla_JSObject */ - -#ifndef _Included_sun_jvmp_mozilla_JSObject -#define _Included_sun_jvmp_mozilla_JSObject -#ifdef __cplusplus -extern "C" { -#endif -/* Inaccessible static: m_evaluator */ -/* - * Class: sun_jvmp_mozilla_JSObject - * Method: JSFinalize - * Signature: (IIJ)V - */ -JNIEXPORT void JNICALL Java_sun_jvmp_mozilla_JSObject_JSFinalize - (JNIEnv *, jclass, jint, jint, jlong); - -/* - * Class: sun_jvmp_mozilla_JSObject - * Method: JSGetNativeJSObject - * Signature: (JLjava/lang/String;[[B[IILjava/security/AccessControlContext;)I - */ -JNIEXPORT jint JNICALL Java_sun_jvmp_mozilla_JSObject_JSGetNativeJSObject - (JNIEnv *, jclass, jlong, jstring, jobjectArray, jintArray, jint, jobject); - -/* - * Class: sun_jvmp_mozilla_JSObject - * Method: JSGetThreadID - * Signature: (J)I - */ -JNIEXPORT jint JNICALL Java_sun_jvmp_mozilla_JSObject_JSGetThreadID - (JNIEnv *, jclass, jlong); - -/* - * Class: sun_jvmp_mozilla_JSObject - * Method: JSObjectCall - * Signature: (IIJLjava/lang/String;[[B[IILjava/lang/String;[Ljava/lang/Object;Ljava/security/AccessControlContext;)Ljava/lang/Object; - */ -JNIEXPORT jobject JNICALL Java_sun_jvmp_mozilla_JSObject_JSObjectCall - (JNIEnv *, jclass, jint, jint, jlong, jstring, jobjectArray, jintArray, jint, jstring, jobjectArray, jobject); - -/* - * Class: sun_jvmp_mozilla_JSObject - * Method: JSObjectEval - * Signature: (IIJLjava/lang/String;[[B[IILjava/lang/String;Ljava/security/AccessControlContext;)Ljava/lang/Object; - */ -JNIEXPORT jobject JNICALL Java_sun_jvmp_mozilla_JSObject_JSObjectEval - (JNIEnv *, jclass, jint, jint, jlong, jstring, jobjectArray, jintArray, jint, jstring, jobject); - -/* - * Class: sun_jvmp_mozilla_JSObject - * Method: JSObjectGetMember - * Signature: (IIJLjava/lang/String;[[B[IILjava/lang/String;Ljava/security/AccessControlContext;)Ljava/lang/Object; - */ -JNIEXPORT jobject JNICALL Java_sun_jvmp_mozilla_JSObject_JSObjectGetMember - (JNIEnv *, jclass, jint, jint, jlong, jstring, jobjectArray, jintArray, jint, jstring, jobject); - -/* - * Class: sun_jvmp_mozilla_JSObject - * Method: JSObjectGetSlot - * Signature: (IIJLjava/lang/String;[[B[IIILjava/security/AccessControlContext;)Ljava/lang/Object; - */ -JNIEXPORT jobject JNICALL Java_sun_jvmp_mozilla_JSObject_JSObjectGetSlot - (JNIEnv *, jclass, jint, jint, jlong, jstring, jobjectArray, jintArray, jint, jint, jobject); - -/* - * Class: sun_jvmp_mozilla_JSObject - * Method: JSObjectRemoveMember - * Signature: (IIJLjava/lang/String;[[B[IILjava/lang/String;Ljava/security/AccessControlContext;)V - */ -JNIEXPORT void JNICALL Java_sun_jvmp_mozilla_JSObject_JSObjectRemoveMember - (JNIEnv *, jclass, jint, jint, jlong, jstring, jobjectArray, jintArray, jint, jstring, jobject); - -/* - * Class: sun_jvmp_mozilla_JSObject - * Method: JSObjectSetMember - * Signature: (IIJLjava/lang/String;[[B[IILjava/lang/String;Ljava/lang/Object;Ljava/security/AccessControlContext;)V - */ -JNIEXPORT void JNICALL Java_sun_jvmp_mozilla_JSObject_JSObjectSetMember - (JNIEnv *, jclass, jint, jint, jlong, jstring, jobjectArray, jintArray, jint, jstring, jobject, jobject); - -/* - * Class: sun_jvmp_mozilla_JSObject - * Method: JSObjectSetSlot - * Signature: (IIJLjava/lang/String;[[B[IIILjava/lang/Object;Ljava/security/AccessControlContext;)V - */ -JNIEXPORT void JNICALL Java_sun_jvmp_mozilla_JSObject_JSObjectSetSlot - (JNIEnv *, jclass, jint, jint, jlong, jstring, jobjectArray, jintArray, jint, jint, jobject, jobject); - -/* - * Class: sun_jvmp_mozilla_JSObject - * Method: JSObjectToString - * Signature: (IIJ)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_sun_jvmp_mozilla_JSObject_JSObjectToString - (JNIEnv *, jclass, jint, jint, jlong); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/mozilla/java/waterfall/wf/include/sun_jvmp_mozilla_JavaScriptProtectionDomain.h b/mozilla/java/waterfall/wf/include/sun_jvmp_mozilla_JavaScriptProtectionDomain.h deleted file mode 100644 index 1d05daa88f7..00000000000 --- a/mozilla/java/waterfall/wf/include/sun_jvmp_mozilla_JavaScriptProtectionDomain.h +++ /dev/null @@ -1,45 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class sun_jvmp_mozilla_JavaScriptProtectionDomain */ - -#ifndef _Included_sun_jvmp_mozilla_JavaScriptProtectionDomain -#define _Included_sun_jvmp_mozilla_JavaScriptProtectionDomain -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: sun_jvmp_mozilla_JavaScriptProtectionDomain - * Method: finalize - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_sun_jvmp_mozilla_JavaScriptProtectionDomain_finalize - (JNIEnv *, jobject, jlong); - -/* - * Class: sun_jvmp_mozilla_JavaScriptProtectionDomain - * Method: getCodeBase - * Signature: (J)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_sun_jvmp_mozilla_JavaScriptProtectionDomain_getCodeBase - (JNIEnv *, jclass, jlong); - -/* - * Class: sun_jvmp_mozilla_JavaScriptProtectionDomain - * Method: getRawCerts - * Signature: (J)[[B - */ -JNIEXPORT jobjectArray JNICALL Java_sun_jvmp_mozilla_JavaScriptProtectionDomain_getRawCerts - (JNIEnv *, jclass, jlong); - -/* - * Class: sun_jvmp_mozilla_JavaScriptProtectionDomain - * Method: implies - * Signature: (JLjava/lang/String;Ljava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL Java_sun_jvmp_mozilla_JavaScriptProtectionDomain_implies - (JNIEnv *, jobject, jlong, jstring, jstring); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/mozilla/java/waterfall/wf/include/sun_jvmp_mozilla_MozillaAppletPeer.h b/mozilla/java/waterfall/wf/include/sun_jvmp_mozilla_MozillaAppletPeer.h deleted file mode 100644 index e72f9454686..00000000000 --- a/mozilla/java/waterfall/wf/include/sun_jvmp_mozilla_MozillaAppletPeer.h +++ /dev/null @@ -1,58 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class sun_jvmp_mozilla_MozillaAppletPeer */ - -#ifndef _Included_sun_jvmp_mozilla_MozillaAppletPeer -#define _Included_sun_jvmp_mozilla_MozillaAppletPeer -#ifdef __cplusplus -extern "C" { -#endif -/* Inaccessible static: appletPanels */ -/* Inaccessible static: audioClips */ -/* Inaccessible static: imageRefs */ -/* - * Class: sun_jvmp_mozilla_MozillaAppletPeer - * Method: finalizeParams - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_sun_jvmp_mozilla_MozillaAppletPeer_finalizeParams - (JNIEnv *, jobject); - -/* - * Class: sun_jvmp_mozilla_MozillaAppletPeer - * Method: getParams - * Signature: ()[[Ljava/lang/String; - */ -JNIEXPORT jobjectArray JNICALL Java_sun_jvmp_mozilla_MozillaAppletPeer_getParams - (JNIEnv *, jobject); - -/* - * Class: sun_jvmp_mozilla_MozillaAppletPeer - * Method: nativeShowDocument - * Signature: (Ljava/lang/String;Ljava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL Java_sun_jvmp_mozilla_MozillaAppletPeer_nativeShowDocument - (JNIEnv *, jobject, jstring, jstring); - -/* - * Class: sun_jvmp_mozilla_MozillaAppletPeer - * Method: nativeShowStatus - * Signature: (Ljava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL Java_sun_jvmp_mozilla_MozillaAppletPeer_nativeShowStatus - (JNIEnv *, jobject, jstring); - - -/* - * Class: sun_jvmp_mozilla_MozillaAppletPeer - * Method: nativeReturnJObject - * Signature: (Ljava/lang/Object;J)V - */ -JNIEXPORT void JNICALL Java_sun_jvmp_mozilla_MozillaAppletPeer_nativeReturnJObject - (JNIEnv *, jobject, jobject, jlong); - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/mozilla/java/waterfall/wf/include/sun_jvmp_mozilla_MozillaPeerFactory.h b/mozilla/java/waterfall/wf/include/sun_jvmp_mozilla_MozillaPeerFactory.h deleted file mode 100644 index 494bbf4dd2f..00000000000 --- a/mozilla/java/waterfall/wf/include/sun_jvmp_mozilla_MozillaPeerFactory.h +++ /dev/null @@ -1,30 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class sun_jvmp_mozilla_MozillaPeerFactory */ - -#ifndef _Included_sun_jvmp_mozilla_MozillaPeerFactory -#define _Included_sun_jvmp_mozilla_MozillaPeerFactory -#ifdef __cplusplus -extern "C" { -#endif -/* Inaccessible static: initialized */ -/* - * Class: sun_jvmp_mozilla_MozillaPeerFactory - * Method: nativeGetProxyInfoForURL - * Signature: (Ljava/lang/String;)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_sun_jvmp_mozilla_MozillaPeerFactory_nativeGetProxyInfoForURL - (JNIEnv *, jobject, jstring); - -/* - * Class: sun_jvmp_mozilla_MozillaPeerFactory - * Method: nativeHandleCall - * Signature: (IJ)I - */ -JNIEXPORT jint JNICALL Java_sun_jvmp_mozilla_MozillaPeerFactory_nativeHandleCall - (JNIEnv *, jobject, jint, jlong); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/mozilla/java/waterfall/wf/java/plugin.policy b/mozilla/java/waterfall/wf/java/plugin.policy deleted file mode 100644 index 5d65ce49961..00000000000 --- a/mozilla/java/waterfall/wf/java/plugin.policy +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: plugin.policy,v 1.1.1.1 2001-05-09 17:29:53 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -grant codeBase "file:${jvmp.home}/classes/" { - permission java.security.AllPermission; -}; -grant codeBase "file:${jvmp.home}/wf.jar" { - permission java.security.AllPermission; -}; - -grant { - permission java.lang.RuntimePermission "accessClassInPackage.sun.jvmp"; - permission java.lang.RuntimePermission "accessClassInPackage.sun.jvmp.applet"; - permission java.lang.RuntimePermission "accessClassInPackage.sun.security.action"; - permission java.lang.RuntimePermission "accessClassInPackage.sun.awt.image"; - permission java.lang.RuntimePermission "accessClassInPackage.sun.audio"; - permission java.lang.RuntimePermission "accessClassInPackage.sun.applet"; - permission java.lang.RuntimePermission "modifyThread"; -}; diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/BrowserSupport.java b/mozilla/java/waterfall/wf/java/sun/jvmp/BrowserSupport.java deleted file mode 100644 index a4cfc02bc2f..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/BrowserSupport.java +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: BrowserSupport.java,v 1.1.1.1 2001-05-09 17:29:54 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp; - -import java.net.URL; -import java.net.URLConnection; -import sun.jvmp.applet.ProxyInfo; - -/** - * Generic interface of browser support - */ -public interface BrowserSupport -{ - - public ProxyInfo getProxyInfoForURL(URL url); - public URLConnection getConnectionForURL(URL url); -} diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/ComponentException.java b/mozilla/java/waterfall/wf/java/sun/jvmp/ComponentException.java deleted file mode 100644 index 9b33a76f570..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/ComponentException.java +++ /dev/null @@ -1,39 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: ComponentException.java,v 1.1.1.1 2001-05-09 17:29:54 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp; - -public class ComponentException extends Exception -{ - String message="Component exception"; - public ComponentException(String message) - { - this.message = message; - } - - public ComponentException() - {} -}; diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/ComponentLoader.java b/mozilla/java/waterfall/wf/java/sun/jvmp/ComponentLoader.java deleted file mode 100644 index 7d302fb8cf7..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/ComponentLoader.java +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: ComponentLoader.java,v 1.1.1.1 2001-05-09 17:29:54 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp; - -import java.net.URL; -import java.net.URLClassLoader; -import java.beans.*; -import java.io.*; -import java.util.jar.*; -import java.lang.reflect.*; -import java.security.CodeSource; - -class ComponentLoader -{ - protected PluggableJVM jvm; - - ComponentLoader(PluggableJVM jvm) - { - this.jvm = jvm; - } - - /** - * Load component from the given URL. - * It should be a JAR with attribute "Factory-Class" set to the name of - * factory class of this component. - **/ - public ObjectFactory getComponent(URL url) - { - try { - //jvm.trace("url="+url, jvm.LOG_DEBUG); - JarInputStream jis = new JarInputStream(url.openStream()); - URL wfcp = jvm.getCodeSource().getLocation(); - // yes - own classloader for every component - must be safer - URLClassLoader comploader = new URLClassLoader(new URL [] {url, wfcp}, - this.getClass().getClassLoader()); - Class factory = null; - Manifest mf = jis.getManifest(); - Attributes a = mf.getMainAttributes(); - // this is magic to allow component to provide - // custom protocol handlers - String pkgs = - a.getValue(new Attributes.Name("Protocol-Handlers")); - if (pkgs != null) jvm.registerProtocolHandlers(comploader, pkgs); - String classname = - a.getValue(new Attributes.Name("Factory-Class")); - if (classname == null) return null; - - factory = Class.forName(classname, true, comploader); - Method m = factory.getDeclaredMethod("getFactory", - new Class[]{PluggableJVM.class, - CodeSource.class}); - CodeSource cs = new CodeSource(url, null); - Object o = m.invoke(null, new Object[]{jvm, cs}); - return (ObjectFactory)o; - } catch (Exception e) { - // as I'm such a lazy butt to perform all checks here - jvm.trace("getComponent failed: "+e, PluggableJVM.LOG_WARNING); - jvm.trace(e, PluggableJVM.LOG_WARNING); - return null; - } - } - - public void register(URL url) - { - ObjectFactory of = getComponent(url); - if (of == null) return; - jvm.registerService(of); - } - - /** - * Autoregister components from those locations - **/ - public void register(URL[] urls) - { - if (urls == null) return; - for (int i=0; i - */ - -package sun.jvmp; - -import sun.jvmp.security.*; -// peer event types, synchronize with nsIJavaHTMLObject.idl -public interface HostObjectPeer extends IDObject -{ - /** - * Some peer types. Just for reference. - **/ - public static final int PT_UNKNOWN = 0; - public static final int PT_EMBED = 1; - public static final int PT_OBJECT = 2; - public static final int PT_APPLET = 3; - public static final int PT_PLUGLET = 4; - - /** - * Some peer events. Just for reference. - **/ - public static final int PE_NOPE = 0; - public static final int PE_CREATE = 1; - public static final int PE_SETWINDOW = 2; - public static final int PE_DESTROY = 3; - public static final int PE_START = 4; - public static final int PE_STOP = 5; - public static final int PE_NEWPARAMS = 6; - public static final int PE_SETTYPE = 7; - public static final int PE_PEEREVENT = 8; - public static final int PE_GETPEER = 9; - - /** - * Java object events - usage is voluntary. - **/ - public static final int JE_NOPE = 0; - public static final int JE_SHOWSTATUS = 1; - public static final int JE_SHOWDOCUMENT = 2; - // generic event sent by applet - public static final int JE_APPLETEVENT = 3; - // error requiring browser's attention happened in applet - public static final int JE_APPLETERROR = 4; - // error requiring browser's attention happened in JVM - public static final int JE_JVMERROR = 5; - - /** - * returns pointer to peer factory used to create this peer - **/ - public HostObjectPeerFactory getFactory(); - /** - * Event handler - called when SendEvent/PostEvent methods called. - * Calls comes directly from PluggableJVM main event loop - - * maybe it's better for each peer to have own message queue, - * but it will make performance overhead. - **/ - public int handleEvent(SecurityCaps caps, int eventID, long eventData); - - /** - * This method is called directly from native thread - - * do anything you want. - **/ - public int handleCall(SecurityCaps caps, int arg1, long arg2); - - /** - * Method called when host calls JVMP_DestroyPeer. - * Final clean up here. Return 0 if don't want to die, or caps - * isn't good enough. - */ - public int destroy(SecurityCaps caps); -}; - - - - - - - - - - - diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/HostObjectPeerFactory.java b/mozilla/java/waterfall/wf/java/sun/jvmp/HostObjectPeerFactory.java deleted file mode 100644 index 2c154457c6d..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/HostObjectPeerFactory.java +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: HostObjectPeerFactory.java,v 1.1.1.1 2001-05-09 17:29:54 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp; - -import sun.jvmp.security.*; -import java.security.*; - -// interface that should be implemented by all Waterfall extensions -// Java classes. -// creates Java peer of given version. -// vendor ID is already fixed, and should be known by this factory -public interface HostObjectPeerFactory extends IDObject -{ - public String getCID(); - public HostObjectPeer create(int version); - /** - * Event handler - called when SendExtEvent/PostExtEvent methods called. - * Calls comes directly from PluggableJVM main event loop - - * maybe it's better for each extension to have own message queue, - * but it will make performance overhead. - **/ - public int handleEvent(SecurityCaps caps, - int eventID, - long eventData); - /** - * This method is called directly from native thread - - * do anything you want. - **/ - public int handleCall(SecurityCaps caps, int arg1, long arg2); - - /** - * Method called when host calls JVMP_UnregisterExtension. - * Final clean up here. Return 0 if don't want to die, or caps - * isn't good enough. - */ - public int destroy(SecurityCaps caps); - /** - * Returns permission collection required for this extension to work - * properly, null if nothing - */ - public PermissionCollection getPermissions(CodeSource codesource); -} - - diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/IDList.java b/mozilla/java/waterfall/wf/java/sun/jvmp/IDList.java deleted file mode 100644 index e5cf243e155..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/IDList.java +++ /dev/null @@ -1,147 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: IDList.java,v 1.1.1.1 2001-05-09 17:29:54 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp; - -import java.util.Vector; -import java.util.Enumeration; -import java.util.Hashtable; - -public class IDList { - protected Vector m_items; - protected Hashtable m_ids; - // this is common for - static int m_nextID = 1; - public IDList() - { - m_items = new Vector(0, 5); - m_ids = new Hashtable(); - } - - // this is way to make all IDList's error-prone, as - // ID will be truly unique for all instances - static synchronized int getNextID() - { - if (m_nextID == Integer.MAX_VALUE) m_nextID = 1; - return m_nextID++; - } - - // XXX: reimplement it with smth more efficient - int getStorage(int id) - { - Integer storage = (Integer)m_ids.get(new Integer(id)); - if (storage == null) return -1; - return storage.intValue(); - } - - int getId(int storage) - { - int id = getNextID(); - m_ids.put(new Integer(id), new Integer(storage)); - return id; - } - - public synchronized int add(IDObject o) - { - int id = 0, free_slot = -1; - if (o == null) return 0; // null objects cannot be saved - // first - find out if this object already added - // reverse order - to give smallest IDs first. - for (int i = m_items.size()-1; i >= 0; i--) - { - IDObject o1 = (IDObject)m_items.elementAt(i); - if (o1 == null) - { - free_slot = i; - } - else - { - if (o1.equals(o)) - { - id = o1.getID(); - o.setID(id); - return id; - } - } - } - if (free_slot != -1) - { - id = getId(free_slot); - m_items.setElementAt(o, free_slot); - } - else - { - m_items.add(o); - id = getId(m_items.indexOf(o)); - } - o.setID(id); - return id; - } - // XXX: should I shrink underlying Vector? - public synchronized IDObject remove(int id) - { - IDObject o = get(id); - m_items.setElementAt(null, getStorage(id)); - return o; - } - - public synchronized IDObject remove(IDObject o) - { - if (o == null) return null; - for (int i = 0; i < m_items.size(); i++) - { - IDObject o1 = (IDObject)m_items.elementAt(i); - if (o.equals(o1)) - { - m_items.setElementAt(null, i); - return o1; - } - } - return null; - } - - public synchronized IDObject get(int id) - { - int storage = getStorage(id); - if (storage == -1) return null; - return (IDObject)m_items.elementAt(storage); - } - - public synchronized int length() - { - int count = 0; - for (int i = 0; i < m_items.size(); i++) - if (m_items.elementAt(i) != null) count++; - return count; - } - - public Enumeration elements() - { - return m_items.elements(); - } -} - - diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/IDObject.java b/mozilla/java/waterfall/wf/java/sun/jvmp/IDObject.java deleted file mode 100644 index 3b6bc4d3ff6..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/IDObject.java +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: IDObject.java,v 1.1.1.1 2001-05-09 17:29:54 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp; - -public interface IDObject { - public void setID(int id); - public int getID(); -} diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/MultipleHashtable.java b/mozilla/java/waterfall/wf/java/sun/jvmp/MultipleHashtable.java deleted file mode 100644 index 78995b4c5d7..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/MultipleHashtable.java +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: MultipleHashtable.java,v 1.1.1.1 2001-05-09 17:29:54 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp; - -import java.util.*; -/** - * utility class - hashtable with multiple values per key - */ - -public class MultipleHashtable extends Hashtable -{ - public MultipleHashtable() - { - super(); - } - - public Object put(Object key, Object value) - { - Vector v = getVector(key); - if (v == null) v = new Vector(); - v.add(value); - return super.put(key, v); - } - - public Vector getVector(Object key) - { - return (Vector)super.get(key); - } -// public Object get(Object key) -// { -// // I know, I'm bad :) -// return null; -// } -} diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/NativeFrame.java b/mozilla/java/waterfall/wf/java/sun/jvmp/NativeFrame.java deleted file mode 100644 index e2602fc5dd1..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/NativeFrame.java +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: NativeFrame.java,v 1.1.1.1 2001-05-09 17:29:54 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp; - -import java.awt.*; - -public class NativeFrame implements IDObject -{ - protected Frame m_f; - protected int m_id = 0; - - public NativeFrame(Frame f) - { - m_f = f; - } - - public void setID(int id) - { - if (m_id !=0) return; - m_id = id; - } - - public int getID() - { - return m_id; - } - - public Frame getFrame() - { - return m_f; - } - public boolean equals(Object obj) - { - NativeFrame f; - if (obj == null) return false; - try { - f = (NativeFrame)obj; - } catch (ClassCastException e) { - return false; - } - return (m_f == f.getFrame()); - } - - public String toString() - { - if (m_f != null) return m_f.toString(); - return "null NativeFrame object"; - } -} diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/NativeThread.java b/mozilla/java/waterfall/wf/java/sun/jvmp/NativeThread.java deleted file mode 100644 index 92d2d5b28ab..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/NativeThread.java +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: NativeThread.java,v 1.1.1.1 2001-05-09 17:29:54 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp; - -public class NativeThread implements IDObject -{ - protected Thread m_t; - protected int m_id = 0; - - public NativeThread(Thread t) - { - m_t = t; - } - - public void setID(int id) - { - if (m_id !=0) return; - m_id = id; - } - - public int getID() - { - return m_id; - } - - public Thread getThread() - { - return m_t; - } - public boolean equals(Object obj) - { - NativeThread t; - if (obj == null) return false; - try { - t = (NativeThread)obj; - } catch (ClassCastException e) { - return false; - } - return (m_t == t.getThread()); - } - - public String toString() - { - if (m_t != null) return m_t.toString(); - return "null NativeThread object"; - } -} diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/ObjectFactory.java b/mozilla/java/waterfall/wf/java/sun/jvmp/ObjectFactory.java deleted file mode 100644 index 279a28b7f24..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/ObjectFactory.java +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: ObjectFactory.java,v 1.1.1.1 2001-05-09 17:29:54 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp; - -import java.util.Enumeration; -import java.security.*; -/** - * This interface describes interface to be implemented by object factory - * if it likes to be used by Waterfall actors. - * Protocol: - * 1. getCIDs(), if returned null - done - * 2. call handleConflict() on every conflicting CID (see handleConflict()) - * XXX: shouldn't interface be locked on conflict resolution time? - * 3. now object factory is ready to produce object instances using - * instantiate() - * 4. also permissions provided by this ObjectFactory used by system policy - **/ -public interface ObjectFactory { - /** - * Returns name of this object factory. Also can be used for - * versioning, i.e. name can be - * WF-AppletViewer:00001 - * and so useful in conflict resolution - **/ - public String getName(); - - /** - * Returns list of CIDs this object factory provides - **/ - public Enumeration getCIDs(); - - /** - * This method called with a rejected CID and conficting object factory. - * Returned value true if ObjectFactory insist to be the owner of this CID, - * false otherwise. - * If both returned true, or both returned false - status quo is saved. - * Otherwise factory returned true becomes owner of CID. - * Using this protocol, versioning issues can be solved easily. - **/ - public boolean handleConflict(String cid, - ObjectFactory f); - - /** - * When Waterfall asked to create instance of object with given CID - * - this method got called. - **/ - public Object instantiate(String cid, Object arg); - - /** - * Object factory allowed to extend Waterfall security policy - * using this method. Usually this method used to grant certain - * permissions to itself, but also can be used to define system-wide policy. - * This isn't recommended in generic case, but some kind of extensions, - * for example applet viewers, cannot avoid it. - **/ - public PermissionCollection getPermissions(CodeSource codesource); -} - - diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/PluggableJVM.java b/mozilla/java/waterfall/wf/java/sun/jvmp/PluggableJVM.java deleted file mode 100644 index c87178101d4..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/PluggableJVM.java +++ /dev/null @@ -1,1019 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: PluggableJVM.java,v 1.1.1.1 2001-05-09 17:29:54 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/** - * Main Waterfall Java class. It works as a message queue handler. - * TODO: - * - To make it more portable sun.misc.Queue dependency should be removed. - * - improve synchronyzation policy - **/ - -package sun.jvmp; - - -import java.io.*; -import java.awt.*; -import java.awt.event.*; -import java.util.*; -import java.net.*; -import sun.misc.Queue; -import sun.jvmp.security.*; -import java.security.*; -import java.lang.reflect.Constructor; - -public abstract class PluggableJVM - extends Thread - implements URLStreamHandlerFactory -{ - protected static int debugLevel = 10; - protected PluggableJVM instance = null; - protected boolean initedNative = false; - protected boolean shouldStop = false; - protected boolean running = false; - protected boolean inited = false; - protected IDList nativeFrames; - protected IDList nativeThreads; - protected IDList nativeMonitors; - protected ConsoleWindow console; - protected IDList javaPeers; - protected IDList vendorExtensions; - protected Queue event_queue; - protected MultipleHashtable extensions; - protected ExtSecurityManager securityManager; - protected Hashtable handlesFrames; - protected Hashtable handlesMonitors; - protected WFPolicy policy; - protected Hashtable hashCID; - protected CodeSource codesource; - protected ComponentLoader loader; - protected Vector protocolHandlers; - - /* commands implemented by this pluggable JVM - - use JVMP_SendSysEvent() call */ - protected final static int CMD_CTL_CONSOLE = 1; - - /* tracing facility levels */ - public final static int LOG_CRITICAL = 0; - public final static int LOG_IMPORTANT = 2; - public final static int LOG_ERROR = 4; - public final static int LOG_WARNING = 6; - public final static int LOG_INFO = 8; - public final static int LOG_DEBUG = 10; - - /*****************************************************************/ - /*************************** PUBLIC METHODS **********************/ - public Frame getFrameWithId(int id) - { - NativeFrame f = (NativeFrame)nativeFrames.get(id); - if (f == null) return null; - return f.getFrame(); - } - - public Enumeration getAllFrames() - { - return nativeFrames.elements(); - } - - public HostObjectPeer getPeerWithId(int id) - { - return (HostObjectPeer)javaPeers.get(id); - } - - public Enumeration getAllPeers() - { - return javaPeers.elements(); - } - - public HostObjectPeerFactory getFactoryWithId(int id) - { - WaterfallExtension ext = - (WaterfallExtension)vendorExtensions.get(id); - if (ext == null) return null; - return ext.getFactory(); - } - - public Enumeration getAllExtensions() - { - return vendorExtensions.elements(); - } - - public Thread getThreadWithId(int id) - { - NativeThread t = (NativeThread)nativeThreads.get(id); - if (t == null) return null; - return t.getThread(); - } - - public Enumeration getAllThreads() - { - return nativeThreads.elements(); - } - - public SynchroObject getSynchroObjectWithID(int id) - { - return (SynchroObject)nativeMonitors.get(id); - } - - public Enumeration getAllSynchroObjects() - { - return nativeMonitors.elements(); - } - - public static void trace(String msg, int level) - { - if (level <= debugLevel) - System.err.println("WF trace("+level+"): " + msg); - } - - public static void trace(Throwable e, int level) - { - if ((level <= debugLevel) && (e != null)) - e.printStackTrace(); - } - - public PluggableJVM getJVM() - { - return instance; - } - - /** - * Those functions should be emphasized. Waterfall itself is just a glueing - * framework, but good one :). Those functions allows any entity - * announce itself as a factory able to produce objects ready to serve - * for some purpose, specified by contract ID (CID). CID itself can be any string, - * describing object functionality. For example Mozilla-like contract IDs, such as - * @sun.com/wf/applets/appletviewer;1 (XXX: what is "1" here? version?) - * Object generated by such factories could implement some expected by client - * interfaces, such as sun.jvmp.applet.AppletViewer, but client should be ready - * to handle ClassCastException and behave properly. Together with ability - * to use java beans from both user-wide and system-wide directories it allows - * Waterfall to be extended very well. Also extensions can register themselves - * as servers at startup time. - **/ - /** - * Register given object factory. Waterfall and object factory use protocol - * described in sun.jvmp.ObjectFactory to complete registration. - **/ - public boolean registerService(ObjectFactory f) - { - int proceed = 0; - trace("registerService " +f, LOG_DEBUG); - if (f == null) return false; - Enumeration e = f.getCIDs(); - if (e == null) return false; - try { - for (;e.hasMoreElements();) - { - ObjectFactory f1; - String cid = (String) e.nextElement(); - if (cid == null) continue; - if ((f1 = (ObjectFactory)hashCID.get(cid)) != null) - { - // resolve conflict - // the same factory - do nothing - if (f.equals(f1)) continue; - if (!f.handleConflict(cid, f1) || - f1.handleConflict(cid, f)) continue; - } - - hashCID.put(cid, f); - proceed++; - } - } catch (Exception ex) { - trace("Exception in registerService: "+ex, LOG_WARNING); - trace(ex, LOG_WARNING); - return false; - } - return (proceed > 0); - } - - /** - * Create server object using given CID, and arg as argument of - * production method - **/ - public Object getServiceByCID(String cid, Object arg) - { - Object o; - try { - if (cid == null) return null; - ObjectFactory of = (ObjectFactory)hashCID.get(cid); - if (of == null) return null; - o = of.instantiate(cid, arg); - } catch (Exception e) { - trace(e, LOG_WARNING); - return null; - } - return o; - } - - /** - * Initiate unregistering of this service. Unregister completed - * by Waterfall and object factory using protocol described in - * sun.jvmp.ObjectFactory - **/ - public boolean unregisterService(ObjectFactory o) - { - int proceed = 0; - if (o == null) return false; - // just release our reference to this object. - for (Enumeration e = hashCID.keys(); e.hasMoreElements();) - { - Object key = e.nextElement(); - if (o.equals(hashCID.get(key))) - { - hashCID.put(key, null); - proceed++; - } - } - return (proceed > 0); - } - - - public PermissionCollection getExtensionsPermissions(CodeSource codesource) - { - Permissions p = new Permissions(); - // return permissions provided by native-based extensions - // really I'd like to have only one repository of extensions - // for both native and Java API. - // rewrite it ASAP - for (Enumeration e=vendorExtensions.elements(); e.hasMoreElements();) - { - HostObjectPeerFactory f = - ((WaterfallExtension)e.nextElement()).getFactory(); - PermissionCollection c = f.getPermissions(codesource); - if (c != null) - { - for (Enumeration e1=c.elements(); e1.hasMoreElements(); ) - p.add((Permission)e1.nextElement()); - } - } - // XXX: it could lead to duplication of permissions, - // but I don't think it's so awful - for (Enumeration e=hashCID.keys(); e.hasMoreElements();) - { - ObjectFactory f = - (ObjectFactory)hashCID.get(e.nextElement()); - PermissionCollection c = f.getPermissions(codesource); - if (c != null) - { - for (Enumeration e1=c.elements(); e1.hasMoreElements(); ) - p.add((Permission)e1.nextElement()); - } - } - return p; - } - // XXX: kill me ASAP - public CodeSource getCodeSource() - { - return codesource; - } - - public URLStreamHandler createURLStreamHandler(String protocol) - { - //trace("handler for: "+protocol, PluggableJVM.LOG_DEBUG); - URLStreamHandler handler = null; - for (Enumeration e=protocolHandlers.elements();e.hasMoreElements();) - { - ProtoHandlerDesc d = (ProtoHandlerDesc)e.nextElement(); - handler = tryToGetHandler(d.loader, d.pkgs, protocol); - if (handler != null) return handler; - } - // fallback to defaults - return tryToGetHandler(null, "sun.net.www.protocol", protocol); - } - /***************** END OF PUBLIC METHODS *************************/ - /*****************************************************************/ - /* methods from here accessible only to JNI calls, or to our subclasses */ - protected PluggableJVM() - { - nativeFrames = new IDList(); - nativeThreads = new IDList(); - nativeMonitors = new IDList(); - javaPeers = new IDList(); - vendorExtensions = new IDList(); - event_queue = new Queue(); - extensions = new MultipleHashtable(); - securityManager = new ExtSecurityManager(this); - handlesFrames = new Hashtable(); - handlesMonitors = new Hashtable(); - hashCID = new Hashtable(); - protocolHandlers = new Vector(); - setName("Waterfall system thread"); - } - - /* two additional guarded entry points - not part of public API */ - public void run() - { - if (running) return; - // stuff like components autoregistration moved to this thread - // to minimize latency - String wfHome = System.getProperty("jvmp.home"); - loader.registerAllInDir(new File(wfHome, "ext")); - running = true; - runMainLoop(); - } - - public void init(String codebase, boolean isNative) - { - // init AWT here - if (inited) return; - Frame f = new Frame(); - f.setBounds(0, 0, 0, 0); - f.addNotify(); - f.removeNotify(); - f = null; - - // create console - console = new ConsoleWindow(this); - trace("stdout and stderr redirected to console", LOG_WARNING); - // Reassign stderr and stdout to console - DebugOutputStream myErrOS = new DebugOutputStream(console, "wflog.err"); - PrintStream myErrPS = new PrintStream(myErrOS); - System.setErr(myErrPS); - DebugOutputStream myOutOS = new DebugOutputStream(console, "wflog.out"); - PrintStream myOutPS = new PrintStream(myOutOS); - System.setOut(myOutPS); - console.printHelp(); - - if (isNative) loadLibrary(); - File c = new File(codebase); - try { - codesource = new CodeSource(c.toURL(), null); - policy = new WFPolicy(this, c.toURL()); - java.security.Policy.setPolicy(policy); - } catch (Exception e) { - trace("Wow, cannot set system wide policy: "+e, LOG_CRITICAL); - } - URL.setURLStreamHandlerFactory(this); - loader = new ComponentLoader(this); - inited = true; - return; - } - - - // start() method inside of platform-specific VM */ - protected int stopJVM(byte caps_raw[]) - { - int c; - if ((c = vendorExtensions.length()) > 0) return c; - shouldStop = true; - /* dummy event to wake up main thread - low priority - to allow pending requests to be completed */ - sendEvent(caps_raw, 0, 0, 0, PJVMEvent.LOW_PRIORITY); - // let it to be handled, and then allow caller to destroy JVM - return 0; - } - - protected synchronized int RegisterWindow(int handle, - int width, int height) - { - NativeFrame nf; - // try to find in hash before - if ((nf = (NativeFrame)handlesFrames.get(new Integer(handle))) != null) - { - nf.getFrame().setBounds(0, 0, width, height); - return (nf.getID()); - } - nf = SysRegisterWindow(handle, width, height); - // check if smth failed - if (nf == null) return 0; - handlesFrames.put(new Integer(handle), nf); - return nativeFrames.add(nf); - } - - protected synchronized int UnregisterWindow(int id) - { - Frame f = getFrameWithId(id); - NativeFrame nf = null; - if (f != null) - { - Object lock = f.getTreeLock(); - synchronized (lock) - { - nf = SysUnregisterWindow(id); - } - } - if (nf == null) return 0; - // remove from ID table - nativeFrames.remove(id); - // remove from hash - Object current; - for (Enumeration e = handlesFrames.keys(); e.hasMoreElements();) - { - current = e.nextElement(); - if (((NativeFrame)handlesFrames.get(current)).getFrame() - == nf.getFrame()) - { - handlesFrames.remove(current); - break; - } - } - return nf.getID(); - } - - protected synchronized int RegisterMonitorObject(long handle) - { - SynchroObject so; - // try to find in hash before - if ((so = (SynchroObject)handlesMonitors.get(new Long(handle))) != null) - { - // XXX: maybe adjust state of SO? - return (so.getID()); - } - so = SysRegisterMonitorObject(handle); - // check if smth failed - if (so == null) return 0; - handlesMonitors.put(new Long(handle), so); - return nativeMonitors.add(so); - } - - protected synchronized int UnregisterMonitorObject(int id) - { - SynchroObject so = SysUnregisterMonitorObject(id); - if (so == null) return 0; - // remove from ID table - nativeMonitors.remove(id); - // remove from hash - Object current; - for (Enumeration e = handlesMonitors.keys(); e.hasMoreElements();) - { - current = e.nextElement(); - if (((SynchroObject)handlesMonitors.get(current)) == so) - { - handlesMonitors.remove(current); - break; - } - } - return so.getID(); - } - - // those four must be implemented by nonabstract JVM - abstract protected NativeFrame SysRegisterWindow(int handle, - int width, int height); - abstract protected NativeFrame SysUnregisterWindow(int id); - abstract protected SynchroObject SysRegisterMonitorObject(long handle); - abstract protected SynchroObject SysUnregisterMonitorObject(int id); - - protected int attachThread() - { - NativeThread t = new NativeThread(Thread.currentThread()); - int id = nativeThreads.add(t); - //log("attaching thread: " + t.getThread()+" with ID "+id); - return id; - } - - protected int detachThread() - { - NativeThread t = new NativeThread(Thread.currentThread()); - t = (NativeThread)nativeThreads.remove(t); - int id = t.getID(); - //log("detaching thread: " + t + " with id " + id); - return id; - } - - protected int registerExtension(String cid, - int version, - String classpath, - String classname, - byte caps_raw[], - byte mask_raw[], - long data) - { - SecurityCaps caps = new SecurityCaps(caps_raw); - SecurityCaps mask = new SecurityCaps(mask_raw); - int extID=0; - try { - trace("Registring extension for "+cid - +" version="+version+" classpath="+classpath - +" classname="+classname, LOG_INFO); - WaterfallExtension ext = - new WaterfallExtension(this, cid, version, - classpath, classname, data); - //securityManager.registerCapsChecker(ext, caps, mask); - extensions.put(cid, ext); - extID = vendorExtensions.add(ext); - } catch (Exception e) - { - trace("Extension not registred: "+e, LOG_ERROR); - trace(e, LOG_ERROR); - return 0; - } - return extID; - } - - protected synchronized int unregisterExtension(byte raw_caps[], - int id) - { - WaterfallExtension ext = - (WaterfallExtension)vendorExtensions.get(id); - if (ext == null) return 0; - HostObjectPeerFactory f = ext.getFactory(); - if (f == null) return 0; - SecurityCaps caps = new SecurityCaps(raw_caps); - for (Enumeration e=javaPeers.elements(); e.hasMoreElements();) - { - HostObjectPeer p = (HostObjectPeer)e.nextElement(); - if (p.getFactory() == f) - { - p.destroy(caps); - javaPeers.remove(p.getID()); - } - } - f.destroy(caps); - vendorExtensions.remove(id); - // XXX: remove from extensions hash - return 1; - } - - // post should send message async - protected int postEventRaw(byte raw_caps[], int target, - int id, long data, int type, int priority) - { - SecurityCaps caps = new SecurityCaps(raw_caps); - PJVMEvent event = new PJVMEvent(target, id, data, false, caps, - priority, type); - synchronized(this) - { - event_queue.enqueue(event); - notifyAll(); - } - return 1; - } - - // send should wait completion of request - // maybe add timeout - protected int sendEventRaw(byte raw_caps[], int target, - int id, long data, int type, int priority) - { - SecurityCaps caps = new SecurityCaps(raw_caps); - PJVMEvent event = new PJVMEvent(target, id, data, true, caps, - priority, type); - synchronized(this) - { - event_queue.enqueue(event); - notifyAll(); - } - synchronized (event) - { - // maybe this event already proceed - - // we'll get deadlock if not check - if (!event.m_completed) - { - try { - event.wait(); - } - catch (InterruptedException e) { - return 0; - } - } - } - return event.m_result; - } - - protected int handleCall(byte raw_caps[], - int type, int target, - int arg1, long arg2) - { - SecurityCaps caps = new SecurityCaps(raw_caps); - switch (type) - { - case 1: - // peer call - HostObjectPeer p = getPeerWithId(target); - if (p == null) { - trace("null target "+target+" for direct call", LOG_ERROR); - return 0; - } - trace("peer call "+p+" "+arg1+" "+arg2, LOG_DEBUG); - return p.handleCall(caps, arg1, arg2); - case 2: - // extension call - HostObjectPeerFactory f = getFactoryWithId(target); - if (f == null) return 0; - return f.handleCall(caps, arg1, arg2); - case 3: - // JVM call - return sysCall(caps, arg1, arg2); - } - return 0; - } - - protected int postEvent(byte raw_caps[], int target, - int id, long data, int priority) - { - return postEventRaw(raw_caps, target, id, - data, PJVMEvent.PEER_EVENT, priority); - } - - protected int sendEvent(byte raw_caps[], int target, - int id, long data, int priority) - { - return sendEventRaw(raw_caps, target, id, - data, PJVMEvent.PEER_EVENT, priority); - } - protected int postExtensionEvent(byte raw_caps[], int target, - int id, long data, int priority) - { - return postEventRaw(raw_caps, target, id, - data, PJVMEvent.EXT_EVENT, priority); - } - - protected int sendExtensionEvent(byte raw_caps[], int target, - int id, long data, int priority) - { - return sendEventRaw(raw_caps, target, id, - data, PJVMEvent.EXT_EVENT, priority); - } - protected int postSysEvent(byte raw_caps[], int id, - long data, int priority) - { - return postEventRaw(raw_caps, 0, id, - data, PJVMEvent.SYS_EVENT, priority); - } - - protected int sendSysEvent(byte raw_caps[], int id, - long data, int priority) - { - return sendEventRaw(raw_caps, 0, id, - data, PJVMEvent.SYS_EVENT, priority); - } - protected int enableCapabilities(byte raw_caps[], byte principals[][]) - { - // XXX: implement ME!!! - SecurityCaps caps = new SecurityCaps(raw_caps); - if (caps.isPureSystem()) - { - String str = new String(principals[0]); - if ("CAPS".equals(str)) return 1; - return 0; - } - if (caps.isPureUser()) - { - // ask extension deciders - } - return 0; - } - - protected int disableCapabilities(byte caps[]) - { - trace("disableCapabilities()", LOG_DEBUG); - return 1; - } - - - - /* PRIVATE AREA */ - protected void loadLibrary() - { - String libname = "JVMPnatives"; - try - { - System.loadLibrary(libname); - initedNative = true; - } - catch (UnsatisfiedLinkError ex) - { - trace("Plugin could not load DLL: " + libname, LOG_CRITICAL); - trace("Path is:" + System.getProperty("java.library.path"), LOG_ERROR); - trace(ex.toString(), LOG_ERROR); - }; - }; - - protected PJVMEvent getNextEvent() throws InterruptedException - { - while (event_queue.isEmpty()) - { - synchronized(this) - { - wait(); - } - } - return (PJVMEvent)event_queue.dequeue(); - } - - - private void runMainLoop() - { - Thread curThread = Thread.currentThread(); - while (!shouldStop && !curThread.isInterrupted()) { - PJVMEvent evt; - try { - evt = getNextEvent(); - } catch (InterruptedException e) { - shouldStop = true; - continue; - } - switch(evt.getType()) - { - case PJVMEvent.PEER_EVENT: - HostObjectPeer peer = getPeerWithId(evt.getTarget()); - if (peer == null) - { - // not show this message on JVM shutdown - if (!shouldStop) - { - trace("target peer " + evt.getTarget() - + " is invalid now", LOG_WARNING); - } - evt.m_completed = true; - break; - } - try { - evt.m_result = peer.handleEvent(evt.getCaps(), - evt.getID(), - evt.getData()); - evt.m_completed = true; - } catch (Throwable e) { - evt.setException(e); - evt.m_completed = true; - trace("Exception in peer event handling: "+e, - LOG_ERROR); - trace(e, LOG_ERROR); - // even if exception - notify sender - } - break; - case PJVMEvent.EXT_EVENT: - HostObjectPeerFactory ext = - getFactoryWithId(evt.getTarget()); - if (ext == null) - { - trace("target extension " + evt.getTarget() - + " is invalid now", LOG_ERROR); - evt.m_completed = true; - break; - } - try { - evt.m_result = ext.handleEvent(evt.getCaps(), - evt.getID(), - evt.getData()); - evt.m_completed = true; - } catch (Throwable e) - { - evt.setException(e); - evt.m_completed = true; - trace("Exception in peer event handling: "+e, - LOG_ERROR); - trace(e, LOG_ERROR); - // even if exception - notify sender - } - break; - case PJVMEvent.SYS_EVENT: - try { - evt.m_result = sysEvent(evt.getCaps(), - evt.getID(), evt.getData()); - evt.m_completed = true; - } catch (Throwable e) { - evt.setException(e); - evt.m_completed = true; - trace("Exception in sysevent handling: "+e, LOG_ERROR); - trace(e, LOG_ERROR); - // even if exception - notify sender - } - break; - default: - trace("Unknow event type: "+evt.getType(), LOG_ERROR); - break; - } - if (evt.isSync()) - { - synchronized (evt) - { - evt.notifyAll(); - } - } - } - trace("Main thread of plugin completed", LOG_WARNING); - running = false; - }; - - protected int sysCall(SecurityCaps caps, int arg1, long arg2) - { - return 0; - } - - protected int sysEvent(SecurityCaps caps, int id, long data) - { - switch (id) - { - case CMD_CTL_CONSOLE: - //log("CMD_CTL_CONSOLE: "+data); - switch ((int)data) - { - case 0: - console.hide(); - return 1; - case 1: - console.show(); - return 1; - case 2: - return (console.isVisible() ? 2 : 1); - } - break; - default: - trace ("Unknown sysevent: id="+id+" data="+data, LOG_WARNING); - return 0; - }; - // for stupid compilers :) - return 0; - } - - protected int createPeer(byte raw_caps[], String cid, int version) - { - HostObjectPeer peer = null; - int id = 0; - // I'd like to optimize it later, checking if caps changed, and - // create new SecurityCaps object only if caps changed from previous - // call. - SecurityCaps caps = new SecurityCaps(raw_caps); - Vector v = extensions.getVector(cid); - if (v != null) - { - WaterfallExtension we = null; - for (Enumeration e = v.elements(); e.hasMoreElements();) - { - // XXX: do smth more meaningful here - we = (WaterfallExtension)e.nextElement(); - } - if (we != null) peer = we.instantiate(caps, version); - } - else - { - trace("Extension with cid "+cid+" not registred", LOG_ERROR); - } - synchronized(this) - { - if (peer != null) id = javaPeers.add(peer); - return id; - } - } - - protected int destroyPeer(byte raw_caps[], int id) - { - SecurityCaps caps = new SecurityCaps(raw_caps); - HostObjectPeer peer = getPeerWithId(id); - if (peer == null) return 0; - if (peer.destroy(caps) != 0) removePeer(id); - return id; - } - - protected int removePeer(int id) - { - // not sure if this additional lookup is needed - //HostObjectPeer peer = getPeerWithId(id); - //trace("unregistering " + id + " peer = " + peer); - //if (peer == null) return 0; - javaPeers.remove(id); - return id; - } - void setDebugLevel(int debug) - { - if (debug > LOG_DEBUG) debug = LOG_DEBUG; - if (debug < LOG_CRITICAL) debug = LOG_CRITICAL; - debugLevel = debug; - } - - URLStreamHandler tryToGetHandler(ClassLoader loader, - String pkgs, - String proto) - { - // XXX: implement me to support several packages - try { - Class handlerClass = Class.forName(pkgs+"."+proto+".Handler", - true, - loader); - if (URLStreamHandler.class.isAssignableFrom(handlerClass)) - { - Constructor c = - handlerClass.getDeclaredConstructor(new Class[]{}); - return (URLStreamHandler)c.newInstance(new Object[]{}); - } - } catch (Exception e) { - // do nothing here - nothing special happened - //e.printStackTrace(); - } - return null; -} - - void registerProtocolHandlers(ClassLoader loader, - String pkgs) - { - synchronized (protocolHandlers) - { - protocolHandlers.add(new ProtoHandlerDesc(loader, pkgs)); - } - } -}; - -class ProtoHandlerDesc -{ - ClassLoader loader; - String pkgs; - - public ProtoHandlerDesc(ClassLoader loader, String pkgs) - { - this.loader = loader; - this.pkgs = pkgs; - } -}; - -class PJVMEvent -{ - public static final int PEER_EVENT = 1; - public static final int EXT_EVENT = 2; - public static final int SYS_EVENT = 3; - public static final int HIGHEST_PRIORITY = 100; - public static final int HIGH_PRIORITY = 80; - public static final int NORMAL_PRIORITY = 50; - public static final int LOW_PRIORITY = 20; - public static final int LOWEST_PRIORITY = 1; - public boolean m_completed = false; - protected int m_target; - protected int m_id; - protected long m_data; - protected boolean m_sync; - protected SecurityCaps m_caps; - protected int m_priority; - protected int m_type; - protected Throwable m_exception; - public int m_result = 0; - PJVMEvent(int target, int id, long data, boolean sync, SecurityCaps caps, - int priority, int type) - { - m_target = target; - m_id = id; - m_data = data; - m_sync = sync; - m_caps = caps; - m_type = type; - m_exception = null; - m_priority = priority; - } - - public int getTarget() - { - return m_target; - } - - public int getID() - { - return m_id; - } - - public int getType() - { - return m_type; - } - - public long getData() - { - return m_data; - } - public boolean isSync() - { - return m_sync; - } - public SecurityCaps getCaps() - { - return m_caps; - } - public Throwable getException() - { - return m_exception; - } - public void setException(Throwable e) - { - m_exception = e; - } - public int getPriority() - { - return m_priority; - } -} - - - - - diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/SynchroObject.java b/mozilla/java/waterfall/wf/java/sun/jvmp/SynchroObject.java deleted file mode 100644 index a9e994897c6..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/SynchroObject.java +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: SynchroObject.java,v 1.1.1.1 2001-05-09 17:29:56 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp; - -public abstract class SynchroObject implements IDObject -{ - protected int m_id = 0; - - /* much like standard Java synchro API */ - public abstract void _lock(); - public abstract void _unlock(); - public abstract void _wait(int milli) throws InterruptedException; - public abstract void _notify(); - public abstract void _notifyAll(); - public abstract void _destroy(); - - public void setID(int id) - { - if (m_id != 0) return; - m_id = id; - } - - public int getID() - { - return m_id; - } -} diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/WaterfallExtension.java b/mozilla/java/waterfall/wf/java/sun/jvmp/WaterfallExtension.java deleted file mode 100644 index 6ab3cb96179..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/WaterfallExtension.java +++ /dev/null @@ -1,229 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: WaterfallExtension.java,v 1.1.1.1 2001-05-09 17:29:56 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp; - -import sun.jvmp.security.*; -import java.lang.reflect.*; -import java.net.*; -import java.util.*; -import sun.jvmp.security.*; -import java.security.*; -import java.io.*; - -class WaterfallExtension implements AccessControlDecider, IDObject -{ - protected int m_version; - protected String m_cid; - protected int m_id; - Class bootstrapClass = null; - ClassLoader extClassLoader; - boolean inited; - HostObjectPeerFactory factory; - AccessControlDecider decider; - PluggableJVM m_jvm; - String m_classpath, m_classname; - - public WaterfallExtension(PluggableJVM jvm, String cid, int version, - String classpath, String classname, - long data) - throws ClassNotFoundException, - MalformedURLException, - NoSuchMethodException, - SecurityException, - IllegalAccessException, - IllegalArgumentException, - InvocationTargetException - { - inited = false; - m_cid = cid; - m_version = version; - m_jvm = jvm; - m_classpath = classpath; - m_classname = classname; - try - { - classpath = getDefaultClassPath() + classpath; - URL[] urls = getURLs(classpath); - ClassLoader loader = this.getClass().getClassLoader(); - - extClassLoader = new URLClassLoader(urls, loader); - bootstrapClass = - Class.forName(classname, true, extClassLoader); - - Method start = - bootstrapClass.getDeclaredMethod("start", - new Class[]{PluggableJVM.class, Long.class}); - // start() is a static method - returns factory - // to produce instances of desired type - factory = (HostObjectPeerFactory) - start.invoke(null, new Object[]{m_jvm, new Long(data)}); - decider = (AccessControlDecider)factory; - - if (!m_cid.equals(factory.getCID())) - { - // smth is wrong, created object - // is of incorrect type - m_jvm.trace("RETURNED CONTRACT ID ISN'T CORRECT", - PluggableJVM.LOG_ERROR); - // XXX: correct exception? - throw new - IllegalArgumentException("Mismatch contract ID: "+ - factory.getCID() + - " instead of "+ m_cid); - } - } - catch (ClassCastException e) - { - m_jvm.trace("Extension class not implements required interfaces", - PluggableJVM.LOG_ERROR); - m_jvm.trace(e, PluggableJVM.LOG_ERROR); - throw e; - } - catch (MalformedURLException e) - { - m_jvm.trace("Oops, can't create URLs from\"" - +classpath+"\"", PluggableJVM.LOG_ERROR); - throw e; - } - catch (ClassNotFoundException e) - { - m_jvm.trace("Oops, can't find class \"" - +classname+"\"", PluggableJVM.LOG_ERROR); - throw e; - } - catch (NoSuchMethodException e) - { - m_jvm.trace("No start method in class "+classname, - PluggableJVM.LOG_ERROR); - throw e; - } - //PluggableJVM.trace("+++++++ Extension inited"); - inited = true; - } - - public void setID(int id) - { - if (m_id != 0) return; - if (factory != null) factory.setID(id); - m_id = id; - } - public int getID() - { - return m_id; - } - - public String getCID() - { - return m_cid; - } - - public int getVersion() - { - return m_version; - } - - public HostObjectPeer instantiate(SecurityCaps caps, int version) - { - if (!inited) - return null; - return factory.create(version); - } - - public int decide(CallingContext ctx, String principal, int cap_no) - { - if (decider == null) return NA; - return decider.decide(ctx, principal, cap_no); - } - - public boolean belongs(int cap_no) - { - if (decider == null) return false; - return decider.belongs(cap_no); - } - - - protected URL[] getURLs(String classpath) - throws MalformedURLException - { - int i, pos, count; - URL url; - if (classpath == null || "".equals(classpath)) return new URL[]{}; - Vector v = new Vector(); - pos = count = 0; - do - { - count++; - i = classpath.indexOf("|", pos); - if (i == -1) - url = new URL(classpath.substring(pos)); - else - url = new URL(classpath.substring(pos, i)); - //m_jvm.trace("adding URL: "+ url, PluggableJVM.LOG_DEBUG); - v.add(url); - pos = i+1; - } - while (i > -1); - - URL[] urls = (URL[])(v.toArray(new URL[v.size()])); - return urls; - } - - public HostObjectPeerFactory getFactory() - { - return factory; - } - - public String toString() - { - StringBuffer buf = new StringBuffer(); - buf.append("Waterfall extension: "); - buf.append("classpath=\""+m_classpath+"\" classname="+m_classname+"\n"); - buf.append("cid="+m_cid+" version="+m_version); - if (factory != null) buf.append(" factory=" + factory.toString()); - return buf.toString(); - } - - protected String getDefaultClassPath() - { - StringBuffer sb = new StringBuffer(); - String wfHome = System.getProperty("jvmp.home"); - File dir = new File(wfHome, "ext"); - if (dir == null || !dir.isDirectory()) return ""; - File[] comps = dir.listFiles(); - if (comps == null) return ""; - try { - for (int i=0; i - */ - -package sun.jvmp.generic; - -import sun.jvmp.*; - -public abstract class GenericSynchroObject extends SynchroObject -{ - protected long m_handle = 0; - protected boolean m_state = false; - - public void _lock() - { - int res; - if (!m_state) - throw new IllegalMonitorStateException("Invalid object state"); - if ((res = doLock(m_handle)) != 0) - throw new IllegalMonitorStateException("Invalid native state: err=" - +res); - } - - public void _unlock() - { - int res; - if (!m_state) - throw new IllegalMonitorStateException("Invalid object state"); - if ((res=doUnlock(m_handle)) != 0) - throw new IllegalMonitorStateException("Invalid native state: err=" - +res); - } - - public void _wait(int milli) throws InterruptedException - { - int res; - if (!m_state) - throw new IllegalMonitorStateException("Invalid object state"); - if ((res = doWait(m_handle, milli)) < -1) - throw new IllegalMonitorStateException("Invalid native state: err=" - +res); - if (res == -1) throw new InterruptedException("Native wait() interrupted"); - } - - public void _notify() - { - int res; - if (!m_state) - throw new IllegalMonitorStateException("Invalid object state"); - if ((res=doNotify(m_handle)) != 0) - throw new IllegalMonitorStateException("Invalid native state: err=" - +res); - } - - public void _notifyAll() - { - int res; - if (!m_state) - throw new IllegalMonitorStateException("Invalid object state"); - if ((res=doNotifyAll(m_handle)) != 0) - throw new IllegalMonitorStateException("Invalid native state: err=" - +res); - } - - public void _destroy() - { - int res; - if (!m_state) - throw new IllegalMonitorStateException("Invalid object state"); - if ((res=doDestroy(m_handle)) != 0) - throw new IllegalMonitorStateException("Invalid native state: err=" - +res); - } - - protected abstract int checkHandle(long handle); - protected abstract int doLock(long handle); - protected abstract int doUnlock(long handle); - protected abstract int doWait(long handle, int milli); - protected abstract int doNotify(long handle); - protected abstract int doNotifyAll(long handle); - protected abstract int doDestroy(long handle); -}; diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/generic/motif/Plugin.java b/mozilla/java/waterfall/wf/java/sun/jvmp/generic/motif/Plugin.java deleted file mode 100644 index 38c5562f714..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/generic/motif/Plugin.java +++ /dev/null @@ -1,124 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: Plugin.java,v 1.1.1.1 2001-05-09 17:29:58 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -// XXX: this class depends on sun.awt.* -package sun.jvmp.generic.motif; - -import sun.jvmp.*; -import java.awt.*; - -public class Plugin extends PluggableJVM -{ - static Plugin real_instance = null; - - protected Plugin() - { - super(); - instance = this; - }; - - - protected static PluggableJVM startJVM(String codebase, int debug) - { - debugLevel = debug; - - // for now, only one instance of JVM is allowed - can be fixed easily - if (real_instance == null) - { - - real_instance = new Plugin(); - // don't do nothing until init is complete - real_instance.init(codebase, true); - real_instance.start(); - }; - return real_instance; - }; - - protected NativeFrame SysRegisterWindow(int handle, - int width, int height) - { - NativeFrame nf; - if (!initedNative) - { - loadLibrary(); - } - long widget = getWidget(handle, width, height, 0, 0); - Frame f = createEmbeddedFrame(widget); - if (f == null) - { - trace("Creation of frame failed", LOG_ERROR); - return null; - } - f.setBounds(0, 0, width, height); - f.setResizable(false); - nf = new NativeFrame(f); - return nf; - } - - protected NativeFrame SysUnregisterWindow(int id) - { - NativeFrame nf = (NativeFrame)nativeFrames.get(id); - if (nf == null) return null; - Frame f = nf.getFrame(); - f.removeAll(); - f.removeNotify(); - return nf; - }; - - protected SynchroObject SysRegisterMonitorObject(long handle) - { - SynchroObject so = null; - try { - so = new PthreadSynchroObject(handle); - } catch (Exception e) { - trace("SysRegisterMonitorObject failed: "+e, LOG_ERROR); - return null; - } - return so; - } - - protected SynchroObject SysUnregisterMonitorObject(int id) - { - SynchroObject so = getSynchroObjectWithID(id); - if (so == null) return null; - so._destroy(); - return so; - } - - /* - this is a separate method as MEmbeddedFrame constructor arguments - differs in 1.1 and 1.2. - and maybe we should use reflection (like original plugin) - to call proper constructor - */ - private Frame createEmbeddedFrame(long widget) - { - return new sun.awt.motif.MEmbeddedFrame(widget); - }; - - static private native long getWidget(int winid, int width, - int height, int x, int y); -}; diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/generic/motif/PthreadSynchroObject.java b/mozilla/java/waterfall/wf/java/sun/jvmp/generic/motif/PthreadSynchroObject.java deleted file mode 100644 index 2525b23a1f8..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/generic/motif/PthreadSynchroObject.java +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: PthreadSynchroObject.java,v 1.1.1.1 2001-05-09 17:29:58 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.generic.motif; - -import sun.jvmp.generic.GenericSynchroObject; - -public class PthreadSynchroObject extends GenericSynchroObject -{ - public PthreadSynchroObject(long handle) throws IllegalArgumentException - { - m_handle = handle; - if (checkHandle(handle) != 0) - throw new IllegalArgumentException("Invalid handle passed to constructor"); - m_state = true; - } - protected native int checkHandle(long handle); - protected native int doLock(long handle); - protected native int doUnlock(long handle); - protected native int doWait(long handle, int milli); - protected native int doNotify(long handle); - protected native int doNotifyAll(long handle); - protected native int doDestroy(long handle); -}; diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/generic/win32/Plugin.java b/mozilla/java/waterfall/wf/java/sun/jvmp/generic/win32/Plugin.java deleted file mode 100644 index a50fd852c07..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/generic/win32/Plugin.java +++ /dev/null @@ -1,114 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: Plugin.java,v 1.1.1.1 2001-05-09 17:29:58 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.generic.win32; - -import sun.jvmp.*; -import java.awt.*; - - -public class Plugin extends PluggableJVM -{ - static Plugin real_instance = null; - - protected Plugin() - { - super(); - instance = this; - }; - - - protected static PluggableJVM startJVM(String codebase, int debug) - { - debugLevel = debug; - // for now, only one instance of JVM is allowed - can be fixed easily - if (real_instance == null) - { - - real_instance = new Plugin(); - // don't do nothing until init is complete - real_instance.init(codebase, false); - real_instance.start(); - }; - return real_instance; - }; - - protected NativeFrame SysRegisterWindow(int handle, - int width, int height) - { - NativeFrame nf; - - Frame frame = createEmbeddedFrame(handle); - if (frame == null) - { - trace("Creation of frame failed", LOG_ERROR); - return null; - }; - frame.setBounds(0, 0, width, height); - frame.setResizable(false); - nf = new NativeFrame(frame); - return nf; - } - - protected NativeFrame SysUnregisterWindow(int id) - { - NativeFrame nf = (NativeFrame)nativeFrames.get(id); - if (nf == null) return null; - Frame f = nf.getFrame(); - // XXX: hacky, but Win32 impl really throws exception here - try { - f.removeAll(); - f.removeNotify(); - } catch (Exception e){ - trace(e, LOG_DEBUG); - } - return nf; - }; - - protected SynchroObject SysRegisterMonitorObject(long handle) - { - return null; - } - - protected SynchroObject SysUnregisterMonitorObject(int id) - { - return null; - } - - /* - this is a separate method as MEmbeddedFrame constructor arguments - differs in 1.1 and 1.2. - and maybe we should use reflection (like original plugin) - to call proper constructor - */ - private Frame createEmbeddedFrame(int handle) - { - return new sun.awt.windows.WEmbeddedFrame(handle); - }; - -}; - - diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ActivatorAppletContext.java b/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ActivatorAppletContext.java deleted file mode 100644 index 6d17988c58e..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ActivatorAppletContext.java +++ /dev/null @@ -1,223 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: ActivatorAppletContext.java,v 1.1.1.1 2001-05-09 17:29:58 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.jpav; - -import sun.jvmp.applet.*; -import java.applet.*; -import java.util.*; -import sun.applet.*; -import java.awt.*; -import java.net.*; -import java.io.*; -import java.lang.reflect.*; -import sun.misc.Ref; - -public abstract class ActivatorAppletContext implements AppletContext -{ - - /* - * Get an audio clip. - * - * @param url url of the desired audio clip - */ - public AudioClip getAudioClip(URL url) { - System.getSecurityManager().checkConnect(url.getHost(), url.getPort()); - synchronized (audioClips) { - AudioClip clip = (AudioClip)audioClips.get(url); - if (clip == null) { - clip = new AppletAudioClip(url); - audioClips.put(url, clip); - } - return clip; - } - } - - /* - * Get an image. - * - * @param url of the desired image - */ - public Image getImage(URL url) { - //sun.jvmp.PluggableJVM.trace("Ask for image: "+url); - return getCachedImage(url); - } - - static Image getCachedImage(URL url) { - System.getSecurityManager().checkConnect(url.getHost(), url.getPort()); - return (Image)getCachedImageRef(url).get(); - } - - /** - * Get an image ref. - */ - static Ref getCachedImageRef(URL url) { - synchronized (imageRefs) { - AppletImageRef ref = (AppletImageRef)imageRefs.get(url); - if (ref == null) { - ref = new AppletImageRef(url); - imageRefs.put(url, ref); - } - return ref; - } - } - - - /** - * Get an applet by name. - */ - public Applet getApplet(String name) { - name = name.toLowerCase(); - for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) { - AppletPanel p = (AppletPanel)e.nextElement(); - String param = p.getParameter("name"); - if (param != null) { - param = param.toLowerCase(); - } - if (name.equals(param) && - p.getDocumentBase().equals(appletPanel.getDocumentBase())) { - try { - if (checkConnect(appletPanel.getCodeBase().getHost(), - p.getCodeBase().getHost())==false) - return null; - } catch (InvocationTargetException ee) { - showStatus(ee.getTargetException().getMessage()); - return null; - } catch (Exception ee) { - showStatus(ee.getMessage()); - return null; - } - return p.getApplet(); - } - } - return null; - } - - /** - * Return an enumeration of all the accessible - * applets on this page. - */ - public Enumeration getApplets() { - Vector v = new Vector(); - for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) { - AppletPanel p = (AppletPanel)e.nextElement(); - if (p.getDocumentBase().equals(appletPanel.getDocumentBase())) { - try { - checkConnect(appletPanel.getCodeBase().getHost(), - p.getCodeBase().getHost()); - v.addElement(p.getApplet()); - } catch (InvocationTargetException ee) { - showStatus(ee.getTargetException().getMessage()); - } catch (Exception ee) { - showStatus(ee.getMessage()); - } - } - } - return v.elements(); - } - - /* - *

- * Check that a particular applet is authorized to connect to - * the target applet. - * This code is JDK 1.1 and 1.2 dependent - *

- * - * @param source Source applet host name requesting the connect - * @param target Target applet host name to connect to - * - * @return true if the connection is granted - */ - private boolean checkConnect(String sourceHostName, String targetHostName) - throws SecurityException, InvocationTargetException, Exception - { - SocketPermission panelSp = - new SocketPermission(sourceHostName, - "connect"); - SocketPermission sp = - new SocketPermission(targetHostName, - "connect"); - if (panelSp.implies(sp)) { - return true; - } - return false; - } - - /* - * Replaces the Web page currently being viewed with the given URL - * - * @param url the address to transfer to - */ - abstract public void showDocument(URL url); - - /* - * Requests that the browser or applet viewer show the Web page - * indicated by the url argument. - * - * @param url the address to transfer to - * @param target One of the value - * "_self" show in the current frame - * "_parent"show in the parent frame - * "_top" show in the topmost frame - * "_blank" show in a new unnamed top-level windownameshow in a - * new top-level window named name - */ - abstract public void showDocument(URL url, String target); - - /* - * Show status. - * - * @param status status message - */ - abstract public void showStatus(String status); - - /* - * Add a applet in this applet context - * - * @param applet the applet to add - */ - void addAppletInContext(AppletPanel appletPanel) { - this.appletPanel = appletPanel; - appletPanels.addElement(appletPanel); - } - - /* - * Remove applet from this applet context - * - * @param applet applet to remove - */ - void removeAppletFromContext(AppletPanel applet) { - appletPanels.removeElement(applet); - } - - private AppletPanel appletPanel; - - private static Vector appletPanels = new Vector(); - - private static Hashtable audioClips = new Hashtable(); - private static Hashtable imageRefs = new Hashtable(); -} - diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ActivatorAppletPanel.java b/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ActivatorAppletPanel.java deleted file mode 100644 index 79d913c3e17..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ActivatorAppletPanel.java +++ /dev/null @@ -1,737 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: ActivatorAppletPanel.java,v 1.1.1.1 2001-05-09 17:29:59 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.jpav; -import java.applet.*; -import java.io.*; -import sun.applet.*; -import java.net.URL; -import java.net.MalformedURLException; -import java.util.*; -import java.awt.*; -import sun.jvmp.*; -import sun.jvmp.applet.*; -import java.lang.reflect.*; - -public class ActivatorAppletPanel extends AppletPanel implements ProxyType -{ - - // Network Access Level - public static final int NETWORK_ACCESS_NONE = 0; - public static final int NETWORK_ACCESS_HOST = 1; - public static final int NETWORK_ACCESS_UNRESTRICTED = 2; - - PluggableJVM m_jvm; - - /* - * are we initialized - */ - public static boolean javaEnabled = true; - private boolean inited = false; - - /** - * Some constants... - */ - private static String propertiesFileName = "properties"; - - /** - * Look here for the properties file - */ - public static File theUserPropertiesFile; - public static File theAppletViewerPropsFile; - - URL documentURL = null; - URL baseURL = null; - Frame m_f = null; - private int width; - private int height; - - private static AppletMessageHandler amh = - new AppletMessageHandler("appletpanel"); - - // Parameters handler - protected java.util.Hashtable atts; - - // Localization strings. - private static ResourceBundle rb; - - // JAR files that have not yet been loaded. - private String cookedJars; - - public static void loadPropertiesFiles() { - - String sep = File.separator; - theUserPropertiesFile = new File(System.getProperty("user.home") + - sep + ".java" + - sep + propertiesFileName); - // ensure the props folder can be made - new File(theUserPropertiesFile.getParent()).mkdirs(); - theAppletViewerPropsFile = new File(System.getProperty("java.home") + - sep + "lib" + - sep + "appletviewer.properties"); - } - - - private class Initer extends Thread { - ActivatorAppletPanel that; - - Initer(ActivatorAppletPanel that) { - super(Thread.currentThread().getThreadGroup(), "IniterThread"); - this.that = that; - } - - /** - * Main body of thread. Call init on our AppletViewer. - */ - public void run() { - init_run_wrapper(); // To identify this thread's stack - } - - private void init_run_wrapper() - { - m_jvm.trace("real Init()", PluggableJVM.LOG_DEBUG); - that.init(); - that.sendEvent(sun.applet.AppletPanel.APPLET_INIT); - that.sendEvent(sun.applet.AppletPanel.APPLET_START); - } - } - - /** - * Construct a new applet viewer. - * Restricted to subclasses for security reasons, - * - * @param appletContext the AppletContext to use - */ - public ActivatorAppletPanel(PluggableJVM jvm, - WFAppletContext appletContext, - Hashtable atts) { - if (appletContext == null) - throw new IllegalArgumentException("AppletContext"); - this.appletContext = appletContext; - appletContext.addAppletInContext(this); - this.atts = atts; - m_jvm = jvm; - } - - public void sendEvent(int id) { - super.sendEvent(id); - } - - /** - * Init the applet, called once to start the download of the applet - */ - public void init() { - ClassLoaderInfo cli = ClassLoaderInfo.find(this); - cli.addReference(); - synchronized(AppletViewer.class) { - super.init(); - } - sendEvent(sun.applet.AppletPanel.APPLET_LOAD); - //sendEvent(sun.applet.AppletPanel.APPLET_INIT); - } - - /** - * Start the applet. - */ - public void appletStart() { - if (inited) - sendEvent(sun.applet.AppletPanel.APPLET_START); - } - - /** - * Stop the applet. - */ - public void appletStop() { - sendEvent(sun.applet.AppletPanel.APPLET_STOP); - } - - public int getLoadingStatus() - { - return status; - } - - /** - * Notification that the applet is being closed - * - * @param timeOut max time we are waiting for the applet to die - * in milliseconds. - */ - public void onClose(final int timeOut) { - - // Just make sure we are destroying the thread from a utility - // thread to not block the main thread for that. - - Runnable work = new Runnable() { - public void run() { - onPrivateClose(timeOut); - } - }; - Thread closingThread = new Thread(work); - closingThread.start(); - } - - /** - * Notification that the applet is being closed - * - * @param timeOut max time we are waiting for the applet to die - * in milliseconds. - */ - protected void onPrivateClose(int timeOut) { - appletContext.removeAppletFromContext(this); - if (status==APPLET_LOAD) { - stopLoading(); - } - sendEvent(APPLET_STOP); - sendEvent(APPLET_DESTROY); - sendEvent(APPLET_DISPOSE); - sendEvent(APPLET_QUIT); - ClassLoaderInfo cli = ClassLoaderInfo.find(this); - cli.removeReference(); - } - - /** - * Initialized the properties for this AppletViewer like the Applet - * codebase and document base. - */ - protected void initProperties() { - String att = getParameter("java_codebase"); - if (att == null) - att = getParameter("codebase"); - if (att != null) { - if (!att.endsWith("/")) { - att += "/"; - } - try { - baseURL = new URL(documentURL, att); - } catch (MalformedURLException e) { - } - } - if (baseURL == null) { - String file = documentURL.getFile(); - int i = file.lastIndexOf('/'); - if (i > 0 && i < file.length() - 1) { - try { - baseURL = new URL(documentURL, file.substring(0, i + 1)); - } catch (MalformedURLException e) { - } - } - } - - // when all is said & done, baseURL shouldn't be null - if (baseURL == null) - baseURL = documentURL; - } - - /** - * Get an applet parameter. - */ - public String getParameter(String name) { - name = name.toLowerCase(); - if (atts.get(name) != null) { - return (String) atts.get(name); - } else { - String value=null; - try { - value = getParameterFromHTML(name); - } catch (Throwable e) { - m_jvm.trace(e, PluggableJVM.LOG_WARNING); - } - if (value != null) - atts.put(name.toLowerCase(), value); - return value; - } - } - - - /** - * Get applet's parameters. - */ - public Hashtable getParameters() - { - return (Hashtable) atts.clone(); - } - - - /** - * Method to retrieve the parameter from the HTML tags - * - * @param name the parameter name - * - * @return the parameter value, null if undefined - */ - protected String getParameterFromHTML(String name) - { - return null; - } - - /** - * Set an applet parameter. - */ - public void setParameter(String name, Object value) { - name = name.toLowerCase(); - atts.put(name, value.toString()); - } - - /** - * Get the document url. - */ - public URL getDocumentBase() { - return documentURL; - - } - - public void setWindow(Frame f) - { - if (f == null) - { - m_jvm.trace("Got zero Frame for SetWindow", - PluggableJVM.LOG_ERROR); - return; - } - f.setLayout(null); - Applet a = getApplet(); - if (a == null) { - try { - int wd = Integer.parseInt(getParameter("width")); - int ht = Integer.parseInt(getParameter("height")); - this.width = wd; - this.height = ht; - } catch (NumberFormatException e) { - // Try and maintain consistency between the parameters and - // our width/height. If the parameters are not properly - // set to be integers, then reset them to our w, h - setParameter("width", new Integer(width)); - setParameter("height", new Integer(height)); - this.width = width; - this.height = height; - } - } else { - // The applet exists, so resize it and its frame, and - // have the width/height parameters reflect these values - setParameter("width", new Integer(width)); - setParameter("height", new Integer(height)); - this.width = width; - this.height = height; - - setSize(width, height); - a.resize(width, height); - a.setVisible(true); - } - setBounds(0, 0, width, height); - if (m_f == f) return; - m_f = f; - f.add(this); - f.show(); - f.setBounds(0, 0, width, height); - maybeInit(); - } - - private void maybeInit() { - m_jvm.trace("maybeInit()", PluggableJVM.LOG_DEBUG); - if (!inited && m_f != null && getDocumentBase() != null) - { - inited = true; - Initer initer = new Initer(this); - initer.start(); - } - } - - /** - * Set the document url. - * This must be done early, before initProperties is called. - */ - public void setDocumentBase(URL url) - { - documentURL = url; - initProperties(); - // If the window has already been set, we can init the applet. - maybeInit(); - } - - /** - * Get the base url. - */ - public URL getCodeBase() { - return baseURL; - } - /** - * Get the width. - */ - public int getWidth() { - String w = getParameter("width"); - if (w != null) { - return Integer.valueOf(w).intValue(); - } - return 0; - } - - /** - * Get the height. - */ - public int getHeight() { - String h = getParameter("height"); - if (h != null) { - return Integer.valueOf(h).intValue(); - } - return 0; - } - - /** - * Get the code parameter - */ - public String getCode() { - - // Support HTML 4.0 style of OBJECT tag. - // - // - // - // - // - // In this case, the CODE will be inside the classid - // attribute. - // - String moniker = getParameter("classid"); - String code = null; - - if (moniker != null) - { - int index = moniker.indexOf("java:"); - - if (index > -1) - { - code = moniker.substring(5 + index); - - if (code != null || !code.equals("")) - return code; - } - } - - code = getParameter("java_code"); - if (code==null) - code=getParameter("code"); - return code; - } - - /** - * Return the list of jar files if specified. - * Otherwise return null. - */ - public String getJarFiles() { - return cookedJars; - } - - - /* - * Allow pre-loading of local .jar files in plug-in lib/app directory - * These .jar files are loaded with the PluginClassLoader so they - * run in the applet's sandbox thereby saving developers the trouble - * of writing trusted support classes. - * The ClassLoaderInfo cli should be locked. - */ - protected Vector getLocalJarFiles() { - - String fSep = File.separator; - String libJarPath = - System.getProperty("java.home") + fSep + "lib"; - - String appJarPath = libJarPath + fSep + "applet"; - return(getJarFilesFromPath(appJarPath)); - - } - - - private Vector getJarFilesFromPath (String basePath) { - File dir = new File(basePath); - if (!dir.exists()) { - return(null); - } - - String[] jarList = dir.list(new FilenameFilter() { - public boolean accept(File f, String s) { - return(s.endsWith(".jar")); - } - }); - - Vector jars = new Vector(); - - String fSep = File.separator; - for (int i = 0; i < jarList.length; i++) { - String fullJarPath = basePath + fSep + jarList[i]; - jars.add(new File(fullJarPath)); - } - - return(jars); - } - - - - /** - * Return the value of the object param - */ - public String getSerializedObject() { - String object = getParameter("java_object"); - if (object==null) - object=getParameter("object");// another name? - return object; - } - -/** - * Get the applet context. For now this is - * also implemented by the AppletPanel class. - */ - public AppletContext getAppletContext() - { - return appletContext; - } - - public Object getViewedObject() - { - Applet applet = super.getApplet(); - return applet; - } - - - /** - * Paint this panel while visible and loading an applet to entertain - * the user. - * - * @param g the graphics context - */ - public void paint(Graphics g) - { - if (getViewedObject() == null && g != null) { - setBackground(Color.lightGray); - g.setColor(Color.black); - Dimension d = getSize(); - Font fontOld = g.getFont(); - FontMetrics fm = null; - if (fontOld != null) - fm = g.getFontMetrics(fontOld); - String str = getWaitingMessage(); - - // Display message on the screen if the applet is not started yet. - if (d != null && fm != null) - g.drawString(str, (d.width - fm.stringWidth(str))/ 2, - (d.height + fm.getAscent())/ 2); - } - } - - public String getWaitingMessage() { - return "loading applet..."; - //return getMessage("loading") + getHandledType() + " ..."; - } - - /* - *

- * Load an applet from a serialized stream. This is likely to happen - * when the user uses the Back/Forward buttons - *

- * - * @param is Input stream of the serialized applet - */ - protected void load(java.io.InputStream is) { - this.is = is; - } - - - /* - * @return the applet name - */ - public String getName() { - - String name = getParameter("name"); - if (name!=null) - return name; - - // Remove .class extension - name = getCode(); - if (name != null){ - int index = name.lastIndexOf(".class"); - if (index != -1) - name = name.substring(0, index); - } else{ - // Remove .object extension - name = getSerializedObject(); - - if (name != null) { - int index = name.lastIndexOf(".ser"); - if (index != -1) - name = name.substring(0, index); - } - } - - return name; - } - - - /** - * @return the java component displayed by this viewer class - */ - protected String getHandledType() { - return getMessage("java_applet"); - } - - public void setStatus(int status) { - this.status = status; - } - - public void showActivatorAppletStatus(String msg) { - showAppletStatus(msg); - } - - public void showActivatorAppletLog(String msg) { - showAppletLog(msg); - } - - public void setDoInit(boolean doInit) { - this.doInit = doInit; - } - - private WFAppletContext appletContext; - - - /** - * Method to get an internationalized string from the Activator resource. - */ - public static String getMessage(String key) { - return key; - } - - - /** - * Method to get an internationalized string from the Activator resource. - */ - public static String[] getMessageArray(String key) { - return new String[] { key }; - } - - private java.io.InputStream is; - - /** - * This method actually creates an AppletClassLoader. - * - * It can be override by subclasses (such as the Plug-in) - * to provide different classloaders. This method should be - * called only when running inside JDK 1.2. - */ - protected AppletClassLoader createClassLoader(final URL codebase) { - return new ActivatorClassLoader(codebase); - } - - /* - * We overload our parent loadJarFiles so tht we can avoid - * reloading JAR files that are already loaded. - * KGH Mar 98 - */ - protected void loadJarFiles(AppletClassLoader loader) - throws IOException, InterruptedException - { - - - // Cache option as read from the Html page tag - String copt; - - // Cache Archive value as read from the Html page tag - String carch; - - // Cache Version value as read from the Html page tag - String cver; - - // Vector to store the names of the jar files to be cached - Vector jname = new Vector(); - - // Vector to store actual version numbers - Vector jVersion = new Vector(); - - - // Figure out the list of all required JARs. - String raw = getParameter("java_archive"); - if (raw == null) - { - raw = getParameter("archive"); - } - - - ClassLoaderInfo cli = ClassLoaderInfo.find(this); - - try - { - // Prevent two applets trying to load JARS from the same - // classloader at the same time. - cli.lock(); - - // If there are no JARs, this is easy. - if (raw == null) - { - return; - } - - // Figure out which JAR files still need to be loaded. - String cooked = ""; - StringTokenizer st = new StringTokenizer(raw, ",", false); - while(st.hasMoreTokens()) - { - String tok = st.nextToken().trim(); - if (cli.hasJar(tok)) - { - continue; - } - - cli.addJar(tok); - - if (cooked.equals("")) - { - cooked = tok; - } - else - { - cooked = cooked + "," + tok; - } - } - - cookedJars = cooked; - - // Now call into our superlcass to do the actual JAR loading. - // It will call back to our getJarFiles method to find which - // JARs need to be loaded, and we will give it the cooked list. - super.loadJarFiles(loader); - - } - finally - { - // Other people can load JARs now. - cli.unlock(); - } - } - - -}; - - - - - - diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ActivatorClassLoader.java b/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ActivatorClassLoader.java deleted file mode 100644 index c4746b5cd2d..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ActivatorClassLoader.java +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: ActivatorClassLoader.java,v 1.1.1.1 2001-05-09 17:29:59 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.jpav; - -import java.net.URL; - -public class ActivatorClassLoader extends sun.jvmp.applet.WFAppletClassLoader -{ - private URL base; - public ActivatorClassLoader(URL base) { - super(base); - this.base = base; - } -}; diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ActivatorProxyHandler.java b/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ActivatorProxyHandler.java deleted file mode 100644 index 152e58037c6..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ActivatorProxyHandler.java +++ /dev/null @@ -1,398 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: ActivatorProxyHandler.java,v 1.1.1.1 2001-05-09 17:29:59 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.jpav; - -import java.net.URL; -import java.util.HashMap; -import java.util.StringTokenizer; -import sun.jvmp.*; -import sun.jvmp.applet.*; - - -public class ActivatorProxyHandler implements ProxyHandler, ProxyType { - - private int proxyType = PROXY_TYPE_NO_PROXY; - - /* proxyList contains all the proxy information in the form of - * "http=webcache1-cup:8080;ftp=webcache2-cup;gopher=javaweb:9090". Proxy - * information for a particular protocol is seperated by ';'. If a port - * number is specified, it is specified by using ':' following the proxy - * host. If a specified protocol is not specified in the list, no proxy - * is assumed. There is another form of this string which is "webcache-cup:8080". - * In this case, it means all protocol will use this proxy (Apply-all). - * Notice that no '=' is in the string in this case. - */ - private String proxyList = null; - - /* proxyOverride contains all the domain which no proxy should be used when - * a connection is made. For example, "a.eng,b.eng,c.*.eng". In this case, - * if the host name is a.eng, b.eng, or c.c.eng, no proxy is used. Otherwise, - * proxy information will be returned according to the protocol in the URL. - * Note that wildcard can be used. If all local address should be bypassed, - * a special string '' is used. - */ - private String proxyOverride = null; - - /** - *

Proxy info cache. - *

- */ - private HashMap proxyTable = null; - - private BrowserSupport support = null; - - public ActivatorProxyHandler(int proxyType, - String proxyList, - String proxyOverride, - BrowserSupport sup) - { - this.proxyType = proxyType; - this.proxyList = proxyList; - this.proxyOverride = proxyOverride; - this.support = sup; - proxyTable = new HashMap(); - } - - - /* getProxyInfo is a function which takes a proxy-info-list, a - * proxy-bypass-list, a URL, and returns the corresponding proxy information - * with respect to the given URL. - * - * parameters : - * u [in] a string which contains all the proxy information - * - * out: - * ProxyInfo [out] ProxyInfo contains the corresponding proxy result. - * - */ - public synchronized ProxyInfo getProxyInfo(URL u) - { - ProxyInfo pinfo = null; - - try { - pinfo = (ProxyInfo) proxyTable.get(u.getProtocol() - + u.getHost() - + u.getPort()); - - // XXX: is it OK? - if (pinfo != null) - return pinfo; - - if (proxyType == PROXY_TYPE_NO_PROXY || - (proxyType == PROXY_TYPE_MANUAL && isProxyBypass(proxyOverride, u))) - // Check if it is direct connect - pinfo = new ProxyInfo(null, -1); - else if (proxyType == PROXY_TYPE_MANUAL) - { - String socksInfo = null; - - // Extract info about SOCKS - int i = proxyList.indexOf("socks="); - if (i != -1) - { - int j = proxyList.indexOf(";", i); - if (j == -1) - socksInfo = proxyList.substring(i + 6); - else - socksInfo = proxyList.substring(i + 6, j); - } - - - if (proxyList.indexOf("=") == -1) - { - // Apply all option - pinfo = new ProxyInfo(proxyList); - } - else - { - // Parse proxy list - String protocol = u.getProtocol(); - - i = proxyList.indexOf(protocol + "="); - if (i == -1) - // Cannot find the protocol proxy - pinfo = new ProxyInfo(null, socksInfo); - else - { - int j = proxyList.indexOf(";", i); - - if (j == -1) { - pinfo = new ProxyInfo(proxyList.substring(i + protocol.length() + 1), socksInfo); - } - else { - pinfo = new ProxyInfo(proxyList.substring(i + protocol.length() + 1, j), socksInfo); - } - } - } - } - else - { - if (support == null) - pinfo = null; - else - pinfo = support.getProxyInfoForURL(u); - } - - proxyTable.put(u.getProtocol() + u.getHost() + u.getPort(), pinfo); - } - catch (Exception e) { - PluggableJVM.trace("Proxy is not configured", - PluggableJVM.LOG_ERROR); - PluggableJVM.trace(e, PluggableJVM.LOG_ERROR); - pinfo = new ProxyInfo(null, -1); - } - - return pinfo; - } - - - /* isProxyBypass is a function which takes a proxy override list and a URL - * , and returns true if the hostname matches the proxy override list; - * otherwise, false is returned. - * - * parameters : - * proxyOverride [in] a string which contains the proxy override list - * u [in] a URL which contains the hostname - * - * out: - * boolean [out] if the proxy override list matches the hostname, - * true is returned. Otherwise, false is returned. - * - * Notes: i) proxyOverride contains all the domain which no proxy should be - * used when a connection is made. For example, "a.eng,b.eng,c.*.eng". - * In this case, if the host name is a.eng, b.eng, or c.c.eng, no - * proxy is used. Otherwise, proxy information will be returned - * according to the protocol in the URL. Note that wildcard can be - * used. If all local address should be bypassed, a special string - * '' is used. - * - */ - private boolean isProxyBypass(String proxyOverride, URL u) - { - if (proxyOverride == null || proxyOverride.equals("")) - return false; - - String host = u.getHost(); - - // Extract proxy-override list - StringTokenizer st = new StringTokenizer(proxyOverride, ",", false); - while (st.hasMoreTokens()) - { - String pattern = st.nextToken(); - - if (pattern.equals("") && host.indexOf(".") == -1) - return true; - else if (shExpMatch(host, pattern)) - return true; - } - - return false; - } - - - /* shExpMatch is a function which takes a string and a pattern, and returns - * true if the string matches the pattern; otherwise, false is returned. - * - * parameters : - * str [in] a string which is used for pattern matching - * shexp [in] a string which contains the pattern - * - * out: - * boolean [out] if the string match the pattern, true is returned. - * otherwise, false is returned. - * - * Notes: i) shexp contains the pattern which may include the wildcard '*'. - * ii) The pattern matching is case-insensitive. - * - */ - private boolean shExpMatch(String str, String shexp) - { - try { - // Convert the string to lower case - str = str.toLowerCase(); - shexp = shexp.toLowerCase(); - - return shExpMatch2(str, shexp); - } catch (Throwable e) { - - // Error recovery - PluggableJVM.trace(e, PluggableJVM.LOG_WARNING); - return false; - } - } - - /* shExpMatch2 is a function which takes a string and a pattern, and returns - * true if the string matches the pattern; otherwise, false is returned. - * - * parameters : - * str [in] a string which is used for pattern matching - * shexp [in] a string which contains the pattern - * - * out: - * boolean [out] if the string match the pattern, true is returned. - * otherwise, false is returned. - * - * Notes: i) shexp contains the pattern which may include the wildcard '*'. - * - * ii) This is the actual implementation of the pattern matching - * algorithm. - * - */ - private boolean shExpMatch2(String str, String shexp) - { - // NULL is not a valid input. - // - if (str == null || shexp == null) - return false; - - if (shexp.equals("*")) - return true; - - // Check the position of the wildcard - int index = shexp.indexOf('*'); - - if (index == -1) - { - // No wildcard anymore - return str.equals(shexp); - } - else if (index == 0) - { - // Wildcard at the beginning of the pattern - - for (int i=0; i <= str.length(); i++) - { - // Loop through the string to see if anything match. - if (shExpMatch2(str.substring(i), shexp.substring(1))) - return true; - } - - return false; - } - else - { - // index > 0 - String sub = null, sub2 = null; - - sub = shexp.substring(0, index); - - if (index <= str.length()) - sub2 = str.substring(0, index); - - if (sub != null && sub2 != null && sub.equals(sub2)) - return shExpMatch2(str.substring(index), shexp.substring(index)); - else - return false; - } - } - - /* extractAutoProxySetting is a function which takes a proxy-info-string - * which returned from the JavaScript function FindProxyForURL, and returns - * the corresponding proxy information. - * - * parameters : - * s [in] a string which contains all the proxy information - * - * out: - * ProxyInfo [out] ProxyInfo contains the corresponding proxy result. - * - * Notes: i) s contains all the proxy information in the form of - * "PROXY webcache1-cup:8080;SOCKS webcache2-cup". There are three - * possible values inside the string: - * a) "DIRECT" -- no proxy is used. - * b) "PROXY" -- Proxy is used. - * c) "SOCKS" -- SOCKS support is used. - * Information for each proxy settings are seperated by ';'. If a - * port number is specified, it is specified by using ':' following - * the proxy host. - * - */ - private ProxyInfo extractAutoProxySetting(String s) - { - if (s != null) - { - StringTokenizer st = new StringTokenizer(s, ";", false); - if (st.hasMoreTokens()) - { - String pattern = st.nextToken(); - - int i = pattern.indexOf("PROXY"); - - if (i != -1) { - // "PROXY" is specified - return new ProxyInfo(pattern.substring(i + 6)); - } - - i = pattern.indexOf("SOCKS"); - - if (i != -1) - { - // "SOCKS" is specified - return new ProxyInfo(null, pattern.substring(i + 6)); - } - } - } - - // proxy string contains 'DIRECT' or unrecognized text - return new ProxyInfo(null, -1); - } - - // The current default proxy handler - private static ProxyHandler handler; - - /* - *

- * @return the default proxy handler installed - *

- * - */ - public static ProxyHandler getDefaultProxyHandler() { - return handler; - } - - /** - *

- * Set the default proxy handler reference - *

- * - * @paran newDefault new default proxy handler - */ - public static void setDefaultProxyHandler(ProxyHandler newDefault) { - handler = newDefault; - } -} - - - - - - - - - - - diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/AppletMessageHandler.java b/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/AppletMessageHandler.java deleted file mode 100644 index d6a6502be50..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/AppletMessageHandler.java +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: AppletMessageHandler.java,v 1.1.1.1 2001-05-09 17:29:59 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.jpav; - -import java.util.ResourceBundle; -import java.util.MissingResourceException; -import java.text.MessageFormat; - -/** - * An hanlder of localized messages. - * - * @version 1.8, 03 Mar 1997 - * @author Koji Uno - */ -public class AppletMessageHandler { - private static ResourceBundle rb; - private String baseKey = null; - - static { - try { - rb = ResourceBundle.getBundle - ("sun.jvmp.resources.MsgAppletViewer"); - } catch (MissingResourceException e) { - //System.err.println(e.getMessage()); - //System.exit(1); - } - }; - - public AppletMessageHandler(String baseKey) { - this.baseKey = baseKey; - } - - public String getMessage(String key) { - return (String)rb.getString(getQualifiedKey(key)); - } - - public String getMessage(String key, Object arg){ - String basemsgfmt = (String)rb.getString(getQualifiedKey(key)); - MessageFormat msgfmt = new MessageFormat(basemsgfmt); - Object msgobj[] = new Object[1]; - if (arg == null) arg = "null"; - msgobj[0] = arg; - return msgfmt.format(msgobj); - } - - public String getMessage(String key, Object arg1, Object arg2) { - String basemsgfmt = (String)rb.getString(getQualifiedKey(key)); - MessageFormat msgfmt = new MessageFormat(basemsgfmt); - Object msgobj[] = new Object[2]; - if (arg1 == null) { - arg1 = "null"; - } - if (arg2 == null) { - arg2 = "null"; - } - msgobj[0] = arg1; - msgobj[1] = arg2; - return msgfmt.format(msgobj); - } - - public String getMessage(String key, Object arg1, Object arg2, Object arg3) { - String basemsgfmt = (String)rb.getString(getQualifiedKey(key)); - MessageFormat msgfmt = new MessageFormat(basemsgfmt); - Object msgobj[] = new Object[3]; - if (arg1 == null) { - arg1 = "null"; - } - if (arg2 == null) { - arg2 = "null"; - } - if (arg3 == null) { - arg3 = "null"; - } - msgobj[0] = arg1; - msgobj[1] = arg2; - msgobj[2] = arg3; - return msgfmt.format(msgobj); - } - - public String getMessage(String key, Object arg[]) { - String basemsgfmt = (String)rb.getString(getQualifiedKey(key)); - MessageFormat msgfmt = new MessageFormat(basemsgfmt); - return msgfmt.format(arg); - } - - String getQualifiedKey(String subKey) { - return baseKey + "." + subKey; - } -} diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ClassLoaderInfo.java b/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ClassLoaderInfo.java deleted file mode 100644 index 738094ec914..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ClassLoaderInfo.java +++ /dev/null @@ -1,187 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: ClassLoaderInfo.java,v 1.1.1.1 2001-05-09 17:29:59 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.jpav; - -/** - * This class keps track of information about active applet class loaders. - * The classloaders are identified by their codebase URL. - * - * We keep around a pool of recently used class loaders. - * - * @author Graham Hamilton - */ - -import sun.applet.*; -import java.util.Hashtable; -import java.util.Vector; -import java.net.URL; - -class ClassLoaderInfo { - private URL codebase; - private int references; - private Hashtable jars; - private boolean locked; - private static boolean initialized; - - // "infos" is a list of ClassLoaderInfos that are available for use. - private static Hashtable infos = new Hashtable(); - - // "zombies" is a list of ClassLoaderInfos that currently have - // a reference count of zero. We keep up to zombieLimit of these - // guys available for resurrection. The least recently used is - // at the front, the more recently used at the end. - // All entries in zombies are also in infos. - private static int zombieLimit; - private static Vector zombies = new Vector(); - - private static synchronized void initialize() { - if (initialized) { - return; - } - initialized = true; - zombieLimit = Integer.getInteger("javaplugin.jar.cache.size", 100).intValue(); - if (zombieLimit > 0) { - System.err.println("java_cache_enabled"); - } else { - System.err.println("java_cache_disabled"); - } - } - - /** - * Find ClassLoaderInfo for the given AppletPanel. - * - * If we don't have any active information, a new ClassLoaderInfo is - * created with an initial reference count of zero. - */ - static synchronized ClassLoaderInfo find(AppletPanel panel) { - initialize(); - URL codebase = panel.getCodeBase(); - //System.err.println("looking classloader for codebase:"+codebase); - ClassLoaderInfo result = (ClassLoaderInfo)infos.get(codebase); - if (result == null) { - // System.out.println("ClassLoaderCache: adding " + codebase); - result = new ClassLoaderInfo(codebase); - infos.put(codebase, result); - } else { - // We make sure this loader isn't on the zombies list. - zombies.removeElement(result); - } - return result; - } - - /** - * Add a retaining reference. - */ - synchronized void addReference() { - references++; - } - - /** - * Remove a retaining reference. If there are no references left - * then we put it on the zombies list. - */ - synchronized void removeReference() { - references--; - if (references < 0) { - throw new Error("negative ref count???"); - } - if (references == 0) { - addZombie(this); - } - } - - /** - * Add the given ClassLoaderInfo to the zomboies list. - * If there are too many zombies we get rid of some. - */ - private static synchronized void addZombie(ClassLoaderInfo cli) { - // Add the ClassLoaderInfo to the end of the zombies list. - zombies.addElement(cli); - // If there are too many zombies, kill the first one. - if (zombies.size() > zombieLimit) { - ClassLoaderInfo victim = (ClassLoaderInfo)zombies.elementAt(0); - // System.out.println("ClassLoaderCache: discarding " + victim.codebase); - zombies.removeElementAt(0); - infos.remove(victim.codebase); - AppletPanel.flushClassLoader(victim.codebase); - } - } - - private ClassLoaderInfo(URL codebase) { - references = 0; - this.codebase = codebase; - jars = new Hashtable(); - } - - synchronized void addJar(String name) { - jars.put(name, name); - } - - synchronized boolean hasJar(String name) { - if (jars.get(name) != null) { - return true; - } else { - return false; - } - } - - /* - * Flag and utility routines for recording whether local .jar files in lib/app/ - * have been loaded or not. This is used as a performance optimization - * so that hasJar() does not need to be checked against the filesystem - * each time an applet is loaded. - */ - - private boolean localJarsLoaded = false; - - public boolean getLocalJarsLoaded() { - return(localJarsLoaded); - } - - public void setLocalJarsLoaded(boolean loadedFlag) { - localJarsLoaded = loadedFlag; - } - - /** - * Acquire the lock. This is used to prevent two AppletPanels - * trying to classload JARs at the same time. - */ - public final synchronized void lock() throws InterruptedException { - while (locked) { - wait(); - } - locked = true; - } - - /** - * Release the lock. This allows other people do to classloading. - */ - public final synchronized void unlock() { - locked = false; - notifyAll(); - } -} diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/CookieHandler.java b/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/CookieHandler.java deleted file mode 100644 index de1eb82023d..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/CookieHandler.java +++ /dev/null @@ -1,39 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: CookieHandler.java,v 1.1.1.1 2001-05-09 17:29:59 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.jpav; - -import java.net.URL; - -public interface CookieHandler { - - /* getCookieInfo takes a particular URL and returns its cookie info. - */ - String getCookieInfo(URL u); -} - - - diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/JavaPluginAVFactory.java b/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/JavaPluginAVFactory.java deleted file mode 100644 index 72ce4b235cf..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/JavaPluginAVFactory.java +++ /dev/null @@ -1,287 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: JavaPluginAVFactory.java,v 1.1.1.1 2001-05-09 17:29:59 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.jpav; - -import sun.jvmp.*; -import sun.jvmp.applet.*; -import java.util.*; -import java.security.*; -import java.net.URL; -import java.awt.Frame; -import java.applet.Applet; -import java.rmi.server.RMISocketFactory; -import java.io.*; - -public class JavaPluginAVFactory implements sun.jvmp.ObjectFactory -{ - Vector cids; - Hashtable permsHash; - Permissions permsForAll; - boolean inited=false; - CodeSource codesource; - PluggableJVM jvm; - static JavaPluginAVFactory instance = null; - - - public static ObjectFactory getFactory(PluggableJVM jvm, - CodeSource codesource) - throws ComponentException - { - if (instance == null) - instance = new JavaPluginAVFactory(jvm, codesource); - return instance; - } - - protected JavaPluginAVFactory(PluggableJVM jvm, CodeSource codesource) - throws ComponentException - { - cids = new Vector(); - cids.add(WFAppletViewer.CID); - permsHash = new Hashtable(); - this.jvm = jvm; - this.codesource = codesource; - /* Permissions p = new Permissions(); - // XXX: correct? - //p.add(new java.security.AllPermission()); - permsHash.put(codesource, p); - */ - // XXX: rewrite with policy file - permsForAll = new Permissions(); - permsForAll.add(new java.lang.RuntimePermission("accessClassInPackage.sun.jvmp.jpav")); - permsForAll.add(new java.lang.RuntimePermission("accessClassInPackage.sun.jvmp.jpav.protocol.jdk12.http")); - permsForAll.add(new java.lang.RuntimePermission("accessClassInPackage.sun.jvmp.jpav.protocol.jdk12.ftp")); - permsForAll.add(new java.lang.RuntimePermission("accessClassInPackage.sun.jvmp.jpav.protocol.jdk12.jar")); - permsForAll.add(new java.lang.RuntimePermission("accessClassInPackage.sun.jvmp.jpav.protocol.jdk12.https")); - permsForAll.add(new java.lang.RuntimePermission("accessClassInPackage.sun.jvmp.jpav.protocol.jdk12.gopher")); - } - - public String getName() - { - return "Java Plugin applet viewer"; - } - - public Enumeration getCIDs() - { - return cids.elements(); - } - - public boolean handleConflict(String cid, - ObjectFactory f) - { - return false; - } - - public Object instantiate(String cid, Object arg) - { - AppletViewerArgs a; - try { - a = (AppletViewerArgs)arg; - } catch (ClassCastException e) { - return null; - } - if (!inited) initEnvironment(a.support); - if ((cid == null) || (!WFAppletViewer.CID.equals(cid)) || (a == null)) - return null; - return new TempAV(a.jvm, a.ctx, a.support, a.atts); - } - - public PermissionCollection getPermissions(CodeSource codesource) - { - // pity, but no clone() here - Permissions p = new Permissions(); - for (Enumeration e=permsForAll.elements(); e.hasMoreElements(); ) - p.add((Permission)e.nextElement()); - if (codesource != null) - { - Permissions p1 = (Permissions)permsHash.get(codesource); - if (p1 != null) - { - for (Enumeration e=p1.elements(); e.hasMoreElements(); ) - p.add((Permission)e.nextElement()); - } - } - return p; - } - - /** - * Prepare the enviroment for executing applets. - */ - void initEnvironment(BrowserSupport support) - { - // if we are already initialized, just return - if (inited) return; - // Get our internationalization resources. (Make sure this is - // done before calling showConsoleWindow.) - //rb = ResourceBundle.getBundle("sun.plugin.resources.Activator"); - //rb = null; - /** - * maybe move all this stuff to plugin.policy file - **/ - Properties props = new Properties(System.getProperties()); - // Define a number of standard properties - props.put("acl.read", "+"); - props.put("acl.read.default", ""); - props.put("acl.write", "+"); - props.put("acl.write.default", ""); - // Standard browser properties - props.put("browser", "sun.jvmp"); - //props.put("browser.version", theVersion); - props.put("browser.vendor", "Sun Microsystems Inc."); - props.put("http.agent", "Waterfall Applet Viewer/1.0"); - // Define which packages can NOT be accessed by applets - props.put("package.restrict.access.sun", "true"); - // - // This is important to set the netscape package access to "false". - // Some applets running in IE and NS will access - // netscape.javascript.JSObject sometimes. If we set this - // restriction to "true", these applets will not run at all. - // However, if we set it to "false", the applet may continue - // to run by catching an exception. - props.put("package.restrict.access.netscape", "false"); - - // Define which packages can NOT be extended by applets - props.put("package.restrict.definition.java", "true"); - props.put("package.restrict.definition.sun", "true"); - props.put("package.restrict.definition.netscape", "true"); - - // Define which properties can be read by applets. - // A property named by "key" can be read only when its twin - // property "key.applet" is true. The following ten properties - // are open by default. Any other property can be explicitly - // opened up by the browser user setting key.applet=true in - // ~/.java/properties. Or vice versa, any of the following can - // be overridden by the user's properties. - props.put("java.version.applet", "true"); - props.put("java.vendor.applet", "true"); - props.put("java.vendor.url.applet", "true"); - props.put("java.class.version.applet", "true"); - props.put("os.name.applet", "true"); - props.put("os.version.applet", "true"); - props.put("os.arch.applet", "true"); - props.put("file.separator.applet", "true"); - props.put("path.separator.applet", "true"); - props.put("line.separator.applet", "true"); - props.remove("proxyHost"); - props.remove("proxyPort"); - props.remove("http.proxyHost"); - props.remove("http.proxyPort"); - props.remove("https.proxyHost"); - props.remove("https.proxyPort"); - props.remove("ftpProxyHost"); - props.remove("ftpProxyPort"); - props.remove("ftpProxySet"); - props.remove("gopherProxyHost"); - props.remove("gopherProxyPort"); - props.remove("gopherProxySet"); - props.remove("socksProxyHost"); - props.remove("socksProxyPort"); - - // Set allow default user interaction in HTTP/HTTPS - java.net.URLConnection.setDefaultAllowUserInteraction(true); - - // Make sure proxy is detected on the fly in http, ftp and gopher. - ProxyHandler handler - = getDefaultProxyHandler(ActivatorAppletPanel.PROXY_TYPE_AUTOCONFIG, - null, - null, - support); - - try { - ActivatorProxyHandler.setDefaultProxyHandler(handler); - } catch(Throwable e) { - PluggableJVM.trace(e, PluggableJVM.LOG_WARNING); - } - - // Set RMI socket factory for proxy. - try { - RMISocketFactory.setSocketFactory(new RMIActivatorSocketFactory()); - } - catch (IOException e) { - } - System.setProperties(props); - inited=true; - } - - protected static ProxyHandler - getDefaultProxyHandler(int proxyType, - String proxyList, - String proxyOverride, - BrowserSupport ctx) - { - return new ActivatorProxyHandler(proxyType, - proxyList, - proxyOverride, - ctx); - } -} - -class TempAV implements WFAppletViewer -{ - ActivatorAppletPanel av; - TempAV(PluggableJVM jvm, WFAppletContext ctx, - BrowserSupport support, Hashtable atts) - { - av = new ActivatorAppletPanel(jvm, ctx, atts); - } - - public void startApplet() - { - av.appletStart(); - } - - public void stopApplet() - { - av.appletStop(); - } - - public void destroyApplet(int timeout) - { - av.onClose(timeout); - } - - public int getLoadingStatus() - { - return av.getLoadingStatus(); - } - - public void setDocumentBase(URL docbase) - { - av.setDocumentBase(docbase); - } - - public void setWindow(Frame f) - { - av.setWindow(f); - } - - public Applet getApplet() - { - return av.getApplet(); - } -}; - - diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ProxyHandler.java b/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ProxyHandler.java deleted file mode 100644 index acb8c29fda4..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/ProxyHandler.java +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: ProxyHandler.java,v 1.1.1.1 2001-05-09 17:29:59 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.jpav; - -import java.net.URL; -import sun.jvmp.applet.ProxyInfo; - - -public interface ProxyHandler { - - /* getProxyInfo takes a particular URL and returns its proxy setting. - */ - ProxyInfo getProxyInfo(URL u); -} - - - diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/RMIActivatorSocketFactory.java b/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/RMIActivatorSocketFactory.java deleted file mode 100644 index 50ad3ec73b7..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/RMIActivatorSocketFactory.java +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: RMIActivatorSocketFactory.java,v 1.1.1.1 2001-05-09 17:29:59 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* - * @(#)RMIPluginSocketFactory.java 1.8 97/01/22 - * - * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved. - * - * This software is the confidential and proprietary information of Sun - * Microsystems, Inc. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Sun. - * - * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE - * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES - * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING - * THIS SOFTWARE OR ITS DERIVATIVES. - * - * CopyrightVersion 1.1_beta - */ -package sun.jvmp.jpav; - -import sun.rmi.transport.proxy.RMIMasterSocketFactory; -import sun.rmi.transport.proxy.RMIHttpToPortSocketFactory; -import sun.rmi.transport.proxy.RMIHttpToCGISocketFactory; - -/** - * RMIPluginSocketFactory attempts to create a socket connection to the - * specified host using successively less efficient mechanisms - * until one succeeds. If the host is successfully connected to, - * the factory for the successful mechanism is stored in an internal - * hash table keyed by the host name, so that future attempts to - * connect to the same host will automatically use the same - * mechanism. - */ -public class RMIActivatorSocketFactory extends RMIMasterSocketFactory { - - /** - * Create a RMIActivatorSocketFactory object. Establish order of - * connection mechanisms to attempt on createSocket, if a direct - * socket connection fails. - */ - public RMIActivatorSocketFactory() - { - altFactoryList.addElement(new RMIHttpToPortSocketFactory()); - altFactoryList.addElement(new RMIHttpToCGISocketFactory()); - } -} - diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/ftp/Handler.java b/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/ftp/Handler.java deleted file mode 100644 index 44d55d19ee1..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/ftp/Handler.java +++ /dev/null @@ -1,94 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: Handler.java,v 1.1.1.1 2001-05-09 17:29:59 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.jpav.protocol.jdk12.ftp; - -import java.net.URL; -import java.io.IOException; -import sun.jvmp.jpav.protocol.jdk12.http.HttpURLConnection; -import java.util.Map; -import java.util.HashMap; -import sun.net.ftp.FtpClient; -import sun.net.www.protocol.ftp.*; -import sun.jvmp.applet.*; -import sun.jvmp.jpav.*; - -/** - * Open an ftp connection given a URL - */ -public class Handler extends java.net.URLStreamHandler { - - - public java.net.URLConnection openConnection(URL u) { - /* if set for proxy usage then go through the gopher code to get - * the url connection. - */ - ProxyHandler handler = ActivatorProxyHandler.getDefaultProxyHandler(); - ProxyInfo pinfo = null; - - if (handler != null) - pinfo = handler.getProxyInfo(u); - - try { - if (pinfo != null && pinfo.isProxyUsed()) - { - return new HttpURLConnection(u, pinfo.getProxy(), pinfo.getPort()); - } - else - { - /* make a direct ftp connection */ - return superOpenConnection(u); - } - } catch(IOException e) { - return superOpenConnection(u); - } - } - - - protected java.net.URLConnection superOpenConnection(URL u) { - /* if set for proxy usage then go through the http code to get */ - /* the url connection. Bad things will happen if a user and - * password are specified in the ftp url */ - try { - if (FtpClient.getUseFtpProxy()) { - String host = FtpClient.getFtpProxyHost(); - if (host != null && - host.length() > 0) { - return new sun.jvmp.jpav.protocol.jdk12.http.HttpURLConnection(u, host, - FtpClient.getFtpProxyPort()); - } - } - } catch(IOException e) { - } - - /* make a direct ftp connection */ - return new FtpURLConnection(u); - } - - protected int getDefaultPort() { - return 21; - } -} diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/gopher/Handler.java b/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/gopher/Handler.java deleted file mode 100644 index 12fd5e0bf05..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/gopher/Handler.java +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: Handler.java,v 1.1.1.1 2001-05-09 17:29:59 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.jpav.protocol.jdk12.gopher; - -import java.net.URL; -import java.io.IOException; -import sun.jvmp.jpav.protocol.jdk12.http.HttpURLConnection; -import sun.jvmp.applet.*; -import sun.jvmp.jpav.*; - -/** - * A class to handle the gopher protocol. - */ - -public class Handler extends sun.net.www.protocol.gopher.Handler { - - public java.net.URLConnection openConnection(URL u) throws IOException { - /* if set for proxy usage then go through the gopher code to get - * the url connection. - */ - ProxyHandler handler = ActivatorProxyHandler.getDefaultProxyHandler(); - ProxyInfo pinfo = null; - - if (handler != null) - pinfo = handler.getProxyInfo(u); - - try { - if (pinfo != null && pinfo.isProxyUsed()) - { - return new HttpURLConnection(u, pinfo.getProxy(), pinfo.getPort()); - } - else - { - /* make a direct gopher connection */ - return super.openConnection(u); - } - } catch(IOException e) { - return super.openConnection(u); - } - } -} - - diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/http/Handler.java b/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/http/Handler.java deleted file mode 100644 index ed3fb7fb041..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/http/Handler.java +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: Handler.java,v 1.1.1.1 2001-05-09 17:29:59 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.jpav.protocol.jdk12.http; - -import java.io.IOException; -import java.net.URL; - - -/** - * Open an http input stream given a URL - */ -public class Handler extends sun.net.www.protocol.http.Handler { - - /* - *

- * We use our protocol handler for JDK 1.2 to open the connection for - * the specified URL - *

- * - * @param URL the url to open - */ - public java.net.URLConnection openConnection(URL u) throws IOException { - return new HttpURLConnection(u, this); - } -} diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/http/HttpClient.java b/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/http/HttpClient.java deleted file mode 100644 index cc24b3095fd..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/http/HttpClient.java +++ /dev/null @@ -1,97 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: HttpClient.java,v 1.1.1.1 2001-05-09 17:30:00 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.jpav.protocol.jdk12.http; - -import java.io.*; -import java.net.*; -import java.util.*; -import sun.net.NetworkClient; -import sun.net.ProgressEntry; -import sun.net.ProgressData; -import sun.net.www.MessageHeader; -import sun.net.www.HeaderParser; -import sun.net.www.MeteredStream; -import sun.misc.Regexp; -import sun.misc.RegexpPool; -import sun.jvmp.applet.ProxyInfo; -import sun.jvmp.jpav.*; - -public class HttpClient extends sun.net.www.http.HttpClient { - - /* This package-only CTOR should only be used for FTP piggy-backed on HTTP - * HTTP URL's that use this won't take advantage of keep-alive. - * Additionally, this constructor may be used as a last resort when the - * first HttpClient gotten through New() failed (probably b/c of a - * Keep-Alive mismatch). - * - * XXX That documentation is wrong ... it's not package-private any more - */ - public HttpClient(URL url, String proxy, int proxyPort) - throws IOException { - super (url, proxy, proxyPort); - } - - /* This class has no public constructor for HTTP. This method is used to - * get an HttpClient to the specifed URL. If there's currently an - * active HttpClient to that server/port, you'll get that one. - */ - public static HttpClient New(URL url, String proxy, int proxyPort) - throws IOException { - /* see if one's already around */ - HttpClient ret = (HttpClient) kac.get(url); - if (ret == null) { - ret = new HttpClient (url, proxy, proxyPort); // CTOR called openServer() - } else { - ret.url = url; - } - // don't know if we're keeping alive until we parse the headers - // for now, keepingAlive is false - return ret; - } - - /** - * Return a socket connected to the server, with any - * appropriate options pre-established - */ - protected Socket doConnect (String server, int port) - throws IOException, UnknownHostException { - - ProxyHandler handler = sun.jvmp.jpav.ActivatorProxyHandler.getDefaultProxyHandler(); - if (handler != null) - { - ProxyInfo pinfo = handler.getProxyInfo(url); - - if (pinfo != null && pinfo.isSocksUsed()) - { - // Use SOCKS !! - return new SocksSocket(server, port, pinfo.getSocksProxy(), pinfo.getSocksPort()); - } - } - - return super.doConnect(server, port); - } -} diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/http/HttpURLConnection.java b/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/http/HttpURLConnection.java deleted file mode 100644 index 2e00c7eb504..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/http/HttpURLConnection.java +++ /dev/null @@ -1,292 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: HttpURLConnection.java,v 1.1.1.1 2001-05-09 17:30:00 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.jpav.protocol.jdk12.http; - -import java.net.URL; -import java.net.ProtocolException; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.io.ByteArrayOutputStream; -import java.io.*; -import java.util.*; -import java.security.AccessController; -import java.security.PrivilegedExceptionAction; -import java.security.PrivilegedActionException; -import sun.net.*; -import sun.net.www.*; -import sun.jvmp.applet.*; -import sun.jvmp.jpav.*; - -public class HttpURLConnection extends - sun.net.www.protocol.http.HttpURLConnection { - - protected String proxy = null; - protected int proxyPort = -1; - - // This is to keep trace of the failedOnce value in the super class. Since failedOnce - // in the super one are declared private, we do some hack to get this value. - boolean failedOnce = false; - - public HttpURLConnection(URL u, Handler handler) - throws IOException { - super(u, handler); - } - - /** this constructor is used by other protocol handlers such as ftp - that want to use http to fetch urls on their behalf. */ - public HttpURLConnection(URL u, String host, int port) - throws IOException { - super(u, host, port); - this.proxy = host; - this.proxyPort = port; - } - - static CookieHandler handler = null; - - /* setCookieHandler is used only when a particular CookieHandler is required - * to determine the cookie value of a particular URL on the fly. - */ - public static void setCookieHandler(CookieHandler h) { - handler = h; - } - - protected boolean fromClassLoader() { - Exception e = new Exception(); - ByteArrayOutputStream ba = new ByteArrayOutputStream(); - PrintStream pos = new PrintStream(ba); - //e.printStackTrace(pos); - String trace = ba.toString(); - StringTokenizer tok = new StringTokenizer(trace); - String s = null; - while(tok.hasMoreTokens()) { - s = tok.nextToken(); - if ((s.startsWith("sun.applet.AppletClassLoader")) || - (s.startsWith("sun.applet.AppletResourceLoader")) || - (s.startsWith("sun.jvmp.jpav.ActivatorClassLoader"))) { - return true; - } - } - return false; - } - - protected boolean rightExt() { - String fname = url.getFile(); - return (fname.endsWith(".jar") || fname.endsWith(".class")); - } - - void privBlock() throws Exception { - try { - if ("http".equals(url.getProtocol()) && !failedOnce) { - http = HttpClient.New(url, proxy, proxyPort); - } else { - // make sure to construct new connection if first attempt failed - http = getProxiedClient(url, proxy, proxyPort); - } - ps = (PrintStream)http.getOutputStream(); - } catch (IOException e) { - throw e; - } - } - - // overridden in HTTPS subclass - - public synchronized void connect() throws IOException { - if (connected) - return; - - // Determine proxy setting for the connection - - if (proxy == null) { - ProxyInfo pinfo = null; - ProxyHandler proxyHandler = ActivatorProxyHandler.getDefaultProxyHandler(); - - if (proxyHandler!=null) { - pinfo = proxyHandler.getProxyInfo(url); - - if (pinfo != null) - { - proxy = pinfo.getProxy(); - proxyPort = pinfo.getPort(); - } - } - } - - // Check whether the applet is allowed to connect to the host. - // This is necessary because we will enable privilege to - // connect to the proxy - SecurityManager m = System.getSecurityManager(); - if (m != null) { - m.checkConnect(url.getHost(), url.getPort()); - } - - // Determine cookie value - if (handler != null) - { - // Use browser cookie only if the cookie has not - // been set by the applet. - if (getRequestProperty("cookie") == null) - { - String cookie = handler.getCookieInfo(url); - - if (cookie != null) - setRequestProperty("cookie", cookie); - } - } - - try { - AccessController.doPrivileged(new PrivilegedBlockAction(this)); - } catch (PrivilegedActionException e) { - IOException ioe = (IOException)e.getException(); - throw ioe; - } - - // Workaround for Mozilla bugs - String workaround = (String) java.security.AccessController.doPrivileged( - new sun.security.action.GetPropertyAction("mozilla.workaround")); - - if (workaround != null && workaround.equalsIgnoreCase("true")) - { - // Disable browser caching in Mozilla - setUseCaches(false); - } - else - { - // constructor to HTTP client calls openserver - setUseCaches(getUseCaches() && rightExt()); - } - - connected = true; - } - - private InputStream cacheStream = null; - - public synchronized InputStream getInputStream() throws IOException{ - if (!connected) - connect(); - if (useCaches) { - try { - // check if we are allowed to read files. If not, there is - // no point to caching. Now, we have no idea where the - // browser will put the file, so lets try to read - // java.home property - if (cacheStream != null) - return cacheStream; - - cacheStream = (InputStream) - AccessController.doPrivileged(new FileCreator(this)); - if (cacheStream==null) { - useCaches = false; - } else { - return cacheStream; - } - } catch (PrivilegedActionException e) { //IOException. fall through, and try - //remote - System.out.println("IO Exception, using remote copy"); - //e.printStackTrace(); - useCaches = false; - } catch (SecurityException e1) { - System.out.println("Security exception, using remote copy"); - useCaches = false; - } - } - return super.getInputStream(); - } - - /** - * Create a new HttpClient object, bypassing the cache of - * HTTP client objects/connections. - * - * @param url the URL being accessed - */ - protected sun.net.www.http.HttpClient getNewClient (URL url) - throws IOException { - - // This is a hack to get the failedOnce value. Since getNewClient is only called by the - // super class when failedOnce is true, we can obtain the failedOnce value this way. - failedOnce = true; - - return getProxiedClient(url, proxy, proxyPort); - } - - - /** - * Create a new HttpClient object, set up so that it uses - * per-instance proxying to the given HTTP proxy. This - * bypasses the cache of HTTP client objects/connections. - * - * @param url the URL being accessed - * @param proxyHost the proxy host to use - * @param proxyPort the proxy port to use - */ - protected sun.net.www.http.HttpClient getProxiedClient (URL url, String proxyHost, int proxyPort) - throws IOException { - return new HttpClient (url, proxyHost, proxyPort); - } - - /** - * Method to get an internationalized string from the Activator resource. - */ - public static String getMessage(String key) { - return key; - } - - // Localization strings. - private static ResourceBundle rb; - - class FileCreator implements PrivilegedExceptionAction { - HttpURLConnection conn; - - FileCreator(HttpURLConnection c) { - conn = c; - } - - public Object run() throws Exception { - - String fileName = null; //sun.plugin.CacheHandler.getCacheFile(conn.getURL()); - if (fileName!=null) - return new BufferedInputStream(new FileInputStream(fileName)); - else - return null; - } - } - - class PrivilegedBlockAction implements PrivilegedExceptionAction { - HttpURLConnection conn; - PrivilegedBlockAction(HttpURLConnection c) - { - conn = c; - } - - public Object run() throws Exception { - conn.privBlock(); - return null; - } - } - -} - - diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/http/SocksSocket.java b/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/http/SocksSocket.java deleted file mode 100644 index 5ba54459fb7..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/http/SocksSocket.java +++ /dev/null @@ -1,407 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: SocksSocket.java,v 1.1.1.1 2001-05-09 17:30:00 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* - * @(#)SocksSocket.java 1.4 00/02/16 - * - * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved. - * - * This software is the confidential and proprietary information of Sun - * Microsystems, Inc. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Sun. - * - * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE - * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES - * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING - * THIS SOFTWARE OR ITS DERIVATIVES. - * - * CopyrightVersion 1.1_beta - * - * @author Stanley Man-Kit Ho - */ - -package sun.jvmp.jpav.protocol.jdk12.http; - -import java.io.ByteArrayOutputStream; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.net.Socket; -import java.net.SocketException; - -/** - * This class implements client sockets (also called just - * "sockets") through SOCKS. A socket is an endpoint for communication - * between two machines. - *

- * The actual work of the socket is performed by an instance of the - * SocketImpl class. An application, by changing - * the socket factory that creates the socket implementation, - * can configure itself to create sockets appropriate to the local - * firewall. - * - * @author Stanley Man-Kit Ho - * @version 1.00, 04/23/98 - * @see java.net.Socket - * @since JDK1.0 - */ -public class SocksSocket extends Socket { - - private Socket socket = null; - - /* SOCKS related constants */ - - private static final int SOCKS_PROTO_VERS = 4; - private static final int SOCKS_REPLY_VERS = 4; - - private static final int COMMAND_CONNECT = 1; - private static final int COMMAND_BIND = 2; - - private static final int REQUEST_GRANTED = 90; - private static final int REQUEST_REJECTED = 91; - private static final int REQUEST_REJECTED_NO_IDENTD = 92; - private static final int REQUEST_REJECTED_DIFF_IDENTS = 93; - - public static final int socksDefaultPort = 1080; - - InetAddress address = null; - int port = -1; - - /** - * Creates a stream socket and connects it to the specified port - * number on the named host using SOCKS. - *

- * If the application has specified a server socket factory, that - * factory's createSocketImpl method is called to create - * the actual socket implementation. Otherwise a "plain" socket is created. - * - * @param host the host name. - * @param port the port number. - * @param socksAddress the host name of the SOCKS server. - * @param socksPort the port number of the SOCKS server. - * @exception IOException if an I/O error occurs when creating the socket. - * @since JDK1.0 - */ - public SocksSocket(String host, int port, String socksAddress, int socksPort) - throws UnknownHostException, IOException - { - this(InetAddress.getByName(host), port, InetAddress.getByName(socksAddress), socksPort); - } - - /** - * Creates a stream socket and connects it to the specified port - * number at the specified IP address using SOCKS. - *

- * If the application has specified a socket factory, that factory's - * createSocketImpl method is called to create the - * actual socket implementation. Otherwise a "plain" socket is created. - * - * @param address the IP address. - * @param port the port number. - * @param socksAddress the IP address of the SOCKS server. - * @param socksPort the port number of the SOCKS server. - * @exception IOException if an I/O error occurs when creating the socket. - * @since JDK1.0 - */ - public SocksSocket(InetAddress address, int port, InetAddress socksAddress, int socksPort) throws IOException { - connect(address, port, socksAddress, socksPort); - } - - - /** - * Creates a socket and connects it to the specified address on - * the specified port using SOCKS v4. - * @param address the address - * @param port the specified port - * @param socksAddress the address of the SOCKS proxy - * @param socksPort the specified port of the SOCKS proxy - */ - private void connect(InetAddress address, int port, InetAddress socksAddress, int socksPort) throws IOException { - - if (socksPort == -1) - socksPort = socksDefaultPort; - - this.address = address; - this.port = port; - - if (socksAddress != null) - { - socket = new Socket(socksAddress, socksPort); - - /** - * Connect to the SOCKS server using the SOCKS connection protocol. - */ - sendSOCKSCommandPacket(COMMAND_CONNECT, address, port); - - int protoStatus = getSOCKSReply(); - - switch (protoStatus) { - case REQUEST_GRANTED: - // connection set up, return control to the socket client - return; - - case REQUEST_REJECTED: - case REQUEST_REJECTED_NO_IDENTD: - throw new SocketException("SOCKS server cannot conect to identd"); - - case REQUEST_REJECTED_DIFF_IDENTS: - throw new SocketException("User name does not match identd name"); - } - } - else - { - socket = new Socket(address, port); - } - } - - - /** - * Read the response from the socks server. Return the result code. - */ - private int getSOCKSReply() throws IOException { - InputStream in = getInputStream(); - byte response[] = new byte[8]; - int bytesReceived = 0; - int len = response.length; - - for (int attempts = 0; bytesReceived> 8) & 0xff); - byteStream.write((port >> 0) & 0xff); - - byte addressBytes[] = address.getAddress(); - byteStream.write(addressBytes, 0, addressBytes.length); - - String userName = (String) java.security.AccessController.doPrivileged( - new sun.security.action.GetPropertyAction("user.name")); - - byte userNameBytes[] = new byte[userName.length()]; - userName.getBytes(0, userName.length(), userNameBytes, 0); - - byteStream.write(userNameBytes, 0, userNameBytes.length); - byteStream.write(0); // null termination for user name - - return byteStream.toByteArray(); - } - - - /** - * Returns the address to which the socket is connected. - * - * @return the remote IP address to which this socket is connected. - * @since JDK1.0 - */ - public InetAddress getInetAddress() { - return address; - } - - /** - * Gets the local address to which the socket is bound. - * - * @since JDK1.1 - */ - public InetAddress getLocalAddress() { - return socket.getLocalAddress(); - } - - /** - * Returns the remote port to which this socket is connected. - * - * @return the remote port number to which this socket is connected. - * @since JDK1.0 - */ - public int getPort() { - return port; - } - - /** - * Returns the local port to which this socket is bound. - * - * @return the local port number to which this socket is connected. - * @since JDK1.0 - */ - public int getLocalPort() { - return socket.getLocalPort(); - } - - /** - * Returns an input stream for this socket. - * - * @return an input stream for reading bytes from this socket. - * @exception IOException if an I/O error occurs when creating the - * input stream. - * @since JDK1.0 - */ - public InputStream getInputStream() throws IOException { - return socket.getInputStream(); - } - - /** - * Returns an output stream for this socket. - * - * @return an output stream for writing bytes to this socket. - * @exception IOException if an I/O error occurs when creating the - * output stream. - * @since JDK1.0 - */ - public OutputStream getOutputStream() throws IOException { - return socket.getOutputStream(); - } - - /** - * Enable/disable TCP_NODELAY (disable/enable Nagle's algorithm). - * - * @since JDK1.1 - */ - public void setTcpNoDelay(boolean on) throws SocketException { - socket.setTcpNoDelay(on); - } - - /** - * Tests if TCP_NODELAY is enabled. - * - * @since JDK1.1 - */ - public boolean getTcpNoDelay() throws SocketException { - return socket.getTcpNoDelay(); - } - - /** - * Enable/disable SO_LINGER with the specified linger time. - * - * @since JDK1.1 - */ - public void setSoLinger(boolean on, int val) throws SocketException { - socket.setSoLinger(on, val); - } - - /** - * Returns setting for SO_LINGER. -1 returns implies that the - * option is disabled. - * - * @since JDK1.1 - */ - public int getSoLinger() throws SocketException { - return socket.getSoLinger(); - } - - /** - * Enable/disable SO_TIMEOUT with the specified timeout, in - * milliseconds. With this option set to a non-zero timeout, - * a read() call on the InputStream associated with this Socket - * will block for only this amount of time. If the timeout expires, - * a java.io.InterruptedIOException is raised, though the - * Socket is still valid. The option must be enabled - * prior to entering the blocking operation to have effect. The - * timeout must be > 0. - * A timeout of zero is interpreted as an infinite timeout. - * - * @since JDK 1.1 - */ - public synchronized void setSoTimeout(int timeout) throws SocketException { - socket.setSoTimeout(timeout); - } - - /** - * Returns setting for SO_TIMEOUT. 0 returns implies that the - * option is disabled (i.e., timeout of infinity). - * - * @since JDK1.1 - */ - public synchronized int getSoTimeout() throws SocketException { - return socket.getSoTimeout(); - } - - /** - * Closes this socket. - * - * @exception IOException if an I/O error occurs when closing this socket. - * @since JDK1.0 - */ - public synchronized void close() throws IOException { - socket.close(); - } - - /** - * Converts this socket to a String. - * - * @return a string representation of this socket. - * @since JDK1.0 - */ - public String toString() { - return "SocksSocket[addr=" + getInetAddress() + - ",port=" + getPort() + - ",localport=" + getLocalPort() + "]"; - } -} diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/https/BrowserHttpsInputStream.java b/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/https/BrowserHttpsInputStream.java deleted file mode 100644 index fd705a7bdc7..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/https/BrowserHttpsInputStream.java +++ /dev/null @@ -1,294 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: BrowserHttpsInputStream.java,v 1.1.1.1 2001-05-09 17:30:00 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* - * @(#)BrowserHttpsInputStream.java 1.2 00/04/27 - * - * Copyright (c) 1996-1999 Sun Microsystems, Inc. All Rights Reserved. - * - * This software is the confidential and proprietary information of Sun - * Microsystems, Inc. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Sun. - * - * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE - * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES - * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING - * THIS SOFTWARE OR ITS DERIVATIVES. - * - * CopyrightVersion 1.0 - */ - -package sun.jvmp.jpav.protocol.jdk12.https; - -import java.net.URLConnection; -import java.io.IOException; -import java.io.InputStream; - - /** - * HTTPS URL input stream support. The intention here is to allow input from the - * server to be flushed prior to being closed. The browser API is used for reading - * https response input. - * - * @author R.H. Yang - */ -public -class BrowserHttpsInputStream extends java.io.InputStream -{ - // parent URLConnection - - BrowserHttpsURLConnection urlConnection; - - // seek pointer - - long seekPos; - - // "cookie" for native connection (handle/ptr/whatever) - - long nativeConnection; - - // stream state - - boolean open; - - - // Construct input stream attached to specified Https URL Connection - - public BrowserHttpsInputStream( BrowserHttpsURLConnection uc ) - throws IOException { - urlConnection = uc; - openStream(); - open = true; - } - - /** - * Reads the next byte of data from the input stream. The value byte is - * returned as an int in the range 0 to - * 255. If no byte is available because the end of the stream - * has been reached, the value -1 is returned. This method - * blocks until input data is available, the end of the stream is detected, - * or an exception is thrown. - * - *

A subclass must provide an implementation of this method. - * - * @return the next byte of data, or -1 if the end of the - * stream is reached. - * @exception IOException if an I/O error occurs. - */ - public synchronized int read() throws IOException { - ensureOpen(); - - if ( 0 == nativeConnection ) - return -1; - - - // Read from native code - - int numRead = readStream( temp, 0, 1 ); - - if ( 1 == numRead ) { - ++seekPos; - - return temp[0] & 0xff; - } else { - return numRead; - } - } - - /** - * Reads up to len bytes of data from the input stream into - * an array of bytes. An attempt is made to read as many as - * len bytes, but a smaller number may be read, possibly - * zero. The number of bytes actually read is returned as an integer. - * - *

This method blocks until input data is available, end of file is - * detected, or an exception is thrown. - * - *

If b is null, a - * NullPointerException is thrown. - * - *

If off is negative, or len is negative, or - * off+len is greater than the length of the array - * b, then an IndexOutOfBoundsException is - * thrown. - * - *

If len is zero, then no bytes are read and - * 0 is returned; otherwise, there is an attempt to read at - * least one byte. If no byte is available because the stream is at end of - * file, the value -1 is returned; otherwise, at least one - * byte is read and stored into b. - * - *

The first byte read is stored into element b[off], the - * next one into b[off+1], and so on. The number of bytes read - * is, at most, equal to len. Let k be the number of - * bytes actually read; these bytes will be stored in elements - * b[off] through b[off+k-1], - * leaving elements b[off+k] through - * b[off+len-1] unaffected. - * - *

In every case, elements b[0] through - * b[off] and elements b[off+len] through - * b[b.length-1] are unaffected. - * - *

If the first byte cannot be read for any reason other than end of - * file, then an IOException is thrown. In particular, an - * IOException is thrown if the input stream has been closed. - * - * @param b the buffer into which the data is read. - * @param off the start offset in array b - * at which the data is written. - * @param len the maximum number of bytes to read. - * @return the total number of bytes read into the buffer, or - * -1 if there is no more data because the end of - * the stream has been reached. - * @exception IOException if an I/O error occurs. - * @see java.io.InputStream#read() - */ - public synchronized int read(byte b[], int off, int len) throws IOException { - ensureOpen(); - - // Check for boundary conditions - - if (b == null) { - throw new NullPointerException(); - } else if ((off < 0) || (off > b.length) || (len < 0) || - ((off + len) > b.length) || ((off + len) < 0)) { - throw new IndexOutOfBoundsException(); - } else if (len == 0) { - return 0; - } - - if ( 0 == nativeConnection ) - return -1; - - - // Read from native code - - int numRead = readStream( b, off, len ); - - if ( numRead > 0 ) { - seekPos += numRead; - } - - return ( numRead > 0 ? numRead : -1 ); - } - - /** - * Skips n bytes of input. - * @param n the number of bytes to skip - * @return the actual number of bytes skipped. - * @exception IOException If an I/O error has occurred. - */ - // (Stolen from SocketInputStream) - public long skip(long numbytes) throws IOException { - synchronized( this ) { - ensureOpen(); - } - - if (numbytes <= 0) { - return 0; - } - long n = numbytes; - int buflen = (int) Math.min(1024, n); - byte data[] = new byte[buflen]; - while (n > 0) { - int r = read(data, 0, (int) Math.min((long) buflen, n)); - if (r < 0) { - break; - } - n -= r; - } - - synchronized( this ) { - seekPos += ( numbytes - n ); - } - return numbytes - n; - } - - /** - * Returns the number of bytes that can be read (or skipped over) from - * this input stream without blocking by the next caller of a method for - * this input stream. The next caller might be the same thread or or - * another thread. - * - * @return the number of bytes that can be read from this input stream - * without blocking. - * @exception IOException if an I/O error occurs. - */ - public synchronized int available() throws IOException { - ensureOpen(); - - return ( 0 == nativeConnection ? 0 : bytesAvailable() ); - } - - /** - * Closes this input stream and releases any system resources associated - * with the stream. - * - * @exception IOException if an I/O error occurs. - */ - public synchronized void close() throws IOException { - if (this.open == true) - { - closeStream(); - this.open = false; - } - } - - /** - * Check to make sure that this stream has not been closed - */ - private void ensureOpen() throws IOException { - if ( !this.open ) - throw new IOException("Stream closed"); - } - - protected void finalize() { - try { - close(); - } catch( IOException e ) { - } - } - - private byte temp[] = new byte[1]; // for single-byte reads - - - ////////////////////////////////////////////////////////////////////////// - // native implementation - - private native void openStream() throws IOException; - - private native int readStream( byte[] buf, int offs, int len ) - throws IOException; - - private native int bytesAvailable() throws IOException; - - private native void closeStream() throws IOException; -} - diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/https/BrowserHttpsOutputStream.java b/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/https/BrowserHttpsOutputStream.java deleted file mode 100644 index 574e14f2c0d..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/https/BrowserHttpsOutputStream.java +++ /dev/null @@ -1,134 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: BrowserHttpsOutputStream.java,v 1.1.1.1 2001-05-09 17:30:00 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* - * @(#)BrowserHttpsOutputStream.java 1.5 00/04/27 - * - * Copyright (c) 1996-1997 Sun Microsystems, Inc. All Rights Reserved. - * - * This software is the confidential and proprietary information of Sun - * Microsystems, Inc. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Sun. - * - * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE - * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES - * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING - * THIS SOFTWARE OR ITS DERIVATIVES. - * - * CopyrightVersion 1.0 - */ - -package sun.jvmp.jpav.protocol.jdk12.https; - -import java.net.URLConnection; -import java.io.IOException; -import java.io.OutputStream; -import java.io.ByteArrayOutputStream; - -/** - * HTTPS URL POST support. This class buffers all the output stream - * until the stream is closed, then it will do a POST on the web - * server through the browser API. - * - * @author Stanley Man-Kit Ho - */ -public -class BrowserHttpsOutputStream extends java.io.ByteArrayOutputStream -{ - // URLConnection of the HTTPS connection. - BrowserHttpsURLConnection urlConnection = null; - - // Determine if the HTTPS output stream has been closed. - private boolean bConnected = false; - - /** - *

Create BrowserHttpsOutputStream object. - *

- * - * @param url URL of the HTTPS connection. - */ - public BrowserHttpsOutputStream(BrowserHttpsURLConnection urlConnection) - { - super(); - this.urlConnection = urlConnection; - this.bConnected = true; - } - - - /** - *

Create BrowserHttpsOutputStream object. - *

- * - * @param url URL of the HTTPS connection. - * @param size Size of the output stream buffer. - */ - public BrowserHttpsOutputStream(BrowserHttpsURLConnection urlConnection, int size) - { - super(size); - this.urlConnection = urlConnection; - this.bConnected = true; - } - - /** - *

Closes this output stream. - *

- */ - public synchronized void close() throws IOException - { - // Make sure the stream has not been closed multiple times - if (bConnected) - { - bConnected = false; - super.close(); - - byte[] postResponse; - byte[] buf = toByteArray(); - - if (buf == null) - postResponse = postHttpsURL(urlConnection, urlConnection.getURL().toString(), null, 0); - else - postResponse = postHttpsURL(urlConnection, urlConnection.getURL().toString(), buf, buf.length); - - if (urlConnection.getDoInput()) { - urlConnection.postResponse = postResponse; - urlConnection.postResponseReady = true; - } - } - } - - /** - *

Native code to call back into the browser to do a POST. - *

- * - * @param url URL of the HTTPS connection - * @param buf Data to post. - */ - private native byte[] postHttpsURL(URLConnection urlConnection, String url, byte[] buf, int length); -} diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/https/BrowserHttpsURLConnection.java b/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/https/BrowserHttpsURLConnection.java deleted file mode 100644 index 845af393561..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/https/BrowserHttpsURLConnection.java +++ /dev/null @@ -1,378 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: BrowserHttpsURLConnection.java,v 1.1.1.1 2001-05-09 17:30:00 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.jpav.protocol.jdk12.https; - -import java.net.*; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; -import sun.net.www.http.*; -import sun.net.www.MessageHeader; -import sun.net.www.protocol.http.*; -import java.util.Date; -import java.text.SimpleDateFormat; -import java.util.TimeZone; -import java.io.FileNotFoundException; -import java.io.BufferedInputStream; -import java.security.*; -import java.security.Permission; -import java.net.SocketPermission; - - -public -class BrowserHttpsURLConnection extends java.net.URLConnection -{ - /* - * Message Headers hold the request and response headers send along - * this HTTP request. This is currently available only in all IE version - */ - private MessageHeader responseHeaders = null; - private MessageHeader requestHeaders = null; - - /* - * Native object reference - */ - private long nativeConnection = 0; - - /* - * Initialize an HTTPS URLConnection ... could check that the URL - * is an "https" URL, and that the handler is also an HTTPS one, - * but that's established by other code in this package. - */ - - public Permission getPermission() throws IOException { - int port = url.getPort(); - port = port < 0 ? 80 : port; - String host = url.getHost() + ":" + port; - Permission permission = new SocketPermission(host, "connect"); - return permission; - } - - /* - * Initialize an HTTPS URLConnection ... could check that the URL - * is an "https" URL, and that the handler is also an HTTPS one, - * but that's established by other code in this package. - */ - public BrowserHttpsURLConnection (URL url) throws IOException { - super (url); - } - /** - * Implements the HTTP protocol handler's "connect" method, - * establishing an SSL connection to the server as necessary. - */ - public synchronized void connect () throws IOException { - if (connected) - return; - - // Check whether the applet is allowed to connect to the host. - // This is necessary because we will enable privilege to - // connect to the proxy - SecurityManager m = System.getSecurityManager(); - if (m != null) { - m.checkConnect(url.getHost(), url.getPort()); - } - - // Add the necessary headers if necessary - java.security.AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - packageRequestHeaders(); - return null; - } - }); - connected = true; - } - - /* - * @return the raw request headers for this URL connection - * - */ - private byte[] getRequestHeaders() { - - // Send the request headers - byte[] rawRequestHeaders = null; - if (requestHeaders!=null) { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - PrintStream ps = new PrintStream(bos); - requestHeaders.print(ps); - ps.flush(); - rawRequestHeaders = bos.toByteArray(); - } - return rawRequestHeaders; - } - - /* - *

- * Sets the response headers from this URLConnection - *

- * - * @param rawResponseHeaders Response headers - */ - private void setResponseHeaders(byte[] rawResponseHeaders) { - - // Extract the response headers - if (rawResponseHeaders!=null) { - ByteArrayInputStream bis = - new ByteArrayInputStream(rawResponseHeaders); - try { - responseHeaders = new MessageHeader(bis); - } catch(IOException e) { - e.printStackTrace(); - } - } - } - - /** - *

- * Package the necessary request headers for this connection - *

- * - * @param mh MessageHeader that will contain all the request headers - * - */ - protected void packageRequestHeaders() { - - // Set the if modified since flag - if (getIfModifiedSince()!=0) { - TimeZone tz = TimeZone.getTimeZone("GMT"); - Date modTime = new Date(getIfModifiedSince()); - SimpleDateFormat df = new SimpleDateFormat(); - df.setTimeZone(tz); - setRequestProperty("If-Modified-Since", df.format(modTime)); - } - setRequestPropertyIfNotSet("Content-Type", "application/x-www-form-urlencoded"); - } - - /** - * Returns the value of the specified header field. Names of - * header fields to pass to this method can be obtained from - * getHeaderFieldKey. - * - * @param name the name of a header field. - * @return the value of the named header field, or null - * if there is no such field in the header. - * @see java.net.URLConnection#getHeaderFieldKey(int) - * @since JDK1.0 - */ - public String getHeaderField(String name) { - if (responseHeaders!=null) - return responseHeaders.findValue(name); - return null; - } - - /** - * Returns the key for the nth header field. - * - * @param n an index. - * @return the key for the nth header field, - * or null if there are fewer than n - * fields. - * @since JDK1.0 - */ - public String getHeaderFieldKey(int n) { - if (responseHeaders!=null) - return responseHeaders.getKey(n); - return null; - } - - /** - * Returns the value for the nth header field. - * It returns null if there are fewer than - * n fields. - *

- * This method can be used in conjunction with the - * getHeaderFieldKey method to iterate through all - * the headers in the message. - * - * @param n an index. - * @return the value of the nth header field. - * @see java.net.URLConnection#getHeaderFieldKey(int) - * @since JDK1.0 - */ - public String getHeaderField(int n) { - if (responseHeaders!=null) - return responseHeaders.getValue(n); - return null; - } - - /** - * Sets the general request property. - * - * @param key the keyword by which the request is known - * (e.g., "accept"). - * @param value the value associated with it. - */ - public synchronized void setRequestProperty(String key, String value) { - if (connected) - throw new IllegalAccessError("Already connected"); - // Create the requests holder if necessary - if (requestHeaders==null) { - requestHeaders= new MessageHeader(); - } - requestHeaders.set(key, value); - } - - public synchronized void setRequestPropertyIfNotSet(String key, String value -) { - if (connected) - throw new IllegalAccessError("Already connected"); - - // Create the requests holder if necessary - if (requestHeaders==null) { - requestHeaders= new MessageHeader(); - } - requestHeaders.setIfNotSet(key, value); - } - - /** - * Returns the value of the named general request property for this - * connection. - * - * @return the value of the named general request property for this - * connection. - */ - public String getRequestProperty(String key) { - if (connected) - throw new IllegalAccessError("Already connected"); - - if (requestHeaders!=null) - return requestHeaders.findValue(key); - return null; - } - - /** - * Returns an input stream that reads from this open connection. - * - * @return an input stream that reads from this open connection. - * @exception IOException if an I/O error occurs while - * creating the input stream. - * @exception UnknownServiceException if the protocol does not support - * input. - * @since JDK1.0 - */ - public InputStream getInputStream() throws IOException - { - if (!doInput) - throw new ProtocolException("Cannot read from URLConnection" - + " if doInput=false (call setDoInput(true))"); - - if (!connected) - connect(); - - if (ins == null) - { - byte buffer[] = null; - - // If we are in input/output mode, we might just want the response - // from a POST. - if (doOutput) { - if (!postResponseReady) - throw new UnknownServiceException("Input from HTTPS not expected until OutputStream is closed"); - - buffer = postResponse; - postResponse=null; - - // If null comes back then probably the URL wasn't found. - - if ( null == buffer ) - throw new FileNotFoundException( getURL().toString() ); - - ins = new ByteArrayInputStream( buffer ); - } else { - ins = new BufferedInputStream( new BrowserHttpsInputStream( this - ) ); - } - - // Check if we have response headers, if we don't we are going to - // enter some heuristic values for the headers we can - if (responseHeaders == null) - responseHeaders = new MessageHeader(); - - String contentType= getHeaderField("Content-Type"); - - if (contentType==null) { - try { - contentType = guessContentTypeFromStream(ins); - } catch(java.io.IOException e) { - } - if (contentType == null) { - if (url.getFile().endsWith("/")) { - contentType = "text/html"; - } else { - contentType = guessContentTypeFromName(url.getFile()); - } - if (contentType == null) - contentType = "content/unknown"; - } - responseHeaders.add("Content-Type", contentType); - } - - if ( null != buffer ) - responseHeaders.setIfNotSet("Content-Length",String.valueOf(buffer.length)); - } - - return ins; - } - - InputStream ins = null; - - OutputStream outs = null; - - /** - * Returns an output stream that writes to this connection. - * - * @return an output stream that writes to this connection. - * @exception IOException if an I/O error occurs while - * creating the output stream. - * @exception UnknownServiceException if the protocol does not support - * output. - * @since JDK1.0 - */ - public OutputStream getOutputStream() throws IOException { - - if (!doOutput) - throw new ProtocolException("cannot write to a URLConnection" - + " if doOutput=false - call setDoOutput(true)"); - - if (ins!=null) - throw new ProtocolException("Cannot write output after reading input."); - - if (!connected) - connect(); - - if (outs == null) - outs = new BrowserHttpsOutputStream(this); - - return outs; - } - - - byte[] postResponse = null; - boolean postResponseReady = false; -} diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/https/Handler.java b/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/https/Handler.java deleted file mode 100644 index b65bfba1ef3..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/https/Handler.java +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: Handler.java,v 1.1.1.1 2001-05-09 17:30:00 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* - * @(#)Handler.java 1.44 96/11/24 - * - * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved. - * - * This software is the confidential and proprietary information of Sun - * Microsystems, Inc. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Sun. - * - * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE - * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES - * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING - * THIS SOFTWARE OR ITS DERIVATIVES. - * - * CopyrightVersion 1.3 - * - * Java Plug-in - * - * @author Jerome Dochez - */ - -/*- - * HTTP stream opener - */ - -package sun.jvmp.jpav.protocol.jdk12.https; - -import java.io.IOException; -import java.net.URL; - -/** open an http input stream given a URL */ -public class Handler extends sun.jvmp.jpav.protocol.jdk12.http.Handler { - - /* - *

- * Delegate to the Https connection - *

- */ - public java.net.URLConnection openConnection(URL u) throws IOException { - - /* for now, SSL export is legal, so this extension can be presented */ - /* - try { - // Try if SSL extension is installed. - Class sslSession = Class.forName("javax.net.ssl.SSLSession"); - return new HttpsURLConnection(u, this); - } - catch (Throwable e) { - // else use browser HTTPS support. - return new BrowserHttpsURLConnection(u); - } */ - return new BrowserHttpsURLConnection(u); - } -} diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/jar/Handler.java b/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/jar/Handler.java deleted file mode 100644 index 65195bdb34d..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/jpav/protocol/jdk12/jar/Handler.java +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: Handler.java,v 1.1.1.1 2001-05-09 17:30:00 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* - * @(#)Handler.java 1.1 99/08/17 - * - * Copyright © 1999 by Sun Microsystems, Inc., - * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. - * All rights reserved. - * - * This software is the confidential and proprietary information - * of Sun Microsystems, Inc. ("Confidential Information"). You - * shall not disclose such Confidential Information and shall use - * it only in accordance with the terms of the license agreement - * you entered into with Sun. - */ - -package sun.jvmp.jpav.protocol.jdk12.jar; - -/* - * Jar URL Handler for plugin - */ -public class Handler extends sun.net.www.protocol.jar.Handler { -} diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/mozilla/MozillaAppletPeer.java b/mozilla/java/waterfall/wf/java/sun/jvmp/mozilla/MozillaAppletPeer.java deleted file mode 100644 index c9fce8c5280..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/mozilla/MozillaAppletPeer.java +++ /dev/null @@ -1,265 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: MozillaAppletPeer.java,v 1.1.1.1 2001-05-09 17:30:00 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.mozilla; - -import sun.jvmp.*; -import sun.jvmp.security.*; -import sun.jvmp.applet.*; -import java.util.Hashtable; -import java.net.URL; -import java.net.MalformedURLException; -import java.applet.*; -import java.awt.Frame; - -public class MozillaAppletPeer extends WFAppletContext - implements HostObjectPeer, sun.jvmp.javascript.JSContext -{ - private int m_id; - private int m_winid; - private long m_params = 0; - MozillaPeerFactory m_factory; - WFAppletViewer m_viewer = null; - private boolean m_stopped = true; - protected JSObject m_js = null; - PluggableJVM jvm; - - MozillaAppletPeer(MozillaHostObjectPeer fake, int id) - { - m_factory = fake.m_factory;; - jvm = m_factory.m_jvm; - jvm.trace("CREATED APPLET OBJECT: "+this, - PluggableJVM.LOG_DEBUG); - m_id = id; - m_winid = 0; - } - - public int getID() - { - return m_id; - } - - public void setID(int id) - { - if (m_id != 0) return; - m_id = id; - } - public int handleEvent(SecurityCaps caps, int eventID, long eventData) - { - int retval = 0; - //jvm.trace("GOT EVENT "+eventID+"!!!"); - switch (eventID) - { - case PE_CREATE: - retval = 1; - break; - case PE_SETTYPE: - jvm.trace("SETTYPE called twice - IGNORED", - PluggableJVM.LOG_WARNING); - retval = 1; - break; - case PE_SETWINDOW: - jvm.trace("PE_SETWINDOW", PluggableJVM.LOG_DEBUG); - m_winid = (int)eventData; - retval = handleSetWindow(); - break; - case PE_NEWPARAMS: - m_params = eventData; - retval = handleNewParams(); - break; - case PE_DESTROY: - retval = destroy(caps); - break; - case PE_STOP: - retval = 1; - // do it before stop, as after we can't be sure - // our browser peer is still alive - m_stopped = true; - if (m_viewer != null) m_viewer.stopApplet(); - break; - case PE_START: - retval = 1; - m_stopped = false; - m_viewer.startApplet(); - break; - case PE_GETPEER: - // this call is handled in both ways - direct and - // queued as policy on place where to handle - // JS calls can be changed on Mozilla side - // At least for now it works OK with both cases - retval = handleCall(caps, PE_GETPEER, eventData); - break; - default: - retval = 0; - } - return retval; - } - - public int handleCall(SecurityCaps caps, int arg1, long arg2) - { - int retval = 0; - switch (arg1) - { - case PE_GETPEER: - if (m_viewer == null) break; - Object o = null; - switch (m_viewer.getLoadingStatus()) - { - case sun.applet.AppletPanel.APPLET_START: - o = m_viewer.getApplet(); - break; - case sun.applet.AppletPanel.APPLET_ERROR: - o = null; - break; - default: - jvm.trace("XXX: Applet loading in progress....", - PluggableJVM.LOG_WARNING); - // here we just return NULL, as for the moment no valid - // applet object exist - if someone really needs this - // object - call later - break; - } - nativeReturnJObject(o, arg2); - retval = 1; - break; - default: - retval = 0; - } - return retval; - } - - public int destroy(SecurityCaps caps) - { - jvm.trace("DESTROY", PluggableJVM.LOG_DEBUG); - finalizeParams(); - m_params = 0; - m_stopped = true; - if (m_viewer != null) { - m_viewer.destroyApplet(2500); - m_viewer = null; - } - return 1; - } - - public HostObjectPeerFactory getFactory() - { - return m_factory; - } - - private int handleNewParams() - { - String[][] params = getParams(); - String[] keys = params[0]; - String[] vals = params[1]; - URL docbase; - Hashtable hparams = new Hashtable(); - for (int i=0; i < keys.length; i++) - hparams.put(keys[i].toLowerCase(), vals[i]); - //hparams.put("OWNER", this); - //hparams.put("ID", new Integer(m_id)); - try - { - docbase = new URL((String)hparams.get("docbase")); - } - catch (MalformedURLException e) - { - jvm.trace("invalid docbase due "+e, - PluggableJVM.LOG_ERROR); - return 0; - } - m_viewer = m_factory.m_mgr.createAppletViewer(this, - m_factory, - hparams); - m_viewer.setDocumentBase(docbase); - return handleSetWindow(); - } - - private int handleSetWindow() - { - if (m_stopped) return 0; - if (m_winid != 0) { - Frame f = jvm.getFrameWithId(m_winid); - if (f != null) m_viewer.setWindow(f); - } - return 1; - } - /** - * From AppletContext - */ - public void showStatus(String string) - { - //PluggableJVM.trace("Status: "+string); - // calls back peer in Mozilla - if (m_stopped) return; - nativeShowStatus(string); - } - - public void showDocument(URL url, String target) - { - // never pass events after stop() - otherwise - // we'll crash the browser - if (m_stopped) return; - // calls back peer in Mozilla - nativeShowDocument(url.toString(), target); - } - - public void showDocument(URL url) - { - showDocument(url, "_top"); - } - - /** - * From JSContext - */ - public netscape.javascript.JSObject getJSObject() - { - // check if we got params from browser - fail otherwise - if (m_params == 0) return null; - if (m_js == null) - m_js = new sun.jvmp.mozilla.JSObject(m_params); - return m_js; - } - // duplicates of nsIJavaObjectInfo methods - // funny way to return 2 arrays of strings - native protected String[][] getParams(); - native protected void finalizeParams(); - native protected boolean nativeShowStatus(String status); - native protected boolean nativeShowDocument(String url, - String target); - // method to write jobject ret to native pointer ptr - native protected void nativeReturnJObject(Object ret, long ptr); - // XXX: add others -}; - - - - - - - - - - diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/mozilla/MozillaHostObjectPeer.java b/mozilla/java/waterfall/wf/java/sun/jvmp/mozilla/MozillaHostObjectPeer.java deleted file mode 100644 index 883d8e0a8c9..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/mozilla/MozillaHostObjectPeer.java +++ /dev/null @@ -1,107 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: MozillaHostObjectPeer.java,v 1.1.1.1 2001-05-09 17:30:00 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.mozilla; - -import sun.jvmp.*; -import sun.jvmp.security.*; - -public class MozillaHostObjectPeer implements HostObjectPeer -{ - private int m_id = 0; - private long m_data = 0; - private HostObjectPeer m_realPeer = null; - MozillaPeerFactory m_factory = null; - - public MozillaHostObjectPeer(MozillaPeerFactory factory, int version) - { - m_factory = factory; - } - - public int getID() - { - return m_id; - } - - public void setID(int id) - { - if (m_id != 0) return; - m_id = id; - } - - public int handleEvent(SecurityCaps caps, int eventID, long eventData) - { - int retval = 0; - // forward functionality to the real peer - if (m_realPeer != null) - return m_realPeer.handleEvent(caps, eventID, eventData); - switch (eventID) - { - case PE_CREATE: - retval = 1; - break; - case PE_SETTYPE: - switch((int)eventData) - { - case PT_APPLET: - case PT_OBJECT: - m_realPeer = new MozillaAppletPeer(this, m_id); - // maybe send CREATE event from here? - retval = 1; - break; - default: - m_factory.m_jvm.trace("Unknown tag type", - PluggableJVM.LOG_WARNING); - break; - } - break; - default: - retval = 0; - break; - } - return retval; - } - public int destroy(SecurityCaps caps) - { - if (m_realPeer != null) - return m_realPeer.destroy(caps); - return 0; - } - - public int handleCall(SecurityCaps caps, int arg1, long arg2) - { - if (m_realPeer != null) - return m_realPeer.handleCall(caps, arg1, arg2); - return 0; - } - - public HostObjectPeerFactory getFactory() - { - return m_factory; - } -}; - - diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/mozilla/MozillaPeerFactory.java b/mozilla/java/waterfall/wf/java/sun/jvmp/mozilla/MozillaPeerFactory.java deleted file mode 100644 index 26586ba5b02..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/mozilla/MozillaPeerFactory.java +++ /dev/null @@ -1,237 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: MozillaPeerFactory.java,v 1.1.1.1 2001-05-09 17:30:00 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.mozilla; - -import sun.jvmp.*; -import sun.jvmp.security.*; -import sun.jvmp.applet.*; -import java.net.*; -import java.util.StringTokenizer; -import java.util.*; -import java.security.*; - -public class MozillaPeerFactory implements HostObjectPeerFactory, - AccessControlDecider, - BrowserSupport -{ - protected final String cid = "@sun.com/wf/mozilla/appletpeer;1"; - protected final int version = 1; - PluggableJVM m_jvm = null; - protected long m_params = 0; - protected int m_id; - private static boolean initialized = false; - protected URL[] m_codebase; - AppletManager m_mgr; - - protected MozillaPeerFactory(PluggableJVM jvm, long data) - throws Exception - { - loadLibrary(); - m_jvm = jvm; - m_params = data; - /* as we could load only one factory, this will allow - generic operations, like JS evaluation, to be performed without - any applets at all */ - JSObject.m_evaluator = data; - m_mgr = new AppletManager(jvm); - try { - m_codebase = null; - URLClassLoader cl = - (URLClassLoader)this.getClass().getClassLoader(); - if (cl != null) m_codebase = cl.getURLs(); - } catch (ClassCastException e) { - // do nothing here - } - System.setSecurityManager(new MozillaSecurityManager()); - } - - public static HostObjectPeerFactory start(PluggableJVM jvm, Long data) - { - MozillaPeerFactory factory = null; - try { - factory = new MozillaPeerFactory(jvm, data.longValue()); - } catch (Exception e) { - jvm.trace("MOZILLA FACTORY NOT CREATED", PluggableJVM.LOG_ERROR); - return null; - } - return factory; - } - - public String getCID() - { - return cid; - } - - public HostObjectPeer create(int version) - { - return new MozillaHostObjectPeer(this, version); - } - - public int handleEvent(SecurityCaps caps, - int eventID, - long eventData) - { - return 1; - } - - private native int nativeHandleCall(int arg1, long arg2); - - public int handleCall(SecurityCaps caps, int arg1, long arg2) - { - int rv = 0; - if (arg1 > 0) - rv = nativeHandleCall(arg1, arg2); - else - rv = 1; - return rv; - } - - public int destroy(SecurityCaps caps) - { - return 1; - } - - public PermissionCollection getPermissions(CodeSource codesource) - { - Permissions perms = new Permissions(); - URL location = codesource.getLocation(); - if (m_codebase != null && location != null) { - for (int i=0; i - */ - -package sun.jvmp.mozilla; - -import sun.jvmp.*; -import sun.jvmp.security.*; -import sun.jvmp.applet.*; -import java.security.*; - -public class MozillaSecurityManager extends WFAppletSecurityManager -{ - public void checkPackageAccess(final String p) - { - //System.err.println("checkPackageAccesss: "+p); - // this check used to prevent infinite recursion when calling implies() - // in JavaScriptProtectionDomain,, as it has to load some classes - if (p.equals("sun.jvmp.mozilla")) - { - return; - } - super.checkPackageAccess(p); - } - - public void checkPermission(Permission p) - { - //System.err.println("checkPermission: "+p); - super.checkPermission(p); - } - -} diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/netscape4/MozillaAppletPeer.java b/mozilla/java/waterfall/wf/java/sun/jvmp/netscape4/MozillaAppletPeer.java deleted file mode 100644 index c70d1194e71..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/netscape4/MozillaAppletPeer.java +++ /dev/null @@ -1,248 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: MozillaAppletPeer.java,v 1.1.1.1 2001-05-09 17:30:02 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.netscape4; - -import sun.jvmp.*; -import sun.jvmp.security.*; -import sun.jvmp.applet.*; -import java.util.Hashtable; -import java.net.URL; -import java.net.MalformedURLException; -import java.lang.reflect.*; - -public class MozillaAppletPeer extends WFAppletContext - implements HostObjectPeer -{ - private int m_id; - private int m_winid; - //private long m_params; - NetscapePeerFactory m_factory; - AppletViewer m_viewer = null; - private boolean m_stopped = true; - - MozillaAppletPeer(MozillaHostObjectPeer fake, int id) - { - //PluggableJVM.trace("CREATED APPLET OBJECT"); - m_factory = fake.m_factory; - m_id = id; - m_winid = 0; - // XXX: get it from browser - /* - ActivatorAppletPanel.initEnvironment(ActivatorAppletPanel.PROXY_TYPE_MANUAL, - "http=webcache-cup:8080", - "dubhe1", - null); - */ - } - - public int getID() - { - return m_id; - } - - public void setID(int id) - { - if (m_id != 0) return; - m_id = id; - } - public int handleEvent(SecurityCaps caps, int eventID, long eventData) - { - int retval = 0; - PluggableJVM jvm = m_factory.m_jvm; - jvm.trace("GOT EVENT "+eventID+"!!!", PluggableJVM.LOG_DEBUG); - switch (eventID) - { - case PE_CREATE: - retval = 1; - break; - case PE_SETTYPE: - jvm.trace("SETTYPE called twice - IGNORED", - PluggableJVM.LOG_WARNING); - retval = 1; - break; - case PE_SETWINDOW: - jvm.trace("PE_SETWINDOW", PluggableJVM.LOG_DEBUG); - m_winid = (int)eventData; - retval = handleSetWindow(); - break; - case PE_NEWPARAMS: - jvm.trace("PE_NEWPARAMS", PluggableJVM.LOG_DEBUG); - //m_params = eventData; - // execute it async - retval = handleNewParams(this, caps); - //retval = 1; - break; - case PE_DESTROY: - retval = destroy(caps); - break; - case PE_STOP: - retval = 1; - // do it before stop, as after we can't be sure - // our browser peer is still alive - m_stopped = true; - if (m_viewer != null) m_viewer.stopApplet(); - break; - case PE_START: - retval = 1; - m_stopped = false; - m_viewer.startApplet(); - break; - default: - retval = 0; - } - return retval; - } - - public int handleCall(SecurityCaps caps, int arg1, long arg2) - { - return 1; - } - - - public int destroy(SecurityCaps caps) - { - m_factory.m_jvm.trace("DESTROY", PluggableJVM.LOG_DEBUG); - m_stopped = true; - if (m_viewer != null) { - m_viewer.destroyApplet(5000); - m_viewer = null; - } - return 1; - } - - int handleNewParams(Object arg, SecurityCaps caps) - { - if (arg != null) - { - Method m; - try { - m = arg.getClass().getDeclaredMethod("handleNewParams", - new Class[] {Object.class}); - } catch (Exception e) { - m_factory.m_jvm.trace("No handleNewParams: "+e, - PluggableJVM.LOG_ERROR); - return 0; - } - AsyncExecutor ex = - new AsyncExecutor(arg, m, new Object[] {null}); - ex.start(); - return 1; - } - String[][] params = getParams(); - String[] keys = params[0]; - String[] vals = params[1]; - URL docbase; - Hashtable hparams = new Hashtable(); - for (int i=0; i < keys.length; i++) - hparams.put(keys[i].toLowerCase(), vals[i]); - //hparams.put("OWNER", this); - //hparams.put("ID", new Integer(m_id)); - try - { - docbase = new URL((String)hparams.get("docbase")); - } - catch (MalformedURLException e) - { - m_factory.m_jvm.trace("invalid docbase due "+e, - PluggableJVM.LOG_WARNING); - return 0; - } - m_viewer = m_factory.m_mgr.createAppletViewer(this, - m_factory, - hparams); - m_viewer.setDocumentBase(docbase); - handleEvent(caps, PE_START, 0); - return handleSetWindow(); - } - - private int handleSetWindow() - { - if (m_stopped) return 0; - if (m_winid != 0) { - Frame f = jvm.getFrameWithId(m_winid); - if (f != null) m_viewer.setWindow(f); - } - return 1; - } - - public void showStatus(String string) - { - // calls back peer in Mozilla - if (m_stopped) return; - nativeShowStatus(string); - } - - public void showDocument(URL url, String target) - { - // never pass events after stop() - otherwise - // we'll crash the browser - if (m_stopped) return; - // calls back peer in Mozilla - //PluggableJVM.trace("showDocument: "+url); - nativeShowDocument(url.toString(), target); - } - - public void showDocument(URL url) - { - showDocument(url, "_top"); - } - - public HostObjectPeerFactory getFactory() - { - return m_factory; - } - - // duplicates of nsIJavaObjectInfo methods - // funny way to return 2 arrays of strings - native protected String[][] getParams(); - native protected boolean nativeShowStatus(String status); - native protected boolean nativeShowDocument(String url, - String target); - // XXX: add others -}; - - -class AsyncExecutor extends Thread -{ - Object o; - Method m; - Object[] args; - AsyncExecutor(Object o, Method m, Object[] args) - { - this.o = o; this.m = m; this.args = args; - } - public void run() - { - try { - m.invoke(o, args); - } catch (Exception e) { - } - } -} - - - diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/netscape4/MozillaHostObjectPeer.java b/mozilla/java/waterfall/wf/java/sun/jvmp/netscape4/MozillaHostObjectPeer.java deleted file mode 100644 index 73e90476289..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/netscape4/MozillaHostObjectPeer.java +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: MozillaHostObjectPeer.java,v 1.1.1.1 2001-05-09 17:30:02 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.netscape4; - -import sun.jvmp.*; -import sun.jvmp.security.*; - -public class MozillaHostObjectPeer implements HostObjectPeer -{ - private int m_id = 0; - private long m_data = 0; - private HostObjectPeer m_realPeer = null; - NetscapePeerFactory m_factory; - - public MozillaHostObjectPeer(NetscapePeerFactory factory, - int version) - { - m_factory = factory; - } - - public int getID() - { - return m_id; - } - - public void setID(int id) - { - if (m_id != 0) return; - m_id = id; - } - - - public int handleEvent(SecurityCaps caps, int eventID, long eventData) - { - int retval = 0; - //Plugin.trace("MozillaHostObjectPeer.handleEvent: "+eventID); - // forward functionality to the real peer - if (m_realPeer != null) - return m_realPeer.handleEvent(caps, eventID, eventData); - switch (eventID) - { - case PE_CREATE: - retval = 1; - break; - case PE_SETTYPE: - switch((int)eventData) - { - case PT_APPLET: - case PT_OBJECT: - m_realPeer = new MozillaAppletPeer(this, m_id); - // maybe send CREATE event from here? - retval = 1; - break; - default: - m_factory.m_jvm.trace("Unknown tag type", - PluggableJVM.LOG_WARNING); - break; - } - break; - default: - retval = 0; - break; - } - return retval; - } - - public int handleCall(SecurityCaps caps, int arg1, long arg2) - { - return 1; - } - - public int destroy(SecurityCaps caps) - { - if (m_realPeer != null) - return m_realPeer.destroy(caps); - return 0; - } - - public HostObjectPeerFactory getFactory() - { - return m_factory; - } -}; - - diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/netscape4/NetscapePeerFactory.java b/mozilla/java/waterfall/wf/java/sun/jvmp/netscape4/NetscapePeerFactory.java deleted file mode 100644 index 2d13066b13b..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/netscape4/NetscapePeerFactory.java +++ /dev/null @@ -1,141 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: NetscapePeerFactory.java,v 1.1.1.1 2001-05-09 17:30:03 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.netscape4; - -import sun.jvmp.*; -import sun.jvmp.security.*; -import java.security.*; - -public class NetscapePeerFactory implements HostObjectPeerFactory, - AccessControlDecider -{ - protected final String cid = "@sun.com/wf/netscape4/appletpeer;1"; - protected final int version = 1; - protected int m_id; - PluggableJVM m_jvm; - - protected NetscapePeerFactory(PluggableJVM jvm) - throws Exception - { - m_jvm = jvm; - loadLibrary(); - } - - public static HostObjectPeerFactory start(PluggableJVM jvm) - { - NetscapePeerFactory factory = null; - try - { - factory = new NetscapePeerFactory(jvm); - } - catch (Exception e) - { - jvm.trace("NETSCAPE 4 FACTORY NOT CREATED", - PluggableJVM.LOG_ERROR); - return null; - } - return factory; - } - public String getCID() - { - return cid; - } - public HostObjectPeer create(int version) - { - return new MozillaHostObjectPeer(this, version); - } - - public int handleEvent(SecurityCaps caps, - int eventID, - long eventData) - { - return 1; - } - - public int handleCall(SecurityCaps caps, int arg1, long arg2) - { - return 1; - } - - public int destroy(SecurityCaps caps) - { - return 1; - } - - public PermissionCollection getPermissions(CodeSource codesource) - { - Permissions perms = new Permissions(); - perms.add(new RuntimePermission("accessClassInPackage.sun.jvmp.netscape4")); - return perms; - } - - public int decide(CallingContext ctx, String principal, int cap_no) - { - return NA; - } - - public boolean belongs(int cap_no) - { - return false; - } - - private void loadLibrary() throws UnsatisfiedLinkError - { - String libname = "wf_netscape4"; - try - { - System.loadLibrary(libname); - } - catch (UnsatisfiedLinkError ex) - { - m_jvm.trace("System could not load DLL: " + libname, - PluggableJVM.LOG_ERROR); - m_jvm.trace("Path is:" + - System.getProperty("java.library.path"), - PluggableJVM.LOG_WARNING); - m_jvm.trace(ex.toString(), - PluggableJVM.LOG_WARNING); - throw ex; - }; - } - public int getID() - { - return m_id; - } - - public void setID(int id) - { - if (m_id != 0) return; - m_id = id; - } -} - - - - - - diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/security/AccessControlDecider.java b/mozilla/java/waterfall/wf/java/sun/jvmp/security/AccessControlDecider.java deleted file mode 100644 index 8611dcbe475..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/security/AccessControlDecider.java +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: AccessControlDecider.java,v 1.1.1.1 2001-05-09 17:30:03 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.security; - -public interface AccessControlDecider -{ - final int NA = 0; /* N/A */ - final int AC = 1; /* allow chained */ - final int AF = 2; /* allow final */ - final int FC = 3; /* forbid chained */ - final int FF = 4; /* forbid final */ - - /** - * check this decider decision on this capability, using this - * calling context and principal - */ - int decide(CallingContext ctx, String principal, - int cap_no); - - /** - * check if this capablity belongs to the area of decision of - * this checker - */ - boolean belongs(int cap_no); -} diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/security/CallingContext.java b/mozilla/java/waterfall/wf/java/sun/jvmp/security/CallingContext.java deleted file mode 100644 index 022d1f0ade3..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/security/CallingContext.java +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: CallingContext.java,v 1.1.1.1 2001-05-09 17:30:03 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.security; - -import java.security.*; - -public class CallingContext -{ - private AccessControlContext acc; - private SecurityCaps caps; - private ProtectionDomain domain; - - public CallingContext(ProtectionDomain domain, byte[] raw_caps) - { - acc = AccessController.getContext(); - this.domain = domain; - caps = new SecurityCaps(raw_caps); - } - - public CallingContext(SecurityCaps caps) - { - this.caps = caps; - } -} diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/security/ExtSecurityManager.java b/mozilla/java/waterfall/wf/java/sun/jvmp/security/ExtSecurityManager.java deleted file mode 100644 index c05463b82da..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/security/ExtSecurityManager.java +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: ExtSecurityManager.java,v 1.1.1.1 2001-05-09 17:30:03 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.security; -import java.util.*; -import sun.jvmp.*; - -public class ExtSecurityManager -{ - protected Vector checkers; - PluggableJVM jvm; - - public ExtSecurityManager(PluggableJVM owner) - { - checkers = new Vector(); - jvm = owner; - } - - public void registerDecider(AccessControlDecider decider, - SecurityCaps caps, - SecurityCaps mask) - { - - } - - public void unregisterCapsChecker(AccessControlDecider decider) - { - } -} diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/security/SecurityCaps.java b/mozilla/java/waterfall/wf/java/sun/jvmp/security/SecurityCaps.java deleted file mode 100644 index 5927087f0a4..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/security/SecurityCaps.java +++ /dev/null @@ -1,103 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: SecurityCaps.java,v 1.1.1.1 2001-05-09 17:30:04 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.security; - -import sun.jvmp.PluggableJVM; - -public class SecurityCaps -{ - // keep in sync with jvmp_caps.h - final int JVMP_MAX_CAPS_BYTES = 128; - final int JVMP_MAX_CAPS = JVMP_MAX_CAPS_BYTES * 8; - final int JVMP_MAX_SYS_CAP_BYTES = 2; - final int JVMP_MAX_SYS_CAP = JVMP_MAX_SYS_CAP_BYTES * 8; - - byte bits[]; - - public SecurityCaps() - { - bits = new byte[JVMP_MAX_CAPS_BYTES]; - for (int i=0; i= JVMP_MAX_CAPS) return false; - return - (((bits[action_no >> 3]) & (1 << (action_no & 0x7))) != 0) ? true : false; - } - - public boolean isForbidden(int action_no) - { - return !isAllowed(action_no); - } - - public boolean permits(SecurityCaps act) - { - // boolean res = true; -// for (int i=0; i - */ - -package sun.jvmp.security; - -import sun.jvmp.*; -import java.security.*; -import java.net.*; -import java.util.*; - -public class WFPolicy extends sun.security.provider.PolicyFile -{ - URL wfcodebase; - PluggableJVM jvm; - String wfextpath; - public WFPolicy(PluggableJVM jvm, URL wfcodebase) - { - this.wfcodebase = wfcodebase; - wfextpath = wfcodebase.getPath()+"ext"; - this.jvm = jvm; - } - - protected boolean isAllPermissionGranted(CodeSource codesource) - { - URL codebase = codesource.getLocation(); - if (codebase == null) return false; - if (wfcodebase.equals(codebase)) return true; - //System.out.println("path="+codebase.getPath()+" extpath="+wfextpath+" proto="+codebase.getProtocol()); - String path = codebase.getPath(); - if ("file".equals(codebase.getProtocol()) && path != null - && path.startsWith(wfextpath)) return true; - return false; - } - - public PermissionCollection getPermissions(CodeSource codesource) - { - jvm.trace("asked perms for: "+codesource, PluggableJVM.LOG_DEBUG); - Permissions perms = new Permissions(); - if (isAllPermissionGranted(codesource)) - { - perms.add(new java.security.AllPermission()); - jvm.trace("all perms granted to "+codesource, - PluggableJVM.LOG_DEBUG); - return perms; - } - PermissionCollection p = super.getPermissions(codesource); - if (p != null) - { - for (Enumeration e=p.elements(); e.hasMoreElements(); ) - perms.add((Permission)e.nextElement()); - } - p = jvm.getExtensionsPermissions(codesource); - if (p != null) - { - for (Enumeration e=p.elements(); e.hasMoreElements(); ) - perms.add((Permission)e.nextElement()); - } - return perms; - } -} diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/test/MyActionListener.java b/mozilla/java/waterfall/wf/java/sun/jvmp/test/MyActionListener.java deleted file mode 100644 index 695da3dafcc..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/test/MyActionListener.java +++ /dev/null @@ -1,44 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: MyActionListener.java,v 1.1.1.1 2001-05-09 17:30:04 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.test; - -import java.awt.*; -import java.awt.event.*; - -class MyActionListener implements ActionListener -{ - private String m_string = null; - public MyActionListener(String s) - { - m_string = s; - } - public void actionPerformed(ActionEvent e) - { - MyDialog dlg = new MyDialog(m_string); - System.out.println("Message is "+m_string); - } -}; diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/test/MyDialog.java b/mozilla/java/waterfall/wf/java/sun/jvmp/test/MyDialog.java deleted file mode 100644 index f8edefabc4b..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/test/MyDialog.java +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: MyDialog.java,v 1.1.1.1 2001-05-09 17:30:04 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.test; - -import java.awt.*; -import java.awt.event.*; - -class MyDialog extends Frame -{ - private Button b; - public MyDialog(String text) - { - b = new Button(text); - b.setBounds(0, 0, 40, 40); - setLayout(new FlowLayout(FlowLayout.CENTER)); - b.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - dispose(); - } - - }); - setSize(200,150); - add(b); - setLocation(200, 200); - pack(); - show(); - } -} diff --git a/mozilla/java/waterfall/wf/java/sun/jvmp/test/TestPeerFactory.java b/mozilla/java/waterfall/wf/java/sun/jvmp/test/TestPeerFactory.java deleted file mode 100644 index ec0b2c6759b..00000000000 --- a/mozilla/java/waterfall/wf/java/sun/jvmp/test/TestPeerFactory.java +++ /dev/null @@ -1,251 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: TestPeerFactory.java,v 1.1.1.1 2001-05-09 17:30:04 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -package sun.jvmp.test; - -import java.awt.*; -import java.security.*; -import sun.jvmp.*; -import sun.jvmp.security.*; - -class TestObjectPeer implements HostObjectPeer -{ - private int m_id = 0; - private long m_data = 0; - private HostObjectPeer m_realPeer = null; - TestPeerFactory m_factory = null; - SynchroObject so = null; - - public TestObjectPeer(TestPeerFactory factory, int version) - { - m_factory = factory; - } - - public int getID() - { - return m_id; - } - - public void setID(int id) - { - if (m_id != 0) return; - m_id = id; - } - - public HostObjectPeerFactory getFactory() - { - return m_factory; - } - - protected void performTest(int id) - { - Frame frame = null; - MyActionListener l1 = new MyActionListener("First button"); - MyActionListener l2 = new MyActionListener("Second button"); - frame = m_factory.m_jvm.getFrameWithId(id); - if (frame == null) return; - frame.setLayout(new FlowLayout(FlowLayout.CENTER)); - Button b1 = new Button("Test 1"); - Button b2 = new Button("Test 2"); - b1.setBounds(0, 0, 40, 40); - b2.setBounds(50, 50, 40, 40); - b1.addActionListener(l1); - b2.addActionListener(l2); - frame.add(b1); - frame.add(b2); - frame.show(); - } - protected void performThreadTest(int id) - { - so = m_factory.m_jvm.getSynchroObjectWithID(id); - if (so == null) { - m_factory.m_jvm.trace("no such synchro object: "+id, - PluggableJVM.LOG_WARNING); - return; - } - Thread t = new Thread(new Runnable() - { - public void run() - { - int millis = 7000; - PluggableJVM jvm = m_factory.m_jvm; - jvm.trace("New thread started. Trying to get lock.", - PluggableJVM.LOG_INFO); - if (millis > 0) - { - so._lock(); - jvm.trace("Lock acquired, sleeping "+millis+" millis...", - PluggableJVM.LOG_INFO); - try { - Thread.sleep(millis); - } catch (InterruptedException e) {} - jvm.trace("notifying sleeping thread", - PluggableJVM.LOG_INFO); - so._notifyAll(); - so._unlock(); - jvm.trace("Unlock and done", - PluggableJVM.LOG_INFO); - } - } - }); - t.start(); - } - - public int handleEvent(SecurityCaps caps, int eventID, long eventData) - { - int retval = 0; - m_factory.m_jvm.trace("TestObjectPeer.handleEvent: "+eventID, - PluggableJVM.LOG_DEBUG); - switch (eventID) - { - case PE_CREATE: - retval = 1; - break; - case 20: - performTest((int)eventData); - retval = 1; - break; - case 666: - performThreadTest((int)eventData); - retval = 1; - break; - default: - retval = 0; - break; - } - return retval; - } - - public int handleCall(SecurityCaps caps, int arg1, long arg2) - { - return 1; - } - - public int destroy(SecurityCaps caps) - { - return 1; - } -}; - -public class TestPeerFactory implements HostObjectPeerFactory, - AccessControlDecider -{ - protected final String cid = "@sun.com/wf/tests/testextension;1"; - protected final int version = 1; - protected PluggableJVM m_jvm = null; - protected int m_id; - protected long m_params = 0; - - protected TestPeerFactory(PluggableJVM jvm, long data) - throws Exception - { - m_jvm = jvm; - m_params = data; - } - - public static HostObjectPeerFactory start(PluggableJVM jvm, Long data) - { - TestPeerFactory factory = null; - try - { - factory = new TestPeerFactory(jvm, data.longValue()); - } - catch (Exception e) - { - jvm.trace("FACTORY NOT CREATED", PluggableJVM.LOG_ERROR); - return null; - } - factory.m_jvm = jvm; - return factory; - } - - public String getCID() - { - return cid; - } - - public HostObjectPeer create(int version) - { - return new TestObjectPeer(this, version); - } - - public int handleEvent(SecurityCaps caps, - int eventID, - long eventData) - { - m_jvm.trace("Event "+eventID+" come to extension "+m_id, - PluggableJVM.LOG_DEBUG); - return 1; - } - - public int handleCall(SecurityCaps caps, int arg1, long arg2) - { - return 1; - } - - public int destroy(SecurityCaps caps) - { - return 1; - } - - public PermissionCollection getPermissions(CodeSource codesource) - { - return null; - } - - public int decide(CallingContext ctx, String principal, int cap_no) - { - return NA; - } - - public boolean belongs(int cap_no) - { - return false; - } - - public int getID() - { - return m_id; - } - - public void setID(int id) - { - if (m_id != 0) return; - m_id = id; - } -}; - - - - - - - - - - - - diff --git a/mozilla/java/waterfall/wf/public/jvmp.h b/mozilla/java/waterfall/wf/public/jvmp.h deleted file mode 100644 index 874ba1cbb98..00000000000 --- a/mozilla/java/waterfall/wf/public/jvmp.h +++ /dev/null @@ -1,314 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: jvmp.h,v 1.1.1.1 2001-05-09 17:30:04 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef _JVMP_H -#define _JVMP_H -/* temporary include to fix subtle problem with includes on WIn32 with VC6.0 */ -#include -#include - -#ifdef _JVMP_IMPLEMENTATION -#define _JVMP_IMPORT_OR_EXPORT JNIEXPORT -#else -#define _JVMP_IMPORT_OR_EXPORT JNIIMPORT -#endif - -#include "jvmp_md.h" -#include "jvmp_drawing.h" -#include "jvmp_threading.h" -#include "jvmp_security.h" -#include "jvmp_vendor.h" -#include "jvmp_extension.h" -#include "jvmp_event.h" -#include "jvmp_errors.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct JVMP_RuntimeContext { - /** - * JVM assostiated with this JVMP object - in some implementations - * may be zero, so you shouldn't rely on this value heavily. - */ - JavaVM* jvm; - /** - * Returns description of this plugin, including: - * underlying JVM version, underlying JVM vendor, vendor-dependent data, - * JVMP version - for details see jvmp_vendor.h. You shouldn't do memory - * management on returned value - it's statically allocated. - */ - jint (JNICALL *JVMP_GetDescription)(JVMP_PluginDescription* *pdesc); - /** - * Does all dirty work on loading and starting Java VM - * with correct arguments. args can be used to pass JVM-specific arguments, - * usually NULL is OK. - * Argument allow_reuse, if JNI_TRUE allow to use - * already running JVM for plugin purposes. May be dangerous, - * if running JVM is not the same that plugin is compiled for. - * Also plugin system classes must be in classpath of this JVM, as current - * JVM specification doesn't allow change classpath after running JVM. - * As additional effect, sets jvm field in JVMP_PluginContext to - * currently running JVM. - */ - jint (JNICALL *JVMP_GetRunningJVM)(JVMP_CallingContext* *pctx, - void* args, - jint allow_reuse); - /** - * Send generic event directly to PluggableJVM. Can be used to - * extend Waterfall API without changing ABI, like ioctl() syscall on Unix. - * Exact time of call execution depends on "priority" - * and current state of event queue. At this point I would like to freeze - * jvmp.h, and all further API extensions should be done using those - * two calls. - * Every WF implementation can have its own set of commands, but suggetsed - * minimum can be found in jvmp_event.h, see JVMP_CMD_*. - * Note - returned value, if != 0 is result of event handling, - * so for all JVMP_Send* calls you should test returned value == JNI_FALSE, - * and avoid returning 0 from custom event handlers, like extension, - * as such return values means that call failed. - */ - jint (JNICALL *JVMP_SendSysEvent)(JVMP_CallingContext* ctx, - jint event, - jlong data, - jint priority); - /** - * Async system call. Exact time of call execution depends on "priority" - * and current state of event queue. - */ - jint (JNICALL *JVMP_PostSysEvent)(JVMP_CallingContext* ctx, - jint event, - jlong data, - jint priority); - /** - * Should stop and unload Java VM - not well implemented in JDK1.3 yet. - * Doesn't stop JVM, if there are unregistered extensions, so unregister - * it first. - */ - jint (JNICALL *JVMP_StopJVM)(JVMP_CallingContext* ctx); - /** - * Registers native window handle (OS dependent, see jvmp_drawing.h) in - * AWT, if succeed you can use PluggableJVM getFrameWithId() method with - * returned id (>0) to obtain this frame on Java side - */ - jint (JNICALL *JVMP_RegisterWindow)(JVMP_CallingContext* ctx, - JVMP_DrawingSurfaceInfo* win, - jint *pID); - /** - * Unregisters native window, ID is invalid after this call. - */ - jint (JNICALL *JVMP_UnregisterWindow)(JVMP_CallingContext* ctx, - jint ID); - /** - * Thread synchronization primitives - */ - /** - * Registers native monitor object (OS dependent, see jvmp_threading.h) in JVM - * if succeed you can use PluggableJVM.getSynchroObjectWithID() - * to obtain SynchroObject, calling _wait(), _notify(), - * _notifyAll() on this object will perform those operation on monitor you - * passed. It leads to obvious granularity problems, but all operations - * must be pretty fast, and it works reasonable. - * In the future, JVM could provide hooks, so it will be possible to use - * JVMP_MonitorInfo to construct java.lang.Object with passed locks and - * monitors, and so Java code shouldn't care about source of synchroobject. - * Now it would require too much JDK work, so using easiest solution. - */ - jint (JNICALL *JVMP_RegisterMonitorObject)(JVMP_CallingContext* ctx, - JVMP_MonitorInfo* monitor, - jint *pID); - /** - * Unregister monitor and destroy assotiated objects. - */ - jint (JNICALL *JVMP_UnregisterMonitorObject)(JVMP_CallingContext* ctx, - jint ID); - - /** - * Attaches current thread to JVM. Creates java.lang.Thread for given thread, - * and register this thread in PluggableJVM, so you can reference it using - * method getThreadWithId(). - * All synchrooperations must happen only after JVMP_AttachThread call - * otherwise error is returned. Really, JVMP_GetRunningJVM and JVMP_GetCallingContext - * call JVMP_AttachCurrentThread, so usually you shouldn't care. - */ - jint (JNICALL *JVMP_AttachCurrentThread)(JVMP_CallingContext* ctx, - jint *pID); - /** - * Detaches current thread from JVM. - * This function must be called by native thread before - * finishing all JVMP operations, as there's no generic way to register - * listener on thread exit - pthread_cleanup_push() is a stupid macros working - * in one block only. - * Also this call frees memory consumed by ctx, so ctx is invalid after this call. - */ - jint (JNICALL *JVMP_DetachCurrentThread)(JVMP_CallingContext* ctx); - - /** - * Gets calling context for further JVMP_* operation - also can be obtained from - * GetRunningJVM call. - */ - jint (JNICALL *JVMP_GetCallingContext)(JVMP_CallingContext* *pctx); - /** - * Extensible event passing(invocation) API. - */ - /** - * Create peer (Java object) as event target. - * vendorID - is unique for application number, - * version should be desired version, or 0 if doesn't matter - * Usually created object is just a wrapper, able to mimic - * more specific HA-dependent objects. Way of object negotiation - * is HA-specific. - * ID returned back can be considered as opaque handle - * for further sync/async events and destroy. - */ - jint (JNICALL *JVMP_CreatePeer)(JVMP_CallingContext* ctx, - const char* cid, - jint version, - jint *target); - /** - * Send an synchronous event to Java peer with some data. - * Waterfall protocol doesn't specify protocol of event passing, - * and format of passed data, it just provides transport. - */ - jint (JNICALL *JVMP_SendEvent)(JVMP_CallingContext* ctx, - jint target, - jint event, - jlong data, - jint priority); - /** - * Send an asynchronous event to Java peer with some data. - * Waterfall protocol doesn't specify protocol of event passing, - * lifetime and format of passed data, it just provides transport. - */ - jint (JNICALL *JVMP_PostEvent)(JVMP_CallingContext* ctx, - jint target, - jint event, - jlong data, - jint priority); - /** - * Destroy Java peer with given ID. - * All pending events will be lost (XXX: or not?). - */ - jint (JNICALL *JVMP_DestroyPeer)(JVMP_CallingContext* ctx, - jint target); - - /** - * Register Waterfall extension DLL (see jvmp_extension.h). - * If succeed, after this call, you can use JVMP_CreatePeer - * with vendorID provided by this extension DLL. - * Maybe Unicode string is better, but not sure yet. - * "data" is arbitrary assotiated with this extension, passed - * to the start() method of extension. - */ - jint (JNICALL *JVMP_RegisterExtension)(JVMP_CallingContext* ctx, - const char* extPath, - jint *pID, - jlong data); - /** - * Send/post event to extension-wide bootstrap class - see - * JVMPExt_GetBootstrapClass() in jvmp_extension.h. - * Could be useful, if ones wish to cooperate with whole extension, - * not only any given peer. "target" is extension ID returned - * by JVMP_RegisterExtension. - */ - jint (JNICALL *JVMP_SendExtensionEvent)(JVMP_CallingContext* ctx, - jint target, - jint event, - jlong data, - jint priority); - jint (JNICALL *JVMP_PostExtensionEvent)(JVMP_CallingContext* ctx, - jint target, - jint event, - jlong data, - jint priority); - /** - * Unregister Waterfall extension DLL. Really it does - * nothing yet. XXX: lifetime - */ - jint (JNICALL *JVMP_UnregisterExtension)(JVMP_CallingContext* ctx, - jint ID); - /** - * Capabilities handling. To perform priveledged actions, - * application must have capability to do it. Those calls intended - * to change capabilities of current calling context. - * It's up to HA extension and JVMP to permit/forbid capability changing, - * using provided pricipal. - * ctx and principal much like username/password pair. - */ - /** - * Tries to enable caps, authenticating with principals. - * On success ctx updated with asked caps, otherwise nothing happens - * and JNI_FALSE returned. Arbitrary set of byte arrays can be used as - * principal. - */ - jint (JNICALL *JVMP_EnableCapabilities)(JVMP_CallingContext* ctx, - JVMP_SecurityCap* caps, - jint num_principals, - jint* principals_len, - jbyte* *principals); - /** - * Drop some capabilities. Some system caps (like JVMP_CAP_SYS_PARITY) - * cannot be dropped. - */ - jint (JNICALL *JVMP_DisableCapabilities)(JVMP_CallingContext* ctx, - JVMP_SecurityCap* caps); - /** - * those methods are useful, if some application needs thread mapping - * "1 -> 1" (not "many -> 1", provided by JVMP_Send* methods). - * Generally using of those calls isn't recommended, - * as it could introduce complicated threading issues in situations, - * where you don't have direct native->Java threads mapping, like - * "green" threads, or remote calls. - **/ - jint (JNICALL *JVMP_DirectPeerCall)(JVMP_CallingContext* ctx, - jint target, - jint arg1, - jlong arg2); - jint (JNICALL *JVMP_DirectExtCall)(JVMP_CallingContext* ctx, - jint target, - jint arg1, - jlong arg2); - jint (JNICALL *JVMP_DirectJVMCall)(JVMP_CallingContext* ctx, - jint arg1, - jlong arg2); - /* buf must be big enough to keep JVMP_MAXERRORLENGTH symbols */ - jint (JNICALL *JVMP_GetLastErrorString)(JVMP_CallingContext* ctx, - char* buf); - /** - * to keep ABI fixed - if adding new methods, decrement number in [] - **/ - void* reserved[10]; -}; - -typedef struct JVMP_RuntimeContext JVMP_RuntimeContext; - -typedef _JVMP_IMPORT_OR_EXPORT jint (JNICALL *JVMP_GetPlugin_t) - (JVMP_RuntimeContext** cx); - -#ifdef __cplusplus -} /* extern "C" */ -#endif -#endif /* _JVMP_H */ diff --git a/mozilla/java/waterfall/wf/public/jvmp_cap_vals.h b/mozilla/java/waterfall/wf/public/jvmp_cap_vals.h deleted file mode 100644 index 71e758410aa..00000000000 --- a/mozilla/java/waterfall/wf/public/jvmp_cap_vals.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: jvmp_cap_vals.h,v 1.1.1.1 2001-05-09 17:30:04 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef _JVMP_CAP_VALS_H -#define _JVMP_CAP_VALS_H -#define JVMP_CAP_SYS_PARITY 0 -#define JVMP_CAP_SYS_SYSTEM 1 -#define JVMP_CAP_SYS_CHCAP 3 -#define JVMP_CAP_SYS_EVENT 2 -#define JVMP_CAP_SYS_SYSEVENT 4 -#define JVMP_CAP_SYS_CALL 5 -#define JVMP_CAP_SYS_SYSCALL 6 -#endif - - diff --git a/mozilla/java/waterfall/wf/public/jvmp_caps.h b/mozilla/java/waterfall/wf/public/jvmp_caps.h deleted file mode 100644 index a5f9e9fdc36..00000000000 --- a/mozilla/java/waterfall/wf/public/jvmp_caps.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: jvmp_caps.h,v 1.1.1.1 2001-05-09 17:30:04 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef _JVMP_CAPS_H -#define _JVMP_CAPS_H -#ifdef __cplusplus -extern "C" { -#endif -#define JVMP_MAX_CAPS_BYTES 128 -#define JVMP_MAX_CAPS JVMP_MAX_CAPS_BYTES * 8 -/* latest system capability used by Waterfall - use JVMP_*_USER_CAP macros - to maintaian user caps */ -#define JVMP_MAX_SYS_CAPS_BYTES 2 -#define JVMP_MAX_SYS_CAPS JVMP_MAX_SYS_CAPS_BYTES * 8 -struct JVMP_SecurityCap -{ - unsigned char bits[JVMP_MAX_CAPS_BYTES]; -}; -/* really action and capability - the same, capability is bitmask and - action is bitfield */ -typedef struct JVMP_SecurityCap JVMP_SecurityCap; -typedef struct JVMP_SecurityCap JVMP_SecurityAction; -#define JVMP_ALLOW_ALL_CAPS(cap) \ - { int _i; for(_i = 0; _i < JVMP_MAX_CAPS_BYTES; _i++) \ - ((cap).bits)[_i] = 0xff; } -/* maybe memset() */ -#define JVMP_FORBID_ALL_CAPS(cap) \ - { int _i; for(_i = 0; _i < JVMP_MAX_CAPS_BYTES; _i++) \ - ((cap).bits)[_i] = 0x0; } -#define JVMP_ALLOW_CAP(cap, action_no) \ - (cap).bits[action_no >> 3] |= 1 << (action_no & 0x7); - -#define JVMP_FORBID_CAP(cap, action_no) \ - (cap).bits[action_no >> 3] &= ~(1 << (action_no & 0x7)); - -#define JVMP_IS_CAP_ALLOWED(cap, action_no) \ - ( ((cap).bits[action_no >> 3]) & (1 << (action_no & 0x7))) ? 1 : 0 -#define JVMP_ALLOW_USER_CAP(cap, cap_no) JVMP_ALLOW_CAP(cap, cap_no + JVMP_MAX_SYS_CAPS) -#define JVMP_FORBID_USER_CAP(cap, cap_no) JVMP_FORBID_CAP(cap, cap_no + JVMP_MAX_SYS_CAPS) -/* not completly safe */ -#define JVMP_FORBID_ALL_USER_CAPS(cap) \ - { int _i; for(_i = JVMP_MAX_SYS_CAPS_BYTES; _i < JVMP_MAX_CAPS_BYTES; _i++) \ - ((cap).bits)[_i] = 0x0; } -#define JVMP_ALLOW_ALL_USER_CAPS(cap) \ - { int _i; for(_i = JVMP_MAX_SYS_CAPS_BYTES; _i < JVMP_MAX_CAPS_BYTES; _i++) \ - ((cap).bits)[_i] = 0xff; } -#define JVMP_SET_CAPS(target, caps) \ - { int _i; for(_i = 0; _i < JVMP_MAX_CAPS_BYTES; _i++) \ - ((target).bits)[_i] |= ((caps).bits)[_i]; } -#define JVMP_RESET_CAPS(target, caps) \ - { int _i; for(_i = 0; _i < JVMP_MAX_CAPS_BYTES; _i++) \ - ((target).bits)[_i] &= ~ ((caps).bits)[_i]; } - -#include "jvmp_cap_vals.h" -#ifdef __cplusplus -} -#endif -#endif - - - diff --git a/mozilla/java/waterfall/wf/public/jvmp_drawing.h b/mozilla/java/waterfall/wf/public/jvmp_drawing.h deleted file mode 100644 index 5f22b8b4e3b..00000000000 --- a/mozilla/java/waterfall/wf/public/jvmp_drawing.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: jvmp_drawing.h,v 1.1.1.1 2001-05-09 17:30:04 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef _JVMP_DRAWING_H -#define _JVMP_DRAWING_H -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Incomplete structure describing platform dependent window handle. - * HWND on Win32, X window handler on X - */ -struct JPluginWindow; - -/* - * The type of a JPluginWindow - it specifies the type of the data structure - * returned in the window field. - */ -enum JPluginWindowType { - JPluginWindowType_Window = 1, - JPluginWindowType_Drawable -}; - -struct JPluginRect { - uint16_t top; - uint16_t left; - uint16_t bottom; - uint16_t right; -}; - -struct JVMP_DrawingSurfaceInfo { - struct JPluginWindow* window; /* Platform specific window handle */ - uint32_t x; /* Position of top left corner relative */ - uint32_t y; /* to a netscape page. */ - uint32_t width; /* Maximum window size */ - uint32_t height; - void* ws_info; /* Platform-dependent additonal data */ - enum JPluginWindowType type; /* Is this a window or a drawable? */ - -}; -typedef struct JVMP_DrawingSurfaceInfo JVMP_DrawingSurfaceInfo; - - -#ifdef __cplusplus -}; -#endif -#endif - - - - - - - - - - diff --git a/mozilla/java/waterfall/wf/public/jvmp_errors.h b/mozilla/java/waterfall/wf/public/jvmp_errors.h deleted file mode 100644 index 14ba7d1aaed..00000000000 --- a/mozilla/java/waterfall/wf/public/jvmp_errors.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: jvmp_errors.h,v 1.1.1.1 2001-05-09 17:30:04 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef _JVMP_ERRORS_H -#define _JVMP_ERRORS_H -#ifdef __cplusplus -extern "C" { -#endif -#define JVMP_MAXERRORLENGTH 1024 -#define JVMP_NUMERRORS 32 - -/* error codes */ -#define JVMP_ERROR_NOERROR 0 -#define JVMP_ERROR_NOSUCHCLASS 1 -#define JVMP_ERROR_NOSUCHMETHOD 2 -#define JVMP_ERROR_FILENOTFOUND 3 -#define JVMP_ERROR_TRANSPORTFAILED 4 -#define JVMP_ERROR_FAILURE 5 -#define JVMP_ERROR_OUTOFMEMORY 6 -#define JVMP_ERROR_NULLPOINTER 7 -#define JVMP_ERROR_INITFAILED 8 -#define JVMP_ERROR_NOACCESS 9 -#define JVMP_ERROR_JAVAEXCEPTION 10 -#define JVMP_ERROR_METHODFAILED 11 -#define JVMP_ERROR_INVALIDARGS 12 -#define JVMP_ERROR_CAPSNOTGIVEN 13 -#ifdef __cplusplus -}; -#endif -#endif diff --git a/mozilla/java/waterfall/wf/public/jvmp_event.h b/mozilla/java/waterfall/wf/public/jvmp_event.h deleted file mode 100644 index 34bd57a94c6..00000000000 --- a/mozilla/java/waterfall/wf/public/jvmp_event.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: jvmp_event.h,v 1.1.1.1 2001-05-09 17:30:05 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef _JVMP_EVENT_H -#define _JVMP_EVENT_H -#ifdef __cplusplus -extern "C" { -#endif -#define JVMP_PRIORITY_LOWEST 1 -#define JVMP_PRIORITY_LOW 20 -#define JVMP_PRIORITY_NORMAL 50 -#define JVMP_PRIORITY_HIGH 80 -#define JVMP_PRIORITY_HIGHEST 100 - -#define JVMP_CMD_CTL_CONSOLE 1 -#ifdef __cplusplus -}; -#endif -#endif diff --git a/mozilla/java/waterfall/wf/public/jvmp_extension.h b/mozilla/java/waterfall/wf/public/jvmp_extension.h deleted file mode 100644 index a8b419a26f3..00000000000 --- a/mozilla/java/waterfall/wf/public/jvmp_extension.h +++ /dev/null @@ -1,108 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: jvmp_extension.h,v 1.1.1.1 2001-05-09 17:30:05 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef _JVMP_EXTENSION_H -#define _JVMP_EXTENSION_H -#ifdef __cplusplus -extern "C" { -#endif -/* XXX: this include should be more generic - different transports */ -#include "shmtran.h" -#include "jvmp_caps.h" -/** - * Usage scenario: - * HA: CreatePeer(id) -> JVM: is extension inited? - * if not yet - look in registry of registred extensions, or just - * ask all registred ext DLL - can they handle this type - use latest - * version of handler, call JVMPExt_Init() of matching DLL, - * load and run bootstrap class - * if yes - just instanciate proper peer, using special factory - * registred by bootstrap class in PluggableJVM. - */ - -struct JVMP_Extension { - /** - * Init native part of this extension. - * Argument is side on which extension is loaded, if in - * separate process situation (0 - not separate process case - * 1 - host side, 2 - JVM side). - */ - jint (JNICALL *JVMPExt_Init)(jint side); - /** - * Shutdown this extension. Usually means nobody wants it anymore. - */ - jint (JNICALL *JVMPExt_Shutdown)(); - /** - * the only function which can be called before Init - * pCID - contract ID, pVersion - version of handler - */ - jint (JNICALL *JVMPExt_GetExtInfo)(const char* *pCID, - jint *pVersion, - JVMP_ExtDescription* *desc); - /** - * Return classpath to find bootstrap Java class, and its name - * Classpath is "|"-separated list of URLs, like - * jar:file:///usr/java/ext/mozilla/moz6_ext.jar|file:///usr/java/ext/mozilla/classes|http://www.mozilla.org/Waterfall/classes - * Name is smth like: sun.jvmp.mozilla.MozillaPeerFactory - */ - jint (JNICALL *JVMPExt_GetBootstrapClass)(char* *bootstrapClassPath, - char* *bootstrapClassName); - /** - * This is extension's callback to schedule request in host - * in different proc or STA situation. - * Different methods executed depending - * on funcno in request, use macros to numerate your functions: - * JVMP_NEW_EXT_FUNCNO(vendorID, funcno). Implementation of this callback - * is application/platform dependent. It can be implemented using - * XtAddEventHandler on X, SendMessage on Win32. - * If local == JNI_TRUE - just execute this request locally. - */ - jint (JNICALL *JVMPExt_ScheduleRequest)(JVMP_ShmRequest* req, jint local); - - /** - * This function reserves capabilities space for this extension. - * Arguments are two caps bitfields - first one is set of capabilities this - * extension is interesting, and secind describes sharing policy on this set - * of caps: - * if bit set - this cap is to be shared. - * After this call for all decisions on caps in this range - * delegated to AccessControlDecider of this extension. - * If access to capability range is shared, then Waterfall chains - * all deciders for given capability, if anyone forbids capability setting - * - this capability not granted. - */ - jint (JNICALL *JVMPExt_GetCapsRange)(JVMP_SecurityCap* caps, - JVMP_SecurityCap* sh_mask); -}; - -typedef struct JVMP_Extension JVMP_Extension; - -typedef _JVMP_IMPORT_OR_EXPORT jint (JNICALL *JVMP_GetExtension_t)(JVMP_Extension** ext); -typedef jint (JNICALL *JVMPExt_ExecuteRequest_t)(JVMP_ShmRequest* req); -#ifdef __cplusplus -}; -#endif -#endif diff --git a/mozilla/java/waterfall/wf/public/jvmp_security.h b/mozilla/java/waterfall/wf/public/jvmp_security.h deleted file mode 100644 index d58dd734453..00000000000 --- a/mozilla/java/waterfall/wf/public/jvmp_security.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: jvmp_security.h,v 1.1.1.1 2001-05-09 17:30:05 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef _JVMP_SECURITY_H -#define _JVMP_SECURITY_H -#ifdef __cplusplus -extern "C" { -#endif -#include "jvmp_caps.h" - -struct JVMP_CallingContext; -typedef struct JVMP_CallingContext JVMP_CallingContext; -struct JVMP_CallingContext { - JVMP_CallingContext* This; /* pointer to this structure */ - JNIEnv *env; /* JNIEnv of the caller. NULL if remote case. - Anyway users of JVMP shouldn't rely on this field.*/ - void* data; /* data for this threading context */ - JVMP_ThreadInfo* source_thread; /* associated thread */ - void* reserved0; /* reserved fields for future using */ - void* reserved1; - void* reserved2; - JVMP_SecurityCap caps; /* current capabilities of this context */ - jbyteArray jcaps; /* cached Java structure to store caps */ - jint err; - /* those functions to simplify work with caps */ - jint (*AllowCap)(JVMP_CallingContext *ctx, - jint cap_no); - jint (*GetCap)(JVMP_CallingContext *ctx, - jint cap_no); - jint (*SetCaps)(JVMP_CallingContext *ctx, - JVMP_SecurityCap *new_caps); - jint (*IsActionAllowed)(JVMP_CallingContext *ctx, - JVMP_SecurityAction *action); -}; -#ifdef __cplusplus -}; -#endif -#endif - - - - diff --git a/mozilla/java/waterfall/wf/public/jvmp_threading.h b/mozilla/java/waterfall/wf/public/jvmp_threading.h deleted file mode 100644 index 23b53ac87c2..00000000000 --- a/mozilla/java/waterfall/wf/public/jvmp_threading.h +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: jvmp_threading.h,v 1.1.1.1 2001-05-09 17:30:05 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef _JVMP_THREADING_H -#define _JVMP_THREADING_H -#ifdef __cplusplus -extern "C" { -#endif - -/* void pointers, used in MD way to refer on proper MD structures */ -struct JPluginMonitor; -struct JVMP_CallingContext; -struct JVMP_Monitor -{ - /* field to be sure that our binary manipulations are correct */ - jint magic; - /** - * pointers to native structure describing mutex and monitor, like - * pthread_mutex_t*, pthread_cond_t* in pthread API - * CRITICAL_SECTION*, ??? in Win32 threads, - * use macros JVMP_MONITOR_INITIALIZER with those argument - * to initialize JVMP_Monitor. - */ - struct JPluginMutex* mutex; - struct JPluginMonitor* monitor; - struct JVMP_Thread* owner; - jint id; - int monitor_state; - int mutex_state; -}; -typedef void (*JVMPThreadDumpProc)(struct JVMP_Thread *t, void *arg); -struct JVMP_Thread -{ - long handle; /* MD thread handle */ - jint id; /* unique TID */ - int state; - void* data; - void (*cleanup)(struct JVMP_Thread* me); - JVMPThreadDumpProc dump; /* dump thread specific info */ - struct - JVMP_CallingContext* ctx; /* context assotiated with this thread */ -}; -typedef struct JVMP_Thread JVMP_Thread; -typedef struct JVMP_Monitor JVMP_Monitor; -/* backward compatibility */ -typedef JVMP_Thread JVMP_ThreadInfo; -typedef JVMP_Monitor JVMP_MonitorInfo; - -#define JVMP_STATE_NOTINITED -2 -/* to prevent occasional incorrect initialization of monitor */ -#define JVMP_STATE_INCORRECT 0 -#define JVMP_STATE_INITED 1 -#define JVMP_STATE_LOCKED 2 -#define JVMP_STATE_DESTROYED 3 -#define JVMP_MONITOR_MAGIC 0xcafeface -#define JVMP_MONITOR_INITIALIZER(mutex, condvar) \ - {JVMP_MONITOR_MAGIC, (JPluginMutex*)mutex, (JPluginMonitor*)condvar, \ - NULL, 0, JVMP_STATE_NOTINITED, JVMP_STATE_NOTINITED } -#define JVMP_ERROR_INCORRECT_MUTEX_STATE -1000 -#define JVMP_ERROR_MUTEX_NOT_LOCKED -1001 -#ifdef __cplusplus -}; -#endif -#endif - - - - - diff --git a/mozilla/java/waterfall/wf/public/jvmp_vendor.h b/mozilla/java/waterfall/wf/public/jvmp_vendor.h deleted file mode 100644 index 24afb862d5c..00000000000 --- a/mozilla/java/waterfall/wf/public/jvmp_vendor.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: jvmp_vendor.h,v 1.1.1.1 2001-05-09 17:30:05 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef _JVMP_VENDOR_H -#define _JVMP_VENDOR_H -#ifdef __cplusplus -extern "C" { -#endif -struct JVMP_PluginDescription { - const char* vendor; /* string describing JVM vendor, like "Sun" */ - const char* jvm_version; /* JVM version, like "1.3.1" */ - const char* jvm_kind; /* JVM kind, like "hotspot" */ - const char* jvmp_version; /* plugin version, like "1.1" */ - const char* platform; /* platform */ - const char* arch; /* architecture this plugin compiled for */ - const void* vendor_data; /* vendor-specific data */ -}; -typedef struct JVMP_PluginDescription JVMP_PluginDescription; - -struct JVMP_ExtDescription { - const char* vendor; /* string describing ext vendor, like "Sun" */ - const char* version; /* extension version, like "0.9" */ - const char* descr; /* description of this extension, like - "Mozilla applet viewer Waterfall extension" */ - const char* platform; /* platform, like "linux" */ - const char* arch; /* architecture this extension compiled for, - like "i386" */ - const char* license; /* license type of this extension, like "GPL" */ - const void* vendor_data; /* vendor-specific data */ -}; -typedef struct JVMP_ExtDescription JVMP_ExtDescription; -#ifdef __cplusplus -}; -#endif -#endif diff --git a/mozilla/java/waterfall/wf/public/linux/jvmp_md.h b/mozilla/java/waterfall/wf/public/linux/jvmp_md.h deleted file mode 100644 index 0155548ec25..00000000000 --- a/mozilla/java/waterfall/wf/public/linux/jvmp_md.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: jvmp_md.h,v 1.1.1.1 2001-05-09 17:30:05 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef _JVMP_MD_H -#define _JVMP_MD_H -#include -#define JLONG_TO_PTR(x) ((void*)(int)x) -#define PTR_TO_JLONG(x) ((jlong)(int)x) -#endif diff --git a/mozilla/java/waterfall/wf/public/shmtran.h b/mozilla/java/waterfall/wf/public/shmtran.h deleted file mode 100644 index ff7349cebe3..00000000000 --- a/mozilla/java/waterfall/wf/public/shmtran.h +++ /dev/null @@ -1,149 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: shmtran.h,v 1.1.1.1 2001-05-09 17:30:05 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef _JVMP_SHMTRAN_H -#define _JVMP_SHMTRAN_H -#ifdef __cplusplus -extern "C" { -#endif -#include "jvmp_caps.h" -#ifdef JVMP_USE_SHM -#include -#include -#include -#include -#include -#endif -/** - * SHM transport used by Waterfall in out of proc situation. - * Typical usage is: - * Host -> libjvmp.so ->(JNI) Java implementation (no shm case, same process) - * Host -> libjvmp_shm.so -> (forward request with SHM) -> - * jvmp process ->(JNI) Java implementation - * Consider event sending, as generic enough: - * jint JVMP_SendEvent(JVMP_ExecutionContext* ctx, - * jint target, jint event, jlong data) - * To use this transport we need: - * in JVMP_GetPlugin(): - * - create message queue, using msgget(). - * - start helper JVM process with argument - this queue ID - * - wait until JVMP send us a message, that it started msg loop - * in JVMP_GetContext(): - * - fill reserved field with message queue ID - * in JVMP_SendEvent(): - * - using message queue ID from ctx create SHM request - * XXX: outdated comment - see sources - */ - -struct JVMP_ShmRequest -{ - unsigned long rid; /* msg ID of message used to pass this request */ - int msg_id; /* ID of message queue */ - unsigned int func_no; /* number of function in JVMP_Context */ - int retval; /* returned by function value */ - int argc; /* number of function arguments */ - char* argt; /* string of arguments types, encoded by chars: - I - int, J - long, C - character, - S - zero terminated string, P - any pointer - also possible to pass/return values - like C's "&" - - use low register letters - i - int, j - long, c - character, - and pass arbitrary length structures: - A[40] - 40 bytes of data passed - a[40] - 40 bytes passed/returned. - If you don't know exact length of returned value - just pass a[0], but then you must set to 1 - parameter alloc_ref of JVMP_DecodeRequest. */ - int nullmask; /* bitmask of pointers args == 0. - So you shouldn't - pass meaningfull == 0 pointers - as > 32th argument ;) */ - int length; /* length of data */ - char* data; /* marshaled arguments */ - int shmlen; /* length of shm data */ - int shmid; /* cached shmid of this request's data */ - JVMP_SecurityCap caps; /* capabilities of this call */ - char* shmdata; /* marshalled request in SHM */ -}; - -typedef struct JVMP_ShmRequest JVMP_ShmRequest; -typedef void* jpointer; - -#ifdef JVMP_USE_SHM -JVMP_ShmRequest* -JVMP_NewShmReq(int msg_id, unsigned int func_no); -/* JVMP_ShmRequest* JVMP_NewEncodedShmReq(int msg_id, unsigned int func_no, */ -/* char* sign, ...); */ -int JVMP_EncodeRequest(JVMP_ShmRequest* req, - char* sign, ...); -int JVMP_DecodeRequest(JVMP_ShmRequest* req, int alloc_ref, - char* sign, ...); -int JVMP_DeleteShmReq(JVMP_ShmRequest* req); -int JVMP_GetArgSize(JVMP_ShmRequest* req, int argno); -int JVMP_SendShmRequest(JVMP_ShmRequest* req, int sync); -int JVMP_RecvShmRequest(int msg_id, int sync, JVMP_ShmRequest* *preq); -int JVMP_ExecuteShmRequest(JVMP_ShmRequest* req); -int JVMP_ConfirmShmRequest(JVMP_ShmRequest* req); -int JVMP_WaitConfirmShmRequest(JVMP_ShmRequest* req); -/* Argument is side on which transport is used, if in - * separate process situation (0 - not separate process case - * 1 - host side, 2 - JVM side). - */ -int JVMP_ShmInit(int side); -void JVMP_ShmShutdown(); -int JVMP_ShmMessageLoop(int msg_id); -int JVMP_msgget(key_t key, int msgflg); -void* JVMP_shmat(int shmid, const void *shmaddr, int shmflg); -int JVMP_shmget(key_t key, int size, int shmflg); -int JVMP_shmdt(const void *shmaddr, int shmid); - -struct JVMP_ShmMessage -{ - long mtype; - int message; /* also used to save returned by function value */ - int shm_id; /* also used to indicate that memory size changed */ - int shm_len; /* also used to show updated len */ -}; - -typedef struct JVMP_ShmMessage JVMP_ShmMessage; - - -#define IS_NULL_VAL(req, argn) (req->nullmask & (0x1 << (argn - 1))) -/* this one defines base for user function numbers - i.e. use - to numerate your functions use - JVMP_USER_BASE + MY_VENDOR_ID*10000 + funcno */ -#define JVMP_USER_BASE 1000 -#define JVMP_NEW_EXT_FUNCNO(_vendorID, _funcno) \ - (JVMP_USER_BASE+_vendorID*10000+_funcno) -#define JVMP_GET_VENDOR(_extfuncno) \ - ((_extfuncno - JVMP_USER_BASE) / 10000) -#define JVMP_GET_EXT_FUNCNO(_funcno) \ - (_funcno-JVMP_USER_BASE -JVMP_GET_VENDOR(_funcno)*10000) -#endif /* JVMP_USE_SHM */ -#ifdef __cplusplus -}; -#endif -#endif diff --git a/mozilla/java/waterfall/wf/public/solaris/jvmp_md.h b/mozilla/java/waterfall/wf/public/solaris/jvmp_md.h deleted file mode 100644 index 733dcf8e243..00000000000 --- a/mozilla/java/waterfall/wf/public/solaris/jvmp_md.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: jvmp_md.h,v 1.1.1.1 2001-05-09 17:30:05 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef _JVMP_MD_H -#define _JVMP_MD_H -#include -#define JLONG_TO_PTR(x) ((void*)(int)x) -#define PTR_TO_JLONG(x) ((jlong)(int)x) -#endif diff --git a/mozilla/java/waterfall/wf/public/win32/jvmp_md.h b/mozilla/java/waterfall/wf/public/win32/jvmp_md.h deleted file mode 100644 index 0ba4c153b88..00000000000 --- a/mozilla/java/waterfall/wf/public/win32/jvmp_md.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: jvmp_md.h,v 1.1.1.1 2001-05-09 17:30:05 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef _JVMP_MD_H -#define _JVMP_MD_H -/* Windows haven't standard(C9X) system primitive types. */ -typedef unsigned char uint8_t; -typedef signed char int8_t; -typedef unsigned short uint16_t; -typedef signed short int16_t; -typedef unsigned int uint32_t; -typedef signed int int32_t; -#define JLONG_TO_PTR(x) ((void*)(int)x) -#define PTR_TO_JLONG(x) ((jlong)(int)x) -#endif diff --git a/mozilla/java/waterfall/wf/src/host/host.cpp b/mozilla/java/waterfall/wf/src/host/host.cpp deleted file mode 100644 index 7f248a36b23..00000000000 --- a/mozilla/java/waterfall/wf/src/host/host.cpp +++ /dev/null @@ -1,668 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: host.cpp,v 1.1.1.1 2001-05-09 17:30:05 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include -#include -#include -#include // to getenv() -#include - -#ifdef XP_UNIX -#include // to sleep() -#include -#include -#include -#include -#define MUTEX_T pthread_mutex_t -#define MUTEX_CREATE(m) m = (MUTEX_T*)malloc(sizeof(MUTEX_T)); pthread_mutex_init(m, NULL) -#define MUTEX_LOCK(m) pthread_mutex_lock(m) -#define MUTEX_UNLOCK(m) pthread_mutex_unlock(m) -#define COND_T pthread_cond_t -#define COND_CREATE(c) c = (COND_T*)malloc(sizeof(COND_T)); pthread_cond_init(c, NULL) -#define dll_t void* -#define DL_MODE RTLD_NOW -#define FILE_SEPARATOR "/" -#define PATH_SEPARATOR ":" -#define DL_MODE RTLD_NOW -// gcc specific -#define DEBUG(x...) fprintf(stderr, "host: "x) -#endif - -#ifdef XP_WIN32 -#include -#include -#define MUTEX_T CRITICAL_SECTION -#define dll_t HINSTANCE -#define DL_MODE 0 -#define FILE_SEPARATOR "\\" -#define PATH_SEPARATOR ";" -#define DL_MODE 0 -#define DEBUG -#endif - - -JVMP_GetPlugin_t fJVMP_GetPlugin; - -// XXX: JVMP_CallingContext is per-thread structure, but almost all calls here -// goes from the "main" GTK thread. -JVMP_CallingContext* ctx = NULL; -JavaVM* jvm = NULL; -JNIEnv* env = NULL; -JavaVMInitArgs vm_args; -GtkWidget* topLevel = NULL; -JVMP_RuntimeContext* jvmp_context = NULL; -jint g_wid = 0; // ID of topLevel inside JVM -jint g_oid = 0; // ID of Java peer object -jint g_eid = 0; // ID of test extension -jint g_mid = 0; // ID of monitor object -char g_errbuf[JVMP_MAXERRORLENGTH]; -#ifdef XP_UNIX // yet -MUTEX_T* g_mutex = NULL; -COND_T* g_cond = NULL; -JVMP_Monitor* g_mon = NULL; -#endif - - -#ifdef XP_UNIX -dll_t LoadDLL(const char* filename, int mode) -{ - return dlopen(filename, mode); -} - -void* FindSymbol(dll_t dll, const char* sym) -{ - return dlsym(dll, sym); -} - -int UnloadDLL(dll_t dll) -{ - return dlclose(dll); -} - -const char* LastDLLErrorString() -{ - return dlerror(); -} - -#endif -#ifdef XP_WIN32 -dll_t LoadDLL(const char* filename, int mode) -{ - return LoadLibrary(filename); -} - -void* FindSymbol(dll_t dll, const char* sym) -{ - return GetProcAddress(dll, sym); -} - -int UnloadDLL(dll_t dll) -{ - // XXX: fix me - return 0; -} - -const char* LastDLLErrorString() -{ - static LPVOID lpMsgBuf = NULL; - - free(lpMsgBuf); - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &lpMsgBuf, 0, NULL ); - return (const char*)lpMsgBuf; -} -#endif - -jint loadPluginLibrary(void** h) { - dll_t handle; - char *path, *home; -#ifdef XP_UNIX -#ifdef JVMP_USE_SHM - char* filename="libjvmp_shm.so"; -#else - char* filename="libjvmp.so"; -#endif -#endif -#ifdef XP_WIN32 - char* filename="jvmp.dll"; -#endif - home = getenv("WFHOME"); - if (!home) return JNI_FALSE; - path = (char*)malloc(strlen(home)+strlen(filename)+2); - sprintf(path, "%s"FILE_SEPARATOR"%s", home, filename); - handle = LoadDLL(path, DL_MODE); - if (!handle) { - fprintf(stderr, "dlopen: %s\n", LastDLLErrorString()); - return JNI_FALSE; - }; - - fJVMP_GetPlugin = - (JVMP_GetPlugin_t)FindSymbol(handle, "JVMP_GetPlugin"); - if (!fJVMP_GetPlugin) { - fprintf(stderr, "dlsym:%s\n", LastDLLErrorString()); - return JNI_FALSE; - }; - if ((*fJVMP_GetPlugin)(&jvmp_context) != JNI_TRUE) - { - fprintf(stderr, "JVMP_GetPlugin failed\n"); - return JNI_FALSE; - } - (*h) = handle; - return JNI_TRUE; -} - -jint initJVM(JavaVM** jvm, JNIEnv** env, JavaVMInitArgs* pvm_args) { - pvm_args->version = JNI_VERSION_1_2; - jint res = (jvmp_context->JVMP_GetRunningJVM)(&ctx, pvm_args, JNI_TRUE); - if (res == JNI_TRUE) { - *env = ctx->env; - *jvm = jvmp_context->jvm; - fprintf(stderr, "++++++JVM successfully obtained.\n"); - return JNI_TRUE; - } else { - fprintf(stderr, "------Failed to obtain JVM.\n"); - return JNI_FALSE; - }; -}; - - -void b1_handler(GtkWidget *widget) -{ - void* handle; - - if (!loadPluginLibrary(&handle)) return; - memset(&vm_args, 0, sizeof(vm_args)); - if (!initJVM(&jvm, &env, &vm_args)) { - return; - }; -}; - -void b2_handler(GtkWidget *widget) { - if (!jvmp_context) return; - if (g_eid) (jvmp_context->JVMP_UnregisterExtension)(ctx, g_eid); - (jvmp_context->JVMP_StopJVM)(ctx); -}; - -void b4_handler(GtkWidget *widget) { - JVMP_DrawingSurfaceInfo w; - - if (!jvmp_context) return; - jint containerWindowID = (jint) GDK_WINDOW_XWINDOW(topLevel->window); - w.window = (JPluginWindow *)containerWindowID; -#ifdef XP_UNIX - gdk_flush(); -#endif - w.x = 0; - w.y = 0; - w.width = topLevel->allocation.width; - w.height = topLevel->allocation.height; - - if ((jvmp_context->JVMP_RegisterWindow)(ctx, &w, &g_wid) != JNI_TRUE) { - jvmp_context->JVMP_GetLastErrorString(ctx, g_errbuf); - fprintf(stderr, "Can\'t register window: %s\n", g_errbuf); - return; - }; - fprintf(stderr, "Registed our GTK window with ID %d\n", (int)g_wid); -} - -void b5_handler(GtkWidget *widget) { - if (!jvmp_context || !g_oid) return; - if ((jvmp_context->JVMP_SendEvent) - (ctx, g_oid, 20, (jlong) g_wid, JVMP_PRIORITY_NORMAL) == JNI_FALSE) - { - jvmp_context->JVMP_GetLastErrorString(ctx, g_errbuf); - fprintf(stderr, "cannot send event to %d: %s\n", - (int)g_oid, g_errbuf); - return; - } - fprintf(stderr, "Event sent to %d\n", (int)g_oid); -} - -void b6_handler(GtkWidget *widget) { - if (!jvmp_context) return; - if ((jvmp_context->JVMP_UnregisterWindow)(ctx, g_wid) != JNI_TRUE) { - jvmp_context->JVMP_GetLastErrorString(ctx, g_errbuf); - fprintf(stderr, "Can\'t unregister window: %s\n", g_errbuf); - return; - }; - fprintf(stderr, "Unregisted our GTK window with ID %d\n", (int)g_wid); -} - -void b9_handler(GtkWidget *widget) { - if (!jvmp_context) return; - JVMP_PluginDescription* d; - if ((jvmp_context->JVMP_GetDescription)(&d) != JNI_TRUE) - { - fprintf(stderr, "Cannot get description\n"); - return; - } - fprintf(stderr, - "Waterfall plugin info:\n" - "JVM vendor=\"%s\"\n" - "JVM version=\"%s\"\n" - "JVM kind=\"%s\"\n" - "JVMP version=\"%s\"\n" - "platform=\"%s\"\n" - "arch=\"%s\"\n" - "vendor data=\"%p\"\n", - d->vendor, d->jvm_version, d->jvm_kind, d->jvmp_version, - d->platform, d->arch, d->vendor_data); - -} -#ifdef XP_UNIX -void* thread_func(void* arg) { - jint id; - JVMP_CallingContext* myctx; - - if ((jvmp_context->JVMP_GetCallingContext)(&myctx) != JNI_TRUE) - return NULL; - if ((jvmp_context->JVMP_AttachCurrentThread)(myctx, &id) != JNI_TRUE) - fprintf(stderr, "Can\'t attach thread\n"); - else - fprintf(stderr, "Attached with ID %d\n", (int)id); - sleep(10); - // this function MUST be called by any function performed JVMP_GetCallingContext - // or JVMP_AttachCurrentThread. as otherwise structures inside of Waterfall - // not cleaned up. Also it destroys myctx - (jvmp_context->JVMP_DetachCurrentThread)(myctx); - return NULL; -} - -#endif - -void b8_handler(GtkWidget *widget) { -#ifdef XP_UNIX - pthread_t tid; - - if (!jvmp_context) return; - // allocate in heap to prevent invalid deallocation - pthread_create(&tid, NULL, &thread_func, NULL); - pthread_detach(tid); -#endif -} - -void registerMyExtension() -{ -#ifdef XP_UNIX - const char* ext = "./libwf_test.so"; -#endif -#ifdef XP_WIN32 - const char* ext = "wf_test.dll"; -#endif - - if ((jvmp_context->JVMP_RegisterExtension) - (ctx, ext, &g_eid, 0) != JNI_TRUE) - { - jvmp_context->JVMP_GetLastErrorString(ctx, g_errbuf); - fprintf(stderr, "extension not registred: %s\n", g_errbuf); - return; - } - fprintf(stderr, "Registered extension with ID: %d\n", (int)g_eid); - if ((jvmp_context->JVMP_SendExtensionEvent)(ctx, g_eid, - 13, 0, JVMP_PRIORITY_NORMAL) == JNI_FALSE) - { - jvmp_context->JVMP_GetLastErrorString(ctx, g_errbuf); - fprintf(stderr, "cannot send extension event: %s\n", g_errbuf); - return; - } - fprintf(stderr, "sent event 13 to newly registred extension\n"); -} - -void b10_handler(GtkWidget *widget) { - if (!jvmp_context) return; - registerMyExtension(); -} - - -int newPrincipalsFromStrings(jbyte** *resprin, jint* *reslen, jint num, ...) -{ - jint* prins_len; - jbyte* *prins; - char* str; - jint i, len; - va_list ap; - - prins_len = (jint*)malloc(num*sizeof(jint)); - if (!prins_len) return 0; - prins = (jbyte**)malloc(num*sizeof(jbyte**)); - - if (!prins) return 0; - va_start(ap, num); - for (i=0; iJVMP_RegisterMonitorObject)(ctx, g_mon, &g_mid) != JNI_TRUE) - { - DEBUG("couldn\'t register monitor object\n"); - return; - } - registered = 1; - } - if (g_oid) { - // now post message to Java peer with request to start thread that will - // try to acquire the same mutex and wake up us on common native monitor. - // Not perfect, as possible race condition - - // if event handled too fast, but OK for testing - (jvmp_context->JVMP_PostEvent) - (ctx, g_oid, 666, (jlong)g_mid, JVMP_PRIORITY_HIGH); - } - DEBUG("locking mutex\n"); - MUTEX_LOCK(g_mutex); - DEBUG("LOCKED. Sleeping no more %d millis, waiting until Java thread will wake up us\n", millis); - gettimeofday(&tv, 0); - end = ((jlong)tv.tv_sec)*1000 + ((jlong)tv.tv_usec)/1000 + millis; - ts.tv_sec = end / 1000; - ts.tv_nsec = (end % 1000) * 1000000; - /* pthread_cond_timedwait() reacquires mutex, so just changing - millis on Java side to value greater than millis wouldn't - force this call to complete earlier. */ - pthread_cond_timedwait(g_cond, g_mutex, &ts); - gettimeofday(&tv1, 0); - MUTEX_UNLOCK(g_mutex); - diff = (tv1.tv_sec-tv.tv_sec)*1000 + (tv1.tv_usec-tv.tv_usec)/1000; - DEBUG("mutex unlocked after %ld millis\n", diff); -#endif -} - -void b11_handler(GtkWidget *widget) { - static int onoff = 0; - - if (!jvmp_context) return; - onoff = !onoff; - if (onoff) - { - if ((jvmp_context->JVMP_CreatePeer)(ctx, - "@sun.com/wf/tests/testextension;1", - 0, - &g_oid) != JNI_TRUE) - { - jvmp_context->JVMP_GetLastErrorString(ctx, g_errbuf); - fprintf(stderr, - "Cannot create new peer using this extension: %s\n", - g_errbuf); - return; - } - fprintf(stderr, "created peer witd id %d\n", (int)g_oid); - } - else - { - if ((jvmp_context->JVMP_DestroyPeer)(ctx, g_oid) != JNI_TRUE) - { - jvmp_context->JVMP_GetLastErrorString(ctx, g_errbuf); - fprintf(stderr, - "Cannot remove peer: %s\n", g_errbuf); - return; - } - fprintf(stderr, "removed peer witd id %d\n", (int)g_oid); - } -} - -void b13_handler(GtkWidget *widget) { - static int onoff = 0; - - if (!jvmp_context) return; - onoff = (onoff == 0) ? 1 : 0; - if ((jvmp_context->JVMP_PostSysEvent) - (ctx, JVMP_CMD_CTL_CONSOLE, (jlong)onoff, JVMP_PRIORITY_NORMAL) == JNI_FALSE) - { - jvmp_context->JVMP_GetLastErrorString(ctx, g_errbuf); - fprintf(stderr, - "Cannot send system event: %s\n", g_errbuf); - return; - } -} - -void b7_handler(GtkWidget *widget) { - JVMP_SecurityCap cap; - static int onoff = 0; - - if (!jvmp_context) return; - onoff = !onoff; - JVMP_FORBID_ALL_CAPS(cap); - JVMP_ALLOW_CAP(cap, JVMP_CAP_SYS_SYSTEM); - JVMP_ALLOW_CAP(cap, JVMP_CAP_SYS_EVENT); - JVMP_ALLOW_CAP(cap, JVMP_CAP_SYS_SYSEVENT); - if (onoff) - { - jbyte** prins; - jint pnum = 2; - jint* plen; - if (!newPrincipalsFromStrings(&prins, &plen, - pnum, "CAPS", "DUMMY")) - return; - if ((jvmp_context->JVMP_EnableCapabilities) - (ctx, &cap, pnum, plen, prins) != JNI_TRUE) - { - jvmp_context->JVMP_GetLastErrorString(ctx, g_errbuf); - fprintf(stderr, "Can\'t enable caps: %s\n", g_errbuf); - return; - }; - deletePrincipals(prins, plen, pnum); - } - - else - { - if ((jvmp_context->JVMP_DisableCapabilities) - (ctx, &cap) != JNI_TRUE) - { - jvmp_context->JVMP_GetLastErrorString(ctx, g_errbuf); - fprintf(stderr, "Can\'t disable cap: %s\n", g_errbuf); - return; - }; - } - - fprintf(stderr, "Capabilities JVMP_CAP_SYS_SYSTEM and JVMP_CAP_SYS_EVENT triggered to %s\n", - onoff ? "ON" : "OFF"); -} - - - -GtkWidget* initGTKStuff(int *argc, char ***argv) { - // fprintf(stderr,"explicit threads init %d\n", XInitThreads()); - gtk_init(argc, argv); - /* Create a new window */ - GtkWidget* window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_title(GTK_WINDOW(window), "Java Plugin Host"); - - /* Here we connect the "destroy" event to a signal handler */ - gtk_signal_connect (GTK_OBJECT (window), "destroy", - GTK_SIGNAL_FUNC (gtk_main_quit), NULL); - - gtk_widget_set_usize(window, 300, 400); - /* Sets the border width of the window. */ - gtk_container_set_border_width (GTK_CONTAINER (window), 10); - - /* Create a Frame */ - GtkWidget* frame = gtk_frame_new(NULL); - /* Set the style of the frame */ - gtk_frame_set_shadow_type( GTK_FRAME(frame), GTK_SHADOW_ETCHED_OUT); - gtk_container_add(GTK_CONTAINER(window), frame); - ///////// - gtk_signal_connect(GTK_OBJECT(window), "destroy", - GTK_SIGNAL_FUNC(gtk_main_quit), - NULL); - gtk_signal_connect(GTK_OBJECT(window), "delete-event", - GTK_SIGNAL_FUNC(gtk_false), - NULL); - /* Button initialization */ - GtkWidget* button1 = gtk_button_new_with_label ("Start JVM"); - GtkWidget* button2 = gtk_button_new_with_label ("Stop JVM"); - GtkWidget* button3 = gtk_button_new_with_label ("Close application"); - GtkWidget* button4 = gtk_button_new_with_label ("Register native window"); - GtkWidget* button5 = gtk_button_new_with_label ("Test registered window"); - GtkWidget* button6 = gtk_button_new_with_label ("Unregister window"); - GtkWidget* button7 = gtk_button_new_with_label ("Enable/Disable system capabilities"); - GtkWidget* button8 = gtk_button_new_with_label ("Attach new native thread"); - GtkWidget* button9 = gtk_button_new_with_label ("Get WF description"); - GtkWidget* button10 = gtk_button_new_with_label ("Register test extension"); - GtkWidget* button11 = gtk_button_new_with_label ("Create/Remove test peer"); - GtkWidget* button12 = gtk_button_new_with_label ("Test Java/native locking ability"); - GtkWidget* button13 = gtk_button_new_with_label ("Show/hide Java console"); - - - gtk_signal_connect (GTK_OBJECT (button1), "clicked", - GTK_SIGNAL_FUNC (b1_handler), NULL); - gtk_signal_connect (GTK_OBJECT (button2), "clicked", - GTK_SIGNAL_FUNC (b2_handler), NULL); - gtk_signal_connect_object (GTK_OBJECT (button3), "clicked", - GTK_SIGNAL_FUNC (gtk_main_quit), - GTK_OBJECT (window)); - gtk_signal_connect_object (GTK_OBJECT (button4), "clicked", - GTK_SIGNAL_FUNC (b4_handler), - GTK_OBJECT (window)); - gtk_signal_connect_object (GTK_OBJECT (button5), "clicked", - GTK_SIGNAL_FUNC (b5_handler), - GTK_OBJECT (window)); - gtk_signal_connect_object (GTK_OBJECT (button6), "clicked", - GTK_SIGNAL_FUNC (b6_handler), - GTK_OBJECT (window)); - gtk_signal_connect_object (GTK_OBJECT (button7), "clicked", - GTK_SIGNAL_FUNC (b7_handler), - GTK_OBJECT (window)); - gtk_signal_connect_object (GTK_OBJECT (button8), "clicked", - GTK_SIGNAL_FUNC (b8_handler), - GTK_OBJECT (window)); - gtk_signal_connect_object (GTK_OBJECT (button9), "clicked", - GTK_SIGNAL_FUNC (b9_handler), - GTK_OBJECT (window)); - gtk_signal_connect_object (GTK_OBJECT (button10), "clicked", - GTK_SIGNAL_FUNC (b10_handler), - GTK_OBJECT (window)); - gtk_signal_connect_object (GTK_OBJECT (button11), "clicked", - GTK_SIGNAL_FUNC (b11_handler), - GTK_OBJECT (window)); - gtk_signal_connect_object (GTK_OBJECT (button12), "clicked", - GTK_SIGNAL_FUNC (b12_handler), - GTK_OBJECT (window)); - gtk_signal_connect_object (GTK_OBJECT (button13), "clicked", - GTK_SIGNAL_FUNC (b13_handler), - GTK_OBJECT (window)); - GtkWidget* vbox1 = gtk_vbox_new (FALSE, 4); - gtk_box_pack_start (GTK_BOX (vbox1), button1, TRUE, TRUE, 0); - gtk_box_pack_start (GTK_BOX (vbox1), button2, TRUE, TRUE, 0); - gtk_box_pack_start (GTK_BOX (vbox1), button13, TRUE, TRUE, 0); - gtk_box_pack_start (GTK_BOX (vbox1), button10, TRUE, TRUE, 0); - gtk_box_pack_start (GTK_BOX (vbox1), button4, TRUE, TRUE, 0); - gtk_box_pack_start (GTK_BOX (vbox1), button6, TRUE, TRUE, 0); - gtk_box_pack_start (GTK_BOX (vbox1), button7, TRUE, TRUE, 0); - gtk_box_pack_start (GTK_BOX (vbox1), button11, TRUE, TRUE, 0); - gtk_box_pack_start (GTK_BOX (vbox1), button5, TRUE, TRUE, 0); - gtk_box_pack_start (GTK_BOX (vbox1), button8, TRUE, TRUE, 0); - gtk_box_pack_start (GTK_BOX (vbox1), button9, TRUE, TRUE, 0); - gtk_box_pack_start (GTK_BOX (vbox1), button12, TRUE, TRUE, 0); - gtk_box_pack_start (GTK_BOX (vbox1), button3, TRUE, TRUE, 0); - gtk_container_add(GTK_CONTAINER(frame), vbox1); - /////////// - gtk_widget_show(button1); - gtk_widget_show(button2); - gtk_widget_show(button3); - gtk_widget_show(button4); - gtk_widget_show(button5); - gtk_widget_show(button6); - gtk_widget_show(button7); - gtk_widget_show(button8); - gtk_widget_show(button9); - gtk_widget_show(button10); - gtk_widget_show(button11); - gtk_widget_show(button12); - gtk_widget_show(button13); - gtk_widget_show(vbox1); - gtk_widget_show(frame); - /* Display the window */ - gtk_widget_show (window); - - /* another window to play with JDK */ - GtkWidget* window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_usize(window1, 300, 300); - GtkWidget* frame1 = gtk_frame_new(NULL); - gtk_frame_set_shadow_type( GTK_FRAME(frame1), GTK_SHADOW_ETCHED_OUT); - gtk_container_add(GTK_CONTAINER(window1), frame1); - gtk_widget_show (frame1); - gtk_widget_show (window1); - topLevel = window1; - return window1; -} - -int main(int argc, char** argv) { - initGTKStuff(&argc, &argv); -// this stuff works only on unix yet -#ifdef XP_UNIX - MUTEX_CREATE(g_mutex); - COND_CREATE(g_cond); - JVMP_Monitor mon = JVMP_MONITOR_INITIALIZER(g_mutex, g_cond); - g_mon = &mon; -#endif - gtk_main(); - return 0; -}; - - - - - - - - - - diff --git a/mozilla/java/waterfall/wf/src/host/test_extension.c b/mozilla/java/waterfall/wf/src/host/test_extension.c deleted file mode 100644 index d5597d82dfe..00000000000 --- a/mozilla/java/waterfall/wf/src/host/test_extension.c +++ /dev/null @@ -1,114 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: test_extension.c,v 1.1.1.1 2001-05-09 17:30:05 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include "jvmp.h" - -#include -#include - -/* Extension parameters */ -static const char* WFCID = "@sun.com/wf/tests/testextension;1"; -static const jint WFExtVersion = 1; -static JVMP_SecurityCap g_moz_caps; -static JVMP_SecurityCap g_moz_cap_mask; -/* range of used capabilities */ -#define MOZ_CAPS_LOW 101 -#define MOZ_CAPS_HIGH 105 -static JVMP_ExtDescription g_Description = -{ - "Sun", /* vendor */ - "1.0", /* version */ - "Waterfall test extension", /* description */ - PLATFORM, /* platform */ - ARCH, /* architecture */ - "GPL", /* license */ - NULL /* vendor data */ -}; - - -/* extension API implementation */ -static jint JNICALL JVMPExt_Init(jint side) -{ - int i; - - JVMP_FORBID_ALL_CAPS(g_moz_caps); - JVMP_ALLOW_ALL_CAPS(g_moz_cap_mask); - for (i=MOZ_CAPS_LOW; i <= MOZ_CAPS_HIGH; i++) - JVMP_ALLOW_CAP(g_moz_caps, i); - return JNI_TRUE; -} - -static jint JNICALL JVMPExt_Shutdown() -{ - return JNI_TRUE; -} -static jint JNICALL JVMPExt_GetExtInfo(const char* *pCID, - jint *pVersion, - JVMP_ExtDescription* *pDesc) -{ - *pCID = WFCID; - *pVersion = WFExtVersion; - if (pDesc) *pDesc = &g_Description; - return JNI_TRUE; -} -static jint JNICALL JVMPExt_GetBootstrapClass(char* *bootstrapClassPath, - char* *bootstrapClassName) -{ - /* should be defined at installation time */ - *bootstrapClassPath = ""; - *bootstrapClassName = "sun.jvmp.test.TestPeerFactory"; - return JNI_TRUE; -} -static jint JNICALL JVMPExt_ScheduleRequest(JVMP_ShmRequest* req, jint local) -{ - return JNI_TRUE; -} - -static jint JNICALL JVMPExt_GetCapsRange(JVMP_SecurityCap* caps, - JVMP_SecurityCap* sh_mask) -{ - if ((caps == NULL) || (sh_mask == NULL)) return JNI_FALSE; - memcpy(caps, &g_moz_caps, sizeof(JVMP_SecurityCap)); - memcpy(sh_mask, &g_moz_cap_mask, sizeof(JVMP_SecurityCap)); - return JNI_TRUE; -} - - -static JVMP_Extension JVMP_Ext = -{ - &JVMPExt_Init, - &JVMPExt_Shutdown, - &JVMPExt_GetExtInfo, - &JVMPExt_GetBootstrapClass, - &JVMPExt_ScheduleRequest, - &JVMPExt_GetCapsRange -}; - -JNIEXPORT jint JNICALL JVMP_GetExtension(JVMP_Extension** ext) -{ - *ext = &JVMP_Ext; - return JNI_TRUE; -} diff --git a/mozilla/java/waterfall/wf/src/plugin/java_plugin.c b/mozilla/java/waterfall/wf/src/plugin/java_plugin.c deleted file mode 100644 index 859ab1a4083..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/java_plugin.c +++ /dev/null @@ -1,1768 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: java_plugin.c,v 1.1.1.1 2001-05-09 17:30:05 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/** - * Main Waterfall C file. Contains implementation of Waterfall API - * for in-process case - **/ - -/* all methods here but JVMP_GetPlugin() declared "static", as only access to - them is via structure returned by JVMP_GetPlugin(), so why to add needless - records to export table of plugin DLL. Also it looks like JNI approach. */ -#include -#include -#include -#include -#ifdef XP_UNIX -#include -#endif -#include -#include "jvmp.h" -#include "jpthreads.h" - -struct JVM_Methods { - jint (JNICALL *JNI_GetDefaultJavaVMInitArgs)(void *args); - jint (JNICALL *JNI_CreateJavaVM)(JavaVM **pvm, void **penv, void *args); - jint (JNICALL *JNI_GetCreatedJavaVMs)(JavaVM **, jsize, jsize *); -}; -typedef struct JVM_Methods JVM_Methods; - -static JVMP_RuntimeContext JVMP_PluginContext; -static JVMP_PluginDescription JVMP_Description; -static JavaVM* JVMP_JVM_running = NULL; -static jobject JVMP_PluginInstance = NULL; -static jclass JVMP_PluginClass = NULL; -static JVM_Methods JVMP_JVMMethods; -static char* JVMP_plugin_home = NULL; -static char* JDK_home = NULL; -static char* global_libpath = NULL; -static MUTEX_T* jvm_mutex = NULL; - - -#define PLUGIN_LOG(s1) { fprintf (stderr, "WF: "); \ - fprintf(stderr, s1); fprintf(stderr, "\n"); } -#define PLUGIN_LOG2(s1, s2) { fprintf (stderr, "WF: "); \ - fprintf(stderr, s1, s2); fprintf(stderr, "\n"); } -#define PLUGIN_LOG3(s1, s2, s3) { fprintf (stderr, "WF: "); \ - fprintf(stderr, s1, s2, s3); fprintf(stderr, "\n"); } -#define PLUGIN_LOG4(s1, s2, s3, s4) { fprintf (stderr, "WF: "); \ - fprintf(stderr, s1, s2, s3 ,s4); fprintf(stderr, "\n"); } -#ifdef XP_UNIX -#define LIBJVM "libjvm.so" -#endif -#ifdef XP_WIN32 -#define LIBJVM "jvm.dll" -#endif - -/* default JNI version used by Waterfall */ -#define DEFAULT_JNI_VERSION JNI_VERSION_1_2 - -/* level of verbosity printed with PlugableJVM.trace method: - lesser number - lesser output */ -#define DEBUG_LEVEL 10 - -/* XXX: localization */ -static char* g_jvmp_errors[] = -{ - "no error", - "no such class", - "no such method", - "file not found", - "remote transport failed", - "failed due unknown reasons", - "out of memory", - "null pointer passed", - "initialization failed", - "forbidden to perform this action", - "java exception happened while handling this call", - "java method failed", - "invalid arguments", - "those capabilities are not granted", - NULL -}; - -static jint JVMP_addOption(JavaVMInitArgs* opt, char* str, void* extra) { - jint numOp; - - numOp = opt->nOptions + 1; - opt->options = realloc(opt->options, numOp * sizeof(JavaVMOption)); - if (!opt->options) - { - PLUGIN_LOG("cannot realloc() memory for JVM options"); - return JNI_FALSE; - }; - opt->options[numOp-1].optionString = str; - opt->options[numOp-1].extraInfo = extra; - opt->nOptions = numOp; - return JNI_TRUE; -} - -static void UpdateCaps(JVMP_CallingContext* ctx) -{ - JNIEnv* env = ctx->env; - if (!env) return; - if (ctx->jcaps == NULL) - { - ctx->jcaps = (*env)->NewByteArray(env, sizeof(JVMP_SecurityCap)); - if (ctx->jcaps == NULL) return; - } - (*env)->SetByteArrayRegion(env, ctx->jcaps, - 0, sizeof(JVMP_SecurityCap), - (jbyte*)(ctx->caps).bits); -} - -static char* createURL(char* proto, char* dir, char* name) -{ - char *res; - int i, len; - char *newdir; - - len = strlen(dir); - newdir = (char*)malloc(len +1); - for (i=0; i<=len; i++) - { - if (dir[i] == '\\') - newdir[i] = '/'; - else - newdir[i] = dir[i]; - } - res = (char*)malloc(strlen(proto)+strlen(newdir)+strlen(name)+5); - sprintf(res, "%s:%s/%s", proto, newdir, name); - free(newdir); - return res; -} - -/* returns JNI_TRUE if there is acceptable for reuse Java VM */ -static jint JVMP_ReuseJVM(JavaVM* *pjvm) -{ - JavaVM* vm; - jsize nVMs; - - nVMs = 0; - if (!(JVMP_JVMMethods.JNI_GetCreatedJavaVMs)) - return JNI_FALSE; - JVMP_JVMMethods.JNI_GetCreatedJavaVMs(&vm, sizeof(vm), &nVMs); - if (!nVMs) return JNI_FALSE; - *pjvm = vm; - return JNI_TRUE; -} - -static char* getPluginLibPath(char* jdkhome, char* wfhome) { - static char* result = NULL; - - if (result != NULL) return result; - result = (char*) malloc(strlen(wfhome) + strlen(jdkhome)+50); - /* FIXME !! */ - sprintf(result, -#ifdef _JVMP_SUNJVM - "%s"PATH_SEPARATOR"%s"FILE_SEPARATOR"jre"FILE_SEPARATOR"lib"FILE_SEPARATOR""ARCH -#endif -#ifdef _JVMP_IBMJVM - "%s"PATH_SEPARATOR"%s"FILE_SEPARATOR"jre"FILE_SEPARATOR"bin" -#endif - , wfhome, jdkhome); - return result; -} - -static char* getWFhome() -{ -#ifdef XP_WIN32 - struct _stat sbuf; -#else - struct stat sbuf; -#endif - /* find out WFHOME */ - JVMP_plugin_home = getenv("WFHOME"); - if (JVMP_plugin_home == NULL) - { - PLUGIN_LOG("Env variable WFHOME not set"); - return NULL; - } -#ifdef XP_WIN32 - if ((_stat(JVMP_plugin_home, &sbuf) < 0) || !((sbuf.st_mode) & _S_IFDIR)) -#else - if ((stat(JVMP_plugin_home, &sbuf) < 0) || !S_ISDIR(sbuf.st_mode)) -#endif - { - PLUGIN_LOG2("Bad value %s of WFHOME", JVMP_plugin_home); - return NULL; - } - return JVMP_plugin_home; -} - -static char* getJDKhome() -{ - JDK_home = getenv("WFJDKHOME"); - if (JDK_home == NULL) - { - PLUGIN_LOG("Env variable JDKHOME not set"); - return NULL; - } - return JDK_home; -} - - - -static jint loadJVM(const char* name) { - dll_t handle; - char *libpath, *newlibpath, *pluginlibpath; - char *libjvm, *java_home, *jre_home; - int tmplen; - static int loaded = 0; - - typedef jint (JNICALL *JNI_GetDefaultJavaVMInitArgs_t)(void *args); - typedef jint (JNICALL *JNI_CreateJavaVM_t)(JavaVM **pvm, void **penv, void *args); - typedef jint (JNICALL *JNI_GetCreatedJavaVMs_t)(JavaVM **, jsize, jsize *); - typedef jint (JNICALL *JNI_OnLoad_t)(JavaVM *vm, void *reserved); - typedef void (JNICALL *JNI_OnUnload_t)(JavaVM *vm, void *reserved); -#define JVM_RESOLVE(method) JVMP_JVMMethods.##method = \ - (method##_t) JVMP_FindSymbol(handle, #method); \ - if (JVMP_JVMMethods.##method == NULL) { \ - PLUGIN_LOG2("FindSymbol: %s", JVMP_LastDLLErrorString()); \ - return JNI_FALSE; \ - } - - if (loaded) return JNI_TRUE; - /* bzero() ? */ - memset(&JVMP_JVMMethods, 0, sizeof(JVMP_JVMMethods)); - if (!getWFhome()) return JNI_FALSE; - if (!getJDKhome()) return JNI_FALSE; - /* LD_LIBRARY_PATH correction */ - pluginlibpath = getPluginLibPath(JDK_home, JVMP_plugin_home); - /* pretty much useless on Win32 :) */ - libpath = getenv("LD_LIBRARY_PATH"); - if (!libpath) libpath = ""; - tmplen = strlen(libpath) + strlen(pluginlibpath); - global_libpath = (char*) malloc(tmplen + 2); - newlibpath = (char*) malloc(tmplen + 22); - - sprintf(global_libpath, "%s:%s", pluginlibpath, libpath); - free(pluginlibpath); - sprintf(newlibpath, "LD_LIBRARY_PATH=%s", global_libpath); - putenv(newlibpath); - java_home = (char*) malloc(strlen(JDK_home)+40); - jre_home = (char*) malloc(strlen(JDK_home)+40); - libjvm = (char*) malloc(strlen(JDK_home)+strlen(name)+50); -#ifdef _JVMP_IBMJVM - sprintf(java_home, - "JAVAHOME=%s"FILE_SEPARATOR"jre", JDK_home); - sprintf(jre_home, - "JREHOME=%s"FILE_SEPARATOR"jre", JDK_home); - sprintf(libjvm, - "%s"FILE_SEPARATOR"jre"FILE_SEPARATOR"bin"FILE_SEPARATOR""JVMKIND""FILE_SEPARATOR"%s", JDK_home, - name); -#endif -#ifdef _JVMP_SUNJVM - sprintf(java_home, - "JAVA_HOME=%s"FILE_SEPARATOR"jre", JDK_home); - sprintf(jre_home, - "JREHOME=%s"FILE_SEPARATOR"jre", JDK_home); -#ifdef XP_UNIX - sprintf(libjvm, "%s/jre/lib/"ARCH"/"JVMKIND"/%s", JDK_home, - name); -#else - sprintf(libjvm, - "%s"FILE_SEPARATOR"jre"FILE_SEPARATOR"bin"FILE_SEPARATOR""JVMKIND""FILE_SEPARATOR"%s", - JDK_home, name); -#endif - -#endif - putenv(java_home); - putenv(jre_home); - /* putenv behaves differently in different cases, so safer not to free it */ - /* - free(java_home); - free(jre_home); - free(newlibpath); */ - //PLUGIN_LOG2("loading JVM from %s", libjvm); - handle = JVMP_LoadDLL (libjvm, DL_MODE); - free (libjvm); - if (!handle) { - PLUGIN_LOG2("LoadDLL: %s", JVMP_LastDLLErrorString()); - return JNI_FALSE; - } - JVM_RESOLVE(JNI_GetDefaultJavaVMInitArgs); - JVM_RESOLVE(JNI_CreateJavaVM); - JVM_RESOLVE(JNI_GetCreatedJavaVMs); - loaded = 1; - return JNI_TRUE; -} - -/* join Plugin's classpaths to the arguments passed to JVM */ -static jint JVMP_initClassPath(void* *pargs) { - JavaVMInitArgs* opt; - char *classpath, *newclasspath, *pluginclasspath; - char *bootclasspath, *policypath, *jvmphome, *policyurl; - char *java_libpath, *java_home; - char* str; - int i; - - if (!pargs) return JNI_FALSE; - opt = (JavaVMInitArgs*) *pargs; - if (opt == NULL) - { - opt = (JavaVMInitArgs*)malloc(sizeof(JavaVMInitArgs)); - memset(opt, 0, sizeof(JavaVMInitArgs)); - opt->version = DEFAULT_JNI_VERSION; - } - for (i=0; i < (int)opt->nOptions; i++) - PLUGIN_LOG3("before option[%d]=%s", i, opt->options[i].optionString); - - /* add javaplugin classpath to standard classpath */ - classpath = getenv("CLASSPATH"); - if (!classpath) classpath = ""; - pluginclasspath = (char*) malloc(2*strlen(JVMP_plugin_home)+50); - sprintf(pluginclasspath, - "%s"FILE_SEPARATOR"classes"PATH_SEPARATOR"%s"FILE_SEPARATOR"wf.jar" - , JVMP_plugin_home, JVMP_plugin_home); - newclasspath = (char*) malloc(strlen(classpath) + - strlen(pluginclasspath) + 1); - strcpy(newclasspath, pluginclasspath); - if (classpath != NULL) { - strcat(newclasspath, PATH_SEPARATOR); - strcat(newclasspath, classpath); - } - str = (char*) malloc(strlen(newclasspath)+30); - sprintf(str, "-Djava.class.path=%s", newclasspath); - if (!JVMP_addOption(opt, str, NULL)) return JNI_FALSE; - - java_libpath = (char*) malloc(strlen(global_libpath) + 30); - sprintf(java_libpath, "-Djava.library.path=%s", global_libpath); - if (!JVMP_addOption(opt, java_libpath, NULL)) return JNI_FALSE; - - java_home = (char*) malloc(strlen(JVMP_plugin_home)+30); - sprintf(java_home, "-Djava.home=%s"FILE_SEPARATOR"jre", JDK_home); - if (!JVMP_addOption(opt, java_home, NULL)) return JNI_FALSE; - free(pluginclasspath); - - bootclasspath = (char*) malloc(3*strlen(JVMP_plugin_home)+180); - sprintf(bootclasspath, "-Xbootclasspath:" - "%s"FILE_SEPARATOR"jre"FILE_SEPARATOR"classes"PATH_SEPARATOR - "%s"FILE_SEPARATOR"jre"FILE_SEPARATOR"lib"FILE_SEPARATOR"rt.jar"PATH_SEPARATOR - "%s"FILE_SEPARATOR"jre"FILE_SEPARATOR"lib"FILE_SEPARATOR"i18n.jar", - JDK_home, JDK_home, JDK_home - ); - if (!JVMP_addOption(opt, bootclasspath, NULL)) - return JNI_FALSE; - - if (!JVMP_addOption(opt, "-Djava.security.manager", NULL)) - return JNI_FALSE; - - jvmphome = (char*) malloc(strlen(JVMP_plugin_home)+20); - sprintf(jvmphome, "-Djvmp.home=%s", JVMP_plugin_home); - if (!JVMP_addOption( opt, jvmphome, NULL)) - return JNI_FALSE; - - policyurl = createURL("file", JVMP_plugin_home, "plugin.policy"); - policypath = (char*) malloc(strlen(policyurl)+30); - sprintf(policypath, "-Djava.security.policy=%s", policyurl); - free(policyurl); - if (!JVMP_addOption( opt, policypath, NULL)) - return JNI_FALSE; - - for (i=0; i < (int)opt->nOptions; i++) - PLUGIN_LOG3("JVM option[%d]=%s", i, opt->options[i].optionString); - *pargs = opt; - return JNI_TRUE; -} - - -static jint JNICALL JVMP_initJavaClasses(JavaVM* jvm, JNIEnv* env) { - jclass clz; - jmethodID meth; - jobject inst; - jstring jhome; - -#ifdef XP_WIN32 -#define WF_MAIN_CLASS "sun/jvmp/generic/win32/Plugin" -#endif -#ifdef XP_UNIX -#define WF_MAIN_CLASS "sun/jvmp/generic/motif/Plugin" -#endif - - (*env)->ExceptionClear(env); - /* Find main plugin's class */ - - clz = (*env)->FindClass(env, WF_MAIN_CLASS); - if (clz == NULL) { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return JNI_FALSE; - } - jhome = (*env)->NewStringUTF(env, JVMP_plugin_home); - - /* Find its "startJVM" method */ - meth = (*env)->GetStaticMethodID(env, clz, "startJVM", - "(Ljava/lang/String;I)Lsun/jvmp/PluggableJVM;"); - if ((*env)->ExceptionOccurred(env)) { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return JNI_FALSE; - }; - inst = (*env)->CallStaticObjectMethod(env, clz, meth, jhome, DEBUG_LEVEL); - if ((*env)->ExceptionOccurred(env)) { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return JNI_FALSE; - }; - JVMP_PluginInstance = (*env)->NewWeakGlobalRef(env, inst); - JVMP_PluginClass = (*env)->NewWeakGlobalRef(env, clz); - return JNI_TRUE; -} - -/* prototype for this function */ -static jint JNICALL JVMP_GetCallingContext(JVMP_CallingContext **pctx); -static jint JVMP_SetCap(JVMP_CallingContext *ctx, jint cap_no) -{ - JVMP_ALLOW_CAP(ctx->caps, cap_no); - return JNI_TRUE; -} - -static jint JVMP_SetCaps(JVMP_CallingContext *ctx, - JVMP_SecurityCap *new_caps) -{ - if (!new_caps) return JNI_FALSE; - memcpy(&(ctx->caps), new_caps, sizeof(JVMP_SecurityCap)); - return JNI_TRUE; -} - -static jint JVMP_GetCap(JVMP_CallingContext *ctx, jint cap_no) -{ - return JVMP_IS_CAP_ALLOWED(ctx->caps, cap_no) ? JNI_TRUE : JNI_FALSE; -} - - - -static jint JVMP_IsActionAllowed(JVMP_CallingContext *ctx, - JVMP_SecurityAction *caps) -{ - int i, r; - for(i=0, r=1; i < JVMP_MAX_CAPS_BYTES; i++) - { - r = - r && ((~(caps->bits)[i]) | - (((ctx->caps).bits)[i] & (caps->bits)[i])); - if (!r) return JNI_FALSE; - } - return JNI_TRUE; -} -static jint JNICALL JVMP_AttachCurrentThread(JVMP_CallingContext* ctx, - jint *pID); -static jint JNICALL JVMP_DetachCurrentThread(JVMP_CallingContext* ctx); -static JVMP_CallingContext* NewCallingContext() -{ - JVMP_CallingContext* ctx_new = NULL; - jint tid; - - ctx_new = (JVMP_CallingContext *) malloc(sizeof(JVMP_CallingContext)); - if (!ctx_new) return NULL; - ctx_new->This = ctx_new; - ctx_new->source_thread = THIS_THREAD(); - ctx_new->env = NULL; - ctx_new->data = NULL; - ctx_new->err = JVMP_ERROR_NOERROR; - ctx_new->source_thread->ctx = ctx_new; - - JVMP_FORBID_ALL_CAPS(ctx_new->caps); - /* basic capabilities of every calling context */ - JVMP_ALLOW_CAP(ctx_new->caps, JVMP_CAP_SYS_PARITY); - JVMP_ALLOW_CAP(ctx_new->caps, JVMP_CAP_SYS_CHCAP); - /* nothing useful here, as no JNIEnv yet. Later call UpdateCaps() */ - ctx_new->jcaps = NULL; - ctx_new->AllowCap = &JVMP_SetCap; - ctx_new->GetCap = &JVMP_GetCap; - ctx_new->SetCaps = &JVMP_SetCaps; - ctx_new->IsActionAllowed = &JVMP_IsActionAllowed; - if (JVMP_JVM_running != NULL) JVMP_AttachCurrentThread(ctx_new, &tid); - return ctx_new; -} -static void DestroyCallingContext(JVMP_CallingContext* ctx) -{ - free(ctx); -} -static jint ValidCtx(JVMP_CallingContext* ctx) -{ - JVMP_Thread* thr; - if (!ctx) return JNI_FALSE; - thr = THIS_THREAD(); - if (ctx->source_thread != thr) - { - PLUGIN_LOG("USED FROM INCORRECT THREAD. JVMP_CallingContext is per-thread structure"); - return JNI_FALSE; - } - /* clean up errors in this context */ - ctx->err = JVMP_ERROR_NOERROR; - return JNI_TRUE; -} - -static jint JNICALL JVMP_GetDescription(JVMP_PluginDescription* *pdesc) -{ - if (!pdesc) return JNI_FALSE; - *pdesc = &JVMP_Description; - return JNI_TRUE; -} - -/* arguments are taken into account only if JVM isn't already created */ -static jint JNICALL JVMP_GetRunningJVM(JVMP_CallingContext **pctx, - void* args, - jint allow_reuse) -{ - JavaVM* jvm_new = NULL; - JVMP_CallingContext* ctx_new = NULL; - JNIEnv* env_new = NULL; - jint jvm_err, tid; - - MUTEX_LOCK(jvm_mutex); - if (JVMP_JVM_running == NULL) - { - if (!JVMP_initClassPath(&args)) return JNI_FALSE; - ctx_new = NewCallingContext(); - if (!ctx_new) return JNI_FALSE; - /* let's start with attempt to find out is Java VM already loaded */ - if (allow_reuse && JVMP_ReuseJVM(&jvm_new)) - { - (*jvm_new)->GetEnv(jvm_new, (void**)&(ctx_new->env), DEFAULT_JNI_VERSION); - } - else if ((jvm_err = JVMP_JVMMethods.JNI_CreateJavaVM - (&jvm_new, (void**)&(ctx_new->env), args)) != JNI_OK) - { - PLUGIN_LOG2("JVMP: JNI_CreateJavaVM failed due %d", (int)jvm_err); - MUTEX_UNLOCK(jvm_mutex); - return jvm_err; - } - - env_new = ctx_new->env; - JVMP_JVM_running = jvm_new; - JVMP_PluginContext.jvm = jvm_new; - } else { - /* XXX: FIXME version */ - MUTEX_UNLOCK(jvm_mutex); - return JVMP_GetCallingContext(pctx); - }; - - if (env_new) { - if (!JVMP_initJavaClasses(jvm_new, env_new)) { - PLUGIN_LOG("Problems with Java classes of JVMP. Cannot continue."); - JVMP_JVM_running = NULL; - MUTEX_UNLOCK(jvm_mutex); - return JNI_FALSE; - }; - (*pctx) = ctx_new; - (*env_new)->ExceptionClear(env_new); - /* this call from NewCallingContext() not executed, as JVM was NULL */ - JVMP_AttachCurrentThread(ctx_new, &tid); - MUTEX_UNLOCK(jvm_mutex); - return JNI_TRUE; - } - else { - MUTEX_UNLOCK(jvm_mutex); - return JNI_FALSE; - }; -} -static jint JNICALL JVMP_SendSysEvent(JVMP_CallingContext* ctx, - jint event, - jlong data, - jint priority) -{ - static jmethodID myMethod=NULL; - jint result; - JNIEnv* env; - - - if (!ValidCtx(ctx)) return JNI_FALSE; - if (ctx->GetCap(ctx, JVMP_CAP_SYS_SYSEVENT) != JNI_TRUE) - { - ctx->err = JVMP_ERROR_NOACCESS; - return JNI_FALSE; - } - env = ctx->env; - if (!myMethod) - { - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "sendSysEvent", "([BIJI)I"); - if (myMethod == NULL) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_NOSUCHMETHOD; - return JNI_FALSE; - } - } - UpdateCaps(ctx); - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - ctx->jcaps, event, data, priority); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_JAVAEXCEPTION; - return JNI_FALSE; - } - if (result == 0) - { - ctx->err = JVMP_ERROR_METHODFAILED; - return JNI_FALSE; - } - return JNI_TRUE; -} - -static jint JNICALL JVMP_PostSysEvent(JVMP_CallingContext* ctx, - jint event, - jlong data, - jint priority) -{ - static jmethodID myMethod=NULL; - jint result; - JNIEnv* env; - - - if (!ValidCtx(ctx)) return JNI_FALSE; - if (ctx->GetCap(ctx, JVMP_CAP_SYS_SYSEVENT) != JNI_TRUE) - { - ctx->err = JVMP_ERROR_NOACCESS; - return JNI_FALSE; - } - env = ctx->env; - if (!myMethod) - { - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "postSysEvent", "([BIJI)I"); - if (myMethod == NULL) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_NOSUCHMETHOD; - return JNI_FALSE; - } - } - UpdateCaps(ctx); - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - ctx->jcaps, event, data, priority); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_JAVAEXCEPTION; - return JNI_FALSE; - } - if (result == 0) - { - ctx->err = JVMP_ERROR_METHODFAILED; - return JNI_FALSE; - } - return JNI_TRUE; -} - -static jint JNICALL JVMP_StopJVM(JVMP_CallingContext* ctx) { - static jmethodID myMethod=NULL; - JNIEnv* env; - jint res; - - if (!ValidCtx(ctx)) return JNI_FALSE; - if (ctx->GetCap(ctx, JVMP_CAP_SYS_SYSTEM) != JNI_TRUE) - { - ctx->err = JVMP_ERROR_NOACCESS; - return JNI_FALSE; - } - env = ctx->env; - if (JVMP_JVM_running == NULL) return JNI_TRUE; - if (!myMethod) - { - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "stopJVM", "([B)I"); - if (myMethod == NULL) { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_NOSUCHMETHOD; - return JNI_FALSE; - } - } - UpdateCaps(ctx); - res = (*env)->CallIntMethod(env, JVMP_PluginInstance, - myMethod, ctx->jcaps); - if ((*env)->ExceptionOccurred(env)) { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_JAVAEXCEPTION; - return JNI_FALSE; - } - /* if stopJVM returns > 0, it means there are some not unregistered - extensions, so not try to kill JVM */ - if (res > 0) return JNI_TRUE; - /* FIXME: I don't know how to completly destroy JVM. - Current code waits until only one thread left - but how to kill 'em? - Host application should be able to control such stuff as execution of - JVM, even if there are some java threads running - */ - (*JVMP_JVM_running)->DestroyJavaVM(JVMP_JVM_running); - JVMP_JVM_running = NULL; - return JNI_TRUE; -} - -static jint JNICALL JVMP_RegisterWindow(JVMP_CallingContext* ctx, - JVMP_DrawingSurfaceInfo *win, - jint *pID) -{ - jint handle; - jint ID=0; - static jmethodID myMethod=NULL; - JNIEnv* env; - - if (!ValidCtx(ctx)) return JNI_FALSE; - if (win == NULL) return JNI_FALSE; - if (ctx->GetCap(ctx, JVMP_CAP_SYS_SYSTEM) != JNI_TRUE) - { - ctx->err = JVMP_ERROR_NOACCESS; - return JNI_FALSE; - } - env = ctx->env; - handle = (jint)(win->window); - if (!myMethod) - { - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "RegisterWindow", "(III)I"); - if (myMethod == NULL) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_NOSUCHMETHOD; - return JNI_FALSE; - } - } - ID = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - handle, win->width, win->height); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_JAVAEXCEPTION; - return JNI_FALSE; - } - if (ID == 0) - { - ctx->err = JVMP_ERROR_METHODFAILED; - return JNI_FALSE; - }; - if (pID) *pID = ID; - return JNI_TRUE; -} - -static jint JNICALL JVMP_UnregisterWindow(JVMP_CallingContext* ctx, - jint ID) -{ - static jmethodID myMethod=NULL; - jint result; - JNIEnv* env; - - if (!ValidCtx(ctx)) return JNI_FALSE; - if (ctx->GetCap(ctx, JVMP_CAP_SYS_SYSTEM) != JNI_TRUE) - { - ctx->err = JVMP_ERROR_NOACCESS; - return JNI_FALSE; - } - if (ID <= 0) - { - ctx->err = JVMP_ERROR_INVALIDARGS; - return JNI_FALSE; - } - env = ctx->env; - if (!myMethod) - { - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "UnregisterWindow", "(I)I"); - if (myMethod == NULL) { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_NOSUCHMETHOD; - return JNI_FALSE; - } - } - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - ID); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_JAVAEXCEPTION; - return JNI_FALSE; - }; - if (result != ID) - { - ctx->err = JVMP_ERROR_METHODFAILED; - return JNI_FALSE; - } - return JNI_TRUE; -} - -static jint JNICALL JVMP_GetCallingContext(JVMP_CallingContext* *pctx) -{ - jint ret; - JVMP_CallingContext* ctx_new; - JVMP_Thread* thr = THIS_THREAD(); - - if (thr->ctx) - { - *pctx = thr->ctx; - return JNI_TRUE; - } - ctx_new = NewCallingContext(); - if (!ctx_new) return JNI_FALSE; - ret = (*JVMP_JVM_running)->GetEnv(JVMP_JVM_running, - (void**)&(ctx_new->env), - DEFAULT_JNI_VERSION); - *pctx = ctx_new; - return (ret == JNI_OK ? JNI_TRUE : JNI_FALSE); -} -/* registers native object, that consist of pair - mutex/condvar and can be used to synchronize execution of Java and - native threads. -*/ -static jint JNICALL JVMP_RegisterMonitorObject(JVMP_CallingContext* ctx, - JVMP_MonitorInfo *monitor, - jint *pID) -{ - jint ID=0; - static jmethodID myMethod=NULL; - JNIEnv* env; - - if (!ValidCtx(ctx)) return JNI_FALSE; - /* we can register only correctly - (using JVMP_MONITOR_INITIALIZER macros) initialized monitors */ - if ((monitor == NULL) || (monitor->monitor_state != JVMP_STATE_NOTINITED) || - (monitor->mutex_state != JVMP_STATE_NOTINITED)) - return JNI_FALSE; - if (ctx->GetCap(ctx, JVMP_CAP_SYS_SYSTEM) != JNI_TRUE) - { - ctx->err = JVMP_ERROR_NOACCESS; - return JNI_FALSE; - } - env = ctx->env; - if (!myMethod) - { - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "RegisterMonitorObject", "(J)I"); - if (myMethod == NULL) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_NOSUCHMETHOD; - return JNI_FALSE; - } - } - monitor->owner = THIS_THREAD(); - ID = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - PTR_TO_JLONG(monitor)); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_JAVAEXCEPTION; - return JNI_FALSE; - } - if (ID == 0) return JNI_FALSE; - monitor->id = ID; - monitor->monitor_state = JVMP_STATE_INITED; - monitor->mutex_state = JVMP_STATE_INITED; - if (pID) *pID = ID; - return JNI_TRUE; -} - -static jint JNICALL JVMP_UnregisterMonitorObject(JVMP_CallingContext* ctx, - jint ID) -{ - static jmethodID myMethod=NULL; - jint result; - JNIEnv* env; - - if (!ValidCtx(ctx)) return JNI_FALSE; - if (ID <= 0) return JNI_FALSE; - if (ctx->GetCap(ctx, JVMP_CAP_SYS_SYSTEM) != JNI_TRUE) - { - ctx->err = JVMP_ERROR_NOACCESS; - return JNI_FALSE; - } - env = ctx->env; - if (!myMethod) - { - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "UnregisterMonitorObject", "(I)I"); - if (myMethod == NULL) { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_NOSUCHMETHOD; - return JNI_FALSE; - } - } - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - ID); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_JAVAEXCEPTION; - return JNI_FALSE; - }; - if (result != ID) - { - ctx->err = JVMP_ERROR_METHODFAILED; - return JNI_FALSE; - } - return JNI_TRUE; -} - -static jint JNICALL JVMP_AttachCurrentThread(JVMP_CallingContext* ctx, - jint *pID) -{ - static jmethodID myMethod = NULL; - jint result = 0; - JNIEnv* env; - - /* - to prevent people from using this method incorrectly - GetCallingContext - should be used instead - */ - if (!ValidCtx(ctx)) return JNI_FALSE; - result = (*JVMP_JVM_running)->AttachCurrentThread(JVMP_JVM_running, - (void**)&(ctx->env), NULL); - env = ctx->env; - if (result != JNI_OK) return JNI_FALSE; - - if (!myMethod) - { - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "attachThread", "()I"); - if (myMethod == NULL) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_NOSUCHMETHOD; - return JNI_FALSE; - } - } - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_JAVAEXCEPTION; - return JNI_FALSE; - }; - if (result == 0) - { - ctx->err = JVMP_ERROR_METHODFAILED; - return JNI_FALSE; - } - ctx->source_thread->id = result; - *pID = result; - return JNI_TRUE; -} - -static jint JNICALL JVMP_DetachCurrentThread(JVMP_CallingContext* ctx) -{ - static jmethodID myMethod = NULL; - jint result = 0; - JNIEnv* env; - - if (!ValidCtx(ctx)) return JNI_FALSE; - env = ctx->env; - if (!myMethod) - { - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "detachThread", "()I"); - if (myMethod == NULL) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_NOSUCHMETHOD; - return JNI_FALSE; - } - } - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_JAVAEXCEPTION; - return JNI_FALSE; - } - if (result == 0) - { - ctx->err = JVMP_ERROR_METHODFAILED; - return JNI_FALSE; - } - (*JVMP_JVM_running)->DetachCurrentThread(JVMP_JVM_running); - if (ctx->source_thread->cleanup) - ctx->source_thread->cleanup(ctx->source_thread); - DestroyCallingContext(ctx); - return JNI_TRUE; -} - -static jint JNICALL JVMP_CreatePeer(JVMP_CallingContext* ctx, - const char* cid, - jint version, - jint *target) -{ - static jmethodID myMethod = NULL; - jint result = 0; - JNIEnv* env = NULL; - jstring jcid = NULL; - - if (!ValidCtx(ctx)) return JNI_FALSE; - if (ctx->GetCap(ctx, JVMP_CAP_SYS_EVENT) != JNI_TRUE) - { - ctx->err = JVMP_ERROR_NOACCESS; - return JNI_FALSE; - } - env = ctx->env; - if (!myMethod) - { - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "createPeer", "([BLjava/lang/String;I)I"); - if (myMethod == NULL) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_NOSUCHMETHOD; - return JNI_FALSE; - } - } - UpdateCaps(ctx); - jcid = (*env)->NewStringUTF(env, cid); - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - ctx->jcaps, jcid, version); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_JAVAEXCEPTION; - return JNI_FALSE; - } - if (result == 0) - { - ctx->err = JVMP_ERROR_METHODFAILED; - return JNI_FALSE; - } - *target = result; - return JNI_TRUE; -} - -static jint JNICALL JVMP_SendEvent(JVMP_CallingContext* ctx, - jint target, - jint event, - jlong data, - jint priority) -{ - static jmethodID myMethod=NULL; - jint result; - JNIEnv* env; - - - if (!ValidCtx(ctx)) return JNI_FALSE; - if (ctx->GetCap(ctx, JVMP_CAP_SYS_EVENT) != JNI_TRUE) - { - ctx->err = JVMP_ERROR_NOACCESS; - return JNI_FALSE; - } - env = ctx->env; - if (!myMethod) - { - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "sendEvent", "([BIIJI)I"); - if (myMethod == NULL) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_NOSUCHMETHOD; - return JNI_FALSE; - }; - } - UpdateCaps(ctx); - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - ctx->jcaps, target, event, data, priority); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_JAVAEXCEPTION; - return JNI_FALSE; - } - return result; -} - -static jint JNICALL JVMP_PostEvent(JVMP_CallingContext* ctx, - jint target, - jint event, - jlong data, - jint priority) -{ - static jmethodID myMethod=NULL; - jint result; - JNIEnv* env; - if (!ValidCtx(ctx)) return JNI_FALSE; - if (ctx->GetCap(ctx, JVMP_CAP_SYS_EVENT) != JNI_TRUE) - { - ctx->err = JVMP_ERROR_NOACCESS; - return JNI_FALSE; - } - env = ctx->env; - if (!myMethod) - { - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "postEvent", "([BIIJI)I"); - if (myMethod == NULL) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_NOSUCHMETHOD; - return JNI_FALSE; - } - } - UpdateCaps(ctx); - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - ctx->jcaps, target, event, data, priority); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_JAVAEXCEPTION; - return JNI_FALSE; - }; - if (result == 0) - { - ctx->err = JVMP_ERROR_METHODFAILED; - return JNI_FALSE; - } - return JNI_TRUE; -} - -static jint JNICALL JVMP_DestroyPeer(JVMP_CallingContext* ctx, - jint target) -{ - - jmethodID myMethod = NULL; - jint result = 0; - JNIEnv* env; - - if (!ValidCtx(ctx)) return JNI_FALSE; - if (ctx->GetCap(ctx, JVMP_CAP_SYS_EVENT) != JNI_TRUE) - { - ctx->err = JVMP_ERROR_NOACCESS; - return JNI_FALSE; - } - env = ctx->env; - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "destroyPeer", "([BI)I"); - if (myMethod == NULL) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_NOSUCHMETHOD; - return JNI_FALSE; - }; - UpdateCaps(ctx); - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - ctx->jcaps, target); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_JAVAEXCEPTION; - return JNI_FALSE; - }; - if (result != target) - { - ctx->err = JVMP_ERROR_METHODFAILED; - return JNI_FALSE; - } - return JNI_TRUE; -} - - -static jint JNICALL JVMP_RegisterExtension(JVMP_CallingContext* ctx, - const char* extPath, - jint *pID, - jlong data) -{ - dll_t handle; - JVMP_GetExtension_t JVMP_GetExtension; - JVMP_Extension* ext; - const char* cid=NULL; - jint version, result=0; - static jmethodID myMethod = NULL; - char *classpath, *classname; - jstring jclasspath=NULL, jclassname=NULL, jcid=NULL; - JNIEnv* env; - JVMP_SecurityCap caps, sh_mask; - jbyteArray jcaps, jmask; - - if (!ValidCtx(ctx)) return JNI_FALSE; - if (ctx->GetCap(ctx, JVMP_CAP_SYS_SYSTEM) != JNI_TRUE) - { - ctx->err = JVMP_ERROR_NOACCESS; - return JNI_FALSE; - } - env = ctx->env; - handle = JVMP_LoadDLL(extPath, DL_MODE); - if (!handle) { - PLUGIN_LOG2("extension LoadDLL: %s", JVMP_LastDLLErrorString()); - return JNI_FALSE; - }; - JVMP_GetExtension = - (JVMP_GetExtension_t)JVMP_FindSymbol(handle, "JVMP_GetExtension"); - if (JVMP_GetExtension == NULL) - { - PLUGIN_LOG2("extension FindSymbol: %s", JVMP_LastDLLErrorString()); - return JNI_FALSE; - } - /* to implement JVMP_UnregisterExtension we should support - GHashTable of opened extensions, but later */ - if (((*JVMP_GetExtension)(&ext) != JNI_TRUE)) - { - PLUGIN_LOG2("Cannot obtain extension from %s", extPath); - ctx->err = JVMP_ERROR_INITFAILED; - return JNI_FALSE; - } - (ext->JVMPExt_GetExtInfo)(&cid, &version, NULL); - if ((ext->JVMPExt_Init)(0) != JNI_TRUE) - { - ctx->err = JVMP_ERROR_INITFAILED; - return JNI_FALSE; - } - /* get capability range reserved by this extension */ - if ((ext->JVMPExt_GetCapsRange)(&caps, &sh_mask) != JNI_TRUE) - { - ctx->err = JVMP_ERROR_INITFAILED; - return JNI_FALSE; - } - jcaps = (*env)->NewByteArray(env, sizeof(JVMP_SecurityCap)); - if (jcaps == NULL) return JNI_FALSE; - (*env)->SetByteArrayRegion(env, jcaps, - 0, sizeof(JVMP_SecurityCap), (jbyte*)caps.bits); - jmask = (*env)->NewByteArray(env, sizeof(JVMP_SecurityCap)); - if (jmask == NULL) return JNI_FALSE; - (*env)->SetByteArrayRegion(env, jmask, - 0, sizeof(JVMP_SecurityCap), - (jbyte*)sh_mask.bits); - if (!myMethod) - { - myMethod = - (*env)->GetMethodID(env, JVMP_PluginClass, - "registerExtension", - "(Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;[B[BJ)I"); - if (myMethod == NULL) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_NOSUCHMETHOD; - return JNI_FALSE; - } - } - - (ext->JVMPExt_GetBootstrapClass)(&classpath, &classname); - jclasspath = (*env)->NewStringUTF(env, classpath); - jclassname = (*env)->NewStringUTF(env, classname); - jcid = (*env)->NewStringUTF(env, cid); - if (jclasspath == NULL || jclassname == NULL || jcid == NULL) - { - ctx->err = JVMP_ERROR_INITFAILED; - return JNI_FALSE; - } - - result = (*env)->CallIntMethod(env, - JVMP_PluginInstance, - myMethod, - jcid, - version, - jclasspath, - jclassname, - jcaps, - jmask, - data); - - /* XXX: maybe leak of jclasspath, jclassname, jcaps - ReleaseStringUTFChars*/ - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_JAVAEXCEPTION; - return JNI_FALSE; - } - *pID = result; - return JNI_TRUE; -} - -static jint JNICALL JVMP_SendExtensionEvent(JVMP_CallingContext* ctx, - jint target, - jint event, - jlong data, - jint priority) -{ - static jmethodID myMethod=NULL; - jint result; - JNIEnv* env; - - - if (!ValidCtx(ctx)) return JNI_FALSE; - if (ctx->GetCap(ctx, JVMP_CAP_SYS_EVENT) != JNI_TRUE) - { - ctx->err = JVMP_ERROR_NOACCESS; - return JNI_FALSE; - } - env = ctx->env; - if (!myMethod) - { - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "sendExtensionEvent", "([BIIJI)I"); - if (myMethod == NULL) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_NOSUCHMETHOD; - return JNI_FALSE; - } - } - UpdateCaps(ctx); - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - ctx->jcaps, target, event, data, priority); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_JAVAEXCEPTION; - return JNI_FALSE; - }; - if (result == 0) - { - ctx->err = JVMP_ERROR_METHODFAILED; - return JNI_FALSE; - } - return JNI_TRUE; -} - -static jint JNICALL JVMP_PostExtensionEvent(JVMP_CallingContext* ctx, - jint target, - jint event, - jlong data, - jint priority) -{ - static jmethodID myMethod=NULL; - jint result; - JNIEnv* env; - if (!ValidCtx(ctx)) return JNI_FALSE; - if (ctx->GetCap(ctx, JVMP_CAP_SYS_EVENT) != JNI_TRUE) - { - ctx->err = JVMP_ERROR_NOACCESS; - return JNI_FALSE; - } - env = ctx->env; - if (!myMethod) - { - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "postExtensionEvent", "([BIIJI)I"); - - if (myMethod == NULL) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_NOSUCHMETHOD; - return JNI_FALSE; - }; - } - UpdateCaps(ctx); - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - ctx->jcaps, target, event, data, priority); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_JAVAEXCEPTION; - return JNI_FALSE; - }; - if (result == 0) - { - ctx->err = JVMP_ERROR_METHODFAILED; - return JNI_FALSE; - } - return JNI_TRUE; -} - - -static jint JNICALL JVMP_DirectPeerCall(JVMP_CallingContext* ctx, - jint target, - jint arg1, - jlong arg2) -{ - static jmethodID myMethod=NULL; - jint result; - JNIEnv* env; - if (!ValidCtx(ctx)) return JNI_FALSE; - if (ctx->GetCap(ctx, JVMP_CAP_SYS_CALL) != JNI_TRUE) - { - ctx->err = JVMP_ERROR_NOACCESS; - return JNI_FALSE; - } - env = ctx->env; - if (!myMethod) - { - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "handleCall", "([BIIIJ)I"); - if (myMethod == NULL) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_NOSUCHMETHOD; - return JNI_FALSE; - } - } - UpdateCaps(ctx); - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - ctx->jcaps, 1, target, arg1, arg2); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_JAVAEXCEPTION; - return JNI_FALSE; - }; - return result; -} - -static jint JNICALL JVMP_DirectExtCall(JVMP_CallingContext* ctx, - jint target, - jint arg1, - jlong arg2) -{ - static jmethodID myMethod=NULL; - jint result; - JNIEnv* env; - if (!ValidCtx(ctx)) return JNI_FALSE; - if (ctx->GetCap(ctx, JVMP_CAP_SYS_CALL) != JNI_TRUE) - { - ctx->err = JVMP_ERROR_NOACCESS; - return JNI_FALSE; - } - env = ctx->env; - if (!myMethod) - { - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "handleCall", "([BIIIJ)I"); - if (myMethod == NULL) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_NOSUCHMETHOD; - return JNI_FALSE; - } - } - UpdateCaps(ctx); - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - ctx->jcaps, 2, target, arg1, arg2); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_JAVAEXCEPTION; - return JNI_FALSE; - }; - return result; -} - -static jint JNICALL JVMP_DirectJVMCall(JVMP_CallingContext* ctx, - jint arg1, - jlong arg2) -{ - static jmethodID myMethod=NULL; - jint result; - JNIEnv* env; - if (!ValidCtx(ctx)) return JNI_FALSE; - if (ctx->GetCap(ctx, JVMP_CAP_SYS_SYSCALL) != JNI_TRUE) - { - ctx->err = JVMP_ERROR_NOACCESS; - return JNI_FALSE; - } - env = ctx->env; - if (!myMethod) - { - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "handleCall", "([BIIJ)I"); - if (myMethod == NULL) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_NOSUCHMETHOD; - return JNI_FALSE; - } - } - UpdateCaps(ctx); - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - ctx->jcaps, 3, arg1, arg2); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_JAVAEXCEPTION; - return JNI_FALSE; - }; - return result; -} - -static jint JNICALL JVMP_UnregisterExtension(JVMP_CallingContext* ctx, - jint ID) -{ - jint result; - JNIEnv* env; - static jmethodID myMethod = NULL; - - if (!ValidCtx(ctx)) return JNI_FALSE; - if (ctx->GetCap(ctx, JVMP_CAP_SYS_SYSTEM) != JNI_TRUE) - { - ctx->err = JVMP_ERROR_NOACCESS; - return JNI_FALSE; - } - env = ctx->env; - if (!myMethod) - { - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "unregisterExtension", "([BI)I"); - if (myMethod == NULL) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_NOSUCHMETHOD; - return JNI_FALSE; - } - } - UpdateCaps(ctx); - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - ctx->jcaps, ID); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_JAVAEXCEPTION; - return JNI_FALSE; - } - return result; -} - -static jint JNICALL JVMP_EnableCapabilities(JVMP_CallingContext* ctx, - JVMP_SecurityCap* caps, - jint num_principals, - jint* principals_len, - jbyte* *principals) -{ - JNIEnv* env; - static jmethodID myMethod = NULL; - jbyteArray jcaps = NULL, jprinc; - jobjectArray jprincipals = NULL; - jint result, i; - jclass byteArrayClass; - - if (!ValidCtx(ctx)) return JNI_FALSE; - if (ctx->GetCap(ctx, JVMP_CAP_SYS_CHCAP) != JNI_TRUE) - { - ctx->err = JVMP_ERROR_NOACCESS; - return JNI_FALSE; - } - env = ctx->env; - if (!myMethod) - { - myMethod = - (*env)->GetMethodID(env, JVMP_PluginClass, - "enableCapabilities", - "([B[[B)I"); - if (myMethod == NULL) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_NOSUCHMETHOD; - return JNI_FALSE; - } - } - byteArrayClass = (*env)->FindClass(env, "[B"); - jprincipals = (*env)->NewObjectArray(env, num_principals, - byteArrayClass, NULL); - if (jprincipals == NULL) return JNI_FALSE; - for (i=0; i < num_principals; i++) - { - jprinc = (*env)->NewByteArray(env, principals_len[i]); - if (jprinc == NULL) return JNI_FALSE; - (*env)->SetByteArrayRegion(env, jprinc, - 0, principals_len[i], - (jbyte*)principals[i]); - (*env)->SetObjectArrayElement(env, jprincipals, i, jprinc); - } - jcaps = (*env)->NewByteArray(env, sizeof(JVMP_SecurityCap)); - if (jcaps == NULL) return JNI_FALSE; - (*env)->SetByteArrayRegion(env, jcaps, - 0, sizeof(JVMP_SecurityCap), (jbyte*)caps->bits); - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, - myMethod, - jcaps, - jprincipals); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_JAVAEXCEPTION; - return JNI_FALSE; - }; - /* if Java side doesn't allow those capabilities */ - if (result != 1) - { - ctx->err = JVMP_ERROR_CAPSNOTGIVEN; - return JNI_FALSE; - } - /* update current context capabilities */ - JVMP_SET_CAPS(ctx->caps, *caps); - return JNI_TRUE; -} - -static jint JNICALL JVMP_DisableCapabilities(JVMP_CallingContext* ctx, - JVMP_SecurityCap* caps) -{ - JNIEnv* env; - static jmethodID myMethod = NULL; - jobject jprincipal = NULL; - jbyteArray jcaps = NULL; - jint result; - - if (!ValidCtx(ctx)) return JNI_FALSE; - if (ctx->GetCap(ctx, JVMP_CAP_SYS_CHCAP) != JNI_TRUE) - { - ctx->err = JVMP_ERROR_NOACCESS; - return JNI_FALSE; - } - env = ctx->env; - if (!myMethod) - { - myMethod = - (*env)->GetMethodID(env, JVMP_PluginClass, - "disableCapabilities", - "([B)I"); - if (myMethod == NULL) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_NOSUCHMETHOD; - return JNI_FALSE; - } - } - jcaps = (*env)->NewByteArray(env, sizeof(JVMP_SecurityCap)); - if (jcaps == NULL) return JNI_FALSE; - (*env)->SetByteArrayRegion(env, jcaps, 0, - sizeof(JVMP_SecurityCap), (jbyte*)caps->bits); - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, - myMethod, - jcaps, - jprincipal); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - ctx->err = JVMP_ERROR_JAVAEXCEPTION; - return JNI_FALSE; - }; - /* update current context capabilities */ - /* XXX: check for system caps */ - JVMP_RESET_CAPS(ctx->caps, *caps); - return JNI_TRUE; -} - -static jint JNICALL JVMP_GetLastErrorString(JVMP_CallingContext* ctx, - char* buf) -{ - jint err; - if (ctx) err=ctx->err; - if (!ValidCtx(ctx) || !buf) return JNI_FALSE; - strcpy(buf, g_jvmp_errors[err]); - return JNI_TRUE; -} -static JVMP_PluginDescription JVMP_Description = { -/* JVM vendor */ -#ifdef _JVMP_SUNJVM - "Sun", -#endif -#ifdef _JVMP_IBMJVM - "IBM", -#endif -/* JVM version: XXX - set it correctly */ - "1.3", -/* JVM kind */ - JVMKIND, -/* JVMP version */ - "1.0", -/* platform */ - PLATFORM, -/* arch */ - ARCH, -/* vendor specific data */ - NULL -}; -/* Here main structure is initialized */ - -static JVMP_RuntimeContext JVMP_PluginContext = { - NULL, - &JVMP_GetDescription, - &JVMP_GetRunningJVM, - &JVMP_SendSysEvent, - &JVMP_PostSysEvent, - &JVMP_StopJVM, - &JVMP_RegisterWindow, - &JVMP_UnregisterWindow, - &JVMP_RegisterMonitorObject, - &JVMP_UnregisterMonitorObject, - &JVMP_AttachCurrentThread, - &JVMP_DetachCurrentThread, - &JVMP_GetCallingContext, - &JVMP_CreatePeer, - &JVMP_SendEvent, - &JVMP_PostEvent, - &JVMP_DestroyPeer, - &JVMP_RegisterExtension, - &JVMP_SendExtensionEvent, - &JVMP_PostExtensionEvent, - &JVMP_UnregisterExtension, - &JVMP_EnableCapabilities, - &JVMP_DisableCapabilities, - &JVMP_DirectPeerCall, - &JVMP_DirectExtCall, - &JVMP_DirectJVMCall, - &JVMP_GetLastErrorString, - { NULL } -}; - -jint _JVMP_IMPORT_OR_EXPORT JNICALL JVMP_GetPlugin(JVMP_RuntimeContext** cx) { - if (cx == NULL) return JNI_FALSE; - if (jvm_mutex == NULL) MUTEX_CREATE(jvm_mutex); - if (!loadJVM(LIBJVM)) { - PLUGIN_LOG("BAD - JVM loading failed"); - *cx = NULL; - return JNI_FALSE; - } - (*cx) = &JVMP_PluginContext; - return JNI_TRUE; -} diff --git a/mozilla/java/waterfall/wf/src/plugin/jpthreads.c b/mozilla/java/waterfall/wf/src/plugin/jpthreads.c deleted file mode 100644 index 697c8ea9b85..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/jpthreads.c +++ /dev/null @@ -1,175 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: jpthreads.c,v 1.1.1.1 2001-05-09 17:30:05 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include "jpthreads.h" -#include - -#ifdef _JVMP_PTHREADS - -static pthread_key_t tid_key = (pthread_key_t) -1; -static int inited = 0; -static void cleanup(JVMP_Thread* thr) -{ - pthread_t tid; - - tid = pthread_self(); - if (!thr || (pthread_t)(thr->handle) != tid) - { - fprintf(stderr, "ERROR: tid mismatch!!!!\n"); - return; - } - free(thr); -} - -JVMP_Thread* ThreadInfoFromPthread() -{ - JVMP_Thread* thr = NULL; - - if (!inited) - { - pthread_key_create(&tid_key, NULL); - inited = 1; - } - thr = pthread_getspecific(tid_key); - if (thr) return thr; - thr = (JVMP_Thread*)malloc(sizeof(JVMP_Thread)); - thr->handle = (long)pthread_self(); - thr->id = 0; /* not yet attached */ - thr->state = 0; /* XXX: find out state using pthread calls */ - thr->cleanup = &cleanup; - thr->data = NULL; - thr->ctx = NULL; - pthread_setspecific(tid_key, thr); - return thr; -} - -#endif - -#ifdef _JVMP_WIN32THREADS -static int inited = 0; - -/* some ideas from JVM Win32 code - I have not so much experience - with low level Windows programming :( */ -#define TLS_INVALID_INDEX 0xffffffffUL -static unsigned long tls_index = TLS_INVALID_INDEX; - -static void cleanup(JVMP_Thread* thr) -{ - unsigned long tid; - - tid = (unsigned long)GetCurrentThread(); - if (!thr || (unsigned long)(thr->handle) != tid) - { - fprintf(stderr, "ERROR: tid mismatch!!!!\n"); - return; - } - free(thr); -} - -JVMP_Thread* ThreadInfoFromWthread() -{ - JVMP_Thread* thr = NULL; - - if (!inited) - { - tls_index = TlsAlloc(); - if (tls_index == TLS_INVALID_INDEX) { - fprintf(stderr, "ERROR: cannot create TLS\n"); - return NULL; - } - inited = 1; - } - thr = TlsGetValue(tls_index); - if (thr) return thr; - thr = (JVMP_Thread*)malloc(sizeof(JVMP_Thread)); - thr->handle = (long)GetCurrentThread(); - thr->id = 0; /* not yet attached */ - thr->state = 0; /* XXX: find out state using Win32 calls */ - thr->cleanup = &cleanup; - thr->data = NULL; - thr->ctx = NULL; - TlsSetValue(tls_index, thr); - return thr; -} -#endif - - -#ifdef XP_UNIX -dll_t JVMP_LoadDLL(const char* filename, int mode) -{ - return dlopen(filename, mode); -} - -void* JVMP_FindSymbol(dll_t dll, const char* sym) -{ - return dlsym(dll, sym); -} - -int JVMP_UnloadDLL(dll_t dll) -{ - return dlclose(dll); -} - -const char* JVMP_LastDLLErrorString() -{ - return dlerror(); -} - -#endif - -#ifdef XP_WIN32 -dll_t JVMP_LoadDLL(const char* filename, int mode) -{ - return LoadLibrary(filename); -} - -void* JVMP_FindSymbol(dll_t dll, const char* sym) -{ - return GetProcAddress(dll, sym); -} - -int JVMP_UnloadDLL(dll_t dll) -{ - // XXX: fix me - return 0; -} - -const char* JVMP_LastDLLErrorString() -{ - static LPVOID lpMsgBuf = NULL; - - free(lpMsgBuf); - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &lpMsgBuf, 0, NULL ); - return lpMsgBuf; -} - -#endif diff --git a/mozilla/java/waterfall/wf/src/plugin/jpthreads.h b/mozilla/java/waterfall/wf/src/plugin/jpthreads.h deleted file mode 100644 index 458ef3e23e8..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/jpthreads.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: jpthreads.h,v 1.1.1.1 2001-05-09 17:30:05 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include "jvmp.h" - -#ifdef XP_WIN32 -#include -#endif -#ifdef XP_UNIX -#include -#endif - - -#ifdef _JVMP_PTHREADS -#include -JVMP_Thread* ThreadInfoFromPthread(); -#define THIS_THREAD() ThreadInfoFromPthread() -#define MUTEX_T pthread_mutex_t -/* arguments are pointers */ -#define MUTEX_CREATE(m) m = (MUTEX_T*)malloc(sizeof(MUTEX_T)); pthread_mutex_init(m, NULL) -#define MUTEX_LOCK(m) pthread_mutex_lock(m) -#define MUTEX_UNLOCK(m) pthread_mutex_unlock(m) -#define MUTEX_DESTROY(m) pthread_mutex_destroy(m); free(m) -#endif /* of #ifdef _JVMP_PTHREADS */ - -#ifdef _JVMP_WIN32THREADS -JVMP_Thread* ThreadInfoFromWthread(); -#define THIS_THREAD() ThreadInfoFromWthread() -#define MUTEX_T CRITICAL_SECTION -/* arguments are pointers */ -#define MUTEX_CREATE(m) m = (MUTEX_T*)malloc(sizeof(MUTEX_T)); InitializeCriticalSection(m) -#define MUTEX_LOCK(m) EnterCriticalSection(m) -#define MUTEX_UNLOCK(m) LeaveCriticalSection(m) -#define MUTEX_DESTROY(m) free(m); -#endif /* of #ifdef _JVMP_WIN32THREADS */ - - -#ifdef XP_UNIX -#define dll_t void* -#define DL_MODE RTLD_NOW -#define FILE_SEPARATOR "/" -#define PATH_SEPARATOR ":" -#endif - -#ifdef XP_WIN32 -#define dll_t HINSTANCE -#define DL_MODE 0 -#define FILE_SEPARATOR "\\" -#define PATH_SEPARATOR ";" -#endif - -/* DLL handling here */ -dll_t JVMP_LoadDLL(const char* filename, int mode); -void* JVMP_FindSymbol(dll_t dll, const char* sym); -int JVMP_UnloadDLL(dll_t dll); -const char* JVMP_LastDLLErrorString(); diff --git a/mozilla/java/waterfall/wf/src/plugin/mozilla/XmHelper.c b/mozilla/java/waterfall/wf/src/plugin/mozilla/XmHelper.c deleted file mode 100644 index 2bb157649be..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/mozilla/XmHelper.c +++ /dev/null @@ -1,145 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: XmHelper.c,v 1.1.1.1 2001-05-09 17:30:09 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include -#include -#include -/* - Note: this tiny DLL overrides some symbols to allow libXm to be - dynamically loaded _after_ libXt. - The only thing you should care about is proper alignment: - "struct dummy_struct_t" should have the same binary layout as - VendorShellClassRec - i.e. use the same alignments as X uses. - On Solaris libawt.so does explicit check of name of library - where vendorShellWidgetClass defined, so this DLL should be called smth like - Helper.libXm.so.4. Stupid dog..... - Dedicated to Lyola. - Compile - gcc -D_GNU_SOURCE -O2 -fPIC -shared XmHelper.c -o Helper.libXm.so.4 -ldl - then - export LD_PRELOAD= - in script running Mozilla. -*/ - -struct dummy_struct_t -{ - void* reserved1; - void* reserved2; - /* typedef unsigned int Cardinal; */ - unsigned int len; - char data[1024]; -}; - -struct dummy_struct_t* vendorShellWidgetClass = NULL; -struct dummy_struct_t vendorShellClassRec = -{ - NULL, NULL, 0, "" -}; - -static int is_our(const char* filename) -{ - if (strstr(filename, "libawt.so") || strstr(filename, "libmawt.so") || - strstr(filename, "libawt_g.so") || strstr(filename, "libmawt_g.so")) - return 1; - return 0; -}; - -void *dlopen (const char *filename, int flag) -{ - typedef void* (*dlopen_t)(const char *filename, int flag); - static dlopen_t real = (void*)0; - void* result; - struct dummy_struct_t* s = (void*)0; - static int done = 0; - int size_core, size_total; - - //fprintf(stderr, "opening %s\n", filename); - if (!real) - real = (dlopen_t)dlsym(RTLD_NEXT, "dlopen"); - result = (*real)(filename, flag); - if (done || !filename || !result) - return result; - /* hate long ifs */ - if (!is_our(filename) && vendorShellWidgetClass) - return result; - s = (struct dummy_struct_t*)dlsym(result, "vendorShellClassRec"); - if (s) { - size_core = s->len; - size_total = size_core /* CoreClassPart */ + - 5*sizeof(void*) /* CompositeClassPart */ + - sizeof(void*) /* ShellClassPart */ + - sizeof(void*) /* WMShellClassPart */ + - sizeof(void*) /* VendorShellClassPart */; - if (size_total > sizeof(struct dummy_struct_t)) - { - fprintf(stderr, "Cannot override vendorShellClassRec: %d > %d\n", - size_total, sizeof(struct dummy_struct_t)); - } - else - { - if (is_our(filename)) - { - memcpy(&vendorShellClassRec, s, size_total); - vendorShellWidgetClass = &vendorShellClassRec; - done = 1; - } - else if (!vendorShellWidgetClass) - { - memcpy(&vendorShellClassRec, s, size_total); - vendorShellWidgetClass = &vendorShellClassRec; - } - } - } - /* - to clean up possible dlsym() errors. - dlopen() errors won't be lost, as it already succeed - */ - dlerror(); - return result; -} - -/* awfully dirty hack to allow JVM loading into browser on Solaris, - see src/solaris/hpi/native_threads/src/threads_solaris.c in JDK tree - for explanations. Need help from JDK people. */ -#ifdef __sun -#include -ulong_t __gettsp(thread_t thr) -{ - typedef ulong_t (*__gettsp_t)(thread_t thr); - static __gettsp_t real = (void*)0; - if (!real) - real = (__gettsp_t)dlsym(RTLD_NEXT, " __gettsp"); - return (*real)(thr); -} -#endif - - - - - - - - diff --git a/mozilla/java/waterfall/wf/src/plugin/mozilla/wf_moz6_common.h b/mozilla/java/waterfall/wf/src/plugin/mozilla/wf_moz6_common.h deleted file mode 100644 index d5af8000df8..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/mozilla/wf_moz6_common.h +++ /dev/null @@ -1,274 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: wf_moz6_common.h,v 1.1.1.1 2001-05-09 17:30:08 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef __wf_moz6_common_h -#define __wf_moz6_common_h -/** Ideology behind this file: - * To keep generic binary compatibility, and be independent from Mozilla - * build system for Mozilla extension (not very good idea, but currently - * it's more convinient) we need some kind of fixed API/ABI between - * extension and Java service in browser. This file is _only_ (beside - * jvmp.h) common header between Java component and extension. It's written - * in pure C and has no Mozilla dependencies. So JVM service in browser fills - * propers callbacks and the extension, if wishes to perform some call to - * Mozilla uses those callbacks (and maybe even in another direction, but - * it's not recommened - use JVMP_Direct*Call for such purposes). - * Here described structures for - * - common browser configuration callbacks (show status, show document, - * get proxy config, add anything you want) - * - LiveConnect calls and security - * JavaObjectWrapper is wrapper for java-driven objects on browser side, - * usually lifetime coincides with lifetime of web page. - * If underlying native object is dead, proper field is 1. - * SecurityContextWrapper is wrapper for security context is - * LiveConnect calls, lifetime coincide with lifetime - * of LiveConnect call. - * BrowserSupportWrapper is wrapper for global JVM service object, - * exist always until JVM service is loaded, can be - * used for global operations not related to browser - * NB: If any other browser will implement those callbacks and be kind enough - * to follow Mozilla protocol in inline plugin handling, it will have - * Java + applets + LiveConnect for free. For example MSIE code can be written - * in such a manner. - **/ - -struct SecurityContextWrapper { - void* info; - int (*Implies) (void* handle, const char* target, - const char* action, int *bAllowedAccess); - int (*GetOrigin)(void* handle, char *buffer, int len); - int (*GetCertificateID)(void* handle, char *buffer, int len); - int dead; -}; -typedef struct SecurityContextWrapper SecurityContextWrapper; -struct JavaObjectWrapper; -typedef struct JavaObjectWrapper JavaObjectWrapper; - -#define WF_APPLETPEER_CID "@sun.com/wf/mozilla/appletpeer;1" - -enum JSCallType { // Possible JS call type - JS_Unknown = 0, - JS_GetWindow = 1, - JS_ToString, - JS_Eval, - JS_Call, - JS_GetMember, - JS_SetMember, - JS_RemoveMember, - JS_GetSlot, - JS_SetSlot, - JS_Finalize - }; - -struct JSObject_CallInfo -{ - const char* pszUrl; // URL of the CodeSource object in the Java call - jobjectArray jCertArray; // Certificate array of the CodeSource object - jintArray jCertLengthArray; // Certificate length array of the CodeSource object - int iNumOfCerts; // Number of certificates in the cert and cert length array - jobject jAccessControlContext; // AccessControlContext object that represents the Java callstack - enum JSCallType type; // Type of JSObject call - jthrowable jException; // Java exception object as the result of the call - JavaObjectWrapper* pWrapper; // native-Java glueing object - union { - struct __GetWindow { - void* pPlugin; // Plug-in instance corresponded to the JSObject call - jint iNativeJSObject; // Native JS object as the result of the GetWindow call - } __getWindow; - struct __Finalize { - jint iNativeJSObject; // Native JS object that needs to be finalized - } __finalize; - struct __ToString { - jint iNativeJSObject; // Native JS object that corresponded to the JSObject.toString - jstring jResult; // Result of JSObject.toString - } __toString; - struct __Call { - const jchar* pszMethodName; // Method name - int iMethodNameLen; // Length of method name - jobjectArray jArgs; // Argument for the JSObject.Call - jint iNativeJSObject; // Native JS object corresponded to the JSObject.call - jobject jResult; // Result of JSObject.call - } __call; - struct __Eval { - const jchar* pszEval; // String to be evaluated - int iEvalLen; // Length of the evaluatation string - jint iNativeJSObject; // Native JS object corresponded to the JSObject.eval - jobject jResult; // Result of JSObject.eval - } __eval; - struct __GetMember { - const jchar* pszName; // Member name - int iNameLen; // Length of member name - jint iNativeJSObject; // Native JS object corresponded to the JSObject.getMember - jobject jResult; // Result of JSObject.getMember - } __getMember; - struct __SetMember { - const jchar* pszName; // Member name - int iNameLen; // Length of member name - jint iNativeJSObject; // Native JS object corresponded to the JSObject.setMember - jobject jValue; // Result of JSObject.setMember - } __setMember; - struct __RemoveMember { - const jchar* pszName; // Member name - int iNameLen; // Length of member name - jint iNativeJSObject; // Native JS object corresponded to the JSObject.removeMember - } __removeMember; - struct __GetSlot { - int iIndex; // Slot number - jint iNativeJSObject; // Native JS object corresponded to the JSObject.getSlot - jobject jResult; // Result of JSObject.getSlot - } __getSlot; - struct __SetSlot { - int iIndex; // Slot number - jobject jValue; // Value to set in the slot - jint iNativeJSObject; // Native JS object corresponded to the JSObject.setSlot - } __setSlot; - } data; -}; - -enum JavaCallType { - Java_Unknown = 0, - Java_WrapJSObject, - Java_CreateObject, - Java_CallMethod, - Java_CallStaticMethod, - Java_CallNonvirtualMethod, - Java_SetField, - Java_SetStaticField, - Java_GetField, - Java_GetStaticField, - Java_UnwrapJObject -}; - -/* just a copy of enum jni_type from nsISecureEnv, as I have to get - it from somewhere - values are the same, so can convert flawlessly */ -enum jvmp_jni_type -{ - jvmp_jobject_type = 0, - jvmp_jboolean_type, - jvmp_jbyte_type, - jvmp_jchar_type, - jvmp_jshort_type, - jvmp_jint_type, - jvmp_jlong_type, - jvmp_jfloat_type, - jvmp_jdouble_type, - jvmp_jvoid_type -}; - -struct Java_CallInfo -{ - enum JavaCallType type; - jthrowable jException; - SecurityContextWrapper* security; - union { - struct __WrapJSObject { - jint jsObject; - jint jstid; - jobject jObject ; - } __wrapJSObject; - struct __CreateObject { - jclass clazz; - jmethodID methodID; - jvalue *args; - jobject result; - } __createObject; - struct __CallMethod { - enum jvmp_jni_type type; - jobject obj; - jmethodID methodID; - jvalue *args; - jvalue result; - } __callMethod; - struct __CallStaticMethod { - enum jvmp_jni_type type; - jclass clazz; - jmethodID methodID; - jvalue *args; - jvalue result; - } __callStaticMethod; - struct __CallNonvirtualMethod { - enum jvmp_jni_type type; - jobject obj; - jclass clazz; - jmethodID methodID; - jvalue *args; - jvalue result; - } __callNonvirtualMethod; - struct __GetField { - enum jvmp_jni_type type; - jobject obj; - jfieldID fieldID; - jvalue result; - } __getField; - struct __GetStaticField { - enum jvmp_jni_type type; - jclass clazz; - jfieldID fieldID; - jvalue result; - } __getStaticField; - struct __SetField { - enum jvmp_jni_type type; - jobject obj; - jfieldID fieldID; - jvalue value; - } __setField; - struct __SetStaticField { - enum jvmp_jni_type type; - jclass clazz; - jfieldID fieldID; - jvalue value; - } __setStaticField; - struct __UnwrapJObject { - jobject jObject; - jint jstid; - jint jsObject ; - } __unwrapJObject; - } data; -}; - - -struct JavaObjectWrapper -{ - void* info; - void* plugin; - int (*GetParameters)(void* handle, char ***keys, - char ***values, int *count); - int (*ShowDocument)(void* handle, char* url, char* target); - int (*ShowStatus)(void* handle, char* status); - int (*GetJSThread)(void* handle, jint* jstid); - int dead; -}; - -struct BrowserSupportWrapper -{ - void* info; - int (*GetProxyForURL)(void* handle, char* url, char** proxy); - int (*JSCall)(void* handle, jint jstid, - struct JSObject_CallInfo** jscall); -}; -typedef struct BrowserSupportWrapper BrowserSupportWrapper; - -#endif diff --git a/mozilla/java/waterfall/wf/src/plugin/mozilla/wfe_mozilla.c b/mozilla/java/waterfall/wf/src/plugin/mozilla/wfe_mozilla.c deleted file mode 100644 index a60c8dacf7d..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/mozilla/wfe_mozilla.c +++ /dev/null @@ -1,127 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: wfe_mozilla.c,v 1.1.1.1 2001-05-09 17:30:06 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include "jvmp.h" -#include -#include -#include -#include "wf_moz6_common.h" - -/* Extension parameters */ -static const char* WFCID = WF_APPLETPEER_CID; -static const jint WFExtVersion = 1; -static JVMP_SecurityCap g_moz_caps; -static JVMP_SecurityCap g_moz_cap_mask; -/* range of used capabilities */ -#define MOZ_CAPS_LOW 16 -#define MOZ_CAPS_HIGH 100 -static JVMP_ExtDescription g_Description = -{ - "Sun", /* vendor */ - "1.0", /* version */ - "Mozilla applet viewer Waterfall extension", /* description */ - PLATFORM, /* platform */ - ARCH, /* architecture */ - "GPL", /* license */ - NULL /* vendor data */ -}; - - -/* extension API implementation */ -static jint JNICALL JVMPExt_Init(jint side) -{ - int i; - - JVMP_FORBID_ALL_CAPS(g_moz_caps); - JVMP_ALLOW_ALL_CAPS(g_moz_cap_mask); - for (i=MOZ_CAPS_LOW; i <= MOZ_CAPS_HIGH; i++) - JVMP_ALLOW_CAP(g_moz_caps, i); - return JNI_TRUE; -} - -static jint JNICALL JVMPExt_Shutdown() -{ - return JNI_TRUE; -} -static jint JNICALL JVMPExt_GetExtInfo(const char* *pCID, - jint *pVersion, - JVMP_ExtDescription* *pDesc) -{ - *pCID = WFCID; - *pVersion = WFExtVersion; - if (pDesc) *pDesc = &g_Description; - return JNI_TRUE; -} -static jint JNICALL JVMPExt_GetBootstrapClass(char* *bootstrapClassPath, - char* *bootstrapClassName) -{ - const char* home; - char* classpath; - - /* XXX: incorrect, should be separate place for extensions */ - home = getenv("WFHOME"); - if (home == NULL) { - fprintf(stderr, "Env variable WFHOME not set"); - return JNI_FALSE; - } - classpath = (char*)malloc(strlen(home)+20); - sprintf(classpath, "file://%s/classes/", home); - /* should be defined in installation time */ - *bootstrapClassPath = classpath; - *bootstrapClassName = "sun.jvmp.mozilla.MozillaPeerFactory"; - return JNI_TRUE; -} -static jint JNICALL JVMPExt_ScheduleRequest(JVMP_ShmRequest* req, jint local) -{ - return JNI_TRUE; -} - -static jint JNICALL JVMPExt_GetCapsRange(JVMP_SecurityCap* caps, - JVMP_SecurityCap* sh_mask) -{ - if ((caps == NULL) || (sh_mask == NULL)) return JNI_FALSE; - memcpy(caps, &g_moz_caps, sizeof(JVMP_SecurityCap)); - memcpy(sh_mask, & g_moz_cap_mask, sizeof(JVMP_SecurityCap)); - return JNI_TRUE; -} - - -static JVMP_Extension JVMP_Ext = -{ - &JVMPExt_Init, - &JVMPExt_Shutdown, - &JVMPExt_GetExtInfo, - &JVMPExt_GetBootstrapClass, - &JVMPExt_ScheduleRequest, - &JVMPExt_GetCapsRange -}; - -JNIEXPORT jint JNICALL JVMP_GetExtension(JVMP_Extension** ext) -{ - *ext = &JVMP_Ext; - return JNI_TRUE; -} - diff --git a/mozilla/java/waterfall/wf/src/plugin/mozilla/wfm6_native.c b/mozilla/java/waterfall/wf/src/plugin/mozilla/wfm6_native.c deleted file mode 100644 index 48574c5e62a..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/mozilla/wfm6_native.c +++ /dev/null @@ -1,1649 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: wfm6_native.c,v 1.1.1.1 2001-05-09 17:30:06 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include -#include -#include -#include "sun_jvmp_mozilla_MozillaAppletPeer.h" -#include "sun_jvmp_mozilla_MozillaPeerFactory.h" -#include "sun_jvmp_mozilla_JSObject.h" -#include "sun_jvmp_mozilla_JavaScriptProtectionDomain.h" -#include "wf_moz6_common.h" - -/* native methods implementation */ - -static jfieldID peerFID = NULL; - -static jclass g_jclass_Object = NULL; -static jclass g_jclass_Class = NULL; -static jclass g_jclass_Boolean = NULL; -static jclass g_jclass_Byte = NULL; -static jclass g_jclass_Character = NULL; -static jclass g_jclass_Short = NULL; -static jclass g_jclass_Integer = NULL; -static jclass g_jclass_Long = NULL; -static jclass g_jclass_Float = NULL; -static jclass g_jclass_Double = NULL; -static jclass g_jclass_Void = NULL; -static jmethodID g_jmethod_Boolean_booleanValue = NULL; -static jmethodID g_jmethod_Byte_byteValue = NULL; -static jmethodID g_jmethod_Character_charValue = NULL; -static jmethodID g_jmethod_Short_shortValue = NULL; -static jmethodID g_jmethod_Integer_intValue = NULL; -static jmethodID g_jmethod_Long_longValue = NULL; -static jmethodID g_jmethod_Float_floatValue = NULL; -static jmethodID g_jmethod_Double_doubleValue = NULL; -static jmethodID g_jmethod_Boolean_init = NULL; -static jmethodID g_jmethod_Byte_init = NULL; -static jmethodID g_jmethod_Character_init = NULL; -static jmethodID g_jmethod_Short_init = NULL; -static jmethodID g_jmethod_Integer_init = NULL; -static jmethodID g_jmethod_Long_init = NULL; -static jmethodID g_jmethod_Float_init = NULL; -static jmethodID g_jmethod_Double_init = NULL; -static jclass g_jclass_SecureInvocation = NULL; -static jclass g_jclass_JSObject = NULL; -static jmethodID g_jmethod_SecureInvocation_ConstructObject = NULL; -static jmethodID g_jmethod_SecureInvocation_CallMethod = NULL; -static jmethodID g_jmethod_SecureInvocation_GetField = NULL; -static jmethodID g_jmethod_SecureInvocation_SetField = NULL; - -static int g_inited = 0; - -static int DoInit(JNIEnv* env); - -static int CreateObject(JNIEnv* env, - jobject constructor, - jvalue* arg, - SecurityContextWrapper* security, - jobject *result); - -static int CallMethod(JNIEnv* env, - enum jvmp_jni_type type, - jobject obj, - jobject method, - jvalue* arg, - SecurityContextWrapper* security, - jvalue* result); - -static int SetField(JNIEnv* env, - enum jvmp_jni_type type, - jobject obj, - jobject field, - jvalue val, - SecurityContextWrapper* security); - -static int GetField(JNIEnv* env, - enum jvmp_jni_type type, - jobject obj, - jobject field, - SecurityContextWrapper* security, - jvalue* result); - - -/* it never changes */ -static BrowserSupportWrapper *browser_wrapper=NULL; - -static void* getWrapper(JNIEnv* env, jobject jobj, jfieldID* fid) -{ - void* wrapper; - - if (*fid == NULL) { - *fid = (*env)->GetFieldID(env, - (*env)->GetObjectClass(env, jobj), - "m_params","J"); - if (*fid == NULL) return NULL; } - wrapper = JLONG_TO_PTR((*env)->GetLongField(env, jobj, *fid)); - return wrapper; -} -/* -static void* getStaticWrapper(JNIEnv* env, jclass jcls, jfieldID* fid) -{ - void* wrapper; - - if (*fid == NULL) { - *fid = (*env)->GetStaticFieldID(env, jcls, - "m_evaluator","J"); - if (*fid == NULL) return NULL; } - wrapper = JLONG_TO_PTR((*env)->GetStaticLongField(env, jcls, *fid)); - return wrapper; - } -*/ - -static BrowserSupportWrapper* getBrowserWrapper(JNIEnv* env, - jobject jobj, - jclass jcls) -{ - jfieldID fid = NULL; - - if (browser_wrapper) return browser_wrapper; - if (jobj == NULL) - { - fid = (*env)->GetStaticFieldID(env, jcls, "m_evaluator","J"); - if (fid == NULL) return NULL; - browser_wrapper = (BrowserSupportWrapper*) - JLONG_TO_PTR(((*env)->GetStaticLongField(env, jcls, fid))); - } - else - { - fid = (*env)->GetFieldID(env, (*env)->GetObjectClass(env, jobj), - "m_params", "J"); - if (fid == NULL) return NULL; - browser_wrapper = (BrowserSupportWrapper*) - JLONG_TO_PTR((*env)->GetLongField(env, jobj, fid)); - } - return browser_wrapper; -} - -/* - * Class: sun_jvmp_mozilla_MozillaAppletPeer - * Method: finalizeParams - * Signature: ()V - */ -JNIEXPORT void JNICALL -Java_sun_jvmp_mozilla_MozillaAppletPeer_finalizeParams -(JNIEnv *env, jobject jobj) -{ - JavaObjectWrapper *wrapper; - - if (!(wrapper = (JavaObjectWrapper*)getWrapper(env, jobj, &peerFID))) - return; - wrapper->dead = 1; -} - -/* kind of obfuscated call, as we can pass m_params directly, - but this is good start point for optimization :) */ -JNIEXPORT jobjectArray JNICALL -Java_sun_jvmp_mozilla_MozillaAppletPeer_getParams(JNIEnv* env, jobject jobj) -{ - char **keys, **vals; - unsigned int i; - int len; - static jclass StringClass=NULL, StringArrayClass=NULL; - jobjectArray jkeys, jvals, result; - JavaObjectWrapper *wrapper; - - if (!(wrapper = (JavaObjectWrapper*)getWrapper(env, jobj, &peerFID))) - return NULL; - wrapper->GetParameters(wrapper->info, &keys, &vals, &len); - /* hopefully here runtime is inited so those classes resolved - without problems - maybe cache it */ - if (!StringClass) - StringClass = (*env)->NewGlobalRef(env, - (*env)->FindClass(env, "java/lang/String")); - if (!StringArrayClass) - StringArrayClass = (*env)->NewGlobalRef(env, - (*env)->FindClass(env, "[Ljava/lang/String;")); - result = (*env)->NewObjectArray(env, 2, StringArrayClass, NULL); - jkeys = (*env)->NewObjectArray(env, len, StringClass, NULL); - jvals = (*env)->NewObjectArray(env, len, StringClass, NULL); - for (i=0; iSetObjectArrayElement(env, jkeys, i, - (*env)->NewStringUTF(env, keys[i])); - (*env)->SetObjectArrayElement(env, jvals, i, - (*env)->NewStringUTF(env, vals[i])); - } - (*env)->SetObjectArrayElement(env, result, 0, jkeys); - (*env)->SetObjectArrayElement(env, result, 1, jvals); - (*env)->DeleteLocalRef(env, jkeys); - (*env)->DeleteLocalRef(env, jvals); - return result; -} - -/* - * Class: sun_jvmp_mozilla_MozillaAppletPeer - * Method: nativeShowStatus - * Signature: (Ljava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL -Java_sun_jvmp_mozilla_MozillaAppletPeer_nativeShowStatus - (JNIEnv * env, jobject jobj, jstring jstatus) -{ - jint res; - char *status; - JavaObjectWrapper *wrapper; - - if (!(wrapper = (JavaObjectWrapper*)getWrapper(env, jobj, &peerFID))) - return JNI_FALSE; - status = (char*)(*env)->GetStringUTFChars(env, jstatus, NULL); - res = wrapper->ShowStatus(wrapper->info, status); - (*env)->ReleaseStringUTFChars(env, jstatus, status); - return (res == 0); -} - -/* - * Class: sun_jvmp_mozilla_MozillaAppletPeer - * Method: nativeShowDocument - * Signature: (Ljava/lang/String;Ljava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL -Java_sun_jvmp_mozilla_MozillaAppletPeer_nativeShowDocument - (JNIEnv *env, jobject jobj, jstring jurl, jstring jtarget) -{ - int result; - char *url, *target; - JavaObjectWrapper *wrapper; - - if (!(wrapper = (JavaObjectWrapper*)getWrapper(env, jobj, &peerFID))) - return JNI_FALSE; - url = (char*)(*env)->GetStringUTFChars(env, jurl, NULL); - target = (char*)(*env)->GetStringUTFChars(env, jtarget, NULL); - result = wrapper->ShowDocument(wrapper->info, url, target); - (*env)->ReleaseStringUTFChars(env, jurl, url); - (*env)->ReleaseStringUTFChars(env, jtarget, target); - return (result == 0); -} - -/* - * Class: sun_jvmp_mozilla_MozillaAppletPeer - * Method: nativeReturnJObject - * Signature: (Ljava/lang/Object;J)V - */ -JNIEXPORT void JNICALL -Java_sun_jvmp_mozilla_MozillaAppletPeer_nativeReturnJObject - (JNIEnv *env, jobject jobj, jobject o, jlong ptr) -{ - jobject* p; - - p = (jobject*)JLONG_TO_PTR(ptr); - if (!p) return; - if (o) - *p = (*env)->NewGlobalRef(env, o); - else - *p = NULL; -} - -/* - * Class: sun_jvmp_mozilla_MozillaPeerFactory - * Method: nativeGetProxyInfoForURL - * Signature: (Ljava/lang/String;)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL -Java_sun_jvmp_mozilla_MozillaPeerFactory_nativeGetProxyInfoForURL - (JNIEnv *env, jobject jobj, jstring jurl) -{ - jstring jresult; - jint res; - char *url, *result; - - if (!getBrowserWrapper(env, jobj, NULL)) return NULL; - url = (char*)(*env)->GetStringUTFChars(env, jurl, NULL); - res = browser_wrapper->GetProxyForURL(browser_wrapper->info, url, &result); - (*env)->ReleaseStringUTFChars(env, jurl, url); - if (res != 0) return NULL; - jresult = (*env)->NewStringUTF(env, result); - free(result); - return jresult; -} - -/* - * Class: sun_jvmp_mozilla_MozillaPeerFactory - * Method: nativeHandleCall - * Signature: (IJ)I - */ -JNIEXPORT jint JNICALL -Java_sun_jvmp_mozilla_MozillaPeerFactory_nativeHandleCall -(JNIEnv * env, jobject jobj, jint arg1, jlong arg2) -{ - struct Java_CallInfo* call = NULL; - static jthrowable jException = NULL; - call = (struct Java_CallInfo*) JLONG_TO_PTR(arg2); - if (!call) return 0; - if (!DoInit(env)) goto done; - call->jException = NULL; - switch (call->type) - { - case Java_WrapJSObject: - { - /* maybe it has sense to lookup if we already have wrapper for this - JS object? */ - static jmethodID m = NULL; - jobject jObj = NULL; - fprintf(stderr, "Java_WrapJSObject: %lx %lx\n", - call->data.__wrapJSObject.jstid, - call->data.__wrapJSObject.jsObject); - if (!m) - { - m = (*env)->GetMethodID(env, g_jclass_JSObject, "", "(II)V"); - if (!m) break; - } - jObj = (*env)->NewObject(env, g_jclass_JSObject, m, - call->data.__wrapJSObject.jstid, - call->data.__wrapJSObject.jsObject); - if (!jObj) break; - call->data.__wrapJSObject.jObject = (*env)->NewGlobalRef(env, jObj); - break; - } - case Java_UnwrapJObject: - { - static jfieldID f = NULL; - fprintf(stderr, "Java_UnwrapJObject: %x %x\n", - (int)call->data.__unwrapJObject.jstid, - (int)call->data.__unwrapJObject.jObject); - if (!(*env)->IsInstanceOf(env, - call->data.__unwrapJObject.jObject, - g_jclass_JSObject)) - { - fprintf(stderr, "Java object is not JS wrapper!!!\n"); - call->data.__unwrapJObject.jsObject = 0; - break; - } - if (!f) - { - f = (*env)->GetFieldID(env, g_jclass_JSObject, - "nativeJSObject", "I"); - if (!f) break; - } - call->data.__unwrapJObject.jsObject - = (*env)->GetIntField(env, call->data.__unwrapJObject.jObject, f); - break; - } - case Java_CreateObject: - { - jobject constr, result; - constr = (*env)->ToReflectedMethod(env, - call->data.__createObject.clazz, - call->data.__createObject.methodID, - JNI_FALSE); - constr = (*env)->NewLocalRef(env, constr); - if (CreateObject(env, - constr, - call->data.__createObject.args, - call->security, - &result)) - call->data.__createObject.result = (*env)->NewGlobalRef(env, result); - (*env)->DeleteLocalRef(env, constr); - break; - } - case Java_CallMethod: - { - jclass clazz; - jobject method; - jvalue result; - clazz = (*env)->NewGlobalRef(env, (*env)->GetObjectClass(env, call->data.__callMethod.obj)); - method = (*env)->NewGlobalRef(env, (*env)->ToReflectedMethod(env, - clazz, - call->data.__callMethod.methodID, - JNI_FALSE)); - if (CallMethod(env, - call->data.__callMethod.type, - call->data.__callMethod.obj, - method, - call->data.__callMethod.args, - call->security, - &result)) - call->data.__callMethod.result = result; - (*env)->DeleteGlobalRef(env, clazz); - (*env)->DeleteGlobalRef(env, method); - break; - } - case Java_CallNonvirtualMethod: - { - jclass clazz; - jobject method; - jvalue result; - if (!((*env)->IsInstanceOf(env, - call->data.__callNonvirtualMethod.obj, - call->data.__callNonvirtualMethod.clazz))) - break; - clazz = (*env)->NewGlobalRef(env, - call->data.__callNonvirtualMethod.clazz); - method = (*env)->NewGlobalRef(env, - (*env)->ToReflectedMethod(env, - clazz, - call->data.__callNonvirtualMethod.methodID, - JNI_FALSE)); - if (CallMethod(env, - call->data.__callNonvirtualMethod.type, - call->data.__callNonvirtualMethod.obj, - method, - call->data.__callNonvirtualMethod.args, - call->security, - &result)) - call->data.__callNonvirtualMethod.result = result; - (*env)->DeleteGlobalRef(env, clazz); - (*env)->DeleteGlobalRef(env, method); - break; - } - case Java_CallStaticMethod: - { - jobject method; - jvalue result; - method = (*env)->NewGlobalRef(env, (*env)->ToReflectedMethod(env, - call->data.__callStaticMethod.clazz, - call->data.__callStaticMethod.methodID, - JNI_TRUE)); - if (CallMethod(env, - call->data.__callMethod.type, - NULL, - method, - call->data.__callMethod.args, - call->security, - &result)) - call->data.__callStaticMethod.result = result; - (*env)->DeleteGlobalRef(env, method); - break; - } - case Java_SetField: - { - jclass clazz; - jobject field, jobj; - clazz = (*env)->GetObjectClass(env, call->data.__setField.obj); - field = (*env)->NewGlobalRef(env, (*env)->ToReflectedField(env, - clazz, - call->data.__setField.fieldID, - JNI_FALSE)); - jobj = (*env)->NewGlobalRef(env, call->data.__setField.obj); - SetField(env, - call->data.__setField.type, - jobj, - field, - call->data.__setField.value, - call->security); - (*env)->DeleteGlobalRef(env, clazz); - (*env)->DeleteGlobalRef(env, field); - (*env)->DeleteGlobalRef(env, jobj); - break; - } - case Java_SetStaticField: - { - jobject field; - - field = (*env)->NewGlobalRef(env, (*env)->ToReflectedField(env, - call->data.__setStaticField.clazz, - call->data.__setStaticField.fieldID, - JNI_TRUE)); - SetField(env, - call->data.__setField.type, - NULL, - field, - call->data.__setStaticField.value, - call->security); - (*env)->DeleteGlobalRef(env, field); - break; - } - case Java_GetField: - { - jclass clazz; - jobject field, jobj; - jvalue result; - clazz = (*env)->GetObjectClass(env, call->data.__getField.obj); - field = (*env)->NewGlobalRef(env, (*env)->ToReflectedField(env, - clazz, - call->data.__getField.fieldID, - JNI_FALSE)); - jobj = (*env)->NewGlobalRef(env, call->data.__getField.obj); - if (GetField(env, - call->data.__getField.type, - jobj, - field, - call->security, - &result)) - call->data.__getField.result = result; - (*env)->DeleteGlobalRef(env, field); - (*env)->DeleteGlobalRef(env, jobj); - break; - } - case Java_GetStaticField: - { - jobject field; - jvalue result; - field = (*env)->NewGlobalRef(env, (*env)->ToReflectedField(env, - call->data.__getStaticField.clazz, - call->data.__getStaticField.fieldID, - JNI_TRUE)); - if (GetField(env, - call->data.__getStaticField.type, - NULL, - field, - call->security, - &result)) - call->data.__getStaticField.result = result; - (*env)->DeleteGlobalRef(env, field); - break; - } - default: - fprintf(stderr, "Unknown call type in nativeHandleCall\n"); - break; - } - done: - jException = (*env)->ExceptionOccurred(env); - if (jException) - { - fprintf(stderr, "hmm, exception in handle call\n"); - jException = (*env)->NewLocalRef(env, jException); - call->jException = jException; - (*env)->ExceptionClear(env); - } - return 1; -} - -static void -Initialize_JSObject_CallInfo(JNIEnv* env, - struct - JSObject_CallInfo* pInfo, - const char* pszUrl, - jlong wrapper, - jobjectArray jCertArray, - jintArray jCertLengthArray, - int iNumOfCerts, - jobject jAccessControlContext); -static void -Clear_JSObject_CallInfo(JNIEnv* env, - struct JSObject_CallInfo* pInfo); - -JNIEXPORT jint JNICALL -Java_sun_jvmp_mozilla_JSObject_JSGetThreadID -(JNIEnv *env, jclass jcls, jlong param) -{ - jint tid; - JavaObjectWrapper* wrapper = (JavaObjectWrapper*) JLONG_TO_PTR(param); - wrapper->GetJSThread(wrapper->info, &tid); - return tid; -} - -JNIEXPORT jint JNICALL -Java_sun_jvmp_mozilla_JSObject_JSGetNativeJSObject -(JNIEnv *env, - jclass jsClass, - jlong param, - jstring url, - jobjectArray jCertArray, - jintArray jCertLengthArray, - jint iNumOfCerts, - jobject jAccessControlContext) -{ - jint ret = 0; - const char* pszUrl = NULL; - struct JSObject_CallInfo* pInfo = NULL; - jint jsThreadID = 0; - JavaObjectWrapper* p = (JavaObjectWrapper*)JLONG_TO_PTR(param); - - if (getBrowserWrapper(env, NULL, jsClass) == NULL) - return 0; - /* "Java_sun_jvmp_mozilla_JSObject_JSGetNativeJSObject: url=%p param=%d %p\n", url, (int)param, browser_wrapper); */ - if (url) - pszUrl = (*env)->GetStringUTFChars(env, url, (jboolean*)0); - pInfo = (struct JSObject_CallInfo*) - malloc(sizeof(struct JSObject_CallInfo)); - memset(pInfo, 0, sizeof(struct JSObject_CallInfo)); - Initialize_JSObject_CallInfo(env, pInfo, pszUrl, - param, - jCertArray, - jCertLengthArray, - iNumOfCerts, - jAccessControlContext); - - pInfo->data.__getWindow.pPlugin = (void*)(p->plugin); - pInfo->data.__getWindow.iNativeJSObject = 0; - pInfo->type = JS_GetWindow; - jsThreadID = - Java_sun_jvmp_mozilla_JSObject_JSGetThreadID(env, jsClass, param); - - browser_wrapper->JSCall(browser_wrapper->info, jsThreadID, &pInfo); - - if (pInfo->jException != NULL) - { - jthrowable jException - = (jthrowable)((*env)->NewLocalRef(env, pInfo->jException)); - (*env)->Throw(env, jException); - ret = 0; - } - else - { - ret = pInfo->data.__getWindow.iNativeJSObject; - } - if (pszUrl) - (*env)->ReleaseStringUTFChars(env, url, pszUrl); - Clear_JSObject_CallInfo(env, pInfo); - free(pInfo); - return ret; -} - - -JNIEXPORT jobject JNICALL -Java_sun_jvmp_mozilla_JSObject_JSObjectEval -(JNIEnv* env, - jclass jsClass, - jint jsThreadID, - jint nativeJSObject, - jlong wrapper, - jstring url, - jobjectArray jCertArray, - jintArray jCertLengthArray, - jint iNumOfCerts, - jstring str, - jobject jAccessControlContext) -{ - jobject ret = NULL; - struct JSObject_CallInfo* pInfo = NULL; - const jchar* pszStr = NULL; - const char* pszUrl = NULL; - jsize len = 0; - - if (getBrowserWrapper(env, NULL, jsClass) == NULL) - return NULL; - if (url) - pszUrl = (*env)->GetStringUTFChars(env, url, (jboolean*)0); - pszStr = (*env)->GetStringChars(env, str, (jboolean*)0); - len = (*env)->GetStringLength(env, str); - pInfo = (struct JSObject_CallInfo*) - malloc(sizeof(struct JSObject_CallInfo)); - memset(pInfo, 0, sizeof(struct JSObject_CallInfo)); - Initialize_JSObject_CallInfo(env, pInfo, pszUrl, - wrapper, - jCertArray, - jCertLengthArray, - iNumOfCerts, - jAccessControlContext); - pInfo->data.__eval.iNativeJSObject = nativeJSObject; - pInfo->data.__eval.jResult = NULL; - pInfo->data.__eval.pszEval = pszStr; - pInfo->data.__eval.iEvalLen = len; - pInfo->type = JS_Eval; - - browser_wrapper->JSCall(browser_wrapper->info, jsThreadID, &pInfo); - - if (pInfo->data.__eval.jResult) - ret = (*env)->NewLocalRef(env, pInfo->data.__eval.jResult); - - if (pInfo->jException != NULL) - { - jthrowable jException - = (jthrowable)((*env)->NewLocalRef(env, pInfo->jException)); - (*env)->Throw(env, jException); - } - if (pszStr) - (*env)->ReleaseStringChars(env, str, pszStr); - if (pszUrl) - (*env)->ReleaseStringUTFChars(env, url, pszUrl); - - pInfo->data.__eval.iNativeJSObject =0; - pInfo->data.__eval.pszEval = NULL; - pInfo->data.__eval.iEvalLen = 0; - - if (pInfo->data.__eval.jResult != NULL) - (*env)->DeleteGlobalRef(env, pInfo->data.__eval.jResult); - pInfo->data.__eval.jResult = NULL; - Clear_JSObject_CallInfo(env, pInfo); - free(pInfo); - return ret; -} - -JNIEXPORT jstring JNICALL -Java_sun_jvmp_mozilla_JSObject_JSObjectToString -(JNIEnv *env, - jclass jsClass, - jint jsThreadID, - jint nativeJSObject, - jlong wrapper) -{ - jstring ret = NULL; - struct JSObject_CallInfo* pInfo = NULL; - - if (getBrowserWrapper(env, NULL, jsClass) == NULL) - return NULL; - pInfo = (struct JSObject_CallInfo*) - malloc(sizeof(struct JSObject_CallInfo)); - memset(pInfo, 0, sizeof(struct JSObject_CallInfo)); - Initialize_JSObject_CallInfo(env, pInfo, NULL, wrapper, - NULL, NULL, 0, NULL); - pInfo->data.__toString.iNativeJSObject = nativeJSObject; - pInfo->data.__toString.jResult = NULL; - pInfo->type = JS_ToString; - browser_wrapper->JSCall(browser_wrapper->info, jsThreadID, &pInfo); - - if (pInfo->data.__toString.jResult) - ret = (*env)->NewLocalRef(env, pInfo->data.__toString.jResult); - if (pInfo->jException != NULL) - { - jthrowable jException - = (jthrowable)((*env)->NewLocalRef(env, pInfo->jException)); - (*env)->Throw(env, jException); - } - pInfo->data.__toString.iNativeJSObject = 0; - if (env != NULL && pInfo->data.__toString.jResult != NULL) - (*env)->DeleteGlobalRef(env, pInfo->data.__toString.jResult); - pInfo->data.__toString.jResult = NULL; - Clear_JSObject_CallInfo(env, pInfo); - free(pInfo); - return ret; -} - -JNIEXPORT void JNICALL -Java_sun_jvmp_mozilla_JSObject_JSFinalize -(JNIEnv *env, - jclass jsClass, - jint jsThreadID, - jint nativeJSObject, - jlong wrapper) -{ - struct JSObject_CallInfo* pInfo = NULL; - - fprintf(stderr, "Java_sun_jvmp_mozilla_JSObject_JSFinalize: %lx\n", - nativeJSObject); - if (getBrowserWrapper(env, NULL, jsClass) == NULL) - return; - - pInfo = (struct JSObject_CallInfo*) - malloc(sizeof(struct JSObject_CallInfo)); - memset(pInfo, 0, sizeof(struct JSObject_CallInfo)); - Initialize_JSObject_CallInfo(env, pInfo, NULL, wrapper, - NULL, NULL, 0, NULL); - pInfo->data.__finalize.iNativeJSObject = nativeJSObject; - pInfo->type = JS_Finalize; - browser_wrapper->JSCall(browser_wrapper->info, - jsThreadID, &pInfo); - - if (pInfo->jException != NULL) - { - jthrowable jException - = (jthrowable)((*env)->NewLocalRef(env, pInfo->jException)); - (*env)->Throw(env, jException); - } - pInfo->data.__finalize.iNativeJSObject = 0; - Clear_JSObject_CallInfo(env, pInfo); - free(pInfo); -} - -JNIEXPORT jobject JNICALL -Java_sun_jvmp_mozilla_JSObject_JSObjectCall -(JNIEnv *env, - jclass jsClass, - jint jsThreadID, - jint nativeJSObject, - jlong wrapper, - jstring url, - jobjectArray jCertArray, - jintArray jCertLengthArray, - jint iNumOfCerts, - jstring methodName, - jobjectArray args, - jobject jAccessControlContext) -{ - struct JSObject_CallInfo* pInfo = NULL; - jobject ret = NULL; - const jchar* pszName = NULL; - const char* pszUrl = NULL; - jsize len = 0; - - - if (getBrowserWrapper(env, NULL, jsClass) == NULL) - return NULL; - pszName = (*env)->GetStringChars(env, methodName, - (jboolean*)0); - if (url) - pszUrl = (*env)->GetStringUTFChars(env, url, (jboolean*)0); - len = (*env)->GetStringLength(env, methodName); - - pInfo = (struct JSObject_CallInfo*) - malloc(sizeof(struct JSObject_CallInfo)); - memset(pInfo, 0, sizeof(struct JSObject_CallInfo)); - Initialize_JSObject_CallInfo(env, pInfo, pszUrl, - wrapper, - jCertArray, - jCertLengthArray, - iNumOfCerts, - jAccessControlContext); - - pInfo->data.__call.iNativeJSObject = nativeJSObject; - pInfo->data.__call.pszMethodName = pszName; - pInfo->data.__call.iMethodNameLen = len; - if (args != NULL) - pInfo->data.__call.jArgs = - (jobjectArray)(*env)->NewGlobalRef(env, args); - pInfo->data.__call.jResult = NULL; - pInfo->type = JS_Call; - - browser_wrapper->JSCall(browser_wrapper->info, jsThreadID, &pInfo); - - if (pszName) - (*env)->ReleaseStringChars(env, methodName, pszName); - if (pszUrl) - (*env)->ReleaseStringUTFChars(env, url, pszUrl); - if (pInfo->data.__call.jResult != NULL) - { - ret = (*env)->NewLocalRef(env, pInfo->data.__call.jResult); - (*env)->DeleteGlobalRef(env, pInfo->data.__call.jResult); - } - if (pInfo->data.__call.jArgs != NULL) - (*env)->DeleteGlobalRef(env, pInfo->data.__call.jArgs); - - if (pInfo->jException != NULL) - { - jthrowable jException - = (jthrowable)((*env)->NewLocalRef(env, pInfo->jException)); - (*env)->Throw(env, jException); - } - pInfo->data.__call.iNativeJSObject = 0; - Clear_JSObject_CallInfo(env, pInfo); - free(pInfo); - return ret; -} - -JNIEXPORT jobject JNICALL -Java_sun_jvmp_mozilla_JSObject_JSObjectGetMember -(JNIEnv *env, - jclass jsClass, - jint jsThreadID, - jint nativeJSObject, - jlong wrapper, - jstring url, - jobjectArray jCertArray, - jintArray jCertLengthArray, - jint iNumOfCerts, - jstring name, - jobject jAccessControlContext) -{ - struct JSObject_CallInfo* pInfo = NULL; - jobject ret = NULL; - const jchar* pszName = NULL; - const char* pszUrl = NULL; - jsize len = 0; - - if (getBrowserWrapper(env, NULL, jsClass) == NULL) - return NULL; - pszName = (*env)->GetStringChars(env, name, - (jboolean*)0); - if (url) - pszUrl = (*env)->GetStringUTFChars(env, url, (jboolean*)0); - len = (*env)->GetStringLength(env, name); - - pInfo = (struct JSObject_CallInfo*) - malloc(sizeof(struct JSObject_CallInfo)); - memset(pInfo, 0, sizeof(struct JSObject_CallInfo)); - Initialize_JSObject_CallInfo(env, pInfo, pszUrl, - wrapper, - jCertArray, - jCertLengthArray, - iNumOfCerts, - jAccessControlContext); - - pInfo->data.__getMember.iNativeJSObject = nativeJSObject; - pInfo->data.__getMember.jResult = NULL; - pInfo->data.__getMember.pszName = pszName; - pInfo->data.__getMember.iNameLen = len; - pInfo->type = JS_GetMember; - - browser_wrapper->JSCall(browser_wrapper->info, jsThreadID, &pInfo); - - if (pInfo->jException != NULL) - { - jthrowable jException - = (jthrowable)((*env)->NewLocalRef(env, pInfo->jException)); - (*env)->Throw(env, jException); - } - if (pszName) - (*env)->ReleaseStringChars(env, name, pszName); - if (pszUrl) - (*env)->ReleaseStringUTFChars(env, url, pszUrl); - if (pInfo->data.__getMember.jResult != NULL) - { - ret = (*env)->NewLocalRef(env, pInfo->data.__getMember.jResult); - (*env)->DeleteGlobalRef(env, pInfo->data.__getMember.jResult); - } - pInfo->data.__getMember.iNativeJSObject = 0; - Clear_JSObject_CallInfo(env, pInfo); - free(pInfo); - return ret; -} - -JNIEXPORT void JNICALL -Java_sun_jvmp_mozilla_JSObject_JSObjectSetMember -(JNIEnv *env, - jclass jsClass, - jint jsThreadID, - jint nativeJSObject, - jlong wrapper, - jstring url, - jobjectArray jCertArray, - jintArray jCertLengthArray, - jint iNumOfCerts, - jstring name, - jobject value, - jobject jAccessControlContext) -{ - struct JSObject_CallInfo* pInfo = NULL; - const jchar* pszName = NULL; - const char* pszUrl = NULL; - jsize len = 0; - - if (getBrowserWrapper(env, NULL, jsClass) == NULL) - return; - pszName = (*env)->GetStringChars(env, name, - (jboolean*)0); - if (url) - pszUrl = (*env)->GetStringUTFChars(env, url, (jboolean*)0); - len = (*env)->GetStringLength(env, name); - - pInfo = (struct JSObject_CallInfo*) - malloc(sizeof(struct JSObject_CallInfo)); - memset(pInfo, 0, sizeof(struct JSObject_CallInfo)); - Initialize_JSObject_CallInfo(env, pInfo, pszUrl, - wrapper, - jCertArray, - jCertLengthArray, - iNumOfCerts, - jAccessControlContext); - pInfo->data.__setMember.iNativeJSObject = nativeJSObject; - pInfo->data.__setMember.jValue = NULL; - pInfo->data.__setMember.pszName = pszName; - pInfo->data.__setMember.iNameLen = len; - pInfo->type = JS_SetMember; - if (value != NULL) - pInfo->data.__setMember.jValue = (*env)->NewGlobalRef(env, value); - - browser_wrapper->JSCall(browser_wrapper->info, jsThreadID, &pInfo); - - if (pInfo->jException != NULL) - { - jthrowable jException - = (jthrowable)((*env)->NewLocalRef(env, pInfo->jException)); - (*env)->Throw(env, jException); - } - if (pszName) - (*env)->ReleaseStringChars(env, name, pszName); - if (pszUrl) - (*env)->ReleaseStringUTFChars(env, url, pszUrl); - if (pInfo->data.__setMember.jValue != NULL) - (*env)->DeleteGlobalRef(env, pInfo->data.__setMember.jValue); - pInfo->data.__setMember.iNativeJSObject = 0; - Clear_JSObject_CallInfo(env, pInfo); - free(pInfo); - return; -} - -JNIEXPORT void JNICALL -Java_sun_jvmp_mozilla_JSObject_JSObjectRemoveMember -(JNIEnv *env, - jclass jsClass, - jint jsThreadID, - jint nativeJSObject, - jlong wrapper, - jstring url, - jobjectArray jCertArray, - jintArray jCertLengthArray, - jint iNumOfCerts, - jstring name, - jobject jAccessControlContext) -{ - struct JSObject_CallInfo* pInfo = NULL; - const jchar* pszName = NULL; - const char* pszUrl = NULL; - jsize len = 0; - - if (getBrowserWrapper(env, NULL, jsClass) == NULL) - return; - pszName = (*env)->GetStringChars(env, name, - (jboolean*)0); - if (url) - pszUrl = (*env)->GetStringUTFChars(env, url, (jboolean*)0); - len = (*env)->GetStringLength(env, name); - - pInfo = (struct JSObject_CallInfo*) - malloc(sizeof(struct JSObject_CallInfo)); - memset(pInfo, 0, sizeof(struct JSObject_CallInfo)); - Initialize_JSObject_CallInfo(env, pInfo, pszUrl, - wrapper, - jCertArray, - jCertLengthArray, - iNumOfCerts, - jAccessControlContext); - pInfo->data.__removeMember.iNativeJSObject = nativeJSObject; - pInfo->data.__removeMember.pszName = pszName; - pInfo->data.__removeMember.iNameLen = len; - pInfo->type = JS_RemoveMember; - - browser_wrapper->JSCall(browser_wrapper->info, jsThreadID, &pInfo); - - if (pInfo->jException != NULL) - { - jthrowable jException - = (jthrowable)((*env)->NewLocalRef(env, pInfo->jException)); - (*env)->Throw(env, jException); - } - if (pszName) - (*env)->ReleaseStringChars(env, name, pszName); - if (pszUrl) - (*env)->ReleaseStringUTFChars(env, url, pszUrl); - pInfo->data.__removeMember.iNativeJSObject = 0; - Clear_JSObject_CallInfo(env, pInfo); - free(pInfo); - return; -} - -JNIEXPORT void JNICALL -Java_sun_jvmp_mozilla_JSObject_JSObjectSetSlot -(JNIEnv *env, - jclass jsClass, - jint jsThreadID, - jint nativeJSObject, - jlong wrapper, - jstring url, - jobjectArray jCertArray, - jintArray jCertLengthArray, - jint iNumOfCerts, - jint index, - jobject value, - jobject jAccessControlContext) -{ - struct JSObject_CallInfo* pInfo = NULL; - const char* pszUrl = NULL; - - if (getBrowserWrapper(env, NULL, jsClass) == NULL) - return; - if (url) - pszUrl = (*env)->GetStringUTFChars(env, url, (jboolean*)0); - - pInfo = (struct JSObject_CallInfo*) - malloc(sizeof(struct JSObject_CallInfo)); - memset(pInfo, 0, sizeof(struct JSObject_CallInfo)); - Initialize_JSObject_CallInfo(env, pInfo, pszUrl, - wrapper, - jCertArray, - jCertLengthArray, - iNumOfCerts, - jAccessControlContext); - pInfo->data.__setSlot.iNativeJSObject = nativeJSObject; - pInfo->data.__setSlot.jValue = NULL; - pInfo->data.__setSlot.iIndex = index; - pInfo->type = JS_SetSlot; - if (value != NULL) - pInfo->data.__setSlot.jValue = (*env)->NewGlobalRef(env, value); - - browser_wrapper->JSCall(browser_wrapper->info, jsThreadID, &pInfo); - - if (pInfo->jException != NULL) - { - jthrowable jException - = (jthrowable)((*env)->NewLocalRef(env, pInfo->jException)); - (*env)->Throw(env, jException); - } - if (pszUrl) - (*env)->ReleaseStringUTFChars(env, url, pszUrl); - if (pInfo->data.__setSlot.jValue != NULL) - (*env)->DeleteGlobalRef(env, pInfo->data.__setSlot.jValue); - pInfo->data.__setSlot.iNativeJSObject = 0; - Clear_JSObject_CallInfo(env, pInfo); - free(pInfo); - return; -} - -JNIEXPORT jobject JNICALL -Java_sun_jvmp_mozilla_JSObject_JSObjectGetSlot -(JNIEnv *env, - jclass jsClass, - jint jsThreadID, - jint nativeJSObject, - jlong wrapper, - jstring url, - jobjectArray jCertArray, - jintArray jCertLengthArray, - jint iNumOfCerts, - jint index, - jobject jAccessControlContext) -{ - struct JSObject_CallInfo* pInfo = NULL; - jobject ret = NULL; - const char* pszUrl = NULL; - - if (getBrowserWrapper(env, NULL, jsClass) == NULL) - return NULL; - if (url) - pszUrl = (*env)->GetStringUTFChars(env, url, (jboolean*)0); - pInfo = (struct JSObject_CallInfo*) - malloc(sizeof(struct JSObject_CallInfo)); - memset(pInfo, 0, sizeof(struct JSObject_CallInfo)); - Initialize_JSObject_CallInfo(env, pInfo, pszUrl, - wrapper, - jCertArray, - jCertLengthArray, - iNumOfCerts, - jAccessControlContext); - - pInfo->data.__getSlot.iNativeJSObject = nativeJSObject; - pInfo->data.__getSlot.jResult = NULL; - pInfo->data.__getSlot.iIndex = index; - pInfo->type = JS_GetSlot; - - browser_wrapper->JSCall(browser_wrapper->info, jsThreadID, &pInfo); - - if (pInfo->data.__getSlot.jResult) - ret = (*env)->NewLocalRef(env, pInfo->data.__getSlot.jResult); - if (pInfo->jException != NULL) - { - jthrowable jException - = (jthrowable)((*env)->NewLocalRef(env, pInfo->jException)); - (*env)->Throw(env, jException); - } - - if (pszUrl) - (*env)->ReleaseStringUTFChars(env, url, pszUrl); - if (pInfo->data.__getSlot.jResult != NULL) - (*env)->DeleteGlobalRef(env, pInfo->data.__getSlot.jResult); - pInfo->data.__getSlot.iNativeJSObject = 0; - Clear_JSObject_CallInfo(env, pInfo); - free(pInfo); - return ret; -} - -JNIEXPORT void JNICALL -Java_sun_jvmp_mozilla_JavaScriptProtectionDomain_finalize -(JNIEnv *env, - jobject jobj, - jlong ctx) -{ - /* do nothing here yet */ - /* fprintf(stderr, "JavaScriptProtectionDomain_finalize\n"); */ -} - -JNIEXPORT jstring JNICALL -Java_sun_jvmp_mozilla_JavaScriptProtectionDomain_getCodeBase -(JNIEnv *env, - jclass clazz, - jlong rawctx) -{ -#define ORIGIN_LEN 512 - char origin[ORIGIN_LEN+1]; - SecurityContextWrapper* ctx; - - ctx = JLONG_TO_PTR(rawctx); - if (!ctx || !ctx->GetOrigin(ctx->info, origin, ORIGIN_LEN)) - return NULL; - return (*env)->NewStringUTF(env, origin); -} - - -JNIEXPORT jobjectArray JNICALL -Java_sun_jvmp_mozilla_JavaScriptProtectionDomain_getRawCerts -(JNIEnv *env, - jclass clazz, - jlong rawctx) -{ - return NULL; -} - - -JNIEXPORT jboolean JNICALL -Java_sun_jvmp_mozilla_JavaScriptProtectionDomain_implies -(JNIEnv* env, - jobject jobj, - jlong rawctx, - jstring target, - jstring action) -{ - const char* pTarget = NULL; - const char* pAction = NULL; - jboolean ret = JNI_FALSE; - int res = 0; - SecurityContextWrapper* ctx; - - ctx = JLONG_TO_PTR(rawctx); - if (!target || !ctx) return ret; - pTarget = (*env)->GetStringUTFChars(env, target, (jboolean*)0); - if (action) pAction = (*env)->GetStringUTFChars(env, action, (jboolean*)0); - if (!ctx->Implies(ctx->info, pTarget, pAction, &res)) ret = JNI_TRUE; - ret = res ? JNI_TRUE : JNI_FALSE; - if (pTarget) - (*env)->ReleaseStringUTFChars(env, target, pTarget); - if (pAction) - (*env)->ReleaseStringUTFChars(env, action, pAction); - return ret; -} - - - -static void -Initialize_JSObject_CallInfo(JNIEnv* env, - struct - JSObject_CallInfo* pInfo, - const char* pszUrl, - jlong wrapper, - jobjectArray jCertArray, - jintArray jCertLengthArray, - int iNumOfCerts, - jobject jAccessControlContext) -{ - pInfo->pszUrl = pszUrl; - pInfo->jCertArray = NULL; - pInfo->jCertLengthArray = NULL; - pInfo->iNumOfCerts = iNumOfCerts; - pInfo->jAccessControlContext = NULL; - pInfo->pWrapper = (JavaObjectWrapper*)JLONG_TO_PTR(wrapper); - pInfo->type = JS_Unknown; - pInfo->jException = NULL; - if (jCertArray != NULL) - pInfo->jCertArray = - (jobjectArray)((*env)->NewGlobalRef(env, jCertArray)); - if (jCertLengthArray != NULL) - pInfo->jCertLengthArray = - (jintArray)((*env)->NewGlobalRef(env, jCertLengthArray)); - if (jAccessControlContext != NULL) - pInfo->jAccessControlContext = - (*env)->NewGlobalRef(env, jAccessControlContext); -} - - -static void Clear_JSObject_CallInfo(JNIEnv* env, - struct JSObject_CallInfo* pInfo) -{ - pInfo->pszUrl = NULL; - pInfo->iNumOfCerts = 0; - pInfo->type = JS_Unknown; - - if (pInfo->jCertArray != NULL) - (*env)->DeleteGlobalRef(env, (jobject)(pInfo->jCertArray)); - - if (pInfo->jCertLengthArray != NULL) - (*env)->DeleteGlobalRef(env, (jobject)(pInfo->jCertLengthArray)); - - if (pInfo->jAccessControlContext != NULL) - (*env)->DeleteGlobalRef(env, pInfo->jAccessControlContext); - - if (pInfo->jException != NULL) - (*env)->DeleteGlobalRef(env, pInfo->jException); - - pInfo->jCertArray = NULL; - pInfo->jCertLengthArray = NULL; - pInfo->jAccessControlContext = NULL; - pInfo->jException = NULL; -} -static int DoInit(JNIEnv* env) -{ - if (g_inited) return 1; - - g_jclass_Object = - (jclass) (*env)->NewGlobalRef(env, (*env)->FindClass(env, "java/lang/Object")); - g_jclass_Class = - (jclass) (*env)->NewGlobalRef(env, (*env)->FindClass(env, "java/lang/Class")); - g_jclass_Boolean = - (jclass) (*env)->NewGlobalRef(env, (*env)->FindClass(env, "java/lang/Boolean")); - g_jclass_Byte = - (jclass) (*env)->NewGlobalRef(env, (*env)->FindClass(env, "java/lang/Byte")); - g_jclass_Character = - (jclass) (*env)->NewGlobalRef(env, (*env)->FindClass(env, "java/lang/Character")); - g_jclass_Short = - (jclass) (*env)->NewGlobalRef(env, (*env)->FindClass(env, "java/lang/Short")); - g_jclass_Integer = - (jclass) (*env)->NewGlobalRef(env, (*env)->FindClass(env, "java/lang/Integer")); - g_jclass_Long = - (jclass) (*env)->NewGlobalRef(env, (*env)->FindClass(env, "java/lang/Long")); - g_jclass_Float = - (jclass) (*env)->NewGlobalRef(env, (*env)->FindClass(env, "java/lang/Float")); - g_jclass_Double = - (jclass) (*env)->NewGlobalRef(env, (*env)->FindClass(env, "java/lang/Double")); - g_jclass_Void = - (jclass) (*env)->NewGlobalRef(env, (*env)->FindClass(env, "java/lang/Void")); - - g_jmethod_Boolean_booleanValue = - (*env)->GetMethodID(env, g_jclass_Boolean, "booleanValue", "()Z"); - g_jmethod_Byte_byteValue = - (*env)->GetMethodID(env, g_jclass_Byte, "byteValue", "()B"); - g_jmethod_Character_charValue = - (*env)->GetMethodID(env, g_jclass_Character, "charValue", "()C"); - g_jmethod_Short_shortValue = - (*env)->GetMethodID(env, g_jclass_Short, "shortValue", "()S"); - g_jmethod_Integer_intValue = - (*env)->GetMethodID(env, g_jclass_Integer, "intValue", "()I"); - g_jmethod_Long_longValue = - (*env)->GetMethodID(env, g_jclass_Long, "longValue", "()J"); - g_jmethod_Float_floatValue = - (*env)->GetMethodID(env, g_jclass_Float, "floatValue", "()F"); - g_jmethod_Double_doubleValue = - (*env)->GetMethodID(env, g_jclass_Double, "doubleValue", "()D"); - - g_jmethod_Boolean_init = - (*env)->GetMethodID(env, g_jclass_Boolean, "", "(Z)V"); - g_jmethod_Byte_init = - (*env)->GetMethodID(env, g_jclass_Byte, "", "(B)V"); - g_jmethod_Character_init = - (*env)->GetMethodID(env, g_jclass_Character, "", "(C)V"); - g_jmethod_Short_init = - (*env)->GetMethodID(env, g_jclass_Short, "", "(S)V"); - g_jmethod_Integer_init = - (*env)->GetMethodID(env, g_jclass_Integer, "", "(I)V"); - g_jmethod_Long_init = - (*env)->GetMethodID(env, g_jclass_Long, "", "(J)V"); - g_jmethod_Float_init = - (*env)->GetMethodID(env, g_jclass_Float, "", "(F)V"); - g_jmethod_Double_init = - (*env)->GetMethodID(env, g_jclass_Double, "", "(D)V"); - - g_jclass_SecureInvocation = - (jclass) (*env)->NewGlobalRef(env, - (*env)->FindClass(env, "sun/jvmp/mozilla/SecureInvocation")); - if (!g_jclass_SecureInvocation) return 0; - g_jmethod_SecureInvocation_ConstructObject = - (*env)->GetStaticMethodID(env, g_jclass_SecureInvocation, - "ConstructObject", - "(Ljava/lang/reflect/Constructor;[Ljava/lang/Object;J)Ljava/lang/Object;"); - if (!g_jmethod_SecureInvocation_ConstructObject) return 0; - g_jmethod_SecureInvocation_CallMethod = - (*env)->GetStaticMethodID(env, g_jclass_SecureInvocation, - "CallMethod", - "(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;J)Ljava/lang/Object;"); - if (!g_jmethod_SecureInvocation_CallMethod) return 0; - g_jmethod_SecureInvocation_GetField = - (*env)->GetStaticMethodID(env, g_jclass_SecureInvocation, - "GetField", - "(Ljava/lang/Object;Ljava/lang/reflect/Field;J)Ljava/lang/Object;"); - if (!g_jmethod_SecureInvocation_GetField) return 0; - g_jmethod_SecureInvocation_SetField = - (*env)->GetStaticMethodID(env, g_jclass_SecureInvocation, - "SetField", - "(Ljava/lang/Object;Ljava/lang/reflect/Field;Ljava/lang/Object;J)V"); - if (!g_jmethod_SecureInvocation_SetField) return 0; - g_jclass_JSObject = - (jclass) (*env)->NewGlobalRef(env, - (*env)->FindClass(env, "sun/jvmp/mozilla/JSObject")); - if (!g_jclass_JSObject) return 0; - g_inited = 1; - return 1; -} -/* kinda hacky, but makes code smaller */ -#ifdef XP_WIN32 -#define strcasecmp stricmp -#endif -static int ConvertJValueToJava(JNIEnv* env, - jvalue val, - jclass type, - jobject* result) -{ - static jmethodID m = NULL; - jstring name; - const char* szName; - - if (!m) - { - m = (*env)->GetMethodID(env, - g_jclass_Class, - "getName", - "()Ljava/lang/String;"); - } - name = (jstring) (*env)->CallObjectMethod(env, type, m); - szName = (*env)->GetStringUTFChars(env, name, JNI_FALSE); - if (strcasecmp(szName, "boolean") == 0) - { - *result = (*env)->NewObject(env, - g_jclass_Boolean, - g_jmethod_Boolean_init, - val.z); - } - else if (strcasecmp(szName, "byte") == 0) - { - *result = (*env)->NewObject(env, - g_jclass_Byte, - g_jmethod_Byte_init, - val.b); - } - else if (strcasecmp(szName, "char") == 0) - { - *result = (*env)->NewObject(env, - g_jclass_Character, - g_jmethod_Character_init, - val.c); - } - else if (strcasecmp(szName, "short") == 0) - { - *result = (*env)->NewObject(env, - g_jclass_Short, - g_jmethod_Short_init, - val.s); - } - else if (strcasecmp(szName, "int") == 0) - { - *result = (*env)->NewObject(env, - g_jclass_Integer, - g_jmethod_Integer_init, - val.i); - } - else if (strcasecmp(szName, "long") == 0) - { - *result = (*env)->NewObject(env, - g_jclass_Long, - g_jmethod_Long_init, - val.j); - } - else if (strcasecmp(szName, "float") == 0) - { - *result = (*env)->NewObject(env, - g_jclass_Float, - g_jmethod_Float_init, - val.f); - } - else if (strcasecmp(szName, "double") == 0) - { - *result = (*env)->NewObject(env, - g_jclass_Double, - g_jmethod_Double_init, - val.d); - } - else /* Object */ - { - *result = val.l; - } - - (*env)->ReleaseStringUTFChars(env, name, szName); - - return 1; -} - -static int ConvertJavaToJValue(JNIEnv* env, - enum jvmp_jni_type type, - jobject obj, - jvalue *result) -{ - if (obj == NULL) - return 0; - - switch(type) - { - case jvmp_jboolean_type: { - result->z = (*env)->CallBooleanMethod(env, obj, g_jmethod_Boolean_booleanValue); - break; - } - case jvmp_jbyte_type: { - result->b = (*env)->CallByteMethod(env, obj, g_jmethod_Byte_byteValue); - break; - } - case jvmp_jchar_type: { - result->c = (*env)->CallCharMethod(env, obj, g_jmethod_Character_charValue); - break; - } - case jvmp_jshort_type: { - result->s = (*env)->CallShortMethod(env, obj, g_jmethod_Short_shortValue); - break; - } - case jvmp_jint_type: { - result->i = (*env)->CallIntMethod(env, obj, g_jmethod_Integer_intValue); - break; - } - case jvmp_jlong_type: { - result->j = (*env)->CallLongMethod(env, obj, g_jmethod_Long_longValue); - break; - } - case jvmp_jfloat_type: { - result->f = (*env)->CallFloatMethod(env, obj, g_jmethod_Float_floatValue); - break; - } - case jvmp_jdouble_type: { - result->d = (*env)->CallDoubleMethod(env, obj, g_jmethod_Double_doubleValue); - break; - } - case jvmp_jobject_type: - { - result->l = (*env)->NewGlobalRef(env, obj); - break; - } - case jvmp_jvoid_type: - { - break; - } - default: - { - return 0; - } - } - return 1; -} - - -static int ConvertJValueArrayToJavaArray(JNIEnv* env, - jobject method, - jvalue* obj, - jobjectArray* result) -{ - jclass clazz, type; - jmethodID m = NULL; - jobjectArray params; - int len = 0, i; - jobject val = NULL; - - if (obj == NULL) - { - if (result != NULL) - *result = NULL; - return 1; - } - - clazz = (*env)->GetObjectClass(env, method); - - m = (*env)->GetMethodID(env, clazz, - "getParameterTypes", - "()[Ljava/lang/Class;"); - - params = (jobjectArray)(*env)->CallObjectMethod(env, - method, - m); - if (params) - { - len = (*env)->GetArrayLength(env, params); - *result = (*env)->NewObjectArray(env, len, g_jclass_Object, NULL); - } - - for (i=0; i < len; i++) - { - type = (jclass) (*env)->NewLocalRef(env, (*env)->GetObjectArrayElement(env, params, i)); - ConvertJValueToJava(env, obj[i], type, &val); - (*env)->SetObjectArrayElement(env, *result, i, val); - (*env)->DeleteLocalRef(env, type); - } - return 1; -} - -static int CreateObject(JNIEnv* env, - jobject constructor, - jvalue* arg, - SecurityContextWrapper* security, - jobject *result) -{ - jobjectArray jarg = NULL; - - if (!(ConvertJValueArrayToJavaArray(env, constructor, arg, &jarg))) - return 0; - *result = (*env)->CallStaticObjectMethod(env, - g_jclass_SecureInvocation, - g_jmethod_SecureInvocation_ConstructObject, - constructor, - jarg, - JLONG_TO_PTR(security)); - return 1; -} - -static int CallMethod(JNIEnv* env, - enum jvmp_jni_type type, - jobject obj, - jobject method, - jvalue* arg, - SecurityContextWrapper* security, - jvalue* result) -{ - jobjectArray jarg; - jobject ret; - - if (!(ConvertJValueArrayToJavaArray(env, method, arg, &jarg))) return 0; - ret = (*env)->CallStaticObjectMethod(env, g_jclass_SecureInvocation, - g_jmethod_SecureInvocation_CallMethod, - obj, method, jarg, PTR_TO_JLONG(security)); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionClear(env); - return 0; - } - return ConvertJavaToJValue(env, type, ret, result); -} - -static int SetField(JNIEnv* env, - enum jvmp_jni_type type, - jobject obj, - jobject field, - jvalue val, - SecurityContextWrapper* security) -{ - jclass fieldClazz, jtype; - jmethodID m; - jobject jval=NULL; - - fieldClazz = (*env)->GetObjectClass(env, field); - m = (*env)->GetMethodID(env, - fieldClazz, - "getType", - "()Ljava/lang/Class;"); - - jtype = (jclass) (*env)->CallObjectMethod(env, field, m); - if ((ConvertJValueToJava(env, val, jtype, &jval))) - { - (*env)->CallStaticVoidMethod(env, - g_jclass_SecureInvocation, - g_jmethod_SecureInvocation_SetField, - obj, - field, - jval, - PTR_TO_JLONG(security)); - return 1; - } - return 0; -} - - -static int GetField(JNIEnv* env, - enum jvmp_jni_type type, - jobject obj, - jobject field, - SecurityContextWrapper* security, - jvalue *result) -{ - jobject ret = NULL; - - ret = (*env)->CallStaticObjectMethod(env, - g_jclass_SecureInvocation, - g_jmethod_SecureInvocation_GetField, - obj, - field, - PTR_TO_JLONG(security)); - return ConvertJavaToJValue(env, type, ret, result); -} diff --git a/mozilla/java/waterfall/wf/src/plugin/netscape4/Aptest.java b/mozilla/java/waterfall/wf/src/plugin/netscape4/Aptest.java deleted file mode 100644 index bdc026efc7d..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/netscape4/Aptest.java +++ /dev/null @@ -1,112 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: Aptest.java,v 1.1.1.1 2001-05-09 17:30:09 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -import java.util.*; -import java.awt.*; -import java.awt.event.*; -import java.applet.*; -import java.text.*; -import java.net.*; - -public class Aptest extends Applet implements Runnable { - Thread timer; // The thread that displays clock - int lastxs, lastys, lastxm, - lastym, lastxh, lastyh; // Dimensions used to draw hands - SimpleDateFormat formatter; // Formats the date displayed - String lastdate; // String to hold date displayed - Font clockFaceFont; // Font for number display on clock - Date currentDate; // Used to get date to display - Color handColor; // Color of main hands and dial - Color numberColor; // Color of second hand and numbers - - public void init() { - Button b1 = new Button("Show status"); - b1.setBounds(0, 0, 40, 40); - b1.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - AppletContext ctx = getAppletContext(); - ctx.showStatus("DONE SHOW STATUS"); - } - }); - Button b2 = new Button("Show document"); - b2.setBounds(0, 0, 40, 40); - b2.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - AppletContext ctx = getAppletContext(); - try { - ctx.showDocument(new URL("http://www.sun.com")); - } catch (Exception ex) {} - } - }); - setLayout(new FlowLayout(FlowLayout.CENTER)); - - add(b1); - add(b2); - resize(300,300); // Set clock window size - } - - public void start() { - timer = new Thread(this); - timer.start(); - } - - public void stop() { - timer = null; - } - - public void run() { - Thread me = Thread.currentThread(); - while (timer == me) { - try { - Thread.currentThread().sleep(100); - } catch (InterruptedException e) { - } - } - } - - public void update(Graphics g) { - paint(g); - } - - public String getAppletInfo() { - return "Title: A Clock \nAuthor: Rachel Gollub, 1995 \nAn analog clock."; - } - - public String[][] getParameterInfo() { - String[][] info = { - {"bgcolor", "hexadecimal RGB number", "The background color. Default is the color of your browser."}, - {"fgcolor1", "hexadecimal RGB number", "The color of the hands and dial. Default is blue."}, - {"fgcolor2", "hexadecimal RGB number", "The color of the seconds hand and numbers. Default is dark gray."} - }; - return info; - } -} - - diff --git a/mozilla/java/waterfall/wf/src/plugin/netscape4/JavaPlugin.c b/mozilla/java/waterfall/wf/src/plugin/netscape4/JavaPlugin.c deleted file mode 100644 index 7e4d2cef02a..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/netscape4/JavaPlugin.c +++ /dev/null @@ -1,722 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: JavaPlugin.c,v 1.1.1.1 2001-05-09 17:30:09 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* -*- Mode: C; tab-width: 4; -*- */ -/****************************************************************************** - * Copyright (c) 1996 Netscape Communications. All rights reserved. - ******************************************************************************/ -/* - * UnixShell.c - * - * Netscape Client Plugin API - * - Function that need to be implemented by plugin developers - * - * This file defines a "Template" plugin that plugin developers can use - * as the basis for a real plugin. This shell just provides empty - * implementations of all functions that the plugin can implement - * that will be called by Netscape (the NPP_xxx methods defined in - * npapi.h). - * - * dp Suresh - * - */ - -#include -#include -#include -#include -#include "jvmp.h" -#include "common.h" -#include "shmtran.h" - -#define MAX_INSTANCES 200 -#define ADD_INST(inst) for(_idx=0; _idx -#include -#include -#include /* really bad */ - -static Atom g_request_handler_atom; -#endif - -/* - * Protypes of utility functions - */ -static NPError DoDirtyInit(); -static jint loadPluginDLL(); -static jint initJVM(JavaVM** jvm, JVMP_CallingContext** ctx, - JavaVMInitArgs* vm_args); -static jint PutParams(jint id, char** buf, int* argc, int* len); -static PluginInstance* GetInstance(jint id); -static void SetDocBase(PluginInstance* inst, char* buf, int len); -static int GetProxyForURL(void* handle, char* url, char** proxy) -{ - PluginInstance* inst = (PluginInstance*)handle; - return JNI_TRUE; -} - -static int ShowDocument(jint id, char* url, char* target) -{ - PluginInstance* inst; - inst = GetInstance(id); - if (!inst) return JNI_FALSE; - NPN_GetURL(inst->m_peer, url, target); - return JNI_TRUE; -} - -static int ShowStatus(jint id, char* status) -{ - PluginInstance* inst; - inst = GetInstance(id); - if (!inst) return JNI_FALSE; - NPN_Status(inst->m_peer, status); - return JNI_TRUE; -} - - -/*********************************************************************** - * - * Implementations of plugin API functions - * - ***********************************************************************/ - -char* -NPP_GetMIMEDescription(void) -{ - printf("NPP_GetMIMEDescription\n"); - return - "application/x-java-vm::Java(tm) Plug-in" - ";application/x-java-applet::Java(tm) Plug-in"; -} - -NPError -NPP_GetValue(NPP instance, NPPVariable variable, void *value) -{ - NPError err = NPERR_NO_ERROR; - - switch (variable) { - case NPPVpluginNameString: - *((char **)value) = "Java plugin"; - break; - case NPPVpluginDescriptionString: - *((char **)value) = - "Flexible Java plugin based on Waterfall API"; - break; - default: - err = NPERR_GENERIC_ERROR; - } - return err; -} - -NPError -NPP_Initialize(void) -{ - JavaVMInitArgs vm_args; - jint ext_id; - - if (g_inited) - return NPERR_NO_ERROR; - if (g_jvmp_context != NULL) - return NPERR_NO_ERROR; - JVMP_ShmInit(1); - if (loadPluginDLL() != JNI_TRUE) - return NPERR_GENERIC_ERROR; - memset(&vm_args, 0, sizeof(vm_args)); - vm_args.version = JNI_VERSION_1_2; - (g_jvmp_context->JVMP_GetDefaultJavaVMInitArgs)(&vm_args); - if (initJVM(&g_jvm, &g_ctx, &vm_args) != JNI_TRUE) - return NPERR_GENERIC_ERROR; - if ((g_jvmp_context->JVMP_RegisterExtension) - (g_ctx, - "/ws/wf/build/unix/libwf_netscape4.so", - &ext_id) != JNI_TRUE) - return NPERR_GENERIC_ERROR; - return DoDirtyInit(); -} - - -void -NPP_Shutdown(void) -{ - g_stopped = 1; -} - - -NPError -NPP_New(NPMIMEType pluginType, - NPP instance, - uint16 mode, - int16 argc, - char* argn[], - char* argv[], - NPSavedData* saved) -{ - PluginInstance* This; - int i; - - if (instance == NULL) - return NPERR_INVALID_INSTANCE_ERROR; - - instance->pdata = malloc(sizeof(PluginInstance)); - - This = (PluginInstance*) instance->pdata; - - if (This == NULL) - return NPERR_OUT_OF_MEMORY_ERROR; - This->m_argn = (char**)malloc(sizeof(char*)*(argc+1)); - This->m_argv = (char**)malloc(sizeof(char*)*(argc+1)); - This->m_peer = instance; - for(i=0; im_argn)[i] = strdup(argn[i]); - (This->m_argv)[i] = strdup(argv[i]); - }; - //NPN_GetURL(This->m_peer, "javascript:document.location", - // NULL); - This->m_argn[i] = strdup("docbase"); - This->m_argv[i] = strdup("http://java.sun.com"); - argc++; - This->m_argc = argc; - This->m_wid = 0; - ADD_INST(This); - if ((g_jvmp_context->JVMP_CreatePeer)(g_ctx, - PV_MOZILLA4, - 0, - &(This->m_id)) != JNI_TRUE) - return NPERR_GENERIC_ERROR; - if ((g_jvmp_context->JVMP_SendEvent)(g_ctx, - This->m_id, - (jint)PE_SETTYPE, - (jlong)PT_APPLET) != JNI_TRUE) - return NPERR_GENERIC_ERROR; - /* async as it calls browser back */ - if ((g_jvmp_context->JVMP_PostEvent)(g_ctx, - This->m_id, - (jint)PE_NEWPARAMS, - (jlong)0) != JNI_TRUE) - return NPERR_GENERIC_ERROR; - return NPERR_NO_ERROR; -} - - -NPError -NPP_Destroy(NPP instance, NPSavedData** save) -{ - PluginInstance* This; - - if (instance == NULL) - return NPERR_INVALID_INSTANCE_ERROR; - - This = (PluginInstance*) instance->pdata; - - /* PLUGIN DEVELOPERS: - * If desired, call NP_MemAlloc to create a - * NPSavedDate structure containing any state information - * that you want restored if this plugin instance is later - * recreated. - */ - - if (This != NULL) { - g_jvmp_context->JVMP_SendEvent(g_ctx, - This->m_id, - (jint)PE_STOP, - 0); - g_jvmp_context->JVMP_UnregisterWindow(g_ctx, - This->m_wid); - /*g_jvmp_context->JVMP_SendEvent(g_ctx, - This->m_id, - (jint)PE_DESTROY, - 0); */ - g_jvmp_context->JVMP_DestroyPeer(g_ctx, - This->m_id); - // XXX: leak, create DestroyInstance() function - DEL_INST(This); - free(instance->pdata); - instance->pdata = NULL; - } - - return NPERR_NO_ERROR; -} - - - -NPError -NPP_SetWindow(NPP instance, NPWindow* rwin) -{ - PluginInstance* This; - JVMP_DrawingSurfaceInfo w; - jint ID; - - if (instance == NULL) - return NPERR_INVALID_INSTANCE_ERROR; - - if (rwin == NULL) - return NPERR_NO_ERROR; - - This = (PluginInstance*) instance->pdata; - - w.window = (struct JPluginWindow*)rwin->window; - w.x = rwin->x; - w.y = rwin->y; - w.width = rwin->width; - w.height = rwin->height; -#ifdef XP_UNIX - XSync(g_data.m_dpy, 0); /* otherwise JDK display connection won't see it */ -#endif - if ((g_jvmp_context->JVMP_RegisterWindow)(g_ctx, &w, &ID) != JNI_TRUE) - return NPERR_GENERIC_ERROR; - if ((g_jvmp_context->JVMP_SendEvent)(g_ctx, - This->m_id, - (jint)PE_SETWINDOW, - (jlong)ID) != JNI_TRUE) - return NPERR_GENERIC_ERROR; - return NPERR_NO_ERROR; -} - - -NPError -NPP_NewStream(NPP instance, - NPMIMEType type, - NPStream *stream, - NPBool seekable, - uint16 *stype) -{ - NPByteRange range; - PluginInstance* This; - - if (instance == NULL) - return NPERR_INVALID_INSTANCE_ERROR; - - This = (PluginInstance*) instance->pdata; - - return NPERR_NO_ERROR; -} - - -/* PLUGIN DEVELOPERS: - * These next 2 functions are directly relevant in a plug-in which - * handles the data in a streaming manner. If you want zero bytes - * because no buffer space is YET available, return 0. As long as - * the stream has not been written to the plugin, Navigator will - * continue trying to send bytes. If the plugin doesn't want them, - * just return some large number from NPP_WriteReady(), and - * ignore them in NPP_Write(). For a NP_ASFILE stream, they are - * still called but can safely be ignored using this strategy. - */ - -int32 STREAMBUFSIZE = 0X0FFFFFFF; /* If we are reading from a file in NPAsFile - * mode so we can take any size stream in our - * write call (since we ignore it) */ - -int32 -NPP_WriteReady(NPP instance, NPStream *stream) -{ - PluginInstance* This; - if (instance != NULL) - This = (PluginInstance*) instance->pdata; - - return STREAMBUFSIZE; -} - - -int32 -NPP_Write(NPP instance, NPStream *stream, - int32 offset, int32 len, void *buffer) -{ - - fprintf(stderr, "NPP_WRITE %d\n", (int)len); - if (instance != NULL) - { - PluginInstance* This = (PluginInstance*) instance->pdata; - SetDocBase(This, (char*)buffer, len); - fprintf(stderr, "got base notification: %s", This->m_docbase); - } - return len; /* The number of bytes accepted */ -} - - -NPError -NPP_DestroyStream(NPP instance, NPStream *stream, NPError reason) -{ - PluginInstance* This; - - if (instance == NULL) - return NPERR_INVALID_INSTANCE_ERROR; - This = (PluginInstance*) instance->pdata; - - return NPERR_NO_ERROR; -} - - -void -NPP_StreamAsFile(NPP instance, NPStream *stream, const char* fname) -{ - PluginInstance* This; - if (instance != NULL) - This = (PluginInstance*) instance->pdata; -} - -void NPP_URLNotify(NPP instance, - const char* url, - NPReason reason, - void* notifyData) -{ - fprintf(stderr, "URLNotify\n"); -} - - -void -NPP_Print(NPP instance, NPPrint* printInfo) -{ - if(printInfo == NULL) - return; - - if (instance != NULL) { - PluginInstance* This = (PluginInstance*) instance->pdata; - - if (printInfo->mode == NP_FULL) { - /* - * PLUGIN DEVELOPERS: - * If your plugin would like to take over - * printing completely when it is in full-screen mode, - * set printInfo->pluginPrinted to TRUE and print your - * plugin as you see fit. If your plugin wants Netscape - * to handle printing in this case, set - * printInfo->pluginPrinted to FALSE (the default) and - * do nothing. If you do want to handle printing - * yourself, printOne is true if the print button - * (as opposed to the print menu) was clicked. - * On the Macintosh, platformPrint is a THPrint; on - * Windows, platformPrint is a structure - * (defined in npapi.h) containing the printer name, port, - * etc. - */ - - void* platformPrint = - printInfo->print.fullPrint.platformPrint; - NPBool printOne = - printInfo->print.fullPrint.printOne; - - /* Do the default*/ - printInfo->print.fullPrint.pluginPrinted = FALSE; - } - else { /* If not fullscreen, we must be embedded */ - /* - * PLUGIN DEVELOPERS: - * If your plugin is embedded, or is full-screen - * but you returned false in pluginPrinted above, NPP_Print - * will be called with mode == NP_EMBED. The NPWindow - * in the printInfo gives the location and dimensions of - * the embedded plugin on the printed page. On the - * Macintosh, platformPrint is the printer port; on - * Windows, platformPrint is the handle to the printing - * device context. - */ - - NPWindow* printWindow = - &(printInfo->print.embedPrint.window); - void* platformPrint = - printInfo->print.embedPrint.platformPrint; - } - } -} - - -/* here our private functions */ -char* GetDlLibraryName(const char* path, - const char* name) -{ - char* result = - (char*)malloc(strlen(path) + strlen(name) + 10); - /* XXX: Unix implementation */ - sprintf(result, "%s/lib%s.so", path, name); - return result; -} - -void* LoadDlLibrary(char* name) -{ - /* XXX: Unix implementation */ - return dlopen(name, RTLD_LAZY); -} - -void GetDlErrorText(char* buf) -{ - char* err; - int len; - - err = dlerror(); - if (err) - memcpy(buf, err, strlen(err)); -} - -void* FindDlSymbol(void* handle, const char* name) -{ - return dlsym(handle, name); -} - -static jint loadPluginDLL() -{ - const char* plugin_home; - char errorMsg[1024] = ""; - char* plugin_dll; - JVMP_GetPlugin_t fJVMP_GetPlugin; - - plugin_home = getenv("JAVA_PLUGIN_HOME"); - if (plugin_home == NULL) { - fprintf(stderr, "Env variable JAVA_PLUGIN_HOME not set"); - return JNI_FALSE; - } - plugin_dll = GetDlLibraryName(plugin_home, "jvmp_shm"); - - g_dll = LoadDlLibrary(plugin_dll); - free(plugin_dll); - if (!g_dll) - { - GetDlErrorText(errorMsg); - fprintf(stderr, "Cannot load plugin DLL: %s", errorMsg); - return JNI_FALSE; - } - fJVMP_GetPlugin = - (JVMP_GetPlugin_t) FindDlSymbol(g_dll, "JVMP_GetPlugin"); - if (!fJVMP_GetPlugin) - { - GetDlErrorText(errorMsg); - fprintf(stderr, "Cannot load plugin DLL: %s", errorMsg); - return JNI_FALSE; - } - (*fJVMP_GetPlugin)(&g_jvmp_context); - return JNI_TRUE; -} - -static jint initJVM(JavaVM** jvm, JVMP_CallingContext** ctx, - JavaVMInitArgs* vm_args) -{ - jint res = - (g_jvmp_context->JVMP_GetRunningJVM)(jvm, ctx, vm_args, JNI_FALSE); - if (res == JNI_TRUE) - { - //fprintf(stderr, "Got JVM!!!\n"); - return JNI_TRUE; - } - else - { - fprintf(stderr, "BAD - NO JVM!!!!"); - return JNI_FALSE; - } -} - -/* this one is called only on Netscape side */ - -int JVMP_ExecuteShmRequest(JVMP_ShmRequest* req) -{ - int vendor, funcno, id, *pid; - char sign[40], *buf, *status, *url, *target; - int len, argc, *pargc; - - if (!req) return 0; - vendor = JVMP_GET_VENDOR(req->func_no); - if (vendor != WFNetscape4VendorID) return 0; - funcno = JVMP_GET_EXT_FUNCNO(req->func_no); - switch(funcno) - { - case 2: - sprintf(sign, "Iia[0]"); - len = 0; pargc = &argc; - JVMP_DecodeRequest(req, 0, sign, &id, &pargc, &buf); - pargc = &argc; - PutParams(id, &buf, pargc, &len); - sprintf(sign, "Iia[%d]", len); - JVMP_EncodeRequest(req, sign, id, pargc, buf); - free(buf); - break; - case 3: - sprintf(sign, "IS"); - JVMP_DecodeRequest(req, 1, sign, &id, &status); - req->retval = ShowStatus(id, status); - free(status); - break; - case 4: - sprintf(sign, "ISS"); - JVMP_DecodeRequest(req, 1, sign, &id, &url, &target); - req->retval = ShowDocument(id, url, target); - free(url); free(target); - default: - return 0; - } - return 1; -} - -#ifdef XP_UNIX -static void -request_handler(Widget w, XtPointer data, - XEvent *raw_evt, Boolean *cont) -{ - JVMP_ShmRequest* req; - XPropertyEvent *evt = (XPropertyEvent *) raw_evt; - if (evt->atom == g_request_handler_atom) - { - while (JVMP_RecvShmRequest(g_data.m_msgid1, 0, &req)) - { - if (!req) break; - JVMP_ExecuteShmRequest(req); - JVMP_ConfirmShmRequest(req); - JVMP_DeleteShmReq(req); - req = NULL; - } - } - // fprintf(stderr, "leaving request_handler\n"); -} - -static int AllocateEventWidget(Display* dpy, XID* pxid) -{ - Arg args[40]; - int argc; - Widget w; - - if (!dpy || !pxid) return 0; - argc = 0; - XtSetArg(args[argc], XmNallowShellResize, True); argc++; - XtSetArg(args[argc], XmNwidth, 100); argc++; - XtSetArg(args[argc], XmNheight, 100); argc++; - XtSetArg(args[argc], XmNmappedWhenManaged, False); argc++; - w = NULL; - w = XtAppCreateShell("WF","XApplication", - vendorShellWidgetClass, - dpy, - args, - argc); - if (w == NULL) return 0; - XtRealizeWidget(w); - XtAddEventHandler(w, PropertyChangeMask, FALSE, - request_handler, NULL); - g_request_handler_atom = - XInternAtom(dpy, "WF atom", FALSE); - *pxid = XtWindow(w); - XFlush(dpy); - return 1; -} -#endif -NPError -DoDirtyInit() -{ -#ifdef XP_UNIX - JVMP_ShmRequest* req = NULL; - int* pmsg_id; - char* npname; - Dl_info nfo; - - g_data.m_msgid = (int)g_ctx->reserved0; - g_data.m_dpy = NULL; - NPN_GetValue(NULL, NPNVxDisplay, &(g_data.m_dpy)); - if (!AllocateEventWidget(g_data.m_dpy, &(g_data.m_xid))) - { - fprintf(stderr, "Cannot allocate event widget\n"); - return NPERR_GENERIC_ERROR; - } - req = JVMP_NewShmReq(g_data.m_msgid, - JVMP_NEW_EXT_FUNCNO(WFNetscape4VendorID, 1)); - JVMP_EncodeRequest(req, "Ii", g_data.m_xid, &(g_data.m_msgid1)); - if (!JVMP_SendShmRequest(req, 1)) return NPERR_GENERIC_ERROR; - JVMP_WaitConfirmShmRequest(req); - if (!req->retval) return NPERR_GENERIC_ERROR; - pmsg_id = &(g_data.m_msgid1); - JVMP_DecodeRequest(req, 0, "Ii", &g_data.m_xid, &pmsg_id); - /* just to increment refcount and forbid to unload plugin DLL */ - if (dladdr(&DoDirtyInit, &nfo) != 0) - LoadDlLibrary(nfo.dli_fname); - g_inited = 1; -#endif - return NPERR_NO_ERROR; -} - -static jint PutParams(jint id, char** pbuf, int* pargc, int* plen) -{ - PluginInstance* inst; - int len, argc, i, pos; - char* buf; - - inst = GetInstance(id); - if (!inst) { - fprintf(stderr, "instance %d not found\n", (int)id); - *plen = *pargc = 0; *pbuf = NULL; - return JNI_FALSE; - } - argc = inst->m_argc; len = 0; - for (i=0; im_argn[i]) + 1 + strlen(inst->m_argv[i]) + 1; - } - buf = (char*)malloc(len); - *plen = len; - pos = 0; - for (i=0; im_argn[i]) + 1; - memcpy(buf+pos, inst->m_argn[i], len); - pos += len; - len = strlen(inst->m_argv[i]) + 1; - memcpy(buf+pos, inst->m_argv[i], len); - pos += len; - } - *pbuf = buf; - *pargc = argc; - return JNI_TRUE; -} - -static PluginInstance* GetInstance(jint id) -{ - int i; - for(i=0; im_id == id)) - return g_instances[i]; - } - return NULL; -} - -static void SetDocBase(PluginInstance* inst, char* buf, int len) -{ - JVMP_ShmRequest* req; - if (!inst) return; - inst->m_docbase = strdup(buf); -} - diff --git a/mozilla/java/waterfall/wf/src/plugin/netscape4/Makefile b/mozilla/java/waterfall/wf/src/plugin/netscape4/Makefile deleted file mode 100644 index 2bf8c32631f..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/netscape4/Makefile +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: Makefile,v 1.1.1.1 2001-05-09 17:30:09 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#!make -################################################################################ -# Copyright (c) 1996 Netscape Communications. All rights reserved. -################################################################################ -# -# Simple Sample plugin makefile -# -# Platform: Linux 1.2 (ELF) -# -# This makefile contains some of our defines for the compiler: -# -# XP_UNIX This needs to get defined for npapi.h on unix platforms. -# PLUGIN_TRACE Enable this define to get debug prints whenever the plugin -# api gets control. -# -# WARNING: Motif libraries are built static into the navigator and cannot -# be accessed from the plugin. -# -PLUGIN_DEFINES= -DXP_UNIX -DJVMP_USE_SHM -#PLUGIN_DEFINES= -DXP_UNIX -DPLUGIN_TRACE -DJVMP_USE_SHM -#PLUGIN_DEFINES= -DXP_UNIX -I../../../include -I../Source/_gen - -CC= gcc -OPTIMIZER= -g -CFLAGS= -Wall -Wno-unused $(OPTIMIZER) $(PLUGIN_DEFINES) -I. -I../../../public/ - - -SRC=JavaPlugin.c npunix.c -OBJ=JavaPlugin.o npunix.o - -SHAREDTARGET=npjvmp.so - -default all: $(SHAREDTARGET) - -$(SHAREDTARGET): $(OBJ) ../../../build/unix/shmtran.o - $(CC) -shared -o $(SHAREDTARGET) $(OBJ) ../../../build/unix/shmtran.o $(LDFLAGS) -ldl - -npsimple.o: ../Source/npsimple.c - $(CC) -c $(CFLAGS) ../Source/npsimple.c - -stubs.o: ../Source/stubs.c - $(CC) -c $(CFLAGS) ../Source/stubs.c - -clean: - $(RM) $(OBJ) $(SHAREDTARGET) diff --git a/mozilla/java/waterfall/wf/src/plugin/netscape4/UnixShell.c b/mozilla/java/waterfall/wf/src/plugin/netscape4/UnixShell.c deleted file mode 100644 index 2d8c78d22ab..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/netscape4/UnixShell.c +++ /dev/null @@ -1,329 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: UnixShell.c,v 1.1.1.1 2001-05-09 17:30:10 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* -*- Mode: C; tab-width: 4; -*- */ -/****************************************************************************** - * Copyright (c) 1996 Netscape Communications. All rights reserved. - ******************************************************************************/ -/* - * UnixShell.c - * - * Netscape Client Plugin API - * - Function that need to be implemented by plugin developers - * - * This file defines a "Template" plugin that plugin developers can use - * as the basis for a real plugin. This shell just provides empty - * implementations of all functions that the plugin can implement - * that will be called by Netscape (the NPP_xxx methods defined in - * npapi.h). - * - * dp Suresh - * - */ - -#include -#include "npapi.h" - -/*********************************************************************** - * Instance state information about the plugin. - * - * PLUGIN DEVELOPERS: - * Use this struct to hold per-instance information that you'll - * need in the various functions in this file. - ***********************************************************************/ - -typedef struct _PluginInstance -{ - int nothing; -} PluginInstance; - - -/*********************************************************************** - * - * Empty implementations of plugin API functions - * - * PLUGIN DEVELOPERS: - * You will need to implement these functions as required by your - * plugin. - * - ***********************************************************************/ - -char* -NPP_GetMIMEDescription(void) -{ - return("mime/type:sample:Template Only"); -} - -NPError -NPP_GetValue(void *future, NPPVariable variable, void *value) -{ - NPError err = NPERR_NO_ERROR; - - switch (variable) { - case NPPVpluginNameString: - *((char **)value) = "Template plugin"; - break; - case NPPVpluginDescriptionString: - *((char **)value) = - "This plugins handles nothing. This is only" - " a template."; - break; - default: - err = NPERR_GENERIC_ERROR; - } - return err; -} - -NPError -NPP_Initialize(void) -{ - return NPERR_NO_ERROR; -} - - -jref -NPP_GetJavaClass() -{ - return NULL; -} - -void -NPP_Shutdown(void) -{ -} - - -NPError -NPP_New(NPMIMEType pluginType, - NPP instance, - uint16 mode, - int16 argc, - char* argn[], - char* argv[], - NPSavedData* saved) -{ - PluginInstance* This; - - if (instance == NULL) - return NPERR_INVALID_INSTANCE_ERROR; - - instance->pdata = NPN_MemAlloc(sizeof(PluginInstance)); - - This = (PluginInstance*) instance->pdata; - - if (This != NULL) - return NPERR_NO_ERROR; - else - return NPERR_OUT_OF_MEMORY_ERROR; -} - - -NPError -NPP_Destroy(NPP instance, NPSavedData** save) -{ - PluginInstance* This; - - if (instance == NULL) - return NPERR_INVALID_INSTANCE_ERROR; - - This = (PluginInstance*) instance->pdata; - - /* PLUGIN DEVELOPERS: - * If desired, call NP_MemAlloc to create a - * NPSavedDate structure containing any state information - * that you want restored if this plugin instance is later - * recreated. - */ - - if (This != NULL) { - NPN_MemFree(instance->pdata); - instance->pdata = NULL; - } - - return NPERR_NO_ERROR; -} - - - -NPError -NPP_SetWindow(NPP instance, NPWindow* window) -{ - PluginInstance* This; - - if (instance == NULL) - return NPERR_INVALID_INSTANCE_ERROR; - - if (window == NULL) - return NPERR_NO_ERROR; - - This = (PluginInstance*) instance->pdata; - - /* - * PLUGIN DEVELOPERS: - * Before setting window to point to the - * new window, you may wish to compare the new window - * info to the previous window (if any) to note window - * size changes, etc. - */ - - return NPERR_NO_ERROR; -} - - -NPError -NPP_NewStream(NPP instance, - NPMIMEType type, - NPStream *stream, - NPBool seekable, - uint16 *stype) -{ - NPByteRange range; - PluginInstance* This; - - if (instance == NULL) - return NPERR_INVALID_INSTANCE_ERROR; - - This = (PluginInstance*) instance->pdata; - - return NPERR_NO_ERROR; -} - - -/* PLUGIN DEVELOPERS: - * These next 2 functions are directly relevant in a plug-in which - * handles the data in a streaming manner. If you want zero bytes - * because no buffer space is YET available, return 0. As long as - * the stream has not been written to the plugin, Navigator will - * continue trying to send bytes. If the plugin doesn't want them, - * just return some large number from NPP_WriteReady(), and - * ignore them in NPP_Write(). For a NP_ASFILE stream, they are - * still called but can safely be ignored using this strategy. - */ - -int32 STREAMBUFSIZE = 0X0FFFFFFF; /* If we are reading from a file in NPAsFile - * mode so we can take any size stream in our - * write call (since we ignore it) */ - -int32 -NPP_WriteReady(NPP instance, NPStream *stream) -{ - PluginInstance* This; - if (instance != NULL) - This = (PluginInstance*) instance->pdata; - - return STREAMBUFSIZE; -} - - -int32 -NPP_Write(NPP instance, NPStream *stream, int32 offset, int32 len, void *buffer) -{ - if (instance != NULL) - { - PluginInstance* This = (PluginInstance*) instance->pdata; - } - - return len; /* The number of bytes accepted */ -} - - -NPError -NPP_DestroyStream(NPP instance, NPStream *stream, NPError reason) -{ - PluginInstance* This; - - if (instance == NULL) - return NPERR_INVALID_INSTANCE_ERROR; - This = (PluginInstance*) instance->pdata; - - return NPERR_NO_ERROR; -} - - -void -NPP_StreamAsFile(NPP instance, NPStream *stream, const char* fname) -{ - PluginInstance* This; - if (instance != NULL) - This = (PluginInstance*) instance->pdata; -} - - -void -NPP_Print(NPP instance, NPPrint* printInfo) -{ - if(printInfo == NULL) - return; - - if (instance != NULL) { - PluginInstance* This = (PluginInstance*) instance->pdata; - - if (printInfo->mode == NP_FULL) { - /* - * PLUGIN DEVELOPERS: - * If your plugin would like to take over - * printing completely when it is in full-screen mode, - * set printInfo->pluginPrinted to TRUE and print your - * plugin as you see fit. If your plugin wants Netscape - * to handle printing in this case, set - * printInfo->pluginPrinted to FALSE (the default) and - * do nothing. If you do want to handle printing - * yourself, printOne is true if the print button - * (as opposed to the print menu) was clicked. - * On the Macintosh, platformPrint is a THPrint; on - * Windows, platformPrint is a structure - * (defined in npapi.h) containing the printer name, port, - * etc. - */ - - void* platformPrint = - printInfo->print.fullPrint.platformPrint; - NPBool printOne = - printInfo->print.fullPrint.printOne; - - /* Do the default*/ - printInfo->print.fullPrint.pluginPrinted = FALSE; - } - else { /* If not fullscreen, we must be embedded */ - /* - * PLUGIN DEVELOPERS: - * If your plugin is embedded, or is full-screen - * but you returned false in pluginPrinted above, NPP_Print - * will be called with mode == NP_EMBED. The NPWindow - * in the printInfo gives the location and dimensions of - * the embedded plugin on the printed page. On the - * Macintosh, platformPrint is the printer port; on - * Windows, platformPrint is the handle to the printing - * device context. - */ - - NPWindow* printWindow = - &(printInfo->print.embedPrint.window); - void* platformPrint = - printInfo->print.embedPrint.platformPrint; - } - } -} diff --git a/mozilla/java/waterfall/wf/src/plugin/netscape4/common.h b/mozilla/java/waterfall/wf/src/plugin/netscape4/common.h deleted file mode 100644 index bed2ad488c0..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/netscape4/common.h +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: common.h,v 1.1.1.1 2001-05-09 17:30:09 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef _common_h -#define _common_h -#include "npapi.h" -/*********************************************************************** - * Instance state information about the plugin. - * - * PLUGIN DEVELOPERS: - * Use this struct to hold per-instance information that you'll - * need in the various functions in this file. - ***********************************************************************/ - -typedef struct _PluginInstance -{ - void* info; /* really "this" */ - NPP m_peer; - jint m_id; - jint m_wid; - int16 m_argc; - char** m_argn; - char** m_argv; - char* m_docbase; -} PluginInstance; - -typedef struct _GlobalData -{ -#ifdef XP_UNIX - Display* m_dpy; - /* message queue ID of shared memory transport in host -> JVM direction */ - int m_msgid; - /* message queue ID of shared memory transport in JVM -> host direction */ - int m_msgid1; - /* XID of widget used to notify browser about our requests */ - XID m_xid; -#endif -} GlobalData; - -#define PE_NOPE 0 -#define PE_CREATE 1 -#define PE_SETWINDOW 2 -#define PE_DESTROY 3 -#define PE_START 4 -#define PE_STOP 5 -#define PE_NEWPARAMS 6 -#define PE_SETTYPE 7 - -#define PV_UNKNOWN 0 -#define PV_MOZILLA6 1 -#define PV_MOZILLA4 2 - -#define PT_UNKNOWN 0 -#define PT_EMBED 1 -#define PT_OBJECT 2 -#define PT_APPLET 3 -#define PT_PLUGLET 4 - -#define WFNetscape4VendorID 2 /* Netscape 4 */ -#define WFNetscape4ExtVersion 1 - -#endif diff --git a/mozilla/java/waterfall/wf/src/plugin/netscape4/jri.h b/mozilla/java/waterfall/wf/src/plugin/netscape4/jri.h deleted file mode 100644 index 01c23b11d4c..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/netscape4/jri.h +++ /dev/null @@ -1,667 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: jri.h,v 1.1.1.1 2001-05-09 17:30:09 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* -*- Mode: C; tab-width: 4; -*- */ -/******************************************************************************* - * Java Runtime Interface - * Copyright (c) 1996 Netscape Communications Corporation. All rights reserved. - ******************************************************************************/ - -#ifndef JRI_H -#define JRI_H - -#include "jritypes.h" - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/******************************************************************************* - * JRIEnv - ******************************************************************************/ - -/* The type of the JRIEnv interface. */ -typedef struct JRIEnvInterface JRIEnvInterface; - -/* The type of a JRIEnv instance. */ -typedef const JRIEnvInterface* JRIEnv; - -/******************************************************************************* - * JRIEnv Operations - ******************************************************************************/ - -#define JRI_DefineClass(env, classLoader, buf, bufLen) \ - (((*(env))->DefineClass)(env, JRI_DefineClass_op, classLoader, buf, bufLen)) - -#define JRI_FindClass(env, name) \ - (((*(env))->FindClass)(env, JRI_FindClass_op, name)) - -#define JRI_Throw(env, obj) \ - (((*(env))->Throw)(env, JRI_Throw_op, obj)) - -#define JRI_ThrowNew(env, clazz, message) \ - (((*(env))->ThrowNew)(env, JRI_ThrowNew_op, clazz, message)) - -#define JRI_ExceptionOccurred(env) \ - (((*(env))->ExceptionOccurred)(env, JRI_ExceptionOccurred_op)) - -#define JRI_ExceptionDescribe(env) \ - (((*(env))->ExceptionDescribe)(env, JRI_ExceptionDescribe_op)) - -#define JRI_ExceptionClear(env) \ - (((*(env))->ExceptionClear)(env, JRI_ExceptionClear_op)) - -#define JRI_NewGlobalRef(env, ref) \ - (((*(env))->NewGlobalRef)(env, JRI_NewGlobalRef_op, ref)) - -#define JRI_DisposeGlobalRef(env, gref) \ - (((*(env))->DisposeGlobalRef)(env, JRI_DisposeGlobalRef_op, gref)) - -#define JRI_GetGlobalRef(env, gref) \ - (((*(env))->GetGlobalRef)(env, JRI_GetGlobalRef_op, gref)) - -#define JRI_SetGlobalRef(env, gref, ref) \ - (((*(env))->SetGlobalRef)(env, JRI_SetGlobalRef_op, gref, ref)) - -#define JRI_IsSameObject(env, a, b) \ - (((*(env))->IsSameObject)(env, JRI_IsSameObject_op, a, b)) - -#define JRI_NewObject(env) ((*(env))->NewObject) -#define JRI_NewObjectV(env, clazz, methodID, args) \ - (((*(env))->NewObjectV)(env, JRI_NewObject_op_va_list, clazz, methodID, args)) -#define JRI_NewObjectA(env, clazz, method, args) \ - (((*(env))->NewObjectA)(env, JRI_NewObject_op_array, clazz, methodID, args)) - -#define JRI_GetObjectClass(env, obj) \ - (((*(env))->GetObjectClass)(env, JRI_GetObjectClass_op, obj)) - -#define JRI_IsInstanceOf(env, obj, clazz) \ - (((*(env))->IsInstanceOf)(env, JRI_IsInstanceOf_op, obj, clazz)) - -#define JRI_GetMethodID(env, clazz, name, sig) \ - (((*(env))->GetMethodID)(env, JRI_GetMethodID_op, clazz, name, sig)) - -#define JRI_CallMethod(env) ((*(env))->CallMethod) -#define JRI_CallMethodV(env, obj, methodID, args) \ - (((*(env))->CallMethodV)(env, JRI_CallMethod_op_va_list, obj, methodID, args)) -#define JRI_CallMethodA(env, obj, methodID, args) \ - (((*(env))->CallMethodA)(env, JRI_CallMethod_op_array, obj, methodID, args)) - -#define JRI_CallMethodBoolean(env) ((*(env))->CallMethodBoolean) -#define JRI_CallMethodBooleanV(env, obj, methodID, args) \ - (((*(env))->CallMethodBooleanV)(env, JRI_CallMethodBoolean_op_va_list, obj, methodID, args)) -#define JRI_CallMethodBooleanA(env, obj, methodID, args) \ - (((*(env))->CallMethodBooleanA)(env, JRI_CallMethodBoolean_op_array, obj, methodID, args)) - -#define JRI_CallMethodByte(env) ((*(env))->CallMethodByte) -#define JRI_CallMethodByteV(env, obj, methodID, args) \ - (((*(env))->CallMethodByteV)(env, JRI_CallMethodByte_op_va_list, obj, methodID, args)) -#define JRI_CallMethodByteA(env, obj, methodID, args) \ - (((*(env))->CallMethodByteA)(env, JRI_CallMethodByte_op_array, obj, methodID, args)) - -#define JRI_CallMethodChar(env) ((*(env))->CallMethodChar) -#define JRI_CallMethodCharV(env, obj, methodID, args) \ - (((*(env))->CallMethodCharV)(env, JRI_CallMethodChar_op_va_list, obj, methodID, args)) -#define JRI_CallMethodCharA(env, obj, methodID, args) \ - (((*(env))->CallMethodCharA)(env, JRI_CallMethodChar_op_array, obj, methodID, args)) - -#define JRI_CallMethodShort(env) ((*(env))->CallMethodShort) -#define JRI_CallMethodShortV(env, obj, methodID, args) \ - (((*(env))->CallMethodShortV)(env, JRI_CallMethodShort_op_va_list, obj, methodID, args)) -#define JRI_CallMethodShortA(env, obj, methodID, args) \ - (((*(env))->CallMethodShortA)(env, JRI_CallMethodShort_op_array, obj, methodID, args)) - -#define JRI_CallMethodInt(env) ((*(env))->CallMethodInt) -#define JRI_CallMethodIntV(env, obj, methodID, args) \ - (((*(env))->CallMethodIntV)(env, JRI_CallMethodInt_op_va_list, obj, methodID, args)) -#define JRI_CallMethodIntA(env, obj, methodID, args) \ - (((*(env))->CallMethodIntA)(env, JRI_CallMethodInt_op_array, obj, methodID, args)) - -#define JRI_CallMethodLong(env) ((*(env))->CallMethodLong) -#define JRI_CallMethodLongV(env, obj, methodID, args) \ - (((*(env))->CallMethodLongV)(env, JRI_CallMethodLong_op_va_list, obj, methodID, args)) -#define JRI_CallMethodLongA(env, obj, methodID, args) \ - (((*(env))->CallMethodLongA)(env, JRI_CallMethodLong_op_array, obj, methodID, args)) - -#define JRI_CallMethodFloat(env) ((*(env))->CallMethodFloat) -#define JRI_CallMethodFloatV(env, obj, methodID, args) \ - (((*(env))->CallMethodFloatV)(env, JRI_CallMethodFloat_op_va_list, obj, methodID, args)) -#define JRI_CallMethodFloatA(env, obj, methodID, args) \ - (((*(env))->CallMethodFloatA)(env, JRI_CallMethodFloat_op_array, obj, methodID, args)) - -#define JRI_CallMethodDouble(env) ((*(env))->CallMethodDouble) -#define JRI_CallMethodDoubleV(env, obj, methodID, args) \ - (((*(env))->CallMethodDoubleV)(env, JRI_CallMethodDouble_op_va_list, obj, methodID, args)) -#define JRI_CallMethodDoubleA(env, obj, methodID, args) \ - (((*(env))->CallMethodDoubleA)(env, JRI_CallMethodDouble_op_array, obj, methodID, args)) - -#define JRI_GetFieldID(env, clazz, name, sig) \ - (((*(env))->GetFieldID)(env, JRI_GetFieldID_op, clazz, name, sig)) - -#define JRI_GetField(env, obj, fieldID) \ - (((*(env))->GetField)(env, JRI_GetField_op, obj, fieldID)) - -#define JRI_GetFieldBoolean(env, obj, fieldID) \ - (((*(env))->GetFieldBoolean)(env, JRI_GetFieldBoolean_op, obj, fieldID)) - -#define JRI_GetFieldByte(env, obj, fieldID) \ - (((*(env))->GetFieldByte)(env, JRI_GetFieldByte_op, obj, fieldID)) - -#define JRI_GetFieldChar(env, obj, fieldID) \ - (((*(env))->GetFieldChar)(env, JRI_GetFieldChar_op, obj, fieldID)) - -#define JRI_GetFieldShort(env, obj, fieldID) \ - (((*(env))->GetFieldShort)(env, JRI_GetFieldShort_op, obj, fieldID)) - -#define JRI_GetFieldInt(env, obj, fieldID) \ - (((*(env))->GetFieldInt)(env, JRI_GetFieldInt_op, obj, fieldID)) - -#define JRI_GetFieldLong(env, obj, fieldID) \ - (((*(env))->GetFieldLong)(env, JRI_GetFieldLong_op, obj, fieldID)) - -#define JRI_GetFieldFloat(env, obj, fieldID) \ - (((*(env))->GetFieldFloat)(env, JRI_GetFieldFloat_op, obj, fieldID)) - -#define JRI_GetFieldDouble(env, obj, fieldID) \ - (((*(env))->GetFieldDouble)(env, JRI_GetFieldDouble_op, obj, fieldID)) - -#define JRI_SetField(env, obj, fieldID, value) \ - (((*(env))->SetField)(env, JRI_SetField_op, obj, fieldID, value)) - -#define JRI_SetFieldBoolean(env, obj, fieldID, value) \ - (((*(env))->SetFieldBoolean)(env, JRI_SetFieldBoolean_op, obj, fieldID, value)) - -#define JRI_SetFieldByte(env, obj, fieldID, value) \ - (((*(env))->SetFieldByte)(env, JRI_SetFieldByte_op, obj, fieldID, value)) - -#define JRI_SetFieldChar(env, obj, fieldID, value) \ - (((*(env))->SetFieldChar)(env, JRI_SetFieldChar_op, obj, fieldID, value)) - -#define JRI_SetFieldShort(env, obj, fieldID, value) \ - (((*(env))->SetFieldShort)(env, JRI_SetFieldShort_op, obj, fieldID, value)) - -#define JRI_SetFieldInt(env, obj, fieldID, value) \ - (((*(env))->SetFieldInt)(env, JRI_SetFieldInt_op, obj, fieldID, value)) - -#define JRI_SetFieldLong(env, obj, fieldID, value) \ - (((*(env))->SetFieldLong)(env, JRI_SetFieldLong_op, obj, fieldID, value)) - -#define JRI_SetFieldFloat(env, obj, fieldID, value) \ - (((*(env))->SetFieldFloat)(env, JRI_SetFieldFloat_op, obj, fieldID, value)) - -#define JRI_SetFieldDouble(env, obj, fieldID, value) \ - (((*(env))->SetFieldDouble)(env, JRI_SetFieldDouble_op, obj, fieldID, value)) - -#define JRI_IsSubclassOf(env, a, b) \ - (((*(env))->IsSubclassOf)(env, JRI_IsSubclassOf_op, a, b)) - -#define JRI_GetStaticMethodID(env, clazz, name, sig) \ - (((*(env))->GetStaticMethodID)(env, JRI_GetStaticMethodID_op, clazz, name, sig)) - -#define JRI_CallStaticMethod(env) ((*(env))->CallStaticMethod) -#define JRI_CallStaticMethodV(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodV)(env, JRI_CallStaticMethod_op_va_list, clazz, methodID, args)) -#define JRI_CallStaticMethodA(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodA)(env, JRI_CallStaticMethod_op_array, clazz, methodID, args)) - -#define JRI_CallStaticMethodBoolean(env) ((*(env))->CallStaticMethodBoolean) -#define JRI_CallStaticMethodBooleanV(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodBooleanV)(env, JRI_CallStaticMethodBoolean_op_va_list, clazz, methodID, args)) -#define JRI_CallStaticMethodBooleanA(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodBooleanA)(env, JRI_CallStaticMethodBoolean_op_array, clazz, methodID, args)) - -#define JRI_CallStaticMethodByte(env) ((*(env))->CallStaticMethodByte) -#define JRI_CallStaticMethodByteV(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodByteV)(env, JRI_CallStaticMethodByte_op_va_list, clazz, methodID, args)) -#define JRI_CallStaticMethodByteA(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodByteA)(env, JRI_CallStaticMethodByte_op_array, clazz, methodID, args)) - -#define JRI_CallStaticMethodChar(env) ((*(env))->CallStaticMethodChar) -#define JRI_CallStaticMethodCharV(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodCharV)(env, JRI_CallStaticMethodChar_op_va_list, clazz, methodID, args)) -#define JRI_CallStaticMethodCharA(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodCharA)(env, JRI_CallStaticMethodChar_op_array, clazz, methodID, args)) - -#define JRI_CallStaticMethodShort(env) ((*(env))->CallStaticMethodShort) -#define JRI_CallStaticMethodShortV(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodShortV)(env, JRI_CallStaticMethodShort_op_va_list, clazz, methodID, args)) -#define JRI_CallStaticMethodShortA(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodShortA)(env, JRI_CallStaticMethodShort_op_array, clazz, methodID, args)) - -#define JRI_CallStaticMethodInt(env) ((*(env))->CallStaticMethodInt) -#define JRI_CallStaticMethodIntV(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodIntV)(env, JRI_CallStaticMethodInt_op_va_list, clazz, methodID, args)) -#define JRI_CallStaticMethodIntA(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodIntA)(env, JRI_CallStaticMethodInt_op_array, clazz, methodID, args)) - -#define JRI_CallStaticMethodLong(env) ((*(env))->CallStaticMethodLong) -#define JRI_CallStaticMethodLongV(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodLongV)(env, JRI_CallStaticMethodLong_op_va_list, clazz, methodID, args)) -#define JRI_CallStaticMethodLongA(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodLongA)(env, JRI_CallStaticMethodLong_op_array, clazz, methodID, args)) - -#define JRI_CallStaticMethodFloat(env) ((*(env))->CallStaticMethodFloat) -#define JRI_CallStaticMethodFloatV(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodFloatV)(env, JRI_CallStaticMethodFloat_op_va_list, clazz, methodID, args)) -#define JRI_CallStaticMethodFloatA(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodFloatA)(env, JRI_CallStaticMethodFloat_op_array, clazz, methodID, args)) - -#define JRI_CallStaticMethodDouble(env) ((*(env))->CallStaticMethodDouble) -#define JRI_CallStaticMethodDoubleV(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodDoubleV)(env, JRI_CallStaticMethodDouble_op_va_list, clazz, methodID, args)) -#define JRI_CallStaticMethodDoubleA(env, clazz, methodID, args) \ - (((*(env))->CallStaticMethodDoubleA)(env, JRI_CallStaticMethodDouble_op_array, clazz, methodID, args)) - -#define JRI_GetStaticFieldID(env, clazz, name, sig) \ - (((*(env))->GetStaticFieldID)(env, JRI_GetStaticFieldID_op, clazz, name, sig)) - -#define JRI_GetStaticField(env, clazz, fieldID) \ - (((*(env))->GetStaticField)(env, JRI_GetStaticField_op, clazz, fieldID)) - -#define JRI_GetStaticFieldBoolean(env, clazz, fieldID) \ - (((*(env))->GetStaticFieldBoolean)(env, JRI_GetStaticFieldBoolean_op, clazz, fieldID)) - -#define JRI_GetStaticFieldByte(env, clazz, fieldID) \ - (((*(env))->GetStaticFieldByte)(env, JRI_GetStaticFieldByte_op, clazz, fieldID)) - -#define JRI_GetStaticFieldChar(env, clazz, fieldID) \ - (((*(env))->GetStaticFieldChar)(env, JRI_GetStaticFieldChar_op, clazz, fieldID)) - -#define JRI_GetStaticFieldShort(env, clazz, fieldID) \ - (((*(env))->GetStaticFieldShort)(env, JRI_GetStaticFieldShort_op, clazz, fieldID)) - -#define JRI_GetStaticFieldInt(env, clazz, fieldID) \ - (((*(env))->GetStaticFieldInt)(env, JRI_GetStaticFieldInt_op, clazz, fieldID)) - -#define JRI_GetStaticFieldLong(env, clazz, fieldID) \ - (((*(env))->GetStaticFieldLong)(env, JRI_GetStaticFieldLong_op, clazz, fieldID)) - -#define JRI_GetStaticFieldFloat(env, clazz, fieldID) \ - (((*(env))->GetStaticFieldFloat)(env, JRI_GetStaticFieldFloat_op, clazz, fieldID)) - -#define JRI_GetStaticFieldDouble(env, clazz, fieldID) \ - (((*(env))->GetStaticFieldDouble)(env, JRI_GetStaticFieldDouble_op, clazz, fieldID)) - -#define JRI_SetStaticField(env, clazz, fieldID, value) \ - (((*(env))->SetStaticField)(env, JRI_SetStaticField_op, clazz, fieldID, value)) - -#define JRI_SetStaticFieldBoolean(env, clazz, fieldID, value) \ - (((*(env))->SetStaticFieldBoolean)(env, JRI_SetStaticFieldBoolean_op, clazz, fieldID, value)) - -#define JRI_SetStaticFieldByte(env, clazz, fieldID, value) \ - (((*(env))->SetStaticFieldByte)(env, JRI_SetStaticFieldByte_op, clazz, fieldID, value)) - -#define JRI_SetStaticFieldChar(env, clazz, fieldID, value) \ - (((*(env))->SetStaticFieldChar)(env, JRI_SetStaticFieldChar_op, clazz, fieldID, value)) - -#define JRI_SetStaticFieldShort(env, clazz, fieldID, value) \ - (((*(env))->SetStaticFieldShort)(env, JRI_SetStaticFieldShort_op, clazz, fieldID, value)) - -#define JRI_SetStaticFieldInt(env, clazz, fieldID, value) \ - (((*(env))->SetStaticFieldInt)(env, JRI_SetStaticFieldInt_op, clazz, fieldID, value)) - -#define JRI_SetStaticFieldLong(env, clazz, fieldID, value) \ - (((*(env))->SetStaticFieldLong)(env, JRI_SetStaticFieldLong_op, clazz, fieldID, value)) - -#define JRI_SetStaticFieldFloat(env, clazz, fieldID, value) \ - (((*(env))->SetStaticFieldFloat)(env, JRI_SetStaticFieldFloat_op, clazz, fieldID, value)) - -#define JRI_SetStaticFieldDouble(env, clazz, fieldID, value) \ - (((*(env))->SetStaticFieldDouble)(env, JRI_SetStaticFieldDouble_op, clazz, fieldID, value)) - -#define JRI_NewString(env, unicode, len) \ - (((*(env))->NewString)(env, JRI_NewString_op, unicode, len)) - -#define JRI_GetStringLength(env, string) \ - (((*(env))->GetStringLength)(env, JRI_GetStringLength_op, string)) - -#define JRI_GetStringChars(env, string) \ - (((*(env))->GetStringChars)(env, JRI_GetStringChars_op, string)) - -#define JRI_NewStringUTF(env, utf, len) \ - (((*(env))->NewStringUTF)(env, JRI_NewStringUTF_op, utf, len)) - -#define JRI_GetStringUTFLength(env, string) \ - (((*(env))->GetStringUTFLength)(env, JRI_GetStringUTFLength_op, string)) - -#define JRI_GetStringUTFChars(env, string) \ - (((*(env))->GetStringUTFChars)(env, JRI_GetStringUTFChars_op, string)) - -#define JRI_NewScalarArray(env, length, elementSig, initialElements) \ - (((*(env))->NewScalarArray)(env, JRI_NewScalarArray_op, length, elementSig, initialElements)) - -#define JRI_GetScalarArrayLength(env, array) \ - (((*(env))->GetScalarArrayLength)(env, JRI_GetScalarArrayLength_op, array)) - -#define JRI_GetScalarArrayElements(env, array) \ - (((*(env))->GetScalarArrayElements)(env, JRI_GetScalarArrayElements_op, array)) - -#define JRI_NewObjectArray(env, length, elementClass, initialElement) \ - (((*(env))->NewObjectArray)(env, JRI_NewObjectArray_op, length, elementClass, initialElement)) - -#define JRI_GetObjectArrayLength(env, array) \ - (((*(env))->GetObjectArrayLength)(env, JRI_GetObjectArrayLength_op, array)) - -#define JRI_GetObjectArrayElement(env, array, index) \ - (((*(env))->GetObjectArrayElement)(env, JRI_GetObjectArrayElement_op, array, index)) - -#define JRI_SetObjectArrayElement(env, array, index, value) \ - (((*(env))->SetObjectArrayElement)(env, JRI_SetObjectArrayElement_op, array, index, value)) - -#define JRI_RegisterNatives(env, clazz, nameAndSigArray, nativeProcArray) \ - (((*(env))->RegisterNatives)(env, JRI_RegisterNatives_op, clazz, nameAndSigArray, nativeProcArray)) - -#define JRI_UnregisterNatives(env, clazz) \ - (((*(env))->UnregisterNatives)(env, JRI_UnregisterNatives_op, clazz)) - -/******************************************************************************* - * JRIEnv Interface - ******************************************************************************/ - -struct java_lang_ClassLoader; -struct java_lang_Class; -struct java_lang_Throwable; -struct java_lang_Object; -struct java_lang_String; - -struct JRIEnvInterface { - void* reserved0; - void* reserved1; - void* reserved2; - void* reserved3; - struct java_lang_Class* (*FindClass)(JRIEnv* env, jint op, const char* a); - void (*Throw)(JRIEnv* env, jint op, struct java_lang_Throwable* a); - void (*ThrowNew)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b); - struct java_lang_Throwable* (*ExceptionOccurred)(JRIEnv* env, jint op); - void (*ExceptionDescribe)(JRIEnv* env, jint op); - void (*ExceptionClear)(JRIEnv* env, jint op); - jglobal (*NewGlobalRef)(JRIEnv* env, jint op, void* a); - void (*DisposeGlobalRef)(JRIEnv* env, jint op, jglobal a); - void* (*GetGlobalRef)(JRIEnv* env, jint op, jglobal a); - void (*SetGlobalRef)(JRIEnv* env, jint op, jglobal a, void* b); - jbool (*IsSameObject)(JRIEnv* env, jint op, void* a, void* b); - void* (*NewObject)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...); - void* (*NewObjectV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c); - void* (*NewObjectA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c); - struct java_lang_Class* (*GetObjectClass)(JRIEnv* env, jint op, void* a); - jbool (*IsInstanceOf)(JRIEnv* env, jint op, void* a, struct java_lang_Class* b); - jint (*GetMethodID)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b, const char* c); - void* (*CallMethod)(JRIEnv* env, jint op, void* a, jint b, ...); - void* (*CallMethodV)(JRIEnv* env, jint op, void* a, jint b, va_list c); - void* (*CallMethodA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c); - jbool (*CallMethodBoolean)(JRIEnv* env, jint op, void* a, jint b, ...); - jbool (*CallMethodBooleanV)(JRIEnv* env, jint op, void* a, jint b, va_list c); - jbool (*CallMethodBooleanA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c); - jbyte (*CallMethodByte)(JRIEnv* env, jint op, void* a, jint b, ...); - jbyte (*CallMethodByteV)(JRIEnv* env, jint op, void* a, jint b, va_list c); - jbyte (*CallMethodByteA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c); - jchar (*CallMethodChar)(JRIEnv* env, jint op, void* a, jint b, ...); - jchar (*CallMethodCharV)(JRIEnv* env, jint op, void* a, jint b, va_list c); - jchar (*CallMethodCharA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c); - jshort (*CallMethodShort)(JRIEnv* env, jint op, void* a, jint b, ...); - jshort (*CallMethodShortV)(JRIEnv* env, jint op, void* a, jint b, va_list c); - jshort (*CallMethodShortA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c); - jint (*CallMethodInt)(JRIEnv* env, jint op, void* a, jint b, ...); - jint (*CallMethodIntV)(JRIEnv* env, jint op, void* a, jint b, va_list c); - jint (*CallMethodIntA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c); - jlong (*CallMethodLong)(JRIEnv* env, jint op, void* a, jint b, ...); - jlong (*CallMethodLongV)(JRIEnv* env, jint op, void* a, jint b, va_list c); - jlong (*CallMethodLongA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c); - jfloat (*CallMethodFloat)(JRIEnv* env, jint op, void* a, jint b, ...); - jfloat (*CallMethodFloatV)(JRIEnv* env, jint op, void* a, jint b, va_list c); - jfloat (*CallMethodFloatA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c); - jdouble (*CallMethodDouble)(JRIEnv* env, jint op, void* a, jint b, ...); - jdouble (*CallMethodDoubleV)(JRIEnv* env, jint op, void* a, jint b, va_list c); - jdouble (*CallMethodDoubleA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c); - jint (*GetFieldID)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b, const char* c); - void* (*GetField)(JRIEnv* env, jint op, void* a, jint b); - jbool (*GetFieldBoolean)(JRIEnv* env, jint op, void* a, jint b); - jbyte (*GetFieldByte)(JRIEnv* env, jint op, void* a, jint b); - jchar (*GetFieldChar)(JRIEnv* env, jint op, void* a, jint b); - jshort (*GetFieldShort)(JRIEnv* env, jint op, void* a, jint b); - jint (*GetFieldInt)(JRIEnv* env, jint op, void* a, jint b); - jlong (*GetFieldLong)(JRIEnv* env, jint op, void* a, jint b); - jfloat (*GetFieldFloat)(JRIEnv* env, jint op, void* a, jint b); - jdouble (*GetFieldDouble)(JRIEnv* env, jint op, void* a, jint b); - void (*SetField)(JRIEnv* env, jint op, void* a, jint b, void* c); - void (*SetFieldBoolean)(JRIEnv* env, jint op, void* a, jint b, jbool c); - void (*SetFieldByte)(JRIEnv* env, jint op, void* a, jint b, jbyte c); - void (*SetFieldChar)(JRIEnv* env, jint op, void* a, jint b, jchar c); - void (*SetFieldShort)(JRIEnv* env, jint op, void* a, jint b, jshort c); - void (*SetFieldInt)(JRIEnv* env, jint op, void* a, jint b, jint c); - void (*SetFieldLong)(JRIEnv* env, jint op, void* a, jint b, jlong c); - void (*SetFieldFloat)(JRIEnv* env, jint op, void* a, jint b, jfloat c); - void (*SetFieldDouble)(JRIEnv* env, jint op, void* a, jint b, jdouble c); - jbool (*IsSubclassOf)(JRIEnv* env, jint op, struct java_lang_Class* a, struct java_lang_Class* b); - jint (*GetStaticMethodID)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b, const char* c); - void* (*CallStaticMethod)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...); - void* (*CallStaticMethodV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c); - void* (*CallStaticMethodA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c); - jbool (*CallStaticMethodBoolean)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...); - jbool (*CallStaticMethodBooleanV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c); - jbool (*CallStaticMethodBooleanA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c); - jbyte (*CallStaticMethodByte)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...); - jbyte (*CallStaticMethodByteV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c); - jbyte (*CallStaticMethodByteA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c); - jchar (*CallStaticMethodChar)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...); - jchar (*CallStaticMethodCharV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c); - jchar (*CallStaticMethodCharA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c); - jshort (*CallStaticMethodShort)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...); - jshort (*CallStaticMethodShortV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c); - jshort (*CallStaticMethodShortA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c); - jint (*CallStaticMethodInt)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...); - jint (*CallStaticMethodIntV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c); - jint (*CallStaticMethodIntA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c); - jlong (*CallStaticMethodLong)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...); - jlong (*CallStaticMethodLongV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c); - jlong (*CallStaticMethodLongA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c); - jfloat (*CallStaticMethodFloat)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...); - jfloat (*CallStaticMethodFloatV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c); - jfloat (*CallStaticMethodFloatA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c); - jdouble (*CallStaticMethodDouble)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...); - jdouble (*CallStaticMethodDoubleV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c); - jdouble (*CallStaticMethodDoubleA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c); - jint (*GetStaticFieldID)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b, const char* c); - void* (*GetStaticField)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b); - jbool (*GetStaticFieldBoolean)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b); - jbyte (*GetStaticFieldByte)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b); - jchar (*GetStaticFieldChar)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b); - jshort (*GetStaticFieldShort)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b); - jint (*GetStaticFieldInt)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b); - jlong (*GetStaticFieldLong)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b); - jfloat (*GetStaticFieldFloat)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b); - jdouble (*GetStaticFieldDouble)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b); - void (*SetStaticField)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, void* c); - void (*SetStaticFieldBoolean)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jbool c); - void (*SetStaticFieldByte)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jbyte c); - void (*SetStaticFieldChar)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jchar c); - void (*SetStaticFieldShort)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jshort c); - void (*SetStaticFieldInt)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jint c); - void (*SetStaticFieldLong)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jlong c); - void (*SetStaticFieldFloat)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jfloat c); - void (*SetStaticFieldDouble)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jdouble c); - struct java_lang_String* (*NewString)(JRIEnv* env, jint op, const jchar* a, jint b); - jint (*GetStringLength)(JRIEnv* env, jint op, struct java_lang_String* a); - const jchar* (*GetStringChars)(JRIEnv* env, jint op, struct java_lang_String* a); - struct java_lang_String* (*NewStringUTF)(JRIEnv* env, jint op, const jbyte* a, jint b); - jint (*GetStringUTFLength)(JRIEnv* env, jint op, struct java_lang_String* a); - const jbyte* (*GetStringUTFChars)(JRIEnv* env, jint op, struct java_lang_String* a); - void* (*NewScalarArray)(JRIEnv* env, jint op, jint a, const char* b, const jbyte* c); - jint (*GetScalarArrayLength)(JRIEnv* env, jint op, void* a); - jbyte* (*GetScalarArrayElements)(JRIEnv* env, jint op, void* a); - void* (*NewObjectArray)(JRIEnv* env, jint op, jint a, struct java_lang_Class* b, void* c); - jint (*GetObjectArrayLength)(JRIEnv* env, jint op, void* a); - void* (*GetObjectArrayElement)(JRIEnv* env, jint op, void* a, jint b); - void (*SetObjectArrayElement)(JRIEnv* env, jint op, void* a, jint b, void* c); - void (*RegisterNatives)(JRIEnv* env, jint op, struct java_lang_Class* a, char** b, void** c); - void (*UnregisterNatives)(JRIEnv* env, jint op, struct java_lang_Class* a); - struct java_lang_Class* (*DefineClass)(JRIEnv* env, jint op, struct java_lang_ClassLoader* a, jbyte* b, jsize bLen); -}; - -/******************************************************************************* - * JRIEnv Operation IDs - ******************************************************************************/ - -typedef enum JRIEnvOperations { - JRI_Reserved0_op, - JRI_Reserved1_op, - JRI_Reserved2_op, - JRI_Reserved3_op, - JRI_FindClass_op, - JRI_Throw_op, - JRI_ThrowNew_op, - JRI_ExceptionOccurred_op, - JRI_ExceptionDescribe_op, - JRI_ExceptionClear_op, - JRI_NewGlobalRef_op, - JRI_DisposeGlobalRef_op, - JRI_GetGlobalRef_op, - JRI_SetGlobalRef_op, - JRI_IsSameObject_op, - JRI_NewObject_op, - JRI_NewObject_op_va_list, - JRI_NewObject_op_array, - JRI_GetObjectClass_op, - JRI_IsInstanceOf_op, - JRI_GetMethodID_op, - JRI_CallMethod_op, - JRI_CallMethod_op_va_list, - JRI_CallMethod_op_array, - JRI_CallMethodBoolean_op, - JRI_CallMethodBoolean_op_va_list, - JRI_CallMethodBoolean_op_array, - JRI_CallMethodByte_op, - JRI_CallMethodByte_op_va_list, - JRI_CallMethodByte_op_array, - JRI_CallMethodChar_op, - JRI_CallMethodChar_op_va_list, - JRI_CallMethodChar_op_array, - JRI_CallMethodShort_op, - JRI_CallMethodShort_op_va_list, - JRI_CallMethodShort_op_array, - JRI_CallMethodInt_op, - JRI_CallMethodInt_op_va_list, - JRI_CallMethodInt_op_array, - JRI_CallMethodLong_op, - JRI_CallMethodLong_op_va_list, - JRI_CallMethodLong_op_array, - JRI_CallMethodFloat_op, - JRI_CallMethodFloat_op_va_list, - JRI_CallMethodFloat_op_array, - JRI_CallMethodDouble_op, - JRI_CallMethodDouble_op_va_list, - JRI_CallMethodDouble_op_array, - JRI_GetFieldID_op, - JRI_GetField_op, - JRI_GetFieldBoolean_op, - JRI_GetFieldByte_op, - JRI_GetFieldChar_op, - JRI_GetFieldShort_op, - JRI_GetFieldInt_op, - JRI_GetFieldLong_op, - JRI_GetFieldFloat_op, - JRI_GetFieldDouble_op, - JRI_SetField_op, - JRI_SetFieldBoolean_op, - JRI_SetFieldByte_op, - JRI_SetFieldChar_op, - JRI_SetFieldShort_op, - JRI_SetFieldInt_op, - JRI_SetFieldLong_op, - JRI_SetFieldFloat_op, - JRI_SetFieldDouble_op, - JRI_IsSubclassOf_op, - JRI_GetStaticMethodID_op, - JRI_CallStaticMethod_op, - JRI_CallStaticMethod_op_va_list, - JRI_CallStaticMethod_op_array, - JRI_CallStaticMethodBoolean_op, - JRI_CallStaticMethodBoolean_op_va_list, - JRI_CallStaticMethodBoolean_op_array, - JRI_CallStaticMethodByte_op, - JRI_CallStaticMethodByte_op_va_list, - JRI_CallStaticMethodByte_op_array, - JRI_CallStaticMethodChar_op, - JRI_CallStaticMethodChar_op_va_list, - JRI_CallStaticMethodChar_op_array, - JRI_CallStaticMethodShort_op, - JRI_CallStaticMethodShort_op_va_list, - JRI_CallStaticMethodShort_op_array, - JRI_CallStaticMethodInt_op, - JRI_CallStaticMethodInt_op_va_list, - JRI_CallStaticMethodInt_op_array, - JRI_CallStaticMethodLong_op, - JRI_CallStaticMethodLong_op_va_list, - JRI_CallStaticMethodLong_op_array, - JRI_CallStaticMethodFloat_op, - JRI_CallStaticMethodFloat_op_va_list, - JRI_CallStaticMethodFloat_op_array, - JRI_CallStaticMethodDouble_op, - JRI_CallStaticMethodDouble_op_va_list, - JRI_CallStaticMethodDouble_op_array, - JRI_GetStaticFieldID_op, - JRI_GetStaticField_op, - JRI_GetStaticFieldBoolean_op, - JRI_GetStaticFieldByte_op, - JRI_GetStaticFieldChar_op, - JRI_GetStaticFieldShort_op, - JRI_GetStaticFieldInt_op, - JRI_GetStaticFieldLong_op, - JRI_GetStaticFieldFloat_op, - JRI_GetStaticFieldDouble_op, - JRI_SetStaticField_op, - JRI_SetStaticFieldBoolean_op, - JRI_SetStaticFieldByte_op, - JRI_SetStaticFieldChar_op, - JRI_SetStaticFieldShort_op, - JRI_SetStaticFieldInt_op, - JRI_SetStaticFieldLong_op, - JRI_SetStaticFieldFloat_op, - JRI_SetStaticFieldDouble_op, - JRI_NewString_op, - JRI_GetStringLength_op, - JRI_GetStringChars_op, - JRI_NewStringUTF_op, - JRI_GetStringUTFLength_op, - JRI_GetStringUTFChars_op, - JRI_NewScalarArray_op, - JRI_GetScalarArrayLength_op, - JRI_GetScalarArrayElements_op, - JRI_NewObjectArray_op, - JRI_GetObjectArrayLength_op, - JRI_GetObjectArrayElement_op, - JRI_SetObjectArrayElement_op, - JRI_RegisterNatives_op, - JRI_UnregisterNatives_op, - JRI_DefineClass_op -} JRIEnvOperations; - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - -#endif /* JRI_H */ -/******************************************************************************/ diff --git a/mozilla/java/waterfall/wf/src/plugin/netscape4/jri_md.h b/mozilla/java/waterfall/wf/src/plugin/netscape4/jri_md.h deleted file mode 100644 index eb05810844d..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/netscape4/jri_md.h +++ /dev/null @@ -1,196 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: jri_md.h,v 1.1.1.1 2001-05-09 17:30:09 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* -*- Mode: C; tab-width: 4; -*- */ -/******************************************************************************* - * Java Runtime Interface - Machine Dependent Types - * Copyright (c) 1996 Netscape Communications Corporation. All rights reserved. - ******************************************************************************/ - -#ifndef JRI_MD_H -#define JRI_MD_H - -#include -#include "jni.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/******************************************************************************* - * WHAT'S UP WITH THIS FILE? - * - * This is where we define the mystical JRI_PUBLIC_API macro that works on all - * platforms. If you're running with Visual C++, Symantec C, or Borland's - * development environment on the PC, you're all set. Or if you're on the Mac - * with Metrowerks, Symantec or MPW with SC you're ok too. For UNIX it shouldn't - * matter. - * - * On UNIX though you probably care about a couple of other symbols though: - * IS_LITTLE_ENDIAN must be defined for little-endian systems - * HAVE_LONG_LONG must be defined on systems that have 'long long' integers - * HAVE_ALIGNED_LONGLONGS must be defined if long-longs must be 8 byte aligned - * HAVE_ALIGNED_DOUBLES must be defined if doubles must be 8 byte aligned - * IS_64 must be defined on 64-bit machines (like Dec Alpha) - ******************************************************************************/ - -/* DLL Entry modifiers... */ - -/* PC */ -#if defined(XP_PC) || defined(_WINDOWS) || defined(WIN32) || defined(_WIN32) -# include -# if defined(_MSC_VER) -# if defined(WIN32) || defined(_WIN32) -# define JRI_PUBLIC_API(ResultType) _declspec(dllexport) ResultType -# define JRI_CALLBACK -# else /* !_WIN32 */ -# if defined(_WINDLL) -# define JRI_PUBLIC_API(ResultType) ResultType __cdecl __export __loadds -# define JRI_CALLBACK __loadds -# else /* !WINDLL */ -# define JRI_PUBLIC_API(ResultType) ResultType __cdecl __export -# define JRI_CALLBACK __export -# endif /* !WINDLL */ -# endif /* !_WIN32 */ -# elif defined(__BORLANDC__) -# if defined(WIN32) || defined(_WIN32) -# define JRI_PUBLIC_API(ResultType) __export ResultType -# define JRI_CALLBACK -# else /* !_WIN32 */ -# define JRI_PUBLIC_API(ResultType) ResultType _cdecl _export _loadds -# define JRI_CALLBACK _loadds -# endif -# else -# error Unsupported PC development environment. -# endif -# ifndef IS_LITTLE_ENDIAN -# define IS_LITTLE_ENDIAN -# endif - -/* Mac */ -#elif macintosh || Macintosh || THINK_C -# if defined(__MWERKS__) /* Metrowerks */ -# if !__option(enumsalwaysint) -# error You need to define 'Enums Always Int' for your project. -# endif -# if defined(GENERATING68K) && !GENERATINGCFM -# if !__option(fourbyteints) -# error You need to define 'Struct Alignment: 68k' for your project. -# endif -# endif /* !GENERATINGCFM */ -# elif defined(__SC__) /* Symantec */ -# error What are the Symantec defines? (warren@netscape.com) -# elif macintosh && applec /* MPW */ -# error Please upgrade to the latest MPW compiler (SC). -# else -# error Unsupported Mac development environment. -# endif -# define JRI_PUBLIC_API(ResultType) ResultType -# define JRI_CALLBACK - -/* Unix or else */ -#else -# define JRI_PUBLIC_API(ResultType) ResultType -# define JRI_CALLBACK -#endif - -#ifndef FAR /* for non-Win16 */ -#define FAR -#endif - -/******************************************************************************/ - -/* Java Scalar Types */ - -typedef unsigned char jbool; -#ifdef IS_64 /* XXX ok for alpha, but not right on all 64-bit architectures */ -typedef unsigned int juint; -typedef int jint; -#else -typedef unsigned long juint; -#endif - - -/******************************************************************************/ -/* -** JDK Stuff -- This stuff is still needed while we're using the JDK -** dynamic linking strategy to call native methods. -*/ - -typedef union JRI_JDK_stack_item { - /* Non pointer items */ - jint i; - jfloat f; - jint o; - /* Pointer items */ - void *h; - void *p; - unsigned char *addr; -#ifdef IS_64 - double d; - long l; /* == 64bits! */ -#endif -} JRI_JDK_stack_item; - -typedef union JRI_JDK_Java8Str { - jint x[2]; - jdouble d; - jlong l; - void *p; - float f; -} JRI_JDK_Java8; - -#ifdef HAVE_ALIGNED_LONGLONGS -#define JRI_GET_INT64(_t,_addr) ( ((_t).x[0] = ((jint*)(_addr))[0]), \ - ((_t).x[1] = ((jint*)(_addr))[1]), \ - (_t).l ) -#define JRI_SET_INT64(_t, _addr, _v) ( (_t).l = (_v), \ - ((jint*)(_addr))[0] = (_t).x[0], \ - ((jint*)(_addr))[1] = (_t).x[1] ) -#else -#define JRI_GET_INT64(_t,_addr) (*(jlong*)(_addr)) -#define JRI_SET_INT64(_t, _addr, _v) (*(jlong*)(_addr) = (_v)) -#endif - -/* If double's must be aligned on doubleword boundaries then define this */ -#ifdef HAVE_ALIGNED_DOUBLES -#define JRI_GET_DOUBLE(_t,_addr) ( ((_t).x[0] = ((jint*)(_addr))[0]), \ - ((_t).x[1] = ((jint*)(_addr))[1]), \ - (_t).d ) -#define JRI_SET_DOUBLE(_t, _addr, _v) ( (_t).d = (_v), \ - ((jint*)(_addr))[0] = (_t).x[0], \ - ((jint*)(_addr))[1] = (_t).x[1] ) -#else -#define JRI_GET_DOUBLE(_t,_addr) (*(jdouble*)(_addr)) -#define JRI_SET_DOUBLE(_t, _addr, _v) (*(jdouble*)(_addr) = (_v)) -#endif - -/******************************************************************************/ -#ifdef __cplusplus -} -#endif -#endif /* JRI_MD_H */ -/******************************************************************************/ diff --git a/mozilla/java/waterfall/wf/src/plugin/netscape4/jritypes.h b/mozilla/java/waterfall/wf/src/plugin/netscape4/jritypes.h deleted file mode 100644 index ea4468bbd5f..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/netscape4/jritypes.h +++ /dev/null @@ -1,193 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: jritypes.h,v 1.1.1.1 2001-05-09 17:30:09 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* -*- Mode: C; tab-width: 4; -*- */ -/******************************************************************************* - * Java Runtime Interface - * Copyright (c) 1996 Netscape Communications Corporation. All rights reserved. - ******************************************************************************/ - -#ifndef JRITYPES_H -#define JRITYPES_H - -#include "jri_md.h" -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/******************************************************************************* - * Types - ******************************************************************************/ - -struct JRIEnvInterface; - -typedef void* JRIRef; -typedef void* JRIGlobalRef; - -typedef jint JRIInterfaceID[4]; -typedef jint JRIFieldID; -typedef jint JRIMethodID; - -/* synonyms: */ -typedef JRIGlobalRef jglobal; -typedef JRIRef jref; - -typedef union JRIValue { - jbool z; - jbyte b; - jchar c; - jshort s; - jint i; - jlong l; - jfloat f; - jdouble d; - jref r; -} JRIValue; - - -typedef enum JRIBoolean { - JRIFalse = 0, - JRITrue = 1 -} JRIBoolean; - -typedef enum JRIConstant { - JRIUninitialized = -1 -} JRIConstant; - -/* convenience types: */ -#define JRIConstructorMethodName "" - -/******************************************************************************* - * Signature Construction Macros - ******************************************************************************/ - -/* -** These macros can be used to construct signature strings. Hopefully their names -** are a little easier to remember than the single character they correspond to. -** For example, to specify the signature of the method: -** -** public int read(byte b[], int off, int len); -** -** you could write something like this in C: -** -** char* readSig = JRISigMethod(JRISigArray(JRISigByte) -** JRISigInt -** JRISigInt) JRISigInt; -** -** Of course, don't put commas between the types. -*/ -#define JRISigArray(T) "[" T -#define JRISigByte "B" -#define JRISigChar "C" -#define JRISigClass(name) "L" name ";" -#define JRISigFloat "F" -#define JRISigDouble "D" -#define JRISigMethod(args) "(" args ")" -#define JRISigNoArgs "" -#define JRISigInt "I" -#define JRISigLong "J" -#define JRISigShort "S" -#define JRISigVoid "V" -#define JRISigBoolean "Z" - -/******************************************************************************* - * Environments - ******************************************************************************/ - -extern JRI_PUBLIC_API(const struct JRIEnvInterface**) -JRI_GetCurrentEnv(void); - -/******************************************************************************* - * Specific Scalar Array Types - ******************************************************************************/ - -/* -** The JRI Native Method Interface does not support boolean arrays. This -** is to allow Java runtime implementations to optimize boolean array -** storage. Using the ScalarArray operations on boolean arrays is bound -** to fail, so convert any boolean arrays to byte arrays in Java before -** passing them to a native method. -*/ - -#define JRI_NewByteArray(env, length, initialValues) \ - JRI_NewScalarArray(env, length, JRISigByte, (jbyte*)(initialValues)) -#define JRI_GetByteArrayLength(env, array) \ - JRI_GetScalarArrayLength(env, array) -#define JRI_GetByteArrayElements(env, array) \ - JRI_GetScalarArrayElements(env, array) - -#define JRI_NewCharArray(env, length, initialValues) \ - JRI_NewScalarArray(env, ((length) * sizeof(jchar)), JRISigChar, (jbyte*)(initialValues)) -#define JRI_GetCharArrayLength(env, array) \ - JRI_GetScalarArrayLength(env, array) -#define JRI_GetCharArrayElements(env, array) \ - ((jchar*)JRI_GetScalarArrayElements(env, array)) - -#define JRI_NewShortArray(env, length, initialValues) \ - JRI_NewScalarArray(env, ((length) * sizeof(jshort)), JRISigShort, (jbyte*)(initialValues)) -#define JRI_GetShortArrayLength(env, array) \ - JRI_GetScalarArrayLength(env, array) -#define JRI_GetShortArrayElements(env, array) \ - ((jshort*)JRI_GetScalarArrayElements(env, array)) - -#define JRI_NewIntArray(env, length, initialValues) \ - JRI_NewScalarArray(env, ((length) * sizeof(jint)), JRISigInt, (jbyte*)(initialValues)) -#define JRI_GetIntArrayLength(env, array) \ - JRI_GetScalarArrayLength(env, array) -#define JRI_GetIntArrayElements(env, array) \ - ((jint*)JRI_GetScalarArrayElements(env, array)) - -#define JRI_NewLongArray(env, length, initialValues) \ - JRI_NewScalarArray(env, ((length) * sizeof(jlong)), JRISigLong, (jbyte*)(initialValues)) -#define JRI_GetLongArrayLength(env, array) \ - JRI_GetScalarArrayLength(env, array) -#define JRI_GetLongArrayElements(env, array) \ - ((jlong*)JRI_GetScalarArrayElements(env, array)) - -#define JRI_NewFloatArray(env, length, initialValues) \ - JRI_NewScalarArray(env, ((length) * sizeof(jfloat)), JRISigFloat, (jbyte*)(initialValues)) -#define JRI_GetFloatArrayLength(env, array) \ - JRI_GetScalarArrayLength(env, array) -#define JRI_GetFloatArrayElements(env, array) \ - ((jfloat*)JRI_GetScalarArrayElements(env, array)) - -#define JRI_NewDoubleArray(env, length, initialValues) \ - JRI_NewScalarArray(env, ((length) * sizeof(jdouble)), JRISigDouble, (jbyte*)(initialValues)) -#define JRI_GetDoubleArrayLength(env, array) \ - JRI_GetScalarArrayLength(env, array) -#define JRI_GetDoubleArrayElements(env, array) \ - ((jdouble*)JRI_GetScalarArrayElements(env, array)) - -/******************************************************************************/ -#ifdef __cplusplus -} -#endif -#endif /* JRITYPES_H */ -/******************************************************************************/ diff --git a/mozilla/java/waterfall/wf/src/plugin/netscape4/npapi.h b/mozilla/java/waterfall/wf/src/plugin/netscape4/npapi.h deleted file mode 100644 index e2c982b53da..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/netscape4/npapi.h +++ /dev/null @@ -1,438 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: npapi.h,v 1.1.1.1 2001-05-09 17:30:09 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* -*- Mode: C; tab-width: 4; -*- */ -/* - * npapi.h $Revision: 1.1.1.1 $ - * Netscape client plug-in API spec - */ - -#ifndef _NPAPI_H_ -#define _NPAPI_H_ - -#ifdef _WINDOWS -# ifndef XP_PC -# define XP_PC 1 -# endif /* XP_PC */ -#endif /* _WINDOWS */ - -#ifdef __MWERKS__ -# define _declspec __declspec -# ifdef macintosh -# ifndef XP_MAC -# define XP_MAC 1 -# endif /* XP_MAC */ -# endif /* macintosh */ -# ifdef __INTEL__ -# undef NULL -# ifndef XP_PC -# define XP_PC 1 -# endif /* __INTEL__ */ -# endif /* XP_PC */ -#endif /* __MWERKS__ */ - -#include "jri.h" /* Java Runtime Interface */ - - -/*----------------------------------------------------------------------*/ -/* Plugin Version Constants */ -/*----------------------------------------------------------------------*/ - -#define NP_VERSION_MAJOR 0 -#define NP_VERSION_MINOR 9 - - - -/*----------------------------------------------------------------------*/ -/* Definition of Basic Types */ -/*----------------------------------------------------------------------*/ - -#ifndef _UINT16 -typedef unsigned short uint16; -#endif -#ifndef _UINT32 -#if defined(__alpha) -typedef unsigned int uint32; -#else /* __alpha */ -typedef unsigned long uint32; -#endif /* __alpha */ -#endif -#ifndef _INT16 -typedef short int16; -#endif -#ifndef _INT32 -#if defined(__alpha) -typedef int int32; -#else /* __alpha */ -typedef long int32; -#endif /* __alpha */ -#endif - -#ifndef FALSE -#define FALSE (0) -#endif -#ifndef TRUE -#define TRUE (1) -#endif -#ifndef NULL -#define NULL (0L) -#endif - -typedef unsigned char NPBool; -typedef void* NPEvent; -typedef int16 NPError; -typedef int16 NPReason; -typedef char* NPMIMEType; - - - -/*----------------------------------------------------------------------*/ -/* Structures and definitions */ -/*----------------------------------------------------------------------*/ - -/* - * NPP is a plug-in's opaque instance handle - */ -typedef struct _NPP -{ - void* pdata; /* plug-in private data */ - void* ndata; /* netscape private data */ -} NPP_t; - -typedef NPP_t* NPP; - - -typedef struct _NPStream -{ - void* pdata; /* plug-in private data */ - void* ndata; /* netscape private data */ - const char* url; - uint32 end; - uint32 lastmodified; - void* notifyData; -} NPStream; - - -typedef struct _NPByteRange -{ - int32 offset; /* negative offset means from the end */ - uint32 length; - struct _NPByteRange* next; -} NPByteRange; - - -typedef struct _NPSavedData -{ - int32 len; - void* buf; -} NPSavedData; - - -typedef struct _NPRect -{ - uint16 top; - uint16 left; - uint16 bottom; - uint16 right; -} NPRect; - - -#ifdef XP_UNIX -/* - * Unix specific structures and definitions - */ -#include - -/* - * Callback Structures. - * - * These are used to pass additional platform specific information. - */ -enum { - NP_SETWINDOW = 1, - NP_PRINT -}; - -typedef struct -{ - int32 type; -} NPAnyCallbackStruct; - -typedef struct -{ - int32 type; - Display* display; - Visual* visual; - Colormap colormap; - unsigned int depth; -} NPSetWindowCallbackStruct; - -typedef struct -{ - int32 type; - FILE* fp; -} NPPrintCallbackStruct; - -/* - * List of variable names for which NPP_GetValue shall be implemented - */ -typedef enum { - NPPVpluginNameString = 1, - NPPVpluginDescriptionString -} NPPVariable; - -/* - * List of variable names for which NPN_GetValue is implemented by Mozilla - */ -typedef enum { - NPNVxDisplay = 1, - NPNVxtAppContext -} NPNVariable; - -#endif /* XP_UNIX */ - - -typedef struct _NPWindow -{ - void* window; /* Platform specific window handle */ - uint32 x; /* Position of top left corner relative */ - uint32 y; /* to a netscape page. */ - uint32 width; /* Maximum window size */ - uint32 height; - NPRect clipRect; /* Clipping rectangle in port coordinates */ - /* Used by MAC only. */ -#ifdef XP_UNIX - void * ws_info; /* Platform-dependent additonal data */ -#endif /* XP_UNIX */ -} NPWindow; - - -typedef struct _NPFullPrint -{ - NPBool pluginPrinted; /* Set TRUE if plugin handled fullscreen */ - /* printing */ - NPBool printOne; /* TRUE if plugin should print one copy */ - /* to default printer */ - void* platformPrint; /* Platform-specific printing info */ -} NPFullPrint; - -typedef struct _NPEmbedPrint -{ - NPWindow window; - void* platformPrint; /* Platform-specific printing info */ -} NPEmbedPrint; - -typedef struct _NPPrint -{ - uint16 mode; /* NP_FULL or NP_EMBED */ - union - { - NPFullPrint fullPrint; /* if mode is NP_FULL */ - NPEmbedPrint embedPrint; /* if mode is NP_EMBED */ - } print; -} NPPrint; - - -#ifdef XP_MAC -/* - * Mac-specific structures and definitions. - */ - -#include -#include - -typedef struct NP_Port -{ - CGrafPtr port; /* Grafport */ - int32 portx; /* position inside the topmost window */ - int32 porty; -} NP_Port; - -/* - * Non-standard event types that can be passed to HandleEvent - */ -#define getFocusEvent (osEvt + 16) -#define loseFocusEvent (osEvt + 17) -#define adjustCursorEvent (osEvt + 18) - -#endif /* XP_MAC */ - - -/* - * Values for mode passed to NPP_New: - */ -#define NP_EMBED 1 -#define NP_FULL 2 - -/* - * Values for stream type passed to NPP_NewStream: - */ -#define NP_NORMAL 1 -#define NP_SEEK 2 -#define NP_ASFILE 3 -#define NP_ASFILEONLY 4 - -#define NP_MAXREADY (((unsigned)(~0)<<1)>>1) - - - -/*----------------------------------------------------------------------*/ -/* Error and Reason Code definitions */ -/*----------------------------------------------------------------------*/ - -/* - * Values of type NPError: - */ -#define NPERR_BASE 0 -#define NPERR_NO_ERROR (NPERR_BASE + 0) -#define NPERR_GENERIC_ERROR (NPERR_BASE + 1) -#define NPERR_INVALID_INSTANCE_ERROR (NPERR_BASE + 2) -#define NPERR_INVALID_FUNCTABLE_ERROR (NPERR_BASE + 3) -#define NPERR_MODULE_LOAD_FAILED_ERROR (NPERR_BASE + 4) -#define NPERR_OUT_OF_MEMORY_ERROR (NPERR_BASE + 5) -#define NPERR_INVALID_PLUGIN_ERROR (NPERR_BASE + 6) -#define NPERR_INVALID_PLUGIN_DIR_ERROR (NPERR_BASE + 7) -#define NPERR_INCOMPATIBLE_VERSION_ERROR (NPERR_BASE + 8) -#define NPERR_INVALID_PARAM (NPERR_BASE + 9) -#define NPERR_INVALID_URL (NPERR_BASE + 10) -#define NPERR_FILE_NOT_FOUND (NPERR_BASE + 11) -#define NPERR_NO_DATA (NPERR_BASE + 12) -#define NPERR_STREAM_NOT_SEEKABLE (NPERR_BASE + 13) - -/* - * Values of type NPReason: - */ -#define NPRES_BASE 0 -#define NPRES_DONE (NPRES_BASE + 0) -#define NPRES_NETWORK_ERR (NPRES_BASE + 1) -#define NPRES_USER_BREAK (NPRES_BASE + 2) - -/* - * Don't use these obsolete error codes any more. - */ -#define NP_NOERR NP_NOERR_is_obsolete_use_NPERR_NO_ERROR -#define NP_EINVAL NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR -#define NP_EABORT NP_EABORT_is_obsolete_use_NPRES_USER_BREAK - -/* - * Version feature information - */ -#define NPVERS_HAS_STREAMOUTPUT 8 -#define NPVERS_HAS_NOTIFICATION 9 -#define NPVERS_HAS_LIVECONNECT 9 -#define NPVERS_WIN16_HAS_LIVECONNECT 10 - - -/*----------------------------------------------------------------------*/ -/* Function Prototypes */ -/*----------------------------------------------------------------------*/ - -#if defined(_WINDOWS) && !defined(WIN32) -#define NP_LOADDS _loadds -#else -#define NP_LOADDS -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * NPP_* functions are provided by the plugin and called by the navigator. - */ - -#ifdef XP_UNIX -char* NPP_GetMIMEDescription(void); -NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value); -NPError NPN_SetValue(void* foo, void *val, void* value); -#endif /* XP_UNIX */ -NPError NPP_Initialize(void); -void NPP_Shutdown(void); -NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance, - uint16 mode, int16 argc, char* argn[], - char* argv[], NPSavedData* saved); -NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save); -NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window); -NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type, - NPStream* stream, NPBool seekable, - uint16* stype); -NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream, - NPReason reason); -int32 NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream); -int32 NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32 offset, - int32 len, void* buffer); -void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream, - const char* fname); -void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint); -int16 NP_LOADDS NPP_HandleEvent(NPP instance, void* event); -void NP_LOADDS NPP_URLNotify(NPP instance, const char* url, - NPReason reason, void* notifyData); -jref NP_LOADDS NPP_GetJavaClass(void); - - -/* - * NPN_* functions are provided by the navigator and called by the plugin. - */ - -#ifdef XP_UNIX -NPError NPN_GetValue(NPP instance, NPNVariable variable, - void *value); -#endif /* XP_UNIX */ -void NPN_Version(int* plugin_major, int* plugin_minor, - int* netscape_major, int* netscape_minor); -NPError NPN_GetURLNotify(NPP instance, const char* url, - const char* target, void* notifyData); -NPError NPN_GetURL(NPP instance, const char* url, - const char* target); -NPError NPN_PostURLNotify(NPP instance, const char* url, - const char* target, uint32 len, - const char* buf, NPBool file, - void* notifyData); -NPError NPN_PostURL(NPP instance, const char* url, - const char* target, uint32 len, - const char* buf, NPBool file); -NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList); -NPError NPN_NewStream(NPP instance, NPMIMEType type, - const char* target, NPStream** stream); -int32 NPN_Write(NPP instance, NPStream* stream, int32 len, - void* buffer); -NPError NPN_DestroyStream(NPP instance, NPStream* stream, - NPReason reason); -void NPN_Status(NPP instance, const char* message); -const char* NPN_UserAgent(NPP instance); -void* NPN_MemAlloc(uint32 size); -void NPN_MemFree(void* ptr); -uint32 NPN_MemFlush(uint32 size); -void NPN_ReloadPlugins(NPBool reloadPages); -JRIEnv* NPN_GetJavaEnv(void); -jref NPN_GetJavaPeer(NPP instance); - - -#ifdef __cplusplus -} /* end extern "C" */ -#endif - -#endif /* _NPAPI_H_ */ diff --git a/mozilla/java/waterfall/wf/src/plugin/netscape4/npapi.h.my b/mozilla/java/waterfall/wf/src/plugin/netscape4/npapi.h.my deleted file mode 100644 index 9181669bd62..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/netscape4/npapi.h.my +++ /dev/null @@ -1,420 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: npapi.h.my,v 1.1.1.1 2001-05-09 17:30:10 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* -*- Mode: C; tab-width: 4; -*- */ -/* - * npapi.h $Revision: 1.1.1.1 $ - * Netscape client plug-in API spec - */ - -#ifndef _NPAPI_H_ -#define _NPAPI_H_ - -/*#include "jri.h" */ /* Java Runtime Interface */ - - -/* XXX this needs to get out of here */ -#if defined(__MWERKS__) -#ifndef XP_MAC -#define XP_MAC -#endif -#endif - - - -/*----------------------------------------------------------------------*/ -/* Plugin Version Constants */ -/*----------------------------------------------------------------------*/ - -#define NP_VERSION_MAJOR 0 -#define NP_VERSION_MINOR 9 - - - -/*----------------------------------------------------------------------*/ -/* Definition of Basic Types */ -/*----------------------------------------------------------------------*/ - -#ifndef _UINT16 -typedef unsigned short uint16; -#endif -#ifndef _UINT32 -#if defined(__alpha) -typedef unsigned int uint32; -#else /* __alpha */ -typedef unsigned long uint32; -#endif /* __alpha */ -#endif -#ifndef _INT16 -typedef short int16; -#endif -#ifndef _INT32 -#if defined(__alpha) -typedef int int32; -#else /* __alpha */ -typedef long int32; -#endif /* __alpha */ -#endif - -#ifndef FALSE -#define FALSE (0) -#endif -#ifndef TRUE -#define TRUE (1) -#endif -#ifndef NULL -#define NULL (0L) -#endif - -typedef unsigned char NPBool; -typedef void* NPEvent; -typedef int16 NPError; -typedef int16 NPReason; -typedef char* NPMIMEType; - - - -/*----------------------------------------------------------------------*/ -/* Structures and definitions */ -/*----------------------------------------------------------------------*/ - -/* - * NPP is a plug-in's opaque instance handle - */ -typedef struct _NPP -{ - void* pdata; /* plug-in private data */ - void* ndata; /* netscape private data */ -} NPP_t; - -typedef NPP_t* NPP; - - -typedef struct _NPStream -{ - void* pdata; /* plug-in private data */ - void* ndata; /* netscape private data */ - const char* url; - uint32 end; - uint32 lastmodified; - void* notifyData; -} NPStream; - - -typedef struct _NPByteRange -{ - int32 offset; /* negative offset means from the end */ - uint32 length; - struct _NPByteRange* next; -} NPByteRange; - - -typedef struct _NPSavedData -{ - int32 len; - void* buf; -} NPSavedData; - - -typedef struct _NPRect -{ - uint16 top; - uint16 left; - uint16 bottom; - uint16 right; -} NPRect; - - -#ifdef XP_UNIX -/* - * Unix specific structures and definitions - */ -#include - -/* - * Callback Structures. - * - * These are used to pass additional platform specific information. - */ -enum { - NP_SETWINDOW = 1 -}; - -typedef struct -{ - int32 type; -} NPAnyCallbackStruct; - -typedef struct -{ - int32 type; - Display* display; - Visual* visual; - Colormap colormap; - unsigned int depth; -} NPSetWindowCallbackStruct; - -/* - * List of variable names for which NPP_GetValue shall be implemented - */ -typedef enum { - NPPVpluginNameString = 1, - NPPVpluginDescriptionString -} NPPVariable; - -/* - * List of variable names for which NPN_GetValue is implemented by Mozilla - */ -typedef enum { - NPNVxDisplay = 1, - NPNVxtAppContext -} NPNVariable; - -#endif /* XP_UNIX */ - - -typedef struct _NPWindow -{ - void* window; /* Platform specific window handle */ - uint32 x; /* Position of top left corner relative */ - uint32 y; /* to a netscape page. */ - uint32 width; /* Maximum window size */ - uint32 height; - NPRect clipRect; /* Clipping rectangle in port coordinates */ - /* Used by MAC only. */ -#ifdef XP_UNIX - void * ws_info; /* Platform-dependent additonal data */ -#endif /* XP_UNIX */ -} NPWindow; - - -typedef struct _NPFullPrint -{ - NPBool pluginPrinted; /* Set TRUE if plugin handled fullscreen */ - /* printing */ - NPBool printOne; /* TRUE if plugin should print one copy */ - /* to default printer */ - void* platformPrint; /* Platform-specific printing info */ -} NPFullPrint; - -typedef struct _NPEmbedPrint -{ - NPWindow window; - void* platformPrint; /* Platform-specific printing info */ -} NPEmbedPrint; - -typedef struct _NPPrint -{ - uint16 mode; /* NP_FULL or NP_EMBED */ - union - { - NPFullPrint fullPrint; /* if mode is NP_FULL */ - NPEmbedPrint embedPrint; /* if mode is NP_EMBED */ - } print; -} NPPrint; - - -#ifdef XP_MAC -/* - * Mac-specific structures and definitions. - */ - -#include -#include - -typedef struct NP_Port -{ - CGrafPtr port; /* Grafport */ - int32 portx; /* position inside the topmost window */ - int32 porty; -} NP_Port; - -/* - * Non-standard event types that can be passed to HandleEvent - */ -#define getFocusEvent (osEvt + 16) -#define loseFocusEvent (osEvt + 17) -#define adjustCursorEvent (osEvt + 18) - -#endif /* XP_MAC */ - - -/* - * Values for mode passed to NPP_New: - */ -#define NP_EMBED 1 -#define NP_FULL 2 - -/* - * Values for stream type passed to NPP_NewStream: - */ -#define NP_NORMAL 1 -#define NP_SEEK 2 -#define NP_ASFILE 3 -#define NP_ASFILEONLY 4 - -#define NP_MAXREADY (((unsigned)(~0)<<1)>>1) - - - -/*----------------------------------------------------------------------*/ -/* Error and Reason Code definitions */ -/*----------------------------------------------------------------------*/ - -/* - * Values of type NPError: - */ -#define NPERR_BASE 0 -#define NPERR_NO_ERROR (NPERR_BASE + 0) -#define NPERR_GENERIC_ERROR (NPERR_BASE + 1) -#define NPERR_INVALID_INSTANCE_ERROR (NPERR_BASE + 2) -#define NPERR_INVALID_FUNCTABLE_ERROR (NPERR_BASE + 3) -#define NPERR_MODULE_LOAD_FAILED_ERROR (NPERR_BASE + 4) -#define NPERR_OUT_OF_MEMORY_ERROR (NPERR_BASE + 5) -#define NPERR_INVALID_PLUGIN_ERROR (NPERR_BASE + 6) -#define NPERR_INVALID_PLUGIN_DIR_ERROR (NPERR_BASE + 7) -#define NPERR_INCOMPATIBLE_VERSION_ERROR (NPERR_BASE + 8) -#define NPERR_INVALID_PARAM (NPERR_BASE + 9) -#define NPERR_INVALID_URL (NPERR_BASE + 10) -#define NPERR_FILE_NOT_FOUND (NPERR_BASE + 11) -#define NPERR_NO_DATA (NPERR_BASE + 12) -#define NPERR_STREAM_NOT_SEEKABLE (NPERR_BASE + 13) - -/* - * Values of type NPReason: - */ -#define NPRES_BASE 0 -#define NPRES_DONE (NPRES_BASE + 0) -#define NPRES_NETWORK_ERR (NPRES_BASE + 1) -#define NPRES_USER_BREAK (NPRES_BASE + 2) - -/* - * Don't use these obsolete error codes any more. - */ -#define NP_NOERR NP_NOERR_is_obsolete_use_NPERR_NO_ERROR -#define NP_EINVAL NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR -#define NP_EABORT NP_EABORT_is_obsolete_use_NPRES_USER_BREAK - -/* - * Version feature information - */ -#define NPVERS_HAS_STREAMOUTPUT 8 -#define NPVERS_HAS_NOTIFICATION 9 -#define NPVERS_HAS_LIVECONNECT 9 - - -/*----------------------------------------------------------------------*/ -/* Function Prototypes */ -/*----------------------------------------------------------------------*/ - -#if defined(_WINDOWS) && !defined(WIN32) -#define NP_LOADDS _loadds -#else -#define NP_LOADDS -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * NPP_* functions are provided by the plugin and called by the navigator. - */ - -#ifdef XP_UNIX -char* NPP_GetMIMEDescription(void); -NPError NPP_GetValue(void *instance, NPPVariable variable, - void *value); -#endif /* XP_UNIX */ -NPError NPP_Initialize(void); -void NPP_Shutdown(void); -NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance, - uint16 mode, int16 argc, char* argn[], - char* argv[], NPSavedData* saved); -NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save); -NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window); -NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type, - NPStream* stream, NPBool seekable, - uint16* stype); -NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream, - NPReason reason); -int32 NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream); -int32 NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32 offset, - int32 len, void* buffer); -void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream, - const char* fname); -void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint); -int16 NPP_HandleEvent(NPP instance, void* event); -void NPP_URLNotify(NPP instance, const char* url, - NPReason reason, void* notifyData); - /* it IS void* really */ -void* NPP_GetJavaClass(void); - - -/* - * NPN_* functions are provided by the navigator and called by the plugin. - */ - -#ifdef XP_UNIX -NPError NPN_GetValue(NPP instance, NPNVariable variable, - void *value); -#endif /* XP_UNIX */ -void NPN_Version(int* plugin_major, int* plugin_minor, - int* netscape_major, int* netscape_minor); -NPError NPN_GetURLNotify(NPP instance, const char* url, - const char* target, void* notifyData); -NPError NPN_GetURL(NPP instance, const char* url, - const char* target); -NPError NPN_PostURLNotify(NPP instance, const char* url, - const char* target, uint32 len, - const char* buf, NPBool file, - void* notifyData); -NPError NPN_PostURL(NPP instance, const char* url, - const char* target, uint32 len, - const char* buf, NPBool file); -NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList); -NPError NPN_NewStream(NPP instance, NPMIMEType type, - const char* target, NPStream** stream); -int32 NPN_Write(NPP instance, NPStream* stream, int32 len, - void* buffer); -NPError NPN_DestroyStream(NPP instance, NPStream* stream, - NPReason reason); -void NPN_Status(NPP instance, const char* message); -const char* NPN_UserAgent(NPP instance); -void* NPN_MemAlloc(uint32 size); -void NPN_MemFree(void* ptr); -uint32 NPN_MemFlush(uint32 size); -void NPN_ReloadPlugins(NPBool reloadPages); - /* don't need it */ - /*JRIEnv* NPN_GetJavaEnv(void);*/ -void* NPN_GetJavaPeer(NPP instance); - - -#ifdef __cplusplus -} /* end extern "C" */ -#endif - -#endif /* _NPAPI_H_ */ diff --git a/mozilla/java/waterfall/wf/src/plugin/netscape4/npunix.c b/mozilla/java/waterfall/wf/src/plugin/netscape4/npunix.c deleted file mode 100644 index 8746cad1956..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/netscape4/npunix.c +++ /dev/null @@ -1,436 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: npunix.c,v 1.1.1.1 2001-05-09 17:30:10 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* - * npunix.c - * - * Netscape Client Plugin API - * - Wrapper function to interface with the Netscape Navigator - * - * dp Suresh - * - *---------------------------------------------------------------------- - * PLUGIN DEVELOPERS: - * YOU WILL NOT NEED TO EDIT THIS FILE. - *---------------------------------------------------------------------- - */ - -#define XP_UNIX 1 - -#include -#include "npapi.h" -#include "npupp.h" - -/* - * Define PLUGIN_TRACE to have the wrapper functions print - * messages to stderr whenever they are called. - */ - -#ifdef PLUGIN_TRACE -#include -#define PLUGINDEBUGSTR(msg) fprintf(stderr, "%s\n", msg) -#else -#define PLUGINDEBUGSTR(msg) -#endif - - -/*********************************************************************** - * - * Globals - * - ***********************************************************************/ - -static NPNetscapeFuncs gNetscapeFuncs; /* Netscape Function table */ - - -/*********************************************************************** - * - * Wrapper functions : plugin calling Netscape Navigator - * - * These functions let the plugin developer just call the APIs - * as documented and defined in npapi.h, without needing to know - * about the function table and call macros in npupp.h. - * - ***********************************************************************/ - -void -NPN_Version(int* plugin_major, int* plugin_minor, - int* netscape_major, int* netscape_minor) -{ - *plugin_major = NP_VERSION_MAJOR; - *plugin_minor = NP_VERSION_MINOR; - - /* Major version is in high byte */ - *netscape_major = gNetscapeFuncs.version >> 8; - /* Minor version is in low byte */ - *netscape_minor = gNetscapeFuncs.version & 0xFF; -} - -NPError -NPN_GetValue(NPP instance, NPNVariable variable, void *r_value) -{ - return CallNPN_GetValueProc(gNetscapeFuncs.getvalue, - instance, variable, r_value); -} - -NPError -NPN_GetURL(NPP instance, const char* url, const char* window) -{ - return CallNPN_GetURLProc(gNetscapeFuncs.geturl, instance, url, window); -} -NPError -NPN_GetURLNotify(NPP instance, const char *url, - const char *target, void* notifyData) -{ - return CallNPN_GetURLNotifyProc(gNetscapeFuncs.geturlnotify, - instance, url, target, notifyData); -} - - -NPError -NPN_PostURL(NPP instance, const char* url, const char* window, - uint32 len, const char* buf, NPBool file) -{ - return CallNPN_PostURLProc(gNetscapeFuncs.posturl, instance, - url, window, len, buf, file); -} - -NPError -NPN_RequestRead(NPStream* stream, NPByteRange* rangeList) -{ - return CallNPN_RequestReadProc(gNetscapeFuncs.requestread, - stream, rangeList); -} - -NPError -NPN_NewStream(NPP instance, NPMIMEType type, const char *window, - NPStream** stream_ptr) -{ - return CallNPN_NewStreamProc(gNetscapeFuncs.newstream, instance, - type, window, stream_ptr); -} - -int32 -NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer) -{ - return CallNPN_WriteProc(gNetscapeFuncs.write, instance, - stream, len, buffer); -} - -NPError -NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason) -{ - return CallNPN_DestroyStreamProc(gNetscapeFuncs.destroystream, - instance, stream, reason); -} - -void -NPN_Status(NPP instance, const char* message) -{ - CallNPN_StatusProc(gNetscapeFuncs.status, instance, message); -} - -const char* -NPN_UserAgent(NPP instance) -{ - return CallNPN_UserAgentProc(gNetscapeFuncs.uagent, instance); -} - -void* -NPN_MemAlloc(uint32 size) -{ - return CallNPN_MemAllocProc(gNetscapeFuncs.memalloc, size); -} - -void NPN_MemFree(void* ptr) -{ - CallNPN_MemFreeProc(gNetscapeFuncs.memfree, ptr); -} - -uint32 NPN_MemFlush(uint32 size) -{ - return CallNPN_MemFlushProc(gNetscapeFuncs.memflush, size); -} - -void NPN_ReloadPlugins(NPBool reloadPages) -{ - CallNPN_ReloadPluginsProc(gNetscapeFuncs.reloadplugins, reloadPages); -} - -JRIEnv* NPN_GetJavaEnv() -{ - return CallNPN_GetJavaEnvProc(gNetscapeFuncs.getJavaEnv); -} - -jref NPN_GetJavaPeer(NPP instance) -{ - return CallNPN_GetJavaPeerProc(gNetscapeFuncs.getJavaPeer, - instance); -} - - -/*********************************************************************** - * - * Wrapper functions : Netscape Navigator -> plugin - * - * These functions let the plugin developer just create the APIs - * as documented and defined in npapi.h, without needing to - * install those functions in the function table or worry about - * setting up globals for 68K plugins. - * - ***********************************************************************/ - -NPError -Private_New(NPMIMEType pluginType, NPP instance, uint16 mode, - int16 argc, char* argn[], char* argv[], NPSavedData* saved) -{ - NPError ret; - PLUGINDEBUGSTR("New"); - ret = NPP_New(pluginType, instance, mode, argc, argn, argv, saved); - return ret; -} - -NPError -Private_Destroy(NPP instance, NPSavedData** save) -{ - PLUGINDEBUGSTR("Destroy"); - return NPP_Destroy(instance, save); -} - -NPError -Private_SetWindow(NPP instance, NPWindow* window) -{ - NPError err; - PLUGINDEBUGSTR("SetWindow"); - err = NPP_SetWindow(instance, window); - return err; -} - -NPError -Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream, - NPBool seekable, uint16* stype) -{ - NPError err; - PLUGINDEBUGSTR("NewStream"); - err = NPP_NewStream(instance, type, stream, seekable, stype); - return err; -} - -int32 -Private_WriteReady(NPP instance, NPStream* stream) -{ - unsigned int result; - PLUGINDEBUGSTR("WriteReady"); - result = NPP_WriteReady(instance, stream); - return result; -} - -int32 -Private_Write(NPP instance, NPStream* stream, int32 offset, int32 len, - void* buffer) -{ - unsigned int result; - PLUGINDEBUGSTR("Write"); - result = NPP_Write(instance, stream, offset, len, buffer); - return result; -} - -void -Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname) -{ - PLUGINDEBUGSTR("StreamAsFile"); - NPP_StreamAsFile(instance, stream, fname); -} - - -NPError -Private_DestroyStream(NPP instance, NPStream* stream, NPError reason) -{ - NPError err; - PLUGINDEBUGSTR("DestroyStream"); - err = NPP_DestroyStream(instance, stream, reason); - return err; -} - - -void -Private_Print(NPP instance, NPPrint* platformPrint) -{ - PLUGINDEBUGSTR("Print"); - NPP_Print(instance, platformPrint); -} - -void* -Private_GetJavaClass(void) -{ - return NULL; -} - -/*********************************************************************** - * - * These functions are located automagically by netscape. - * - ***********************************************************************/ - -/* - * NP_GetMIMEDescription - * - Netscape needs to know about this symbol - * - Netscape uses the return value to identify when an object instance - * of this plugin should be created. - */ -char * -NP_GetMIMEDescription(void) -{ - return NPP_GetMIMEDescription(); -} - -/* - * NP_GetValue [optional] - * - Netscape needs to know about this symbol. - * - Interfaces with plugin to get values for predefined variables - * that the navigator needs. - */ -NPError -NP_GetValue(void *future, NPPVariable variable, void *value) -{ - return NPP_GetValue(future, variable, value); -} - -/* - * NP_Initialize - * - Netscape needs to know about this symbol. - * - It calls this function after looking up its symbol before it - * is about to create the first ever object of this kind. - * - * PARAMETERS - * nsTable - The netscape function table. If developers just use these - * wrappers, they dont need to worry about all these function - * tables. - * RETURN - * pluginFuncs - * - This functions needs to fill the plugin function table - * pluginFuncs and return it. Netscape Navigator plugin - * library will use this function table to call the plugin. - * - */ -NPError -NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs) -{ - NPError err = NPERR_NO_ERROR; - - PLUGINDEBUGSTR("NP_Initialize"); - - /* validate input parameters */ - - if ((nsTable == NULL) || (pluginFuncs == NULL)) - err = NPERR_INVALID_FUNCTABLE_ERROR; - - /* - * Check the major version passed in Netscape's function table. - * We won't load if the major version is newer than what we expect. - * Also check that the function tables passed in are big enough for - * all the functions we need (they could be bigger, if Netscape added - * new APIs, but that's OK with us -- we'll just ignore them). - * - */ - - if (err == NPERR_NO_ERROR) { - if ((nsTable->version >> 8) > NP_VERSION_MAJOR) - err = NPERR_INCOMPATIBLE_VERSION_ERROR; - if (nsTable->size < sizeof(NPNetscapeFuncs)) - err = NPERR_INVALID_FUNCTABLE_ERROR; - if (pluginFuncs->size < sizeof(NPPluginFuncs)) - err = NPERR_INVALID_FUNCTABLE_ERROR; - } - - - if (err == NPERR_NO_ERROR) { - /* - * Copy all the fields of Netscape function table into our - * copy so we can call back into Netscape later. Note that - * we need to copy the fields one by one, rather than assigning - * the whole structure, because the Netscape function table - * could actually be bigger than what we expect. - */ - gNetscapeFuncs.version = nsTable->version; - gNetscapeFuncs.size = nsTable->size; - gNetscapeFuncs.posturl = nsTable->posturl; - gNetscapeFuncs.geturl = nsTable->geturl; - gNetscapeFuncs.geturlnotify = nsTable->geturlnotify; - gNetscapeFuncs.requestread = nsTable->requestread; - gNetscapeFuncs.newstream = nsTable->newstream; - gNetscapeFuncs.write = nsTable->write; - gNetscapeFuncs.destroystream = nsTable->destroystream; - gNetscapeFuncs.status = nsTable->status; - gNetscapeFuncs.uagent = nsTable->uagent; - gNetscapeFuncs.memalloc = nsTable->memalloc; - gNetscapeFuncs.memfree = nsTable->memfree; - gNetscapeFuncs.memflush = nsTable->memflush; - gNetscapeFuncs.reloadplugins = nsTable->reloadplugins; - gNetscapeFuncs.getJavaEnv = nsTable->getJavaEnv; - gNetscapeFuncs.getJavaPeer = nsTable->getJavaPeer; - gNetscapeFuncs.getvalue = nsTable->getvalue; - - /* - * Set up the plugin function table that Netscape will use to - * call us. Netscape needs to know about our version and size - * and have a UniversalProcPointer for every function we - * implement. - */ - pluginFuncs->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR; - pluginFuncs->size = sizeof(NPPluginFuncs); - pluginFuncs->newp = NewNPP_NewProc(Private_New); - pluginFuncs->destroy = NewNPP_DestroyProc(Private_Destroy); - pluginFuncs->setwindow = NewNPP_SetWindowProc(Private_SetWindow); - pluginFuncs->newstream = NewNPP_NewStreamProc(Private_NewStream); - pluginFuncs->destroystream = NewNPP_DestroyStreamProc(Private_DestroyStream); - pluginFuncs->asfile = NewNPP_StreamAsFileProc(Private_StreamAsFile); - pluginFuncs->writeready = NewNPP_WriteReadyProc(Private_WriteReady); - pluginFuncs->write = NewNPP_WriteProc(Private_Write); - pluginFuncs->print = NewNPP_PrintProc(Private_Print); - pluginFuncs->event = NULL; - pluginFuncs->javaClass = Private_GetJavaClass(); - - err = NPP_Initialize(); - } - - return err; -} - -/* - * NP_Shutdown [optional] - * - Netscape needs to know about this symbol. - * - It calls this function after looking up its symbol after - * the last object of this kind has been destroyed. - * - */ -NPError -NP_Shutdown(void) -{ - PLUGINDEBUGSTR("NP_Shutdown"); - NPP_Shutdown(); - return NPERR_NO_ERROR; -} diff --git a/mozilla/java/waterfall/wf/src/plugin/netscape4/npunix.c.my b/mozilla/java/waterfall/wf/src/plugin/netscape4/npunix.c.my deleted file mode 100644 index e22392cb829..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/netscape4/npunix.c.my +++ /dev/null @@ -1,436 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: npunix.c.my,v 1.1.1.1 2001-05-09 17:30:10 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* - * npunix.c - * - * Netscape Client Plugin API - * - Wrapper function to interface with the Netscape Navigator - * - * dp Suresh - * - *---------------------------------------------------------------------- - * PLUGIN DEVELOPERS: - * YOU WILL NOT NEED TO EDIT THIS FILE. - *---------------------------------------------------------------------- - */ - -#define XP_UNIX 1 - -#include -#include "npapi.h" -#include "npupp.h" - -/* - * Define PLUGIN_TRACE to have the wrapper functions print - * messages to stderr whenever they are called. - */ - -#ifdef PLUGIN_TRACE -#include -#define PLUGINDEBUGSTR(msg) fprintf(stderr, "%s\n", msg) -#else -#define PLUGINDEBUGSTR(msg) -#endif - - -/*********************************************************************** - * - * Globals - * - ***********************************************************************/ - -static NPNetscapeFuncs gNetscapeFuncs; /* Netscape Function table */ - - -/*********************************************************************** - * - * Wrapper functions : plugin calling Netscape Navigator - * - * These functions let the plugin developer just call the APIs - * as documented and defined in npapi.h, without needing to know - * about the function table and call macros in npupp.h. - * - ***********************************************************************/ - -void -NPN_Version(int* plugin_major, int* plugin_minor, - int* netscape_major, int* netscape_minor) -{ - *plugin_major = NP_VERSION_MAJOR; - *plugin_minor = NP_VERSION_MINOR; - - /* Major version is in high byte */ - *netscape_major = gNetscapeFuncs.version >> 8; - /* Minor version is in low byte */ - *netscape_minor = gNetscapeFuncs.version & 0xFF; -} - -NPError -NPN_GetValue(NPP instance, NPNVariable variable, void *r_value) -{ - return CallNPN_GetValueProc(gNetscapeFuncs.getvalue, - instance, variable, r_value); -} - -NPError -NPN_GetURL(NPP instance, const char* url, const char* window) -{ - return CallNPN_GetURLProc(gNetscapeFuncs.geturl, instance, url, window); -} -NPError -NPN_GetURLNotify(NPP instance, const char *url, - const char *target, void* notifyData) -{ - return CallNPN_GetURLNotifyProc(gNetscapeFuncs.geturlnotify, - instance, url, target, notifyData); -} - - -NPError -NPN_PostURL(NPP instance, const char* url, const char* window, - uint32 len, const char* buf, NPBool file) -{ - return CallNPN_PostURLProc(gNetscapeFuncs.posturl, instance, - url, window, len, buf, file); -} - -NPError -NPN_RequestRead(NPStream* stream, NPByteRange* rangeList) -{ - return CallNPN_RequestReadProc(gNetscapeFuncs.requestread, - stream, rangeList); -} - -NPError -NPN_NewStream(NPP instance, NPMIMEType type, const char *window, - NPStream** stream_ptr) -{ - return CallNPN_NewStreamProc(gNetscapeFuncs.newstream, instance, - type, window, stream_ptr); -} - -int32 -NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer) -{ - return CallNPN_WriteProc(gNetscapeFuncs.write, instance, - stream, len, buffer); -} - -NPError -NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason) -{ - return CallNPN_DestroyStreamProc(gNetscapeFuncs.destroystream, - instance, stream, reason); -} - -void -NPN_Status(NPP instance, const char* message) -{ - CallNPN_StatusProc(gNetscapeFuncs.status, instance, message); -} - -const char* -NPN_UserAgent(NPP instance) -{ - return CallNPN_UserAgentProc(gNetscapeFuncs.uagent, instance); -} - -void* -NPN_MemAlloc(uint32 size) -{ - return CallNPN_MemAllocProc(gNetscapeFuncs.memalloc, size); -} - -void NPN_MemFree(void* ptr) -{ - CallNPN_MemFreeProc(gNetscapeFuncs.memfree, ptr); -} - -uint32 NPN_MemFlush(uint32 size) -{ - return CallNPN_MemFlushProc(gNetscapeFuncs.memflush, size); -} - -void NPN_ReloadPlugins(NPBool reloadPages) -{ - CallNPN_ReloadPluginsProc(gNetscapeFuncs.reloadplugins, reloadPages); -} - -void* NPN_GetJavaEnv() -{ - return CallNPN_GetJavaEnvProc(gNetscapeFuncs.getJavaEnv); -} - -void* NPN_GetJavaPeer(NPP instance) -{ - return CallNPN_GetJavaPeerProc(gNetscapeFuncs.getJavaPeer, - instance); -} - - -/*********************************************************************** - * - * Wrapper functions : Netscape Navigator -> plugin - * - * These functions let the plugin developer just create the APIs - * as documented and defined in npapi.h, without needing to - * install those functions in the function table or worry about - * setting up globals for 68K plugins. - * - ***********************************************************************/ - -NPError -Private_New(NPMIMEType pluginType, NPP instance, uint16 mode, - int16 argc, char* argn[], char* argv[], NPSavedData* saved) -{ - NPError ret; - PLUGINDEBUGSTR("New"); - ret = NPP_New(pluginType, instance, mode, argc, argn, argv, saved); - return ret; -} - -NPError -Private_Destroy(NPP instance, NPSavedData** save) -{ - PLUGINDEBUGSTR("Destroy"); - return NPP_Destroy(instance, save); -} - -NPError -Private_SetWindow(NPP instance, NPWindow* window) -{ - NPError err; - PLUGINDEBUGSTR("SetWindow"); - err = NPP_SetWindow(instance, window); - return err; -} - -NPError -Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream, - NPBool seekable, uint16* stype) -{ - NPError err; - PLUGINDEBUGSTR("NewStream"); - err = NPP_NewStream(instance, type, stream, seekable, stype); - return err; -} - -int32 -Private_WriteReady(NPP instance, NPStream* stream) -{ - unsigned int result; - PLUGINDEBUGSTR("WriteReady"); - result = NPP_WriteReady(instance, stream); - return result; -} - -int32 -Private_Write(NPP instance, NPStream* stream, int32 offset, int32 len, - void* buffer) -{ - unsigned int result; - PLUGINDEBUGSTR("Write"); - result = NPP_Write(instance, stream, offset, len, buffer); - return result; -} - -void -Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname) -{ - PLUGINDEBUGSTR("StreamAsFile"); - NPP_StreamAsFile(instance, stream, fname); -} - - -NPError -Private_DestroyStream(NPP instance, NPStream* stream, NPError reason) -{ - NPError err; - PLUGINDEBUGSTR("DestroyStream"); - err = NPP_DestroyStream(instance, stream, reason); - return err; -} - - -void -Private_Print(NPP instance, NPPrint* platformPrint) -{ - PLUGINDEBUGSTR("Print"); - NPP_Print(instance, platformPrint); -} - -void* -Private_GetJavaClass(void) -{ - return NULL; -} - -/*********************************************************************** - * - * These functions are located automagically by netscape. - * - ***********************************************************************/ - -/* - * NP_GetMIMEDescription - * - Netscape needs to know about this symbol - * - Netscape uses the return value to identify when an object instance - * of this plugin should be created. - */ -char * -NP_GetMIMEDescription(void) -{ - return NPP_GetMIMEDescription(); -} - -/* - * NP_GetValue [optional] - * - Netscape needs to know about this symbol. - * - Interfaces with plugin to get values for predefined variables - * that the navigator needs. - */ -NPError -NP_GetValue(void *future, NPPVariable variable, void *value) -{ - return NPP_GetValue(future, variable, value); -} - -/* - * NP_Initialize - * - Netscape needs to know about this symbol. - * - It calls this function after looking up its symbol before it - * is about to create the first ever object of this kind. - * - * PARAMETERS - * nsTable - The netscape function table. If developers just use these - * wrappers, they dont need to worry about all these function - * tables. - * RETURN - * pluginFuncs - * - This functions needs to fill the plugin function table - * pluginFuncs and return it. Netscape Navigator plugin - * library will use this function table to call the plugin. - * - */ -NPError -NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs) -{ - NPError err = NPERR_NO_ERROR; - - PLUGINDEBUGSTR("NP_Initialize"); - - /* validate input parameters */ - - if ((nsTable == NULL) || (pluginFuncs == NULL)) - err = NPERR_INVALID_FUNCTABLE_ERROR; - - /* - * Check the major version passed in Netscape's function table. - * We won't load if the major version is newer than what we expect. - * Also check that the function tables passed in are big enough for - * all the functions we need (they could be bigger, if Netscape added - * new APIs, but that's OK with us -- we'll just ignore them). - * - */ - - if (err == NPERR_NO_ERROR) { - if ((nsTable->version >> 8) > NP_VERSION_MAJOR) - err = NPERR_INCOMPATIBLE_VERSION_ERROR; - if (nsTable->size < sizeof(NPNetscapeFuncs)) - err = NPERR_INVALID_FUNCTABLE_ERROR; - if (pluginFuncs->size < sizeof(NPPluginFuncs)) - err = NPERR_INVALID_FUNCTABLE_ERROR; - } - - - if (err == NPERR_NO_ERROR) { - /* - * Copy all the fields of Netscape function table into our - * copy so we can call back into Netscape later. Note that - * we need to copy the fields one by one, rather than assigning - * the whole structure, because the Netscape function table - * could actually be bigger than what we expect. - */ - gNetscapeFuncs.version = nsTable->version; - gNetscapeFuncs.size = nsTable->size; - gNetscapeFuncs.posturl = nsTable->posturl; - gNetscapeFuncs.geturl = nsTable->geturl; - gNetscapeFuncs.geturlnotify = nsTable->geturlnotify; - gNetscapeFuncs.requestread = nsTable->requestread; - gNetscapeFuncs.newstream = nsTable->newstream; - gNetscapeFuncs.write = nsTable->write; - gNetscapeFuncs.destroystream = nsTable->destroystream; - gNetscapeFuncs.status = nsTable->status; - gNetscapeFuncs.uagent = nsTable->uagent; - gNetscapeFuncs.memalloc = nsTable->memalloc; - gNetscapeFuncs.memfree = nsTable->memfree; - gNetscapeFuncs.memflush = nsTable->memflush; - gNetscapeFuncs.reloadplugins = nsTable->reloadplugins; - gNetscapeFuncs.getJavaEnv = nsTable->getJavaEnv; - gNetscapeFuncs.getJavaPeer = nsTable->getJavaPeer; - gNetscapeFuncs.getvalue = nsTable->getvalue; - - /* - * Set up the plugin function table that Netscape will use to - * call us. Netscape needs to know about our version and size - * and have a UniversalProcPointer for every function we - * implement. - */ - pluginFuncs->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR; - pluginFuncs->size = sizeof(NPPluginFuncs); - pluginFuncs->newp = NewNPP_NewProc(Private_New); - pluginFuncs->destroy = NewNPP_DestroyProc(Private_Destroy); - pluginFuncs->setwindow = NewNPP_SetWindowProc(Private_SetWindow); - pluginFuncs->newstream = NewNPP_NewStreamProc(Private_NewStream); - pluginFuncs->destroystream = NewNPP_DestroyStreamProc(Private_DestroyStream); - pluginFuncs->asfile = NewNPP_StreamAsFileProc(Private_StreamAsFile); - pluginFuncs->writeready = NewNPP_WriteReadyProc(Private_WriteReady); - pluginFuncs->write = NewNPP_WriteProc(Private_Write); - pluginFuncs->print = NewNPP_PrintProc(Private_Print); - pluginFuncs->event = NULL; - pluginFuncs->javaClass = Private_GetJavaClass(); - - err = NPP_Initialize(); - } - - return err; -} - -/* - * NP_Shutdown [optional] - * - Netscape needs to know about this symbol. - * - It calls this function after looking up its symbol after - * the last object of this kind has been destroyed. - * - */ -NPError -NP_Shutdown(void) -{ - PLUGINDEBUGSTR("NP_Shutdown"); - NPP_Shutdown(); - return NPERR_NO_ERROR; -} diff --git a/mozilla/java/waterfall/wf/src/plugin/netscape4/npupp.h b/mozilla/java/waterfall/wf/src/plugin/netscape4/npupp.h deleted file mode 100644 index a9044d4bd3d..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/netscape4/npupp.h +++ /dev/null @@ -1,1020 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: npupp.h,v 1.1.1.1 2001-05-09 17:30:10 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* -*- Mode: C; tab-width: 4; -*- */ -/* - * npupp.h $Revision: 1.1.1.1 $ - * function call mecahnics needed by platform specific glue code. - */ - - -#ifndef _NPUPP_H_ -#define _NPUPP_H_ - -#ifndef GENERATINGCFM -#define GENERATINGCFM 0 -#endif - -#ifndef _NPAPI_H_ -#include "npapi.h" -#endif -#include "jni.h" - -/****************************************************************************************** - plug-in function table macros - for each function in and out of the plugin API we define - typedef NPP_FooUPP - #define NewNPP_FooProc - #define CallNPP_FooProc - for mac, define the UPP magic for PPC/68K calling - *******************************************************************************************/ - - -/* NPP_Initialize */ - -#if GENERATINGCFM -typedef UniversalProcPtr NPP_InitializeUPP; - -enum { - uppNPP_InitializeProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0)) - | RESULT_SIZE(SIZE_CODE(0)) -}; - -#define NewNPP_InitializeProc(FUNC) \ - (NPP_InitializeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_InitializeProcInfo, GetCurrentArchitecture()) -#define CallNPP_InitializeProc(FUNC) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_InitializeProcInfo) - -#else - -typedef void (*NPP_InitializeUPP)(void); -#define NewNPP_InitializeProc(FUNC) \ - ((NPP_InitializeUPP) (FUNC)) -#define CallNPP_InitializeProc(FUNC) \ - (*(FUNC))() - -#endif - - -/* NPP_Shutdown */ - -#if GENERATINGCFM -typedef UniversalProcPtr NPP_ShutdownUPP; - -enum { - uppNPP_ShutdownProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0)) - | RESULT_SIZE(SIZE_CODE(0)) -}; - -#define NewNPP_ShutdownProc(FUNC) \ - (NPP_ShutdownUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_ShutdownProcInfo, GetCurrentArchitecture()) -#define CallNPP_ShutdownProc(FUNC) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_ShutdownProcInfo) - -#else - -typedef void (*NPP_ShutdownUPP)(void); -#define NewNPP_ShutdownProc(FUNC) \ - ((NPP_ShutdownUPP) (FUNC)) -#define CallNPP_ShutdownProc(FUNC) \ - (*(FUNC))() - -#endif - - -/* NPP_New */ - -#if GENERATINGCFM -typedef UniversalProcPtr NPP_NewUPP; - -enum { - uppNPP_NewProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPMIMEType))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(uint16))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int16))) - | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(char **))) - | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(char **))) - | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(NPSavedData *))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; - -#define NewNPP_NewProc(FUNC) \ - (NPP_NewUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewProcInfo, GetCurrentArchitecture()) -#define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewProcInfo, \ - (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)) -#else - -typedef NPError (*NPP_NewUPP)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved); -#define NewNPP_NewProc(FUNC) \ - ((NPP_NewUPP) (FUNC)) -#define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \ - (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)) - -#endif - - -/* NPP_Destroy */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_DestroyUPP; -enum { - uppNPP_DestroyProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPSavedData **))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPP_DestroyProc(FUNC) \ - (NPP_DestroyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyProcInfo, GetCurrentArchitecture()) -#define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyProcInfo, (ARG1), (ARG2)) -#else - -typedef NPError (*NPP_DestroyUPP)(NPP instance, NPSavedData** save); -#define NewNPP_DestroyProc(FUNC) \ - ((NPP_DestroyUPP) (FUNC)) -#define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \ - (*(FUNC))((ARG1), (ARG2)) - -#endif - - -/* NPP_SetWindow */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_SetWindowUPP; -enum { - uppNPP_SetWindowProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPWindow *))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPP_SetWindowProc(FUNC) \ - (NPP_SetWindowUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_SetWindowProcInfo, GetCurrentArchitecture()) -#define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_SetWindowProcInfo, (ARG1), (ARG2)) - -#else - -typedef NPError (*NPP_SetWindowUPP)(NPP instance, NPWindow* window); -#define NewNPP_SetWindowProc(FUNC) \ - ((NPP_SetWindowUPP) (FUNC)) -#define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \ - (*(FUNC))((ARG1), (ARG2)) - -#endif - - -/* NPP_NewStream */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_NewStreamUPP; -enum { - uppNPP_NewStreamProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPStream *))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPBool))) - | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(uint16 *))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPP_NewStreamProc(FUNC) \ - (NPP_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewStreamProcInfo, GetCurrentArchitecture()) -#define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewStreamProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5)) -#else - -typedef NPError (*NPP_NewStreamUPP)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype); -#define NewNPP_NewStreamProc(FUNC) \ - ((NPP_NewStreamUPP) (FUNC)) -#define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \ - (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5)) -#endif - - -/* NPP_DestroyStream */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_DestroyStreamUPP; -enum { - uppNPP_DestroyStreamProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPP_DestroyStreamProc(FUNC) \ - (NPP_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, GetCurrentArchitecture()) -#define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPReasonArg) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, (NPParg), (NPStreamPtr), (NPReasonArg)) - -#else - -typedef NPError (*NPP_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason); -#define NewNPP_DestroyStreamProc(FUNC) \ - ((NPP_DestroyStreamUPP) (FUNC)) -#define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPReasonArg) \ - (*(FUNC))((NPParg), (NPStreamPtr), (NPReasonArg)) - -#endif - - -/* NPP_WriteReady */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_WriteReadyUPP; -enum { - uppNPP_WriteReadyProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) - | RESULT_SIZE(SIZE_CODE(sizeof(int32))) -}; -#define NewNPP_WriteReadyProc(FUNC) \ - (NPP_WriteReadyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, GetCurrentArchitecture()) -#define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \ - (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, (NPParg), (NPStreamPtr)) - -#else - -typedef int32 (*NPP_WriteReadyUPP)(NPP instance, NPStream* stream); -#define NewNPP_WriteReadyProc(FUNC) \ - ((NPP_WriteReadyUPP) (FUNC)) -#define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \ - (*(FUNC))((NPParg), (NPStreamPtr)) - -#endif - - -/* NPP_Write */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_WriteUPP; -enum { - uppNPP_WriteProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int32))) - | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(void*))) - | RESULT_SIZE(SIZE_CODE(sizeof(int32))) -}; -#define NewNPP_WriteProc(FUNC) \ - (NPP_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteProcInfo, GetCurrentArchitecture()) -#define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr) \ - (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteProcInfo, (NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr)) - -#else - -typedef int32 (*NPP_WriteUPP)(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer); -#define NewNPP_WriteProc(FUNC) \ - ((NPP_WriteUPP) (FUNC)) -#define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr) \ - (*(FUNC))((NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr)) - -#endif - - -/* NPP_StreamAsFile */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_StreamAsFileUPP; -enum { - uppNPP_StreamAsFileProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *))) - | RESULT_SIZE(SIZE_CODE(0)) -}; -#define NewNPP_StreamAsFileProc(FUNC) \ - (NPP_StreamAsFileUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, GetCurrentArchitecture()) -#define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, (ARG1), (ARG2), (ARG3)) - -#else - -typedef void (*NPP_StreamAsFileUPP)(NPP instance, NPStream* stream, const char* fname); -#define NewNPP_StreamAsFileProc(FUNC) \ - ((NPP_StreamAsFileUPP) (FUNC)) -#define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \ - (*(FUNC))((ARG1), (ARG2), (ARG3)) -#endif - - -/* NPP_Print */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_PrintUPP; -enum { - uppNPP_PrintProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPrint *))) - | RESULT_SIZE(SIZE_CODE(0)) -}; -#define NewNPP_PrintProc(FUNC) \ - (NPP_PrintUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_PrintProcInfo, GetCurrentArchitecture()) -#define CallNPP_PrintProc(FUNC, NPParg, voidPtr) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_PrintProcInfo, (NPParg), (voidPtr)) - -#else - -typedef void (*NPP_PrintUPP)(NPP instance, NPPrint* platformPrint); -#define NewNPP_PrintProc(FUNC) \ - ((NPP_PrintUPP) (FUNC)) -#define CallNPP_PrintProc(FUNC, NPParg, NPPrintArg) \ - (*(FUNC))((NPParg), (NPPrintArg)) - -#endif - - -/* NPP_HandleEvent */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_HandleEventUPP; -enum { - uppNPP_HandleEventProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void *))) - | RESULT_SIZE(SIZE_CODE(sizeof(int16))) -}; -#define NewNPP_HandleEventProc(FUNC) \ - (NPP_HandleEventUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_HandleEventProcInfo, GetCurrentArchitecture()) -#define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \ - (int16)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_HandleEventProcInfo, (NPParg), (voidPtr)) - -#else - -typedef int16 (*NPP_HandleEventUPP)(NPP instance, void* event); -#define NewNPP_HandleEventProc(FUNC) \ - ((NPP_HandleEventUPP) (FUNC)) -#define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \ - (*(FUNC))((NPParg), (voidPtr)) - -#endif - - -/* NPP_URLNotify */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_URLNotifyUPP; -enum { - uppNPP_URLNotifyProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*))) - | RESULT_SIZE(SIZE_CODE(SIZE_CODE(0))) -}; -#define NewNPP_URLNotifyProc(FUNC) \ - (NPP_URLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_URLNotifyProcInfo, GetCurrentArchitecture()) -#define CallNPP_URLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_URLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4)) - -#else - -typedef void (*NPP_URLNotifyUPP)(NPP instance, const char* url, NPReason reason, void* notifyData); -#define NewNPP_URLNotifyProc(FUNC) \ - ((NPP_URLNotifyUPP) (FUNC)) -#define CallNPP_URLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ - (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4)) - -#endif - - - - -/* - * Netscape entry points - */ - -#ifdef XP_UNIX - -/* NPN_GetValue */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_GetValueUPP; -enum { - uppNPN_GetValueProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPNVariable))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_GetValueProc(FUNC) \ - (NPN_GetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetValueProcInfo, GetCurrentArchitecture()) -#define CallNPN_GetURNotifyLProc(FUNC, ARG1, ARG2, ARG3) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetValueProcInfo, (ARG1), (ARG2), (ARG3)) -#else - -typedef NPError (*NPN_GetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue); -#define NewNPN_GetValueProc(FUNC) \ - ((NPN_GetValueUPP) (FUNC)) -#define CallNPN_GetValueProc(FUNC, ARG1, ARG2, ARG3) \ - (*(FUNC))((ARG1), (ARG2), (ARG3)) -#endif - -#endif /* XP_UNIX */ - - - -/* NPN_GetUrlNotify */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_GetURLNotifyUPP; -enum { - uppNPN_GetURLNotifyProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_GetURLNotifyProc(FUNC) \ - (NPN_GetURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLNotifyProcInfo, GetCurrentArchitecture()) -#define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4)) -#else - -typedef NPError (*NPN_GetURLNotifyUPP)(NPP instance, const char* url, const char* window, void* notifyData); -#define NewNPN_GetURLNotifyProc(FUNC) \ - ((NPN_GetURLNotifyUPP) (FUNC)) -#define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ - (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4)) -#endif - - -/* NPN_PostUrlNotify */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_PostURLNotifyUPP; -enum { - uppNPN_PostURLNotifyProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32))) - | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool))) - | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(void*))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_PostURLNotifyProc(FUNC) \ - (NPN_PostURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLNotifyProcInfo, GetCurrentArchitecture()) -#define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)) -#else - -typedef NPError (*NPN_PostURLNotifyUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData); -#define NewNPN_PostURLNotifyProc(FUNC) \ - ((NPN_PostURLNotifyUPP) (FUNC)) -#define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \ - (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)) -#endif - - -/* NPN_GetUrl */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_GetURLUPP; -enum { - uppNPN_GetURLProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_GetURLProc(FUNC) \ - (NPN_GetURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLProcInfo, GetCurrentArchitecture()) -#define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLProcInfo, (ARG1), (ARG2), (ARG3)) -#else - -typedef NPError (*NPN_GetURLUPP)(NPP instance, const char* url, const char* window); -#define NewNPN_GetURLProc(FUNC) \ - ((NPN_GetURLUPP) (FUNC)) -#define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \ - (*(FUNC))((ARG1), (ARG2), (ARG3)) -#endif - - -/* NPN_PostUrl */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_PostURLUPP; -enum { - uppNPN_PostURLProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32))) - | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_PostURLProc(FUNC) \ - (NPN_PostURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLProcInfo, GetCurrentArchitecture()) -#define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6)) -#else - -typedef NPError (*NPN_PostURLUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file); -#define NewNPN_PostURLProc(FUNC) \ - ((NPN_PostURLUPP) (FUNC)) -#define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \ - (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6)) -#endif - - -/* NPN_RequestRead */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_RequestReadUPP; -enum { - uppNPN_RequestReadProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPStream *))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPByteRange *))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_RequestReadProc(FUNC) \ - (NPN_RequestReadUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_RequestReadProcInfo, GetCurrentArchitecture()) -#define CallNPN_RequestReadProc(FUNC, stream, range) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_RequestReadProcInfo, (stream), (range)) - -#else - -typedef NPError (*NPN_RequestReadUPP)(NPStream* stream, NPByteRange* rangeList); -#define NewNPN_RequestReadProc(FUNC) \ - ((NPN_RequestReadUPP) (FUNC)) -#define CallNPN_RequestReadProc(FUNC, stream, range) \ - (*(FUNC))((stream), (range)) - -#endif - - -/* NPN_NewStream */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_NewStreamUPP; -enum { - uppNPN_NewStreamProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPStream **))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_NewStreamProc(FUNC) \ - (NPN_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_NewStreamProcInfo, GetCurrentArchitecture()) -#define CallNPN_NewStreamProc(FUNC, npp, type, window, stream) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_NewStreamProcInfo, (npp), (type), (window), (stream)) - -#else - -typedef NPError (*NPN_NewStreamUPP)(NPP instance, NPMIMEType type, const char* window, NPStream** stream); -#define NewNPN_NewStreamProc(FUNC) \ - ((NPN_NewStreamUPP) (FUNC)) -#define CallNPN_NewStreamProc(FUNC, npp, type, window, stream) \ - (*(FUNC))((npp), (type), (window), (stream)) - -#endif - - -/* NPN_Write */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_WriteUPP; -enum { - uppNPN_WriteProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*))) - | RESULT_SIZE(SIZE_CODE(sizeof(int32))) -}; -#define NewNPN_WriteProc(FUNC) \ - (NPN_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_WriteProcInfo, GetCurrentArchitecture()) -#define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \ - (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_WriteProcInfo, (npp), (stream), (len), (buffer)) - -#else - -typedef int32 (*NPN_WriteUPP)(NPP instance, NPStream* stream, int32 len, void* buffer); -#define NewNPN_WriteProc(FUNC) \ - ((NPN_WriteUPP) (FUNC)) -#define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \ - (*(FUNC))((npp), (stream), (len), (buffer)) - -#endif - - -/* NPN_DestroyStream */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_DestroyStreamUPP; -enum { - uppNPN_DestroyStreamProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP ))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_DestroyStreamProc(FUNC) \ - (NPN_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, GetCurrentArchitecture()) -#define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, (npp), (stream), (reason)) - -#else - -typedef NPError (*NPN_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason); -#define NewNPN_DestroyStreamProc(FUNC) \ - ((NPN_DestroyStreamUPP) (FUNC)) -#define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason) \ - (*(FUNC))((npp), (stream), (reason)) - -#endif - - -/* NPN_Status */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_StatusUPP; -enum { - uppNPN_StatusProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(char *))) -}; - -#define NewNPN_StatusProc(FUNC) \ - (NPN_StatusUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_StatusProcInfo, GetCurrentArchitecture()) -#define CallNPN_StatusProc(FUNC, npp, msg) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_StatusProcInfo, (npp), (msg)) - -#else - -typedef void (*NPN_StatusUPP)(NPP instance, const char* message); -#define NewNPN_StatusProc(FUNC) \ - ((NPN_StatusUPP) (FUNC)) -#define CallNPN_StatusProc(FUNC, npp, msg) \ - (*(FUNC))((npp), (msg)) - -#endif - - -/* NPN_UserAgent */ -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_UserAgentUPP; -enum { - uppNPN_UserAgentProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | RESULT_SIZE(SIZE_CODE(sizeof(const char *))) -}; - -#define NewNPN_UserAgentProc(FUNC) \ - (NPN_UserAgentUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_UserAgentProcInfo, GetCurrentArchitecture()) -#define CallNPN_UserAgentProc(FUNC, ARG1) \ - (const char*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_UserAgentProcInfo, (ARG1)) - -#else - -typedef const char* (*NPN_UserAgentUPP)(NPP instance); -#define NewNPN_UserAgentProc(FUNC) \ - ((NPN_UserAgentUPP) (FUNC)) -#define CallNPN_UserAgentProc(FUNC, ARG1) \ - (*(FUNC))((ARG1)) - -#endif - - -/* NPN_MemAlloc */ -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_MemAllocUPP; -enum { - uppNPN_MemAllocProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32))) - | RESULT_SIZE(SIZE_CODE(sizeof(void *))) -}; - -#define NewNPN_MemAllocProc(FUNC) \ - (NPN_MemAllocUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemAllocProcInfo, GetCurrentArchitecture()) -#define CallNPN_MemAllocProc(FUNC, ARG1) \ - (void*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemAllocProcInfo, (ARG1)) - -#else - -typedef void* (*NPN_MemAllocUPP)(uint32 size); -#define NewNPN_MemAllocProc(FUNC) \ - ((NPN_MemAllocUPP) (FUNC)) -#define CallNPN_MemAllocProc(FUNC, ARG1) \ - (*(FUNC))((ARG1)) - -#endif - - -/* NPN__MemFree */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_MemFreeUPP; -enum { - uppNPN_MemFreeProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void *))) -}; - -#define NewNPN_MemFreeProc(FUNC) \ - (NPN_MemFreeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFreeProcInfo, GetCurrentArchitecture()) -#define CallNPN_MemFreeProc(FUNC, ARG1) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFreeProcInfo, (ARG1)) - -#else - -typedef void (*NPN_MemFreeUPP)(void* ptr); -#define NewNPN_MemFreeProc(FUNC) \ - ((NPN_MemFreeUPP) (FUNC)) -#define CallNPN_MemFreeProc(FUNC, ARG1) \ - (*(FUNC))((ARG1)) - -#endif - - -/* NPN_MemFlush */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_MemFlushUPP; -enum { - uppNPN_MemFlushProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32))) - | RESULT_SIZE(SIZE_CODE(sizeof(uint32))) -}; - -#define NewNPN_MemFlushProc(FUNC) \ - (NPN_MemFlushUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFlushProcInfo, GetCurrentArchitecture()) -#define CallNPN_MemFlushProc(FUNC, ARG1) \ - (uint32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFlushProcInfo, (ARG1)) - -#else - -typedef uint32 (*NPN_MemFlushUPP)(uint32 size); -#define NewNPN_MemFlushProc(FUNC) \ - ((NPN_MemFlushUPP) (FUNC)) -#define CallNPN_MemFlushProc(FUNC, ARG1) \ - (*(FUNC))((ARG1)) - -#endif - - - -/* NPN_ReloadPlugins */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_ReloadPluginsUPP; -enum { - uppNPN_ReloadPluginsProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPBool))) - | RESULT_SIZE(SIZE_CODE(0)) -}; - -#define NewNPN_ReloadPluginsProc(FUNC) \ - (NPN_ReloadPluginsUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, GetCurrentArchitecture()) -#define CallNPN_ReloadPluginsProc(FUNC, ARG1) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, (ARG1)) - -#else - -typedef void (*NPN_ReloadPluginsUPP)(NPBool reloadPages); -#define NewNPN_ReloadPluginsProc(FUNC) \ - ((NPN_ReloadPluginsUPP) (FUNC)) -#define CallNPN_ReloadPluginsProc(FUNC, ARG1) \ - (*(FUNC))((ARG1)) - -#endif - - -/* NPN_GetJavaEnv */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_GetJavaEnvUPP; -enum { - uppNPN_GetJavaEnvProcInfo = kThinkCStackBased - | RESULT_SIZE(SIZE_CODE(sizeof(JRIEnv*))) -}; - -#define NewNPN_GetJavaEnvProc(FUNC) \ - (NPN_GetJavaEnvUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetJavaEnvProcInfo, GetCurrentArchitecture()) -#define CallNPN_GetJavaEnvProc(FUNC) \ - (JRIEnv*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJavaEnvProcInfo) - -#else - -typedef JRIEnv* (*NPN_GetJavaEnvUPP)(void); -#define NewNPN_GetJavaEnvProc(FUNC) \ - ((NPN_GetJavaEnvUPP) (FUNC)) -#define CallNPN_GetJavaEnvProc(FUNC) \ - (*(FUNC))() - -#endif - - -/* NPN_GetJavaPeer */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_GetJavaPeerUPP; -enum { - uppNPN_GetJavaPeerProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | RESULT_SIZE(SIZE_CODE(sizeof(jref))) -}; - -#define NewNPN_GetJavaPeerProc(FUNC) \ - (NPN_GetJavaPeerUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetJavaPeerProcInfo, GetCurrentArchitecture()) -#define CallNPN_GetJavaPeerProc(FUNC, ARG1) \ - (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJavaPeerProcInfo, (ARG1)) - -#else - -typedef jref (*NPN_GetJavaPeerUPP)(NPP instance); -#define NewNPN_GetJavaPeerProc(FUNC) \ - ((NPN_GetJavaPeerUPP) (FUNC)) -#define CallNPN_GetJavaPeerProc(FUNC, ARG1) \ - (*(FUNC))((ARG1)) - -#endif - - - - -/****************************************************************************************** - * The actual plugin function table definitions - *******************************************************************************************/ - -typedef struct _NPPluginFuncs { - uint16 size; - uint16 version; - NPP_NewUPP newp; - NPP_DestroyUPP destroy; - NPP_SetWindowUPP setwindow; - NPP_NewStreamUPP newstream; - NPP_DestroyStreamUPP destroystream; - NPP_StreamAsFileUPP asfile; - NPP_WriteReadyUPP writeready; - NPP_WriteUPP write; - NPP_PrintUPP print; - NPP_HandleEventUPP event; - NPP_URLNotifyUPP urlnotify; - JRIGlobalRef javaClass; -} NPPluginFuncs; - -typedef struct _NPNetscapeFuncs { - uint16 size; - uint16 version; - NPN_GetURLUPP geturl; - NPN_PostURLUPP posturl; - NPN_RequestReadUPP requestread; - NPN_NewStreamUPP newstream; - NPN_WriteUPP write; - NPN_DestroyStreamUPP destroystream; - NPN_StatusUPP status; - NPN_UserAgentUPP uagent; - NPN_MemAllocUPP memalloc; - NPN_MemFreeUPP memfree; - NPN_MemFlushUPP memflush; - NPN_ReloadPluginsUPP reloadplugins; - NPN_GetJavaEnvUPP getJavaEnv; - NPN_GetJavaPeerUPP getJavaPeer; - NPN_GetURLNotifyUPP geturlnotify; - NPN_PostURLNotifyUPP posturlnotify; -#ifdef XP_UNIX - NPN_GetValueUPP getvalue; -#endif /* XP_UNIX */ -} NPNetscapeFuncs; - - - -#ifdef XP_MAC -/****************************************************************************************** - * Mac platform-specific plugin glue stuff - *******************************************************************************************/ - -/* - * Main entry point of the plugin. - * This routine will be called when the plugin is loaded. The function - * tables are passed in and the plugin fills in the NPPluginFuncs table - * and NPPShutdownUPP for Netscape's use. - */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_MainEntryUPP; -enum { - uppNPP_MainEntryProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPNetscapeFuncs*))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPluginFuncs*))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPP_ShutdownUPP*))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPP_MainEntryProc(FUNC) \ - (NPP_MainEntryUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_MainEntryProcInfo, GetCurrentArchitecture()) -#define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP) \ - CallUniversalProc((UniversalProcPtr)(FUNC), (ProcInfoType)uppNPP_MainEntryProcInfo, (netscapeFunc), (pluginFunc), (shutdownUPP)) - -#else - -typedef NPError (*NPP_MainEntryUPP)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownUPP*); -#define NewNPP_MainEntryProc(FUNC) \ - ((NPP_MainEntryUPP) (FUNC)) -#define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP) \ - (*(FUNC))((netscapeFunc), (pluginFunc), (shutdownUPP)) - -#endif -#endif /* MAC */ - - -#ifdef _WINDOWS - -#ifdef __cplusplus -extern "C" { -#endif - -/* plugin meta member functions */ - -NPError WINAPI NP_GetEntryPoints(NPPluginFuncs* pFuncs); - -NPError WINAPI NP_Initialize(NPNetscapeFuncs* pFuncs); - -NPError WINAPI NP_Shutdown(); - -#ifdef __cplusplus -} -#endif - -#endif /* _WINDOWS */ - -#ifdef XP_UNIX - -#ifdef __cplusplus -extern "C" { -#endif - -/* plugin meta member functions */ - -char* NP_GetMIMEDescription(void); -NPError NP_Initialize(NPNetscapeFuncs*, NPPluginFuncs*); -NPError NP_Shutdown(void); - -#ifdef __cplusplus -} -#endif - -#endif /* XP_UNIX */ - -#endif /* _NPUPP_H_ */ diff --git a/mozilla/java/waterfall/wf/src/plugin/netscape4/npupp.h.my b/mozilla/java/waterfall/wf/src/plugin/netscape4/npupp.h.my deleted file mode 100644 index a67ff3be1a4..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/netscape4/npupp.h.my +++ /dev/null @@ -1,1021 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: npupp.h.my,v 1.1.1.1 2001-05-09 17:30:10 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* -*- Mode: C; tab-width: 4; -*- */ -/* - * npupp.h $Revision: 1.1.1.1 $ - * function call mecahnics needed by platform specific glue code. - */ - - -#ifndef _NPUPP_H_ -#define _NPUPP_H_ - -#ifndef GENERATINGCFM -#define GENERATINGCFM 0 -#endif - -#ifndef _NPAPI_H_ -#include "npapi.h" -#endif - -//#include "jri.h" - -/****************************************************************************************** - plug-in function table macros - for each function in and out of the plugin API we define - typedef NPP_FooUPP - #define NewNPP_FooProc - #define CallNPP_FooProc - for mac, define the UPP magic for PPC/68K calling - *******************************************************************************************/ - - -/* NPP_Initialize */ - -#if GENERATINGCFM -typedef UniversalProcPtr NPP_InitializeUPP; - -enum { - uppNPP_InitializeProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0)) - | RESULT_SIZE(SIZE_CODE(0)) -}; - -#define NewNPP_InitializeProc(FUNC) \ - (NPP_InitializeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_InitializeProcInfo, GetCurrentArchitecture()) -#define CallNPP_InitializeProc(FUNC) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_InitializeProcInfo) - -#else - -typedef void (*NPP_InitializeUPP)(void); -#define NewNPP_InitializeProc(FUNC) \ - ((NPP_InitializeUPP) (FUNC)) -#define CallNPP_InitializeProc(FUNC) \ - (*(FUNC))() - -#endif - - -/* NPP_Shutdown */ - -#if GENERATINGCFM -typedef UniversalProcPtr NPP_ShutdownUPP; - -enum { - uppNPP_ShutdownProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0)) - | RESULT_SIZE(SIZE_CODE(0)) -}; - -#define NewNPP_ShutdownProc(FUNC) \ - (NPP_ShutdownUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_ShutdownProcInfo, GetCurrentArchitecture()) -#define CallNPP_ShutdownProc(FUNC) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_ShutdownProcInfo) - -#else - -typedef void (*NPP_ShutdownUPP)(void); -#define NewNPP_ShutdownProc(FUNC) \ - ((NPP_ShutdownUPP) (FUNC)) -#define CallNPP_ShutdownProc(FUNC) \ - (*(FUNC))() - -#endif - - -/* NPP_New */ - -#if GENERATINGCFM -typedef UniversalProcPtr NPP_NewUPP; - -enum { - uppNPP_NewProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPMIMEType))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(uint16))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int16))) - | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(char **))) - | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(char **))) - | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(NPSavedData *))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; - -#define NewNPP_NewProc(FUNC) \ - (NPP_NewUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewProcInfo, GetCurrentArchitecture()) -#define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewProcInfo, \ - (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)) -#else - -typedef NPError (*NPP_NewUPP)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved); -#define NewNPP_NewProc(FUNC) \ - ((NPP_NewUPP) (FUNC)) -#define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \ - (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)) - -#endif - - -/* NPP_Destroy */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_DestroyUPP; -enum { - uppNPP_DestroyProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPSavedData **))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPP_DestroyProc(FUNC) \ - (NPP_DestroyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyProcInfo, GetCurrentArchitecture()) -#define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyProcInfo, (ARG1), (ARG2)) -#else - -typedef NPError (*NPP_DestroyUPP)(NPP instance, NPSavedData** save); -#define NewNPP_DestroyProc(FUNC) \ - ((NPP_DestroyUPP) (FUNC)) -#define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \ - (*(FUNC))((ARG1), (ARG2)) - -#endif - - -/* NPP_SetWindow */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_SetWindowUPP; -enum { - uppNPP_SetWindowProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPWindow *))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPP_SetWindowProc(FUNC) \ - (NPP_SetWindowUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_SetWindowProcInfo, GetCurrentArchitecture()) -#define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_SetWindowProcInfo, (ARG1), (ARG2)) - -#else - -typedef NPError (*NPP_SetWindowUPP)(NPP instance, NPWindow* window); -#define NewNPP_SetWindowProc(FUNC) \ - ((NPP_SetWindowUPP) (FUNC)) -#define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \ - (*(FUNC))((ARG1), (ARG2)) - -#endif - - -/* NPP_NewStream */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_NewStreamUPP; -enum { - uppNPP_NewStreamProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPStream *))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPBool))) - | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(uint16 *))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPP_NewStreamProc(FUNC) \ - (NPP_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewStreamProcInfo, GetCurrentArchitecture()) -#define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewStreamProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5)) -#else - -typedef NPError (*NPP_NewStreamUPP)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype); -#define NewNPP_NewStreamProc(FUNC) \ - ((NPP_NewStreamUPP) (FUNC)) -#define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \ - (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5)) -#endif - - -/* NPP_DestroyStream */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_DestroyStreamUPP; -enum { - uppNPP_DestroyStreamProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPP_DestroyStreamProc(FUNC) \ - (NPP_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, GetCurrentArchitecture()) -#define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPReasonArg) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, (NPParg), (NPStreamPtr), (NPReasonArg)) - -#else - -typedef NPError (*NPP_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason); -#define NewNPP_DestroyStreamProc(FUNC) \ - ((NPP_DestroyStreamUPP) (FUNC)) -#define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPReasonArg) \ - (*(FUNC))((NPParg), (NPStreamPtr), (NPReasonArg)) - -#endif - - -/* NPP_WriteReady */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_WriteReadyUPP; -enum { - uppNPP_WriteReadyProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) - | RESULT_SIZE(SIZE_CODE(sizeof(int32))) -}; -#define NewNPP_WriteReadyProc(FUNC) \ - (NPP_WriteReadyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, GetCurrentArchitecture()) -#define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \ - (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, (NPParg), (NPStreamPtr)) - -#else - -typedef int32 (*NPP_WriteReadyUPP)(NPP instance, NPStream* stream); -#define NewNPP_WriteReadyProc(FUNC) \ - ((NPP_WriteReadyUPP) (FUNC)) -#define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \ - (*(FUNC))((NPParg), (NPStreamPtr)) - -#endif - - -/* NPP_Write */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_WriteUPP; -enum { - uppNPP_WriteProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int32))) - | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(void*))) - | RESULT_SIZE(SIZE_CODE(sizeof(int32))) -}; -#define NewNPP_WriteProc(FUNC) \ - (NPP_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteProcInfo, GetCurrentArchitecture()) -#define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr) \ - (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteProcInfo, (NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr)) - -#else - -typedef int32 (*NPP_WriteUPP)(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer); -#define NewNPP_WriteProc(FUNC) \ - ((NPP_WriteUPP) (FUNC)) -#define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr) \ - (*(FUNC))((NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr)) - -#endif - - -/* NPP_StreamAsFile */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_StreamAsFileUPP; -enum { - uppNPP_StreamAsFileProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *))) - | RESULT_SIZE(SIZE_CODE(0)) -}; -#define NewNPP_StreamAsFileProc(FUNC) \ - (NPP_StreamAsFileUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, GetCurrentArchitecture()) -#define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, (ARG1), (ARG2), (ARG3)) - -#else - -typedef void (*NPP_StreamAsFileUPP)(NPP instance, NPStream* stream, const char* fname); -#define NewNPP_StreamAsFileProc(FUNC) \ - ((NPP_StreamAsFileUPP) (FUNC)) -#define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \ - (*(FUNC))((ARG1), (ARG2), (ARG3)) -#endif - - -/* NPP_Print */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_PrintUPP; -enum { - uppNPP_PrintProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPrint *))) - | RESULT_SIZE(SIZE_CODE(0)) -}; -#define NewNPP_PrintProc(FUNC) \ - (NPP_PrintUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_PrintProcInfo, GetCurrentArchitecture()) -#define CallNPP_PrintProc(FUNC, NPParg, voidPtr) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_PrintProcInfo, (NPParg), (voidPtr)) - -#else - -typedef void (*NPP_PrintUPP)(NPP instance, NPPrint* platformPrint); -#define NewNPP_PrintProc(FUNC) \ - ((NPP_PrintUPP) (FUNC)) -#define CallNPP_PrintProc(FUNC, NPParg, NPPrintArg) \ - (*(FUNC))((NPParg), (NPPrintArg)) - -#endif - - -/* NPP_HandleEvent */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_HandleEventUPP; -enum { - uppNPP_HandleEventProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void *))) - | RESULT_SIZE(SIZE_CODE(sizeof(int16))) -}; -#define NewNPP_HandleEventProc(FUNC) \ - (NPP_HandleEventUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_HandleEventProcInfo, GetCurrentArchitecture()) -#define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \ - (int16)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_HandleEventProcInfo, (NPParg), (voidPtr)) - -#else - -typedef int16 (*NPP_HandleEventUPP)(NPP instance, void* event); -#define NewNPP_HandleEventProc(FUNC) \ - ((NPP_HandleEventUPP) (FUNC)) -#define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \ - (*(FUNC))((NPParg), (voidPtr)) - -#endif - - -/* NPP_URLNotify */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_URLNotifyUPP; -enum { - uppNPP_URLNotifyProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*))) - | RESULT_SIZE(SIZE_CODE(SIZE_CODE(0))) -}; -#define NewNPP_URLNotifyProc(FUNC) \ - (NPP_URLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_URLNotifyProcInfo, GetCurrentArchitecture()) -#define CallNPP_URLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_URLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4)) - -#else - -typedef void (*NPP_URLNotifyUPP)(NPP instance, const char* url, NPReason reason, void* notifyData); -#define NewNPP_URLNotifyProc(FUNC) \ - ((NPP_URLNotifyUPP) (FUNC)) -#define CallNPP_URLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ - (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4)) - -#endif - - - - -/* - * Netscape entry points - */ - -#ifdef XP_UNIX - -/* NPN_GetValue */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_GetValueUPP; -enum { - uppNPN_GetValueProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPNVariable))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_GetValueProc(FUNC) \ - (NPN_GetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetValueProcInfo, GetCurrentArchitecture()) -#define CallNPN_GetURNotifyLProc(FUNC, ARG1, ARG2, ARG3) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetValueProcInfo, (ARG1), (ARG2), (ARG3)) -#else - -typedef NPError (*NPN_GetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue); -#define NewNPN_GetValueProc(FUNC) \ - ((NPN_GetValueUPP) (FUNC)) -#define CallNPN_GetValueProc(FUNC, ARG1, ARG2, ARG3) \ - (*(FUNC))((ARG1), (ARG2), (ARG3)) -#endif - -#endif /* XP_UNIX */ - - - -/* NPN_GetUrlNotify */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_GetURLNotifyUPP; -enum { - uppNPN_GetURLNotifyProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_GetURLNotifyProc(FUNC) \ - (NPN_GetURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLNotifyProcInfo, GetCurrentArchitecture()) -#define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4)) -#else - -typedef NPError (*NPN_GetURLNotifyUPP)(NPP instance, const char* url, const char* window, void* notifyData); -#define NewNPN_GetURLNotifyProc(FUNC) \ - ((NPN_GetURLNotifyUPP) (FUNC)) -#define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ - (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4)) -#endif - - -/* NPN_PostUrlNotify */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_PostURLNotifyUPP; -enum { - uppNPN_PostURLNotifyProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32))) - | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool))) - | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(void*))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_PostURLNotifyProc(FUNC) \ - (NPN_PostURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLNotifyProcInfo, GetCurrentArchitecture()) -#define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)) -#else - -typedef NPError (*NPN_PostURLNotifyUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData); -#define NewNPN_PostURLNotifyProc(FUNC) \ - ((NPN_PostURLNotifyUPP) (FUNC)) -#define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \ - (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)) -#endif - - -/* NPN_GetUrl */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_GetURLUPP; -enum { - uppNPN_GetURLProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_GetURLProc(FUNC) \ - (NPN_GetURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLProcInfo, GetCurrentArchitecture()) -#define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLProcInfo, (ARG1), (ARG2), (ARG3)) -#else - -typedef NPError (*NPN_GetURLUPP)(NPP instance, const char* url, const char* window); -#define NewNPN_GetURLProc(FUNC) \ - ((NPN_GetURLUPP) (FUNC)) -#define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \ - (*(FUNC))((ARG1), (ARG2), (ARG3)) -#endif - - -/* NPN_PostUrl */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_PostURLUPP; -enum { - uppNPN_PostURLProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32))) - | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*))) - | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_PostURLProc(FUNC) \ - (NPN_PostURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLProcInfo, GetCurrentArchitecture()) -#define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6)) -#else - -typedef NPError (*NPN_PostURLUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file); -#define NewNPN_PostURLProc(FUNC) \ - ((NPN_PostURLUPP) (FUNC)) -#define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \ - (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6)) -#endif - - -/* NPN_RequestRead */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_RequestReadUPP; -enum { - uppNPN_RequestReadProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPStream *))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPByteRange *))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_RequestReadProc(FUNC) \ - (NPN_RequestReadUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_RequestReadProcInfo, GetCurrentArchitecture()) -#define CallNPN_RequestReadProc(FUNC, stream, range) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_RequestReadProcInfo, (stream), (range)) - -#else - -typedef NPError (*NPN_RequestReadUPP)(NPStream* stream, NPByteRange* rangeList); -#define NewNPN_RequestReadProc(FUNC) \ - ((NPN_RequestReadUPP) (FUNC)) -#define CallNPN_RequestReadProc(FUNC, stream, range) \ - (*(FUNC))((stream), (range)) - -#endif - - -/* NPN_NewStream */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_NewStreamUPP; -enum { - uppNPN_NewStreamProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPStream **))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_NewStreamProc(FUNC) \ - (NPN_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_NewStreamProcInfo, GetCurrentArchitecture()) -#define CallNPN_NewStreamProc(FUNC, npp, type, window, stream) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_NewStreamProcInfo, (npp), (type), (window), (stream)) - -#else - -typedef NPError (*NPN_NewStreamUPP)(NPP instance, NPMIMEType type, const char* window, NPStream** stream); -#define NewNPN_NewStreamProc(FUNC) \ - ((NPN_NewStreamUPP) (FUNC)) -#define CallNPN_NewStreamProc(FUNC, npp, type, window, stream) \ - (*(FUNC))((npp), (type), (window), (stream)) - -#endif - - -/* NPN_Write */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_WriteUPP; -enum { - uppNPN_WriteProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*))) - | RESULT_SIZE(SIZE_CODE(sizeof(int32))) -}; -#define NewNPN_WriteProc(FUNC) \ - (NPN_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_WriteProcInfo, GetCurrentArchitecture()) -#define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \ - (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_WriteProcInfo, (npp), (stream), (len), (buffer)) - -#else - -typedef int32 (*NPN_WriteUPP)(NPP instance, NPStream* stream, int32 len, void* buffer); -#define NewNPN_WriteProc(FUNC) \ - ((NPN_WriteUPP) (FUNC)) -#define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \ - (*(FUNC))((npp), (stream), (len), (buffer)) - -#endif - - -/* NPN_DestroyStream */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_DestroyStreamUPP; -enum { - uppNPN_DestroyStreamProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP ))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPN_DestroyStreamProc(FUNC) \ - (NPN_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, GetCurrentArchitecture()) -#define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason) \ - (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, (npp), (stream), (reason)) - -#else - -typedef NPError (*NPN_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason); -#define NewNPN_DestroyStreamProc(FUNC) \ - ((NPN_DestroyStreamUPP) (FUNC)) -#define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason) \ - (*(FUNC))((npp), (stream), (reason)) - -#endif - - -/* NPN_Status */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_StatusUPP; -enum { - uppNPN_StatusProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(char *))) -}; - -#define NewNPN_StatusProc(FUNC) \ - (NPN_StatusUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_StatusProcInfo, GetCurrentArchitecture()) -#define CallNPN_StatusProc(FUNC, npp, msg) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_StatusProcInfo, (npp), (msg)) - -#else - -typedef void (*NPN_StatusUPP)(NPP instance, const char* message); -#define NewNPN_StatusProc(FUNC) \ - ((NPN_StatusUPP) (FUNC)) -#define CallNPN_StatusProc(FUNC, npp, msg) \ - (*(FUNC))((npp), (msg)) - -#endif - - -/* NPN_UserAgent */ -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_UserAgentUPP; -enum { - uppNPN_UserAgentProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | RESULT_SIZE(SIZE_CODE(sizeof(const char *))) -}; - -#define NewNPN_UserAgentProc(FUNC) \ - (NPN_UserAgentUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_UserAgentProcInfo, GetCurrentArchitecture()) -#define CallNPN_UserAgentProc(FUNC, ARG1) \ - (const char*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_UserAgentProcInfo, (ARG1)) - -#else - -typedef const char* (*NPN_UserAgentUPP)(NPP instance); -#define NewNPN_UserAgentProc(FUNC) \ - ((NPN_UserAgentUPP) (FUNC)) -#define CallNPN_UserAgentProc(FUNC, ARG1) \ - (*(FUNC))((ARG1)) - -#endif - - -/* NPN_MemAlloc */ -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_MemAllocUPP; -enum { - uppNPN_MemAllocProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32))) - | RESULT_SIZE(SIZE_CODE(sizeof(void *))) -}; - -#define NewNPN_MemAllocProc(FUNC) \ - (NPN_MemAllocUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemAllocProcInfo, GetCurrentArchitecture()) -#define CallNPN_MemAllocProc(FUNC, ARG1) \ - (void*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemAllocProcInfo, (ARG1)) - -#else - -typedef void* (*NPN_MemAllocUPP)(uint32 size); -#define NewNPN_MemAllocProc(FUNC) \ - ((NPN_MemAllocUPP) (FUNC)) -#define CallNPN_MemAllocProc(FUNC, ARG1) \ - (*(FUNC))((ARG1)) - -#endif - - -/* NPN__MemFree */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_MemFreeUPP; -enum { - uppNPN_MemFreeProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void *))) -}; - -#define NewNPN_MemFreeProc(FUNC) \ - (NPN_MemFreeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFreeProcInfo, GetCurrentArchitecture()) -#define CallNPN_MemFreeProc(FUNC, ARG1) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFreeProcInfo, (ARG1)) - -#else - -typedef void (*NPN_MemFreeUPP)(void* ptr); -#define NewNPN_MemFreeProc(FUNC) \ - ((NPN_MemFreeUPP) (FUNC)) -#define CallNPN_MemFreeProc(FUNC, ARG1) \ - (*(FUNC))((ARG1)) - -#endif - - -/* NPN_MemFlush */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_MemFlushUPP; -enum { - uppNPN_MemFlushProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32))) - | RESULT_SIZE(SIZE_CODE(sizeof(uint32))) -}; - -#define NewNPN_MemFlushProc(FUNC) \ - (NPN_MemFlushUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFlushProcInfo, GetCurrentArchitecture()) -#define CallNPN_MemFlushProc(FUNC, ARG1) \ - (uint32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFlushProcInfo, (ARG1)) - -#else - -typedef uint32 (*NPN_MemFlushUPP)(uint32 size); -#define NewNPN_MemFlushProc(FUNC) \ - ((NPN_MemFlushUPP) (FUNC)) -#define CallNPN_MemFlushProc(FUNC, ARG1) \ - (*(FUNC))((ARG1)) - -#endif - - - -/* NPN_ReloadPlugins */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_ReloadPluginsUPP; -enum { - uppNPN_ReloadPluginsProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPBool))) - | RESULT_SIZE(SIZE_CODE(0)) -}; - -#define NewNPN_ReloadPluginsProc(FUNC) \ - (NPN_ReloadPluginsUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, GetCurrentArchitecture()) -#define CallNPN_ReloadPluginsProc(FUNC, ARG1) \ - (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, (ARG1)) - -#else - -typedef void (*NPN_ReloadPluginsUPP)(NPBool reloadPages); -#define NewNPN_ReloadPluginsProc(FUNC) \ - ((NPN_ReloadPluginsUPP) (FUNC)) -#define CallNPN_ReloadPluginsProc(FUNC, ARG1) \ - (*(FUNC))((ARG1)) - -#endif - - -/* NPN_GetJavaEnv */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_GetJavaEnvUPP; -enum { - uppNPN_GetJavaEnvProcInfo = kThinkCStackBased - | RESULT_SIZE(SIZE_CODE(sizeof(void*))) -}; - -#define NewNPN_GetJavaEnvProc(FUNC) \ - (NPN_GetJavaEnvUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetJavaEnvProcInfo, GetCurrentArchitecture()) -#define CallNPN_GetJavaEnvProc(FUNC) \ - (JRIEnv*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJavaEnvProcInfo) - -#else - -typedef void* (*NPN_GetJavaEnvUPP)(void); -#define NewNPN_GetJavaEnvProc(FUNC) \ - ((NPN_GetJavaEnvUPP) (FUNC)) -#define CallNPN_GetJavaEnvProc(FUNC) \ - (*(FUNC))() - -#endif - - -/* NPN_GetJavaPeer */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPN_GetJavaPeerUPP; -enum { - uppNPN_GetJavaPeerProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) - | RESULT_SIZE(SIZE_CODE(sizeof(void*))) -}; - -#define NewNPN_GetJavaPeerProc(FUNC) \ - (NPN_GetJavaPeerUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetJavaPeerProcInfo, GetCurrentArchitecture()) -#define CallNPN_GetJavaPeerProc(FUNC, ARG1) \ - (void*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJavaPeerProcInfo, (ARG1)) - -#else - -typedef void* (*NPN_GetJavaPeerUPP)(NPP instance); -#define NewNPN_GetJavaPeerProc(FUNC) \ - ((NPN_GetJavaPeerUPP) (FUNC)) -#define CallNPN_GetJavaPeerProc(FUNC, ARG1) \ - (*(FUNC))((ARG1)) - -#endif - - - - -/****************************************************************************************** - * The actual plugin function table definitions - *******************************************************************************************/ - -typedef struct _NPPluginFuncs { - uint16 size; - uint16 version; - NPP_NewUPP newp; - NPP_DestroyUPP destroy; - NPP_SetWindowUPP setwindow; - NPP_NewStreamUPP newstream; - NPP_DestroyStreamUPP destroystream; - NPP_StreamAsFileUPP asfile; - NPP_WriteReadyUPP writeready; - NPP_WriteUPP write; - NPP_PrintUPP print; - NPP_HandleEventUPP event; - NPP_URLNotifyUPP urlnotify; - void* javaClass; -} NPPluginFuncs; - -typedef struct _NPNetscapeFuncs { - uint16 size; - uint16 version; - NPN_GetURLUPP geturl; - NPN_PostURLUPP posturl; - NPN_RequestReadUPP requestread; - NPN_NewStreamUPP newstream; - NPN_WriteUPP write; - NPN_DestroyStreamUPP destroystream; - NPN_StatusUPP status; - NPN_UserAgentUPP uagent; - NPN_MemAllocUPP memalloc; - NPN_MemFreeUPP memfree; - NPN_MemFlushUPP memflush; - NPN_ReloadPluginsUPP reloadplugins; - NPN_GetJavaEnvUPP getJavaEnv; - NPN_GetJavaPeerUPP getJavaPeer; - NPN_GetURLNotifyUPP geturlnotify; - NPN_PostURLNotifyUPP posturlnotify; -#ifdef XP_UNIX - NPN_GetValueUPP getvalue; -#endif /* XP_UNIX */ -} NPNetscapeFuncs; - - - -#ifdef XP_MAC -/****************************************************************************************** - * Mac platform-specific plugin glue stuff - *******************************************************************************************/ - -/* - * Main entry point of the plugin. - * This routine will be called when the plugin is loaded. The function - * tables are passed in and the plugin fills in the NPPluginFuncs table - * and NPPShutdownUPP for Netscape's use. - */ - -#if GENERATINGCFM - -typedef UniversalProcPtr NPP_MainEntryUPP; -enum { - uppNPP_MainEntryProcInfo = kThinkCStackBased - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPNetscapeFuncs*))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPluginFuncs*))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPP_ShutdownUPP*))) - | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) -}; -#define NewNPP_MainEntryProc(FUNC) \ - (NPP_MainEntryUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_MainEntryProcInfo, GetCurrentArchitecture()) -#define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP) \ - CallUniversalProc((UniversalProcPtr)(FUNC), (ProcInfoType)uppNPP_MainEntryProcInfo, (netscapeFunc), (pluginFunc), (shutdownUPP)) - -#else - -typedef NPError (*NPP_MainEntryUPP)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownUPP*); -#define NewNPP_MainEntryProc(FUNC) \ - ((NPP_MainEntryUPP) (FUNC)) -#define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP) \ - (*(FUNC))((netscapeFunc), (pluginFunc), (shutdownUPP)) - -#endif -#endif /* MAC */ - - -#ifdef _WINDOWS - -#ifdef __cplusplus -extern "C" { -#endif - -/* plugin meta member functions */ - -NPError WINAPI NP_GetEntryPoints(NPPluginFuncs* pFuncs); - -NPError WINAPI NP_Initialize(NPNetscapeFuncs* pFuncs); - -NPError WINAPI NP_Shutdown(); - -#ifdef __cplusplus -} -#endif - -#endif /* _WINDOWS */ - -#ifdef XP_UNIX - -#ifdef __cplusplus -extern "C" { -#endif - -/* plugin meta member functions */ - -char* NP_GetMIMEDescription(void); -NPError NP_Initialize(NPNetscapeFuncs*, NPPluginFuncs*); -NPError NP_Shutdown(void); - -#ifdef __cplusplus -} -#endif - -#endif /* XP_UNIX */ - -#endif /* _NPUPP_H_ */ diff --git a/mozilla/java/waterfall/wf/src/plugin/netscape4/stubs.c b/mozilla/java/waterfall/wf/src/plugin/netscape4/stubs.c deleted file mode 100644 index b589a9514b1..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/netscape4/stubs.c +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: stubs.c,v 1.1.1.1 2001-05-09 17:30:10 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* -*- Mode: C; tab-width: 4; -*- */ -/******************************************************************************* - * Simple LiveConnect Sample Plugin - * Copyright (c) 1996 Netscape Communications. All rights reserved. - ******************************************************************************/ - -/* -** Ok, so we don't usually include .c files (only .h files) but we're -** doing it here to avoid some fancy make rules. First pull in the common -** glue code: -*/ -#ifdef XP_UNIX -#include "../../../common/npunix.c" -#endif diff --git a/mozilla/java/waterfall/wf/src/plugin/netscape4/wfe_netscape4.c b/mozilla/java/waterfall/wf/src/plugin/netscape4/wfe_netscape4.c deleted file mode 100644 index 7d17e0785cc..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/netscape4/wfe_netscape4.c +++ /dev/null @@ -1,412 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: wfe_netscape4.c,v 1.1.1.1 2001-05-09 17:30:10 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include "jvmp.h" -#include "common.h" -#include "shmtran.h" - -/* Extension parameters */ -static jint g_side = 0; - -#ifdef XP_UNIX -#include -#include -#include -#include -#include -#include - -/* PART 1 - application specific host callbacks */ -static XID g_xid = 0; -static int g_msgid1 = -1; -static Display* GetDisplay() -{ - char* dname; - static Display* dpy = NULL; - - if (dpy) return dpy; - dname = getenv("DISPLAY"); - if (!dname) return NULL; - dpy = XOpenDisplay(dname); - return dpy; -} - -static int SetTransport(int xid, int* pmsg_id) -{ - int msg_id; - - g_xid = xid; - /* create msg queue used by extension to recieve messages */ - if ((msg_id = - JVMP_msgget (0, IPC_CREAT | IPC_PRIVATE | IPC_EXCL | 0770)) == -1) - { - perror("host: msgget"); - return 0; - } - *pmsg_id = msg_id; - return 1; -} -#endif - -int NotifyHost() -{ -#ifdef XP_UNIX - static Atom atom = 0; - static Display* dpy; - - if (g_side != 2 || !g_xid) return 0; /* has sense only on JVM side - and after init message has come */ - dpy = GetDisplay(); - if (!dpy) return 0; - if (!atom) atom = XInternAtom(dpy, "WF atom", FALSE); - XChangeProperty(dpy, g_xid, atom, XA_STRING, 8, - PropModeReplace, NULL, 0); - XFlush(dpy); - return 1; -#endif -} - - -/* PART 2 - Extension API implementation and related functions */ - -/* this is a dummy method to make linker happy */ -int JVMP_ExecuteShmRequest(JVMP_ShmRequest* req) -{ - fprintf(stderr, "NEVER CALL ME\n"); - return 1; -} - -/* this one is called only on JVM side and handle extension spec*/ -static int JVMP_ExecuteExtShmRequest(JVMP_ShmRequest* req) -{ - int vendor, funcno, xid; - char sign[40], *docbase; - int* pmsg_id; - jint *pid; - - if (!req) return 0; - vendor = JVMP_GET_VENDOR(req->func_no); - if (vendor != WFNetscape4VendorID) return 0; - funcno = JVMP_GET_EXT_FUNCNO(req->func_no); - switch(funcno) - { - case 1: - /* XID setter on Unix, HANDLE setter on Win32 */ - sprintf(sign, "Ii"); - pmsg_id = &g_msgid1; - JVMP_DecodeRequest(req, 0, sign, &xid, &pmsg_id); - /* kinda tricky to allow msg queue clean up */ - req->retval = SetTransport(xid, &g_msgid1); - JVMP_EncodeRequest(req, sign, xid, pmsg_id); - break; - case 5: - /* doc base setter - stupid Netscape */ - sprintf(sign, "IS"); - pid = NULL; - JVMP_DecodeRequest(req, 1, sign, pid, &docbase); - fprintf(stderr, "got docbase %s for id %ld\n", docbase, *pid); - free(pid); free(docbase); - break; - default: - fprintf(stderr, "JVM got func %d\n", funcno); - return 0; - } - return 1; -} - - -/* extension API implementation */ -static jint JNICALL JVMPExt_Init(jint side) -{ - g_side = side; - if (g_side == 0) return JNI_TRUE; /* in-proc case. Do nothing yet */ - if (g_side == 1) - { - /* host side - create event widget and custom message queue, - and send their XID and msg_id to JVM side using - SHM transport. Sync is OK, as this Init methods are called in right - order - host side first, JVM side next. Really I'll do it - in JavaPlugin.c due current design it's more acceptable. */ - } - else - { - /* JVM side - add extention callback to handle XID when it'll come. - Then use this XID as notificator after putting smth into this - extension's SHM queue. It's also not required as now callback - is JVMPExt_ScheduleRequest and called by JVMP automatically on every - non system request. - */ - } - return JNI_TRUE; -} - -static jint JNICALL JVMPExt_Shutdown() -{ - return JNI_TRUE; -} - -static jint JNICALL JVMPExt_GetExtInfo(jint *pID, jint *pVersion) -{ - *pID = WFNetscape4VendorID; - *pVersion = WFNetscape4ExtVersion; - return JNI_TRUE; -} - - -static jint JNICALL JVMPExt_GetBootstrapClass(char* *bootstrapClassPath, - char* *bootstrapClassName) -{ - /* should be defined at installation time */ - *bootstrapClassPath = - "file:///ws/M2308/mozilla/modules/jvmp/build/unix/classes/"; - *bootstrapClassName = - "sun.jvmp.netscape4.NetscapePeerFactory"; - return JNI_TRUE; -} - -static jint JNICALL JVMPExt_ScheduleRequest(JVMP_ShmRequest* req, - jint local) -{ - if (local == JNI_TRUE) - return JVMP_ExecuteExtShmRequest(req); - if (g_side == 1) - { - /* host side */ - JVMP_SendShmRequest(req, 1); - JVMP_WaitConfirmShmRequest(req); - } - else - { - /* JVM side */ - JVMP_SendShmRequest(req, 1); - if (NotifyHost()) JVMP_WaitConfirmShmRequest(req); - } - return JNI_TRUE; -} - - - -static JVMP_Extension JVMP_Ext = -{ - &JVMPExt_Init, - &JVMPExt_Shutdown, - &JVMPExt_GetExtInfo, - &JVMPExt_GetBootstrapClass, - &JVMPExt_ScheduleRequest -}; - -jint JNICALL JVMP_GetExtension(JVMP_Extension** ext) -{ - *ext = &JVMP_Ext; - return JNI_TRUE; -} -/* PART3 - Java native methods implementation */ - -jint getID(JNIEnv* env, jobject jobj) -{ - jint id; - static jfieldID peerFID = NULL; - - if (!peerFID) - { - peerFID = (*env)->GetFieldID(env, - (*env)->GetObjectClass(env, jobj), - "m_id","I"); - if (!peerFID) return 0; - } - id = (*env)->GetIntField(env, jobj, peerFID); - return id; -} - -static jint GetParameters(jint id, char*** pkeys, char*** pvals, int *plen) -{ - JVMP_ShmRequest* req; - int *pres, *pid, i, len, argc, pos; - char* buf, sign[20]; - char **keys, **vals; -#define EXTRACT_STRING(res) \ - len = strlen(buf+pos)+1; \ - res = (char*)malloc(len); \ - memcpy(res, buf+pos, len); \ - pos += len; - - req = JVMP_NewShmReq(g_msgid1, - JVMP_NEW_EXT_FUNCNO(WFNetscape4VendorID, 2)); - pres = NULL; - pid = NULL; - buf = NULL; - sprintf(sign, "Iia[0]"); - JVMP_EncodeRequest(req, sign, id, pres, buf); - JVMPExt_ScheduleRequest(req, JNI_FALSE); - JVMP_DecodeRequest(req, 1, sign, pid, &pres, &buf); - /* here we hopefully got all our parameters in one huge buffer - now is time to make strings arrays from 'em */ - argc = *pres; - keys = (char**)malloc(argc*sizeof(char*)); - vals = (char**)malloc(argc*sizeof(char*)); - for (i=0, pos=0; iretval; -} - -static jint ShowDocument(jint id, char* url, char* status) -{ - JVMP_ShmRequest* req; - char sign[40]; - - req = JVMP_NewShmReq(g_msgid1, - JVMP_NEW_EXT_FUNCNO(WFNetscape4VendorID, 4)); - sprintf(sign, "ISS"); - JVMP_EncodeRequest(req, sign, id, url, status); - JVMPExt_ScheduleRequest(req, JNI_FALSE); - JVMP_DeleteShmReq(req); - return req->retval; -} - - - -JNIEXPORT jobjectArray JNICALL -Java_sun_jvmp_netscape4_MozillaAppletPeer_getParams(JNIEnv* env, jobject jobj) -{ - char **keys, **vals; - unsigned int i, len; - jclass StringClass, StringArrayClass; - jobjectArray jkeys, jvals, result; - jint id; - - id = getID(env, jobj); - if (!GetParameters(id, &keys, &vals, &len)) return NULL; - // hopefully here runtime is inited so those classes resolved - // without problems - maybe cache it - StringClass = (*env)->FindClass(env, "java/lang/String"); - StringArrayClass = (*env)->FindClass(env, "[Ljava/lang/String;"); - result = (*env)->NewObjectArray(env, 2, StringArrayClass, NULL); - jkeys = (*env)->NewObjectArray(env, len, StringClass, NULL); - jvals = (*env)->NewObjectArray(env, len, StringClass, NULL); - for (i=0; iSetObjectArrayElement(env, jkeys, i, - (*env)->NewStringUTF(env, keys[i])); - (*env)->SetObjectArrayElement(env, jvals, i, - (*env)->NewStringUTF(env, vals[i])); - free(keys[i]); free(vals[i]); - } - free(keys); free(vals); - (*env)->SetObjectArrayElement(env, result, 0, jkeys); - (*env)->SetObjectArrayElement(env, result, 1, jvals); - (*env)->DeleteLocalRef(env, jkeys); - (*env)->DeleteLocalRef(env, jvals); - return result; -} - -#if 0 -JNIEXPORT jstring JNICALL -Java_sun_jvmp_netscape4_MozillaAppletPeer_getProxyForURL(JNIEnv * env, - jobject jobj, - jstring jurl) -{ - jstring jresult; - jint res; - char *url, *result; - PluginInstance *wrapper; - - if (!(wrapper = getWrapper(env, jobj))) return NULL; - url = (char*)(*env)->GetStringUTFChars(env, jurl, NULL); - res = wrapper->GetProxyForURL(wrapper->info, url, &result); - (*env)->ReleaseStringUTFChars(env, jurl, url); - if (res != 0) return NULL; - jresult = (*env)->NewStringUTF(env, result); - return jresult; -} -#endif -/* - * Class: sun_jvmp_netscape4_MozillaAppletPeer - * Method: nativeShowStatus - * Signature: (Ljava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL -Java_sun_jvmp_netscape4_MozillaAppletPeer_nativeShowStatus - (JNIEnv * env, jobject jobj, jstring jstatus) -{ - jint res; - char *status; - jint id; - - if (!(id = getID(env, jobj))) return JNI_FALSE; - status = (char*)(*env)->GetStringUTFChars(env, jstatus, NULL); - res = ShowStatus(id, status); - (*env)->ReleaseStringUTFChars(env, jstatus, status); - return (res == 0); -} - -/* - * Class: sun_jvmp_netscape4_MozillaAppletPeer - * Method: nativeShowDocument - * Signature: (Ljava/lang/String;Ljava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL -Java_sun_jvmp_netscape4_MozillaAppletPeer_nativeShowDocument - (JNIEnv *env, jobject jobj, jstring jurl, jstring jtarget) -{ - int res; - char *url, *target; - jint id; - - if (!(id = getID(env, jobj))) return JNI_FALSE; - url = (char*)(*env)->GetStringUTFChars(env, jurl, NULL); - target = (char*)(*env)->GetStringUTFChars(env, jtarget, NULL); - res = ShowDocument(id, url, target); - (*env)->ReleaseStringUTFChars(env, jurl, url); - (*env)->ReleaseStringUTFChars(env, jtarget, target); - return (res == 0); -} - - - - - diff --git a/mozilla/java/waterfall/wf/src/plugin/unix/Makefile b/mozilla/java/waterfall/wf/src/plugin/unix/Makefile deleted file mode 100644 index b8ddcfa5f1e..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/unix/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: Makefile,v 1.1.1.1 2001-05-09 17:30:10 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -CFLAGS=-Wall -g -I../../../public/ -DJVMP_USE_SHM -all: shmtran.o jvmp_exec host -jvmp_exec: jvmp_exec.o shmtran.o - gcc -o jvmp_exec jvmp_exec.o shmtran.o -host: host.o shmtran.o - gcc -o host host.o shmtran.o -clean: - rm -rf *.o jvmp_exec host core diff --git a/mozilla/java/waterfall/wf/src/plugin/unix/java_plugin_shm.c b/mozilla/java/waterfall/wf/src/plugin/unix/java_plugin_shm.c deleted file mode 100644 index 801af4c03fa..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/unix/java_plugin_shm.c +++ /dev/null @@ -1,590 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: java_plugin_shm.c,v 1.1.1.1 2001-05-09 17:30:10 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* - all methods here but JVMP_GetPlugin() declared "static", as only access to - them is via structure returned by JVMP_GetPlugin(), so why to add needless - records to export table of plugin DLL. Also it looks like JNI approach. -*/ -#include -#include -#include -#include -#include -#include -#include "jvmp.h" -#include "shmtran.h" - -//#define PLUGIN_DEBUG 1 - - -static JavaVM* JVMP_JVM_running = NULL; -//static jobject JVMP_PluginInstance = NULL; -//static jclass JVMP_PluginClass = NULL; -static char* JVMP_plugin_home = NULL; -static char* global_libpath = NULL; -static int g_msgid; - -#ifdef PLUGIN_DEBUG -#define PLUGIN_LOG(s1) { fprintf (stderr, "Java Plugin: "); \ - fprintf(stderr, s1); fprintf(stderr, "\n"); } -#define PLUGIN_LOG2(s1, s2) { fprintf (stderr, "Java Plugin: "); \ - fprintf(stderr, s1, s2); fprintf(stderr, "\n"); } -#define PLUGIN_LOG3(s1, s2, s3) { fprintf (stderr, "Java Plugin: "); \ - fprintf(stderr, s1, s2, s3); fprintf(stderr, "\n"); } -#define PLUGIN_LOG4(s1, s2, s3, s4) { fprintf (stderr, "Java Plugin: "); \ - fprintf(stderr, s1, s2, s3 ,s4); fprintf(stderr, "\n"); } -#else -#define PLUGIN_LOG(s1) -#define PLUGIN_LOG2(s1, s2) -#define PLUGIN_LOG3(s1, s2, s3) -#define PLUGIN_LOG4(s1, s2, s3, s4) -#endif -#define JVMP_EXEC "jvmp_exec" - -static char* getPluginLibPath(char* home) { - static char* result = NULL; - - if (result != NULL) return result; - - result = (char*) malloc(3*strlen(home)+200); - /* FIXME !! */ - sprintf(result, -#ifdef _JVMP_SUNJVM - "%s/java/jre/lib/"ARCH"/hotspot:%s/java/jre/lib/"ARCH":%s" -#endif -#ifdef _JVMP_IBMJVM - "%s:%s/java/jre/bin:%s/java/jre/bin/classic" -#endif - , home, home, home); - return result; -} -static jint startSHM() { - static int started = 0; - char *libpath, *newlibpath, *pluginlibpath; - char *java_home, *jre_home; - char *jvmp_exec; - pid_t pid; - char* str; - struct stat sbuf; - int tmplen; - - if (started) return JNI_TRUE; - /* find out JAVA_PLUGIN_HOME */ - JVMP_plugin_home = getenv("JAVA_PLUGIN_HOME"); - if (JVMP_plugin_home == NULL) { - PLUGIN_LOG("Env variable JAVA_PLUGIN_HOME not set"); - return JNI_FALSE; - } - if ((stat(JVMP_plugin_home, &sbuf) < 0) || !S_ISDIR(sbuf.st_mode)) { - PLUGIN_LOG2("Bad value %s of JAVA_PLUGIN_HOME", JVMP_plugin_home); - return JNI_FALSE; - } - /* LD_LIBRARY_PATH correction */ - - pluginlibpath = getPluginLibPath(JVMP_plugin_home); - libpath = getenv("LD_LIBRARY_PATH"); - if (!libpath) libpath = ""; - tmplen = strlen(libpath) + strlen(pluginlibpath); - global_libpath = (char*) malloc(tmplen + 2); - newlibpath = (char*) malloc(tmplen + 22); - - sprintf(global_libpath, "%s:%s", pluginlibpath, libpath); - sprintf(newlibpath, "LD_LIBRARY_PATH=%s", global_libpath); - putenv(newlibpath); - java_home = (char*) malloc(strlen(JVMP_plugin_home)+40); - jre_home = (char*) malloc(strlen(JVMP_plugin_home)+40); -#ifdef _JVMP_IBMJVM - sprintf(java_home, "JAVAHOME=%s/java/jre", JVMP_plugin_home); - sprintf(jre_home, "JREHOME=%s/java/jre", JVMP_plugin_home); -#endif -#ifdef _JVMP_SUNJVM - sprintf(java_home, "JAVA_HOME=%s/java/jre/", JVMP_plugin_home); - sprintf(jre_home, "JREHOME=%s/java/jre/", JVMP_plugin_home); -#endif - putenv(java_home); - putenv(jre_home); - JVMP_ShmInit(1); /* init transport on host side */ - if ((g_msgid = JVMP_msgget (0, IPC_CREAT | IPC_PRIVATE | 0770)) == -1) - { - perror("host: msgget"); - return JNI_FALSE; - } - if ((pid = fork()) == 0) - { - /* child */ - str = (char*)malloc(20); - jvmp_exec = (char*)malloc(strlen(JVMP_EXEC)+ - strlen(JVMP_plugin_home)+2); - sprintf(jvmp_exec, "%s/%s", JVMP_plugin_home, JVMP_EXEC); - sprintf(str, "%d", g_msgid); - execlp(jvmp_exec, "jvmp_exec", str, NULL); - perror("exec"); - exit(1); - } - started = 1; - return JNI_TRUE; -} - -static jint JVMP_SetCap(JVMP_CallingContext *ctx, jint cap_no) -{ - JVMP_ALLOW_CAP(ctx->caps, cap_no); - return JNI_TRUE; -} - -static jint JVMP_SetCaps(JVMP_CallingContext *ctx, - JVMP_SecurityCap *new_caps) -{ - if (!new_caps) return JNI_FALSE; - memcpy(&(ctx->caps), new_caps, sizeof(JVMP_SecurityCap)); - return JNI_TRUE; -} - -static jint JVMP_GetCap(JVMP_CallingContext *ctx, jint cap_no) -{ - return JVMP_IS_CAP_ALLOWED(ctx->caps, cap_no); -} - - - -static jint JVMP_IsActionAllowed(JVMP_CallingContext *ctx, - JVMP_SecurityAction *caps) -{ - int i, r; - for(i=0, r=1; i < JVMP_MAX_CAPS_BYTES; i++) - { - r = - r && ((!(caps->bits)[i]) | - (((ctx->caps).bits)[i] & (caps->bits)[i])); - if (!r) return JNI_FALSE; - } - return JNI_TRUE; -} - -static JVMP_CallingContext* NewCallingContext() -{ - JVMP_CallingContext* ctx_new = NULL; - - ctx_new = (JVMP_CallingContext *) malloc(sizeof(JVMP_CallingContext)); - if (!ctx_new) return NULL; - ctx_new->source_thread = NULL; /* must be current thread */ - ctx_new->env = NULL; - ctx_new->source = NULL; - ctx_new->reserved0 = (void*)g_msgid; - JVMP_FORBID_ALL_CAPS(ctx_new->caps); - ctx_new->AllowCap = &JVMP_SetCap; - ctx_new->GetCap = &JVMP_GetCap; - ctx_new->SetCaps = &JVMP_SetCaps; - ctx_new->IsActionAllowed = &JVMP_IsActionAllowed; - return ctx_new; -} - - -/* prototype for this function */ -static jint JVMP_GetCallingContext(JavaVM *jvm, - JVMP_CallingContext **pctx, - jint version, - JVMP_ThreadInfo* target); -/* Arguments are taken into account only if JVM isn't already created. - No clear what to do with JVM reusing - just ignore for now. - */ -static jint JNICALL JVMP_GetRunningJVM(JavaVM **pjvm, - JVMP_CallingContext **pctx, - void *args, jint allow_reuse) -{ - JavaVM* jvm_new = NULL; - JVMP_CallingContext* ctx_new = NULL; - JVMP_ShmRequest* req; - jint retval; - - if (JVMP_JVM_running == NULL) { - ctx_new = NewCallingContext(); - if (!ctx_new) return JNI_FALSE; - *pctx = ctx_new; - jvm_new = (JavaVM*)malloc(sizeof(JavaVM)); - if (!jvm_new) return JNI_FALSE; - memset(jvm_new, 0, sizeof(JavaVM)); - req = JVMP_NewShmReq(g_msgid, 1); - if (!JVMP_EncodeRequest(req, "") - || !JVMP_SendShmRequest(req, 1)) - { - return JNI_FALSE; - } - JVMP_WaitConfirmShmRequest(req); - retval = req->retval; - JVMP_DeleteShmReq(req); - } else { - (*pjvm) = JVMP_JVM_running; - /* XXX: FIXME version */ - return JVMP_GetCallingContext(JVMP_JVM_running, - pctx, - JNI_VERSION_1_2, - NULL); - }; - - return retval; -} - -static jint JNICALL JVMP_StopJVM(JVMP_CallingContext* ctx) { - JVMP_ShmRequest* req; - jint retval; - - if (JVMP_JVM_running == NULL) return JNI_TRUE; - req = JVMP_NewShmReq(g_msgid, 2); - if (!JVMP_EncodeRequest(req, "") - || !JVMP_SendShmRequest(req, 1)) - { - return JNI_FALSE; - } - JVMP_WaitConfirmShmRequest(req); - retval = req->retval; - JVMP_DeleteShmReq(req); - return retval; -} - -static jint JNICALL JVMP_GetDefaultJavaVMInitArgs(void *args) -{ - return JNI_TRUE; -} - -static jint JNICALL JVMP_RegisterWindow(JVMP_CallingContext* ctx, - JVMP_DrawingSurfaceInfo *win, - jint *pID) -{ - JVMP_ShmRequest* req; - jint retval; - char sign[50]; - - PLUGIN_LOG("JVMP_RegisterWindow"); - if (win == NULL) return JNI_FALSE; - sprintf(sign, "A[%d]i", sizeof(JVMP_DrawingSurfaceInfo)); - req = JVMP_NewShmReq(g_msgid, 4); - if (!JVMP_EncodeRequest(req, sign, win, pID) - || !JVMP_SendShmRequest(req, 1)) - { - return JNI_FALSE; - } - JVMP_WaitConfirmShmRequest(req); - retval = req->retval; - JVMP_DecodeRequest(req, 0/* not alloc references */, sign, - &win, &pID); - JVMP_DeleteShmReq(req); - return retval; -} - -static jint JNICALL JVMP_UnregisterWindow(JVMP_CallingContext* ctx, - jint ID) -{ - JVMP_ShmRequest* req; - jint retval; - char sign[50]; - - PLUGIN_LOG("JVMP_UnregisterWindow"); - sprintf(sign, "I"); - req = JVMP_NewShmReq(g_msgid, 5); - if (!JVMP_EncodeRequest(req, sign, ID) - || !JVMP_SendShmRequest(req, 1)) - { - return JNI_FALSE; - } - JVMP_WaitConfirmShmRequest(req); - retval = req->retval; - JVMP_DeleteShmReq(req); - return retval; -} - -static jint JVMP_GetCallingContext(JavaVM *jvm, - JVMP_CallingContext* *pctx, - jint version, - JVMP_ThreadInfo* target) -{ - JVMP_CallingContext* ctx_new = NewCallingContext(); - if (!ctx_new) return JNI_FALSE; - if (!target) - ctx_new->dest_thread = ctx_new->source_thread; - else - ctx_new->dest_thread = target; - ctx_new->reserved0 = (void*)g_msgid; - *pctx = ctx_new; - return JNI_TRUE; -} - -static jint JNICALL JVMP_RegisterMonitor(JVMP_CallingContext* ctx, - JVMP_MonitorInfo *monitor, - jint *pID) -{ - return JNI_FALSE; -} - -static jint JNICALL JVMP_UnregisterMonitor(JVMP_CallingContext* ctx, - jint ID) -{ - return JNI_FALSE; -} - -static jint JNICALL JVMP_MonitorEnter(JVMP_CallingContext* ctx, - jint ID) -{ - return JNI_FALSE; -} - -static jint JNICALL JVMP_MonitorExit(JVMP_CallingContext* ctx, - jint ID) -{ - return JNI_FALSE; -} - -static jint JNICALL JVMP_MonitorWait(JVMP_CallingContext* ctx, - jint ID, jlong milli) -{ - return JNI_FALSE; -} -static jint JNICALL JVMP_MonitorNotify(JVMP_CallingContext* ctx, - jint ID) -{ - return JNI_FALSE; -} -static jint JNICALL JVMP_MonitorNotifyAll(JVMP_CallingContext* ctx, - jint ID) -{ - return JNI_FALSE; -} -static jint JNICALL JVMP_CreatePeer(JVMP_CallingContext* ctx, - jint hostApp, - jint version, - jint *target) -{ - JVMP_ShmRequest* req; - jint retval; - char sign[50]; - - PLUGIN_LOG("JVMP_CreatePeer"); - sprintf(sign, "IIi"); - req = JVMP_NewShmReq(g_msgid, 14); - if (!JVMP_EncodeRequest(req, sign, hostApp, hostApp, target) - || !JVMP_SendShmRequest(req, 1)) - { - return JNI_FALSE; - } - JVMP_WaitConfirmShmRequest(req); - retval = req->retval; - JVMP_DecodeRequest(req, 0/* not alloc references */, sign, - NULL, NULL, &target); - JVMP_DeleteShmReq(req); - return retval; -} - - -static jint JNICALL JVMP_SendEvent(JVMP_CallingContext* ctx, - jint target, - jint event, - jlong data) -{ - JVMP_ShmRequest* req; - jint retval; - char sign[50]; - - PLUGIN_LOG("JVMP_SendEvent"); - sprintf(sign, "IIA[%d]", sizeof(jlong)); - req = JVMP_NewShmReq(g_msgid, 15); - if (!JVMP_EncodeRequest(req, sign, target, event, &data) - || !JVMP_SendShmRequest(req, 1)) - { - return JNI_FALSE; - } - JVMP_WaitConfirmShmRequest(req); - retval = req->retval; - JVMP_DeleteShmReq(req); - return retval; -} - -static jint JNICALL JVMP_PostEvent(JVMP_CallingContext* ctx, - jint target, - jint event, - jlong data) -{ - JVMP_ShmRequest* req; - jint retval; - char sign[50]; - - PLUGIN_LOG("JVMP_PostEvent"); - sprintf(sign, "IIA[%d]", sizeof(jlong)); - req = JVMP_NewShmReq(g_msgid, 16); - if (!JVMP_EncodeRequest(req, sign, target, event, &data) - || !JVMP_SendShmRequest(req, 1)) - { - return JNI_FALSE; - } - JVMP_WaitConfirmShmRequest(req); - retval = req->retval; - JVMP_DeleteShmReq(req); - return retval; -} - -static jint JNICALL JVMP_DestroyPeer(JVMP_CallingContext* ctx, - jint target) -{ - JVMP_ShmRequest* req; - jint retval; - char sign[50]; - - PLUGIN_LOG("JVMP_DestroyPeer"); - sprintf(sign, "I"); - req = JVMP_NewShmReq(g_msgid, 17); - if (!JVMP_EncodeRequest(req, sign, target) - || !JVMP_SendShmRequest(req, 1)) - { - return JNI_FALSE; - } - JVMP_WaitConfirmShmRequest(req); - retval = req->retval; - JVMP_DeleteShmReq(req); - return retval; -} - -static jint JNICALL JVMP_RegisterExtension(JVMP_CallingContext* ctx, - const char* extPath, - jint *pID) -{ - JVMP_ShmRequest* req; - jint retval; - char sign[50]; - void* handle; - JVMP_GetExtension_t JVMP_GetExtension; - JVMP_Extension* ext; - jint vendorID, version; - - PLUGIN_LOG("JVMP_RegisterExtension - Netscape"); - /* firstly, load it into the host */ - - handle = dlopen(extPath, RTLD_NOW); - if (!handle) { - PLUGIN_LOG2("extension dlopen: %s", dlerror()); - return JNI_FALSE; - }; - JVMP_GetExtension = - (JVMP_GetExtension_t)dlsym(handle, "JVMP_GetExtension"); - if (handle == NULL) - { - PLUGIN_LOG2("extension dlsym: %s", dlerror()); - return JNI_FALSE; - } - /* to implement JVMP_UnregisterExtension we should support - GHashTable of opened extensions, but later */ - if (((*JVMP_GetExtension)(&ext) != JNI_TRUE)) - { - PLUGIN_LOG2("Cannot obtain extension from %s", extPath); - return JNI_FALSE; - } - (ext->JVMPExt_GetExtInfo)(&vendorID, &version); - /* init it on host side */ - if ((ext->JVMPExt_Init)(1) != JNI_TRUE) return JNI_FALSE; - /* then ask slave to do it */ - sprintf(sign, "Si"); - req = JVMP_NewShmReq(g_msgid, 18); - if (!JVMP_EncodeRequest(req, sign, extPath, pID) - || !JVMP_SendShmRequest(req, 1)) - { - return JNI_FALSE; - } - JVMP_WaitConfirmShmRequest(req); - retval = req->retval; - JVMP_DecodeRequest(req, 0/* not alloc references */, sign, - NULL, &pID); - JVMP_DeleteShmReq(req); - return retval; -} - -static jint JNICALL JVMP_UnregisterExtension(JVMP_CallingContext* ctx, - jint ID) -{ - JVMP_ShmRequest* req; - jint retval; - char sign[50]; - - PLUGIN_LOG("JVMP_UnregisterExtension"); - sprintf(sign, "I"); - req = JVMP_NewShmReq(g_msgid, 19); - if (!JVMP_EncodeRequest(req, sign, ID) - || !JVMP_SendShmRequest(req, 1)) - { - return JNI_FALSE; - } - JVMP_WaitConfirmShmRequest(req); - retval = req->retval; - JVMP_DeleteShmReq(req); - return retval; -} - -/* Here main structure is initialized */ - -static JVMP_RuntimeContext JVMP_PluginContext = { - &JVMP_GetRunningJVM, - &JVMP_StopJVM, - &JVMP_GetDefaultJavaVMInitArgs, - &JVMP_RegisterWindow, - &JVMP_UnregisterWindow, - &JVMP_RegisterMonitor, - &JVMP_UnregisterMonitor, - &JVMP_MonitorEnter, - &JVMP_MonitorExit, - &JVMP_MonitorWait, - &JVMP_MonitorNotify, - &JVMP_MonitorNotifyAll, - &JVMP_GetCallingContext, - &JVMP_CreatePeer, - &JVMP_SendEvent, - &JVMP_PostEvent, - &JVMP_DestroyPeer, - &JVMP_RegisterExtension, - &JVMP_UnregisterExtension -}; - -jint JNICALL JVMP_GetPlugin(JVMP_RuntimeContext** cx) { - if (cx == NULL) return JNI_FALSE; - if (!startSHM()) { - PLUGIN_LOG("BAD - SHM not started"); - return JNI_FALSE; - } - PLUGIN_LOG("OK - SHM started"); - (*cx) = &JVMP_PluginContext; - return JNI_TRUE; -} - - -#ifdef _JVMP_PTHREADS -JVMP_ThreadInfo* ThreadInfoFromPthread(pthread_t thr) -{ - JVMP_ThreadInfo* res = - (JVMP_ThreadInfo*)malloc(sizeof(JVMP_ThreadInfo)); - /* pthread_t is unsigned int on Linux and Solaris :) */ - res->handle = (void*)thr; - return res; -} -#endif /* of pthread case */ - - - diff --git a/mozilla/java/waterfall/wf/src/plugin/unix/java_plugin_shm_host.c b/mozilla/java/waterfall/wf/src/plugin/unix/java_plugin_shm_host.c deleted file mode 100644 index 5e58ed63c0d..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/unix/java_plugin_shm_host.c +++ /dev/null @@ -1,947 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: java_plugin_shm_host.c,v 1.1.1.1 2001-05-09 17:30:10 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* - all methods here but JVMP_GetPlugin() declared "static", as only access to - them is via structure returned by JVMP_GetPlugin(), so why to add needless - records to export table of plugin DLL. Also it looks like JNI approach. -*/ -#include -#include -#include -#include -#include -#include -#include "jvmp.h" -#include "shmtran.h" - -#define PLUGIN_DEBUG 1 -#define MAX_EXT 50 - -static int g_msg_id; -static JVMP_CallingContext* g_ctx = NULL; -static JVMP_Extension* g_extensions[MAX_EXT]; - - -struct JVM_Methods { - jint JNICALL (*JNI_GetDefaultJavaVMInitArgs)(void *args); - jint JNICALL (*JNI_CreateJavaVM)(JavaVM **pvm, void **penv, void *args); - jint JNICALL (*JNI_GetCreatedJavaVMs)(JavaVM **, jsize, jsize *); -}; -typedef struct JVM_Methods JVM_Methods; - -static JavaVM* JVMP_JVM_running = NULL; -static jobject JVMP_PluginInstance = NULL; -static jclass JVMP_PluginClass = NULL; -static JVM_Methods JVMP_JVMMethods; -static char* JVMP_plugin_home = NULL; -static char* global_libpath = NULL; - -#ifdef PLUGIN_DEBUG -#define PLUGIN_LOG(s1) { fprintf (stderr, "Java Plugin: "); \ - fprintf(stderr, s1); fprintf(stderr, "\n"); } -#define PLUGIN_LOG2(s1, s2) { fprintf (stderr, "Java Plugin: "); \ - fprintf(stderr, s1, s2); fprintf(stderr, "\n"); } -#define PLUGIN_LOG3(s1, s2, s3) { fprintf (stderr, "Java Plugin: "); \ - fprintf(stderr, s1, s2, s3); fprintf(stderr, "\n"); } -#define PLUGIN_LOG4(s1, s2, s3, s4) { fprintf (stderr, "Java Plugin: "); \ - fprintf(stderr, s1, s2, s3 ,s4); fprintf(stderr, "\n"); } -#else -#define PLUGIN_LOG(s1) -#define PLUGIN_LOG2(s1, s2) -#define PLUGIN_LOG3(s1, s2, s3) -#define PLUGIN_LOG4(s1, s2, s3, s4) -#endif - -#define LIBJVM "libjvm.so" - -static jint __JVMP_addOption(JavaVMInitArgs* opt, char* str, void* extra) { - jint numOp; - - numOp = opt->nOptions + 1; - opt->options = realloc(opt->options, numOp * sizeof(JavaVMOption)); - if (!opt->options) - { - PLUGIN_LOG("cannot realloc() memory for JVM options"); - return JNI_FALSE; - }; - opt->options[numOp-1].optionString = str; - opt->options[numOp-1].extraInfo = extra; - opt->nOptions = numOp; - return JNI_TRUE; -} - -static char* getPluginLibPath(char* home) { - static char* result = NULL; - - if (result != NULL) return result; - - result = (char*) malloc(3*strlen(home)+200); - /* FIXME !! */ - sprintf(result, -#ifdef _JVMP_SUNJVM - "%s/java/jre/lib/"ARCH"/hotspot:%s/java/jre/lib/"ARCH":%s" -#endif -#ifdef _JVMP_IBMJVM - "%s:%s/java/jre/bin:%s/java/jre/bin/classic" -#endif - , home, home, home); - return result; -} - -static jint loadJVM(const char* name) { - void* handle; - char* error; - char *libpath, *newlibpath, *pluginlibpath; - char *libjvm, *java_home, *jre_home; - int tmplen; - struct stat sbuf; - static int loaded = 0; - - typedef jint JNICALL (*JNI_GetDefaultJavaVMInitArgs_t)(void *args); - typedef jint JNICALL (*JNI_CreateJavaVM_t)(JavaVM **pvm, void **penv, void *args); - typedef jint JNICALL (*JNI_GetCreatedJavaVMs_t)(JavaVM **, jsize, jsize *); - typedef jint JNICALL (*JNI_OnLoad_t)(JavaVM *vm, void *reserved); - typedef void JNICALL (*JNI_OnUnload_t)(JavaVM *vm, void *reserved); - #define JVM_RESOLVE(method) JVMP_JVMMethods.##method = \ - (method##_t) dlsym(handle, #method); \ - if ((error = dlerror()) != NULL) { \ - PLUGIN_LOG2("dlsym: %s", error); \ - return JNI_FALSE; \ - } - - if (loaded) return JNI_TRUE; - /* bzero() ? */ - memset(&JVMP_JVMMethods, 0, sizeof(JVMP_JVMMethods)); - /* find out JAVA_PLUGIN_HOME */ - JVMP_plugin_home = getenv("JAVA_PLUGIN_HOME"); - if (JVMP_plugin_home == NULL) { - PLUGIN_LOG("Env variable JAVA_PLUGIN_HOME not set"); - return JNI_FALSE; - } - if ((stat(JVMP_plugin_home, &sbuf) < 0) || !S_ISDIR(sbuf.st_mode)) { - PLUGIN_LOG2("Bad value %s of JAVA_PLUGIN_HOME", JVMP_plugin_home); - return JNI_FALSE; - } - /* LD_LIBRARY_PATH correction */ - - pluginlibpath = getPluginLibPath(JVMP_plugin_home); - libpath = getenv("LD_LIBRARY_PATH"); - if (!libpath) libpath = ""; - tmplen = strlen(libpath) + strlen(pluginlibpath); - global_libpath = (char*) malloc(tmplen + 2); - newlibpath = (char*) malloc(tmplen + 22); - - sprintf(global_libpath, "%s:%s", pluginlibpath, libpath); - sprintf(newlibpath, "LD_LIBRARY_PATH=%s", global_libpath); - //putenv(newlibpath); - java_home = (char*) malloc(strlen(JVMP_plugin_home)+41); - jre_home = (char*) malloc(strlen(JVMP_plugin_home)+41); - libjvm = (char*) malloc(strlen(JVMP_plugin_home)+strlen(name)+50); -#ifdef _JVMP_IBMJVM - sprintf(java_home, "JAVAHOME=%s/java/jre", JVMP_plugin_home); - sprintf(jre_home, "JREHOME=%s/java/jre", JVMP_plugin_home); - sprintf(libjvm, "%s/java/jre/bin/classic/%s", JVMP_plugin_home, - name); -#endif -#ifdef _JVMP_SUNJVM - sprintf(java_home, "JAVA_HOME=%s/java/jre/", JVMP_plugin_home); - sprintf(jre_home, "JREHOME=%s/java/jre/", JVMP_plugin_home); - sprintf(libjvm, "%s/java/jre/lib/"ARCH"/hotspot/%s", JVMP_plugin_home, - name); -#endif - //putenv(java_home); - //putenv(jre_home); - PLUGIN_LOG2("loading JVM from %s", libjvm); - handle = dlopen (libjvm, RTLD_NOW); - free (libjvm); - if (!handle) { - PLUGIN_LOG2("dlopen: %s", dlerror()); - return JNI_FALSE; - }; - - JVM_RESOLVE(JNI_GetDefaultJavaVMInitArgs); - JVM_RESOLVE(JNI_CreateJavaVM); - JVM_RESOLVE(JNI_GetCreatedJavaVMs); - loaded = 1; - return JNI_TRUE; -} - -/* join Plugin's classpaths to the arguments passed to JVM */ -static jint JVMP_initClassPath(void* args) { - JavaVMInitArgs* opt; - char *classpath, *newclasspath, *pluginclasspath, *bootclasspath; - char *java_libpath, *java_home; - char* str; - int i; - - opt = (JavaVMInitArgs*) args; - for (i=0; i < (int)opt->nOptions; i++) - PLUGIN_LOG3("before option[%d]=%s", i, opt->options[i].optionString); - - /* add javaplugin classpath to standard classpath */ - classpath = getenv("CLASSPATH"); - if (!classpath) classpath = ""; - pluginclasspath = (char*) malloc(2*strlen(JVMP_plugin_home)+50); - /* XXX: FIX ME - use both JARS and dirs */ - sprintf(pluginclasspath, - "%s/classes:" -/* #ifdef _JVMP_IBMJVM */ -/* "%s/java/jre/lib/rt.jar:" */ -/* #endif */ -/* #ifdef _JVMP_SUNJVM */ -/* "%s/java/jre/lib/classes:" */ -/* #endif */ - , JVMP_plugin_home); - newclasspath = (char*) malloc(strlen(classpath) + - strlen(pluginclasspath) + 1); - strcpy(newclasspath, pluginclasspath); - if (classpath != NULL) - strcat(newclasspath, classpath); - str = (char*) malloc(strlen(newclasspath)+30); - sprintf(str, "-Djava.class.path=%s", newclasspath); - if (!__JVMP_addOption(opt, str, NULL)) return JNI_FALSE; - - java_libpath = (char*) malloc(strlen(global_libpath) + 30); - sprintf(java_libpath, "-Djava.library.path=%s", global_libpath); - if (!__JVMP_addOption(opt, java_libpath, NULL)) return JNI_FALSE; - - java_home = (char*) malloc(strlen(JVMP_plugin_home)+30); - sprintf(java_home, "-Djava.home=%s/java/jre", JVMP_plugin_home); - if (!__JVMP_addOption(opt, java_home, NULL)) return JNI_FALSE; - free(pluginclasspath); - bootclasspath = (char*) malloc(3*strlen(JVMP_plugin_home)+180); - sprintf(bootclasspath, "-Xbootclasspath:" - "%s/java/jre/classes:" - "%s/java/jre/lib/rt.jar:" - "%s/java/jre/lib/i18n.jar", - JVMP_plugin_home, JVMP_plugin_home, JVMP_plugin_home - ); - if (!__JVMP_addOption(opt, bootclasspath, NULL)) return JNI_FALSE; - for (i=0; i < (int)opt->nOptions; i++) - PLUGIN_LOG3("JVM option[%d]=%s", i, opt->options[i].optionString); - return JNI_TRUE; -} - - -static jint JNICALL JVMP_initJavaClasses(JavaVM* jvm, JNIEnv* env) { - jclass clz; - jmethodID meth; - jboolean trace = JNI_TRUE; - jobject inst; - - (*env)->ExceptionClear(env); - /* Find main plugin's class */ - clz = (*env)->FindClass(env, "sun/jvmp/generic/motif/Plugin"); - if (clz == 0) { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return JNI_FALSE; - }; - /* Find its "startJVM" method */ - meth = (*env)->GetStaticMethodID(env, clz, "startJVM", - "(Z)Lsun/jvmp/PluggableJVM;"); - if ((*env)->ExceptionOccurred(env)) { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return JNI_FALSE; - }; - inst = (*env)->CallStaticObjectMethod(env, clz, meth, trace); - if ((*env)->ExceptionOccurred(env)) { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return JNI_FALSE; - }; - JVMP_PluginInstance = (*env)->NewWeakGlobalRef(env, inst); - JVMP_PluginClass = (*env)->NewWeakGlobalRef(env, clz); - return JNI_TRUE; -} - -/* prototype for this function */ -static jint JVMP_GetCallingContext(JavaVM *jvm, - JVMP_CallingContext **pctx, - jint version, - JVMP_ThreadInfo* target); - -static jint JVMP_SetCap(JVMP_CallingContext *ctx, jint cap_no) -{ - JVMP_ALLOW_CAP(ctx->caps, cap_no); - return JNI_TRUE; -} - -static jint JVMP_SetCaps(JVMP_CallingContext *ctx, - JVMP_SecurityCap *new_caps) -{ - if (!new_caps) return JNI_FALSE; - memcpy(&(ctx->caps), new_caps, sizeof(JVMP_SecurityCap)); - return JNI_TRUE; -} - -static jint JVMP_GetCap(JVMP_CallingContext *ctx, jint cap_no) -{ - return JVMP_IS_CAP_ALLOWED(ctx->caps, cap_no); -} - - - -static jint JVMP_IsActionAllowed(JVMP_CallingContext *ctx, - JVMP_SecurityAction *caps) -{ - int i, r; - for(i=0, r=1; i < JVMP_MAX_CAPS_BYTES; i++) - { - r = - r && ((!(caps->bits)[i]) | - (((ctx->caps).bits)[i] & (caps->bits)[i])); - if (!r) return JNI_FALSE; - } - return JNI_TRUE; -} - -static JVMP_CallingContext* NewCallingContext() -{ - JVMP_CallingContext* ctx_new = NULL; - - ctx_new = (JVMP_CallingContext *) malloc(sizeof(JVMP_CallingContext)); - if (!ctx_new) return NULL; - ctx_new->source_thread = NULL; /* must be current thread */ - ctx_new->env = NULL; - ctx_new->source = NULL; - JVMP_FORBID_ALL_CAPS(ctx_new->caps); - ctx_new->AllowCap = &JVMP_SetCap; - ctx_new->GetCap = &JVMP_GetCap; - ctx_new->SetCaps = &JVMP_SetCaps; - ctx_new->IsActionAllowed = &JVMP_IsActionAllowed; - return ctx_new; -} - -/* arguments are taken into account only if JVM isn't already created */ -/* XXX: fix possible race conditions when different threads calls - this method in the same time, as JNI_CreateJavaVM() is long. - I've skipped it yet, as haven't decided which thread library to - use. I can't use MonitorEnter/MonitorExit yet, as there is no - JNIEnv yet. -*/ -static jint JNICALL JVMP_GetRunningJVM(JavaVM **pjvm, - JVMP_CallingContext **pctx, - void *args, jint allow_reuse) -{ - JavaVM* jvm_new = NULL; - JVMP_CallingContext* ctx_new = NULL; - JNIEnv* env_new = NULL; - jint jvm_err; - - if (JVMP_JVM_running == NULL) { - if (!JVMP_initClassPath(args)) return JNI_FALSE; - ctx_new = NewCallingContext(); - if (!ctx_new) return JNI_FALSE; - if ((jvm_err = JVMP_JVMMethods.JNI_CreateJavaVM - (&jvm_new, (void*)&(ctx_new->env), args)) != JNI_OK) - { - PLUGIN_LOG2("JVMP: JNI_CreateJavaVM failed due %d", (int)jvm_err); - return jvm_err; - } - env_new = ctx_new->env; - } else { - (*pjvm) = JVMP_JVM_running; - /* XXX: FIXME version */ - return JVMP_GetCallingContext(JVMP_JVM_running, - pctx, - JNI_VERSION_1_2, - NULL); - }; - - if (env_new) { - if (!JVMP_initJavaClasses(jvm_new, env_new)) { - PLUGIN_LOG("Problems with Java classes of JVMP. Exiting..."); - return JNI_FALSE; - }; - JVMP_JVM_running = jvm_new; - (*pjvm) = JVMP_JVM_running; - (*pctx) = ctx_new; - (*env_new)->ExceptionClear(env_new); - return JNI_TRUE; - } - else { - return JNI_FALSE; - }; -} - -static jint JNICALL JVMP_StopJVM(JVMP_CallingContext* ctx) { - jmethodID myMethod; - JNIEnv* env = ctx->env; - - if (JVMP_JVM_running == NULL) return JNI_TRUE; - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "stopPlugin", "()V"); - if ((*env)->ExceptionOccurred(env)) { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return JNI_FALSE; - }; - (*env)->CallVoidMethod(env, JVMP_PluginInstance, myMethod); - if ((*env)->ExceptionOccurred(env)) { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return JNI_FALSE; - }; - /* FIXME: I don't know how to completly destroy JVM. - Current code waits until only one thread left - but how to kill 'em? - Host application should be able to control such stuff as execution of - JVM, even if there are some java threads running - */ - (*JVMP_JVM_running)->DestroyJavaVM(JVMP_JVM_running); - JVMP_JVM_running = NULL; - return JNI_TRUE; -} - -static jint JNICALL JVMP_GetDefaultJavaVMInitArgs(void *args) -{ - if (JVMP_JVMMethods.JNI_GetDefaultJavaVMInitArgs) - { - return JVMP_JVMMethods.JNI_GetDefaultJavaVMInitArgs(args); - } - return JNI_FALSE; -} - -static jint JNICALL JVMP_RegisterWindow(JVMP_CallingContext* ctx, - JVMP_DrawingSurfaceInfo *win, - jint *pID) -{ - jlong handle; - jint ID; - jmethodID myMethod; - JNIEnv* env = ctx->env; - - PLUGIN_LOG("JVMP_RegisterWindow"); - if (win == NULL) return JNI_FALSE; - - handle = (jlong)(jint)(win->window); - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "RegisterWindow", "(JII)I"); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return JNI_FALSE; - } - - /* fprintf(stderr, "calling RegisterWindow()\n"); */ - ID = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - handle, win->width, win->height); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return JNI_FALSE; - } - if (ID == 0) - { - PLUGIN_LOG("ID == 0"); - return JNI_FALSE; - }; - if (pID) *pID = ID; - return JNI_TRUE; -} - -static jint JNICALL JVMP_UnregisterWindow(JVMP_CallingContext* ctx, - jint ID) -{ - jmethodID myMethod; - jint result; - JNIEnv* env = ctx->env; - - if (ID <= 0) return JNI_FALSE; - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "UnregisterWindow", "(I)I"); - if ((*env)->ExceptionOccurred(env)) { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return JNI_FALSE; - }; - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - ID); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return JNI_FALSE; - }; - if (result != ID) return JNI_FALSE; - return JNI_TRUE; -} - -static jint JVMP_GetCallingContext(JavaVM *jvm, - JVMP_CallingContext* *pctx, - jint version, - JVMP_ThreadInfo* target) -{ - jint ret; - JVMP_CallingContext* ctx_new = NewCallingContext(); - if (!ctx_new) return JNI_FALSE; - g_ctx = ctx_new; - ret = (*jvm)->GetEnv(jvm, (void*)&(ctx_new->env), version); - return (ret == JNI_OK ? JNI_TRUE : JNI_FALSE); -} - -static jint JNICALL JVMP_RegisterMonitor(JVMP_CallingContext* ctx, - JVMP_MonitorInfo *monitor, - jint *pID) -{ - return JNI_FALSE; -} - -static jint JNICALL JVMP_UnregisterMonitor(JVMP_CallingContext* ctx, - jint ID) -{ - return JNI_FALSE; -} - -static jint JNICALL JVMP_MonitorEnter(JVMP_CallingContext* ctx, - jint ID) -{ - return JNI_FALSE; -} - -static jint JNICALL JVMP_MonitorExit(JVMP_CallingContext* ctx, - jint ID) -{ - return JNI_FALSE; -} - -static jint JNICALL JVMP_MonitorWait(JVMP_CallingContext* ctx, - jint ID, jlong milli) -{ - return JNI_FALSE; -} -static jint JNICALL JVMP_MonitorNotify(JVMP_CallingContext* ctx, - jint ID) -{ - return JNI_FALSE; -} -static jint JNICALL JVMP_MonitorNotifyAll(JVMP_CallingContext* ctx, - jint ID) -{ - return JNI_FALSE; -} -static jint JNICALL JVMP_CreatePeer(JVMP_CallingContext* ctx, - jint hostApp, - jint version, - jint *target) -{ - jmethodID myMethod = NULL; - jint result = 0; - JNIEnv* env = ctx->env; - - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "createPeer", "(II)I"); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return JNI_FALSE; - }; - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - hostApp, version); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return JNI_FALSE; - }; - if (result == 0) return JNI_FALSE; - *target = result; - return JNI_TRUE; -} - -static jint JNICALL JVMP_SendEvent(JVMP_CallingContext* ctx, - jint target, - jint event, - jlong data) -{ - jmethodID myMethod; - jint result; - JNIEnv* env = ctx->env; - - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "sendEvent", "(IIJ)I"); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return JNI_FALSE; - }; - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - target, event, data); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return JNI_FALSE; - }; - if (result == 0) return JNI_FALSE; - return JNI_TRUE; -} - -static jint JNICALL JVMP_PostEvent(JVMP_CallingContext* ctx, - jint target, - jint event, - jlong data) -{ - jmethodID myMethod; - jint result; - JNIEnv* env = ctx->env; - - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "postEvent", "(IIJ)I"); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return JNI_FALSE; - }; - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - target, event, data); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return JNI_FALSE; - }; - if (result == 0) return JNI_FALSE; - return JNI_TRUE; -} - -static jint JNICALL JVMP_DestroyPeer(JVMP_CallingContext* ctx, - jint target) -{ - - jmethodID myMethod = NULL; - jint result = 0; - JNIEnv* env = ctx->env; - - myMethod = (*env)->GetMethodID(env, JVMP_PluginClass, - "removePeer", "(I)I"); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return JNI_FALSE; - }; - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - target); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return JNI_FALSE; - }; - if (result != target) return JNI_FALSE; - return JNI_TRUE; -} - - -static jint JNICALL JVMP_RegisterExtension(JVMP_CallingContext* ctx, - const char* extPath, - jint *pID) -{ - void* handle; - char* error; - JVMP_GetExtension_t JVMP_GetExtension; - JVMP_Extension* ext; - jint vendorID, version, result; - jmethodID myMethod = NULL; - char *classpath, *classname; - jstring jclasspath, jclassname; - static int ext_idx = 0; - - JNIEnv* env = ctx->env; - - PLUGIN_LOG("JVMP_RegisterExtension - JVM"); - handle = dlopen(extPath, RTLD_NOW); - if (!handle) { - PLUGIN_LOG2("extension dlopen: %s", dlerror()); - return JNI_FALSE; - }; - JVMP_GetExtension = - (JVMP_GetExtension_t)dlsym(handle, "JVMP_GetExtension"); - if ((error = dlerror()) != NULL) - { - PLUGIN_LOG2("extension dlsym: %s", error); - return JNI_FALSE; - } - /* to implement JVMP_UnregisterExtension we should support - GHashTable of opened extensions, but later */ - if (((*JVMP_GetExtension)(&ext) != JNI_TRUE)) - { - PLUGIN_LOG2("Cannot obtain extension from %s", extPath); - return JNI_FALSE; - } - (ext->JVMPExt_GetExtInfo)(&vendorID, &version); - /* init it on JVM side */ - if ((ext->JVMPExt_Init)(2) != JNI_TRUE) return JNI_FALSE; - g_extensions[ext_idx++] = ext; - myMethod = - (*env)->GetMethodID(env, JVMP_PluginClass, - "registerExtension", - "(IILjava/lang/String;Ljava/lang/String;)I"); - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return JNI_FALSE; - }; - (ext->JVMPExt_GetBootstrapClass)(&classpath, &classname); - jclasspath = (*env)->NewStringUTF(env, classpath); - jclassname = (*env)->NewStringUTF(env, classname); - if (jclasspath == NULL || jclassname == NULL) return JNI_FALSE; - result = (*env)->CallIntMethod(env, JVMP_PluginInstance, myMethod, - vendorID, version, - jclasspath, jclassname); - /* XXX: maybe leak of jclasspath, jclassname - ReleaseStringUTFChars*/ - if ((*env)->ExceptionOccurred(env)) - { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return JNI_FALSE; - }; - *pID = result; - - return JNI_TRUE; -} - -static jint JNICALL JVMP_UnregisterExtension(JVMP_CallingContext* ctx, - jint ID) -{ - return JNI_TRUE; -} - -/* Here main structure is initialized */ - -static JVMP_RuntimeContext JVMP_PluginContext = { - &JVMP_GetRunningJVM, - &JVMP_StopJVM, - &JVMP_GetDefaultJavaVMInitArgs, - &JVMP_RegisterWindow, - &JVMP_UnregisterWindow, - &JVMP_RegisterMonitor, - &JVMP_UnregisterMonitor, - &JVMP_MonitorEnter, - &JVMP_MonitorExit, - &JVMP_MonitorWait, - &JVMP_MonitorNotify, - &JVMP_MonitorNotifyAll, - &JVMP_GetCallingContext, - &JVMP_CreatePeer, - &JVMP_SendEvent, - &JVMP_PostEvent, - &JVMP_DestroyPeer, - &JVMP_RegisterExtension, - &JVMP_UnregisterExtension -}; - -jint JNICALL JVMP_GetPlugin(JVMP_RuntimeContext** cx) { - if (cx == NULL) return JNI_FALSE; - if (!loadJVM(LIBJVM)) { - PLUGIN_LOG("BAD - JVM loading failed"); - return JNI_FALSE; - } - PLUGIN_LOG("OK - JVM dll at least loaded"); - (*cx) = &JVMP_PluginContext; - return JNI_TRUE; -} - - -#ifdef _JVMP_PTHREADS -JVMP_ThreadInfo* ThreadInfoFromPthread(pthread_t thr) -{ - JVMP_ThreadInfo* res = - (JVMP_ThreadInfo*)malloc(sizeof(JVMP_ThreadInfo)); - /* pthread_t is unsigned int on Linux and Solaris :) */ - res->handle = (void*)thr; - return res; -} -#endif /* of pthread case */ - -static int JVMP_ExecuteExtReq(JVMP_ShmRequest* req) -{ - int i; - - for (i=0; iJVMPExt_ScheduleRequest)(req, JNI_TRUE)) - break; - } - return 1; -} - - - -int JVMP_ExecuteShmRequest(JVMP_ShmRequest* req) -{ - JavaVMInitArgs vm_args; - JVMP_DrawingSurfaceInfo win, *pwin; - jint ID, *pID; - char* extPath; - char sign[100]; - jint vendorID, version, *ptarget, target, event; - jlong data, *pdata; - - if (!req) return 0; - switch(req->func_no) - { - case 1: - // JVMP_GetRunningJVM(JavaVM **jvm, - // JVMP_CallingContext* *pctx, void *args) - memset(&vm_args, 0, sizeof(vm_args)); - vm_args.version = JNI_VERSION_1_2; - JVMP_GetDefaultJavaVMInitArgs((void*)&vm_args); - req->retval = JVMP_GetRunningJVM(&JVMP_JVM_running, - &g_ctx, &vm_args, JNI_FALSE); - break; - case 2: - // JVMP_StopJVM(JVMP_CallingContext* ctx) - req->retval = JVMP_StopJVM(g_ctx); - break; - case 3: - // jint JNICALL (*JVMP_GetDefaultJavaVMInitArgs)(void *args); - req->retval = JNI_TRUE; - break; - case 4: - /* jint JNICALL (*JVMP_RegisterWindow)(JVMP_CallingContext* ctx, - JVMP_DrawingSurfaceInfo *win, - jint *pID); - */ - pwin = &win; - pID = &ID; - sprintf(sign, "A[%d]i", sizeof(JVMP_DrawingSurfaceInfo)); - JVMP_DecodeRequest(req, 0, sign, &pwin, &pID); - req->retval = JVMP_RegisterWindow(g_ctx, pwin, pID); - JVMP_EncodeRequest(req, sign, pwin, pID); - break; - case 5: - /* jint JNICALL (*JVMP_UnregisterWindow)(JVMP_CallingContext* ctx, - jint ID); - */ - sprintf(sign, "I"); - JVMP_DecodeRequest(req, 0, sign, &ID); - req->retval = JVMP_UnregisterWindow(g_ctx, ID); - break; - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - req->retval = JNI_FALSE; - break; - case 14: - /* jint JNICALL (*JVMP_CreatePeer)(JVMP_CallingContext* ctx, - jint vendorID, - jint version, - jint *target); */ - sprintf(sign, "IIi"); - ptarget = ⌖ - JVMP_DecodeRequest(req, 0, sign, &vendorID, &version, &ptarget); - req->retval = JVMP_CreatePeer(g_ctx, vendorID, version, ptarget); - JVMP_EncodeRequest(req, sign, vendorID, version, ptarget); - break; - case 15: - /* jint JNICALL (*JVMP_SendEvent)(JVMP_CallingContext* ctx, - jint target, - jint event, - jlong data); */ - sprintf(sign, "IIA[%d]", sizeof(jlong)); - pdata = &data; - JVMP_DecodeRequest(req, 0, sign, &target, &event, &pdata); - req->retval = JVMP_SendEvent(g_ctx, target, event, data); - break; - case 16: - /* jint JNICALL (*JVMP_PostEvent)(JVMP_CallingContext* ctx, - jint target, - jint event, - jlong data); */ - sprintf(sign, "IIA[%d]", sizeof(jlong)); - pdata = &data; - JVMP_DecodeRequest(req, 0, sign, &target, &event, &pdata); - req->retval = JVMP_PostEvent(g_ctx, target, event, data); - break; - case 17: - /* jint JNICALL (*JVMP_DestroyPeer)(JVMP_CallingContext* ctx, - jint target); */ - sprintf(sign, "I"); - JVMP_DecodeRequest(req, 0, sign, &target); - req->retval = JVMP_DestroyPeer(g_ctx, target); - break; - case 18: - /* jint JNICALL (*JVMP_RegisterExtension)(JVMP_CallingContext* ctx, - const char* extPath, - jint *pID); */ - sprintf(sign, "Si"); - JVMP_DecodeRequest(req, 1, sign, &extPath, &pID); - req->retval = JVMP_RegisterExtension(g_ctx, extPath, pID); - JVMP_EncodeRequest(req, sign, NULL, pID); - free(extPath); - free(pID); - break; - case 19: - /* jint JNICALL (*JVMP_UnregisterExtension)(JVMP_CallingContext* ctx, - jint ID); */ - sprintf(sign, "I"); - JVMP_DecodeRequest(req, 0, sign, &ID); - req->retval = JVMP_UnregisterExtension(g_ctx, ID); - break; - default: - return JVMP_ExecuteExtReq(req); - } - return 1; -} - -int main(int argc, char** argv) -{ - int id = 0; - JVMP_RuntimeContext* cx = NULL; - /* one and only argument should be message queue id used to communicate - with host application */ - if (argc != 2) return 1; - id = atoi(argv[1]); - g_msg_id = id; - //sleep(30); - JVMP_ShmInit(2); /* init it on JVM side */ - memset(g_extensions, 0, MAX_EXT*sizeof(JVMP_Extension*)); - if (!JVMP_GetPlugin(&cx) || !cx) return 1; - JVMP_ShmMessageLoop(g_msg_id); - return 0; -} - - - - - - diff --git a/mozilla/java/waterfall/wf/src/plugin/unix/jvmp_exec.c b/mozilla/java/waterfall/wf/src/plugin/unix/jvmp_exec.c deleted file mode 100644 index 0fdcda8ec90..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/unix/jvmp_exec.c +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: jvmp_exec.c,v 1.1.1.1 2001-05-09 17:30:10 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include -#include -#include -#include -#include -#include "shmtran.h" -#include "string.h" -int g_msg_id; - -static int test(int i, char* s, void* ptr); - -int JVMP_ExecuteShmRequest(JVMP_ShmRequest* req) -{ - char* string_val; - jpointer jpointer_val; - int int_val; - char sign[20]; - char* buf; - - if (!req) return 0; - switch(req->func_no) - { - case 1: - strcpy(sign, "ISA[8]a[0]"); - JVMP_DecodeRequest(req, 1, sign, - &int_val, &string_val, &jpointer_val, &buf); - buf = malloc(100000); - strcpy(buf, "Privet"); - sprintf(sign, "ISA[8]a[%d]", 100000); - req->retval = test(int_val, string_val, jpointer_val); - JVMP_EncodeRequest(req, sign, int_val, string_val, jpointer_val, buf); - break; - default: - printf("no such function\n"); - return 0; - break; - } - return 1; -} - - -static int test(int i, char* s, void* ptr) -{ - - printf("called with i=%d s=\"%s\" ptr[5]=%c \n", i, s, ((char*)ptr)[5] - ); - ((char*)ptr)[5] = 'B'; - return 19; -} - - -int main(int argc, char** argv) -{ - int id = 0; - /* one and only argument should be message queue id used to communicate - with host application */ - if (argc != 2) return 1; - id = atoi(argv[1]); - g_msg_id = id; - JVMP_ShmInit(); - JVMP_ShmMessageLoop(g_msg_id); - return 0; -} diff --git a/mozilla/java/waterfall/wf/src/plugin/unix/native.c b/mozilla/java/waterfall/wf/src/plugin/unix/native.c deleted file mode 100644 index 088f73540bc..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/unix/native.c +++ /dev/null @@ -1,344 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: native.c,v 1.1.1.1 2001-05-09 17:30:10 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* Waterfall headers */ -#include "jvmp.h" -#include "jvmp_threading.h" -/* some native methods implemented here */ -#include "sun_jvmp_generic_motif_Plugin.h" -#include "sun_jvmp_generic_motif_PthreadSynchroObject.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -/* AWT glueing code */ -#include "awt_Plugin.h" - -/* code resolved from AWT DLL */ -static void (* LockIt)(JNIEnv *) = NULL; -static void (* UnLockIt)(JNIEnv *) = NULL; -static void (* NoFlushUnlockIt)(JNIEnv *) = NULL; -/* AWT X server connection */ -static Display *display; -/* AWT DLL handle */ -static void *awtDLL = NULL; - -#define AWTDLL "libawt.so" - -/* those functions exported from AWT DLL ... */ -typedef void (*getAwtLockFunctions_t)(void (**AwtLock)(JNIEnv *), - void (**AwtUnlock)(JNIEnv *), - void (**AwtNoFlushUnlock)(JNIEnv *), - void *reserved); -typedef void (*getAwtData_t) (int *awt_depth, - Colormap *awt_cmap, - Visual* *awt_visual, - int *awt_num_colors, - void* pReserved); -typedef Display* (*getAwtDisplay_t)(void); - -/* ...and written to this table */ -struct awt_callbacks_t { - getAwtLockFunctions_t getAwtLockFunctions; - getAwtData_t getAwtData; - getAwtDisplay_t getAwtDisplay; -} awt = -{ NULL, - NULL, - NULL }; - -static WidgetClass getVendorShellWidgetClass() { - static WidgetClass *v = NULL; - if (v != NULL) return *v; - v = (WidgetClass *) dlsym(RTLD_DEFAULT , "vendorShellWidgetClass"); - if (v != NULL) return *v; - /* I dunno why but it doesn't work on Linux - with statically linked Motif - so search it in libawt explicity */ - v = (WidgetClass *) dlsym(awtDLL, "vendorShellWidgetClass"); - if (v != NULL) return *v; - fprintf(stderr, - "Cannot resolve vendorShellWidgetClass now: %s\nAborting...\n", - dlerror()); - /* XXX: maybe give up more nicely */ - exit(1); - /* Not reached anyway */ - return *v; -} - -static int initAWTGlue() -{ -#define AWT_RESOLVE(method) awt.##method = \ - (method##_t) dlsym(awtDLL, #method); \ - if (awt.##method == NULL) { \ - fprintf(stderr, "dlsyn: %s", dlerror()); \ - return 0; \ - } - char awtPath[MAXPATHLEN]; - - /* JAVA_HOME/JAVAHOME set by Waterfall before, see java_plugin.c */ -#ifdef _JVMP_SUNJVM - sprintf(awtPath, "%s/lib/" ARCH "/" AWTDLL, - getenv("JAVA_HOME")); -#endif -#ifdef _JVMP_IBMJVM - sprintf(awtPath, "%s/bin/" AWTDLL, - getenv("JAVAHOME")); -#endif - //fprintf(stderr,"loading %s\n", awtPath); - awtDLL = dlopen(awtPath, RTLD_NOW); - if (awtDLL == NULL) - { - fprintf(stderr,"cannot load AWT: %s\n", dlerror()); - return 0; - } - AWT_RESOLVE(getAwtLockFunctions); - awt.getAwtLockFunctions(&LockIt, &UnLockIt, &NoFlushUnlockIt, NULL); - AWT_RESOLVE(getAwtData); - AWT_RESOLVE(getAwtDisplay); - return 1; -} - -static void -checkPos(Widget w, XtPointer data, XEvent *event) -{ - /* for reparent hack */ - w->core.x = event->xcrossing.x_root - event->xcrossing.x; - w->core.y = event->xcrossing.y_root - event->xcrossing.y; -} - - -JNIEXPORT jlong JNICALL -Java_sun_jvmp_generic_motif_Plugin_getWidget(JNIEnv *env, jclass clz, - jint winid, jint width, jint height, - jint x, jint y) -{ - Arg args[40]; - int argc; - Widget w; - Window child, parent; - Visual *visual; - Colormap cmap; - int depth; - int ncolors; - Display **awt_display_ptr; - - /* - * Create a top-level shell. Note that we need to use the - * AWT's own awt_display to initialize the widget. If we - * try to create a second X11 display connection the Java - * runtimes get very confused. - */ - (*LockIt)(env); - argc = 0; - XtSetArg(args[argc], XmNsaveUnder, False); argc++; - XtSetArg(args[argc], XmNallowShellResize, False); argc++; - - /* the awt initialization should be done by now (awt_GraphicsEnv.c) */ - - awt.getAwtData(&depth,&cmap, &visual, &ncolors, NULL); - - awt_display_ptr = (Display **) dlsym(awtDLL, "awt_display"); - if (awt_display_ptr == NULL) - display = awt.getAwtDisplay(); - else - display = *awt_display_ptr; - - XtSetArg(args[argc], XmNvisual, visual); argc++; - XtSetArg(args[argc], XmNdepth, depth); argc++; - XtSetArg(args[argc], XmNcolormap, cmap); argc++; - - XtSetArg(args[argc], XmNwidth, width); argc++; - XtSetArg(args[argc], XmNheight, height); argc++; - XtSetArg(args[argc], XmNx, 0); argc++; - XtSetArg(args[argc], XmNy, 0); argc++; - - XtSetArg(args[argc], XmNmappedWhenManaged, False); argc++; - - w = XtAppCreateShell("AWTapp","XApplication", - getVendorShellWidgetClass(), - display, - args, - argc); - XtRealizeWidget(w); - XtAddEventHandler(w, EnterWindowMask, FALSE,(XtEventHandler) checkPos, 0); - /* - * Now reparent our new Widget into our Navigator window - */ - parent = (Window) winid; - child = XtWindow(w); - XReparentWindow(display, child, parent, 0, 0); - XFlush(display); - XSync(display, False); - XtVaSetValues(w, XmNx, 0, XmNy, 0, NULL); - XFlush(display); - XSync(display, False); - (*UnLockIt)(env); - return PTR_TO_JLONG(w); -} - -JNIEXPORT jint JNICALL -JNI_OnLoad(JavaVM *vm, void *reserved) -{ - if (!initAWTGlue()) return 0; - return JNI_VERSION_1_2; -} - -static jlong getTimeMillis() -{ - struct timeval t; - gettimeofday(&t, 0); - return ((jlong)t.tv_sec) * 1000 + (jlong)(t.tv_usec/1000); -} - -JNIEXPORT jint JNICALL -Java_sun_jvmp_generic_motif_PthreadSynchroObject_checkHandle (JNIEnv *env, - jobject jobj, - jlong handle) -{ - JVMP_Monitor* monitor = (JVMP_Monitor*)JLONG_TO_PTR(handle); - - if (!monitor || monitor->magic != JVMP_MONITOR_MAGIC) return -1; - return 0; -} - -JNIEXPORT jint JNICALL -Java_sun_jvmp_generic_motif_PthreadSynchroObject_doDestroy(JNIEnv *env, - jobject jobj, - jlong handle) -{ - JVMP_Monitor* monitor = (JVMP_Monitor*)JLONG_TO_PTR(handle); - /* XXX: should this code destroy anything at all? */ - pthread_cond_destroy((pthread_cond_t*)monitor->monitor); - pthread_mutex_destroy((pthread_mutex_t*)monitor->mutex); - return 0; -} - -JNIEXPORT jint JNICALL -Java_sun_jvmp_generic_motif_PthreadSynchroObject_doLock(JNIEnv *env, - jobject jobj, - jlong handle) -{ - JVMP_Monitor* monitor = (JVMP_Monitor*)JLONG_TO_PTR(handle); - int r; - - if (monitor->mutex_state != JVMP_STATE_INITED) - return JVMP_ERROR_INCORRECT_MUTEX_STATE; - r = pthread_mutex_lock((pthread_mutex_t*)monitor->mutex); - if (r != 0) return r; - monitor->mutex_state = JVMP_STATE_LOCKED; - return 0; -} - -JNIEXPORT jint JNICALL -Java_sun_jvmp_generic_motif_PthreadSynchroObject_doUnlock(JNIEnv *env, - jobject jobj, - jlong handle) -{ - JVMP_Monitor* monitor = (JVMP_Monitor*)JLONG_TO_PTR(handle); - int r; - - if (monitor->mutex_state != JVMP_STATE_LOCKED) - return JVMP_ERROR_MUTEX_NOT_LOCKED; - r = pthread_mutex_unlock((pthread_mutex_t*)monitor->mutex); - if (r != 0) return r; - monitor->mutex_state = JVMP_STATE_INITED; - return 0; -} - -JNIEXPORT jint JNICALL -Java_sun_jvmp_generic_motif_PthreadSynchroObject_doNotify(JNIEnv *env, - jobject jobj, - jlong handle) -{ - JVMP_Monitor* monitor = (JVMP_Monitor*)JLONG_TO_PTR(handle); - - if (monitor->mutex_state != JVMP_STATE_LOCKED) - return JVMP_ERROR_MUTEX_NOT_LOCKED; - return pthread_cond_signal((pthread_cond_t*)monitor->monitor); -} - -JNIEXPORT jint JNICALL -Java_sun_jvmp_generic_motif_PthreadSynchroObject_doNotifyAll(JNIEnv *env, - jobject jobj, - jlong handle) -{ - JVMP_Monitor* monitor = (JVMP_Monitor*)JLONG_TO_PTR(handle); - if (monitor->mutex_state != JVMP_STATE_LOCKED) - return JVMP_ERROR_MUTEX_NOT_LOCKED; - return pthread_cond_broadcast((pthread_cond_t*)monitor->monitor); -} - -JNIEXPORT jint JNICALL -Java_sun_jvmp_generic_motif_PthreadSynchroObject_doWait(JNIEnv *env, - jobject jobj, - jlong handle, - jint milli) -{ - JVMP_Monitor* monitor = (JVMP_Monitor*)JLONG_TO_PTR(handle); - int r; - - if (monitor->mutex_state != JVMP_STATE_LOCKED) - return JVMP_ERROR_MUTEX_NOT_LOCKED; - if (milli == 0) - r = pthread_cond_wait((pthread_cond_t*)monitor->monitor, - (pthread_mutex_t*)monitor->mutex); - else - { - struct timespec abstime; - jlong end; - - end = getTimeMillis() + milli; - abstime.tv_sec = end / 1000; - abstime.tv_nsec = (end % 1000) * 1000000; - r = pthread_cond_timedwait((pthread_cond_t*)monitor->monitor, - (pthread_mutex_t*)monitor->mutex, - &abstime); - } - switch (r) - { - case 0: - return 0; /* OK */ - case EINTR: - return -1; /* interrupted */ - case ETIMEDOUT: - return 0; /* OK as far */ - default: - return -2; - } -} - diff --git a/mozilla/java/waterfall/wf/src/plugin/unix/shmtran.c b/mozilla/java/waterfall/wf/src/plugin/unix/shmtran.c deleted file mode 100644 index 33d50a5139f..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/unix/shmtran.c +++ /dev/null @@ -1,813 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: shmtran.c,v 1.1.1.1 2001-05-09 17:30:10 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include "shmtran.h" -#include -#include /* for va_list */ -#include -#include -#include /* for index() */ -#include -#include -#include "jvmp_cap_vals.h" - -/* XXX: int->jint, long->jlong */ - -static volatile int g_terminate = 0; -#define MAX_SHM_MSG 40 -#define MAX_SHM_MEM 10 -static int _msgs[MAX_SHM_MSG]; -static int _shms[MAX_SHM_MEM]; -static struct sigaction _sigs[NSIG]; -#define JVMP_SHM_LIMIT 1000000 -static int g_side = 0; - -/* to break, or not to break */ -#define ADD_MQ(_idx, msg) for(_idx=0; _idxrid = 0; - req->argt = NULL; - req->argc = 0; - req->length = 0; - req->data = NULL; - req->func_no = func_no; - req->retval = 0; /* determined later in JVMP_WaitConfirmShmRequest*/ - req->msg_id = msg_id; - req->shmid = 0; - req->shmdata = NULL; - req->nullmask = 0; - req->shmlen = 0; - JVMP_FORBID_ALL_CAPS(req->caps); - JVMP_ALLOW_CAP(req->caps, JVMP_CAP_SYS_PARITY); /* integrity bit */ - return req; -} - -int JVMP_EncodeRequest(JVMP_ShmRequest* req, - char* fmt, ...) -{ -#define GET_AND_COPY(ap, type, pos, len) \ - type##_val = va_arg(ap, type); \ - size = sizeof(type); \ - if (pos+size >= len) { len = step+pos+size; buf = realloc(buf, len); } \ - memcpy(buf+pos, &type##_val, size); \ - pos += size; argc++; -#define GET_AND_COPY_STRING(ap, pos, len) \ - string_val = va_arg(ap, char*); \ - if (!string_val) {nullmask |= (0x1 << argc); } else {\ - size = strlen(string_val) + 1; \ - if (pos+size >= len) { len = step+pos+size; buf = realloc(buf, len); } \ - memcpy(buf+pos, string_val, size); \ - pos += size; } argc++; -#define GET_AND_COPY_DATA(ap, pos, len, size) \ - jpointer_val = va_arg(ap, void*); \ - if (!jpointer_val) { nullmask |= (0x1 << argc); } else {\ - if (pos+size >= len) { len = step+pos+size; buf = realloc(buf, len); } \ - memcpy(buf+pos, jpointer_val, size); \ - pos += size;} argc++; - char* buf = NULL; - char *next, lens[20]; - int len, step, pos, size, argc, slen, nullmask; - int int_val; - char* string_val; - long long_val; - jpointer jpointer_val; - va_list ap; - if (!req || !fmt) return 0; - if (req->argt) free(req->argt); - req->argt = strdup(fmt); - nullmask = 0; - len = 0; step = 20; pos = 0; argc = 0; size = 0; - va_start(ap, fmt); - while(*fmt) - { - switch(*fmt++) - { - case 'I': /* integer */ - GET_AND_COPY(ap, int, pos, len); - //printf("int %d of size %d\n", int_val, size); - break; - case 'i': /* integer ref */ - GET_AND_COPY_DATA(ap, pos, len, sizeof(int)); - //printf("int ref %d\n", (int)*(int*)jpointer_val); - break; - case 'J': /* long */ - GET_AND_COPY(ap, long, pos, len); - //printf("long %ld of size %d\n", long_val, size); - break; - case 'j': /* long ref */ - GET_AND_COPY_DATA(ap, pos, len, sizeof(long)); - //printf("long ref %ld\n", (long)*(long*)jpointer_val); - break; - case 'P': /* pointer */ - GET_AND_COPY(ap, jpointer, pos, len); - //printf("pointer %p of size %d\n", jpointer_val, size); - break; - case 'p': /* pointer ref */ - GET_AND_COPY_DATA(ap, pos, len, sizeof(void*)); - //printf("pointer ref %p\n", *(void**)jpointer_val); - break; - case 'C': /* char */ - /* `char' is promoted to `int' when passed through `...' */ - GET_AND_COPY(ap, int, pos, len); - //printf("char %c of size %d\n", int_val, size); - break; - case 'c': /* char ref - not string */ - GET_AND_COPY_DATA(ap, pos, len, sizeof(void*)); - break; - case 'S': /* zero terminated string */ - case 's': - GET_AND_COPY_STRING(ap, pos, len); - //printf("string \"%s\" of size %d\n", string_val, size); - break; - case 'A': /* any data - length follows */ - case 'a': - if (*fmt != '[') break; /* invalid description */ - next = index(fmt, ']'); - if (!next) break; /* invalid description */ - slen = (int)(next - fmt); - if (slen > 20) break; - memset(lens, 0, slen); - memcpy(lens, fmt+1, slen-1); - slen = atoi(lens); - GET_AND_COPY_DATA(ap, pos, len, slen) - fmt = next + 1; - //fprintf(stderr, "data %p of size %d\n", jpointer_val, slen); - break; - default: - //printf("UNKNOWN\n"); - break; - } - }; - va_end(ap); - //printf("Total len is %d, argc=%d nullmask=0x%x\n", pos, argc, nullmask); - req->argc = argc; - req->length = pos; - if (req->data) free(req->data); - req->data = buf; - req->nullmask = nullmask; - return 1; -} - -int JVMP_DecodeRequest(JVMP_ShmRequest* req, int alloc_ref, - char* sign, ...) -{ -#define CHECK_SIGNATURE(sign1, sign2) \ - if (strcmp(sign1, sign2)) { \ - fprintf(stderr, "signature mismatch\n"); return 0; } - - char* fmt; - char *buf, *next, lens[20]; - int size, argc, slen, byval; - jpointer* ptr; - va_list ap; - - if (!req || !sign) return 0; - //CHECK_SIGNATURE(req->argt, sign); - fmt = req->argt; - buf = req->data; - argc = 0; - va_start(ap, sign); - - while(*fmt) - { - byval = 0; - switch(*fmt++) - { - case 'I': /* integer */ - byval = 1; - case 'i': - size = sizeof(int); - break; - case 'J': /* long */ - byval = 1; - case 'j': - size = sizeof(long); - break; - case 'P': /* pointer */ - byval = 1; - case 'p': - size = sizeof(void*); - break; - case 'C': /* char */ - byval = 1; - case 'c': - /* `char' is promoted to `int' when passed through `...' */ - size = sizeof(int); - break; - case 'S': /* zero terminated string */ - case 's': - size = strlen(buf)+1; - break; - case 'A': - case 'a': /* any data - length follows */ - size = 0; - if (*fmt != '[') break; /* invalid description */ - next = index(fmt, ']'); - if (!next) break; /* invalid description */ - slen = (int)(next - fmt); - memset(lens, 0, slen); - memcpy(lens, fmt+1, slen-1); - slen = atoi(lens); - size = slen; - fmt = next + 1; - break; - // not yet -#if 0 - case 'Z': - case 'z': /* really special, but important case of char** - Z[10] means array of 10 strings, or z[0] - if you don't know length of returned value. - But another side must know, when calling - JVMP_EncodeRequest, and it should change - signature to smth meaningful. - Use with care. */ - size = 0; - if (*fmt != '[') break; /* invalid description */ - next = index(fmt, ']'); - if (!next) break; /* invalid description */ - slen = (int)(next - fmt); - if (slen > 20) break; - memset(lens, 0, slen); - memcpy(lens, fmt+1, slen-1); - slen = atoi(lens); - if (!slen) { size = -1; break; } - size = slen; - fmt = next + 1; - break; -#endif - default: - size = 0; - fprintf(stderr, "shmtran: UNKNOWN signature: %c\n",*(fmt-1)); - break; - } - if (size != 0) argc++; - if (size == -1) size = 0; - ptr = va_arg(ap, jpointer*); - if (ptr) - { - if (IS_NULL_VAL(req, argc)) - { - *ptr = NULL; - continue; - } - if (byval) - memcpy(ptr, buf, size); - else - { - if (alloc_ref) *ptr = malloc(size); - memcpy(*ptr, buf, size); - } - } - if (!IS_NULL_VAL(req, argc)) - buf += size; - }; - va_end(ap); - return 1; -} - -int JVMP_GetArgSize(JVMP_ShmRequest* req, int argno) -{ - char* fmt; - char *buf, *next, lens[40]; - int size, argc, slen; - - if (!req) return 0; - fmt = strdup(req->argt); - buf = req->data; - argc = 0; - while(*fmt) - { - switch(*fmt++) - { - case 'I': /* integer */ - case 'i': - size = sizeof(int); - break; - case 'J': /* long */ - case 'j': - size = sizeof(long); - break; - case 'P': /* pointer */ - case 'p': - size = sizeof(void*); - break; - case 'C': /* char */ - case 'c': - /* `char' is promoted to `int' when passed through `...' */ - size = sizeof(int); - break; - case 'S': /* zero terminated string */ - case 's': - size = strlen(buf)+1; - break; - case 'A': - case 'a': /* any data - length follows */ - size = 0; - if (*fmt != '[') break; /* invalid description */ - next = index(fmt, ']'); - if (!next) break; /* invalid description */ - slen = (int)(next - fmt); - if (slen > 20) break; - memset(lens, 0, slen); - memcpy(lens, fmt+1, slen-1); - slen = atoi(lens); - if (!slen) { size = -1; break; } - size = slen; - fmt = next + 1; - break; - default: - size = 0; - printf("UNKNOWN: %c\n",*(fmt-1)); - break; - } - if (size != 0) argc++; - if (size == -1) size = 0; - if (argc == argno) - { - if (IS_NULL_VAL(req, argc)) - { - return 0; - } - return size; - } - if (!IS_NULL_VAL(req, argc)) - buf += size; - }; - return -1; -} - - -int JVMP_DeleteShmReq(JVMP_ShmRequest* req) -{ - JVMP_shmdt(req->shmdata, req->shmid); - /* XXX: this can be inefficient, but otherwise I'll get EINVAL - if this segment will be reused with greater size */ - shmctl(req->shmid, IPC_RMID, NULL); - free(req->data); - free(req->argt); - free(req); - return 1; -} - -// XXX: update when JVMP_ShmRequest changed -static int JVMP_MarshallShmReq(JVMP_ShmRequest* req, - char* *res, int *plen) -{ -#define ADD_VAL(val) \ - size = sizeof(val); \ - if (pos+size >= len) { len = pos+size+step; buf = realloc(buf, len); } \ - memcpy(buf+pos, &val, size); \ - pos += size; argc++; -#define ADD_REF(ref, size) \ - if (pos+size >= len) { len = pos+size+step; buf = realloc(buf, len); } \ - memcpy(buf+pos, ref, size); \ - pos += size; argc++; - int len=0, pos=0, size, step=20, argc=0; - char* buf = NULL; - if (!req) return 0; - - ADD_VAL(req->rid); - ADD_VAL(req->msg_id); - ADD_VAL(req->func_no); - ADD_VAL(req->retval); - ADD_VAL(req->argc); - ADD_REF(req->argt, strlen(req->argt)+1); - ADD_VAL(req->nullmask); - ADD_VAL(req->length); - ADD_REF(req->data, req->length); - ADD_VAL(req->shmlen); - ADD_VAL(req->shmid); - ADD_VAL(req->caps); - // there's no ADD_REF(req->shmdata, req->length); as it's SHARED - *res = buf; - *plen = pos; - return 1; -} -static int JVMP_DemarshallShmReq(char* buf, int buf_len, - JVMP_ShmRequest* *preq) -{ -#define EXTRACT_VAL(val) \ - size = sizeof(val); \ - memcpy(&(val), buf+pos, size); \ - pos += size; argc++; -#define EXTRACT_REF(ref, size) \ - ref = (char*)malloc(size); \ - memcpy(ref, buf+pos, size); \ - pos += size; argc++; - int pos=0, size, argc=0; - JVMP_ShmRequest* req; - req = JVMP_NewShmReq(0, 0); - if (!req) return 0; - - EXTRACT_VAL(req->rid); - EXTRACT_VAL(req->msg_id); - EXTRACT_VAL(req->func_no); - EXTRACT_VAL(req->retval); - EXTRACT_VAL(req->argc); - EXTRACT_REF(req->argt, strlen(buf+pos)+1); - EXTRACT_VAL(req->nullmask); - EXTRACT_VAL(req->length); - EXTRACT_REF(req->data, req->length); - EXTRACT_VAL(req->shmlen); - EXTRACT_VAL(req->shmid); - EXTRACT_VAL(req->caps); - if (!JVMP_IS_CAP_ALLOWED(req->caps, JVMP_CAP_SYS_PARITY)) - { - fprintf(stderr, "Parity cap is not set - probably WF bug\n"); - return 0; - } - *preq = req; - return 1; -} -/* there's additional #if 0'ed handshake code for cases - when it desired to detach shared memory ASAP */ -int JVMP_SendShmRequest(JVMP_ShmRequest* req, int sync) -{ - char* buf = NULL; - int len = 0; - int shmid; - void* shmbuf; - static key_t key = 0; - JVMP_ShmMessage msg; - static unsigned long id = 0; - - id += 2; - if (id >= JVMP_SHM_LIMIT) id = 0; - req->rid = id; - //if (!key) key = ftok(".", 's'); - JVMP_MarshallShmReq(req, &buf, &len); - shmid = JVMP_shmget(key, len, IPC_CREAT | IPC_EXCL | IPC_PRIVATE | 0660); - if (shmid == -1) - { - perror("JVMP_SendShmRequest: shmget"); - return 0; - } - if ((shmbuf = JVMP_shmat(shmid, NULL, 0)) == (void*)-1) - { - perror("JVMP_SendShmRequest: shmat"); - return 0; - } - req->shmid = shmid; - req->shmdata = shmbuf; - req->shmlen = GetShmRealLen(len); - - /* yes, double marshalling is stupid, but I dunno how to find out len */ - free(buf); - JVMP_MarshallShmReq(req, &buf, &len); - memcpy(shmbuf, buf, len); - free(buf); - msg.mtype = id; - msg.message = sync ? 1 : 2; /* 1 - sync, - wait confirmtion - 2 - async, - never wait confirmation */ - msg.shm_len = req->shmlen; - msg.shm_id = shmid; - if ((msgsnd(req->msg_id, (struct msgbuf *)&msg, - sizeof(msg)-sizeof(long), 0)) ==-1) - { - perror("JVMP_SendShmRequest: msgsnd"); - return 0; - } - return 1; -} - -int JVMP_RecvShmRequest(int msg_id, int sync, - JVMP_ShmRequest* *preq) -{ - int qflags = sync ? 0 : IPC_NOWAIT; - JVMP_ShmMessage msg; - char* buf; - void* shmbuf; - int len; - - /* this msgrcv() won't recieve system messages */ - restart: - if ((msgrcv(msg_id, - (struct msgbuf *)&msg, - sizeof(msg)-sizeof(long), - -JVMP_SHM_LIMIT, qflags)) ==-1) - { - if (errno == EINTR && !g_terminate) goto restart; - /* just to remove not needed output */ - if (!(((errno == ENOMSG || errno == EAGAIN) && !sync) || g_terminate)) - perror("JVMP_RecvShmRequest: msgrcv"); - *preq = NULL; - return 0; - } - if ((shmbuf = JVMP_shmat(msg.shm_id, NULL, 0)) == (void*)-1) - { - perror("JVMP_RecvShmRequest: shmat"); - return 0; - } - len = msg.shm_len; - buf = (char*)malloc(len); - memcpy(buf, shmbuf, len); - JVMP_DemarshallShmReq(buf, len, preq); - free(buf); - (*preq)->shmid = msg.shm_id; - (*preq)->shmdata = shmbuf; - - return 1; -} - -int JVMP_ConfirmShmRequest(JVMP_ShmRequest* req) -{ - JVMP_ShmMessage msg; - char* buf; - int len; - - msg.mtype = req->rid + JVMP_SHM_LIMIT + 1; - msg.message = req->retval; - msg.shm_id = req->shmid; - JVMP_MarshallShmReq(req, &buf, &len); - /* can optimize it, using knowledge, that really segment size is whole pages - number on some systems - see GetShmRealLen() */ - if (req->shmlen < len) - { - JVMP_shmdt(req->shmdata, req->shmid); - req->shmid = - JVMP_shmget(0, len, IPC_CREAT | IPC_EXCL | IPC_PRIVATE | 0660); - if (req->shmid == -1) - { - perror("JVMP_ConfirmShmRequest: shmget"); - return 0; - } - if ((req->shmdata - = JVMP_shmat(req->shmid, NULL, 0)) == (void*)-1) - { - perror("JVMP_ConfirmShmRequest: shmat"); - return 0; - } - req->shmlen = GetShmRealLen(len); - if ((req->shmdata = JVMP_shmat(req->shmid, NULL, 0)) == (void*)-1) - { - perror("JVMP_WaitConfirmShmRequest: shmat"); - return 0; - } - msg.shm_id = req->shmid; - } - msg.shm_len = req->shmlen; - memcpy(req->shmdata, buf, len); - if ((msgsnd(req->msg_id, (struct msgbuf *)&msg, - sizeof(msg)-sizeof(long), 0)) == -1) - { - perror("JVMP_ConfirmShmRequest: msgsnd"); - return 0; - } - return 1; -} - -int JVMP_WaitConfirmShmRequest(JVMP_ShmRequest* req) -{ - JVMP_ShmMessage msg; - char* buf; - int len; - JVMP_ShmRequest* req1; - - //fprintf(stderr, "Waiting confirm %ld\n", req->rid + JVMP_SHM_LIMIT + 1); - restart: - if ((msgrcv(req->msg_id, - (struct msgbuf *)&msg, - sizeof(msg)-sizeof(long), - req->rid + JVMP_SHM_LIMIT + 1, 0)) == -1) - { - /* I know, it's wrong, but what else I can do - to reliably restart after alarams? */ - if (errno == EINTR && !g_terminate) goto restart; - if (!!g_terminate) perror("JVMP_WaitConfirmShmRequest: msgrcv"); - return 0; - } - req->retval = msg.message; - req->shmlen = msg.shm_len; - if (req->shmid != msg.shm_id) /* SHM segment changed - reattach to new */ - { - JVMP_shmdt(req->shmdata, req->shmid); - shmctl(req->shmid, IPC_RMID, NULL); /* nobody uses it */ - req->shmid = msg.shm_id; - if ((req->shmdata = JVMP_shmat(req->shmid, NULL, 0)) == (void*)-1) - { - perror("JVMP_WaitConfirmShmRequest: shmat"); - return 0; - } - } - len = req->shmlen; - buf = (char*)malloc(len); - memcpy(buf, req->shmdata, len); - JVMP_DemarshallShmReq(buf, len, &req1); - free(buf); - free(req->argt); req->argt = req1->argt; - req->length = req1->length; - free(req->data); req->data = req1->data; - req->nullmask = req1->nullmask; - /* update call capabilities, if changed on another side. - Higher level code can use it to update thread current capabilities, - if some caps changing call happened. Maybe not need, commented out yet. */ - //memcpy(&req->caps, &req1->caps, sizeof(JVMP_SecurityCap)); - free(req1); - //fprintf(stderr, "Got confirm %ld retval=%d\n", - // req->rid + JVMP_SHM_LIMIT + 1, req->retval); - return 1; -} - - -int JVMP_ShmMessageLoop(int msg_id) -{ - JVMP_ShmRequest* req; - while (!g_terminate) - { - if (!JVMP_RecvShmRequest(msg_id, 1, &req)) break; - JVMP_ExecuteShmRequest(req); - JVMP_ConfirmShmRequest(req); - JVMP_DeleteShmReq(req); - } - JVMP_ShmShutdown(); - return 1; -} - -static void JVMP_SigHandler(int sig) -{ - fprintf(stderr, "Got signal %d\n", sig); - g_terminate = 1; - JVMP_ShmShutdown(); - raise(sig); -} - -int JVMP_ShmInit(int side) -{ - int i; - struct sigaction sigact; - - for (i=0; i < MAX_SHM_MSG; i++) _msgs[i] = -1; - for (i=0; i < MAX_SHM_MEM; i++) _shms[i] = -1; - - sigact.sa_handler = JVMP_SigHandler; - sigact.sa_flags = 0; - g_side = side; - /* interrupts chaining */ - if (side == 1) - { - /* host side - all signal handlers setting are safe */ - sigaction(SIGSEGV, &sigact, &(_sigs[SIGSEGV])); - sigaction(SIGCHLD, &sigact, &(_sigs[SIGCHLD])); - //sigaction(SIGILL, &sigact, &(_sigs[SIGILL])); - } - else - { - /* JVM side - some signal handlers unsafe to set */ -#ifndef _JVMP_SUNJVM - /* Sun's JVM stupidly coredumps if change those handlers */ - sigaction(SIGSEGV, &sigact, &(_sigs[SIGSEGV])); - sigaction(SIGCHLD, &sigact, &(_sigs[SIGCHLD])); -#endif - } - sigaction(SIGINT, &sigact, &(_sigs[SIGINT])); - sigaction(SIGKILL, &sigact, &(_sigs[SIGKILL])); - sigaction(SIGTERM, &sigact, &(_sigs[SIGTERM])); - atexit(&JVMP_ShmShutdown); - return 1; -} - -void JVMP_ShmShutdown() -{ - struct msqid_ds mctl; - struct shmid_ds sctl; - int i; - - for (i=0; i < MAX_SHM_MSG; i++) - if (_msgs[i] != -1) { - msgctl(_msgs[i], IPC_RMID, &mctl); - _msgs[i] = -1; - } - for (i=0; i < MAX_SHM_MEM; i++) - if (_shms[i] != -1) { - shmctl(_shms[i], IPC_RMID, &sctl); - _shms[i] = -1; - } - if (g_side == 1) - { - sigaction(SIGSEGV, &(_sigs[SIGSEGV]), 0); - sigaction(SIGCHLD, &(_sigs[SIGCHLD]), 0); - } - else - { - /* Sun's JVM stupidly coredumps if change those handlers */ -#ifndef _JVMP_SUNJVM - sigaction(SIGSEGV, &(_sigs[SIGSEGV]), 0); - sigaction(SIGCHLD, &(_sigs[SIGCHLD]), 0); -#endif - } - sigaction(SIGINT, &(_sigs[SIGINT]), 0); - sigaction(SIGKILL, &(_sigs[SIGKILL]), 0); - sigaction(SIGTERM, &(_sigs[SIGTERM]), 0); - //sigaction(SIGILL, &(_sigs[SIGILL]), 0); -} - -/* -JVMP_ShmRequest* JVMP_NewEncodedShmReq(int msg_id, unsigned int func_no, - char* sign, ...) -{ - JVMP_ShmRequest* req = JVMP_NewShmReq(msg_id, func_no); - if (!req || !JVMP_EncodeRequest(req, sign, ...)) return 0; - return 1; -} -*/ - - - - - - - - diff --git a/mozilla/java/waterfall/wf/src/plugin/win32/native.c b/mozilla/java/waterfall/wf/src/plugin/win32/native.c deleted file mode 100644 index b2af5aa5b4b..00000000000 --- a/mozilla/java/waterfall/wf/src/plugin/win32/native.c +++ /dev/null @@ -1,27 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: native.c,v 1.1.1.1 2001-05-09 17:30:10 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -// nothing here yet diff --git a/mozilla/java/waterfall/wf/tests/LC/LC.java b/mozilla/java/waterfall/wf/tests/LC/LC.java deleted file mode 100644 index a62ca309887..00000000000 --- a/mozilla/java/waterfall/wf/tests/LC/LC.java +++ /dev/null @@ -1,112 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: LC.java,v 1.1.1.1 2001-05-09 17:30:10 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -import java.util.*; -import java.awt.*; -import java.applet.*; -import java.text.*; -import netscape.javascript.*; - -public class LC extends Applet implements Runnable { - Thread timer; // The thread that displays smth - int max = 0, counter, prev_counter; - JSObject jso; - String msg; - Font font1; - Color textColor; - - public void init() { - prev_counter = -1; - msg = getParameter("message"); - if (msg == null) msg = "Default message"; - try { - max = Integer.parseInt(getParameter("count")); - } - catch (Exception e) { - e.printStackTrace(); - max = 30; - } - counter = max; - - font1 = new Font("Serif", Font.BOLD, 45); - setBackground(new Color(0x00ffff)); - textColor = Color.red; - try - { - jso = JSObject.getWindow(this); - } - catch(JSException e) - { - System.err.println("JSException: "+e); - return; - } - System.err.println("I got JSObject: "+jso); - } - - public void paint(Graphics g) { - g.setFont(font1); - g.setColor(getBackground()); - if (prev_counter >= 0) - g.drawString(new Integer(prev_counter).toString(), 60, 70); - g.setColor(textColor); - g.drawString(new Integer(counter).toString(), 60, 70); - } - - public void start() { - timer = new Thread(this); - timer.start(); - } - - public void stop() { - timer = null; - } - - public void run() { - Thread me = Thread.currentThread(); - while (timer == me) { - try { - Thread.currentThread().sleep(1000); - } catch (InterruptedException e) { - } - prev_counter = counter; - counter--; - if (counter == 0) - { - counter = max; - jso.eval("alert(\""+msg+"\")"); - } - repaint(); - } - } - - public void update(Graphics g) { - paint(g); - } - - public String getAppletInfo() { - return "Title: LiveConnect Sample."; - } -} diff --git a/mozilla/java/waterfall/wf/tests/LC/LC1.java b/mozilla/java/waterfall/wf/tests/LC/LC1.java deleted file mode 100644 index 21812596602..00000000000 --- a/mozilla/java/waterfall/wf/tests/LC/LC1.java +++ /dev/null @@ -1,134 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: LC1.java,v 1.1.1.1 2001-05-09 17:30:10 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -import java.util.*; -import java.awt.*; -import java.applet.*; -import java.text.*; -import netscape.javascript.*; - -public class LC1 extends Applet implements Runnable { - Thread timer; // The thread that displays smth - int max = 0, counter, prev_counter; - JSObject jso; - String msg; - Font font1; - Color textColor; - - public void init() { - prev_counter = -1; - msg = getParameter("message"); - if (msg == null) msg = "Default message"; - try { - max = Integer.parseInt(getParameter("count")); - } - catch (Exception e) { - e.printStackTrace(); - max = 30; - } - counter = max; - - font1 = new Font("Serif", Font.BOLD, 45); - setBackground(new Color(0x00ffff)); - textColor = Color.red; - try - { - jso = JSObject.getWindow(this); - System.out.println("window.location="+ - jso.getMember("location")); - - } - catch(JSException e) - { - System.err.println("JSException: "+e); - return; - } - } - - public void paint(Graphics g) { - g.setFont(font1); - g.setColor(getBackground()); - if (prev_counter >= 0) - g.drawString(new Integer(prev_counter).toString(), 60, 70); - g.setColor(textColor); - g.drawString(new Integer(counter).toString(), 60, 70); - } - - public void start() { - timer = new Thread(this); - timer.start(); - } - - public void stop() { - timer = null; - } - - public void run() { - Thread me = Thread.currentThread(); - while (timer == me) { - try { - Thread.currentThread().sleep(1000); - } catch (InterruptedException e) { - } - prev_counter = counter; - counter--; - if (counter == -1) - { - counter = max; - int x = (int)(Math.random()*400); - int y = (int)(Math.random()*400); - try { - jso.call("moveTo", - new Object[] { new Integer(x), new Integer(y) }); - } catch (Exception e) { - System.err.println("got JS exception: "+e); - } - } - repaint(); - } - } - - public void update(Graphics g) { - paint(g); - } - - public String getAppletInfo() { - return "Title: LiveConnect Sample."; - } - - public void setLimit(String limit) - { - int l = Integer.parseInt(limit); - setLimit(l); - } - - public void setLimit(int limit) - { - prev_counter = counter; - max = counter = limit; - repaint(); - } -} diff --git a/mozilla/java/waterfall/wf/tests/LC/example1.html b/mozilla/java/waterfall/wf/tests/LC/example1.html deleted file mode 100644 index 822c12170a7..00000000000 --- a/mozilla/java/waterfall/wf/tests/LC/example1.html +++ /dev/null @@ -1,20 +0,0 @@ - - - Live connect sample - - -

Live Connect

-
- - - - alt="Your browser understands the <APPLET> tag but isn't running the applet, for some reason." - Your browser is completely ignoring the <APPLET> tag! - - - - - - - - diff --git a/mozilla/java/waterfall/wf/tests/LC/example2.html b/mozilla/java/waterfall/wf/tests/LC/example2.html deleted file mode 100644 index 6fe3c8c5933..00000000000 --- a/mozilla/java/waterfall/wf/tests/LC/example2.html +++ /dev/null @@ -1,23 +0,0 @@ - - - -JS->Java call sample - - - - -
- -
- - - diff --git a/mozilla/java/waterfall/wf/tests/LC/example3.html b/mozilla/java/waterfall/wf/tests/LC/example3.html deleted file mode 100644 index 7515e3cbde7..00000000000 --- a/mozilla/java/waterfall/wf/tests/LC/example3.html +++ /dev/null @@ -1,16 +0,0 @@ - - - Another LiveConnect sample - - -

Live Connect

-
- - - - alt="Your browser understands the <APPLET> tag but isn't running the applet, for some reason." - Your browser is completely ignoring the <APPLET> tag! - - - - diff --git a/mozilla/java/waterfall/wf/tests/LC/example4.html b/mozilla/java/waterfall/wf/tests/LC/example4.html deleted file mode 100644 index 006e78b2593..00000000000 --- a/mozilla/java/waterfall/wf/tests/LC/example4.html +++ /dev/null @@ -1,21 +0,0 @@ - - - -JS->Java unsecure call sample - should fail - - - - -
-
-
- - diff --git a/mozilla/java/waterfall/wf/tests/LC/example5.html b/mozilla/java/waterfall/wf/tests/LC/example5.html deleted file mode 100644 index 89bba0a7e49..00000000000 --- a/mozilla/java/waterfall/wf/tests/LC/example5.html +++ /dev/null @@ -1,23 +0,0 @@ - - - -JS->Java field setter/getter - - - - -
-
-
- - diff --git a/mozilla/java/waterfall/wf/tests/LC/example6.html b/mozilla/java/waterfall/wf/tests/LC/example6.html deleted file mode 100644 index 03a64024a1f..00000000000 --- a/mozilla/java/waterfall/wf/tests/LC/example6.html +++ /dev/null @@ -1,28 +0,0 @@ - - - -LiveConnect DOM calls tester - - - - -
- -
-
- - - -alt="Your browser understands the <APPLET> tag but isn't running the applet, for some reason." - Your browser is completely ignoring the <APPLET> tag! - - - diff --git a/mozilla/java/waterfall/wf/tests/https/SecureApplet.java b/mozilla/java/waterfall/wf/tests/https/SecureApplet.java deleted file mode 100644 index 744c90a0a24..00000000000 --- a/mozilla/java/waterfall/wf/tests/https/SecureApplet.java +++ /dev/null @@ -1,138 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: SecureApplet.java,v 1.1.1.1 2001-05-09 17:30:10 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -import java.util.*; -import java.awt.*; -import java.awt.event.*; -import java.applet.*; -import java.text.*; -import java.io.*; -import java.net.*; - -public class SecureApplet extends Applet implements ActionListener -{ - Button b1, b2, clear; - TextArea content; - - public void init() { - b1 = new Button("Secure"); - b2 = new Button("Nonsecure"); - clear = new Button("Clear"); - content = new TextArea(15, 35); - setFont(new Font("Monospaced", Font.PLAIN, 10)); - add(content); - add(b1); add(b2); add(clear); - b1.addActionListener(this); - b2.addActionListener(this); - clear.addActionListener(this); - } - - public void actionPerformed(ActionEvent evt) { - Button source = (Button)evt.getSource(); - if (source == b1) - { - doSecureConnect("lyola"); - return; - } - if (source == b2) - { - doNonsecureConnect("lyola"); - return; - } - if (source == clear) - { - content.setText(""); - } - } - - - public void paint(Graphics g) { - - } - - public void start() { - } - - public void stop() { - } - - public String getAppletInfo() { - return "Title: Secure Connection test"; - } - - void readStream(URL u, InputStream is) { - byte[] buf = new byte[256]; - int r; - StringBuffer sb = new StringBuffer(); - content.setText("reading...."); - sb.append("Following read from url "+u+":\n"); - try { - while ( (r = is.read(buf)) != -1) - { - sb.append(new String(buf, 0, r)); - } - } catch (IOException e) { - e.printStackTrace(); - } - sb.append("_________________________________________"); - content.setText(new String(sb)); - } - - void doSecureConnect(String host) { - InputStream is; - URL u; - try { - URL u1 = getDocumentBase(); - u = new URL("https", - u1.getHost(), - 443, - "/applets/https/data1.dat"); - is = u.openStream(); - } catch (Exception e) { - e.printStackTrace(); - return; - } - readStream(u, is); - } - - void doNonsecureConnect(String host) { - InputStream is; - URL u; - try { - URL u1 = getDocumentBase(); - u = new URL("http", - u1.getHost(), - 80, - "/applets/https/data2.dat"); - is = u.openStream(); - } catch (Exception e) { - e.printStackTrace(); - return; - } - readStream(u, is); - } - -} diff --git a/mozilla/java/waterfall/wf/tests/https/data1.dat b/mozilla/java/waterfall/wf/tests/https/data1.dat deleted file mode 100644 index 31150a8f20c..00000000000 --- a/mozilla/java/waterfall/wf/tests/https/data1.dat +++ /dev/null @@ -1,3 +0,0 @@ -This is secured data. -Q: What's tiny and yellow and very, very, dangerous? -A: A canary with the super-user password. diff --git a/mozilla/java/waterfall/wf/tests/https/data2.dat b/mozilla/java/waterfall/wf/tests/https/data2.dat deleted file mode 100644 index 2bd95076219..00000000000 --- a/mozilla/java/waterfall/wf/tests/https/data2.dat +++ /dev/null @@ -1,10 +0,0 @@ -Insecure data. -Cite 1: - It's not an optical illusion, it just looks like one. - -- Phil White -Cite 2: - Every program has at least one bug and can be shortened by at least one - instruction -- from which, by induction, one can deduce that every - program can be reduced to one instruction which doesn't work. - -Result - no samsara wheel installed on my webserver. diff --git a/mozilla/java/waterfall/wf/tests/https/example1.html b/mozilla/java/waterfall/wf/tests/https/example1.html deleted file mode 100644 index c6e309a6514..00000000000 --- a/mozilla/java/waterfall/wf/tests/https/example1.html +++ /dev/null @@ -1,14 +0,0 @@ - - - HTTPS test sample - - -

Secure/Nonsecure connection

-
- - alt="Your browser understands the <APPLET> tag but isn't running the applet, for some reason." - Your browser is completely ignoring the <APPLET> tag! - - - - diff --git a/mozilla/java/waterfall/wf_moz6/Makefile.in b/mozilla/java/waterfall/wf_moz6/Makefile.in deleted file mode 100644 index 4a6e6aee443..00000000000 --- a/mozilla/java/waterfall/wf_moz6/Makefile.in +++ /dev/null @@ -1,56 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: Makefile.in,v 1.1.1.1 2001-05-09 18:51:31 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -# -# The contents of this file are subject to the Netscape Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/NPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): -# - -DEPTH = ../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -DIRS = public src - -include $(topsrcdir)/config/rules.mk - diff --git a/mozilla/java/waterfall/wf_moz6/doc/README.txt b/mozilla/java/waterfall/wf_moz6/doc/README.txt deleted file mode 100644 index d6877843a53..00000000000 --- a/mozilla/java/waterfall/wf_moz6/doc/README.txt +++ /dev/null @@ -1,95 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: README.txt,v 1.1.1.1 2001-05-09 18:51:32 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - - Introduction - - - This module is an attempt to supply Mozilla with reasonable implementation -of OJI interfaces. This module uses generic low level library called Waterfall -as JVM provider. Its JVM integration part is written from scratch, but for -sake of completness applet viewer from Java Plugin included, so currently -we couldn't publish Waterfall under GPL. -If someone could write reasonable applet viewer, or if I'll -do it at some moment (currently it's work in progress) - it will be complete -GPL code. - - Waterfall - - Anyway, anyone could be able to get Waterfall binaries for Mozilla. -On Unix platforms (Solaris, Linux) it gives much better performance then -Java Plugin (as runs in the same process). -Currently Waterfall known to work on following configurations: - - OS: Solaris - ARCH: Sparc - OS Version: 5.8 (maybe 5.7 with patches) - JDK: Sun 1.3.1 - VM type: hotspot - Status: works OK - - - OS: Solaris - ARCH: i386 - OS Version: 5.7, 5.8 - JDK: Sun 1.3.1 - VM type: hotspot - Status: test program sometimes crashes after AWT loading, - seems bug in x86 Solaris or GTK+, - otherwise works OK - - - OS: Linux - ARCH: i386 - OS Version: 2.2, glibc 2.2 - JDK: Sun 1.3.1 - VM type: hotspot - Status: works OK - - - OS: Linux - ARCH: i386 - OS Version: 2.2, glibc 2.2 - JDK: IBM 1.3 - VM type: classic - Status: works OK - - - OS: Windows - ARCH: i386 - OS Version: NT4.0 (should work on other Win32 systems as far) - JDK: Sun 1.3 - VM type: hotspot - Status: works OK - -Also planned porting Waterfall to Mac and other possible platforms. - - - Running - - Unix: - edit set_env.sh to fit your environment (you need Waterfall headers - and binaries) and add - source set_env.sh - to script running Mozilla - - Windows: - edit set_env.bat to fit your environment (you need Waterfall headers - and binaries) and run - set_env.bat - before running Mozilla diff --git a/mozilla/java/waterfall/wf_moz6/doc/set_env.bat b/mozilla/java/waterfall/wf_moz6/doc/set_env.bat deleted file mode 100644 index 3187e10b175..00000000000 --- a/mozilla/java/waterfall/wf_moz6/doc/set_env.bat +++ /dev/null @@ -1,33 +0,0 @@ -@REM -@REM The contents of this file are subject to the Mozilla Public -@REM License Version 1.1 (the "License"); you may not use this file -@REM except in compliance with the License. You may obtain a copy of -@REM the License at http://www.mozilla.org/MPL/ -@REM -@REM Software distributed under the License is distributed on an "AS -@REM IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -@REM implied. See the License for the specific language governing -@REM rights and limitations under the License. -@REM -@REM The Original Code is The Waterfall Java Plugin Module -@REM -@REM The Initial Developer of the Original Code is Sun Microsystems Inc -@REM Portions created by Sun Microsystems Inc are Copyright (C) 2001 -@REM All Rights Reserved. -@REM -@REM $Id: set_env.bat,v 1.1.1.1 2001-05-09 18:51:33 edburns%acm.org Exp $ -@REM -@REM -@REM Contributor(s): -@REM -@REM Nikolay N. Igotti - -@echo off -rem Set those variables -set WFDIR=f:\nike\wf -rem set WFJDKHOME=c:\jdk1.3 -rem end of customizable part - -set WFHOME=%WFDIR%\build\win32 -echo WFJDKHOME is %WFJDKHOME% -echo WFHOME is %WFHOME% diff --git a/mozilla/java/waterfall/wf_moz6/doc/set_env.sh b/mozilla/java/waterfall/wf_moz6/doc/set_env.sh deleted file mode 100644 index 1cd5daef523..00000000000 --- a/mozilla/java/waterfall/wf_moz6/doc/set_env.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: set_env.sh,v 1.1.1.1 2001-05-09 18:51:33 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -# Set those variables -# for me this var set in .bashrc so I don't need it here -#WFJDKHOME=/usr/java/jdk1.3.0_02 -WFDIR=/usr/local/home/nike/mozilla/wf -# end of customizable part - -CURDIR=`pwd` -cd ${WFDIR}/build/unix -source ./set_paths -cd ${CURDIR} -export WFDIR WFJDKHOME diff --git a/mozilla/java/waterfall/wf_moz6/makefile.win b/mozilla/java/waterfall/wf_moz6/makefile.win deleted file mode 100644 index b9e8aa18cd7..00000000000 --- a/mozilla/java/waterfall/wf_moz6/makefile.win +++ /dev/null @@ -1,28 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: makefile.win,v 1.1.1.1 2001-05-09 18:51:31 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -DEPTH=..\..\.. -DIRS=public src - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/java/waterfall/wf_moz6/public/Makefile.in b/mozilla/java/waterfall/wf_moz6/public/Makefile.in deleted file mode 100644 index 513f07a18a0..00000000000 --- a/mozilla/java/waterfall/wf_moz6/public/Makefile.in +++ /dev/null @@ -1,68 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: Makefile.in,v 1.1.1.1 2001-05-09 18:51:34 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -# -# The contents of this file are subject to the Netscape Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/NPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): -# - -DEPTH = ../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = oji_jvm - -XPIDLSRCS = \ - nsoji2.idl \ - nsIPluggableJVM.idl \ - nsIJavaHTMLObject.idl \ - nsIJavaObjectInfo.idl \ - nsIJavaPluginInstanceProxy.idl \ - nsIWFInstanceWrapper.idl \ - nsIBrowserJavaSupport.idl \ - $(NULL) - -include $(topsrcdir)/config/rules.mk - - - diff --git a/mozilla/java/waterfall/wf_moz6/public/makefile.win b/mozilla/java/waterfall/wf_moz6/public/makefile.win deleted file mode 100644 index b7000f7f793..00000000000 --- a/mozilla/java/waterfall/wf_moz6/public/makefile.win +++ /dev/null @@ -1,39 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: makefile.win,v 1.1.1.1 2001-05-09 18:51:34 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -DEPTH = ..\..\..\.. - -MODULE = oji_jvm - -XPIDLSRCS = \ - .\nsoji2.idl \ - .\nsIPluggableJVM.idl \ - .\nsIJavaHTMLObject.idl \ - .\nsIJavaObjectInfo.idl \ - .\nsIJavaPluginInstanceProxy.idl \ - .\nsIWFInstanceWrapper.idl \ - .\nsIBrowserJavaSupport.idl \ - $(NULL) - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/java/waterfall/wf_moz6/public/nsIBrowserJavaSupport.idl b/mozilla/java/waterfall/wf_moz6/public/nsIBrowserJavaSupport.idl deleted file mode 100644 index f3669adea1d..00000000000 --- a/mozilla/java/waterfall/wf_moz6/public/nsIBrowserJavaSupport.idl +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsIBrowserJavaSupport.idl,v 1.1.1.1 2001-05-09 18:51:34 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include "nsoji2.idl" -#include "nsIJavaPluginInstanceProxy.idl" - -[uuid(f016284f-24f5-4471-aca5-c53746046246)] -interface nsIBrowserJavaSupport : nsISupports -{ - void GetProxyForURL(in string url, out string proxy); - void JSCall(in jp_jint jstid, inout jp_CallInfo call); -}; diff --git a/mozilla/java/waterfall/wf_moz6/public/nsIJavaHTMLObject.idl b/mozilla/java/waterfall/wf_moz6/public/nsIJavaHTMLObject.idl deleted file mode 100644 index 2dbd22ac5f7..00000000000 --- a/mozilla/java/waterfall/wf_moz6/public/nsIJavaHTMLObject.idl +++ /dev/null @@ -1,129 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsIJavaHTMLObject.idl,v 1.1.1.1 2001-05-09 18:51:34 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include "nsoji2.idl" -#include "nsIPluggableJVM.idl" -%{C++ -#include "nsIDOMElement.h" -%} -native nsIDOMElement(nsIDOMElement*); - -/** - * this is instance of visible object on browser's page controlled by - * Java code, like or tag content. - */ -[scriptable, uuid(d0bc700b-aadb-417f-b584-5d644bb3432f)] -interface nsIJavaHTMLObject : nsISupports { - /** - * Initialization stuff. Used by browser when it wishes to create - * Java-driven object on page. Argument is nsISupports - * to simplify using new OJI module - it can be nsIPluginInstancePeer - * for older cases and smth else in the future. - * Second one argument is JVM which should be responsible for this object. - */ - void Initialize(in nsISupports peer, in nsIPluggableJVM jvm); - - /** - * Starts/resumes this object's operations. - */ - void Start(); - - /** - * Stops/suspends this object's operations - */ - void Stop(); - - /** - * Die! - */ - void Destroy(); - - /** - * Method to set drawing window. - * I intentionally will not allow generic Java object here to - * avoid mess. Register window in nsIPluggableJVM first (from C++) or - * in Plugin class (from Java). - */ - [noscript] void SetWindow(in jp_jint ID); - - /** - * Get object peer in browser/host application. - */ - void GetPeer(out nsISupports peer); - /** - * Set type of this Java object - */ - [noscript] void SetType(in jp_jint type); - /** - * Get Java JSObject for this object. - */ - [noscript] void GetJavaPeer(out jp_jobject ID); - - // can ask owner document from this guy - [noscript] void GetDOMElement(out nsIDOMElement result); - - /** - * Methods called by Java side - */ - [noscript] void PostEvent(in jp_jint event, in jp_jlong data); - [noscript] void SendEvent(in jp_jint event, in jp_jlong data); - - - // peer event types, synchronize with HostObjectPeer.java - const long PE_NOPE = 0; - const long PE_CREATE = 1; - const long PE_SETWINDOW = 2; - const long PE_DESTROY = 3; - const long PE_START = 4; - const long PE_STOP = 5; - const long PE_NEWPARAMS = 6; - const long PE_SETTYPE = 7; - // generic event sent by browser - const long PE_PEEREVENT = 8; - const long PE_GETPEER = 9; - - // java event types - const long JE_NOPE = 0; - const long JE_SHOWSTATUS = 1; - const long JE_SHOWDOCUMENT = 2; - // generic event sent by applet - const long JE_APPLETEVENT = 3; - // error requiring browser's attention happened in applet - const long JE_APPLETERROR = 4; - // error requiring browser's attention happened in JVM - const long JE_JVMERROR = 5; - - // peer's host applications - const long PV_UNKNOWN = 0; - const long PV_MOZILLA6 = 1; - - // peer's types - const long PT_UNKNOWN = 0; - const long PT_EMBED = 1; - const long PT_OBJECT = 2; - const long PT_APPLET = 3; - const long PT_PLUGLET = 4; -}; diff --git a/mozilla/java/waterfall/wf_moz6/public/nsIJavaObjectInfo.idl b/mozilla/java/waterfall/wf_moz6/public/nsIJavaObjectInfo.idl deleted file mode 100644 index af1ddbeb8d3..00000000000 --- a/mozilla/java/waterfall/wf_moz6/public/nsIJavaObjectInfo.idl +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsIJavaObjectInfo.idl,v 1.1.1.1 2001-05-09 18:51:34 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include "nsoji2.idl" -#include "nsIJavaHTMLObject.idl" -#include "nsIWFInstanceWrapper.idl" -%{C++ -enum nsJavaObjectType -{ - nsJavaObjectType_Unknown, - nsJavaObjectType_Embed, - nsJavaObjectType_Object, - nsJavaObjectType_Applet, - nsJavaObjectType_Pluglet -}; - -/* opaque structure to be used to pass as bridge between Java and Mozilla - applet operations */ -struct JavaObjectWrapper; -%} - -native nsJavaObjectType(nsJavaObjectType); -native JavaObjectWrapper(JavaObjectWrapper*); - -[uuid(f7eb8258-e2a3-404f-ae11-b9d8a976e993)] -interface nsIJavaObjectInfo : nsISupports -{ - // I don't know why attributes and parameters different - - // so let's consider them as the same thing - void addParameter(in string key, in string value); - void getParameters([array, size_is(count)] out string keys, - [array, size_is(count)] out string values, - [retval] out PRUint32 count); - /* I'm not sure which attributes should be readonly */ - attribute string docBase; - attribute string encoding; - attribute string alignment; - attribute PRUint32 width; - attribute PRUint32 height; - readonly attribute nsJavaObjectType type; - - void getOwner(out nsIJavaHTMLObject owner); - void getWrapper(out JavaObjectWrapper wrapper); - // XXX: temporary - keep it last - void getPluginWrapper(out nsIWFInstanceWrapper wrapper); -}; - - - diff --git a/mozilla/java/waterfall/wf_moz6/public/nsIJavaPluginInstanceProxy.idl b/mozilla/java/waterfall/wf_moz6/public/nsIJavaPluginInstanceProxy.idl deleted file mode 100644 index 33124b07227..00000000000 --- a/mozilla/java/waterfall/wf_moz6/public/nsIJavaPluginInstanceProxy.idl +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsIJavaPluginInstanceProxy.idl,v 1.1.1.1 2001-05-09 18:51:34 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/** - * this is an utility interface used by Java plugin to perform all - * required by Java UI calls in UI thread. - * - * Author: Nikolay Igotti (inn@sparc.spb.su) - */ - -#include "nsISupports.idl" -#include "nsoji2.idl" - -%{C++ -#define NS_JAVAPLUGININSTANCEPROXY_CID \ -{ /* d0e94e41-65e1-49dc-9cbf-7ade042f4c16 */ \ - 0xd0e94e41, \ - 0x65e1, \ - 0x49dc, \ - {0x9c, 0xbf, 0x7a, 0xde, 0x04, 0x2f, 0x4c, 0x16} \ -} -%} -/* The main usage of this interface is to supply Java plugin with thread-safe - applet context. If something else will be required to be wrapped - - extend this one. Here listed all AppletContext methods with comments: - - Applet getApplet(String name); - Note: everthing will happen inside JVM - SKIPPED - - Enumeration getApplets(); - Note: not requires interaction with browser's UI as all applets - anyway registred in plugin - SKIPPED - - AudioClip getAudioClip(URL url); - Note: XXX: maybe requires interaction with browser's UI but I don't know - how to describe audio clip - SKIPPED - - Image getImage(URL url); - Note: everything will happen inside JVM - SKIPPED - - void showDocument(URL url) ; - Note: superseded by next method - WRAPPED by next method - - void showDocument(URL url, String target); - Note: requires interaction with browser - WRAPPED. - - void showStatus(String status); - Note: requires interaction with browser - WRAPPED. -*/ - -[uuid(6706fc34-05b7-4656-9c58-b92ffb220a8a)] -interface nsIJavaPluginInstanceProxy : nsISupports { - void ShowStatus(in string status); - void ShowDocument(in string url, in string target); - void GetJSThread(out jp_jint jstid); -}; - -[uuid(bc704bd3-f962-47ff-9e88-a48c941d78e9)] -interface nsIJavaPluginProxy : nsISupports { - void GetProxyForURL(in string url, out string proxy); - void JSCall(in jp_jint jstid, inout jp_CallInfo call); -}; - - - - diff --git a/mozilla/java/waterfall/wf_moz6/public/nsIJavaPluginInstanceWrapper.idl b/mozilla/java/waterfall/wf_moz6/public/nsIJavaPluginInstanceWrapper.idl deleted file mode 100644 index bce978dc187..00000000000 --- a/mozilla/java/waterfall/wf_moz6/public/nsIJavaPluginInstanceWrapper.idl +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsIJavaPluginInstanceWrapper.idl,v 1.1.1.1 2001-05-09 18:51:34 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include "nsoji2.idl" - - /** - * Thread-safe java plugin instance wrapper. - * nsIJavaPluginInstanceProxy exists as probably not all methods - * here should be forwarded to main thread, and we need IDL description for - * interthread proxy. - */ - [uuid(364eb8a7-8b4b-49b5-bbb5-c34ab2bc2189)] - interface nsIJavaPluginInstanceWrapper : nsISupports - { - void ShowStatus(in string status); - void ShowDocument(in string url, in string target); - void GetJSThread(out jp_jint jstid); -}; diff --git a/mozilla/java/waterfall/wf_moz6/public/nsIPluggableJVM.idl b/mozilla/java/waterfall/wf_moz6/public/nsIPluggableJVM.idl deleted file mode 100644 index 92297095cd5..00000000000 --- a/mozilla/java/waterfall/wf_moz6/public/nsIPluggableJVM.idl +++ /dev/null @@ -1,152 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsIPluggableJVM.idl,v 1.1.1.1 2001-05-09 18:51:35 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include "nsoji2.idl" -#include "nsIBrowserJavaSupport.idl" - -interface nsIJavaHTMLObject; - -/** this is generic JVM inside browser. You can have - * more control on this then using nsIJVMPlugin interface. - * This stuff SHOULD NOT depend on particular JNI/JVM. - * XXX: now it does :), but only in nsoji2.idl and generated .h files. - */ -/** One more important issue: maybe it has sense to divide functionality - * onto threading, drawing, scripting, startup/shutdown parts, - * but I'd like to avoid scattering functionality, so everything - * is in one place. But interface users should expect that some interface - * method aren't implemented, especially LiveConnect related. - */ -%{C++ -#define NS_PLUGGABLEJVM_CID \ -{ /* 43abebc6-a9b1-419f-acbe-677474edead1 */ \ - 0x43abebc6, \ - 0xa9b1, \ - 0x419f, \ - {0xac, 0xbe, 0x67, 0x74, 0x74, 0xed, 0xea, 0xd1} \ -} - -%} - -[uuid(931c3870-c12d-4bff-8e80-005dd29fee01)] -interface nsIPluggableJVM : nsISupports { -/**********************************************************/ - // Here drawing context stuff - /** - * This method registers native window handle rwin - * as Java frame, returns Java object and integer ID - * of this window. Until UnregisterWindow() is called - * it is valid handle. Generally only one thread should - * work with registration/unregistration of one window. - * Also when native peer is destroyed unregister window should be called - * before - otherwise JVM may crash. - */ - void RegisterWindow(in nsNativeWindow rwin, - out jp_jint ID); - /** - * Unregister window and remove Java peer. Call carefully. - */ - void UnregisterWindow(in jp_jint ID); - -/**********************************************************/ - // Here threading stuff - /** - * Create Java monitor assotiated with given native monitor - */ - void RegisterMonitor(in nsNativeMonitor rmon, - out jp_jint ID); - - /** - * Unregister monitor. Call carefully. - */ - void UnregisterMonitor(in jp_jint ID); - - /**********************************************************/ - // Here scripting stuff (javascript based) - /** - * Get JavaScript Java object used for LiveConnect. - */ - void GetJavaWrapper(in jp_jint jsobj, out jp_jobject jobj); - - /** - * Get native JS object from Java object - **/ - void UnwrapJavaWrapper(in jp_jobject jobj, out jp_jint jsobj); - - /** - * Returns JNIEnv of current context. Required due current way - * of LiveConnect implementation. - */ - void GetJNIEnv(out jp_JNIEnv env); -/**********************************************************/ - // Here JVM control stuff - /** - * Run JVM with given classpath. - * Status depends on success of this operation. - */ - void StartupJVM(in string classPath, - out nsJVMStatus status, - in jp_jlong support); - - /** - * Shutdown JVM. - */ - void ShutdownJVM(in PRBool fullShutdown, out nsJVMStatus status); - -/**********************************************************/ - // generic object management - void CreateJavaPeer(in nsIJavaHTMLObject obj, - in string cid, - out jp_jint id); - - void PostEventToJavaPeer(in jp_jint obj_id, - in jp_jint evt_id, - in jp_jlong evt_data); - - void SendEventToJavaPeer(in jp_jint obj_id, - in jp_jint evt_id, - in jp_jlong evt_data, - out jp_jint result); - void JavaPeerCall(in jp_jint obj_id, - in jp_jint data1, - in jp_jlong data2); - void DestroyJavaPeer(in jp_jint id); - void ExtensionCall(in jp_jint arg1, in jp_jlong arg2); - -/*********************************************************/ - // utility stuff, like console handling - void SetConsoleVisibility(in boolean visibility); - void GetConsoleVisibility(out boolean visibility); - void PrintToConsole(in string msg, in string encoding); -}; - - - - - - - - diff --git a/mozilla/java/waterfall/wf_moz6/public/nsIWFInstanceWrapper.idl b/mozilla/java/waterfall/wf_moz6/public/nsIWFInstanceWrapper.idl deleted file mode 100644 index 24b86d8e6ba..00000000000 --- a/mozilla/java/waterfall/wf_moz6/public/nsIWFInstanceWrapper.idl +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsIWFInstanceWrapper.idl,v 1.1.1.1 2001-05-09 18:51:35 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include "nsoji2.idl" - - /** - * Thread-safe java plugin instance wrapper. - * nsIWFInstanceProxy exists as probably not all methods - * here should be forwarded to main thread, and we need IDL description for - * interthread proxy. - */ - [uuid(364eb8a7-8b4b-49b5-bbb5-c34ab2bc2189)] - interface nsIWFInstanceWrapper : nsISupports - { - void ShowStatus(in string status); - void ShowDocument(in string url, in string target); - void GetJSThread(out jp_jint jstid); -}; diff --git a/mozilla/java/waterfall/wf_moz6/public/nsoji2.idl b/mozilla/java/waterfall/wf_moz6/public/nsoji2.idl deleted file mode 100644 index 7a1fbe61638..00000000000 --- a/mozilla/java/waterfall/wf_moz6/public/nsoji2.idl +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsoji2.idl,v 1.1.1.1 2001-05-09 18:51:35 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include "nsISupports.idl" - -%{C++ - -// external C++ includes here - they can be Mozilla dependent, but not -// JDK dependent -// we using older plugin stuff for easyness of integration -// this should be removed in future -//several hacks to live with current Mozilla tree -#define JNI_H -#define JRI_H -#define JRI_MD_H -#include "jvmp.h" -#include "nsplugindefs.h" -#include "nsIPluginInstancePeer.h" -//Java Script stuff -#include "jsapi.h" - -typedef enum nsPluggableJVMStatus { - nsPluggableJVMStatus_Enabled, /* but not Running */ - nsPluggableJVMStatus_Disabled, /* explicitly disabled */ - nsPluggableJVMStatus_Running, /* enabled and started */ - nsPluggableJVMStatus_Failed /* enabled but failed to start */ -} nsPluggableJVMStatus; - -typedef struct _nsPluginThread nsPluginThread; - -// Auxilary macroses -#define OJI_LOG(s1) { fprintf (stderr, "MOZWF: "); \ - fprintf(stderr, s1); fprintf(stderr, "\n"); } -#define OJI_LOG2(s1, s2) { fprintf (stderr, "MOZWF: "); \ - fprintf(stderr, s1, s2); fprintf(stderr, "\n"); } -#define OJI_LOG3(s1, s2, s3) { fprintf (stderr, "MOZWF: "); \ - fprintf(stderr, s1, s2, s3); fprintf(stderr, "\n"); } -#define OJI_LOG4(s1, s2, s3, s4) { fprintf (stderr, "MOZWF: "); \ - fprintf(stderr, s1, s2, s3 ,s4); fprintf(stderr, "\n"); } -#define OJI_LOG5(s1, s2, s3, s4, s5) { fprintf (stderr, "MOZWF: "); \ - fprintf(stderr, s1, s2, s3 ,s4, s5); fprintf(stderr, "\n"); } - -%} - -// native types -native nsNativeWindow(nsPluginWindow*); -native nsNativeMonitor(PRMonitor*); -native nsJVMStatus(nsPluggableJVMStatus); -// hackz - should be in jvmp.h -native jp_jobject(jobject); -native jp_jint(jint); -native jp_jlong(jlong); -native jp_JNIEnv(JNIEnv*); -native jp_CallInfo(struct JSObject_CallInfo*); -// hackz - should be scripting engine independent -native nsScriptRuntime(JSRuntime*); -native nsScriptContext(JSContext*); -native nsScriptObject(JSObject*); - -// interfaces to be IDL'ized -interface nsISecureEnv; -interface nsIPluginInstancePeer; diff --git a/mozilla/java/waterfall/wf_moz6/src/Makefile.in b/mozilla/java/waterfall/wf_moz6/src/Makefile.in deleted file mode 100644 index faa540f86d3..00000000000 --- a/mozilla/java/waterfall/wf_moz6/src/Makefile.in +++ /dev/null @@ -1,83 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: Makefile.in,v 1.1.1.1 2001-05-09 18:51:35 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -# -# The contents of this file are subject to the Netscape Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/NPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): -# - -DEPTH = ../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ -uname = $(shell uname) -ifeq ($(uname), SunOS) -PLATFORM = solaris -endif -ifeq ($(uname), Linux) -PLATFORM = linux -endif - -include $(DEPTH)/config/autoconf.mk - -MODULE = oji_jvm -IS_COMPONENT = 1 - - -LIBRARY_NAME = ojijvm - - -CPPSRCS = \ - nsPluggableJVM.cpp \ - nsCJVMFactory.cpp \ - nsJavaHTMLObjectFactory.cpp \ - nsJavaHTMLObject.cpp \ - nsAppletHTMLObject.cpp \ - nsJavaObjectInfo.cpp \ - nsWFSecureEnv.cpp \ - nsWFSecurityContext.cpp \ - $(NULL) - -include $(DEPTH)/config/rules.mk - -INCLUDES := -I$(WFDIR)/public -I$(WFDIR)/public/$(PLATFORM) -I$(WFJDKHOME)/include -I$(WFJDKHOME)/include/$(PLATFORM) $(INCLUDES) - - - diff --git a/mozilla/java/waterfall/wf_moz6/src/makefile.win b/mozilla/java/waterfall/wf_moz6/src/makefile.win deleted file mode 100644 index 3bfd44cb3fa..00000000000 --- a/mozilla/java/waterfall/wf_moz6/src/makefile.win +++ /dev/null @@ -1,57 +0,0 @@ -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is The Waterfall Java Plugin Module -# -# The Initial Developer of the Original Code is Sun Microsystems Inc -# Portions created by Sun Microsystems Inc are Copyright (C) 2001 -# All Rights Reserved. -# -# $Id: makefile.win,v 1.1.1.1 2001-05-09 18:51:35 edburns%acm.org Exp $ -# -# -# Contributor(s): -# -# Nikolay N. Igotti - -#!nmake -DEPTH = ..\..\..\.. -include <$(DEPTH)\config\config.mak> - -MODULE=ojijvm -IS_COMPONENT=1 - -MAKE_OBJ_TYPE=DLL -DLLNAME=ojijvm -DLL=.\$(OBJDIR)\$(DLLNAME).dll - -OBJS = \ - .\$(OBJDIR)\nsPluggableJVM.obj \ - .\$(OBJDIR)\nsCJVMFactory.obj \ - .\$(OBJDIR)\nsJavaHTMLObjectFactory.obj \ - .\$(OBJDIR)\nsJavaHTMLObject.obj \ - .\$(OBJDIR)\nsAppletHTMLObject.obj \ - .\$(OBJDIR)\nsJavaObjectInfo.obj \ - .\$(OBJDIR)\nsWFSecureEnv.obj \ - .\$(OBJDIR)\nsWFSecurityContext.obj \ - $(NULL) -EXPORTS = \ - $(NULL) - -LINCS = -I$(WFDIR)/public -I$(WFDIR)/public/win32 -I$(WFJDKHOME)/include -I$(WFJDKHOME)/include/win32 -LLIBS = \ - $(DIST)\lib\xpcom.lib \ - $(LIBNSPR) - -include <$(DEPTH)\config\rules.mak> - -install:: $(DLL) - $(MAKE_INSTALL) $(DLL) $(DIST)\bin\components diff --git a/mozilla/java/waterfall/wf_moz6/src/nsAppletHTMLObject.cpp b/mozilla/java/waterfall/wf_moz6/src/nsAppletHTMLObject.cpp deleted file mode 100644 index c4f7e8a1086..00000000000 --- a/mozilla/java/waterfall/wf_moz6/src/nsAppletHTMLObject.cpp +++ /dev/null @@ -1,459 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsAppletHTMLObject.cpp,v 1.1.1.1 2001-05-09 18:51:35 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include "nsAppletHTMLObject.h" -#include "nsJavaHTMLObject.h" -#include "nsJavaObjectInfo.h" -#include "nsIPluginTagInfo.h" -#include "nsIProxyObjectManager.h" -#include "nsIServiceManager.h" -#include "nsIPluginManager2.h" -#include "nsIJavaPluginInstanceProxy.h" -#include "nsIWFInstanceWrapper.h" -#include "nsIJVMPluginInstance.h" -#include "wf_moz6_common.h" -#include "nsIThread.h" - -static NS_DEFINE_CID(kProxyObjectManagerCID, NS_PROXYEVENT_MANAGER_CID); -static NS_DEFINE_CID(kPluginManagerCID, NS_PLUGINMANAGER_CID); - -static NS_DEFINE_IID(kIPluginManagerIID, NS_IPLUGINMANAGER_IID); -static NS_DEFINE_IID(kIPluginManager2IID, NS_IPLUGINMANAGER2_IID); -static NS_DEFINE_IID(kIPluginInstancePeerIID, NS_IPLUGININSTANCEPEER_IID); -static NS_DEFINE_IID(kIPluginInstancePeer2IID, NS_IPLUGININSTANCEPEER2_IID); -static NS_DEFINE_IID(kIPluginTagInfoIID, NS_IPLUGINTAGINFO_IID); -static NS_DEFINE_IID(kIPluginTagInfo2IID, NS_IPLUGINTAGINFO2_IID); - -NS_IMPL_THREADSAFE_ISUPPORTS3(nsAppletHTMLObject, - nsIPluginInstance, - nsIWFInstanceWrapper, - nsIJVMPluginInstance) - -nsAppletHTMLObject::nsAppletHTMLObject(nsJavaHTMLObjectFactory *factory) -{ - NS_INIT_ISUPPORTS(); - m_factory = factory; - m_mgr = nsnull; - NS_ADDREF(m_factory); - m_peer = m_peer2 = nsnull; - m_dead = PR_FALSE; - nsCOMPtr mainIThread; - nsIThread::GetMainThread(getter_AddRefs(mainIThread)); - mainIThread->GetPRThread(&m_mainThread); -} - -nsAppletHTMLObject::~nsAppletHTMLObject(void) { - OJI_LOG("nsAppletHTMLObject::~nsAppletHTMLObject"); - if (m_factory) NS_RELEASE(m_factory); -} - -NS_IMETHODIMP -nsAppletHTMLObject::Initialize(nsIPluginInstancePeer *peer) -{ - nsresult res; - OJI_LOG("nsAppletHTMLObject::Initialize"); - m_peer = peer; - NS_ADDREF(m_peer); - peer->QueryInterface(kIPluginInstancePeer2IID, - (void **)&m_peer2); - m_jobject = new nsJavaHTMLObject(m_factory); - NS_ADDREF(m_jobject); - res = nsServiceManager::GetService(kPluginManagerCID, - kIPluginManagerIID, - getter_AddRefs(m_mgr)); - if (NS_FAILED(res)) return res; - m_id = 0; - if (NS_FAILED(res = m_factory->GetJVM(&m_jvm))) return res; - if (NS_FAILED(res = m_jvm->GetJNIEnv(&m_env))) return res; - if (NS_FAILED(res = m_jobject->Initialize(peer, m_jvm))) return res; - // find out applet information from our peer and explain it - // to nsJavaHTMLObject - // in new API nsJavaHTMLObject should get everything needed - // from peer - nsJavaObjectInfo* info = - new nsJavaObjectInfo((nsIWFInstanceWrapper*)this); - NS_ADDREF(info); - nsIPluginTagInfo *tagInfo; - if (NS_SUCCEEDED(res = peer->QueryInterface(kIPluginTagInfoIID, - (void **)&tagInfo))) - { - PRUint16 argc = 0, i; - char **keys, **vals; - tagInfo->GetAttributes(argc, (const char* const* &)keys, - (const char* const* &) vals); - for (i=0; iAddParameter(keys[i], vals[i]); - NS_RELEASE(tagInfo); - } - - nsIPluginTagInfo2 *extTagInfo; - if (NS_SUCCEEDED(res = peer->QueryInterface(kIPluginTagInfo2IID, - (void **)&extTagInfo))) - { - nsPluginTagType tagType = nsPluginTagType_Unknown; - if (NS_SUCCEEDED(extTagInfo->GetTagType(&tagType))) - { - if (tagType == nsPluginTagType_Applet || - tagType == nsPluginTagType_Object) - { - PRUint16 argc = 0, i; - char **keys, **vals; - extTagInfo->GetParameters(argc, - (const char*const*&)keys, - (const char*const*&) vals); - for (i=0; iAddParameter(keys[i], vals[i]); - } - nsJavaObjectType type = mapType(tagType); - info->SetType(type); - if (NS_FAILED(res = m_jobject->SetType(type))) - return res; - } - const char *docbase = NULL; - if (NS_FAILED(res = extTagInfo->GetDocumentBase(&docbase))) - { - OJI_LOG("Failed to obtain doc base"); - } - if (docbase != NULL) - { - char *slash = strrchr((char*)docbase, '/'); - if (slash != NULL) *(slash+1) = 0; - OJI_LOG2("real docbase is %s", docbase); - info->SetDocBase(docbase); - } - NS_RELEASE(extTagInfo); - } - // really it's crucial to call SetType() _before_ passing Java object info - // otherwise parameters will be passed to wrapper - and silently ignored - res = m_jobject->SetJavaObjectInfo(info); - NS_RELEASE(info); - return res; -} - -NS_IMETHODIMP -nsAppletHTMLObject::GetPeer(nsIPluginInstancePeer* *resultingPeer) -{ - //OJI_LOG("nsAppletHTMLObject::GetPeer"); - if (m_dead) return NS_ERROR_FAILURE; - *resultingPeer = m_peer; - NS_ADDREF(m_peer); - return NS_OK; -} - -NS_IMETHODIMP -nsAppletHTMLObject::Start(void) -{ - OJI_LOG("nsAppletHTMLObject::Start"); - m_dead = PR_FALSE; - return m_jobject->Start(); -} - -NS_IMETHODIMP -nsAppletHTMLObject::Stop(void) -{ - OJI_LOG("nsAppletHTMLObject::Stop"); - if (m_jobject) m_jobject->Stop(); - if (m_id && m_jvm) m_jvm->UnregisterWindow(m_id); - m_id = 0; - m_dead = PR_TRUE; - return NS_OK; -} - -NS_IMETHODIMP -nsAppletHTMLObject::Destroy(void) -{ - OJI_LOG("nsAppletHTMLObject::Destroy"); - m_dead = PR_TRUE; - if (m_jobject) - { - m_jobject->Destroy(); - NS_RELEASE(m_jobject); - } - if (m_peer) NS_RELEASE(m_peer); - if (m_peer2) NS_RELEASE(m_peer2); - if (m_jvm) NS_RELEASE(m_jvm); - //OJI_LOG2("mRefCnt=%d",mRefCnt); - return NS_OK; -} - -// XXX: for now, this code can leak window descriptors, -// as not unregisters old window, if new one has come -// with another native handle. -// SetWindow() with size changing hopefully works well -NS_IMETHODIMP -nsAppletHTMLObject::SetWindow(nsPluginWindow* window) -{ - OJI_LOG2("nsAppletHTMLObject::SetWindow(%p)", - window != nsnull ? (void*)window->window : 0x0); - nsresult res = NS_OK; - - if (m_jvm == NULL) - { - OJI_LOG("m_jvm is NULL"); - return NS_ERROR_FAILURE; - } - - if (window != NULL) - { - jint new_id; - res = m_jvm->RegisterWindow(window, &new_id); - if (NS_FAILED(res)) return res; - //if (m_id != 0 && new_id != m_id) m_jvm->UnregisterWindow(m_id); - m_id = new_id; - } - else - { - if (m_id != 0) m_jvm->UnregisterWindow(m_id); - m_id = 0; - } - return m_jobject->SetWindow(m_id); -} - -NS_IMETHODIMP -nsAppletHTMLObject::NewStream(nsIPluginStreamListener** listener) -{ - OJI_LOG("nsAppletHTMLObject::NewStream"); - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP -nsAppletHTMLObject::Print(nsPluginPrint* platformPrint) -{ - OJI_LOG("nsAppletHTMLObject::Print"); - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP -nsAppletHTMLObject::GetValue(nsPluginInstanceVariable variable, void *value) -{ - OJI_LOG2("nsAppletHTMLObject::GetValue: %d", variable); - if (variable == nsPluginInstanceVariable_DoCacheBool) - { - //OJI_LOG("SET NO PLUGIN CACHING"); - *(PRBool*)value = PR_FALSE; - return NS_OK; - } - return NS_OK; -} - -NS_IMETHODIMP -nsAppletHTMLObject::HandleEvent(nsPluginEvent* event, PRBool* handled) -{ - OJI_LOG("nsAppletHTMLObject::HandleEvent"); - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsJavaObjectType -nsAppletHTMLObject::mapType(nsPluginTagType pluginType) -{ - switch (pluginType) - { - case nsPluginTagType_Applet: - return nsJavaObjectType_Applet; - case nsPluginTagType_Object: - return nsJavaObjectType_Object; - case nsPluginTagType_Embed: - return nsJavaObjectType_Embed; - default: - return nsJavaObjectType_Unknown; - } -} -/* HERE INTERTHREAD PROXY STUFF FOLLOWS */ -// utility proxy class -class nsJavaPluginInstanceProxy : public nsIJavaPluginInstanceProxy -{ -public: - NS_DECL_ISUPPORTS - NS_DECL_NSIJAVAPLUGININSTANCEPROXY - - nsJavaPluginInstanceProxy(); - virtual ~nsJavaPluginInstanceProxy(); - NS_IMETHOD Init(nsAppletHTMLObject* owner); -protected: - nsAppletHTMLObject* m_owner; -}; - -NS_IMPL_THREADSAFE_ISUPPORTS1(nsJavaPluginInstanceProxy, - nsIJavaPluginInstanceProxy); - -nsJavaPluginInstanceProxy::nsJavaPluginInstanceProxy() -{ - NS_INIT_ISUPPORTS(); -} - -NS_IMETHODIMP -nsJavaPluginInstanceProxy::Init(nsAppletHTMLObject* owner) -{ - m_owner = owner; - NS_ADDREF(owner); - return NS_OK; -} - -nsJavaPluginInstanceProxy::~nsJavaPluginInstanceProxy() -{ - NS_RELEASE(m_owner); -} - -NS_IMETHODIMP -nsJavaPluginInstanceProxy::ShowDocument(const char* url, - const char* target) -{ - return m_owner->doShowDocument(url, target); -} - -NS_IMETHODIMP -nsJavaPluginInstanceProxy::ShowStatus(const char* status) -{ - return m_owner->doShowStatus(status); -} - -NS_IMETHODIMP -nsJavaPluginInstanceProxy::GetJSThread(jint* jstid) -{ - return m_owner->doGetJSThread(jstid); -} - -// Here follows thread-safe versions of methods of plugin API -NS_IMETHODIMP -nsAppletHTMLObject::ShowStatus(const char* status) -{ - nsresult rv = NS_OK; - if (m_dead) return NS_ERROR_FAILURE; - if (PR_GetCurrentThread() == m_mainThread) return doShowStatus(status); - nsCOMPtr inst = - new nsJavaPluginInstanceProxy(); - inst->Init(this); - nsCOMPtr instProxy; - NS_WITH_SERVICE(nsIProxyObjectManager, proxyObjectManager, - kProxyObjectManagerCID, &rv); - rv = proxyObjectManager-> - GetProxyForObject(NS_UI_THREAD_EVENTQ, - NS_GET_IID(nsIJavaPluginInstanceProxy), - NS_STATIC_CAST(nsISupports*, inst), - PROXY_ASYNC | PROXY_ALWAYS, - getter_AddRefs(instProxy)); - if (NS_FAILED(rv)) return rv; - //OJI_LOG(">>>>>>>>>>>>>>>>>>>"); - rv = instProxy->ShowStatus(status); - //OJI_LOG2("ShowStatus(%s) done ", status); - return rv; -} - - -NS_IMETHODIMP -nsAppletHTMLObject::ShowDocument(const char* url, - const char* target) -{ - nsresult rv = NS_OK; - if (m_dead) return NS_ERROR_FAILURE; - if (PR_GetCurrentThread() == m_mainThread) - return doShowDocument(url, target); - nsCOMPtr inst = - new nsJavaPluginInstanceProxy(); - inst->Init(this); - nsCOMPtr instProxy; - NS_WITH_SERVICE(nsIProxyObjectManager, proxyObjectManager, - kProxyObjectManagerCID, &rv); - rv = proxyObjectManager-> - GetProxyForObject(NS_UI_THREAD_EVENTQ, - NS_GET_IID(nsIJavaPluginInstanceProxy), - NS_STATIC_CAST(nsISupports*, inst), - PROXY_SYNC | PROXY_ALWAYS, - getter_AddRefs(instProxy)); - if (NS_FAILED(rv)) return rv; - rv = instProxy->ShowDocument(url, target); - return rv; -} - -NS_IMETHODIMP -nsAppletHTMLObject::GetJSThread(jint* jstid) -{ - PRUint32 jsThreadID = 0; - if (m_dead) return NS_ERROR_FAILURE; - if (NS_SUCCEEDED(m_peer2->GetJSThread(&jsThreadID))) - *jstid = (jint)(jsThreadID); - return NS_OK; - /* - nsresult rv = NS_OK; - if (m_dead) return NS_ERROR_FAILURE; - nsCOMPtr inst = - new nsJavaPluginInstanceProxy(); - inst->Init(this); - nsCOMPtr instProxy; - NS_WITH_SERVICE(nsIProxyObjectManager, proxyObjectManager, - kProxyObjectManagerCID, &rv); - rv = proxyObjectManager-> - GetProxyForObject(NS_UI_THREAD_EVENTQ, - NS_GET_IID(nsIJavaPluginInstanceProxy), - NS_STATIC_CAST(nsISupports*, inst), - PROXY_SYNC | PROXY_ALWAYS, - getter_AddRefs(instProxy)); - if (NS_FAILED(rv)) return rv; - rv = instProxy->GetJSThread(jstid); - return rv; */ -} - -// Here follows thread-unsafe versions of methods of plugin API -NS_IMETHODIMP -nsAppletHTMLObject::doShowStatus(const char* status) -{ - if (m_dead) return NS_ERROR_FAILURE; - return m_peer->ShowStatus(status); -} - - -NS_IMETHODIMP -nsAppletHTMLObject::doShowDocument(const char* url, - const char* target) -{ - if (m_dead) return NS_ERROR_FAILURE; - return m_mgr->GetURL((nsIPluginInstance*)this, url, target, - NULL, NULL, NULL, PR_FALSE); -} - -NS_IMETHODIMP -nsAppletHTMLObject::doGetJSThread(jint* jstid) -{ - PRUint32 jsThreadID = 0; - if (m_dead) return NS_ERROR_FAILURE; - if (NS_SUCCEEDED(m_peer2->GetJSThread(&jsThreadID))) - *jstid = (jint)(jsThreadID); - return NS_OK; -} - -NS_IMETHODIMP -nsAppletHTMLObject::GetJavaObject(jobject *result) -{ - if (!result || !m_jobject) return NS_ERROR_FAILURE; - return m_jobject->GetJavaPeer(result); -} - -NS_IMETHODIMP -nsAppletHTMLObject::GetText(const char* *result) -{ - OJI_LOG("nsAppletHTMLObject::GetText"); - return NS_OK; -} diff --git a/mozilla/java/waterfall/wf_moz6/src/nsAppletHTMLObject.h b/mozilla/java/waterfall/wf_moz6/src/nsAppletHTMLObject.h deleted file mode 100644 index fa0ce54d967..00000000000 --- a/mozilla/java/waterfall/wf_moz6/src/nsAppletHTMLObject.h +++ /dev/null @@ -1,102 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsAppletHTMLObject.h,v 1.1.1.1 2001-05-09 18:51:35 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef __nsAppletHTMLObject_h -#define __nsAppletHTMLObject_h -#include "nsCOMPtr.h" -#include "nsIPluginInstance.h" -#include "nsplugindefs.h" -#include "nsJavaHTMLObjectFactory.h" -#include "nsIJavaObjectInfo.h" -#include "nsIPluginTagInfo2.h" -#include "nsIPluginManager.h" -#include "nsIPluginManager2.h" -#include "nsIPluginInstancePeer.h" -#include "nsIPluginInstancePeer2.h" -#include "nsIJVMPluginInstance.h" -//#include "nsIPluginStreamListener.h" -class nsJavaHTMLObject; - -/** - * this class is just wrapper forwarding functionality from - * older plugin based API to newer OJI2 based API - */ -class nsAppletHTMLObject : public nsIPluginInstance, - public nsIWFInstanceWrapper, - public nsIJVMPluginInstance -{ - public: - NS_DECL_ISUPPORTS - NS_DECL_NSIWFINSTANCEWRAPPER - - nsAppletHTMLObject(nsJavaHTMLObjectFactory *factory); - virtual ~nsAppletHTMLObject(void); - - // from nsIPluginInstance - NS_IMETHOD Initialize(nsIPluginInstancePeer *peer); - NS_IMETHOD GetPeer(nsIPluginInstancePeer* *resultingPeer); - NS_IMETHOD Start(void); - NS_IMETHOD Stop(void); - NS_IMETHOD Destroy(void); - NS_IMETHOD SetWindow(nsPluginWindow* window); - NS_IMETHOD NewStream(nsIPluginStreamListener** listener); - NS_IMETHOD Print(nsPluginPrint* platformPrint); - NS_IMETHOD GetValue(nsPluginInstanceVariable variable, void *value); - NS_IMETHOD HandleEvent(nsPluginEvent* event, PRBool* handled); - - // from nsIJVMPluginInstance - NS_IMETHOD GetJavaObject(jobject *result); - NS_IMETHOD GetText(const char* *result); - - // friend proxy class - friend class nsJavaPluginInstanceProxy; - - protected: - nsJavaHTMLObject* m_jobject; - nsJavaHTMLObjectFactory* m_factory; - jint m_id; - nsIPluggableJVM* m_jvm; - JNIEnv* m_env; /* cached JNIEnv of main Mozilla thread */ - - nsJavaObjectType mapType(nsPluginTagType pluginType); - // methods that can be called from main thread to do real job - NS_IMETHOD doShowStatus(const char* status); - NS_IMETHOD doShowDocument(const char* url, - const char* target); - NS_IMETHOD doGetJSThread(jint *jstid); - - // kind of caching - nsIPluginInstancePeer* m_peer; - nsIPluginInstancePeer2* m_peer2; - nsCOMPtr m_mgr; - // workaround for incorrect lifecycle of plugin peer - PRBool m_dead; - PRThread* m_mainThread; -}; - -#endif - - diff --git a/mozilla/java/waterfall/wf_moz6/src/nsCJVMFactory.cpp b/mozilla/java/waterfall/wf_moz6/src/nsCJVMFactory.cpp deleted file mode 100644 index 7f91b03cd83..00000000000 --- a/mozilla/java/waterfall/wf_moz6/src/nsCJVMFactory.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsCJVMFactory.cpp,v 1.1.1.1 2001-05-09 18:51:35 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ -#include "nsJavaHTMLObjectFactory.h" -#include "nsIGenericFactory.h" -#include "nsIModule.h" - -static NS_DEFINE_CID(kCPluggableJVMCID, NS_PLUGGABLEJVM_CID); - -// The list of components we register -static nsModuleComponentInfo components[] = -{ - { "Waterfall API-based JVM Service", - NS_PLUGGABLEJVM_CID, - NS_INLINE_PLUGIN_CONTRACTID_PREFIX NS_JVM_MIME_TYPE, - nsJavaHTMLObjectFactory::Create, - }, -}; - -NS_IMPL_NSGETMODULE("nsCJVMModule", components); - - - diff --git a/mozilla/java/waterfall/wf_moz6/src/nsJavaHTMLObject.cpp b/mozilla/java/waterfall/wf_moz6/src/nsJavaHTMLObject.cpp deleted file mode 100644 index 2592fa3d0ba..00000000000 --- a/mozilla/java/waterfall/wf_moz6/src/nsJavaHTMLObject.cpp +++ /dev/null @@ -1,219 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsJavaHTMLObject.cpp,v 1.1.1.1 2001-05-09 18:51:36 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include "nsJavaHTMLObjectFactory.h" -#include "nsJavaHTMLObject.h" - -NS_IMPL_ISUPPORTS1(nsJavaHTMLObject, nsIJavaHTMLObject) - -nsJavaHTMLObject::nsJavaHTMLObject(nsJavaHTMLObjectFactory* f) -{ - NS_INIT_ISUPPORTS(); - m_factory = f; - NS_ADDREF(f); - m_id = 0; - m_jvm = NULL; - m_info = NULL; -} - -nsJavaHTMLObject::~nsJavaHTMLObject() -{ - OJI_LOG("nsJavaHTMLObject::~nsJavaHTMLObject"); - if (m_factory) NS_RELEASE(m_factory); -} - -/* [noscript] void SetWindow (in jp_jint ID); */ -NS_IMETHODIMP nsJavaHTMLObject::SetWindow(jint ID) -{ - OJI_LOG2("nsJavaHTMLObject::SetWindow(%ld)", ID); - if (m_id == 0) - { - OJI_LOG("SetWindow() for not inited obj!"); - return NS_ERROR_FAILURE; - } - nsresult res; - if (ID == 0) return NS_OK; - // this is part of generic policy to minimize time occupied in main thread - // if this event will be proceed when user leaves page - nothing wrong, window - // will be just unregistered and Java-side SetWindow() will fail - // also it prevents possible deadlocks, when Java calls back to browser and - // browser main thread waits here and can't perform call - if (NS_FAILED(res = PostEvent((jint)PE_SETWINDOW, (jlong)ID))) - return res; - return NS_OK; -} - -/* void Initialize (in nsISupports peer, in nsIPluggableJVM jvm); */ -NS_IMETHODIMP -nsJavaHTMLObject::Initialize(nsISupports *peer, - nsIPluggableJVM *jvm) -{ - nsresult res; - m_instance_peer = peer; - NS_ADDREF(m_instance_peer); - m_jvm = jvm; - NS_ADDREF(m_jvm); - m_id = 0; - if (NS_FAILED(res = m_jvm->CreateJavaPeer(this, - WF_APPLETPEER_CID, - &m_id))) - return res; - if (m_id == 0) return NS_ERROR_FAILURE; - OJI_LOG2("nsJavaHTMLObject::Initialize: got id %d", (int)m_id); - return NS_OK; -} - -/* void Start (); */ -NS_IMETHODIMP -nsJavaHTMLObject::Start() -{ - nsresult res; - if (NS_FAILED(res = PostEvent((jint)PE_START, (jlong)m_id))) - return res; - return NS_OK; -} - -/* void Stop (); */ -NS_IMETHODIMP -nsJavaHTMLObject::Stop() -{ - nsresult res; - if (NS_FAILED(res = PostEvent((jint)PE_STOP, (jlong)m_id))) - return res; - return NS_OK; -} - -/* void Destroy (); */ -NS_IMETHODIMP -nsJavaHTMLObject::Destroy() -{ - nsresult res; - if (!m_jvm) return NS_ERROR_FAILURE; - if (NS_FAILED(res - = SendEvent((jint)PE_DESTROY, (jlong)m_id))) - return res; - if (NS_FAILED(res - = m_jvm->DestroyJavaPeer(m_id))) - return res; - //if (ID) m_jvm->UnregisterWindow(ID); - if (m_instance_peer) NS_RELEASE(m_instance_peer); - if (m_info) NS_RELEASE(m_info); - return NS_OK; -} - -/* void GetPeer (out nsISupports peer); */ -NS_IMETHODIMP -nsJavaHTMLObject::GetPeer(nsISupports **peer) -{ - *peer = m_instance_peer; - NS_ADDREF(m_instance_peer); - return NS_OK; -} - -NS_IMETHODIMP -nsJavaHTMLObject::SetJavaObjectInfo(nsIJavaObjectInfo* info) -{ - if (m_info) NS_RELEASE(m_info); - m_info = info; - NS_ADDREF(m_info); - nsresult res; - JavaObjectWrapper* wrapper; - if (NS_FAILED(res = m_info->GetWrapper(&wrapper))) - return res; - if (NS_FAILED(res = PostEvent((jint)PE_NEWPARAMS, PTR_TO_JLONG(wrapper)))) - return res; - return NS_OK; -} - -NS_IMETHODIMP -nsJavaHTMLObject::GetJavaObjectInfo(nsIJavaObjectInfo* *info) -{ - *info = m_info; - NS_ADDREF(m_info); - return NS_OK; -} - -NS_IMETHODIMP -nsJavaHTMLObject::GetJavaPeer(jobject *pObj) -{ - nsresult res; - OJI_LOG("nsJavaHTMLObject::GetJavaPeer"); - if (!pObj) return NS_ERROR_NULL_POINTER; - *pObj = NULL; - // both ways should be OK, but event seems to work better in generic case - // as synchronized with other applet events -#if 0 - if (NS_FAILED(res = m_jvm->JavaPeerCall(m_id, - PE_GETPEER, - PTR_TO_JLONG(pObj)))) - return res; -#else - if (NS_FAILED(res = SendEvent(PE_GETPEER, - PTR_TO_JLONG(pObj)))) - return res; -#endif - return NS_OK; -} - -NS_IMETHODIMP -nsJavaHTMLObject::SetType(jint type) -{ - nsresult res; - if (NS_FAILED(res = SendEvent(PE_SETTYPE, (jlong)type))) - return res; - return NS_OK; -} - - -NS_IMETHODIMP -nsJavaHTMLObject::GetDOMElement(nsIDOMElement* *result) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP -nsJavaHTMLObject::PostEvent(jint id, jlong data) -{ - nsresult res; - if (!m_jvm || !m_id) return NS_ERROR_FAILURE; - if (NS_FAILED(res = m_jvm->PostEventToJavaPeer(m_id, id, data))) - return res; - return NS_OK; -} - -NS_IMETHODIMP -nsJavaHTMLObject::SendEvent(jint id, jlong data) -{ - nsresult res; - if (!m_jvm || !m_id) return NS_ERROR_FAILURE; - if (NS_FAILED(res = m_jvm->SendEventToJavaPeer(m_id, id, data, nsnull))) - return res; - return NS_OK; -} - - - - diff --git a/mozilla/java/waterfall/wf_moz6/src/nsJavaHTMLObject.h b/mozilla/java/waterfall/wf_moz6/src/nsJavaHTMLObject.h deleted file mode 100644 index c84b781a4f0..00000000000 --- a/mozilla/java/waterfall/wf_moz6/src/nsJavaHTMLObject.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsJavaHTMLObject.h,v 1.1.1.1 2001-05-09 18:51:36 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef __nsJavaHTMLObject_h -#define __nsJavaHTMLObject_h - -#include "nsIJavaHTMLObject.h" -#include "nsIPluggableJVM.h" -#include "nsJavaHTMLObjectFactory.h" -#include "nsIJavaObjectInfo.h" - -class nsJavaHTMLObject : public nsIJavaHTMLObject -{ - public: - NS_DECL_ISUPPORTS - NS_DECL_NSIJAVAHTMLOBJECT - - nsJavaHTMLObject(nsJavaHTMLObjectFactory* f); - virtual ~nsJavaHTMLObject(); - - // generally bad idea, but I don't like to add smth plugin API - // specific into nsJavaHTMLObject - // ideally all this info should be obtained from peer - NS_IMETHOD SetJavaObjectInfo(nsIJavaObjectInfo* info); - NS_IMETHOD GetJavaObjectInfo(nsIJavaObjectInfo* *info); - - protected: - nsJavaHTMLObjectFactory* m_factory; - nsISupports* m_instance_peer; - nsIPluggableJVM* m_jvm; - nsIJavaObjectInfo* m_info; - jint m_id; -}; - -#endif // __nsJavaHTMLObject_h diff --git a/mozilla/java/waterfall/wf_moz6/src/nsJavaHTMLObjectFactory.cpp b/mozilla/java/waterfall/wf_moz6/src/nsJavaHTMLObjectFactory.cpp deleted file mode 100644 index c234494e20a..00000000000 --- a/mozilla/java/waterfall/wf_moz6/src/nsJavaHTMLObjectFactory.cpp +++ /dev/null @@ -1,719 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsJavaHTMLObjectFactory.cpp,v 1.1.1.1 2001-05-09 18:51:36 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include "nsJavaHTMLObjectFactory.h" -#include "nsPluggableJVM.h" -#include "nsIFactory.h" -#include "nsIPluginInstance.h" -#include "nsJavaHTMLObject.h" -#include "nsAppletHTMLObject.h" -#include "nsIProxyObjectManager.h" -#include "nsIBrowserJavaSupport.h" -#include "nsIPluginInstancePeer.h" -#include "nsIPluginInstancePeer2.h" -#include "nsWFSecureEnv.h" -#include "nsWFSecurityContext.h" -#include "nsIThread.h" -#include "nsIJVMConsole.h" - -static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); -static NS_DEFINE_IID(kIPluginIID, NS_IPLUGIN_IID); -static NS_DEFINE_IID(kIPluginInstanceIID, NS_IPLUGININSTANCE_IID); -static NS_DEFINE_IID(kIJavaHTMLObjectIID, NS_IJAVAHTMLOBJECT_IID); -static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); -static NS_DEFINE_IID(kIPluggableJVMIID, NS_IPLUGGABLEJVM_IID); -static NS_DEFINE_IID(kIBrowserJavaSupportIID, NS_IBROWSERJAVASUPPORT_IID); -static NS_DEFINE_IID(kIPluginManagerIID, NS_IPLUGINMANAGER_IID); -static NS_DEFINE_IID(kIPluginManager2IID, NS_IPLUGINMANAGER2_IID); -static NS_DEFINE_IID(kILiveConnectIID, NS_ILIVECONNECT_IID); -static NS_DEFINE_IID(kIPluginInstancePeerIID, NS_IPLUGININSTANCEPEER_IID); -static NS_DEFINE_IID(kIPluginInstancePeer2IID, NS_IPLUGININSTANCEPEER2_IID); -static NS_DEFINE_IID(kIJVMPluginIID, NS_IJVMPLUGIN_IID); -static NS_DEFINE_IID(kIServiceManagerIID, NS_ISERVICEMANAGER_IID); -static NS_DEFINE_IID(kIJVMManagerIID, NS_IJVMMANAGER_IID); -static NS_DEFINE_IID(kIJVMConsoleIID, NS_IJVMCONSOLE_IID); - - -static NS_DEFINE_CID(kCLiveConnectCID, NS_CLIVECONNECT_CID); -static NS_DEFINE_CID(kPluginManagerCID, NS_PLUGINMANAGER_CID); -static NS_DEFINE_CID(kProxyObjectManagerCID, NS_PROXYEVENT_MANAGER_CID); -static NS_DEFINE_CID(kCJVMManagerCID, NS_JVMMANAGER_CID); - - -nsJavaHTMLObjectFactory* nsJavaHTMLObjectFactory::instance = nsnull; - -NS_IMPL_THREADSAFE_ISUPPORTS5(nsJavaHTMLObjectFactory, \ - nsIFactory, \ - nsIPlugin, \ - nsIJVMPlugin, \ - nsIJVMConsole, \ - nsIBrowserJavaSupport) - -static int GetProxyForURL(void* handle, - char* url, - char* *proxy) -{ - nsresult res; - nsIBrowserJavaSupport* obj = (nsIBrowserJavaSupport*)handle; - res = obj->GetProxyForURL(url, proxy); - return res; -} - -static int JSCall(void* handle, jint jstid, struct JSObject_CallInfo** call) -{ - nsresult res; - nsIBrowserJavaSupport* obj = (nsIBrowserJavaSupport*)handle; - res = obj->JSCall(jstid, call); - return res; -} - -nsJavaHTMLObjectFactory::nsJavaHTMLObjectFactory() { - NS_INIT_ISUPPORTS(); - m_mgr2 = nsnull; - m_jvm = new nsPluggableJVM(); - NS_ADDREF(m_jvm); - nsCOMPtr mainIThread; - nsIThread::GetMainThread(getter_AddRefs(mainIThread)); - mainIThread->GetPRThread(&m_mainThread); - instance = this; - m_jsjRecursion = 0; -} - -nsJavaHTMLObjectFactory::~nsJavaHTMLObjectFactory() { - OJI_LOG("nsJavaHTMLObjectFactory::~nsJavaHTMLObjectFactory"); - NS_RELEASE(m_jvm); - free(m_wrapper); -} - - -NS_METHOD -nsJavaHTMLObjectFactory::Create(nsISupports* outer, - const nsIID& aIID, - void* *aInstancePtr) -{ - //OJI_LOG2("nsJavaHTMLObjectFactory::Create with %p", outer); - //OJI_LOG2("it is %s", aIID.ToString()); - if (!aInstancePtr) - return NS_ERROR_INVALID_POINTER; - *aInstancePtr = nsnull; - nsresult rv = NS_OK; - - if (!instance) - { - instance = new nsJavaHTMLObjectFactory(); - rv = instance->Initialize(); - if (NS_FAILED(rv)) return rv; - } - - if (aIID.Equals(kIPluginIID) || aIID.Equals(kIFactoryIID)) - { - return instance->QueryInterface(aIID, aInstancePtr); - } - - if (aIID.Equals(kIPluginInstanceIID) || aIID.Equals(kIJavaHTMLObjectIID)) - { - return instance->CreateInstance(outer, - aIID, - aInstancePtr); - } - OJI_LOG2("nsJavaHTMLObjectFactory::Create: no matching ifaces for %s", - aIID.ToString()); - return NS_ERROR_FAILURE; -} - -NS_IMETHODIMP -nsJavaHTMLObjectFactory::CreateInstance(nsISupports *aOuter, - const nsIID & aIID, - void **result) -{ - *result = NULL; - if (aOuter != NULL) - { - OJI_LOG("Aggregation of nsJavaHTMLObjectFactory failed"); - return NS_ERROR_NO_AGGREGATION; - } - if (!m_jvm) return NS_ERROR_FAILURE; - // XXX: remove me when it'll be called by Mozilla - //if (NS_FAILED(Initialize())) return NS_ERROR_FAILURE; - if (aIID.Equals(kIJavaHTMLObjectIID)) - { - OJI_LOG("NEW API - creating IJavaHTMLObject"); - nsJavaHTMLObject* instance = new nsJavaHTMLObject(this); - *result = (nsIJavaHTMLObject*) instance; - NS_ADDREF(instance); - return NS_OK; - } - // it's current Mozilla API where it ask us to create PluginInstance - // give it a wrapper - if (aIID.Equals(kIPluginInstanceIID)) - { - OJI_LOG("OLD API - creating IPluginInstance"); - nsAppletHTMLObject* instance = new nsAppletHTMLObject(this); - *result = (nsIPluginInstance *) instance; - NS_ADDREF(instance); - return NS_OK; - } - if (aIID.Equals(kIPluginIID)) - { - OJI_LOG("request for factory"); - return QueryInterface(kIPluginIID, result); - } - return NS_ERROR_NO_INTERFACE; -} - -NS_IMETHODIMP -nsJavaHTMLObjectFactory::Initialize(void) -{ - //OJI_LOG2("nsJavaHTMLObjectFactory::Initialize: %p", this); - static int inited = 0; - if (inited) return NS_OK; - nsresult res; - nsPluggableJVMStatus status; - res = nsServiceManager::GetService(kPluginManagerCID, - kIPluginManagerIID, - getter_AddRefs(m_mgr)); - if (NS_FAILED(res)) return res; - res = nsServiceManager::GetService(kCJVMManagerCID, - kIJVMManagerIID, - getter_AddRefs(m_jvmMgr)); - if (NS_FAILED(res)) return res; - m_mgr2 = do_QueryInterface(m_mgr); - if (m_mgr2 == nsnull) return NS_ERROR_FAILURE; - - m_wrapper = (BrowserSupportWrapper*) malloc(sizeof(BrowserSupportWrapper)); - m_wrapper->info = (void*)(nsIBrowserJavaSupport*)this; - m_wrapper->GetProxyForURL = &::GetProxyForURL; - m_wrapper->JSCall = &::JSCall; - - res = m_jvm->StartupJVM("", &status, PTR_TO_JLONG(m_wrapper)); - if (NS_FAILED(res) || status != nsPluggableJVMStatus_Running) - return NS_ERROR_FAILURE; - m_jvm->GetJNIEnv(&m_env); - inited = 1; - OJI_LOG("nsJavaHTMLObjectFactory::Initialize done"); - return NS_OK; -} - - -NS_IMETHODIMP -nsJavaHTMLObjectFactory::CreatePluginInstance(nsISupports *aOuter, - REFNSIID aIID, - const char * aMimeType, - void **result) -{ - return CreateInstance(aOuter, aIID, result); -} - -NS_IMETHODIMP -nsJavaHTMLObjectFactory::GetMIMEDescription(const char **resDesc) -{ - *resDesc = - "application/x-java-vm::Java(tm) Plug-in" - ";application/x-java-applet::Java(tm) Plug-in" - ";application/x-java-applet:version=1.1::Java(tm) Plug-in" - ";application/x-java-applet:version=1.1.1::Java(tm) Plug-in" - ";application/x-java-applet:version=1.1.2::Java(tm) Plug-in" - ";application/x-java-applet:version=1.1.3::Java(tm) Plug-in" - ";application/x-java-applet:version=1.2::Java(tm) Plug-in" - ";application/x-java-applet:version=1.2.1::Java(tm) Plug-in" - ";application/x-java-applet:version=1.2.2::Java(tm) Plug-in" - ";application/x-java-applet:version=1.3::Java(tm) Plug-in" - ";application/x-java-bean::Java(tm) Plug-in" - ";application/x-java-bean:version=1.1::Java(tm) Plug-in" - ";application/x-java-bean:version=1.1.1::Java(tm) Plug-in" - ";application/x-java-bean:version=1.1.2::Java(tm) Plug-in" - ";application/x-java-bean:version=1.1.3::Java(tm) Plug-in" - ";application/x-java-bean:version=1.2::Java(tm) Plug-in" - ";application/x-java-bean:version=1.2.1::Java(tm) Plug-in" - ";application/x-java-bean:version=1.2.2::Java(tm) Plug-in" - ";application/x-java-bean:version=1.3::Java(tm) Plug-in" - ""; - return NS_OK; -} - -NS_IMETHODIMP nsJavaHTMLObjectFactory::LockFactory(PRBool aLock) -{ - return NS_OK; -} - -NS_IMETHODIMP -nsJavaHTMLObjectFactory::Shutdown(void) -{ - OJI_LOG("nsJavaHTMLObjectFactory::Shutdown"); - return NS_OK; -} - - - -NS_IMETHODIMP -nsJavaHTMLObjectFactory::GetValue(nsPluginVariable variable, - void *value) -{ - nsresult err = NS_OK; - return err; -} - -NS_IMETHODIMP -nsJavaHTMLObjectFactory::GetJVM(nsIPluggableJVM* *jvm) -{ - if ((jvm != NULL) && (m_jvm != NULL)) - { - *jvm = m_jvm; - return NS_OK; - } - return NS_ERROR_NULL_POINTER; -} - -NS_IMETHODIMP -nsJavaHTMLObjectFactory::Show() -{ - if (m_jvm) return m_jvm->SetConsoleVisibility(PR_TRUE); - return NS_ERROR_FAILURE; -} - -NS_IMETHODIMP -nsJavaHTMLObjectFactory::Hide() -{ - if (m_jvm) return m_jvm->SetConsoleVisibility(PR_FALSE); - return NS_ERROR_FAILURE; -} - -NS_IMETHODIMP -nsJavaHTMLObjectFactory::IsVisible(PRBool *result) -{ - if (m_jvm) return m_jvm->GetConsoleVisibility(result); - return NS_ERROR_FAILURE; -} - -NS_IMETHODIMP -nsJavaHTMLObjectFactory::Print(const char* msg, - const char* encodingName) -{ - if (m_jvm) return m_jvm->PrintToConsole(msg, encodingName); - return NS_ERROR_FAILURE; -} - -/* HERE INTERTHREAD PROXY STUFF FOLLOWS */ -// utility proxy class -class nsJavaPluginProxy : public nsIJavaPluginProxy -{ -public: - NS_DECL_ISUPPORTS - NS_DECL_NSIJAVAPLUGINPROXY - - nsJavaPluginProxy(); - virtual ~nsJavaPluginProxy(); - NS_IMETHOD Init(nsJavaHTMLObjectFactory* owner); -protected: - nsJavaHTMLObjectFactory* m_owner; -}; - -NS_IMPL_THREADSAFE_ISUPPORTS1(nsJavaPluginProxy, - nsIJavaPluginProxy); - -nsJavaPluginProxy::nsJavaPluginProxy() -{ - NS_INIT_ISUPPORTS(); -} - -NS_IMETHODIMP -nsJavaPluginProxy::Init(nsJavaHTMLObjectFactory* owner) -{ - m_owner = owner; - NS_ADDREF(owner); - return NS_OK; -} - -nsJavaPluginProxy::~nsJavaPluginProxy() -{ - NS_RELEASE(m_owner); -} - -NS_IMETHODIMP -nsJavaPluginProxy::GetProxyForURL(const char* url, - char* *result) -{ - return m_owner->doGetProxyForURL(url, result); -} - -NS_IMETHODIMP -nsJavaPluginProxy::JSCall(jint jstid, struct JSObject_CallInfo** call) -{ - return m_owner->doJSCall(jstid, call); -} - -/* END OF INTERTHREAD STUFF */ - - -NS_IMETHODIMP -nsJavaHTMLObjectFactory::GetProxyForURL(const char *url, char **proxy) -{ - nsresult rv = NS_OK; - if (PR_GetCurrentThread() == m_mainThread) - return doGetProxyForURL(url, proxy); - nsCOMPtr inst = - new nsJavaPluginProxy(); - inst->Init(this); - nsCOMPtr instProxy; - NS_WITH_SERVICE(nsIProxyObjectManager, proxyObjectManager, - kProxyObjectManagerCID, &rv); - rv = proxyObjectManager-> - GetProxyForObject(NS_UI_THREAD_EVENTQ, - NS_GET_IID(nsIJavaPluginProxy), - NS_STATIC_CAST(nsISupports*, inst), - PROXY_SYNC | PROXY_ALWAYS, - getter_AddRefs(instProxy)); - if (NS_FAILED(rv)) return rv; - rv = instProxy->GetProxyForURL(url, proxy); - return rv; -} - -NS_IMETHODIMP -nsJavaHTMLObjectFactory::JSCall(jint jstid, struct JSObject_CallInfo** call) -{ - nsresult rv = NS_OK; - // TODO: I dunno why, but if not proxify it, some calls like GetWindow - // just fails, maybe due timing issues. I have to investigate it in the - // future. - // if this thread is already main thread - don't forward anything - //if (PR_GetCurrentThread() == m_mainThread) return doJSCall(jstid, call); - - nsCOMPtr inst = new nsJavaPluginProxy(); - inst->Init(this); - nsCOMPtr instProxy; - NS_WITH_SERVICE(nsIProxyObjectManager, proxyObjectManager, - kProxyObjectManagerCID, &rv); - rv = proxyObjectManager-> - GetProxyForObject(NS_UI_THREAD_EVENTQ, - NS_GET_IID(nsIJavaPluginProxy), - NS_STATIC_CAST(nsISupports*, inst), - PROXY_SYNC | PROXY_ALWAYS, - getter_AddRefs(instProxy)); - if (NS_FAILED(rv)) return rv; - rv = instProxy->JSCall(jstid, call); - return rv; -} - - -NS_IMETHODIMP -nsJavaHTMLObjectFactory::doGetProxyForURL(const char* url, - char* *proxy) -{ - if (!m_mgr2) - { - *proxy = nsCRT::strdup(""); // falls back to direct connection - return NS_OK; - } - return m_mgr2->FindProxyForURL(url, proxy); -} - -NS_IMETHODIMP -nsJavaHTMLObjectFactory::doJSCall(jint jstid, struct JSObject_CallInfo** call) -{ - // placed here to avoid lifetime pain in switch - nsCOMPtr plugin = nsnull; - nsCOMPtr pContext = nsnull; - nsresult rv = NS_OK; - - - if ((*call)->pWrapper && (*call)->pWrapper->dead) - { - OJI_LOG("JSObject dead before JS call can be performed."); - return NS_ERROR_FAILURE; - } - NS_WITH_SERVICE(nsIJVMManager, pJVMManager, kCJVMManagerCID, &rv); - if (NS_FAILED(rv)) - { - OJI_LOG2("cannot get JVMManager service: %x", rv); - return rv; - } - - if (m_liveConnect == nsnull && NS_FAILED(rv = initLiveConnect())) - { - OJI_LOG2("Cannot init Live Connect: %x", rv); - return rv; - } - - JNIEnv* pProxyJNIEnv = nsnull; - if (NS_FAILED(rv = pJVMManager->CreateProxyJNI(NULL, &pProxyJNIEnv))) - { - OJI_LOG2("Cannot create proxy JNI: %x", rv); - return rv; - } - - if (NS_FAILED(rv=nsWFSecurityContext::Create(NULL, m_jvm, - (*call)->jAccessControlContext, - (*call)->pszUrl, - kISupportsIID, - getter_AddRefs(pContext)))) - { - OJI_LOG2("Cannot create proper security context: %x", rv); - return rv; - } - m_jsjRecursion++; - if (m_jsjRecursion > 1) OJI_LOG2("incremented depth=%d!!!", - (int)m_jsjRecursion); - - switch ((*call)->type) - { - case JS_GetWindow: - OJI_LOG2("JS_GetWindow: %p", (*call)->data.__getWindow.pPlugin); - plugin = do_QueryInterface((nsISupports*)((*call)->data.__getWindow.pPlugin)); - if (plugin == nsnull) - { - OJI_LOG("Bug in internals - pPlugin field is incorrect"); - break; - } - if (NS_FAILED(m_liveConnect->GetWindow(pProxyJNIEnv, - plugin, - NULL, - 0, - (nsISupports*)pContext, - (jsobject*) &((*call)->data.__getWindow.iNativeJSObject)))) - OJI_LOG("Liveconnect::GetWindow failed"); - break; - case JS_Eval: - { - jobject ret = NULL; - OJI_LOG2("JS_Eval: script len=%d", (*call)->data.__eval.iEvalLen); - if (NS_FAILED(m_liveConnect->Eval(pProxyJNIEnv, - (jsobject)(*call)->data.__eval.iNativeJSObject, - (*call)->data.__eval.pszEval, - (*call)->data.__eval.iEvalLen, - NULL, - 0, - (nsISupports*)pContext, - &ret))) - { - OJI_LOG("Liveconnect::Eval failed"); - } - else - { - if (ret != NULL) - (*call)->data.__eval.jResult = m_env->NewGlobalRef(ret); - } - break; - } - case JS_ToString: - { - jstring ret = NULL; - m_liveConnect->ToString(pProxyJNIEnv, - (jsobject)(*call)->data.__toString.iNativeJSObject, - &ret); - if (ret != NULL) - (*call)->data.__toString.jResult = (jstring)(m_env->NewGlobalRef(ret)); - break; - } - - case JS_Finalize: - OJI_LOG2("JS_Finalize: %x", - (int)(*call)->data.__finalize.iNativeJSObject); - m_liveConnect->FinalizeJSObject(pProxyJNIEnv, - (jsobject)(*call)->data.__finalize.iNativeJSObject); - break; - - case JS_Call: - { - jobject ret = NULL; - OJI_LOG2("JS_Call: obj=%x", - (int)(*call)->data.__call.iNativeJSObject); - if (NS_FAILED(m_liveConnect->Call(pProxyJNIEnv, - (jsobject) - (*call)->data.__call.iNativeJSObject, - (*call)->data.__call.pszMethodName, - (*call)->data.__call.iMethodNameLen, - (*call)->data.__call.jArgs, - /* (void**)&pPrincipal, */ NULL, - /* principalLen, */ 0, - (nsISupports*)pContext, - &ret))) - { - OJI_LOG("Call failed"); - break; - } - if (ret != NULL) - (*call)->data.__call.jResult = m_env->NewGlobalRef(ret); - } - break; - - case JS_GetMember: - { - jobject ret = NULL; - m_liveConnect->GetMember(pProxyJNIEnv, - (jsobject)(*call)->data.__getMember.iNativeJSObject, - (*call)->data.__getMember.pszName, - (*call)->data.__getMember.iNameLen, - /* (void**)&pPrincipal, */ NULL, - /* principalLen, */ 0, - (nsISupports*)pContext, - &ret); - if (ret != NULL) - (*call)->data.__getMember.jResult = m_env->NewGlobalRef(ret); - break; - } - case JS_SetMember: - m_liveConnect->SetMember(pProxyJNIEnv, - (jsobject)(*call)->data.__setMember.iNativeJSObject, - (*call)->data.__setMember.pszName, - (*call)->data.__setMember.iNameLen, - (*call)->data.__setMember.jValue, - /* (void**)&pPrincipal, */ NULL, - /* principalLen, */ 0, - (nsISupports*)pContext); - break; - - - case JS_RemoveMember: - m_liveConnect->RemoveMember(pProxyJNIEnv, - (jsobject)(*call)->data.__removeMember.iNativeJSObject, - (*call)->data.__removeMember.pszName, - (*call)->data.__removeMember.iNameLen, - /* (void**)&pPrincipal, */ NULL, - /* principalLen, */ 0, - (nsISupports*)pContext); - break; - - case JS_GetSlot: - { - jobject ret = NULL; - m_liveConnect->GetSlot(pProxyJNIEnv, - (jsobject)(*call)->data.__getSlot.iNativeJSObject, - (*call)->data.__getSlot.iIndex, - /* (void**)&pPrincipal, */ NULL, - /* principalLen, */ 0, - (nsISupports*)pContext, - &ret); - - if (ret != NULL) - (*call)->data.__getSlot.jResult = m_env->NewGlobalRef(ret); - break; - } - case JS_SetSlot: - m_liveConnect->SetSlot(pProxyJNIEnv, - (jsobject)(*call)->data.__setSlot.iNativeJSObject, - (*call)->data.__setSlot.iIndex, - (*call)->data.__setSlot.jValue, - /* (void**)&pPrincipal, */ NULL, - /* principalLen, */ 0, - (nsISupports*)pContext); - break; - - default: - OJI_LOG2("UNKNOWN CALL: %d", (*call)->type); - } - jthrowable jException = m_env->ExceptionOccurred(); - - if (jException != NULL) - { - OJI_LOG("exception in doJSCall"); - m_env->ExceptionDescribe(); - // Clean up exception - m_env->ExceptionClear(); - - // Store the exception in JSObject_CallInfo - (*call)->jException = - NS_STATIC_CAST(jthrowable, m_env->NewGlobalRef(jException)); - // Release local ref - m_env->DeleteLocalRef(jException); - } - m_jsjRecursion--; - return NS_OK; -} - - - -NS_IMETHODIMP -nsJavaHTMLObjectFactory::AddToClassPath(const char* dirPath) -{ - OJI_LOG("nsJavaHTMLObjectFactory::AddToClassPath"); - return NS_OK; -} -NS_IMETHODIMP -nsJavaHTMLObjectFactory::RemoveFromClassPath(const char* dirPath) -{ - OJI_LOG("nsJavaHTMLObjectFactory::RemoveFromClassPath"); - return NS_OK; -} -NS_IMETHODIMP -nsJavaHTMLObjectFactory::GetClassPath(const char* *result) -{ - OJI_LOG("nsJavaHTMLObjectFactory::GetClassPath"); - return NS_OK; -} -NS_IMETHODIMP -nsJavaHTMLObjectFactory::GetJavaWrapper(JNIEnv* jenv, - jint jsobj, - jobject *jobj) -{ - OJI_LOG2("GetJavaWrapper for %x", (int)jsobj); - if (!m_jvm || !jobj) return NS_ERROR_FAILURE; - *jobj = NULL; - return m_jvm->GetJavaWrapper(jsobj, jobj); -} - -NS_IMETHODIMP -nsJavaHTMLObjectFactory::CreateSecureEnv(JNIEnv* proxyEnv, - nsISecureEnv* *outSecureEnv) -{ - return nsWFSecureEnv::Create(m_jvm, - kISupportsIID, (void**)outSecureEnv); -} -NS_IMETHODIMP -nsJavaHTMLObjectFactory::SpendTime(PRUint32 timeMillis) -{ - OJI_LOG("nsJavaHTMLObjectFactory::SpendTime"); - return NS_OK; -} -NS_IMETHODIMP -nsJavaHTMLObjectFactory::UnwrapJavaWrapper(JNIEnv* jenv, - jobject jobj, - jint* jsobj) -{ - OJI_LOG2("nsJavaHTMLObjectFactory::UnwrapJavaWrapper for %x", (int)jobj); - if (!m_jvm || !jsobj) return NS_ERROR_FAILURE; - *jsobj = 0; - return m_jvm->UnwrapJavaWrapper(jobj, jsobj); -} - - -NS_IMETHODIMP -nsJavaHTMLObjectFactory::initLiveConnect() -{ - nsresult res; - res = nsServiceManager::GetService(kCLiveConnectCID, - kILiveConnectIID, - getter_AddRefs(m_liveConnect)); - if (NS_FAILED(res)) - { - OJI_LOG2("cannot get LiveConnect service from browser: %x", res); - return NS_ERROR_FAILURE; - } - return NS_OK; -} - - - - diff --git a/mozilla/java/waterfall/wf_moz6/src/nsJavaHTMLObjectFactory.h b/mozilla/java/waterfall/wf_moz6/src/nsJavaHTMLObjectFactory.h deleted file mode 100644 index 1e50478eb31..00000000000 --- a/mozilla/java/waterfall/wf_moz6/src/nsJavaHTMLObjectFactory.h +++ /dev/null @@ -1,124 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsJavaHTMLObjectFactory.h,v 1.1.1.1 2001-05-09 18:51:36 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef __nsJavaHTMLObjectFactory_h -#define __nsJavaHTMLObjectFactory_h - -#include "nsCOMPtr.h" -#include "nsPluggableJVM.h" -#include "nsIBrowserJavaSupport.h" -#include "nsIPlugin.h" -#include "nsIPluginManager.h" -#include "nsIPluginManager2.h" -#include "nsILiveconnect.h" -#include "nsILiveConnectManager.h" -#include "nsIJavaObjectInfo.h" -#include "nsIJVMPlugin.h" -#include "nsIJVMManager.h" -#include "nsIJVMConsole.h" -#include "nsIServiceManager.h" -#include "wf_moz6_common.h" - -/* this class is derived from nsIPlugin as I don't like idea - * to touch Mozilla internals in applet handling rigth now - */ -class nsJavaHTMLObjectFactory : public nsIPlugin, - public nsIJVMPlugin, - public nsIBrowserJavaSupport, - public nsIJVMConsole -{ - public: - NS_DECL_ISUPPORTS - NS_DECL_NSIBROWSERJAVASUPPORT - - virtual ~nsJavaHTMLObjectFactory(void); - - // nsIFactory - NS_IMETHOD CreateInstance(nsISupports *aOuter, const nsIID & iid, - void **result); - NS_IMETHOD LockFactory(PRBool aLock); - - // nsIPlugin - NS_IMETHOD CreatePluginInstance(nsISupports *aOuter, REFNSIID aIID, - const char* aPluginMIMEType, - void **aResult); - NS_IMETHOD Initialize(void); - NS_IMETHOD Shutdown(void); - NS_IMETHOD GetMIMEDescription(const char* *resultingDesc); - NS_IMETHOD GetValue(nsPluginVariable variable, void *value); - - // nsIJVMPlugin - NS_IMETHOD AddToClassPath(const char* dirPath); - NS_IMETHOD RemoveFromClassPath(const char* dirPath); - NS_IMETHOD GetClassPath(const char* *result); - NS_IMETHOD GetJavaWrapper(JNIEnv* jenv, jint obj, jobject *jobj); - NS_IMETHOD CreateSecureEnv(JNIEnv* proxyEnv, nsISecureEnv* *outSecureEnv); - NS_IMETHOD SpendTime(PRUint32 timeMillis); - NS_IMETHOD UnwrapJavaWrapper(JNIEnv* jenv, jobject jobj, jint* obj); - - // nsIJVMConsole - NS_IMETHOD Show(); - NS_IMETHOD Hide(); - NS_IMETHOD IsVisible(PRBool *result); - NS_IMETHOD Print(const char* msg, const char* encodingName = NULL); - - - // the only way to create instance using this factory - static NS_METHOD Create(nsISupports* outer, - const nsIID& aIID, - void* *aInstancePtr); - // Get JVM used by this factory now - // doesn't NS_ADDREF result - NS_IMETHOD GetJVM(nsIPluggableJVM* *jvm); - // friend proxy class - friend class nsJavaPluginProxy; - static nsJavaHTMLObjectFactory* instance; - - protected: - nsJavaHTMLObjectFactory(); - nsPluggableJVM* m_jvm; - nsCOMPtr m_mgr; - nsCOMPtr m_mgr2; - nsCOMPtr m_liveConnect; - nsCOMPtr m_jvmMgr; - BrowserSupportWrapper* m_wrapper; - JNIEnv* m_env; - NS_IMETHOD doGetProxyForURL(const char* url, - char* *target); - NS_IMETHOD doJSCall(jint jstid, struct JSObject_CallInfo** call); - NS_IMETHOD initLiveConnect(); - PRThread* m_mainThread; - jint m_jsjRecursion; -}; -#endif //__nsJavaHTMLObjectFactory_h - - - - - - - - diff --git a/mozilla/java/waterfall/wf_moz6/src/nsJavaObjectInfo.cpp b/mozilla/java/waterfall/wf_moz6/src/nsJavaObjectInfo.cpp deleted file mode 100644 index 46fcc7aa5d3..00000000000 --- a/mozilla/java/waterfall/wf_moz6/src/nsJavaObjectInfo.cpp +++ /dev/null @@ -1,283 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsJavaObjectInfo.cpp,v 1.1.1.1 2001-05-09 18:51:36 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include "nsJavaObjectInfo.h" -#include "nsCOMPtr.h" -#include "nsIWFInstanceWrapper.h" -#include "nsIPluginInstance.h" -#include "wf_moz6_common.h" - -static NS_DEFINE_IID(kIPluginInstanceIID, NS_IPLUGININSTANCE_IID); -static NS_DEFINE_IID(kIWFInstanceWrapperIID, NS_IWFINSTANCEWRAPPER_IID); - -static int GetParameters(void* handle, char*** keys, - char*** vals, int* count) -{ - nsIJavaObjectInfo* obj = (nsIJavaObjectInfo*)handle; - return obj->GetParameters(keys, vals, (PRUint32*)count); -} - -static int ShowDocument(void* handle, char* url, char* target) -{ - nsresult res; - nsIJavaObjectInfo* obj = (nsIJavaObjectInfo*)handle; - nsCOMPtr wrapper; - if (NS_FAILED(res = obj->GetPluginWrapper(getter_AddRefs(wrapper)))) - return res; - return (wrapper->ShowDocument(url, target)); -} - -static int ShowStatus(void* handle, char* status) -{ - nsresult res; - nsIJavaObjectInfo* obj = (nsIJavaObjectInfo*)handle; - nsCOMPtr wrapper; - if (NS_FAILED(res = obj->GetPluginWrapper(getter_AddRefs(wrapper)))) - return res; - return (wrapper->ShowStatus(status)); -} - -static int GetJSThread(void* handle, jint* jstid) -{ - nsresult res; - nsIJavaObjectInfo* obj = (nsIJavaObjectInfo*)handle; - nsCOMPtr wrapper; - if (NS_FAILED(res = obj->GetPluginWrapper(getter_AddRefs(wrapper)))) - return res; - return (wrapper->GetJSThread(jstid)); -} - -static int WrapperAddRef(JavaObjectWrapper* me) -{ - return 1; -} - -static int WrapperRelease(JavaObjectWrapper* me) -{ - //if (--me->counter > 0) return me->counter; - nsIPluginInstance* plugin = (nsIPluginInstance*)(me->plugin); - if (plugin) NS_RELEASE(plugin); - free(me); - return 0; -} - - - -NS_IMPL_ISUPPORTS1(nsJavaObjectInfo, nsIJavaObjectInfo) - -nsJavaObjectInfo::nsJavaObjectInfo(nsISupports* instance) -{ - NS_INIT_ISUPPORTS(); - m_argc = 0; - m_size = 5; - m_step = 3; - m_keys = (char**) malloc(m_size*sizeof(char*)); - m_vals = (char**) malloc(m_size*sizeof(char*)); - m_docbase = NULL; - m_instance = instance; - // backward compatibility with plugin API - fix when new API will appear - if (NS_FAILED(m_instance->QueryInterface(kIWFInstanceWrapperIID, - (void**)&m_jpiwrapper))) - OJI_LOG("FAILED to get nsIWFInstanceWrapper"); - nsIPluginInstance* plugin = nsnull; - if (NS_FAILED(m_instance->QueryInterface(kIPluginInstanceIID, - (void**)&plugin))) - OJI_LOG("FAILED to get nsIPluginInstance"); - /* member initializers and constructor code */ - m_wrapper = (JavaObjectWrapper*) malloc(sizeof(JavaObjectWrapper)); - m_wrapper->info = (void*)this; - m_wrapper->plugin = (void*)plugin; - m_wrapper->GetParameters = &::GetParameters; - m_wrapper->ShowDocument = &::ShowDocument; - m_wrapper->ShowStatus = &::ShowStatus; - m_wrapper->GetJSThread = &::GetJSThread; - m_wrapper->dead = 0; -} - -nsJavaObjectInfo::~nsJavaObjectInfo() -{ - OJI_LOG("nsJavaObjectInfo::~nsJavaObjectInfo"); - for (PRUint32 i=0; i < m_argc; i++) - { - if (m_keys[i]) free(m_keys[i]); - if (m_vals[i]) free(m_vals[i]); - } - free(m_keys); - free(m_vals); - if (m_jpiwrapper) NS_RELEASE(m_jpiwrapper); - WrapperRelease(m_wrapper); - // if m_wrapper is hold by someone else, like Java native method - // set field in wrapper that it cannot be used anymore and should be released - //m_wrapper->dead = 1; - //m_wrapper->Release(m_wrapper); -} - -/* void addParameter (in string key, in string value); */ -NS_IMETHODIMP -nsJavaObjectInfo::AddParameter(const char *key, const char *value) -{ - OJI_LOG3("adding {%s} => {%s}", key, value); - if (m_argc >= m_size) - { - //OJI_LOG3("Enlarge vector from %d to %d", m_size, m_size+m_step); - m_size += m_step; - m_keys = (char**) realloc(m_keys, m_size*sizeof(char*)); - m_vals = (char**) realloc(m_vals, m_size*sizeof(char*)); - } - m_keys[m_argc] = strdup(key); - m_vals[m_argc] = strdup(value); - m_argc++; - return NS_OK; -} - -/* void getParameters ([array, size_is (count)] out string keys, [array, size_is - (count)] out string values, [retval] out PRUint32 count); */ -NS_IMETHODIMP -nsJavaObjectInfo::GetParameters(char ***keys, char ***values, - PRUint32 *count) -{ - *keys = m_keys; - *values = m_vals; - *count = m_argc; - return NS_OK; -} - -/* attribute string docBase; */ -NS_IMETHODIMP -nsJavaObjectInfo::GetDocBase(char * *aDocBase) -{ - *aDocBase = m_docbase; - return NS_OK; -} - -NS_IMETHODIMP -nsJavaObjectInfo::SetDocBase(const char * aDocBase) -{ - free(m_docbase); - m_docbase = strdup(aDocBase); - AddParameter("docbase", aDocBase); - return NS_OK; -} - -/* attribute string encoding; */ -NS_IMETHODIMP -nsJavaObjectInfo::GetEncoding(char * *aEncoding) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} -NS_IMETHODIMP -nsJavaObjectInfo::SetEncoding(const char * aEncoding) -{ - AddParameter("encoding", aEncoding); - return NS_ERROR_NOT_IMPLEMENTED; -} - -/* attribute string alignment; */ -NS_IMETHODIMP -nsJavaObjectInfo::GetAlignment(char * *aAlignment) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} -NS_IMETHODIMP -nsJavaObjectInfo::SetAlignment(const char * aAlignment) -{ - AddParameter("align", aAlignment); - return NS_ERROR_NOT_IMPLEMENTED; -} - -// ask peer -/* attribute PRUint32 width; */ -NS_IMETHODIMP -nsJavaObjectInfo::GetWidth(PRUint32 *aWidth) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} -NS_IMETHODIMP -nsJavaObjectInfo::SetWidth(PRUint32 aWidth) -{ - //char buf[10]; - //snprintf(buf, 9, "%d", aWidth); - //AddParameter("width", buf); - return NS_ERROR_NOT_IMPLEMENTED; -} - -/* attribute PRUint32 height; */ -NS_IMETHODIMP -nsJavaObjectInfo::GetHeight(PRUint32 *aHeight) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} -NS_IMETHODIMP -nsJavaObjectInfo::SetHeight(PRUint32 aHeight) -{ - //char buf[10]; - //snprintf(buf, 9, "%d", aHeight); - //AddParameter("height", buf); - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP -nsJavaObjectInfo::SetType(nsJavaObjectType type) -{ - m_type = type; - return NS_OK; -} - - -NS_IMETHODIMP -nsJavaObjectInfo::GetType(nsJavaObjectType* type) -{ - *type = m_type; - return NS_OK; -} - -NS_IMETHODIMP -nsJavaObjectInfo::GetOwner(nsIJavaHTMLObject **owner) -{ - *owner = m_owner; - NS_ADDREF(m_owner); - return NS_OK; -} - - -NS_IMETHODIMP -nsJavaObjectInfo::GetWrapper(JavaObjectWrapper* *res) -{ - *res = m_wrapper; - return NS_OK; -} - -NS_IMETHODIMP -nsJavaObjectInfo::GetPluginWrapper(nsIWFInstanceWrapper* *wrapper) -{ - *wrapper = m_jpiwrapper; - NS_ADDREF(m_jpiwrapper); - return NS_OK; -} - - - - diff --git a/mozilla/java/waterfall/wf_moz6/src/nsJavaObjectInfo.h b/mozilla/java/waterfall/wf_moz6/src/nsJavaObjectInfo.h deleted file mode 100644 index 87a61bbf08d..00000000000 --- a/mozilla/java/waterfall/wf_moz6/src/nsJavaObjectInfo.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsJavaObjectInfo.h,v 1.1.1.1 2001-05-09 18:51:36 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef __nsJavaObjectInfo_h__ -#define __nsJavaObjectInfo_h__ -#include "nsIJavaObjectInfo.h" -#include "nsIJavaHTMLObject.h" -#include "nsIWFInstanceWrapper.h" - -class nsJavaObjectInfo : public nsIJavaObjectInfo -{ - public: - NS_DECL_ISUPPORTS - NS_DECL_NSIJAVAOBJECTINFO - - nsJavaObjectInfo(nsISupports* peer); - virtual ~nsJavaObjectInfo(); - NS_IMETHOD SetType(nsJavaObjectType type); - - private: - char **m_keys, **m_vals; - PRUint32 m_argc, m_size, m_step; - char* m_docbase; - nsISupports* m_instance; - nsJavaObjectType m_type; - nsIJavaHTMLObject* m_owner; - JavaObjectWrapper* m_wrapper; - nsIWFInstanceWrapper* m_jpiwrapper; -}; - -#endif diff --git a/mozilla/java/waterfall/wf_moz6/src/nsPluggableJVM.cpp b/mozilla/java/waterfall/wf_moz6/src/nsPluggableJVM.cpp deleted file mode 100644 index ccc63fb99bb..00000000000 --- a/mozilla/java/waterfall/wf_moz6/src/nsPluggableJVM.cpp +++ /dev/null @@ -1,459 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsPluggableJVM.cpp,v 1.1.1.1 2001-05-09 18:51:36 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include "nsoji2.h" -#include "nsPluggableJVM.h" -#include "nsIJavaHTMLObject.h" -#include "wf_moz6_common.h" -// just as I'm lazy to Create/Cleanup Java calls -#include "nsWFSecureEnv.h" - -NS_IMPL_ISUPPORTS1(nsPluggableJVM, nsIPluggableJVM) - -static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); -static NS_DEFINE_IID(kIPluggableJVMIID, NS_IPLUGGABLEJVM_IID); - -nsPluggableJVM::nsPluggableJVM() -{ - NS_INIT_ISUPPORTS(); - m_extID = 0; - m_dll = nsnull; -} - -nsPluggableJVM::~nsPluggableJVM() -{ - OJI_LOG("nsPluggableJVM::~nsPluggableJVM"); - if (m_jvmp_context) - { - if (m_extID) - (m_jvmp_context->JVMP_UnregisterExtension)(m_ctx, m_extID); - } -} - -NS_IMETHODIMP -nsPluggableJVM::RegisterWindow(nsPluginWindow* rwin, - jint *ID) -{ - JVMP_DrawingSurfaceInfo w; - - OJI_LOG("nsPluggableJVM::RegisterWindow"); - w.window = (JPluginWindow *)rwin->window; - w.x = rwin->x; - w.y = rwin->y; - w.width = rwin->width; - w.height = rwin->height; - if ((m_jvmp_context->JVMP_RegisterWindow)(m_ctx, &w, ID) != JNI_TRUE) - { - OJI_LOG("can\'t register window"); - return NS_ERROR_FAILURE; - }; - OJI_LOG2("Registed our native window with ID %ld", *ID); - return NS_OK; -} - -/* void UnregisterWindow (in jp_jint ID); */ -NS_IMETHODIMP -nsPluggableJVM::UnregisterWindow(jint ID) -{ - if ((m_jvmp_context->JVMP_UnregisterWindow)(m_ctx, ID) != JNI_TRUE) - { - OJI_LOG("can\'t unregister window"); - return NS_ERROR_FAILURE; - }; - return NS_OK; -} - -NS_IMETHODIMP -nsPluggableJVM::RegisterMonitor(PRMonitor* rmon, jint *pID) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -/* void UnregisterMonitor (in jp_jint ID); */ -NS_IMETHODIMP -nsPluggableJVM::UnregisterMonitor(jint ID) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP -nsPluggableJVM::GetJavaWrapper(jint obj, jobject *wrapper) -{ - struct Java_CallInfo* call; - nsresult rv = NS_OK; - *wrapper = NULL; - if (!m_extID) return NS_ERROR_FAILURE; - nsWFSecureEnv::CreateJavaCallInfo(&call, NULL); - call->type = Java_WrapJSObject; - call->jException = NULL; - call->data.__wrapJSObject.jsObject = obj; - call->data.__wrapJSObject.jstid = (jint)PR_GetCurrentThread(); - - rv = ExtensionCall(1, PTR_TO_JLONG(call)); - if (!NS_FAILED(rv)) - { - // XXX: do smth meaningful with possible Java exception - if (call->jException) { - DeleteLocalRef(call->jException); - rv = NS_ERROR_FAILURE; - } else { - // global ref already created - *wrapper = call->data.__wrapJSObject.jObject; - } - } - nsWFSecureEnv::CleanupJavaCallInfo(call, NULL); - return rv; -} - -NS_IMETHODIMP -nsPluggableJVM::UnwrapJavaWrapper(jobject jobj, jint *jsobj) -{ - struct Java_CallInfo* call; - nsresult rv = NS_OK; - if (jsobj == NULL || !m_extID) return NS_ERROR_FAILURE; - if (jobj == NULL) - { - *jsobj = 0; - return NS_OK; - } - *jsobj = 0; - nsWFSecureEnv::CreateJavaCallInfo(&call, NULL); - call->type = Java_UnwrapJObject; - call->jException = NULL; - call->data.__unwrapJObject.jObject = jobj; - call->data.__unwrapJObject.jstid = (jint)PR_GetCurrentThread(); - - rv = ExtensionCall(1, PTR_TO_JLONG(call)); - if (!NS_FAILED(rv)) - { - // XXX: do smth meaningful with possible Java exception - if (call->jException) { - DeleteLocalRef(call->jException); - rv = NS_ERROR_FAILURE; - } else { - *jsobj = call->data.__unwrapJObject.jsObject; - } - } - nsWFSecureEnv::CleanupJavaCallInfo(call, NULL); - return rv; -} - - -NS_IMETHODIMP -nsPluggableJVM::GetJNIEnv(JNIEnv* *env) -{ - JVMP_CallingContext* ctx; - int res; - - res = (m_jvmp_context->JVMP_GetCallingContext)(&ctx); - if (res != JNI_TRUE) return NS_ERROR_FAILURE; - *env = ctx->env; - return NS_OK;; -} - - -static int newPrincipalsFromStrings(jbyte** *resprin, - jint* *reslen, jint num, ...) -{ - jint* prins_len; - jbyte* *prins; - char* str; - jint i, len; - va_list ap; - - prins_len = (jint*)malloc(num*sizeof(jint)); - if (!prins_len) return 0; - prins = (jbyte**)malloc(num*sizeof(jbyte**)); - if (!prins) return 0; - va_start(ap, num); - for (i=0; iJVMP_EnableCapabilities) - (m_ctx, &cap, pnum, plen, prins) != JNI_TRUE) - { - OJI_LOG("Can\'t enable caps"); - return JNI_FALSE; - }; - deletePrincipals(prins, plen, pnum); - SetConsoleVisibility(PR_TRUE); - char* ext_dll = PR_GetLibraryName(plugin_home, LIBEXT); - OJI_LOG2("JVMP_RegisterExtension: %s", ext_dll); - res = (m_jvmp_context->JVMP_RegisterExtension)(m_ctx, - ext_dll, - &m_extID, - sup); - PR_Free(ext_dll); - if (res != JNI_TRUE || m_extID == 0) return NS_ERROR_FAILURE; - OJI_LOG("JVMP_RegisterExtension OK"); - *status = nsPluggableJVMStatus_Running; - return NS_OK; -} - -/* void ShutdownJVM (in PRBool fullShutdown, out nsJVMStatus status); */ -NS_IMETHODIMP -nsPluggableJVM::ShutdownJVM(PRBool fullShutdown, nsPluggableJVMStatus *status) -{ - if ((m_jvmp_context->JVMP_UnregisterExtension(m_ctx, m_extID) != JNI_TRUE)) - return NS_ERROR_FAILURE; - if ((m_jvmp_context->JVMP_StopJVM(m_ctx) != JNI_TRUE)) - return NS_ERROR_FAILURE; - m_jvmp_context = NULL; - return NS_OK; -} - -nsresult -nsPluggableJVM::loadPluginDLL(const char* plugin_home) -{ - char* plugin_dll = PR_GetLibraryName(plugin_home, LIBJVMP); - JVMP_GetPlugin_t fJVMP_GetPlugin; - char errorMsg[1024] = ""; - - OJI_LOG2("Loading JVMP from %s", plugin_dll); - m_dll = PR_LoadLibrary(plugin_dll); - PR_Free(plugin_dll); - if (!m_dll) - { - if (PR_GetErrorTextLength() < (int) sizeof(errorMsg)) - PR_GetErrorText(errorMsg); - OJI_LOG2("Cannot load plugin DLL: %s", errorMsg); - return NS_ERROR_FAILURE; - } - fJVMP_GetPlugin = - (JVMP_GetPlugin_t) PR_FindSymbol(m_dll, "JVMP_GetPlugin"); - if (!fJVMP_GetPlugin) - { - if (PR_GetErrorTextLength() < (int) sizeof(errorMsg)) - PR_GetErrorText(errorMsg); - OJI_LOG2("Cannot resolve JVMP_GetPlugin: %s", errorMsg); - return NS_ERROR_FAILURE; - } - (*fJVMP_GetPlugin)(&m_jvmp_context); - return NS_OK; -} - -nsresult -nsPluggableJVM::initJVM(JVMP_CallingContext* *penv, - JavaVMInitArgs* vm_args) -{ - jint res = (m_jvmp_context->JVMP_GetRunningJVM)(penv, vm_args, JNI_TRUE); - if (res == JNI_TRUE) - { - OJI_LOG("OK GOT JVM!!!!"); - return NS_OK; - } - else - { - OJI_LOG("BAD - NO JVM!!!!"); - return NS_ERROR_FAILURE; - } - return NS_OK; -} - -NS_IMETHODIMP -nsPluggableJVM::CreateJavaPeer(nsIJavaHTMLObject *obj, - const char* cid, - jint *pid) -{ - if ((m_jvmp_context->JVMP_CreatePeer)(m_ctx, cid, 0, pid)) - return NS_OK; - return NS_ERROR_FAILURE; -} - -/* void PostEventToJavaPeer (in jp_jint obj_id, in jp_jint evt_id, in jp_jint evt_data); */ -NS_IMETHODIMP -nsPluggableJVM::PostEventToJavaPeer(jint obj_id, jint evt_id, - jlong evt_data) -{ - if ((m_jvmp_context->JVMP_PostEvent)(m_ctx, obj_id, - evt_id, evt_data, JVMP_PRIORITY_NORMAL) == JNI_FALSE) - return NS_ERROR_FAILURE; - return NS_OK; -} - -NS_IMETHODIMP -nsPluggableJVM::JavaPeerCall(jint obj_id, - jint data1, - jlong data2) -{ - if ((m_jvmp_context->JVMP_DirectPeerCall)(m_ctx, obj_id, - data1, data2) == JNI_FALSE) - return NS_ERROR_FAILURE; - return NS_OK; -} - - -/* void SendEventToJavaPeer (in jp_jint obj_id, in jp_jint evt_id, in jp_jint evt_data); */ -NS_IMETHODIMP -nsPluggableJVM::SendEventToJavaPeer(jint obj_id, jint evt_id, - jlong evt_data, jint* result) -{ - jint r = (m_jvmp_context->JVMP_SendEvent)(m_ctx, obj_id, - evt_id, evt_data, JVMP_PRIORITY_NORMAL); - if (r == JNI_FALSE) - { - return NS_ERROR_FAILURE; - } - if (result) *result = r; - return NS_OK; -} - -/* void DestroyJavaPeer (in jp_jint id); */ -NS_IMETHODIMP -nsPluggableJVM::DestroyJavaPeer(jint id) -{ - if ((m_jvmp_context->JVMP_DestroyPeer)(m_ctx, id)) - return NS_OK; - return NS_ERROR_FAILURE; -} - -NS_IMETHODIMP -nsPluggableJVM::ExtensionCall(jint arg1, jlong arg2) -{ - if (m_extID == 0) return NS_ERROR_FAILURE; - if ((m_jvmp_context->JVMP_DirectExtCall)(m_ctx, m_extID, arg1, arg2)) - return NS_OK; - return NS_ERROR_FAILURE; -} - -NS_IMETHODIMP -nsPluggableJVM::DeleteGlobalRef(jobject jobj) -{ - m_ctx->env->DeleteGlobalRef(jobj); - return NS_OK; -} - -NS_IMETHODIMP -nsPluggableJVM::DeleteLocalRef(jobject jobj) -{ - m_ctx->env->DeleteLocalRef(jobj); - return NS_OK; -} - - -NS_IMETHODIMP -nsPluggableJVM::GetWFCtx(JVMP_RuntimeContext* *rt_ctx, - JVMP_CallingContext* *c_ctx) -{ - if (!m_jvmp_context) return NS_ERROR_FAILURE; - *rt_ctx = m_jvmp_context; - if ((m_jvmp_context->JVMP_GetCallingContext)(c_ctx) != JNI_TRUE) - { - OJI_LOG2("JVMP_GetCallingContext failed: %ld", (*c_ctx)->err); - return NS_ERROR_FAILURE; - } - return NS_OK; -} - -NS_IMETHODIMP -nsPluggableJVM::SetConsoleVisibility(PRBool visibility) -{ - - //OJI_LOG2("nsPluggableJVM::SetConsoleVisibility: %d", visibility); - jint rv = (m_jvmp_context->JVMP_PostSysEvent)(m_ctx, - JVMP_CMD_CTL_CONSOLE, - (jlong) (visibility ? 1 : 0), - JVMP_PRIORITY_NORMAL); - return (rv == JNI_TRUE ? NS_OK : NS_ERROR_FAILURE); -} - -NS_IMETHODIMP -nsPluggableJVM::GetConsoleVisibility(PRBool *pVisibility) -{ - // this call uses hacky feature of JVMP_Send*Event(): - // returned value can be used to return value from event handler - jint rv = (m_jvmp_context->JVMP_SendSysEvent)(m_ctx, - JVMP_CMD_CTL_CONSOLE, - (jlong)2, - JVMP_PRIORITY_NORMAL); - *pVisibility = (rv == 2 ? PR_TRUE : PR_FALSE); - return NS_OK; -} - -NS_IMETHODIMP -nsPluggableJVM::PrintToConsole(const char* msg, - const char* encoding) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} diff --git a/mozilla/java/waterfall/wf_moz6/src/nsPluggableJVM.h b/mozilla/java/waterfall/wf_moz6/src/nsPluggableJVM.h deleted file mode 100644 index 31fd6265cea..00000000000 --- a/mozilla/java/waterfall/wf_moz6/src/nsPluggableJVM.h +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsPluggableJVM.h,v 1.1.1.1 2001-05-09 18:51:36 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef __nsPluggableJVM_h__ -#define __nsPluggableJVM_h__ -#include "nsIPluggableJVM.h" -#include "nsIBrowserJavaSupport.h" -#include "nsCOMPtr.h" -#include "nspr.h" -// Waterfall interface -#include "jvmp.h" - -#define LIBJVMP "jvmp" -#define LIBEXT "wf_moz6" - -class nsPluggableJVM : public nsIPluggableJVM { - public: - NS_DECL_ISUPPORTS - - NS_DECL_NSIPLUGGABLEJVM - - nsPluggableJVM(); - - virtual ~nsPluggableJVM(); - - NS_IMETHOD GetWFCtx(JVMP_RuntimeContext* *rt_ctx, - JVMP_CallingContext* *c_ctx); - NS_IMETHOD DeleteGlobalRef(jobject jobj); - NS_IMETHOD DeleteLocalRef(jobject jobj); - protected: - // pointer to WF plugin context - JVMP_RuntimeContext* m_jvmp_context; - // Waterfall DLL handle - PRLibrary* m_dll; - // this field contains JVMP_CallingContext only for main NS thread - // other threads should use JVMP_GetCallingContext() - JVMP_CallingContext* m_ctx; - // descriptor provided by Waterfall library for proper Mozilla extension - jint m_extID; - // browser Java support field - nsCOMPtr m_support; - // just load Waterfall and set up m_jvmp_context correctly - NS_METHOD loadPluginDLL(const char* plugin_home); - // start up JVM and set up m_ctx correctly - call from main thread - NS_METHOD initJVM(JVMP_CallingContext* *penv, - JavaVMInitArgs* vm_args); -}; - -#endif /* __nsPluggableJVM_h__ */ diff --git a/mozilla/java/waterfall/wf_moz6/src/nsWFSecureEnv.cpp b/mozilla/java/waterfall/wf_moz6/src/nsWFSecureEnv.cpp deleted file mode 100644 index 6736f058e2c..00000000000 --- a/mozilla/java/waterfall/wf_moz6/src/nsWFSecureEnv.cpp +++ /dev/null @@ -1,1186 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsWFSecureEnv.cpp,v 1.1.1.1 2001-05-09 18:51:36 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include "nsDebug.h" -#include "nsWFSecureEnv.h" -#include "nsCRT.h" - -// Caching of those two gives significant performance gain and is safe. -// Instead of time consuming reflection and call to Waterfall extension, -// we'll use plain JNI call. -static jclass g_javaLangSystem = NULL; -static jmethodID g_identityHashCodeMID = NULL; - -NS_IMPL_ISUPPORTS1(nsWFSecureEnv, nsISupports) - -NS_METHOD -nsWFSecureEnv::Create(nsPluggableJVM* jvm, - const nsIID& aIID, - void* *aInstancePtr) -{ - nsWFSecureEnv* env = new nsWFSecureEnv(jvm); - if (env == NULL) return NS_ERROR_OUT_OF_MEMORY; - return env->QueryInterface(aIID, aInstancePtr); - -} - -nsWFSecureEnv::nsWFSecureEnv(nsPluggableJVM* jvm) -{ - NS_INIT_ISUPPORTS(); - m_jvm = jvm; - NS_ADDREF(m_jvm); - m_jvm->GetWFCtx(&m_rtctx, &m_ctx); - m_env = m_ctx->env; - NS_ASSERTION(m_env != nsnull, - "Error: env field not initialized by this Waterfall implementation."); - if (!g_javaLangSystem) - g_javaLangSystem = (jclass)m_env->NewGlobalRef(m_env->FindClass("java/lang/System")); - if (!g_identityHashCodeMID) - g_identityHashCodeMID = m_env->GetStaticMethodID(g_javaLangSystem, - "identityHashCode", - "(Ljava/lang/Object;)I"); -} - -nsWFSecureEnv::~nsWFSecureEnv(void) -{ - OJI_LOG("nsWFSecureEnv::~nsWFSecureEnv"); - NS_RELEASE(m_jvm); -} -static int Implies(void* handle, const char* target, - const char* action, int *bAllowedAccess) -{ - nsISecurityContext* ctx = (nsISecurityContext*)handle; - if (ctx) return NS_SUCCEEDED(ctx->Implies(target, action, bAllowedAccess)); - return 0; -} - -static int GetOrigin(void* handle, char *buffer, int len) -{ - nsISecurityContext* ctx = (nsISecurityContext*)handle; - if (ctx) return NS_SUCCEEDED(ctx->GetOrigin(buffer, len)); - return 0; -} - -static int GetCertificateID(void* handle, char *buffer, int len) -{ - nsISecurityContext* ctx = (nsISecurityContext*)handle; - if (ctx) return NS_SUCCEEDED(ctx->GetCertificateID(buffer, len)); - return 0; -} - -NS_METHOD -nsWFSecureEnv::CreateJavaCallInfo(Java_CallInfo* *pCall, - nsISecurityContext* ctx) -{ - Java_CallInfo* call = (Java_CallInfo*)malloc(sizeof(Java_CallInfo)); - nsCRT::memset(call, 0, sizeof(Java_CallInfo)); - if (ctx) { - NS_ADDREF(ctx); - SecurityContextWrapper* sec = - (SecurityContextWrapper*)malloc(sizeof(SecurityContextWrapper)); - sec->info = (void*)ctx; - sec->Implies = ⇒ - sec->GetOrigin = &GetOrigin; - sec->GetCertificateID = &GetCertificateID; - sec->dead = 0; - call->security = sec; - } - *pCall = call; - return NS_OK; -} - -NS_METHOD -nsWFSecureEnv::CleanupJavaCallInfo(Java_CallInfo* pCall, - nsISecurityContext* ctx) -{ - if (!pCall) return NS_OK; - if (ctx) - { - free(pCall->security); - NS_RELEASE(ctx); - } - free(pCall); - return NS_OK; -} -//nsISecureEnv -NS_IMETHODIMP -nsWFSecureEnv::NewObject(/*[in]*/ jclass clazz, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jobject* result, - /*[in]*/ nsISecurityContext* ctx) -{ - //OJI_LOG("nsWFSecureEnv::NewObject"); - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - struct Java_CallInfo* call = NULL; - nsWFSecureEnv::CreateJavaCallInfo(&call, ctx); - call->type = Java_CreateObject; - call->data.__createObject.clazz = clazz; - call->data.__createObject.methodID = methodID; - call->data.__createObject.args = args; - nsresult rv = m_jvm->ExtensionCall(1, PTR_TO_JLONG(call)); - if (!NS_FAILED(rv)) - { - // XXX: do smth meaningful with possible Java exception - if (call->jException) { - m_jvm->DeleteLocalRef(call->jException); - rv = NS_ERROR_FAILURE; - } else { - *result = call->data.__createObject.result; - rv = NS_OK; - } - } - nsWFSecureEnv::CleanupJavaCallInfo(call, ctx); - return rv; -} - -NS_IMETHODIMP -nsWFSecureEnv::CallMethod(/*[in]*/ jni_type ret_type, - /*[in]*/ jobject obj, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx) -{ - if (result == NULL || obj == NULL || methodID == NULL) - return NS_ERROR_NULL_POINTER; - struct Java_CallInfo* call = NULL; - nsWFSecureEnv::CreateJavaCallInfo(&call, ctx); - //OJI_LOG5("CallMethod: %x %x %x %x", obj, methodID, args, result); - call->type = Java_CallMethod; - call->data.__callMethod.type = (enum jvmp_jni_type)ret_type; // the same structure, really - call->data.__callMethod.obj = obj; - call->data.__callMethod.methodID = methodID; - call->data.__callMethod.args = args; - nsresult rv = m_jvm->ExtensionCall(1, PTR_TO_JLONG(call)); - if (!NS_FAILED(rv)) - { - // XXX: do smth meaningful with possible Java exception - if (call->jException) { - m_jvm->DeleteLocalRef(call->jException); - rv = NS_ERROR_FAILURE; - } else { - *result = call->data.__callMethod.result; - rv = NS_OK; - } - } - nsWFSecureEnv::CleanupJavaCallInfo(call, ctx); - return rv; -} - -NS_IMETHODIMP -nsWFSecureEnv::CallNonvirtualMethod(/*[in]*/ jni_type ret_type, - /*[in]*/ jobject obj, - /*[in]*/ jclass clazz, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx) -{ - if (result == NULL || obj == NULL || methodID == NULL) - return NS_ERROR_NULL_POINTER; - struct Java_CallInfo* call = NULL; - nsWFSecureEnv::CreateJavaCallInfo(&call, ctx); - //OJI_LOG5("CallMethod: %x %x %x %x", obj, methodID, args, result); - call->type = Java_CallNonvirtualMethod; - call->data.__callNonvirtualMethod.type = (enum jvmp_jni_type)ret_type; // the same structure, really - call->data.__callNonvirtualMethod.obj = obj; - call->data.__callNonvirtualMethod.clazz = clazz; - call->data.__callNonvirtualMethod.methodID = methodID; - call->data.__callNonvirtualMethod.args = args; - nsresult rv = m_jvm->ExtensionCall(1, PTR_TO_JLONG(call)); - if (!NS_FAILED(rv)) - { - // XXX: do smth meaningful with possible Java exception - if (call->jException) { - m_jvm->DeleteLocalRef(call->jException); - rv = NS_ERROR_FAILURE; - } else { - *result = call->data.__callNonvirtualMethod.result; - rv = NS_OK; - } - } - nsWFSecureEnv::CleanupJavaCallInfo(call, ctx); - return rv; -} - -NS_IMETHODIMP -nsWFSecureEnv::GetField(/*[in]*/ jni_type field_type, - /*[in]*/ jobject obj, - /*[in]*/ jfieldID fieldID, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx) -{ - //OJI_LOG("nsWFSecureEnv::GetField"); - if (m_env == NULL || obj == NULL || fieldID == NULL) - return NS_ERROR_NULL_POINTER; - struct Java_CallInfo* call = NULL; - nsWFSecureEnv::CreateJavaCallInfo(&call, ctx); - call->type = Java_GetField; - call->data.__getField.type = (enum jvmp_jni_type)field_type; // the same structure, really - call->data.__getField.obj = obj; - call->data.__getField.fieldID = fieldID; - nsresult rv = m_jvm->ExtensionCall(1, PTR_TO_JLONG(call)); - if (!NS_FAILED(rv)) - { - // XXX: do smth meaningful with possible Java exception - if (call->jException) { - m_jvm->DeleteLocalRef(call->jException); - rv = NS_ERROR_FAILURE; - } else { - *result = call->data.__getField.result; - rv = NS_OK; - } - } - nsWFSecureEnv::CleanupJavaCallInfo(call, ctx); - return rv; -} - -NS_IMETHODIMP -nsWFSecureEnv::SetField(/*[in]*/ jni_type field_type, - /*[in]*/ jobject obj, - /*[in]*/ jfieldID fieldID, - /*[in]*/ jvalue val, - /*[in]*/ nsISecurityContext* ctx) -{ - //OJI_LOG("nsWFSecureEnv::SetField"); - if (m_env == NULL || obj == NULL || fieldID == NULL) - return NS_ERROR_NULL_POINTER; - struct Java_CallInfo* call = NULL; - nsWFSecureEnv::CreateJavaCallInfo(&call, ctx); - call->type = Java_SetField; - call->data.__setField.type = (enum jvmp_jni_type)field_type; // the same structure, really - call->data.__setField.obj = obj; - call->data.__setField.fieldID = fieldID; - call->data.__setField.value = val; - nsresult rv = m_jvm->ExtensionCall(1, PTR_TO_JLONG(call)); - if (!NS_FAILED(rv)) - { - // XXX: do smth meaningful with possible Java exception - if (call->jException) { - m_jvm->DeleteLocalRef(call->jException); - rv = NS_ERROR_FAILURE; - } else - rv = NS_OK; - } - nsWFSecureEnv::CleanupJavaCallInfo(call, ctx); - return rv; -} - -NS_IMETHODIMP -nsWFSecureEnv::CallStaticMethod(/*[in]*/ jni_type ret_type, - /*[in]*/ jclass clazz, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx) -{ - if (result == NULL || clazz == NULL || methodID == NULL) - return NS_ERROR_NULL_POINTER; - if (methodID == g_identityHashCodeMID) - { - //OJI_LOG("using cached identityHashCode"); - result->i = m_env->CallStaticIntMethodA(g_javaLangSystem, - g_identityHashCodeMID, - args); - return NS_OK; - } - struct Java_CallInfo* call = NULL; - nsWFSecureEnv::CreateJavaCallInfo(&call, ctx); - call->type = Java_CallStaticMethod; - call->data.__callStaticMethod.type = (enum jvmp_jni_type)ret_type; // the same structure, really - call->data.__callStaticMethod.clazz = clazz; - call->data.__callStaticMethod.methodID = methodID; - call->data.__callStaticMethod.args = args; - nsresult rv = m_jvm->ExtensionCall(1, PTR_TO_JLONG(call)); - if (!NS_FAILED(rv)) - { - // XXX: do smth meaningful with possible Java exception - if (call->jException) { - m_jvm->DeleteLocalRef(call->jException); - rv = NS_ERROR_FAILURE; - } else - *result = call->data.__callStaticMethod.result; - } - nsWFSecureEnv::CleanupJavaCallInfo(call, ctx); - return rv; -} - -NS_IMETHODIMP -nsWFSecureEnv::GetStaticField(/*[in]*/ jni_type field_type, - /*[in]*/ jclass clazz, - /*[in]*/ jfieldID fieldID, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx) -{ - //OJI_LOG4("nsWFSecureEnv::GetStaticField: type=%d class=%x fid=%x", - // field_type, clazz, fieldID); - if (m_env == NULL || clazz == NULL || fieldID == NULL) - return NS_ERROR_NULL_POINTER; - struct Java_CallInfo* call = NULL; - nsWFSecureEnv::CreateJavaCallInfo(&call, ctx); - call->type = Java_GetStaticField; - call->data.__getStaticField.type = (enum jvmp_jni_type)field_type; // the same structure, really - call->data.__getStaticField.clazz = clazz; - call->data.__getStaticField.fieldID = fieldID; - nsresult rv = m_jvm->ExtensionCall(1, PTR_TO_JLONG(call)); - if (!NS_FAILED(rv)) - { - // XXX: do smth meaningful with possible Java exception - if (call->jException) { - m_jvm->DeleteLocalRef(call->jException); - rv = NS_ERROR_FAILURE; - } else { - *result = call->data.__getStaticField.result; - rv = NS_OK; - } - } - nsWFSecureEnv::CleanupJavaCallInfo(call, ctx); - return rv; -} - -NS_IMETHODIMP -nsWFSecureEnv::SetStaticField(/*[in]*/ jni_type field_type, - /*[in]*/ jclass clazz, - /*[in]*/ jfieldID fieldID, - /*[in]*/ jvalue val, - /*[in]*/ nsISecurityContext* ctx) -{ - //OJI_LOG("nsWFSecureEnv::SetStaticField"); - if (m_env == NULL || clazz == NULL || fieldID == NULL) - return NS_ERROR_NULL_POINTER; - struct Java_CallInfo* call = NULL; - nsWFSecureEnv::CreateJavaCallInfo(&call, ctx); - call->type = Java_SetStaticField; - call->data.__setStaticField.type = (enum jvmp_jni_type)field_type; // the same structure, really - call->data.__setStaticField.clazz = clazz; - call->data.__setStaticField.fieldID = fieldID; - call->data.__setStaticField.value = val; - nsresult rv = m_jvm->ExtensionCall(1, PTR_TO_JLONG(call)); - if (!NS_FAILED(rv)) - { - // XXX: do smth meaningful with possible Java exception - if (call->jException) { - m_jvm->DeleteLocalRef(call->jException); - rv = NS_ERROR_FAILURE; - } else - rv = NS_OK; - } - nsWFSecureEnv::CleanupJavaCallInfo(call, ctx); - return rv; -} - -NS_IMETHODIMP nsWFSecureEnv::GetVersion(/*[out]*/ jint* version) -{ - if (m_env == NULL || version == NULL) - return NS_ERROR_NULL_POINTER; - - *version = m_env->GetVersion(); - - return NS_OK; -} - -NS_IMETHODIMP nsWFSecureEnv::DefineClass(/*[in]*/ const char* name, - /*[in]*/ jobject loader, - /*[in]*/ const jbyte *buf, - /*[in]*/ jsize len, - /*[out]*/ jclass* clazz) -{ - //OJI_LOG("nsWFSecureEnv::DefineClass"); - - if (m_env == NULL || clazz == NULL) - return NS_ERROR_NULL_POINTER; - - *clazz = m_env->DefineClass(name, loader, buf, len); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::FindClass(/*[in]*/ const char* name, - /*[out]*/ jclass* clazz) -{ - - if (m_env == NULL || clazz == NULL) - return NS_ERROR_NULL_POINTER; - - *clazz = m_env->FindClass(name); - //OJI_LOG3("nsWFSecureEnv::FindClass for %s is %x", name, *clazz); - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::GetSuperclass(/*[in]*/ jclass sub, - /*[out]*/ jclass* super) -{ - if (m_env == NULL || super == NULL) - return NS_ERROR_NULL_POINTER; - - *super = m_env->GetSuperclass(sub); - //OJI_LOG3("nsWFSecureEnv::GetSuperclass: %x->%x", sub, *super); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::IsAssignableFrom(/*[in]*/ jclass sub, - /*[in]*/ jclass super, - /*[out]*/ jboolean* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->IsAssignableFrom(sub, super); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::Throw(/*[in]*/ jthrowable obj, - /*[out]*/ jint* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - //OJI_LOG("nsWFSecureEnv::Throw"); - *result = m_env->Throw(obj); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::ThrowNew(/*[in]*/ jclass clazz, - /*[in]*/ const char *msg, - /*[out]*/ jint* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->ThrowNew(clazz, msg); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::ExceptionOccurred(/*[out]*/ jthrowable* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->ExceptionOccurred(); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::ExceptionDescribe(void) -{ - if (m_env == NULL) - return NS_ERROR_NULL_POINTER; - - m_env->ExceptionDescribe(); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::ExceptionClear(void) -{ - if (m_env == NULL) - return NS_ERROR_NULL_POINTER; - - m_env->ExceptionClear(); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::FatalError(/*[in]*/ const char* msg) -{ - if (m_env == NULL) - return NS_ERROR_NULL_POINTER; - - OJI_LOG2("Fatal error: %s", msg); - m_env->FatalError(msg); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::NewGlobalRef(/*[in]*/ jobject lobj, - /*[out]*/ jobject* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->NewGlobalRef(lobj); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::DeleteGlobalRef(/*[in]*/ jobject gref) -{ - if (m_env == NULL) - return NS_ERROR_NULL_POINTER; - - m_env->DeleteGlobalRef(gref); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::DeleteLocalRef(/*[in]*/ jobject obj) -{ - if (m_env == NULL) - return NS_ERROR_NULL_POINTER; - - m_env->DeleteLocalRef(obj); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::IsSameObject(/*[in]*/ jobject obj1, - /*[in]*/ jobject obj2, - /*[out]*/ jboolean* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->IsSameObject(obj1, obj2); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::AllocObject(/*[in]*/ jclass clazz, - /*[out]*/ jobject* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->AllocObject(clazz); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::GetObjectClass(/*[in]*/ jobject obj, - /*[out]*/ jclass* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->GetObjectClass(obj); - //OJI_LOG("nsWFSecureEnv::GetObjectClass"); - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::IsInstanceOf(/*[in]*/ jobject obj, - /*[in]*/ jclass clazz, - /*[out]*/ jboolean* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->IsInstanceOf(obj, clazz); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::GetMethodID(/*[in]*/ jclass clazz, - /*[in]*/ const char* name, - /*[in]*/ const char* sig, - /*[out]*/ jmethodID* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->GetMethodID(clazz, name, sig); - //OJI_LOG5("nsWFSecureEnv::GetMethodID: class=%x method=%s sig=%s r=%x", clazz, name, sig, *result); - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::GetFieldID(/*[in]*/ jclass clazz, - /*[in]*/ const char* name, - /*[in]*/ const char* sig, - /*[out]*/ jfieldID* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->GetFieldID(clazz, name, sig); - //OJI_LOG5("nsWFSecureEnv::GetFieldID: class=%x method=%s sig=%s r=%x", - //clazz, name, sig, *result); - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::GetStaticMethodID(/*[in]*/ jclass clazz, - /*[in]*/ const char* name, - /*[in]*/ const char* sig, - /*[out]*/ jmethodID* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->GetStaticMethodID(clazz, name, sig); - //OJI_LOG5("nsWFSecureEnv::GetStaticMethodID: class=%x method=%s sig=%s r=%x", - //clazz, name, sig, *result); - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::GetStaticFieldID(/*[in]*/ jclass clazz, - /*[in]*/ const char* name, - /*[in]*/ const char* sig, - /*[out]*/ jfieldID* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->GetStaticFieldID(clazz, name, sig); - //OJI_LOG5("nsWFSecureEnv::GetStaticFieldID: clazz=%x name=%s sig=%s r=%x", - //clazz, name, sig, *result); - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::NewString(/*[in]*/ const jchar* unicode, - /*[in]*/ jsize len, - /*[out]*/ jstring* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->NewString(unicode, len); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::GetStringLength(/*[in]*/ jstring str, - /*[out]*/ jsize* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->GetStringLength(str); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::GetStringChars(/*[in]*/ jstring str, - /*[in]*/ jboolean *isCopy, - /*[out]*/ const jchar** result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->GetStringChars(str, isCopy); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::ReleaseStringChars(/*[in]*/ jstring str, - /*[in]*/ const jchar *chars) -{ - if (m_env == NULL) - return NS_ERROR_NULL_POINTER; - - m_env->ReleaseStringChars(str, chars); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::NewStringUTF(/*[in]*/ const char *utf, - /*[out]*/ jstring* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->NewStringUTF(utf); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::GetStringUTFLength(/*[in]*/ jstring str, - /*[out]*/ jsize* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->GetStringUTFLength(str); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::GetStringUTFChars(/*[in]*/ jstring str, - /*[in]*/ jboolean *isCopy, - /*[out]*/ const char** result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->GetStringUTFChars(str, isCopy); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::ReleaseStringUTFChars(/*[in]*/ jstring str, - /*[in]*/ const char *chars) -{ - if (m_env == NULL) - return NS_ERROR_NULL_POINTER; - - m_env->ReleaseStringUTFChars(str, chars); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::GetArrayLength(/*[in]*/ jarray array, - /*[out]*/ jsize* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->GetArrayLength(array); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::GetObjectArrayElement(/*[in]*/ jobjectArray array, - /*[in]*/ jsize index, - /*[out]*/ jobject* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->GetObjectArrayElement(array, index); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::SetObjectArrayElement(/*[in]*/ jobjectArray array, - /*[in]*/ jsize index, - /*[in]*/ jobject val) -{ - if (m_env == NULL) - return NS_ERROR_NULL_POINTER; - - m_env->SetObjectArrayElement(array, index, val); - - return NS_OK; -} - - - -NS_IMETHODIMP nsWFSecureEnv::NewObjectArray(/*[in]*/ jsize len, - /*[in]*/ jclass clazz, - /*[in]*/ jobject init, - /*[out]*/ jobjectArray* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->NewObjectArray(len, clazz, init); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::NewArray(/*[in]*/ jni_type element_type, - /*[in]*/ jsize len, - /*[out]*/ jarray* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - switch (element_type) - { - case jboolean_type: { - *result = m_env->NewBooleanArray(len); - break; - } - - case jbyte_type: { - *result = m_env->NewByteArray(len); - break; - } - - case jchar_type: { - *result = m_env->NewCharArray(len); - break; - } - - case jshort_type: { - *result = m_env->NewShortArray(len); - break; - } - - case jint_type: { - *result = m_env->NewIntArray(len); - break; - } - - case jlong_type:{ - *result = m_env->NewLongArray(len); - break; - } - - case jfloat_type:{ - *result = m_env->NewFloatArray(len); - break; - } - - case jdouble_type:{ - *result = m_env->NewDoubleArray(len); - break; - } - - default: - return NS_ERROR_FAILURE; - } - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::GetArrayElements(/*[in]*/ jni_type element_type, - /*[in]*/ jarray array, - /*[in]*/ jboolean *isCopy, - /*[out]*/ void* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - switch (element_type) - { - case jboolean_type: { - jboolean** ret = (jboolean**) result; - *ret = m_env->GetBooleanArrayElements((jbooleanArray)array, isCopy); - break; - } - - case jbyte_type: { - jbyte** ret = (jbyte**) result; - *ret = m_env->GetByteArrayElements((jbyteArray)array, isCopy); - break; - } - - case jchar_type: { - jchar** ret = (jchar**) result; - *ret = m_env->GetCharArrayElements((jcharArray)array, isCopy); - break; - } - - case jshort_type: { - jshort** ret = (jshort**) result; - *ret = m_env->GetShortArrayElements((jshortArray)array, isCopy); - break; - } - - case jint_type: { - jint** ret = (jint**) result; - *ret = m_env->GetIntArrayElements((jintArray)array, isCopy); - break; - } - - case jlong_type:{ - jlong** ret = (jlong**) result; - *ret = m_env->GetLongArrayElements((jlongArray)array, isCopy); - break; - } - - case jfloat_type:{ - jfloat** ret = (jfloat**) result; - *ret = m_env->GetFloatArrayElements((jfloatArray)array, isCopy); - break; - } - - case jdouble_type:{ - jdouble** ret = (jdouble**) result; - *ret = m_env->GetDoubleArrayElements((jdoubleArray)array, isCopy); - break; - } - - default: - return NS_ERROR_FAILURE; - } - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::ReleaseArrayElements(/*[in]*/ jni_type element_type, - /*[in]*/ jarray array, - /*[in]*/ void *elems, - /*[in]*/ jint mode) -{ - if (m_env == NULL) - return NS_ERROR_NULL_POINTER; - - switch (element_type) - { - case jboolean_type: { - m_env->ReleaseBooleanArrayElements((jbooleanArray)array, (jboolean*)elems, mode); - break; - } - - case jbyte_type: { - m_env->ReleaseByteArrayElements((jbyteArray)array, (jbyte*)elems, mode); - break; - } - - case jchar_type: { - m_env->ReleaseCharArrayElements((jcharArray)array, (jchar*)elems, mode); - break; - } - - case jshort_type: { - m_env->ReleaseShortArrayElements((jshortArray)array, (jshort*)elems, mode); - break; - } - - case jint_type: { - m_env->ReleaseIntArrayElements((jintArray)array, (jint*)elems, mode); - break; - } - - case jlong_type:{ - m_env->ReleaseLongArrayElements((jlongArray)array, (jlong*)elems, mode); - break; - } - - case jfloat_type:{ - m_env->ReleaseFloatArrayElements((jfloatArray)array, (jfloat*)elems, mode); - break; - } - - case jdouble_type:{ - m_env->ReleaseDoubleArrayElements((jdoubleArray)array, (jdouble*)elems, mode); - break; - } - - default: - return NS_ERROR_FAILURE; - } - - return NS_OK; -} - -NS_IMETHODIMP nsWFSecureEnv::GetArrayRegion(/*[in]*/ jni_type element_type, - /*[in]*/ jarray array, - /*[in]*/ jsize start, - /*[in]*/ jsize len, - /*[out]*/ void* buf) -{ - if (m_env == NULL || buf == NULL) - return NS_ERROR_NULL_POINTER; - - switch (element_type) - { - case jboolean_type: { - m_env->GetBooleanArrayRegion((jbooleanArray)array, start, len, (jboolean*)buf); - break; - } - - case jbyte_type: { - m_env->GetByteArrayRegion((jbyteArray)array, start, len, (jbyte*)buf); - break; - } - - case jchar_type: { - m_env->GetCharArrayRegion((jcharArray)array, start, len, (jchar*)buf); - break; - } - - case jshort_type: { - m_env->GetShortArrayRegion((jshortArray)array, start, len, (jshort*)buf); - break; - } - - case jint_type: { - m_env->GetIntArrayRegion((jintArray)array, start, len, (jint*)buf); - break; - } - - case jlong_type:{ - m_env->GetLongArrayRegion((jlongArray)array, start, len, (jlong*)buf); - break; - } - - case jfloat_type:{ - m_env->GetFloatArrayRegion((jfloatArray)array, start, len, (jfloat*)buf); - break; - } - - case jdouble_type:{ - m_env->GetDoubleArrayRegion((jdoubleArray)array, start, len, (jdouble*)buf); - break; - } - - default: - return NS_ERROR_FAILURE; - } - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::SetArrayRegion(/*[in]*/ jni_type element_type, - /*[in]*/ jarray array, - /*[in]*/ jsize start, - /*[in]*/ jsize len, - /*[in]*/ void* buf) -{ - if (m_env == NULL || buf == NULL) - return NS_ERROR_NULL_POINTER; - - switch (element_type) - { - case jboolean_type: { - m_env->SetBooleanArrayRegion((jbooleanArray)array, start, len, (jboolean*)buf); - break; - } - - case jbyte_type: { - m_env->SetByteArrayRegion((jbyteArray)array, start, len, (jbyte*)buf); - break; - } - - case jchar_type: { - m_env->SetCharArrayRegion((jcharArray)array, start, len, (jchar*)buf); - break; - } - - case jshort_type: { - m_env->SetShortArrayRegion((jshortArray)array, start, len, (jshort*)buf); - break; - } - - case jint_type: { - m_env->SetIntArrayRegion((jintArray)array, start, len, (jint*)buf); - break; - } - - case jlong_type:{ - m_env->SetLongArrayRegion((jlongArray)array, start, len, (jlong*)buf); - break; - } - - case jfloat_type:{ - m_env->SetFloatArrayRegion((jfloatArray)array, start, len, (jfloat*)buf); - break; - } - - case jdouble_type:{ - m_env->SetDoubleArrayRegion((jdoubleArray)array, start, len, (jdouble*)buf); - break; - } - - default: - return NS_ERROR_FAILURE; - } - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::RegisterNatives(/*[in]*/ jclass clazz, - /*[in]*/ const JNINativeMethod *methods, - /*[in]*/ jint nMethods, - /*[out]*/ jint* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->RegisterNatives(clazz, methods, nMethods); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::UnregisterNatives(/*[in]*/ jclass clazz, - /*[out]*/ jint* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->UnregisterNatives(clazz); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::MonitorEnter(/*[in]*/ jobject obj, - /*[out]*/ jint* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->MonitorEnter(obj); - - return NS_OK; -} - - -NS_IMETHODIMP nsWFSecureEnv::MonitorExit(/*[in]*/ jobject obj, - /*[out]*/ jint* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->MonitorExit(obj); - - return NS_OK; -} - -NS_IMETHODIMP nsWFSecureEnv::GetJavaVM(/*[in]*/ JavaVM **vm, - /*[out]*/ jint* result) -{ - if (m_env == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = m_env->GetJavaVM(vm); - - return NS_OK; -} - diff --git a/mozilla/java/waterfall/wf_moz6/src/nsWFSecureEnv.h b/mozilla/java/waterfall/wf_moz6/src/nsWFSecureEnv.h deleted file mode 100644 index 19abbc4ff5c..00000000000 --- a/mozilla/java/waterfall/wf_moz6/src/nsWFSecureEnv.h +++ /dev/null @@ -1,271 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsWFSecureEnv.h,v 1.1.1.1 2001-05-09 18:51:36 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef __nsWFSecureEnv_h -#define __nsWFSecureEnv_h -#include "nsoji2.h" -#include "nsISecureEnv.h" -#include "nsPluggableJVM.h" -#include "wf_moz6_common.h" - -class nsWFSecureEnv : public nsISecureEnv -{ - public: - NS_DECL_ISUPPORTS - static NS_METHOD Create(nsPluggableJVM* jvm, - const nsIID& aIID, - void* *aInstancePtr); - static NS_METHOD CreateJavaCallInfo(Java_CallInfo* *pCall, - nsISecurityContext* ctx); - static NS_METHOD CleanupJavaCallInfo(Java_CallInfo* pCall, - nsISecurityContext* ctx); - // here follows methods from nsISecureEnv - no IDL and - // cute macroses yet :( - NS_IMETHOD NewObject(/*[in]*/ jclass clazz, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jobject* result, - /*[in]*/ nsISecurityContext* ctx = NULL); - - NS_IMETHOD CallMethod(/*[in]*/ jni_type ret_type, - /*[in]*/ jobject obj, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx = NULL); - - NS_IMETHOD CallNonvirtualMethod(/*[in]*/ jni_type ret_type, - /*[in]*/ jobject obj, - /*[in]*/ jclass clazz, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx = NULL); - - NS_IMETHOD GetField(/*[in]*/ jni_type field_type, - /*[in]*/ jobject obj, - /*[in]*/ jfieldID fieldID, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx = NULL); - - NS_IMETHOD SetField(/*[in]*/ jni_type field_type, - /*[in]*/ jobject obj, - /*[in]*/ jfieldID fieldID, - /*[in]*/ jvalue val, - /*[in]*/ nsISecurityContext* ctx = NULL); - - NS_IMETHOD CallStaticMethod(/*[in]*/ jni_type ret_type, - /*[in]*/ jclass clazz, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx = NULL); - - NS_IMETHOD GetStaticField(/*[in]*/ jni_type field_type, - /*[in]*/ jclass clazz, - /*[in]*/ jfieldID fieldID, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx = NULL); - - NS_IMETHOD SetStaticField(/*[in]*/ jni_type field_type, - /*[in]*/ jclass clazz, - /*[in]*/ jfieldID fieldID, - /*[in]*/ jvalue val, - /*[in]*/ nsISecurityContext* ctx = NULL); - - NS_IMETHOD GetVersion(/*[out]*/ jint* version); - - NS_IMETHOD DefineClass(/*[in]*/ const char* name, - /*[in]*/ jobject loader, - /*[in]*/ const jbyte *buf, - /*[in]*/ jsize len, - /*[out]*/ jclass* clazz); - - NS_IMETHOD FindClass(/*[in]*/ const char* name, - /*[out]*/ jclass* clazz); - - NS_IMETHOD GetSuperclass(/*[in]*/ jclass sub, - /*[out]*/ jclass* super); - - NS_IMETHOD IsAssignableFrom(/*[in]*/ jclass sub, - /*[in]*/ jclass super, - /*[out]*/ jboolean* result); - - NS_IMETHOD Throw(/*[in]*/ jthrowable obj, - /*[out]*/ jint* result); - - NS_IMETHOD ThrowNew(/*[in]*/ jclass clazz, - /*[in]*/ const char *msg, - /*[out]*/ jint* result); - - NS_IMETHOD ExceptionOccurred(/*[out]*/ jthrowable* result); - - NS_IMETHOD ExceptionDescribe(void); - - NS_IMETHOD ExceptionClear(void); - - NS_IMETHOD FatalError(/*[in]*/ const char* msg); - - NS_IMETHOD NewGlobalRef(/*[in]*/ jobject lobj, - /*[out]*/ jobject* result); - - NS_IMETHOD DeleteGlobalRef(/*[in]*/ jobject gref); - - NS_IMETHOD DeleteLocalRef(/*[in]*/ jobject obj); - - NS_IMETHOD IsSameObject(/*[in]*/ jobject obj1, - /*[in]*/ jobject obj2, - /*[out]*/ jboolean* result); - - NS_IMETHOD AllocObject(/*[in]*/ jclass clazz, - /*[out]*/ jobject* result); - - NS_IMETHOD GetObjectClass(/*[in]*/ jobject obj, - /*[out]*/ jclass* result); - - NS_IMETHOD IsInstanceOf(/*[in]*/ jobject obj, - /*[in]*/ jclass clazz, - /*[out]*/ jboolean* result); - - NS_IMETHOD GetMethodID(/*[in]*/ jclass clazz, - /*[in]*/ const char* name, - /*[in]*/ const char* sig, - /*[out]*/ jmethodID* id); - - NS_IMETHOD GetFieldID(/*[in]*/ jclass clazz, - /*[in]*/ const char* name, - /*[in]*/ const char* sig, - /*[out]*/ jfieldID* id); - - NS_IMETHOD GetStaticMethodID(/*[in]*/ jclass clazz, - /*[in]*/ const char* name, - /*[in]*/ const char* sig, - /*[out]*/ jmethodID* id); - - NS_IMETHOD GetStaticFieldID(/*[in]*/ jclass clazz, - /*[in]*/ const char* name, - /*[in]*/ const char* sig, - /*[out]*/ jfieldID* id); - - NS_IMETHOD NewString(/*[in]*/ const jchar* unicode, - /*[in]*/ jsize len, - /*[out]*/ jstring* result); - - NS_IMETHOD GetStringLength(/*[in]*/ jstring str, - /*[out]*/ jsize* result); - - NS_IMETHOD GetStringChars(/*[in]*/ jstring str, - /*[in]*/ jboolean *isCopy, - /*[out]*/ const jchar** result); - - NS_IMETHOD ReleaseStringChars(/*[in]*/ jstring str, - /*[in]*/ const jchar *chars); - - NS_IMETHOD NewStringUTF(/*[in]*/ const char *utf, - /*[out]*/ jstring* result); - - NS_IMETHOD GetStringUTFLength(/*[in]*/ jstring str, - /*[out]*/ jsize* result); - - NS_IMETHOD GetStringUTFChars(/*[in]*/ jstring str, - /*[in]*/ jboolean *isCopy, - /*[out]*/ const char** result); - - NS_IMETHOD ReleaseStringUTFChars(/*[in]*/ jstring str, - /*[in]*/ const char *chars); - - NS_IMETHOD GetArrayLength(/*[in]*/ jarray array, - /*[out]*/ jsize* result); - - NS_IMETHOD GetObjectArrayElement(/*[in]*/ jobjectArray array, - /*[in]*/ jsize index, - /*[out]*/ jobject* result); - - NS_IMETHOD SetObjectArrayElement(/*[in]*/ jobjectArray array, - /*[in]*/ jsize index, - /*[in]*/ jobject val); - - NS_IMETHOD NewObjectArray(/*[in]*/ jsize len, - /*[in]*/ jclass clazz, - /*[in]*/ jobject init, - /*[out]*/ jobjectArray* result); - - NS_IMETHOD NewArray(/*[in]*/ jni_type element_type, - /*[in]*/ jsize len, - /*[out]*/ jarray* result); - - NS_IMETHOD GetArrayElements(/*[in]*/ jni_type element_type, - /*[in]*/ jarray array, - /*[in]*/ jboolean *isCopy, - /*[out]*/ void* result); - - NS_IMETHOD ReleaseArrayElements(/*[in]*/ jni_type element_type, - /*[in]*/ jarray array, - /*[in]*/ void *elems, - /*[in]*/ jint mode); - - NS_IMETHOD GetArrayRegion(/*[in]*/ jni_type element_type, - /*[in]*/ jarray array, - /*[in]*/ jsize start, - /*[in]*/ jsize len, - /*[out]*/ void* buf); - - NS_IMETHOD SetArrayRegion(/*[in]*/ jni_type element_type, - /*[in]*/ jarray array, - /*[in]*/ jsize start, - /*[in]*/ jsize len, - /*[in]*/ void* buf); - - NS_IMETHOD RegisterNatives(/*[in]*/ jclass clazz, - /*[in]*/ const JNINativeMethod *methods, - /*[in]*/ jint nMethods, - /*[out]*/ jint* result); - - NS_IMETHOD UnregisterNatives(/*[in]*/ jclass clazz, - /*[out]*/ jint* result); - - NS_IMETHOD MonitorEnter(/*[in]*/ jobject obj, - /*[out]*/ jint* result); - - NS_IMETHOD MonitorExit(/*[in]*/ jobject obj, - /*[out]*/ jint* result); - - NS_IMETHOD GetJavaVM(/*[in]*/ JavaVM **vm, - /*[out]*/ jint* result); - - nsWFSecureEnv(nsPluggableJVM* jvm); - virtual ~nsWFSecureEnv(void); - protected: - nsPluggableJVM* m_jvm; - // as for now all LiveConnect calls comes from the main thread, - // it's correct to use one JNI env and cache it here. - // if LiveConnect will be truly mutlithreaded - it should be rewritten - JNIEnv* m_env; - JVMP_RuntimeContext* m_rtctx; - JVMP_CallingContext* m_ctx; -}; - -#endif //ifndef __nsWFSecureEnv_h diff --git a/mozilla/java/waterfall/wf_moz6/src/nsWFSecurityContext.cpp b/mozilla/java/waterfall/wf_moz6/src/nsWFSecurityContext.cpp deleted file mode 100644 index 273c591bd44..00000000000 --- a/mozilla/java/waterfall/wf_moz6/src/nsWFSecurityContext.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsWFSecurityContext.cpp,v 1.1.1.1 2001-05-09 18:51:36 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#include "nsWFSecurityContext.h" -#include "plstr.h" -#include "nsCRT.h" - -NS_DEFINE_IID(kISecurityContextIID, NS_ISECURITYCONTEXT_IID); -NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - -//////////////////////////////////////////////////////////////////////////// -// from nsISupports and AggregatedQueryInterface: - -// Thes macro expands to the aggregated query interface scheme. - -NS_IMPL_AGGREGATED(nsWFSecurityContext); - -NS_METHOD -nsWFSecurityContext::AggregatedQueryInterface(const nsIID& aIID, - void** aInstancePtr) -{ - if (aIID.Equals(kISupportsIID)) { - *aInstancePtr = GetInner(); - AddRef(); - return NS_OK; - } - if (aIID.Equals(kISecurityContextIID)) { - *aInstancePtr = (nsISecurityContext *)this; - AddRef(); - return NS_OK; - } - return NS_NOINTERFACE; -} - - - -nsWFSecurityContext::nsWFSecurityContext(nsISupports *aOuter, - nsPluggableJVM* pIJavaVM, - jobject ctx, - const char* url): - m_jvm(pIJavaVM), context(NULL), m_url(NULL), m_olen(0) -{ - NS_INIT_AGGREGATED(aOuter); - - JNIEnv* env = nsnull; - m_jvm->GetJNIEnv(&env); - if (env) context = env->NewGlobalRef(ctx); - if (url) { - m_url = nsCRT::strdup(url); - char* s = m_url; - int slashes=0; - - while(s && *s) - { - if (*s++ == '/') slashes++; - if (slashes == 3) break; - m_olen++; - } - } - //fprintf(stderr, "url=%s\n", url); -} - - - -nsWFSecurityContext::~nsWFSecurityContext() -{ - JNIEnv* env = nsnull; - m_jvm->GetJNIEnv(&env); - - if (env && context) - env->DeleteGlobalRef(context); - if (m_url) nsCRT::free(m_url); -} - - -NS_METHOD -nsWFSecurityContext::Create(nsISupports* outer, - nsPluggableJVM* pIJavaVM, - jobject ctx, - const char* url, - const nsIID& aIID, - void* *aInstancePtr) -{ - if (outer && !aIID.Equals(kISupportsIID)) - return NS_NOINTERFACE; - nsWFSecurityContext* context = - new nsWFSecurityContext(outer, pIJavaVM, ctx, url); - if (context == NULL) - return NS_ERROR_OUT_OF_MEMORY; - context->AddRef(); - *aInstancePtr = context->GetInner(); - *aInstancePtr = (outer != NULL) ? - (void *)context->GetInner(): (void *)context; - return NS_OK; -} - -// XXX: not the best implementation, but this method never got called AFAIK, -// maybe beside LiveConnect with signed scripts, but it's not implemented -// anyway. -NS_IMETHODIMP -nsWFSecurityContext::Implies(const char* target, - const char* action, - PRBool* bActionAllowed) -{ - OJI_LOG3("nsWFSecurityContext::Implies: %s %s",target, action); - if (target == NULL || bActionAllowed == NULL) - return NS_ERROR_NULL_POINTER; - *bActionAllowed = PR_FALSE; - return NS_OK; -} - - -NS_IMETHODIMP -nsWFSecurityContext::GetOrigin(char* buf, int len) -{ - int total = m_olen > len ? len : m_olen; - nsCRT::memcpy(buf, m_url, total); - buf[total] = '\0'; - return NS_OK; -} - -NS_IMETHODIMP -nsWFSecurityContext::GetCertificateID(char* buf, int len) -{ - //::PL_strncpy(buf, "", len); - buf[0] = 0; - return NS_OK; -} - diff --git a/mozilla/java/waterfall/wf_moz6/src/nsWFSecurityContext.h b/mozilla/java/waterfall/wf_moz6/src/nsWFSecurityContext.h deleted file mode 100644 index b56a2231802..00000000000 --- a/mozilla/java/waterfall/wf_moz6/src/nsWFSecurityContext.h +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: nsWFSecurityContext.h,v 1.1.1.1 2001-05-09 18:51:36 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef nsWFSecurityContext_h___ -#define nsWFSecurityContext_h___ - -#include "nsPluggableJVM.h" -#include "nsISecurityContext.h" -#include "nsAgg.h" - -class nsWFSecurityContext : public nsISecurityContext -{ -public: - - // from nsISupports and AggregatedQueryInterface: - - NS_DECL_AGGREGATED - - static NS_METHOD Create(nsISupports* outer, - nsPluggableJVM* pIJavaVM, - jobject ctx, - const char* url, - const nsIID& aIID, - void* *aInstancePtr); - - NS_IMETHOD Implies(const char* target, - const char* action, - PRBool* bActionAllowed); - - NS_IMETHOD GetOrigin(char* buf, int len); - - NS_IMETHOD GetCertificateID(char* buf, int len); - - - nsWFSecurityContext(nsISupports *aOuter, - nsPluggableJVM* pIJavaVM, - jobject ctx, - const char* url); - virtual ~nsWFSecurityContext(void); - -protected: - nsPluggableJVM* m_jvm; - jobject context; - char* m_url; - int m_olen; -}; - -#endif diff --git a/mozilla/java/waterfall/wf_moz6/src/wf_moz6_common.h b/mozilla/java/waterfall/wf_moz6/src/wf_moz6_common.h deleted file mode 100644 index 1b15a4a730d..00000000000 --- a/mozilla/java/waterfall/wf_moz6/src/wf_moz6_common.h +++ /dev/null @@ -1,274 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is The Waterfall Java Plugin Module - * - * The Initial Developer of the Original Code is Sun Microsystems Inc - * Portions created by Sun Microsystems Inc are Copyright (C) 2001 - * All Rights Reserved. - * - * $Id: wf_moz6_common.h,v 1.1.1.1 2001-05-09 18:51:36 edburns%acm.org Exp $ - * - * - * Contributor(s): - * - * Nikolay N. Igotti - */ - -#ifndef __wf_moz6_common_h -#define __wf_moz6_common_h -/** Ideology behind this file: - * To keep generic binary compatibility, and be independent from Mozilla - * build system for Mozilla extension (not very good idea, but currently - * it's more convinient) we need some kind of fixed API/ABI between - * extension and Java service in browser. This file is _only_ (beside - * jvmp.h) common header between Java component and extension. It's written - * in pure C and has no Mozilla dependencies. So JVM service in browser fills - * propers callbacks and the extension, if wishes to perform some call to - * Mozilla uses those callbacks (and maybe even in another direction, but - * it's not recommened - use JVMP_Direct*Call for such purposes). - * Here described structures for - * - common browser configuration callbacks (show status, show document, - * get proxy config, add anything you want) - * - LiveConnect calls and security - * JavaObjectWrapper is wrapper for java-driven objects on browser side, - * usually lifetime coincides with lifetime of web page. - * If underlying native object is dead, proper field is 1. - * SecurityContextWrapper is wrapper for security context is - * LiveConnect calls, lifetime coincide with lifetime - * of LiveConnect call. - * BrowserSupportWrapper is wrapper for global JVM service object, - * exist always until JVM service is loaded, can be - * used for global operations not related to browser - * NB: If any other browser will implement those callbacks and be kind enough - * to follow Mozilla protocol in inline plugin handling, it will have - * Java + applets + LiveConnect for free. For example MSIE code can be written - * in such a manner. - **/ - -struct SecurityContextWrapper { - void* info; - int (*Implies) (void* handle, const char* target, - const char* action, int *bAllowedAccess); - int (*GetOrigin)(void* handle, char *buffer, int len); - int (*GetCertificateID)(void* handle, char *buffer, int len); - int dead; -}; -typedef struct SecurityContextWrapper SecurityContextWrapper; -struct JavaObjectWrapper; -typedef struct JavaObjectWrapper JavaObjectWrapper; - -#define WF_APPLETPEER_CID "@sun.com/wf/mozilla/appletpeer;1" - -enum JSCallType { // Possible JS call type - JS_Unknown = 0, - JS_GetWindow = 1, - JS_ToString, - JS_Eval, - JS_Call, - JS_GetMember, - JS_SetMember, - JS_RemoveMember, - JS_GetSlot, - JS_SetSlot, - JS_Finalize - }; - -struct JSObject_CallInfo -{ - const char* pszUrl; // URL of the CodeSource object in the Java call - jobjectArray jCertArray; // Certificate array of the CodeSource object - jintArray jCertLengthArray; // Certificate length array of the CodeSource object - int iNumOfCerts; // Number of certificates in the cert and cert length array - jobject jAccessControlContext; // AccessControlContext object that represents the Java callstack - enum JSCallType type; // Type of JSObject call - jthrowable jException; // Java exception object as the result of the call - JavaObjectWrapper* pWrapper; // native-Java glueing object - union { - struct __GetWindow { - void* pPlugin; // Plug-in instance corresponded to the JSObject call - jint iNativeJSObject; // Native JS object as the result of the GetWindow call - } __getWindow; - struct __Finalize { - jint iNativeJSObject; // Native JS object that needs to be finalized - } __finalize; - struct __ToString { - jint iNativeJSObject; // Native JS object that corresponded to the JSObject.toString - jstring jResult; // Result of JSObject.toString - } __toString; - struct __Call { - const jchar* pszMethodName; // Method name - int iMethodNameLen; // Length of method name - jobjectArray jArgs; // Argument for the JSObject.Call - jint iNativeJSObject; // Native JS object corresponded to the JSObject.call - jobject jResult; // Result of JSObject.call - } __call; - struct __Eval { - const jchar* pszEval; // String to be evaluated - int iEvalLen; // Length of the evaluatation string - jint iNativeJSObject; // Native JS object corresponded to the JSObject.eval - jobject jResult; // Result of JSObject.eval - } __eval; - struct __GetMember { - const jchar* pszName; // Member name - int iNameLen; // Length of member name - jint iNativeJSObject; // Native JS object corresponded to the JSObject.getMember - jobject jResult; // Result of JSObject.getMember - } __getMember; - struct __SetMember { - const jchar* pszName; // Member name - int iNameLen; // Length of member name - jint iNativeJSObject; // Native JS object corresponded to the JSObject.setMember - jobject jValue; // Result of JSObject.setMember - } __setMember; - struct __RemoveMember { - const jchar* pszName; // Member name - int iNameLen; // Length of member name - jint iNativeJSObject; // Native JS object corresponded to the JSObject.removeMember - } __removeMember; - struct __GetSlot { - int iIndex; // Slot number - jint iNativeJSObject; // Native JS object corresponded to the JSObject.getSlot - jobject jResult; // Result of JSObject.getSlot - } __getSlot; - struct __SetSlot { - int iIndex; // Slot number - jobject jValue; // Value to set in the slot - jint iNativeJSObject; // Native JS object corresponded to the JSObject.setSlot - } __setSlot; - } data; -}; - -enum JavaCallType { - Java_Unknown = 0, - Java_WrapJSObject, - Java_CreateObject, - Java_CallMethod, - Java_CallStaticMethod, - Java_CallNonvirtualMethod, - Java_SetField, - Java_SetStaticField, - Java_GetField, - Java_GetStaticField, - Java_UnwrapJObject -}; - -/* just a copy of enum jni_type from nsISecureEnv, as I have to get - it from somewhere - values are the same, so can convert flawlessly */ -enum jvmp_jni_type -{ - jvmp_jobject_type = 0, - jvmp_jboolean_type, - jvmp_jbyte_type, - jvmp_jchar_type, - jvmp_jshort_type, - jvmp_jint_type, - jvmp_jlong_type, - jvmp_jfloat_type, - jvmp_jdouble_type, - jvmp_jvoid_type -}; - -struct Java_CallInfo -{ - enum JavaCallType type; - jthrowable jException; - SecurityContextWrapper* security; - union { - struct __WrapJSObject { - jint jsObject; - jint jstid; - jobject jObject ; - } __wrapJSObject; - struct __CreateObject { - jclass clazz; - jmethodID methodID; - jvalue *args; - jobject result; - } __createObject; - struct __CallMethod { - enum jvmp_jni_type type; - jobject obj; - jmethodID methodID; - jvalue *args; - jvalue result; - } __callMethod; - struct __CallStaticMethod { - enum jvmp_jni_type type; - jclass clazz; - jmethodID methodID; - jvalue *args; - jvalue result; - } __callStaticMethod; - struct __CallNonvirtualMethod { - enum jvmp_jni_type type; - jobject obj; - jclass clazz; - jmethodID methodID; - jvalue *args; - jvalue result; - } __callNonvirtualMethod; - struct __GetField { - enum jvmp_jni_type type; - jobject obj; - jfieldID fieldID; - jvalue result; - } __getField; - struct __GetStaticField { - enum jvmp_jni_type type; - jclass clazz; - jfieldID fieldID; - jvalue result; - } __getStaticField; - struct __SetField { - enum jvmp_jni_type type; - jobject obj; - jfieldID fieldID; - jvalue value; - } __setField; - struct __SetStaticField { - enum jvmp_jni_type type; - jclass clazz; - jfieldID fieldID; - jvalue value; - } __setStaticField; - struct __UnwrapJObject { - jobject jObject; - jint jstid; - jint jsObject ; - } __unwrapJObject; - } data; -}; - - -struct JavaObjectWrapper -{ - void* info; - void* plugin; - int (*GetParameters)(void* handle, char ***keys, - char ***values, int *count); - int (*ShowDocument)(void* handle, char* url, char* target); - int (*ShowStatus)(void* handle, char* status); - int (*GetJSThread)(void* handle, jint* jstid); - int dead; -}; - -struct BrowserSupportWrapper -{ - void* info; - int (*GetProxyForURL)(void* handle, char* url, char** proxy); - int (*JSCall)(void* handle, jint jstid, - struct JSObject_CallInfo** jscall); -}; -typedef struct BrowserSupportWrapper BrowserSupportWrapper; - -#endif