From 213fe95837c25543304400505ee5053f97de3bfc Mon Sep 17 00:00:00 2001 From: "seawood%netscape.com" Date: Wed, 11 Jun 2003 03:02:22 +0000 Subject: [PATCH] Removing old cfm build files. Use the CFM_LAST_RITES tag to resurrect. r=macdev --- .../MRJ/documentation/build-instructions.html | 96 - plugin/oji/MRJ/plugin/MRJPlugin.jar | Bin 30755 -> 0 bytes plugin/oji/MRJ/plugin/MRJPlugin.xml | 6906 ----------------- plugin/oji/MRJ/plugin/Resources/Dialogs.rsrc | Bin 1186 -> 0 bytes plugin/oji/MRJ/plugin/Resources/Strings.rsrc | Bin 1338 -> 0 bytes plugin/oji/MRJ/plugin/Resources/Version.rsrc | Bin 883 -> 0 bytes plugin/oji/MRJ/plugin/Source/AWTUtils.java | 74 - .../MRJ/plugin/Source/AltWindowHandling.cpp | 296 - .../oji/MRJ/plugin/Source/AltWindowHandling.h | 65 - plugin/oji/MRJ/plugin/Source/AsyncMessage.h | 58 - .../oji/MRJ/plugin/Source/BackwardAdapter.cpp | 2554 ------ plugin/oji/MRJ/plugin/Source/CSecureEnv.cpp | 1976 ----- plugin/oji/MRJ/plugin/Source/CSecureEnv.h | 409 - .../oji/MRJ/plugin/Source/EmbeddedFrame.cpp | 331 - plugin/oji/MRJ/plugin/Source/EmbeddedFrame.h | 87 - .../Source/EmbeddedFramePluginInstance.cpp | 126 - .../Source/EmbeddedFramePluginInstance.h | 196 - plugin/oji/MRJ/plugin/Source/EventFilter.cpp | 175 - plugin/oji/MRJ/plugin/Source/EventFilter.h | 56 - plugin/oji/MRJ/plugin/Source/JMURLConnection | Bin 789 -> 0 bytes .../oji/MRJ/plugin/Source/JMURLConnection.exp | 1 - .../oji/MRJ/plugin/Source/JMURLConnection.h | 262 - plugin/oji/MRJ/plugin/Source/JNIThread.java | 59 - plugin/oji/MRJ/plugin/Source/JNIUtils.java | 80 - plugin/oji/MRJ/plugin/Source/JSEvaluator.cpp | 130 - plugin/oji/MRJ/plugin/Source/JSEvaluator.h | 131 - .../oji/MRJ/plugin/Source/JavaMessageQueue.h | 82 - .../Source/LiveConnectNativeMethods.cpp | 1017 --- .../plugin/Source/LiveConnectNativeMethods.h | 53 - plugin/oji/MRJ/plugin/Source/LocalPort.h | 72 - plugin/oji/MRJ/plugin/Source/MRJConsole.cpp | 396 - plugin/oji/MRJ/plugin/Source/MRJConsole.h | 128 - plugin/oji/MRJ/plugin/Source/MRJConsole.java | 241 - plugin/oji/MRJ/plugin/Source/MRJContext.cp | 1729 ----- plugin/oji/MRJ/plugin/Source/MRJContext.h | 168 - plugin/oji/MRJ/plugin/Source/MRJFrame.cpp | 223 - plugin/oji/MRJ/plugin/Source/MRJFrame.h | 95 - plugin/oji/MRJ/plugin/Source/MRJMonitor.cpp | 138 - plugin/oji/MRJ/plugin/Source/MRJMonitor.h | 75 - .../oji/MRJ/plugin/Source/MRJNetworking.cpp | 417 - plugin/oji/MRJ/plugin/Source/MRJNetworking.h | 52 - plugin/oji/MRJ/plugin/Source/MRJPage.cpp | 153 - plugin/oji/MRJ/plugin/Source/MRJPage.h | 106 - plugin/oji/MRJ/plugin/Source/MRJPlugin.cpp | 941 --- plugin/oji/MRJ/plugin/Source/MRJPlugin.h | 491 -- plugin/oji/MRJ/plugin/Source/MRJPlugin.java | 49 - .../MRJ/plugin/Source/MRJPlugin_4.x_config.h | 48 - .../MRJ/plugin/Source/MRJPlugin_GC_config.h | 47 - .../oji/MRJ/plugin/Source/MRJPlugin_config.h | 47 - .../MRJ/plugin/Source/MRJSecurityContext.h | 59 - plugin/oji/MRJ/plugin/Source/MRJSession.cpp | 541 -- plugin/oji/MRJ/plugin/Source/MRJSession.h | 120 - plugin/oji/MRJ/plugin/Source/Monitor.h | 58 - .../oji/MRJ/plugin/Source/NativeMonitor.cpp | 106 - plugin/oji/MRJ/plugin/Source/NativeMonitor.h | 67 - plugin/oji/MRJ/plugin/Source/PluginNew.cpp | 67 - .../oji/MRJ/plugin/Source/PrintingPort.java | 164 - .../oji/MRJ/plugin/Source/RunnableMixin.cpp | 19 - plugin/oji/MRJ/plugin/Source/RunnableMixin.h | 26 - plugin/oji/MRJ/plugin/Source/StringUtils.cpp | 86 - plugin/oji/MRJ/plugin/Source/StringUtils.h | 53 - .../oji/MRJ/plugin/Source/SupportsMixin.cpp | 167 - plugin/oji/MRJ/plugin/Source/SupportsMixin.h | 121 - .../oji/MRJ/plugin/Source/TopLevelFrame.cpp | 304 - plugin/oji/MRJ/plugin/Source/TopLevelFrame.h | 81 - plugin/oji/MRJ/plugin/Source/jGNE.cpp | 151 - plugin/oji/MRJ/plugin/Source/jGNE.h | 55 - plugin/oji/MRJ/plugin/Source/npmac.cpp | 708 -- .../oji/MRJ/plugin/Source/nsLiveConnect.cpp | 150 - plugin/oji/MRJ/plugin/Source/nsLiveConnect.h | 270 - plugin/oji/MRJ/plugin/netscape.plugin.jar | Bin 1003 -> 0 bytes .../MRJ/testing/ConsoleApplet/Console.java | 118 - .../testing/ConsoleApplet/ConsoleApplet.html | 19 - .../testing/ConsoleApplet/ConsoleApplet.java | 100 - .../testing/ConsoleApplet/ConsoleApplet.mcp | Bin 38451 -> 0 bytes .../testing/ConsoleApplet/LaunchConsole.html | 14 - plugin/oji/MRJ/testing/ConsoleApplet/README | 2 - plugin/oji/MRJ/testing/Embedding/README | 1 - plugin/oji/MRJ/testing/Embedding/Test.html | 41 - plugin/oji/MRJ/testing/JSApplet/JSApplet.html | 18 - plugin/oji/MRJ/testing/JSApplet/JSApplet.java | 95 - plugin/oji/MRJ/testing/JSApplet/JSApplet.mcp | Bin 38581 -> 0 bytes plugin/oji/MRJ/testing/LiveConnect/Test.html | 35 - .../MRJ/testing/SwingApplet/TestApplet.java | 32 - .../MRJ/testing/SwingApplet/TestApplet.mcp | Bin 37180 -> 0 bytes .../MRJ/testing/SwingApplet/TestFrame.java | 27 - .../MRJ/testing/SwingApplet/TestPanel.java | 16 - .../oji/MRJ/testing/SwingApplet/mactest.html | 12 - .../MRJ/testing/TrivialApplet/MyApplet.mcp | Bin 36100 -> 0 bytes .../testing/TrivialApplet/TrivialApplet.html | 70 - .../testing/TrivialApplet/TrivialApplet.java | 207 - .../testing/TrivialApplet/TrivialApplets.html | 77 - .../JavaFrameworks/JavaEmbedding/JavaApplet.h | 393 - .../JavaEmbedding/JavaControl.h | 461 -- .../MRJSDK/JavaFrameworks/JavaEmbeddingLib | Bin 1648 -> 0 bytes .../MRJSDK/JavaFrameworks/JavaVM/jni.h | 1949 ----- .../MRJSDK/JavaFrameworks/JavaVM/jni_md.h | 22 - plugin/oji/MRJCarbon/plugin/CHANGES | 108 - .../plugin/English.lproj/InfoPlist.strings | Bin 592 -> 0 bytes plugin/oji/MRJCarbon/plugin/INSTALL.txt | 7 - plugin/oji/MRJCarbon/plugin/MRJPlugin.jar | Bin 21050 -> 0 bytes .../plugin/MRJPlugin.pbproj/project.pbxproj | 773 -- plugin/oji/MRJCarbon/plugin/MRJPlugin.policy | 4 - .../oji/MRJCarbon/plugin/MRJPlugin.properties | 4 - .../MRJCarbon/plugin/MRJPluginCarbon.plist | 28 - .../oji/MRJCarbon/plugin/MRJPluginCarbon.xml | 2391 ------ .../MRJCarbon/plugin/Resources/Dialogs.rsrc | Bin 1156 -> 0 bytes .../oji/MRJCarbon/plugin/Resources/Makefile | 15 - .../MRJCarbon/plugin/Resources/Strings.rsrc | Bin 1622 -> 0 bytes .../MRJCarbon/plugin/Resources/Version.rsrc | Bin 762 -> 0 bytes .../oji/MRJCarbon/plugin/Source/AWTUtils.java | 74 - .../MRJCarbon/plugin/Source/AsyncMessage.h | 58 - .../MRJCarbon/plugin/Source/CSecureEnv.cpp | 3148 -------- .../oji/MRJCarbon/plugin/Source/CSecureEnv.h | 429 - .../MRJCarbon/plugin/Source/EmbeddedFrame.cpp | 331 - .../MRJCarbon/plugin/Source/EmbeddedFrame.h | 87 - .../Source/EmbeddedFramePluginInstance.cpp | 126 - .../Source/EmbeddedFramePluginInstance.h | 196 - .../MRJCarbon/plugin/Source/EventFilter.cpp | 174 - .../oji/MRJCarbon/plugin/Source/EventFilter.h | 55 - .../MRJCarbon/plugin/Source/JNIThread.java | 69 - .../oji/MRJCarbon/plugin/Source/JNIUtils.java | 80 - .../MRJCarbon/plugin/Source/JSEvaluator.cpp | 130 - .../oji/MRJCarbon/plugin/Source/JSEvaluator.h | 131 - .../plugin/Source/JavaMessageQueue.h | 82 - .../plugin/Source/JavaVMFramework.cpp | 118 - .../Source/LiveConnectNativeMethods.cpp | 1007 --- .../plugin/Source/LiveConnectNativeMethods.h | 53 - .../plugin/Source/LiveConnectProxy.java | 50 - .../oji/MRJCarbon/plugin/Source/LocalPort.h | 72 - .../MRJCarbon/plugin/Source/MRJConsole.cpp | 419 - .../oji/MRJCarbon/plugin/Source/MRJConsole.h | 126 - .../MRJCarbon/plugin/Source/MRJConsole.java | 241 - .../oji/MRJCarbon/plugin/Source/MRJContext.cp | 2006 ----- .../oji/MRJCarbon/plugin/Source/MRJContext.h | 192 - .../oji/MRJCarbon/plugin/Source/MRJFrame.cpp | 223 - plugin/oji/MRJCarbon/plugin/Source/MRJFrame.h | 95 - .../MRJCarbon/plugin/Source/MRJMonitor.cpp | 138 - .../oji/MRJCarbon/plugin/Source/MRJMonitor.h | 75 - .../oji/MRJCarbon/plugin/Source/MRJPage.cpp | 161 - plugin/oji/MRJCarbon/plugin/Source/MRJPage.h | 87 - .../oji/MRJCarbon/plugin/Source/MRJPlugin.cpp | 969 --- .../oji/MRJCarbon/plugin/Source/MRJPlugin.h | 483 -- .../plugin/Source/MRJPluginCarbon_config.h | 48 - .../plugin/Source/MRJPlugin_4.x_config.h | 48 - .../plugin/Source/MRJPlugin_GC_config.h | 47 - .../plugin/Source/MRJPlugin_config.h | 47 - .../plugin/Source/MRJSecurityContext.h | 59 - .../MRJCarbon/plugin/Source/MRJSession.cpp | 543 -- .../oji/MRJCarbon/plugin/Source/MRJSession.h | 132 - .../MRJCarbon/plugin/Source/MRJSession.java | 112 - plugin/oji/MRJCarbon/plugin/Source/Monitor.h | 58 - .../MRJCarbon/plugin/Source/NativeMonitor.cpp | 106 - .../MRJCarbon/plugin/Source/NativeMonitor.h | 67 - .../oji/MRJCarbon/plugin/Source/PluginNew.cpp | 79 - .../MRJCarbon/plugin/Source/PrintingPort.java | 164 - .../Source/ProxyClassLoaderFactory.java | 119 - .../MRJCarbon/plugin/Source/RunnableMixin.cpp | 55 - .../MRJCarbon/plugin/Source/RunnableMixin.h | 64 - .../MRJCarbon/plugin/Source/StringUtils.cpp | 86 - .../oji/MRJCarbon/plugin/Source/StringUtils.h | 53 - .../MRJCarbon/plugin/Source/SupportsMixin.cpp | 171 - .../MRJCarbon/plugin/Source/SupportsMixin.h | 123 - .../MRJCarbon/plugin/Source/TimedMessage.h | 56 - .../MRJCarbon/plugin/Source/TopLevelFrame.cpp | 304 - .../MRJCarbon/plugin/Source/TopLevelFrame.h | 81 - plugin/oji/MRJCarbon/plugin/Source/jGNE.cpp | 150 - plugin/oji/MRJCarbon/plugin/Source/jGNE.h | 54 - 168 files changed, 45759 deletions(-) delete mode 100644 plugin/oji/MRJ/documentation/build-instructions.html delete mode 100644 plugin/oji/MRJ/plugin/MRJPlugin.jar delete mode 100644 plugin/oji/MRJ/plugin/MRJPlugin.xml delete mode 100755 plugin/oji/MRJ/plugin/Resources/Dialogs.rsrc delete mode 100644 plugin/oji/MRJ/plugin/Resources/Strings.rsrc delete mode 100644 plugin/oji/MRJ/plugin/Resources/Version.rsrc delete mode 100644 plugin/oji/MRJ/plugin/Source/AWTUtils.java delete mode 100644 plugin/oji/MRJ/plugin/Source/AltWindowHandling.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/AltWindowHandling.h delete mode 100644 plugin/oji/MRJ/plugin/Source/AsyncMessage.h delete mode 100644 plugin/oji/MRJ/plugin/Source/BackwardAdapter.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/CSecureEnv.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/CSecureEnv.h delete mode 100644 plugin/oji/MRJ/plugin/Source/EmbeddedFrame.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/EmbeddedFrame.h delete mode 100644 plugin/oji/MRJ/plugin/Source/EmbeddedFramePluginInstance.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/EmbeddedFramePluginInstance.h delete mode 100644 plugin/oji/MRJ/plugin/Source/EventFilter.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/EventFilter.h delete mode 100644 plugin/oji/MRJ/plugin/Source/JMURLConnection delete mode 100644 plugin/oji/MRJ/plugin/Source/JMURLConnection.exp delete mode 100644 plugin/oji/MRJ/plugin/Source/JMURLConnection.h delete mode 100644 plugin/oji/MRJ/plugin/Source/JNIThread.java delete mode 100644 plugin/oji/MRJ/plugin/Source/JNIUtils.java delete mode 100644 plugin/oji/MRJ/plugin/Source/JSEvaluator.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/JSEvaluator.h delete mode 100644 plugin/oji/MRJ/plugin/Source/JavaMessageQueue.h delete mode 100644 plugin/oji/MRJ/plugin/Source/LiveConnectNativeMethods.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/LiveConnectNativeMethods.h delete mode 100644 plugin/oji/MRJ/plugin/Source/LocalPort.h delete mode 100644 plugin/oji/MRJ/plugin/Source/MRJConsole.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/MRJConsole.h delete mode 100644 plugin/oji/MRJ/plugin/Source/MRJConsole.java delete mode 100644 plugin/oji/MRJ/plugin/Source/MRJContext.cp delete mode 100644 plugin/oji/MRJ/plugin/Source/MRJContext.h delete mode 100644 plugin/oji/MRJ/plugin/Source/MRJFrame.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/MRJFrame.h delete mode 100644 plugin/oji/MRJ/plugin/Source/MRJMonitor.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/MRJMonitor.h delete mode 100644 plugin/oji/MRJ/plugin/Source/MRJNetworking.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/MRJNetworking.h delete mode 100644 plugin/oji/MRJ/plugin/Source/MRJPage.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/MRJPage.h delete mode 100644 plugin/oji/MRJ/plugin/Source/MRJPlugin.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/MRJPlugin.h delete mode 100644 plugin/oji/MRJ/plugin/Source/MRJPlugin.java delete mode 100644 plugin/oji/MRJ/plugin/Source/MRJPlugin_4.x_config.h delete mode 100644 plugin/oji/MRJ/plugin/Source/MRJPlugin_GC_config.h delete mode 100644 plugin/oji/MRJ/plugin/Source/MRJPlugin_config.h delete mode 100644 plugin/oji/MRJ/plugin/Source/MRJSecurityContext.h delete mode 100644 plugin/oji/MRJ/plugin/Source/MRJSession.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/MRJSession.h delete mode 100644 plugin/oji/MRJ/plugin/Source/Monitor.h delete mode 100644 plugin/oji/MRJ/plugin/Source/NativeMonitor.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/NativeMonitor.h delete mode 100644 plugin/oji/MRJ/plugin/Source/PluginNew.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/PrintingPort.java delete mode 100644 plugin/oji/MRJ/plugin/Source/RunnableMixin.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/RunnableMixin.h delete mode 100644 plugin/oji/MRJ/plugin/Source/StringUtils.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/StringUtils.h delete mode 100644 plugin/oji/MRJ/plugin/Source/SupportsMixin.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/SupportsMixin.h delete mode 100644 plugin/oji/MRJ/plugin/Source/TopLevelFrame.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/TopLevelFrame.h delete mode 100644 plugin/oji/MRJ/plugin/Source/jGNE.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/jGNE.h delete mode 100644 plugin/oji/MRJ/plugin/Source/npmac.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/nsLiveConnect.cpp delete mode 100644 plugin/oji/MRJ/plugin/Source/nsLiveConnect.h delete mode 100644 plugin/oji/MRJ/plugin/netscape.plugin.jar delete mode 100644 plugin/oji/MRJ/testing/ConsoleApplet/Console.java delete mode 100644 plugin/oji/MRJ/testing/ConsoleApplet/ConsoleApplet.html delete mode 100644 plugin/oji/MRJ/testing/ConsoleApplet/ConsoleApplet.java delete mode 100644 plugin/oji/MRJ/testing/ConsoleApplet/ConsoleApplet.mcp delete mode 100644 plugin/oji/MRJ/testing/ConsoleApplet/LaunchConsole.html delete mode 100644 plugin/oji/MRJ/testing/ConsoleApplet/README delete mode 100644 plugin/oji/MRJ/testing/Embedding/README delete mode 100644 plugin/oji/MRJ/testing/Embedding/Test.html delete mode 100644 plugin/oji/MRJ/testing/JSApplet/JSApplet.html delete mode 100644 plugin/oji/MRJ/testing/JSApplet/JSApplet.java delete mode 100644 plugin/oji/MRJ/testing/JSApplet/JSApplet.mcp delete mode 100644 plugin/oji/MRJ/testing/LiveConnect/Test.html delete mode 100644 plugin/oji/MRJ/testing/SwingApplet/TestApplet.java delete mode 100644 plugin/oji/MRJ/testing/SwingApplet/TestApplet.mcp delete mode 100644 plugin/oji/MRJ/testing/SwingApplet/TestFrame.java delete mode 100644 plugin/oji/MRJ/testing/SwingApplet/TestPanel.java delete mode 100644 plugin/oji/MRJ/testing/SwingApplet/mactest.html delete mode 100644 plugin/oji/MRJ/testing/TrivialApplet/MyApplet.mcp delete mode 100644 plugin/oji/MRJ/testing/TrivialApplet/TrivialApplet.html delete mode 100644 plugin/oji/MRJ/testing/TrivialApplet/TrivialApplet.java delete mode 100644 plugin/oji/MRJ/testing/TrivialApplet/TrivialApplets.html delete mode 100644 plugin/oji/MRJCarbon/MRJSDK/JavaFrameworks/JavaEmbedding/JavaApplet.h delete mode 100644 plugin/oji/MRJCarbon/MRJSDK/JavaFrameworks/JavaEmbedding/JavaControl.h delete mode 100644 plugin/oji/MRJCarbon/MRJSDK/JavaFrameworks/JavaEmbeddingLib delete mode 100644 plugin/oji/MRJCarbon/MRJSDK/JavaFrameworks/JavaVM/jni.h delete mode 100644 plugin/oji/MRJCarbon/MRJSDK/JavaFrameworks/JavaVM/jni_md.h delete mode 100644 plugin/oji/MRJCarbon/plugin/CHANGES delete mode 100644 plugin/oji/MRJCarbon/plugin/English.lproj/InfoPlist.strings delete mode 100644 plugin/oji/MRJCarbon/plugin/INSTALL.txt delete mode 100644 plugin/oji/MRJCarbon/plugin/MRJPlugin.jar delete mode 100644 plugin/oji/MRJCarbon/plugin/MRJPlugin.pbproj/project.pbxproj delete mode 100644 plugin/oji/MRJCarbon/plugin/MRJPlugin.policy delete mode 100644 plugin/oji/MRJCarbon/plugin/MRJPlugin.properties delete mode 100644 plugin/oji/MRJCarbon/plugin/MRJPluginCarbon.plist delete mode 100644 plugin/oji/MRJCarbon/plugin/MRJPluginCarbon.xml delete mode 100644 plugin/oji/MRJCarbon/plugin/Resources/Dialogs.rsrc delete mode 100644 plugin/oji/MRJCarbon/plugin/Resources/Makefile delete mode 100644 plugin/oji/MRJCarbon/plugin/Resources/Strings.rsrc delete mode 100644 plugin/oji/MRJCarbon/plugin/Resources/Version.rsrc delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/AWTUtils.java delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/AsyncMessage.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/CSecureEnv.cpp delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/CSecureEnv.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/EmbeddedFrame.cpp delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/EmbeddedFrame.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/EmbeddedFramePluginInstance.cpp delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/EmbeddedFramePluginInstance.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/EventFilter.cpp delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/EventFilter.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/JNIThread.java delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/JNIUtils.java delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/JSEvaluator.cpp delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/JSEvaluator.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/JavaMessageQueue.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/JavaVMFramework.cpp delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/LiveConnectNativeMethods.cpp delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/LiveConnectNativeMethods.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/LiveConnectProxy.java delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/LocalPort.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/MRJConsole.cpp delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/MRJConsole.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/MRJConsole.java delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/MRJContext.cp delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/MRJContext.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/MRJFrame.cpp delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/MRJFrame.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/MRJMonitor.cpp delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/MRJMonitor.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/MRJPage.cpp delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/MRJPage.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/MRJPlugin.cpp delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/MRJPlugin.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/MRJPluginCarbon_config.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/MRJPlugin_4.x_config.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/MRJPlugin_GC_config.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/MRJPlugin_config.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/MRJSecurityContext.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/MRJSession.cpp delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/MRJSession.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/MRJSession.java delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/Monitor.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/NativeMonitor.cpp delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/NativeMonitor.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/PluginNew.cpp delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/PrintingPort.java delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/ProxyClassLoaderFactory.java delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/RunnableMixin.cpp delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/RunnableMixin.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/StringUtils.cpp delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/StringUtils.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/SupportsMixin.cpp delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/SupportsMixin.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/TimedMessage.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/TopLevelFrame.cpp delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/TopLevelFrame.h delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/jGNE.cpp delete mode 100644 plugin/oji/MRJCarbon/plugin/Source/jGNE.h diff --git a/plugin/oji/MRJ/documentation/build-instructions.html b/plugin/oji/MRJ/documentation/build-instructions.html deleted file mode 100644 index a171ea3752ca..000000000000 --- a/plugin/oji/MRJ/documentation/build-instructions.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - MRJ Plugin Build Instructions - - - -
-

-MRJ Plugin Build Instructions

- -
(as of 2.V.2000) -

-


- -
-

-In 6ish or 8ish Easy Steps

- -
(this requires the general mac build environment -as described on the Mozilla -Mac Build Page)
- -

-Mac build environment additions:

- -
    -
  1. -In order to keep with the myth that we "don't use ANYTHING relative to -CodeWarrior MPW", copy the StdCLib stubs library from MPW (in CodeWarrior -MPW:Interfaces&Libraries:Libraries:SharedLibraries) to Metrowerks -CodeWarrior:MacOS Support:Universal:Libraries:StubLibraries:
  2. - -
  3. -Now copy jni.h and jni_md.h from the latest MRJ -SDK (MRJ_SDK_2.2 or later) to Metrowerks CodeWarrior:MacOS Support:Universal:Interfaces:CIncludes:
  4. -
- -

-Importing the CW project file:

- -
    -
  1. -The current project file is stored as an importable XML file named MRJPlugin.xml, -so you can do one of the following:
  2. - -
      -
    1. -Run the AppleScript file called "MRJPlugin.import", and load the resultant -CW project file in CodeWarrior
    2. - -
    3. -Or: from CW file menu, choose "Import Project..." and select the XML file.
    4. -
    -
- -

-Building the plugin:

- -
    -
  1. -Build the MRJPlugin target - this should automatically first build -the BackwardAdaptot target. If it doesn't do this, do it by hand -by choosing the BackwardAdaptor target and building.
  2. - -
  3. -Build the project mozilla:js:macbuild:LiveConnectClasses.mcp, and -make an alias to the file liveconnect.jar in mozilla:plugin:oji:MRJ:plugin:; -if liveconnect.jar cannot be found in mozilla:js:macbuild: -after the build is successful, it can be found in mozilla:dist:liveconnect:
  4. - -
  5. -Build the project mozilla:plugin:oji:MRJ:testing:ConsoleApplet.mcp, -and make an alias to the file ConsoleApplet.jar in mozilla:plugin:oji:MRJ:plugin:.
  6. - -
  7. -Finally, build the MRJPlugin.jar target
  8. - -
  9. -To install the 5.X plugin, find the plugins folder for the debug; it should -be mozilla:dist:viewer_debug:Plugins:.   Drag both MRJInABox -and MRJPlugin.jar into this folder. To install the 4.X plugin, drag -both MRJPlugin and MRJPlugin.jar into your "Plug-ins" folder -located inside your Netscape Communicator folder.
  10. -
- -
Well that's it. You should now have a working build of the MRJ -plugin. -

-


-

If you have comments or suggestions, email beard@netscape.com

- - - diff --git a/plugin/oji/MRJ/plugin/MRJPlugin.jar b/plugin/oji/MRJ/plugin/MRJPlugin.jar deleted file mode 100644 index 60cc40a4c35ed425dd8236dcd0acb6d4c1882b33..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 30755 zcmd6wYjj-Kb>H^@1I%DJARZ({f&@vB1W9lJ0(?lM_>e>p1Sx&=!Jv}|0DNd~Tw5#@_eNPS0IUXUuq?IXC3q+UoSWL)xR= z6q5SDeM{MzMWi((tIA9QX_qJH1N~Pe3_J6U#&XxoHN>?hF)u6LH?M2?TWcQfks7|o zZ33y6mE4K;Cr>nU7gwA4zBK)i2UTR$ztH1Tnz34%&AYX-%3RmTYOXN|JR$33y+ljr z`~UjR_ILg!ETW(FBrMzBz}!AiW^O;u5LWwUO^wc)u+)ZRMV>|FET+esgmH;V9m}h1 z-6OK1jxLHVdnq}KVa0IjmRWn}Qd1$>-sxMRBUg079riC;=MfFdnwMIdxA2N@8&4KF zz}U51DmfXF)g_C+n6lnk(B+far-$RRM%IR;(JRTmh{(Daqq)c=rKh}V__)m{VNh|| zB<(tYn`sGDZT(A#MwRO+yJN|ewADPM4IQ$rqz#rvM0UiaQ?`d>rAxr_%eW+@9Uka4 z+7OCJcMQJUrJ0yb4li3%o|nP59-B#hW?V-$GhaJdi&Ro)Hs5Nwh73PwffQ727s1Ui`S-CXr;Rl>3$Fa2hd-g1&EIEV6#I%$Dt z*qj|EpGf$Dv<35a`pVi^%(27C5xFb%^RgwF>98-;)?x+sl1VEVg-!09m!4p*=X}+S zI@Jup1eH@ZlF!d6d%Zr_6%Hv~E5NBRFW zaw-%-Bu~-Qt znWhD0m0^AxV{oOFaTUKvz4GG}ku7zyRoT{xe5!CZm(D7di_12t)!eY1ntUOdE9go@ zLT!?r3{MG6TDyR?I9xd-b$P{xc7UsMbD8CEoAFN<)Ht(IhY1b}s_{L5!EB{P%3!Lr zlg#YbWu$PVi@PbF>6+P|cqp;)=JfFq|!E)$ac!<1cVABYpB70c5w$?=^w!-X#T&`rt$Y>-ARndKe5S|qT__C-lj z5}2y>O;5AHd?gf#X+w}6@G`?FN=lE&+L*M;8X7p6&d+A^sW`)0&m{J9qyFR-vfm+(U_uuWy4R#1BPUBk+ReL(xPld|{pb+0+`Dm-hE$<-3wN zRP&zHw$?m4RNETD;qJpn->?0lVFw)`JdvX^Ag4^(s_bkx zB`PXPAe_69G(D&@yJ2H{5Zh16K_Jgj>Z=OT%eHp1!=NbYDLcufxZ)f+6Q+!FFrx%* z(r3F2JBl;WRQHNN`w4?BqVfW{>@)qQut;$jBh6p!2|wQ0ZTVn1&1{c@G%U_|+Te^T zIZ(>wAXogST&~iJFELp>`m29+W+(7QKgwS#W%RM10K@!t8HQOu%KT(G~Y*CyQ)^DwG#H{(Yo;g%$th{c5 z4Kg~~3@ak)Ws|bSb~W)tl_>mfTLn^H*F~fwhH$18h#Aef!vR3WF-TM#JCBmVj;t%K zNLP{FI;`(;rooStLCHM;ZL69nsA``Iw9e`i>86EWrVMU0qLyoyg`= zS998HG}GT{{n_bk4n*^!yrdoTGIHD`&oBj={0UEh4oLTkysGIgGh5V}nNCipUuSx} z-#J*RNp5YP&*lq@Rrl^q4J)pv7mm9Xp(R&jVkutWrjAG|2GpnT z07(uqEa9g8?o(!V!&L_n_G7jxq{y@sqi~C1u<6!;+Y_nTLOPpaeurS%>pTT=WUeqW zbtW~F&D|Nu<+5m!C`^rRdB-h8q`*d9BFTvxcErz}Jf>5wV$YDqbms+K?KGmZ!u%{r z8xg8mbL(2VpiIIW40m45$xXB>AGBqu*q<_hLeI9xBEk4Zt^U@qoTvuGg9 z#a+QAGn1Ui=6kQEP*1d%&FV+#ol|oo-53IVCIU09LKc;-$=r>>%=tX+zzOjpENT)J z;Cvp*IYJzP%#d%{{W(T;c9q*U15Sn!LYio*m@=knjF5X)I`EdXeIHp`p|cCGN{=RovGm z+V07^#D;s)hI+qoe0_CwZS{TGd{4G=zYT-p_IuKq_z|~1lFoVQwzyW!Ya5L=zYBUj z;D=to@@`tO2W!G!p6o+`RCsPm<6hloluH`*g6OwBd{ce@5b48!?+|$uN^3n+=9^$r zpyZFFK`-<2R3fDHq9XPY_1UkFI=xD*qq~F-h@b-1)-`?c zFz6${hQhSnA?cH24*BoWN2*|)N_5T3^Y>(kX6R?#JsEMnG7>0JW8;j?#WUSJT$|vJ zws#$$HaJNW3VFVmfNM!MY@m9H>{b__f>AyXk( z;&xw&H4L||udnjKT+YCMqYR0mV8?YWN}^ichESD!OTKBY@5rxlRb%)Vtm-+Ca*59Q z7dQUm-WxC_{X9#;3WC+o{1#y5fD-y;#7NLsLNIt zYgJvWtbMrx2VZ0i_8fC`$e#mlH`KwHFxiJoOwvD>?ovBpkewR-9lO8Z5=Wo5xKjKK zm_lWz4_6pZq_z#8qxB7FX3R+rqFW!54F+_yr!(kY>B)AtPujD_VH#BxcQF@5t?IjN zs_)iHgb)MOcWb6DWvB4Wh6arXQGL8>w4WO1sT%FK=@X3hHB)LSD8aQJ&`?WKwb zK>kw|5sVLUmxuEer>ZY^oJG7_yA9A3J(5cm=5iUrMatV;i~WDxMQ}O@aSUJR#BtfL zfh5L4;Gs{qlNr5OzS!(IlG3#L5DUc&D*g( zDb=A2hGo15WvKF!yTHslp3c##h@6he89BvLnKcw#nEJSgSM_96l`HtdaUDXdPekN$Op+QG5hYA%R$nZ^V*R<9P;N(l3V1&b`kT`3x*7*P zZCk`{z?c4%7*sOW3!o7tTI>rp%f>wZ`2A4=PJ^F~yU zM-QcO9I(}NAMDFjbpXBg%*)=>@5zd;_s_g1HQkR6Rg?3;_f>IdLWQvId##BD=%dtn zj5p``TtE}Jo04y+AeQs z2|tj&V3pmsWT4jS?^xMd^Zub)^?TGlI;7r_1K-zPZGw@Ur7ZQSs4}P8%jc;1E4+D? z&t+7oBok}G)aY6B{&KNjFY5w<3U$?~ZpP-aPIdZQpAGOWEJNhdR_chtO-Zk<{3%a0 z)!U5a^ABYB$a)&o^gz!4eFJs%+XH#2y83~<`cRT6f>(@A!t-lClIaIBYm;-6^WRJt z9~UnBpXW-S&&%!Z2l9qjW(1$|OIF#?p6Eff5>{@Q#T=CkEzS~zk&`VlM~~d3Ww+!u z|KE_;fxVwMy<;_;x1HXJ%3I7v?VW_$!DNz_SIZZmS_Q`cC3AffCBfp_M&`&Z{#(zEz*OOWuFe)4)^1ShwCwk?ulXtZel3IN{cRqn%o{b8c32QKvw zoE;k+8Gdza{OrK1182^T;bI95V$l8=1NW-H`wJt3$8}g~cT3>a$g!b;{xN+S3dx$l z%M<5^`?VB(4TKHm9UVJ2IDArHRxf-xeE!U_fphvYjJ-NQ_}IwE>482&w+7%9csp?J z+=$6ZlvZ?#7|~2}2J4jHr|N`x01nhIl*#fXZ$e7pwT0}BRAw+UnF2?wzJ*b8HZ@u7 z-LX5fkZKG*E~V~x^dV|PS0Q>lH49j(km77++NkZ&f9T0ZA#>8No@00`!J}TXcvRm}NCoXI4o83Te z`)zMf8`$gxsQ6~DuNZ{*Vu-s<4ruM4X4)Y?pTG|8v)4M|kH8MXaI`u{LUP!_jwXcJ z89!eh=ZT+;`$+AYYcTCzEIXDMEipE(D)XMYdO4$5g&|iGg(tf{ngGFpm&MopiTGskOqgR2cW`s)T{J!nD16B9EB}-hCbS z8h+`fU%`FccVEx_O5c40_l>^$Chj$A$IY)X!%R{Bs!&y7Ejs7Sl^MsiiX8T;(Zn`{ znYF-wjh=gjs|u%fM9kJi^R|1kGf{m{x)RO1?n$qH-IJ)gC;Keh*BB%#0Q;eNoR$n= zpg2K!CwcxnhAlT{uN^ICKX)7WD5GP3Iwht}*&>@0UH9eSV-z_`=Z+zB&eI_mXzWFr zbIBBGvCL+tNJxVvS}4>OUPa-DxzpyJr*LJ04W_vmSNA2l@5wV>>sFfANm_RWaX(?m zTcOoZB(GzlBcQf6?NjZ+HUqr0hJGwlXmqw8{C2B-)^4R^Yb|AO z_{OouX|-!7)fW0QKVvOcUgj^C$y~)$(TRx1(_BxKO60%(_v>DL2=dX7uBq~C(z1(y zI6hWJ95=f8d#>lN_e@StM^zxIr7JwY|#W9WE$rn;H zSpH*7mmwlZc>4_ zu8xVil`?Fk)y736T~Q>&uIIB?uD_a`oWy|^?i^B;dA+nL6--3xd&mFCZkj-#zaygj z<5nc84&~A5EP7=iP_~$YD9|F=9hE1DlSf5igj|;HB2t%Nn;g#4n<=--VKxX6hj*|{ z5ij{fuv^B$M|4RFqa1U8iMU(aRTtBl$t=3_lTLvq)DdH!Mm%b0VWnB5c7v%j(U8W! zUYmMtE;$XrD4DEoMR8Uxtyy3H1&eN58Aoo{4~_cn@tCY;LMkUxp}5X`V^(o(KuFto z{k7Z;@?P2ds^)O$fy7QFK0=*-AdQ67T1l~nmo|3x5{lqBLg__FyaWrj@-Ko+H@?46 zOjjyTt5_r(A*$q$ai`BzMc-mVb3Ljt^X3X{d%{q2)%0y9d`%Uh9aLPax&Z{@(yKO7 z%hKC)&yDcaT3UJ(NryU-k8-%YTZ{(vOZz`KbuszI`Xa`8Sr~ z{C>W0ytDGW_N}T)Tw|HM(_=3CmMFI*M&DUEEK?ur8CZhC!kYV@xNEV5F|qK=cdV1z zkMey40&HukmicPo_9(S*nBB!Cs<1HgCufCwmnh3G9-NwfDvWYz=C{85FqrvGlyzAl zx-KN?Uog+K>q{{NvTA75y9MdAB6sy)9d-j%bku%e!W_7oFbA%N)p0dDA-NKlZqhY5 z>6@|lXg;f`R2fF33``jm=)9CA{N0BiUDys1)K3Qq%6A#sdq(%x2DrkBGF&0bh7OZ9 zBunCsBC^@M)Er`JFN-%QU@VW0*fp?1>KxbN#>&l%$Vwof)R)WvG%A(%cTRM2`>51x&o}U{K={BJ4OXA_q7;)vq&-!;Iur*KH)eYEH zWawi<#aaS^s_C2J+jQ3M3W0T`k~4(xu{*6~TwIM{Umd~{E05h4GEFCxg-t-){c^zV zp;GF^$i$GVm~|RvH57cbKs?=8E;)hKY^^iqr8&%?BYR^6`QW`mINofBF&t<_g~rm4EHrZ+ZsgxGL(F>$)<$5dul z7qw{V`tZ@|yYdtGx=L+UGJ}B=}^s0^g-Pf@w`3qss&b+?`IC)1TH5 zjWTA9Lot*b=9Xj3Xj?=C>e6A*m*&9h7GHW1=?lrVUoa;&Yh1e&BsVl#yo0A5qoMk* z8jff=-4^a<_^y0+lWr%wFDp(zl!kGPxy@%1-8hQ*Y=F6Kww6IPg<5ZK57Vv}b$Ac= zdttxU+i8ufo8V>&_M%`yjl5Q`>q_G#tU`rVuW87b1~vRt|25o|u0NI)cV$oWzIi!l z^=B>0>bq(%eGW;X>+Peh&8^Dfu*)*9ZcQ>3rR&3OTZq9??Q_k>M5^DODDoI*rEKz6O1Um#v4r8}lkf?gNP0*J*le|IFc4V@ZqiQk zg09^9503b%zXiP2`O-1=U8(WXVF@EsQz+PU5DHBr{s|8Rx%XOKE4k&*$yjug>6%>hF zHs3fcp(!j!)>r)lJ+NXWE4=BETB%yp8??r*84Yi@t2zaZDHhmOR_ryNrTOk+k~YW6 z7KXZp0;;B{Wg;Q?sO8O;`!#BXW+{6WzX6-p@M-z3M1XM{`P!Zs=h=(l%M`!w$a@l9 z{{xWRAuyeZED6&_ZKZMww^lRI%OH@m@Q_(x+H0m(me=fcYSlrhn@z2{`D?$q_1kLd z*WuLfudK!^m)I8DS`(~c+y2PA(%RMbR#hli*|D|_-;{o(f{))M|f zYYmNHkL`!w*Pf{*=XuhC|ZbKT1y&=J=m_oSb0*y- zr$vH4Y`f`S{kDVL%GWNLzON?#Q*cs^6gtUYZEqMlxV?+t>|3u7)Gn%wQ|HEz`6hts z`-J*1LH;m$kCD+Sp?@61sE&ZT(85H<)H9!&iHy;DTE4p0sb@9DMjfwSMnNcFf7qL0UgFg5U>?edG z=d%$glPaO#u}2f3(p5~fmqbNFLW#;(gdWRg-SHvha=TNBsMMQ%pf1AFklhnGqA?;0 zKbzD?V<;*mn~S7~8X_(|Ebe84O!oF9L<9ZgMz5Z)plc zf{_O98V0SEv?(Hb21uJ=(DEXV-Oi85MhCW|TRAon4;L+{XGFHv0T^KR)l?B^=&MwJ zaTlDUZfFg>hlCv~M)h`C(z*7032W^B6QXHWU#3}kF)q;3Kxl*OT%;7lqrcPxocVjyZe@@~dH z(MeV8awioz>r0+RH25P@oKVlk&?K2RD<&*h(QJ%dDIJK!k5lb-r`}QNhejrKYY@+8 zNKQDN@As2>1j@F@H!@nH(!r22AZ&~6kdtiu^NnXQLHSJEWl-CITe3Zn$-h@kiBQ6J zjV^v#&LH27#ohFzXP5DHubIXpa#q*X3qc^`gZvAoCY@DNNEggedOiioS^ECD?=~zV zmtr`P7=S8RN7GPpulgoEBbN6%diqd}-Za7_B#w&dDa4E%%$UJuf z+A(%q-cu^}u|zfNPyMSvZhNQ-qxwM}2 z{}ynm?CD@Ks6OGsDFs$)1P{q5-~Jr2r%J>`qIo6S5S#N>t0ig;`cQ(KO(3bwFW!@F z^U`%O(G==#l0TW3Jr8A{rh4+sLwTAM2ZtZZGvm$A-It?>!mZ&%^YLziKj-Dt#a(*( z#_+|&u6a3UQJ6*p+bGOk$naid`EDfcew2{|NYq1o>qCz@hCj2Ph?xN zn&v!rR9HjYX~ceVY1ocB?Y5EsFp_)_O-;ARDN9cwoo($#n6 zTJ!aJ$$HIK=){qrhP(wCbq@JzfS-bk0^m=td4g)xYg>hA>i}9cL)KhN!AAUlzy3FE zbdr8FZl(lm_)z#n$?2hguME2h>Qz%)=R=v$Z z0X_qaYgk{aQFQn(7T1A@a%__|jwaeF8}$}|fzqQ{H|y;*MkibeLyK0S}=$;CM8 ze(-5Y%e-mZVFx23Psgw(Q(PsZW~UsE!AZaiwN#3nCAIP~aU(0A)g42vauwe%#VT+mcyF`bde7g)A_VH!MCRKr582Yr!Jkp;6Bs+`F`nI z%Z8}AX?m&ZB|>3pjKd}lb7e*xPzma&9%W;}Y6-GQ=dsEx>61gQZZOQJ!yV%eFi3|t z#vlbB?&w!O1@gHe(>fhN7sXZ6L%tp_UsSS;i6zZ$tumm_Z@zcwvJY5?3d54)DV$rx z-FYj99($7#?3rM3v{?rEwjQ!@TW5n~BWhiYkH8lEn?#Kb*mnT)aF)|WI9SAI3i@RR za4MS{MnQ_RR~Qf8!ZS#}5@Rp#TL7tGmo1=2`M$9k&YBK5o|>|y+H)|z4vaCeY56=y zOry@01Ux$sFwSo8x81c{>L7{8uf^oo<(n~f2PY6I$qDzchmBBj$J?BYT*9rW+yCG2 zNj5V_ZX-@>KugvX72~_L*jiJRdL`6U5Y?%QRDYB2Z0Qc+#!>0cbtUEq#arry3z?(F zz5y)Jf5UfW-3PMau59{1+V9Gi4`i#JjL^K}zI1&cyBSPdBAf;7g{e^ zlT)uTuKJIEXb_>bsL3dZkqyg1C9YP09bvQMELBlngDnsT^k=OshM`i_v#;cIoiJ{SL z%Nf4uKgK@ukpjfbyAp4neISML4MnP-Q0fFkP*w znh8Dp>ialZzA=tl*Mcoq#WMz$fX04_(U3GYm9wcFLSaTvM8XtS zw2k<+=K(cq0czBsl3n^Ve+Q^8VE}SZHTNstaV8=dq#_P=EqkSLH%l5ILx`WYO3gzO zyW6RjHVLj>M5wz4y~mb5)|V zxjVvD7e*ArK1XFY+eNLiOP3+86JwOO%P`7PXyJ`6ZO%*PJtlNuvYy#px>N zg1fZzU6JrQ!@LbO`gr@s*Qct0=TXaQygmem42!OAoKfpRO)-=4=` zd2InUWvTT|65FD|DW7;1e#T3zBA?r;OT#WfHL?9X3vjP*(fqs%aJP@vQVVd4vj8{y z79c;C5L|$7b$lVUgJrFs4jNq|3q5_z(bWS>@QrfP&(gSawqYX$&<~2tewiZ8 zM6DJ>1gzP>HQCnbQSMQ;nVMU#l|&u6xTGzjQGfCP>$lI+V;v2~U$x}V zQJ6p}UtSx*?mM&^jZAgGMb$AJ(dAS_b1FTD+(g)FGnX2f3hXs<1LYTVIm-5C^-TGy zWXHle%aw^<-YKZ&Dt<$wUL&QVyH03qS1K1(MeviJ(2v(j=@C0s+$p5tsvOT;)EHTfTd+nQMBCIsWMX!Tu_bP_j*ZZx-DVCco(wJ-dTjY> zejGOrrlq0<$Nh~Y#~2Wimtz?DU!rps_j1Q^&0k&ub6!zREvY?*r?i~2mcw6+=SK(o zw23E*6Zz4v-FqGLbxtF`eb$ol(dF2p9Gg*Ar$ejE8k?MY+_2R=Hl(yN+{{~dE=Tmp zn9o?qITmq5K$F2>w+-gAHjf&4spP&qb-F98!Nc?Ntc9K$1#GvYeFYQAuMk7=RlF%*gS-nJ56e;M z<8BXCBG{Y?XmDRY#cM@Qa@C6H8IH~Czcnu>FH*E)QBdO6qVP7?Z~BNfI7Br}Zpy)M*N_L;5+cTD?{D-)nsG?|%HZ7vKH(fAaYsBvLJ41@2D0Hqc8| z^o$#_^j*GvkAC_+Qv5z||Dh?~ng>=n#aH9aQiT6H{wuxS;g}VR^qW}spARbCfAY%S zfBLsnM?YIhxERndcKHC#z`e3i>vk2!Wnu{I7t3%(a6nwt`~pr~S)E5BW-&dy;~2X&I^Vsq_EW^WeDLoGY1 zbh3$)YcmtfojCfVQAAvYV8Kea{I4*Y7sWp%6X|C^(cfe&%^v(!#$ryaMS*$f{(xUc znV;vgb23Og_!D>@@lB|-C3SO&mnRhbg(#2EAUz%=WD!nzO2J>e@hE+W?Ye|g@h3Zs zrzO}nFC#q5ef2sWP%5G-+Oa03 zAXQQ^*9IQ!xuEIJqnDhhNY63k1?dGX5gxt2oC?tMnp$F)2vQ6}4v*rg?BW!C0Oahc S8ilPGI$PxHe0%FPz5Bn#fVpY_ diff --git a/plugin/oji/MRJ/plugin/MRJPlugin.xml b/plugin/oji/MRJ/plugin/MRJPlugin.xml deleted file mode 100644 index 657cab76ef97..000000000000 --- a/plugin/oji/MRJ/plugin/MRJPlugin.xml +++ /dev/null @@ -1,6906 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]> - - - - - MRJPlugin - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathsfalse - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:xpcom: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:nspr: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:plugin: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:oji: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:js: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:include: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:caps: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:liveconnect: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:Java_Support:VM_Support:MRJ_Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MSL: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS PPC Linker - PreLinker - PostLinker - TargetnameMRJPlugin - OutputDirectory - Path: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathsfalse - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeNSPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.p - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pas - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerMW Rez - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.s - CompilerPPCAsm - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXCOF - FileExtension - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypestub - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - - - CacheModDatestrue - ActivateBrowsertrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - - - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - - - OtherExecutables - - - CustomColor1 - Red0 - Green39321 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus1 - MWFrontEnd_C_checkprotos1 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint1 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixnameMRJPlugin_config.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_direct_to_som0 - MWFrontEnd_C_som_env_check0 - MWFrontEnd_C_alwaysinline0 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - - - MWWarning_C_warn_illpragma1 - MWWarning_C_warn_emptydecl1 - MWWarning_C_warn_possunwant1 - MWWarning_C_warn_unusedvar1 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma1 - MWWarning_C_pedantic1 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion0 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut25 - MWVJavaDebugging_SupportSlowDevicesfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_useVM1 - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Depricated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - - - i£ø - - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC - MWCodeGen_PPC_tracebacktablesInline - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_processorspecific0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_vrsave0 - - - MWCodeGen_MachO_structalignmentPPC - MWCodeGen_MachO_tracebacktablesNone - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_profiler0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_processorspecific0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vrsave1 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_implicit_templates1 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings1 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initnameMRJPlugin__initialize - MWLinker_PPC_mainnamemain - MWLinker_PPC_termnameMRJPlugin__terminate - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_stacksize64 - MWProject_MachO_stackaddress0 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - - - MWPEF_exportsPragma - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentnameMRJInABox - MWPEF_collapsereloads0 - - - MWProject_PPC_typeSharedLibrary - MWProject_PPC_outfileMRJPlugin - MWProject_PPC_filecreatorMOSS - MWProject_PPC_filetypeNSPL - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' 'mcvs' 'ckid' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_machinecodelisting0 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_syminfo0 - MWCodeGen_X86_codeviewinfo1 - MWCodeGen_X86_extinst_cmov_fcomi0 - MWCodeGen_X86_extinst_sse0 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showSourcefalse - PDisasmX86_showHextrue - PDisasmX86_showRelocationtrue - PDisasmX86_showCommentsfalse - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showDatatrue - PDisasmX86_showRawfalse - PDisasmX86_verbosefalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV1 - - - MWProject_X86_typeApplication - MWProject_X86_outfilenoname.exe - MWProject_X86_baseaddress4194304 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWProject_X86_importlib - xpidl Settings - 0001000101000000000000000000000000000000000000000000000000000000 - 0000000000000000 - - - - - Name - Strings.rsrc - MacOS - Resource - Debug - - - Name - MRJContext.cp - MacOS - Text - Debug - - - Name - MRJSession.cpp - MacOS - Text - Debug - - - Name - PluginNew.cpp - MacOS - Text - Debug - - - Name - SupportsMixin.cpp - MacOS - Text - Debug - - - Name - MRJPlugin.cpp - MacOS - Text - Debug - - - Name - Version.rsrc - MacOS - Resource - Debug - - - Name - TopLevelFrame.cpp - MacOS - Text - Debug - - - Name - MRJFrame.cpp - MacOS - Text - Debug - - - Name - MRJConsole.cpp - MacOS - Text - Debug - - - Name - MRJPage.cpp - MacOS - Text - Debug - - - Name - StringUtils.cpp - MacOS - Text - Debug - - - Name - LiveConnectNativeMethods.cpp - MacOS - Text - Debug - - - Name - MRJMonitor.cpp - MacOS - Text - Debug - - - Name - CSecureEnv.cpp - MacOS - Text - Debug - - - Name - NativeMonitor.cpp - MacOS - Text - Debug - - - Name - JSEvaluator.cpp - MacOS - Text - Debug - - - Name - EmbeddedFrame.cpp - MacOS - Text - Debug - - - Name - EmbeddedFramePluginInstance.cpp - MacOS - Text - Debug - - - Name - RunnableMixin.cpp - MacOS - Text - Debug - - - Name - Dialogs.rsrc - MacOS - Resource - Debug - - - Name - InterfaceLib - MacOS - Library - Debug - - - Name - AppearanceLib - MacOS - Library - Debug - - - Name - JManagerLib - MacOS - Library - Debug - - - Name - TextCommon - MacOS - Library - Debug - - - Name - AltWindowHandling.cpp - MacOS - Text - Debug - - - Name - MSL_Runtime_PPC.Lib - MacOS - Library - Debug - - - Name - MSL_C_PPC.Lib - MacOS - Library - Debug - - - Name - MathLib - MacOS - Library - Debug - - - Name - BackwardAdaptor.lib - MacOS - Library - Debug, TargetOutputFile - - - - - Name - Version.rsrc - MacOS - - - Name - Strings.rsrc - MacOS - - - Name - Dialogs.rsrc - MacOS - - - Name - MRJPlugin.cpp - MacOS - - - Name - MRJContext.cp - MacOS - - - Name - MRJSession.cpp - MacOS - - - Name - MRJFrame.cpp - MacOS - - - Name - TopLevelFrame.cpp - MacOS - - - Name - MRJConsole.cpp - MacOS - - - Name - PluginNew.cpp - MacOS - - - Name - SupportsMixin.cpp - MacOS - - - Name - MRJPage.cpp - MacOS - - - Name - StringUtils.cpp - MacOS - - - Name - LiveConnectNativeMethods.cpp - MacOS - - - Name - MRJMonitor.cpp - MacOS - - - Name - CSecureEnv.cpp - MacOS - - - Name - NativeMonitor.cpp - MacOS - - - Name - JSEvaluator.cpp - MacOS - - - Name - EmbeddedFrame.cpp - MacOS - - - Name - EmbeddedFramePluginInstance.cpp - MacOS - - - Name - RunnableMixin.cpp - MacOS - - - Name - InterfaceLib - MacOS - - - Name - MathLib - MacOS - - - Name - AppearanceLib - MacOS - - - Name - JManagerLib - MacOS - - - Name - TextCommon - MacOS - - - Name - AltWindowHandling.cpp - MacOS - - - Name - MSL_C_PPC.Lib - MacOS - - - Name - MSL_Runtime_PPC.Lib - MacOS - - - Name - BackwardAdaptor.lib - MacOS - - - - - BackwardAdaptor - LinkAgainst - - Name - BackwardAdaptor.lib - MacOS - - - - - - BackwardAdaptor - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathsfalse - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:plugin: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:include: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:oji: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MSL: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS PPC Linker - PreLinker - PostLinker - TargetnameBackwardAdaptor - OutputDirectory - Path: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathsfalse - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.p - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pas - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ppu - CompilerMW Pascal PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.s - CompilerPPCAsm - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXCOF - FileExtension - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypestub - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.o - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - - - CacheModDatestrue - ActivateBrowsertrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - - - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint1 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixname - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_direct_to_som0 - MWFrontEnd_C_som_env_check0 - MWFrontEnd_C_alwaysinline0 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion0 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut25 - MWVJavaDebugging_SupportSlowDevicesfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_useVM1 - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Depricated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - - - i£ø - - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC - MWCodeGen_PPC_tracebacktablesInline - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_processorspecific0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_vrsave0 - - - MWCodeGen_MachO_structalignmentPPC - MWCodeGen_MachO_tracebacktablesNone - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_profiler0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_processorspecific0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vrsave1 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_implicit_templates1 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_stacksize64 - MWProject_MachO_stackaddress0 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeLibrary - MWProject_PPC_outfileBackwardAdaptor.lib - MWProject_PPC_filecreator???? - MWProject_PPC_filetype???? - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_machinecodelisting0 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_syminfo0 - MWCodeGen_X86_codeviewinfo1 - MWCodeGen_X86_extinst_cmov_fcomi0 - MWCodeGen_X86_extinst_sse0 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showSourcefalse - PDisasmX86_showHextrue - PDisasmX86_showRelocationtrue - PDisasmX86_showCommentsfalse - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showDatatrue - PDisasmX86_showRawfalse - PDisasmX86_verbosefalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV1 - - - MWProject_X86_typeApplication - MWProject_X86_outfilenoname.exe - MWProject_X86_baseaddress4194304 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWProject_X86_importlib - xpidl Settings - 0001000101000000000000000000000000000000000000000000000000000000 - 0000000000000000 - - - - - Name - npmac.cpp - MacOS - Text - Debug - - - Name - nsLiveConnect.cpp - MacOS - Text - Debug - - - Name - BackwardAdapter.cpp - MacOS - Text - Debug - - - Name - EventFilter.cpp - MacOS - Text - Debug - - - - - Name - npmac.cpp - MacOS - - - Name - nsLiveConnect.cpp - MacOS - - - Name - BackwardAdapter.cpp - MacOS - - - Name - EventFilter.cpp - MacOS - - - - - MRJPlugin (4.X) - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathsfalse - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:xpcom: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:nspr: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:plugin: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:oji: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:dom: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:js: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:include: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:caps: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:liveconnect: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:string: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:netwerk: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:Java_Support:VM_Support:MRJ_Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MSL: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS PPC Linker - PreLinker - PostLinker - TargetnameMRJPlugin (4.X) - OutputDirectory - Path: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathsfalse - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeNSPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.p - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pas - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerMW Rez - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.s - CompilerPPCAsm - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXCOF - FileExtension - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypestub - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - - - CacheModDatestrue - ActivateBrowsertrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - - - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - - - OtherExecutables - - - CustomColor1 - Red0 - Green39321 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus1 - MWFrontEnd_C_checkprotos1 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint1 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixnameMRJPlugin_4.x_config.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_direct_to_som0 - MWFrontEnd_C_som_env_check0 - MWFrontEnd_C_alwaysinline0 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - - - MWWarning_C_warn_illpragma1 - MWWarning_C_warn_emptydecl1 - MWWarning_C_warn_possunwant1 - MWWarning_C_warn_unusedvar1 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma1 - MWWarning_C_pedantic1 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion0 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut25 - MWVJavaDebugging_SupportSlowDevicesfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_useVM1 - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Depricated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - - - i£ø - - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC - MWCodeGen_PPC_tracebacktablesInline - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_peephole0 - MWCodeGen_PPC_processorspecific0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_vrsave0 - - - MWCodeGen_MachO_structalignmentPPC - MWCodeGen_MachO_tracebacktablesNone - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_profiler0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_processorspecific0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vrsave1 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_implicit_templates1 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings1 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initnameMRJPlugin__initialize - MWLinker_PPC_mainnamemain - MWLinker_PPC_termnameMRJPlugin__terminate - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_stacksize64 - MWProject_MachO_stackaddress0 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - - - MWPEF_exportsPragma - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentnameMRJ Plugin - MWPEF_collapsereloads0 - - - MWProject_PPC_typeSharedLibrary - MWProject_PPC_outfileMRJPlugin (4.X) - MWProject_PPC_filecreatorMOSS - MWProject_PPC_filetypeNSPL - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' 'mcvs' 'ckid' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_machinecodelisting0 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_syminfo0 - MWCodeGen_X86_codeviewinfo1 - MWCodeGen_X86_extinst_cmov_fcomi0 - MWCodeGen_X86_extinst_sse0 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showSourcefalse - PDisasmX86_showHextrue - PDisasmX86_showRelocationtrue - PDisasmX86_showCommentsfalse - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showDatatrue - PDisasmX86_showRawfalse - PDisasmX86_verbosefalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV1 - - - MWProject_X86_typeApplication - MWProject_X86_outfilenoname.exe - MWProject_X86_baseaddress4194304 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWProject_X86_importlib - xpidl Settings - 0001000101000000000000000000000000000000000000000000000000000000 - 0000000000000000 - - - - - Name - Strings.rsrc - MacOS - Resource - Debug - - - Name - MRJContext.cp - MacOS - Text - Debug - - - Name - MRJSession.cpp - MacOS - Text - Debug - - - Name - PluginNew.cpp - MacOS - Text - Debug - - - Name - SupportsMixin.cpp - MacOS - Text - Debug - - - Name - MRJPlugin.cpp - MacOS - Text - Debug - - - Name - Version.rsrc - MacOS - Resource - Debug - - - Name - TopLevelFrame.cpp - MacOS - Text - Debug - - - Name - MRJFrame.cpp - MacOS - Text - Debug - - - Name - MRJConsole.cpp - MacOS - Text - Debug - - - Name - MRJPage.cpp - MacOS - Text - Debug - - - Name - StringUtils.cpp - MacOS - Text - Debug - - - Name - LiveConnectNativeMethods.cpp - MacOS - Text - Debug - - - Name - MRJMonitor.cpp - MacOS - Text - Debug - - - Name - CSecureEnv.cpp - MacOS - Text - Debug - - - Name - NativeMonitor.cpp - MacOS - Text - Debug - - - RootRelative - Project - :BackwardAdaptor.lib - MacOS - Unknown - Debug, TargetOutputFile - - - Name - JSEvaluator.cpp - MacOS - Text - Debug - - - Name - EmbeddedFrame.cpp - MacOS - Text - Debug - - - Name - EmbeddedFramePluginInstance.cpp - MacOS - Text - Debug - - - Name - RunnableMixin.cpp - MacOS - Text - Debug - - - Name - Dialogs.rsrc - MacOS - Resource - Debug - - - Name - JManagerLib - MacOS - Library - Debug - - - Name - InterfaceLib - MacOS - Library - Debug - - - Name - AppearanceLib - MacOS - Library - Debug - - - Name - TextCommon - MacOS - Library - Debug - - - Name - MSL_Runtime_PPC.Lib - MacOS - Library - Debug - - - Name - MSL_C_PPC.Lib - MacOS - Library - Debug - - - Name - MathLib - MacOS - Library - Debug - - - Name - MRJNetworking.cpp - MacOS - Text - Debug - - - Name - JMURLConnection - MacOS - Library - Debug - - - - - Name - Version.rsrc - MacOS - - - Name - Strings.rsrc - MacOS - - - Name - Dialogs.rsrc - MacOS - - - RootRelative - Project - :BackwardAdaptor.lib - MacOS - - - Name - MRJPlugin.cpp - MacOS - - - Name - MRJContext.cp - MacOS - - - Name - MRJSession.cpp - MacOS - - - Name - MRJFrame.cpp - MacOS - - - Name - TopLevelFrame.cpp - MacOS - - - Name - MRJConsole.cpp - MacOS - - - Name - PluginNew.cpp - MacOS - - - Name - SupportsMixin.cpp - MacOS - - - Name - MRJPage.cpp - MacOS - - - Name - StringUtils.cpp - MacOS - - - Name - LiveConnectNativeMethods.cpp - MacOS - - - Name - MRJMonitor.cpp - MacOS - - - Name - CSecureEnv.cpp - MacOS - - - Name - NativeMonitor.cpp - MacOS - - - Name - JSEvaluator.cpp - MacOS - - - Name - EmbeddedFrame.cpp - MacOS - - - Name - EmbeddedFramePluginInstance.cpp - MacOS - - - Name - RunnableMixin.cpp - MacOS - - - Name - JManagerLib - MacOS - - - Name - InterfaceLib - MacOS - - - Name - AppearanceLib - MacOS - - - Name - TextCommon - MacOS - - - Name - MSL_Runtime_PPC.Lib - MacOS - - - Name - MSL_C_PPC.Lib - MacOS - - - Name - MathLib - MacOS - - - Name - MRJNetworking.cpp - MacOS - - - Name - JMURLConnection - MacOS - - - - - BackwardAdaptor - LinkAgainst - - RootRelative - Project - :BackwardAdaptor.lib - MacOS - - - - - - MRJPlugin.jar - - - - UserSourceTrees - - - AlwaysSearchUserPathsfalse - InterpretDOSAndUnixPathsfalse - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::js:src:liveconnect:classes:netscape:javascript: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:Extensions:MRJ Libraries:MRJClasses: - PathFormatMacOS - PathRootSystem - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerJava Linker - PreLinker - PostLinker - TargetnameMRJPlugin.jar - OutputDirectory - Path: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathsfalse - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeGIFf - FileExtension.gif - CompilerJAR Importer - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeJPEG - FileExtension.jpg - CompilerJAR Importer - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerRunTSScript - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.html - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.java - CompilerMW Java - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.mf - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.au - CompilerJAR Importer - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.class - CompilerMW Java - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.gif - CompilerJAR Importer - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.jar - CompilerMW Java - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.jpeg - CompilerJAR Importer - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.zip - CompilerMW Java - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - - - CacheModDatestrue - ActivateBrowsertrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - - - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixname - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_direct_to_som0 - MWFrontEnd_C_som_env_check0 - MWFrontEnd_C_alwaysinline0 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion0 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut25 - MWVJavaDebugging_SupportSlowDevicesfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileMRJPlugin.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_useVM1 - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Depricated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - - - i£ø - - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentMC68K - MWCodeGen_PPC_tracebacktablesNone - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_processorspecific0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_vrsave0 - - - MWCodeGen_MachO_structalignmentPPC - MWCodeGen_MachO_tracebacktablesNone - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_profiler0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_processorspecific0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vrsave1 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_implicit_templates1 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_stacksize64 - MWProject_MachO_stackaddress0 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeApplication - MWProject_PPC_outfilea.out - MWProject_PPC_filecreator???? - MWProject_PPC_filetypeAPPL - MWProject_PPC_size384 - MWProject_PPC_minsize384 - MWProject_PPC_stacksize64 - MWProject_PPC_flags22720 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_machinecodelisting0 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_syminfo0 - MWCodeGen_X86_codeviewinfo1 - MWCodeGen_X86_extinst_cmov_fcomi0 - MWCodeGen_X86_extinst_sse0 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showSourcefalse - PDisasmX86_showHextrue - PDisasmX86_showRelocationtrue - PDisasmX86_showCommentsfalse - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showDatatrue - PDisasmX86_showRawfalse - PDisasmX86_verbosefalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV1 - - - MWProject_X86_typeApplication - MWProject_X86_outfilenoname.exe - MWProject_X86_baseaddress4194304 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWProject_X86_importlib - xpidl Settings - 0001000101000000000000000000000000000000000000000000000000000000 - 0000000000000000 - - - - - Name - JNIUtils.java - MacOS - Text - Debug - - - Name - JNIThread.java - MacOS - Text - Debug - - - Name - JDKClasses.zip - MacOS - Unknown - - - - Name - AWTUtils.java - MacOS - Text - Debug - - - Name - MRJClasses.zip - MacOS - Unknown - - - - Name - PrintingPort.java - MacOS - Text - Debug - - - Name - JSException.java - MacOS - Text - Debug - - - Name - JSObject.java - MacOS - Text - Debug - - - Name - JSProxy.java - MacOS - Text - Debug - - - Name - JSRunnable.java - MacOS - Text - Debug - - - Name - JSUtil.java - MacOS - Text - Debug - - - Name - MRJConsole.java - MacOS - Text - Debug - - - - - Name - JNIUtils.java - MacOS - - - Name - JNIThread.java - MacOS - - - Name - JDKClasses.zip - MacOS - - - Name - MRJClasses.zip - MacOS - - - Name - AWTUtils.java - MacOS - - - Name - PrintingPort.java - MacOS - - - Name - JSException.java - MacOS - - - Name - JSObject.java - MacOS - - - Name - JSProxy.java - MacOS - - - Name - JSRunnable.java - MacOS - - - Name - JSUtil.java - MacOS - - - Name - MRJConsole.java - MacOS - - - - - MRJPlugin.jar (4.X) - - - - UserSourceTrees - - - AlwaysSearchUserPathsfalse - InterpretDOSAndUnixPathsfalse - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::js:src:liveconnect:classes:netscape:javascript: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:Extensions:MRJ Libraries:MRJClasses: - PathFormatMacOS - PathRootSystem - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerJava Linker - PreLinker - PostLinker - TargetnameMRJPlugin.jar (4.X) - OutputDirectory - Path: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathsfalse - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeGIFf - FileExtension.gif - CompilerJAR Importer - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeJPEG - FileExtension.jpg - CompilerJAR Importer - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerRunTSScript - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.html - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.java - CompilerMW Java - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.mf - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.au - CompilerJAR Importer - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.class - CompilerMW Java - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.gif - CompilerJAR Importer - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.jar - CompilerMW Java - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.jpeg - CompilerJAR Importer - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.zip - CompilerMW Java - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - - - CacheModDatestrue - ActivateBrowsertrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - - - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixname - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_direct_to_som0 - MWFrontEnd_C_som_env_check0 - MWFrontEnd_C_alwaysinline0 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion0 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut25 - MWVJavaDebugging_SupportSlowDevicesfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileMRJPlugin.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_useVM1 - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Depricated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - - - i£ø - - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentMC68K - MWCodeGen_PPC_tracebacktablesNone - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_processorspecific0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_vrsave0 - - - MWCodeGen_MachO_structalignmentPPC - MWCodeGen_MachO_tracebacktablesNone - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_profiler0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_processorspecific0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vrsave1 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_implicit_templates1 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_stacksize64 - MWProject_MachO_stackaddress0 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeApplication - MWProject_PPC_outfilea.out - MWProject_PPC_filecreator???? - MWProject_PPC_filetypeAPPL - MWProject_PPC_size384 - MWProject_PPC_minsize384 - MWProject_PPC_stacksize64 - MWProject_PPC_flags22720 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_machinecodelisting0 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_syminfo0 - MWCodeGen_X86_codeviewinfo1 - MWCodeGen_X86_extinst_cmov_fcomi0 - MWCodeGen_X86_extinst_sse0 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showSourcefalse - PDisasmX86_showHextrue - PDisasmX86_showRelocationtrue - PDisasmX86_showCommentsfalse - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showDatatrue - PDisasmX86_showRawfalse - PDisasmX86_verbosetrue - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV1 - - - MWProject_X86_typeApplication - MWProject_X86_outfilenoname.exe - MWProject_X86_baseaddress4194304 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWProject_X86_importlib - xpidl Settings - 0001000101000000000000000000000000000000000000000000000000000000 - 0000000000000000 - - - - - Name - JNIUtils.java - MacOS - Text - Debug - - - Name - JNIThread.java - MacOS - Text - Debug - - - Name - JDKClasses.zip - MacOS - Unknown - - - - Name - ConsoleApplet.jar - MacOS - Unknown - MergeLibrary, TargetOutputFile - - - Name - netscape.plugin.jar - MacOS - Unknown - - - - Name - MRJPlugin.java - MacOS - Text - Debug - - - Name - AWTUtils.java - MacOS - Text - Debug - - - Name - MRJClasses.zip - MacOS - Unknown - - - - Name - PrintingPort.java - MacOS - Text - Debug - - - Name - JSException.java - MacOS - Text - Debug - - - Name - JSObject.java - MacOS - Text - Debug - - - Name - JSProxy.java - MacOS - Text - Debug - - - Name - JSRunnable.java - MacOS - Text - Debug - - - Name - JSUtil.java - MacOS - Text - Debug - - - - - Name - JNIUtils.java - MacOS - - - Name - JNIThread.java - MacOS - - - Name - JDKClasses.zip - MacOS - - - Name - MRJClasses.zip - MacOS - - - Name - ConsoleApplet.jar - MacOS - - - Name - netscape.plugin.jar - MacOS - - - Name - MRJPlugin.java - MacOS - - - Name - AWTUtils.java - MacOS - - - Name - PrintingPort.java - MacOS - - - Name - JSException.java - MacOS - - - Name - JSObject.java - MacOS - - - Name - JSProxy.java - MacOS - - - Name - JSRunnable.java - MacOS - - - Name - JSUtil.java - MacOS - - - - - ConsoleApplet.jar - LinkAgainst - - Name - ConsoleApplet.jar - MacOS - - - - - - ConsoleApplet.jar - - - - UserSourceTrees - - - AlwaysSearchUserPathsfalse - InterpretDOSAndUnixPathsfalse - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::js:src:liveconnect:classes:netscape:javascript: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:Extensions:MRJ Libraries:MRJClasses: - PathFormatMacOS - PathRootSystem - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerJava Linker - PreLinker - PostLinker - TargetnameConsoleApplet.jar - OutputDirectory - Path: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathsfalse - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeGIFf - FileExtension.gif - CompilerJAR Importer - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeJPEG - FileExtension.jpg - CompilerJAR Importer - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerRunTSScript - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.html - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.java - CompilerMW Java - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.mf - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.au - CompilerJAR Importer - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.class - CompilerMW Java - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.gif - CompilerJAR Importer - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.jar - CompilerMW Java - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.jpeg - CompilerJAR Importer - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.zip - CompilerMW Java - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - - - CacheModDatesfalse - ActivateBrowsertrue - DumpBrowserInfofalse - CacheSubprojectsfalse - UseThirdPartyDebuggerfalse - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - - - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixname - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_direct_to_som0 - MWFrontEnd_C_som_env_check0 - MWFrontEnd_C_alwaysinline0 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion0 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut25 - MWVJavaDebugging_SupportSlowDevicesfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileConsoleApplet.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_useVM1 - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Depricated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - - - i£ø - - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentMC68K - MWCodeGen_PPC_tracebacktablesNone - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_processorspecific0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_vrsave0 - - - MWCodeGen_MachO_structalignmentPPC - MWCodeGen_MachO_tracebacktablesNone - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_profiler0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_processorspecific0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vrsave1 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_implicit_templates1 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_stacksize64 - MWProject_MachO_stackaddress0 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeApplication - MWProject_PPC_outfilea.out - MWProject_PPC_filecreator???? - MWProject_PPC_filetypeAPPL - MWProject_PPC_size384 - MWProject_PPC_minsize384 - MWProject_PPC_stacksize64 - MWProject_PPC_flags22720 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_machinecodelisting0 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_syminfo0 - MWCodeGen_X86_codeviewinfo1 - MWCodeGen_X86_extinst_cmov_fcomi0 - MWCodeGen_X86_extinst_sse0 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showSourcefalse - PDisasmX86_showHextrue - PDisasmX86_showRelocationtrue - PDisasmX86_showCommentsfalse - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showDatatrue - PDisasmX86_showRawfalse - PDisasmX86_verbosetrue - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV1 - - - MWProject_X86_typeApplication - MWProject_X86_outfilenoname.exe - MWProject_X86_baseaddress4194304 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWProject_X86_importlib - xpidl Settings - 0001000101000000000000000000000000000000000000000000000000000000 - 0000000000000000 - - - - - Name - JNIUtils.java - MacOS - Text - Debug - - - Name - JNIThread.java - MacOS - Text - Debug - - - Name - JDKClasses.zip - MacOS - Unknown - - - - Name - MRJConsole.java - MacOS - Text - Debug - - - Name - JSException.java - MacOS - Text - Debug - - - Name - JSObject.java - MacOS - Text - Debug - - - Name - JSProxy.java - MacOS - Text - Debug - - - Name - JSRunnable.java - MacOS - Text - Debug - - - Name - JSUtil.java - MacOS - Text - Debug - - - - - Name - JNIUtils.java - MacOS - - - Name - JNIThread.java - MacOS - - - Name - JDKClasses.zip - MacOS - - - Name - MRJConsole.java - MacOS - - - Name - JSException.java - MacOS - - - Name - JSObject.java - MacOS - - - Name - JSProxy.java - MacOS - - - Name - JSRunnable.java - MacOS - - - Name - JSUtil.java - MacOS - - - - - - - MRJPlugin - MRJPlugin (4.X) - BackwardAdaptor - MRJPlugin.jar - MRJPlugin.jar (4.X) - ConsoleApplet.jar - - - - Plugin - - MRJPlugin - Name - MRJPlugin.cpp - MacOS - - - MRJPlugin - Name - MRJConsole.cpp - MacOS - - - MRJPlugin - Name - MRJContext.cp - MacOS - - - MRJPlugin - Name - MRJMonitor.cpp - MacOS - - - MRJPlugin - Name - MRJPage.cpp - MacOS - - - MRJPlugin - Name - MRJFrame.cpp - MacOS - - - MRJPlugin (4.X) - Name - MRJNetworking.cpp - MacOS - - - MRJPlugin - Name - AltWindowHandling.cpp - MacOS - - - MRJPlugin - Name - TopLevelFrame.cpp - MacOS - - - MRJPlugin - Name - SupportsMixin.cpp - MacOS - - - MRJPlugin - Name - RunnableMixin.cpp - MacOS - - - MRJPlugin - Name - MRJSession.cpp - MacOS - - - MRJPlugin - Name - PluginNew.cpp - MacOS - - - MRJPlugin - Name - StringUtils.cpp - MacOS - - - MRJPlugin - Name - JSEvaluator.cpp - MacOS - - - MRJPlugin - Name - EmbeddedFrame.cpp - MacOS - - - MRJPlugin - Name - EmbeddedFramePluginInstance.cpp - MacOS - - - MRJPlugin - Name - Strings.rsrc - MacOS - - - MRJPlugin - Name - Version.rsrc - MacOS - - - MRJPlugin - Name - Dialogs.rsrc - MacOS - - - LiveConnect - - MRJPlugin - Name - LiveConnectNativeMethods.cpp - MacOS - - - SecureJNI - - MRJPlugin - Name - CSecureEnv.cpp - MacOS - - - MRJPlugin - Name - NativeMonitor.cpp - MacOS - - - Backward Adaptor - - BackwardAdaptor - Name - BackwardAdapter.cpp - MacOS - - - BackwardAdaptor - Name - nsLiveConnect.cpp - MacOS - - - BackwardAdaptor - Name - npmac.cpp - MacOS - - - BackwardAdaptor - Name - EventFilter.cpp - MacOS - - - Libraries - - MRJPlugin - Name - MSL_Runtime_PPC.Lib - MacOS - - - MRJPlugin - Name - InterfaceLib - MacOS - - - MRJPlugin - Name - AppearanceLib - MacOS - - - MRJPlugin - Name - JManagerLib - MacOS - - - MRJPlugin (4.X) - Name - JMURLConnection - MacOS - - - MRJPlugin - Name - TextCommon - MacOS - - - MRJPlugin - Name - BackwardAdaptor.lib - MacOS - - - MRJPlugin.jar - - MRJPlugin.jar - Name - MRJConsole.java - MacOS - - - MRJPlugin.jar - Name - AWTUtils.java - MacOS - - - MRJPlugin.jar - Name - JNIUtils.java - MacOS - - - MRJPlugin.jar - Name - JNIThread.java - MacOS - - - MRJPlugin.jar - Name - PrintingPort.java - MacOS - - - MRJPlugin.jar - Name - JDKClasses.zip - MacOS - - - MRJPlugin.jar - Name - MRJClasses.zip - MacOS - - - MRJPlugin.jar (4.X) - - MRJPlugin.jar (4.X) - Name - ConsoleApplet.jar - MacOS - - - MRJPlugin.jar (4.X) - Name - netscape.plugin.jar - MacOS - - - MRJPlugin.jar (4.X) - Name - MRJPlugin.java - MacOS - - - liveconnect - - MRJPlugin.jar - Name - JSException.java - MacOS - - - MRJPlugin.jar - Name - JSObject.java - MacOS - - - MRJPlugin.jar - Name - JSProxy.java - MacOS - - - MRJPlugin.jar - Name - JSRunnable.java - MacOS - - - MRJPlugin.jar - Name - JSUtil.java - MacOS - - - - MRJPlugin - Name - MSL_C_PPC.Lib - MacOS - - - MRJPlugin - Name - MathLib - MacOS - - - - diff --git a/plugin/oji/MRJ/plugin/Resources/Dialogs.rsrc b/plugin/oji/MRJ/plugin/Resources/Dialogs.rsrc deleted file mode 100755 index 381d4e574e85b7c836a3b02b960c064ad75560e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1186 zcmb7Dzi-n(6n=J`mVi~F3Q+`=I8}iOMG*rM5kFeuPzBN^ga`u4(2MP)E{ToKj_8C^ zq)Md|17cw8#DEYL6C(>lCl+=XK>P#D;obS1x+x4i>F#~+d++()d%lC@NdOfNO9Ckc z*EQ+lF^Dw-bqe(})Fcc^H1QL-;1{kjQBO%ifz-`Q`aPTZj^}2X&&&r)Ym`x1$gZ1S zyKQ!<@2gO|TPqk|zk^5bi1Ww3xBGSTT}Y`P!GSK=SbbQ(n!dW5ExpAhBgRstSuZx~ zh5M!A-@S*}(~{x!Uq;Ml5|5BA7C~l{<+UU z4v(8x$mqCq6gwfnG29s>1unxkSWz;XTDdLl7q9|fw2151qQ<(5~0<#m(ozXBRBX zwg`0z?FXy28#pEn@M#cB1ZFXWU$yN7E1iQ(-C6M&Zy#!C5& rfZrej${UGsGRjYF?z29%aG=AfD)ZKCGw>KOXh35x9^jM6J+S=&O%kgy diff --git a/plugin/oji/MRJ/plugin/Resources/Strings.rsrc b/plugin/oji/MRJ/plugin/Resources/Strings.rsrc deleted file mode 100644 index f827cdad82d09d6db89a359fcb6d2b12054d3382..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1338 zcmcIkO>7fK6n@xF8t95vgi=6MJc-0uD4E3xe?A$39DoBHICJ8{0da^52Snk{i7N+G)KgnHRBEN(C{p^?ixs65DHonJGw;p&X5PH{ z-VF5Y0Z736lBB6^)F$4!A`I!Nmo#n%=-E#r#*ow$K$05Vs+Tn!g1#TuKy!LCCDf{a zp_aK=__ok0ECI}EMHRYDN3u|cmST0@=0eqcTe4aZ2u~)!ESgi(e#?nM1CP4Ra{u|& zwRk4^)!VsO2Tu(#=)3g{^SRfFdb$s%1{TXF2InD#d94P?Pfk<^Chx(4%n{gC-lL}q zkAHz9U|jv?rkDDe=5adnxpAfXd&U?raYyxOXFb3g+ciA9{x)r7X3Kjg9bMBu)q4w% z;f`_k+@G-1Po(EN+0jWJK;pL9YDzRH8RS9G5K3Z8Qkuw{n4T|<%`8mLOs8i{W2m^p zFz<)x`Jq6!S@lDYE7xxhA+6(5VB3|hLRAxZCWmw8On$tkRB&3?mzS5B=YQum8l3r| zqx*GNUoefuM$2)Vtfsui1eqAyXY||zE{h7%W`cbdIXcISy>#mHZ=OJxVc5h9B(v-| zA(F$FD)B|f{o!}P^`H~68^3FsLi(-H5|Yp>(5uaO6=B=LMq_DV_l6POQLb}GA7heY z{|(v~5ecrvxm2YW!c^i zdaLk}7(TMa-A7~iD5d>V>z^0Tzy59HD5PS#03Q8OzVYbSxi?+AJN8$aLP{~%q&l^D zAeiNQ5$PxYQwM~v!R+YqV<(R>%-J?_+jgU}84f@QiDJn-MBmeX z>ym2|Y{IkJQH2@s{rWnRvc11_0e*<|ZT+O*h07iNCh0ZWV=w(}*GPX!dL$2{?#l&k iO)V91DJB)WrMq)6^y|V>l| z#9sU-ya^)oR_lM@Rs0k5+=C}C@oln8V(Np(`})0)dGjE58Nh(Eltott`EC-5F{o!R zq0FOfqa+iEaflKb-XqVEaW!#dAiuGCZd)iV!+&CT3^-S*QNAvHt()8Shf! ziRZ7P9`9t9cK&>YbXV}t`ygx4RfJ}XyY_6xEkArMJ&%?8-oTYXDeTEov-LPNTSA8e z#f8S4>lt{F1ISs_v?~`8M7G8`S0EorJ?syabYDhfQ$(7xzCf4n z4+6bll^^N3V_#il?ca%0)X6T8kS& zQk?S8hXspT%X2Hh1baj7lWwSpJ#dM&Tv@rjLdku{A!P0%4*_NJ+hLot9c9`plVS#8>vjtNQ#V+x;Oz*J$q}4Gt;Q+2d7Yx2D9Skq| zd@o+=%{@FqOekYKzRqv?#m*_}Q_74+XuLuHZ!pICbJU$HO~&inZIT=@Nq_46mI`}< SNBG7y7P09GkC3KSQ|&LKrL?aA diff --git a/plugin/oji/MRJ/plugin/Source/AWTUtils.java b/plugin/oji/MRJ/plugin/Source/AWTUtils.java deleted file mode 100644 index 30ad6732dd6e..000000000000 --- a/plugin/oji/MRJ/plugin/Source/AWTUtils.java +++ /dev/null @@ -1,74 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - AWTUtils.java - */ - -package netscape.oji; - - -import java.awt.Container; -import java.awt.Graphics; -import java.awt.Point; - -import com.apple.mrj.internal.awt.PrintingPort; - -public class AWTUtils { - /** - * Prints the components of a specified Container. - */ - public static void printContainer(Container container, int printingPort, int originX, int originY, Object notifier) { - try { - // obtain a graphics object to draw with. - PrintingPort printer = new PrintingPort(printingPort, originX, originY); - Graphics graphics = printer.getGraphics(container); - - // print the specified container. - container.printAll(graphics); - - graphics.dispose(); - printer.dispose(); - } finally { - // if caller is waiting for this to complete, then notify. - if (notifier != null) { - synchronized(notifier) { - notifier.notifyAll(); - } - } - } - } -} diff --git a/plugin/oji/MRJ/plugin/Source/AltWindowHandling.cpp b/plugin/oji/MRJ/plugin/Source/AltWindowHandling.cpp deleted file mode 100644 index bd2c331c0fb4..000000000000 --- a/plugin/oji/MRJ/plugin/Source/AltWindowHandling.cpp +++ /dev/null @@ -1,296 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - AltWindowHandling.cpp - - Due to a hole in the OJI API, 6.x still not able to open a new - window from Java w/o a hack. thePluginManager2->RegisterWindow - is doing nothing. Here I add Patrick's workaround used in 4.x. - File will be used from TopLevelFrame::showHide() - This code comes from the CPluginManager class in BackwardAdaptor.cpp. - If the API is fixed, can remove this file and the two calls to it. - - */ - -#include -#include - -#include "nsIPluginManager2.h" -#include "EventFilter.h" -#include "nsIEventHandler.h" - -#include "AltWindowHandling.h" - -RegisteredWindow* theRegisteredWindows = NULL; -RegisteredWindow* theActiveWindow = NULL; -Boolean mEventFiltersInstalled = nil; - -Boolean EventFilter(EventRecord* event); -Boolean MenuFilter(long menuSelection); -RegisteredWindow** GetRegisteredWindow(nsPluginPlatformWindowRef window); - -NS_METHOD -AltRegisterWindow(nsIEventHandler* handler, nsPluginPlatformWindowRef window) -{ - theRegisteredWindows = new RegisteredWindow(theRegisteredWindows, handler, window); - -#ifdef XP_MAC - // use jGNE to obtain events for registered windows. - if (!mEventFiltersInstalled) { - ::InstallEventFilters(&EventFilter, &MenuFilter); - mEventFiltersInstalled = true; - } - - // plugin expects the window to be shown and selected at this point. - - SInt16 variant = ::GetWVariant(window); - if (variant == plainDBox) { - ::ShowHide(window, true); - ::BringToFront(window); - } else { - ::ShowWindow(window); - ::SelectWindow(window); - } -#endif - - return NS_OK; -} - -NS_METHOD -AltUnregisterWindow(nsIEventHandler* handler, nsPluginPlatformWindowRef window) -{ - RegisteredWindow** link = GetRegisteredWindow(window); - if (link != NULL) { - RegisteredWindow* registeredWindow = *link; - if (registeredWindow == theActiveWindow) - theActiveWindow = NULL; - *link = registeredWindow->mNext; - delete registeredWindow; - } - -#ifdef XP_MAC - ::HideWindow(window); - - // if no windows registered, remove the filter. - if (theRegisteredWindows == NULL) { - ::RemoveEventFilters(); - mEventFiltersInstalled = false; - } -#endif - - return NS_OK; -} - -static void sendActivateEvent(nsIEventHandler* handler, WindowRef window, Boolean active) -{ - EventRecord event; - ::OSEventAvail(0, &event); - event.what = activateEvt; - event.message = UInt32(window); - if (active) - event.modifiers |= activeFlag; - else - event.modifiers &= ~activeFlag; - - nsPluginEvent pluginEvent = { &event, window }; - PRBool handled = PR_FALSE; - - handler->HandleEvent(&pluginEvent, &handled); -} - -RegisteredWindow** GetRegisteredWindow(nsPluginPlatformWindowRef window) -{ - RegisteredWindow** link = &theRegisteredWindows; - RegisteredWindow* registeredWindow = *link; - while (registeredWindow != NULL) { - if (registeredWindow->mWindow == window) - return link; - link = ®isteredWindow->mNext; - registeredWindow = *link; - } - return NULL; -} -RegisteredWindow* FindRegisteredWindow(nsPluginPlatformWindowRef window); -RegisteredWindow* FindRegisteredWindow(nsPluginPlatformWindowRef window) -{ - RegisteredWindow** link = GetRegisteredWindow(window); - return (link != NULL ? *link : NULL); -} - -/** - * This method filters events using a very low-level mechanism known as a jGNE filter. - * This filter gets first crack at all events before they are returned by WaitNextEvent - * or EventAvail. One trickiness is that the filter runs in all processes, so care - * must be taken not to act on events if the browser's process isn't current. - * So far, with activates, updates, and mouse clicks, it works quite well. - */ -Boolean EventFilter(EventRecord* event) -{ - Boolean filteredEvent = false; - - WindowRef window = WindowRef(event->message); - nsPluginEvent pluginEvent = { event, window }; - EventRecord simulatedEvent; - - RegisteredWindow* registeredWindow; - PRBool handled = PR_FALSE; - - // see if this event is for one of our registered windows. - switch (event->what) { - case nullEvent: - // See if the frontmost window is one of our registered windows. - // we want to somehow deliver mouse enter/leave events. - window = ::FrontWindow(); - registeredWindow = FindRegisteredWindow(window); - if (registeredWindow != NULL) { - simulatedEvent = *event; - simulatedEvent.what = nsPluginEventType_AdjustCursorEvent; - pluginEvent.event = &simulatedEvent; - pluginEvent.window = registeredWindow->mWindow; - registeredWindow->mHandler->HandleEvent(&pluginEvent, &handled); - } - break; - case keyDown: - case keyUp: - case autoKey: - // See if the frontmost window is one of our registered windows. - window = ::FrontWindow(); - registeredWindow = FindRegisteredWindow(window); - if (registeredWindow != NULL) { - pluginEvent.window = window; - registeredWindow->mHandler->HandleEvent(&pluginEvent, &handled); - filteredEvent = true; - } - break; - case mouseDown: - // use FindWindow to see if the click was in one our registered windows. - short partCode = FindWindow(event->where, &window); - switch (partCode) { - case inContent: - case inDrag: - case inGrow: - case inGoAway: - case inZoomIn: - case inZoomOut: - case inCollapseBox: - case inProxyIcon: - registeredWindow = FindRegisteredWindow(window); - if (registeredWindow != NULL) { - // make sure this window has been activated before passing it the click. - if (theActiveWindow == NULL) { - sendActivateEvent(registeredWindow->mHandler, window, true); - theActiveWindow = registeredWindow; - } - pluginEvent.window = window; - registeredWindow->mHandler->HandleEvent(&pluginEvent, &handled); - filteredEvent = true; - } else if (theActiveWindow != NULL) { - // a click is going into an unregistered window, if we are active, - // the browser doesn't seem to be generating a deactivate event. - // I think this is because PowerPlant is managing the windows, dang it. - window = theActiveWindow->mWindow; - sendActivateEvent(theActiveWindow->mHandler, window, false); - ::HiliteWindow(window, false); - theActiveWindow = NULL; - } - break; - } - break; - case activateEvt: - registeredWindow = FindRegisteredWindow(window); - if (registeredWindow != NULL) { - registeredWindow->mHandler->HandleEvent(&pluginEvent, &handled); - filteredEvent = true; - theActiveWindow = registeredWindow; - } - break; - case updateEvt: - registeredWindow = FindRegisteredWindow(window); - if (registeredWindow != NULL) { - GrafPtr port; GetPort(&port); SetPort(window); BeginUpdate(window); - registeredWindow->mHandler->HandleEvent(&pluginEvent, &handled); - EndUpdate(window); SetPort(port); - filteredEvent = true; - } - break; - case osEvt: - if ((event->message & osEvtMessageMask) == (suspendResumeMessage << 24)) { - registeredWindow = theActiveWindow; - if (registeredWindow != NULL) { - window = registeredWindow->mWindow; - Boolean active = (event->message & resumeFlag) != 0; - sendActivateEvent(registeredWindow->mHandler, window, active); - pluginEvent.window = window; - registeredWindow->mHandler->HandleEvent(&pluginEvent, &handled); - ::HiliteWindow(window, active); - } - } - break; - } - - return filteredEvent; -} - -// TODO: find out what range of menus Communicator et. al. uses. -enum { - kBaseMenuID = 20000, - kBaseSubMenuID = 200 -}; - -static PRInt16 nextMenuID = kBaseMenuID; -static PRInt16 nextSubMenuID = kBaseSubMenuID; - -Boolean MenuFilter(long menuSelection) -{ - if (theActiveWindow != NULL) { - UInt16 menuID = (menuSelection >> 16); - if ((menuID >= kBaseMenuID && menuID < nextMenuID) || (menuID >= kBaseSubMenuID && menuID < nextSubMenuID)) { - EventRecord menuEvent; - ::OSEventAvail(0, &menuEvent); - menuEvent.what = nsPluginEventType_MenuCommandEvent; - menuEvent.message = menuSelection; - - WindowRef window = theActiveWindow->mWindow; - nsPluginEvent pluginEvent = { &menuEvent, window }; - PRBool handled = PR_FALSE; - theActiveWindow->mHandler->HandleEvent(&pluginEvent, &handled); - - return handled; - } - } - return false; -} diff --git a/plugin/oji/MRJ/plugin/Source/AltWindowHandling.h b/plugin/oji/MRJ/plugin/Source/AltWindowHandling.h deleted file mode 100644 index a60e2c8fd5f2..000000000000 --- a/plugin/oji/MRJ/plugin/Source/AltWindowHandling.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#pragma once - -/* - AltWindowHandling.h - */ - -typedef struct RegisteredWindow { - RegisteredWindow* mNext; - nsIEventHandler* mHandler; - nsPluginPlatformWindowRef mWindow; - - RegisteredWindow(RegisteredWindow* next, nsIEventHandler* handler, nsPluginPlatformWindowRef window) - : mNext(next), mHandler(handler), mWindow(window) - { - NS_ADDREF(mHandler); - } - - ~RegisteredWindow() - { - NS_RELEASE(mHandler); - } - } RegisteredWindow; - -NS_METHOD -AltRegisterWindow(nsIEventHandler* handler, nsPluginPlatformWindowRef window); - -NS_METHOD -AltUnregisterWindow(nsIEventHandler* handler, nsPluginPlatformWindowRef window); diff --git a/plugin/oji/MRJ/plugin/Source/AsyncMessage.h b/plugin/oji/MRJ/plugin/Source/AsyncMessage.h deleted file mode 100644 index 8729b17c3024..000000000000 --- a/plugin/oji/MRJ/plugin/Source/AsyncMessage.h +++ /dev/null @@ -1,58 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - AsyncMessage.h - - Base class for messages that are executed asynchronously, during MRJSession idle time. - - by Patrick C. Beard. - */ - -#pragma once - -#include "MRJSession.h" - -class AsyncMessage : public NativeMessage { -public: - AsyncMessage(MRJSession* session) : mSession(session) {} - virtual ~AsyncMessage() {} - - void send(Boolean async = false); - -protected: - MRJSession* mSession; -}; diff --git a/plugin/oji/MRJ/plugin/Source/BackwardAdapter.cpp b/plugin/oji/MRJ/plugin/Source/BackwardAdapter.cpp deleted file mode 100644 index 5e78be1b61a8..000000000000 --- a/plugin/oji/MRJ/plugin/Source/BackwardAdapter.cpp +++ /dev/null @@ -1,2554 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -//////////////////////////////////////////////////////////////////////////////// -// Backward Adapter -// This acts as a adapter layer to allow 5.0 plugins work with the 4.0/3.0 -// browser. -//////////////////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////////////////// -// SECTION 1 - Includes -//////////////////////////////////////////////////////////////////////////////// - -#include "npapi.h" -#include "nsIPluginManager2.h" -#include "nsIServiceManager.h" -#include "nsMemory.h" -#include "nsLiveConnect.h" -#include "nsIEventHandler.h" -#include "nsplugin.h" -#include "nsDebug.h" -#include "nsIJRILiveConnectPlugin.h" -#include "nsIJRILiveConnectPIPeer.h" -#include "nsIPluginInputStream.h" -#include "nsObsoleteModuleLoading.h" - -#ifdef XP_MAC -#include "EventFilter.h" -#include -#endif - -//////////////////////////////////////////////////////////////////////////////// -// SECTION 3 - Classes -//////////////////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////////////////// -// -// CPluginManager -// -// This is the dummy plugin manager that interacts with the 5.0 plugin. -// - -#pragma mark CPluginManager - -class CPluginManager : public nsIPluginManager2, public nsIServiceManager, public nsIMemory { -public: - // Need an operator new for this. - void* operator new(size_t size) { return ::NPN_MemAlloc(size); } - void operator delete(void* ptr) { ::NPN_MemFree(ptr); } - - CPluginManager(void); - virtual ~CPluginManager(void); - - NS_DECL_ISUPPORTS - - //////////////////////////////////////////////////////////////////////////// - // from nsIPluginManager: - - /** - * Returns the value of a variable associated with the plugin manager. - * - * (Corresponds to NPN_GetValue.) - * - * @param variable - the plugin manager variable to get - * @param value - the address of where to store the resulting value - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - GetValue(nsPluginManagerVariable variable, void *value); - - /** - * Causes the plugins directory to be searched again for new plugin - * libraries. - * - * (Corresponds to NPN_ReloadPlugins.) - * - * @param reloadPages - indicates whether currently visible pages should - * also be reloaded - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - ReloadPlugins(PRBool reloadPages); - - /** - * Returns the user agent string for the browser. - * - * (Corresponds to NPN_UserAgent.) - * - * @param resultingAgentString - the resulting user agent string - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - UserAgent(const char* *resultingAgentString); - - /** - * Fetches a URL. - * - * (Corresponds to NPN_GetURL and NPN_GetURLNotify.) - * - * @param pluginInst - the plugin making the request. If NULL, the URL - * is fetched in the background. - * @param url - the URL to fetch - * @param target - the target window into which to load the URL - * @param notifyData - when present, URLNotify is called passing the - * notifyData back to the client. When NULL, this call behaves like - * NPN_GetURL. - * @param altHost - an IP-address string that will be used instead of the - * host specified in the URL. This is used to prevent DNS-spoofing - * attacks. Can be defaulted to NULL meaning use the host in the URL. - * @param referrer - the referring URL (may be NULL) - * @param forceJSEnabled - forces JavaScript to be enabled for 'javascript:' - * URLs, even if the user currently has JavaScript disabled (usually - * specify PR_FALSE) - * @result - NS_OK if this operation was successful - */ - - NS_IMETHOD - GetURL(nsISupports* pluginInst, - const char* url, - const char* target = NULL, - nsIPluginStreamListener* streamListener = NULL, - const char* altHost = NULL, - const char* referrer = NULL, - PRBool forceJSEnabled = PR_FALSE); - - /** - * Posts to a URL with post data and/or post headers. - * - * (Corresponds to NPN_PostURL and NPN_PostURLNotify.) - * - * @param pluginInst - the plugin making the request. If NULL, the URL - * is fetched in the background. - * @param url - the URL to fetch - * @param target - the target window into which to load the URL - * @param postDataLength - the length of postData (if non-NULL) - * @param postData - the data to POST. NULL specifies that there is not post - * data - * @param isFile - whether the postData specifies the name of a file to - * post instead of data. The file will be deleted afterwards. - * @param notifyData - when present, URLNotify is called passing the - * notifyData back to the client. When NULL, this call behaves like - * NPN_GetURL. - * @param altHost - an IP-address string that will be used instead of the - * host specified in the URL. This is used to prevent DNS-spoofing - * attacks. Can be defaulted to NULL meaning use the host in the URL. - * @param referrer - the referring URL (may be NULL) - * @param forceJSEnabled - forces JavaScript to be enabled for 'javascript:' - * URLs, even if the user currently has JavaScript disabled (usually - * specify PR_FALSE) - * @param postHeadersLength - the length of postHeaders (if non-NULL) - * @param postHeaders - the headers to POST. NULL specifies that there - * are no post headers - * @result - NS_OK if this operation was successful - */ - - NS_IMETHOD - PostURL(nsISupports* pluginInst, - const char* url, - PRUint32 postDataLen, - const char* postData, - PRBool isFile = PR_FALSE, - const char* target = NULL, - nsIPluginStreamListener* streamListener = NULL, - const char* altHost = NULL, - const char* referrer = NULL, - PRBool forceJSEnabled = PR_FALSE, - PRUint32 postHeadersLength = 0, - const char* postHeaders = NULL); - - NS_IMETHOD - RegisterPlugin(REFNSIID aCID, - const char* aPluginName, - const char* aDescription, - const char** aMimeTypes, - const char** aMimeDescriptions, - const char** aFileExtensions, - PRInt32 aCount); - - NS_IMETHOD - UnregisterPlugin(REFNSIID aCID); - - NS_IMETHOD - GetURLWithHeaders(nsISupports* pluginInst, - const char* url, - const char* target = NULL, - nsIPluginStreamListener* streamListener = NULL, - const char* altHost = NULL, - const char* referrer = NULL, - PRBool forceJSEnabled = PR_FALSE, - PRUint32 getHeadersLength = 0, - const char* getHeaders = NULL); - - - //////////////////////////////////////////////////////////////////////////// - // from nsIPluginManager2: - - /** - * Puts up a wait cursor. - * - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - BeginWaitCursor(void) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * Restores the previous (non-wait) cursor. - * - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - EndWaitCursor(void) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * Returns true if a URL protocol (e.g. "http") is supported. - * - * @param protocol - the protocol name - * @param result - true if the protocol is supported - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - SupportsURLProtocol(const char* protocol, PRBool *result) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * This method may be called by the plugin to indicate that an error - * has occurred, e.g. that the plugin has failed or is shutting down - * spontaneously. This allows the browser to clean up any plugin-specific - * state. - * - * @param plugin - the plugin whose status is changing - * @param errorStatus - the the error status value - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - NotifyStatusChange(nsIPlugin* plugin, nsresult errorStatus) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * Returns the proxy info for a given URL. The caller is required to - * free the resulting memory with nsIMalloc::Free. The result will be in the - * following format - * - * i) "DIRECT" -- no proxy - * ii) "PROXY xxx.xxx.xxx.xxx" -- use proxy - * iii) "SOCKS xxx.xxx.xxx.xxx" -- use SOCKS - * iv) Mixed. e.g. "PROXY 111.111.111.111;PROXY 112.112.112.112", - * "PROXY 111.111.111.111;SOCKS 112.112.112.112".... - * - * Which proxy/SOCKS to use is determined by the plugin. - */ - NS_IMETHOD - FindProxyForURL(const char* url, char* *result) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - //////////////////////////////////////////////////////////////////////////// - // New top-level window handling calls for Mac: - - /** - * Registers a top-level window with the browser. Events received by that - * window will be dispatched to the event handler specified. - * - * @param handler - the event handler for the window - * @param window - the platform window reference - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - RegisterWindow(nsIEventHandler* handler, nsPluginPlatformWindowRef window); - - /** - * Unregisters a top-level window with the browser. The handler and window pair - * should be the same as that specified to RegisterWindow. - * - * @param handler - the event handler for the window - * @param window - the platform window reference - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - UnregisterWindow(nsIEventHandler* handler, nsPluginPlatformWindowRef window); - - /** - * Allocates a new menu ID (for the Mac). - * - * @param handler - the event handler for the window - * @param isSubmenu - whether this is a sub-menu ID or not - * @param result - the resulting menu ID - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - AllocateMenuID(nsIEventHandler* handler, PRBool isSubmenu, PRInt16 *result); - - /** - * Deallocates a menu ID (for the Mac). - * - * @param handler - the event handler for the window - * @param menuID - the menu ID - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - DeallocateMenuID(nsIEventHandler* handler, PRInt16 menuID) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * Indicates whether this event handler has allocated the given menu ID. - * - * @param handler - the event handler for the window - * @param menuID - the menu ID - * @param result - returns PR_TRUE if the menu ID is allocated - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - HasAllocatedMenuID(nsIEventHandler* handler, PRInt16 menuID, PRBool *result) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - //////////////////////////////////////////////////////////////////////////// - // from nsIServiceManager: - - NS_IMETHOD - GetService(const nsCID& aClass, const nsIID& aIID, void* *result); - - NS_IMETHOD - GetServiceByContractID(const char *aContractID, const nsIID & aIID, void * *result) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - NS_IMETHOD - IsServiceInstantiated(const nsCID & aClass, const nsIID & aIID, PRBool *_retval) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - NS_IMETHOD - IsServiceInstantiatedByContractID(const char *aContractID, const nsIID & aIID, PRBool *_retval) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * Allocates a block of memory of a particular size. - * - * @param size - the size of the block to allocate - * @result the block of memory - */ - NS_IMETHOD_(void*) - Alloc(size_t size); - - /** - * Reallocates a block of memory to a new size. - * - * @param ptr - the block of memory to reallocate - * @param size - the new size - * @result the rellocated block of memory - */ - NS_IMETHOD_(void*) - Realloc(void* ptr, size_t size); - - /** - * Frees a block of memory. - * - * @param ptr - the block of memory to free - */ - NS_IMETHOD_(void) - Free(void* ptr); - - NS_IMETHOD - IsLowMemory(PRBool *_retval) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * Attempts to shrink the heap. - */ - NS_IMETHOD - HeapMinimize(PRBool aImmediate); - -private: - nsILiveconnect* mLiveconnect; - - struct RegisteredWindow { - RegisteredWindow* mNext; - nsIEventHandler* mHandler; - nsPluginPlatformWindowRef mWindow; - - RegisteredWindow(RegisteredWindow* next, nsIEventHandler* handler, nsPluginPlatformWindowRef window) - : mNext(next), mHandler(handler), mWindow(window) - { - NS_ADDREF(mHandler); - } - - ~RegisteredWindow() - { - NS_RELEASE(mHandler); - } - }; - - static RegisteredWindow* theRegisteredWindows; - static RegisteredWindow* theActiveWindow; - - static RegisteredWindow** GetRegisteredWindow(nsPluginPlatformWindowRef window); - static RegisteredWindow* FindRegisteredWindow(nsPluginPlatformWindowRef window); - -#ifdef XP_MAC - Boolean mEventFiltersInstalled; - - static Boolean EventFilter(EventRecord* event); - static Boolean MenuFilter(long menuSelection); -#endif -}; - -//////////////////////////////////////////////////////////////////////////////// -// -// CPluginManagerStream -// -// This is the dummy plugin manager stream that interacts with the 5.0 plugin. -// - -#pragma mark CPluginManagerStream - -class CPluginManagerStream : public nsIOutputStream { -public: - - CPluginManagerStream(NPP npp, NPStream* pstr); - virtual ~CPluginManagerStream(void); - - NS_DECL_ISUPPORTS - - ////////////////////////////////////////////////////////////////////////// - // - // Taken from nsIStream - // - - /** Write data into the stream. - * @param aBuf the buffer into which the data is read - * @param aCount the maximum number of bytes to read - * @param errorResult the error code if an error occurs - * @return number of bytes read or -1 if error - */ - NS_IMETHOD - Write(const char* aBuf, PRUint32 aCount, PRUint32 *aWriteCount); - - /** - * Writes data into the stream from an input stream. - * Implementer's note: This method is defined by this interface in order - * to allow the output stream to efficiently copy the data from the input - * stream into its internal buffer (if any). If this method was provide - * as an external facility, a separate char* buffer would need to be used - * in order to call the output stream's other Write method. - * @param fromStream the stream from which the data is read - * @param aWriteCount out parameter to hold the number of - * bytes written. if an error occurs, the writecount - * is undefined - * @return error status - */ - NS_IMETHOD - Write(nsIInputStream* fromStream, PRUint32 *aWriteCount); - - /** - * Flushes the stream. - */ - NS_IMETHOD - Flush(void); - - NS_IMETHOD - WriteFrom(nsIInputStream *inStr, PRUint32 count, PRUint32 *_retval) { - NS_NOTREACHED("WriteFrom"); - return NS_ERROR_NOT_IMPLEMENTED; - } - - NS_IMETHOD - WriteSegments(nsReadSegmentFun reader, void * closure, PRUint32 count, PRUint32 *_retval) { - NS_NOTREACHED("WriteSegments"); - return NS_ERROR_NOT_IMPLEMENTED; - } - - NS_IMETHOD - IsNonBlocking(PRBool *aNonBlocking) { - NS_NOTREACHED("IsNonBlocking"); - return NS_ERROR_NOT_IMPLEMENTED; - } - - ////////////////////////////////////////////////////////////////////////// - // - // Specific methods to nsIPluginManagerStream. - // - - // Corresponds to NPStream's url field. - NS_IMETHOD - GetURL(const char* *result); - - // Corresponds to NPStream's end field. - NS_IMETHOD - GetEnd(PRUint32 *result); - - // Corresponds to NPStream's lastmodfied field. - NS_IMETHOD - GetLastModified(PRUint32 *result); - - // Corresponds to NPStream's notifyData field. - NS_IMETHOD - GetNotifyData(void* *result); - - // Corresponds to NPStream's url field. - NS_IMETHOD Close(void); - -protected: - - // npp - // The plugin instance that the manager stream belongs to. - NPP npp; - - // pstream - // The stream the class is using. - NPStream* pstream; - -}; - -//////////////////////////////////////////////////////////////////////////////// -// -// CPluginInstancePeer -// -// This is the dummy instance peer that interacts with the 5.0 plugin. -// In order to do LiveConnect, the class subclasses nsILiveConnectPluginInstancePeer. -// - -#pragma mark CPluginInstancePeer - -class CPluginInstancePeer : public nsIPluginInstancePeer, public nsIPluginTagInfo, public nsIJRILiveConnectPluginInstancePeer { -public: - - // XXX - I add parameters to the constructor because I wasn't sure if - // XXX - the 4.0 browser had the npp_instance struct implemented. - // XXX - If so, then I can access npp_instance through npp->ndata. - CPluginInstancePeer(nsIPluginInstance* pluginInstance, NPP npp, nsMIMEType typeString, nsPluginMode type, - PRUint16 attribute_cnt, const char** attribute_list, const char** values_list); - - virtual ~CPluginInstancePeer(void); - - NS_DECL_ISUPPORTS - - /** - * Returns the value of a variable associated with the plugin manager. - * - * (Corresponds to NPN_GetValue.) - * - * @param variable - the plugin manager variable to get - * @param value - the address of where to store the resulting value - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - GetValue(nsPluginInstancePeerVariable variable, void *value); - - // (Corresponds to NPN_SetValue.) - NS_IMETHOD - SetValue(nsPluginInstancePeerVariable variable, void *value); - - /** - * Returns the MIME type of the plugin instance. - * - * (Corresponds to NPP_New's MIMEType argument.) - * - * @param result - resulting MIME type - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - GetMIMEType(nsMIMEType *result); - - /** - * Returns the mode of the plugin instance, i.e. whether the plugin is - * embedded in the html, or full page. - * - * (Corresponds to NPP_New's mode argument.) - * - * @param result - the resulting mode - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - GetMode(nsPluginMode *result); - - /** - * This operation is called by the plugin instance when it wishes to send - * a stream of data to the browser. It constructs a new output stream to which - * the plugin may send the data. When complete, the Close and Release methods - * should be called on the output stream. - * - * (Corresponds to NPN_NewStream.) - * - * @param type - type MIME type of the stream to create - * @param target - the target window name to receive the data - * @param result - the resulting output stream - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - NewStream(nsMIMEType type, const char* target, nsIOutputStream* *result); - - /** - * This operation causes status information to be displayed on the window - * associated with the plugin instance. - * - * (Corresponds to NPN_Status.) - * - * @param message - the status message to display - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - ShowStatus(const char* message); - - /** - * Set the desired size of the window in which the plugin instance lives. - * - * @param width - new window width - * @param height - new window height - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - SetWindowSize(PRUint32 width, PRUint32 height); - - // Get a ptr to the paired list of attribute names and values, - // returns the length of the array. - // - // Each name or value is a null-terminated string. - NS_IMETHOD - GetAttributes(PRUint16& n, const char* const*& names, const char* const*& values); - - // Get the value for the named attribute. Returns null - // if the attribute was not set. - NS_IMETHOD - GetAttribute(const char* name, const char* *result); - - /** - * Returns the DOM element corresponding to the tag which references - * this plugin in the document. - * - * REMIND: do we need to expose as an nsISupports * to avoid - * introducing runtime dependencies on XPCOM? - * - * @param result - resulting DOM element - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - GetDOMElement(nsIDOMElement* *result); - - /** - * Returns a JRI env corresponding to the current Java thread of the - * browser. - * - * (Corresponds to NPN_GetJavaEnv.) - * - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - GetJavaEnv(JRIEnv* *resultingEnv); - - /** - * Returns a JRI reference to the Java peer object associated with the - * plugin instance. This object is an instance of the class specified - * by nsIJRILiveConnectPlugin::GetJavaClass. - * - * (Corresponds to NPN_GetJavaPeer.) - * - * @param resultingJavaPeer - a resulting reference to the Java instance - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - GetJavaPeer(jref *resultingJavaPeer); - - nsIPluginInstance* GetInstance(void) { return mInstance; } - NPP GetNPPInstance(void) { return npp; } - - void SetWindow(NPWindow* window) { mWindow = window; } - NPWindow* GetWindow() { return mWindow; } - -protected: - - NPP npp; - // XXX - The next five variables may need to be here since I - // XXX - don't think np_instance is available in 4.0X. - nsIPluginInstance* mInstance; - NPWindow* mWindow; - nsMIMEType typeString; - nsPluginMode type; - PRUint16 attribute_cnt; - char** attribute_list; - char** values_list; -}; - -#pragma mark CPluginStreamInfo - -class CPluginStreamInfo : public nsIPluginStreamInfo { -public: - - CPluginStreamInfo(const char* URL, nsIPluginInputStream* inStr, nsMIMEType type, PRBool seekable) - : mURL(URL), mInputStream(inStr), mMimeType(type), mIsSeekable(seekable) - { - } - - virtual ~CPluginStreamInfo() {} - - NS_DECL_ISUPPORTS - - NS_METHOD - GetContentType(nsMIMEType* result) - { - *result = mMimeType; - return NS_OK; - } - - NS_METHOD - IsSeekable(PRBool* result) - { - *result = mIsSeekable; - return NS_OK; - } - - NS_METHOD - GetLength(PRUint32* result) - { - return mInputStream->Available(result); - } - - NS_METHOD - GetLastModified(PRUint32* result) - { - return mInputStream->GetLastModified(result); - } - - NS_METHOD - GetURL(const char** result) - { - *result = mURL; - return NS_OK; - } - - NS_METHOD - RequestRead(nsByteRange* rangeList) - { - return mInputStream->RequestRead(rangeList); - } - - NS_METHOD - GetStreamOffset(PRInt32 *result) - { - *result = mStreamOffset; - return NS_OK; - } - - - NS_METHOD - SetStreamOffset(PRInt32 offset) - { - mStreamOffset = offset; - return NS_OK; - } - -private: - const char* mURL; - nsIPluginInputStream* mInputStream; - nsMIMEType mMimeType; - PRBool mIsSeekable; - PRInt32 mStreamOffset; -}; - -#pragma mark CPluginInputStream - -class CPluginInputStream : public nsIPluginInputStream { -public: - - NS_DECL_ISUPPORTS - - //////////////////////////////////////////////////////////////////////////// - // from nsIInputStream: - - /** Close the stream. */ - NS_IMETHOD - Close(void); - - /** Return the number of bytes in the stream - * @param aLength out parameter to hold the length - * of the stream. if an error occurs, the length - * will be undefined - * @return error status - */ - NS_IMETHOD - Available(PRUint32 *aLength); - - /** Read data from the stream. - * @param aErrorCode the error code if an error occurs - * @param aBuf the buffer into which the data is read - * @param aCount the maximum number of bytes to read - * @param aReadCount out parameter to hold the number of - * bytes read, eof if 0. if an error occurs, the - * read count will be undefined - * @return error status - */ - NS_IMETHOD - Read(char* aBuf, PRUint32 aCount, PRUint32 *aReadCount); - - NS_IMETHOD ReadSegments(nsWriteSegmentFun writer, void * closure, PRUint32 count, PRUint32 *_retval) { - NS_NOTREACHED("ReadSegments"); - return NS_ERROR_NOT_IMPLEMENTED; - } - - NS_IMETHOD IsNonBlocking(PRBool *aNonBlocking) { - NS_NOTREACHED("IsNonBlocking"); - return NS_ERROR_NOT_IMPLEMENTED; - } - - //////////////////////////////////////////////////////////////////////////// - // from nsIPluginInputStream: - - // (Corresponds to NPStream's lastmodified field.) - NS_IMETHOD - GetLastModified(PRUint32 *result); - - NS_IMETHOD - RequestRead(nsByteRange* rangeList); - - //////////////////////////////////////////////////////////////////////////// - // CPluginInputStream specific methods: - - CPluginInputStream(nsIPluginStreamListener* listener); - virtual ~CPluginInputStream(void); - - void SetStreamInfo(NPP npp, NPStream* stream) { - mNPP = npp; - mStream = stream; - } - - nsIPluginStreamListener* GetListener(void) { return mListener; } - nsPluginStreamType GetStreamType(void) { return mStreamType; } - - nsresult SetReadBuffer(PRUint32 len, const char* buffer) { - // XXX this has to be way more sophisticated - if (mBuffer != NULL) delete[] mBuffer; - mBuffer = dup(len, buffer); - mBufferLength = len; - mAmountRead = 0; - return NS_OK; - } - - static char* dup(PRUint32 len, const char* buffer) { - char* result = new char[len]; - if (result != NULL) - memcpy(result, buffer, len); - return result; - } - - nsIPluginStreamInfo* CreatePluginStreamInfo(const char* url, nsMIMEType type, PRBool seekable) { - if (mStreamInfo == NULL) { - mStreamInfo = new CPluginStreamInfo(url, this, type, seekable); - mStreamInfo->AddRef(); - } - return mStreamInfo; - } - - nsIPluginStreamInfo* GetPluginStreamInfo() { - return mStreamInfo; - } - -protected: - const char* mURL; - nsIPluginStreamListener* mListener; - nsPluginStreamType mStreamType; - NPP mNPP; - NPStream* mStream; - char* mBuffer; - PRUint32 mBufferLength; - PRUint32 mAmountRead; - nsIPluginStreamInfo* mStreamInfo; -}; - -////////////////////////////////////////////////////////////////////////////// - -#ifdef XP_UNIX -#define TRACE(foo) trace(foo) -#endif - -#ifdef XP_MAC -#undef assert -#define assert(cond) -#endif - -//#if defined(__cplusplus) -//extern "C" { -//#endif - -//////////////////////////////////////////////////////////////////////////////// -// SECTION 1 - Includes -//////////////////////////////////////////////////////////////////////////////// - -#if defined(XP_UNIX) || defined(XP_MAC) -#include -#include -#include -#else -#include -#endif - -//////////////////////////////////////////////////////////////////////////////// -// SECTION 2 - Global Variables -//////////////////////////////////////////////////////////////////////////////// -#pragma mark Globals - -// -// thePlugin and thePluginManager are used in the life of the plugin. -// -// These two will be created on NPP_Initialize and destroyed on NPP_Shutdown. -// -#pragma export on -nsIPluginManager* thePluginManager = NULL; -nsIPlugin* thePlugin = NULL; -#pragma export off - -// -// Interface IDs -// -#pragma mark IIDs - -static NS_DEFINE_CID(kPluginCID, NS_PLUGIN_CID); -static NS_DEFINE_CID(kPluginManagerCID, NS_PLUGINMANAGER_CID); -static NS_DEFINE_CID(kMemoryCID, NS_MEMORY_CID); - -// mapping from NPError to nsresult -nsresult fromNPError[] = { - NS_OK, // NPERR_NO_ERROR, - NS_ERROR_FAILURE, // NPERR_GENERIC_ERROR, - NS_ERROR_FAILURE, // NPERR_INVALID_INSTANCE_ERROR, - NS_ERROR_NOT_INITIALIZED, // NPERR_INVALID_FUNCTABLE_ERROR, - NS_ERROR_FACTORY_NOT_LOADED, // NPERR_MODULE_LOAD_FAILED_ERROR, - NS_ERROR_OUT_OF_MEMORY, // NPERR_OUT_OF_MEMORY_ERROR, - NS_NOINTERFACE, // NPERR_INVALID_PLUGIN_ERROR, - NS_ERROR_ILLEGAL_VALUE, // NPERR_INVALID_PLUGIN_DIR_ERROR, - NS_NOINTERFACE, // NPERR_INCOMPATIBLE_VERSION_ERROR, - NS_ERROR_ILLEGAL_VALUE, // NPERR_INVALID_PARAM, - NS_ERROR_ILLEGAL_VALUE, // NPERR_INVALID_URL, - NS_ERROR_ILLEGAL_VALUE, // NPERR_FILE_NOT_FOUND, - NS_ERROR_FAILURE, // NPERR_NO_DATA, - NS_ERROR_FAILURE // NPERR_STREAM_NOT_SEEKABLE, -}; - -//////////////////////////////////////////////////////////////////////////////// -// SECTION 4 - API Shim Plugin Implementations -// Glue code to the 5.0x Plugin. -// -// Most of the NPP_* functions that interact with the plug-in will need to get -// the instance peer from npp->pdata so it can get the plugin instance from the -// peer. Once the plugin instance is available, the appropriate 5.0 plug-in -// function can be called: -// -// CPluginInstancePeer* peer = (CPluginInstancePeer* )instance->pdata; -// nsIPluginInstance* inst = peer->GetUserInstance(); -// inst->NewPluginAPIFunction(); -// -// Similar steps takes place with streams. The stream peer is stored in NPStream's -// pdata. Get the peer, get the stream, call the function. -// - -//////////////////////////////////////////////////////////////////////////////// -// UNIX-only API calls -//////////////////////////////////////////////////////////////////////////////// - -#ifdef XP_UNIX -char* NPP_GetMIMEDescription(void) -{ - int freeFac = 0; - //fprintf(stderr, "MIME description\n"); - if (thePlugin == NULL) { - freeFac = 1; - NSGetFactory(thePluginManager, kPluginCID, NULL, NULL, (nsIFactory** )&thePlugin); - } - //fprintf(stderr, "Allocated Plugin 0x%08x\n", thePlugin); - const char * ret; - nsresult err = thePlugin->GetMIMEDescription(&ret); - if (err) return NULL; - //fprintf(stderr, "Get response %s\n", ret); - if (freeFac) { - //fprintf(stderr, "Freeing plugin..."); - thePlugin->Release(); - thePlugin = NULL; - } - //fprintf(stderr, "Done\n"); - return (char*)ret; -} - - -//------------------------------------------------------------------------------ -// Cross-Platform Plug-in API Calls -//------------------------------------------------------------------------------ - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// NPP_SetValue: -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NPError -NPP_SetValue(NPP instance, NPNVariable variable, void *value) -{ - return NPERR_GENERIC_ERROR; // nothing to set -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// NPP_GetValue: -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NPError -NPP_GetValue(NPP instance, NPPVariable variable, void *value) { - int freeFac = 0; - //fprintf(stderr, "MIME description\n"); - if (thePlugin == NULL) { - freeFac = 1; - if (NSGetFactory(thePluginManager, kPluginCID, NULL, NULL, (nsIFactory** )&thePlugin) != NS_OK) - return NPERR_GENERIC_ERROR; - } - //fprintf(stderr, "Allocated Plugin 0x%08x\n", thePlugin); - nsresult err = thePlugin->GetValue((nsPluginVariable)variable, value); - if (err) return NPERR_GENERIC_ERROR; - //fprintf(stderr, "Get response %08x\n", ret); - if (freeFac) { - //fprintf(stderr, "Freeing plugin..."); - thePlugin->Release(); - thePlugin = NULL; - } - //fprintf(stderr, "Done\n"); - return NPERR_NO_ERROR; -} -#endif // XP_UNIX - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// NPP_Initialize: -// Provides global initialization for a plug-in, and returns an error value. -// -// This function is called once when a plug-in is loaded, before the first instance -// is created. thePluginManager and thePlugin are both initialized. -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NPError -NPP_Initialize(void) -{ -// TRACE("NPP_Initialize\n"); - - // Only call initialize the plugin if it hasn't been created. - // This could happen if GetJavaClass() is called before - // NPP Initialize. - if (thePluginManager == NULL) { - // Create the plugin manager and plugin classes. - thePluginManager = new CPluginManager(); - if ( thePluginManager == NULL ) - return NPERR_OUT_OF_MEMORY_ERROR; - thePluginManager->AddRef(); - } - NPError error = NPERR_INVALID_PLUGIN_ERROR; - // On UNIX the plugin might have been created when calling NPP_GetMIMEType. - if (thePlugin == NULL) { - // create nsIPlugin factory - nsresult result = NSGetFactory(thePluginManager, kPluginCID, NULL, NULL, (nsIFactory**)&thePlugin); - if (result == NS_OK && thePlugin->Initialize() == NS_OK) - error = NPERR_NO_ERROR; - - } - - return error; -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// NPP_GetJavaClass: -// New in Netscape Navigator 3.0. -// -// NPP_GetJavaClass is called during initialization to ask your plugin -// what its associated Java class is. If you don't have one, just return -// NULL. Otherwise, use the javah-generated "use_" function to both -// initialize your class and return it. If you can't find your class, an -// error will be signalled by "use_" and will cause the Navigator to -// complain to the user. -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -jref -NPP_GetJavaClass(void) -{ - jref pluginClass = NULL; - if (thePlugin != NULL) { - nsIJRILiveConnectPlugin* jriPlugin = NULL; - if (thePlugin->QueryInterface(NS_GET_IID(nsIJRILiveConnectPlugin), (void**)&jriPlugin) == NS_OK) { - jriPlugin->GetJavaClass(NPN_GetJavaEnv(), &pluginClass); - NS_RELEASE(jriPlugin); - } - } - return pluginClass; -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// NPP_Shutdown: -// Provides global deinitialization for a plug-in. -// -// This function is called once after the last instance of your plug-in -// is destroyed. thePluginManager and thePlugin are delete at this time. -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -void -NPP_Shutdown(void) -{ -// TRACE("NPP_Shutdown\n"); - - if (thePlugin) - { - thePlugin->Shutdown(); - thePlugin->Release(); - thePlugin = NULL; - } - - if (thePluginManager) { - thePluginManager->Release(); - thePluginManager = NULL; - } - - return; -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// NPP_New: -// Creates a new instance of a plug-in and returns an error value. -// -// A plugin instance peer and instance peer is created. After -// a successful instansiation, the peer is stored in the plugin -// instance's pdata. -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NPError -NPP_New(NPMIMEType pluginType, - NPP instance, - PRUint16 mode, - int16 argc, - char* argn[], - char* argv[], - NPSavedData* saved) -{ -// TRACE("NPP_New\n"); - - if (instance == NULL) - return NPERR_INVALID_INSTANCE_ERROR; - - // Create a new plugin instance and start it. - nsIPluginInstance* pluginInstance = NULL; - thePlugin->CreatePluginInstance(thePluginManager, NS_GET_IID(nsIPluginInstance), pluginType, (void**)&pluginInstance); - if (pluginInstance == NULL) { - return NPERR_OUT_OF_MEMORY_ERROR; - } - - // Create a new plugin instance peer, - // XXX - Since np_instance is not implemented in the 4.0x browser, I - // XXX - had to save the plugin parameter in the peer class. - // XXX - Ask Warren about np_instance. - CPluginInstancePeer* peer = new CPluginInstancePeer(pluginInstance, instance, - (nsMIMEType)pluginType, - (nsPluginMode)mode, (PRUint16)argc, - (const char** )argn, (const char** )argv); - assert( peer != NULL ); - if (!peer) return NPERR_OUT_OF_MEMORY_ERROR; - peer->AddRef(); - pluginInstance->Initialize(peer); - pluginInstance->Start(); - // Set the user instance and store the peer in npp->pdata. - instance->pdata = peer; - peer->Release(); - - return NPERR_NO_ERROR; -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// NPP_Destroy: -// Deletes a specific instance of a plug-in and returns an error value. -// -// The plugin instance peer and plugin instance are destroyed. -// The instance's pdata is set to NULL. -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NPError -NPP_Destroy(NPP instance, NPSavedData** save) -{ -// TRACE("NPP_Destroy\n"); - - if (instance == NULL) - return NPERR_INVALID_INSTANCE_ERROR; - - CPluginInstancePeer* peer = (CPluginInstancePeer*) instance->pdata; - nsIPluginInstance* pluginInstance = peer->GetInstance(); - pluginInstance->Stop(); - pluginInstance->Destroy(); - pluginInstance->Release(); - // peer->Release(); - instance->pdata = NULL; - - return NPERR_NO_ERROR; -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// NPP_SetWindow: -// Sets the window in which a plug-in draws, and returns an error value. -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NPError -NPP_SetWindow(NPP instance, NPWindow* window) -{ -// TRACE("NPP_SetWindow\n"); - - if (instance == NULL) - return NPERR_INVALID_INSTANCE_ERROR; - - CPluginInstancePeer* peer = (CPluginInstancePeer*) instance->pdata; - if ( peer == NULL) - return NPERR_INVALID_PLUGIN_ERROR; - - // record the window in the peer, so we can deliver proper events. - peer->SetWindow(window); - - nsIPluginInstance* pluginInstance = peer->GetInstance(); - if( pluginInstance == 0 ) - return NPERR_INVALID_PLUGIN_ERROR; - - return (NPError)pluginInstance->SetWindow((nsPluginWindow* ) window ); -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// NPP_NewStream: -// Notifies an instance of a new data stream and returns an error value. -// -// Create a stream peer and stream. If succesful, save -// the stream peer in NPStream's pdata. -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NPError -NPP_NewStream(NPP instance, - NPMIMEType type, - NPStream *stream, - NPBool seekable, - PRUint16 *stype) -{ - // XXX - How do you set the fields of the peer stream and stream? - // XXX - Looks like these field will have to be created since - // XXX - We are not using np_stream. - -// TRACE("NPP_NewStream\n"); - - if (instance == NULL) - return NPERR_INVALID_INSTANCE_ERROR; - - CPluginInputStream* inStr = (CPluginInputStream*)stream->notifyData; - if (inStr == NULL) - return NPERR_GENERIC_ERROR; - - nsIPluginStreamInfo* info = inStr->CreatePluginStreamInfo(stream->url, type, seekable); - nsresult err = inStr->GetListener()->OnStartBinding(info); - if (err) return err; - - inStr->SetStreamInfo(instance, stream); - stream->pdata = inStr; - *stype = inStr->GetStreamType(); - - return NPERR_NO_ERROR; -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// NPP_WriteReady: -// Returns the maximum number of bytes that an instance is prepared to accept -// from the stream. -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -int32 -NPP_WriteReady(NPP instance, NPStream *stream) -{ -// TRACE("NPP_WriteReady\n"); - - if (instance == NULL) - return -1; - - CPluginInputStream* inStr = (CPluginInputStream*)stream->pdata; - if (inStr == NULL) - return -1; - return NP_MAXREADY; -} - - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// NPP_Write: -// Delivers data from a stream and returns the number of bytes written. -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -int32 -NPP_Write(NPP instance, NPStream *stream, int32 offset, int32 len, void *buffer) -{ -// TRACE("NPP_Write\n"); - - if (instance == NULL) - return -1; - - CPluginInputStream* inStr = (CPluginInputStream*)stream->pdata; - if (inStr == NULL) - return -1; - nsresult err = inStr->SetReadBuffer((PRUint32)len, (const char*)buffer); - if (err != NS_OK) return -1; - err = inStr->GetListener()->OnDataAvailable(inStr->GetPluginStreamInfo(), inStr, len); - if (err != NS_OK) return -1; - return len; -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// NPP_DestroyStream: -// Indicates the closure and deletion of a stream, and returns an error value. -// -// The stream peer and stream are destroyed. NPStream's -// pdata is set to NULL. -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NPError -NPP_DestroyStream(NPP instance, NPStream *stream, NPReason reason) -{ -// TRACE("NPP_DestroyStream\n"); - - if (instance == NULL) - return NPERR_INVALID_INSTANCE_ERROR; - - CPluginInputStream* inStr = (CPluginInputStream*)stream->pdata; - if (inStr == NULL) - return NPERR_GENERIC_ERROR; - inStr->GetListener()->OnStopBinding(inStr->GetPluginStreamInfo(), (nsPluginReason)reason); - // inStr->Release(); - stream->pdata = NULL; - - return NPERR_NO_ERROR; -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// NPP_StreamAsFile: -// Provides a local file name for the data from a stream. -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -void -NPP_StreamAsFile(NPP instance, NPStream *stream, const char* fname) -{ -// TRACE("NPP_StreamAsFile\n"); - - if (instance == NULL) - return; - - CPluginInputStream* inStr = (CPluginInputStream*)stream->pdata; - if (inStr == NULL) - return; - (void)inStr->GetListener()->OnFileAvailable(inStr->GetPluginStreamInfo(), fname); -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// NPP_Print: -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -void -NPP_Print(NPP instance, NPPrint* printInfo) -{ -// TRACE("NPP_Print\n"); - - if(printInfo == NULL) // trap invalid parm - return; - - if (instance != NULL) - { - CPluginInstancePeer* peer = (CPluginInstancePeer*) instance->pdata; - nsIPluginInstance* pluginInstance = peer->GetInstance(); - pluginInstance->Print((nsPluginPrint* ) printInfo ); - } -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// NPP_URLNotify: -// Notifies the instance of the completion of a URL request. -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -void -NPP_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData) -{ -// TRACE("NPP_URLNotify\n"); - - if (instance != NULL) { - CPluginInputStream* inStr = (CPluginInputStream*)notifyData; - (void)inStr->GetListener()->OnStopBinding(inStr->GetPluginStreamInfo(), (nsPluginReason)reason); - inStr->Release(); - } -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// NPP_HandleEvent: -// Mac-only, but stub must be present for Windows -// Delivers a platform-specific event to the instance. -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -#ifndef XP_UNIX -int16 -NPP_HandleEvent(NPP instance, void* event) -{ -// TRACE("NPP_HandleEvent\n"); - int16 eventHandled = FALSE; - if (instance == NULL) - return eventHandled; - - NPEvent* npEvent = (NPEvent*) event; - nsPluginEvent pluginEvent = { -#ifdef XP_MAC - npEvent, NULL -#else - npEvent->event, npEvent->wParam, npEvent->lParam -#endif - }; - - CPluginInstancePeer* peer = (CPluginInstancePeer*) instance->pdata; - nsIPluginInstance* pluginInstance = peer->GetInstance(); - if (pluginInstance) { - PRBool handled; - nsresult err = pluginInstance->HandleEvent(&pluginEvent, &handled); - if (err) return FALSE; - eventHandled = (handled == PR_TRUE); - } - - return eventHandled; -} -#endif // ndef XP_UNIX - -////////////////////////////////////////////////////////////////////////////// -// SECTION 5 - API Browser Implementations -// -// Glue code to the 4.0x Browser. -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -// -// CPluginManager -// - -//****************************************************************************** -// -// Once we moved to the new APIs, we need to implement fJVMMgr. -// -//****************************************************************************** - -CPluginManager::CPluginManager(void) -{ - mLiveconnect = NULL; - -#ifdef XP_MAC - mEventFiltersInstalled = false; -#endif -} - -CPluginManager::~CPluginManager(void) -{ - NS_IF_RELEASE(mLiveconnect); - -#ifdef XP_MAC - if (mEventFiltersInstalled) - RemoveEventFilters(); -#endif -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// ReloadPlugins: -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NS_METHOD -CPluginManager::ReloadPlugins(PRBool reloadPages) -{ - NPN_ReloadPlugins(reloadPages); - return NS_OK; -} - -NS_METHOD -CPluginManager::GetURL(nsISupports* pluginInst, - const char* url, - const char* target, - nsIPluginStreamListener* streamListener, - const char* altHost, - const char* referrer, - PRBool forceJSEnabled) -{ - if (altHost != NULL || referrer != NULL || forceJSEnabled != PR_FALSE) { - return NPERR_INVALID_PARAM; - } - - nsIPluginInstance* inst = NULL; - nsresult rslt = pluginInst->QueryInterface(NS_GET_IID(nsIPluginInstance), (void**)&inst); - if (rslt != NS_OK) return rslt; - CPluginInstancePeer* instancePeer = NULL; - rslt = inst->GetPeer((nsIPluginInstancePeer**)&instancePeer); - if (rslt != NS_OK) { - inst->Release(); - return rslt; - } - NPP npp = instancePeer->GetNPPInstance(); - - NPError err; - if (streamListener) { - CPluginInputStream* inStr = new CPluginInputStream(streamListener); - if (inStr == NULL) { - instancePeer->Release(); - inst->Release(); - return NS_ERROR_OUT_OF_MEMORY; - } - inStr->AddRef(); - - err = NPN_GetURLNotify(npp, url, target, inStr); - } - else { - err = NPN_GetURL(npp, url, target); - } - instancePeer->Release(); - inst->Release(); - return fromNPError[err]; -} - -NS_METHOD -CPluginManager::PostURL(nsISupports* pluginInst, - const char* url, - PRUint32 postDataLen, - const char* postData, - PRBool isFile, - const char* target, - nsIPluginStreamListener* streamListener, - const char* altHost, - const char* referrer, - PRBool forceJSEnabled, - PRUint32 postHeadersLength, - const char* postHeaders) -{ - if (altHost != NULL || referrer != NULL || forceJSEnabled != PR_FALSE - || postHeadersLength != 0 || postHeaders != NULL) { - return NPERR_INVALID_PARAM; - } - - nsIPluginInstance* inst = NULL; - nsresult rslt = pluginInst->QueryInterface(NS_GET_IID(nsIPluginInstance), (void**)&inst); - if (rslt != NS_OK) return rslt; - CPluginInstancePeer* instancePeer = NULL; - rslt = inst->GetPeer((nsIPluginInstancePeer**)&instancePeer); - if (rslt != NS_OK) { - inst->Release(); - return rslt; - } - NPP npp = instancePeer->GetNPPInstance(); - - NPError err; - if (streamListener) { - CPluginInputStream* inStr = new CPluginInputStream(streamListener); - if (inStr == NULL) { - instancePeer->Release(); - inst->Release(); - return NS_ERROR_OUT_OF_MEMORY; - } - inStr->AddRef(); - - err = NPN_PostURLNotify(npp, url, target, postDataLen, postData, isFile, inStr); - } - else { - err = NPN_PostURL(npp, url, target, postDataLen, postData, isFile); - } - instancePeer->Release(); - inst->Release(); - return fromNPError[err]; -} - -NS_IMETHODIMP -CPluginManager::RegisterPlugin(REFNSIID aCID, - const char* aPluginName, - const char* aDescription, - const char** aMimeTypes, - const char** aMimeDescriptions, - const char** aFileExtensions, - PRInt32 aCount) -{ - // XXXwaterson I don't think we need to do anything here. - return NS_OK; -} - -NS_IMETHODIMP -CPluginManager::UnregisterPlugin(REFNSIID aCID) -{ - // XXXwaterson I don't think we need to do anything here. - return NS_OK; -} - -NS_IMETHODIMP -CPluginManager::GetURLWithHeaders(nsISupports* pluginInst, - const char* url, - const char* target, - nsIPluginStreamListener* streamListener, - const char* altHost, - const char* referrer, - PRBool forceJSEnabled, - PRUint32 getHeadersLength, - const char* getHeaders) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -////////////////////////////// -// nsIPluginManager2 methods. - - - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// UserAgent: -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NS_METHOD -CPluginManager::UserAgent(const char* *result) -{ - *result = NPN_UserAgent(NULL); - return NS_OK; -} - - -int varMap[] = { - (int)NPNVxDisplay, // nsPluginManagerVariable_XDisplay = 1, - (int)NPNVxtAppContext, // nsPluginManagerVariable_XtAppContext, - (int)NPNVnetscapeWindow, // nsPluginManagerVariable_NetscapeWindow, - (int)NPPVpluginWindowBool, // nsPluginInstancePeerVariable_WindowBool, - (int)NPPVpluginTransparentBool, // nsPluginInstancePeerVariable_TransparentBool, - (int)NPPVjavaClass, // nsPluginInstancePeerVariable_JavaClass, - (int)NPPVpluginWindowSize, // nsPluginInstancePeerVariable_WindowSize, - (int)NPPVpluginTimerInterval, // nsPluginInstancePeerVariable_TimerInterval -}; - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// GetValue: -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NS_METHOD -CPluginManager::GetValue(nsPluginManagerVariable variable, void *value) -{ -#ifdef XP_UNIX - return fromNPError[NPN_GetValue(NULL, (NPNVariable)varMap[(int)variable], value)]; -#else - return fromNPError[NPERR_GENERIC_ERROR]; -#endif // XP_UNIX -} - -////////////////////////////// -// nsIPluginManager2 methods. -////////////////////////////// - -CPluginManager::RegisteredWindow* CPluginManager::theRegisteredWindows = NULL; -CPluginManager::RegisteredWindow* CPluginManager::theActiveWindow = NULL; - -CPluginManager::RegisteredWindow** CPluginManager::GetRegisteredWindow(nsPluginPlatformWindowRef window) -{ - RegisteredWindow** link = &theRegisteredWindows; - RegisteredWindow* registeredWindow = *link; - while (registeredWindow != NULL) { - if (registeredWindow->mWindow == window) - return link; - link = ®isteredWindow->mNext; - registeredWindow = *link; - } - return NULL; -} - -CPluginManager::RegisteredWindow* CPluginManager::FindRegisteredWindow(nsPluginPlatformWindowRef window) -{ - RegisteredWindow** link = GetRegisteredWindow(window); - return (link != NULL ? *link : NULL); -} - - -NS_METHOD -CPluginManager::RegisterWindow(nsIEventHandler* handler, nsPluginPlatformWindowRef window) -{ - theRegisteredWindows = new RegisteredWindow(theRegisteredWindows, handler, window); - -#ifdef XP_MAC - // use jGNE to obtain events for registered windows. - if (!mEventFiltersInstalled) { - ::InstallEventFilters(&EventFilter, &MenuFilter); - mEventFiltersInstalled = true; - } - - // plugin expects the window to be shown and selected at this point. - - SInt16 variant = ::GetWVariant(window); - if (variant == plainDBox) { - ::ShowHide(window, true); - ::BringToFront(window); - } else { - ::ShowWindow(window); - ::SelectWindow(window); - } -#endif - - return NS_OK; -} - -NS_METHOD -CPluginManager::UnregisterWindow(nsIEventHandler* handler, nsPluginPlatformWindowRef window) -{ - RegisteredWindow** link = GetRegisteredWindow(window); - if (link != NULL) { - RegisteredWindow* registeredWindow = *link; - if (registeredWindow == theActiveWindow) - theActiveWindow = NULL; - *link = registeredWindow->mNext; - delete registeredWindow; - } - -#ifdef XP_MAC - ::HideWindow(window); - - // if no windows registered, remove the filter. - if (theRegisteredWindows == NULL) { - ::RemoveEventFilters(); - mEventFiltersInstalled = false; - } -#endif - - return NS_OK; -} - -#ifdef XP_MAC - -static void sendActivateEvent(nsIEventHandler* handler, WindowRef window, Boolean active) -{ - EventRecord event; - ::OSEventAvail(0, &event); - event.what = activateEvt; - event.message = UInt32(window); - if (active) - event.modifiers |= activeFlag; - else - event.modifiers &= ~activeFlag; - - nsPluginEvent pluginEvent = { &event, window }; - PRBool handled = PR_FALSE; - - handler->HandleEvent(&pluginEvent, &handled); -} - -/** - * This method filters events using a very low-level mechanism known as a jGNE filter. - * This filter gets first crack at all events before they are returned by WaitNextEvent - * or EventAvail. One trickiness is that the filter runs in all processes, so care - * must be taken not to act on events if the browser's process isn't current. - * So far, with activates, updates, and mouse clicks, it works quite well. - */ -Boolean CPluginManager::EventFilter(EventRecord* event) -{ - Boolean filteredEvent = false; - - WindowRef window = WindowRef(event->message); - nsPluginEvent pluginEvent = { event, window }; - EventRecord simulatedEvent; - - RegisteredWindow* registeredWindow; - PRBool handled = PR_FALSE; - - // see if this event is for one of our registered windows. - switch (event->what) { - case nullEvent: - // See if the frontmost window is one of our registered windows. - // we want to somehow deliver mouse enter/leave events. - window = ::FrontWindow(); - registeredWindow = FindRegisteredWindow(window); - if (registeredWindow != NULL) { - simulatedEvent = *event; - simulatedEvent.what = nsPluginEventType_AdjustCursorEvent; - pluginEvent.event = &simulatedEvent; - pluginEvent.window = registeredWindow->mWindow; - registeredWindow->mHandler->HandleEvent(&pluginEvent, &handled); - } - break; - case keyDown: - case keyUp: - case autoKey: - // See if the frontmost window is one of our registered windows. - window = ::FrontWindow(); - registeredWindow = FindRegisteredWindow(window); - if (registeredWindow != NULL) { - pluginEvent.window = window; - registeredWindow->mHandler->HandleEvent(&pluginEvent, &handled); - filteredEvent = true; - } - break; - case mouseDown: - // use FindWindow to see if the click was in one our registered windows. - short partCode = FindWindow(event->where, &window); - switch (partCode) { - case inContent: - case inDrag: - case inGrow: - case inGoAway: - case inZoomIn: - case inZoomOut: - case inCollapseBox: - case inProxyIcon: - registeredWindow = FindRegisteredWindow(window); - if (registeredWindow != NULL) { - // make sure this window has been activated before passing it the click. - if (theActiveWindow == NULL) { - sendActivateEvent(registeredWindow->mHandler, window, true); - theActiveWindow = registeredWindow; - } - pluginEvent.window = window; - registeredWindow->mHandler->HandleEvent(&pluginEvent, &handled); - filteredEvent = true; - } else if (theActiveWindow != NULL) { - // a click is going into an unregistered window, if we are active, - // the browser doesn't seem to be generating a deactivate event. - // I think this is because PowerPlant is managing the windows, dang it. - window = theActiveWindow->mWindow; - sendActivateEvent(theActiveWindow->mHandler, window, false); - ::HiliteWindow(window, false); - theActiveWindow = NULL; - } - break; - } - break; - case activateEvt: - registeredWindow = FindRegisteredWindow(window); - if (registeredWindow != NULL) { - registeredWindow->mHandler->HandleEvent(&pluginEvent, &handled); - filteredEvent = true; - theActiveWindow = registeredWindow; - } - break; - case updateEvt: - registeredWindow = FindRegisteredWindow(window); - if (registeredWindow != NULL) { - GrafPtr port; GetPort(&port); SetPort(window); BeginUpdate(window); - registeredWindow->mHandler->HandleEvent(&pluginEvent, &handled); - EndUpdate(window); SetPort(port); - filteredEvent = true; - } - break; - case osEvt: - if ((event->message & osEvtMessageMask) == (suspendResumeMessage << 24)) { - registeredWindow = theActiveWindow; - if (registeredWindow != NULL) { - window = registeredWindow->mWindow; - Boolean active = (event->message & resumeFlag) != 0; - sendActivateEvent(registeredWindow->mHandler, window, active); - pluginEvent.window = window; - registeredWindow->mHandler->HandleEvent(&pluginEvent, &handled); - ::HiliteWindow(window, active); - } - } - break; - } - - return filteredEvent; -} - -// TODO: find out what range of menus Communicator et. al. uses. -enum { - kBaseMenuID = 20000, - kBaseSubMenuID = 200 -}; - -static PRInt16 nextMenuID = kBaseMenuID; -static PRInt16 nextSubMenuID = kBaseSubMenuID; - -Boolean CPluginManager::MenuFilter(long menuSelection) -{ - if (theActiveWindow != NULL) { - UInt16 menuID = (menuSelection >> 16); - if ((menuID >= kBaseMenuID && menuID < nextMenuID) || (menuID >= kBaseSubMenuID && menuID < nextSubMenuID)) { - EventRecord menuEvent; - ::OSEventAvail(0, &menuEvent); - menuEvent.what = nsPluginEventType_MenuCommandEvent; - menuEvent.message = menuSelection; - - WindowRef window = theActiveWindow->mWindow; - nsPluginEvent pluginEvent = { &menuEvent, window }; - PRBool handled = PR_FALSE; - theActiveWindow->mHandler->HandleEvent(&pluginEvent, &handled); - - return handled; - } - } - return false; -} - -NS_METHOD -CPluginManager::AllocateMenuID(nsIEventHandler* handler, PRBool isSubmenu, PRInt16 *result) -{ - *result = (isSubmenu ? nextSubMenuID++ : nextMenuID++); - - return NS_OK; -} - -#else /* !XP_MAC */ - -NS_METHOD -CPluginManager::AllocateMenuID(nsIEventHandler* handler, PRBool isSubmenu, PRInt16 *result) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -#endif /* XP_MAC */ - -////////////////////////////// -// nsIServiceManager methods. -////////////////////////////// - -NS_METHOD -CPluginManager::GetService(const nsCID& aClass, const nsIID& aIID, void* *result) -{ - // the only service we support currently is nsIMemory. - if (aClass.Equals(kPluginManagerCID) || aClass.Equals(kMemoryCID)) { - return QueryInterface(aIID, (void**) result); - } - if (aClass.Equals(nsILiveconnect::GetCID())) { - if (mLiveconnect == NULL) { - mLiveconnect = new nsLiveconnect; - NS_IF_ADDREF(mLiveconnect); - } - return mLiveconnect->QueryInterface(aIID, (void**)result); - } - return NS_ERROR_SERVICE_NOT_FOUND; -} - -////////////////////////////// -// nsIMemory methods. -////////////////////////////// - -NS_METHOD_(void*) -CPluginManager::Alloc(size_t size) -{ - return ::NPN_MemAlloc(size); -} - -NS_METHOD_(void*) -CPluginManager::Realloc(void* ptr, size_t size) -{ - if (ptr != NULL) { - void* new_ptr = Alloc(size); - if (new_ptr != NULL) { - ::memcpy(new_ptr, ptr, size); - Free(ptr); - } - ptr = new_ptr; - } - return ptr; -} - -NS_METHOD_(void) -CPluginManager::Free(void* ptr) -{ - if (ptr != NULL) { - ::NPN_MemFree(ptr); - } -} - -NS_METHOD -CPluginManager::HeapMinimize(PRBool aImmediate) -{ -#ifdef XP_MAC - ::NPN_MemFlush(1024); -#endif - return NS_OK; -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// nsISupports methods -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NS_METHOD -CPluginManager::QueryInterface(const nsIID& iid, void** ptr) -{ - if (NULL == ptr) { - return NS_ERROR_NULL_POINTER; - } - - if (iid.Equals(NS_GET_IID(nsIPluginManager)) || iid.Equals(NS_GET_IID(nsIPluginManager2))) { - *ptr = (void*) ((nsIPluginManager2*)this); - AddRef(); - return NS_OK; - } - if (iid.Equals(NS_GET_IID(nsIServiceManager))) { - *ptr = (void*) (nsIServiceManager*)this; - AddRef(); - return NS_OK; - } - if (iid.Equals(NS_GET_IID(nsIMemory))) { - *ptr = (void*) (nsIMemory*)this; - AddRef(); - return NS_OK; - } - if (iid.Equals(NS_GET_IID(nsISupports))) { - *ptr = (void*) this; - AddRef(); - return NS_OK; - } - return NS_NOINTERFACE; -} - -NS_IMPL_ADDREF(CPluginManager); -NS_IMPL_RELEASE(CPluginManager); - -////////////////////////////////////////////////////////////////////////////// -// -// CPluginInstancePeer -// - -CPluginInstancePeer::CPluginInstancePeer(nsIPluginInstance* pluginInstance, - NPP npp, - nsMIMEType typeString, - nsPluginMode type, - PRUint16 attr_cnt, - const char** attr_list, - const char** val_list) - : mInstance(pluginInstance), mWindow(NULL), - npp(npp), typeString(typeString), type(type), attribute_cnt(attr_cnt), - attribute_list(NULL), values_list(NULL) -{ - NS_IF_ADDREF(mInstance); - - attribute_list = (char**) NPN_MemAlloc(attr_cnt * sizeof(const char*)); - values_list = (char**) NPN_MemAlloc(attr_cnt * sizeof(const char*)); - - if (attribute_list != NULL && values_list != NULL) { - for (int i = 0; i < attribute_cnt; i++) { - attribute_list[i] = (char*) NPN_MemAlloc(strlen(attr_list[i]) + 1); - if (attribute_list[i] != NULL) - strcpy(attribute_list[i], attr_list[i]); - - values_list[i] = (char*) NPN_MemAlloc(strlen(val_list[i]) + 1); - if (values_list[i] != NULL) - strcpy(values_list[i], val_list[i]); - } - } -} - -CPluginInstancePeer::~CPluginInstancePeer(void) -{ - if (attribute_list != NULL && values_list != NULL) { - for (int i = 0; i < attribute_cnt; i++) { - NPN_MemFree(attribute_list[i]); - NPN_MemFree(values_list[i]); - } - - NPN_MemFree(attribute_list); - NPN_MemFree(values_list); - } - - NS_IF_RELEASE(mInstance); -} - - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// GetValue: -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NS_METHOD -CPluginInstancePeer::GetValue(nsPluginInstancePeerVariable variable, void *value) -{ -#ifdef XP_UNIX - return fromNPError[NPN_GetValue(NULL, (NPNVariable)varMap[(int)variable], value)]; -#else - return fromNPError[NPERR_GENERIC_ERROR]; -#endif // XP_UNIX -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// SetValue: -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NS_METHOD -CPluginInstancePeer::SetValue(nsPluginInstancePeerVariable variable, void *value) -{ -#ifdef XP_UNIX - return fromNPError[NPN_SetValue(NULL, (NPPVariable)varMap[(int)variable], value)]; -#else - return fromNPError[NPERR_GENERIC_ERROR]; -#endif // XP_UNIX -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// GetMIMEType: -// Corresponds to NPP_New's MIMEType argument. -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NS_METHOD -CPluginInstancePeer::GetMIMEType(nsMIMEType *result) -{ - *result = typeString; - return NS_OK; -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// GetMode: -// Corresponds to NPP_New's mode argument. -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NS_METHOD -CPluginInstancePeer::GetMode(nsPluginMode *result) -{ - *result = type; - return NS_OK; -} - - -// Get a ptr to the paired list of attribute names and values, -// returns the length of the array. -// -// Each name or value is a null-terminated string. -NS_METHOD -CPluginInstancePeer::GetAttributes(PRUint16& n, const char* const*& names, const char* const*& values) -{ - n = attribute_cnt; - names = attribute_list; - values = values_list; - - return NS_OK; -} - -/** - * Returns a JRI env corresponding to the current Java thread of the - * browser. - * - * (Corresponds to NPN_GetJavaEnv.) - * - * @result - NS_OK if this operation was successful - */ -NS_METHOD -CPluginInstancePeer::GetJavaEnv(JRIEnv* *resultingEnv) -{ - *resultingEnv = NPN_GetJavaEnv(); - return NS_OK; -} - -/** - * Returns a JRI reference to the Java peer object associated with the - * plugin instance. This object is an instance of the class specified - * by nsIJRILiveConnectPlugin::GetJavaClass. - * - * (Corresponds to NPN_GetJavaPeer.) - * - * @param resultingJavaPeer - a resulting reference to the Java instance - * @result - NS_OK if this operation was successful - */ -NS_METHOD -CPluginInstancePeer::GetJavaPeer(jref *resultingJavaPeer) -{ - *resultingJavaPeer = NPN_GetJavaPeer(npp); - return NS_OK; -} - -#if defined(XP_MAC) - -inline unsigned char toupper(unsigned char c) -{ - return (c >= 'a' && c <= 'z') ? (c - ('a' - 'A')) : c; -} - -static int strcasecmp(const char * str1, const char * str2) -{ -#if __POWERPC__ - - const unsigned char * p1 = (unsigned char *) str1 - 1; - const unsigned char * p2 = (unsigned char *) str2 - 1; - unsigned long c1, c2; - - while (toupper(c1 = *++p1) == toupper(c2 = *++p2)) - if (!c1) - return(0); - -#else - - const unsigned char * p1 = (unsigned char *) str1; - const unsigned char * p2 = (unsigned char *) str2; - unsigned char c1, c2; - - while (toupper(c1 = *p1++) == toupper(c2 = *p2++)) - if (!c1) - return(0); - -#endif - - return(toupper(c1) - toupper(c2)); -} - -#endif /* XP_MAC */ - -// Get the value for the named attribute. Returns null -// if the attribute was not set. -NS_METHOD -CPluginInstancePeer::GetAttribute(const char* name, const char* *result) -{ - for (int i=0; i < attribute_cnt; i++) { -#if defined(XP_UNIX) || defined(XP_MAC) - if (strcasecmp(name, attribute_list[i]) == 0) -#else - if (stricmp(name, attribute_list[i]) == 0) -#endif - { - *result = values_list[i]; - return NS_OK; - } - } - - return NS_ERROR_FAILURE; -} - -/** - * Returns the DOM element corresponding to the tag which references - * this plugin in the document. - * - * REMIND: do we need to expose as an nsISupports * to avoid - * introducing runtime dependencies on XPCOM? - * - * @param result - resulting DOM element - * @result - NS_OK if this operation was successful - */ -NS_METHOD -CPluginInstancePeer::GetDOMElement(nsIDOMElement* *result) -{ -/** PENDING **/ - - return NS_OK; -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// NewStream: -//+++++++++++++++++++++++++++++++++++++++++++++++++ -NS_METHOD -CPluginInstancePeer::NewStream(nsMIMEType type, const char* target, - nsIOutputStream* *result) -{ - assert( npp != NULL ); - - // Create a new NPStream. - NPStream* ptr = NULL; - NPError error = NPN_NewStream(npp, (NPMIMEType)type, target, &ptr); - if (error) - return fromNPError[error]; - - // Create a new Plugin Manager Stream. - // XXX - Do we have to Release() the manager stream before doing this? - // XXX - See the BAM doc for more info. - CPluginManagerStream* mstream = new CPluginManagerStream(npp, ptr); - if (mstream == NULL) - return NS_ERROR_OUT_OF_MEMORY; - mstream->AddRef(); - *result = (nsIOutputStream* )mstream; - - return NS_OK; -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// ShowStatus: -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NS_METHOD -CPluginInstancePeer::ShowStatus(const char* message) -{ - assert( message != NULL ); - - NPN_Status(npp, message); - return NS_OK; -} - -NS_METHOD -CPluginInstancePeer::SetWindowSize(PRUint32 width, PRUint32 height) -{ - NPError err; - NPSize size; - size.width = width; - size.height = height; - err = NPN_SetValue(npp, NPPVpluginWindowSize, &size); - return fromNPError[err]; -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// nsISupports functions -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NS_IMPL_ADDREF(CPluginInstancePeer); -NS_IMPL_RELEASE(CPluginInstancePeer); - -NS_METHOD -CPluginInstancePeer::QueryInterface(const nsIID& iid, void** ptr) -{ - if (NULL == ptr) { - return NS_ERROR_NULL_POINTER; - } - - if (iid.Equals(NS_GET_IID(nsIPluginInstancePeer))) { - *ptr = (void*) this; - AddRef(); - return NS_OK; - } - if (iid.Equals(NS_GET_IID(nsIPluginTagInfo)) || iid.Equals(NS_GET_IID(nsISupports))) { - *ptr = (void*) ((nsIPluginTagInfo*)this); - AddRef(); - return NS_OK; - } - return NS_NOINTERFACE; -} - -////////////////////////////////////////////////////////////////////////////// -// -// CPluginManagerStream -// - -CPluginManagerStream::CPluginManagerStream(NPP npp, NPStream* pstr) - : npp(npp), pstream(pstr) -{ -} - -CPluginManagerStream::~CPluginManagerStream(void) -{ - //pstream = NULL; - NPN_DestroyStream(npp, pstream, NPRES_DONE); -} - - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// Write: -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NS_METHOD -CPluginManagerStream::Write(const char* buffer, PRUint32 len, PRUint32 *aWriteCount) -{ - assert( npp != NULL ); - assert( pstream != NULL ); - - *aWriteCount = NPN_Write(npp, pstream, len, (void* )buffer); - return *aWriteCount >= 0 ? NS_OK : NS_ERROR_FAILURE; -} - -NS_METHOD -CPluginManagerStream::Write(nsIInputStream* fromStream, PRUint32 *aWriteCount) -{ - nsresult rv = fromStream->Available(aWriteCount); - if (rv == NS_OK) { - char buffer[1024]; - PRUint32 len = *aWriteCount; - while (len > 0) { - PRUint32 count = (len < sizeof(buffer) ? len : sizeof(buffer)); - rv = fromStream->Read(buffer, count, &count); - if (rv == NS_OK) - rv = Write(buffer, count, &count); - if (rv != NS_OK) { - *aWriteCount -= len; - break; - } - len -= count; - } - } - return rv; -} - -NS_METHOD -CPluginManagerStream::Flush() -{ - return NS_OK; -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// GetURL: -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NS_METHOD -CPluginManagerStream::GetURL(const char* *result) -{ - assert( pstream != NULL ); - - *result = pstream->url; - return NS_OK; -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// GetEnd: -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NS_METHOD -CPluginManagerStream::GetEnd(PRUint32 *result) -{ - assert( pstream != NULL ); - - *result = pstream->end; - return NS_OK; -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// GetLastModified: -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NS_METHOD -CPluginManagerStream::GetLastModified(PRUint32 *result) -{ - assert( pstream != NULL ); - - *result = pstream->lastmodified; - return NS_OK; -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// GetNotifyData: -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NS_METHOD -CPluginManagerStream::GetNotifyData(void* *result) -{ - assert( pstream != NULL ); - - *result = pstream->notifyData; - return NS_OK; -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// GetNotifyData: -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NS_METHOD -CPluginManagerStream::Close(void) -{ - assert( pstream != NULL ); - - return NS_OK; -} - - -//+++++++++++++++++++++++++++++++++++++++++++++++++ -// nsISupports functions -//+++++++++++++++++++++++++++++++++++++++++++++++++ - -NS_IMPL_ISUPPORTS1(CPluginManagerStream, nsIOutputStream) - -////////////////////////////////////////////////////////////////////////////// - -NS_IMPL_ISUPPORTS1(CPluginStreamInfo, nsIPluginStreamInfo) - -CPluginInputStream::CPluginInputStream(nsIPluginStreamListener* listener) - : mListener(listener), mStreamType(nsPluginStreamType_Normal), - mNPP(NULL), mStream(NULL), - mBuffer(NULL), mBufferLength(0), mAmountRead(0), - mStreamInfo(NULL) -{ - if (mListener != NULL) { - mListener->AddRef(); - mListener->GetStreamType(&mStreamType); - } -} - -CPluginInputStream::~CPluginInputStream(void) -{ - NS_IF_RELEASE(mListener); - - delete mBuffer; - - NS_IF_RELEASE(mStreamInfo); -} - -NS_IMPL_ISUPPORTS1(CPluginInputStream, nsIPluginInputStream) - -NS_METHOD -CPluginInputStream::Close(void) -{ - if (mNPP == NULL || mStream == NULL) - return NS_ERROR_FAILURE; - NPError err = NPN_DestroyStream(mNPP, mStream, NPRES_USER_BREAK); - return fromNPError[err]; -} - -NS_METHOD -CPluginInputStream::Available(PRUint32 *aLength) -{ - *aLength = mStream->end; - return NS_OK; -} - -NS_METHOD -CPluginInputStream::Read(char* aBuf, PRUint32 aCount, PRUint32 *aReadCount) -{ - PRUint32 cnt = PR_MIN(aCount, mBufferLength); - memcpy(aBuf, mBuffer + mAmountRead, cnt); - *aReadCount = cnt; - mAmountRead += cnt; - mBufferLength -= cnt; - return NS_OK; -} - -NS_METHOD -CPluginInputStream::GetLastModified(PRUint32 *result) -{ - *result = mStream->lastmodified; - return NS_OK; -} - -NS_METHOD -CPluginInputStream::RequestRead(nsByteRange* rangeList) -{ - NPError err = NPN_RequestRead(mStream, (NPByteRange*)rangeList); - return fromNPError[err]; -} - - -////////////////////////////////////////////////////////////////////////////// - -//#if defined(__cplusplus) -//} /* extern "C" */ -//#endif - diff --git a/plugin/oji/MRJ/plugin/Source/CSecureEnv.cpp b/plugin/oji/MRJ/plugin/Source/CSecureEnv.cpp deleted file mode 100644 index 40c313349137..000000000000 --- a/plugin/oji/MRJ/plugin/Source/CSecureEnv.cpp +++ /dev/null @@ -1,1976 +0,0 @@ -/* - * 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 - * Sun Microsystems, Inc. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - -/* - CSecureEnv.cpp - - Rewritten for use with MRJ plugin by Patrick C. Beard. Just forwards all - calls through the underlying JNIEnv that this wraps. Eventually, it will - communicate with the underlying threads using a message queue. - */ - -#include "CSecureEnv.h" -#include "nsISecurityContext.h" - -#include "MRJPlugin.h" -#include "MRJSession.h" -#include "nsIThreadManager.h" -#include "nsIJVMManager.h" - -#include "MRJMonitor.h" -#include "NativeMonitor.h" -#include "JavaMessageQueue.h" - -#if 0 -static NS_DEFINE_IID(kISecureEnvIID, NS_ISECUREENV_IID); -static NS_DEFINE_IID(kIRunnableIID, NS_IRUNNABLE_IID); -static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); -#endif - -JavaMessageQueue::JavaMessageQueue(Monitor* monitor) - : mFirst(NULL), mLast(NULL), mMonitor(monitor) -{ -} - -void JavaMessageQueue::putMessage(JavaMessage* msg) -{ - if (mFirst == NULL) { - mFirst = mLast = msg; - } else { - mLast->setNext(msg); - mLast = msg; - } - msg->setNext(NULL); -} - -JavaMessage* JavaMessageQueue::getMessage() -{ - JavaMessage* msg = mFirst; - if (msg != NULL) { - mFirst = mFirst->getNext(); - if (mFirst == NULL) mLast = NULL; - } - return msg; -} - -void JavaMessageQueue::enter() -{ - mMonitor->enter(); -} - -void JavaMessageQueue::exit() -{ - mMonitor->exit(); -} - -void JavaMessageQueue::wait() -{ - mMonitor->wait(); -} - -void JavaMessageQueue::wait(long long millis) -{ - mMonitor->wait(millis); -} - -void JavaMessageQueue::notify() -{ - mMonitor->notify(); -} - -/** - * Native run method that communicates with LiveConnect from a Java thread. - */ -static void netscape_oji_JNIThread_run(JNIEnv* env, jobject self) -{ - CSecureEnv* secureEnv = NULL; - jmethodID yieldMethod = NULL; - jmethodID sleepMethod = NULL; - - jclass clazz = env->GetObjectClass(self); - if (clazz != NULL) { - // the field fSecureEnv contains a pointer to a CSecureEnv. - jfieldID fSecureEnvField = env->GetFieldID(clazz, "fSecureEnv", "I"); - if (fSecureEnvField != NULL) { - secureEnv = (CSecureEnv*) env->GetIntField(self, fSecureEnvField); - } - yieldMethod = env->GetStaticMethodID(clazz, "yield", "()V"); - sleepMethod = env->GetStaticMethodID(clazz, "sleep", "(J)V"); - } - - // notify the secure JNI that we are here, and wait for messages to arrive. - if (secureEnv != NULL) { - jboolean isRunning = true; - MRJSession* session = secureEnv->getSession(); - MRJMonitor requestMonitor(session, self); - MRJMonitor replyMonitor(session); - // NativeMonitor replyMonitor(secureEnv->getThreadManager()); - JavaMessageQueue requests(&requestMonitor), replies(&replyMonitor); - secureEnv->initialize(env, &isRunning, &requests, &replies); - - // when this thread is running, no other thread can enter the request queue monitor. - requests.enter(); - - while (isRunning) { - // the protocol for now is dead simple: get a message from the - // requests message queue, process it, and then put it back in - // the replies queue. This will get more elaborate to handle - // upcall requests. - JavaMessage* msg = requests.getMessage(); - if (msg != NULL) { - msg->execute(env); - replies.putMessage(msg); - replies.notify(); - } else { - // should we do sleep, timed wait, or what? - // env->CallStaticVoidMethod(clazz, yieldMethod); - // env->CallStaticVoidMethod(clazz, sleepMethod, jlong(kDefaultJMTime)); - requests.wait(); - } - } - - requests.exit(); - } -} - -/** - * Called from browser side, starts the Java thread that calls from LiveConnect to Java - * are processed in. - */ -static void CreateJNIThread(CSecureEnv* secureEnv) -{ - nsIThreadManager* manager = secureEnv->getThreadManager(); - MRJSession* session = secureEnv->getSession(); - JNIEnv* env = session->getCurrentEnv(); - jclass JNIThreadClass = env->FindClass("netscape/oji/JNIThread"); - if (JNIThreadClass != NULL) { - JNINativeMethod method = { "run", "()V", &netscape_oji_JNIThread_run }; - env->RegisterNatives(JNIThreadClass, &method, 1); - jmethodID constructorID = env->GetMethodID(JNIThreadClass, "", "(I)V"); - if (constructorID != NULL) { - jobject javaThread = env->NewObject(JNIThreadClass, constructorID, secureEnv); - for (;;) { - // give time to Java, to allow the thread to come up. - session->idle(kDefaultJMTime); - // has the thread made contact? - if (secureEnv->isInitialized()) - break; - // give time to NSPR, to avoid hanging too long. - manager->Sleep(); - } - } - } -} - -/** - * Creates a new native thread in MRJ's main thread, to avoid deadlock problems. - */ -class CreateNativeThreadMessage : public NativeMessage { - nsresult* mResult; - PRUint32* mThreadID; - CSecureEnv* mSecureEnv; -public: - CreateNativeThreadMessage(nsresult* outResult, PRUint32* outThreadID, CSecureEnv* secureEnv) - : mResult(outResult), mThreadID(outThreadID), mSecureEnv(secureEnv) - { - } - - virtual void execute() - { - nsIThreadManager* manager = mSecureEnv->getThreadManager(); - *mResult = manager->CreateThread(mThreadID, mSecureEnv); - } -}; - -/** - * Called from a Java thread that wants to communicate with the browser. - */ -static void CreateNativeThread(CSecureEnv* secureEnv) -{ - nsresult result; - PRUint32 threadID; - MRJSession* session = secureEnv->getSession(); - - // cause a native thread to be created on our behalf. Perhaps this should be a message we send to the - // session itself. otherwise we could have reentrancy problems. - CreateNativeThreadMessage message(&result, &threadID, secureEnv); - session->sendMessage(&message); - - if (session->onMainThread()) { - // give time to other native threads, so the new thread can come up. - nsIThreadManager* manager = secureEnv->getThreadManager(); - while (!secureEnv->isInitialized()) { - manager->Sleep(); - } - } else { - // sleep the current Java thread until we rendezvous with the Native thread. - JNIEnv* env = session->getCurrentEnv(); - jclass threadClass = env->FindClass("java/lang/Thread"); - if (threadClass != NULL) { - jmethodID sleepMethod = env->GetStaticMethodID(threadClass, "sleep", "(J)V"); - if (sleepMethod != NULL) { - while (!secureEnv->isInitialized()) - env->CallStaticVoidMethod(threadClass, sleepMethod, jlong(kDefaultJMTime)); - } - env->DeleteLocalRef(threadClass); - } - } -} - -/** - * Runs the server thread for LiveConnect upcalls from spontaneous Java threads. - */ -NS_IMETHODIMP CSecureEnv::Run() -{ - jboolean isRunning = true; - NativeMonitor requestMonitor(mSession, mThreadManager); - MRJMonitor replyMonitor(mSession); - JavaMessageQueue requests(&requestMonitor), replies(&replyMonitor); - // initialize(env, self, &isRunning, &requests, &replies); - - // we have to create the Proxy JNI here, so it associated with this thread. - nsIJVMManager* manager = mPlugin->getManager(); - manager->CreateProxyJNI(this, &mProxyEnv); - - mIsRunning = &isRunning; - mNativeQueue = &requests; - mJavaQueue = &replies; - - // when this thread is running, no other thread can enter the request queue monitor. - requests.enter(); - - while (isRunning) { - // the protocol for now is dead simple: get a message from the - // requests message queue, process it, and then put it back in - // the replies queue. This will get more elaborate to handle - // upcall requests. - JavaMessage* msg = requests.getMessage(); - if (msg != NULL) { - msg->execute(mProxyEnv); - replies.putMessage(msg); - replies.notify(); - } else { - // should we do sleep, timed wait, or what? - // env->CallStaticVoidMethod(clazz, yieldMethod); - // env->CallStaticVoidMethod(clazz, sleepMethod, jlong(kDefaultJMTime)); - requests.wait(); - } - } - - requests.exit(); - - return NS_OK; -} - -/** - * Used to send a message from Native to Java threads. - */ -void CSecureEnv::sendMessageToJava(JavaMessage* msg) -{ - messageLoop(mProxyEnv, msg, mJavaQueue, mNativeQueue, true); -} - -/** - * Used to send a message from Java to Native threads. - */ -void CSecureEnv::sendMessageFromJava(JNIEnv* javaEnv, JavaMessage* msg, Boolean busyWaiting) -{ - messageLoop(javaEnv, msg, mNativeQueue, mJavaQueue, busyWaiting); -} - -//////////////////////////////////////////////////////////////////////////// -// from nsISupports and AggregatedQueryInterface: - -// Thes macro expands to the aggregated query interface scheme. - -#if 0 -NS_IMPL_AGGREGATED(CSecureEnv); - -NS_METHOD -CSecureEnv::AggregatedQueryInterface(const nsIID& aIID, void** aInstancePtr) -{ - if (aIID.Equals(kISupportsIID)) { - *aInstancePtr = GetInner(); - AddRef(); - return NS_OK; - } - if (aIID.Equals(kISecureEnvIID)) { - *aInstancePtr = (nsISecureEnv*) this; - AddRef(); - return NS_OK; - } - if (aIID.Equals(kIRunnableIID)) { - *aInstancePtr = (nsIRunnable*) this; - AddRef(); - return NS_OK; - } - return NS_NOINTERFACE; -} -#endif - -const InterfaceInfo CSecureEnv::sInterfaces[] = { - { NS_ISECUREENV_IID, INTERFACE_OFFSET(CSecureEnv, nsISecureEnv) }, - { NS_IRUNNABLE_IID, INTERFACE_OFFSET(CSecureEnv, nsIRunnable) }, -}; -const UInt32 CSecureEnv::kInterfaceCount = sizeof(sInterfaces) / sizeof(InterfaceInfo); - -///=--------------------------------------------------------------------------= -// CSecureEnv::CSecureEnv -///=--------------------------------------------------------------------------= -// Implements the CSecureJNI object for creating object, invoking method, -// getting/setting field in JNI with security context. -// -// parameters : -// -// return : -// -// notes : -// -CSecureEnv::CSecureEnv(MRJPlugin* plugin, JNIEnv* proxyEnv, JNIEnv* javaEnv) - : SupportsMixin(this, sInterfaces, kInterfaceCount), - mPlugin(plugin), mProxyEnv(proxyEnv), mJavaEnv(javaEnv), - mSession(plugin->getSession()), mThreadManager(plugin->getThreadManager()), - mIsRunning(NULL), mJavaQueue(NULL), mNativeQueue(NULL) -{ - // need to create the JNIThread for communicating with Java. - if (mJavaEnv != NULL) - CreateNativeThread(this); - else - CreateJNIThread(this); -} - - -///=--------------------------------------------------------------------------= -// CSecureEnv::~CSecureEnv -///=--------------------------------------------------------------------------= -// Implements the CSecureEnv object for creating object, invoking method, -// getting/setting field in JNI with security context. -// -// parameters : -// -// return : -// -// notes : -// -CSecureEnv::~CSecureEnv() -{ - // Tell the Java thread to die. - if (mIsRunning != NULL) { - *mIsRunning = false; - mJavaQueue->notify(); - } -} - -void CSecureEnv::initialize(JNIEnv* javaEnv, jboolean* isRunning, JavaMessageQueue* javaQueue, JavaMessageQueue* nativeQueue) -{ - mJavaEnv = javaEnv; - mIsRunning = isRunning; - mJavaQueue = javaQueue; - mNativeQueue = nativeQueue; -} - -///=--------------------------------------------------------------------------= -// CSecureEnv::Create -///=--------------------------------------------------------------------------= -// Create the CSecureEnv object for creating object, invoking method, -// getting/setting field in JNI with security context. -// -// parameters : -// -// return : -// -// notes : -// -NS_METHOD -CSecureEnv::Create(MRJPlugin* plugin, JNIEnv* proxyEnv, const nsIID& aIID, void* *aInstancePtr) -{ - CSecureEnv* secureEnv = new CSecureEnv(plugin, proxyEnv); - if (secureEnv == NULL) - return NS_ERROR_OUT_OF_MEMORY; - nsresult result = secureEnv->QueryInterface(aIID, aInstancePtr); - if (result != NS_OK) { - delete secureEnv; - return result; - } - return NS_OK; -} - -//////////////////////////////////////////////////////////////////////////// -// from nsISecureJNI: -// - - -///=--------------------------------------------------------------------------= -// CSecureEnv::NewObject -///=--------------------------------------------------------------------------= -// Create new Java object in LiveConnect. -// -// @param env -- JNIEnv pointer. -// @param clazz -- Java Class object. -// @param methodID -- Method id -// @param args -- arguments for invoking the constructor. -// @param result -- return new Java object. -// @param ctx -- security context -// - -class NewObjectMessage : public JavaMessage { - jclass clazz; - jmethodID methodID; - jvalue* args; - jobject* result; - -public: - NewObjectMessage(jclass clazz, jmethodID methodID, jvalue *args, jobject* result) - { - this->clazz = clazz; - this->methodID = methodID; - this->args = args; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->NewObjectA(clazz, methodID, args); - } -}; - -NS_IMETHODIMP CSecureEnv::NewObject(/*[in]*/ jclass clazz, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jobject* result, - /*[in]*/ nsISecurityContext* ctx) -{ - if (clazz == NULL || methodID == NULL) - return NS_ERROR_NULL_POINTER; - - // Call method on Java side - NewObjectMessage msg(clazz, methodID, args, result); - sendMessageToJava(&msg); - // *result = m_env->NewObjectA(clazz, methodID, args); - - return NS_OK; -} - - -///=--------------------------------------------------------------------------= -// CSecureEnv::CallMethod -///=--------------------------------------------------------------------------= -// Invoke method on Java object in LiveConnect. -// -// @param type -- Return type -// @param obj -- Java object. -// @param methodID -- Method id -// @param result -- return result of invocation. -// @param ctx -- security context -// - -class CallMethodMessage : public JavaMessage { - jni_type type; - jobject obj; - jmethodID methodID; - jvalue* args; - jvalue* result; - -public: - CallMethodMessage(jni_type type, jobject obj, jmethodID methodID, jvalue *args, jvalue* result) - { - this->type = type; - this->obj = obj; - this->methodID = methodID; - this->args = args; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - switch (type) { - case jobject_type: - result->l = env->CallObjectMethodA(obj, methodID, args); - break; - case jboolean_type: - result->z = env->CallBooleanMethodA(obj, methodID, args); - break; - case jbyte_type: - result->b = env->CallByteMethodA(obj, methodID, args); - break; - case jchar_type: - result->c = env->CallCharMethodA(obj, methodID, args); - break; - case jshort_type: - result->s = env->CallShortMethodA(obj, methodID, args); - break; - case jint_type: - result->i = env->CallIntMethodA(obj, methodID, args); - break; - case jlong_type: - result->j = env->CallLongMethodA(obj, methodID, args); - break; - case jfloat_type: - result->f = env->CallFloatMethodA(obj, methodID, args); - break; - case jdouble_type: - result->d = env->CallDoubleMethodA(obj, methodID, args); - break; - case jvoid_type: - env->CallVoidMethodA(obj, methodID, args); - break; - } - } -}; - -NS_IMETHODIMP CSecureEnv::CallMethod(/*[in]*/ jni_type type, - /*[in]*/ jobject obj, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx) -{ - if (obj == NULL || methodID == NULL) - return NS_ERROR_NULL_POINTER; - - // Call method on Java side - // return CallJavaMethod(obj, method, args, ctx, result); - CallMethodMessage msg(type, obj, methodID, args, result); - sendMessageToJava(&msg); - - return NS_OK; -} - - -///=--------------------------------------------------------------------------= -// CSecureEnv::CallNonvirtualMethod -///=--------------------------------------------------------------------------= -// Invoke non-virtual method on Java object in LiveConnect. -// -// @param obj -- Java object. -// @param methodID -- Method id -// @param args -- arguments for invoking the constructor. -// @param result -- return result of invocation. -// @param ctx -- security context -// - -class CallNonvirtualMethodMessage : public JavaMessage { - jni_type type; - jobject obj; - jclass clazz; - jmethodID methodID; - jvalue* args; - jvalue* result; - -public: - CallNonvirtualMethodMessage(jni_type type, jobject obj, jclass clazz, jmethodID methodID, jvalue *args, jvalue* result) - { - this->type = type; - this->obj = obj; - this->clazz = clazz; - this->methodID = methodID; - this->args = args; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - switch (type) { - case jobject_type: - result->l = env->CallNonvirtualObjectMethodA(obj, clazz, methodID, args); - break; - case jboolean_type: - result->z = env->CallNonvirtualBooleanMethodA(obj, clazz, methodID, args); - break; - case jbyte_type: - result->b = env->CallNonvirtualByteMethodA(obj, clazz, methodID, args); - break; - case jchar_type: - result->c = env->CallNonvirtualCharMethodA(obj, clazz, methodID, args); - break; - case jshort_type: - result->s = env->CallNonvirtualShortMethodA(obj, clazz, methodID, args); - break; - case jint_type: - result->i = env->CallNonvirtualIntMethodA(obj, clazz, methodID, args); - break; - case jlong_type: - result->j = env->CallNonvirtualLongMethodA(obj, clazz, methodID, args); - break; - case jfloat_type: - result->f = env->CallNonvirtualFloatMethodA(obj, clazz, methodID, args); - break; - case jdouble_type: - result->d = env->CallNonvirtualDoubleMethodA(obj, clazz, methodID, args); - break; - case jvoid_type: - env->CallNonvirtualVoidMethodA(obj, clazz, methodID, args); - break; - } - } -}; - -NS_IMETHODIMP CSecureEnv::CallNonvirtualMethod(/*[in]*/ jni_type type, - /*[in]*/ jobject obj, - /*[in]*/ jclass clazz, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx) -{ - if (obj == NULL || clazz == NULL || methodID == NULL) - return NS_ERROR_NULL_POINTER; - - // Call non-virtual method on Java side - // return CallJavaMethod(obj, method, args, ctx, result); - CallNonvirtualMethodMessage msg(type, obj, clazz, methodID, args, result); - sendMessageToJava(&msg); - - return NS_OK; -} - - -///=--------------------------------------------------------------------------= -// CSecureEnv::GetField -///=--------------------------------------------------------------------------= -// Get a field on Java object in LiveConnect. -// -// @param obj -- Java object. -// @param fieldID -- field id -// @param result -- return field value -// @param ctx -- security context -// - -class GetFieldMessage : public JavaMessage { - jni_type type; - jobject obj; - jfieldID fieldID; - jvalue* args; - jvalue* result; - -public: - GetFieldMessage(jni_type type, jobject obj, jfieldID fieldID, jvalue *args, jvalue* result) - { - this->type = type; - this->obj = obj; - this->fieldID = fieldID; - this->args = args; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - switch (type) { - case jobject_type: - result->l = env->GetObjectField(obj, fieldID); - break; - case jboolean_type: - result->z = env->GetBooleanField(obj, fieldID); - break; - case jbyte_type: - result->b = env->GetByteField(obj, fieldID); - break; - case jchar_type: - result->c = env->GetCharField(obj, fieldID); - break; - case jshort_type: - result->s = env->GetShortField(obj, fieldID); - break; - case jint_type: - result->i = env->GetIntField(obj, fieldID); - break; - case jlong_type: - result->j = env->GetLongField(obj, fieldID); - break; - case jfloat_type: - result->f = env->GetFloatField(obj, fieldID); - break; - case jdouble_type: - result->d = env->GetDoubleField(obj, fieldID); - break; - } - } -}; - -NS_IMETHODIMP CSecureEnv::GetField(/*[in]*/ jni_type type, - /*[in]*/ jobject obj, - /*[in]*/ jfieldID fieldID, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx) -{ - if (mJavaEnv == NULL || obj == NULL || fieldID == NULL) - return NS_ERROR_NULL_POINTER; - - // Get field on Java side - // return GetJavaField(obj, field, ctx, result); - - JNIEnv* env = mJavaEnv; - switch (type) { - case jobject_type: - result->l = env->GetObjectField(obj, fieldID); - break; - case jboolean_type: - result->z = env->GetBooleanField(obj, fieldID); - break; - case jbyte_type: - result->b = env->GetByteField(obj, fieldID); - break; - case jchar_type: - result->c = env->GetCharField(obj, fieldID); - break; - case jshort_type: - result->s = env->GetShortField(obj, fieldID); - break; - case jint_type: - result->i = env->GetIntField(obj, fieldID); - break; - case jlong_type: - result->j = env->GetLongField(obj, fieldID); - break; - case jfloat_type: - result->f = env->GetFloatField(obj, fieldID); - break; - case jdouble_type: - result->d = env->GetDoubleField(obj, fieldID); - break; - } - - return NS_OK; -} - - -///=--------------------------------------------------------------------------= -// CSecureEnv::SetField -///=--------------------------------------------------------------------------= -// -// Set a field on Java object in LiveConnect. -// -// @param obj -- Java object. -// @param fieldID -- field id -// @param result -- field value to set -// @param ctx -- security context -// -NS_IMETHODIMP CSecureEnv::SetField(/*[in]*/ jni_type type, - /*[in]*/ jobject obj, - /*[in]*/ jfieldID fieldID, - /*[in]*/ jvalue val, - /*[in]*/ nsISecurityContext* ctx) -{ - if (mJavaEnv == NULL || obj == NULL || fieldID == NULL) - return NS_ERROR_NULL_POINTER; - - // Set field on Java side - // return SetJavaField(obj, field, val, ctx); - - JNIEnv* env = mJavaEnv; - switch (type) { - case jobject_type: - env->SetObjectField(obj, fieldID, val.l); - break; - case jboolean_type: - env->SetBooleanField(obj, fieldID, val.z); - break; - case jbyte_type: - env->SetByteField(obj, fieldID, val.b); - break; - case jchar_type: - env->SetCharField(obj, fieldID, val.c); - break; - case jshort_type: - env->SetShortField(obj, fieldID, val.s); - break; - case jint_type: - env->SetIntField(obj, fieldID, val.i); - break; - case jlong_type: - env->SetLongField(obj, fieldID, val.j); - break; - case jfloat_type: - env->SetFloatField(obj, fieldID, val.f); - break; - case jdouble_type: - env->SetDoubleField(obj, fieldID, val.d); - break; - } - - return NS_OK; -} - - -///=--------------------------------------------------------------------------= -// CSecureEnv::CallStaticMethod -///=--------------------------------------------------------------------------= -// -// Invoke static method on Java object in LiveConnect. -// -// @param obj -- Java object. -// @param methodID -- method id -// @param args -- arguments for invoking the constructor. -// @param result -- return result of invocation. -// @param ctx -- security context -// - -class CallStaticMethodMessage : public JavaMessage { - jni_type type; - jclass clazz; - jmethodID methodID; - jvalue* args; - jvalue* result; - -public: - CallStaticMethodMessage(jni_type type, jclass clazz, jmethodID methodID, jvalue *args, jvalue* result) - { - this->type = type; - this->clazz = clazz; - this->methodID = methodID; - this->args = args; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - switch (type) { - case jobject_type: - result->l = env->CallStaticObjectMethodA(clazz, methodID, args); - break; - case jboolean_type: - result->z = env->CallStaticBooleanMethodA(clazz, methodID, args); - break; - case jbyte_type: - result->b = env->CallStaticByteMethodA(clazz, methodID, args); - break; - case jchar_type: - result->c = env->CallStaticCharMethodA(clazz, methodID, args); - break; - case jshort_type: - result->s = env->CallStaticShortMethodA(clazz, methodID, args); - break; - case jint_type: - result->i = env->CallStaticIntMethodA(clazz, methodID, args); - break; - case jlong_type: - result->j = env->CallStaticLongMethodA(clazz, methodID, args); - break; - case jfloat_type: - result->f = env->CallStaticFloatMethodA(clazz, methodID, args); - break; - case jdouble_type: - result->d = env->CallStaticDoubleMethodA(clazz, methodID, args); - break; - case jvoid_type: - env->CallStaticVoidMethodA(clazz, methodID, args); - break; - } - } -}; - -NS_IMETHODIMP CSecureEnv::CallStaticMethod(/*[in]*/ jni_type type, - /*[in]*/ jclass clazz, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx) -{ - if (clazz == NULL || methodID == NULL) - return NS_ERROR_NULL_POINTER; - - // Call method on Java side - // return CallJavaMethod(NULL, method, args, ctx, result); - CallStaticMethodMessage msg(type, clazz, methodID, args, result); - sendMessageToJava(&msg); - - return NS_OK; -} - - -///=--------------------------------------------------------------------------= -// CSecureEnv::GetStaticField -///=--------------------------------------------------------------------------= -// Get a static field on Java object in LiveConnect. -// -// @param obj -- Java object. -// @param fieldID -- field id -// @param result -- return field value -// @param ctx -- security context -// - - -class GetStaticFieldMessage : public JavaMessage { - jni_type type; - jclass clazz; - jfieldID fieldID; - jvalue* args; - jvalue* result; - -public: - GetStaticFieldMessage(jni_type type, jclass clazz, jfieldID fieldID, jvalue* result) - { - this->type = type; - this->clazz = clazz; - this->fieldID = fieldID; - this->args = args; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - switch (type) { - case jobject_type: - result->l = env->GetStaticObjectField(clazz, fieldID); - break; - case jboolean_type: - result->z = env->GetStaticBooleanField(clazz, fieldID); - break; - case jbyte_type: - result->b = env->GetStaticByteField(clazz, fieldID); - break; - case jchar_type: - result->c = env->GetStaticCharField(clazz, fieldID); - break; - case jshort_type: - result->s = env->GetStaticShortField(clazz, fieldID); - break; - case jint_type: - result->i = env->GetStaticIntField(clazz, fieldID); - break; - case jlong_type: - result->j = env->GetStaticLongField(clazz, fieldID); - break; - case jfloat_type: - result->f = env->GetStaticFloatField(clazz, fieldID); - break; - case jdouble_type: - result->d = env->GetStaticDoubleField(clazz, fieldID); - break; - } - } -}; - -NS_IMETHODIMP CSecureEnv::GetStaticField(/*[in]*/ jni_type type, - /*[in]*/ jclass clazz, - /*[in]*/ jfieldID fieldID, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx) -{ - if (mJavaEnv == NULL || clazz == NULL || fieldID == NULL) - return NS_ERROR_NULL_POINTER; - - // Get static field on Java side - // return GetJavaField(NULL, field, ctx, result); - // GetStaticFieldMessage msg(type, clazz, fieldID, result); - // sendMessageToJava(&msg); - - // should be able to perform in Java env. - JNIEnv* env = mJavaEnv; - switch (type) { - case jobject_type: - result->l = env->GetStaticObjectField(clazz, fieldID); - break; - case jboolean_type: - result->z = env->GetStaticBooleanField(clazz, fieldID); - break; - case jbyte_type: - result->b = env->GetStaticByteField(clazz, fieldID); - break; - case jchar_type: - result->c = env->GetStaticCharField(clazz, fieldID); - break; - case jshort_type: - result->s = env->GetStaticShortField(clazz, fieldID); - break; - case jint_type: - result->i = env->GetStaticIntField(clazz, fieldID); - break; - case jlong_type: - result->j = env->GetStaticLongField(clazz, fieldID); - break; - case jfloat_type: - result->f = env->GetStaticFloatField(clazz, fieldID); - break; - case jdouble_type: - result->d = env->GetStaticDoubleField(clazz, fieldID); - break; - } - - return NS_OK; -} - - -///=--------------------------------------------------------------------------= -// CSecureEnv::SetStaticField -///=--------------------------------------------------------------------------= -// Set a static field on Java object in LiveConnect. -// -// @param obj -- Java object. -// @param fieldID -- field id -// @param result -- field value to set -// @param ctx -- security context -// -NS_IMETHODIMP CSecureEnv::SetStaticField(/*[in]*/ jni_type type, - /*[in]*/ jclass clazz, - /*[in]*/ jfieldID fieldID, - /*[in]*/ jvalue val, - /*[in]*/ nsISecurityContext* ctx) -{ - if (mJavaEnv == NULL || clazz == NULL || fieldID == NULL) - return NS_ERROR_NULL_POINTER; - - // Set static field on Java side - // return SetJavaField(NULL, field, val, ctx); - - JNIEnv* env = mJavaEnv; - switch (type) { - case jobject_type: - env->SetStaticObjectField(clazz, fieldID, val.l); - break; - case jboolean_type: - env->SetStaticBooleanField(clazz, fieldID, val.z); - break; - case jbyte_type: - env->SetStaticByteField(clazz, fieldID, val.b); - break; - case jchar_type: - env->SetStaticCharField(clazz, fieldID, val.c); - break; - case jshort_type: - env->SetStaticShortField(clazz, fieldID, val.s); - break; - case jint_type: - env->SetStaticIntField(clazz, fieldID, val.i); - break; - case jlong_type: - env->SetStaticLongField(clazz, fieldID, val.j); - break; - case jfloat_type: - env->SetStaticFloatField(clazz, fieldID, val.f); - break; - case jdouble_type: - env->SetStaticDoubleField(clazz, fieldID, val.d); - break; - } - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::GetVersion(/*[out]*/ jint* version) -{ - if (version == NULL) - return NS_ERROR_NULL_POINTER; - - JNIEnv* env = mSession->getCurrentEnv(); - *version = env->GetVersion(); - - return NS_OK; -} - -/** - * To give proper "local" refs, need to run this in the Java thread. - */ -class DefineClassMessage : public JavaMessage { - const char* name; - jobject loader; - const jbyte *buf; - jsize len; - jclass* clazz; -public: - DefineClassMessage(const char* name, jobject loader, const jbyte *buf, jsize len, jclass* clazz) - { - this->name = name; - this->loader = loader; - this->buf = buf; - this->len = len; - this->clazz = clazz; - } - - virtual void execute(JNIEnv* env) - { - *clazz = env->DefineClass(name, loader, buf, len); - } -}; - -NS_IMETHODIMP CSecureEnv::DefineClass(/*[in]*/ const char* name, - /*[in]*/ jobject loader, - /*[in]*/ const jbyte *buf, - /*[in]*/ jsize len, - /*[out]*/ jclass* clazz) -{ - if (clazz == NULL) - return NS_ERROR_NULL_POINTER; - - DefineClassMessage msg(name, loader, buf, len, clazz); - sendMessageToJava(&msg); - - return NS_OK; -} - -/** - * To give proper "local" refs, need to run this in the Java thread. - */ -class FindClassMessage : public JavaMessage { - const char* name; - jclass* result; -public: - FindClassMessage(const char* name, jclass* result) - { - this->name = name; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->FindClass(name); - } -}; - -NS_IMETHODIMP CSecureEnv::FindClass(/*[in]*/ const char* name, - /*[out]*/ jclass* clazz) -{ - if (clazz == NULL) - return NS_ERROR_NULL_POINTER; - - // JNIEnv* env = mSession->getCurrentEnv(); - // *clazz = env->FindClass(name); - FindClassMessage msg(name, clazz); - sendMessageToJava(&msg); - - return NS_OK; -} - -/** - * To give proper "local" refs, need to run this in the Java thread. - */ -class GetSuperclassMessage : public JavaMessage { - jclass sub; - jclass* super; -public: - GetSuperclassMessage(jclass sub, jclass* super) - { - this->sub = sub; - this->super = super; - } - - virtual void execute(JNIEnv* env) - { - *super = env->GetSuperclass(sub); - } -}; - -NS_IMETHODIMP CSecureEnv::GetSuperclass(/*[in]*/ jclass sub, - /*[out]*/ jclass* super) -{ - if (mJavaEnv == NULL || super == NULL) - return NS_ERROR_NULL_POINTER; - - // GetSuperclassMessage msg(sub, super); - // sendMessageToJava(&msg); - *super = mJavaEnv->GetSuperclass(sub); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::IsAssignableFrom(/*[in]*/ jclass sub, - /*[in]*/ jclass super, - /*[out]*/ jboolean* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - // JNIEnv* env = mSession->getCurrentEnv(); - // *result = env->IsAssignableFrom(sub, super); - *result = mJavaEnv->IsAssignableFrom(sub, super); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::Throw(/*[in]*/ jthrowable obj, - /*[out]*/ jint* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - // Huh? This doesn't really make sense. - - *result = mJavaEnv->Throw(obj); - - return NS_OK; -} - -NS_IMETHODIMP CSecureEnv::ThrowNew(/*[in]*/ jclass clazz, - /*[in]*/ const char *msg, - /*[out]*/ jint* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = mJavaEnv->ThrowNew(clazz, msg); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::ExceptionOccurred(/*[out]*/ jthrowable* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = mJavaEnv->ExceptionOccurred(); - - return NS_OK; -} - -NS_IMETHODIMP CSecureEnv::ExceptionDescribe(void) -{ - if (mJavaEnv == NULL) - return NS_ERROR_NULL_POINTER; - - mJavaEnv->ExceptionDescribe(); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::ExceptionClear(void) -{ - mJavaEnv->ExceptionClear(); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::FatalError(/*[in]*/ const char* msg) -{ - mJavaEnv->FatalError(msg); - - return NS_OK; -} - - -/** - * To give proper "local" refs, need to run this in the true thread. - */ -NS_IMETHODIMP CSecureEnv::NewGlobalRef(/*[in]*/ jobject localRef, - /*[out]*/ jobject* result) -{ - if (result == NULL) - return NS_ERROR_NULL_POINTER; - - // *result = mJavaEnv->NewGlobalRef(localRef); - class NewGlobalRefMessage : public JavaMessage { - jobject localRef; - jobject* result; - public: - NewGlobalRefMessage(jobject localRef, jobject* result) - { - this->localRef = localRef; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->NewGlobalRef(localRef); - } - } msg(localRef, result); - sendMessageToJava(&msg); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::DeleteGlobalRef(/*[in]*/ jobject globalRef) -{ - JNIEnv* env = mSession->getCurrentEnv(); - env->DeleteGlobalRef(globalRef); - return NS_OK; -} - -/** - * To give proper "local" refs, need to run this in the true thread. - */ -class DeleteLocalRefMessage : public JavaMessage { - jobject localRef; -public: - DeleteLocalRefMessage(jobject localRef) - { - this->localRef = localRef; - } - - virtual void execute(JNIEnv* env) - { - env->DeleteLocalRef(localRef); - } -}; - -NS_IMETHODIMP CSecureEnv::DeleteLocalRef(/*[in]*/ jobject obj) -{ - mJavaEnv->DeleteLocalRef(obj); - return NS_OK; -} - -NS_IMETHODIMP CSecureEnv::IsSameObject(/*[in]*/ jobject obj1, - /*[in]*/ jobject obj2, - /*[out]*/ jboolean* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = mJavaEnv->IsSameObject(obj1, obj2); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::AllocObject(/*[in]*/ jclass clazz, - /*[out]*/ jobject* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = mJavaEnv->AllocObject(clazz); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::GetObjectClass(/*[in]*/ jobject obj, - /*[out]*/ jclass* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = mJavaEnv->GetObjectClass(obj); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::IsInstanceOf(/*[in]*/ jobject obj, - /*[in]*/ jclass clazz, - /*[out]*/ jboolean* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = mJavaEnv->IsInstanceOf(obj, clazz); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::GetMethodID(/*[in]*/ jclass clazz, - /*[in]*/ const char* name, - /*[in]*/ const char* sig, - /*[out]*/ jmethodID* result) -{ - if (result == NULL) - return NS_ERROR_NULL_POINTER; - - // run this on the *CURRENT* thread. - JNIEnv* env = mSession->getCurrentEnv(); - *result = env->GetMethodID(clazz, name, sig); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::GetFieldID(/*[in]*/ jclass clazz, - /*[in]*/ const char* name, - /*[in]*/ const char* sig, - /*[out]*/ jfieldID* result) -{ - if (result == NULL) - return NS_ERROR_NULL_POINTER; - - // run this on the *CURRENT* thread. - JNIEnv* env = mSession->getCurrentEnv(); - *result = env->GetFieldID(clazz, name, sig); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::GetStaticMethodID(/*[in]*/ jclass clazz, - /*[in]*/ const char* name, - /*[in]*/ const char* sig, - /*[out]*/ jmethodID* result) -{ - if (result == NULL) - return NS_ERROR_NULL_POINTER; - - // run this on the *CURRENT* thread. - JNIEnv* env = mSession->getCurrentEnv(); - *result = env->GetStaticMethodID(clazz, name, sig); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::GetStaticFieldID(/*[in]*/ jclass clazz, - /*[in]*/ const char* name, - /*[in]*/ const char* sig, - /*[out]*/ jfieldID* result) -{ - if (result == NULL) - return NS_ERROR_NULL_POINTER; - - // run this on the *CURRENT* thread. - JNIEnv* env = mSession->getCurrentEnv(); - *result = env->GetStaticFieldID(clazz, name, sig); - - return NS_OK; -} - -/** - * To give proper "local" refs, need to run this in the true thread. - */ -NS_IMETHODIMP CSecureEnv::NewString(/*[in]*/ const jchar* unicode, - /*[in]*/ jsize len, - /*[out]*/ jstring* result) -{ - if (result == NULL) - return NS_ERROR_NULL_POINTER; - - // *result = mJavaEnv->NewString(unicode, len); - class NewStringMessage : public JavaMessage { - const jchar* unicode; - jsize len; - jstring* result; - public: - NewStringMessage(const jchar* unicode, jsize len, jstring* result) - { - this->unicode = unicode; - this->len = len; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->NewString(unicode, len); - } - } msg(unicode, len, result); - sendMessageToJava(&msg); - - return NS_OK; -} - -NS_IMETHODIMP CSecureEnv::GetStringLength(/*[in]*/ jstring str, - /*[out]*/ jsize* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = mJavaEnv->GetStringLength(str); - - return NS_OK; -} - -NS_IMETHODIMP CSecureEnv::GetStringChars(/*[in]*/ jstring str, - /*[in]*/ jboolean *isCopy, - /*[out]*/ const jchar** result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = mJavaEnv->GetStringChars(str, isCopy); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::ReleaseStringChars(/*[in]*/ jstring str, - /*[in]*/ const jchar *chars) -{ - if (mJavaEnv == NULL) - return NS_ERROR_NULL_POINTER; - - mJavaEnv->ReleaseStringChars(str, chars); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::NewStringUTF(/*[in]*/ const char *utf, - /*[out]*/ jstring* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - // *result = mJavaEnv->NewStringUTF(utf); - class NewStringUTFMessage : public JavaMessage { - const char *utf; - jstring* result; - public: - NewStringUTFMessage(const char *utf, jstring* result) - { - this->utf = utf; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->NewStringUTF(utf); - } - } msg(utf, result); - sendMessageToJava(&msg); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::GetStringUTFLength(/*[in]*/ jstring str, - /*[out]*/ jsize* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = mJavaEnv->GetStringUTFLength(str); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::GetStringUTFChars(/*[in]*/ jstring str, - /*[in]*/ jboolean *isCopy, - /*[out]*/ const char** result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = mJavaEnv->GetStringUTFChars(str, isCopy); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::ReleaseStringUTFChars(/*[in]*/ jstring str, - /*[in]*/ const char *chars) -{ - if (mJavaEnv == NULL) - return NS_ERROR_NULL_POINTER; - - mJavaEnv->ReleaseStringUTFChars(str, chars); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::GetArrayLength(/*[in]*/ jarray array, - /*[out]*/ jsize* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = mJavaEnv->GetArrayLength(array); - - return NS_OK; -} - -NS_IMETHODIMP CSecureEnv::NewObjectArray(/*[in]*/ jsize len, - /*[in]*/ jclass clazz, - /*[in]*/ jobject init, - /*[out]*/ jobjectArray* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = mJavaEnv->NewObjectArray(len, clazz, init); - - return NS_OK; -} - -NS_IMETHODIMP CSecureEnv::GetObjectArrayElement(/*[in]*/ jobjectArray array, - /*[in]*/ jsize index, - /*[out]*/ jobject* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = mJavaEnv->GetObjectArrayElement(array, index); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::SetObjectArrayElement(/*[in]*/ jobjectArray array, - /*[in]*/ jsize index, - /*[in]*/ jobject val) -{ - if (mJavaEnv == NULL) - return NS_ERROR_NULL_POINTER; - - mJavaEnv->SetObjectArrayElement(array, index, val); - - return NS_OK; -} - -NS_IMETHODIMP CSecureEnv::NewArray(/*[in]*/ jni_type element_type, - /*[in]*/ jsize len, - /*[out]*/ jarray* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - switch (element_type) { - case jboolean_type: - result = (jarray*) mJavaEnv->NewBooleanArray(len); - break; - case jbyte_type: - result = (jarray*) mJavaEnv->NewByteArray(len); - break; - case jchar_type: - result = (jarray*) mJavaEnv->NewCharArray(len); - break; - case jshort_type: - result = (jarray*) mJavaEnv->NewShortArray(len); - break; - case jint_type: - result = (jarray*) mJavaEnv->NewIntArray(len); - break; - case jlong_type: - result = (jarray*) mJavaEnv->NewLongArray(len); - break; - case jfloat_type: - result = (jarray*) mJavaEnv->NewFloatArray(len); - break; - case jdouble_type: - result = (jarray*) mJavaEnv->NewDoubleArray(len); - break; - default: - return NS_ERROR_FAILURE; - } - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::GetArrayElements(/*[in]*/ jni_type type, - /*[in]*/ jarray array, - /*[in]*/ jboolean *isCopy, - /*[out]*/ void* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - switch (type) { - case jboolean_type: - result = (void*) mJavaEnv->GetBooleanArrayElements((jbooleanArray)array, isCopy); - break; - case jbyte_type: - result = (void*) mJavaEnv->GetByteArrayElements((jbyteArray)array, isCopy); - break; - case jchar_type: - result = (void*) mJavaEnv->GetCharArrayElements((jcharArray)array, isCopy); - break; - case jshort_type: - result = (void*) mJavaEnv->GetShortArrayElements((jshortArray)array, isCopy); - break; - case jint_type: - result = (void*) mJavaEnv->GetIntArrayElements((jintArray)array, isCopy); - break; - case jlong_type: - result = (void*) mJavaEnv->GetLongArrayElements((jlongArray)array, isCopy); - break; - case jfloat_type: - result = (void*) mJavaEnv->GetFloatArrayElements((jfloatArray)array, isCopy); - break; - case jdouble_type: - result = (void*) mJavaEnv->GetDoubleArrayElements((jdoubleArray)array, isCopy); - break; - default: - return NS_ERROR_FAILURE; - } - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::ReleaseArrayElements(/*[in]*/ jni_type type, - /*[in]*/ jarray array, - /*[in]*/ void *elems, - /*[in]*/ jint mode) -{ - if (mJavaEnv == NULL) - return NS_ERROR_NULL_POINTER; - - switch (type) - { - case jboolean_type: - mJavaEnv->ReleaseBooleanArrayElements((jbooleanArray)array, (jboolean*)elems, mode); - break; - case jbyte_type: - mJavaEnv->ReleaseByteArrayElements((jbyteArray)array, (jbyte*)elems, mode); - break; - case jchar_type: - mJavaEnv->ReleaseCharArrayElements((jcharArray)array, (jchar*)elems, mode); - break; - case jshort_type: - mJavaEnv->ReleaseShortArrayElements((jshortArray)array, (jshort*)elems, mode); - break; - case jint_type: - mJavaEnv->ReleaseIntArrayElements((jintArray)array, (jint*)elems, mode); - break; - case jlong_type: - mJavaEnv->ReleaseLongArrayElements((jlongArray)array, (jlong*)elems, mode); - break; - case jfloat_type: - mJavaEnv->ReleaseFloatArrayElements((jfloatArray)array, (jfloat*)elems, mode); - break; - case jdouble_type: - mJavaEnv->ReleaseDoubleArrayElements((jdoubleArray)array, (jdouble*)elems, mode); - break; - default: - return NS_ERROR_FAILURE; - } - - return NS_OK; -} - -NS_IMETHODIMP CSecureEnv::GetArrayRegion(/*[in]*/ jni_type type, - /*[in]*/ jarray array, - /*[in]*/ jsize start, - /*[in]*/ jsize len, - /*[out]*/ void* buf) -{ - if (mJavaEnv == NULL || buf == NULL) - return NS_ERROR_NULL_POINTER; - - switch (type) { - case jboolean_type: - mJavaEnv->GetBooleanArrayRegion((jbooleanArray)array, start, len, (jboolean*)buf); - break; - case jbyte_type: - mJavaEnv->GetByteArrayRegion((jbyteArray)array, start, len, (jbyte*)buf); - break; - case jchar_type: - mJavaEnv->GetCharArrayRegion((jcharArray)array, start, len, (jchar*)buf); - break; - case jshort_type: - mJavaEnv->GetShortArrayRegion((jshortArray)array, start, len, (jshort*)buf); - break; - case jint_type: - mJavaEnv->GetIntArrayRegion((jintArray)array, start, len, (jint*)buf); - break; - case jlong_type: - mJavaEnv->GetLongArrayRegion((jlongArray)array, start, len, (jlong*)buf); - break; - case jfloat_type: - mJavaEnv->GetFloatArrayRegion((jfloatArray)array, start, len, (jfloat*)buf); - break; - case jdouble_type: - mJavaEnv->GetDoubleArrayRegion((jdoubleArray)array, start, len, (jdouble*)buf); - break; - default: - return NS_ERROR_FAILURE; - } - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::SetArrayRegion(/*[in]*/ jni_type type, - /*[in]*/ jarray array, - /*[in]*/ jsize start, - /*[in]*/ jsize len, - /*[in]*/ void* buf) -{ - if (mJavaEnv == NULL || buf == NULL) - return NS_ERROR_NULL_POINTER; - - switch (type) { - case jboolean_type: - mJavaEnv->SetBooleanArrayRegion((jbooleanArray)array, start, len, (jboolean*)buf); - break; - case jbyte_type: - mJavaEnv->SetByteArrayRegion((jbyteArray)array, start, len, (jbyte*)buf); - break; - case jchar_type: - mJavaEnv->SetCharArrayRegion((jcharArray)array, start, len, (jchar*)buf); - break; - case jshort_type: - mJavaEnv->SetShortArrayRegion((jshortArray)array, start, len, (jshort*)buf); - break; - case jint_type: - mJavaEnv->SetIntArrayRegion((jintArray)array, start, len, (jint*)buf); - break; - case jlong_type: - mJavaEnv->SetLongArrayRegion((jlongArray)array, start, len, (jlong*)buf); - break; - case jfloat_type: - mJavaEnv->SetFloatArrayRegion((jfloatArray)array, start, len, (jfloat*)buf); - break; - case jdouble_type: - mJavaEnv->SetDoubleArrayRegion((jdoubleArray)array, start, len, (jdouble*)buf); - break; - default: - return NS_ERROR_FAILURE; - } - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::RegisterNatives(/*[in]*/ jclass clazz, - /*[in]*/ const JNINativeMethod *methods, - /*[in]*/ jint nMethods, - /*[out]*/ jint* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = mJavaEnv->RegisterNatives(clazz, methods, nMethods); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::UnregisterNatives(/*[in]*/ jclass clazz, - /*[out]*/ jint* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = mJavaEnv->UnregisterNatives(clazz); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::MonitorEnter(/*[in]*/ jobject obj, - /*[out]*/ jint* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - // *result = mJavaEnv->MonitorEnter(obj); - class MonitorEnterMessage : public JavaMessage { - jobject obj; - jint* result; - public: - MonitorEnterMessage(jobject obj, jint* result) - { - this->obj = obj; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->MonitorEnter(obj); - } - } msg(obj, result); - sendMessageToJava(&msg); - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::MonitorExit(/*[in]*/ jobject obj, - /*[out]*/ jint* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - // *result = mJavaEnv->MonitorExit(obj); - class MonitorExitMessage : public JavaMessage { - jobject obj; - jint* result; - public: - MonitorExitMessage(jobject obj, jint* result) - { - this->obj = obj; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->MonitorExit(obj); - } - } msg(obj, result); - sendMessageToJava(&msg); - - return NS_OK; -} - -NS_IMETHODIMP CSecureEnv::GetJavaVM(/*[in]*/ JavaVM **vm, - /*[out]*/ jint* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = mJavaEnv->GetJavaVM(vm); - - return NS_OK; -} - -/** - * Runs a message loop. Puts the message in the sendQueue, then waits on the receiveQueue for the reply. - */ - -void CSecureEnv::messageLoop(JNIEnv* env, JavaMessage* msg, JavaMessageQueue* sendQueue, JavaMessageQueue* receiveQueue, Boolean busyWaiting) -{ - // put the message in the send queue, and wait for a reply. - sendQueue->putMessage(msg); - sendQueue->notify(); - JavaMessage* replyMsg = receiveQueue->getMessage(); - for (;;) { - // Fully synchronized approach. - if (replyMsg != NULL) { - if (replyMsg == msg) - break; - // must be a message that needs executing. - replyMsg->execute(env); - sendQueue->putMessage(replyMsg); - sendQueue->notify(); - // notify can cause a yield, so look again. - replyMsg = receiveQueue->getMessage(); - if (replyMsg != NULL) - continue; - } - // when busy waiting, must give time to browser between timed waits. - if (busyWaiting) { - receiveQueue->wait(kDefaultJMTime); - replyMsg = receiveQueue->getMessage(); - if (replyMsg != NULL) - continue; - // mSession->lock(); - mThreadManager->Sleep(); - // mSession->unlock(); - } else { - // wait for a message to arrive. - receiveQueue->wait(); - } - replyMsg = receiveQueue->getMessage(); - } -} - -CSecureEnv* GetSecureJNI(JNIEnv* env, jobject thread) -{ - CSecureEnv* secureJNI = NULL; - - jclass threadClass = env->GetObjectClass(thread); - if (threadClass != NULL) { - jfieldID fSecureEnvField = env->GetFieldID(threadClass, "fSecureEnv", "I"); - if (fSecureEnvField != NULL) { - secureJNI = (CSecureEnv*) env->GetIntField(thread, fSecureEnvField); - } else { - env->ExceptionClear(); - } - env->DeleteLocalRef(threadClass); - } - - return secureJNI; -} diff --git a/plugin/oji/MRJ/plugin/Source/CSecureEnv.h b/plugin/oji/MRJ/plugin/Source/CSecureEnv.h deleted file mode 100644 index fede86b65e9b..000000000000 --- a/plugin/oji/MRJ/plugin/Source/CSecureEnv.h +++ /dev/null @@ -1,409 +0,0 @@ -/* - * 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 - * Sun Microsystems, Inc. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - -/* - CSecureEnv.h - - Rewritten for use with MRJ plugin by Patrick C. Beard. - */ - -#ifndef CSecureJNI2_h___ -#define CSecureJNI_h___ - -#include "nsISecureEnv.h" -#include "nsIThreadManager.h" -#include "SupportsMixin.h" -#include "nsAgg.h" - -class MRJPlugin; -class MRJSession; - -class Monitor; -class nsIThreadManager; -class nsIJVMManager; - -class JavaMessage; -class JavaMessageQueue; - -class CSecureEnv : public nsISecureEnv, public nsIRunnable, private SupportsMixin { -public: - - //////////////////////////////////////////////////////////////////////////// - // from nsISupports and AggregatedQueryInterface: - - // NS_DECL_AGGREGATED - DECL_SUPPORTS_MIXIN - - static NS_METHOD Create(MRJPlugin* plugin, JNIEnv* proxyEnv, const nsIID& aIID, void* *aInstancePtr); - - //////////////////////////////////////////////////////////////////////////// - // from nsISecureJNI2: - - - /** - * Create new Java object in LiveConnect. - * - * @param clazz -- Java Class object. - * @param methodID -- Method id - * @param args -- arguments for invoking the constructor. - * @param result -- return new Java object. - * @param ctx -- security context - */ - NS_IMETHOD NewObject(/*[in]*/ jclass clazz, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jobject* result, - /*[in]*/ nsISecurityContext* ctx = NULL); - - /** - * Invoke method on Java object in LiveConnect. - * - * @param type -- Return type - * @param obj -- Java object. - * @param methodID -- method id - * @param args -- arguments for invoking the constructor. - * @param result -- return result of invocation. - * @param ctx -- security context - */ - NS_IMETHOD CallMethod(/*[in]*/ jni_type type, - /*[in]*/ jobject obj, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx = NULL); - - /** - * Invoke non-virtual method on Java object in LiveConnect. - * - * @param type -- Return type - * @param obj -- Java object. - * @param clazz -- Class object - * @param methodID -- method id - * @param args -- arguments for invoking the constructor. - * @param ctx -- security context - * @param result -- return result of invocation. - */ - NS_IMETHOD CallNonvirtualMethod(/*[in]*/ jni_type type, - /*[in]*/ jobject obj, - /*[in]*/ jclass clazz, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx = NULL); - - /** - * Get a field on Java object in LiveConnect. - * - * @param type -- Return type - * @param obj -- Java object. - * @param fieldID -- field id - * @param result -- return field value - * @param ctx -- security context - */ - NS_IMETHOD GetField(/*[in]*/ jni_type type, - /*[in]*/ jobject obj, - /*[in]*/ jfieldID fieldID, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx = NULL); - - /** - * Set a field on Java object in LiveConnect. - * - * @param type -- Return type - * @param obj -- Java object. - * @param fieldID -- field id - * @param val -- field value to set - * @param ctx -- security context - */ - NS_IMETHOD SetField(/*[in]*/ jni_type type, - /*[in]*/ jobject obj, - /*[in]*/ jfieldID fieldID, - /*[in]*/ jvalue val, - /*[in]*/ nsISecurityContext* ctx = NULL); - - /** - * Invoke static method on Java object in LiveConnect. - * - * @param type -- Return type - * @param clazz -- Class object. - * @param methodID -- method id - * @param args -- arguments for invoking the constructor. - * @param result -- return result of invocation. - * @param ctx -- security context - */ - NS_IMETHOD CallStaticMethod(/*[in]*/ jni_type type, - /*[in]*/ jclass clazz, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx = NULL); - - /** - * Get a static field on Java object in LiveConnect. - * - * @param type -- Return type - * @param clazz -- Class object. - * @param fieldID -- field id - * @param result -- return field value - * @param ctx -- security context - */ - NS_IMETHOD GetStaticField(/*[in]*/ jni_type type, - /*[in]*/ jclass clazz, - /*[in]*/ jfieldID fieldID, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx = NULL); - - - /** - * Set a static field on Java object in LiveConnect. - * - * @param type -- Return type - * @param clazz -- Class object. - * @param fieldID -- field id - * @param val -- field value to set - * @param ctx -- security context - */ - NS_IMETHOD SetStaticField(/*[in]*/ jni_type 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 NewObjectArray(/*[in]*/ jsize len, - /*[in]*/ jclass clazz, - /*[in]*/ jobject init, - /*[out]*/ jobjectArray* 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 NewArray(/*[in]*/ jni_type element_type, - /*[in]*/ jsize len, - /*[out]*/ jarray* result); - - NS_IMETHOD GetArrayElements(/*[in]*/ jni_type type, - /*[in]*/ jarray array, - /*[in]*/ jboolean *isCopy, - /*[out]*/ void* result); - - NS_IMETHOD ReleaseArrayElements(/*[in]*/ jni_type type, - /*[in]*/ jarray array, - /*[in]*/ void *elems, - /*[in]*/ jint mode); - - NS_IMETHOD GetArrayRegion(/*[in]*/ jni_type type, - /*[in]*/ jarray array, - /*[in]*/ jsize start, - /*[in]*/ jsize len, - /*[out]*/ void* buf); - - NS_IMETHOD SetArrayRegion(/*[in]*/ jni_type 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); - - //////////////////////////////////////////////////////////////////////////// - // from nsIRunnable: - - NS_IMETHOD Run(); - - CSecureEnv(MRJPlugin* plugin, JNIEnv* proxyEnv, JNIEnv* javaEnv = NULL); - virtual ~CSecureEnv(void); - - /** - * Called by the native run method, to connect the - * thread and the secure env. - */ - void initialize(JNIEnv* javaEnv, jboolean* isRunning, JavaMessageQueue* javaQueue, JavaMessageQueue* nativeQueue); - - jboolean isInitialized() { return mJavaQueue != NULL; } - - void setProxyEnv(JNIEnv* proxyEnv) { mProxyEnv = proxyEnv; } - JNIEnv* getProxyEnv() { return mProxyEnv; } - - void setJavaEnv(JNIEnv* javaEnv) { mJavaEnv = javaEnv; } - JNIEnv* getJavaEnv() { return mJavaEnv; } - - MRJSession* getSession() { return mSession; } - nsIThreadManager* getThreadManager() { return mThreadManager; } - - void getMessageQueues(JavaMessageQueue*& javaQueue, JavaMessageQueue*& nativeQueue) - { - javaQueue = mJavaQueue; - nativeQueue = mNativeQueue; - } - - void sendMessageToJava(JavaMessage* msg); - void sendMessageFromJava(JNIEnv* javaEnv, JavaMessage* msg, Boolean busyWaiting = false); - void messageLoop(JNIEnv* env, JavaMessage* msgToSend, JavaMessageQueue* sendQueue, JavaMessageQueue* receiveQueue, Boolean busyWaiting = false); - -protected: - - MRJPlugin* mPlugin; - JNIEnv* mProxyEnv; - MRJSession* mSession; - nsIThreadManager* mThreadManager; - - JNIEnv* mJavaEnv; - jboolean* mIsRunning; - JavaMessageQueue* mJavaQueue; - JavaMessageQueue* mNativeQueue; - -private: - // support for SupportsMixin. - static const InterfaceInfo sInterfaces[]; - static const UInt32 kInterfaceCount; -}; - -/** - * Returns the secure JNI associated with the current thread (if any). - */ -CSecureEnv* GetSecureJNI(JNIEnv* env, jobject thread); - -#endif // CSecureJNI2_h___ diff --git a/plugin/oji/MRJ/plugin/Source/EmbeddedFrame.cpp b/plugin/oji/MRJ/plugin/Source/EmbeddedFrame.cpp deleted file mode 100644 index 3484bf756208..000000000000 --- a/plugin/oji/MRJ/plugin/Source/EmbeddedFrame.cpp +++ /dev/null @@ -1,331 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - TopLevelFrame.cpp - - An MRJFrame sub-class that manages the behavior of a top-level window - running inside the Communicator. - - by Patrick C. Beard. - */ - -#include -#include - -#include "EmbeddedFrame.h" -#include "EmbeddedFramePluginInstance.h" -#include "MRJPlugin.h" -#include "MRJSession.h" - -#include "nsIPluginInstancePeer.h" -#include "nsIOutputStream.h" -#include "JSEvaluator.h" -#include "LocalPort.h" -#include "StringUtils.h" - -static void UnsetPort(GrafPtr port); - -EmbeddedFrame::EmbeddedFrame(MRJPluginInstance* pluginInstance, JMFrameRef frameRef, JMFrameKind kind, - const Rect* initialBounds, Boolean resizeable) - : MRJFrame(frameRef), - mPluginInstance(NULL), mEvaluator(NULL), mWindow(NULL), mBounds(*initialBounds) -{ - Boolean hasGoAway = true; - SInt16 windowProc = documentProc; - SInt16 resizeHeight = resizeable ? 15 : 0; - - switch (kind) { - case eBorderlessModelessWindowFrame: - hasGoAway = false; - windowProc = plainDBox; - // mBounds.bottom += resizeHeight; - resizeable = false; - break; - case eModelessWindowFrame: - case eModelessDialogFrame: - hasGoAway = true; - windowProc = resizeable ? zoomDocProc : documentProc; - // mBounds.bottom += resizeHeight; - break; - case eModalWindowFrame: - hasGoAway = true; - // We have to allow resizeable modal windows. - windowProc = resizeable ? documentProc : movableDBoxProc; - break; - } - -#if 0 - - // Note: opening a new window on a stream using the following code crashes 4.X browsers. - // The problem is that the window has no URL assigned to it, and so some variables are - // unitialized and the browser crashes in a call to strlen(). - - class NewStreamMessage : public NativeMessage { - nsIPluginInstancePeer* mPeer; - const char* mType; - public: - NewStreamMessage(nsIPluginInstancePeer* peer, const char* type) : mPeer(peer), mType(type) {} - - virtual void execute() { - nsIOutputStream* output = NULL; - if (mPeer->NewStream(mType, "_new", &output) == NS_OK) { - // write some data to the stream. - output->Close(); - NS_RELEASE(output); - } - } - }; - - // open a stream of type "application/x-java-frame", which should cause a full-screen plugin to get created for a Java frame's - // behalf. communicate with the other instance via this stream. - nsIPluginInstancePeer* peer = NULL; - if (pluginInstance->GetPeer(&peer) == NS_OK) { - NewStreamMessage msg(peer, "application/x-java-frame"); - pluginInstance->getSession()->sendMessage(&msg); - NS_RELEASE(peer); - } - -#else - // var w = window.open('', '_new','resizable=no,status=no,width=200,height=200'); d = w.document; d.open(); d.write('Hi'); d.close(); - - static UInt32 embeddedFrameCounter = 0; - - // Use JavaScript to create a window with an tag. - const char* kEmbeddedFrameScript = "var w = window.open('','__MRJ_JAVA_FRAME_%d__','resizable=no,status=no,width=%d,height=%d,screenX=%d,screenY=%d');" - "var d = w.document; d.open();" - "d.writeln(' ');" - "d.close();"; - - int width = mBounds.right - mBounds.left; - int height = mBounds.bottom - mBounds.top; - int screenX = mBounds.left; - int screenY = mBounds.top; - - char* script = new char[::strlen(kEmbeddedFrameScript) + 100]; - ::sprintf(script, kEmbeddedFrameScript, ++embeddedFrameCounter, width, height, screenX, screenY, width, height, this); - - JSEvaluator* evaluator = new JSEvaluator(pluginInstance); - evaluator->AddRef(); - - // create the window. It will have been created after returning from eval. - const char* result = evaluator->eval(script); - - evaluator->Release(); - - delete[] script; - -#endif - - if (mWindow != NULL) { - Point zeroPt = { 0, 0 }; - ::JMSetFrameVisibility(mFrameRef, mWindow, zeroPt, NULL); - } -} - -EmbeddedFrame::~EmbeddedFrame() -{ - if (mPluginInstance != NULL) - mPluginInstance->setFrame(NULL); - - // make sure the window is hidden (and unregistered with the browser). - showHide(false); - - // make sure this port isn't ever current again. - ::UnsetPort(mWindow); - - // if (mWindow != NULL) - // ::DisposeWindow(mWindow); -} - -void EmbeddedFrame::setSize(const Rect* newSize) -{ - mBounds = *newSize; - - if (mWindow != NULL) { - SInt16 width = newSize->right - newSize->left; - SInt16 height = newSize->bottom - newSize->top; - ::SizeWindow(mWindow, width, height, true); - ::MoveWindow(mWindow, newSize->left, newSize->top, false); - } -} - -void EmbeddedFrame::invalRect(const Rect* invalidRect) -{ - if (mWindow != NULL) { - ::InvalRect(invalidRect); - } -} - -void EmbeddedFrame::showHide(Boolean visible) -{ - if (mWindow != NULL && visible != IsWindowVisible(mWindow)) { - if (visible) { - // Have to notify the browser that this window exists, so that it will receive events. - ::ShowWindow(mWindow); - ::SelectWindow(mWindow); - } else { - ::HideWindow(mWindow); - } - - // ::ShowHide(mWindow, visible); - } -} - -void EmbeddedFrame::setTitle(const StringPtr title) -{ - if (mWindow != NULL) { - ::SetWTitle(mWindow, title); - } -} - -void EmbeddedFrame::checkUpdate() -{ -} - -void EmbeddedFrame::reorder(ReorderRequest request) -{ - switch (request) { - case eBringToFront: /* bring the window to front */ - break; - case eSendToBack: /* send the window to back */ - break; - case eSendBehindFront: /* send the window behind the front window */ - break; - } -} - -void EmbeddedFrame::setResizeable(Boolean resizeable) -{ - // this might have to recreate the window, no? -} - -static void computeBounds(WindowRef window, Rect* bounds) -{ - LocalPort port(window); - port.Enter(); - - Point position = { 0, 0 }; - ::LocalToGlobal(&position); - - *bounds = window->portRect; - - port.Exit(); - - ::OffsetRect(bounds, position.h, position.v); -} - -void EmbeddedFrame::activate(Boolean active) -{ - focusEvent(active); - MRJFrame::activate(active); -} - -void EmbeddedFrame::click(const EventRecord* event) -{ - Point where = event->where; - SInt16 modifiers = event->modifiers; - WindowRef hitWindow; - short partCode = ::FindWindow(where, &hitWindow); - switch (partCode) { - case inContent: - ::SelectWindow(mWindow); - MRJFrame::click(event); - break; - case inDrag: - Rect bounds = (**GetGrayRgn()).rgnBBox; - DragWindow(mWindow, where, &bounds); - computeBounds(mWindow, &mBounds); - break; - case inGrow: - Rect limits = { 30, 30, 5000, 5000 }; - long result = GrowWindow(mWindow, where, &limits); - if (result != 0) { - short width = (result & 0xFFFF); - short height = (result >> 16) & 0xFFFF; - Rect newBounds; - topLeft(newBounds) = topLeft(mBounds); - newBounds.right = newBounds.left + width; - newBounds.bottom = newBounds.top + height; - ::JMSetFrameSize(mFrameRef, &newBounds); - } - break; - case inGoAway: - if (::TrackGoAway(mWindow, where)) - ::JMFrameGoAway(mFrameRef); - break; - case inZoomIn: - case inZoomOut: - if (::TrackBox(mWindow, where, partCode)) { - ZoomWindow(mWindow, partCode, true); - computeBounds(mWindow, &mBounds); - ::JMSetFrameSize(mFrameRef, &mBounds); - } - break; - case inCollapseBox: - break; - } -} - -void EmbeddedFrame::setPluginInstance(EmbeddedFramePluginInstance* embeddedInstance) -{ - mPluginInstance = embeddedInstance; -} - -void EmbeddedFrame::setWindow(WindowRef window) -{ - mWindow = window; -} - -WindowRef EmbeddedFrame::getWindow() -{ - return mWindow; -} - -GrafPtr EmbeddedFrame::getPort() -{ - return mWindow; -} - -static void UnsetPort(GrafPtr port) -{ - GrafPtr curPort; - ::GetPort(&curPort); - if (curPort == port) { - ::GetWMgrPort(&port); - ::SetPort(port); - } -} diff --git a/plugin/oji/MRJ/plugin/Source/EmbeddedFrame.h b/plugin/oji/MRJ/plugin/Source/EmbeddedFrame.h deleted file mode 100644 index b1c4c483793e..000000000000 --- a/plugin/oji/MRJ/plugin/Source/EmbeddedFrame.h +++ /dev/null @@ -1,87 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - EmbeddedFrame.h - - An MRJFrame sub-class that manages the behavior of a top-level window - running inside the Communicator. - - by Patrick C. Beard. - */ - -#pragma once - -#include "MRJFrame.h" - -#ifndef __MACWINDOWS__ -#include -#endif - -class MRJPluginInstance; -class EmbeddedFramePluginInstance; -class JSEvaluator; - -class EmbeddedFrame : public MRJFrame { -public: - EmbeddedFrame(MRJPluginInstance* pluginInstance, JMFrameRef frameRef, JMFrameKind kind, const Rect* initialBounds, Boolean resizeable); - virtual ~EmbeddedFrame(); - - virtual void setSize(const Rect* newSize); - virtual void invalRect(const Rect* invalidRect); - virtual void showHide(Boolean visible); - virtual void setTitle(const StringPtr title); - virtual void checkUpdate(); - virtual void reorder(ReorderRequest request); - virtual void setResizeable(Boolean resizeable); - - virtual void activate(Boolean active); - virtual void click(const EventRecord* event); - - void setPluginInstance(EmbeddedFramePluginInstance* embeddedInstance); - - void setWindow(WindowRef window); - WindowRef getWindow(); - -protected: - virtual GrafPtr getPort(); - -private: - EmbeddedFramePluginInstance* mPluginInstance; - JSEvaluator* mEvaluator; - WindowRef mWindow; - Rect mBounds; -}; diff --git a/plugin/oji/MRJ/plugin/Source/EmbeddedFramePluginInstance.cpp b/plugin/oji/MRJ/plugin/Source/EmbeddedFramePluginInstance.cpp deleted file mode 100644 index df85bdb6c774..000000000000 --- a/plugin/oji/MRJ/plugin/Source/EmbeddedFramePluginInstance.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - EmbeddedFramePluginInstance.cpp - */ - -#include "EmbeddedFramePluginInstance.h" -#include "EmbeddedFrame.h" -#include "MRJPlugin.h" - -#include "nsIPluginInstancePeer.h" -#include "nsIPluginTagInfo.h" - -#include - -EmbeddedFramePluginInstance::EmbeddedFramePluginInstance() - : mPeer(NULL), mFrame(NULL) -{ -} - -EmbeddedFramePluginInstance::~EmbeddedFramePluginInstance() -{ - if (mFrame != NULL) - delete mFrame; -} - -NS_METHOD EmbeddedFramePluginInstance::Initialize(nsIPluginInstancePeer* peer) -{ - mPeer = peer; - NS_ADDREF(mPeer); - - nsIPluginTagInfo* tagInfo = NULL; - if (mPeer->QueryInterface(NS_GET_IID(nsIPluginTagInfo), (void **)&tagInfo) == NS_OK) { - const char* frameValue = NULL; - if (tagInfo->GetAttribute("JAVAFRAME", &frameValue) == NS_OK) { - sscanf(frameValue, "%X", &mFrame); - } - if (mFrame != NULL) - mFrame->setPluginInstance(this); - NS_RELEASE(tagInfo); - } - - return NS_OK; -} - -NS_METHOD EmbeddedFramePluginInstance::GetPeer(nsIPluginInstancePeer* *resultingPeer) -{ - if (mPeer != NULL) { - *resultingPeer = mPeer; - mPeer->AddRef(); - } - return NS_OK; -} - -NS_METHOD EmbeddedFramePluginInstance::Destroy() -{ - NS_IF_RELEASE(mPeer); - - // assume that Java will release this frame. - if (mFrame != NULL) { - mFrame->showHide(false); - // delete mFrame; - mFrame = NULL; - } - - return NS_OK; -} - -NS_METHOD EmbeddedFramePluginInstance::SetWindow(nsPluginWindow* pluginWindow) -{ - if (mFrame != NULL) { - if (pluginWindow != NULL) - mFrame->setWindow(WindowRef(pluginWindow->window->port)); - else - mFrame->setWindow(NULL); - } - return NS_OK; -} - -NS_METHOD EmbeddedFramePluginInstance::HandleEvent(nsPluginEvent* pluginEvent, PRBool* eventHandled) -{ - if (mFrame != NULL) - *eventHandled = mFrame->handleEvent(pluginEvent->event); - return NS_OK; -} - -void EmbeddedFramePluginInstance::setFrame(EmbeddedFrame* frame) -{ - mFrame = frame; -} - -NS_IMPL_ISUPPORTS1(EmbeddedFramePluginInstance, nsIPluginInstance) diff --git a/plugin/oji/MRJ/plugin/Source/EmbeddedFramePluginInstance.h b/plugin/oji/MRJ/plugin/Source/EmbeddedFramePluginInstance.h deleted file mode 100644 index 63b615cccb58..000000000000 --- a/plugin/oji/MRJ/plugin/Source/EmbeddedFramePluginInstance.h +++ /dev/null @@ -1,196 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - EmbeddedFramePluginInstance.h - */ - -#pragma once - -#include "nsIPluginInstance.h" - -class EmbeddedFrame; -class MRJPluginInstance; - -class EmbeddedFramePluginInstance : public nsIPluginInstance { -public: - EmbeddedFramePluginInstance(); - virtual ~EmbeddedFramePluginInstance(); - - NS_DECL_ISUPPORTS - - /** - * Initializes a newly created plugin instance, passing to it the plugin - * instance peer which it should use for all communication back to the browser. - * - * @param peer - the corresponding plugin instance peer - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Initialize(nsIPluginInstancePeer* peer); - - /** - * Returns a reference back to the plugin instance peer. This method is - * used whenever the browser needs to obtain the peer back from a plugin - * instance. The implementation of this method should be sure to increment - * the reference count on the peer by calling AddRef. - * - * @param resultingPeer - the resulting plugin instance peer - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - GetPeer(nsIPluginInstancePeer* *resultingPeer); - - /** - * Called to instruct the plugin instance to start. This will be called after - * the plugin is first created and initialized, and may be called after the - * plugin is stopped (via the Stop method) if the plugin instance is returned - * to in the browser window's history. - * - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Start(void) - { - return NS_OK; - } - - /** - * Called to instruct the plugin instance to stop, thereby suspending its state. - * This method will be called whenever the browser window goes on to display - * another page and the page containing the plugin goes into the window's history - * list. - * - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Stop(void) - { - return NS_OK; - } - - /** - * Called to instruct the plugin instance to destroy itself. This is called when - * it become no longer possible to return to the plugin instance, either because - * the browser window's history list of pages is being trimmed, or because the - * window containing this page in the history is being closed. - * - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Destroy(void); - - /** - * Called when the window containing the plugin instance changes. - * - * (Corresponds to NPP_SetWindow.) - * - * @param window - the plugin window structure - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - SetWindow(nsPluginWindow* window); - - /** - * Called to tell the plugin that the initial src/data stream is - * ready. Expects the plugin to return a nsIPluginStreamListener. - * - * (Corresponds to NPP_NewStream.) - * - * @param listener - listener the browser will use to give the plugin the data - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - NewStream(nsIPluginStreamListener** listener) - { - *listener = NULL; - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * Called to instruct the plugin instance to print itself to a printer. - * - * (Corresponds to NPP_Print.) - * - * @param platformPrint - platform-specific printing information - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Print(nsPluginPrint* platformPrint) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * Returns the value of a variable associated with the plugin instance. - * - * @param variable - the plugin instance variable to get - * @param value - the address of where to store the resulting value - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - GetValue(nsPluginInstanceVariable variable, void *value) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * Handles an event. An nsIEventHandler can also get registered with with - * nsIPluginManager2::RegisterWindow and will be called whenever an event - * comes in for that window. - * - * Note that for Unix and Mac the nsPluginEvent structure is different - * from the old NPEvent structure -- it's no longer the native event - * record, but is instead a struct. This was done for future extensibility, - * and so that the Mac could receive the window argument too. For Windows - * and OS2, it's always been a struct, so there's no change for them. - * - * (Corresponds to NPP_HandleEvent.) - * - * @param event - the event to be handled - * @param handled - set to PR_TRUE if event was handled - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - HandleEvent(nsPluginEvent* event, PRBool* handled); - - void setFrame(EmbeddedFrame* frame); - -private: - nsIPluginInstancePeer* mPeer; - MRJPluginInstance* mParentInstance; - EmbeddedFrame* mFrame; -}; diff --git a/plugin/oji/MRJ/plugin/Source/EventFilter.cpp b/plugin/oji/MRJ/plugin/Source/EventFilter.cpp deleted file mode 100644 index 4268e6bf84e0..000000000000 --- a/plugin/oji/MRJ/plugin/Source/EventFilter.cpp +++ /dev/null @@ -1,175 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - EventFilter.cpp - - Provides a generalized event filtering service. - - Patches WaitNextEvent for events, and MenuSelect for menus. - - by Patrick C. Beard. - */ - -#include "EventFilter.h" - -#include -#include -#include -#include -#include -#include - -enum { - uppWaitNextEventProcInfo = kPascalStackBased - | RESULT_SIZE(SIZE_CODE(sizeof(Boolean))) - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(EventMask))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(EventRecord*))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(UInt32))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(RgnHandle))), - uppMenuSelectProcInfo = kPascalStackBased - | RESULT_SIZE(SIZE_CODE(sizeof(long))) - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Point))) -}; - -static pascal Boolean NewWaitNextEvent(EventMask eventMask, EventRecord* event, UInt32 sleep, RgnHandle mouseRgn); -static pascal long NewMenuSelect(Point where); - -enum { - kIsToolboxTrap = (1 << 11) -}; - -inline TrapType getTrapType(UInt16 trapNum) -{ - return ((trapNum & kIsToolboxTrap) != 0 ? kToolboxTrapType : kOSTrapType); -} - -static UniversalProcPtr SwapTrapAddress(UInt16 trapNum, UniversalProcPtr newTrapAddress) -{ - TrapType type = getTrapType(trapNum); - UniversalProcPtr oldTrapAddress = NGetTrapAddress(trapNum, type); - NSetTrapAddress(newTrapAddress, trapNum, type); - return oldTrapAddress; -} - -struct Patch { - UInt16 trap; - RoutineDescriptor descriptor; - UniversalProcPtr original; - - void Install() { original = SwapTrapAddress(trap, &descriptor); } - void Remove() { SwapTrapAddress(trap, original); original = NULL; } -}; - -static Patch WaitNextEventPatch = { - _WaitNextEvent, - BUILD_ROUTINE_DESCRIPTOR(uppWaitNextEventProcInfo, NewWaitNextEvent), - NULL -}; - -static Patch MenuSelectPatch = { - _MenuSelect, - BUILD_ROUTINE_DESCRIPTOR(uppMenuSelectProcInfo, NewMenuSelect), - NULL -}; - -static EventFilterProcPtr theEventFilter; -static MenuFilterProcPtr theMenuFilter; - -OSStatus InstallEventFilters(EventFilterProcPtr eventFilter, MenuFilterProcPtr menuFilter) -{ - if (theEventFilter == NULL) { - theEventFilter = eventFilter; - theMenuFilter = menuFilter; - - // Patch WNE, which will be used to filter events. - WaitNextEventPatch.Install(); - - // Patch MenuSelect, which will be used to filter menu selections. - MenuSelectPatch.Install(); - - return noErr; - } - return paramErr; -} - -OSStatus RemoveEventFilters() -{ - if (theEventFilter != NULL) { - WaitNextEventPatch.Remove(); - MenuSelectPatch.Remove(); - - theEventFilter = NULL; - theMenuFilter = NULL; - - return noErr; - } - return paramErr; -} - -static pascal Boolean NewWaitNextEvent(EventMask eventMask, EventRecord* event, UInt32 sleep, RgnHandle mouseRgn) -{ - Boolean gotEvent = CALL_FOUR_PARAMETER_UPP(WaitNextEventPatch.original, uppWaitNextEventProcInfo, eventMask, event, sleep, mouseRgn); - if (true) { - // prevent recursive calls to the filter. - static Boolean inFilter = false; - if (! inFilter) { - inFilter = true; - Boolean filteredEvent = theEventFilter(event); - if (filteredEvent) { - // consume the event by making it a nullEvent. - event->what = nullEvent; - gotEvent = false; - } - inFilter = false; - } - } - return gotEvent; -} - -static pascal long NewMenuSelect(Point where) -{ - long menuSelection = CALL_ONE_PARAMETER_UPP(MenuSelectPatch.original, uppMenuSelectProcInfo, where); - if (menuSelection != 0) { - Boolean filteredEvent = theMenuFilter(menuSelection); - if (filteredEvent) { - // consume the menu selection by zeroing it out. - menuSelection = 0; - } - } - return menuSelection; -} diff --git a/plugin/oji/MRJ/plugin/Source/EventFilter.h b/plugin/oji/MRJ/plugin/Source/EventFilter.h deleted file mode 100644 index 40913c80fb5c..000000000000 --- a/plugin/oji/MRJ/plugin/Source/EventFilter.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#pragma once - -/* - EventFilter.h - - Provides a generalized event filtering service. - - by Patrick C. Beard. - */ - -#ifndef __EVENTS__ -#include -#endif - -typedef Boolean (*EventFilterProcPtr) (EventRecord* event); -typedef Boolean (*MenuFilterProcPtr) (long menuSelection); - -OSStatus InstallEventFilters(EventFilterProcPtr eventFilter, MenuFilterProcPtr menuFilter); -OSStatus RemoveEventFilters(); diff --git a/plugin/oji/MRJ/plugin/Source/JMURLConnection b/plugin/oji/MRJ/plugin/Source/JMURLConnection deleted file mode 100644 index 8ca26329e5e60afe917c26291bf4ca93572bdfc7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 789 zcmZQz6=PsvV!#B6o^L}2to2NTIhpi7@={AqzuGl##C#<>E)Z4 zmzbVfWCTXI lOhw52&dlHoD9X0x" + Integer.toHexString(secureEnv)); - fSecureEnv = secureEnv; - setPriority(NORM_PRIORITY); - // setPriority(MAX_PRIORITY); - start(); - } - - public native void run(); -} diff --git a/plugin/oji/MRJ/plugin/Source/JNIUtils.java b/plugin/oji/MRJ/plugin/Source/JNIUtils.java deleted file mode 100644 index b7e978ae793d..000000000000 --- a/plugin/oji/MRJ/plugin/Source/JNIUtils.java +++ /dev/null @@ -1,80 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - JNIUtils.java - */ - -package netscape.oji; - -public class JNIUtils { - /** - * Returns a local reference for a passed-in global reference. - */ - public static Object NewLocalRef(Object object) { - return object; - } - - /** - * Returns the currently running thread. - */ - public static Object GetCurrentThread() { - return Thread.currentThread(); - } - - - /** - * Stub SecurityManager class, to expose access to class loaders. - */ - static class StubSecurityManager extends SecurityManager { - public ClassLoader getCurrentClassLoader() { - return currentClassLoader(); - } - } - - private static StubSecurityManager stubManager = new StubSecurityManager(); - - /** - * Returns the current class loader. - */ - public static Object GetCurrentClassLoader() { - return stubManager.getCurrentClassLoader(); - } - - public static Object GetObjectClassLoader(Object object) { - return object.getClass().getClassLoader(); - } -} diff --git a/plugin/oji/MRJ/plugin/Source/JSEvaluator.cpp b/plugin/oji/MRJ/plugin/Source/JSEvaluator.cpp deleted file mode 100644 index 6e9a62ff41c7..000000000000 --- a/plugin/oji/MRJ/plugin/Source/JSEvaluator.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - JSEvaluator.cpp - */ - -#include "JSEvaluator.h" -#include "MRJPlugin.h" -#include "MRJSession.h" -#include "MRJMonitor.h" -#include "nsIPluginManager.h" - -#include - -extern nsIPluginManager* thePluginManager; - -JSEvaluator::JSEvaluator(MRJPluginInstance* pluginInstance) - : mPluginInstance(pluginInstance) -{ - NS_ADDREF(pluginInstance); - mSession = pluginInstance->getSession(); - mJSMonitor = new MRJMonitor(mSession); -} - -JSEvaluator::~JSEvaluator() -{ - NS_IF_RELEASE(mPluginInstance); - if (mJSMonitor != NULL) - delete mJSMonitor; -} - -NS_IMPL_ISUPPORTS1(JSEvaluator, nsIPluginStreamListener) - -const char* JSEvaluator::eval(const char* script) -{ - JNIEnv* env = mSession->getCurrentEnv(); - nsIPluginStreamListener* listener = this; - - mJSMonitor->enter(); - - while (mScript != NULL) { - // some other thread is evaluating a script. - mJSMonitor->wait(); - } - - // construct a "javascript:" URL from the passed-in script. - const char* kJavaScriptPrefix = "javascript:"; - mScript = new char[strlen(kJavaScriptPrefix) + strlen(script) + 1]; - if (mScript != NULL) { - strcpy(mScript, kJavaScriptPrefix); - strcat(mScript, script); - - // start an async evaluation of this script. - nsresult result = thePluginManager->GetURL((nsIPluginInstance*)mPluginInstance, mScript, NULL, (nsIPluginStreamListener*)this); - - // default result is NULL, in case JavaScript returns undefined value. - if (mResult != NULL) { - delete[] mResult; - mResult = NULL; - } - - // need to block until the result is ready. - mJSMonitor->wait(); - - // can now delete the script. - delete[] mScript; - mScript = NULL; - } - - mJSMonitor->notifyAll(); - - mJSMonitor->exit(); - - return mResult; -} - -NS_METHOD JSEvaluator::OnDataAvailable(nsIPluginStreamInfo* pluginInfo, nsIInputStream* input, PRUint32 length) -{ - // hopefully all our data is available. - mResult = new char[length + 1]; - if (mResult != NULL) { - if (input->Read(mResult, length, &length) == NS_OK) { - // We've delayed processing the applet tag, because we - // don't know the location of the curren document yet. - mResult[length] = '\0'; - } - } - return NS_OK; -} - -NS_METHOD JSEvaluator::OnStopBinding(nsIPluginStreamInfo* pluginInfo, nsresult status) -{ - // the stream has been closed, notify any waiting Java threads. - mJSMonitor->notifyAll(); - return NS_OK; -} diff --git a/plugin/oji/MRJ/plugin/Source/JSEvaluator.h b/plugin/oji/MRJ/plugin/Source/JSEvaluator.h deleted file mode 100644 index c54401905694..000000000000 --- a/plugin/oji/MRJ/plugin/Source/JSEvaluator.h +++ /dev/null @@ -1,131 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - JSEvaluator.h - */ - -#pragma once - -#include "nsIPluginStreamListener.h" - -#ifndef JNI_H -#include "jni.h" -#endif - -class MRJMonitor; -class MRJSession; -class MRJPluginInstance; - -class JSEvaluator : public nsIPluginStreamListener { -public: - NS_DECL_ISUPPORTS - - JSEvaluator(MRJPluginInstance* pluginInstance); - virtual ~JSEvaluator(); - - const char* eval(const char* script); - - const char* getResult() - { - return mResult; - } - - // nsIPluginStreamListener implementation. - - /** - * Notify the observer that the URL has started to load. This method is - * called only once, at the beginning of a URL load.

- * - * @return The return value is currently ignored. In the future it may be - * used to cancel the URL load.. - */ - NS_IMETHOD - OnStartBinding(nsIPluginStreamInfo* pluginInfo) - { - return NS_OK; - } - - /** - * Notify the client that data is available in the input stream. This - * method is called whenver data is written into the input stream by the - * networking library...

- * - * @param aIStream The input stream containing the data. This stream can - * be either a blocking or non-blocking stream. - * @param length The amount of data that was just pushed into the stream. - * @return The return value is currently ignored. - */ - NS_IMETHOD - OnDataAvailable(nsIPluginStreamInfo* pluginInfo, nsIInputStream* input, PRUint32 length); - - NS_IMETHOD - OnFileAvailable(nsIPluginStreamInfo* pluginInfo, const char* fileName) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * Notify the observer that the URL has finished loading. This method is - * called once when the networking library has finished processing the - * URL transaction initiatied via the nsINetService::Open(...) call.

- * - * This method is called regardless of whether the URL loaded successfully.

- * - * @param status Status code for the URL load. - * @param msg A text string describing the error. - * @return The return value is currently ignored. - */ - NS_IMETHOD - OnStopBinding(nsIPluginStreamInfo* pluginInfo, nsresult status); - - /** - * What is this method supposed to do? - */ - NS_IMETHOD - GetStreamType(nsPluginStreamType *result) - { - *result = nsPluginStreamType_Normal; - return NS_OK; - } - -private: - MRJPluginInstance* mPluginInstance; - MRJSession* mSession; - MRJMonitor* mJSMonitor; - char* mScript; - char* mResult; -}; diff --git a/plugin/oji/MRJ/plugin/Source/JavaMessageQueue.h b/plugin/oji/MRJ/plugin/Source/JavaMessageQueue.h deleted file mode 100644 index bb7ba8a26787..000000000000 --- a/plugin/oji/MRJ/plugin/Source/JavaMessageQueue.h +++ /dev/null @@ -1,82 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - JavaMessageQueue.h - */ - -#pragma once - -#ifndef JNI_H -#include "jni.h" -#endif - -class Monitor; - -class JavaMessage { -public: - JavaMessage() : mNext(NULL) {} - virtual ~JavaMessage() {} - - void setNext(JavaMessage* next) { mNext = next; } - JavaMessage* getNext() { return mNext; } - - virtual void execute(JNIEnv* env) = 0; - -private: - JavaMessage* mNext; -}; - -class JavaMessageQueue { -public: - JavaMessageQueue(Monitor* monitor); - - void putMessage(JavaMessage* msg); - JavaMessage* getMessage(); - - void enter(); - void exit(); - - void wait(); - void wait(long long millis); - void notify(); - -private: - // Message queue. - JavaMessage* mFirst; - JavaMessage* mLast; - Monitor* mMonitor; -}; diff --git a/plugin/oji/MRJ/plugin/Source/LiveConnectNativeMethods.cpp b/plugin/oji/MRJ/plugin/Source/LiveConnectNativeMethods.cpp deleted file mode 100644 index 377b323e9d00..000000000000 --- a/plugin/oji/MRJ/plugin/Source/LiveConnectNativeMethods.cpp +++ /dev/null @@ -1,1017 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - LiveConnectNativeMethods.cpp - */ - -#include - -#include "LiveConnectNativeMethods.h" - -#include "nsIComponentManagerObsolete.h" -#include "nsIServiceManager.h" -#include "nsIPluginManager.h" -#include "nsIJVMManager.h" -#include "nsILiveconnect.h" -#include "nsIPluginInstancePeer2.h" - -#include "MRJPlugin.h" -#include "MRJContext.h" -#include "MRJSession.h" -#include "MRJSecurityContext.h" -#include "CSecureEnv.h" -#include "JavaMessageQueue.h" -#include "MRJMonitor.h" -#include "NativeMonitor.h" -#include "RunnableMixin.h" -#include "StringUtils.h" - -#include "netscape_javascript_JSObject.h" /* javah-generated headers */ - -extern nsIPluginManager* thePluginManager; - -static MRJPlugin* theJVMPlugin = NULL; -static nsILiveconnect* theLiveConnectManager = NULL; -static nsIComponentManagerObsolete* theComponentManager = NULL; - -static jclass netscape_javascript_JSObject = NULL; -static jmethodID netscape_javascript_JSObject_JSObject; -static jfieldID netscape_javascript_JSObject_internal; - -static jclass netscape_oji_JNIUtils = NULL; -static jmethodID netscape_oji_JNIUtils_NewLocalRef = NULL; -static jmethodID netscape_oji_JNIUtils_GetCurrentThread = NULL; -static jmethodID netscape_oji_JNIUtils_GetCurrentClassLoader = NULL; -static jmethodID netscape_oji_JNIUtils_GetObjectClassLoader = NULL; - -static NS_DEFINE_IID(kLiveConnectCID, NS_CLIVECONNECT_CID); -static NS_DEFINE_IID(kComponentManagerCID, NS_COMPONENTMANAGER_CID); - -static nsresult getGlobalComponentManager(nsIComponentManagerObsolete* *result) -{ - return MRJPlugin::GetService(kComponentManagerCID, NS_GET_IID(nsIComponentManagerObsolete), (void**)result); -} - -nsresult InitLiveConnectSupport(MRJPlugin* jvmPlugin) -{ - theJVMPlugin = jvmPlugin; - - getGlobalComponentManager(&theComponentManager); - - nsresult result = MRJPlugin::GetService(kLiveConnectCID, NS_GET_IID(nsILiveconnect), - (void**)&theLiveConnectManager); - if (result != NS_OK) - return result; - - // Manually load the required native methods. - static JNINativeMethod nativeMethods[] = { - "getMember", "(Ljava/lang/String;)Ljava/lang/Object;", (void*)&Java_netscape_javascript_JSObject_getMember, - "getSlot", "(I)Ljava/lang/Object;", (void*)&Java_netscape_javascript_JSObject_getSlot, - "setMember", "(Ljava/lang/String;Ljava/lang/Object;)V", (void*)&Java_netscape_javascript_JSObject_setMember, - "setSlot", "(ILjava/lang/Object;)V", (void*)&Java_netscape_javascript_JSObject_setSlot, - "removeMember", "(Ljava/lang/String;)V", (void*)&Java_netscape_javascript_JSObject_removeMember, - "call", "(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object;", (void*)&Java_netscape_javascript_JSObject_call, - "eval", "(Ljava/lang/String;)Ljava/lang/Object;", (void*)&Java_netscape_javascript_JSObject_eval, - "toString", "()Ljava/lang/String;", (void*)&Java_netscape_javascript_JSObject_toString, - "getWindow", "(Ljava/applet/Applet;)Lnetscape/javascript/JSObject;", (void*)&Java_netscape_javascript_JSObject_getWindow, - "finalize", "()V", (void*)&Java_netscape_javascript_JSObject_finalize, - }; - - JNIEnv* env = NULL; - nsrefcnt count = jvmPlugin->GetJNIEnv(&env); - if (count > 0 && env != NULL) { - jclass classJSObject = env->FindClass("netscape/javascript/JSObject"); - if (classJSObject != NULL) { - // register LiveConnect native methods. - netscape_javascript_JSObject = (jclass) env->NewGlobalRef(classJSObject); - env->DeleteLocalRef(classJSObject); - - netscape_javascript_JSObject_JSObject = env->GetMethodID(netscape_javascript_JSObject, "", "(I)V"); - netscape_javascript_JSObject_internal = env->GetFieldID(netscape_javascript_JSObject, "internal", "I"); - - env->RegisterNatives(netscape_javascript_JSObject, nativeMethods, sizeof(nativeMethods) / sizeof(JNINativeMethod)); - if (env->ExceptionOccurred()) { - env->ExceptionClear(); - result = NS_ERROR_FAILURE; - } - } - - // load netscape.oji.JNIUtils class. - jclass classJNIUtils = env->FindClass("netscape/oji/JNIUtils"); - if (classJNIUtils != NULL) { - netscape_oji_JNIUtils = (jclass) env->NewGlobalRef(classJNIUtils); - env->DeleteLocalRef(classJNIUtils); - netscape_oji_JNIUtils_NewLocalRef = env->GetStaticMethodID(netscape_oji_JNIUtils, "NewLocalRef", "(Ljava/lang/Object;)Ljava/lang/Object;"); - netscape_oji_JNIUtils_GetCurrentThread = env->GetStaticMethodID(netscape_oji_JNIUtils, "GetCurrentThread", "()Ljava/lang/Object;"); - netscape_oji_JNIUtils_GetCurrentClassLoader = env->GetStaticMethodID(netscape_oji_JNIUtils, "GetCurrentClassLoader", "()Ljava/lang/Object;"); - netscape_oji_JNIUtils_GetObjectClassLoader = env->GetStaticMethodID(netscape_oji_JNIUtils, "GetObjectClassLoader", "(Ljava/lang/Object;)Ljava/lang/Object;"); - } - - jvmPlugin->ReleaseJNIEnv(env); - } - - return result; -} - -nsresult ShutdownLiveConnectSupport() -{ - NS_IF_RELEASE(theLiveConnectManager); - NS_IF_RELEASE(theComponentManager); - - if (theJVMPlugin != NULL) { - theJVMPlugin = NULL; - } - - return NS_OK; -} - -jobject Wrap_JSObject(JNIEnv* env, jsobject js_obj) -{ - jmethodID constructorID = env->GetMethodID(netscape_javascript_JSObject, "", "(I)V"); - return env->NewObject(netscape_javascript_JSObject, constructorID, js_obj); -} - -jsobject Unwrap_JSObject(JNIEnv* env, jobject java_wrapper_obj) -{ - return env->GetIntField(java_wrapper_obj, netscape_javascript_JSObject_internal); -} - -static jobject NewLocalRef(JNIEnv* env, jobject global_ref) -{ - return env->CallStaticObjectMethod(netscape_oji_JNIUtils, netscape_oji_JNIUtils_NewLocalRef, global_ref); -} - -static jobject ToGlobalRef(JNIEnv* env, jobject localRef) -{ - jobject globalRef = env->NewGlobalRef(localRef); - env->DeleteLocalRef(localRef); - return globalRef; -} - -static jobject ToLocalRef(JNIEnv* env, jobject globalRef) -{ - jobject localRef = NewLocalRef(env, globalRef); - env->DeleteGlobalRef(globalRef); - return localRef; -} - -static jobject GetCurrentThread(JNIEnv* env) -{ - return env->CallStaticObjectMethod(netscape_oji_JNIUtils, netscape_oji_JNIUtils_GetCurrentThread); -} - -/** - * Security Considerations. - */ - -MRJSecurityContext::MRJSecurityContext(const char* location) - : mLocation(nsnull), mConnection(nsnull) -{ - mLocation = ::strdup(location); - if (mLocation) { - // find the 3rd slash of the URL, hopefully it's in canonical form. - char* colon = ::strchr(mLocation, ':'); - if (colon) { - if (colon[1] == '/' && colon[2] == '/') { - char* slash = ::strchr(colon + 3, '/'); - if (slash) *slash = '\0'; - } - } - } - - if (theComponentManager) { - theComponentManager->CreateInstance(kLiveConnectCID, nsnull, NS_GET_IID(nsILiveconnect), - (void**)&mConnection); - } else { - mConnection = theLiveConnectManager; - NS_IF_ADDREF(mConnection); - } -} - -MRJSecurityContext::~MRJSecurityContext() -{ - delete[] mLocation; - NS_IF_RELEASE(mConnection); -} - -// work around a bug in Metrowerks pre-processor. -NS_IMPL_ISUPPORTS1(MRJSecurityContext, nsISecurityContext) - -NS_METHOD MRJSecurityContext::Implies(const char* target, const char* action, PRBool *bAllowedAccess) -{ - *bAllowedAccess = (target != NULL && action == NULL); - return NS_OK; -} - -NS_METHOD -MRJSecurityContext::GetOrigin(char* buf, int len) -{ - if (mLocation) { - ::strncpy(buf, mLocation, len); - return NS_OK; - } - return NS_ERROR_FAILURE; -} - -NS_METHOD -MRJSecurityContext::GetCertificateID(char* buf, int len) -{ - // ACTION: Implement me. - return NS_ERROR_NOT_IMPLEMENTED; -} - -// NOTE: this a weak reference to the MRJSecurityContext associated with this -// plugin instance. The MRJSecurityContext is owned by the MRJContext. - -static MRJSecurityContext* getSecurityContext(MRJPluginInstance* pluginInstance) -{ - if (pluginInstance != NULL) { - MRJContext* context = pluginInstance->getContext(); - MRJSecurityContext* securityContext = context->getSecurityContext(); - if (securityContext == NULL) { - securityContext = new MRJSecurityContext(context->getDocumentBase()); - context->setSecurityContext(securityContext); - } - return securityContext; - } - return NULL; -} - -inline nsILiveconnect* getLiveconnectInstance(MRJSecurityContext* securityContext) -{ - return (securityContext ? securityContext->getConnection() : theLiveConnectManager); -} - -static jobject GetCurrentClassLoader(JNIEnv* env) -{ - return env->CallStaticObjectMethod(netscape_oji_JNIUtils, netscape_oji_JNIUtils_GetCurrentClassLoader); -} - -static jobject GetObjectClassLoader(JNIEnv* env, jobject object) -{ - return env->CallStaticObjectMethod(netscape_oji_JNIUtils, netscape_oji_JNIUtils_GetObjectClassLoader, object); -} - -/** - * Maps the given JNIEnv to a given plugin instance by comparing the current class loader - * with the class loader of the applet of each plugin instance. This could be made - * faster, but it's probably good enough. Note: the reference count of the plugin - * instance isn't affected by this call. - */ -static MRJPluginInstance* GetCurrentInstance(JNIEnv* env) -{ - MRJPluginInstance* pluginInstance = NULL; - jobject classLoader = GetCurrentClassLoader(env); - if (classLoader != NULL) { - pluginInstance = MRJPluginInstance::getInstances(); - while (pluginInstance != NULL) { - jobject applet; - pluginInstance->GetJavaObject(&applet); - jobject appletClassLoader = GetObjectClassLoader(env, applet); - jboolean sameClassLoader = env->IsSameObject(appletClassLoader, classLoader); - env->DeleteLocalRef(appletClassLoader); - if (sameClassLoader) - break; - pluginInstance = pluginInstance->getNextInstance(); - } - env->DeleteLocalRef(classLoader); - } - return pluginInstance; -} - -/** - * Wraps a JavaMessage in an nsIRunnable form, so that it runs on the correct native thread. - */ -class MessageRunnable : public JavaMessage, public RunnableMixin { -public: - MessageRunnable(PRUint32 threadID, JavaMessage* msg); - - virtual void execute(JNIEnv* env); - - NS_IMETHOD Run(); - -private: - PRUint32 mThreadID; - JavaMessage* mMessage; -}; - -MessageRunnable::MessageRunnable(PRUint32 threadID, JavaMessage* msg) - : mThreadID(threadID), mMessage(msg) -{ -} - -void MessageRunnable::execute(JNIEnv* env) -{ - // because a spontaneous Java thread called us, we have to switch to the JavaScript thread - // to handle this request. - nsIThreadManager* threadManager = NULL; - if (MRJPlugin::GetService(nsIJVMManager::GetCID(), NS_GET_IID(nsIThreadManager), (void **)&threadManager) == NS_OK) { - threadManager->PostEvent(mThreadID, this, PR_FALSE); - NS_RELEASE(threadManager); - } -} - -NS_IMETHODIMP MessageRunnable::Run() -{ - nsIJVMManager* javaManager = NULL; - if (MRJPlugin::GetService(nsIJVMManager::GetCID(), NS_GET_IID(nsIJVMManager), (void **)&javaManager) == NS_OK) { - JNIEnv* proxyEnv = NULL; - if (javaManager->GetProxyJNI(&proxyEnv) == NS_OK && proxyEnv != NULL) - mMessage->execute(proxyEnv); - NS_RELEASE(javaManager); - } - return NS_OK; -} - -static PRUint32 getJavaScriptThread(JNIEnv* env) -{ - PRUint32 threadID = 0; - MRJPluginInstance* pluginInstance = GetCurrentInstance(env); - if (pluginInstance != NULL) { - nsIPluginInstancePeer* peer; - if (pluginInstance->GetPeer(&peer) == NS_OK) { - nsIPluginInstancePeer2* peer2 = NULL; - if (peer->QueryInterface(NS_GET_IID(nsIPluginInstancePeer2), (void **)&peer2) == NS_OK) { - if (peer2->GetJSThread(&threadID) != NS_OK) - threadID = 0; - NS_RELEASE(peer2); - } - NS_RELEASE(peer); - } - } - return threadID; -} - -/** - * Sends a message by rendezvousing with an existing JavaScript thread, or creates a new one - * if none exists for this thread already. - */ -static void sendMessage(JNIEnv* env, JavaMessage* msg) -{ - // the main thread gets its own secure env, so it won't contend with other threads. this - // is needed to handle finalization, which seems to get called from the main thread sometimes. - if (env == theJVMPlugin->getSession()->getMainEnv()) { - static CSecureEnv* mainEnv = NULL; - if (mainEnv == NULL) { - mainEnv = new CSecureEnv(theJVMPlugin, NULL, env); - mainEnv->AddRef(); - } - mainEnv->setJavaEnv(env); - mainEnv->sendMessageFromJava(env, msg, true); - return; - } - - // If this is a call back into JavaScript from Java, there will be a secureEnv associated with this thread. - jobject thread = GetCurrentThread(env); - CSecureEnv* secureEnv = GetSecureJNI(env, thread); - env->DeleteLocalRef(thread); - if (secureEnv != NULL) { - secureEnv->sendMessageFromJava(env, msg); - } else { - // spontaneous call in from Java. this communicates with a shared server thread. this is *VERY* slow right now. - static MRJMonitor sharedMonitor(theJVMPlugin->getSession()); - // only 1 Java thread can use this at a time. - sharedMonitor.enter(); - { - static CSecureEnv* sharedEnv = NULL; - if (sharedEnv == NULL) { - sharedEnv = new CSecureEnv(theJVMPlugin, NULL, env); - sharedEnv->AddRef(); - } - sharedEnv->setJavaEnv(env); - - // In the current Seamonkey architecture, there's really only one thread that JavaScript - // can execute in. We take advantage of that fact here. When we have a more multithreaded - // system, this will have to be revisited. - static PRUint32 theJavaScriptThread = getJavaScriptThread(env); - - // if the JavaScript thread is known, wrap the message in a MessageRunnable to handle - // the message in the JavaScript thread. - if (theJavaScriptThread != 0) { - MessageRunnable* runnableMsg = new MessageRunnable(theJavaScriptThread, msg); - NS_ADDREF(runnableMsg); - sharedEnv->sendMessageFromJava(env, runnableMsg); - NS_IF_RELEASE(runnableMsg); - } - } - sharedMonitor.exit(); - } -} - -static nsIPrincipal* newCodebasePrincipal(const char* codebaseURL) -{ - nsIPrincipal* principal = NULL; -#if 0 - nsICapsManager* capsManager = NULL; - static NS_DEFINE_IID(kICapsManagerIID, NS_ICAPSMANAGER_IID); - if (thePluginManager->QueryInterface(kICapsManagerIID, &capsManager) == NS_OK) { - if (capsManager->CreateCodebasePrincipal(codebaseURL, &principal) != NS_OK) - principal = NULL; - capsManager->Release(); - } -#endif - return principal; -} - -/****************** Implementation of methods of JSObject *******************/ - -/* - * Class: netscape_javascript_JSObject - * Method: getMember - * Signature: (Ljava/lang/String;)Ljava/lang/Object; - */ - -class GetMemberMessage : public JavaMessage { - MRJPluginInstance* mPluginInstance; - jsobject mObject; - const jchar* mPropertyName; - jsize mLength; - jobject* mResultObject; -public: - GetMemberMessage(MRJPluginInstance* pluginInstance, jsobject js_obj, - const jchar* propertyName, jsize nameLength, jobject* member) - : mPluginInstance(pluginInstance), mObject(js_obj), mPropertyName(propertyName), - mLength(nameLength), mResultObject(member) - { - } - - virtual void execute(JNIEnv* env) - { - MRJSecurityContext* securityContext = getSecurityContext(mPluginInstance); - nsILiveconnect* connection = getLiveconnectInstance(securityContext); - jobject member; - nsresult result = connection->GetMember(env, mObject, mPropertyName, mLength, NULL, 0, securityContext, &member); - if (result == NS_OK) { - // convert reference to a global reference, in case we're switching threads. - *mResultObject = ToGlobalRef(env, member); - } - } -}; - -JNIEXPORT jobject JNICALL -Java_netscape_javascript_JSObject_getMember(JNIEnv* env, - jobject java_wrapper_obj, - jstring property_name_jstr) -{ - if (property_name_jstr == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal null member name"); - return NULL; - } - - MRJPluginInstance* pluginInstance = GetCurrentInstance(env); -#if 0 - if (pluginInstance == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal JNIEnv (can't find plugin)"); - return NULL; - } -#endif - - /* Get the Unicode string for the JS property name */ - jboolean is_copy; - const jchar* property_name_ucs2 = env->GetStringChars(property_name_jstr, &is_copy); - jsize property_name_len = env->GetStringLength(property_name_jstr); - - jsobject js_obj = Unwrap_JSObject(env, java_wrapper_obj); - jobject member = NULL; - - GetMemberMessage msg(pluginInstance, js_obj, property_name_ucs2, property_name_len, &member); - sendMessage(env, &msg); - - // convert the resulting reference back to a local reference. - if (member != NULL) - member = ToLocalRef(env, member); - - env->ReleaseStringChars(property_name_jstr, property_name_ucs2); - - return member; -} - -/* - * Class: netscape_javascript_JSObject - * Method: getSlot - * Signature: (I)Ljava/lang/Object; - */ - -class GetSlotMessage : public JavaMessage { - MRJPluginInstance* mPluginInstance; - jsobject mObject; - jint mSlot; - jobject* mResultObject; -public: - GetSlotMessage(MRJPluginInstance* pluginInstance, jsobject js_obj, - jint slot, jobject* member) - : mPluginInstance(pluginInstance), mObject(js_obj), mSlot(slot), mResultObject(member) - { - } - - virtual void execute(JNIEnv* env) - { - MRJSecurityContext* securityContext = getSecurityContext(mPluginInstance); - nsILiveconnect* connection = getLiveconnectInstance(securityContext); - jobject member; - nsresult result = connection->GetSlot(env, mObject, mSlot, NULL, 0, securityContext, &member); - if (result == NS_OK) { - // convert reference to a global reference, in case we're switching threads. - *mResultObject = ToGlobalRef(env, member); - } - } -}; - -JNIEXPORT jobject JNICALL -Java_netscape_javascript_JSObject_getSlot(JNIEnv* env, - jobject java_wrapper_obj, - jint slot) -{ - MRJPluginInstance* pluginInstance = GetCurrentInstance(env); -#if 0 - if (pluginInstance == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal JNIEnv (can't find plugin)"); - return NULL; - } -#endif - - jsobject js_obj = Unwrap_JSObject(env, java_wrapper_obj); - jobject member = NULL; - - GetSlotMessage msg(pluginInstance, js_obj, slot, &member); - sendMessage(env, &msg); - - // convert the resulting reference back to a local reference. - if (member != NULL) - member = ToLocalRef(env, member); - return member; -} - -/* - * Class: netscape_javascript_JSObject - * Method: setMember - * Signature: (Ljava/lang/String;Ljava/lang/Object;)V - */ - -class SetMemberMessage : public JavaMessage { - MRJPluginInstance* mPluginInstance; - jsobject mObject; - const jchar* mPropertyName; - jsize mLength; - jobject mJavaObject; -public: - SetMemberMessage(MRJPluginInstance* pluginInstance, jsobject js_obj, const jchar* propertyName, - jsize nameLength, jobject java_obj) - : mPluginInstance(pluginInstance), mObject(js_obj), mPropertyName(propertyName), mLength(nameLength), mJavaObject(java_obj) - { - } - - virtual void execute(JNIEnv* env) - { - MRJSecurityContext* securityContext = getSecurityContext(mPluginInstance); - nsILiveconnect* connection = getLiveconnectInstance(securityContext); - nsresult result = connection->SetMember(env, mObject, mPropertyName, mLength, mJavaObject, 0, NULL, securityContext); - } -}; - -JNIEXPORT void JNICALL -Java_netscape_javascript_JSObject_setMember(JNIEnv* env, - jobject java_wrapper_obj, - jstring property_name_jstr, - jobject java_obj) -{ - if (property_name_jstr == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal null member name"); - return; - } - - MRJPluginInstance* pluginInstance = GetCurrentInstance(env); -#if 0 - if (pluginInstance == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal JNIEnv (can't find plugin)"); - return; - } -#endif - - /* Get the Unicode string for the JS property name */ - jboolean is_copy; - const jchar* property_name_ucs2 = env->GetStringChars(property_name_jstr, &is_copy); - jsize property_name_len = env->GetStringLength(property_name_jstr); - - jsobject js_obj = Unwrap_JSObject(env, java_wrapper_obj); - java_obj = ToGlobalRef(env, java_obj); - - SetMemberMessage msg(pluginInstance, js_obj, property_name_ucs2, property_name_len, java_obj); - sendMessage(env, &msg); - - env->DeleteGlobalRef(java_obj); - env->ReleaseStringChars(property_name_jstr, property_name_ucs2); -} - -/* - * Class: netscape_javascript_JSObject - * Method: setSlot - * Signature: (ILjava/lang/Object;)V - */ - -class SetSlotMessage : public JavaMessage { - MRJPluginInstance* mPluginInstance; - jsobject mObject; - jint mSlot; - jobject mJavaObject; -public: - SetSlotMessage(MRJPluginInstance* pluginInstance, jsobject js_obj, jint slot, jobject java_obj) - : mPluginInstance(pluginInstance), mObject(js_obj), mSlot(slot), mJavaObject(java_obj) - { - } - - virtual void execute(JNIEnv* env) - { - MRJSecurityContext* securityContext = getSecurityContext(mPluginInstance); - nsILiveconnect* connection = getLiveconnectInstance(securityContext); - nsresult result = connection->SetSlot(env, mObject, mSlot, mJavaObject, 0, NULL, securityContext); - } -}; - -JNIEXPORT void JNICALL -Java_netscape_javascript_JSObject_setSlot(JNIEnv* env, - jobject java_wrapper_obj, - jint slot, - jobject java_obj) -{ - MRJPluginInstance* pluginInstance = GetCurrentInstance(env); -#if 0 - if (pluginInstance == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal JNIEnv (can't find plugin)"); - return; - } -#endif - - jsobject js_obj = Unwrap_JSObject(env, java_wrapper_obj); - java_obj = ToGlobalRef(env, java_obj); - - SetSlotMessage msg(pluginInstance, js_obj, slot, java_obj); - sendMessage(env, &msg); - env->DeleteGlobalRef(java_obj); -} - -/* - * Class: netscape_javascript_JSObject - * Method: removeMember - * Signature: (Ljava/lang/String;)V - */ - -class RemoveMemberMessage : public JavaMessage { - MRJPluginInstance* mPluginInstance; - jsobject mObject; - const jchar* mPropertyName; - jsize mLength; -public: - RemoveMemberMessage(MRJPluginInstance* pluginInstance, jsobject obj, - const jchar* propertyName, jsize length) - : mPluginInstance(pluginInstance), mObject(obj), - mPropertyName(propertyName), mLength(length) - { - } - - virtual void execute(JNIEnv* env) - { - MRJSecurityContext* securityContext = getSecurityContext(mPluginInstance); - nsILiveconnect* connection = getLiveconnectInstance(securityContext); - nsresult result = connection->RemoveMember(env, mObject, mPropertyName, mLength, NULL, 0, securityContext); - } -}; - -JNIEXPORT void JNICALL -Java_netscape_javascript_JSObject_removeMember(JNIEnv* env, - jobject java_wrapper_obj, - jstring property_name_jstr) -{ - if (property_name_jstr == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal null member name"); - return; - } - - MRJPluginInstance* pluginInstance = GetCurrentInstance(env); -#if 0 - if (pluginInstance == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal JNIEnv (can't find plugin)"); - return; - } -#endif - - /* Get the Unicode string for the JS property name */ - jboolean is_copy; - const jchar* property_name_ucs2 = env->GetStringChars(property_name_jstr, &is_copy); - jsize property_name_len = env->GetStringLength(property_name_jstr); - - jsobject js_obj = Unwrap_JSObject(env, java_wrapper_obj); - RemoveMemberMessage msg(pluginInstance, js_obj, property_name_ucs2, property_name_len); - - sendMessage(env, &msg); - - env->ReleaseStringChars(property_name_jstr, property_name_ucs2); -} - -/* - * Class: netscape_javascript_JSObject - * Method: call - * Signature: (Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object; - */ -class CallMessage : public JavaMessage { - MRJPluginInstance* mPluginInstance; - jsobject mObject; - const jchar* mFunctionName; - jsize mLength; - jobjectArray mJavaArgs; - jobject* mJavaResult; -public: - CallMessage(MRJPluginInstance* pluginInstance, jsobject obj, const jchar* functionName, - jsize length, jobjectArray javaArgs, jobject* javaResult) - : mPluginInstance(pluginInstance), mObject(obj), mFunctionName(functionName), - mLength(length), mJavaArgs(javaArgs), mJavaResult(javaResult) - { - } - - virtual void execute(JNIEnv* env) - { - /* If we have an applet, try to create a codebase principle. */ - MRJSecurityContext* securityContext = getSecurityContext(mPluginInstance); - nsILiveconnect* connection = getLiveconnectInstance(securityContext); - jobject jresult = NULL; - nsresult result = connection->Call(env, mObject, mFunctionName, mLength, mJavaArgs, NULL, 0, securityContext, &jresult); - if (result == NS_OK) - *mJavaResult = ToGlobalRef(env, jresult); - } -}; - -JNIEXPORT jobject JNICALL -Java_netscape_javascript_JSObject_call(JNIEnv* env, jobject java_wrapper_obj, - jstring function_name_jstr, jobjectArray java_args) -{ - if (function_name_jstr == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal null function name"); - return NULL; - } - - /* Try to determine which plugin instance is responsible for this thread. This is done by checking class loaders. */ - MRJPluginInstance* pluginInstance = GetCurrentInstance(env); -#if 0 - if (pluginInstance == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal JNIEnv (can't find plugin)"); - return NULL; - } -#endif - - /* Get the Unicode string for the JS function name */ - jboolean is_copy; - const jchar* function_name_ucs2 = env->GetStringChars(function_name_jstr, &is_copy); - jsize function_name_len = env->GetStringLength(function_name_jstr); - - jsobject js_obj = Unwrap_JSObject(env, java_wrapper_obj); - jobject jresult = NULL; - - CallMessage msg(pluginInstance, js_obj, function_name_ucs2, function_name_len, java_args, &jresult); - sendMessage(env, &msg); - - env->ReleaseStringChars(function_name_jstr, function_name_ucs2); - - if (jresult != NULL) - jresult = ToLocalRef(env, jresult); - - return jresult; -} - -/* - * Class: netscape_javascript_JSObject - * Method: eval - * Signature: (Ljava/lang/String;)Ljava/lang/Object; - */ -class EvalMessage : public JavaMessage { - MRJPluginInstance* mPluginInstance; - jsobject mObject; - const jchar* mScript; - jsize mLength; - jobject* mJavaResult; -public: - EvalMessage(MRJPluginInstance* pluginInstance, jsobject obj, const jchar* script, jsize length, jobject* javaResult) - : mPluginInstance(pluginInstance), mObject(obj), mScript(script), mLength(length), mJavaResult(javaResult) - { - } - - virtual void execute(JNIEnv* env) - { - jobject jresult = NULL; - MRJSecurityContext* securityContext = getSecurityContext(mPluginInstance); - nsILiveconnect* connection = getLiveconnectInstance(securityContext); - nsresult result = connection->Eval(env, mObject, mScript, mLength, NULL, 0, securityContext, &jresult); - if (result == NS_OK && jresult != NULL) - *mJavaResult = ToGlobalRef(env, jresult); - } -}; - -JNIEXPORT jobject JNICALL -Java_netscape_javascript_JSObject_eval(JNIEnv* env, - jobject java_wrapper_obj, - jstring script_jstr) -{ - /* Get the Unicode string for the JS function name */ - if (script_jstr == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal null script string"); - return NULL; - } - jboolean is_copy; - const jchar* script_ucs2 = env->GetStringChars(script_jstr, &is_copy); - jsize script_len = env->GetStringLength(script_jstr); - - /* unwrap the JS object from the Java object. */ - jsobject js_obj = Unwrap_JSObject(env, java_wrapper_obj); - jobject jresult = NULL; - -#ifdef MRJPLUGIN_4X - nsresult status = theLiveConnectManager->Eval(env, js_obj, script_ucs2, script_len, NULL, 0, NULL, &jresult); -#else - /* determine the plugin instance so we can obtain its codebase. */ - // beard: should file a bug with Apple that JMJNIToAWTContext doesn't work. - MRJPluginInstance* pluginInstance = GetCurrentInstance(env); -#if 0 - if (pluginInstance == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal JNIEnv (can't find plugin)"); - return NULL; - } -#endif - - EvalMessage msg(pluginInstance, js_obj, script_ucs2, script_len, &jresult); - sendMessage(env, &msg); - - if (jresult != NULL) - jresult = ToLocalRef(env, jresult); - -#endif - - env->ReleaseStringChars(script_jstr, script_ucs2); - - return jresult; -} - -/* - * Class: netscape_javascript_JSObject - * Method: toString - * Signature: ()Ljava/lang/String; - */ -class ToStringMessage : public JavaMessage { - MRJPluginInstance* mPluginInstance; - jsobject mObject; - jstring* mStringResult; -public: - ToStringMessage(MRJPluginInstance* pluginInstance, jsobject js_obj, jstring* stringResult) - : mPluginInstance(pluginInstance), mObject(js_obj), mStringResult(stringResult) - { - } - - virtual void execute(JNIEnv* env) - { - MRJSecurityContext* securityContext = getSecurityContext(mPluginInstance); - nsILiveconnect* connection = getLiveconnectInstance(securityContext); - jstring jresult = NULL; - nsresult status = connection->ToString(env, mObject, &jresult); - if (status == NS_OK && jresult != NULL) - *mStringResult = (jstring) ToGlobalRef(env, jresult); - } -}; - -JNIEXPORT jstring JNICALL -Java_netscape_javascript_JSObject_toString(JNIEnv* env, jobject java_wrapper_obj) -{ - /* unwrap the JS object from the Java object. */ - jstring jresult = NULL; - jsobject js_obj = Unwrap_JSObject(env, java_wrapper_obj); - - MRJPluginInstance* pluginInstance = GetCurrentInstance(env); -#if 0 - if (pluginInstance == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal JNIEnv (can't find plugin)"); - return NULL; - } -#endif - - ToStringMessage msg(pluginInstance, js_obj, &jresult); - sendMessage(env, &msg); - - if (jresult != NULL) - jresult = (jstring) ToLocalRef(env, jresult); - - return jresult; -} - -/* - * Class: netscape_javascript_JSObject - * Method: getWindow - * Signature: (Ljava/applet/Applet;)Lnetscape/javascript/JSObject; - */ -class GetWindowMessage : public JavaMessage { - MRJPluginInstance* mPluginInstance; - jsobject* mWindowResult; -public: - GetWindowMessage(MRJPluginInstance* pluginInstance, jsobject* windowResult) - : mPluginInstance(pluginInstance), mWindowResult(windowResult) - { - } - - ~GetWindowMessage() - { - NS_RELEASE(mPluginInstance); - } - - virtual void execute(JNIEnv* env) - { - MRJSecurityContext* securityContext = getSecurityContext(mPluginInstance); - nsILiveconnect* connection = getLiveconnectInstance(securityContext); - nsresult status = connection->GetWindow(env, mPluginInstance, NULL, 0, securityContext, mWindowResult); - } -}; - -JNIEXPORT jobject JNICALL -Java_netscape_javascript_JSObject_getWindow(JNIEnv* env, - jclass js_object_class, - jobject java_applet_obj) -{ - MRJPluginInstance* pluginInstance = theJVMPlugin->getPluginInstance(java_applet_obj); - if (pluginInstance != NULL) { -#ifdef MRJPLUGIN_4X - // keep an extra reference to the plugin instance, until it is finalized. - jobject jwindow = Wrap_JSObject(env, jsobject(pluginInstance)); - return jwindow; -#else - jsobject jswindow = NULL; - GetWindowMessage msg(pluginInstance, &jswindow); - sendMessage(env, &msg); - - if (jswindow != NULL) - return Wrap_JSObject(env, jswindow); -#endif - } - return NULL; -} - -/* - * Class: netscape_javascript_JSObject - * Method: finalize - * Signature: ()V - */ -class FinalizeMessage : public JavaMessage { - jsobject m_jsobj; -public: - FinalizeMessage(jsobject jsobj) - : m_jsobj(jsobj) - { - } - - virtual void execute(JNIEnv* env) - { - nsresult result = theLiveConnectManager->FinalizeJSObject(env, m_jsobj); - } -}; - -JNIEXPORT void JNICALL -Java_netscape_javascript_JSObject_finalize(JNIEnv* env, jobject java_wrapper_obj) -{ - jsobject jsobj = Unwrap_JSObject(env, java_wrapper_obj); - -#ifdef MRJPLUGIN_4X - MRJPluginInstance* pluginInstance = (MRJPluginInstance*)jsobj; - NS_IF_RELEASE(pluginInstance); -#else - FinalizeMessage msg(jsobj); - sendMessage(env, &msg); -#endif -} diff --git a/plugin/oji/MRJ/plugin/Source/LiveConnectNativeMethods.h b/plugin/oji/MRJ/plugin/Source/LiveConnectNativeMethods.h deleted file mode 100644 index 34775f9e0d42..000000000000 --- a/plugin/oji/MRJ/plugin/Source/LiveConnectNativeMethods.h +++ /dev/null @@ -1,53 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - LiveConnectNativeMethods.h - */ - -#pragma once - -#include "nsError.h" - -#include "jni.h" - -class MRJPlugin; - -nsresult InitLiveConnectSupport(MRJPlugin* jvmPlugin); -nsresult ShutdownLiveConnectSupport(void); - -jobject Wrap_JSObject(JNIEnv* env, jint js_obj); -jint Unwrap_JSObject(JNIEnv* env, jobject java_wrapper_obj); diff --git a/plugin/oji/MRJ/plugin/Source/LocalPort.h b/plugin/oji/MRJ/plugin/Source/LocalPort.h deleted file mode 100644 index 17b3a1ff9415..000000000000 --- a/plugin/oji/MRJ/plugin/Source/LocalPort.h +++ /dev/null @@ -1,72 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - LocalPort.h - - Simple utility class to put a Quickdraw GrafPort into a known state. - - by Patrick C. Beard. - */ - -#pragma once - -#include - -class LocalPort { -public: - LocalPort(GrafPtr port) - { - fPort = port; - fOrigin.h = fOrigin.v = 0; - } - - LocalPort(GrafPtr port, Point origin) - { - fPort = port; - fOrigin.h = origin.h; - fOrigin.v = origin.v; - } - - void Enter(); - void Exit(); - -private: - GrafPtr fPort; - Point fOrigin; - GrafPtr fOldPort; - Point fOldOrigin; -}; diff --git a/plugin/oji/MRJ/plugin/Source/MRJConsole.cpp b/plugin/oji/MRJ/plugin/Source/MRJConsole.cpp deleted file mode 100644 index 9a4e649fb509..000000000000 --- a/plugin/oji/MRJ/plugin/Source/MRJConsole.cpp +++ /dev/null @@ -1,396 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - MRJConsole.cpp - - Implements the JVM console interface. - - by Patrick C. Beard. - */ - -#include -#include - -#include - -#include "MRJConsole.h" -#include "MRJPlugin.h" -#include "MRJSession.h" -#include "TopLevelFrame.h" - -#include "nsIPluginManager2.h" - -extern nsIPluginManager2* thePluginManager2; - -MRJConsole* theConsole = NULL; - -const InterfaceInfo MRJConsole::sInterfaces[] = { - { NS_IJVMCONSOLE_IID, INTERFACE_OFFSET(MRJConsole, nsIJVMConsole) }, - { NS_IEVENTHANDLER_IID, INTERFACE_OFFSET(MRJConsole, nsIEventHandler) }, -}; -const UInt32 MRJConsole::kInterfaceCount = sizeof(sInterfaces) / sizeof(InterfaceInfo); - -MRJConsole::MRJConsole(MRJPlugin* plugin) - : SupportsMixin(this, sInterfaces, kInterfaceCount, (nsIPlugin*) plugin), - mPlugin(plugin), mSession(NULL), mIsInitialized(PR_FALSE), - mConsoleClass(NULL), mInitMethod(NULL), mDisposeMethod(NULL), - mShowMethod(NULL), mHideMethod(NULL), mVisibleMethod(NULL), mPrintMethod(NULL), mFinishMethod(NULL), - mResults(NULL), mContext(NULL), mFrame(NULL) -{ - // Initialize(); -} - -MRJConsole::~MRJConsole() -{ - theConsole = NULL; - - if (mSession != NULL) { - JNIEnv* env = mSession->getCurrentEnv(); - - if (mConsoleClass != NULL) { - if (mDisposeMethod != NULL) - env->CallStaticVoidMethod(mConsoleClass, mDisposeMethod); - env->DeleteGlobalRef(mConsoleClass); - mConsoleClass = NULL; - } - - if (mResults != NULL) { - env->DeleteGlobalRef(mResults); - mResults = NULL; - } - - if (mContext != NULL) { - JMDisposeAWTContext(mContext); - mContext = NULL; - } - } -} - -NS_METHOD MRJConsole::QueryInterface(const nsIID& aIID, void** aInstancePtr) -{ - nsresult result = queryInterface(aIID, aInstancePtr); - if (result == NS_NOINTERFACE) - result = mPlugin->queryInterface(aIID, aInstancePtr); - return result; -} -nsrefcnt MRJConsole::AddRef() { return addRef(); } -nsrefcnt MRJConsole::Release() { return release(); } - -#pragma mark ***** MRJConsole ***** - -NS_METHOD MRJConsole::Show() -{ - Initialize(); - - if (mShowMethod != NULL) { - CallConsoleMethod(mShowMethod); - return NS_OK; - } - - return NS_ERROR_FAILURE; -} - -NS_METHOD MRJConsole::Hide() -{ - Initialize(); - - if (mHideMethod != NULL) { - CallConsoleMethod(mHideMethod); - return NS_OK; - } - - return NS_ERROR_FAILURE; -} - -NS_METHOD MRJConsole::IsVisible(PRBool* isVisible) -{ - // don't initialize here, because if we haven't been initialized, it can't be visible. - *isVisible = PR_FALSE; - if (mVisibleMethod != NULL) { - CallConsoleMethod(mVisibleMethod, mResults); - jboolean isCopy; - JNIEnv* env = mSession->getCurrentEnv(); - jboolean* elements = env->GetBooleanArrayElements(mResults, &isCopy); - *isVisible = elements[0]; - env->ReleaseBooleanArrayElements(mResults, elements, JNI_ABORT); - } - return NS_OK; -} - -// Prints a message to the Java console. The encodingName specifies the -// encoding of the message, and if NULL, specifies the default platform -// encoding. - -NS_METHOD MRJConsole::Print(const char* msg, const char* encodingName) -{ - Initialize(); - - if (mPrintMethod != NULL) { - JNIEnv* env = mSession->getCurrentEnv(); - jstring jmsg = env->NewStringUTF(msg); - jvalue args[1]; args[0].l = jmsg; - JMExecJNIStaticMethodInContext(mContext, env, mConsoleClass, mPrintMethod, 1, args); - env->DeleteLocalRef(jmsg); - return NS_OK; - } - - return NS_ERROR_FAILURE; -} - -// Writes a message to the Java console immediately, in the current thread. - -void MRJConsole::write(const void *message, UInt32 messageLengthInBytes) -{ - if (mPrintMethod != NULL) { - char* buffer = new char[messageLengthInBytes + 1]; - if (buffer != NULL) { - memcpy(buffer, message, messageLengthInBytes); - buffer[messageLengthInBytes] = '\0'; - - JNIEnv* env = mSession->getCurrentEnv(); - jstring jmsg = env->NewStringUTF(buffer); - if (jmsg != NULL) { - env->CallStaticVoidMethod(mConsoleClass, mPrintMethod, jmsg); - env->DeleteLocalRef(jmsg); - } - - delete buffer; - } - } -} - -NS_METHOD MRJConsole::HandleEvent(nsPluginEvent* pluginEvent, PRBool* eventHandled) -{ - *eventHandled = PR_TRUE; - - if (pluginEvent != NULL) { - EventRecord* event = pluginEvent->event; - - if (event->what == nullEvent) { - // Give MRJ another quantum of time. - MRJSession* session = mPlugin->getSession(); - session->idle(kDefaultJMTime); - } else { - TopLevelFrame* frame = mFrame; - if (frame != NULL) { - switch (event->what) { - case nsPluginEventType_GetFocusEvent: - frame->focusEvent(true); - break; - - case nsPluginEventType_LoseFocusEvent: - frame->focusEvent(false); - break; - - case nsPluginEventType_AdjustCursorEvent: - frame->idle(event->modifiers); - break; - - case nsPluginEventType_MenuCommandEvent: - frame->menuSelected(event->message, event->modifiers); - break; - - default: - *eventHandled = frame->handleEvent(event); - break; - } - } - } - } - - return NS_OK; -} - -OSStatus MRJConsole::CallConsoleMethod(jmethodID method) -{ - JNIEnv* env = mSession->getCurrentEnv(); - OSStatus status = JMExecJNIStaticMethodInContext(mContext, env, mConsoleClass, method, 0, NULL); - env->CallStaticVoidMethod(mConsoleClass, mFinishMethod); - return status; -} - -OSStatus MRJConsole::CallConsoleMethod(jmethodID method, jobject arg) -{ - jvalue args[1]; - args[0].l = arg; - JNIEnv* env = mSession->getCurrentEnv(); - OSStatus status = JMExecJNIStaticMethodInContext(mContext, env, mConsoleClass, method, 1, args); - env->CallStaticVoidMethod(mConsoleClass, mFinishMethod); - return status; -} - -static OSStatus requestFrame(JMAWTContextRef contextRef, JMFrameRef frameRef, JMFrameKind kind, - const Rect* initialBounds, Boolean resizeable, JMFrameCallbacks* cb) -{ - extern JMFrameCallbacks theFrameCallbacks; - // set up the viewer frame's callbacks. - BlockMoveData(&theFrameCallbacks, cb, sizeof(theFrameCallbacks)); - - MRJConsole* thisConsole = NULL; - OSStatus status = ::JMGetAWTContextData(contextRef, (JMClientData*)&thisConsole); - if (status == noErr && thePluginManager2 != NULL) { - // Can only do this safely if we are using the new API. - TopLevelFrame* frame = new TopLevelFrame(thisConsole, frameRef, kind, initialBounds, resizeable); - status = ::JMSetFrameData(frameRef, frame); - thisConsole->setFrame(frame); - } - return status; -} - -static OSStatus releaseFrame(JMAWTContextRef contextRef, JMFrameRef frameRef) -{ - MRJConsole* thisConsole = NULL; - OSStatus status = ::JMGetAWTContextData(contextRef, (JMClientData*)&thisConsole); - MRJFrame* thisFrame = NULL; - status = ::JMGetFrameData(frameRef, (JMClientData*)&thisFrame); - if (thisFrame != NULL) { - status = ::JMSetFrameData(frameRef, NULL); - thisConsole->setFrame(NULL); - delete thisFrame; - } - return status; -} - -static SInt16 getUniqueMenuID(JMAWTContextRef contextRef, Boolean isSubmenu) -{ - MRJConsole* thisConsole = NULL; - OSStatus status = ::JMGetAWTContextData(contextRef, (JMClientData*)&thisConsole); - if (thePluginManager2 != NULL) { - PRInt16 menuID; - if (thePluginManager2->AllocateMenuID(thisConsole, isSubmenu, &menuID) == NS_OK) - return menuID; - } - return -1; -} - -static Boolean appearanceManagerExists() -{ - long response = 0; - return (Gestalt(gestaltAppearanceAttr, &response) == noErr && (response & (1 << gestaltAppearanceExists))); -} - -static OSStatus JMTextToStr255(JMTextRef textRef, Str255 str) -{ - UInt32 length = 0; - OSStatus status = JMGetTextBytes(textRef, kTextEncodingMacRoman, &str[1], sizeof(Str255) - 1, &length); - if (status == noErr) - str[0] = (unsigned char)(status == noErr ? length : 0); - return status; -} - -inline int min(int x, int y) { return (x <= y ? x : y); } - -static void push(StringPtr dest, StringPtr str) -{ - int length = dest[0]; - int newLength = min(255, length + str[0]); - if (newLength > length) - ::BlockMoveData(&str[1], &dest[1] + length, newLength - length); -} - -static void exceptionOccurred(JMAWTContextRef context, JMTextRef exceptionName, JMTextRef exceptionMsg, JMTextRef stackTrace) -{ - // why not display this using the Appearance Manager's wizzy new alert? - if (appearanceManagerExists()) { - OSStatus status; - Str255 preason = { '\0' }, pmessage = { '\0'}, ptrace = { '\0' }; - if (exceptionName != NULL) { - status = ::JMTextToStr255(exceptionName, preason); - if (exceptionMsg != NULL) { - status = ::JMTextToStr255(exceptionMsg, pmessage); - push(preason, "\p ("); - push(preason, pmessage); - push(preason, "\p)"); - } - } - - if (stackTrace != NULL) - status = ::JMTextToStr255(stackTrace, ptrace); - - SInt16 itemHit = 0; - OSErr result = ::StandardAlert(kAlertPlainAlert, preason, ptrace, NULL, &itemHit); - } -} - -void MRJConsole::Initialize() -{ - if (mIsInitialized) - return; - - mSession = mPlugin->getSession(); - JNIEnv* env = mSession->getCurrentEnv(); - - jclass consoleClass = env->FindClass("netscape/oji/MRJConsole"); - if (consoleClass == NULL) return; - mConsoleClass = (jclass) env->NewGlobalRef(consoleClass); - - mInitMethod = env->GetStaticMethodID(consoleClass, "init", "()V"); - mDisposeMethod = env->GetStaticMethodID(consoleClass, "dispose", "()V"); - mShowMethod = env->GetStaticMethodID(consoleClass, "show", "()V"); - mHideMethod = env->GetStaticMethodID(consoleClass, "hide", "()V"); - mVisibleMethod = env->GetStaticMethodID(consoleClass, "visible", "([Z)V"); - mPrintMethod = env->GetStaticMethodID(consoleClass, "print", "(Ljava/lang/String;)V"); - mFinishMethod = env->GetStaticMethodID(consoleClass, "finish", "()V"); - - jbooleanArray results = env->NewBooleanArray(1); - mResults = (jbooleanArray) env->NewGlobalRef(results); - env->DeleteLocalRef(results); - - // Create an AWT context to work in. - - JMAWTContextCallbacks callbacks = { - kJMVersion, /* should be set to kJMVersion */ - &requestFrame, /* a new frame is being created. */ - &releaseFrame, /* an existing frame is being destroyed. */ - &getUniqueMenuID, /* a new menu will be created with this id. */ - &exceptionOccurred, /* just some notification that some recent operation caused an exception. You can't do anything really from here. */ - }; - OSStatus status = ::JMNewAWTContext(&mContext, mSession->getSessionRef(), &callbacks, this); - - // Finally, call the Java initialize method, and wait for it to complete. - - if (mInitMethod != NULL && status == noErr) { - status = JMExecJNIStaticMethodInContext(mContext, env, consoleClass, mInitMethod, 0, NULL); - env->CallStaticVoidMethod(mConsoleClass, mFinishMethod); - } - env->DeleteLocalRef(consoleClass); - - mIsInitialized = (status == noErr); - - if (mIsInitialized) - theConsole = this; -} diff --git a/plugin/oji/MRJ/plugin/Source/MRJConsole.h b/plugin/oji/MRJ/plugin/Source/MRJConsole.h deleted file mode 100644 index 8ef072dfe68a..000000000000 --- a/plugin/oji/MRJ/plugin/Source/MRJConsole.h +++ /dev/null @@ -1,128 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - MRJConsole.h - - Implements the JVM console interface. - - by Patrick C. Beard. - */ - -#ifndef CALL_NOT_IN_CARBON - #define CALL_NOT_IN_CARBON 1 -#endif - -#include "nsIJVMConsole.h" -#include "nsIEventHandler.h" -#include "SupportsMixin.h" - -#include "jni.h" -#include - -class MRJPlugin; -class MRJSession; -class TopLevelFrame; - -class MRJConsole : public nsIJVMConsole, - public nsIEventHandler, - public SupportsMixin { -public: - MRJConsole(MRJPlugin* plugin); - virtual ~MRJConsole(); - - // NS_DECL_ISUPPORTS - // DECL_SUPPORTS_MIXIN - NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr); - NS_IMETHOD_(nsrefcnt) AddRef(void); - NS_IMETHOD_(nsrefcnt) Release(void); - - // nsIJVMConsole methods. - - NS_IMETHOD - Show(void); - - NS_IMETHOD - Hide(void); - - NS_IMETHOD - IsVisible(PRBool* isVisible); - - // Prints a message to the Java console. The encodingName specifies the - // encoding of the message, and if NULL, specifies the default platform - // encoding. - NS_IMETHOD - Print(const char* msg, const char* encodingName = NULL); - - NS_IMETHOD - HandleEvent(nsPluginEvent* event, PRBool* eventHandled); - - // Private implementation methods. - - void setFrame(TopLevelFrame* frame) { mFrame = frame; } - - void write(const void *message, UInt32 messageLengthInBytes); - -private: - // Private implementation methods. - OSStatus CallConsoleMethod(jmethodID method); - OSStatus CallConsoleMethod(jmethodID method, jobject arg); - - void Initialize(); - -private: - MRJPlugin* mPlugin; - MRJSession* mSession; - PRBool mIsInitialized; - - jclass mConsoleClass; - jmethodID mInitMethod; - jmethodID mDisposeMethod; - jmethodID mShowMethod; - jmethodID mHideMethod; - jmethodID mVisibleMethod; - jmethodID mPrintMethod; - jmethodID mFinishMethod; - - jbooleanArray mResults; - - JMAWTContextRef mContext; - TopLevelFrame* mFrame; - - // support for SupportsMixin. - static const InterfaceInfo sInterfaces[]; - static const UInt32 kInterfaceCount; -}; diff --git a/plugin/oji/MRJ/plugin/Source/MRJConsole.java b/plugin/oji/MRJ/plugin/Source/MRJConsole.java deleted file mode 100644 index d7414c33eb60..000000000000 --- a/plugin/oji/MRJ/plugin/Source/MRJConsole.java +++ /dev/null @@ -1,241 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - MJRConsole.java - - Simple Java console for MRJ. - - All methods are called asynchronously, using JMExecJNIStaticMethodInContext(). After posting - each call this way, MRJConsole.finish() is called, which waits on MRJConsole.class. Each - public method calls MRJConsole.done(), which notifies. This should probably be changed - to a pure Java approach. - - by Patrick C. Beard. - */ - -package netscape.oji; - -import java.io.*; -import java.awt.*; -import java.awt.event.*; - -class ConsoleWindow extends Frame { - TextArea text; - - ConsoleWindow(String title) { - super("Java Console"); - - addWindowListener( - new WindowAdapter() { - public void windowClosing(WindowEvent e) { - hide(); - } - }); - - add(text = new TextArea()); - setSize(300, 200); - - ActionListener dumpThreadsListener = - new ActionListener() { - public void actionPerformed(ActionEvent e) { - dumpThreads(); - } - }; - - // Create a console menu. - MenuBar menuBar = new MenuBar(); - Menu consoleMenu = new Menu("Console"); - consoleMenu.add(newItem("Dump Threads", dumpThreadsListener)); - - menuBar.add(consoleMenu); - setMenuBar(menuBar); - } - - private MenuItem newItem(String title, ActionListener listener) { - MenuItem item = new MenuItem(title); - item.addActionListener(listener); - return item; - } - - public void dumpThreads() { - System.out.println("Dumping threads..."); - } -} - -public class MRJConsole { - // Save primordial System streams. - private static InputStream in; - private static PrintStream out; - private static PrintStream err; - private static ConsoleWindow window; - - native static int readLine(byte[] buffer, int offset, int length); - native static void writeLine(byte[] buffer, int offset, int length); - - private static class Input extends InputStream { - byte[] buffer = new byte[1024]; - int position = 0; - int count = 0; - - private void fillBuffer() throws EOFException { - // int length = readLine(buffer, 0, buffer.length); - int length = 1024; - if (length == -1) - throw new EOFException(); - count = length; - position = 0; - } - - public int read() throws IOException { - synchronized(this) { - if (position >= count) - fillBuffer(); - return buffer[position++]; - } - } - - public int read(byte[] b, int offset, int length) throws IOException { - synchronized(this) { - // only fill the buffer at the outset, always returns at most one line of data. - if (position >= count) - fillBuffer(); - int initialOffset = offset; - while (offset < length && position < count) { - b[offset++] = buffer[position++]; - } - return (offset - initialOffset); - } - } - } - - private static class Output extends OutputStream implements Runnable { - StringBuffer buffer = new StringBuffer(); - - public Output() { - Thread flusher = new Thread(this, getClass().getName() + "-Flusher"); - flusher.setDaemon(true); - flusher.start(); - } - - public synchronized void write(int b) throws IOException { - this.buffer.append((char)b); - notify(); - } - - public synchronized void write(byte[] buffer, int offset, int count) throws IOException { - this.buffer.append(new String(buffer, 0, offset, count)); - notify(); - } - - public synchronized void flush() throws IOException { - String value = this.buffer.toString(); - window.text.append(value); - this.buffer.setLength(0); - } - - /** - * When I/O occurs, it is placed in a StringBuffer, which is flushed in a different thread. - * This prevents deadlocks that could occur when the AWT itself is printing messages. - */ - public synchronized void run() { - for (;;) { - try { - wait(); - flush(); - } catch (InterruptedException ie) { - } catch (IOException ioe) { - } - } - } - } - - private static class Error extends Output {} - - public static void init() { - in = System.in; - out = System.out; - err = System.err; - - window = new ConsoleWindow("Java Console"); - - System.setIn(new Input()); - System.setOut(new PrintStream(new Output())); - System.setErr(new PrintStream(new Error())); - - done(); - } - - public static void dispose() { - System.setIn(in); - System.setOut(out); - System.setErr(err); - window.dispose(); - window = null; - done(); - } - - public static void show() { - window.show(); - done(); - } - - public static void hide() { - window.hide(); - done(); - } - - public static void visible(boolean[] result) { - result[0] = window.isVisible(); - done(); - } - - public static void print(String text) { - System.out.print(text); - done(); - } - - public static synchronized void finish() { - try { - MRJConsole.class.wait(); - } catch (InterruptedException ie) { - } - } - - private static synchronized void done() { - MRJConsole.class.notify(); - } -} diff --git a/plugin/oji/MRJ/plugin/Source/MRJContext.cp b/plugin/oji/MRJ/plugin/Source/MRJContext.cp deleted file mode 100644 index 520a883a64af..000000000000 --- a/plugin/oji/MRJ/plugin/Source/MRJContext.cp +++ /dev/null @@ -1,1729 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - MRJContext.cp - - Manages Java content using the MacOS Runtime for Java. - - by Patrick C. Beard. - */ - -#include -#include -#include -#include -#include - -#include "MRJSession.h" -#include "MRJContext.h" -#include "MRJPlugin.h" -#include "MRJPage.h" -#include "MRJMonitor.h" -#include "AsyncMessage.h" -#include "TopLevelFrame.h" -#include "EmbeddedFrame.h" -#include "LocalPort.h" -#include "StringUtils.h" - -#include "nsIPluginManager2.h" -#include "nsIPluginInstancePeer.h" -#include "nsIJVMPluginTagInfo.h" -#include "MRJSecurityContext.h" - -#include - -using namespace std; - -extern nsIPluginManager* thePluginManager; -extern nsIPluginManager2* thePluginManager2; - -static OSStatus JMTextToStr255(JMTextRef textRef, Str255 str); -static char* JMTextToEncoding(JMTextRef textRef, JMTextEncoding encoding); - -static void blinkRgn(RgnHandle rgn); - -void LocalPort::Enter() -{ - ::GetPort(&fOldPort); - if (fPort != fOldPort) - ::SetPort(fPort); - fOldOrigin = topLeft(fPort->portRect); - if (fOldOrigin.h != fOrigin.h || fOldOrigin.v != fOrigin.v) - ::SetOrigin(fOrigin.h, fOrigin.v); -} - -void LocalPort::Exit() -{ - if (fOldOrigin.h != fOrigin.h || fOldOrigin.v != fOrigin.v) - ::SetOrigin(fOldOrigin.h, fOldOrigin.v); - if (fOldPort != fPort) - ::SetPort(fOldPort); -} - -static RgnHandle NewEmptyRgn() -{ - RgnHandle region = ::NewRgn(); - if (region != NULL) ::SetEmptyRgn(region); - return region; -} - -MRJContext::MRJContext(MRJSession* session, MRJPluginInstance* instance) - : mPluginInstance(instance), mSession(session), mSessionRef(session->getSessionRef()), mPeer(NULL), - mLocator(NULL), mContext(NULL), mViewer(NULL), mViewerFrame(NULL), mIsActive(false), - mPluginWindow(NULL), mPluginClipping(NULL), mPluginPort(NULL), - mDocumentBase(NULL), mAppletHTML(NULL), mPage(NULL), mSecurityContext(NULL) -{ - instance->GetPeer(&mPeer); - - // we cache attributes of the window, and periodically notice when they change. - mCachedOrigin.x = mCachedOrigin.y = -1; - ::SetRect((Rect*)&mCachedClipRect, 0, 0, 0, 0); - mPluginClipping =::NewEmptyRgn(); - mPluginPort = getEmptyPort(); -} - -MRJContext::~MRJContext() -{ - if (mLocator != NULL) { - JMDisposeAppletLocator(mLocator); - mLocator = NULL; - } - - if (mViewer != NULL) { - ::JMDisposeAppletViewer(mViewer); - mViewer = NULL; - } - - // hack: see if this allows the applet viewer to terminate gracefully. - // Re-enable. Else if opened a new window thru Java and then quit browser, - // get "SP_WARN: Yow! Invalid canvas->visRgn:0000000" in 'MRJSubPorts' - // several times while applet viewer is closing - - for (int i = 0; i < 100; i++) - ::JMIdle(mSessionRef, kDefaultJMTime); - - if (mContext != NULL) { - // hack: release any frames that we still see in the AWT context, before tossing it. - releaseFrames(); - - ::JMDisposeAWTContext(mContext); - mContext = NULL; - } - - if (mPeer != NULL) { - mPeer->Release(); - mPeer = NULL; - } - - if (mPage != NULL) { - mPage->Release(); - mPage = NULL; - } - - if (mPluginClipping != NULL) { - ::DisposeRgn(mPluginClipping); - mPluginClipping = NULL; - } - - if (mDocumentBase != NULL) { - delete[] mDocumentBase; - mDocumentBase = NULL; - } - - if (mAppletHTML != NULL) { - delete[] mAppletHTML; - mAppletHTML = NULL; - } - - if (mSecurityContext != NULL) { - mSecurityContext->Release(); - mSecurityContext = NULL; - } -} - -static char* slashify(char* url) -{ - int len = ::strlen(url); - if (url[len - 1] != '/') { - char* newurl = new char[len + 2]; - ::strcpy(newurl, url); - newurl[len] = '/'; - newurl[len + 1] = '\0'; - delete[] url; - url = newurl; - } - return url; -} - -static bool isAppletAttribute(const char* name) -{ - // this table must be kept in alphabetical order. - static const char* kAppletAttributes[] = { - "ALIGN", "ALT", "ARCHIVE", - "CODE", "CODEBASE", - "HEIGHT", "HSPACE", - "MAYSCRIPT", "NAME", "OBJECT", - "VSPACE", "WIDTH" - }; - int length = sizeof(kAppletAttributes) / sizeof(char*); - int minIndex = 0, maxIndex = length - 1; - int index = maxIndex / 2; - while (minIndex <= maxIndex) { - int diff = strcasecmp(name, kAppletAttributes[index]); - if (diff < 0) { - maxIndex = (index - 1); - index = (minIndex + maxIndex) / 2; - } else if (diff > 0) { - minIndex = (index + 1); - index = (minIndex + maxIndex) / 2; - } else { - return true; - } - } - return false; -} - -static void addAttribute(string& attrs, const char* name, const char* value) -{ - attrs += " "; - attrs += name; - attrs += "=\""; - attrs += value; - attrs += "\""; -} - -static void addParameter(string& params, const char* name, const char* value) -{ - params += "\n"; -} - -static void addAttributes(nsIPluginTagInfo* tagInfo, string& attributes) -{ - PRUint16 count; - const char* const* names; - const char* const* values; - if (tagInfo->GetAttributes(count, names, values) == NS_OK) { - for (PRUint16 i = 0; i < count; ++i) - addAttribute(attributes, names[i], values[i]); - } -} - -static void addParameters(nsIPluginTagInfo2* tagInfo2, string& parameters) -{ - PRUint16 count; - const char* const* names; - const char* const* values; - if (tagInfo2->GetParameters(count, names, values) == NS_OK) { - for (PRUint16 i = 0; i < count; ++i) - addParameter(parameters, names[i], values[i]); - } -} - -static void addObjectAttributes(nsIPluginTagInfo* tagInfo, string& attributes) -{ - PRUint16 count; - const char* const* names; - const char* const* values; - const char kClassID[] = "classid"; - const char kJavaPrefix[] = "java:"; - const size_t kJavaPrefixSize = sizeof(kJavaPrefix) - 1; - if (tagInfo->GetAttributes(count, names, values) == NS_OK) { - for (PRUint16 i = 0; i < count; ++i) { - const char* name = names[i]; - const char* value = values[i]; - if (strcasecmp(name, "classid") == 0 && strncmp(value, kJavaPrefix, kJavaPrefixSize) == 0) - addAttribute(attributes, "code", value + kJavaPrefixSize); - else - addAttribute(attributes, name, value); - } - } -} - -static void addEmbedAttributes(nsIPluginTagInfo* tagInfo, string& attributes, string& parameters) -{ - PRUint16 count; - const char* const* names; - const char* const* values; - const char kJavaPluginAttributePrefix[] = "java_"; - const size_t kJavaPluginAttributePrefixSize = sizeof(kJavaPluginAttributePrefix) - 1; - if (tagInfo->GetAttributes(count, names, values) == NS_OK) { - for (PRUint16 i = 0; i < count; ++i) { - const char* name = names[i]; - const char* value = values[i]; - if (strncmp(name, kJavaPluginAttributePrefix, kJavaPluginAttributePrefixSize) == 0) - name += kJavaPluginAttributePrefixSize; - if (isAppletAttribute(name)) { - addAttribute(attributes, name, value); - } else { - // assume it's a parameter. - addParameter(parameters, name, value); - } - } - } -} - -static char* synthesizeAppletElement(nsIPluginTagInfo* tagInfo) -{ - // just synthesize an element out of whole cloth. - // this may be used because of the way the applet is being - // instantiated, or it may be used to work around bugs - // in the shipping browser. - string element("QueryInterface(NS_GET_IID(nsIPluginTagInfo2), (void **)&tagInfo2) == NS_OK) { - nsPluginTagType tagType = nsPluginTagType_Unknown; - if (tagInfo2->GetTagType(&tagType) == NS_OK) { - switch (tagType) { - case nsPluginTagType_Applet: - addAttributes(tagInfo2, attributes); - addParameters(tagInfo2, parameters); - break; - case nsPluginTagType_Object: - addObjectAttributes(tagInfo2, attributes); - addParameters(tagInfo2, parameters); - break; - case nsPluginTagType_Embed: - addEmbedAttributes(tagInfo2, attributes, parameters); - break; - } - } - NS_RELEASE(tagInfo2); - } else { - addEmbedAttributes(tagInfo, attributes, parameters); - } - - element += attributes; - element += ">\n"; - element += parameters; - element += "\n"; - - return ::strdup(element.c_str()); -} - -#if 1 - -static void fetchCompleted(JMAppletLocatorRef ref, JMLocatorErrors status) {} - -void MRJContext::processAppletTag() -{ - // use the applet's HTML element to create a locator. this is required - // in general, to specify a separate CODEBASE. - - nsIPluginTagInfo* tagInfo = NULL; - if (mPeer->QueryInterface(NS_GET_IID(nsIPluginTagInfo), (void **)&tagInfo) == NS_OK) { - nsIPluginTagInfo2* tagInfo2 = NULL; - if (tagInfo->QueryInterface(NS_GET_IID(nsIPluginTagInfo2), (void **)&tagInfo2) == NS_OK) { - nsPluginTagType tagType = nsPluginTagType_Unknown; - if (tagInfo2->GetTagType(&tagType) == NS_OK) { - // get the URL of the HTML document containing the applet, and the - // fragment of HTML that defines this applet itself. - const char* documentBase = NULL; - if (tagInfo2->GetDocumentBase(&documentBase) == NS_OK) - setDocumentBase(documentBase); - const char* appletHTML = NULL; - if (tagInfo2->GetTagText(&appletHTML) == NS_OK) - setAppletHTML(appletHTML, tagType); - else - mAppletHTML = synthesizeAppletElement(tagInfo); - } - - // to support applet communication, put applets from the same document, codebase, and mayscript setting - // in the same page. - - // establish a page context for this applet to run in. - nsIJVMPluginTagInfo* jvmTagInfo = NULL; - if (mPeer->QueryInterface(NS_GET_IID(nsIJVMPluginTagInfo), (void **)&jvmTagInfo) == NS_OK) { - PRUint32 documentID; - const char* codeBase; - const char* archive; - PRBool mayScript; - if (tagInfo2->GetUniqueID(&documentID) != NS_OK) documentID = 0; - if (jvmTagInfo->GetCodeBase(&codeBase) != NS_OK) codeBase = NULL; - if (jvmTagInfo->GetArchive(&archive) != NS_OK) archive = NULL; - if (jvmTagInfo->GetMayScript(&mayScript) != NS_OK) mayScript = PR_FALSE; - MRJPageAttributes pageAttributes = { documentID, codeBase, archive, mayScript }; - mPage = findPage(pageAttributes); - NS_RELEASE(jvmTagInfo); - } - - NS_RELEASE(tagInfo2); - } else { - mAppletHTML = synthesizeAppletElement(tagInfo); - } - - NS_RELEASE(tagInfo); - } - - if (mDocumentBase != NULL && mAppletHTML != NULL) { - // example that works. - // const char* kBaseURL = "http://java.sun.com/applets/other/ImageLoop/index.html"; - // const char* kAppletHTML = "\n" - // "\n" - // "\n" - // "\n" - // ""; - - static JMAppletLocatorCallbacks callbacks = { - kJMVersion, /* should be set to kJMVersion */ - &fetchCompleted, /* called when the html has been completely fetched */ - }; - OSStatus status; - JMTextRef urlRef = NULL, htmlRef = NULL; - - TextEncoding utf8 = CreateTextEncoding(kTextEncodingUnicodeDefault, kTextEncodingDefaultVariant, kUnicodeUTF8Format); - - status = ::JMNewTextRef(mSessionRef, &urlRef, utf8, mDocumentBase, strlen(mDocumentBase)); - if (status != noErr) goto done; - - status = ::JMNewTextRef(mSessionRef, &htmlRef, utf8, mAppletHTML, strlen(mAppletHTML)); - if (status != noErr) goto done; - - status = ::JMNewAppletLocator(&mLocator, mSessionRef, &callbacks, - urlRef, htmlRef, JMClientData(this)); - - done: - if (urlRef != NULL) - ::JMDisposeTextRef(urlRef); - if (htmlRef != NULL) - ::JMDisposeTextRef(htmlRef); - } -} - -#else - -void MRJContext::processAppletTag() -{ - // create an applet locator. - OSStatus status = noErr; - JMLocatorInfoBlock info; - info.fVersion = kJMVersion; - info.fBaseURL = NULL; - info.fAppletCode = NULL; - info.fWidth = info.fHeight = 100; - info.fOptionalParameterCount = 0; - info.fParams = NULL; - - struct { - PRUint16 fCount; - const char* const* fNames; - const char* const* fValues; - } attributes = { 0, NULL, NULL }, parameters = { 0, NULL, NULL }; - - MRJPageAttributes pageAttributes = { 0, NULL, NULL, false }; - nsPluginTagType pluginTagType = nsPluginTagType_Embed; - - // obtain the applet's attributes & parameters. - nsIPluginTagInfo* tagInfo = NULL; - if (mPeer->QueryInterface(NS_GET_IID(nsIPluginTagInfo), &tagInfo) == NS_OK) { - tagInfo->GetAttributes(attributes.fCount, attributes.fNames, attributes.fValues); - nsIPluginTagInfo2* tagInfo2 = NULL; - if (tagInfo->QueryInterface(NS_GET_IID(nsIPluginTagInfo2), &tagInfo2) == NS_OK) { - tagInfo2->GetParameters(parameters.fCount, parameters.fNames, parameters.fValues); - tagInfo2->GetTagType(&pluginTagType); - - // get the URL of the HTML document containing the applet. - const char* documentBase = NULL; - if (tagInfo2->GetDocumentBase(&documentBase) == NS_OK && documentBase != NULL) { - // record the document base, in case - setDocumentBase(documentBase); - - // establish a page context for this applet to run in. - nsIJVMPluginTagInfo* jvmTagInfo = NULL; - if (mPeer->QueryInterface(NS_GET_IID(nsIJVMPluginTagInfo), &jvmTagInfo) == NS_OK) { - PRUint32 documentID; - const char* codeBase; - const char* archive; - PRBool mayScript; - if (tagInfo2->GetUniqueID(&documentID) == NS_OK && - jvmTagInfo->GetCodeBase(&codeBase) == NS_OK && - jvmTagInfo->GetArchive(&archive) == NS_OK && - jvmTagInfo->GetMayScript(&mayScript) == NS_OK) { - pageAttributes.documentID = documentID; - pageAttributes.codeBase = codeBase; - pageAttributes.archive = archive; - pageAttributes.mayScript = mayScript; - } - jvmTagInfo->Release(); - } - } - tagInfo2->Release(); - } - tagInfo->Release(); - } - - // compute the URL of the directory containing this applet's HTML page. - char* baseURL = ::strdup(getDocumentBase()); - if (baseURL != NULL) { - // trim the trailing document name. - char* lastSlash = ::strrchr(baseURL, '/'); - if (lastSlash != NULL) - lastSlash[1] = '\0'; - } - - // assume that all arguments might be optional. - int optionalArgIndex = 0; - info.fParams = new JMLIBOptionalParams[attributes.fCount + parameters.fCount]; - if (info.fParams == NULL) - goto done; - - // process APPLET/EMBED tag attributes. - for (int i = 0; i < attributes.fCount; i++) { - const char* name = attributes.fNames[i]; - const char* value = attributes.fValues[i]; - if (name != NULL && value != NULL) { - // if running as an EMBED tag plugin, there may be some attribute - // rewriting going on. Sun's Java plugin uses attributes with the - // "java_" prefix. - if (pluginTagType == nsPluginTagType_Embed) { - static const char kJavaPluginAttributePrefix[] = "java_"; - if (strncmp(name, kJavaPluginAttributePrefix, sizeof(kJavaPluginAttributePrefix) - 1) == 0) - name += (sizeof(kJavaPluginAttributePrefix) - 1); - } - if (strcasecmp(name, "CODEBASE") == 0) { - if (pageAttributes.codeBase == NULL) - pageAttributes.codeBase = value; - } else - if (strcasecmp(name, "CODE") == 0) { - status = ::JMNewTextRef(mSessionRef, &info.fAppletCode, kTextEncodingMacRoman, value, strlen(value)); - } else - if (strcasecmp(name, "CLASSID") == 0) { - // bug 6591: uses classid="java:classname" - value += 5; - status = ::JMNewTextRef(mSessionRef, &info.fAppletCode, kTextEncodingMacRoman, value, strlen(value)); - } else - if (strcasecmp(name, "WIDTH") == 0) { - info.fWidth = ::atoi(value); - } else - if (strcasecmp(name, "HEIGHT") == 0) { - info.fHeight = ::atoi(value); - } else { - // assume it's an optional argument. - JMLIBOptionalParams* param = &info.fParams[optionalArgIndex++]; - status = ::JMNewTextRef(mSessionRef, ¶m->fParamName, kTextEncodingMacRoman, name, strlen(name)); - status = ::JMNewTextRef(mSessionRef, ¶m->fParamValue, kTextEncodingMacRoman, value, strlen(value)); - } - } - } - - // set up the clipping region based on width & height. - ::SetRectRgn(mPluginClipping, 0, 0, info.fWidth, info.fHeight); - - // process parameters. - for (int i = 0; i < parameters.fCount; i++) { - const char* name = parameters.fNames[i]; - const char* value = parameters.fValues[i]; - if (name != NULL && value != NULL) { - // assume it's an optional argument. - JMLIBOptionalParams* param = &info.fParams[optionalArgIndex++]; - status = ::JMNewTextRef(mSessionRef, ¶m->fParamName, kTextEncodingMacRoman, name, strlen(name)); - status = ::JMNewTextRef(mSessionRef, ¶m->fParamValue, kTextEncodingMacRoman, value, strlen(value)); - } - } - info.fOptionalParameterCount = optionalArgIndex; - - // Compute the locator's baseURL field by concatenating the CODEBASE (if any specified). - if (baseURL != NULL) { - if (pageAttributes.codeBase != NULL) { - // if the codebase is an absolute URL, use it, otherwise, concatenate with document's URL. - if (::strchr(pageAttributes.codeBase, ':') != NULL) { - delete[] baseURL; - baseURL = ::strdup(pageAttributes.codeBase); - } else { - if (pageAttributes.codeBase[0] == '/') { - // if codeBase starts with '/', need to prepend the URL's protocol://hostname part. - char* fullURL = new char[::strlen(baseURL) + ::strlen(pageAttributes.codeBase) + 1]; - // search for start of host name. what about file URL's? - const char* hostNameStart = strchr(baseURL, '/'); - while (*hostNameStart == '/') ++hostNameStart; - const char* hostNameEnd = strchr(hostNameStart, '/') + 1; - ::strncpy(fullURL, baseURL, hostNameEnd - baseURL); - fullURL[hostNameEnd - baseURL] = '\0'; - ::strcat(fullURL, pageAttributes.codeBase + 1); - delete[] baseURL; - baseURL = fullURL; - } else { - // assume the codeBase is relative to the document's URL. - int baseLength = ::strlen(baseURL); - int fullLength = baseLength + ::strlen(pageAttributes.codeBase); - char* fullURL = new char[fullLength + 1]; - ::strcpy(fullURL, baseURL); - ::strcat(fullURL + baseLength, pageAttributes.codeBase); - delete[] baseURL; - baseURL = fullURL; - } - } - } - } else if (pageAttributes.codeBase != NULL) { - // the CODEBASE must be an absolute URL in this case. - baseURL = ::strdup(pageAttributes.codeBase); - } - - if (baseURL != NULL) { - // make sure the URL always ends with a slash. - baseURL = ::slashify(baseURL); - status = ::JMNewTextRef(mSessionRef, &info.fBaseURL, kTextEncodingMacRoman, baseURL, ::strlen(baseURL)); - - // baseURL is now the *TRUE* codeBase - pageAttributes.codeBase = baseURL; - mPage = findPage(pageAttributes); - - // keep the codeBase around for later. - // setCodeBase(baseURL); - delete[] baseURL; - - status = ::JMNewAppletLocatorFromInfo(&mLocator, mSessionRef, &info, NULL); - } else { - ::DebugStr("\pNeed a baseURL (CODEBASE)!"); - } - -done: - if (info.fBaseURL != NULL) - ::JMDisposeTextRef(info.fBaseURL); - if (info.fAppletCode != NULL) - ::JMDisposeTextRef(info.fAppletCode); - if (info.fParams != NULL) { - for (int i = 0; i < optionalArgIndex; i++) { - JMLIBOptionalParams* param = &info.fParams[i]; - ::JMDisposeTextRef(param->fParamName); - ::JMDisposeTextRef(param->fParamValue); - } - delete info.fParams; - } -} - -#endif - -static MRJFrame* getFrame(JMFrameRef ref) -{ - MRJFrame* frame = NULL; - if (ref != NULL) { - ::JMGetFrameData(ref, (JMClientData*)&frame); - } - - return frame; -} - -static void frameSetSize(JMFrameRef ref, const Rect* newSize) -{ - MRJFrame* frame = getFrame(ref); - if (frame != NULL) - frame->setSize(newSize); -} - -static void frameInvalRect(JMFrameRef ref, const Rect* invalidRect) -{ - MRJFrame* frame = getFrame(ref); - if (frame != NULL) - frame->invalRect(invalidRect); - -#if 0 - // do we know for certain that this frame's port is a window? Assume it is. - MRJContext* thisContext = NULL; - OSStatus status = ::JMGetFrameData(frame, (JMClientData*)&thisContext); - if (status == noErr && thisContext != NULL) - ::InvalRect(r); -#endif - -#if 0 - // since this comes in on an arbitrary thread, we can't very well go calling - // back into the browser to do this, it crashes. - MRJContext* thisContext; - OSStatus status = ::JMGetFrameData(frame, (JMClientData*)&thisContext); - if (status == noErr) { - // since this comes in on an arbitrary thread, there's no telling what - // state the world is in. - NPRect invalidRect = { r->top, r->left, r->bottom, r->right }; - ::NPN_InvalidateRect(thisContext->fInstance, &invalidRect); - } -#endif -} - -static void frameShowHide(JMFrameRef ref, Boolean visible) -{ - MRJFrame* frame = getFrame(ref); - if (frame != NULL) - frame->showHide(visible); -} - -static void frameSetTitle(JMFrameRef ref, JMTextRef titleRef) -{ - Str255 title; - JMTextToStr255(titleRef, title); - MRJFrame* frame = getFrame(ref); - if (frame != NULL) - frame->setTitle(title); -} - -static void frameCheckUpdate(JMFrameRef ref) -{ - MRJFrame* frame = getFrame(ref); - if (frame != NULL) - frame->checkUpdate(); -} - -static void frameReorderFrame(JMFrameRef ref, ReorderRequest request) -{ - MRJFrame* frame = getFrame(ref); - if (frame != NULL) - frame->reorder(request); -} - -static void frameSetResizeable(JMFrameRef ref, Boolean resizeable) -{ - MRJFrame* frame = getFrame(ref); - if (frame != NULL) - frame->setResizeable(resizeable); -} - -static void frameGetFrameInsets(JMFrameRef frame, Rect *insets) -{ - // MRJFrame* frame = getFrame(ref); - // if (frame != NULL) - // frame->getFrameInsets(insets); - insets->top = insets->left = insets->bottom = insets->right = 0; -} - -static void frameNextFocus(JMFrameRef frame, Boolean forward) -{ - // MRJFrame* frame = getFrame(ref); - // if (frame != NULL) - // frame->nextFocus(insets); -} - -static void frameRequestFocus(JMFrameRef frame) -{ - // MRJFrame* frame = getFrame(ref); - // if (frame != NULL) - // frame->requestFocus(insets); -} - -class AppletViewerFrame : public MRJFrame { -public: - AppletViewerFrame(JMFrameRef frameRef, MRJContext* context) : MRJFrame(frameRef), mContext(context) {} - - virtual void invalRect(const Rect* invalidRect); - - virtual void idle(SInt16 modifiers); - virtual void update(); - virtual void click(const EventRecord* event); - -protected: - virtual GrafPtr getPort(); - -private: - MRJContext* mContext; -}; - -void AppletViewerFrame::invalRect(const Rect* invalidRect) -{ - ::InvalRect(invalidRect); -} - -void AppletViewerFrame::idle(SInt16 modifiers) -{ - mContext->idle(modifiers); -} - -void AppletViewerFrame::update() -{ - mContext->drawApplet(); -} - -void AppletViewerFrame::click(const EventRecord* event) -{ - mContext->click(event, this); -} - -GrafPtr AppletViewerFrame::getPort() -{ - return mContext->getPort(); -} - -JMFrameCallbacks theFrameCallbacks = { - kJMVersion, /* should be set to kJMVersion */ - &frameSetSize, - &frameInvalRect, - &frameShowHide, - &frameSetTitle, - &frameCheckUpdate, - &frameReorderFrame, - &frameSetResizeable, - &frameGetFrameInsets, - &frameNextFocus, - &frameRequestFocus, -}; - -OSStatus MRJContext::requestFrame(JMAWTContextRef contextRef, JMFrameRef frameRef, JMFrameKind kind, - const Rect* initialBounds, Boolean resizeable, JMFrameCallbacks* cb) -{ - // set up the viewer frame's callbacks. - BlockMoveData(&theFrameCallbacks, cb, sizeof(theFrameCallbacks)); - // *cb = callbacks; - - MRJContext* thisContext = NULL; - OSStatus status = ::JMGetAWTContextData(contextRef, (JMClientData*)&thisContext); - return thisContext->createFrame(frameRef, kind, initialBounds, resizeable); -} - -OSStatus MRJContext::releaseFrame(JMAWTContextRef contextRef, JMFrameRef frameRef) -{ - MRJContext* thisContext = NULL; - OSStatus status = ::JMGetAWTContextData(contextRef, (JMClientData*)&thisContext); - MRJFrame* thisFrame = NULL; - status = ::JMGetFrameData(frameRef, (JMClientData*)&thisFrame); - if (thisFrame != NULL) { - status = ::JMSetFrameData(frameRef, NULL); - if (thisContext->mViewerFrame == frameRef) { - thisContext->mViewerFrame = NULL; - } - delete thisFrame; - } - return status; -} - -SInt16 MRJContext::getUniqueMenuID(JMAWTContextRef contextRef, Boolean isSubmenu) -{ - MRJContext* thisContext = NULL; - OSStatus status = ::JMGetAWTContextData(contextRef, (JMClientData*)&thisContext); - return thisContext->allocateMenuID(isSubmenu); -} - -static Boolean appearanceManagerExists() -{ - long response = 0; - return (Gestalt(gestaltAppearanceAttr, &response) == noErr && (response & (1 << gestaltAppearanceExists))); -} - -static OSStatus JMTextToStr255(JMTextRef textRef, Str255 str) -{ - UInt32 length = 0; - OSStatus status = JMGetTextBytes(textRef, kTextEncodingMacRoman, &str[1], sizeof(Str255) - 1, &length); - if (status == noErr) - str[0] = (unsigned char)(status == noErr ? length : 0); - return status; -} - -static char* JMTextToEncoding(JMTextRef textRef, JMTextEncoding encoding) -{ - UInt32 length = 0; - OSStatus status = ::JMGetTextLengthInBytes(textRef, encoding, &length); - if (status != noErr) - return NULL; - char* text = new char[length + 1]; - if (text != NULL) { - UInt32 actualLength; - status = ::JMGetTextBytes(textRef, encoding, text, length, &actualLength); - if (status != noErr) { - delete text; - return NULL; - } - text[length] = '\0'; - } - return text; -} - -void MRJContext::exceptionOccurred(JMAWTContextRef context, JMTextRef exceptionName, JMTextRef exceptionMsg, JMTextRef stackTrace) -{ - // why not display this using the Appearance Manager's wizzy new alert? - if (appearanceManagerExists()) { - OSStatus status; - Str255 error, explanation; - status = ::JMTextToStr255(exceptionName, error); - status = ::JMTextToStr255(exceptionMsg, explanation); - -#if 0 - TextEncoding utf8 = CreateTextEncoding(kTextEncodingUnicodeDefault, kTextEncodingDefaultVariant, kUnicodeUTF8Format); - char* where = ::JMTextToEncoding(stackTrace, utf8); - if (where != NULL) - delete[] where; -#endif - - SInt16 itemHit = 0; - OSErr result = ::StandardAlert(kAlertPlainAlert, error, explanation, NULL, &itemHit); - } -} - -Boolean MRJContext::createContext() -{ - JMAWTContextCallbacks callbacks = { - kJMVersion, /* should be set to kJMVersion */ - &requestFrame, /* a new frame is being created. */ - &releaseFrame, /* an existing frame is being destroyed. */ - &getUniqueMenuID, /* a new menu will be created with this id. */ - &exceptionOccurred, /* just some notification that some recent operation caused an exception. You can't do anything really from here. */ - }; - if (mPage != NULL) - return mPage->createContext(&mContext, &callbacks, this); - else - return (::JMNewAWTContext(&mContext, mSessionRef, &callbacks, this) == noErr); -} - -JMAWTContextRef MRJContext::getContextRef() -{ - return mContext; -} - -JMAppletViewerRef MRJContext::getViewerRef() -{ - return mViewer; -} - -void MRJContext::showDocument(JMAppletViewerRef viewer, JMTextRef urlString, JMTextRef windowName) -{ - MRJContext* thisContext; - OSStatus status = ::JMGetAppletViewerData(viewer, (JMClientData*)&thisContext); - if (status == noErr) { - Handle urlHandle = ::JMTextToMacOSCStringHandle(urlString); - Handle windowHandle = ::JMTextToMacOSCStringHandle(windowName); - if (urlHandle != NULL && windowHandle != NULL) { - ::HLock(urlHandle); ::HLock(windowHandle); - const char* url = *urlHandle; - const char* target = *windowHandle; - thisContext->showURL(url, target); - } - if (urlHandle != NULL) - ::DisposeHandle(urlHandle); - if (windowHandle != NULL) - ::DisposeHandle(windowHandle); - } -} - -void MRJContext::setStatusMessage(JMAppletViewerRef viewer, JMTextRef statusMsg) -{ - MRJContext* thisContext; - OSStatus status = ::JMGetAppletViewerData(viewer, (JMClientData*)&thisContext); - if (status == noErr) { - TextEncoding utf8 = CreateTextEncoding(kTextEncodingUnicodeDefault, kTextEncodingDefaultVariant, kUnicodeUTF8Format); - char* message = JMTextToEncoding(statusMsg, utf8); - if (message) { - thisContext->showStatus(message); - delete[] message; - } - } -} - -/* - FIXME: this code should really be called from a true browser thread, so should put message in a queue, and let - idle time processing handle it. Otherwise, the browser will get very confused. - */ - -static nsresult getURL(nsISupports* peer, const char* url, const char* target) -{ - nsresult result = NS_OK; - if (thePluginManager != NULL) { - result = thePluginManager->GetURL(peer, url, target); - } - return result; -} - -void AsyncMessage::send(Boolean async) -{ - // submit the message, and wait for the message to be executed asynchronously. - mSession->sendMessage(this, async); -} - -class GetURLMessage : public AsyncMessage { - MRJPluginInstance* mPluginInstance; - char* mURL; - char* mTarget; -public: - GetURLMessage(MRJPluginInstance* pluginInstance, const char* url, const char* target); - ~GetURLMessage(); - - virtual void execute(); -}; - -GetURLMessage::GetURLMessage(MRJPluginInstance* pluginInstance, const char* url, const char* target) - : AsyncMessage(pluginInstance->getSession()), - mPluginInstance(pluginInstance), mURL(::strdup(url)), mTarget(::strdup(target)) -{ - NS_ADDREF(mPluginInstance); -} - -GetURLMessage::~GetURLMessage() -{ - if (mURL != NULL) - delete[] mURL; - if (mTarget != NULL) - delete[] mTarget; - - NS_RELEASE(mPluginInstance); -} - -void GetURLMessage::execute() -{ - // get the URL. - nsIPluginInstance* pluginInstance = mPluginInstance; - nsresult result = thePluginManager->GetURL(pluginInstance, mURL, mTarget); - delete this; -} - -void MRJContext::showURL(const char* url, const char* target) -{ - if (thePluginManager != NULL) { -#if 0 - GetURLMessage* message = new GetURLMessage(mPluginInstance, url, target); - message->send(true); -#else - nsIPluginInstance* pluginInstance = mPluginInstance; - thePluginManager->GetURL(pluginInstance, url, target); -#endif - } -} - -void MRJContext::showStatus(const char* message) -{ - ensureValidPort(); - - if (mPeer != NULL) - mPeer->ShowStatus(message); -} - -static SInt16 nextMenuId = 20000; -static SInt16 nextMenuPopupId = 200; - -SInt16 MRJContext::allocateMenuID(Boolean isSubmenu) -{ - // FIXME: can use more centralized approach to managing menu IDs which can be shared across all contexts. - if (thePluginManager2 != NULL) { - PRInt16 menuID = -1; - nsIEventHandler* eventHandler = mPluginInstance; - thePluginManager2->AllocateMenuID(eventHandler, isSubmenu, &menuID); - return menuID; - } else - return (isSubmenu ? nextMenuPopupId++ : nextMenuId++); -} - -OSStatus MRJContext::createFrame(JMFrameRef frameRef, JMFrameKind kind, const Rect* initialBounds, Boolean resizeable) -{ - OSStatus status = memFullErr; - MRJFrame* frame = NULL; - - // The first frame created will always be for the applet viewer. - if (mViewerFrame == NULL) { - // bind this newly created frame to this context, and vice versa. - mViewerFrame = frameRef; - frame = new AppletViewerFrame(frameRef, this); - - // make sure the frame's clipping is up-to-date. - synchronizeClipping(); - } else if (thePluginManager2 != NULL) { - // Can only do this safely if we are using the new API. - frame = new TopLevelFrame(mPluginInstance, frameRef, kind, initialBounds, resizeable); - } else { - // Try to create a frame that lives in a newly created browser window. - frame = new EmbeddedFrame(mPluginInstance, frameRef, kind, initialBounds, resizeable); - } - - if (frame != NULL) - status = ::JMSetFrameData(frameRef, frame); - - return status; -} - -Boolean MRJContext::appletLoaded() -{ - return (mViewer != NULL); -} - -void MRJContext::setProxyInfoForURL(char * url, JMProxyType proxyType) -{ - /* - * We then call 'nsIPluginManager2::FindProxyForURL' which will return - * proxy information which we can parse and set via JMSetProxyInfo. - */ - char* proxy = NULL; - nsresult rv = thePluginManager2->FindProxyForURL(url, &proxy); - if (NS_SUCCEEDED(rv) && proxy != NULL) { - /* See if a proxy was specified */ - if (strcmp("DIRECT", proxy) != 0) { - JMProxyInfo proxyInfo; - proxyInfo.useProxy = true; - char* space = strchr(proxy, ' '); - if (space != NULL) { - char* host = space + 1; - char* colon = ::strchr(host, ':'); - int length = (colon - host); - if (length < sizeof(proxyInfo.proxyHost)) { - strncpy(proxyInfo.proxyHost, host, length); - proxyInfo.proxyPort = atoi(colon + 1); - ::JMSetProxyInfo(mSessionRef, proxyType, &proxyInfo); - } - } - } - - delete[] proxy; - } -} - - -Boolean MRJContext::loadApplet() -{ - static JMAppletSecurity security = { - kJMVersion, /* should be set to kJMVersion */ - eAppletHostAccess, /* can this applet access network resources */ - eLocalAppletAccess, /* can this applet access network resources */ - true, /* restrict access to system packages (com.apple.*, sun.*, netscape.*) also found in the property "mrj.security.system.access" */ - true, /* restrict classes from loading system packages (com.apple.*, sun.*, netscape.*) also found in the property "mrj.security.system.define" */ - true, /* restrict access to application packages found in the property "mrj.security.application.access" */ - true, /* restrict access to application packages found in the property "mrj.security.application.access" */ - }; - static JMAppletViewerCallbacks callbacks = { - kJMVersion, /* should be set to kJMVersion */ - &showDocument, /* go to a url, optionally in a new window */ - &setStatusMessage, /* applet changed status message */ - }; - OSStatus status; - - /* Added by Mark: */ - /* - * Set proxy info - * It is only set if the new enhanced Plugin Manager exists. - */ - if (thePluginManager2 != NULL) { - /* Sample URL's to use for getting the HTTP proxy and FTP proxy */ - setProxyInfoForURL("http://www.mozilla.org/", eHTTPProxy); - setProxyInfoForURL("ftp://ftp.mozilla.org/", eFTPProxy); - } - /* End set proxy info code */ - - status = ::JMNewAppletViewer(&mViewer, mContext, mLocator, 0, - &security, &callbacks, this); - if (status == noErr) { - status = ::JMSetAppletViewerData(mViewer, JMClientData(this)); - status = ::JMReloadApplet(mViewer); - } - - if (status == noErr) { - // for grins, force the applet to load right away, so we can report any error we might encounter eagerly. - // jobject appletObject = getApplet(); - } - - return (status == noErr); -} - -void MRJContext::suspendApplet() -{ - if (mViewer != NULL) - ::JMSuspendApplet(mViewer); -} - -void MRJContext::resumeApplet() -{ - if (mViewer != NULL) - ::JMResumeApplet(mViewer); -} - -jobject MRJContext::getApplet() -{ - if (appletLoaded() && &::JMGetAppletJNIObject != NULL) { - JNIEnv* env = ::JMGetCurrentEnv(mSessionRef); - jobject appletObject = ::JMGetAppletJNIObject(mViewer, env); - if (appletObject == NULL) { - // Give MRJ some time to try to comply. 100 calls to JMIdle should be enough. - // 10 seconds should be enough. Could ask the user... - UInt32 deadline = ::TickCount() + 600; - while (appletObject == NULL && ::TickCount() < deadline) { - mSession->idle(kDefaultJMTime); - appletObject = ::JMGetAppletJNIObject(mViewer, env); - } - if (appletObject == NULL) { - // assume the applet's hosed. - ::JMDisposeAppletViewer(mViewer); - mViewer = NULL; - // Let the user know the applet failed to load. - if (appearanceManagerExists()) { - SInt16 itemHit = 0; - Str255 appletURL = { "\pUnknown APPLET URL" }; - if (mDocumentBase != NULL) { - appletURL[0] = ::strlen(mDocumentBase); - ::BlockMoveData(mDocumentBase, appletURL + 1, mDocumentBase[0]); - } - ::StandardAlert(kAlertPlainAlert, "\pApplet failed to load from URL:", appletURL, NULL, &itemHit); - } - } - } - return appletObject; - } - return NULL; -} - -/** - * At various times during development, it is useful to see what bits are supposed to be drawn by - * the applet. Defining DEBUG_CLIPPING as 1 turns on this behavior. - */ -#define DEBUG_CLIPPING 0 - -void MRJContext::drawApplet() -{ - // We assume the proper coordinate system for the frame has - // already been set up. - if (appletLoaded()) { -#if DEBUG_CLIPPING - nsPluginPort* npPort = (nsPluginPort*) mCache.window; - GrafPtr framePort = GrafPtr(npPort->port); - RgnHandle oldClip = NewRgn(); - if (oldClip != NULL) { - CopyRgn(framePort->clipRgn, oldClip); - SetClip(mPluginClipping); - InvertRgn(mPluginClipping); - SetClip(oldClip); - DisposeRgn(oldClip); - } -#endif - - // ::JMFrameUpdate(mViewerFrame, framePort->visRgn); - // OSStatus status = ::JMFrameUpdate(mViewerFrame, framePort->clipRgn); - OSStatus status = ::JMFrameUpdate(mViewerFrame, mPluginClipping); - } -} - -void MRJContext::printApplet(nsPluginWindow* printingWindow) -{ - jobject frameObject = NULL; - jclass utilsClass = NULL; - OSStatus status = noErr; - JNIEnv* env = ::JMGetCurrentEnv(mSessionRef); - - // put the printing port into window coordinates: (0, 0) in upper left corner. - GrafPtr printingPort = GrafPtr(printingWindow->window->port); - LocalPort localPort(printingPort); - localPort.Enter(); - ::ClipRect((Rect*)&printingWindow->clipRect); - - do { - // try to use the printing API, if that fails, fall back on netscape.oji.AWTUtils.printContainer(). - if (&::JMDrawFrameInPort != NULL) { - Point frameOrigin = { printingWindow->y, printingWindow->x }; - status = ::JMDrawFrameInPort(mViewerFrame, printingPort, frameOrigin, printingPort->clipRgn, false); - if (status == noErr) break; - } - - // get the frame object to print. - frameObject = ::JMGetAWTFrameJNIObject(mViewerFrame, env); - if (frameObject == NULL) break; - - // call the print methods of the applet viewer's frame. - jclass utilsClass = env->FindClass("netscape/oji/AWTUtils"); - if (utilsClass == NULL) break; - jmethodID printContainerMethod = env->GetStaticMethodID(utilsClass, "printContainer", "(Ljava/awt/Container;IIILjava/lang/Object;)V"); - if (printContainerMethod == NULL) break; - - // create a monitor to synchronize with. - MRJMonitor notifier(mSession); - - // start the asynchronous print call. - jvalue args[5]; - args[0].l = frameObject; - args[1].i = jint(printingPort); - args[2].i = jint(printingWindow->x); - args[3].i = jint(printingWindow->y); - args[4].l = notifier.getObject(); - OSStatus status = ::JMExecJNIStaticMethodInContext(mContext, env, utilsClass, printContainerMethod, 5, args); - - // now, wait for the print method to complete. - if (status == noErr) - notifier.wait(); - } while (0); - - // restore the origin & port. - localPort.Exit(); - - if (frameObject != NULL) - env->DeleteLocalRef(frameObject); - if (utilsClass != NULL) - env->DeleteLocalRef(utilsClass); -} - -void MRJContext::activate(Boolean active) -{ - if (mViewerFrame != NULL) { - ::JMFrameActivate(mViewerFrame, active); - mIsActive = active; - } else { - mIsActive = false; - } -} - -void MRJContext::resume(Boolean inFront) -{ -// printf("mrjcontext::resume\n"); - - if (mViewerFrame != NULL) { - ::JMFrameResume(mViewerFrame, inFront); - } -} - -void MRJContext::click(const EventRecord* event, MRJFrame* appletFrame) -{ - // inspectWindow(); -// printf("mrjcontext::click\n"); - - nsPluginPort* npPort = mPluginWindow->window; - - // make the plugin's port current, and move its origin to (0, 0). - LocalPort port(GrafPtr(npPort->port)); - port.Enter(); - - // will we always be called in the right coordinate system? - Point localWhere = event->where; - ::GlobalToLocal(&localWhere); - nsPluginRect& clipRect = mCachedClipRect; - Rect bounds = { clipRect.top, clipRect.left, clipRect.bottom, clipRect.right }; - if (PtInRect(localWhere, &bounds)) { - localToFrame(&localWhere); - appletFrame->click(event, localWhere); - } - - // restore the plugin port's origin, and restore the current port. - port.Exit(); -} - -void MRJContext::keyPress(long message, short modifiers) -{ - if (mViewerFrame != NULL) { - ::JMFrameKey(mViewerFrame, message & charCodeMask, - (message & keyCodeMask) >> 8, modifiers); - } -} - -void MRJContext::keyRelease(long message, short modifiers) -{ - if (mViewerFrame != NULL) { - ::JMFrameKeyRelease(mViewerFrame, message & charCodeMask, - (message & keyCodeMask) >> 8, modifiers); - } -} - -void MRJContext::idle(short modifiers) -{ - // inspectWindow(); -// printf("mrjcontext::idle\n"); - - // Put the port in to proper window coordinates. - nsPluginPort* npPort = mPluginWindow->window; - LocalPort port(GrafPtr(npPort->port)); - port.Enter(); - - Point pt; - ::GetMouse(&pt); - localToFrame(&pt); - ::JMFrameMouseOver(mViewerFrame, pt, modifiers); - - port.Exit(); -} - -// interim routine for compatibility between OLD plugin interface and new. - -// FIXME: when the window goes away, npWindow/pluginWindow is passed in as NULL. -// should tell the AWTContext that the window has gone away. could use an offscreen -// or empty clipped grafport. - -void MRJContext::setWindow(nsPluginWindow* pluginWindow) -{ - // don't do anything if the AWTContext hasn't been created yet. - if (mContext != NULL) { - if (pluginWindow != NULL) { - mPluginWindow = pluginWindow; - - // establish the GrafPort the plugin will draw in. - mPluginPort = pluginWindow->window->port; - - if (! appletLoaded()) - loadApplet(); - } else { - // tell MRJ the window has gone away. - mPluginWindow = NULL; - - // use a single, 0x0, empty port for all future drawing. - mPluginPort = getEmptyPort(); - } - synchronizeClipping(); - } -} - -static Boolean equalRect(const nsPluginRect* r1, const nsPluginRect* r2) -{ - SInt32* r1p = (SInt32*)r1; - SInt32* r2p = (SInt32*)r2; - return (r1p[0] == r2p[0] && r1p[1] == r2p[1]); -} - -Boolean MRJContext::inspectWindow() -{ - // don't bother looking, if the applet viewer frame doesn't exist yet. - if (mViewerFrame == NULL) - return false; - - Boolean recomputeClipping = false; - - if (mPluginWindow != NULL) { - // Check for origin or clipping changes. - nsPluginPort* npPort = mPluginWindow->window; - if (mCachedOrigin.x != npPort->portx || mCachedOrigin.y != npPort->porty || !equalRect(&mCachedClipRect, &mPluginWindow->clipRect)) { - // transfer over values to the window cache. - recomputeClipping = true; - } - } - - if (recomputeClipping) - synchronizeClipping(); - - return recomputeClipping; -} - -/** - * This routine ensures that the browser and MRJ agree on what the current clipping - * should be. If the browser has assigned us a window to draw in (see setWindow() - * above), then we use that window's clipRect to set up clipping, which is cached - * in mPluginClipping, as a region. Otherwise, mPluginClipping is set to an empty - * region. - */ -void MRJContext::synchronizeClipping() -{ - // this is called on update events to make sure the clipping region is in sync with the browser's. - if (mPluginWindow != NULL) { - // plugin clipping is intersection of clipRgn and the clipRect. - nsPluginRect clipRect = mPluginWindow->clipRect; - nsPluginPort* pluginPort = mPluginWindow->window; - clipRect.left += pluginPort->portx, clipRect.right += pluginPort->portx; - clipRect.top += pluginPort->porty, clipRect.bottom += pluginPort->porty; - ::SetRectRgn(mPluginClipping, clipRect.left, clipRect.top, clipRect.right, clipRect.bottom); - } else { - ::SetEmptyRgn(mPluginClipping); - } - synchronizeVisibility(); -} - -MRJFrame* MRJContext::findFrame(WindowRef window) -{ - MRJFrame* frame = NULL; - - // synchronizeVisibility(); - - // locates the frame corresponding to this window. - if (window == NULL || (CGrafPtr(window) == mPluginPort) && mViewerFrame != NULL) { - frame = getFrame(mViewerFrame); - } else { - // Scan the available frames for this context, and see if any of them correspond to this window. - UInt32 frameCount; - OSStatus status = ::JMCountAWTContextFrames(mContext, &frameCount); - if (status == noErr) { - for (UInt32 frameIndex = 1; frameIndex < frameCount; frameIndex++) { - JMFrameRef frameRef; - status = ::JMGetAWTContextFrame(mContext, frameIndex, &frameRef); - frame = getFrame(frameRef); - TopLevelFrame* tlFrame = dynamic_cast(frame); - if (tlFrame != NULL && tlFrame->getWindow() == window) - break; - } - } - } - - return frame; -} - -GrafPtr MRJContext::getPort() -{ -#if 0 - if (mPluginWindow != NULL) { - nsPluginPort* npPort = mPluginWindow->window; - return GrafPtr(npPort->port); - } - return NULL; -#endif - - return GrafPtr(mPluginPort); -} - -void MRJContext::localToFrame(Point* pt) -{ - if (mPluginWindow != NULL) { - // transform mouse to frame coordinates. - nsPluginPort* npPort = mPluginWindow->window; - pt->v += npPort->porty; - pt->h += npPort->portx; - } -} - -void MRJContext::ensureValidPort() -{ - if (mPluginWindow != NULL) { - nsPluginPort* npPort = mPluginWindow->window; - if (npPort == NULL) - mPluginPort = getEmptyPort(); - ::SetPort(GrafPtr(mPluginPort)); - } -} - -static void blinkRgn(RgnHandle rgn) -{ - ::InvertRgn(rgn); - UInt32 ticks = ::TickCount(); - while (::TickCount() - ticks < 10) ; - ::InvertRgn(rgn); -} - -void MRJContext::synchronizeVisibility() -{ - // always update the cached information. - if (mViewerFrame != NULL) { - if (mPluginWindow != NULL) { - nsPluginRect oldClipRect = mCachedClipRect; - nsPluginPort* pluginPort = mPluginWindow->window; - mCachedOrigin.x = pluginPort->portx; - mCachedOrigin.y = pluginPort->porty; - mCachedClipRect = mPluginWindow->clipRect; - - // compute the frame's origin and clipping. - - // JManager wants the origin expressed in window coordinates. - // npWindow refers to the entire mozilla view port whereas the nport - // refers to the actual rendered html window. - Point frameOrigin = { -pluginPort->porty, -pluginPort->portx }; - GrafPtr framePort = (GrafPtr)mPluginPort; - OSStatus status = ::JMSetFrameVisibility(mViewerFrame, framePort, - frameOrigin, mPluginClipping); - - // Invalidate the old clip rectangle, so that any bogus drawing that may - // occurred at the old location, will be corrected. - LocalPort port(framePort); - port.Enter(); - ::InvalRect((Rect*)&oldClipRect); - ::InvalRect((Rect*)&mCachedClipRect); - port.Exit(); - } else { - Point frameOrigin = { 0, 0 }; - OSStatus status = ::JMSetFrameVisibility(mViewerFrame, GrafPtr(mPluginPort), - frameOrigin, mPluginClipping); - } - } -} - -void MRJContext::showFrames() -{ - UInt32 frameCount; - OSStatus status = ::JMCountAWTContextFrames(mContext, &frameCount); - if (status == noErr) { - for (UInt32 frameIndex = 0; frameIndex < frameCount; frameIndex++) { - JMFrameRef frameRef; - status = ::JMGetAWTContextFrame(mContext, frameIndex, &frameRef); - if (status == noErr) { - ::JMFrameShowHide(frameRef, true); -// MRJFrame* frame = getFrame(frameRef); -// if (frame != NULL) -// frame->focusEvent(false); - } - } - } -} - -void MRJContext::hideFrames() -{ - UInt32 frameCount; - OSStatus status = ::JMCountAWTContextFrames(mContext, &frameCount); - if (status == noErr) { - for (UInt32 frameIndex = 0; frameIndex < frameCount; frameIndex++) { - JMFrameRef frameRef; - status = ::JMGetAWTContextFrame(mContext, frameIndex, &frameRef); - if (status == noErr) { - // make sure the frame doesn't have the focus. - MRJFrame* frame = getFrame(frameRef); - if (frame != NULL) - frame->focusEvent(false); - ::JMFrameShowHide(frameRef, false); - } - } - } -} - -/** - * Ensure that any frames Java still has a reference to are no longer valid, so that we won't crash - * after a plugin instance gets shut down. This is called by the destructor just in case, to avoid - * some hard freeze crashes I've seen. - */ -void MRJContext::releaseFrames() -{ - UInt32 frameCount; - OSStatus status = ::JMCountAWTContextFrames(mContext, &frameCount); - if (status == noErr) { - for (UInt32 frameIndex = 0; frameIndex < frameCount; frameIndex++) { - JMFrameRef frameRef = NULL; - status = ::JMGetAWTContextFrame(mContext, frameIndex, &frameRef); - if (status == noErr) { - frameShowHide(frameRef, false); - releaseFrame(mContext, frameRef); - } - } - } -} - -void MRJContext::setDocumentBase(const char* documentBase) -{ - if (mDocumentBase != NULL) - mDocumentBase = NULL; - mDocumentBase = ::strdup(documentBase); -} - -const char* MRJContext::getDocumentBase() -{ - return mDocumentBase; -} - -void MRJContext::setAppletHTML(const char* appletHTML, nsPluginTagType tagType) -{ - if (mAppletHTML != NULL) - delete[] mAppletHTML; - - switch (tagType) { - case nsPluginTagType_Applet: - mAppletHTML = ::strdup(appletHTML); - break; - - case nsPluginTagType_Object: - { - // If the HTML isn't an element, but is an element, then - // transform it so MRJ can deal with it gracefully. it sure would be - // nice if some DOM code would deal with this for us. This code - // is fragile, because it assumes the case of the classid attribute. - - // edit the element, converting to , - // classid="java:JitterText.class" to code="JitterText.class", - // and to . - string element(appletHTML); - - const char kAppletTag[] = "applet"; - const size_t kAppleTagSize = sizeof(kAppletTag) - 1; - string::size_type startTag = element.find(""); - if (endTag != string::npos) { - element.replace(endTag + 2, kAppleTagSize, kAppletTag); - } - - const char kClassIDAttribute[] = "classid=\"java:"; - const char kCodeAttribute[] = "code=\""; - size_t kClassIDAttributeSize = sizeof(kClassIDAttribute) - 1; - string::size_type classID = element.find(kClassIDAttribute); - if (classID != string::npos) { - element.replace(classID, kClassIDAttributeSize, kCodeAttribute); - } - - mAppletHTML = ::strdup(element.c_str()); - } - break; - case nsPluginTagType_Embed: - { - nsIPluginTagInfo* tagInfo = NULL; - if (mPeer->QueryInterface(NS_GET_IID(nsIPluginTagInfo), (void **)&tagInfo) == NS_OK) { - // just synthesize an element out of whole cloth. - mAppletHTML = synthesizeAppletElement(tagInfo); - NS_RELEASE(tagInfo); - } - } - break; - } -} - -const char* MRJContext::getAppletHTML() -{ - return mAppletHTML; -} - -void MRJContext::setSecurityContext(MRJSecurityContext* context) -{ - NS_ADDREF(context); - NS_IF_RELEASE(mSecurityContext); - mSecurityContext = context; -} - -MRJSecurityContext* MRJContext::getSecurityContext() -{ - return mSecurityContext; -} - -MRJPage* MRJContext::findPage(const MRJPageAttributes& attributes) -{ - MRJPage* page = MRJPage::getFirstPage(); - while (page != NULL) { - if (attributes.documentID == page->getDocumentID() && - ::strcasecmp(attributes.codeBase, page->getCodeBase()) == 0 && - ::strcasecmp(attributes.archive, page->getArchive()) == 0 && - attributes.mayScript == page->getMayScript()) { - page->AddRef(); - return page; - } - page = page->getNextPage(); - } - - // create a unique page for this URL. - page = new MRJPage(mSession, attributes); - page->AddRef(); - return page; -} - -struct EmptyPort : public CGrafPort { - EmptyPort() { - GrafPtr oldPort; - ::GetPort(&oldPort); - ::OpenCPort(this); - ::PortSize(0, 0); - ::SetEmptyRgn(this->visRgn); - ::SetEmptyRgn(this->clipRgn); - ::SetPort(oldPort); - } - - ~EmptyPort() { - ::CloseCPort(this); - } -}; - -CGrafPtr MRJContext::getEmptyPort() -{ - static EmptyPort emptyPort; - return &emptyPort; -} diff --git a/plugin/oji/MRJ/plugin/Source/MRJContext.h b/plugin/oji/MRJ/plugin/Source/MRJContext.h deleted file mode 100644 index b48582115c85..000000000000 --- a/plugin/oji/MRJ/plugin/Source/MRJContext.h +++ /dev/null @@ -1,168 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - MRJContext.h - - Manages Java content using the MacOS Runtime for Java. - - by Patrick C. Beard. - */ - -#pragma once - -#include "jni.h" -#include "JManager.h" -#include "nsIPluginTagInfo2.h" - -// -// Instance state information about the plugin. -// -// *Developers*: Use this struct to hold per-instance -// information that you'll need in the -// various functions in this file. -// - -class MRJSession; -class MRJPluginInstance; -class nsIPluginInstancePeer; -struct nsPluginWindow; -class MRJFrame; -class MRJPage; -struct MRJPageAttributes; -class MRJSecurityContext; - -struct nsPluginPoint { - PRInt32 x; - PRInt32 y; -}; - -class MRJContext { -public: - MRJContext(MRJSession* session, MRJPluginInstance* instance); - ~MRJContext(); - - void processAppletTag(); - Boolean createContext(); - JMAWTContextRef getContextRef(); - JMAppletViewerRef getViewerRef(); - - void setProxyInfoForURL(char * url, JMProxyType proxyType); - Boolean appletLoaded(); - Boolean loadApplet(); - Boolean isActive(); - - void suspendApplet(); - void resumeApplet(); - - jobject getApplet(); - - void idle(short modifiers); - void drawApplet(); - void printApplet(nsPluginWindow* printingWindow); - - void activate(Boolean active); - void resume(Boolean inFront); - - void click(const EventRecord* event, MRJFrame* frame); - void keyPress(long message, short modifiers); - void keyRelease(long message, short modifiers); - - void setWindow(nsPluginWindow* pluginWindow); - Boolean inspectWindow(); - - MRJFrame* findFrame(WindowRef window); - GrafPtr getPort(); - - void showFrames(); - void hideFrames(); - void releaseFrames(); - - void setDocumentBase(const char* documentBase); - const char* getDocumentBase(); - - void setAppletHTML(const char* appletHTML, nsPluginTagType tagType); - const char* getAppletHTML(); - - void setSecurityContext(MRJSecurityContext* context); - MRJSecurityContext* getSecurityContext(); - -private: - void localToFrame(Point* pt); - void ensureValidPort(); - void synchronizeClipping(); - void synchronizeVisibility(); - - static OSStatus requestFrame(JMAWTContextRef context, JMFrameRef newFrame, JMFrameKind kind, - const Rect *initialBounds, Boolean resizeable, JMFrameCallbacks *callbacks); - static OSStatus releaseFrame(JMAWTContextRef context, JMFrameRef oldFrame); - static SInt16 getUniqueMenuID(JMAWTContextRef context, Boolean isSubmenu); - static void exceptionOccurred(JMAWTContextRef context, JMTextRef exceptionName, JMTextRef exceptionMsg, JMTextRef stackTrace); - - static void showDocument(JMAppletViewerRef viewer, JMTextRef urlString, JMTextRef windowName); - static void setStatusMessage(JMAppletViewerRef viewer, JMTextRef statusMsg); - - void showURL(const char* url, const char* target); - void showStatus(const char* message); - SInt16 allocateMenuID(Boolean isSubmenu); - - OSStatus createFrame(JMFrameRef frameRef, JMFrameKind kind, const Rect* initialBounds, Boolean resizeable); - - // Finds a suitable MRJPage object for this document URL, or creates one. - MRJPage* findPage(const MRJPageAttributes& attributes); - - static CGrafPtr getEmptyPort(); - -private: - MRJPluginInstance* mPluginInstance; - MRJSession* mSession; - JMSessionRef mSessionRef; - nsIPluginInstancePeer* mPeer; - JMAppletLocatorRef mLocator; - JMAWTContextRef mContext; - JMAppletViewerRef mViewer; - JMFrameRef mViewerFrame; - Boolean mIsActive; - nsPluginPoint mCachedOrigin; - nsPluginRect mCachedClipRect; - RgnHandle mPluginClipping; - nsPluginWindow* mPluginWindow; - CGrafPtr mPluginPort; - char* mDocumentBase; - char* mAppletHTML; - MRJPage* mPage; - MRJSecurityContext* mSecurityContext; -}; diff --git a/plugin/oji/MRJ/plugin/Source/MRJFrame.cpp b/plugin/oji/MRJ/plugin/Source/MRJFrame.cpp deleted file mode 100644 index 484543505e62..000000000000 --- a/plugin/oji/MRJ/plugin/Source/MRJFrame.cpp +++ /dev/null @@ -1,223 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - MRJFrame.cpp - - Encapsulates a JManager frame. - - by Patrick C. Beard. - */ - -#include "MRJFrame.h" -#include "LocalPort.h" -#include "nsplugindefs.h" - -MRJFrame::MRJFrame(JMFrameRef frameRef) - : mFrameRef(frameRef), mActive(false), mFocused(false) -{ -} - -MRJFrame::~MRJFrame() -{ -} - -/* Stub implementations. */ -void MRJFrame::setSize(const Rect* newSize) {} -void MRJFrame::invalRect(const Rect* invalidRect) {} -void MRJFrame::showHide(Boolean visible) {} -void MRJFrame::setTitle(const StringPtr title) {} -void MRJFrame::checkUpdate() {} -void MRJFrame::reorder(ReorderRequest request) {} -void MRJFrame::setResizeable(Boolean resizeable) {} - -Boolean MRJFrame::handleEvent(const EventRecord* event) -{ - Boolean eventHandled = true; - - switch (event->what) { - case nsPluginEventType_AdjustCursorEvent: - idle(event->modifiers); - break; - - case ::mouseDown: - click(event); - break; - - case keyDown: - case autoKey: - keyPress(event->message, event->modifiers); - break; - - case keyUp: - keyRelease(event->message, event->modifiers); - break; - - case updateEvt: - update(); - break; - - case activateEvt: - activate((event->modifiers & activeFlag) != 0); - break; - -#if 0 - case osEvt: - resume((event->message & resumeFlag) != 0); - eventHandled = false; - break; -#endif - - default: - eventHandled = false; - break; - } - - return eventHandled; -} - -void MRJFrame::idle(SInt16 modifiers) -{ - LocalPort port(getPort()); - port.Enter(); - - Point pt; - ::GetMouse(&pt); - ::JMFrameMouseOver(mFrameRef, pt, modifiers); - - port.Exit(); -} - -void MRJFrame::update() -{ - GrafPtr framePort = getPort(); - if (framePort != NULL) - ::JMFrameUpdate(mFrameRef, framePort->clipRgn); -} - -void MRJFrame::activate(Boolean active) -{ - if (mActive != active) { - mActive = active; - ::JMFrameActivate(mFrameRef, active); - } -} - -void MRJFrame::focusEvent(Boolean gotFocus) -{ - if (&::JMFrameFocus != NULL) { - if (gotFocus != mFocused) { - if (gotFocus) { - // HACK, until focus really works. - if (mActive != gotFocus) { - mActive = gotFocus; - ::JMFrameActivate(mFrameRef, gotFocus); - } - } - mFocused = gotFocus; - ::JMFrameFocus(mFrameRef, gotFocus); - } - } else { - if (mActive != gotFocus) { - mActive = gotFocus; - ::JMFrameActivate(mFrameRef, gotFocus); - } - } -} - -void MRJFrame::resume(Boolean inFront) -{ - ::JMFrameResume(mFrameRef, inFront); -} - -void MRJFrame::click(const EventRecord* event) -{ - // make the frame's port current, and move its origin to (0, 0). - // this is needed to transform the mouse click location to frame coordinates. - LocalPort port(getPort()); - port.Enter(); - - Point localWhere = event->where; - ::GlobalToLocal(&localWhere); - click(event, localWhere); - - // restore the plugin port's origin, and restore the current port. - port.Exit(); -} - -void MRJFrame::click(const EventRecord* event, Point localWhere) -{ - if (&::JMFrameClickWithEventRecord != NULL) - ::JMFrameClickWithEventRecord(mFrameRef, localWhere, event); - else - ::JMFrameClick(mFrameRef, localWhere, event->modifiers); -} - -void MRJFrame::keyPress(UInt32 message, SInt16 modifiers) -{ - ::JMFrameKey(mFrameRef, message & charCodeMask, (message & keyCodeMask) >> 8, modifiers); -} - -void MRJFrame::keyRelease(UInt32 message, SInt16 modifiers) -{ - ::JMFrameKeyRelease(mFrameRef, message & charCodeMask, (message & keyCodeMask) >> 8, modifiers); -} - -void MRJFrame::menuSelected(UInt32 message, SInt16 modifiers) -{ - MenuHandle menu = ::GetMenuHandle(short(message >> 16)); - if (menu != NULL) { - short item = short(message); - if (&::JMMenuSelectedWithModifiers != NULL) - ::JMMenuSelectedWithModifiers(::JMGetFrameContext(mFrameRef), menu, item, modifiers); - else - ::JMMenuSelected(::JMGetFrameContext(mFrameRef), menu, item); - } -} - -void MRJFrame::print(GrafPtr printingPort, Point frameOrigin) -{ -#if 0 - // this doesn't work, as Apple hasn't implemented it yet. - OSStatus status = JMDrawFrameInPort(mFrameRef, printingPort, frameOrigin, printingPort->clipRgn, false); - if (status != noErr) { - ::MoveTo(10, 12); - ::TextFont(0); - ::TextSize(12); - ::DrawString("\pMRJPlugin: printing failed."); - } -#endif -} diff --git a/plugin/oji/MRJ/plugin/Source/MRJFrame.h b/plugin/oji/MRJ/plugin/Source/MRJFrame.h deleted file mode 100644 index 88f6d2f2ca59..000000000000 --- a/plugin/oji/MRJ/plugin/Source/MRJFrame.h +++ /dev/null @@ -1,95 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - MRJFrame.h - - Encapsulates a JManager frame. - - by Patrick C. Beard. - */ - -#pragma once - -#ifndef CALL_NOT_IN_CARBON - #define CALL_NOT_IN_CARBON 1 -#endif - -#include "jni.h" -#include "JManager.h" - -struct EventRecord; -struct nsPluginPrint; - -class MRJFrame { -public: - MRJFrame(JMFrameRef frameRef); - virtual ~MRJFrame(); - - /** Methods used to implement the JMFrame callback protocol. */ - virtual void setSize(const Rect* newSize); - virtual void invalRect(const Rect* invalidRect); - virtual void showHide(Boolean visible); - virtual void setTitle(const StringPtr title); - virtual void checkUpdate(); - virtual void reorder(ReorderRequest request); - virtual void setResizeable(Boolean resizeable); - - /** Methods to handle various events. */ - virtual Boolean handleEvent(const EventRecord* event); - - virtual void idle(SInt16 modifiers); - virtual void update(); - virtual void activate(Boolean active); - virtual void resume(Boolean inFront); - virtual void click(const EventRecord* event); - virtual void click(const EventRecord* event, Point localWhere); - virtual void keyPress(UInt32 message, SInt16 modifiers); - virtual void keyRelease(UInt32 message, SInt16 modifiers); - - virtual void focusEvent(Boolean gotFocus); - virtual void menuSelected(UInt32 message, SInt16 modifiers); - - virtual void print(GrafPtr printingPort, Point frameOrigin); - -protected: - virtual GrafPtr getPort() = 0; - -protected: - JMFrameRef mFrameRef; - Boolean mActive; - Boolean mFocused; -}; diff --git a/plugin/oji/MRJ/plugin/Source/MRJMonitor.cpp b/plugin/oji/MRJ/plugin/Source/MRJMonitor.cpp deleted file mode 100644 index 75fe3e716c07..000000000000 --- a/plugin/oji/MRJ/plugin/Source/MRJMonitor.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - MRJMonitor.cpp - - Provides a C++ interface to Java monitors. - - by Patrick C. Beard. - */ - -#include "MRJMonitor.h" -#include "MRJSession.h" - -MRJMonitor::MRJMonitor(MRJSession* session, jobject monitor) - : mSession(session), mMonitor(NULL), mWaitMethod(NULL), mNotifyMethod(NULL), mNotifyAllMethod(NULL) -{ - JNIEnv* env = mSession->getCurrentEnv(); - jclass javaLangObject = env->FindClass("java/lang/Object"); - if (javaLangObject != NULL) { - // look up method IDs. - mWaitMethod = env->GetMethodID(javaLangObject, "wait", "()V"); - mTimedWaitMethod = env->GetMethodID(javaLangObject, "wait", "(J)V"); - mNotifyMethod = env->GetMethodID(javaLangObject, "notify", "()V"); - mNotifyAllMethod = env->GetMethodID(javaLangObject, "notifyAll", "()V"); - - Boolean allocateMonitor = (monitor == NULL); - if (allocateMonitor) - monitor = env->AllocObject(javaLangObject); - - if (monitor != NULL) - mMonitor = env->NewGlobalRef(monitor); - - if (allocateMonitor) - env->DeleteLocalRef(monitor); - - env->DeleteLocalRef(javaLangObject); - } -} - -MRJMonitor::~MRJMonitor() -{ - if (mMonitor != NULL) { - JNIEnv* env = mSession->getCurrentEnv(); - env->DeleteGlobalRef(mMonitor); - mMonitor = NULL; - } -} - -void MRJMonitor::enter() -{ - JNIEnv* env = mSession->getCurrentEnv(); - env->MonitorEnter(mMonitor); -} - -void MRJMonitor::exit() -{ - JNIEnv* env = mSession->getCurrentEnv(); - env->MonitorExit(mMonitor); -} - -void MRJMonitor::wait() -{ - if (mMonitor != NULL && mWaitMethod != NULL) { - JNIEnv* env = mSession->getCurrentEnv(); - env->MonitorEnter(mMonitor); - env->CallVoidMethod(mMonitor, mWaitMethod); - env->MonitorExit(mMonitor); - } -} - -void MRJMonitor::wait(long long millis) -{ - if (mMonitor != NULL && mWaitMethod != NULL) { - JNIEnv* env = mSession->getCurrentEnv(); - env->MonitorEnter(mMonitor); - env->CallVoidMethod(mMonitor, mTimedWaitMethod, jlong(millis)); - env->MonitorExit(mMonitor); - } -} - -void MRJMonitor::notify() -{ - if (mMonitor != NULL && mNotifyMethod != NULL) { - JNIEnv* env = mSession->getCurrentEnv(); - env->MonitorEnter(mMonitor); - env->CallVoidMethod(mMonitor, mNotifyMethod); - env->MonitorExit(mMonitor); - } -} - -void MRJMonitor::notifyAll() -{ - if (mMonitor != NULL && mNotifyAllMethod != NULL) { - JNIEnv* env = mSession->getCurrentEnv(); - env->MonitorEnter(mMonitor); - env->CallVoidMethod(mMonitor, mNotifyAllMethod); - env->MonitorExit(mMonitor); - } -} - -jobject MRJMonitor::getObject() -{ - return mMonitor; -} diff --git a/plugin/oji/MRJ/plugin/Source/MRJMonitor.h b/plugin/oji/MRJ/plugin/Source/MRJMonitor.h deleted file mode 100644 index 5b272d0ff6e0..000000000000 --- a/plugin/oji/MRJ/plugin/Source/MRJMonitor.h +++ /dev/null @@ -1,75 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - MRJMonitor.h - - Provides a C++ interface to Java monitors. - - by Patrick C. Beard. - */ - -#include "Monitor.h" - -#ifndef JNI_H -#include "jni.h" -#endif - -class MRJSession; - -class MRJMonitor : public Monitor { -public: - MRJMonitor(MRJSession* session, jobject monitor = NULL); - ~MRJMonitor(); - - virtual void enter(); - virtual void exit(); - - virtual void wait(); - virtual void wait(long long millis); - virtual void notify(); - virtual void notifyAll(); - - virtual jobject getObject(); - -private: - MRJSession* mSession; - jobject mMonitor; - jmethodID mWaitMethod; - jmethodID mTimedWaitMethod; - jmethodID mNotifyMethod; - jmethodID mNotifyAllMethod; -}; diff --git a/plugin/oji/MRJ/plugin/Source/MRJNetworking.cpp b/plugin/oji/MRJ/plugin/Source/MRJNetworking.cpp deleted file mode 100644 index b21c3bb549cb..000000000000 --- a/plugin/oji/MRJ/plugin/Source/MRJNetworking.cpp +++ /dev/null @@ -1,417 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - MRJNetworking.cpp - - by Patrick C. Beard. - */ - -#include -#include -#include "JMURLConnection.h" - -#include "MRJNetworking.h" -#include "MRJContext.h" -#include "MRJPlugin.h" -#include "MRJSession.h" -#include "MRJMonitor.h" -#include "nsIPluginManager2.h" - -#include - -extern nsIPluginManager* thePluginManager; // now in badaptor.cpp. -extern nsIPluginManager2* thePluginManager2; - -static char* JMTextToEncoding(JMTextRef textRef, JMTextEncoding encoding) -{ - UInt32 length = 0; - OSStatus status = ::JMGetTextLengthInBytes(textRef, encoding, &length); - if (status != noErr) - return NULL; - char* text = new char[length + 1]; - if (text != NULL) { - UInt32 actualLength; - status = ::JMGetTextBytes(textRef, encoding, text, length, &actualLength); - if (status != noErr) { - delete text; - return NULL; - } - text[length] = '\0'; - } - return text; -} - -class MRJInputStream : public nsIPluginStreamListener { - MRJMonitor mMonitor; - typedef std::vector buffer_t; - buffer_t mBuffer; - size_t mOffset; - bool mComplete; -public: - NS_DECL_ISUPPORTS - - MRJInputStream(MRJSession* session) - : mMonitor(session), mOffset(0), mComplete(false) - { - mBuffer.reserve(8192); - } - - NS_IMETHOD - OnStartBinding(nsIPluginStreamInfo* pluginInfo) - { - return NS_OK; - } - - NS_IMETHOD - OnDataAvailable(nsIPluginStreamInfo* pluginInfo, nsIInputStream* input, PRUint32 length); - - NS_IMETHOD - OnFileAvailable(nsIPluginStreamInfo* pluginInfo, const char* fileName) - { - return NS_OK; - } - - NS_IMETHOD - OnStopBinding(nsIPluginStreamInfo* pluginInfo, nsresult status) - { - if (!mComplete) { - mComplete = true; - mMonitor.notify(); - } - return NS_OK; - } - - NS_IMETHOD - GetStreamType(nsPluginStreamType *result) - { - *result = nsPluginStreamType_Normal; - return NS_OK; - } - - OSStatus read(void* buffer, SInt32 bufferSize, SInt32* bytesRead); -}; -NS_IMPL_ISUPPORTS1(MRJInputStream, nsIPluginStreamListener); - -NS_IMETHODIMP -MRJInputStream::OnDataAvailable(nsIPluginStreamInfo* pluginInfo, nsIInputStream* input, PRUint32 length) -{ - size_t oldSize = mBuffer.size(); - mBuffer.resize(oldSize + length); - buffer_t::iterator buffer = mBuffer.begin() + oldSize; - input->Read(buffer, length, &length); - mMonitor.notify(); - return NS_OK; -} - -OSStatus MRJInputStream::read(void* buffer, SInt32 bufferSize, SInt32* bytesRead) -{ - size_t sz = mBuffer.size(); - while (mOffset >= sz && !mComplete) { - // wait until there is some data to read. - mMonitor.wait(); - sz = mBuffer.size(); - } - - SInt32 available = (sz - mOffset); - if (bufferSize > available) - bufferSize = available; - - if (bufferSize <= 0 && mComplete) { - *bytesRead = 0; - return noErr; - } - - ::BlockMoveData(mBuffer.begin() + mOffset, buffer, bufferSize); - *bytesRead = bufferSize; - mOffset += bufferSize; - - return noErr; -} - -class MRJURLConnection { -public: - MRJURLConnection(JMTextRef url, JMTextRef requestMethod, - JMURLConnectionOptions options, - JMAppletViewerRef appletViewer); - - ~MRJURLConnection(); - - MRJPluginInstance* getInstance(); - const char* getURL(); - const char* getRequestMethod(); - Boolean getUsingProxy(); - -private: - MRJPluginInstance* mInstance; - char* mURL; - char* mRequestMethod; - JMURLConnectionOptions mOptions; - Boolean mUsingProxy; -}; - -MRJURLConnection::MRJURLConnection(JMTextRef url, JMTextRef requestMethod, - JMURLConnectionOptions options, - JMAppletViewerRef appletViewer) - : mInstance(0), mURL(0), mRequestMethod(0), mOptions(options), mUsingProxy(false) -{ - MRJPluginInstance* instance = MRJPluginInstance::getInstances(); - if (appletViewer != NULL) { - while (instance != NULL) { - MRJContext* context = instance->getContext(); - if (context->getViewerRef() == appletViewer) { - mInstance = instance; - break; - } - instance = instance->getNextInstance(); - } - } else { - // any instance will do? - mInstance = instance; - NS_IF_ADDREF(instance); - } - - TextEncoding utf8 = ::CreateTextEncoding(kTextEncodingUnicodeDefault, - kTextEncodingDefaultVariant, - kUnicodeUTF8Format); - - // pull the text out of the url and requestMethod. - mURL = ::JMTextToEncoding(url, utf8); - mRequestMethod = ::JMTextToEncoding(requestMethod, utf8); - - // see if a proxy will be used for this URL. - if (thePluginManager2 != NULL) { - char* proxyForURL = NULL; - if (thePluginManager2->FindProxyForURL(mURL, &proxyForURL) == NS_OK) { - mUsingProxy = (::strcmp("DIRECT", proxyForURL) != 0); - delete[] proxyForURL; - } - } -} - -MRJURLConnection::~MRJURLConnection() -{ - delete[] mURL; - delete[] mRequestMethod; -} - -inline MRJPluginInstance* MRJURLConnection::getInstance() -{ - return mInstance; -} - -inline const char* MRJURLConnection::getURL() -{ - return mURL; -} - -inline const char* MRJURLConnection::getRequestMethod() -{ - return mRequestMethod; -} - -inline Boolean MRJURLConnection::getUsingProxy() -{ - return mUsingProxy; -} - -static OSStatus openConnection( - /* in URL = */ JMTextRef url, - /* in RequestMethod = */ JMTextRef requestMethod, - /* in ConnectionOptions = */ JMURLConnectionOptions options, - /* in AppletViewer = */ JMAppletViewerRef appletViewer, - /* out URLConnectionRef = */ JMURLConnectionRef* urlConnectionRef - ) -{ - MRJURLConnection* connection = new MRJURLConnection(url, requestMethod, - options, appletViewer); - *urlConnectionRef = connection; - return noErr; -} - -static OSStatus closeConnection( - /* in URLConnectionRef = */ JMURLConnectionRef urlConnectionRef - ) -{ - MRJURLConnection* connection = reinterpret_cast(urlConnectionRef); - delete connection; - return noErr; -} - -static Boolean usingProxy( - /* in URLConnectionRef = */ JMURLConnectionRef urlConnectionRef - ) -{ - MRJURLConnection* connection = reinterpret_cast(urlConnectionRef); - return connection->getUsingProxy(); -} - -static OSStatus getCookie( - /* in URLConnectionRef = */ JMURLConnectionRef urlConnectionRef, - /* out CookieValue = */ JMTextRef* cookie - ) -{ - return paramErr; -} - -static OSStatus setCookie( - /* in URLConnectionRef = */ JMURLConnectionRef urlConnectionRef, - /* in CookieValue = */ JMTextRef cookie - ) -{ - return paramErr; -} - -static OSStatus setRequestProperties( - /* in URLConnectionRef = */ JMURLConnectionRef urlConnectionRef, - /* in NumberOfProperties = */ int numberOfProperties, - /* in PropertyNames = */ JMTextRef* keys, - /* in Values = */ JMTextRef* value - ) -{ - return paramErr; -} - -static OSStatus getResponsePropertiesCount( - /* in URLConnectionRef = */ JMURLInputStreamRef urlInputStreamRef, - /* out numberOfProperties = */ int* numberOfProperties - ) -{ - if (numberOfProperties == NULL) - return paramErr; - *numberOfProperties = 0; - return noErr; -} - -static OSStatus getResponseProperties( - /* in URLConnectionRef = */ JMURLInputStreamRef urlInputStreamRef, - /* in numberOfProperties = */ int numberOfProperties, - /* out PropertyNames = */ JMTextRef* keys, - /* out Values = */ JMTextRef* values - ) -{ - return noErr; -} - -static OSStatus openInputStream( - /* in URLConnectionRef = */ JMURLConnectionRef urlConnectionRef, - /* out URLStreamRef = */ JMURLInputStreamRef* urlInputStreamRef - ) -{ - MRJURLConnection* connection = reinterpret_cast(urlConnectionRef); - MRJInputStream* inputStream = new MRJInputStream(connection->getInstance()->getSession()); - inputStream->AddRef(); - *urlInputStreamRef = inputStream; - - nsIPluginInstance* pluginInstance = connection->getInstance(); - nsIPluginStreamListener* listener = inputStream; - nsresult rv = thePluginManager->GetURL(pluginInstance, connection->getURL(), NULL, listener); - - return noErr; -} - -static OSStatus openOutputStream( - /* in URLConnectionRef = */ JMURLConnectionRef urlConnectionRef, - /* out URLOutputStreamRef = */ JMURLOutputStreamRef* urlOutputStreamRef - ) -{ - return paramErr; -} - -static OSStatus closeInputStream( - /* in URLInputStreamRef = */ JMURLInputStreamRef urlInputStreamRef - ) -{ - MRJInputStream* inputStream = reinterpret_cast(urlInputStreamRef); - inputStream->Release(); - return noErr; -} - -static OSStatus closeOutputStream( - /* in URLOutputStreamRef = */ JMURLOutputStreamRef urlOutputStreamRef - ) -{ - return paramErr; -} - -static OSStatus readInputStream( - /* in URLConnectionRef = */ JMURLInputStreamRef urlInputStreamRef, - /* out Buffer = */ void* buffer, - /* in BufferSize = */ UInt32 bufferSize, - /* out BytesRead = */ SInt32* bytesRead - ) -{ - MRJInputStream* inputStream = reinterpret_cast(urlInputStreamRef); - return inputStream->read(buffer, bufferSize, bytesRead); -} - -static OSStatus writeOutputStream( - /* in URLConnectionRef = */ JMURLOutputStreamRef oStreamRef, - /* in Buffer = */ void* buffer, - /* in BytesToWrite = */ SInt32 bytesToWrite - ) -{ - return paramErr; -} - -static JMURLCallbacks theURLCallbacks = { - kJMVersion, - &openConnection, &closeConnection, - &usingProxy, &getCookie, &setCookie, - &setRequestProperties, - &getResponsePropertiesCount, - &getResponseProperties, - &openInputStream, &openOutputStream, - &closeInputStream, &closeOutputStream, - &readInputStream, &writeOutputStream -}; - -OSStatus OpenMRJNetworking(MRJSession* session) -{ - OSStatus rv = paramErr; - if (&::JMURLSetCallbacks != 0) { - rv = ::JMURLSetCallbacks(session->getSessionRef(), - "http", &theURLCallbacks); - rv = ::JMURLSetCallbacks(session->getSessionRef(), - "https", &theURLCallbacks); - } - return rv; -} - -OSStatus CloseMRJNetworking(MRJSession* session) -{ - return noErr; -} diff --git a/plugin/oji/MRJ/plugin/Source/MRJNetworking.h b/plugin/oji/MRJ/plugin/Source/MRJNetworking.h deleted file mode 100644 index df34bc6dbaea..000000000000 --- a/plugin/oji/MRJ/plugin/Source/MRJNetworking.h +++ /dev/null @@ -1,52 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - MRJNetworking.h - - by Patrick C. Beard. - */ - -#pragma once - -#ifndef __MACTYPES__ -#include -#endif - -class MRJSession; - -OSStatus OpenMRJNetworking(MRJSession* session); -OSStatus CloseMRJNetworking(MRJSession* session); diff --git a/plugin/oji/MRJ/plugin/Source/MRJPage.cpp b/plugin/oji/MRJ/plugin/Source/MRJPage.cpp deleted file mode 100644 index 420574bf3c88..000000000000 --- a/plugin/oji/MRJ/plugin/Source/MRJPage.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - MRJPage.cpp - - Encapsulates the new MRJ Page API, which loads applets into a common context. - - by Patrick C. Beard. - */ - -#include "MRJPage.h" -#include "MRJSession.h" - -#include "StringUtils.h" - -MRJPage::MRJPage(MRJSession* session, UInt32 documentID, const char* codeBase, const char* archive, Boolean mayScript) - : mRefCount(0), mNextPage(NULL), mSession(session), mPageRef(NULL), - mDocumentID(documentID), mCodeBase(strdup(codeBase)), mArchive(strdup(archive)), mMayScript(mayScript) -{ - pushPage(); - - if (&::JMNewAppletPage != NULL) { - OSStatus status = ::JMNewAppletPage(&mPageRef, session->getSessionRef()); - if (status != noErr) mPageRef = NULL; - } -} - -MRJPage::MRJPage(MRJSession* session, const MRJPageAttributes& attributes) - : mRefCount(0), mNextPage(NULL), mSession(session), mPageRef(NULL), - mDocumentID(attributes.documentID), mCodeBase(strdup(attributes.codeBase)), - mArchive(strdup(attributes.archive)), mMayScript(attributes.mayScript) -{ - pushPage(); - - if (&::JMNewAppletPage != NULL) { - OSStatus status = ::JMNewAppletPage(&mPageRef, session->getSessionRef()); - if (status != noErr) mPageRef = NULL; - } -} - -MRJPage::~MRJPage() -{ - popPage(); - - if (&::JMDisposeAppletPage != NULL && mPageRef != NULL) { - OSStatus status = ::JMDisposeAppletPage(mPageRef); - mPageRef = NULL; - } - - if (mCodeBase != NULL) { - delete[] mCodeBase; - mCodeBase = NULL; - } - - if (mArchive != NULL) { - delete[] mArchive; - mArchive = NULL; - } -} - -UInt16 MRJPage::AddRef() -{ - return (++mRefCount); -} - -UInt16 MRJPage::Release() -{ - UInt16 result = --mRefCount; - if (result == 0) { - delete this; - } - return result; -} - -Boolean MRJPage::createContext(JMAWTContextRef* outContext, const JMAWTContextCallbacks * callbacks, JMClientData data) -{ - OSStatus status = noErr; - if (&::JMNewAWTContextInPage != NULL && mPageRef != NULL) { - status = ::JMNewAWTContextInPage(outContext, mSession->getSessionRef(), mPageRef, callbacks, data); - } else { - status = ::JMNewAWTContext(outContext, mSession->getSessionRef(), callbacks, data); - } - return (status == noErr); -} - -static MRJPage* thePageList = NULL; - -MRJPage* MRJPage::getFirstPage() -{ - return thePageList; -} - -MRJPage* MRJPage::getNextPage() -{ - return mNextPage; -} - -void MRJPage::pushPage() -{ - // put this on the global list of pages. - mNextPage = thePageList; - thePageList = this; -} - -void MRJPage::popPage() -{ - // Remove this page from the global list. - MRJPage** link = &thePageList; - MRJPage* page = *link; - while (page != NULL) { - if (page == this) { - *link = mNextPage; - mNextPage = NULL; - break; - } - link = &page->mNextPage; - page = *link; - } -} diff --git a/plugin/oji/MRJ/plugin/Source/MRJPage.h b/plugin/oji/MRJ/plugin/Source/MRJPage.h deleted file mode 100644 index 4b03d3884b3b..000000000000 --- a/plugin/oji/MRJ/plugin/Source/MRJPage.h +++ /dev/null @@ -1,106 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - MRJPage.h - - Encapsulates the MRJ data structure. - - by Patrick C. Beard. - */ - -#ifndef __TYPES__ -#include -#endif - -#ifndef CALL_NOT_IN_CARBON - #define CALL_NOT_IN_CARBON 1 -#endif - -#include "JManager.h" - -// For now. -typedef struct OpaqueJMAppletPageRef* JMAppletPageRef; - -class MRJSession; - -struct MRJPageAttributes { - UInt32 documentID; - const char* codeBase; - const char* archive; - Boolean mayScript; -}; - -class MRJPage { -public: - MRJPage(MRJSession* session, UInt32 documentID, const char* codeBase, const char* archive, Boolean mayScript); - MRJPage(MRJSession* session, const MRJPageAttributes& attributes); - ~MRJPage(); - - // Pages are reference counted. - UInt16 AddRef(void); - UInt16 Release(void); - - JMAppletPageRef getPageRef() { return mPageRef; } - - UInt32 getDocumentID() { return mDocumentID; } - const char* getCodeBase() { return mCodeBase; } - const char* getArchive() { return mArchive; } - Boolean getMayScript() { return mMayScript; } - - // Creating AWTContexts. - Boolean createContext(JMAWTContextRef* outContext, - const JMAWTContextCallbacks * callbacks, - JMClientData data); - - // Accessing the list of instances. - static MRJPage* getFirstPage(void); - MRJPage* getNextPage(void); - -private: - void pushPage(); - void popPage(); - -private: - UInt16 mRefCount; - MRJPage* mNextPage; - MRJSession* mSession; - JMAppletPageRef mPageRef; - UInt32 mDocumentID; - char* mCodeBase; - char* mArchive; - Boolean mMayScript; -}; diff --git a/plugin/oji/MRJ/plugin/Source/MRJPlugin.cpp b/plugin/oji/MRJ/plugin/Source/MRJPlugin.cpp deleted file mode 100644 index 7c3d6bf5c6fe..000000000000 --- a/plugin/oji/MRJ/plugin/Source/MRJPlugin.cpp +++ /dev/null @@ -1,941 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - MRJPlugin.cpp - - XP COM Plugin Implementation. - - by Patrick C. Beard. - */ - -#include "MRJPlugin.h" -#include "MRJSession.h" -#include "MRJContext.h" -#include "MRJFrame.h" -#include "MRJConsole.h" -#include "EmbeddedFramePluginInstance.h" - -#include "nsIServiceManager.h" -#include "nsMemory.h" -#include "nsIComponentManager.h" -#include "nsIJVMManager.h" -#include "nsIJVMPluginTagInfo.h" -#include "nsIPluginManager2.h" -#include "nsIPluginInstancePeer.h" -#include "nsIWindowlessPlugInstPeer.h" -#include "LiveConnectNativeMethods.h" -#include "CSecureEnv.h" -#include "EventFilter.h" -#include "nsObsoleteModuleLoading.h" - -#include - -static nsIServiceManager* theServiceManager = NULL; -static nsIServiceManagerObsolete* theServiceManagerObsolete = NULL; - -extern nsIServiceManager* theServiceManager; // needs to be in badaptor.cpp. -extern nsIPluginManager* thePluginManager; // now in badaptor.cpp. -extern nsIPlugin* thePlugin; - -nsIPluginManager2* thePluginManager2 = NULL; -nsIMemory* theMemoryAllocator = NULL; // should also be provided by badaptor.cpp. - -FSSpec thePluginSpec; -short thePluginRefnum = -1; - -// Common interface IDs. - -static NS_DEFINE_IID(kPluginCID, NS_PLUGIN_CID); -static NS_DEFINE_IID(kPluginManagerCID, NS_PLUGINMANAGER_CID); -#ifdef MRJPLUGIN_4X -static NS_DEFINE_IID(kMemoryCID, NS_MEMORY_CID); -#endif -static NS_DEFINE_IID(kJVMManagerCID, NS_JVMMANAGER_CID); - -static NS_DEFINE_IID(kIWindowlessPluginInstancePeerIID, NS_IWINDOWLESSPLUGININSTANCEPEER_IID); - -const char* MRJPlugin::PLUGIN_VERSION = "eerieQuarkDoll.v.b1"; - - -nsresult MRJPlugin::GetService(const nsCID& aCID, const nsIID& aIID, void* *aService) -{ - if (theServiceManager) - return theServiceManager->GetService(aCID, aIID, aService); - if (theServiceManagerObsolete) - return theServiceManagerObsolete->GetService(aCID, aIID, (nsISupports **)aService); - return NS_ERROR_FAILURE; -} - -nsresult MRJPlugin::GetService(const char* aContractID, const nsIID& aIID, void* *aService) -{ - if (theServiceManager) - return theServiceManager->GetServiceByContractID(aContractID, aIID, aService); - if (theServiceManagerObsolete) - return theServiceManagerObsolete->GetService(aContractID, aIID, (nsISupports **)aService); - return NS_ERROR_FAILURE; -} - -#pragma export on - -nsresult NSGetFactory(nsISupports* serviceManager, const nsCID &aClass, const char *aClassName, const char *aContractID, nsIFactory **aFactory) -{ - nsresult result = NS_OK; - - if (theServiceManager == NULL && theServiceManagerObsolete == NULL) { - if (NS_FAILED(serviceManager->QueryInterface(NS_GET_IID(nsIServiceManager), (void**)&theServiceManager))) - if (NS_FAILED(serviceManager->QueryInterface(NS_GET_IID(nsIServiceManagerObsolete), (void**)&theServiceManagerObsolete))) - return NS_ERROR_FAILURE; - - // Our global operator new wants to use nsIMalloc to do all of its allocation. - // This should be available from the Service Manager. -#ifdef MRJPLUGIN_4X - if (MRJPlugin::GetService(kMemoryCID, NS_GET_IID(nsIMemory), (void**)&theMemoryAllocator) != NS_OK) - return NS_ERROR_FAILURE; -#else - if (NS_FAILED(MRJPlugin::GetService("@mozilla.org/xpcom/memory-service;1", NS_GET_IID(nsIMemory), (void **)&theMemoryAllocator))) - return NS_ERROR_FAILURE; -#endif - } - - if (aClass.Equals(kPluginCID)) { - MRJPlugin* pluginFactory = new MRJPlugin(); - pluginFactory->AddRef(); - *aFactory = pluginFactory; - return NS_OK; - } - return NS_NOINTERFACE; -} - -#pragma export off - -extern "C" { - -pascal OSErr __initialize(const CFragInitBlock *initBlock); -pascal void __terminate(void); - -#if defined(MRJPLUGIN_GC) -pascal OSErr __NSInitialize(const CFragInitBlock* initBlock); -pascal void __NSTerminate(void); -#define __initialize __NSInitialize -#define __terminate __NSTerminate -#endif - -pascal OSErr MRJPlugin__initialize(const CFragInitBlock *initBlock); -pascal void MRJPlugin__terminate(void); - -} - -pascal OSErr MRJPlugin__initialize(const CFragInitBlock *initBlock) -{ - OSErr err = __initialize(initBlock); - if (err != noErr) return err; - - if (initBlock->fragLocator.where == kDataForkCFragLocator) { - thePluginSpec = *initBlock->fragLocator.u.onDisk.fileSpec; - - // is it always the case that the plugin's resource file is open now? - thePluginRefnum = ::FSpOpenResFile(&thePluginSpec, fsRdPerm); - } - - return noErr; -} - -pascal void MRJPlugin__terminate() -{ -#ifdef MRJPLUGIN_4X - // Make sure the event filters are removed. - RemoveEventFilters(); -#endif - - __terminate(); - - // last ditch release of the memory allocator. - if (theMemoryAllocator != NULL) { - theMemoryAllocator->Release(); - theMemoryAllocator = NULL; - } -} - -// -// The MEAT of the plugin. -// - -#pragma mark *** MRJPlugin *** - -const InterfaceInfo MRJPlugin::sInterfaces[] = { - { NS_IPLUGIN_IID, INTERFACE_OFFSET(MRJPlugin, nsIPlugin) }, - { NS_IJVMPLUGIN_IID, INTERFACE_OFFSET(MRJPlugin, nsIJVMPlugin) }, - { NS_IRUNNABLE_IID, INTERFACE_OFFSET(MRJPlugin, nsIRunnable) }, -}; -const UInt32 MRJPlugin::kInterfaceCount = sizeof(sInterfaces) / sizeof(InterfaceInfo); - -MRJPlugin::MRJPlugin() - : SupportsMixin(this, sInterfaces, kInterfaceCount), - mManager(NULL), mThreadManager(NULL), mSession(NULL), mConsole(NULL), mIsEnabled(false), mPluginThreadID(NULL) -{ - // make this singleton instance visible. - ::thePlugin = this; -} - -MRJPlugin::~MRJPlugin() -{ - // make sure the plugin is no longer visible. - ::thePlugin = NULL; - - // Release the console. - if (mConsole != NULL) { - mConsole->Release(); - mConsole = NULL; - } - - // tear down the MRJ session, if it exists. - if (mSession != NULL) { - delete mSession; - mSession = NULL; - } - - // Release the manager? - if (mManager != NULL) { - mManager->Release(); - mManager = NULL; - } - - if (mThreadManager != NULL) { - mThreadManager->Release(); - mThreadManager = NULL; - } -} - -/** - * MRJPlugin aggregates MRJConsole, so that it can be QI'd to be an nsIJVMConsole. - * To save code size, we use the SupportsMixin class instead of the macros in - * nsAgg.h. SupportsMixin::queryInterface, addRef, and release are all local - * operations, regardless of aggregation. The capitalized versions take aggregation - * into account. - */ -NS_METHOD MRJPlugin::QueryInterface(const nsIID& aIID, void** instancePtr) -{ - nsresult result = queryInterface(aIID, instancePtr); - if (result == NS_NOINTERFACE) { - result = mConsole->queryInterface(aIID, instancePtr); - } - return result; -} - -NS_METHOD MRJPlugin::CreateInstance(nsISupports *aOuter, const nsIID& aIID, void **aResult) -{ - nsresult result = StartupJVM(); - if (result == NS_OK) { - MRJPluginInstance* instance = new MRJPluginInstance(this); - if (instance == nsnull) - return NS_ERROR_OUT_OF_MEMORY; - result = instance->QueryInterface(aIID, aResult); - if (result != NS_OK) - delete instance; - } - return result; -} - -#define NS_APPLET_MIME_TYPE "application/x-java-applet" - -NS_METHOD MRJPlugin::CreatePluginInstance(nsISupports *aOuter, REFNSIID aIID, const char* aPluginMIMEType, void **aResult) -{ - nsresult result = NS_NOINTERFACE; - - if (::strcmp(aPluginMIMEType, "application/x-java-frame") == 0) { - // create a special plugin instance that manages an embedded frame. - EmbeddedFramePluginInstance* instance = new EmbeddedFramePluginInstance(); - nsresult result = instance->QueryInterface(aIID, aResult); - if (result != NS_OK) - delete instance; - } else { - // assume it's some kind of an applet. - result = CreateInstance(aOuter, aIID, aResult); - } - return result; -} - -NS_METHOD MRJPlugin::Initialize() -{ - nsresult result = NS_OK; - - // try to get a plugin manager. - if (thePluginManager == NULL) { - result = MRJPlugin::GetService(kPluginManagerCID, NS_GET_IID(nsIPluginManager), (void**)&thePluginManager); - if (result != NS_OK || thePluginManager == NULL) - return NS_ERROR_FAILURE; - } - - // see if the enhanced plugin manager exists. - if (thePluginManager2 == NULL) { - if (thePluginManager->QueryInterface(NS_GET_IID(nsIPluginManager2), (void**)&thePluginManager2) != NS_OK) - thePluginManager2 = NULL; - } - - // try to get a JVM manager. we have to be able to run without one. - if (MRJPlugin::GetService(kJVMManagerCID, NS_GET_IID(nsIJVMManager), (void**)&mManager) != NS_OK) - mManager = NULL; - - // try to get a Thread manager. - if (mManager != NULL) { - if (mManager->QueryInterface(NS_GET_IID(nsIThreadManager), (void**)&mThreadManager) != NS_OK) - mThreadManager = NULL; - - if (mThreadManager != NULL) - mThreadManager->GetCurrentThread(&mPluginThreadID); - } - - // create a console, only if there's user interface for it. - if (thePluginManager2 != NULL) { - mConsole = new MRJConsole(this); - mConsole->AddRef(); - } - - return result; -} - -NS_METHOD MRJPlugin::Shutdown() -{ - // shutdown LiveConnect. - ShutdownLiveConnectSupport(); - - // release our reference to the plugin manager(s). - NS_IF_RELEASE(thePluginManager2); - NS_IF_RELEASE(thePluginManager); - - // release our reference to the service manager. - NS_IF_RELEASE(theServiceManager); - NS_IF_RELEASE(theServiceManagerObsolete); - - return NS_OK; -} - -NS_METHOD MRJPlugin::GetMIMEDescription(const char* *result) -{ - *result = NS_JVM_MIME_TYPE; - return NS_OK; -} - -NS_METHOD MRJPlugin::GetValue(nsPluginVariable variable, void *value) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_METHOD MRJPlugin::SetValue(nsPluginVariable variable, void *value) -{ - return NS_ERROR_FAILURE; -} - -MRJSession* MRJPlugin::getSession() -{ - StartupJVM(); - return mSession; -} - -nsIJVMManager* MRJPlugin::getManager() -{ - return mManager; -} - -nsIThreadManager* MRJPlugin::getThreadManager() -{ - return mThreadManager; -} - -NS_METHOD MRJPlugin::StartupJVM() -{ - if (mSession == NULL) { - // start a session with MRJ. - mSession = new MRJSession(); - if (mSession->getStatus() != noErr) { - // how can we signal an error? - delete mSession; - mSession = NULL; - return NS_ERROR_FAILURE; - } -#if 0 - // Apply the initialization args. - if (initArgs != NULL && initArgs->version >= nsJVMInitArgs_Version) { - const char* classPathAdditions = initArgs->classpathAdditions; - if (classPathAdditions != NULL) { - // what format will this be in? UNIX paths, separated by ':' characters. - char* paths = new char[1 + strlen(classPathAdditions)]; - if (paths != NULL) { - strcpy(paths, classPathAdditions); - char* path = strtok(paths, ":"); - while (path != NULL) { - static char urlPrefix[] = { "file://" }; - char* fileURL = new char[sizeof(urlPrefix) + strlen(path)]; - if (fileURL != NULL) { - strcat(strcpy(fileURL, urlPrefix), path); - mSession->addURLToClassPath(fileURL); - delete[] fileURL; - } - path = strtok(NULL, ":"); - } - delete[] paths; - } - } - } -#endif - - // Add "MRJPlugin.jar" to the class path. - FSSpec jarFileSpec = { thePluginSpec.vRefNum, thePluginSpec.parID, "\pMRJPlugin.jar" }; - mSession->addToClassPath(jarFileSpec); - - InitLiveConnectSupport(this); - -#if 0 - // start our idle thread. - if (mThreadManager != NULL) { - PRUint32 threadID; - mThreadManager->CreateThread(&threadID, this); - } -#endif - - mIsEnabled = true; - } - return NS_OK; -} - -NS_METHOD MRJPlugin::ShutdownJVM(PRBool fullShutdown) -{ - if (fullShutdown) { - nsresult rv = ShutdownLiveConnectSupport(); - - if (mSession != NULL) { - delete mSession; - mSession = NULL; - } - } - return NS_OK; -} - -NS_METHOD MRJPlugin::AddToClassPath(const char* dirPath) -{ - if (mSession != NULL) { - mSession->addToClassPath(dirPath); - return NS_OK; - } - return NS_ERROR_FAILURE; -} - -NS_METHOD MRJPlugin::GetClassPath(const char* *result) -{ - char* classPath = mSession->getProperty("java.class.path"); - *result = classPath; - return (classPath != NULL ? NS_OK : NS_ERROR_FAILURE); -} - -NS_METHOD MRJPlugin::GetJavaWrapper(JNIEnv* env, jint jsobj, jobject *jobj) -{ - // use jsobj as key into a table. - // if not in the table, then create a new netscape.javascript.JSObject that references this. - *jobj = Wrap_JSObject(env, jsobj); - return NS_OK; -} - -NS_METHOD MRJPlugin::UnwrapJavaWrapper(JNIEnv* jenv, jobject jobj, jint* obj) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_METHOD MRJPlugin::GetJavaVM(JavaVM* *result) -{ - *result = NULL; - if (StartupJVM() == NS_OK) { - *result = mSession->getJavaVM(); - return NS_OK; - } - return NS_ERROR_FAILURE; -} - -nsrefcnt MRJPlugin::GetJNIEnv(JNIEnv* *result) -{ - JNIEnv* env = NULL; - if (StartupJVM() == NS_OK) { -#if 1 - env = mSession->getCurrentEnv(); -#else - JDK1_1AttachArgs args; - JavaVM* vm = mSession->getJavaVM(); - jint result = vm->AttachCurrentThread(&env, &args); - if (result != 0) - env = NULL; -#endif - } - *result = env; - return 1; -} - -nsrefcnt MRJPlugin::ReleaseJNIEnv(JNIEnv* env) -{ - return 0; -} - -NS_METHOD MRJPlugin::CreateSecureEnv(JNIEnv* proxyEnv, nsISecureEnv* *outSecureEnv) -{ - *outSecureEnv = NULL; - nsresult rv = StartupJVM(); - if (rv == NS_OK) { - // Need to spawn a new JVM communication thread here. - NS_DEFINE_IID(kISecureEnvIID, NS_ISECUREENV_IID); - rv = CSecureEnv::Create(this, proxyEnv, kISecureEnvIID, (void**)outSecureEnv); - } - return rv; -} - -NS_METHOD MRJPlugin::SpendTime(PRUint32 timeMillis) -{ - nsresult result = NS_OK; - // Only do this if there aren't any plugin instances. - if (MRJPluginInstance::getInstances() == NULL) { - if (mSession == NULL) - result = StartupJVM(); - if (mSession != NULL) - mSession->idle(timeMillis); - } - return result; -} - -NS_METHOD MRJPlugin::Run() -{ - while (mSession != NULL) { - mSession->idle(); - mThreadManager->Sleep(); - } - return NS_OK; -} - -MRJPluginInstance* MRJPlugin::getPluginInstance(jobject applet) -{ - JNIEnv* env = mSession->getCurrentEnv(); - MRJPluginInstance* instance = MRJPluginInstance::getInstances(); - while (instance != NULL) { - jobject object = NULL; - if (instance->GetJavaObject(&object) == NS_OK && env->IsSameObject(applet, object)) { - instance->AddRef(); - return instance; - } - instance = instance->getNextInstance(); - } - return NULL; -} - -MRJPluginInstance* MRJPlugin::getPluginInstance(JNIEnv* jenv) -{ - // Apple will provide an API that maps a JNIEnv to an JMAWTContextRef. We can map this to the MRJContext/Applet/Instance. - MRJPluginInstance* instance = MRJPluginInstance::getInstances(); - if (&::JMJNIToAWTContext != NULL) { - JMAWTContextRef contextRef = ::JMJNIToAWTContext(mSession->getSessionRef(), jenv); - if (contextRef != NULL) { - while (instance != NULL) { - if (instance->getContext()->getContextRef() == contextRef) { - instance->AddRef(); - return instance; - } - instance = instance->getNextInstance(); - } - } - } else { - if (instance != NULL) { - instance->AddRef(); - return instance; - } - } - return NULL; -} - -Boolean MRJPlugin::inPluginThread() -{ - Boolean result = false; - nsPluginThread *currentThreadID = NULL; - - if (mThreadManager != NULL) - mThreadManager->GetCurrentThread(¤tThreadID); - if ((NULL != currentThreadID) && (NULL != mPluginThreadID)) { - if (currentThreadID == mPluginThreadID) { - result = true; - } - } - - return result; -} - -#pragma mark *** MRJPluginInstance *** - -const InterfaceInfo MRJPluginInstance::sInterfaces[] = { - { NS_IPLUGININSTANCE_IID, INTERFACE_OFFSET(MRJPluginInstance, nsIPluginInstance) }, - { NS_IJVMPLUGININSTANCE_IID, INTERFACE_OFFSET(MRJPluginInstance, nsIJVMPluginInstance) }, - { NS_IEVENTHANDLER_IID, INTERFACE_OFFSET(MRJPluginInstance, nsIEventHandler) }, -}; -const UInt32 MRJPluginInstance::kInterfaceCount = sizeof(sInterfaces) / sizeof(InterfaceInfo); - -MRJPluginInstance::MRJPluginInstance(MRJPlugin* plugin) - : SupportsMixin(this, sInterfaces, kInterfaceCount), - mPeer(NULL), mWindowlessPeer(NULL), - mPlugin(plugin), mSession(plugin->getSession()), - mContext(NULL), mApplet(NULL), mPluginWindow(NULL), - mNext(NULL) -{ - // add this instance to the instance list. - pushInstance(); - - // Tell the plugin we are retaining a reference. - mPlugin->AddRef(); -} - -MRJPluginInstance::~MRJPluginInstance() -{ - // Remove this instance from the global list. - popInstance(); - -#if 0 - if (mContext != NULL) { - delete mContext; - mContext = NULL; - } - - if (mPlugin != NULL) { - mPlugin->Release(); - mPlugin = NULL; - } - - if (mWindowlessPeer != NULL) { - mWindowlessPeer->Release(); - mWindowlessPeer = NULL; - } - - if (mPeer != NULL) { - mPeer->Release(); - mPeer = NULL; - } - - if (mApplet != NULL) { - JNIEnv* env = mSession->getCurrentEnv(); - env->DeleteGlobalRef(mApplet); - mApplet = NULL; - } -#endif -} - -static const char* kGetCodeBaseScriptURL = "javascript:var href = window.location.href; href.substring(0, href.lastIndexOf('/') + 1)"; -static const char* kGetDocumentBaseScriptURL = "javascript:window.location"; - -static bool hasTagInfo(nsISupports* supports) -{ - nsIJVMPluginTagInfo* tagInfo; - if (supports->QueryInterface(NS_GET_IID(nsIJVMPluginTagInfo), (void **)&tagInfo) == NS_OK) { - NS_RELEASE(tagInfo); - return true; - } - return false; -} - -NS_METHOD MRJPluginInstance::Initialize(nsIPluginInstancePeer* peer) -{ - // Tell the peer we are retaining a reference. - mPeer = peer; - mPeer->AddRef(); - - // See if we have a windowless peer. - nsresult result = mPeer->QueryInterface(kIWindowlessPluginInstancePeerIID, (void **)&mWindowlessPeer); - if (result != NS_OK) mWindowlessPeer = NULL; - - // create a context for the applet we will run. - mContext = new MRJContext(mSession, this); - - if (hasTagInfo(mPeer)) { - mContext->processAppletTag(); - mContext->createContext(); - } else { - // we'll be using JavaScript to create windows. - // fire up a JavaScript URL to get the current document's location. - nsIPluginInstance* pluginInstance = this; - nsIPluginStreamListener* listener = this; - result = thePluginManager->GetURL(pluginInstance, kGetDocumentBaseScriptURL, NULL, listener); - } - - return NS_OK; -} - -NS_METHOD MRJPluginInstance::OnDataAvailable(nsIPluginStreamInfo* pluginInfo, nsIInputStream* input, PRUint32 length) -{ - // hopefully all our data is available. - char* documentBase = new char[length + 1]; - if (documentBase != NULL) { - if (input->Read(documentBase, length, &length) == NS_OK) { - // We've delayed processing the applet tag, because we - // don't know the location of the current document yet. - documentBase[length] = '\0'; - - // set up the default document location, which can be used to compute relative CODEBASE, etc. - mContext->setDocumentBase(documentBase); - delete[] documentBase; - - mContext->processAppletTag(); - mContext->createContext(); - - // SetWindow may be called at an inopportune time. - if (mPluginWindow != NULL) - mContext->setWindow(mPluginWindow); - } - } - return NS_OK; -} - -NS_METHOD MRJPluginInstance::GetPeer(nsIPluginInstancePeer* *result) -{ - mPeer->AddRef(); - *result = mPeer; - return NS_OK; -} - -NS_METHOD MRJPluginInstance::Start() -{ - // Take this moment to show the applet's frames (if any). - mContext->showFrames(); - - mContext->resumeApplet(); - - return NS_OK; -} - -NS_METHOD MRJPluginInstance::Stop() -{ - // Take this moment to hide the applet's frames. - mContext->hideFrames(); - - mContext->suspendApplet(); - - return NS_OK; -} - -NS_METHOD MRJPluginInstance::Destroy() -{ - // Use this opportunity to break any cycles that might exist, and reduce - // reference counts to their minimum values. - if (mContext != NULL) { - delete mContext; - mContext = NULL; - } - - if (mPlugin != NULL) { - mPlugin->Release(); - mPlugin = NULL; - } - - if (mWindowlessPeer != NULL) { - mWindowlessPeer->Release(); - mWindowlessPeer = NULL; - } - - if (mPeer != NULL) { - mPeer->Release(); - mPeer = NULL; - } - - if (mApplet != NULL) { - JNIEnv* env = mSession->getCurrentEnv(); - env->DeleteGlobalRef(mApplet); - mApplet = NULL; - } - - return NS_OK; -} - -/** FIXME: Need an intelligent way to track changes to the NPPluginWindow. */ - -NS_METHOD MRJPluginInstance::SetWindow(nsPluginWindow* pluginWindow) -{ - mPluginWindow = pluginWindow; - - mContext->setWindow(pluginWindow); - - return NS_OK; -} - -NS_METHOD MRJPluginInstance::HandleEvent(nsPluginEvent* pluginEvent, PRBool* eventHandled) -{ - *eventHandled = PR_TRUE; - Boolean isUpdate; - - if (pluginEvent != NULL) { - EventRecord* event = pluginEvent->event; - -#if 0 - // Check for clipping changes. - if (event->what == nsPluginEventType_ClippingChangedEvent) { - mContext->setClipping(RgnHandle(event->message)); - return NS_OK; - } -#else - // Check for coordinate/clipping changes. - isUpdate = (event->what == updateEvt); - inspectInstance(isUpdate); -#endif - - if (event->what == nullEvent) { - // Give MRJ another quantum of time. - mSession->idle(kDefaultJMTime); // now SpendTime does this. - -#if 0 - // check for pending update events. - if (CheckUpdate(event)) { - MRJFrame* frame = mContext->findFrame(WindowRef(event->message)); - if (frame != NULL) - frame->update(); - } -#endif - - } else { - MRJFrame* frame = mContext->findFrame(WindowRef(pluginEvent->window)); - if (frame != NULL) { - switch (event->what) { - case nsPluginEventType_GetFocusEvent: - frame->focusEvent(true); - break; - - case nsPluginEventType_LoseFocusEvent: - frame->focusEvent(false); - break; - - case nsPluginEventType_AdjustCursorEvent: - frame->idle(event->modifiers); - break; - - case nsPluginEventType_MenuCommandEvent: - frame->menuSelected(event->message, event->modifiers); - break; - - default: - *eventHandled = frame->handleEvent(event); - break; - } - } - } - } - - return NS_OK; -} - -NS_METHOD MRJPluginInstance::Print(nsPluginPrint* platformPrint) -{ - if (platformPrint->mode == nsPluginMode_Embedded) { - mContext->printApplet(&platformPrint->print.embedPrint.window); - return NS_OK; - } - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_METHOD MRJPluginInstance::GetValue(nsPluginInstanceVariable variable, void *value) -{ - switch (variable) { - case nsPluginInstanceVariable_WindowlessBool: - *(PRBool*)value = PR_FALSE; - break; - case nsPluginInstanceVariable_TransparentBool: - *(PRBool*)value = PR_FALSE; - break; - case nsPluginInstanceVariable_DoCacheBool: - *(PRBool*)value = PR_FALSE; - break; - } - return NS_OK; -} - -NS_METHOD MRJPluginInstance::GetJavaObject(jobject *result) -{ - if (mApplet == NULL) { - jobject applet = mContext->getApplet(); - JNIEnv* env = mSession->getCurrentEnv(); - mApplet = env->NewGlobalRef(applet); - } - *result = mApplet; - return NS_OK; -} - -// Accessing the list of instances. - -static MRJPluginInstance* theInstances = NULL; - -void MRJPluginInstance::pushInstance() -{ - mNext = theInstances; - theInstances = this; -} - -void MRJPluginInstance::popInstance() -{ - MRJPluginInstance** link = &theInstances; - MRJPluginInstance* instance = *link; - while (instance != NULL) { - if (instance == this) { - *link = mNext; - mNext = NULL; - break; - } - link = &instance->mNext; - instance = *link; - } -} - -MRJPluginInstance* MRJPluginInstance::getInstances() -{ - return theInstances; -} - -MRJPluginInstance* MRJPluginInstance::getNextInstance() -{ - return mNext; -} - -MRJContext* MRJPluginInstance::getContext() -{ - return mContext; -} - -MRJSession* MRJPluginInstance::getSession() -{ - return mSession; -} - -void MRJPluginInstance::inspectInstance(Boolean isUpdateEvt) -{ - if (mContext != NULL && mContext->inspectWindow() && !isUpdateEvt && mWindowlessPeer != NULL) - mWindowlessPeer->ForceRedraw(); -} diff --git a/plugin/oji/MRJ/plugin/Source/MRJPlugin.h b/plugin/oji/MRJ/plugin/Source/MRJPlugin.h deleted file mode 100644 index d3d1322acdf8..000000000000 --- a/plugin/oji/MRJ/plugin/Source/MRJPlugin.h +++ /dev/null @@ -1,491 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - MRJPlugin.h - - MRJPlugin encapsulates the global state of the MRJ plugin as a single COM object. - MRJPluginInstance represents an instance of the MRJ plugin. - - by Patrick C. Beard. - */ - -#pragma once - -#include "nsIPlugin.h" -#include "nsIJVMPlugin.h" -#include "nsIThreadManager.h" -#include "nsIPluginInstance.h" -#include "nsIJVMPluginInstance.h" -#include "nsIEventHandler.h" -#include "nsIPluginStreamListener.h" -#include "SupportsMixin.h" - -class MRJPlugin; -class MRJPluginInstance; -class MRJSession; -class MRJContext; -class MRJConsole; - -class nsIJVMManager; - -class MRJPlugin : public nsIPlugin, public nsIJVMPlugin, - public nsIRunnable, public SupportsMixin { -public: - MRJPlugin(); - virtual ~MRJPlugin(); - - static nsresult GetService(const nsCID &aCID, const nsIID& aIID, void* *aService); - static nsresult GetService(const char* aContractID, const nsIID& aIID, void* *aService); - - static const char* PLUGIN_VERSION; - - // Currently, this is a singleton, statically allocated object. - void operator delete(void* ptr) {} - - // NS_DECL_ISUPPORTS - NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); - NS_IMETHOD_(nsrefcnt) AddRef(void) { return addRef(); } - NS_IMETHOD_(nsrefcnt) Release(void) { return release(); } - - // The Release method on NPIPlugin corresponds to NPP_Shutdown. - - // The old NPP_New call has been factored into two plugin instance methods: - // - // NewInstance -- called once, after the plugin instance is created. This - // method is used to initialize the new plugin instance (although the actual - // plugin instance object will be created by the plugin manager). - // - // NPIPluginInstance::Start -- called when the plugin instance is to be - // started. This happens in two circumstances: (1) after the plugin instance - // is first initialized, and (2) after a plugin instance is returned to - // (e.g. by going back in the window history) after previously being stopped - // by the Stop method. - - // nsIFactory Methods. - - NS_IMETHOD - CreateInstance(nsISupports *aOuter, const nsIID& aIID, void **aResult); - - NS_IMETHOD - LockFactory(PRBool aLock) { return NS_ERROR_NOT_IMPLEMENTED; } - - // nsIPlugin Methods. - - /** - * Creates a new plugin instance, based on the MIME type. This - * allows different impelementations to be created depending on - * the specified MIME type. - */ - NS_IMETHOD CreatePluginInstance(nsISupports *aOuter, REFNSIID aIID, - const char* aPluginMIMEType, - void **aResult); - - /** - * Initializes the plugin and will be called before any new instances are - * created. This separates out the phase when a plugin is loaded just to - * query for its mime type from the phase when a plugin is used for real. - * The plugin should load up any resources at this point. - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Initialize(void); - - /** - * Called when the browser is done with the plugin factory, or when - * the plugin is disabled by the user. - * - * (Corresponds to NPP_Shutdown.) - * - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Shutdown(void); - - /** - * Returns the MIME description for the plugin. The MIME description - * is a colon-separated string containg the plugin MIME type, plugin - * data file extension, and plugin name, e.g.: - * - * "application/x-simple-plugin:smp:Simple LiveConnect Sample Plug-in" - * - * (Corresponds to NPP_GetMIMEDescription.) - * - * @param resultingDesc - the resulting MIME description - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - GetMIMEDescription(const char* *result); - - /** - * Returns the value of a variable associated with the plugin. - * - * (Corresponds to NPP_GetValue.) - * - * @param variable - the plugin variable to get - * @param value - the address of where to store the resulting value - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - GetValue(nsPluginVariable variable, void *value); - - // (Corresponds to NPP_SetValue.) - NS_IMETHOD - SetValue(nsPluginVariable variable, void *value); - - // JVM Plugin Methods. - - // This method us used to start the Java virtual machine. - // It sets up any global state necessary to host Java programs. - // Note that calling this method is distinctly separate from - // initializing the nsIJVMPlugin object (done by the Initialize - // method). - NS_IMETHOD - StartupJVM(void); - - // This method us used to stop the Java virtual machine. - // It tears down any global state necessary to host Java programs. - // The fullShutdown flag specifies whether the browser is quitting - // (PR_TRUE) or simply whether the JVM is being shut down (PR_FALSE). - NS_IMETHOD - ShutdownJVM(PRBool fullShutdown); - - // Causes the JVM to append a new directory to its classpath. - // If the JVM doesn't support this operation, an error is returned. - NS_IMETHOD - AddToClassPath(const char* dirPath); - - // Causes the JVM to remove a directory from its classpath. - // If the JVM doesn't support this operation, an error is returned. - NS_IMETHOD - RemoveFromClassPath(const char* dirPath) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - // Returns the current classpath in use by the JVM. - NS_IMETHOD - GetClassPath(const char* *result); - - NS_IMETHOD - GetJavaWrapper(JNIEnv* env, jint jsobj, jobject *jobj); - - NS_IMETHOD - GetJavaVM(JavaVM* *result); - - // nsIJNIPlugin Methods. - - // Find or create a JNIEnv for the current thread. - // Returns NULL if an error occurs. - NS_IMETHOD_(nsrefcnt) - GetJNIEnv(JNIEnv* *result); - - // This method must be called when the caller is done using the JNIEnv. - // This decrements a refcount associated with it may free it. - NS_IMETHOD_(nsrefcnt) - ReleaseJNIEnv(JNIEnv* env); - - /** - * This creates a new secure communication channel with Java. The second parameter, - * nativeEnv, if non-NULL, will be the actual thread for Java communication. - * Otherwise, a new thread should be created. - * @param proxyEnv the env to be used by all clients on the browser side - * @return outSecureEnv the secure environment used by the proxyEnv - */ - NS_IMETHOD - CreateSecureEnv(JNIEnv* proxyEnv, nsISecureEnv* *outSecureEnv); - - /** - * Gives time to the JVM from the main event loop of the browser. This is - * necessary when there aren't any plugin instances around, but Java threads exist. - */ - NS_IMETHOD - SpendTime(PRUint32 timeMillis); - - /** - * The Run method gives time to the JVM periodically. This makes SpendTIme() obsolete. - */ - NS_IMETHOD - Run(); - - // NON-INTERFACE methods, for internal use only. - - MRJSession* getSession(); - nsIJVMManager* getManager(); - nsIThreadManager* getThreadManager(); - - MRJPluginInstance* getPluginInstance(jobject applet); - MRJPluginInstance* getPluginInstance(JNIEnv* jenv); - - Boolean inPluginThread(); - - NS_IMETHOD - UnwrapJavaWrapper(JNIEnv* jenv, jobject jobj, jint* obj); - -private: - nsIJVMManager* mManager; - nsIThreadManager* mThreadManager; - MRJSession* mSession; - MRJConsole* mConsole; - nsPluginThread *mPluginThreadID; - Boolean mIsEnabled; - - // support for SupportsMixin. - static const InterfaceInfo sInterfaces[]; - static const UInt32 kInterfaceCount; -}; - -class MRJPluginInstance : public nsIPluginInstance, public nsIJVMPluginInstance, - public nsIEventHandler, public nsIPluginStreamListener, - private SupportsMixin { -public: - MRJPluginInstance(MRJPlugin* plugin); - virtual ~MRJPluginInstance(); - - // NS_DECL_ISUPPORTS - DECL_SUPPORTS_MIXIN - - // (Corresponds to NPP_HandleEvent.) - NS_IMETHOD - HandleEvent(nsPluginEvent* event, PRBool* handled); - - /** - * Initializes a newly created plugin instance, passing to it the plugin - * instance peer which it should use for all communication back to the browser. - * - * @param peer - the corresponding plugin instance peer - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Initialize(nsIPluginInstancePeer* peer); - - /** - * Returns a reference back to the plugin instance peer. This method is - * used whenever the browser needs to obtain the peer back from a plugin - * instance. The implementation of this method should be sure to increment - * the reference count on the peer by calling AddRef. - * - * @param resultingPeer - the resulting plugin instance peer - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - GetPeer(nsIPluginInstancePeer* *result); - - /** - * Called to instruct the plugin instance to start. This will be called after - * the plugin is first created and initialized, and may be called after the - * plugin is stopped (via the Stop method) if the plugin instance is returned - * to in the browser window's history. - * - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Start(void); - - /** - * Called to instruct the plugin instance to stop, thereby suspending its state. - * This method will be called whenever the browser window goes on to display - * another page and the page containing the plugin goes into the window's history - * list. - * - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Stop(void); - - /** - * Called to instruct the plugin instance to destroy itself. This is called when - * it become no longer possible to return to the plugin instance, either because - * the browser window's history list of pages is being trimmed, or because the - * window containing this page in the history is being closed. - * - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Destroy(void); - - /** - * Called when the window containing the plugin instance changes. - * - * (Corresponds to NPP_SetWindow.) - * - * @param window - the plugin window structure - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - SetWindow(nsPluginWindow* window); - - /** - * Called to tell the plugin that the initial src/data stream is - * ready. Expects the plugin to return a nsIPluginStreamListener. - * - * (Corresponds to NPP_NewStream.) - * - * @param listener - listener the browser will use to give the plugin the data - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - NewStream(nsIPluginStreamListener** listener) - { - *listener = this; - AddRef(); - return NS_OK; - } - - /** - * Called to instruct the plugin instance to print itself to a printer. - * - * (Corresponds to NPP_Print.) - * - * @param platformPrint - platform-specific printing information - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Print(nsPluginPrint* platformPrint); - - /** - * Returns the value of a variable associated with the plugin instance. - * - * @param variable - the plugin instance variable to get - * @param value - the address of where to store the resulting value - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - GetValue(nsPluginInstanceVariable variable, void *value); - - // nsIJVMPluginInstance methods. - - // This method is called when LiveConnect wants to find the Java object - // associated with this plugin instance, e.g. the Applet or JavaBean object. - NS_IMETHOD - GetJavaObject(jobject *result); - - NS_IMETHOD - GetText(const char* *result) - { - *result = NULL; - return NS_OK; - } - - // nsIPluginStreamListener implementation. - - /** - * Notify the observer that the URL has started to load. This method is - * called only once, at the beginning of a URL load.

- * - * @return The return value is currently ignored. In the future it may be - * used to cancel the URL load.. - */ - NS_IMETHOD - OnStartBinding(nsIPluginStreamInfo* pluginInfo) - { - return NS_OK; - } - - /** - * Notify the client that data is available in the input stream. This - * method is called whenver data is written into the input stream by the - * networking library...

- * - * @param aIStream The input stream containing the data. This stream can - * be either a blocking or non-blocking stream. - * @param length The amount of data that was just pushed into the stream. - * @return The return value is currently ignored. - */ - NS_IMETHOD - OnDataAvailable(nsIPluginStreamInfo* pluginInfo, nsIInputStream* input, PRUint32 length); - - NS_IMETHOD - OnFileAvailable(nsIPluginStreamInfo* pluginInfo, const char* fileName) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * Notify the observer that the URL has finished loading. This method is - * called once when the networking library has finished processing the - * URL transaction initiatied via the nsINetService::Open(...) call.

- * - * This method is called regardless of whether the URL loaded successfully.

- * - * @param status Status code for the URL load. - * @param msg A text string describing the error. - * @return The return value is currently ignored. - */ - NS_IMETHOD - OnStopBinding(nsIPluginStreamInfo* pluginInfo, nsresult status) - { - return NS_OK; - } - - /** - * What is this method supposed to do? - */ - NS_IMETHOD - GetStreamType(nsPluginStreamType *result) - { - *result = nsPluginStreamType_Normal; - return NS_OK; - } - - // Accessing the list of instances. - static MRJPluginInstance* getInstances(void); - MRJPluginInstance* getNextInstance(void); - - MRJContext* getContext(void); - MRJSession* getSession(void); - -private: - void pushInstance(void); - void popInstance(void); - void inspectInstance(Boolean isUpdateEvt); - -private: - nsIPluginInstancePeer* mPeer; - nsIWindowlessPluginInstancePeer* mWindowlessPeer; - MRJPlugin* mPlugin; - MRJSession* mSession; - MRJContext* mContext; - jobject mApplet; - nsPluginWindow* mPluginWindow; - - // maintain a list of instances. - MRJPluginInstance* mNext; - - // support for SupportsMixin. - static const InterfaceInfo sInterfaces[]; - static const UInt32 kInterfaceCount; -}; diff --git a/plugin/oji/MRJ/plugin/Source/MRJPlugin.java b/plugin/oji/MRJ/plugin/Source/MRJPlugin.java deleted file mode 100644 index 32da35a48293..000000000000 --- a/plugin/oji/MRJ/plugin/Source/MRJPlugin.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - MRJPlugin.java - */ - -import netscape.plugin.Plugin; - -class MRJPlugin extends Plugin { - MRJPlugin() {} - - public native Object getField(String name, String signature); - public native void setField(String name, String signature, Object value); - public native Object callMethod(String name, String signature, Object[] args); -} diff --git a/plugin/oji/MRJ/plugin/Source/MRJPlugin_4.x_config.h b/plugin/oji/MRJ/plugin/Source/MRJPlugin_4.x_config.h deleted file mode 100644 index f78cf94f179b..000000000000 --- a/plugin/oji/MRJ/plugin/Source/MRJPlugin_4.x_config.h +++ /dev/null @@ -1,48 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - MRJPlugin_4.x_config.h - - Global configuration defines used by the MRJ plugin. - - by Patrick C. Beard. - */ - -#include "MacHeaders.h" - -#define MRJPLUGIN_4X 1 - diff --git a/plugin/oji/MRJ/plugin/Source/MRJPlugin_GC_config.h b/plugin/oji/MRJ/plugin/Source/MRJPlugin_GC_config.h deleted file mode 100644 index 011c4fdeefcb..000000000000 --- a/plugin/oji/MRJ/plugin/Source/MRJPlugin_GC_config.h +++ /dev/null @@ -1,47 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - MRJPlugin_GC_config.h - - Global configuration defines used by the MRJ plugin. - - by Patrick C. Beard. - */ - -#include "MacHeaders.h" - -#define MRJPLUGIN_GC 1 diff --git a/plugin/oji/MRJ/plugin/Source/MRJPlugin_config.h b/plugin/oji/MRJ/plugin/Source/MRJPlugin_config.h deleted file mode 100644 index 6e344532c743..000000000000 --- a/plugin/oji/MRJ/plugin/Source/MRJPlugin_config.h +++ /dev/null @@ -1,47 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - MRJPlugin_config.h - - Global configuration defines used by the MRJ plugin. - - by Patrick C. Beard. - */ - -#include "MacHeaders.h" - -/* #define NEW_PLUGIN_STREAM_API */ diff --git a/plugin/oji/MRJ/plugin/Source/MRJSecurityContext.h b/plugin/oji/MRJ/plugin/Source/MRJSecurityContext.h deleted file mode 100644 index 3c13d3b168d4..000000000000 --- a/plugin/oji/MRJ/plugin/Source/MRJSecurityContext.h +++ /dev/null @@ -1,59 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#pragma once - -#include "nsISecurityContext.h" - -class nsILiveconnect; - -class MRJSecurityContext : public nsISecurityContext { -public: - MRJSecurityContext(const char* location); - ~MRJSecurityContext(); - - NS_DECL_ISUPPORTS - - NS_IMETHOD Implies(const char* target, const char* action, PRBool *bAllowedAccess); - NS_IMETHOD GetOrigin(char* buf, int len); - NS_IMETHOD GetCertificateID(char* buf, int len); - - nsILiveconnect* getConnection() { return mConnection; } - -private: - char* mLocation; - nsILiveconnect* mConnection; -}; diff --git a/plugin/oji/MRJ/plugin/Source/MRJSession.cpp b/plugin/oji/MRJ/plugin/Source/MRJSession.cpp deleted file mode 100644 index 3ecfd47e27ca..000000000000 --- a/plugin/oji/MRJ/plugin/Source/MRJSession.cpp +++ /dev/null @@ -1,541 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - MRJSession.cpp - - Encapsulates a session with the MacOS Runtime for Java. - - by Patrick C. Beard. - */ - -#include "MRJSession.h" -#include "MRJPlugin.h" -#include "MRJContext.h" -#include "MRJConsole.h" -#include "MRJMonitor.h" -#include "MRJNetworking.h" - -#include -#include -#include -#include -#include -#include -#include - -#if (UNIVERSAL_INTERFACES_VERSION >= 0x0330) -#include -#endif - -extern MRJConsole* theConsole; -extern short thePluginRefnum; - -static Str255 consoleOutFilename = "\pMRJPluginAppletOutput"; -static bool fileCreated = false; - -static SInt32 java_stdin(JMSessionRef session, void *buffer, SInt32 maxBufferLength) -{ - return -1; -} - -static Boolean java_exit(JMSessionRef session, SInt32 status) -{ - return false; /* not allowed in a plugin. */ -} - -static void getItemText(DialogPtr dialog, DialogItemIndex index, ResType textTag, char str[256]) -{ - ControlHandle control; - if (::GetDialogItemAsControl(dialog, index, &control) == noErr) { - Size textSize; - ::GetControlDataSize(control, kControlNoPart, textTag, &textSize); - if (textSize > 255) textSize = 255; - ::GetControlData(control, kControlNoPart, textTag, textSize, (Ptr)str, &textSize); - str[textSize] = '\0'; - } -} - -static void miniEgg () { - -#if 0 - - long count = 0; - OSErr myErr; - short myVRef; - long myDirID; - FSSpec mySpec; - short refNum; - Str255 holder; - - myErr = FindFolder(kOnSystemDisk, kPreferencesFolderType, kDontCreateFolder, &myVRef, &myDirID); - - if (myErr == noErr) { - - myErr = FSMakeFSSpec(myVRef, myDirID, "\pFileName", &mySpec); - - if ((myErr != noErr) && (myErr != fnfErr)) { - return; - } - - myErr = FSpCreate(&mySpec, 'ttxt', 'TEXT', smSystemScript); - - // if it exists just exit. - if (myErr != noErr) { - return; - } - - //we care if this errs, but not enough to impede mozilla running. - myErr = FSpOpenDF(&mySpec, fsWrPerm, &refNum); - - if (myErr != noErr) { - return; - } - - sprintf((char *)holder, "egg line1\r"); - count = strlen((char *)holder); - myErr = FSWrite(refNum, &count, holder); - - sprintf((char *)holder, "egg line2\r"); - count = strlen((char *)holder); - myErr = FSWrite(refNum, &count, holder); - - sprintf((char *)holder, "egg line3\r"); - count = strlen((char *)holder); - myErr = FSWrite(refNum, &count, holder); - - // ... - - FlushVol("\p", refNum); - myErr = FSClose(refNum); - } - -#endif - -} - -static void debug_out(const void *label, const void *message, UInt32 messageLengthInBytes) -{ - long count = 0; - OSErr myErr; - short myVRef; - long myDirID; - FSSpec mySpec; - short refNum; - Str255 holder; - - myErr = Gestalt(gestaltFindFolderAttr, &count); - - if ((myErr != noErr) || (! (count & (1 << gestaltFindFolderPresent)))) { - return; - } - - myErr = FindFolder(kOnSystemDisk, kPreferencesFolderType, kDontCreateFolder, &myVRef, &myDirID); - - if (myErr == noErr) { - - myErr = FSMakeFSSpec(myVRef, myDirID, consoleOutFilename, &mySpec); - - if ((myErr != noErr) && (myErr != fnfErr)) { - return; - } - - //will err if file exists, we don't care. - myErr = FSpCreate(&mySpec, 'ttxt', 'TEXT', smSystemScript); - - //we care if this errs, but not enough to impede mozilla running. - myErr = FSpOpenDF(&mySpec, fsWrPerm, &refNum); - - if (myErr != noErr) { - return; - } - - if (! fileCreated) { - //write over - miniEgg(); - myErr = SetEOF(refNum, 0); - - fileCreated = true; - sprintf((char *)holder, "MRJ Console Output.\rMRJ Plugin Version: %s\r--------------------\r", MRJPlugin::PLUGIN_VERSION); - - count = strlen((char *)holder); - myErr = FSWrite(refNum, &count, holder); - - } else { - //append - myErr = SetFPos(refNum, fsFromLEOF, 0); - } - - count = strlen((char *)label); - myErr = FSWrite(refNum, &count, label); - - count = messageLengthInBytes; - myErr = FSWrite(refNum, &count, message); - - count = 1; - myErr = FSWrite(refNum, &count, "\r"); - - FlushVol("\p", refNum); - myErr = FSClose(refNum); - } - - -// Str255 pmsg; -//if (myErr != noErr) { -//Str255 bla; -//sprintf((char *)bla, "FSpOpenDF error: %d", myErr); -//pmsg[0] = strlen((char *)bla); -//::BlockMoveData(bla, &pmsg[1], pmsg[0]); -//::DebugStr(pmsg); -//} - -} - -static void java_stdout(JMSessionRef session, const void *message, SInt32 messageLengthInBytes) -{ - if (theConsole != NULL) { - theConsole->write(message, messageLengthInBytes); - } else { - debug_out("[System.out] ", message, messageLengthInBytes); - } -} - -static void java_stderr(JMSessionRef session, const void *message, SInt32 messageLengthInBytes) -{ - if (theConsole != NULL) { - theConsole->write(message, messageLengthInBytes); - } else { - debug_out("[System.err] ", message, messageLengthInBytes); - } -} - -static ControlHandle getItemControl(DialogPtr dialog, DialogItemIndex index) -{ - ControlHandle control; - if (::GetDialogItemAsControl(dialog, index, &control) == noErr) - return control; - else - return NULL; -} - -enum { - kUserNameIndex = 3, - kPasswordIndex, - kAuthenticationDialog = 128 -}; - -static Boolean java_authenticate(JMSessionRef session, const char *url, const char *realm, char userName[255], char password[255]) -{ - Boolean result = false; - if (thePluginRefnum != -1) { - // ensure resources come from the plugin (yuck!). - short oldRefnum = ::CurResFile(); - ::UseResFile(thePluginRefnum); - - DialogRecord storage; - DialogPtr dialog = ::GetNewDialog(kAuthenticationDialog, &storage, WindowPtr(-1)); - if (dialog != NULL) { - // set up default buttons. - ::SetDialogDefaultItem(dialog, kStdOkItemIndex); - ::SetDialogCancelItem(dialog, kStdCancelItemIndex); - ::SetDialogTracksCursor(dialog, true); - - // set up default keyboard focus. - ControlHandle userNameControl = getItemControl(dialog, kUserNameIndex); - if (userNameControl != NULL) - ::SetKeyboardFocus(dialog, userNameControl, kControlFocusNextPart); - - ::ShowWindow(dialog); - - DialogItemIndex itemHit = 0; - do { - ::ModalDialog(ModalFilterUPP(NULL), &itemHit); - } while (itemHit != 1 && itemHit != 2); - - if (itemHit == 1) { - getItemText(dialog, kUserNameIndex, kControlEditTextTextTag, userName); - getItemText(dialog, kPasswordIndex, kControlEditTextPasswordTag, password); - result = true; - } - - ::CloseDialog(dialog); - ::UseResFile(oldRefnum); - } - } - return result; -} - -static void java_lowmem(JMSessionRef session) -{ - /* can ask Netscape to purge some memory. */ - // NPN_MemFlush(512 * 1024); -} - -MRJSession::MRJSession() - : mSession(NULL), mStatus(noErr), mMainEnv(NULL), mFirst(NULL), mLast(NULL), mMessageMonitor(NULL), mLockCount(0) -{ - // Make sure JManager exists. - if (&::JMGetVersion != NULL && ::JMGetVersion() >= kJMVersion) { - static JMSessionCallbacks callbacks = { - kJMVersion, /* should be set to kJMVersion */ - &java_stdout, /* JM will route "stdout" to this function. */ - &java_stderr, /* JM will route "stderr" to this function. */ - &java_stdin, /* read from console - can be nil for default behavior (no console IO) */ - &java_exit, /* handle System.exit(int) requests */ - &java_authenticate, /* present basic authentication dialog */ - &java_lowmem /* Low Memory notification Proc */ - }; - - JMTextRef nameRef = NULL; - JMTextRef valueRef = NULL; - OSStatus status = noErr; - - mStatus = ::JMOpenSession(&mSession, eJManager2Defaults, eCheckRemoteCode, - &callbacks, kTextEncodingMacRoman, NULL); - - // capture the main environment, so it can be distinguished from true Java threads. - if (mStatus == noErr) { - mMainEnv = ::JMGetCurrentEnv(mSession); - - // create a monitor for the message queue to unblock Java threads. - mMessageMonitor = new MRJMonitor(this); - -#ifdef MRJPLUGIN_4X - // hook up MRJ networking layer, to permit SSL, etc. - ::OpenMRJNetworking(this); -#endif - } - } else { - mStatus = kJMVersionError; - } -} - -MRJSession::~MRJSession() -{ -#ifdef MRJPLUGIN_4X - // is this perhaps too late? - ::CloseMRJNetworking(this); -#endif - - if (mMessageMonitor != NULL) { - mMessageMonitor->notifyAll(); - delete mMessageMonitor; - } - - if (mSession != NULL) { - mStatus = ::JMCloseSession(mSession); - mSession = NULL; - } -} - -JMSessionRef MRJSession::getSessionRef() -{ - return mSession; -} - -JNIEnv* MRJSession::getCurrentEnv() -{ - return ::JMGetCurrentEnv(mSession); -} - -JNIEnv* MRJSession::getMainEnv() -{ - return mMainEnv; -} - -JavaVM* MRJSession::getJavaVM() -{ - JNIEnv* env = ::JMGetCurrentEnv(mSession); - JavaVM* vm = NULL; - env->GetJavaVM(&vm); - return vm; -} - -Boolean MRJSession::onMainThread() -{ - JNIEnv* env = ::JMGetCurrentEnv(mSession); - return (env == mMainEnv); -} - -inline StringPtr c2p(const char* cstr, StringPtr pstr) -{ - pstr[0] = (unsigned char)strlen(cstr); - ::BlockMoveData(cstr, pstr + 1, pstr[0]); - return pstr; -} - -Boolean MRJSession::addToClassPath(const FSSpec& fileSpec) -{ - return (::JMAddToClassPath(mSession, &fileSpec) == noErr); -} - -Boolean MRJSession::addToClassPath(const char* dirPath) -{ - // Need to convert the path into an FSSpec, and add it MRJ's class path. - Str255 path; - FSSpec pathSpec; - OSStatus status = ::FSMakeFSSpec(0, 0, c2p(dirPath, path), &pathSpec); - if (status == noErr) - status = ::JMAddToClassPath(mSession, &pathSpec); - return (status == noErr); -} - -Boolean MRJSession::addURLToClassPath(const char* fileURL) -{ - OSStatus status = noErr; - // Need to convert the URL into an FSSpec, and add it MRJ's class path. - JMTextRef urlRef = NULL; - status = ::JMNewTextRef(mSession, &urlRef, kTextEncodingMacRoman, fileURL, strlen(fileURL)); - if (status == noErr) { - FSSpec pathSpec; - status = ::JMURLToFSS(mSession, urlRef, &pathSpec); - if (status == noErr) - status = ::JMAddToClassPath(mSession, &pathSpec); - ::JMDisposeTextRef(urlRef); - } - - return (status == noErr); -} - -char* MRJSession::getProperty(const char* propertyName) -{ - char* result = NULL; - OSStatus status = noErr; - JMTextRef nameRef = NULL, valueRef = NULL; - status = ::JMNewTextRef(mSession, &nameRef, kTextEncodingMacRoman, propertyName, strlen(propertyName)); - if (status == noErr) { - status = ::JMGetSessionProperty(mSession, nameRef, &valueRef); - ::JMDisposeTextRef(nameRef); - if (status == noErr && valueRef != NULL) { - UInt32 valueLength = 0; - status = ::JMGetTextLengthInBytes(valueRef, kTextEncodingMacRoman, &valueLength); - if (status == noErr) { - result = new char[valueLength + 1]; - if (result != NULL) { - UInt32 actualLength; - status = ::JMGetTextBytes(valueRef, kTextEncodingMacRoman, result, valueLength, &actualLength); - result[valueLength] = '\0'; - } - ::JMDisposeTextRef(valueRef); - } - } - } - return result; -} - -void MRJSession::setStatus(OSStatus status) -{ - mStatus = status; -} - -OSStatus MRJSession::getStatus() -{ - return mStatus; -} - -void MRJSession::idle(UInt32 milliseconds) -{ - // Each call to idle processes a single message. - dispatchMessage(); - - // Guard against entering the VM multiple times. - if (mLockCount == 0) { - lock(); - mStatus = ::JMIdle(mSession, milliseconds); - unlock(); - } -#if 0 - else { - // sleep the current thread. - JNIEnv* env = getCurrentEnv(); - jclass threadClass = env->FindClass("java/lang/Thread"); - if (threadClass != NULL) { - jmethodID sleepMethod = env->GetStaticMethodID(threadClass, "sleep", "(J)V"); - env->CallStaticVoidMethod(threadClass, sleepMethod, jlong(milliseconds)); - env->DeleteLocalRef(threadClass); - } - } -#endif -} - -void MRJSession::sendMessage(NativeMessage* message, Boolean async) -{ - // can't block the main env, otherwise messages will never be processed! - if (onMainThread()) { - message->execute(); - } else { - postMessage(message); - if (!async) - mMessageMonitor->wait(); - } -} - -/** - * Put a message on the queue. - */ -void MRJSession::postMessage(NativeMessage* message) -{ - if (mFirst == NULL) { - mFirst = mLast = message; - } else { - mLast->setNext(message); - mLast = message; - } - message->setNext(NULL); -} - -void MRJSession::dispatchMessage() -{ - if (mFirst != NULL) { - NativeMessage* message = mFirst; - mFirst = message->getNext(); - if (mFirst == NULL) mLast = NULL; - - message->setNext(NULL); - message->execute(); - mMessageMonitor->notify(); - } -} - -void MRJSession::lock() -{ - ++mLockCount; -} - -void MRJSession::unlock() -{ - --mLockCount; -} diff --git a/plugin/oji/MRJ/plugin/Source/MRJSession.h b/plugin/oji/MRJ/plugin/Source/MRJSession.h deleted file mode 100644 index be713457eafd..000000000000 --- a/plugin/oji/MRJ/plugin/Source/MRJSession.h +++ /dev/null @@ -1,120 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - MRJSession.h - - Encapsulates a session with the MacOS Runtime for Java. - - by Patrick C. Beard. - */ - -#pragma once - -#ifndef CALL_NOT_IN_CARBON - #define CALL_NOT_IN_CARBON 1 -#endif - -#include "jni.h" -#include "JManager.h" - -class NativeMessage { -public: - NativeMessage() : mNext(NULL) {} - - virtual void execute() = 0; - - void setNext(NativeMessage* next) { mNext = next; } - NativeMessage* getNext() { return mNext; } - -private: - NativeMessage* mNext; -}; - -// FIXME: need an interface for setting security options, etc. - -class MRJContext; -class Monitor; - -class MRJSession { -public: - MRJSession(); - virtual ~MRJSession(); - - JMSessionRef getSessionRef(); - - JNIEnv* getCurrentEnv(); - JNIEnv* getMainEnv(); - JavaVM* getJavaVM(); - - Boolean onMainThread(); - - Boolean addToClassPath(const FSSpec& fileSpec); - Boolean addToClassPath(const char* dirPath); - Boolean addURLToClassPath(const char* fileURL); - - char* getProperty(const char* propertyName); - - void setStatus(OSStatus status); - OSStatus getStatus(); - - void idle(UInt32 milliseconds = kDefaultJMTime); - - void sendMessage(NativeMessage* message, Boolean async = false); - - /** - * Used to prevent reentering the VM. - */ - void lock(); - void unlock(); - -private: - void postMessage(NativeMessage* message); - void dispatchMessage(); - -private: - JMSessionRef mSession; - OSStatus mStatus; - - JNIEnv* mMainEnv; - - // Message queue. - NativeMessage* mFirst; - NativeMessage* mLast; - Monitor* mMessageMonitor; - - UInt32 mLockCount; -}; diff --git a/plugin/oji/MRJ/plugin/Source/Monitor.h b/plugin/oji/MRJ/plugin/Source/Monitor.h deleted file mode 100644 index 627c9f3d9e68..000000000000 --- a/plugin/oji/MRJ/plugin/Source/Monitor.h +++ /dev/null @@ -1,58 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - Monitor.h - - Abstract class representing monitors. - - by Patrick C. Beard. - */ - -#pragma once - -class Monitor { -public: - virtual ~Monitor() {} - - virtual void enter() = 0; - virtual void exit() = 0; - - virtual void wait() = 0; - virtual void wait(long long millis) = 0; - virtual void notify() = 0; - virtual void notifyAll() = 0; -}; diff --git a/plugin/oji/MRJ/plugin/Source/NativeMonitor.cpp b/plugin/oji/MRJ/plugin/Source/NativeMonitor.cpp deleted file mode 100644 index 44513d785954..000000000000 --- a/plugin/oji/MRJ/plugin/Source/NativeMonitor.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - NativeMonitor.cpp - - Provides a C++ interface to native monitors. - - by Patrick C. Beard. - */ - -#include "NativeMonitor.h" -#include "MRJSession.h" -#include "nsIThreadManager.h" - -NativeMonitor::NativeMonitor(MRJSession* session, nsIThreadManager* manager, void* address) - : mSession(session), mManager(manager), mAddress(address) -{ - if (address == NULL) - mAddress = this; -} - -NativeMonitor::~NativeMonitor() {} - -void NativeMonitor::enter() -{ - mManager->EnterMonitor(mAddress); -} - -void NativeMonitor::exit() -{ - mManager->ExitMonitor(mAddress); -} - -void NativeMonitor::wait() -{ - // this is weird hackery, but we don't want to let the VM be reentered while we wait on a native monitor. - Boolean inJavaThread = (mSession->getMainEnv() != mSession->getCurrentEnv()); - if (inJavaThread) - mSession->lock(); - - if (mManager->EnterMonitor(mAddress) == NS_OK) { - mManager->Wait(mAddress); - mManager->ExitMonitor(mAddress); - } - - if (inJavaThread) - mSession->unlock(); -} - -void NativeMonitor::wait(long long millis) -{ - if (mManager->EnterMonitor(mAddress) == NS_OK) { - mManager->Wait(mAddress, PRUint32(millis)); - mManager->ExitMonitor(mAddress); - } -} - -void NativeMonitor::notify() -{ - if (mManager->EnterMonitor(mAddress) == NS_OK) { - mManager->Notify(mAddress); - mManager->ExitMonitor(mAddress); - } -} - -void NativeMonitor::notifyAll() -{ - if (mManager->EnterMonitor(mAddress) == NS_OK) { - mManager->NotifyAll(mAddress); - mManager->ExitMonitor(mAddress); - } -} diff --git a/plugin/oji/MRJ/plugin/Source/NativeMonitor.h b/plugin/oji/MRJ/plugin/Source/NativeMonitor.h deleted file mode 100644 index b06dab5afd8e..000000000000 --- a/plugin/oji/MRJ/plugin/Source/NativeMonitor.h +++ /dev/null @@ -1,67 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - NativeMonitor.h - - Provides a C++ interface to native monitors. - - by Patrick C. Beard. - */ - -#include "Monitor.h" - -class MRJSession; -class nsIThreadManager; - -class NativeMonitor : public Monitor { -public: - NativeMonitor(MRJSession* session, nsIThreadManager* manager, void* address = NULL); - virtual ~NativeMonitor(); - - virtual void enter(); - virtual void exit(); - - virtual void wait(); - virtual void wait(long long millis); - virtual void notify(); - virtual void notifyAll(); - -private: - MRJSession* mSession; - nsIThreadManager* mManager; - void* mAddress; -}; diff --git a/plugin/oji/MRJ/plugin/Source/PluginNew.cpp b/plugin/oji/MRJ/plugin/Source/PluginNew.cpp deleted file mode 100644 index d302e65e87f0..000000000000 --- a/plugin/oji/MRJ/plugin/Source/PluginNew.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - PluginNew.cpp - - new & delete operators for plugins. - - by Patrick C. Beard. - */ - -#include - -#include "jni.h" -#include "nsIMemory.h" - -// Warning: this forces all C++ allocation to go through Navigator's memory allocation -// Routines. As such, static constructors that use operator new may not work. This can -// be fixed if we delay static construction (see the call to __InitCode__() in npmac.cpp). - -extern nsIMemory* theMemoryAllocator; - -void* operator new(size_t size) -{ - if (theMemoryAllocator != NULL) - return theMemoryAllocator->Alloc(size); - return NULL; -} - -void operator delete(void* ptr) -{ - if (ptr != NULL && theMemoryAllocator != NULL) - theMemoryAllocator->Free(ptr); -} diff --git a/plugin/oji/MRJ/plugin/Source/PrintingPort.java b/plugin/oji/MRJ/plugin/Source/PrintingPort.java deleted file mode 100644 index 2766048d6955..000000000000 --- a/plugin/oji/MRJ/plugin/Source/PrintingPort.java +++ /dev/null @@ -1,164 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - PrintingPort.java - - Wraps a Quickdraw printing port and provides a way to image on it - with a java.awt.Graphics object. - - by Patrick C. Beard. - */ - -package com.apple.mrj.internal.awt; - -import com.apple.mrj.macos.generated.RectStruct; -import com.apple.mrj.macos.generated.QuickdrawFunctions; -import java.awt.*; - -public class PrintingPort implements GraphicsHost { - private int mPrintingPort; - private int mOriginX; - private int mOriginY; - private PortManager mPortManager; - private QDPipeline mPipeline; - private Rectangle mClipping; - - public PrintingPort(int printingPort, int originX, int originY) { - mPrintingPort = printingPort; - mOriginX = originX; - mOriginY = originY; - mPortManager = new PortManager(printingPort, 0, 0, PortManager.kPrinting, 0); - mPipeline = new QDPipeline(); - mPortManager.setPipeline(mPipeline); - } - - public void dispose() { - // dispose of port manager flushes the pipeline. - if (mPortManager != null) { - mPortManager.dispose(); - mPortManager = null; - } - if (mPipeline != null) { - mPipeline.dispose(); - mPipeline = null; - } - } - - private static final short MAXSHORT = 32767, MINSHORT = -32768; - - static short pinToShort(int value) { - if (value > MAXSHORT) - return MAXSHORT; - else if (value < MINSHORT) - return MINSHORT; - return (short) value; - } - - final class PrintingGraphics extends QDGraphics { - /** Creates a new PrintingGraphics. You must call initialize on it next. */ - public PrintingGraphics() { - super(); - } - - public synchronized Graphics create() { - if( !internalMarkHostInUse ( ) ) - throw new AWTError("Using invalid Graphics object"); - try { - return (new PrintingGraphics()).initialize(this,fXoff,fYoff,fClip); - } finally { - internalDoneUsingHost ( ); - } - } - - public synchronized Graphics create(int x, int y, int width, int height) { - if( !internalMarkHostInUse() ) - throw new AWTError("Using invalid Graphics object"); - try { - VToolkit.intersect(sRectangle, fClip, fXoff+x,fYoff+y,width,height); - return (new PrintingGraphics()).initialize(this,fXoff+x,fYoff+y,sRectangle); - } finally { - internalDoneUsingHost ( ); - } - } - - /** - * Override QDGraphics.restore(), to reset origin and clipping during drawing. - */ - void restore() { - super.restore(); - - int port = VAWTDirect.FastGetThePort(); - if (port != mPrintingPort) - QuickdrawFunctions.SetPort(mPrintingPort); - - // restore default orgin. - QuickdrawFunctions.SetOrigin((short)0, (short)0); - - // set up correct clipping. - QDRectStruct clipRect = new QDRectStruct(); - clipRect.Set(pinToShort(mClipping.x), pinToShort(mClipping.y), - pinToShort(mClipping.x + mClipping.width), pinToShort(mClipping.y + mClipping.width)); - QuickdrawFunctions.ClipRect(clipRect); - - if (port != mPrintingPort) - QuickdrawFunctions.SetPort(port); - } - } - - /** - * Creates a graphics object that wraps the specified printing port. - * Assumes that the underlying port's coordinate system is already - * set up to have (0, 0) as the upper left corner. - */ - public Graphics getGraphics(Component component) { - mClipping = component.getBounds(); - mClipping.x = mOriginX; mClipping.y = mOriginY; - QDGraphics graphics = new PrintingGraphics(); - graphics.initialize(mPrintingPort, this, mPortManager, - mOriginX, mOriginY, mClipping, component.getForeground(), - component.getFont()); - return graphics; - } - - /** methods to satisfy GraphicsHost interface. */ - public void graphicsCreated(QDGraphics g) throws OutOfMemoryError {} - public void graphicsDisposed(QDGraphics g) {} - public RGBColorValue getBackgroundRGB() { return new RGBColorValue(Color.white); } - public void repaint(RectStruct r) {} - public boolean markInUse() { return (mPortManager != null); } - public void doneUsingIt() {} -} diff --git a/plugin/oji/MRJ/plugin/Source/RunnableMixin.cpp b/plugin/oji/MRJ/plugin/Source/RunnableMixin.cpp deleted file mode 100644 index 55282a014e5e..000000000000 --- a/plugin/oji/MRJ/plugin/Source/RunnableMixin.cpp +++ /dev/null @@ -1,19 +0,0 @@ -/* - RunnableMixin.cpp - - Provides a mixin nsIRunnable implementation. - - by Patrick C. Beard. - */ - -#include "RunnableMixin.h" - -const InterfaceInfo RunnableMixin::sInterfaces[] = { - { NS_IRUNNABLE_IID, INTERFACE_OFFSET(RunnableMixin, nsIRunnable) }, -}; -const UInt32 RunnableMixin::kInterfaceCount = sizeof(sInterfaces) / sizeof(InterfaceInfo); - -RunnableMixin::RunnableMixin() - : SupportsMixin(this, sInterfaces, kInterfaceCount) -{ -} diff --git a/plugin/oji/MRJ/plugin/Source/RunnableMixin.h b/plugin/oji/MRJ/plugin/Source/RunnableMixin.h deleted file mode 100644 index 825dc64450db..000000000000 --- a/plugin/oji/MRJ/plugin/Source/RunnableMixin.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - RunnableMixin.h - - Provides a mixin nsIRunnable implementation. - - by Patrick C. Beard. - */ - -#pragma once - -#include "nsIThreadManager.h" -#include "SupportsMixin.h" - -class RunnableMixin : public nsIRunnable, private SupportsMixin { -public: - RunnableMixin(); - - DECL_SUPPORTS_MIXIN - - NS_IMETHOD Run() = 0; - -private: - // support for SupportsMixin. - static const InterfaceInfo sInterfaces[]; - static const UInt32 kInterfaceCount; -}; diff --git a/plugin/oji/MRJ/plugin/Source/StringUtils.cpp b/plugin/oji/MRJ/plugin/Source/StringUtils.cpp deleted file mode 100644 index 660ad26a2302..000000000000 --- a/plugin/oji/MRJ/plugin/Source/StringUtils.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - StringUtils.cpp - */ - -#include "StringUtils.h" - -#include - -inline unsigned char toupper(unsigned char c) -{ - return (c >= 'a' && c <= 'z') ? (c - ('a' - 'A')) : c; -} - -int strcasecmp(const char * str1, const char * str2) -{ -#if !__POWERPC__ - - const unsigned char * p1 = (unsigned char *) str1; - const unsigned char * p2 = (unsigned char *) str2; - unsigned char c1, c2; - - while (toupper(c1 = *p1++) == toupper(c2 = *p2++)) - if (!c1) - return(0); - -#else - - const unsigned char * p1 = (unsigned char *) str1 - 1; - const unsigned char * p2 = (unsigned char *) str2 - 1; - unsigned long c1, c2; - - while (toupper(c1 = *++p1) == toupper(c2 = *++p2)) - if (!c1) - return(0); - -#endif - - return(toupper(c1) - toupper(c2)); -} - -char* strdup(const char* str) -{ - if (str != NULL) { - char* result = new char[::strlen(str) + 1]; - if (result != NULL) - ::strcpy(result, str); - return result; - } - return NULL; -} diff --git a/plugin/oji/MRJ/plugin/Source/StringUtils.h b/plugin/oji/MRJ/plugin/Source/StringUtils.h deleted file mode 100644 index 226f081a7f16..000000000000 --- a/plugin/oji/MRJ/plugin/Source/StringUtils.h +++ /dev/null @@ -1,53 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - StringUtils.h - - String utilities. - */ - -#pragma once - -/** - * Case-insensitive string comparison. - */ -int strcasecmp(const char * str1, const char * str2); - -/** - * Duplicates a C string, returns NULL if failed, or passed NULL. - */ -char* strdup(const char* str); diff --git a/plugin/oji/MRJ/plugin/Source/SupportsMixin.cpp b/plugin/oji/MRJ/plugin/Source/SupportsMixin.cpp deleted file mode 100644 index f4482871bce2..000000000000 --- a/plugin/oji/MRJ/plugin/Source/SupportsMixin.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - SupportsMixin.cpp - - Experimental way to implement nsISupports interface. - - by Patrick C. Beard. - */ - -#include "SupportsMixin.h" -#include "nsAgg.h" - -// Standard nsISupport method implementations. - -#ifdef SUPPORT_AGGREGATION - -SupportsMixin::SupportsMixin(void* instance, const InterfaceInfo interfaces[], UInt32 interfaceCount, nsISupports* outer) - : mInstance(instance), mRefCount(0), mInterfaces(interfaces), mInterfaceCount(interfaceCount), mOuter(outer) -{ - if (mOuter != NULL) - mInner = new Inner(this); -} - -SupportsMixin::~SupportsMixin() -{ - if (mRefCount > 0) { - ::DebugStr("\pmRefCount > 0!"); - } - if (mInner != NULL) - delete mInner; -} - -/** - * The uppercase versions QueryInterface, AddRef, and Release are meant to be called by subclass - * implementations. They take aggregation into account. - */ -nsresult SupportsMixin::OuterQueryInterface(const nsIID& aIID, void** aInstancePtr) -{ - // first, see if we really implement this interface. - nsresult result = queryInterface(aIID, aInstancePtr); - // if not, then delegate to the outer object, if any. - if (result != NS_OK && mOuter != NULL) - return mOuter->QueryInterface(aIID, aInstancePtr); - else - return result; -} - -nsrefcnt SupportsMixin::OuterAddRef() -{ - nsrefcnt result = addRef(); - if (mOuter != NULL) - return mOuter->AddRef(); - return result; -} - -nsrefcnt SupportsMixin::OuterRelease() -{ - if (mOuter != NULL) { - nsIOuter* outer = NULL; - nsISupports* supports = mOuter; - static NS_DEFINE_IID(kIOuterIID, NS_IOUTER_IID); - if (mRefCount == 1 && supports->QueryInterface(kIOuterIID, &outer) == NS_OK) { - outer->ReleaseInner(mInner); - outer->Release(); - } else - release(); - return supports->Release(); - } else { - return release(); - } -} - -#else /* !SUPPORT_AGGREGATION */ - -SupportsMixin::SupportsMixin(void* instance, const InterfaceInfo interfaces[], UInt32 interfaceCount, nsISupports* /* outer */) - : mInstance(instance), mRefCount(0), mInterfaces(interfaces), mInterfaceCount(interfaceCount) -{ -} - -SupportsMixin::~SupportsMixin() -{ - if (mRefCount > 0) { - ::DebugStr("\pmRefCount > 0!"); - } -} - -#endif /* !SUPPORT_AGGREGATION */ - -/** - * The lowercase implementations of queryInterface, addRef, and release all act locally - * on the current object, regardless of aggregation. They are meant to be called by - * aggregating outer objects. - */ -NS_IMETHODIMP SupportsMixin::queryInterface(const nsIID& aIID, void** aInstancePtr) -{ - if (aInstancePtr == NULL) { - return NS_ERROR_NULL_POINTER; - } - // first check to see if it's one of our known interfaces. - // need to solve the non-left inheritance graph case. - const InterfaceInfo* interfaces = mInterfaces; - UInt32 count = mInterfaceCount; - for (UInt32 i = 0; i < count; i++) { - if (aIID.Equals(interfaces[i].mIID)) { - *aInstancePtr = (void*) (UInt32(mInstance) + interfaces[i].mOffset); - addRef(); - return NS_OK; - } - } - // finally, does the interface match nsISupports? - static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - if (aIID.Equals(kISupportsIID)) { - *aInstancePtr = (void*) mInstance; - addRef(); - return NS_OK; - } - return NS_NOINTERFACE; -} - -NS_IMETHODIMP_(nsrefcnt) SupportsMixin::addRef() -{ - return ++mRefCount; -} - -NS_IMETHODIMP_(nsrefcnt) SupportsMixin::release() -{ - if (--mRefCount == 0) { - delete this; - return 0; - } - return mRefCount; -} diff --git a/plugin/oji/MRJ/plugin/Source/SupportsMixin.h b/plugin/oji/MRJ/plugin/Source/SupportsMixin.h deleted file mode 100644 index 6c83d790430d..000000000000 --- a/plugin/oji/MRJ/plugin/Source/SupportsMixin.h +++ /dev/null @@ -1,121 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - SupportsMixin.h - - Experimental way to implement nsISupports interface. - - Uses table-driven approach for fast lookup. - - Aggregation support isn't quite here yet, it requires a helper object that is referenced only by the outer object, - whose QueryInterace, AddRef, and Release act only locally (i.e. they call queryInterface, addRef, and release). - However, if we're not using aggregation (hardly ever are) it seems wasteful to define the helper object. - - by Patrick C. Beard. - */ - -#pragma once - -#include "nsISupports.h" - -// #define SUPPORT_AGGREGATION - -struct InterfaceInfo { - nsID mIID; // the IID of this interface. - UInt32 mOffset; // the offset of this interface. -}; - -class SupportsMixin { -public: - // These act locally on the current object, and are meant to be called by sub-classes. - nsresult queryInterface(const nsIID& aIID, void** aInstancePtr); - nsrefcnt addRef(void); - nsrefcnt release(void); - -protected: - SupportsMixin(void* instance, const InterfaceInfo interfaces[], UInt32 interfaceCount, nsISupports* outer = NULL); - virtual ~SupportsMixin(); - -#ifdef SUPPORT_AGGREGATION - NS_METHOD OuterQueryInterface(REFNSIID aIID, void** aInstancePtr); - NS_METHOD_(nsrefcnt) OuterAddRef(void); - NS_METHOD_(nsrefcnt) OuterRelease(void); -#endif - -private: - void* mInstance; - nsrefcnt mRefCount; - const InterfaceInfo* mInterfaces; - UInt32 mInterfaceCount; - -#ifdef SUPPORT_AGGREGATION - nsISupports* mOuter; - - class Inner : public nsISupports { - public: - NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) { return mSupports->queryInterface(aIID, aInstancePtr); } - NS_IMETHOD_(nsrefcnt) AddRef(void) { return mSupports->addRef(); } - NS_IMETHOD_(nsrefcnt) Release(void) { return mSupports->release(); } - - Inner(SupportsMixin* supports) : mSupports(supports) {} - - private: - SupportsMixin* mSupports; - }; - - Inner* mInner; -#endif -}; - -#ifdef SUPPORT_AGGREGATION - -#define DECL_SUPPORTS_MIXIN \ - NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) { return OuterQueryInterface(aIID, aInstancePtr); } \ - NS_IMETHOD_(nsrefcnt) AddRef(void) { return OuterAddRef(); } \ - NS_IMETHOD_(nsrefcnt) Release(void) { return OuterRelease(); } - -#else - -#define DECL_SUPPORTS_MIXIN \ - NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) { return queryInterface(aIID, aInstancePtr); } \ - NS_IMETHOD_(nsrefcnt) AddRef(void) { return addRef(); } \ - NS_IMETHOD_(nsrefcnt) Release(void) { return release(); } - -#endif - -#define INTERFACE_OFFSET(leafType, interfaceType) \ - UInt32((interfaceType*) ((leafType*)0)) diff --git a/plugin/oji/MRJ/plugin/Source/TopLevelFrame.cpp b/plugin/oji/MRJ/plugin/Source/TopLevelFrame.cpp deleted file mode 100644 index 276fd1ac4c62..000000000000 --- a/plugin/oji/MRJ/plugin/Source/TopLevelFrame.cpp +++ /dev/null @@ -1,304 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - TopLevelFrame.cpp - - An MRJFrame sub-class that manages the behavior of a top-level window - running inside the Communicator. - - by Patrick C. Beard. - */ - -#include -#include - -#include "TopLevelFrame.h" -#include "LocalPort.h" - -#include "nsIPluginManager2.h" -#include "nsIEventHandler.h" - -#if !defined(MRJPLUGIN_4X) -#define USE_ALT_WINDOW_HANDLING -#endif - -#ifdef USE_ALT_WINDOW_HANDLING -#include "AltWindowHandling.h" -#endif - -#include "nsIEventHandler.h" -#include "AltWindowHandling.h" - -extern nsIPluginManager2* thePluginManager2; - -static void UnsetPort(GrafPtr port); -static short getModifiers(); - -TopLevelFrame::TopLevelFrame(nsIEventHandler* handler, JMFrameRef frameRef, JMFrameKind kind, - const Rect* initialBounds, Boolean resizeable) - : MRJFrame(frameRef), - mHandler(handler), mWindow(NULL), mBounds(*initialBounds) -{ - Boolean hasGoAway = true; - SInt16 windowProc = documentProc; - SInt16 resizeHeight = resizeable ? 15 : 0; - - switch (kind) { - case eBorderlessModelessWindowFrame: - hasGoAway = false; - windowProc = plainDBox; - // mBounds.bottom += resizeHeight; - resizeable = false; - break; - case eModelessWindowFrame: - case eModelessDialogFrame: - hasGoAway = true; - windowProc = resizeable ? zoomDocProc : documentProc; - // mBounds.bottom += resizeHeight; - break; - case eModalWindowFrame: - hasGoAway = true; - // We have to allow resizeable modal windows. - windowProc = resizeable ? documentProc : movableDBoxProc; - break; - } - - mWindow = ::NewCWindow(NULL, &mBounds, "\p", false, windowProc, WindowPtr(-1), hasGoAway, long(this)); - if (mWindow != NULL) { - Point zeroPt = { 0, 0 }; - ::JMSetFrameVisibility(frameRef, mWindow, zeroPt, mWindow->clipRgn); - } -} - -TopLevelFrame::~TopLevelFrame() -{ - // make sure the window is hidden (and unregistered with the browser). - showHide(false); - - // make sure this port isn't ever current again. - ::UnsetPort(mWindow); - - if (mWindow != NULL) - ::DisposeWindow(mWindow); -} - -void TopLevelFrame::setSize(const Rect* newSize) -{ - mBounds = *newSize; - - if (mWindow != NULL) { - SInt16 width = newSize->right - newSize->left; - SInt16 height = newSize->bottom - newSize->top; - ::SizeWindow(mWindow, width, height, true); - ::MoveWindow(mWindow, newSize->left, newSize->top, false); - } -} - -void TopLevelFrame::invalRect(const Rect* invalidRect) -{ - if (mWindow != NULL) { - ::InvalRect(invalidRect); - } -} - -void TopLevelFrame::showHide(Boolean visible) -{ - if (mWindow != NULL && visible != IsWindowVisible(mWindow)) { - if (visible) { -#if !defined(USE_ALT_WINDOW_HANDLING) - // Have to notify the browser that this window exists, so that it will receive events. - thePluginManager2->RegisterWindow(mHandler, mWindow); - // the plugin manager takes care of showing the window. - // ::ShowWindow(mWindow); - // ::SelectWindow(mWindow); -#else - AltRegisterWindow(mHandler, mWindow); -#endif - } else { -#if defined(USE_ALT_WINDOW_HANDLING) - AltUnregisterWindow(mHandler, mWindow); -#else - // the plugin manager takes care of hiding the window. - // ::HideWindow(mWindow); - // Let the browser know it doesn't have to send events anymore. - thePluginManager2->UnregisterWindow(mHandler, mWindow); -#endif - activate(false); - } - - // ::ShowHide(mWindow, visible); - } -} - -void TopLevelFrame::setTitle(const StringPtr title) -{ - if (mWindow != NULL) { - ::SetWTitle(mWindow, title); - } -} - -void TopLevelFrame::checkUpdate() -{ -} - -void TopLevelFrame::reorder(ReorderRequest request) -{ - switch (request) { - case eBringToFront: /* bring the window to front */ - ::BringToFront(mWindow); - break; - case eSendToBack: /* send the window to back */ - ::SendBehind(mWindow, NULL); - break; - case eSendBehindFront: /* send the window behind the front window */ - WindowPtr frontWindow = ::FrontWindow(); - if (mWindow == frontWindow) { - ::SendBehind(mWindow, GetNextWindow(mWindow)); - } else { - ::SendBehind(mWindow, frontWindow); - } - break; - } -} - -void TopLevelFrame::setResizeable(Boolean resizeable) -{ - // this might have to recreate the window, no? -} - -static void computeBounds(WindowRef window, Rect* bounds) -{ - LocalPort port(window); - port.Enter(); - - Point position = { 0, 0 }; - ::LocalToGlobal(&position); - - *bounds = window->portRect; - - port.Exit(); - - ::OffsetRect(bounds, position.h, position.v); -} - -void TopLevelFrame::activate(Boolean active) -{ - focusEvent(active); - MRJFrame::activate(active); -} - -void TopLevelFrame::click(const EventRecord* event) -{ - Point where = event->where; - SInt16 modifiers = event->modifiers; - WindowRef hitWindow; - short partCode = ::FindWindow(where, &hitWindow); - switch (partCode) { - case inContent: - ::SelectWindow(mWindow); - MRJFrame::click(event); - break; - case inDrag: - { - Rect bounds = (**GetGrayRgn()).rgnBBox; - DragWindow(mWindow, where, &bounds); - computeBounds(mWindow, &bounds); - ::JMSetFrameSize(mFrameRef, &bounds); - - Point zeroPt = { 0, 0 }; - ::JMSetFrameVisibility(mFrameRef, mWindow, zeroPt, mWindow->clipRgn); - } - break; - case inGrow: - Rect limits = { 30, 30, 5000, 5000 }; - long result = GrowWindow(mWindow, where, &limits); - if (result != 0) { - short width = (result & 0xFFFF); - short height = (result >> 16) & 0xFFFF; - Rect newBounds; - topLeft(newBounds) = topLeft(mBounds); - newBounds.right = newBounds.left + width; - newBounds.bottom = newBounds.top + height; - ::JMSetFrameSize(mFrameRef, &newBounds); - - Point zeroPt = { 0, 0 }; - ::JMSetFrameVisibility(mFrameRef, mWindow, zeroPt, mWindow->clipRgn); - } - break; - case inGoAway: - if (::TrackGoAway(mWindow, where)) - ::JMFrameGoAway(mFrameRef); - break; - case inZoomIn: - case inZoomOut: - if (::TrackBox(mWindow, where, partCode)) { - ZoomWindow(mWindow, partCode, true); - computeBounds(mWindow, &mBounds); - ::JMSetFrameSize(mFrameRef, &mBounds); - } - break; - case inCollapseBox: - break; - } -} - -WindowRef TopLevelFrame::getWindow() -{ - return mWindow; -} - -GrafPtr TopLevelFrame::getPort() -{ - return mWindow; -} - -static void UnsetPort(GrafPtr port) -{ - GrafPtr curPort; - ::GetPort(&curPort); - if (curPort == port) { - ::GetWMgrPort(&port); - ::SetPort(port); - } -} - -static short getModifiers() -{ - EventRecord event; - ::OSEventAvail(0, &event); - return event.modifiers; -} diff --git a/plugin/oji/MRJ/plugin/Source/TopLevelFrame.h b/plugin/oji/MRJ/plugin/Source/TopLevelFrame.h deleted file mode 100644 index 3c26edf908aa..000000000000 --- a/plugin/oji/MRJ/plugin/Source/TopLevelFrame.h +++ /dev/null @@ -1,81 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - TopLevelFrame.h - - An MRJFrame sub-class that manages the behavior of a top-level window - running inside the Communicator. - - by Patrick C. Beard. - */ - -#pragma once - -#include "MRJFrame.h" - -#ifndef __MACWINDOWS__ -#include -#endif - -class nsIEventHandler; - -class TopLevelFrame : public MRJFrame { -public: - TopLevelFrame(nsIEventHandler* handler, JMFrameRef frameRef, JMFrameKind kind, const Rect* initialBounds, Boolean resizeable); - virtual ~TopLevelFrame(); - - virtual void setSize(const Rect* newSize); - virtual void invalRect(const Rect* invalidRect); - virtual void showHide(Boolean visible); - virtual void setTitle(const StringPtr title); - virtual void checkUpdate(); - virtual void reorder(ReorderRequest request); - virtual void setResizeable(Boolean resizeable); - - virtual void activate(Boolean active); - virtual void click(const EventRecord* event); - - WindowRef getWindow(); - -protected: - virtual GrafPtr getPort(); - -private: - nsIEventHandler* mHandler; - WindowRef mWindow; - Rect mBounds; -}; diff --git a/plugin/oji/MRJ/plugin/Source/jGNE.cpp b/plugin/oji/MRJ/plugin/Source/jGNE.cpp deleted file mode 100644 index 4b10b21e702e..000000000000 --- a/plugin/oji/MRJ/plugin/Source/jGNE.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - jGNE.cpp - - Provides a generalized jGNE filtering service. - - by Patrick C. Beard. - */ - -#include "jGNE.h" - -#include -#include -#include -#include - -/** - * A 68K jump vector. - */ -#pragma options align=mac68k - -struct Jump { - unsigned short jmp; - UniversalProcPtr addr; -}; - -#pragma options align=reset - -static void GNEFilter(EventRecord *event, Boolean* result); - -static RoutineDescriptor theGNEFilterDescriptor = BUILD_ROUTINE_DESCRIPTOR(uppGetNextEventFilterProcInfo, GNEFilter); -static Jump* theGNEFilterJump; -static GetNextEventFilterUPP theOldGNEFilterUPP = NULL; -static EventFilterProcPtr theEventFilter = NULL; - -static Str63 theAppName; - -OSStatus InstallEventFilter(EventFilterProcPtr filter) -{ - if (theEventFilter == NULL) { - theEventFilter = filter; - - // record the current application's name. - StringPtr currentAppName = LMGetCurApName(); - ::BlockMoveData(currentAppName, theAppName, 1 + currentAppName[0]); - - // allocate a jump vector in the System heap, so it will be retained after termination. - if (theGNEFilterJump == NULL) { - theGNEFilterJump = (Jump*) NewPtrSys(sizeof(Jump)); - if (theGNEFilterJump == NULL) - return MemError(); - - theGNEFilterJump->jmp = 0x4EF9; - theGNEFilterJump->addr = &theGNEFilterDescriptor; - - // get previous event filter routine. - theOldGNEFilterUPP = LMGetGNEFilter(); - LMSetGNEFilter(GetNextEventFilterUPP(theGNEFilterJump)); - } else { - // our previously allocated Jump is still installed, use it. - theOldGNEFilterUPP = theGNEFilterJump->addr; - theGNEFilterJump->addr = &theGNEFilterDescriptor; - } - - return noErr; - } - return paramErr; -} - -OSStatus RemoveEventFilter() -{ - if (theEventFilter != NULL) { - // It's only truly safe to remove our filter, if nobody else installed one after us. - if (LMGetGNEFilter() == GetNextEventFilterUPP(theGNEFilterJump)) { - // can safely restore the old filter. - LMSetGNEFilter(theOldGNEFilterUPP); - DisposePtr(Ptr(theGNEFilterJump)); - theGNEFilterJump = NULL; - } else { - // modify the jump instruction to point to the previous filter. - theGNEFilterJump->addr = theOldGNEFilterUPP; - } - theOldGNEFilterUPP = NULL; - theEventFilter = NULL; - return noErr; - } - return paramErr; -} - -static void GNEFilter(EventRecord *event, Boolean* result) -{ - // call next filter in chain first. - if (theOldGNEFilterUPP != NULL) - CallGetNextEventFilterProc(theOldGNEFilterUPP, event, result); - - // now, let the filter proc have a crack at the event. - if (*result) { - // only call the filter if called in the current application's context. - /* if (::EqualString(theAppName, LMGetCurApName(), true, true)) */ - { - // prevent recursive calls to the filter. - static Boolean inFilter = false; - if (! inFilter) { - inFilter = true; - Boolean filteredEvent = theEventFilter(event); - if (filteredEvent) { - // consume the event by making it a nullEvent. - event->what = nullEvent; - *result = false; - } - inFilter = false; - } - } - } -} diff --git a/plugin/oji/MRJ/plugin/Source/jGNE.h b/plugin/oji/MRJ/plugin/Source/jGNE.h deleted file mode 100644 index 95ac221171e3..000000000000 --- a/plugin/oji/MRJ/plugin/Source/jGNE.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#pragma once - -/* - jGNE.h - - Provides a generalized jGNE filtering service. - - by Patrick C. Beard. - */ - -#ifndef __EVENTS__ -#include -#endif - -typedef Boolean (*EventFilterProcPtr) (EventRecord* event); - -OSStatus InstallEventFilter(EventFilterProcPtr filter); -OSStatus RemoveEventFilter(); diff --git a/plugin/oji/MRJ/plugin/Source/npmac.cpp b/plugin/oji/MRJ/plugin/Source/npmac.cpp deleted file mode 100644 index 99b94dd6e62a..000000000000 --- a/plugin/oji/MRJ/plugin/Source/npmac.cpp +++ /dev/null @@ -1,708 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -// -// npmac.cpp -// -//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -#include -#include -#include -#include -#include -#include - -#define XP_MAC 1 -#define NDEBUG 1 - -// -// A4Stuff.h contains the definition of EnterCodeResource and -// EnterCodeResource, used for setting up the code resource¹s -// globals for 68K (analagous to the function SetCurrentA5 -// defined by the toolbox). -// -// A4Stuff does not exist as of CW 7. Define them to nothing. -// - -#if defined(__MWERKS__) && (__MWERKS__ >= 0x2400) - #define EnterCodeResource() - #define ExitCodeResource() -#else - #include -#endif - -#include "jri.h" -#include "npapi.h" - -// -// The Mixed Mode procInfos defined in npupp.h assume Think C- -// style calling conventions. These conventions are used by -// Metrowerks with the exception of pointer return types, which -// in Metrowerks 68K are returned in A0, instead of the standard -// D0. Thus, since NPN_MemAlloc and NPN_UserAgent return pointers, -// Mixed Mode will return the values to a 68K plugin in D0, but -// a 68K plugin compiled by Metrowerks will expect the result in -// A0. The following pragma forces Metrowerks to use D0 instead. -// -#ifdef __MWERKS__ -#ifndef powerc -#pragma pointers_in_D0 -#endif -#endif - -#include "npupp.h" - -#ifdef __MWERKS__ -#ifndef powerc -#pragma pointers_in_A0 -#endif -#endif - -// The following fix for static initializers (which fixes a preious -// incompatibility with some parts of PowerPlant, was submitted by -// Jan Ulbrich. -#ifdef __MWERKS__ - #ifdef __cplusplus - extern "C" { - #endif - #ifndef powerc - extern void __InitCode__(void); - #else - extern void __sinit(void); - #define __InitCode__ __sinit - #endif - extern void __destroy_global_chain(void); - #ifdef __cplusplus - } - #endif // __cplusplus -#endif // __MWERKS__ - -// -// Define PLUGIN_TRACE to 1 to have the wrapper functions emit -// DebugStr messages whenever they are called. -// -#define PLUGIN_TRACE 0 - -#if PLUGIN_TRACE -#define PLUGINDEBUGSTR(msg) ::DebugStr(msg) -#else -#define PLUGINDEBUGSTR -#endif - - - - - - -//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -// -// Globals -// -//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -QDGlobals* gQDPtr; // Pointer to Netscape¹s QuickDraw globals -short gResFile; // Refnum of the plugin¹s resource file -NPNetscapeFuncs gNetscapeFuncs; // Function table for procs in Netscape called by plugin - - -//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -// -// Wrapper functions for all calls from the plugin to Netscape. -// 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; - *netscape_major = gNetscapeFuncs.version >> 8; // Major version is in high byte - *netscape_minor = gNetscapeFuncs.version & 0xFF; // Minor version is in low byte -} - -NPError NPN_GetURLNotify(NPP instance, const char* url, const char* window, void* notifyData) -{ - int navMinorVers = gNetscapeFuncs.version & 0xFF; - NPError err; - - if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) - { - err = CallNPN_GetURLNotifyProc(gNetscapeFuncs.geturlnotify, instance, url, window, notifyData); - } - else - { - err = NPERR_INCOMPATIBLE_VERSION_ERROR; - } - return err; -} - -NPError NPN_GetURL(NPP instance, const char* url, const char* window) -{ - return CallNPN_GetURLProc(gNetscapeFuncs.geturl, instance, url, window); -} - -NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData) -{ - int navMinorVers = gNetscapeFuncs.version & 0xFF; - NPError err; - - if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) - { - err = CallNPN_PostURLNotifyProc(gNetscapeFuncs.posturlnotify, instance, url, - window, len, buf, file, notifyData); - } - else - { - err = NPERR_INCOMPATIBLE_VERSION_ERROR; - } - return err; -} - -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) -{ - int navMinorVers = gNetscapeFuncs.version & 0xFF; - NPError err; - - if( navMinorVers >= NPVERS_HAS_STREAMOUTPUT ) - { - err = CallNPN_NewStreamProc(gNetscapeFuncs.newstream, instance, type, window, stream); - } - else - { - err = NPERR_INCOMPATIBLE_VERSION_ERROR; - } - return err; -} - -int32 NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer) -{ - int navMinorVers = gNetscapeFuncs.version & 0xFF; - NPError err; - - if( navMinorVers >= NPVERS_HAS_STREAMOUTPUT ) - { - err = CallNPN_WriteProc(gNetscapeFuncs.write, instance, stream, len, buffer); - } - else - { - err = NPERR_INCOMPATIBLE_VERSION_ERROR; - } - return err; -} - -NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason) -{ - int navMinorVers = gNetscapeFuncs.version & 0xFF; - NPError err; - - if( navMinorVers >= NPVERS_HAS_STREAMOUTPUT ) - { - err = CallNPN_DestroyStreamProc(gNetscapeFuncs.destroystream, instance, stream, reason); - } - else - { - err = NPERR_INCOMPATIBLE_VERSION_ERROR; - } - return err; -} - -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); -} - -#define DEBUG_MEMORY 0 - -void* NPN_MemAlloc(uint32 size) -{ -#if DEBUG_MEMORY - return (void*) NewPtrClear(size); -#else - return CallNPN_MemAllocProc(gNetscapeFuncs.memalloc, size); -#endif -} - -void NPN_MemFree(void* ptr) -{ -#if DEBUG_MEMORY - DisposePtr(Ptr(ptr)); -#else - CallNPN_MemFreeProc(gNetscapeFuncs.memfree, ptr); -#endif -} - -uint32 NPN_MemFlush(uint32 size) -{ - return CallNPN_MemFlushProc(gNetscapeFuncs.memflush, size); -} - -void NPN_ReloadPlugins(NPBool reloadPages) -{ - CallNPN_ReloadPluginsProc(gNetscapeFuncs.reloadplugins, reloadPages); -} - - -JRIEnv* NPN_GetJavaEnv(void) -{ - return CallNPN_GetJavaEnvProc( gNetscapeFuncs.getJavaEnv ); -} - -jref NPN_GetJavaPeer(NPP instance) -{ - return CallNPN_GetJavaPeerProc( gNetscapeFuncs.getJavaPeer, instance ); -} - -NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value) -{ - return CallNPN_GetValueProc( gNetscapeFuncs.getvalue, instance, variable, value); -} - -NPError NPN_SetValue(NPP instance, NPPVariable variable, void *value) -{ - return CallNPN_SetValueProc( gNetscapeFuncs.setvalue, instance, variable, value); -} - -void NPN_InvalidateRect(NPP instance, NPRect *rect) -{ - CallNPN_InvalidateRectProc( gNetscapeFuncs.invalidaterect, instance, rect); -} - -void NPN_InvalidateRegion(NPP instance, NPRegion region) -{ - CallNPN_InvalidateRegionProc( gNetscapeFuncs.invalidateregion, instance, region); -} - -void NPN_ForceRedraw(NPP instance) -{ - CallNPN_ForceRedrawProc( gNetscapeFuncs.forceredraw, instance); -} - -//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -// -// Wrapper functions for all calls from Netscape to the 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_Initialize(void); -void Private_Shutdown(void); -NPError Private_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved); -NPError Private_Destroy(NPP instance, NPSavedData** save); -NPError Private_SetWindow(NPP instance, NPWindow* window); -NPError Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype); -NPError Private_DestroyStream(NPP instance, NPStream* stream, NPError reason); -int32 Private_WriteReady(NPP instance, NPStream* stream); -int32 Private_Write(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer); -void Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname); -void Private_Print(NPP instance, NPPrint* platformPrint); -int16 Private_HandleEvent(NPP instance, void* event); -void Private_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData); -jref Private_GetJavaClass(void); - - -NPError Private_Initialize(void) -{ - NPError err; - EnterCodeResource(); - PLUGINDEBUGSTR("\pInitialize;g;"); - err = NPP_Initialize(); - ExitCodeResource(); - return err; -} - -void Private_Shutdown(void) -{ - EnterCodeResource(); - PLUGINDEBUGSTR("\pShutdown;g;"); - NPP_Shutdown(); - - __destroy_global_chain(); - - ExitCodeResource(); -} - - -NPError Private_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved) -{ - EnterCodeResource(); - NPError ret = NPP_New(pluginType, instance, mode, argc, argn, argv, saved); - PLUGINDEBUGSTR("\pNew;g;"); - ExitCodeResource(); - return ret; -} - -NPError Private_Destroy(NPP instance, NPSavedData** save) -{ - NPError err; - EnterCodeResource(); - PLUGINDEBUGSTR("\pDestroy;g;"); - err = NPP_Destroy(instance, save); - ExitCodeResource(); - return err; -} - -NPError Private_SetWindow(NPP instance, NPWindow* window) -{ - NPError err; - EnterCodeResource(); - PLUGINDEBUGSTR("\pSetWindow;g;"); - err = NPP_SetWindow(instance, window); - ExitCodeResource(); - return err; -} - -NPError Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype) -{ - NPError err; - EnterCodeResource(); - PLUGINDEBUGSTR("\pNewStream;g;"); - err = NPP_NewStream(instance, type, stream, seekable, stype); - ExitCodeResource(); - return err; -} - -int32 Private_WriteReady(NPP instance, NPStream* stream) -{ - int32 result; - EnterCodeResource(); - PLUGINDEBUGSTR("\pWriteReady;g;"); - result = NPP_WriteReady(instance, stream); - ExitCodeResource(); - return result; -} - -int32 Private_Write(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer) -{ - int32 result; - EnterCodeResource(); - PLUGINDEBUGSTR("\pWrite;g;"); - result = NPP_Write(instance, stream, offset, len, buffer); - ExitCodeResource(); - return result; -} - -void Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname) -{ - EnterCodeResource(); - PLUGINDEBUGSTR("\pStreamAsFile;g;"); - NPP_StreamAsFile(instance, stream, fname); - ExitCodeResource(); -} - - -NPError Private_DestroyStream(NPP instance, NPStream* stream, NPError reason) -{ - NPError err; - EnterCodeResource(); - PLUGINDEBUGSTR("\pDestroyStream;g;"); - err = NPP_DestroyStream(instance, stream, reason); - ExitCodeResource(); - return err; -} - -int16 Private_HandleEvent(NPP instance, void* event) -{ - int16 result; - EnterCodeResource(); - PLUGINDEBUGSTR("\pHandleEvent;g;"); - result = NPP_HandleEvent(instance, event); - ExitCodeResource(); - return result; -} - -void Private_Print(NPP instance, NPPrint* platformPrint) -{ - EnterCodeResource(); - PLUGINDEBUGSTR("\pPrint;g;"); - NPP_Print(instance, platformPrint); - ExitCodeResource(); -} - -void Private_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData) -{ - EnterCodeResource(); - PLUGINDEBUGSTR("\pURLNotify;g;"); - NPP_URLNotify(instance, url, reason, notifyData); - ExitCodeResource(); -} - - -jref Private_GetJavaClass(void) -{ - EnterCodeResource(); - PLUGINDEBUGSTR("\pGetJavaClass;g;"); - - jref clazz = NPP_GetJavaClass(); - ExitCodeResource(); - if (clazz) - { - JRIEnv* env = NPN_GetJavaEnv(); - return (jref)JRI_NewGlobalRef(env, clazz); - } - return NULL; -} - - -void SetUpQD(void); - -void SetUpQD(void) -{ - ProcessSerialNumber PSN; - FSSpec myFSSpec; - Str63 name; - ProcessInfoRec infoRec; - OSErr result = noErr; - CFragConnectionID connID; - Str255 errName; - - // - // Memorize the plugin¹s resource file - // refnum for later use. - // - gResFile = CurResFile(); - - // - // Ask the system if CFM is available. - // - long response; - OSErr err = Gestalt(gestaltCFMAttr, &response); - Boolean hasCFM = BitTst(&response, 31-gestaltCFMPresent); - - if (hasCFM) - { - // - // GetProcessInformation takes a process serial number and - // will give us back the name and FSSpec of the application. - // See the Process Manager in IM. - // - infoRec.processInfoLength = sizeof(ProcessInfoRec); - infoRec.processName = name; - infoRec.processAppSpec = &myFSSpec; - - PSN.highLongOfPSN = 0; - PSN.lowLongOfPSN = kCurrentProcess; - - result = GetProcessInformation(&PSN, &infoRec); - if (result != noErr) - PLUGINDEBUGSTR("\pFailed in GetProcessInformation"); - } - else - // - // If no CFM installed, assume it must be a 68K app. - // - result = -1; - - if (result == noErr) - { - // - // Now that we know the app name and FSSpec, we can call GetDiskFragment - // to get a connID to use in a subsequent call to FindSymbol (it will also - // return the address of ³main² in app, which we ignore). If GetDiskFragment - // returns an error, we assume the app must be 68K. - // - Ptr mainAddr; - result = GetDiskFragment(infoRec.processAppSpec, 0L, 0L, infoRec.processName, - kReferenceCFrag, &connID, (Ptr*)&mainAddr, errName); - } - - if (result == noErr) - { - // - // The app is a PPC code fragment, so call FindSymbol - // to get the exported ³qd² symbol so we can access its - // QuickDraw globals. - // - CFragSymbolClass symClass; - result = FindSymbol(connID, "\pqd", (Ptr*)&gQDPtr, &symClass); - if (result != noErr) - PLUGINDEBUGSTR("\pFailed in FindSymbol qd"); - } - else - { - // - // The app is 68K, so use its A5 to compute the address - // of its QuickDraw globals. - // - gQDPtr = (QDGlobals*)(*((long*)SetCurrentA5()) - (sizeof(QDGlobals) - sizeof(GrafPtr))); - } - -} - - - -NPError main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unloadUpp); - -#pragma export on - -#if GENERATINGCFM -RoutineDescriptor mainRD = BUILD_ROUTINE_DESCRIPTOR(uppNPP_MainEntryProcInfo, main); -#endif - -#pragma export off - - -NPError main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unloadUpp) -{ - EnterCodeResource(); - PLUGINDEBUGSTR("\pmain"); - - NPError err = NPERR_NO_ERROR; - - // - // Ensure that everything Netscape passed us is valid! - // - if ((nsTable == NULL) || (pluginFuncs == NULL) || (unloadUpp == 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) // Major version is in high byte - 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¹s 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. - // - - int navMinorVers = nsTable->version & 0xFF; - - gNetscapeFuncs.version = nsTable->version; - gNetscapeFuncs.size = nsTable->size; - gNetscapeFuncs.posturl = nsTable->posturl; - gNetscapeFuncs.geturl = nsTable->geturl; - 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; - if( navMinorVers >= NPVERS_HAS_LIVECONNECT ) - { - gNetscapeFuncs.getJavaEnv = nsTable->getJavaEnv; - gNetscapeFuncs.getJavaPeer = nsTable->getJavaPeer; - } - if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) - { - gNetscapeFuncs.geturlnotify = nsTable->geturlnotify; - gNetscapeFuncs.posturlnotify = nsTable->posturlnotify; - } - gNetscapeFuncs.getvalue = nsTable->getvalue; - gNetscapeFuncs.setvalue = nsTable->setvalue; - gNetscapeFuncs.invalidaterect = nsTable->invalidaterect; - gNetscapeFuncs.invalidateregion = nsTable->invalidateregion; - gNetscapeFuncs.forceredraw = nsTable->forceredraw; - - // defer static constructors until the global functions are initialized. - __InitCode__(); - - // - // 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 = NewNPP_HandleEventProc(Private_HandleEvent); - if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) - { - pluginFuncs->urlnotify = NewNPP_URLNotifyProc(Private_URLNotify); - } - if( navMinorVers >= NPVERS_HAS_LIVECONNECT ) - { - pluginFuncs->javaClass = (JRIGlobalRef) Private_GetJavaClass(); - } - *unloadUpp = NewNPP_ShutdownProc(Private_Shutdown); - SetUpQD(); - err = Private_Initialize(); - } - - ExitCodeResource(); - return err; -} diff --git a/plugin/oji/MRJ/plugin/Source/nsLiveConnect.cpp b/plugin/oji/MRJ/plugin/Source/nsLiveConnect.cpp deleted file mode 100644 index f9336cbe6d1e..000000000000 --- a/plugin/oji/MRJ/plugin/Source/nsLiveConnect.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - nsLiveConnect.cpp - */ - -#include "nsLiveconnect.h" -#include "MRJMonitor.h" -#include "MRJPlugin.h" -#include "nsIPluginManager.h" - -#include - -extern nsIPluginManager* thePluginManager; - -const InterfaceInfo nsLiveconnect::sInterfaces[] = { - { NS_ILIVECONNECT_IID, INTERFACE_OFFSET(nsLiveconnect, nsILiveconnect) }, - { NS_IPLUGINSTREAMLISTENER_IID, INTERFACE_OFFSET(nsLiveconnect, nsIPluginStreamListener) }, -}; -const UInt32 nsLiveconnect::kInterfaceCount = sizeof(sInterfaces) / sizeof(InterfaceInfo); - -nsLiveconnect::nsLiveconnect() - : SupportsMixin(this, sInterfaces, kInterfaceCount), - mJavaScriptMonitor(NULL), mScript(NULL), mResult(NULL) -{ -} - -nsLiveconnect::~nsLiveconnect() -{ - if (mJavaScriptMonitor != NULL) - delete mJavaScriptMonitor; -} - -static char* u2c(const jchar *ustr, jsize length) -{ - char* result = new char[length + 1]; - if (result != NULL) { - char* cstr = result; - while (length-- > 0) { - *cstr++ = (char) *ustr++; - } - *cstr = '\0'; - } - return result; -} - -const char* kJavaScriptPrefix = "javascript:"; - -NS_METHOD -nsLiveconnect::Eval(JNIEnv *env, jsobject obj, const jchar *script, jsize length, void* principalsArray[], - int numPrincipals, nsISupports *securitySupports, jobject *outResult) -{ - MRJPluginInstance* pluginInstance = (MRJPluginInstance*) obj; - nsIPluginStreamListener* listener = this; - - if (mJavaScriptMonitor == NULL) - mJavaScriptMonitor = new MRJMonitor(pluginInstance->getSession()); - - mJavaScriptMonitor->enter(); - - while (mScript != NULL) { - // some other thread is evaluating a script. - mJavaScriptMonitor->wait(); - } - - // convert the script to ASCII, construct a "javascript:" URL. - char* cscript = u2c(script, length); - mScript = new char[strlen(kJavaScriptPrefix) + length + 1]; - strcpy(mScript, kJavaScriptPrefix); - strcat(mScript, cscript); - delete[] cscript; - nsresult result = thePluginManager->GetURL((nsIPluginInstance*)pluginInstance, mScript, NULL, listener); - - // need to block until the result is ready. - mJavaScriptMonitor->wait(); - - // default result is NULL, in case JavaScript returns undefined value. - *outResult = NULL; - - // result should now be ready, convert it to a Java string and return. - if (mResult != NULL) { - *outResult = env->NewStringUTF(mResult); - delete[] mResult; - mResult = NULL; - } - - delete[] mScript; - mScript = NULL; - - mJavaScriptMonitor->notifyAll(); - - mJavaScriptMonitor->exit(); - - return NS_OK; -} - -NS_METHOD nsLiveconnect::OnDataAvailable(nsIPluginStreamInfo* pluginInfo, nsIInputStream* input, PRUint32 length) -{ - // hopefully all our data is available. - mResult = new char[length + 1]; - if (mResult != NULL) { - if (input->Read(mResult, length, &length) == NS_OK) { - // We've delayed processing the applet tag, because we - // don't know the location of the curren document yet. - mResult[length] = '\0'; - } - } - return NS_OK; -} - -NS_METHOD nsLiveconnect::OnStopBinding(nsIPluginStreamInfo* pluginInfo, nsresult status) -{ - // the stream has been closed, notify any waiting Java threads. - mJavaScriptMonitor->notifyAll(); - return NS_OK; -} diff --git a/plugin/oji/MRJ/plugin/Source/nsLiveConnect.h b/plugin/oji/MRJ/plugin/Source/nsLiveConnect.h deleted file mode 100644 index 7630dc4fa153..000000000000 --- a/plugin/oji/MRJ/plugin/Source/nsLiveConnect.h +++ /dev/null @@ -1,270 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - nsLiveConnect.h - */ - -#pragma once - -#include "nsILiveconnect.h" -#include "nsIPluginStreamListener.h" -#include "SupportsMixin.h" - -class MRJMonitor; - -class nsLiveconnect : public nsILiveconnect, - public nsIPluginStreamListener, - private SupportsMixin { -public: - DECL_SUPPORTS_MIXIN - - nsLiveconnect(); - virtual ~nsLiveconnect(); - - /** - * get member of a Native JSObject for a given name. - * - * @param obj - A Native JS Object. - * @param name - Name of a member. - * @param pjobj - return parameter as a java object representing - * the member. If it is a basic data type it is converted to - * a corresponding java type. If it is a NJSObject, then it is - * wrapped up as java wrapper netscape.javascript.JSObject. - */ - NS_IMETHOD - GetMember(JNIEnv *env, jsobject jsobj, const jchar *name, jsize length, void* principalsArray[], - int numPrincipals, nsISupports *securitySupports, jobject *pjobj) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * get member of a Native JSObject for a given index. - * - * @param obj - A Native JS Object. - * @param slot - Index of a member. - * @param pjobj - return parameter as a java object representing - * the member. - */ - NS_IMETHOD - GetSlot(JNIEnv *env, jsobject jsobj, jint slot, void* principalsArray[], - int numPrincipals, nsISupports *securitySupports, jobject *pjobj) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * set member of a Native JSObject for a given name. - * - * @param obj - A Native JS Object. - * @param name - Name of a member. - * @param jobj - Value to set. If this is a basic data type, it is converted - * using standard JNI calls but if it is a wrapper to a JSObject - * then a internal mapping is consulted to convert to a NJSObject. - */ - NS_IMETHOD - SetMember(JNIEnv *env, jsobject jsobj, const jchar* name, jsize length, jobject jobj, void* principalsArray[], - int numPrincipals, nsISupports *securitySupports) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * set member of a Native JSObject for a given index. - * - * @param obj - A Native JS Object. - * @param index - Index of a member. - * @param jobj - Value to set. If this is a basic data type, it is converted - * using standard JNI calls but if it is a wrapper to a JSObject - * then a internal mapping is consulted to convert to a NJSObject. - */ - NS_IMETHOD - SetSlot(JNIEnv *env, jsobject jsobj, jint slot, jobject jobj, void* principalsArray[], - int numPrincipals, nsISupports *securitySupports) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * remove member of a Native JSObject for a given name. - * - * @param obj - A Native JS Object. - * @param name - Name of a member. - */ - NS_IMETHOD - RemoveMember(JNIEnv *env, jsobject jsobj, const jchar* name, jsize length, void* principalsArray[], - int numPrincipals, nsISupports *securitySupports) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * call a method of Native JSObject. - * - * @param obj - A Native JS Object. - * @param name - Name of a method. - * @param jobjArr - Array of jobjects representing parameters of method being caled. - * @param pjobj - return value. - */ - NS_IMETHOD - Call(JNIEnv *env, jsobject jsobj, const jchar* name, jsize length, jobjectArray jobjArr, void* principalsArray[], - int numPrincipals, nsISupports *securitySupports, jobject *pjobj) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * Evaluate a script with a Native JS Object representing scope. - * - * @param obj - A Native JS Object. - * @param principalsArray - Array of principals to be used to compare privileges. - * @param numPrincipals - Number of principals being passed. - * @param script - Script to be executed. - * @param pjobj - return value. - */ - NS_IMETHOD - Eval(JNIEnv *env, jsobject obj, const jchar *script, jsize length, void* principalsArray[], - int numPrincipals, nsISupports *securitySupports, jobject *outResult); - - /** - * Get the window object for a plugin instance. - * - * @param pJavaObject - Either a jobject or a pointer to a plugin instance - * representing the java object. - * @param pjobj - return value. This is a native js object - * representing the window object of a frame - * in which a applet/bean resides. - */ - NS_IMETHOD - GetWindow(JNIEnv *env, void *pJavaObject, void* principalsArray[], - int numPrincipals, nsISupports *securitySupports, jsobject *pobj) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * Finalize a JSObject instance. - * - * @param env - JNIEnv on which the call is being made. - * @param obj - A Native JS Object. - */ - NS_IMETHOD - FinalizeJSObject(JNIEnv *env, jsobject jsobj) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * Convert a JSObject to a string. - * - * @param env - JNIEnv on which the call is being made. - * @param obj - A Native JS Object. - * @param jstring - Return value as a jstring representing a JS object. - */ - NS_IMETHOD - ToString(JNIEnv *env, jsobject obj, jstring *pjstring) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - // nsIPluginStreamListener implementation. - - /** - * Notify the observer that the URL has started to load. This method is - * called only once, at the beginning of a URL load.

- * - * @return The return value is currently ignored. In the future it may be - * used to cancel the URL load.. - */ - NS_IMETHOD - OnStartBinding(nsIPluginStreamInfo* pluginInfo) - { - return NS_OK; - } - - /** - * Notify the client that data is available in the input stream. This - * method is called whenver data is written into the input stream by the - * networking library...

- * - * @param aIStream The input stream containing the data. This stream can - * be either a blocking or non-blocking stream. - * @param length The amount of data that was just pushed into the stream. - * @return The return value is currently ignored. - */ - NS_IMETHOD - OnDataAvailable(nsIPluginStreamInfo* pluginInfo, nsIInputStream* input, PRUint32 length); - - NS_IMETHOD - OnFileAvailable(nsIPluginStreamInfo* pluginInfo, const char* fileName) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * Notify the observer that the URL has finished loading. This method is - * called once when the networking library has finished processing the - * URL transaction initiatied via the nsINetService::Open(...) call.

- * - * This method is called regardless of whether the URL loaded successfully.

- * - * @param status Status code for the URL load. - * @param msg A text string describing the error. - * @return The return value is currently ignored. - */ - NS_IMETHOD - OnStopBinding(nsIPluginStreamInfo* pluginInfo, nsresult status); - - /** - * What is this method supposed to do? - */ - NS_IMETHOD - GetStreamType(nsPluginStreamType *result) - { - *result = nsPluginStreamType_Normal; - return NS_OK; - } - -private: - MRJMonitor* mJavaScriptMonitor; - char* mScript; - char* mResult; - - // support for SupportsMixin. - static const InterfaceInfo sInterfaces[]; - static const UInt32 kInterfaceCount; -}; diff --git a/plugin/oji/MRJ/plugin/netscape.plugin.jar b/plugin/oji/MRJ/plugin/netscape.plugin.jar deleted file mode 100644 index 1b7782e9124aabb46f9e23eaf5b4310f8532852a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1003 zcmaiz-D(p-6vzLQ%}29|wqlJ|Yg-XC5j5bfMbJ_~6Lg^(!Mn+32vgSGu)Ap$A3zYF zz-Q=%f*^RI;H8h?!-)U0P1CS#?JRrFeEiPGoSE@DPSJ(5KMz0N$T|~Ir4CJ+_j(zjU%0zW&(w8`h$m^8KLOc9^Qa2nK{R7D?uWA4Q diff --git a/plugin/oji/MRJ/testing/ConsoleApplet/Console.java b/plugin/oji/MRJ/testing/ConsoleApplet/Console.java deleted file mode 100644 index 80c64143ffdf..000000000000 --- a/plugin/oji/MRJ/testing/ConsoleApplet/Console.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - Console.java - - Simple console that lets an Applet attach to the system console. - - by Patrick C. Beard. - */ - -package netscape.console; - -import java.io.*; -import java.awt.*; - -public class Console { - // Save primordial System streams. - private static InputStream in; - private static PrintStream out; - private static PrintStream err; - private static TextArea console; - - private static class Input extends InputStream { - byte[] buffer = new byte[1024]; - int position = 0; - int count = 0; - - private void fillBuffer() throws EOFException { - // int length = readLine(buffer, 0, buffer.length); - int length = 1024; - if (length == -1) - throw new EOFException(); - count = length; - position = 0; - } - - public int read() throws IOException { - synchronized(this) { - if (position >= count) - fillBuffer(); - return buffer[position++]; - } - } - - public int read(byte[] b, int offset, int length) throws IOException { - synchronized(this) { - // only fill the buffer at the outset, always returns at most one line of data. - if (position >= count) - fillBuffer(); - int initialOffset = offset; - while (offset < length && position < count) { - b[offset++] = buffer[position++]; - } - return (offset - initialOffset); - } - } - } - - private static class Output extends OutputStream implements Runnable { - StringBuffer buffer = new StringBuffer(); - - public Output() { - Thread flusher = new Thread(this, getClass().getName() + "-Flusher"); - flusher.setDaemon(true); - flusher.start(); - } - - public synchronized void write(int b) throws IOException { - this.buffer.append((char)b); - notify(); - } - - public synchronized void write(byte[] buffer, int offset, int count) throws IOException { - this.buffer.append(new String(buffer, 0, offset, count)); - notify(); - } - - public synchronized void flush() throws IOException { - String value = this.buffer.toString(); - console.append(value); - this.buffer.setLength(0); - } - - /** - * When I/O occurs, it is placed in a StringBuffer, which is flushed in a different thread. - * This prevents deadlocks that could occur when the AWT itself is printing messages. - */ - public synchronized void run() { - for (;;) { - try { - wait(); - flush(); - } catch (InterruptedException ie) { - } catch (IOException ioe) { - } - } - } - } - - private static class Error extends Output {} - - public static void init(TextArea text) { - in = System.in; - out = System.out; - err = System.err; - console = text; - - System.setIn(new Input()); - System.setOut(new PrintStream(new Output())); - System.setErr(new PrintStream(new Error())); - } - - public static void dispose() { - System.setIn(in); - System.setOut(out); - System.setErr(err); - - console = null; - } -} diff --git a/plugin/oji/MRJ/testing/ConsoleApplet/ConsoleApplet.html b/plugin/oji/MRJ/testing/ConsoleApplet/ConsoleApplet.html deleted file mode 100644 index 0cc2a833e4f9..000000000000 --- a/plugin/oji/MRJ/testing/ConsoleApplet/ConsoleApplet.html +++ /dev/null @@ -1,19 +0,0 @@ - - -Java Console - - - - - - - - - diff --git a/plugin/oji/MRJ/testing/ConsoleApplet/ConsoleApplet.java b/plugin/oji/MRJ/testing/ConsoleApplet/ConsoleApplet.java deleted file mode 100644 index d69568d28470..000000000000 --- a/plugin/oji/MRJ/testing/ConsoleApplet/ConsoleApplet.java +++ /dev/null @@ -1,100 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - ConsoleApplet.java - - Simple Java console for MRJ. - - A trusted applet that provides simple console services for the MRJ plugin. - The applet's classes must be installed in the MRJClasses folder, because - it alters the System.in/out/err streams. - - by Patrick C. Beard. - */ - -package netscape.console; - -import java.io.*; -import java.awt.*; -import java.applet.*; -import java.awt.event.*; - -public class ConsoleApplet extends Applet { - TextArea console; - - public ConsoleApplet() { - setLayout(new BorderLayout()); - add(console = new TextArea(), BorderLayout.CENTER); - - Panel panel = new Panel(); - add(panel, BorderLayout.SOUTH); - - // clear console button. - ActionListener clearConsoleListener = new ActionListener() { - public void actionPerformed(ActionEvent e) { - console.setText(""); - } - }; - - Button clearConsole = new Button("Clear"); - clearConsole.addActionListener(clearConsoleListener); - panel.add(clearConsole); - - // dump threads button. - ActionListener dumpThreadsListener = new ActionListener() { - public void actionPerformed(ActionEvent e) { - dumpThreads(); - } - }; - - Button dumpThreads = new Button("Dump Threads"); - dumpThreads.addActionListener(dumpThreadsListener); - panel.add(dumpThreads); - } - - public void init() { - Console.init(console); - } - - public void destroy() { - Console.dispose(); - } - - public void dumpThreads() { - System.out.println("Dumping threads..."); - } -} diff --git a/plugin/oji/MRJ/testing/ConsoleApplet/ConsoleApplet.mcp b/plugin/oji/MRJ/testing/ConsoleApplet/ConsoleApplet.mcp deleted file mode 100644 index 0e6e73ea60959237bd378f1c6d15733d22b598f4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 38451 zcmeHQdu$xXd7nM<#D^(~qGZWdWa}hZlpM)N$+9i^;@FgqlthUXFC-NyvR(6dT$3l= zD|bg(c3qokgtVy(*f5d+1zf;?G=Pf+soJ`z+z09;PU}95q)7}UY5H)2HfieCMqf^X zHtO#;Gke_K+r2wJ5=Y{G#5do!-^_e7^UXJ}-Q`{?pU(&(nuIWR3i0%HLOioih!qft zUL$0XN{Htt%~Q!@F`X|)62<&kGgY>tmJ_uMvI&h2>4x743j0a;0K#U?p92kR{vxO} zD(G{-7A=1Xv{mz825r;)_dwefZ%{Y-g<#x_phL34*bBN+^T$9}X?_xPwdNlO?bQ4y zLDy*h_dvTe|0U41n*UeOb&3zM-0L+T0bQ^8{h%8(e;o7%&8I+b)I7`GsCkzA9?f3@ zrR@NrR}tJKSrPgNP__*adI!N~$%-c0Bcl1Opj$M5FDS18O(zg+ldNcB9d6P5FM@8@ zJZ;{s`OBa?H2)1y_&uTNEd;kpRy5PD@74Tmpu05BvUY3!94O-e%^yb)m8@v~4bUFV ze;#y?=Kmg)eFkX$A%fc_E5fuT#vCDh7lJz^E5Zp-`W7IZN5D8h_*n$(13>t<5FC)K z2!9duZq0uiG^Y70pzl-s3ijV81;^wkG7KLh%6ntvMfA z=}+`8`X2k6{mlMlzm5ahkL*A88~cm>#QtHwus_%jv_I`md(+PJY0eYu%R7Ob4>%9p z2HXSWJa9LVw*fZ-Isb4B+yuNCxD>$l5mxD~z{5 z=@S6s9R%!iK!~=d?*Kw3^J{Z9KEkI|X-_zeMKcByrh2>y*5mo?r z9k3bL3T)#w#O%{vR1afKR!#P?(LKFq#iduQF@Pk@j&Wlcq!xrA)qZJ-=IF8H`DEl^ zp^!1l;&8fHDn~}msjQhRi&#v=R75$jr^0ET=Op8p>qBgX!Ek zvnb*-rE)$SIc`4sNWM5(5(iT$vs8*ClI7`=7)utXOtz$4PUogdXjsOK3?&N%d39(e zotcdEUnm!oCDCV2%uG$0#fZuy4v!_EBxhz+Y4LnEo6Jo{P^ziRPv)j(l2iI>D47}_ zohwMzaCoL%m?^8&)^U;%efd=7csXJ|7J=>pDu%Y?bESO7)V&aMTq;9Ik!e|0TG5rv zOD2tGrBf!?0cRTTywqWn#^@*3y^CR*Fmn?T$i~1a$e#*q}N}$_HxbT z8t>lUaG$`5jqB zSUUBNW{r;T((&E;dad3et&(z9QJqLS%`wd!wdkwWK+NgJ5J7jwF(34jf zT@}K9N+DzQ>`ww@NT~*_Dil%#wDwpXn8=Qr$w{+VicVWe9n`MF(nyb)1G(y`0<{o% z*qnBj*2@i}Q%NN|#B_koI-RVxR^cE>M@NkKq^oELL-TEEARQgKqh2~kC4!5<0)Yhr z3p8Q@&Pbt=;bGohsX*w+$jOAh3bm;H7SG2`hX)4xk)u`9HchXyr8ipijv46<9p8NN z#K7s&q?wQ0+8ELwXKY~H_Y}p$L84{;oeBwfPHm5M-6-!%mw3v^PH;!;&ZIZ}Zn1rLtq(D=cu#!SuDQLnJ&TIMlb)PB z2RNb*51|r{atB5t!v$=5(~r3-B=ZeAjsdzIGRD6Bx68dMtBwytCXOriQ-{u$NS0E` zjCWgfoM&SaiMXekDfcxqBR$MaaiagQ!!lB)pOe{*2>HQM)}tYg(~dpIsdR3Hb=3zU zd(?#kcX>8~a*ujaY*|>-i1g6GbV;AZv{gq_#dM*J15M7OU+rf!duVGx;)_ zWKa*ZkegFz#$r?ut|n zAj^)yO{g`Fp66}vD}NK)V_|su%s?VCbn1*cmr0|wsckt%-NNj3AK+jjF(~h~HTMl3 zIh{I}p5%Z%HJXU4`-3dV);~73x=b0li8sK)$!LC|wW8ii&4e*~dbYZx`AVp-lINuH zjL{b2GhQ1Qv$l(+U|V?0ZgKF?L#1+32E_&T@Z!pc`&GH!D&-BTaqTA)1JOd!d^ml< zyCh`- zY)@RAzVc2lt{-H6vGJYM3d|!1nnn=PaGWTkM^JL_pVPb#d1s_(6o9D zo0pTwvSn%aMHUBA$<-M&+c!1~Y(fajnf0dF0#)d2>=Hh=4xrisw9O_2b8f5p?j~#_ zzH{Zu8-G%rC6ELbSfB;$YlI`Kk%lT)vkXKwtsR zQGBx5OH(w#FYp?lnJcC7Hd}0H~OemR&guI=t_ zxOFzaFu0YJ>x{nXEZ-w;SW}QNu)x)C0mohNtG_w(Z$Yq^oWISk(H!!;i}!!k4RrND z<{E8k(5wYmfcGb}$#iZ3S+AWe^>4RcJ8cbG5?COxKy3@ypB~DTauuzeCy1?Mfp_sO z1gmCx6J%WmG_XKm0Urxo&z&J4nEHGS6o>;01Qu8}7O!@x`>U{!zzw9hQ|1g2o0Gn6p4gw4KP~3wgD`7#d0xYb9tTt`~{y@9=o$>5~6; z=NZ+wa2!ebZ=#Lo@J>lR@!?-RC;kI3EdK5Be-xq5A6Q|mXl;7x%}+GX8qbK$dwCYB zd=*h_zGEH!AqAGP7(5|2cKB{oV^rXVQhkRCo-? z1BNL&4gSL*AL{U$U)|Fm_;kpaj`74^;AB2E1F|R>NA6;&m|Bz)WTqZMG{vu!ibaht zsfS-V1+cAC4cdq4?Do-m;6MIg+1WpZiiz^mssQR=Xn)!M`(G(_hvA>K8FQ&-gr)MZ z(sX9RZM214>t5$~O!Ql*E-kHct#Aq5mvdU&F>}{)t(d#??dUP60(LNs5HV+Sj7Qeb+SHs;%9hj?) ze?sYD6UmzYgnuYmPEG4?c6n)&Ereu2AE8)PJJ+m@>@WT4BL5CkdhnI^8i4vVs3%pkW%b%MTWMEn zx|RnuuBT9Q4_>cbmHO1#fG+kX!Y4Ic7oOhs(# z2{f%Db}&PUL3!eI2wfKq=~<#X4a0|yMO?*KT@EEqS)SqBuEb!zrk7SJ^$?6hwp8bw zcV(sYwT_;_8(k^u>S=JLtgEN?l2Vy@>+7khs9``{E@lXou^s@*M!0W^c|MKhGV2zn&%9 z0W9f?TYF)eJ5&0$YMv`)T|KocR9Tto>Z!dj%|lO3MGfouX|I$%_L*BL8(f)u^vq&- zs1>)tm8piF)A8ZDJ8Y(@%)LIkuJRSdr&ajn$@#4)zIr&LEyap*p-}ca1+oZyrmT?} zia$M23&s(t&IGkLhli4xOg^8B95pk(BUS3DJ+TPfnjITezpUU}EvW}TALp9@5%P=7 zwGtps>XFar{1eu*4|6uMtk=^suB#A5w`z9bguhu8z_PYL-{HZr)k9{vn1949o-0N8 zuFJAENYMC&T7WMM1Q1wYIa|Qshk)_Bl=>ewaSk6H@c9n#ayHZQYWsA#T!{7b@cq7M zX(ks<<+DA7Vt#TaRW9|Mojlir-?r|-aj4XjETr+Hu-6=fL;|mqslRKkar0}?x*hT1 zzWyDN9eoGK4uT{G;$u7Jr{d~P9a3)=UfqodY9Cl2us~perLe$_I5%~OY^m(J!({B_ zr^q39-M?yqJVd$cJ8>&-;d}K;Pt*72YSxDIODK_~^zRVxVmP@RsP2TYWt~-%F?UG+s@=V?({{gN$`13-t&n`lsS= z`x^MINh>qm-6^X60)sIetIqH(b5;DtFy~L$FVRzESGg|D#_3f1Ap& z?+@UgrG50Als|t zz1vX#h|<&A3fb*S9*@J%JC(fqC}jJTyzBd*y4)?Wp}0fKe+;VpmBi+5b7- zJlCIvKQanE-&A^ z**}8pUM2qkp7n0gNg6uYDV`gG&CfCe%mS zbN^q`HxDU!H`_6x(tqZE!J|J2JNW}m2bBD^mEij*6=L_FBUq{A-~B`I`aInI9C+Pd zCpLiBPnFhkUQ_+G|BK%Oe*_5VzJx&c*N?sqo_!D4@l6D;DE%LUFNpz4h4|nXV4oY5 z{7Lo+{|O1OoAb#FN}l<5@cK=%-5ekC=g-9cC#i$u0q}9uEu_o6z&;<6V)4{A*jd>> j^x-!l%PV>JUxBt|^PErYup9j@cFJ;BzwsjY0%QLltTv_A diff --git a/plugin/oji/MRJ/testing/ConsoleApplet/LaunchConsole.html b/plugin/oji/MRJ/testing/ConsoleApplet/LaunchConsole.html deleted file mode 100644 index 553a6888d4b8..000000000000 --- a/plugin/oji/MRJ/testing/ConsoleApplet/LaunchConsole.html +++ /dev/null @@ -1,14 +0,0 @@ - - -Launching the Java Console. - - - - - - - - diff --git a/plugin/oji/MRJ/testing/ConsoleApplet/README b/plugin/oji/MRJ/testing/ConsoleApplet/README deleted file mode 100644 index 3ab23e321736..000000000000 --- a/plugin/oji/MRJ/testing/ConsoleApplet/README +++ /dev/null @@ -1,2 +0,0 @@ -To use this applet with the MRJ plugin, you must install "ConsoleApplet.jar" in your -MRJClasses folder. diff --git a/plugin/oji/MRJ/testing/Embedding/README b/plugin/oji/MRJ/testing/Embedding/README deleted file mode 100644 index 8ca0306aa7ab..000000000000 --- a/plugin/oji/MRJ/testing/Embedding/README +++ /dev/null @@ -1 +0,0 @@ -Put an alias to AppletClasses.jar in this directory to test. diff --git a/plugin/oji/MRJ/testing/Embedding/Test.html b/plugin/oji/MRJ/testing/Embedding/Test.html deleted file mode 100644 index d256d983f027..000000000000 --- a/plugin/oji/MRJ/testing/Embedding/Test.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - -MRJ In A Box - - - - -

What is MRJ In A Box?

- -Makes a Java applet run with an embed tag.

- -


- - - - - - - diff --git a/plugin/oji/MRJ/testing/JSApplet/JSApplet.html b/plugin/oji/MRJ/testing/JSApplet/JSApplet.html deleted file mode 100644 index 5f765bf65862..000000000000 --- a/plugin/oji/MRJ/testing/JSApplet/JSApplet.html +++ /dev/null @@ -1,18 +0,0 @@ - - -JS Test - - - - - - - diff --git a/plugin/oji/MRJ/testing/JSApplet/JSApplet.java b/plugin/oji/MRJ/testing/JSApplet/JSApplet.java deleted file mode 100644 index 58297070ef04..000000000000 --- a/plugin/oji/MRJ/testing/JSApplet/JSApplet.java +++ /dev/null @@ -1,95 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - JSApplet.java - - Tests JSObject.eval. - - by Patrick C. Beard. - */ - -import java.io.*; -import java.awt.*; -import java.applet.*; -import java.awt.event.*; - -import netscape.javascript.JSObject; - -public class JSApplet extends Applet { - TextField text; - - public void init() { - setLayout(new BorderLayout()); - add(text = new TextField(), BorderLayout.CENTER); - - Panel panel = new Panel(); - add(panel, BorderLayout.SOUTH); - - // eval button. - ActionListener evalListener = new ActionListener() { - JSObject window; - - public void actionPerformed(ActionEvent e) { - if (window == null) - window = JSObject.getWindow(JSApplet.this); - Object result = window.eval(text.getText()); - if (result != null) - System.out.println(result); - text.selectAll(); - } - }; - - Button evalButton = new Button("eval"); - evalButton.addActionListener(evalListener); - text.addActionListener(evalListener); - panel.add(evalButton); - - // clear button. - ActionListener clearConsoleListener = new ActionListener() { - public void actionPerformed(ActionEvent e) { - text.setText(""); - } - }; - - Button clearConsole = new Button("clear"); - clearConsole.addActionListener(clearConsoleListener); - panel.add(clearConsole); - } - - public void destroy() { - } -} diff --git a/plugin/oji/MRJ/testing/JSApplet/JSApplet.mcp b/plugin/oji/MRJ/testing/JSApplet/JSApplet.mcp deleted file mode 100644 index 5b9968d39a6747958da14620120f0954b9fb9d57..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 38581 zcmeHQ3vgW3c|Lcgwca3O8yrI7#l{a}d1WvGv%F-lBqLd}wvvoo2Z~p#i?sH>*j*Xp z@DO0$FAoz)r=Z;2>-N(SQE`{^y+kob#XmJnlVruVU$RLI_bOgt0}4C!ZJM?h%u5Y}t{2&iB4CqP$d{#nol z&A$rTsQJGFZPGmL->i6px?42=anM%HUjo{u`F_x|G(Q1)w&w2uZP)zMper^170`1u z|83A!n*UGG)r$AA+%=jHfS#-QD?rcF{9e$tnva2gMDr~7e9g1mk81u!P}&aQdjrA8 zBrAOX49d0veD5PzCs|QPdjvGU9`r)ZUkl1>K;1qB8zd|0Sci)=e=q1p&C}+aH2(_d zX3hT{=oZbt3wp8Q>uJ|dXnq^$R?V}l4$U6{WgMXXVFW?Riu&IK?bQ6&LAPuEpFr7X zfcl>yxKy&jPh0NL{N((oUF;h`Bil73 zS<%S)(vE<}Uq-<3323A}hb1c-Pk^#cfJXYssANUsAAs)H{I@`F&^&EBrg_@-fa06Z z0c9D0Ci>bz$%-c0_*0sv?i)2vU%g55)1bei`6oed*8KCJhcy4Epi#}g4LYv*AAwRA zpxK9DLb9Uy0#H-)mx11*dD?GM^M^p$-+<=Z5yT}cnx6qZtoh#trLO~;Uqz6RtZ04< zG^u&oB&B(dU)mSY(vBb_SKulf5yX%|4t=Mfy0tY~=| z^ft}^CFn8DzXQrP09qLwX8?W;f=^3Uv~s-Op?Uh|otobddY9&DkGnO0ALxwce+~2= z&3_g2Ud_J=%5;EM+JXKAX#F_?wgJ#~E`kRnE803iAJja3{~^uO7arC;+sCm7XnPvL zqmmVE?2E@V|3{#YYyR7yPiX%8p!6X?8|!dVvP(bU*kM1>U&eqOcO3H^(;RmkZyaZX zK#pgQZ;pMAH`Hl58UBKPIFt8g)pX>#4exz^o0sDcR z{|10TpdYvbxCz(*Yy=v>dSDZ<8Q20OYz1xv)&VyITY+1EZNQ6xX93R!27v9ri-0SE zoXai*t_Q9Ht_FSrxCTgHJ`cDS_z~bbpbxkKcs}r>K+ZiM15N{v0_o2jryQSYAjkf3 z;HQBck11dt$a#Qs#GOEnM~=f8;61>5f%gGV0PhDr0DKVm5b$B(Bfv+2j{zSCJ^_3Z zm;rtqxKLmlX-C?hZKG`hKy50w~K-6e%kQF*snG`_7c-5FbrfXfDcO9hn~B$}VfiP30w(qv2W`FLtFhlVB0z+g0!kypE?Tp||WyvKQ1(wATFy#ZT+Z@BBuNwEgY-U26Kf#3|z`I;?`ugou*>DK`|G zsz}Ghv87D81?6+lS5>*HmbI{Eftm$s7Qo$YadRDVZ&>Ydj?Jq*!o88T$2m8(_87+o z*B){C&b`=mPMCYll%sBxcgJ(wR6KF4)V`EPuJq}0kc1PD8quu37 z?;h>3UiXexRnhAe3oXJlq8sAp|^F2N?Sh@PHj)97Mo_c7QR7fcXIi57l{q3@}b0&3Z9450OKtL0dnB~6~Tp)6~?=u>oxyA=my36X#0ya&$e#Vd;pY(-2h)F z0v=2QeAgf-9=1wZE%3AeJo)ZZj428Ics4Jc$TQ!v5n@P}Sb?V&$~yL_2G~pf$sE=Y zZpHF?y&0V_v$^1ur`7B_tisSOHb9Cd^#}}0y-hv`_Bz0>NMt}B+|+ju>^TrS5})9X zXKW-ARudZg+ff+|yH;!Qrw;Z-0)t}*BeE(gvo(R1uN~i=sFR5i zH18YQw`;H`*mI!AJ4YAAoB@Y>(uGq1_D7FA_| zvy@M8YQs#rKhhV>WX)UReA&?hl>d}W^RAQz*9t8&#Dhkg@q@ZsTOBu*+^ZULr|j$E z4j3xAeXK#v0`##{fG(P%4t{~x_{>x;j6Z&@zC&Z3*JM*&1 z`xQK2*N>%~55>;B=GIy?M+@+_HyMqm=9ulwO5UJu{uk1yn{UqLqcX_O^YQXRO1I_3 zIhj8iOwacrH#HR=bPHqVz>H1zJXzbr5c~kR3~1|jpu|v{DRo{ zc1P2*7eCkZomVpc^ouWwEuY#a`qS@$Zo>5ol4mae_BZ|MFO!o1ehcE?6B~Y`Rct)x zA0XTyuc1$DJnu8i=TE=XPW{Gt#z7+Tv^RaH>oxzT`s=Br>Aqt(f~;oQyhi+X;S1j= zHbzcNoqE3u*Ecc0IREM!b@>r-?tSh4`rwNX1$^D7-nsB^{pYv8#=PsEk@;ujsp3ZK z1rt*L)Z72(PrtHHm$F(e359i`segBRIyHfx)lf?*$o)Ite`{3dQm0Oh_3i6UO(zni zX={?21(ux!xY5E{K5kA3viXA}eP!OoT6Wf1whf-j=QE+s&cpc0XD~ON3dYjO&P+Bv zF&)e2IuB1A>BRSiIw#VxTxT>B=exIO8eqMsfrkb7qNPu+(jJkEAacCOxd{4dDwdxG zd_EDy7t=<2Mn;!k<7+LhS)jxMKGC=@jW6U?0%LG6!cSu^2)dBl{tl0)vUB855j>-+ z7al@VeodkJ9NsCZCp`4n5%FJmVe#+x{)_N^edh{eMPuEg?|i0y#yBa~UBdgv!dDT+ zy31B$2}Ek7Kk>>=BEGdMufvI4ZZY)qAI{zq1hS0z0xLZ@7Ve&Jekfzp0EUdqzp5%heEE~d~!7Q}jyP)Y{Jkv{s{XpJ}nWEj` zqaPj#@|r&Y)F1eC$e51t#4aE<=F=bxfw@g?=}!h^;YU(5B!tyGr($j@h z)?8RgRW0#s1 zith&Pj^<-i_-+Tk8Ri8u5dH!@wW59I;HhQxbfH~y@YJ$;phiNKo;tgp>O8fg9(;Um z$E5+=_vEZfT6E>2dPW6LW`Xcj^+6U?$f|&w%KF5%ZgtD;*VXH(T%qdq$nAl>3J!h_ zdMYZaT95b7&deRH-Lcv1PNhYo^ey*ih#`|rWQf!$>qQxMyF0!=H3 z9n4^4K;CgWgszLK^eobohN0d40ax)QmxGZp%QMQhD>9I-=%pn}Jp_j!Tdez>U&u;X z);f9yuXd%JRZo>G<*a%tFDZqYcXmA$6;-XrJXTSUhs%_RWWQHjmux$mGVN-I*14^? zWfT?kRJ-ENrl-mkw~U&ZLVc=Sac9+2?TYKIs8FArIf<$*2(Z{zT>Yz2eh7(9=kpPK zSaQ~RHJ6{BbzZGT58JihYG|k?eB0t9+KzTijv;$bw z6}R%jRJ^Aw+p0OPl(XuoT%p3sG^?J<3)39*R8&;8p3}Wjma$K9rL1ygDx+rx!$YmO zRjy1G^c)Be&AP*8n!?;$M%NNwQOdLmAIO~Bic(e&XS79GQSdwC*?xs+|CJ$5e&{Y; z_@AJ!fqt-H|2UHm|6r8ADXaaiOsw7<9_sGd9N65wYjhV#q%SgOGWuMRJTeyY{+1F=AN@4)EU zgJwRPzRk=Y$p!dk)|?AU<;`pg|E;y>SSFFqmO0;>v({RMrDXx%(yDH)wu^3ong=Yp zNoxvg7Fe+J^(8A5um2g!w(o*pujB)L;Pw9x z+V(%-o0WX!#o+b-66(AI{8LJPbP&A$zd}K4H`gid9e+;$00e%bYfO^{PuoCw4 zbtE%6m;4gSFG%JmUG`kXXE<69xB~2W4(xfdT;Y4SAQpGCEi;h;{2$%*Kcg-5|2Ycc zJN!nyO#kvX4?!LP0=DBpnsKg_hlisOte0YOU=`}qE#<@C{TgJbAK~B_+H;O7clA#o z*eJ!K^*zw~WYqmFi`M^Ea`$hew%!Bz`BIPXrLTZzT>(43ijVjoQ1Yv3^NbXW(Aki$ zR`LyBfb3Q!zX^6+*P-N}Ujv!;_pQH-Tqz|%&69<<%~o=k82 z=rIWHlw#5QF4}vklE2UQuI^Iu{tGc48L!Y`5W*LD0z@SOKOvH<0q`kgG#>bAyD04SJ7^~1_a@^y1#rkqKyLeAOxcb zRDb!t{4Ma0P>T1}!w6ni<#xe0}9%_i1au9Zw^8LCM1g_{S*~VvN2m z{}YDrU2y^UCn!btT!ZnY%bnz$@uU=sNBLHHPfC{@>TSsrevD)NfG`Z!p_A} diff --git a/plugin/oji/MRJ/testing/LiveConnect/Test.html b/plugin/oji/MRJ/testing/LiveConnect/Test.html deleted file mode 100644 index 7d671e492342..000000000000 --- a/plugin/oji/MRJ/testing/LiveConnect/Test.html +++ /dev/null @@ -1,35 +0,0 @@ - - -Testing LiveConnect - - - - - - - diff --git a/plugin/oji/MRJ/testing/SwingApplet/TestApplet.java b/plugin/oji/MRJ/testing/SwingApplet/TestApplet.java deleted file mode 100644 index 529677480c9e..000000000000 --- a/plugin/oji/MRJ/testing/SwingApplet/TestApplet.java +++ /dev/null @@ -1,32 +0,0 @@ -import java.awt.event.*; -import java.applet.*; -import javax.swing.*; -import java.awt.*; - -public class TestApplet extends JApplet implements ActionListener -{ - TestFrame tFrame; - - public void init() - { - getContentPane().setLayout(new BorderLayout()); - TestPanel tPanel = new TestPanel(); - getContentPane().add("Center", tPanel); - - Button showBtn = new Button("Show"); - showBtn.addActionListener(this); - Panel bottomPanel = new Panel(); - bottomPanel.setLayout(new FlowLayout()); - bottomPanel.add(showBtn); - getContentPane().add("South", bottomPanel); - - tFrame = new TestFrame(); - } - - public void actionPerformed(ActionEvent e) - { - tFrame.setVisible(true); -// tFrame.dispose(); - } - -} diff --git a/plugin/oji/MRJ/testing/SwingApplet/TestApplet.mcp b/plugin/oji/MRJ/testing/SwingApplet/TestApplet.mcp deleted file mode 100644 index 2e1b0125e5a5b906ea61ff825ef0e9e2ef3f5937..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 37180 zcmeHQdu$xXd7nMJeL^9E;SElt}T!D@m7v>cTo6*W^+6 z>fKUS-AZK>Ax-QAG4cY6xJh$scYL1TGLHXvcP{_D?V^V0=k z59>=L^gAsIB11;!joiFZ&i5*8G@ck84@Gro8QRb2 zDMzwcypV{eyz8REJS!86MLg9^enmAi&_m5+#|8$S;SUi=cCdwPSU!R(vnbGqhv%finvTvM9Wv5^W-sU(s z5%Ul!3lGJn<0uRCX~`9?Ox4A;EY-$#jay|Q#hz{tF-I*Mr(_H^ zX1Oi61B;`XJHTZl?qD_6x!E4oV;St7%a){k5VQrl$H4L+FU8P)t%=5-0&K?s=nAXW zm=sywnB;PJbP4iM0AiK~M_Y8q*l6RAXXo2-pF90C)#*GjJEM6L=?Z3-BS}UBJ76 zTY=kv_W*YS1Hj$D?ZA71JAn5A?*|?M9tFN1_z3V(;KRUf;4$C_fIUF0`NU!1Az&Bq zIPfvx2Z4_RPXK#?eZZ5z2(TYG02~CK0-gpA0f&KSfFr;tFbrHRU|p$Cwu7Z_)|Wb` zEketL)C09>>Om4xn-Lox2j11h!R@qeQ2xE?&-ELID395 z7K%=uk4Z5qA-k3>!%`_^BpK9>N)@AkXav%h0tltORRb#><5_iJ|D)X!ehEl>B3uMY z&A`6~Wc>&)0+}D-&w;c-!gqnRd%{~ljyC{}ve^d!8v8x%7@)B~)8+vh`z8AUK%0g` zeFC)Kgv0&-&^`-?{RE)B0*8GCpnV69>MPp6fo6XJ1eh=T4ImJL!@dIuaGc>d1qhsh z!|@6bNWkH^1qd)-_9;Ms`Lf>v0x!d%?f`+;;IJ+kTau!IWq3f*AA-L}(bV}~Mc;tGPto6pzhBWmga4pOH&U-0mjR6r z!#N;H(a5|wo&p*#!eJPo@gs1;k`#@fhu@`Wwr{th{{}wW4AA%!I2@A!LD~q%azK#v zIENW_?d9nzDx!Jqe#S4QQT&LpuXB|27=XJ%Hxlg%g#eX#NxUY@6E`f*dAq-|E#{ zGj>cu8`s`hnwA(CJ=!fR!*deMB;&BYVzd}5_yjH~9Sx3B$h!;}v-1R8RD;B^f zd=2;-@HJp+fa3!P+6ExU!{WFH`lf>Igi{PA^97#t&!qK?A$od5k9nLIN%2^|z`cry zPKIQXL*YZ=BcjI&dN!F8JrnulrDQy1CPM5>aW`+)NT)0jqG!1Oj3a$2c}Y)XaVVQG zWL`Z{Jv0A=kxVgb2$LDB0~q(c4Ck?;>z;-40MT)3=sqeeou0|u%8yTr=VUV6bvPz@ z_S1js6o>)#voFVyPmg0iNUf#g2?M98VW}?}JeZHCbxWrRk|)UOy6_BcW|$gtNXpyJ zq;9Ga`NG$_2CVf7_uw3d2;Ap#JR)#E%W;XoeV;Wxac^bq|GAgp8jbK2kn1o)0m!u$ z;WvO>PZ6F6a?M2GK347j#Y>>AGsWK{#svuW?_g_Wv69T-$&E?K~XrBLUhB9Hs|o&%n7?l0v%%e}|$! z3t#R3wJ(9bU-4goulE0?^)KXn8~j}=&OgHMG-=;`moz{dr|n7qE8iGAzqt6t=ia5f z{cP5j1~^W3!m-9nj*6sr!EVkiE`IX=)>d`=(yp2YID)9dl3vb zSTJi~3$PWqv3T-PE%AB`Gf$JYs@>Bzb)s~SIvv`sPM+?SJ`{NiEFhLmrP?2QDAZrG zd8|{i$`NTB4Xg(1+j@5NY+rOBJaBHnJ4G+q@`w$N@;&>SnH(bdmILK8pCGt2-w+UI zX)?X1Ib#`W-@Tp)tqhReS_O0CzOvE>u$;G!Ggl@FZK%4%%H;T|*R}>^&$U;9hT+4? zG;k|drmE!Hnp~pp#-P;8`!CIJx4#tJ_pi7$qdn=-7S?SakDztTGM7810uF|ZY$%xh z`WHkna$W3s<6z5+4}PKL^&7ch_T`tw{$DvOhOEn9h9$a)y@-LR9?qwEV6ThRiYd>oE zwKn;zg!Oy`7E$tAJ>4N+^;~8SellMJYf%HGM|aj@=~to5{vESbP~z<&LM|5qV#C=i z-de5(S~MEVSBp?jST7>kXCKcro8_bRo;CHa-@yu9xdm&cwjE3G+eBNC*;B4k4W2qt9YR{Y%Q>qtgJ^b*4`JFrHmMN)GI&GFW=99K#F=^LcFm z+ZUp&LR$VEt7;ilESVX?Qq7P0pg>ju z+`cSN;=lnn-+o=coazOtUyfWJ*o)wxmmsIApt|MEI$tX&mAdFqsts9LjH^;#&_D=}Nmg6fx(tGWiSRj*=sYAnGaM}GIMiV9^=xN2Xo zm0F0HiV{vGtFE;01a4?3oy+D84jq-{hO<+1l|zLXotmppPQLmVov0kWphQ*3&|H7> z<7D28KC$Dyw*HPrM^09#Op$GC2~@4fb`a6nh}>~Hn68VuT7+EF8Ty)$J^Id#sIHRV*FQi>yQZ8=p1)h$QA zTvd*T$&|5VyH}l;Y%7}z_3D7srOmh%1Qq4fJLA@pQ|F9ZLCiw2Jax{vHRaSh<9Z7! zmZzZe-P9EUCflmBe?7u4Akw>eK7ubV)*M$0#(d3jwH`UF|EjG>R;VQE*<1nGzDmgg z+TpG>z5+ni?A0mJOI!g|ma|GLfK{Dwt4~a&J!QpOEpeu-DW`gYiZfG9In^hoCCI5N zsBSs$_DoqpKc$(n&Y7u#oCS0bbH=T6W~w6RTx7K73Y&3?V{ZjnYkWqjP%C`WVrer< zML8VNR%=F~EFadG1_EoWynb=tdm6xdK=|;lyjP4h;rLL67mVI}1@}vIb2Kn(7`dLV zE*%8#cw-!=jU^M4Xh~*aABbpzl6M|itZP7H8s#b zI5P3RsBYx5&*=G!1^Ge!CCkqkdOm|c<{h}4OJ(!;A5$OJp$7c>2kWrW9aV1Pq#_q- z{05j0z6OdK;DRF^PiBgY^+@<5+hTBgBKf$Ozc}9RX1yixuJNxwVvwj*VWg6uK`~JWg5`-^Y}hpFkHt;?Wgfg=>_mz zXZbCNuaWQCW8A~|N>0ODrEKm4zkz(nvGZH6b0jw9*!g$9h7U}Nv?0HkWE-ltfiD)o z=Uccoe*1o0htfuY<+SnJAYXJKe$vSgU&Hmbw2{g>`R({xl4#@qBa6;41KttS7D2SM)u0uJ}V`IO1O#Q*eG{|nds66j%*fAyb1tN)1G$a3z7 z9#BrZ9zv(_^`?XAT*1Zf#P{nh(b77z1(=N4ik z1w(ZHFLj~*r|!@Pp~glT|100T0DcGvc=QwC-!1u(u{ao=k}ambiSqPI{@CAs4ZH_T z{w(y-u-VLa%YTEn$K-GPANY;wxceT_#&=A<`%77E{K(LD%F(Va@IT=n1_B;<0e`u4 zPV%q3`B5;!k}ZyZ8~iP1{G%TOPd)9{_d`_ipc(%M9|FJIjDN>#s8_R+KLXw%lYeCc z${#Z0|M>5~J8be7_M`Y6CjXu9gLlN_w{3=R=6mHA)Xh=F-wR*biFWn)`#}={ZOmWV zn|9^R{{XGtL2i2t^d_@BJE+e`fq;YGLphsF{^R(PmmmT*e+SOvCjZl)0!V8A{I$G!wP zrXH?tih=RCWQ)QqSK-gv$f{ancZXV - - - diff --git a/plugin/oji/MRJ/testing/TrivialApplet/MyApplet.mcp b/plugin/oji/MRJ/testing/TrivialApplet/MyApplet.mcp deleted file mode 100644 index 0421a4d8f5e12e64417c36340c418a2404166577..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36100 zcmeHQeQX@Zb)P-*BvB@1N|q&AcB7LVin1vmB|A+7#*HZ*Nt+Z;yiyb>s7|fpaZR3d zcYD1%%CeHyM6ASV(*j1~CP144Zu^h_FbcOdS_S=55;t`Lw{GhQ{W1_2M$-TZ8aGX$ zegtNJznR(N?s4yKk9UqmaUVH5Z{EClJM-qv=kCs>EGr{~XcNLXAjGGCD8w^&2@(Dd zXb%}71D=AIHET{M3x%{*h$ITuIWtwVqt=B#mb{RR9L?u5W@#X{P%K&5$Z_+@C#=G3 zQ8?p{rc!3H7)c~c^X`bLWMR%MMNXQfQaU&1jvGm5%t$<$&##C%wvf)uMusnz3Q2d8 z4<9)mVVyi|=3MtDeJEW_7K>(fCSw*>M2@F(=RL@FojS`B>yP#I;V#)c^5>SMqF@lY z6C#UMcd$gGKD9EIF z$-5NO>D(mq>QPx2k9^p(5TtwLlVm$j+K)&J9ZwhCm2omvNastF3%Q&}y$)HavKUv< z%*Wj-NN21Pisd3sp<5a$Sh>=0Zq`E!iDV{AO{}cwA#-M7Zq6)3RC{v?W!rc-W6i)2 zyv=cBD&ZkgW*&;oCXpBD%fnEW@p-mw)_TpGmU9d}qK&wvpR^VVDKj!vFwNq+=x2jM z1{%15HDFJOFh>$0ozI_ykNJ~?pT@Oa|1^yOjdT9B zS>Xm{-=gsk!0*)fVfbAdAA`R|$srt$B>->&cw z?|Zw(Bk*@<{3GypYWz6-T^dipzeD4^?{1CrzIST;CHT}GAoMCOKOs>O`WAea4G_AH z%N~h}HtHjy@qO_3YW!pH83weSz~yd|0S2* zK3&XUSRnumAtcwf>t@#>%Ay`K%%6en_pl;a?Sq8Q{-QIw;030(sF_JD6xzd@- znz@n~7!U($;S|eoSyGIiOBO_YIwF%CjvkIaAO`HHOX<8Am@1?%q>~wy2;3Kvm9+U% zHe-tr17kzSUFkFF3uel~q%>8M_Zo|GnovR;vKF+K=C)TdzKntod5D{pg84cL|Ci^q?I|TMS?B@vV zci0~i4#C;|FUNECodnJ)*nbipgJVBRD8jKHC42&o;}79;a2$sS9Orp&!i#Y1PYE3J z*{2d-g|o+)YrxsR68;rV&yU1^0=MT!jMHP7L0&ySGFUG5y8wgztezhk1HkqC$l!cI z&yS2V!1esdm;=uA0OJW<^!!K?R&{~msqc*(xdti0J%riy!U2hOv8f6lQ%V3I>uIy* z3(JvA$HBAfjb!4tEX!MFs^DY&b}sXkv&00h00{vE8VEEHXrMt2upePR$Ue>YE!JkK$6#k7?x4#X$Nu%|pzNEXtj4C$3j zU^`US%?%E_2&3l+`iq;px_y_rcA@Jp}ecriEZOY%;chk8#2JIv*{hLDEsyjCSq!L2uADN){)Otu=~S2@Tu7#7HF6C<{rb{de3jGTtms-H*EHW zlTmB6nS@YL&ZsaJPcM?v98g|a!YSifqa(zvNCy~;jzB9=E@wkpDfQ*KE8JrdT***h zWWZ6WfyW*zmXd{4ww+30s|y?DEp?_p7%5qiu=VxlML70?=(%>V!5`Z5-{5#_A-{=%Q+uj86ZW)F=(X;b8rVCrY z*G>7xPU8$6(sXycF?cn+zx@#k>3I6$qwu!#-V7uDkO;*d6+MZ|^GnwU5&k&Si`@@C zs_&l=JD%K=m1*~UQKny%w%@b#w*!Z47oNZNZrHkVLf>V( zv}tVjY+do3(M~}>Jbz|15s6QqNl?1%h-5;;jJ#JJp`+8ot@t`^8(ceF7>^_1+57aH zPbEg9`GWa)`XY%dLGmJn+F~llhjouyCah0HKK5v?=(0_}pA8$2QR{Pz|N*SJ^ZUQVXQ1}*jcD}o|nMj*Fs?-c*C^rJ6)b?LvKHN>Xp_AXuhID$FQN3iz$BUtn(eYuVXw$xv z&)BH9<{W(Onvajbyy2;(FI=Y_80|5_g;GAn?3VmFITt@6hRY>hLbT z(|w12I=Wj=7Vgx3b$<0^wUXbvAnz5GmQowoU9#Jhb-DS(#EGNv;pp(`VeeFfBug8@ zMf;u;HI*E4-QBW!mK;GWo+Zol_OoS`Kwq()t87b!ABr>wF4=1<(5}s}nOuip()Q#0 zX5^?UQD)tooSQLqNF-2K>hESOUjt>@-W!`38t#qs4jr933NJAlo8o(T0R$RY)_`-! zH}p_%Tz%qCYX2cUU$-2@sFl(~2*So7$Nr7iyIu_Ue)~m)xlXDC`?aS^`g#xZaXufg zOaJ9pMjl&QdgrzEu9TqsYfA&3y~&|fmcbCu7+uD{wf$VDd^%#k9~=^!PFVOttri&Z zc%o2?!B5;En4HfgJ=1KHd&Hhm{)uP7%6%RGDZDu;CpPiR=fw}ukNorTw?yb`M>ZH6 zHnn~3d(X8m8qbP7hr5|lznPBxrw?t%;sD&>zkKBgoe+m*IF>0ETOnucT;cI39PhDO zV5Z~Kv7yzbx6_>kGI??`W`|enQ_j@z>8YrENq@Cc)N8p?&N;rb-&}o3IoYPvEDOR7 z#AfS#5R%TM^CJ{E2FI1HDZ1rnUR-Z7%-54`J9N^>$9TFyxLGT;0Iw-Hi`0c;A=Q)+ zB&HlfG{w(6L{sfc%Hd}s0G4&mr+&!i)Q^?}`>77Lo~v`Hm?*zZ0Z{&G>&x+xx)NG> z4c}-zW~+LHR#{kaJ~LCPwAF-lt@B$N{UuO^ludH1s32Abm!(w3EQjS-u^jZo{K#p2 zpX!+vN%WH+*%ww9;Y-dSxa_{LmMA~@VS3&7R2Ai0j&AGK1o@GpdC)~yv9OK?EDTbr zk}WmBrSsYK3Hl^{WM^yRpkt#Tn$)iRXGqN z!KbCxm*dY;Ys$gVArIUiahwKXXVUh!w$w6eSTb)2OI4@KAVYQrDt(!sR9{~u-5K^T zr*?+?%aPLqXBJ#|19EB#@-4^vji7R#>dE1{Lh89@Ze)Gw6LhLqn397djA{V#<5Nzm zX36T6Yq4Ce)O;-q@-HV}a}HjwT;=@KnSw)(JmaT^3T0HZW?Qe9THqOhf@mgPbEbu_ z79ykByj3W%>!>a_YR#Oh9xKGe%sGE@3bl{Gp>oWk7FFejYW~f0fV?Mt;;tKQ{vD5x zAFEQBGTBiRJbB9#;)!v&;`EHvL|<}Rw9_zgY%EeMFN}*PrftipTCT*nRntoA-GlLG z;aauMd0$4#s@l;#xZjbot{k5uWnDS7hm>;9TVGC1LB8df7i-F)jno5K?={CI$IPZm zxw>(a#zx#Kg35CIj=1&Y_#APoh*>P>$LEM!SB~Ei*IQ6IKSh(@;Wq^sY-^7GeuSR| z(~on11cwmT?N^JXg}VK!A2}?4%Vs1^Dv5elGXTd4jm)4EZeQaw02IwxoMpVh89;S8 zEt&zebi}PaFfFestCp(4k+QCw+8HX3Om*ed9+(=CQ&W&{IX~`^vWk9|M@pX~Qx!Rj zXdY_B^*J)tkaIdVQFn$-o^sz?Mb;W0QL2;*$M-ZgqEwZ`9<3!KihY(41qQG#H83BgT7tSCr*Ig1_$`)U*lMmbMjcJXuA ze~RpFRP_IN1$1=+vgrIf;9AbbUjvR69ij8vxNKJZfAn48`ryRQcYtqE^yps!-vkHP z|Lc&yLD8SYsb2Q)$o9Mp{9}s#_P+zyhtPJu3tY?Dc^&vIaDd)#LC!xZ{yx6((J9HI zi!wVEea9kj{kyaGd|DuQqMZd;<3-12` zdVYY*jHK^<_Y!dZJGFgJ0zabo-~JHrZE%1-p6cJF=nuXH{5Cki{wZ9vK7aOy#7PBx z9v7|8zxX8)qv8(#6!h6H`CtCVS|w*ZNH*Nc`sEjqVKD~dlfy4@BG`8-HJ~jt^Cb;czM`Qc$1RzJI{i^ zx&bWY!LRIDe381kSCU2V>+o&)UjyE!=v{12?b&4I9(Nbp0qB*d0RH@sK$h*x`1Hry gz;jT^`4r@YRl5tF83ye>MZfp|;CEy#*84L2KhVOt9{>OV diff --git a/plugin/oji/MRJ/testing/TrivialApplet/TrivialApplet.html b/plugin/oji/MRJ/testing/TrivialApplet/TrivialApplet.html deleted file mode 100644 index bc293dc5c393..000000000000 --- a/plugin/oji/MRJ/testing/TrivialApplet/TrivialApplet.html +++ /dev/null @@ -1,70 +0,0 @@ - - -TrivialApplet - - - - - - - - -

- - - -

- -
- -The source. - -
- -

- - - - - -

- -
- - - diff --git a/plugin/oji/MRJ/testing/TrivialApplet/TrivialApplet.java b/plugin/oji/MRJ/testing/TrivialApplet/TrivialApplet.java deleted file mode 100644 index e3e57de63314..000000000000 --- a/plugin/oji/MRJ/testing/TrivialApplet/TrivialApplet.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - Trivial applet that displays a string - 4/96 PNL -*/ - -import java.awt.*; -import java.awt.event.*; -import java.applet.Applet; -import java.net.URL; -import java.net.MalformedURLException; - -import netscape.javascript.JSObject; - -class AboutBox extends Frame { - AboutBox(Menu aboutMenu, ActionListener[] actionListeners) { - super("About Applet"); - - addWindowListener( - new WindowAdapter() { - public void windowClosing(WindowEvent e) { - dispose(); - } - }); - - Button okButton = new Button("OK"); - okButton.addActionListener( - new ActionListener() { - public void actionPerformed(ActionEvent e) { - dispose(); - } - }); - - // Annoying use of flow layout managers. - Panel labelPanel = new Panel(); - Panel buttonPanel = new Panel(); - Panel fieldPanel = new Panel(); - - labelPanel.add(new Label("This applet's about box...")); - buttonPanel.add(okButton); - - fieldPanel.add(new TextField(20)); - fieldPanel.add(new TextField(20)); - - add(labelPanel, "North"); - add(buttonPanel, "Center"); - add(fieldPanel, "South"); - - // test menu bar stuff. - MenuBar menuBar = new MenuBar(); - aboutMenu = (Menu) cloneMenu(aboutMenu); - for (int i = 0; i < actionListeners.length; i++) - aboutMenu.getItem(i).addActionListener(actionListeners[i]); - menuBar.add(aboutMenu); - setMenuBar(menuBar); - - pack(); - show(); - } - - private MenuItem cloneMenu(MenuItem oldItem) { - if (oldItem instanceof Menu) { - Menu oldMenu = (Menu) oldItem; - Menu newMenu = new Menu(oldMenu.getLabel()); - int count = oldMenu.getItemCount(); - for (int i = 0; i < count; i++) { - newMenu.add(cloneMenu(oldMenu.getItem(i))); - } - return newMenu; - } else { - MenuItem newItem = new MenuItem(oldItem.getLabel()); - return newItem; - } - } -} - -class ExceptionThread extends Thread { - ExceptionThread() { - start(); - } - - public void run() { - throw new Error("this is an error!"); - } -} - -public class TrivialApplet extends Applet { - public Button goButton; - public Button aboutButton; - public TextField urlField; - public PopupMenu contextMenu; - public Menu aboutMenu; - public ActionListener[] actionListeners; - private static int appletCount; - - public void init() { - ++appletCount; - - goButton = new Button("Go"); - aboutButton = new Button("About"); - - String urlText = getParameter("URL"); - if (urlText == null) - urlText = "http://www.apple.com"; - - urlField = new TextField(urlText); - - ActionListener goListener = - new ActionListener() { - public void actionPerformed(ActionEvent e) { - try { - URL location = new URL(urlField.getText()); - System.out.println("going to URL: " + location); - JSObject window = JSObject.getWindow(TrivialApplet.this); - if (window != null) { - //window.eval("alert('going to location " + location + "');"); - window.eval("println('" + location + "')"); - } - getAppletContext().showDocument(location, "_new"); - } catch (MalformedURLException mfue) { - } - } - }; - - ActionListener aboutListener = - new ActionListener() { - public void actionPerformed(ActionEvent e) { - new AboutBox(aboutMenu, actionListeners); - } - }; - - goButton.addActionListener(goListener); - aboutButton.addActionListener(aboutListener); - - add(goButton); - add(aboutButton); - add(urlField); - - // Try a pop-up menu, and a menu in the menubar. - contextMenu = new PopupMenu(); - aboutMenu = new Menu("About"); - - contextMenu.add(newItem("About", aboutListener)); - aboutMenu.add(newItem("About", aboutListener)); - - contextMenu.add(newItem("Go", goListener)); - aboutMenu.add(newItem("Go", goListener)); - - ActionListener errorListener = new ActionListener() { - public void actionPerformed(ActionEvent e) { - new ExceptionThread(); - } - }; - contextMenu.add(newItem("Error", errorListener)); - aboutMenu.add(newItem("Error", errorListener)); - - ActionListener[] listeners = { aboutListener, goListener, errorListener }; - actionListeners = listeners; - - add(contextMenu); - - // add a mouse listener that causes the pop-up to appear appropriately. - MouseListener mouseListener = new MouseAdapter() { - public void mousePressed(MouseEvent e) { - if (e.isPopupTrigger()) { - e.consume(); - contextMenu.show(TrivialApplet.this, e.getX(), e.getY()); - } - } - }; - - addMouseListener(mouseListener); - } - - private MenuItem newItem(String title, ActionListener listener) { - MenuItem item = new MenuItem(title); - item.addActionListener(listener); - return item; - } - - private Frame getFrame() { - Component p = this; - while (p != null && !(p instanceof Frame)) - p = getParent(); - return (Frame)p; - } - - // public void paint( Graphics g ) {} - - public boolean mouseEnter(Event evt, int x, int y) { - showStatus("Welcome!"); - return true; - } - - public boolean mouseExit(Event evt, int x, int y) { - showStatus("See you later!"); - return true; - } - - public void print(String message) { - JSObject window = JSObject.getWindow(this); - Object[] args = { message }; - window.call("println", args); - } - - public int getAppletCount() { - return appletCount; - } -} diff --git a/plugin/oji/MRJ/testing/TrivialApplet/TrivialApplets.html b/plugin/oji/MRJ/testing/TrivialApplet/TrivialApplets.html deleted file mode 100644 index 6321529d7da1..000000000000 --- a/plugin/oji/MRJ/testing/TrivialApplet/TrivialApplets.html +++ /dev/null @@ -1,77 +0,0 @@ - - -TrivialApplets - - - - - - -
- - - - - -
- - - - - -
- -

-The source. -

- -
- - - - - - - -
- - - diff --git a/plugin/oji/MRJCarbon/MRJSDK/JavaFrameworks/JavaEmbedding/JavaApplet.h b/plugin/oji/MRJCarbon/MRJSDK/JavaFrameworks/JavaEmbedding/JavaApplet.h deleted file mode 100644 index eda17e26821a..000000000000 --- a/plugin/oji/MRJCarbon/MRJSDK/JavaFrameworks/JavaEmbedding/JavaApplet.h +++ /dev/null @@ -1,393 +0,0 @@ -/* - File: JavaEmbedding/JavaApplet.h - - Contains: interface to embedding a Java Applet in a Carbon Control - - Version: JavaEmbedding-3~36 - - Copyright: © 2000-2001 by Apple Computer, Inc., all rights reserved. - - Bugs?: For bug reports, consult the following page on - the World Wide Web: - - http://developer.apple.com/bugreporter/ - -*/ -#ifndef __JAVAAPPLET__ -#define __JAVAAPPLET__ - -#if __MACHO__ -#ifndef __CORESERVICES__ -#include -#endif - -#ifndef __JAVACONTROL__ -#include -#endif - -#else - -#ifndef __CFURL__ -#include -#endif - -#ifndef __JAVACONTROL__ -#include -#endif - -#endif - - -#if PRAGMA_ONCE -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=mac68k -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(push, 2) -#elif PRAGMA_STRUCT_PACK - #pragma pack(2) -#endif - -#if PRAGMA_ENUM_ALWAYSINT - #if defined(__fourbyteints__) && !__fourbyteints__ - #define __JAVAAPPLET__RESTORE_TWOBYTEINTS - #pragma fourbyteints on - #endif - #pragma enumsalwaysint on -#elif PRAGMA_ENUM_OPTIONS - #pragma option enum=int -#elif PRAGMA_ENUM_PACK - #if __option(pack_enums) - #define __JAVAAPPLET__RESTORE_PACKED_ENUMS - #pragma options(!pack_enums) - #endif -#endif - - -/* - * AppletDescriptor - * - * Discussion: - * The structure for describing applet. This is used as the - * definition of the applet to create when you call CreateJavaApplet. - */ -struct AppletDescriptor { - CFURLRef docBase; - CFURLRef codeBase; - - /* - * The attributes found in the tag formatted as a - * CFDictionary of CFStrings. For attributes like height and width - * they should be in screen coordinates. some Applets define them as - * % (for example 90%) and should be converted to pixels before put - * into the dictionary. - */ - CFDictionaryRef htmlAttrs; - - /* - * The parameters to the applet formatted as a CFDictionary of - * CFStrings. These are typically found in tags inside of - * the applet tag. - */ - CFDictionaryRef appletParams; -}; -typedef struct AppletDescriptor AppletDescriptor; - -/* - * AppletArena - * - * Discussion: - * This is an opaque type that represents an AppletArena - an applet - * arena represents a single classloader, so all applets that share - * an arena share a common classloader. - */ -typedef struct OpaqueAppletArena* AppletArena; -/* - kUniqueArena is the value to pass to CreateJavaApplet if you want the applet to be created - in a unique arena. A unique arena is one which is guaranteed not to be shared with - any other applet running in this Java VM. This is the appropriate default value to - pass to CreateJavaApplet. -*/ -#define kUniqueArena ((AppletArena)NULL) - -/* - * JE_ShowDocumentCallback - * - * Discussion: - * Type of a callback function used for show document (link) message - * from an applet. - * - * Parameters: - * - * applet: - * The applet which sent this show document message. - * - * url: - * The url to load. - * - * windowName: - * A string definition of where to open the url. Null means open - * in place, other strings are defined in the HTML spec, like - * "_top" means the parent window of the applet if it happens to - * be in a frame, etc. - * - * userData: - * Data specified when this callback was registered using - * RegisterShowDocumentCallback. - */ -typedef CALLBACK_API_C( void , JE_ShowDocumentCallback )(jobject applet, CFURLRef url, CFStringRef windowName, void *userData); - -/* - * JE_SetStatusCallback - * - * Discussion: - * Type of a callback function used for a status message from an - * applet. - * - * Parameters: - * - * applet: - * The applet which sent this status message. - * - * statusMessage: - * The message to be displayed. - * - * userData: - * Data specified when this callback was registered using - * RegisterStatusCallback. - */ -typedef CALLBACK_API_C( void , JE_SetStatusCallback )(jobject applet, CFStringRef statusMessage, void *userData); -/* - * CreateAppletArena() - * - * Discussion: - * Create an applet arena. By default each applet you create will - * have its own "arena". By creating an applet arena, and passing - * that arena into two or more CreateJavaApplet calls, those applets - * will share a single classloader and thus be able to communicate - * with each other through static objects. - * - * Parameters: - * - * outNewArena: - * The newly created applet arena. - * - * Availability: - * Mac OS X: in version 10.1 and later in Carbon.framework - * CarbonLib: not available - * Non-Carbon CFM: not available - */ -extern OSStatus -CreateAppletArena(AppletArena * outNewArena); - - -/* - * CreateJavaApplet() - * - * Discussion: - * Creates a java applet from a descriptor. - * - * Parameters: - * - * env: - * The JNI environment for the current thread. - * - * applet: - * A full descriptor of the applet being loaded. See - * AppletDescriptor. - * - * trusted: - * Whether this applet should be loaded as trusted. - * - * arena: - * The arena for this applet. If this is set to null then a new - * arena will be created. This is the typcial case for applets. - * - * outJavaFrame: - * The applet itself to be used for registering callbacks and - * creating controls. - * - * Availability: - * Mac OS X: in version 10.1 and later in Carbon.framework - * CarbonLib: not available - * Non-Carbon CFM: not available - */ -extern OSStatus -CreateJavaApplet( - JNIEnv * env, - AppletDescriptor applet, - Boolean trusted, - AppletArena arena, /* can be NULL */ - jobject * outJavaFrame); - - - -/* - * AppletState - * - * Summary: - * Constants that are passed to SetJavaAppletState. - */ - -enum AppletState { - kAppletStart = 1, /* Starts the applet processing 3.*/ - kAppletStop = 2, /* Halts the applet, but it can be started again.*/ - kAppletDestroy = 4 /* Tears down the applet.*/ -}; -typedef enum AppletState AppletState; - - -/* - * SetJavaAppletState() - * - * Discussion: - * Sets the state of the current applet as defined by the applet - * spec. Applets can be started and stopped many times, but - * destroying them is final. - * - * Parameters: - * - * env: - * The JNI environment for the current VM and thread. - * - * inAppletFrame: - * The applet to register the status callback (from - * CreateJavaApplet). - * - * inNewState: - * Host defined data passed into showStatusFunction. - * - * Availability: - * Mac OS X: in version 10.1 and later in Carbon.framework - * CarbonLib: not available - * Non-Carbon CFM: not available - */ -extern OSStatus -SetJavaAppletState( - JNIEnv * env, - jobject inAppletFrame, - AppletState inNewState); - - - -/* - * RegisterStatusCallback() - * - * Discussion: - * Registers your function that will be called to update the - * applet's status area. Status typically is put in a web browser as - * a text area at the bottom of the page. - * - * Note that this callback will be called from a preemptive thread, - * and if the host application is using cooperative threads they - * will need to push this into their own event system in order to - * handle this correctly. - * - * Parameters: - * - * env: - * The JNI environment for the current VM and thread. - * - * inJavaFrame: - * The applet to register the status callback (from - * CreateJavaApplet). - * - * showStatusFunction: - * The function that will be called when the applet calls - * showStatus(...). - * - * userData: - * Host defined data passed into showStatusFunction. - * - * Availability: - * Mac OS X: in version 10.1 and later in Carbon.framework - * CarbonLib: not available - * Non-Carbon CFM: not available - */ -extern OSStatus -RegisterStatusCallback( - JNIEnv * env, - jobject inJavaFrame, - JE_SetStatusCallback showStatusFunction, - void * userData); - - - -/* - * RegisterShowDocumentCallback() - * - * Discussion: - * Registers your function that will be called when the applet - * behaves like a hyperlink. This will be called to move an - * embedding host application to a new URL. - * - * Note that this callback will be called from a preemptive thread, - * and if the host application is using cooperative threads they - * will need to push this into their own event system in order to - * handle this correctly. - * - * Parameters: - * - * env: - * The JNI environment for the current VM and thread. - * - * inJavaFrame: - * The applet to register the show document callback (from - * CreateJavaApplet). - * - * showDocumentFunction: - * The function that will be called when the applet calls - * showDocument(). - * - * userData: - * Host defined data passed into showDocumentFunction. - * - * Result: - * An operating system status code. - * - * Availability: - * Mac OS X: in version 10.1 and later in Carbon.framework - * CarbonLib: not available - * Non-Carbon CFM: not available - */ -extern OSStatus -RegisterShowDocumentCallback( - JNIEnv * env, - jobject inJavaFrame, - JE_ShowDocumentCallback showDocumentFunction, - void * userData); - - - - -#if PRAGMA_ENUM_ALWAYSINT - #pragma enumsalwaysint reset - #ifdef __JAVAAPPLET__RESTORE_TWOBYTEINTS - #pragma fourbyteints off - #endif -#elif PRAGMA_ENUM_OPTIONS - #pragma option enum=reset -#elif defined(__JAVAAPPLET__RESTORE_PACKED_ENUMS) - #pragma options(pack_enums) -#endif - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=reset -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(pop) -#elif PRAGMA_STRUCT_PACK - #pragma pack() -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __JAVAAPPLET__ */ - diff --git a/plugin/oji/MRJCarbon/MRJSDK/JavaFrameworks/JavaEmbedding/JavaControl.h b/plugin/oji/MRJCarbon/MRJSDK/JavaFrameworks/JavaEmbedding/JavaControl.h deleted file mode 100644 index 08f70c8f5976..000000000000 --- a/plugin/oji/MRJCarbon/MRJSDK/JavaFrameworks/JavaEmbedding/JavaControl.h +++ /dev/null @@ -1,461 +0,0 @@ -/* - File: JavaEmbedding/JavaControl.h - - Contains: interface to embedding Java code in a Carbon Control - - Version: JavaEmbedding-3~36 - - Copyright: © 2000-2001 by Apple Computer, Inc., all rights reserved. - - Bugs?: For bug reports, consult the following page on - the World Wide Web: - - http://developer.apple.com/bugreporter/ - -*/ -#ifndef __JAVACONTROL__ -#define __JAVACONTROL__ - -#if __MACHO__ -#ifndef __HITOOLBOX__ -#include -#endif - -#include -#else -#include -#endif - -#if PRAGMA_ONCE -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=mac68k -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(push, 2) -#elif PRAGMA_STRUCT_PACK - #pragma pack(2) -#endif - - -/* - * Summary: - * JavaControl Embedding errors - * - * Discussion: - * The following are all errors which can be returned from the - * routines contained in this file. Most are self explanatory. - */ -enum { - errJavaEmbeddingNotYetImplemented = -9950, - errJavaEmbeddingIntializationFailed = -9962, /* previously errClassConstructorNotFound, errClassNotFound, and errMethodNotFound*/ - errJavaEmbeddingMissingURL = -9955, /* previously errMissingURL*/ - errJavaEmbeddingCouldNotCreateApplet = -9956, /* previously errCouldNotCreateApplet*/ - errJavaEmbeddingCouldNotEmbedFrame = -9957, /* previously errCouldNotEmbedFrame */ - errJavaEmbeddingCouldNotConvertURL = -9958, /* previously errCouldNotConvertURL*/ - errJavaEmbeddingNotAFrame = -9959, /* previously errNotAFrame*/ - errJavaEmbeddingControlNotEmbedded = -9960, /* previously errControlNotEmbedded*/ - errJavaEmbeddingExceptionThrown = -9961 /* previously errExceptionThrown*/ -}; - - - -/* - * MoveAndClipJavaControl() - * - * Summary: - * Positions the control in the containing window, and sets the clip - * bounds for drawing. - * - * Discussion: - * All coordinates are local to the host window, and 0,0 is the top - * left corner of the content area of the host window - just below - * the title bar. - * Usually a call to MoveAndClipJavaControl is followed by a call to - * DrawJavaControl. - * - * Parameters: - * - * env: - * The JNI Environment for the current thread. - * - * theControl: - * The Java control (applet). - * - * posX: - * The x position of the control. - * - * posY: - * The y position of the control. - * - * clipX: - * The left of the clip region. - * - * clipY: - * The top of the clip region. - * - * clipWidth: - * The width of the clip region. (Notice this is not right, but - * width) - * - * clipHeight: - * The height of the clip region. (Notice this is not bottom, but - * height) - * - * Availability: - * Mac OS X: in version 10.1 and later in Carbon.framework - * CarbonLib: not available - * Non-Carbon CFM: not available - */ -extern OSStatus -MoveAndClipJavaControl( - JNIEnv * env, - ControlRef theControl, - int posX, - int posY, - int clipX, - int clipY, - int clipWidth, - int clipHeight); - - -/* - * SizeJavaControl() - * - * Summary: - * Sets the size of the Java control. - * - * Availability: - * Mac OS X: in version 10.1 and later in Carbon.framework - * CarbonLib: not available - * Non-Carbon CFM: not available - */ -extern OSStatus -SizeJavaControl( - JNIEnv * env, - ControlRef theControl, - int width, - int height); - - -/* - * ShowHideJavaControl() - * - * Summary: - * Makes a Java control visible or invisible. - * - * Parameters: - * - * env: - * The JNI Environment for the current thread. - * - * theControl: - * The Java control (applet). - * - * visible: - * True shows the control. - * - * Availability: - * Mac OS X: in version 10.1 and later in Carbon.framework - * CarbonLib: not available - * Non-Carbon CFM: not available - */ -extern OSStatus -ShowHideJavaControl( - JNIEnv * env, - ControlRef theControl, - Boolean visible); - - -/* - * StopJavaControlAsyncDrawing() - * - * Summary: - * Stops a Java applet from drawing asynchonously. - * - * Discussion: - * Many applets are used for animation and they draw themselves at - * times other than when the control is drawn. In order to handle - * things like live resize and scrolling a host app must be able to - * suspend asynchronous drawing otherwise a draw may occur before - * the host app is able to reposition/reclip the control thus - * causing drawing in the wrong location. When async drawing is off - * normal paint events in an applet are ignored. Only - * DrawJavaControl events are allowed to paint. This allows - * temporary fine grained control of when an applet can paint, and - * should only be used when needed. - * - * Parameters: - * - * env: - * The JNI Environment for the current thread. - * - * theControl: - * The Java control (applet). - * - * Availability: - * Mac OS X: in version 10.1 and later in Carbon.framework - * CarbonLib: not available - * Non-Carbon CFM: not available - */ -extern OSStatus -StopJavaControlAsyncDrawing( - JNIEnv * env, - ControlRef theControl); - - -/* - * RestartJavaControlAsyncDrawing() - * - * Summary: - * Allows a Java applet to draw asynchonously. - * - * Discussion: - * This should be called when it is safe again for an applet to draw - * asynchronously. See StopJavaControlAsyncDrawing. - * - * Parameters: - * - * env: - * The JNI Environment for the current thread. - * - * theControl: - * The Java control (applet). - * - * Availability: - * Mac OS X: in version 10.1 and later in Carbon.framework - * CarbonLib: not available - * Non-Carbon CFM: not available - */ -extern OSStatus -RestartJavaControlAsyncDrawing( - JNIEnv * env, - ControlRef theControl); - - -/* - * DrawJavaControl() - * - * Summary: - * Causes a Java control that to be drawn. - * - * Discussion: - * This should be called whenever the host app needs the - * applet/control to be redrawn. In the case where Async drawing is - * paused, DrawJavaControl will still cause the applet to draw. So - * if the host app is stopping async drawing for something like live - * scrolling, if there are convenient times the host app should call - * DrawJavaControl (usually after a call to MoveAndClipJavaControl) - * to provide some feedback to the user. - * - * Parameters: - * - * env: - * The JNI Environment for the current thread. - * - * theControl: - * The corresponding Java control (applet) that is to be drawn. - * - * Availability: - * Mac OS X: in version 10.1 and later in Carbon.framework - * CarbonLib: not available - * Non-Carbon CFM: not available - */ -extern OSStatus -DrawJavaControl( - JNIEnv * env, - ControlRef theControl); - - - -/* - ======================================================================================== - UTILITY API - functions to determine the status of a window or control - ======================================================================================== -*/ - -/* - * GetJavaWindowFromWindow() - * - * Discussion: - * Given a native Carbon window this returns the corresponding Java - * window. - * - * Parameters: - * - * env: - * The JNI Environment for the current thread. - * - * inMacWindow: - * A reference to a native window. - * - * outJavaWindow: - * The corresponding Java window. - * - * Availability: - * Mac OS X: in version 10.1 and later in Carbon.framework - * CarbonLib: not available - * Non-Carbon CFM: not available - */ -extern OSStatus -GetJavaWindowFromWindow( - JNIEnv * env, - WindowRef inMacWindow, - jobject * outJavaWindow); - - -/* - * GetWindowFromJavaWindow() - * - * Discussion: - * Given a Java window this returns the corresponding native Carbon - * window. - * - * Parameters: - * - * env: - * The JNI Environment for the current thread. - * - * inJavaWindow: - * A reference to a Java window. - * - * outMacWindow: - * The corresponding native window. - * - * Availability: - * Mac OS X: in version 10.1 and later in Carbon.framework - * CarbonLib: not available - * Non-Carbon CFM: not available - */ -extern OSStatus -GetWindowFromJavaWindow( - JNIEnv * env, - jobject inJavaWindow, - WindowRef * outMacWindow); - - -/* - * GetJavaFrameFromControl() - * - * Discussion: - * Given an embedded control this returns the corresponding Java - * applet frame. - * - * Parameters: - * - * env: - * The JNI Environment for the current thread. - * - * inMacControl: - * A reference to the control for the applet. - * - * outJavaFrame: - * The applet reference. - * - * Availability: - * Mac OS X: in version 10.1 and later in Carbon.framework - * CarbonLib: not available - * Non-Carbon CFM: not available - */ -extern OSStatus -GetJavaFrameFromControl( - JNIEnv * env, - ControlRef inMacControl, - jobject * outJavaFrame); - - -/* - * GetControlFromJavaFrame() - * - * Discussion: - * Given a Java applet frame reference this returns the embedded - * control. - * - * Parameters: - * - * env: - * The JNI Environment for the current thread. - * - * inJavaFrame: - * The applet reference obtained from CreateJavaApplet. - * - * outMacControl: - * A reference to the control for the applet. - * - * Availability: - * Mac OS X: in version 10.1 and later in Carbon.framework - * CarbonLib: not available - * Non-Carbon CFM: not available - */ -extern OSStatus -GetControlFromJavaFrame( - JNIEnv * env, - jobject inJavaFrame, - ControlRef * outMacControl); - - - -/* - * CreateJavaControl() - * - * Discussion: - * Creates a control for the specified applet whose content is drawn - * and events processed by java. - * All communication to this control should be through the APIs - * specified here in JavaControl.h. - * - * Parameters: - * - * env: - * The JNI Environment for the current thread. - * - * inNativeWindow: - * The carbon window that will host the applet. - * - * inBounds: - * The starting location for the applet. - * - * inAppletFrame: - * The applet reference obtained from CreateJavaApplet. - * - * inVisible: - * True if the applet should start out hidden. - * - * outControl: - * A reference to the control that is created for the applet. - * - * Availability: - * Mac OS X: in version 10.1 and later in Carbon.framework - * CarbonLib: not available - * Non-Carbon CFM: not available - */ -extern OSStatus -CreateJavaControl( - JNIEnv * env, - WindowRef inNativeWindow, - const Rect * inBounds, - jobject inAppletFrame, - Boolean inVisible, - ControlRef * outControl); - - - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=reset -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(pop) -#elif PRAGMA_STRUCT_PACK - #pragma pack() -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __JAVACONTROL__ */ - diff --git a/plugin/oji/MRJCarbon/MRJSDK/JavaFrameworks/JavaEmbeddingLib b/plugin/oji/MRJCarbon/MRJSDK/JavaFrameworks/JavaEmbeddingLib deleted file mode 100644 index 10f96658190c25506407f5d4fe5417f077669e83..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1648 zcmd^<&1(}u6u{p$QM96I)7l`dB^7#9i;5N%B_^%5v>1}sp!hY}OxkUe-DP*$Q0<{! z1oi4k@KO-8f>luzp$K{s6%+)$2t_FhUWM9=_08_iWNiHpe6aI=^WK{`Z(cG3YnlLR zV6}wMq~Ui6Ak4iO6GpCyBCiKnn?@b)wIKB*xG* zQaT*?g;m6@)WWamPON1Q&Ux)yk`5(|CTzPzS;C2|ELPiU^1cm`?alWvEUDGv^|!RUavQASkHDav7%T3y1OF!hu}Duy|fp)Mni z*M}fj_3|L)9Jrs~xfFGE$FP~@xP0fqOds!q61k!u)r$P}IfD(04!XWGONzA195)=x z -#include - -/* jni_md.h contains the machine-dependent typedefs for jbyte, jint - and jlong */ - -#include "jni_md.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * JNI Types - */ - -#ifndef JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H - -typedef unsigned char jboolean; -typedef unsigned short jchar; -typedef short jshort; -typedef float jfloat; -typedef double jdouble; - -typedef jint jsize; - -#ifdef __cplusplus - -class _jobject {}; -class _jclass : public _jobject {}; -class _jthrowable : public _jobject {}; -class _jstring : public _jobject {}; -class _jarray : public _jobject {}; -class _jbooleanArray : public _jarray {}; -class _jbyteArray : public _jarray {}; -class _jcharArray : public _jarray {}; -class _jshortArray : public _jarray {}; -class _jintArray : public _jarray {}; -class _jlongArray : public _jarray {}; -class _jfloatArray : public _jarray {}; -class _jdoubleArray : public _jarray {}; -class _jobjectArray : public _jarray {}; - -typedef _jobject *jobject; -typedef _jclass *jclass; -typedef _jthrowable *jthrowable; -typedef _jstring *jstring; -typedef _jarray *jarray; -typedef _jbooleanArray *jbooleanArray; -typedef _jbyteArray *jbyteArray; -typedef _jcharArray *jcharArray; -typedef _jshortArray *jshortArray; -typedef _jintArray *jintArray; -typedef _jlongArray *jlongArray; -typedef _jfloatArray *jfloatArray; -typedef _jdoubleArray *jdoubleArray; -typedef _jobjectArray *jobjectArray; - -#else - -struct _jobject; - -typedef struct _jobject *jobject; -typedef jobject jclass; -typedef jobject jthrowable; -typedef jobject jstring; -typedef jobject jarray; -typedef jarray jbooleanArray; -typedef jarray jbyteArray; -typedef jarray jcharArray; -typedef jarray jshortArray; -typedef jarray jintArray; -typedef jarray jlongArray; -typedef jarray jfloatArray; -typedef jarray jdoubleArray; -typedef jarray jobjectArray; - -#endif - -typedef jobject jweak; - -typedef union jvalue { - jboolean z; - jbyte b; - jchar c; - jshort s; - jint i; - jlong j; - jfloat f; - jdouble d; - jobject l; -} jvalue; - -struct _jfieldID; -typedef struct _jfieldID *jfieldID; - -struct _jmethodID; -typedef struct _jmethodID *jmethodID; - -#endif /* JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H */ - -/* - * jboolean constants - */ - -#define JNI_FALSE 0 -#define JNI_TRUE 1 - -/* - * possible return values for JNI functions. - */ - -#define JNI_OK 0 /* success */ -#define JNI_ERR (-1) /* unknown error */ -#define JNI_EDETACHED (-2) /* thread detached from the VM */ -#define JNI_EVERSION (-3) /* JNI version error */ -#define JNI_ENOMEM (-4) /* not enough memory */ -#define JNI_EEXIST (-5) /* VM already created */ -#define JNI_EINVAL (-6) /* invalid arguments */ - -/* - * used in ReleaseScalarArrayElements - */ - -#define JNI_COMMIT 1 -#define JNI_ABORT 2 - -/* - * used in RegisterNatives to describe native method name, signature, - * and function pointer. - */ - -typedef struct { - char *name; - char *signature; - void *fnPtr; -} JNINativeMethod; - -/* - * JNI Native Method Interface. - */ - -struct JNINativeInterface_; - -struct JNIEnv_; - -#ifdef __cplusplus -typedef JNIEnv_ JNIEnv; -#else -typedef const struct JNINativeInterface_ *JNIEnv; -#endif - -/* - * JNI Invocation Interface. - */ - -struct JNIInvokeInterface_; - -struct JavaVM_; - -#ifdef __cplusplus -typedef JavaVM_ JavaVM; -#else -typedef const struct JNIInvokeInterface_ *JavaVM; -#endif - -struct JNINativeInterface_ { - void *reserved0; - void *reserved1; - void *reserved2; - - void *reserved3; - -#if !TARGET_RT_MAC_CFM - void* cfm_vectors[225]; -#endif /* !TARGET_RT_MAC_CFM */ - - jint (JNICALL *GetVersion)(JNIEnv *env); - - jclass (JNICALL *DefineClass) - (JNIEnv *env, const char *name, jobject loader, const jbyte *buf, - jsize len); - jclass (JNICALL *FindClass) - (JNIEnv *env, const char *name); - - jmethodID (JNICALL *FromReflectedMethod) - (JNIEnv *env, jobject method); - jfieldID (JNICALL *FromReflectedField) - (JNIEnv *env, jobject field); - - jobject (JNICALL *ToReflectedMethod) - (JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic); - - jclass (JNICALL *GetSuperclass) - (JNIEnv *env, jclass sub); - jboolean (JNICALL *IsAssignableFrom) - (JNIEnv *env, jclass sub, jclass sup); - - jobject (JNICALL *ToReflectedField) - (JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic); - - jint (JNICALL *Throw) - (JNIEnv *env, jthrowable obj); - jint (JNICALL *ThrowNew) - (JNIEnv *env, jclass clazz, const char *msg); - jthrowable (JNICALL *ExceptionOccurred) - (JNIEnv *env); - void (JNICALL *ExceptionDescribe) - (JNIEnv *env); - void (JNICALL *ExceptionClear) - (JNIEnv *env); - void (JNICALL *FatalError) - (JNIEnv *env, const char *msg); - - jint (JNICALL *PushLocalFrame) - (JNIEnv *env, jint capacity); - jobject (JNICALL *PopLocalFrame) - (JNIEnv *env, jobject result); - - jobject (JNICALL *NewGlobalRef) - (JNIEnv *env, jobject lobj); - void (JNICALL *DeleteGlobalRef) - (JNIEnv *env, jobject gref); - void (JNICALL *DeleteLocalRef) - (JNIEnv *env, jobject obj); - jboolean (JNICALL *IsSameObject) - (JNIEnv *env, jobject obj1, jobject obj2); - jobject (JNICALL *NewLocalRef) - (JNIEnv *env, jobject ref); - jint (JNICALL *EnsureLocalCapacity) - (JNIEnv *env, jint capacity); - - jobject (JNICALL *AllocObject) - (JNIEnv *env, jclass clazz); - jobject (JNICALL *NewObject) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jobject (JNICALL *NewObjectV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jobject (JNICALL *NewObjectA) - (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); - - jclass (JNICALL *GetObjectClass) - (JNIEnv *env, jobject obj); - jboolean (JNICALL *IsInstanceOf) - (JNIEnv *env, jobject obj, jclass clazz); - - jmethodID (JNICALL *GetMethodID) - (JNIEnv *env, jclass clazz, const char *name, const char *sig); - - jobject (JNICALL *CallObjectMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jobject (JNICALL *CallObjectMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jobject (JNICALL *CallObjectMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, jvalue * args); - - jboolean (JNICALL *CallBooleanMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jboolean (JNICALL *CallBooleanMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jboolean (JNICALL *CallBooleanMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, jvalue * args); - - jbyte (JNICALL *CallByteMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jbyte (JNICALL *CallByteMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jbyte (JNICALL *CallByteMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); - - jchar (JNICALL *CallCharMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jchar (JNICALL *CallCharMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jchar (JNICALL *CallCharMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); - - jshort (JNICALL *CallShortMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jshort (JNICALL *CallShortMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jshort (JNICALL *CallShortMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); - - jint (JNICALL *CallIntMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jint (JNICALL *CallIntMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jint (JNICALL *CallIntMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); - - jlong (JNICALL *CallLongMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jlong (JNICALL *CallLongMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jlong (JNICALL *CallLongMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); - - jfloat (JNICALL *CallFloatMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jfloat (JNICALL *CallFloatMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jfloat (JNICALL *CallFloatMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); - - jdouble (JNICALL *CallDoubleMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - jdouble (JNICALL *CallDoubleMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - jdouble (JNICALL *CallDoubleMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); - - void (JNICALL *CallVoidMethod) - (JNIEnv *env, jobject obj, jmethodID methodID, ...); - void (JNICALL *CallVoidMethodV) - (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); - void (JNICALL *CallVoidMethodA) - (JNIEnv *env, jobject obj, jmethodID methodID, jvalue * args); - - jobject (JNICALL *CallNonvirtualObjectMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jobject (JNICALL *CallNonvirtualObjectMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jobject (JNICALL *CallNonvirtualObjectMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - jvalue * args); - - jboolean (JNICALL *CallNonvirtualBooleanMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jboolean (JNICALL *CallNonvirtualBooleanMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jboolean (JNICALL *CallNonvirtualBooleanMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - jvalue * args); - - jbyte (JNICALL *CallNonvirtualByteMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jbyte (JNICALL *CallNonvirtualByteMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jbyte (JNICALL *CallNonvirtualByteMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - jvalue *args); - - jchar (JNICALL *CallNonvirtualCharMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jchar (JNICALL *CallNonvirtualCharMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jchar (JNICALL *CallNonvirtualCharMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - jvalue *args); - - jshort (JNICALL *CallNonvirtualShortMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jshort (JNICALL *CallNonvirtualShortMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jshort (JNICALL *CallNonvirtualShortMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - jvalue *args); - - jint (JNICALL *CallNonvirtualIntMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jint (JNICALL *CallNonvirtualIntMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jint (JNICALL *CallNonvirtualIntMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - jvalue *args); - - jlong (JNICALL *CallNonvirtualLongMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jlong (JNICALL *CallNonvirtualLongMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jlong (JNICALL *CallNonvirtualLongMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - jvalue *args); - - jfloat (JNICALL *CallNonvirtualFloatMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jfloat (JNICALL *CallNonvirtualFloatMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jfloat (JNICALL *CallNonvirtualFloatMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - jvalue *args); - - jdouble (JNICALL *CallNonvirtualDoubleMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - jdouble (JNICALL *CallNonvirtualDoubleMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - jdouble (JNICALL *CallNonvirtualDoubleMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - jvalue *args); - - void (JNICALL *CallNonvirtualVoidMethod) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); - void (JNICALL *CallNonvirtualVoidMethodV) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - va_list args); - void (JNICALL *CallNonvirtualVoidMethodA) - (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, - jvalue * args); - - jfieldID (JNICALL *GetFieldID) - (JNIEnv *env, jclass clazz, const char *name, const char *sig); - - jobject (JNICALL *GetObjectField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jboolean (JNICALL *GetBooleanField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jbyte (JNICALL *GetByteField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jchar (JNICALL *GetCharField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jshort (JNICALL *GetShortField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jint (JNICALL *GetIntField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jlong (JNICALL *GetLongField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jfloat (JNICALL *GetFloatField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - jdouble (JNICALL *GetDoubleField) - (JNIEnv *env, jobject obj, jfieldID fieldID); - - void (JNICALL *SetObjectField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jobject val); - void (JNICALL *SetBooleanField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val); - void (JNICALL *SetByteField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val); - void (JNICALL *SetCharField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jchar val); - void (JNICALL *SetShortField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jshort val); - void (JNICALL *SetIntField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jint val); - void (JNICALL *SetLongField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jlong val); - void (JNICALL *SetFloatField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val); - void (JNICALL *SetDoubleField) - (JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val); - - jmethodID (JNICALL *GetStaticMethodID) - (JNIEnv *env, jclass clazz, const char *name, const char *sig); - - jobject (JNICALL *CallStaticObjectMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jobject (JNICALL *CallStaticObjectMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jobject (JNICALL *CallStaticObjectMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); - - jboolean (JNICALL *CallStaticBooleanMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jboolean (JNICALL *CallStaticBooleanMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jboolean (JNICALL *CallStaticBooleanMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); - - jbyte (JNICALL *CallStaticByteMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jbyte (JNICALL *CallStaticByteMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jbyte (JNICALL *CallStaticByteMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); - - jchar (JNICALL *CallStaticCharMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jchar (JNICALL *CallStaticCharMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jchar (JNICALL *CallStaticCharMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); - - jshort (JNICALL *CallStaticShortMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jshort (JNICALL *CallStaticShortMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jshort (JNICALL *CallStaticShortMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); - - jint (JNICALL *CallStaticIntMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jint (JNICALL *CallStaticIntMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jint (JNICALL *CallStaticIntMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); - - jlong (JNICALL *CallStaticLongMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jlong (JNICALL *CallStaticLongMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jlong (JNICALL *CallStaticLongMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); - - jfloat (JNICALL *CallStaticFloatMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jfloat (JNICALL *CallStaticFloatMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jfloat (JNICALL *CallStaticFloatMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); - - jdouble (JNICALL *CallStaticDoubleMethod) - (JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jdouble (JNICALL *CallStaticDoubleMethodV) - (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); - jdouble (JNICALL *CallStaticDoubleMethodA) - (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); - - void (JNICALL *CallStaticVoidMethod) - (JNIEnv *env, jclass cls, jmethodID methodID, ...); - void (JNICALL *CallStaticVoidMethodV) - (JNIEnv *env, jclass cls, jmethodID methodID, va_list args); - void (JNICALL *CallStaticVoidMethodA) - (JNIEnv *env, jclass cls, jmethodID methodID, jvalue * args); - - jfieldID (JNICALL *GetStaticFieldID) - (JNIEnv *env, jclass clazz, const char *name, const char *sig); - jobject (JNICALL *GetStaticObjectField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jboolean (JNICALL *GetStaticBooleanField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jbyte (JNICALL *GetStaticByteField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jchar (JNICALL *GetStaticCharField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jshort (JNICALL *GetStaticShortField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jint (JNICALL *GetStaticIntField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jlong (JNICALL *GetStaticLongField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jfloat (JNICALL *GetStaticFloatField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - jdouble (JNICALL *GetStaticDoubleField) - (JNIEnv *env, jclass clazz, jfieldID fieldID); - - void (JNICALL *SetStaticObjectField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value); - void (JNICALL *SetStaticBooleanField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value); - void (JNICALL *SetStaticByteField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value); - void (JNICALL *SetStaticCharField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value); - void (JNICALL *SetStaticShortField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value); - void (JNICALL *SetStaticIntField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value); - void (JNICALL *SetStaticLongField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value); - void (JNICALL *SetStaticFloatField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value); - void (JNICALL *SetStaticDoubleField) - (JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value); - - jstring (JNICALL *NewString) - (JNIEnv *env, const jchar *unicode, jsize len); - jsize (JNICALL *GetStringLength) - (JNIEnv *env, jstring str); - const jchar *(JNICALL *GetStringChars) - (JNIEnv *env, jstring str, jboolean *isCopy); - void (JNICALL *ReleaseStringChars) - (JNIEnv *env, jstring str, const jchar *chars); - - jstring (JNICALL *NewStringUTF) - (JNIEnv *env, const char *utf); - jsize (JNICALL *GetStringUTFLength) - (JNIEnv *env, jstring str); - const char* (JNICALL *GetStringUTFChars) - (JNIEnv *env, jstring str, jboolean *isCopy); - void (JNICALL *ReleaseStringUTFChars) - (JNIEnv *env, jstring str, const char* chars); - - - jsize (JNICALL *GetArrayLength) - (JNIEnv *env, jarray array); - - jobjectArray (JNICALL *NewObjectArray) - (JNIEnv *env, jsize len, jclass clazz, jobject init); - jobject (JNICALL *GetObjectArrayElement) - (JNIEnv *env, jobjectArray array, jsize index); - void (JNICALL *SetObjectArrayElement) - (JNIEnv *env, jobjectArray array, jsize index, jobject val); - - jbooleanArray (JNICALL *NewBooleanArray) - (JNIEnv *env, jsize len); - jbyteArray (JNICALL *NewByteArray) - (JNIEnv *env, jsize len); - jcharArray (JNICALL *NewCharArray) - (JNIEnv *env, jsize len); - jshortArray (JNICALL *NewShortArray) - (JNIEnv *env, jsize len); - jintArray (JNICALL *NewIntArray) - (JNIEnv *env, jsize len); - jlongArray (JNICALL *NewLongArray) - (JNIEnv *env, jsize len); - jfloatArray (JNICALL *NewFloatArray) - (JNIEnv *env, jsize len); - jdoubleArray (JNICALL *NewDoubleArray) - (JNIEnv *env, jsize len); - - jboolean * (JNICALL *GetBooleanArrayElements) - (JNIEnv *env, jbooleanArray array, jboolean *isCopy); - jbyte * (JNICALL *GetByteArrayElements) - (JNIEnv *env, jbyteArray array, jboolean *isCopy); - jchar * (JNICALL *GetCharArrayElements) - (JNIEnv *env, jcharArray array, jboolean *isCopy); - jshort * (JNICALL *GetShortArrayElements) - (JNIEnv *env, jshortArray array, jboolean *isCopy); - jint * (JNICALL *GetIntArrayElements) - (JNIEnv *env, jintArray array, jboolean *isCopy); - jlong * (JNICALL *GetLongArrayElements) - (JNIEnv *env, jlongArray array, jboolean *isCopy); - jfloat * (JNICALL *GetFloatArrayElements) - (JNIEnv *env, jfloatArray array, jboolean *isCopy); - jdouble * (JNICALL *GetDoubleArrayElements) - (JNIEnv *env, jdoubleArray array, jboolean *isCopy); - - void (JNICALL *ReleaseBooleanArrayElements) - (JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode); - void (JNICALL *ReleaseByteArrayElements) - (JNIEnv *env, jbyteArray array, jbyte *elems, jint mode); - void (JNICALL *ReleaseCharArrayElements) - (JNIEnv *env, jcharArray array, jchar *elems, jint mode); - void (JNICALL *ReleaseShortArrayElements) - (JNIEnv *env, jshortArray array, jshort *elems, jint mode); - void (JNICALL *ReleaseIntArrayElements) - (JNIEnv *env, jintArray array, jint *elems, jint mode); - void (JNICALL *ReleaseLongArrayElements) - (JNIEnv *env, jlongArray array, jlong *elems, jint mode); - void (JNICALL *ReleaseFloatArrayElements) - (JNIEnv *env, jfloatArray array, jfloat *elems, jint mode); - void (JNICALL *ReleaseDoubleArrayElements) - (JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode); - - void (JNICALL *GetBooleanArrayRegion) - (JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf); - void (JNICALL *GetByteArrayRegion) - (JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf); - void (JNICALL *GetCharArrayRegion) - (JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf); - void (JNICALL *GetShortArrayRegion) - (JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf); - void (JNICALL *GetIntArrayRegion) - (JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf); - void (JNICALL *GetLongArrayRegion) - (JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf); - void (JNICALL *GetFloatArrayRegion) - (JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf); - void (JNICALL *GetDoubleArrayRegion) - (JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf); - - void (JNICALL *SetBooleanArrayRegion) - (JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf); - void (JNICALL *SetByteArrayRegion) - (JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf); - void (JNICALL *SetCharArrayRegion) - (JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf); - void (JNICALL *SetShortArrayRegion) - (JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf); - void (JNICALL *SetIntArrayRegion) - (JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf); - void (JNICALL *SetLongArrayRegion) - (JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf); - void (JNICALL *SetFloatArrayRegion) - (JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf); - void (JNICALL *SetDoubleArrayRegion) - (JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf); - - jint (JNICALL *RegisterNatives) - (JNIEnv *env, jclass clazz, const JNINativeMethod *methods, - jint nMethods); - jint (JNICALL *UnregisterNatives) - (JNIEnv *env, jclass clazz); - - jint (JNICALL *MonitorEnter) - (JNIEnv *env, jobject obj); - jint (JNICALL *MonitorExit) - (JNIEnv *env, jobject obj); - - jint (JNICALL *GetJavaVM) - (JNIEnv *env, JavaVM **vm); - - void (JNICALL *GetStringRegion) - (JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf); - void (JNICALL *GetStringUTFRegion) - (JNIEnv *env, jstring str, jsize start, jsize len, char *buf); - - void * (JNICALL *GetPrimitiveArrayCritical) - (JNIEnv *env, jarray array, jboolean *isCopy); - void (JNICALL *ReleasePrimitiveArrayCritical) - (JNIEnv *env, jarray array, void *carray, jint mode); - - const jchar * (JNICALL *GetStringCritical) - (JNIEnv *env, jstring string, jboolean *isCopy); - void (JNICALL *ReleaseStringCritical) - (JNIEnv *env, jstring string, const jchar *cstring); - - jweak (JNICALL *NewWeakGlobalRef) - (JNIEnv *env, jobject obj); - void (JNICALL *DeleteWeakGlobalRef) - (JNIEnv *env, jweak ref); - - jboolean (JNICALL *ExceptionCheck) - (JNIEnv *env); - -#if TARGET_RT_MAC_CFM - void* real_functions[225]; -#endif /* TARGET_RT_MAC_CFM */ -}; - -/* - * We use inlined functions for C++ so that programmers can write: - * - * env->FindClass("java/lang/String") - * - * in C++ rather than: - * - * (*env)->FindClass(env, "java/lang/String") - * - * in C. - */ - -struct JNIEnv_ { - const struct JNINativeInterface_ *functions; -#ifdef __cplusplus - - jint GetVersion() { - return functions->GetVersion(this); - } - jclass DefineClass(const char *name, jobject loader, const jbyte *buf, - jsize len) { - return functions->DefineClass(this, name, loader, buf, len); - } - jclass FindClass(const char *name) { - return functions->FindClass(this, name); - } - jmethodID FromReflectedMethod(jobject method) { - return functions->FromReflectedMethod(this,method); - } - jfieldID FromReflectedField(jobject field) { - return functions->FromReflectedField(this,field); - } - - jobject ToReflectedMethod(jclass cls, jmethodID methodID, jboolean isStatic) { - return functions->ToReflectedMethod(this, cls, methodID, isStatic); - } - - jclass GetSuperclass(jclass sub) { - return functions->GetSuperclass(this, sub); - } - jboolean IsAssignableFrom(jclass sub, jclass sup) { - return functions->IsAssignableFrom(this, sub, sup); - } - - jobject ToReflectedField(jclass cls, jfieldID fieldID, jboolean isStatic) { - return functions->ToReflectedField(this,cls,fieldID,isStatic); - } - - jint Throw(jthrowable obj) { - return functions->Throw(this, obj); - } - jint ThrowNew(jclass clazz, const char *msg) { - return functions->ThrowNew(this, clazz, msg); - } - jthrowable ExceptionOccurred() { - return functions->ExceptionOccurred(this); - } - void ExceptionDescribe() { - functions->ExceptionDescribe(this); - } - void ExceptionClear() { - functions->ExceptionClear(this); - } - void FatalError(const char *msg) { - functions->FatalError(this, msg); - } - - jint PushLocalFrame(jint capacity) { - return functions->PushLocalFrame(this,capacity); - } - jobject PopLocalFrame(jobject result) { - return functions->PopLocalFrame(this,result); - } - - jobject NewGlobalRef(jobject lobj) { - return functions->NewGlobalRef(this,lobj); - } - void DeleteGlobalRef(jobject gref) { - functions->DeleteGlobalRef(this,gref); - } - void DeleteLocalRef(jobject obj) { - functions->DeleteLocalRef(this, obj); - } - - jboolean IsSameObject(jobject obj1, jobject obj2) { - return functions->IsSameObject(this,obj1,obj2); - } - - jobject NewLocalRef(jobject ref) { - return functions->NewLocalRef(this,ref); - } - jint EnsureLocalCapacity(jint capacity) { - return functions->EnsureLocalCapacity(this,capacity); - } - - jobject AllocObject(jclass clazz) { - return functions->AllocObject(this,clazz); - } - jobject NewObject(jclass clazz, jmethodID methodID, ...) { - va_list args; - jobject result; - va_start(args, methodID); - result = functions->NewObjectV(this,clazz,methodID,args); - va_end(args); - return result; - } - jobject NewObjectV(jclass clazz, jmethodID methodID, - va_list args) { - return functions->NewObjectV(this,clazz,methodID,args); - } - jobject NewObjectA(jclass clazz, jmethodID methodID, - jvalue *args) { - return functions->NewObjectA(this,clazz,methodID,args); - } - - jclass GetObjectClass(jobject obj) { - return functions->GetObjectClass(this,obj); - } - jboolean IsInstanceOf(jobject obj, jclass clazz) { - return functions->IsInstanceOf(this,obj,clazz); - } - - jmethodID GetMethodID(jclass clazz, const char *name, - const char *sig) { - return functions->GetMethodID(this,clazz,name,sig); - } - - jobject CallObjectMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jobject result; - va_start(args,methodID); - result = functions->CallObjectMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jobject CallObjectMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallObjectMethodV(this,obj,methodID,args); - } - jobject CallObjectMethodA(jobject obj, jmethodID methodID, - jvalue * args) { - return functions->CallObjectMethodA(this,obj,methodID,args); - } - - jboolean CallBooleanMethod(jobject obj, - jmethodID methodID, ...) { - va_list args; - jboolean result; - va_start(args,methodID); - result = functions->CallBooleanMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jboolean CallBooleanMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallBooleanMethodV(this,obj,methodID,args); - } - jboolean CallBooleanMethodA(jobject obj, jmethodID methodID, - jvalue * args) { - return functions->CallBooleanMethodA(this,obj,methodID, args); - } - - jbyte CallByteMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jbyte result; - va_start(args,methodID); - result = functions->CallByteMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jbyte CallByteMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallByteMethodV(this,obj,methodID,args); - } - jbyte CallByteMethodA(jobject obj, jmethodID methodID, - jvalue * args) { - return functions->CallByteMethodA(this,obj,methodID,args); - } - - jchar CallCharMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jchar result; - va_start(args,methodID); - result = functions->CallCharMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jchar CallCharMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallCharMethodV(this,obj,methodID,args); - } - jchar CallCharMethodA(jobject obj, jmethodID methodID, - jvalue * args) { - return functions->CallCharMethodA(this,obj,methodID,args); - } - - jshort CallShortMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jshort result; - va_start(args,methodID); - result = functions->CallShortMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jshort CallShortMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallShortMethodV(this,obj,methodID,args); - } - jshort CallShortMethodA(jobject obj, jmethodID methodID, - jvalue * args) { - return functions->CallShortMethodA(this,obj,methodID,args); - } - - jint CallIntMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jint result; - va_start(args,methodID); - result = functions->CallIntMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jint CallIntMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallIntMethodV(this,obj,methodID,args); - } - jint CallIntMethodA(jobject obj, jmethodID methodID, - jvalue * args) { - return functions->CallIntMethodA(this,obj,methodID,args); - } - - jlong CallLongMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jlong result; - va_start(args,methodID); - result = functions->CallLongMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jlong CallLongMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallLongMethodV(this,obj,methodID,args); - } - jlong CallLongMethodA(jobject obj, jmethodID methodID, - jvalue * args) { - return functions->CallLongMethodA(this,obj,methodID,args); - } - - jfloat CallFloatMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jfloat result; - va_start(args,methodID); - result = functions->CallFloatMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jfloat CallFloatMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallFloatMethodV(this,obj,methodID,args); - } - jfloat CallFloatMethodA(jobject obj, jmethodID methodID, - jvalue * args) { - return functions->CallFloatMethodA(this,obj,methodID,args); - } - - jdouble CallDoubleMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - jdouble result; - va_start(args,methodID); - result = functions->CallDoubleMethodV(this,obj,methodID,args); - va_end(args); - return result; - } - jdouble CallDoubleMethodV(jobject obj, jmethodID methodID, - va_list args) { - return functions->CallDoubleMethodV(this,obj,methodID,args); - } - jdouble CallDoubleMethodA(jobject obj, jmethodID methodID, - jvalue * args) { - return functions->CallDoubleMethodA(this,obj,methodID,args); - } - - void CallVoidMethod(jobject obj, jmethodID methodID, ...) { - va_list args; - va_start(args,methodID); - functions->CallVoidMethodV(this,obj,methodID,args); - va_end(args); - } - void CallVoidMethodV(jobject obj, jmethodID methodID, - va_list args) { - functions->CallVoidMethodV(this,obj,methodID,args); - } - void CallVoidMethodA(jobject obj, jmethodID methodID, - jvalue * args) { - functions->CallVoidMethodA(this,obj,methodID,args); - } - - jobject CallNonvirtualObjectMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jobject result; - va_start(args,methodID); - result = functions->CallNonvirtualObjectMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jobject CallNonvirtualObjectMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualObjectMethodV(this,obj,clazz, - methodID,args); - } - jobject CallNonvirtualObjectMethodA(jobject obj, jclass clazz, - jmethodID methodID, jvalue * args) { - return functions->CallNonvirtualObjectMethodA(this,obj,clazz, - methodID,args); - } - - jboolean CallNonvirtualBooleanMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jboolean result; - va_start(args,methodID); - result = functions->CallNonvirtualBooleanMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jboolean CallNonvirtualBooleanMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualBooleanMethodV(this,obj,clazz, - methodID,args); - } - jboolean CallNonvirtualBooleanMethodA(jobject obj, jclass clazz, - jmethodID methodID, jvalue * args) { - return functions->CallNonvirtualBooleanMethodA(this,obj,clazz, - methodID, args); - } - - jbyte CallNonvirtualByteMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jbyte result; - va_start(args,methodID); - result = functions->CallNonvirtualByteMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jbyte CallNonvirtualByteMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualByteMethodV(this,obj,clazz, - methodID,args); - } - jbyte CallNonvirtualByteMethodA(jobject obj, jclass clazz, - jmethodID methodID, jvalue * args) { - return functions->CallNonvirtualByteMethodA(this,obj,clazz, - methodID,args); - } - - jchar CallNonvirtualCharMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jchar result; - va_start(args,methodID); - result = functions->CallNonvirtualCharMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jchar CallNonvirtualCharMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualCharMethodV(this,obj,clazz, - methodID,args); - } - jchar CallNonvirtualCharMethodA(jobject obj, jclass clazz, - jmethodID methodID, jvalue * args) { - return functions->CallNonvirtualCharMethodA(this,obj,clazz, - methodID,args); - } - - jshort CallNonvirtualShortMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jshort result; - va_start(args,methodID); - result = functions->CallNonvirtualShortMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jshort CallNonvirtualShortMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualShortMethodV(this,obj,clazz, - methodID,args); - } - jshort CallNonvirtualShortMethodA(jobject obj, jclass clazz, - jmethodID methodID, jvalue * args) { - return functions->CallNonvirtualShortMethodA(this,obj,clazz, - methodID,args); - } - - jint CallNonvirtualIntMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jint result; - va_start(args,methodID); - result = functions->CallNonvirtualIntMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jint CallNonvirtualIntMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualIntMethodV(this,obj,clazz, - methodID,args); - } - jint CallNonvirtualIntMethodA(jobject obj, jclass clazz, - jmethodID methodID, jvalue * args) { - return functions->CallNonvirtualIntMethodA(this,obj,clazz, - methodID,args); - } - - jlong CallNonvirtualLongMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jlong result; - va_start(args,methodID); - result = functions->CallNonvirtualLongMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jlong CallNonvirtualLongMethodV(jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallNonvirtualLongMethodV(this,obj,clazz, - methodID,args); - } - jlong CallNonvirtualLongMethodA(jobject obj, jclass clazz, - jmethodID methodID, jvalue * args) { - return functions->CallNonvirtualLongMethodA(this,obj,clazz, - methodID,args); - } - - jfloat CallNonvirtualFloatMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jfloat result; - va_start(args,methodID); - result = functions->CallNonvirtualFloatMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jfloat CallNonvirtualFloatMethodV(jobject obj, jclass clazz, - jmethodID methodID, - va_list args) { - return functions->CallNonvirtualFloatMethodV(this,obj,clazz, - methodID,args); - } - jfloat CallNonvirtualFloatMethodA(jobject obj, jclass clazz, - jmethodID methodID, - jvalue * args) { - return functions->CallNonvirtualFloatMethodA(this,obj,clazz, - methodID,args); - } - - jdouble CallNonvirtualDoubleMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - jdouble result; - va_start(args,methodID); - result = functions->CallNonvirtualDoubleMethodV(this,obj,clazz, - methodID,args); - va_end(args); - return result; - } - jdouble CallNonvirtualDoubleMethodV(jobject obj, jclass clazz, - jmethodID methodID, - va_list args) { - return functions->CallNonvirtualDoubleMethodV(this,obj,clazz, - methodID,args); - } - jdouble CallNonvirtualDoubleMethodA(jobject obj, jclass clazz, - jmethodID methodID, - jvalue * args) { - return functions->CallNonvirtualDoubleMethodA(this,obj,clazz, - methodID,args); - } - - void CallNonvirtualVoidMethod(jobject obj, jclass clazz, - jmethodID methodID, ...) { - va_list args; - va_start(args,methodID); - functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args); - va_end(args); - } - void CallNonvirtualVoidMethodV(jobject obj, jclass clazz, - jmethodID methodID, - va_list args) { - functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args); - } - void CallNonvirtualVoidMethodA(jobject obj, jclass clazz, - jmethodID methodID, - jvalue * args) { - functions->CallNonvirtualVoidMethodA(this,obj,clazz,methodID,args); - } - - jfieldID GetFieldID(jclass clazz, const char *name, - const char *sig) { - return functions->GetFieldID(this,clazz,name,sig); - } - - jobject GetObjectField(jobject obj, jfieldID fieldID) { - return functions->GetObjectField(this,obj,fieldID); - } - jboolean GetBooleanField(jobject obj, jfieldID fieldID) { - return functions->GetBooleanField(this,obj,fieldID); - } - jbyte GetByteField(jobject obj, jfieldID fieldID) { - return functions->GetByteField(this,obj,fieldID); - } - jchar GetCharField(jobject obj, jfieldID fieldID) { - return functions->GetCharField(this,obj,fieldID); - } - jshort GetShortField(jobject obj, jfieldID fieldID) { - return functions->GetShortField(this,obj,fieldID); - } - jint GetIntField(jobject obj, jfieldID fieldID) { - return functions->GetIntField(this,obj,fieldID); - } - jlong GetLongField(jobject obj, jfieldID fieldID) { - return functions->GetLongField(this,obj,fieldID); - } - jfloat GetFloatField(jobject obj, jfieldID fieldID) { - return functions->GetFloatField(this,obj,fieldID); - } - jdouble GetDoubleField(jobject obj, jfieldID fieldID) { - return functions->GetDoubleField(this,obj,fieldID); - } - - void SetObjectField(jobject obj, jfieldID fieldID, jobject val) { - functions->SetObjectField(this,obj,fieldID,val); - } - void SetBooleanField(jobject obj, jfieldID fieldID, - jboolean val) { - functions->SetBooleanField(this,obj,fieldID,val); - } - void SetByteField(jobject obj, jfieldID fieldID, - jbyte val) { - functions->SetByteField(this,obj,fieldID,val); - } - void SetCharField(jobject obj, jfieldID fieldID, - jchar val) { - functions->SetCharField(this,obj,fieldID,val); - } - void SetShortField(jobject obj, jfieldID fieldID, - jshort val) { - functions->SetShortField(this,obj,fieldID,val); - } - void SetIntField(jobject obj, jfieldID fieldID, - jint val) { - functions->SetIntField(this,obj,fieldID,val); - } - void SetLongField(jobject obj, jfieldID fieldID, - jlong val) { - functions->SetLongField(this,obj,fieldID,val); - } - void SetFloatField(jobject obj, jfieldID fieldID, - jfloat val) { - functions->SetFloatField(this,obj,fieldID,val); - } - void SetDoubleField(jobject obj, jfieldID fieldID, - jdouble val) { - functions->SetDoubleField(this,obj,fieldID,val); - } - - jmethodID GetStaticMethodID(jclass clazz, const char *name, - const char *sig) { - return functions->GetStaticMethodID(this,clazz,name,sig); - } - - jobject CallStaticObjectMethod(jclass clazz, jmethodID methodID, - ...) { - va_list args; - jobject result; - va_start(args,methodID); - result = functions->CallStaticObjectMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jobject CallStaticObjectMethodV(jclass clazz, jmethodID methodID, - va_list args) { - return functions->CallStaticObjectMethodV(this,clazz,methodID,args); - } - jobject CallStaticObjectMethodA(jclass clazz, jmethodID methodID, - jvalue *args) { - return functions->CallStaticObjectMethodA(this,clazz,methodID,args); - } - - jboolean CallStaticBooleanMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jboolean result; - va_start(args,methodID); - result = functions->CallStaticBooleanMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jboolean CallStaticBooleanMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticBooleanMethodV(this,clazz,methodID,args); - } - jboolean CallStaticBooleanMethodA(jclass clazz, - jmethodID methodID, jvalue *args) { - return functions->CallStaticBooleanMethodA(this,clazz,methodID,args); - } - - jbyte CallStaticByteMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jbyte result; - va_start(args,methodID); - result = functions->CallStaticByteMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jbyte CallStaticByteMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticByteMethodV(this,clazz,methodID,args); - } - jbyte CallStaticByteMethodA(jclass clazz, - jmethodID methodID, jvalue *args) { - return functions->CallStaticByteMethodA(this,clazz,methodID,args); - } - - jchar CallStaticCharMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jchar result; - va_start(args,methodID); - result = functions->CallStaticCharMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jchar CallStaticCharMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticCharMethodV(this,clazz,methodID,args); - } - jchar CallStaticCharMethodA(jclass clazz, - jmethodID methodID, jvalue *args) { - return functions->CallStaticCharMethodA(this,clazz,methodID,args); - } - - jshort CallStaticShortMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jshort result; - va_start(args,methodID); - result = functions->CallStaticShortMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jshort CallStaticShortMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticShortMethodV(this,clazz,methodID,args); - } - jshort CallStaticShortMethodA(jclass clazz, - jmethodID methodID, jvalue *args) { - return functions->CallStaticShortMethodA(this,clazz,methodID,args); - } - - jint CallStaticIntMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jint result; - va_start(args,methodID); - result = functions->CallStaticIntMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jint CallStaticIntMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticIntMethodV(this,clazz,methodID,args); - } - jint CallStaticIntMethodA(jclass clazz, - jmethodID methodID, jvalue *args) { - return functions->CallStaticIntMethodA(this,clazz,methodID,args); - } - - jlong CallStaticLongMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jlong result; - va_start(args,methodID); - result = functions->CallStaticLongMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jlong CallStaticLongMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticLongMethodV(this,clazz,methodID,args); - } - jlong CallStaticLongMethodA(jclass clazz, - jmethodID methodID, jvalue *args) { - return functions->CallStaticLongMethodA(this,clazz,methodID,args); - } - - jfloat CallStaticFloatMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jfloat result; - va_start(args,methodID); - result = functions->CallStaticFloatMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jfloat CallStaticFloatMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticFloatMethodV(this,clazz,methodID,args); - } - jfloat CallStaticFloatMethodA(jclass clazz, - jmethodID methodID, jvalue *args) { - return functions->CallStaticFloatMethodA(this,clazz,methodID,args); - } - - jdouble CallStaticDoubleMethod(jclass clazz, - jmethodID methodID, ...) { - va_list args; - jdouble result; - va_start(args,methodID); - result = functions->CallStaticDoubleMethodV(this,clazz,methodID,args); - va_end(args); - return result; - } - jdouble CallStaticDoubleMethodV(jclass clazz, - jmethodID methodID, va_list args) { - return functions->CallStaticDoubleMethodV(this,clazz,methodID,args); - } - jdouble CallStaticDoubleMethodA(jclass clazz, - jmethodID methodID, jvalue *args) { - return functions->CallStaticDoubleMethodA(this,clazz,methodID,args); - } - - void CallStaticVoidMethod(jclass cls, jmethodID methodID, ...) { - va_list args; - va_start(args,methodID); - functions->CallStaticVoidMethodV(this,cls,methodID,args); - va_end(args); - } - void CallStaticVoidMethodV(jclass cls, jmethodID methodID, - va_list args) { - functions->CallStaticVoidMethodV(this,cls,methodID,args); - } - void CallStaticVoidMethodA(jclass cls, jmethodID methodID, - jvalue * args) { - functions->CallStaticVoidMethodA(this,cls,methodID,args); - } - - jfieldID GetStaticFieldID(jclass clazz, const char *name, - const char *sig) { - return functions->GetStaticFieldID(this,clazz,name,sig); - } - jobject GetStaticObjectField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticObjectField(this,clazz,fieldID); - } - jboolean GetStaticBooleanField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticBooleanField(this,clazz,fieldID); - } - jbyte GetStaticByteField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticByteField(this,clazz,fieldID); - } - jchar GetStaticCharField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticCharField(this,clazz,fieldID); - } - jshort GetStaticShortField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticShortField(this,clazz,fieldID); - } - jint GetStaticIntField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticIntField(this,clazz,fieldID); - } - jlong GetStaticLongField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticLongField(this,clazz,fieldID); - } - jfloat GetStaticFloatField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticFloatField(this,clazz,fieldID); - } - jdouble GetStaticDoubleField(jclass clazz, jfieldID fieldID) { - return functions->GetStaticDoubleField(this,clazz,fieldID); - } - - void SetStaticObjectField(jclass clazz, jfieldID fieldID, - jobject value) { - functions->SetStaticObjectField(this,clazz,fieldID,value); - } - void SetStaticBooleanField(jclass clazz, jfieldID fieldID, - jboolean value) { - functions->SetStaticBooleanField(this,clazz,fieldID,value); - } - void SetStaticByteField(jclass clazz, jfieldID fieldID, - jbyte value) { - functions->SetStaticByteField(this,clazz,fieldID,value); - } - void SetStaticCharField(jclass clazz, jfieldID fieldID, - jchar value) { - functions->SetStaticCharField(this,clazz,fieldID,value); - } - void SetStaticShortField(jclass clazz, jfieldID fieldID, - jshort value) { - functions->SetStaticShortField(this,clazz,fieldID,value); - } - void SetStaticIntField(jclass clazz, jfieldID fieldID, - jint value) { - functions->SetStaticIntField(this,clazz,fieldID,value); - } - void SetStaticLongField(jclass clazz, jfieldID fieldID, - jlong value) { - functions->SetStaticLongField(this,clazz,fieldID,value); - } - void SetStaticFloatField(jclass clazz, jfieldID fieldID, - jfloat value) { - functions->SetStaticFloatField(this,clazz,fieldID,value); - } - void SetStaticDoubleField(jclass clazz, jfieldID fieldID, - jdouble value) { - functions->SetStaticDoubleField(this,clazz,fieldID,value); - } - - jstring NewString(const jchar *unicode, jsize len) { - return functions->NewString(this,unicode,len); - } - jsize GetStringLength(jstring str) { - return functions->GetStringLength(this,str); - } - const jchar *GetStringChars(jstring str, jboolean *isCopy) { - return functions->GetStringChars(this,str,isCopy); - } - void ReleaseStringChars(jstring str, const jchar *chars) { - functions->ReleaseStringChars(this,str,chars); - } - - jstring NewStringUTF(const char *utf) { - return functions->NewStringUTF(this,utf); - } - jsize GetStringUTFLength(jstring str) { - return functions->GetStringUTFLength(this,str); - } - const char* GetStringUTFChars(jstring str, jboolean *isCopy) { - return functions->GetStringUTFChars(this,str,isCopy); - } - void ReleaseStringUTFChars(jstring str, const char* chars) { - functions->ReleaseStringUTFChars(this,str,chars); - } - - jsize GetArrayLength(jarray array) { - return functions->GetArrayLength(this,array); - } - - jobjectArray NewObjectArray(jsize len, jclass clazz, - jobject init) { - return functions->NewObjectArray(this,len,clazz,init); - } - jobject GetObjectArrayElement(jobjectArray array, jsize index) { - return functions->GetObjectArrayElement(this,array,index); - } - void SetObjectArrayElement(jobjectArray array, jsize index, - jobject val) { - functions->SetObjectArrayElement(this,array,index,val); - } - - jbooleanArray NewBooleanArray(jsize len) { - return functions->NewBooleanArray(this,len); - } - jbyteArray NewByteArray(jsize len) { - return functions->NewByteArray(this,len); - } - jcharArray NewCharArray(jsize len) { - return functions->NewCharArray(this,len); - } - jshortArray NewShortArray(jsize len) { - return functions->NewShortArray(this,len); - } - jintArray NewIntArray(jsize len) { - return functions->NewIntArray(this,len); - } - jlongArray NewLongArray(jsize len) { - return functions->NewLongArray(this,len); - } - jfloatArray NewFloatArray(jsize len) { - return functions->NewFloatArray(this,len); - } - jdoubleArray NewDoubleArray(jsize len) { - return functions->NewDoubleArray(this,len); - } - - jboolean * GetBooleanArrayElements(jbooleanArray array, jboolean *isCopy) { - return functions->GetBooleanArrayElements(this,array,isCopy); - } - jbyte * GetByteArrayElements(jbyteArray array, jboolean *isCopy) { - return functions->GetByteArrayElements(this,array,isCopy); - } - jchar * GetCharArrayElements(jcharArray array, jboolean *isCopy) { - return functions->GetCharArrayElements(this,array,isCopy); - } - jshort * GetShortArrayElements(jshortArray array, jboolean *isCopy) { - return functions->GetShortArrayElements(this,array,isCopy); - } - jint * GetIntArrayElements(jintArray array, jboolean *isCopy) { - return functions->GetIntArrayElements(this,array,isCopy); - } - jlong * GetLongArrayElements(jlongArray array, jboolean *isCopy) { - return functions->GetLongArrayElements(this,array,isCopy); - } - jfloat * GetFloatArrayElements(jfloatArray array, jboolean *isCopy) { - return functions->GetFloatArrayElements(this,array,isCopy); - } - jdouble * GetDoubleArrayElements(jdoubleArray array, jboolean *isCopy) { - return functions->GetDoubleArrayElements(this,array,isCopy); - } - - void ReleaseBooleanArrayElements(jbooleanArray array, - jboolean *elems, - jint mode) { - functions->ReleaseBooleanArrayElements(this,array,elems,mode); - } - void ReleaseByteArrayElements(jbyteArray array, - jbyte *elems, - jint mode) { - functions->ReleaseByteArrayElements(this,array,elems,mode); - } - void ReleaseCharArrayElements(jcharArray array, - jchar *elems, - jint mode) { - functions->ReleaseCharArrayElements(this,array,elems,mode); - } - void ReleaseShortArrayElements(jshortArray array, - jshort *elems, - jint mode) { - functions->ReleaseShortArrayElements(this,array,elems,mode); - } - void ReleaseIntArrayElements(jintArray array, - jint *elems, - jint mode) { - functions->ReleaseIntArrayElements(this,array,elems,mode); - } - void ReleaseLongArrayElements(jlongArray array, - jlong *elems, - jint mode) { - functions->ReleaseLongArrayElements(this,array,elems,mode); - } - void ReleaseFloatArrayElements(jfloatArray array, - jfloat *elems, - jint mode) { - functions->ReleaseFloatArrayElements(this,array,elems,mode); - } - void ReleaseDoubleArrayElements(jdoubleArray array, - jdouble *elems, - jint mode) { - functions->ReleaseDoubleArrayElements(this,array,elems,mode); - } - - void GetBooleanArrayRegion(jbooleanArray array, - jsize start, jsize len, jboolean *buf) { - functions->GetBooleanArrayRegion(this,array,start,len,buf); - } - void GetByteArrayRegion(jbyteArray array, - jsize start, jsize len, jbyte *buf) { - functions->GetByteArrayRegion(this,array,start,len,buf); - } - void GetCharArrayRegion(jcharArray array, - jsize start, jsize len, jchar *buf) { - functions->GetCharArrayRegion(this,array,start,len,buf); - } - void GetShortArrayRegion(jshortArray array, - jsize start, jsize len, jshort *buf) { - functions->GetShortArrayRegion(this,array,start,len,buf); - } - void GetIntArrayRegion(jintArray array, - jsize start, jsize len, jint *buf) { - functions->GetIntArrayRegion(this,array,start,len,buf); - } - void GetLongArrayRegion(jlongArray array, - jsize start, jsize len, jlong *buf) { - functions->GetLongArrayRegion(this,array,start,len,buf); - } - void GetFloatArrayRegion(jfloatArray array, - jsize start, jsize len, jfloat *buf) { - functions->GetFloatArrayRegion(this,array,start,len,buf); - } - void GetDoubleArrayRegion(jdoubleArray array, - jsize start, jsize len, jdouble *buf) { - functions->GetDoubleArrayRegion(this,array,start,len,buf); - } - - void SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len, - jboolean *buf) { - functions->SetBooleanArrayRegion(this,array,start,len,buf); - } - void SetByteArrayRegion(jbyteArray array, jsize start, jsize len, - jbyte *buf) { - functions->SetByteArrayRegion(this,array,start,len,buf); - } - void SetCharArrayRegion(jcharArray array, jsize start, jsize len, - jchar *buf) { - functions->SetCharArrayRegion(this,array,start,len,buf); - } - void SetShortArrayRegion(jshortArray array, jsize start, jsize len, - jshort *buf) { - functions->SetShortArrayRegion(this,array,start,len,buf); - } - void SetIntArrayRegion(jintArray array, jsize start, jsize len, - jint *buf) { - functions->SetIntArrayRegion(this,array,start,len,buf); - } - void SetLongArrayRegion(jlongArray array, jsize start, jsize len, - jlong *buf) { - functions->SetLongArrayRegion(this,array,start,len,buf); - } - void SetFloatArrayRegion(jfloatArray array, jsize start, jsize len, - jfloat *buf) { - functions->SetFloatArrayRegion(this,array,start,len,buf); - } - void SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len, - jdouble *buf) { - functions->SetDoubleArrayRegion(this,array,start,len,buf); - } - - jint RegisterNatives(jclass clazz, const JNINativeMethod *methods, - jint nMethods) { - return functions->RegisterNatives(this,clazz,methods,nMethods); - } - jint UnregisterNatives(jclass clazz) { - return functions->UnregisterNatives(this,clazz); - } - - jint MonitorEnter(jobject obj) { - return functions->MonitorEnter(this,obj); - } - jint MonitorExit(jobject obj) { - return functions->MonitorExit(this,obj); - } - - jint GetJavaVM(JavaVM **vm) { - return functions->GetJavaVM(this,vm); - } - - void GetStringRegion(jstring str, jsize start, jsize len, jchar *buf) { - functions->GetStringRegion(this,str,start,len,buf); - } - void GetStringUTFRegion(jstring str, jsize start, jsize len, char *buf) { - functions->GetStringUTFRegion(this,str,start,len,buf); - } - - void * GetPrimitiveArrayCritical(jarray array, jboolean *isCopy) { - return functions->GetPrimitiveArrayCritical(this,array,isCopy); - } - void ReleasePrimitiveArrayCritical(jarray array, void *carray, jint mode) { - functions->ReleasePrimitiveArrayCritical(this,array,carray,mode); - } - - const jchar * GetStringCritical(jstring string, jboolean *isCopy) { - return functions->GetStringCritical(this,string,isCopy); - } - void ReleaseStringCritical(jstring string, const jchar *cstring) { - functions->ReleaseStringCritical(this,string,cstring); - } - - jweak NewWeakGlobalRef(jobject obj) { - return functions->NewWeakGlobalRef(this,obj); - } - void DeleteWeakGlobalRef(jweak ref) { - functions->DeleteWeakGlobalRef(this,ref); - } - - jboolean ExceptionCheck() { - return functions->ExceptionCheck(this); - } - -#endif /* __cplusplus */ -}; - -typedef struct JavaVMOption { - char *optionString; - void *extraInfo; -} JavaVMOption; - -typedef struct JavaVMInitArgs { - jint version; - - jint nOptions; - JavaVMOption *options; - jboolean ignoreUnrecognized; -} JavaVMInitArgs; - -typedef struct JavaVMAttachArgs { - jint version; - - char *name; - jobject group; -} JavaVMAttachArgs; - -/* These structures will be VM-specific. */ - -typedef struct JDK1_1InitArgs { - jint version; - - char **properties; - jint checkSource; - jint nativeStackSize; - jint javaStackSize; - jint minHeapSize; - jint maxHeapSize; - jint verifyMode; - char *classpath; - - jint (JNICALL *vfprintf)(FILE *fp, const char *format, va_list args); - void (JNICALL *exit)(jint code); - void (JNICALL *abort)(void); - - jint enableClassGC; - jint enableVerboseGC; - jint disableAsyncGC; - jint verbose; - jboolean debugging; - jint debugPort; -} JDK1_1InitArgs; - -typedef struct JDK1_1AttachArgs { - void * __padding; /* C compilers don't allow empty structures. */ -} JDK1_1AttachArgs; - -#define JDK1_2 - -/* End VM-specific. */ - -struct JNIInvokeInterface_ { - void *reserved0; - void *reserved1; - void *reserved2; - -#if !TARGET_RT_MAC_CFM - void* cfm_vectors[4]; -#endif /* !TARGET_RT_MAC_CFM */ - - jint (JNICALL *DestroyJavaVM)(JavaVM *vm); - - jint (JNICALL *AttachCurrentThread)(JavaVM *vm, void **penv, void *args); - - jint (JNICALL *DetachCurrentThread)(JavaVM *vm); - - jint (JNICALL *GetEnv)(JavaVM *vm, void **penv, jint version); - -#if TARGET_RT_MAC_CFM - void* real_functions[4]; -#endif /* TARGET_RT_MAC_CFM */ -}; - -struct JavaVM_ { - const struct JNIInvokeInterface_ *functions; -#ifdef __cplusplus - - jint DestroyJavaVM() { - return functions->DestroyJavaVM(this); - } - jint AttachCurrentThread(void **penv, void *args) { - return functions->AttachCurrentThread(this, penv, args); - } - jint DetachCurrentThread() { - return functions->DetachCurrentThread(this); - } - - jint GetEnv(void **penv, jint version) { - return functions->GetEnv(this, penv, version); - } -#endif -}; - -#ifdef _JNI_IMPLEMENTATION_ -#define _JNI_IMPORT_OR_EXPORT_ JNIEXPORT -#else -#define _JNI_IMPORT_OR_EXPORT_ JNIIMPORT -#endif -_JNI_IMPORT_OR_EXPORT_ jint JNICALL -JNI_GetDefaultJavaVMInitArgs(void *args); - -_JNI_IMPORT_OR_EXPORT_ jint JNICALL -JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args); - -_JNI_IMPORT_OR_EXPORT_ jint JNICALL -JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *); - -/* Defined by native libraries. */ -JNIEXPORT jint JNICALL -JNI_OnLoad(JavaVM *vm, void *reserved); - -JNIEXPORT void JNICALL -JNI_OnUnload(JavaVM *vm, void *reserved); - -#define JNI_VERSION_1_1 0x00010001 -#define JNI_VERSION_1_2 0x00010002 - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - -#endif /* !_JAVASOFT_JNI_H_ */ - - diff --git a/plugin/oji/MRJCarbon/MRJSDK/JavaFrameworks/JavaVM/jni_md.h b/plugin/oji/MRJCarbon/MRJSDK/JavaFrameworks/JavaVM/jni_md.h deleted file mode 100644 index fdca490b7eaf..000000000000 --- a/plugin/oji/MRJCarbon/MRJSDK/JavaFrameworks/JavaVM/jni_md.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * @(#)jni_md.h 1.12 00/02/02 - * - * Copyright 1996-2000 Sun Microsystems, Inc. All Rights Reserved. - * - * This software is the proprietary information of Sun Microsystems, Inc. - * Use is subject to license terms. - * - */ - -#ifndef _JAVASOFT_JNI_MD_H_ -#define _JAVASOFT_JNI_MD_H_ - -#define JNIEXPORT -#define JNIIMPORT -#define JNICALL - -typedef long jint; -typedef long long jlong; -typedef signed char jbyte; - -#endif /* !_JAVASOFT_JNI_MD_H_ */ diff --git a/plugin/oji/MRJCarbon/plugin/CHANGES b/plugin/oji/MRJCarbon/plugin/CHANGES deleted file mode 100644 index 35ead265c22c..000000000000 --- a/plugin/oji/MRJCarbon/plugin/CHANGES +++ /dev/null @@ -1,108 +0,0 @@ -Changes since 1.0: - -1. Fixed a crash caused by leaving pending Java exceptions in a JNIEnv, when loading -LiveConnect classes that were incompatible with ours. Thanks Apple! - -2. Worked around a change to com.apple.mrj.JavaEmbedding.JE_AppletViewer in Jaguar's JVM -that was no longer implementing the java.applet.AppletContext. Now reading the panel field, -which is an instance of a sun.applet.AppletPanel, which has a getApplet() method. - -3. Worked around Apple's shipped netscape.* classes by prepending MRJPlugin.jar to the -boot classpath, instead of adding it to the regular application class path. - -Changes since 1.0fc2: - -1. Return correct value when mouse clicks occur within the applet. The browser is still -initiating drags when it shouldn't. This should be fixed in Mozilla 1.0.1. - -2. Built the plugin as a Mac OS X bundle to simplify installation. - -Changes since 1.0fc1: - -1. Fixed crash resulting from stale reference to an nsIPluginInstancePeer held by the Carbon -event loop timer used for both status messages and opening new browser documents from Java. - -2. Made all SupportsMixin::addRef/release thread-safe, since a Java thread is calling -AddRef on an MRJPluginInstance in the event loop timer. - -Changes since 1.0b2: - -1. Added call to SizeJavaControl() when processing window size changes. This causes the applet -to be correctly resized before calling MoveAndClipJavaControl(). - -2. Fixed LiveConnect method that was causing stale plugin instance references to be retained -in the active plugin list. - -3. Changed TimedMessage handling so it uses the system memory allocators. This fixes some issues -that we were seeing when Carbon event handlers were being fired during event processing. - -4. Added versioning strings to the mimetype list to improve compatibility with websites that -insist on declaring their applets using the "x-java-applet;version=x.x.x" format. - -Changes since 1.0b1: - -1. Repaired Security Context code that was broken by the checkin for bug 124042. This code now -uses standard character strings instead of Mozilla string classes. - -2. Fixed code that was causing recursive painting calls. - -Changes since 1.0d8: - -1. Unescape file:// URLs when processing them. This allows us to launch local applets when there -is a space in the pathname leading to the applet (i.e. "/Volume/Applet Folder/applet"). - -Changes since 1.0d7: - -1. Added support for relative height and width. This fixes problems with apples failing to load -because their height or width was specified as a percentage value. - -2. Removed checks for zero height and width when instantiating the applet. This was keeping -some applets from being created. - -3. Fixed Unicode to UTF-8 conversion on strings that were being passed to the status bar. - -Changes since 1.0d6: - -1. Using cfref template class to simplify and guard releases of CFTypeRef objects. This fixes -several crashing bugs. - -Changes since 1.0d5: - -1. Converting between HFS+ paths POSIX paths when processing URLs. This fixes bugzilla bug #108519 -and addresses a mismatch between the way Mozilla (FizzillaCFM) and Java represent paths. Mozilla -uses HFS+ file paths, and simply converts them to URLs with the same path elements. Java uses the -POSIX representation, where the boot volume is simply "/" and all other volumes appear under -"/Volumes". The workaround code is a little messy, and is only necessary for file: URLs. - -2. Added NULL check to showDocumentCallback as a workaround for bug #108054. For some strange reason, -url is NULL when that applet calls getAppletContext().showDocument(url, "_blank"). - -Changes since 1.0d4: - -1. Need an applet object for LiveConnect. Is it available? Doing a little digging, -I find that the applet's frame is an instance of com.apple.mrj.JavaEmbedding.JE_AppletViewer. -This class has a getApplet(String) method, which should do the trick. I need to tell Apple that -I am calling its methods. Actually, getApplet()/getApplets() is part of the interface -java.applet.AppletContext, which the applet frame's class implements. For applets that have -a name attribute in their HTML element, then getApplet(String) can be used. If a name attribute -isn't specified, then AppletContext.getApplets() can be used, which returns a java.util.Enumeration, -and presumably the first applet it returns is the one we want. - -2. Created JNIRunnable, LiveConnectProxy classes to implement a rudimentary security architecture. -Slowly removing cross thread calls, which are terribly slow and didn't actually do anything for -security. - -Changes since 1.0d3: - -1. Added system version check to make sure only runs on 10.1 or later. - -2. Talked to Scott Kovatch, he told me how to interact with applet -security. Added code to netscape.oji.JNIThread's constructor to start the thread -using a privileged action. ** Doesn't work, since code isn't in boot class path. ** - -3. Added code to netscape.oji.MRJSession to install com.apple.mrj.JavaEmbedding.JE_AppletSecurity -as the system security manager, so that it is always there, not just after applets run. - -4. Added MRJPlugin.properties to configure the plugin. - -5. Added MRJPlugin.policy so that classes in MRJPlugin.jar can execute with all privileges. diff --git a/plugin/oji/MRJCarbon/plugin/English.lproj/InfoPlist.strings b/plugin/oji/MRJCarbon/plugin/English.lproj/InfoPlist.strings deleted file mode 100644 index 884326b7d7effa63ce45ae7fc040c07d5bd0cc5c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 592 zcmb`EOKZYF6ot>)UlCje(KOrQrh+eOkOsPMO^l*>kcXf@zU?=YB3ROHD#Of8?mc(T zxo18;HIgew&&svYn~vJ+qF52R6R}i9CRavuh+EDDe_OtXDlEQIP4)o#Y*8+E_E-~5 z^`r)L1TI#<{VCDWnBCV(FIs9%tx*C?M((krFVqgU5|-B+MIo8e_9cJZ`Ew3O4=DGT zU?cw*#u+^IbiUN;}=7gDyYd%UmPE!voYh~Y|us)fNlw~~J+k8!IUt{>K cJy57Qh!l4-9F2()``vop#o4;wRr$A?FCp+{ng9R* diff --git a/plugin/oji/MRJCarbon/plugin/INSTALL.txt b/plugin/oji/MRJCarbon/plugin/INSTALL.txt deleted file mode 100644 index a6b7e478d4b9..000000000000 --- a/plugin/oji/MRJCarbon/plugin/INSTALL.txt +++ /dev/null @@ -1,7 +0,0 @@ -MRJPluginCarbon v1.0.1 Install Notes - -This short document explains how to install the MRJ Plugin for Mac OS X. The process for installing the plugin has been greatly simplified from previous releases. Simply drag the file MRJPluginCarbon into the folder - -/Library/Internet Plug-Ins - -This will make the MRJ Plugin for Mac OS X available to all installations of Netscape Gecko based browsers. diff --git a/plugin/oji/MRJCarbon/plugin/MRJPlugin.jar b/plugin/oji/MRJCarbon/plugin/MRJPlugin.jar deleted file mode 100644 index 2cfce336d60f81c55c7698bfb38c5d2204755e60..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21050 zcmdU1=~rCIb-&#-yryXcY6%G>kQ%MfAX?i$lXcTUEF2{oPx)`pR=)BB9pkI=Q@(s8JfFCih^G^oJ8|XF zIUhxav&lsIdLoxfOsDk;{_s)Fa4MsZ78j=VoN*@tUR-p;q)`CGZOSf=HL46zh=M)} z^k!#3Hc*&L<$csPyy-@R!HV;ujbW-GKa;EVQD{6{%q8`K6!RMCp3Y~}#eyzxUP%<@ zd=wtcWb~Y9sg4?3H(jAdbv}A2o|;HxQpJV%WHy(c;m^DAk?hNR7Q;V$kid^1>>eyJ$BBol<{S`@2*B86e_gH(vB?uS>#Ddr0_`3}l%i zJLN1p0jls(RUT8zm{LzBieU;;B_^3C?;2HAqKiVCo>0b=s2bJpiy3%TpY_q97G<7} zP0#De!Z~&78n@7}ta!+^+0)N@T6@XT0~2#OJu%~>?G6=Sy;*HcYwy?O-E(2uN%cOe zwQG_OG};xyXqFIC^pwqpqH~@`O@(PMMR@?5(GpOV{5yySS@*Hh!<2EfRop}y4$whI z8zc>l4u`0P4*6({NkD4NFvTbeO=ve-5YnhU1nt|#g&<9aM%(GF(V)GaSXKQm>mF)` z)V5$of>oApe5=6OC$vH>uHr%g5LK;GVCpexZ&J0?4K;We5)b=uz9Q5K>xxR+3f+LN z#`kudS*7@6QWsf><__oYtpLx-^TsH8e*4_WenC`S}np+myf6g2 zGot77KoV&2prsm7cgrAShfU#tFgM+E7KK7oMU`Q;MLw!8#i~YIDq(S|QL6(H>{>H_ z%*J5~Rq+(GcrVKpGn<)K5qsjAv^3UYx8DidF7=^d+_%8ED>o>L7FS`A8*uoAv1TFg zqbqqTY{ke9h--*K>@kI7yB|@l6r~`ZZ9xg5E{I4sCP)u37eVA%z(SB>Hop9AJD&S| zP_5#LA8&9SyP>%Gyvu2fuYT}1|1<=ud^F+(_h=c+Cmne6q=z*Q%?iY)_h;_?7D5Hc zV2{;!A(zVB=_$_6>N(&?36&&6M>>x_2vQXqsai={;9TomJM$bO3FQwsD6>Fh>%Li+Tpuv)!vk#qz3L!_@4coy-WNEm+8! zTsSST#RR|-zl&MxVPE%zVEDEevucO;IBB%6lJ>J@tjgetLZ+2NRbm3ekTEKk+px9ss}1+(F*|t19Ez<{ zXettZOf|b#sBW1WmZ|A6MS02{hy|DFFw8*Ao_jkWQUqna6N35emd@)gIvV?W7}tqEsJA5nM*Ae;?5FH|MAv`Z)5iJ zaj-;*q4E9)Nqw=9%4S?v;j+i{-QItrxBtq-;MnNxiK#37xBEw~Oib}aF8go%0Y|x> zUmqLnV`YSXu5&#a>ly0ro#2O1LOWd#2d<6waxMHA*27(PeB$ch=p}v##O{7LdTpeq z|0+L(UD@Fx+%q;d+}|zemID~Np7vk8Iwnd2rv+!>D`pZ4>@TjFx9nuXk=8R=e8~&f z5*DVAy{l&iGc)=FkiMT|RWM`q?!?1Ikg9dxc2c)cw&B8pXrI2A)02sU4yCe5i`&S3 zw#(L1ux5qSf^M;*QFDm)QPf9TF>^PQy`KrvfiM&p9NE2IVxsRkWfN@q9HY3BY}h#ipoj+Q}Xbd3IE z)ebGm?40+}IS*B=lri+GO2)j!C}$@?{-ozvB7y=`w9VsrY3Hdon}KT06s{-IMTo=3 zSbyQkz{h-E#2M15dwMd9fJU+q7e-mn$2S;Q1B%otgCK4}g|(o&8CEn1DB`1Do|RB^ z4S*vYN08TuJwOob>q=a+17<$2!gW}=uEzBi<+=vfwaWEYTt}2^1}+d$d@`ItQ~-aF zIdO)>;p|5VdFFV6^cyf2@Xx4u8fOOXQ9!2svB<$k)EX;$L~XIikw+Bgug7BkM|46e zb2bipgxc-}P4-v%0m=qY-zA9FWf+e^0kI`sk3!X-LWw3Etn478My(5?exl}B+haQO z1l5kCgC~Fjuc1?}qrsDC(hVTPDN(J&bInGzAWvt(n$KXs4+hTRikm$J23Q%^h-SlV zortwRq6>B_xsQnw_?!k@OkzxCL={n4%&LONhewkGK-|CFn~l_IwDVP*Ird|;6IHav znz(lx0^GZG<)ykei*_!ed*2PRIkX`U(gn1$D46J!L@g%Fc5;hZ7}!QP3vu8!HVc8^ z<}|Ys0%dbRE>f4#A9ld&hjilmc-1d}fb=onql{^}QK=6wy2qpN1?l;*pvb}>@+juYG*h#olE3UpQrJxN+Zr} zy;4fkBjCuCYXB-apev#&VYolAZjEM3;|}{Fd&-96n=+V|aSEmY=X04vTDm6H>1^iC zZROsO+XrSB9Ly*%++-jcf(Y(q1GuXag1R4d$Vm2{5|+=fTrdgq`Rw%k?ZnIs!tjBX zA+}|^sgbDwhF4-NM|6&|yF!14$x_G7BB`O!csg5Po9ggutTzDKEwYE#7Z9Tin??<# zB;68L7*XP!zL34An=A*gaDd)D<59&e#Uz_`ti6RU(eLp9ZR94&u9{3`X0rF82#pE> z$~rBP|Ap2c(m81J-d0 z2I?kA+=8WE!hIRP(qQMSaF8#=vlVy!m?(Qdn5$4j7yE=CWmA@+i)pCtBqsihplF6J z4#HvLzYrZp1K4qE0x~gamI-Uc;gEf?y^lB0XwH?S*+?7?X@h%)FL2R1 z#5vAR8Lp3UBo5~jpvUKvunv4aWxRhHP9FIx=?n}p`2sM%Xg8jprwic04?D@9-E>i$ zyPRg=$K{!~{~iX64<03Nv4jqP@X%!i_IOwURY&x-tS{rr3|miwY*LTfisr-y^=_<& z`Zu7kmUHEfIWHYb3QEAcV~w{}4?rQ{QehjlOyR=pQE*`>zR3+(SX=n%)#C9D>QYUG z!RhZrX>RP(?Dif8A>Sh6>S0iK`6%@c>rXkq7*D`%4UOBEKs^nx!TeW=m;x`Ja%=&> zN1Q96lK5JvJe;1O)dlMS-+X~Vt^tcGV-W#WOk>D zE6lzz0=r_*6r zJ<+aq0AEIliW;)G1RN?u-&jvm**GG{nF3UYo>)K#8!J{0C~SHMCn{kq5dqQ``Smn9 z!4pCO=AI%f;L9FzQrGBA2zC`ApBh1AypTxVoyaAU0A}^Zm^({|L5J-PAH+`u0!dY)i+DNL&*}`QrwX5K zP+9FjOGogu18>H09L4)_lsE?GJdQG0(#F8ri%acz7DZWJ!(~1pOW>Y)WiCIBdyE9z zVn3wX$N?Xs=997Ewzt6Ckv4Eu*Y@+D4lmI&ZOe474d-RL$V}E?y^292=YZ@+rIN`* zV2u!BA%LzbK&~1H$2OdI18y|}aAC}`7Jph{uFYVs5%8@8>@$4qLU}*@@@{eNbL!s* ziN3iYbT1!Kyx^^vIQ7bJ@<>p;#~pdL9<^?p!YM zaI9EZEE>~OWB1%ji>l<=9^}lEYNVYNuv#N0F`~b6=9eM^9pIdvlUO+7Z!#lN)T~|vfC#}{L$8<5ri=MGLuuED z^tTPy*7nd|?wY8j;MdcK+wUXGt2>u1W@fqvZwvuA^c3%)BrlD?>?>MSgf5^X53%Ci zV%vc0+0=|it(B107U$N9J7y|+-Mwvf0j-;_>quVqq8A6KaedW;L%vZH1gEJ zpl__1ca@%c8g=_wP!V(rVc3r7=_T(gWGa>!J=(;X1III!X|Tpx#8J_!}isz;E5Mq>~d1Xc_~ zB{QbnB63Uoz@7)8#e5=s$U$fRt68G9Us2T(9gCb;rZdvN=BlJG%t6(Q_}(e1;37Z+ z77;Z;<-A>#Ut^BU1eFVhODi4PKI+0VKlM7bsCFp$kG%*4@WG*2YbZI>6`7CY$S+yD z^0?%oLf4xcCNj~m{p8P{w>0GPy~WyIss< zS8-(ZDVnyLHEo#HWBDR#;Pt9fm0F5*a7=-o5rA4z4JIHbuMTDuoenfxG7kdUQA41t zsE^IMB88@FtEeZVLwMy5SXaT;@`1()2aN<5%z@m@ZiF_jCgdILq`i29hxLj`Z|&eF z%K;Gh_Gxn?Ap1=GAf#eL{e74KZ+B8_2nGV&REb^(qkyQY;ZeE~;~ijWaUePRJ?|_lP)@k*9hQuhoH;4I6FHCc`GqVHR=x`c-IG2W4@vC zX3V_~nE(@{%iLjIKJp4Dt3anGiy529z&O^^bB^R1#sM% zNF#inA72Hwz!lUmr#xM&1gF>7=@geY`0|D_UW(_U(Jl10I>%J_qS1@I#=N#OZ?afa z)9nzwMDJQ3{Z!L*h+d#%7-|>n3=kAl1w!Yj$02kIQvx;Jp*bFxlzh8CmkZNfc?ag9@bF6`b1ew!}3p59lI4WmxbT*rd zjwF)NvGM4Q=)EA_vt79`J>ZG|0%4u!z%7w8gjB3(aWOgsdl{8s_NbZTAMJ_;>Gxcz zQ6;sJOz47G?5Fqglztxu_{AW70P301v~#Be@UJ6-*Yy}wexE+Xo%xC>1OhZ#6HcQ) zKwO4}phKiDAswn?F`G^$9|q~8j3l9Y&j#raA)l&#Gv4?FCZtHD66y|p@ms91eTqKK ze11l8hTPgIr)#>CMNQh~KSCyQ1;X*oE z=6ot9%b(D9xZnO1+#8yRw{@^=LK7<%%|xl+3(=p8=^~fq8f=v6geG8UV~F~$Cxf6; zo3Fe3L%~MeyXZyN9l*~4w1B~9h_xQRg;?E*GpA)B^oTngqx1<+`3rc;Sn~KPg#k-z z088tpR%z!HmUlR#EwXQ!4#6vbOl>1=0IA1toO+D{lWnhq0y2DnPPYN!@g|aexF&#K z*diR#-);e6ZHqag^fWX;ul;y@o?xU#<<+7>E^s;&TJ$yT`Oz)3;(0aB)AO00x zjC@R#`#4?zY(EtFqCd36;qD=4O`}6}` z`ROmk=Nt4_;{3YP`}o&Wi(4j8l8^m(!GtYh<_+7q3IP9W7S?uq`5+>MTPn!BNxy+H z3ZSEByfKJ`c#hNw)W@HdL$%^G{DUpDHfXi0SoG`rby-xk+Zv3XST+_P! zr*X(-_IIub-JBY6(mK!kP>S_vHvh3|kv=)cGmk;KSX{N(Uvp@}_G)G3&QVCdDOKLpw(7!Yq__!E)h{bIqKSh7@`+)v?^}6v|h>@$tY8xWjzJ@S>wr zg(M0qJuEh24kVI=Y|g#t`)v=|tP@69;K4~farbf}KR1$C)Hwggk`;SPTlIoc36S4T z1uZJYft$nzwga1C@@e<8mCxviT9xuGH;Rg3ACSYoo2w2xDuEf1&sx$!=0%RQPWjo`UB!A0mqJj`TpbBxaRyGm zAQRW!N5geL}L0_=iRpU@ff1K^x?P?9_UB znTqB##}7VRIl~fhi5r0!EfoUkD(kAH0FI>^60BD9nL1-a*)(DR7$GI{Q7u zq%;bOw=t~-X^88A!y8KSrWu1uy)q9SCBP4RJt7qee(z8iIN^#Z-D@h)=xPYy;duyS zUKHW&TkIGDNcwret(X#A!-Nv-Kt>Pr9%@qV`6zC5)S7zCou=qPr2v|Di(cU7!FN`c z=hRo&doE}1`6heM|>82RRpC=<7<}l{!#Nr_tHvEw_4@!VKw50TC`UEHlUE zP&y=XSg|~z)T_~a2$(9x%)ze?EQ+n)wQjWwDB`r2?iUQbe87Dld~QvG(Sok%S0oiV zyce-w$?Q7Y|B@OX6dZA&G7QGX0X)kqD^QVhuHmE08RaIg(F5o>j(2eep&{Asm%xKu z6NlQ5k0jFYFBkNgYgdOAfB8M;#N>DINTc_K=>4og!!y}raREOlfV(g)HAV)D@g8VD zvl(l$rfW6&5KvQ#i<*?94~OU#_TbBe6gj+aqh}OdVBAstVypW;N+09ygP&iev;y_c z==nk}`_M6}6*9LmOrMgS{%MCHk~B5?Y=}Om?E5{mDZxT71ry06wEO|Y94p5kW(sq9 zA%zeUR@phQ_GL_DezdV~>iS)SC)`i430KuU2TaT&{np0y9tWDyl+OvUWo{*w4l8>D zNS=W+$rx+ht;9M!()++_47u3Hw6_uu2(JYj7MG}gm3B=<8XwahtT*qA9KgpiwP5L4 zf;oGW@iT&w^fDU7N-_J@yct(A^lxxwc*%Pr^2`dIfe(EiUTEi3TcqnT^**M7k#9Azdq?>KbzqD zJ&zxPJr8s@D{tU;?oW6*aNRG7v--f`};8pifWIdySUHL|kDGergIWpT}_*EB0w5CM@8+dAylHP<@0`lp|_3$yHTkDLDK7wA=71?h|6UiO;3?_h<#A{YN`u{-A|{8iDYFM$Au zcfN*CKYfe7F3#ViZ{W;3z+XXSSqeG5i>{u@e}5Y*eSENk{Zy*fmC-Qf;co1A5MJYq z2}~n4A1G?fD~t~K$v~h2@nZ+Y5?TY=!PskHqZyHF{Pb4E++M!PML)wew=(2BEt1$t zCovXU#pY2l9B`De(U;Q~EQeY|c-@^ChBSw+Sq7B z?iQ?=^ko+kDXiMgdi%%%!vAVuVTXz)&7!B$0ED&r3}YUR;g*Kt?alDk#NMoM#-rPTUWfMP$LGdIm4Yiw) z`&VFWLQ_~Aa1%0v%HFixKm1|ST0*b7X(0&@PP#WGyCiSpRsT)_I9Zff^;kb<;Ou?( z&l%V>=1Ndd_c9CP;O;8-{!5!=2%DL_m>M#-Re92LZ{)G*ZN*+IZ+c>Od-s`p6M#+b zK(rLO^~ckl)@oDy&cRX?uOUIon?HAYmrd=T5!$wz>s(RwCgonMu}RHgS;#@kZTGzi zy5sCN!T-Wyq=TSaznUJb=McLQwoUgI)YN9^t_f|J4JZd_=M8x^^nI+~J{aMv{{b1g BcUu4e diff --git a/plugin/oji/MRJCarbon/plugin/MRJPlugin.pbproj/project.pbxproj b/plugin/oji/MRJCarbon/plugin/MRJPlugin.pbproj/project.pbxproj deleted file mode 100644 index 754a02cdf1e7..000000000000 --- a/plugin/oji/MRJCarbon/plugin/MRJPlugin.pbproj/project.pbxproj +++ /dev/null @@ -1,773 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 34; - objects = { - 089C1669FE841209C02AAC07 = { - buildStyles = ( - 4F9091AC011F3BD104CA0E50, - 4F9091AD011F3BD104CA0E50, - ); - isa = PBXProject; - mainGroup = 089C166AFE841209C02AAC07; - projectDirPath = ""; - targets = ( - 089C1673FE841209C02AAC07, - F59D147502AC39EF01000104, - F59D147102AC328B01000104, - ); - }; - 089C166AFE841209C02AAC07 = { - children = ( - F5BFB5F1029AD43001000102, - 08FB77ADFE841716C02AAC07, - F53C74E602A8021101000104, - 089C167CFE841241C02AAC07, - 089C1671FE841209C02AAC07, - 19C28FB4FE9D528D11CA2CBB, - ); - isa = PBXGroup; - name = MRJPlugin; - refType = 4; - }; - 089C1671FE841209C02AAC07 = { - children = ( - 08EA7FFBFE8413EDC02AAC07, - F535746F0299A36101FE39E3, - F53574700299A36101FE39E3, - F51A400C0299CD65012FC976, - ); - isa = PBXGroup; - name = "External Frameworks and Libraries"; - refType = 4; - }; - 089C1673FE841209C02AAC07 = { - buildPhases = ( - 089C1674FE841209C02AAC07, - 089C1675FE841209C02AAC07, - 089C1676FE841209C02AAC07, - 089C1677FE841209C02AAC07, - 089C1679FE841209C02AAC07, - F5BFB5E8029AD01B01000102, - ); - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ""; - HEADER_SEARCH_PATHS = "../MRJSDK/JavaFrameworks/JavaVM ../MRJSDK/JavaFrameworks/JavaEmbedding ../../../../dist/sdk/xpcom/include ../../../../dist/include/caps ../../../../dist/include/java ../../../../dist/include/js ../../../../dist/include/nspr ../../../../dist/include/oji ../../../../dist/include/plugin ../../../../dist/include/xpcom ../../../../dist/include/xpconnect /Developer/Headers/FlatCarbon"; - LIBRARY_SEARCH_PATHS = /usr/lib; - OTHER_CFLAGS = "-DXP_MACOSX=1 -DNO_X11=1 -DUSE_SYSTEM_CONSOLE=1"; - OTHER_LDFLAGS = ""; - OTHER_REZFLAGS = ""; - PRODUCT_NAME = MRJPlugin; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; - WRAPPER_EXTENSION = plugin; - }; - dependencies = ( - F59D149002AC3B8E01000104, - F59D147202AC350E01000104, - ); - isa = PBXBundleTarget; - name = MRJPlugin; - productName = MRJPlugin; - productReference = 4F9091AB011F3BD104CA0E50; - productSettingsXML = " - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - MRJPlugin - CFBundleIconFile - - CFBundleIdentifier - com.netscape.MRJPlugin - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - NSPL - CFBundleSignature - MOSS - CFBundleVersion - 1.0fc2 - CSResourcesFileMapped - - - -"; - shouldUseHeadermap = 1; - }; - 089C1674FE841209C02AAC07 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXHeadersBuildPhase; - name = Headers; - }; - 089C1675FE841209C02AAC07 = { - buildActionMask = 2147483647; - files = ( - 089C1680FE841241C02AAC07, - ); - isa = PBXResourcesBuildPhase; - name = "Bundle Resources"; - }; - 089C1676FE841209C02AAC07 = { - buildActionMask = 2147483647; - files = ( - F535747C0299B28B01FE39E3, - F53574820299B7B201FE39E3, - F53574830299BAF701FE39E3, - F53574840299C0DB01FE39E3, - F53574850299C1B701FE39E3, - F53574860299C80701FE39E3, - F51A400F0299CE02012FC976, - F5DC13A60299D19A01403EB6, - F5DC13A80299D2CA01403EB6, - F5DC13AA0299D38E01403EB6, - ); - isa = PBXSourcesBuildPhase; - name = Sources; - }; - 089C1677FE841209C02AAC07 = { - buildActionMask = 2147483647; - files = ( - 08EA7FFCFE8413EDC02AAC07, - F53574710299A36101FE39E3, - F53574720299A36101FE39E3, - F51A400D0299CD65012FC976, - ); - isa = PBXFrameworksBuildPhase; - name = "Frameworks & Libraries"; - }; - 089C1679FE841209C02AAC07 = { - buildActionMask = 2147483647; - files = ( - F59D146F02AC308301000104, - F59D147002AC308301000104, - ); - isa = PBXRezBuildPhase; - name = "ResourceManager Resources"; - }; - 089C167CFE841241C02AAC07 = { - children = ( - 089C167DFE841241C02AAC07, - F59D147302AC371D01000104, - F59D146D02AC308301000104, - F59D146E02AC308301000104, - ); - isa = PBXGroup; - name = Resources; - refType = 4; - }; - 089C167DFE841241C02AAC07 = { - children = ( - 089C167EFE841241C02AAC07, - ); - isa = PBXVariantGroup; - name = InfoPlist.strings; - refType = 4; - }; - 089C167EFE841241C02AAC07 = { - fileEncoding = 10; - isa = PBXFileReference; - name = English; - path = English.lproj/InfoPlist.strings; - refType = 4; - }; - 089C1680FE841241C02AAC07 = { - fileRef = 089C167DFE841241C02AAC07; - isa = PBXBuildFile; - settings = { - }; - }; - 08EA7FFBFE8413EDC02AAC07 = { - isa = PBXFrameworkReference; - name = Carbon.framework; - path = /System/Library/Frameworks/Carbon.framework; - refType = 0; - }; - 08EA7FFCFE8413EDC02AAC07 = { - fileRef = 08EA7FFBFE8413EDC02AAC07; - isa = PBXBuildFile; - settings = { - }; - }; - 08FB77ADFE841716C02AAC07 = { - children = ( - F53574730299B1E101FE39E3, - F53574750299B20701FE39E3, - F53574770299B25701FE39E3, - F53574780299B25701FE39E3, - F535747D0299B74301FE39E3, - F535747B0299B28B01FE39E3, - F51A400E0299CE02012FC976, - F5DC13A50299D19A01403EB6, - F5DC13A70299D2CA01403EB6, - F5DC13A90299D38E01403EB6, - ); - isa = PBXGroup; - name = Source; - refType = 4; - }; -//080 -//081 -//082 -//083 -//084 -//190 -//191 -//192 -//193 -//194 - 19C28FB4FE9D528D11CA2CBB = { - children = ( - 4F9091AB011F3BD104CA0E50, - F59D147402AC39EF01000104, - ); - isa = PBXGroup; - name = Products; - refType = 4; - }; -//190 -//191 -//192 -//193 -//194 -//4F0 -//4F1 -//4F2 -//4F3 -//4F4 - 4F9091AB011F3BD104CA0E50 = { - isa = PBXBundleReference; - path = MRJPlugin.plugin; - refType = 3; - }; - 4F9091AC011F3BD104CA0E50 = { - buildRules = ( - ); - buildSettings = { - COPY_PHASE_STRIP = NO; - OPTIMIZATION_CFLAGS = "-O0"; - }; - isa = PBXBuildStyle; - name = Development; - }; - 4F9091AD011F3BD104CA0E50 = { - buildRules = ( - ); - buildSettings = { - COPY_PHASE_STRIP = YES; - }; - isa = PBXBuildStyle; - name = Deployment; - }; -//4F0 -//4F1 -//4F2 -//4F3 -//4F4 -//F50 -//F51 -//F52 -//F53 -//F54 - F51A400C0299CD65012FC976 = { - isa = PBXFileReference; - name = "libstdc++.a"; - path = "/usr/lib/libstdc++.a"; - refType = 0; - }; - F51A400D0299CD65012FC976 = { - fileRef = F51A400C0299CD65012FC976; - isa = PBXBuildFile; - settings = { - }; - }; - F51A400E0299CE02012FC976 = { - isa = PBXFileReference; - name = LiveConnectNativeMethods.cpp; - path = Source/LiveConnectNativeMethods.cpp; - refType = 4; - }; - F51A400F0299CE02012FC976 = { - fileRef = F51A400E0299CE02012FC976; - isa = PBXBuildFile; - settings = { - }; - }; - F535746F0299A36101FE39E3 = { - isa = PBXFrameworkReference; - name = JavaVM.framework; - path = /System/Library/Frameworks/JavaVM.framework; - refType = 0; - }; - F53574700299A36101FE39E3 = { - isa = PBXFrameworkReference; - name = JavaEmbedding.framework; - path = /System/Library/Frameworks/JavaEmbedding.framework; - refType = 0; - }; - F53574710299A36101FE39E3 = { - fileRef = F535746F0299A36101FE39E3; - isa = PBXBuildFile; - settings = { - }; - }; - F53574720299A36101FE39E3 = { - fileRef = F53574700299A36101FE39E3; - isa = PBXBuildFile; - settings = { - }; - }; - F53574730299B1E101FE39E3 = { - isa = PBXFileReference; - name = MRJPlugin.cpp; - path = Source/MRJPlugin.cpp; - refType = 4; - }; - F53574750299B20701FE39E3 = { - isa = PBXFileReference; - name = MRJContext.cp; - path = Source/MRJContext.cp; - refType = 4; - }; - F53574770299B25701FE39E3 = { - isa = PBXFileReference; - name = MRJMonitor.cpp; - path = Source/MRJMonitor.cpp; - refType = 4; - }; - F53574780299B25701FE39E3 = { - isa = PBXFileReference; - name = MRJPage.cpp; - path = Source/MRJPage.cpp; - refType = 4; - }; - F535747B0299B28B01FE39E3 = { - isa = PBXFileReference; - name = SupportsMixin.cpp; - path = Source/SupportsMixin.cpp; - refType = 4; - }; - F535747C0299B28B01FE39E3 = { - fileRef = F535747B0299B28B01FE39E3; - isa = PBXBuildFile; - settings = { - }; - }; - F535747D0299B74301FE39E3 = { - isa = PBXFileReference; - name = MRJSession.cpp; - path = Source/MRJSession.cpp; - refType = 4; - }; - F53574820299B7B201FE39E3 = { - fileRef = F53574780299B25701FE39E3; - isa = PBXBuildFile; - settings = { - }; - }; - F53574830299BAF701FE39E3 = { - fileRef = F535747D0299B74301FE39E3; - isa = PBXBuildFile; - settings = { - }; - }; - F53574840299C0DB01FE39E3 = { - fileRef = F53574770299B25701FE39E3; - isa = PBXBuildFile; - settings = { - }; - }; - F53574850299C1B701FE39E3 = { - fileRef = F53574750299B20701FE39E3; - isa = PBXBuildFile; - settings = { - }; - }; - F53574860299C80701FE39E3 = { - fileRef = F53574730299B1E101FE39E3; - isa = PBXBuildFile; - settings = { - }; - }; - F53C74E602A8021101000104 = { - children = ( - F59D148402AC3AC401000104, - F59D148502AC3AC401000104, - ); - isa = PBXGroup; - name = Classes; - refType = 4; - }; - F59D146D02AC308301000104 = { - isa = PBXFileReference; - name = _Dialogs.rsrc; - path = Resources/_Dialogs.rsrc; - refType = 2; - }; - F59D146E02AC308301000104 = { - isa = PBXFileReference; - name = _Strings.rsrc; - path = Resources/_Strings.rsrc; - refType = 2; - }; - F59D146F02AC308301000104 = { - fileRef = F59D146D02AC308301000104; - isa = PBXBuildFile; - settings = { - }; - }; - F59D147002AC308301000104 = { - fileRef = F59D146E02AC308301000104; - isa = PBXBuildFile; - settings = { - }; - }; - F59D147102AC328B01000104 = { - buildArgumentsString = $ACTION; - buildPhases = ( - ); - buildSettings = { - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - OTHER_REZFLAGS = ""; - PRODUCT_NAME = Resources; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; - }; - buildToolPath = /usr/bin/gnumake; - buildWorkingDirectory = ./Resources/; - dependencies = ( - ); - isa = PBXLegacyTarget; - name = Resources; - productName = Resources; - settingsToExpand = 6; - settingsToPassInEnvironment = 287; - settingsToPassOnCommandLine = 280; - shouldUseHeadermap = 0; - }; - F59D147202AC350E01000104 = { - isa = PBXTargetDependency; - target = F59D147102AC328B01000104; - }; - F59D147302AC371D01000104 = { - isa = PBXFileReference; - name = Makefile; - path = Resources/Makefile; - refType = 2; - }; - F59D147402AC39EF01000104 = { - isa = PBXLibraryReference; - path = MRJPlugin.jar; - refType = 3; - }; - F59D147502AC39EF01000104 = { - buildPhases = ( - F59D147602AC39EF01000104, - F59D147702AC39EF01000104, - F59D147802AC39EF01000104, - F59D147902AC39EF01000104, - ); - buildSettings = { - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - LIBRARY_STYLE = STATIC; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOL_FLAGS = ""; - OTHER_REZFLAGS = ""; - PRODUCT_NAME = MRJPlugin; - REZ_EXECUTABLE = YES; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; - }; - dependencies = ( - ); - isa = PBXLibraryTarget; - name = MRJPlugin.jar; - productInstallPath = /usr/local/lib; - productName = MRJPlugin.jar; - productReference = F59D147402AC39EF01000104; - shouldUseHeadermap = 0; - }; - F59D147602AC39EF01000104 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXHeadersBuildPhase; - name = Headers; - }; - F59D147702AC39EF01000104 = { - buildActionMask = 2147483647; - files = ( - F59D147B02AC3A1E01000104, - F59D147D02AC3A4001000104, - F59D148102AC3A6101000104, - F59D148202AC3A6101000104, - F59D148302AC3A6101000104, - F59D148B02AC3AF001000104, - F59D148C02AC3AF001000104, - F59D148D02AC3AF001000104, - F59D148E02AC3AF001000104, - F59D148F02AC3AF001000104, - ); - isa = PBXSourcesBuildPhase; - name = Sources; - }; - F59D147802AC39EF01000104 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXFrameworksBuildPhase; - name = "Frameworks & Libraries"; - }; - F59D147902AC39EF01000104 = { - buildActionMask = 2147483647; - files = ( - ); - isa = PBXRezBuildPhase; - name = "ResourceManager Resources"; - }; - F59D147A02AC3A1E01000104 = { - isa = PBXFileReference; - name = MRJSession.java; - path = Source/MRJSession.java; - refType = 4; - }; - F59D147B02AC3A1E01000104 = { - fileRef = F59D147A02AC3A1E01000104; - isa = PBXBuildFile; - settings = { - }; - }; - F59D147C02AC3A4001000104 = { - isa = PBXFileReference; - name = JNIUtils.java; - path = Source/JNIUtils.java; - refType = 4; - }; - F59D147D02AC3A4001000104 = { - fileRef = F59D147C02AC3A4001000104; - isa = PBXBuildFile; - settings = { - }; - }; - F59D147E02AC3A6101000104 = { - isa = PBXFileReference; - name = JNIThread.java; - path = Source/JNIThread.java; - refType = 4; - }; - F59D147F02AC3A6101000104 = { - isa = PBXFileReference; - name = LiveConnectProxy.java; - path = Source/LiveConnectProxy.java; - refType = 4; - }; - F59D148002AC3A6101000104 = { - isa = PBXFileReference; - name = ProxyClassLoaderFactory.java; - path = Source/ProxyClassLoaderFactory.java; - refType = 4; - }; - F59D148102AC3A6101000104 = { - fileRef = F59D147E02AC3A6101000104; - isa = PBXBuildFile; - settings = { - }; - }; - F59D148202AC3A6101000104 = { - fileRef = F59D147F02AC3A6101000104; - isa = PBXBuildFile; - settings = { - }; - }; - F59D148302AC3A6101000104 = { - fileRef = F59D148002AC3A6101000104; - isa = PBXBuildFile; - settings = { - }; - }; - F59D148402AC3AC401000104 = { - children = ( - F59D147A02AC3A1E01000104, - F59D147C02AC3A4001000104, - F59D147E02AC3A6101000104, - F59D147F02AC3A6101000104, - F59D148002AC3A6101000104, - ); - isa = PBXGroup; - name = netscape.oji; - refType = 4; - }; - F59D148502AC3AC401000104 = { - children = ( - F59D148602AC3AEF01000104, - F59D148702AC3AEF01000104, - F59D148802AC3AEF01000104, - F59D148902AC3AEF01000104, - F59D148A02AC3AEF01000104, - ); - isa = PBXGroup; - name = netscape.javascript; - path = ""; - refType = 4; - }; - F59D148602AC3AEF01000104 = { - isa = PBXFileReference; - name = JSException.java; - path = ../../../../js/src/liveconnect/classes/netscape/javascript/JSException.java; - refType = 2; - }; - F59D148702AC3AEF01000104 = { - isa = PBXFileReference; - name = JSObject.java; - path = ../../../../js/src/liveconnect/classes/netscape/javascript/JSObject.java; - refType = 2; - }; - F59D148802AC3AEF01000104 = { - isa = PBXFileReference; - name = JSProxy.java; - path = ../../../../js/src/liveconnect/classes/netscape/javascript/JSProxy.java; - refType = 2; - }; - F59D148902AC3AEF01000104 = { - isa = PBXFileReference; - name = JSRunnable.java; - path = ../../../../js/src/liveconnect/classes/netscape/javascript/JSRunnable.java; - refType = 2; - }; - F59D148A02AC3AEF01000104 = { - isa = PBXFileReference; - name = JSUtil.java; - path = ../../../../js/src/liveconnect/classes/netscape/javascript/JSUtil.java; - refType = 2; - }; - F59D148B02AC3AF001000104 = { - fileRef = F59D148602AC3AEF01000104; - isa = PBXBuildFile; - settings = { - }; - }; - F59D148C02AC3AF001000104 = { - fileRef = F59D148702AC3AEF01000104; - isa = PBXBuildFile; - settings = { - }; - }; - F59D148D02AC3AF001000104 = { - fileRef = F59D148802AC3AEF01000104; - isa = PBXBuildFile; - settings = { - }; - }; - F59D148E02AC3AF001000104 = { - fileRef = F59D148902AC3AEF01000104; - isa = PBXBuildFile; - settings = { - }; - }; - F59D148F02AC3AF001000104 = { - fileRef = F59D148A02AC3AEF01000104; - isa = PBXBuildFile; - settings = { - }; - }; - F59D149002AC3B8E01000104 = { - isa = PBXTargetDependency; - target = F59D147502AC39EF01000104; - }; - F59D149202AC3C1401000104 = { - fileRef = F59D147402AC39EF01000104; - isa = PBXBuildFile; - settings = { - }; - }; - F5BFB5E8029AD01B01000102 = { - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 6; - files = ( - F5BFB5F0029AD0D101000102, - F5BFB5EE029AD0B901000102, - F59D149202AC3C1401000104, - ); - isa = PBXCopyFilesBuildPhase; - name = "Copy Files"; - }; - F5BFB5E9029AD0B901000102 = { - isa = PBXFileReference; - path = MRJPlugin.policy; - refType = 4; - }; - F5BFB5EA029AD0B901000102 = { - isa = PBXFileReference; - path = MRJPlugin.properties; - refType = 4; - }; - F5BFB5EE029AD0B901000102 = { - fileRef = F5BFB5EA029AD0B901000102; - isa = PBXBuildFile; - settings = { - }; - }; - F5BFB5F0029AD0D101000102 = { - fileRef = F5BFB5E9029AD0B901000102; - isa = PBXBuildFile; - settings = { - }; - }; - F5BFB5F1029AD43001000102 = { - children = ( - F5BFB5E9029AD0B901000102, - F5BFB5EA029AD0B901000102, - ); - isa = PBXGroup; - name = Misc; - refType = 4; - }; - F5DC13A50299D19A01403EB6 = { - isa = PBXFileReference; - name = CSecureEnv.cpp; - path = Source/CSecureEnv.cpp; - refType = 4; - }; - F5DC13A60299D19A01403EB6 = { - fileRef = F5DC13A50299D19A01403EB6; - isa = PBXBuildFile; - settings = { - }; - }; - F5DC13A70299D2CA01403EB6 = { - isa = PBXFileReference; - name = NativeMonitor.cpp; - path = Source/NativeMonitor.cpp; - refType = 4; - }; - F5DC13A80299D2CA01403EB6 = { - fileRef = F5DC13A70299D2CA01403EB6; - isa = PBXBuildFile; - settings = { - }; - }; - F5DC13A90299D38E01403EB6 = { - isa = PBXFileReference; - name = RunnableMixin.cpp; - path = Source/RunnableMixin.cpp; - refType = 4; - }; - F5DC13AA0299D38E01403EB6 = { - fileRef = F5DC13A90299D38E01403EB6; - isa = PBXBuildFile; - settings = { - }; - }; - }; - rootObject = 089C1669FE841209C02AAC07; -} diff --git a/plugin/oji/MRJCarbon/plugin/MRJPlugin.policy b/plugin/oji/MRJCarbon/plugin/MRJPlugin.policy deleted file mode 100644 index ca8436d8e10b..000000000000 --- a/plugin/oji/MRJCarbon/plugin/MRJPlugin.policy +++ /dev/null @@ -1,4 +0,0 @@ -// MRJPlugin.policy -grant codeBase "file:${netscape.oji.plugin.home}/MRJPlugin.jar" { - permission java.security.AllPermission; -}; diff --git a/plugin/oji/MRJCarbon/plugin/MRJPlugin.properties b/plugin/oji/MRJCarbon/plugin/MRJPlugin.properties deleted file mode 100644 index 75dda1b488c8..000000000000 --- a/plugin/oji/MRJCarbon/plugin/MRJPlugin.properties +++ /dev/null @@ -1,4 +0,0 @@ -# MRJPlugin.properties -netscape.oji.plugin.console.append=false -netscape.oji.plugin.version=1.0.1 -netscape.oji.plugin.security=com.apple.mrj.JavaEmbedding.JE_AppletSecurity diff --git a/plugin/oji/MRJCarbon/plugin/MRJPluginCarbon.plist b/plugin/oji/MRJCarbon/plugin/MRJPluginCarbon.plist deleted file mode 100644 index 900d6eb8f38d..000000000000 --- a/plugin/oji/MRJCarbon/plugin/MRJPluginCarbon.plist +++ /dev/null @@ -1,28 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en_US - CFBundleExecutable - MRJPluginCarbon - CFBundleGetInfoString - MRJPluginCarbon 1.0, Copyright Netscape Communications 2002 - CFBundleIdentifier - com.netscape.MRJPluginCarbon.plugin - CFBundleInfoDictionaryVersion - 1.0 - CFBundleName - MRJPluginCarbon.plugin - CFBundlePackageType - NSPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - MOSS - CFBundleVersion - 1.0 - CSResourcesFileMapped - - - diff --git a/plugin/oji/MRJCarbon/plugin/MRJPluginCarbon.xml b/plugin/oji/MRJCarbon/plugin/MRJPluginCarbon.xml deleted file mode 100644 index 099a6c91a090..000000000000 --- a/plugin/oji/MRJCarbon/plugin/MRJPluginCarbon.xml +++ /dev/null @@ -1,2391 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]> - - - - - MRJPlugin.jar - - - - UserSourceTrees - - - AlwaysSearchUserPathsfalse - InterpretDOSAndUnixPathsfalse - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::js:src:liveconnect:classes:netscape:javascript: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::modules:oji:src:classes:netscape:oji: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerJava Linker - PreLinker - PostLinker - TargetnameMRJPlugin.jar - OutputDirectory - Path: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathsfalse - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeGIFf - FileExtension.gif - CompilerJAR Importer - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeJPEG - FileExtension.jpg - CompilerJAR Importer - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerRunTSScript - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.html - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.java - CompilerMW Java - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.mf - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.au - CompilerJAR Importer - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.class - CompilerMW Java - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.gif - CompilerJAR Importer - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.jar - CompilerMW Java - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.jpeg - CompilerJAR Importer - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.zip - CompilerMW Java - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - - - CacheModDatestrue - ActivateBrowsertrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - - - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixname - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_direct_to_som0 - MWFrontEnd_C_som_env_check0 - MWFrontEnd_C_alwaysinline0 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password26339bjk0ÿÙp - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion0 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut25 - MWVJavaDebugging_SupportSlowDevicesfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileMRJPlugin.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - - - MWJava_Proj_projtypeLibrary - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1463898714 - MWJava_Proj_HTMLAppName - MWJava_Proj_PathVersion0 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32Name - MWJava_Proj_compress0 - MWJava_Proj_useVM1 - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Depricated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - - - ,³ˆ - - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentMC68K - MWCodeGen_PPC_tracebacktablesNone - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_processorspecific0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_vrsave0 - - - MWCodeGen_MachO_structalignmentPPC - MWCodeGen_MachO_tracebacktablesNone - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_profiler0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_processorspecific0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vrsave1 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_implicit_templates1 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_stacksize64 - MWProject_MachO_stackaddress0 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeApplication - MWProject_PPC_outfilea.out - MWProject_PPC_filecreator???? - MWProject_PPC_filetypeAPPL - MWProject_PPC_size384 - MWProject_PPC_minsize384 - MWProject_PPC_stacksize64 - MWProject_PPC_flags22720 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - - Name - JNIUtils.java - MacOS - Text - Debug - - - Name - JNIThread.java - MacOS - Text - Debug - - - Name - JSException.java - MacOS - Text - Debug - - - Name - JSObject.java - MacOS - Text - Debug - - - Name - JSProxy.java - MacOS - Text - Debug - - - Name - JSRunnable.java - MacOS - Text - Debug - - - Name - JSUtil.java - MacOS - Text - Debug - - - Name - MRJSession.java - MacOS - Text - Debug - - - Name - rt.jar - MacOS - Library - - - - Name - LiveConnectProxy.java - MacOS - Text - Debug - - - Name - ProxyClassLoaderFactory.java - MacOS - Text - Debug - - - - - Name - JNIUtils.java - MacOS - - - Name - JNIThread.java - MacOS - - - Name - JSException.java - MacOS - - - Name - JSObject.java - MacOS - - - Name - JSProxy.java - MacOS - - - Name - JSRunnable.java - MacOS - - - Name - JSUtil.java - MacOS - - - Name - MRJSession.java - MacOS - - - Name - rt.jar - MacOS - - - Name - LiveConnectProxy.java - MacOS - - - Name - ProxyClassLoaderFactory.java - MacOS - - - - - MRJPluginCarbon - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:nspr: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:plugin: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:gfx: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:xpcom: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:oji: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:dom: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:js: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:include: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:caps: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:liveconnect: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:netwerk: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::::dist:xpconnect: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path::MRJSDK: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MSL: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS PPC Linker - PreLinker - PostLinker - TargetnameMRJPluginCarbon - OutputDirectory - Path: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeNSPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.p - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pas - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerMW Rez - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.s - CompilerPPCAsm - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXCOF - FileExtension - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypestub - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - - - CacheModDatestrue - ActivateBrowsertrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - - - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionNameno connections avaiable - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - - - OtherExecutables - - - CustomColor1 - Red0 - Green39321 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus1 - MWFrontEnd_C_checkprotos1 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint1 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixnameMRJPluginCarbon_config.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_direct_to_som0 - MWFrontEnd_C_som_env_check0 - MWFrontEnd_C_alwaysinline0 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - - - MWWarning_C_warn_illpragma1 - MWWarning_C_warn_emptydecl1 - MWWarning_C_warn_possunwant1 - MWWarning_C_warn_unusedvar1 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma1 - MWWarning_C_pedantic1 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password26339bjk0ÿÙp - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion0 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut25 - MWVJavaDebugging_SupportSlowDevicesfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1463898714 - MWJava_Proj_HTMLAppName - MWJava_Proj_PathVersion0 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32Name - MWJava_Proj_compress0 - MWJava_Proj_useVM1 - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Depricated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - - - ,³ˆ - - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC - MWCodeGen_PPC_tracebacktablesInline - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_processorspecific0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_vrsave0 - - - MWCodeGen_MachO_structalignmentPPC - MWCodeGen_MachO_tracebacktablesNone - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_profiler0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_processorspecific0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vrsave1 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_implicit_templates1 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings1 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initnameMRJPlugin__initialize - MWLinker_PPC_mainname - MWLinker_PPC_termnameMRJPlugin__terminate - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_stacksize64 - MWProject_MachO_stackaddress0 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - - - MWPEF_exportsPragma - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentnameMRJPluginCarbon - MWPEF_collapsereloads0 - - - MWProject_PPC_typeSharedLibrary - MWProject_PPC_outfileMRJPluginCarbon - MWProject_PPC_filecreatorMOSS - MWProject_PPC_filetypeNSPL - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' 'mcvs' 'ckid' - - - - PathRelative - Project - : - :Resources:Strings.rsrc - MacOS - Resource - Debug - - - PathRelative - Project - : - :Source:MRJContext.cp - MacOS - Text - Debug - - - PathRelative - Project - : - :Source:MRJSession.cpp - MacOS - Text - Debug - - - PathRelative - Project - : - :Source:PluginNew.cpp - MacOS - Text - Debug - - - PathRelative - Project - : - :Source:SupportsMixin.cpp - MacOS - Text - Debug - - - PathRelative - Project - : - :Source:MRJPlugin.cpp - MacOS - Text - Debug - - - PathRelative - Project - : - :Resources:Version.rsrc - MacOS - Resource - Debug - - - PathRelative - Project - : - :Source:StringUtils.cpp - MacOS - Text - Debug - - - PathRelative - Project - : - :Source:LiveConnectNativeMethods.cpp - MacOS - Text - Debug - - - PathRelative - Project - : - :Source:MRJMonitor.cpp - MacOS - Text - Debug - - - PathRelative - Project - : - :Source:CSecureEnv.cpp - MacOS - Text - Debug - - - PathRelative - Project - : - :Source:NativeMonitor.cpp - MacOS - Text - Debug - - - PathRelative - Project - : - :Source:JSEvaluator.cpp - MacOS - Text - Debug - - - PathRelative - Project - : - :Source:RunnableMixin.cpp - MacOS - Text - Debug - - - PathRelative - Project - : - :Resources:Dialogs.rsrc - MacOS - Resource - Debug - - - PathRelative - Project - : - :Source:MRJPage.cpp - MacOS - Text - Debug - - - PathRelative - Project - : - :Source:JavaVMFramework.cpp - MacOS - Text - Debug - - - PathRelative - Project - ::MRJSDK: - :JavaFrameworks:JavaEmbeddingLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:CarbonLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_All_Carbon.Lib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:CarbonFrameworkLib - MacOS - Library - Debug - - - - - PathRelative - Project - : - :Resources:Version.rsrc - MacOS - - - PathRelative - Project - : - :Resources:Strings.rsrc - MacOS - - - PathRelative - Project - : - :Resources:Dialogs.rsrc - MacOS - - - PathRelative - Project - : - :Source:MRJPlugin.cpp - MacOS - - - PathRelative - Project - : - :Source:MRJContext.cp - MacOS - - - PathRelative - Project - : - :Source:MRJSession.cpp - MacOS - - - PathRelative - Project - : - :Source:PluginNew.cpp - MacOS - - - PathRelative - Project - : - :Source:SupportsMixin.cpp - MacOS - - - PathRelative - Project - : - :Source:StringUtils.cpp - MacOS - - - PathRelative - Project - : - :Source:LiveConnectNativeMethods.cpp - MacOS - - - PathRelative - Project - : - :Source:MRJMonitor.cpp - MacOS - - - PathRelative - Project - : - :Source:CSecureEnv.cpp - MacOS - - - PathRelative - Project - : - :Source:NativeMonitor.cpp - MacOS - - - PathRelative - Project - : - :Source:JSEvaluator.cpp - MacOS - - - PathRelative - Project - : - :Source:RunnableMixin.cpp - MacOS - - - PathRelative - Project - : - :Source:MRJPage.cpp - MacOS - - - PathRelative - Project - : - :Source:JavaVMFramework.cpp - MacOS - - - PathRelative - Project - ::MRJSDK: - :JavaFrameworks:JavaEmbeddingLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:CarbonLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:CarbonFrameworkLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_All_Carbon.Lib - MacOS - - - - - - - MRJPluginCarbon - MRJPlugin.jar - - - - Plugin - - MRJPluginCarbon - PathRelative - Project - : - :Source:MRJPlugin.cpp - MacOS - - - MRJPluginCarbon - PathRelative - Project - : - :Source:MRJContext.cp - MacOS - - - MRJPluginCarbon - PathRelative - Project - : - :Source:MRJMonitor.cpp - MacOS - - - MRJPluginCarbon - PathRelative - Project - : - :Source:MRJPage.cpp - MacOS - - - MRJPluginCarbon - PathRelative - Project - : - :Source:SupportsMixin.cpp - MacOS - - - MRJPluginCarbon - PathRelative - Project - : - :Source:RunnableMixin.cpp - MacOS - - - MRJPluginCarbon - PathRelative - Project - : - :Source:MRJSession.cpp - MacOS - - - MRJPluginCarbon - PathRelative - Project - : - :Source:PluginNew.cpp - MacOS - - - MRJPluginCarbon - PathRelative - Project - : - :Source:StringUtils.cpp - MacOS - - - MRJPluginCarbon - PathRelative - Project - : - :Source:JSEvaluator.cpp - MacOS - - - MRJPluginCarbon - PathRelative - Project - : - :Source:JavaVMFramework.cpp - MacOS - - - MRJPluginCarbon - PathRelative - Project - : - :Resources:Strings.rsrc - MacOS - - - MRJPluginCarbon - PathRelative - Project - : - :Resources:Version.rsrc - MacOS - - - MRJPluginCarbon - PathRelative - Project - : - :Resources:Dialogs.rsrc - MacOS - - - LiveConnect - - MRJPluginCarbon - PathRelative - Project - : - :Source:LiveConnectNativeMethods.cpp - MacOS - - - SecureJNI - - MRJPluginCarbon - PathRelative - Project - : - :Source:CSecureEnv.cpp - MacOS - - - MRJPluginCarbon - PathRelative - Project - : - :Source:NativeMonitor.cpp - MacOS - - - Carbon Libraries - - MRJPluginCarbon - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:CarbonLib - MacOS - - - MRJPluginCarbon - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:CarbonFrameworkLib - MacOS - - - MRJPluginCarbon - PathRelative - Project - ::MRJSDK: - :JavaFrameworks:JavaEmbeddingLib - MacOS - - - MRJPluginCarbon - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_All_Carbon.Lib - MacOS - - - MRJPlugin.jar - - MRJPlugin.jar - Name - MRJSession.java - MacOS - - - MRJPlugin.jar - Name - JNIUtils.java - MacOS - - - MRJPlugin.jar - Name - JNIThread.java - MacOS - - - MRJPlugin.jar - Name - LiveConnectProxy.java - MacOS - - - MRJPlugin.jar - Name - ProxyClassLoaderFactory.java - MacOS - - - MRJPlugin.jar - Name - rt.jar - MacOS - - liveconnect - - MRJPlugin.jar - Name - JSException.java - MacOS - - - MRJPlugin.jar - Name - JSObject.java - MacOS - - - MRJPlugin.jar - Name - JSProxy.java - MacOS - - - MRJPlugin.jar - Name - JSRunnable.java - MacOS - - - MRJPlugin.jar - Name - JSUtil.java - MacOS - - - - - - diff --git a/plugin/oji/MRJCarbon/plugin/Resources/Dialogs.rsrc b/plugin/oji/MRJCarbon/plugin/Resources/Dialogs.rsrc deleted file mode 100644 index 728a264db18212574f3d4282afc658cb49b995ec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1156 zcmb7D&rcIU6#ix@V70-9gBay7n#x5}8xJNDf1q0=XiIBpq#8^Zw%f9}bj|J(IT=XA z5KbP92alXQ7$YZQ;>9Z`Jb3q_@h|XN-^@;7Eqd@JGw*xfdvE5w`GMXOfPur(LlmQN zUAtrq;lv2(B-zhMGCsnA3!AEs>NnEYwzHG(Xy}NpRBcwrYgKb* za{TY!L+mNd$oj7kmS+-|Arw%3*Jietk45K8+MIC~x#mi6vWcZ;qG?!nZsTEv&NtZ%XO#1n9^}qK-7V ze|XZ4`ineq9M6bjV3hT+dn_>4W4Wtmi@GK*)+p!WtUxS4Py%m-FqNz1@pZ5eM_&ye<6txt1LUmUv=kEpG`dhg9AXuGb9I)9*yf z$8_*}rc0G7dqMXwj9v7bQ`G|Xd@Dam8hDs5Ow>p>@`cg_Y2SM6)JZ?9Tj4zE&AQuM zA^qBk>@BRe+Z^zS1J)E)Q1h>pK{51@WQUOV&%xeme4O|nXMTN3$#~*UN4&zDF( k;O26;V7EfY5+Qx>fwJ!{+E(cKJTF2K`_sT@mHWr^8wIMMfB*mh diff --git a/plugin/oji/MRJCarbon/plugin/Resources/Makefile b/plugin/oji/MRJCarbon/plugin/Resources/Makefile deleted file mode 100644 index e852f952e32a..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Resources/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# decodes resource files from AppleSingle to Resource Manager format. - -ASDECODE = ../../../../../dist/bin/asdecode -RESOURCE_FILES = _Dialogs.rsrc _Strings.rsrc - -all: $(RESOURCE_FILES) - -_Dialogs.rsrc: Dialogs.rsrc - $(ASDECODE) Dialogs.rsrc _Dialogs.rsrc - -_Strings.rsrc: Strings.rsrc - $(ASDECODE) Strings.rsrc _Strings.rsrc - -clean: - rm -f $(RESOURCE_FILES) diff --git a/plugin/oji/MRJCarbon/plugin/Resources/Strings.rsrc b/plugin/oji/MRJCarbon/plugin/Resources/Strings.rsrc deleted file mode 100644 index 591b7b609e89c809bfaf70710733e37ed86fcaf3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1622 zcmdT^O=uHQ5S}J!ts06{Eh;Sz*v25~+hzkrtX9)BZC#Qyq@ffsnqM#aD0%P%OxhQMp=XgRczbo;maGVp2R=! zW9HN0;}HVgD^GDMzV54rx-l`BT^t=sK>(+M74YvEEe%fGhyL&}=w0lS0-3e9a14|i z3%88GYc9vh@E+xQ>0?+K%;B!m6Zd<7Rnj{=z40TYgr^q|Oq8Xdv|H-RtifI7%_>-CzhsZ6&_>GH71YPf0mFISrf|Dq8h%D7e?`loiRNo|LFI~66- zPHq{E9&O8(M7vz;cFkqaTyE2Q%rlR*1zdK4x93`J0hikYE)x&9EVqRu<|2u;m1L}i zBo^g=**n-BOd17REYcz>^XYwC41Z&cyD#})3we?+KCeH&clv`o0s+psefQ}7o!er0 zjkdWbB(3S#mc=B)x}w)=s#LEv%DO38Rb5Kwl!R&*cmuSAIqFyqTceKjYtKV(fvR?K z$fV5C)H)@aWq?0QWY{(uM98sorp2(X+6=7{78-i3cpf*sVo9%22TPWXX;s77Ib6V5 zL$C+Gm>QsfX z`Uy!|T3RBl@)64}Z`LmBR+3bhQ5)x_M2|ly#m8}p7LYrmWI!b7DYhjZ!Df_<{631| z(B2f3U>W-10(8vfb4U1?@6|5pMP8dxxVEu@(D6nT3YNvaMOVe$zv6PsV)s23dr#K3 Vs#Ie<=Sh{RTT^<2lQ7s$KLH?W<{SV3 diff --git a/plugin/oji/MRJCarbon/plugin/Resources/Version.rsrc b/plugin/oji/MRJCarbon/plugin/Resources/Version.rsrc deleted file mode 100644 index ae01c6ea6eca66f1ef60c4ae5e3862bcc01bfbe7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 762 zcmZuvK}#D^5T0G*L69OIs;GxK)E;Vhn*948&$oFn;uYU9)y9+)9AZhyk{Pxtw4J&^q&ln@E+4ErQ@WB08-ui#_89J9C$^2`S zCp#IopI`ES-oJY&6(C1&TJ6sNe%+n_buml>a2;`Kv{I4NR_A^YaHkW*O+R#0%Xcc? zj>~mTh5tZL8Wn3HjWfJ5n662#>x-d`jNl!~gla>s$coGGWVMO%+NV%O*x@=t)xcWp z2ldZLI@MGa`*K)h1=KQ-+(;D1JZwtClI~ZQbxC2I>Z~}kw^PQfuc0(nxWK)AJS4*E zFmEYk=kXivW&@(D+U+>>1&`>rn>?07!LU>)ltxd-!rT;8;Sv_W1M8ITgqAriPW(El nyaBt{qj*P7jcJ~|f%pS^QPrv?MMMK`@`yiPQjcuF8YF)KoDh<` diff --git a/plugin/oji/MRJCarbon/plugin/Source/AWTUtils.java b/plugin/oji/MRJCarbon/plugin/Source/AWTUtils.java deleted file mode 100644 index 2ed5f466ada4..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/AWTUtils.java +++ /dev/null @@ -1,74 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - AWTUtils.java - */ - -package netscape.oji; - - -import java.awt.Container; -import java.awt.Graphics; -import java.awt.Point; - -import com.apple.mrj.internal.awt.PrintingPort; - -public class AWTUtils { - /** - * Prints the components of a specified Container. - */ - public static void printContainer(Container container, int printingPort, int originX, int originY, Object notifier) { - try { - // obtain a graphics object to draw with. - PrintingPort printer = new PrintingPort(printingPort, originX, originY); - Graphics graphics = printer.getGraphics(container); - - // print the specified container. - container.printAll(graphics); - - graphics.dispose(); - printer.dispose(); - } finally { - // if caller is waiting for this to complete, then notify. - if (notifier != null) { - synchronized(notifier) { - notifier.notifyAll(); - } - } - } - } -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/AsyncMessage.h b/plugin/oji/MRJCarbon/plugin/Source/AsyncMessage.h deleted file mode 100644 index d42ea516a02f..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/AsyncMessage.h +++ /dev/null @@ -1,58 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - AsyncMessage.h - - Base class for messages that are executed asynchronously, during MRJSession idle time. - - by Patrick C. Beard. - */ - -#pragma once - -#include "MRJSession.h" - -class AsyncMessage : public NativeMessage { -public: - AsyncMessage(MRJSession* session) : mSession(session) {} - virtual ~AsyncMessage() {} - - void send(Boolean async = false); - -protected: - MRJSession* mSession; -}; diff --git a/plugin/oji/MRJCarbon/plugin/Source/CSecureEnv.cpp b/plugin/oji/MRJCarbon/plugin/Source/CSecureEnv.cpp deleted file mode 100644 index 7ffb2184a0f7..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/CSecureEnv.cpp +++ /dev/null @@ -1,3148 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -#include "CSecureEnv.h" -#include "nsISecurityContext.h" - -#include "MRJPlugin.h" -#include "MRJSession.h" -#include "nsIThreadManager.h" -#include "nsIJVMManager.h" -#include "nsIScriptSecurityManager.h" -#include "nsICodebasePrincipal.h" - -#include "MRJMonitor.h" -#include "NativeMonitor.h" -#include "JavaMessageQueue.h" - -#define PROXY_JNI_CALLS 1 -#define USE_LIVECONNECT_PROXY 1 -#define LOCAL_REFS_ARE_GLOBAL USE_LIVECONNECT_PROXY - -inline jobject ToGlobalRef(JNIEnv* env, jobject localRef) -{ - jobject globalRef = env->NewGlobalRef(localRef); - // env->DeleteLocalRef(localRef); // not necessary from native methods. done en-masse. - return globalRef; -} - -JavaMessageQueue::JavaMessageQueue(Monitor* monitor) - : mFirst(NULL), mLast(NULL), mMonitor(monitor) -{ -} - -void JavaMessageQueue::putMessage(JavaMessage* msg) -{ - if (mFirst == NULL) { - mFirst = mLast = msg; - } else { - mLast->setNext(msg); - mLast = msg; - } - msg->setNext(NULL); -} - -JavaMessage* JavaMessageQueue::getMessage() -{ - JavaMessage* msg = mFirst; - if (msg != NULL) { - mFirst = mFirst->getNext(); - if (mFirst == NULL) mLast = NULL; - } - return msg; -} - -void JavaMessageQueue::enter() -{ - mMonitor->enter(); -} - -void JavaMessageQueue::exit() -{ - mMonitor->exit(); -} - -void JavaMessageQueue::wait() -{ - mMonitor->wait(); -} - -void JavaMessageQueue::wait(long long millis) -{ - mMonitor->wait(millis); -} - -void JavaMessageQueue::notify() -{ - mMonitor->notify(); -} - -/** - * Native run method that communicates with LiveConnect from a Java thread. - */ -static void netscape_oji_JNIThread_run(JNIEnv* env, jobject self) -{ - CSecureEnv* secureEnv = NULL; - jmethodID yieldMethod = NULL; - jmethodID sleepMethod = NULL; - - jclass clazz = env->GetObjectClass(self); - if (clazz != NULL) { - // the field fSecureEnv contains a pointer to a CSecureEnv. - jfieldID fSecureEnvField = env->GetFieldID(clazz, "fSecureEnv", "I"); - if (fSecureEnvField != NULL) { - secureEnv = (CSecureEnv*) env->GetIntField(self, fSecureEnvField); - } - yieldMethod = env->GetStaticMethodID(clazz, "yield", "()V"); - sleepMethod = env->GetStaticMethodID(clazz, "sleep", "(J)V"); - } - - // notify the secure JNI that we are here, and wait for messages to arrive. - if (secureEnv != NULL) { - jboolean isRunning = true; - MRJSession* session = secureEnv->getSession(); - MRJMonitor requestMonitor(session, self); - MRJMonitor replyMonitor(session); - // NativeMonitor replyMonitor(secureEnv->getThreadManager()); - JavaMessageQueue requests(&requestMonitor), replies(&replyMonitor); - secureEnv->initialize(env, &isRunning, &requests, &replies); - - // when this thread is running, no other thread can enter the request queue monitor. - requests.enter(); - - while (isRunning) { - // the protocol for now is dead simple: get a message from the - // requests message queue, process it, and then put it back in - // the replies queue. This will get more elaborate to handle - // upcall requests. - JavaMessage* msg = requests.getMessage(); - if (msg != NULL) { - msg->execute(env); - secureEnv->savePendingException(env); - replies.putMessage(msg); - replies.notify(); - } else { - // should we do sleep, timed wait, or what? - // env->CallStaticVoidMethod(clazz, yieldMethod); - // env->CallStaticVoidMethod(clazz, sleepMethod, jlong(kDefaultJMTime)); - requests.wait(); - } - } - - requests.exit(); - } -} - -static jclass netscape_oji_JNIRunnable; -static jmethodID netscape_oji_JNIRunnable_constructorID; -static jfieldID netscape_oji_JNIRunnable_mJavaMessageID; - -static void netscape_oji_JNIRunnable_run(JNIEnv* env, jobject self) -{ - JavaMessage* msg = (JavaMessage*) env->GetIntField(self, netscape_oji_JNIRunnable_mJavaMessageID); - if (msg) { - msg->execute(env); - // what about upcalls? - } -} - -static bool check_exceptions(JNIEnv* env) -{ - jthrowable exc = env->ExceptionOccurred(); - if (exc) { - env->ExceptionDescribe(); - env->ExceptionClear(); - env->DeleteLocalRef(exc); - return true; - } - return false; -} - -/** - * Called from browser side, starts the Java thread that calls from LiveConnect to Java - * are processed in. - */ -static void CreateJNIThread(CSecureEnv* secureEnv) -{ - nsIThreadManager* manager = secureEnv->getThreadManager(); - MRJSession* session = secureEnv->getSession(); - JNIEnv* env = session->getCurrentEnv(); - - check_exceptions(env); - - jclass JNIThreadClass = env->FindClass("netscape.oji.JNIThread"); - if (JNIThreadClass != NULL) { - JNINativeMethod method = { "run", "()V", &netscape_oji_JNIThread_run }; - env->RegisterNatives(JNIThreadClass, &method, 1); - jmethodID constructorID = env->GetMethodID(JNIThreadClass, "", "(I)V"); - if (constructorID != NULL) { - jobject javaThread = env->NewObject(JNIThreadClass, constructorID, secureEnv); - for (;;) { - // was there some kind of exception? bail if so. - if (check_exceptions(env)) - break; - // give time to Java, to allow the thread to come up. - session->idle(); - // has the thread made contact? - if (secureEnv->isInitialized()) - break; - // give time to NSPR, to avoid hanging too long. - manager->Sleep(); - } - } - env->DeleteLocalRef(JNIThreadClass); - } -} - -static jobject CreateJNIRunnable(JNIEnv* env, JavaMessage* msg) -{ - // XXX: does this have to be thread safe? - if (!netscape_oji_JNIRunnable) { - jclass clazz = env->FindClass("netscape.oji.JNIRunnable"); - if (!clazz) return NULL; - JNINativeMethod method = { "run", "()V", &netscape_oji_JNIRunnable_run }; - env->RegisterNatives(clazz, &method, 1); - netscape_oji_JNIRunnable_constructorID = env->GetMethodID(clazz, "", "(I)V"); - netscape_oji_JNIRunnable_mJavaMessageID = env->GetFieldID(clazz, "mJavaMessage", "I"); - netscape_oji_JNIRunnable = (jclass) env->NewGlobalRef(clazz); - env->DeleteLocalRef(clazz); - } - check_exceptions(env); - return env->NewObject(netscape_oji_JNIRunnable, netscape_oji_JNIRunnable_constructorID, msg); -} - -static jclass GetLiveConnectProxy(JNIEnv* env, nsICodebasePrincipal* codebasePrincipal) -{ - jclass liveConnectProxy = NULL; - jclass netscape_oji_ProxyClassLoaderFactory = env->FindClass("netscape/oji/ProxyClassLoaderFactory"); - if (netscape_oji_ProxyClassLoaderFactory) { - jmethodID createClassLoaderID = env->GetStaticMethodID(netscape_oji_ProxyClassLoaderFactory, - "createClassLoader", - "(Ljava/lang/String;)Ljava/lang/ClassLoader;"); - if (createClassLoaderID) { - jstring codebaseUTF = NULL; - char* codebase; - nsresult rv = codebasePrincipal->GetOrigin(&codebase); - if (NS_SUCCEEDED(rv)) { - codebaseUTF = env->NewStringUTF(codebase); - delete[] codebase; - } - if (codebaseUTF) { - jobject classLoader = env->CallStaticObjectMethod(netscape_oji_ProxyClassLoaderFactory, - createClassLoaderID, codebaseUTF); - if (classLoader) { - jclass clazz = env->GetObjectClass(classLoader); - jmethodID loadClassID = env->GetMethodID(clazz, "loadClass", - "(Ljava/lang/String;)Ljava/lang/Class;"); - if (loadClassID) { - jstring className = env->NewStringUTF("netscape.oji.LiveConnectProxy"); - if (className) { - liveConnectProxy = (jclass) env->CallObjectMethod(classLoader, loadClassID, className); - env->DeleteLocalRef(className); - } - } - env->DeleteLocalRef(clazz); - } - env->DeleteLocalRef(codebaseUTF); - } - } - env->DeleteLocalRef(netscape_oji_ProxyClassLoaderFactory); - } - check_exceptions(env); - return liveConnectProxy; -} - -/** - * Creates a new native thread in MRJ's main thread, to avoid deadlock problems. - */ -class CreateNativeThreadMessage : public NativeMessage { - nsresult* mResult; - PRUint32* mThreadID; - CSecureEnv* mSecureEnv; -public: - CreateNativeThreadMessage(nsresult* outResult, PRUint32* outThreadID, CSecureEnv* secureEnv) - : mResult(outResult), mThreadID(outThreadID), mSecureEnv(secureEnv) - { - } - - virtual void execute() - { - nsIThreadManager* manager = mSecureEnv->getThreadManager(); - *mResult = manager->CreateThread(mThreadID, mSecureEnv); - } -}; - -/** - * Called from a Java thread that wants to communicate with the browser. - */ -static void CreateNativeThread(CSecureEnv* secureEnv) -{ - nsresult result; - PRUint32 threadID; - MRJSession* session = secureEnv->getSession(); - - // cause a native thread to be created on our behalf. Perhaps this should be a message we send to the - // session itself. otherwise we could have reentrancy problems. - CreateNativeThreadMessage message(&result, &threadID, secureEnv); - session->sendMessage(&message); - - if (session->onMainThread()) { - // give time to other native threads, so the new thread can come up. - nsIThreadManager* manager = secureEnv->getThreadManager(); - while (!secureEnv->isInitialized()) { - manager->Sleep(); - } - } else { - // sleep the current Java thread until we rendezvous with the Native thread. - JNIEnv* env = session->getCurrentEnv(); - jclass threadClass = env->FindClass("java/lang/Thread"); - if (threadClass != NULL) { - jmethodID sleepMethod = env->GetStaticMethodID(threadClass, "sleep", "(J)V"); - if (sleepMethod != NULL) { - while (!secureEnv->isInitialized()) - env->CallStaticVoidMethod(threadClass, sleepMethod, jlong(1024)); - } - env->DeleteLocalRef(threadClass); - } - } -} - -/** - * Runs the server thread for LiveConnect upcalls from spontaneous Java threads. - */ -NS_IMETHODIMP CSecureEnv::Run() -{ - jboolean isRunning = true; - NativeMonitor requestMonitor(mSession, mThreadManager); - MRJMonitor replyMonitor(mSession); - JavaMessageQueue requests(&requestMonitor), replies(&replyMonitor); - // initialize(env, self, &isRunning, &requests, &replies); - - // we have to create the Proxy JNI here, so it associated with this thread. - nsIJVMManager* manager = mPlugin->getManager(); - manager->CreateProxyJNI(this, &mProxyEnv); - - mIsRunning = &isRunning; - mNativeQueue = &requests; - mJavaQueue = &replies; - - // when this thread is running, no other thread can enter the request queue monitor. - requests.enter(); - - while (isRunning) { - // the protocol for now is dead simple: get a message from the - // requests message queue, process it, and then put it back in - // the replies queue. This will get more elaborate to handle - // upcall requests. - JavaMessage* msg = requests.getMessage(); - if (msg != NULL) { - msg->execute(mProxyEnv); - replies.putMessage(msg); - replies.notify(); - } else { - // should we do sleep, timed wait, or what? - // env->CallStaticVoidMethod(clazz, yieldMethod); - // env->CallStaticVoidMethod(clazz, sleepMethod, jlong(kDefaultJMTime)); - requests.wait(); - } - } - - requests.exit(); - - return NS_OK; -} - -/** - * Used to send a message from Native to Java threads. - */ -void CSecureEnv::sendMessageToJava(JavaMessage* msg) -{ -#if USE_LIVECONNECT_PROXY - JNIEnv* env = mSession->getCurrentEnv(); - // XXX this needs to be optimized up the wazoo. - // somehow, get the associated class loader for the codebase of the currently running - // script. doing this here would require us to use lots of unfrozen interfaces. - nsresult rv = NS_OK; - if (!mScriptSecurityManager) { - rv = MRJPlugin::GetService("@mozilla.org/scriptsecuritymanager;1", - NS_GET_IID(nsIScriptSecurityManager), - (void**)&mScriptSecurityManager); - } - // XXX Simple principal caching mechanism. If the principal is the same as - // last time, then keep using the same LiveConnect proxy class. This should - // be adequate for the simple cases of a single document using LiveConnect. - // There should also be some caching going on inside ProxyClassLoaderFactory, - // which should return the same class loader for the same URL, until this - // prinicipal changes. Idea: could use a weak reference dictionary that - // only holds the class loader while there are other strong references to it. - if (NS_SUCCEEDED(rv)) { - nsIPrincipal* scriptPrincipal; - rv = mScriptSecurityManager->GetSubjectPrincipal(&scriptPrincipal); - if (NS_SUCCEEDED(rv)) { - if (scriptPrincipal != mScriptPrincipal) { - // invalidate our cached LiveConnectProxy class. - NS_IF_RELEASE(mScriptPrincipal); - mScriptPrincipal = scriptPrincipal; - if (mLiveConnectProxy) { - env->DeleteGlobalRef(mLiveConnectProxy); - mLiveConnectProxy = NULL; - } - } - if (!mLiveConnectProxy && scriptPrincipal) { - nsICodebasePrincipal* codebasePrincipal; - rv = scriptPrincipal->QueryInterface(NS_GET_IID(nsICodebasePrincipal), (void**)&codebasePrincipal); - if (NS_SUCCEEDED(rv)) { - jclass liveConnectProxy = GetLiveConnectProxy(env, codebasePrincipal); - NS_RELEASE(codebasePrincipal); - if (liveConnectProxy) { - mLiveConnectProxy = (jclass) env->NewGlobalRef(liveConnectProxy); - env->DeleteLocalRef(liveConnectProxy); - } - } - } - } - } - if (mLiveConnectProxy) { - jobject runnable = CreateJNIRunnable(env, msg); - if (runnable) { - jmethodID runID = env->GetStaticMethodID(mLiveConnectProxy, "run", "(Ljava/lang/Runnable;)V"); - if (runID) { - env->CallStaticVoidMethod(mLiveConnectProxy, runID, runnable); - savePendingException(env); - } - env->DeleteLocalRef(runnable); - } - } else { - msg->execute(env); - savePendingException(env); - } -#else - messageLoop(mProxyEnv, msg, mJavaQueue, mNativeQueue, true); -#endif -} - -/** - * Used to send a message from Java to Native threads. - */ -void CSecureEnv::sendMessageFromJava(JNIEnv* javaEnv, JavaMessage* msg, Boolean busyWaiting) -{ - messageLoop(javaEnv, msg, mNativeQueue, mJavaQueue, busyWaiting); -} - -//////////////////////////////////////////////////////////////////////////// -// Table-driven nsISupports data. - -const InterfaceInfo CSecureEnv::sInterfaces[] = { - { NS_ISECUREENV_IID, INTERFACE_OFFSET(CSecureEnv, nsISecureEnv) }, - { NS_IRUNNABLE_IID, INTERFACE_OFFSET(CSecureEnv, nsIRunnable) }, -}; -const UInt32 CSecureEnv::kInterfaceCount = sizeof(sInterfaces) / sizeof(InterfaceInfo); - -CSecureEnv::CSecureEnv(MRJPlugin* plugin, JNIEnv* proxyEnv, JNIEnv* javaEnv) - : SupportsMixin(this, sInterfaces, kInterfaceCount), - mPlugin(plugin), mProxyEnv(proxyEnv), mJavaEnv(javaEnv), - mSession(plugin->getSession()), mThreadManager(plugin->getThreadManager()), - mIsRunning(NULL), mJavaQueue(NULL), mNativeQueue(NULL), - mPendingException(NULL), - mScriptSecurityManager(NULL), mScriptPrincipal(NULL), mLiveConnectProxy(NULL) -{ - // need to create the JNIThread for communicating with Java. - if (mJavaEnv != NULL) - CreateNativeThread(this); - else - CreateJNIThread(this); -} - - -CSecureEnv::~CSecureEnv() -{ - // Tell the Java thread to die. - if (mIsRunning != NULL) { - *mIsRunning = false; - mJavaQueue->notify(); - } - - JNIEnv* env = mSession->getCurrentEnv(); - if (mPendingException) { - env->DeleteGlobalRef(mPendingException); - mPendingException = NULL; - } - - if (mLiveConnectProxy) { - env->DeleteGlobalRef(mLiveConnectProxy); - mLiveConnectProxy = NULL; - } - - NS_IF_RELEASE(mScriptPrincipal); - NS_IF_RELEASE(mScriptSecurityManager); -} - -void CSecureEnv::initialize(JNIEnv* javaEnv, jboolean* isRunning, JavaMessageQueue* javaQueue, JavaMessageQueue* nativeQueue) -{ - mJavaEnv = javaEnv; - mIsRunning = isRunning; - mJavaQueue = javaQueue; - mNativeQueue = nativeQueue; -} - -///=--------------------------------------------------------------------------= -// CSecureEnv::Create -///=--------------------------------------------------------------------------= -// Create the CSecureEnv object for creating object, invoking method, -// getting/setting field in JNI with security context. -// -// parameters : -// -// return : -// -// notes : -// -NS_METHOD -CSecureEnv::Create(MRJPlugin* plugin, JNIEnv* proxyEnv, const nsIID& aIID, void* *aInstancePtr) -{ - CSecureEnv* secureEnv = new CSecureEnv(plugin, proxyEnv); - if (secureEnv == NULL) - return NS_ERROR_OUT_OF_MEMORY; - NS_ADDREF(secureEnv); - nsresult rv = secureEnv->QueryInterface(aIID, aInstancePtr); - NS_RELEASE(secureEnv); - return rv; -} - -///=--------------------------------------------------------------------------= -// CSecureEnv::NewObject -///=--------------------------------------------------------------------------= -// Create new Java object in LiveConnect. -// -// @param env -- JNIEnv pointer. -// @param clazz -- Java Class object. -// @param methodID -- Method id -// @param args -- arguments for invoking the constructor. -// @param result -- return new Java object. -// @param ctx -- security context -// - -class NewObjectMessage : public JavaMessage { - jclass clazz; - jmethodID methodID; - jvalue* args; - jobject* result; - -public: - NewObjectMessage(jclass clazz, jmethodID methodID, jvalue *args, jobject* result) - { - this->clazz = clazz; - this->methodID = methodID; - this->args = args; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->NewObjectA(clazz, methodID, args); -#if LOCAL_REFS_ARE_GLOBAL - *result = ToGlobalRef(env, *result); -#endif - } -}; - -NS_IMETHODIMP CSecureEnv::NewObject(/*[in]*/ jclass clazz, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jobject* result, - /*[in]*/ nsISecurityContext* ctx) -{ - if (clazz == NULL || methodID == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - // Call method on Java side - NewObjectMessage msg(clazz, methodID, args, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->NewObjectA(clazz, methodID, args); -#endif - - return NS_OK; -} - - -///=--------------------------------------------------------------------------= -// CSecureEnv::CallMethod -///=--------------------------------------------------------------------------= -// Invoke method on Java object in LiveConnect. -// -// @param type -- Return type -// @param obj -- Java object. -// @param methodID -- Method id -// @param result -- return result of invocation. -// @param ctx -- security context -// - -class CallMethodMessage : public JavaMessage { - jni_type return_type; - jobject obj; - jmethodID methodID; - jvalue* args; - jvalue* result; - -public: - CallMethodMessage(jni_type return_type, jobject obj, jmethodID methodID, jvalue *args, jvalue* result) - { - this->return_type = return_type; - this->obj = obj; - this->methodID = methodID; - this->args = args; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - switch (return_type) { - case jobject_type: - result->l = env->CallObjectMethodA(obj, methodID, args); -#if LOCAL_REFS_ARE_GLOBAL - result->l = ToGlobalRef(env, result->l); -#endif - break; - case jboolean_type: - result->z = env->CallBooleanMethodA(obj, methodID, args); - break; - case jbyte_type: - result->b = env->CallByteMethodA(obj, methodID, args); - break; - case jchar_type: - result->c = env->CallCharMethodA(obj, methodID, args); - break; - case jshort_type: - result->s = env->CallShortMethodA(obj, methodID, args); - break; - case jint_type: - result->i = env->CallIntMethodA(obj, methodID, args); - break; - case jlong_type: - result->j = env->CallLongMethodA(obj, methodID, args); - break; - case jfloat_type: - result->f = env->CallFloatMethodA(obj, methodID, args); - break; - case jdouble_type: - result->d = env->CallDoubleMethodA(obj, methodID, args); - break; - case jvoid_type: - env->CallVoidMethodA(obj, methodID, args); - break; - } - } -}; - -NS_IMETHODIMP CSecureEnv::CallMethod(/*[in]*/ jni_type return_type, - /*[in]*/ jobject obj, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx) -{ - if (obj == NULL || methodID == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - // Call method on Java side - // return CallJavaMethod(obj, method, args, ctx, result); - CallMethodMessage msg(return_type, obj, methodID, args, result); - sendMessageToJava(&msg); -#else - JNIEnv* env = mJavaEnv; - switch (return_type) { - case jobject_type: - result->l = env->CallObjectMethodA(obj, methodID, args); - break; - case jboolean_type: - result->z = env->CallBooleanMethodA(obj, methodID, args); - break; - case jbyte_type: - result->b = env->CallByteMethodA(obj, methodID, args); - break; - case jchar_type: - result->c = env->CallCharMethodA(obj, methodID, args); - break; - case jshort_type: - result->s = env->CallShortMethodA(obj, methodID, args); - break; - case jint_type: - result->i = env->CallIntMethodA(obj, methodID, args); - break; - case jlong_type: - result->j = env->CallLongMethodA(obj, methodID, args); - break; - case jfloat_type: - result->f = env->CallFloatMethodA(obj, methodID, args); - break; - case jdouble_type: - result->d = env->CallDoubleMethodA(obj, methodID, args); - break; - case jvoid_type: - env->CallVoidMethodA(obj, methodID, args); - break; - } -#endif - - return NS_OK; -} - - -///=--------------------------------------------------------------------------= -// CSecureEnv::CallNonvirtualMethod -///=--------------------------------------------------------------------------= -// Invoke non-virtual method on Java object in LiveConnect. -// -// @param obj -- Java object. -// @param methodID -- Method id -// @param args -- arguments for invoking the constructor. -// @param result -- return result of invocation. -// @param ctx -- security context -// - -class CallNonvirtualMethodMessage : public JavaMessage { - jni_type type; - jobject obj; - jclass clazz; - jmethodID methodID; - jvalue* args; - jvalue* result; - -public: - CallNonvirtualMethodMessage(jni_type type, jobject obj, jclass clazz, jmethodID methodID, jvalue *args, jvalue* result) - { - this->type = type; - this->obj = obj; - this->clazz = clazz; - this->methodID = methodID; - this->args = args; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - switch (type) { - case jobject_type: - result->l = env->CallNonvirtualObjectMethodA(obj, clazz, methodID, args); -#if LOCAL_REFS_ARE_GLOBAL - result->l = ToGlobalRef(env, result->l); -#endif - break; - case jboolean_type: - result->z = env->CallNonvirtualBooleanMethodA(obj, clazz, methodID, args); - break; - case jbyte_type: - result->b = env->CallNonvirtualByteMethodA(obj, clazz, methodID, args); - break; - case jchar_type: - result->c = env->CallNonvirtualCharMethodA(obj, clazz, methodID, args); - break; - case jshort_type: - result->s = env->CallNonvirtualShortMethodA(obj, clazz, methodID, args); - break; - case jint_type: - result->i = env->CallNonvirtualIntMethodA(obj, clazz, methodID, args); - break; - case jlong_type: - result->j = env->CallNonvirtualLongMethodA(obj, clazz, methodID, args); - break; - case jfloat_type: - result->f = env->CallNonvirtualFloatMethodA(obj, clazz, methodID, args); - break; - case jdouble_type: - result->d = env->CallNonvirtualDoubleMethodA(obj, clazz, methodID, args); - break; - case jvoid_type: - env->CallNonvirtualVoidMethodA(obj, clazz, methodID, args); - break; - } - } -}; - -NS_IMETHODIMP CSecureEnv::CallNonvirtualMethod(/*[in]*/ jni_type type, - /*[in]*/ jobject obj, - /*[in]*/ jclass clazz, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx) -{ - if (obj == NULL || clazz == NULL || methodID == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - // Call non-virtual method on Java side - // return CallJavaMethod(obj, method, args, ctx, result); - CallNonvirtualMethodMessage msg(type, obj, clazz, methodID, args, result); - sendMessageToJava(&msg); -#else - #error "Implement me!" -#endif - - return NS_OK; -} - - -///=--------------------------------------------------------------------------= -// CSecureEnv::GetField -///=--------------------------------------------------------------------------= -// Get a field on Java object in LiveConnect. -// -// @param obj -- Java object. -// @param fieldID -- field id -// @param result -- return field value -// @param ctx -- security context -// - -class GetFieldMessage : public JavaMessage { - jni_type type; - jobject obj; - jfieldID fieldID; - jvalue* result; -public: - GetFieldMessage(jni_type type, jobject obj, jfieldID fieldID, jvalue* result) - { - this->type = type; - this->obj = obj; - this->fieldID = fieldID; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - switch (type) { - case jobject_type: - result->l = env->GetObjectField(obj, fieldID); -#if LOCAL_REFS_ARE_GLOBAL - result->l = ToGlobalRef(env, result->l); -#endif - break; - case jboolean_type: - result->z = env->GetBooleanField(obj, fieldID); - break; - case jbyte_type: - result->b = env->GetByteField(obj, fieldID); - break; - case jchar_type: - result->c = env->GetCharField(obj, fieldID); - break; - case jshort_type: - result->s = env->GetShortField(obj, fieldID); - break; - case jint_type: - result->i = env->GetIntField(obj, fieldID); - break; - case jlong_type: - result->j = env->GetLongField(obj, fieldID); - break; - case jfloat_type: - result->f = env->GetFloatField(obj, fieldID); - break; - case jdouble_type: - result->d = env->GetDoubleField(obj, fieldID); - break; - } - } -}; - -NS_IMETHODIMP CSecureEnv::GetField(/*[in]*/ jni_type type, - /*[in]*/ jobject obj, - /*[in]*/ jfieldID fieldID, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx) -{ - if (mJavaEnv == NULL || obj == NULL || fieldID == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - // Get field on Java side - GetFieldMessage msg(type, obj, fieldID, result); - sendMessageToJava(&msg); -#else - JNIEnv* env = mJavaEnv; - switch (type) { - case jobject_type: - result->l = env->GetObjectField(obj, fieldID); - break; - case jboolean_type: - result->z = env->GetBooleanField(obj, fieldID); - break; - case jbyte_type: - result->b = env->GetByteField(obj, fieldID); - break; - case jchar_type: - result->c = env->GetCharField(obj, fieldID); - break; - case jshort_type: - result->s = env->GetShortField(obj, fieldID); - break; - case jint_type: - result->i = env->GetIntField(obj, fieldID); - break; - case jlong_type: - result->j = env->GetLongField(obj, fieldID); - break; - case jfloat_type: - result->f = env->GetFloatField(obj, fieldID); - break; - case jdouble_type: - result->d = env->GetDoubleField(obj, fieldID); - break; - } -#endif - - return NS_OK; -} - - -///=--------------------------------------------------------------------------= -// CSecureEnv::SetField -///=--------------------------------------------------------------------------= -// -// Set a field on Java object in LiveConnect. -// -// @param obj -- Java object. -// @param fieldID -- field id -// @param result -- field value to set -// @param ctx -- security context -// - -class SetFieldMessage : public JavaMessage { - jni_type type; - jobject obj; - jfieldID fieldID; - jvalue val; -public: - SetFieldMessage(jni_type type, jobject obj, jfieldID fieldID, jvalue val) - { - this->type = type; - this->obj = obj; - this->fieldID = fieldID; - this->val = val; - } - - virtual void execute(JNIEnv* env) - { - switch (type) { - case jobject_type: - env->SetObjectField(obj, fieldID, val.l); - break; - case jboolean_type: - env->SetBooleanField(obj, fieldID, val.z); - break; - case jbyte_type: - env->SetByteField(obj, fieldID, val.b); - break; - case jchar_type: - env->SetCharField(obj, fieldID, val.c); - break; - case jshort_type: - env->SetShortField(obj, fieldID, val.s); - break; - case jint_type: - env->SetIntField(obj, fieldID, val.i); - break; - case jlong_type: - env->SetLongField(obj, fieldID, val.j); - break; - case jfloat_type: - env->SetFloatField(obj, fieldID, val.f); - break; - case jdouble_type: - env->SetDoubleField(obj, fieldID, val.d); - break; - } - } -}; - -NS_IMETHODIMP CSecureEnv::SetField(/*[in]*/ jni_type type, - /*[in]*/ jobject obj, - /*[in]*/ jfieldID fieldID, - /*[in]*/ jvalue val, - /*[in]*/ nsISecurityContext* ctx) -{ - if (mJavaEnv == NULL || obj == NULL || fieldID == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - // Set field on Java side - SetFieldMessage msg(type, obj, fieldID, val); - sendMessageToJava(&msg); -#else - JNIEnv* env = mJavaEnv; - switch (type) { - case jobject_type: - env->SetObjectField(obj, fieldID, val.l); - break; - case jboolean_type: - env->SetBooleanField(obj, fieldID, val.z); - break; - case jbyte_type: - env->SetByteField(obj, fieldID, val.b); - break; - case jchar_type: - env->SetCharField(obj, fieldID, val.c); - break; - case jshort_type: - env->SetShortField(obj, fieldID, val.s); - break; - case jint_type: - env->SetIntField(obj, fieldID, val.i); - break; - case jlong_type: - env->SetLongField(obj, fieldID, val.j); - break; - case jfloat_type: - env->SetFloatField(obj, fieldID, val.f); - break; - case jdouble_type: - env->SetDoubleField(obj, fieldID, val.d); - break; - } -#endif - - return NS_OK; -} - - -///=--------------------------------------------------------------------------= -// CSecureEnv::CallStaticMethod -///=--------------------------------------------------------------------------= -// -// Invoke static method on Java object in LiveConnect. -// -// @param obj -- Java object. -// @param methodID -- method id -// @param args -- arguments for invoking the constructor. -// @param result -- return result of invocation. -// @param ctx -- security context -// - -class CallStaticMethodMessage : public JavaMessage { - jni_type type; - jclass clazz; - jmethodID methodID; - jvalue* args; - jvalue* result; -public: - CallStaticMethodMessage(jni_type type, jclass clazz, jmethodID methodID, jvalue *args, jvalue* result) - { - this->type = type; - this->clazz = clazz; - this->methodID = methodID; - this->args = args; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - switch (type) { - case jobject_type: - result->l = env->CallStaticObjectMethodA(clazz, methodID, args); -#if LOCAL_REFS_ARE_GLOBAL - result->l = ToGlobalRef(env, result->l); -#endif - break; - case jboolean_type: - result->z = env->CallStaticBooleanMethodA(clazz, methodID, args); - break; - case jbyte_type: - result->b = env->CallStaticByteMethodA(clazz, methodID, args); - break; - case jchar_type: - result->c = env->CallStaticCharMethodA(clazz, methodID, args); - break; - case jshort_type: - result->s = env->CallStaticShortMethodA(clazz, methodID, args); - break; - case jint_type: - result->i = env->CallStaticIntMethodA(clazz, methodID, args); - break; - case jlong_type: - result->j = env->CallStaticLongMethodA(clazz, methodID, args); - break; - case jfloat_type: - result->f = env->CallStaticFloatMethodA(clazz, methodID, args); - break; - case jdouble_type: - result->d = env->CallStaticDoubleMethodA(clazz, methodID, args); - break; - case jvoid_type: - env->CallStaticVoidMethodA(clazz, methodID, args); - break; - } - } -}; - -NS_IMETHODIMP CSecureEnv::CallStaticMethod(/*[in]*/ jni_type type, - /*[in]*/ jclass clazz, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx) -{ - if (clazz == NULL || methodID == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - // Call method on Java side - // return CallJavaMethod(NULL, method, args, ctx, result); - CallStaticMethodMessage msg(type, clazz, methodID, args, result); - sendMessageToJava(&msg); -#else - #error "Implement me!" -#endif - - return NS_OK; -} - - -///=--------------------------------------------------------------------------= -// CSecureEnv::GetStaticField -///=--------------------------------------------------------------------------= -// Get a static field on Java object in LiveConnect. -// -// @param obj -- Java object. -// @param fieldID -- field id -// @param result -- return field value -// @param ctx -- security context -// - -class GetStaticFieldMessage : public JavaMessage { - jni_type type; - jclass clazz; - jfieldID fieldID; - jvalue* result; -public: - GetStaticFieldMessage(jni_type type, jclass clazz, jfieldID fieldID, jvalue* result) - { - this->type = type; - this->clazz = clazz; - this->fieldID = fieldID; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - switch (type) { - case jobject_type: - result->l = env->GetStaticObjectField(clazz, fieldID); -#if LOCAL_REFS_ARE_GLOBAL - result->l = ToGlobalRef(env, result->l); -#endif - break; - case jboolean_type: - result->z = env->GetStaticBooleanField(clazz, fieldID); - break; - case jbyte_type: - result->b = env->GetStaticByteField(clazz, fieldID); - break; - case jchar_type: - result->c = env->GetStaticCharField(clazz, fieldID); - break; - case jshort_type: - result->s = env->GetStaticShortField(clazz, fieldID); - break; - case jint_type: - result->i = env->GetStaticIntField(clazz, fieldID); - break; - case jlong_type: - result->j = env->GetStaticLongField(clazz, fieldID); - break; - case jfloat_type: - result->f = env->GetStaticFloatField(clazz, fieldID); - break; - case jdouble_type: - result->d = env->GetStaticDoubleField(clazz, fieldID); - break; - } - } -}; - -NS_IMETHODIMP CSecureEnv::GetStaticField(/*[in]*/ jni_type type, - /*[in]*/ jclass clazz, - /*[in]*/ jfieldID fieldID, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx) -{ - if (mJavaEnv == NULL || clazz == NULL || fieldID == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - // Get static field on Java side - GetStaticFieldMessage msg(type, clazz, fieldID, result); - sendMessageToJava(&msg); -#else - // This doesn't work in Mac OS X. - // should be able to perform in Java env. - JNIEnv* env = mJavaEnv; - switch (type) { - case jobject_type: - result->l = env->GetStaticObjectField(clazz, fieldID); - break; - case jboolean_type: - result->z = env->GetStaticBooleanField(clazz, fieldID); - break; - case jbyte_type: - result->b = env->GetStaticByteField(clazz, fieldID); - break; - case jchar_type: - result->c = env->GetStaticCharField(clazz, fieldID); - break; - case jshort_type: - result->s = env->GetStaticShortField(clazz, fieldID); - break; - case jint_type: - result->i = env->GetStaticIntField(clazz, fieldID); - break; - case jlong_type: - result->j = env->GetStaticLongField(clazz, fieldID); - break; - case jfloat_type: - result->f = env->GetStaticFloatField(clazz, fieldID); - break; - case jdouble_type: - result->d = env->GetStaticDoubleField(clazz, fieldID); - break; - } -#endif - - return NS_OK; -} - - -///=--------------------------------------------------------------------------= -// CSecureEnv::SetStaticField -///=--------------------------------------------------------------------------= -// Set a static field on Java object in LiveConnect. -// -// @param obj -- Java object. -// @param fieldID -- field id -// @param result -- field value to set -// @param ctx -- security context -// - -class SetStaticFieldMessage : public JavaMessage { - jni_type type; - jclass clazz; - jfieldID fieldID; - jvalue val; -public: - SetStaticFieldMessage(jni_type type, jclass clazz, jfieldID fieldID, jvalue val) - { - this->type = type; - this->clazz = clazz; - this->fieldID = fieldID; - this->val = val; - } - - virtual void execute(JNIEnv* env) - { - switch (type) { - case jobject_type: - env->SetStaticObjectField(clazz, fieldID, val.l); - break; - case jboolean_type: - env->SetStaticBooleanField(clazz, fieldID, val.z); - break; - case jbyte_type: - env->SetStaticByteField(clazz, fieldID, val.b); - break; - case jchar_type: - env->SetStaticCharField(clazz, fieldID, val.c); - break; - case jshort_type: - env->SetStaticShortField(clazz, fieldID, val.s); - break; - case jint_type: - env->SetStaticIntField(clazz, fieldID, val.i); - break; - case jlong_type: - env->SetStaticLongField(clazz, fieldID, val.j); - break; - case jfloat_type: - env->SetStaticFloatField(clazz, fieldID, val.f); - break; - case jdouble_type: - env->SetStaticDoubleField(clazz, fieldID, val.d); - break; - } - } -}; - -NS_IMETHODIMP CSecureEnv::SetStaticField(/*[in]*/ jni_type type, - /*[in]*/ jclass clazz, - /*[in]*/ jfieldID fieldID, - /*[in]*/ jvalue val, - /*[in]*/ nsISecurityContext* ctx) -{ - if (mJavaEnv == NULL || clazz == NULL || fieldID == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - // Set static field on Java side - SetStaticFieldMessage msg(type, clazz, fieldID, val); - sendMessageToJava(&msg); -#else - JNIEnv* env = mJavaEnv; - switch (type) { - case jobject_type: - env->SetStaticObjectField(clazz, fieldID, val.l); - break; - case jboolean_type: - env->SetStaticBooleanField(clazz, fieldID, val.z); - break; - case jbyte_type: - env->SetStaticByteField(clazz, fieldID, val.b); - break; - case jchar_type: - env->SetStaticCharField(clazz, fieldID, val.c); - break; - case jshort_type: - env->SetStaticShortField(clazz, fieldID, val.s); - break; - case jint_type: - env->SetStaticIntField(clazz, fieldID, val.i); - break; - case jlong_type: - env->SetStaticLongField(clazz, fieldID, val.j); - break; - case jfloat_type: - env->SetStaticFloatField(clazz, fieldID, val.f); - break; - case jdouble_type: - env->SetStaticDoubleField(clazz, fieldID, val.d); - break; - } -#endif - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::GetVersion(/*[out]*/ jint* version) -{ - if (mJavaEnv == NULL || version == NULL) - return NS_ERROR_NULL_POINTER; - - JNIEnv* env = mJavaEnv; - *version = env->GetVersion(); - - return NS_OK; -} - -/** - * To give proper "local" refs, need to run this in the Java thread. - */ -class DefineClassMessage : public JavaMessage { - const char* name; - jobject loader; - const jbyte *buf; - jsize len; - jclass* clazz; -public: - DefineClassMessage(const char* name, jobject loader, const jbyte *buf, jsize len, jclass* clazz) - { - this->name = name; - this->loader = loader; - this->buf = buf; - this->len = len; - this->clazz = clazz; - } - - virtual void execute(JNIEnv* env) - { - *clazz = env->DefineClass(name, loader, buf, len); - } -}; - -NS_IMETHODIMP CSecureEnv::DefineClass(/*[in]*/ const char* name, - /*[in]*/ jobject loader, - /*[in]*/ const jbyte *buf, - /*[in]*/ jsize len, - /*[out]*/ jclass* clazz) -{ - if (mJavaEnv == NULL || clazz == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - DefineClassMessage msg(name, loader, buf, len, clazz); - sendMessageToJava(&msg); -#else - *clazz = mJavaEnv->DefineClass(name, loader, buf, len); -#endif - - return NS_OK; -} - -/** - * To give proper "local" refs, need to run this in the Java thread. - */ -class FindClassMessage : public JavaMessage { - const char* name; - jclass* result; -public: - FindClassMessage(const char* name, jclass* result) - { - this->name = name; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->FindClass(name); -#if LOCAL_REFS_ARE_GLOBAL - *result = (jclass) ToGlobalRef(env, *result); -#endif - } -}; - -NS_IMETHODIMP CSecureEnv::FindClass(/*[in]*/ const char* name, - /*[out]*/ jclass* clazz) -{ - if (clazz == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - FindClassMessage msg(name, clazz); - sendMessageToJava(&msg); -#else - *clazz = mJavaEnv->FindClass(name); -#endif - - return NS_OK; -} - -/** - * To give proper "local" refs, need to run this in the Java thread. - */ -class GetSuperclassMessage : public JavaMessage { - jclass sub; - jclass* super; -public: - GetSuperclassMessage(jclass sub, jclass* super) - { - this->sub = sub; - this->super = super; - } - - virtual void execute(JNIEnv* env) - { - *super = env->GetSuperclass(sub); - } -}; - -NS_IMETHODIMP CSecureEnv::GetSuperclass(/*[in]*/ jclass sub, - /*[out]*/ jclass* super) -{ - if (mJavaEnv == NULL || super == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - GetSuperclassMessage msg(sub, super); - sendMessageToJava(&msg); -#else - *super = mJavaEnv->GetSuperclass(sub); -#endif - - return NS_OK; -} - - -class IsAssignableFromMessage : public JavaMessage { - jclass sub; - jclass super; - jboolean* result; -public: - IsAssignableFromMessage(jclass sub, jclass super, jboolean* result) - { - this->sub = sub; - this->super = super; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->IsAssignableFrom(sub, super); - } -}; - -NS_IMETHODIMP CSecureEnv::IsAssignableFrom(/*[in]*/ jclass sub, - /*[in]*/ jclass super, - /*[out]*/ jboolean* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - IsAssignableFromMessage msg(sub, super, result); - sendMessageToJava(&msg); -#else - // JNIEnv* env = mSession->getCurrentEnv(); - *result = mJavaEnv->IsAssignableFrom(sub, super); -#endif - - return NS_OK; -} - - -class ThrowMessage : public JavaMessage { - jthrowable obj; - jint* result; -public: - ThrowMessage(jthrowable obj, jint* result) - { - this->obj = obj; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->Throw(obj); - } -}; - -NS_IMETHODIMP CSecureEnv::Throw(/*[in]*/ jthrowable obj, - /*[out]*/ jint* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - ThrowMessage msg(obj, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->Throw(obj); -#endif - - return NS_OK; -} - -class ThrowNewMessage : public JavaMessage { - jclass clazz; - const char* message; - jint* result; -public: - ThrowNewMessage(jclass clazz, const char* message, jint* result) - { - this->clazz = clazz; - this->message = message; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->ThrowNew(clazz, message); - } -}; - -NS_IMETHODIMP CSecureEnv::ThrowNew(/*[in]*/ jclass clazz, - /*[in]*/ const char *message, - /*[out]*/ jint* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - ThrowNewMessage msg(clazz, message, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->ThrowNew(clazz, msg); -#endif - - return NS_OK; -} - - -class ExceptionOccurredMessage : public JavaMessage { - CSecureEnv* secureEnv; - jthrowable* result; -public: - ExceptionOccurredMessage(CSecureEnv* secureEnv, jthrowable* result) - { - this->secureEnv = secureEnv; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = secureEnv->getPendingException(env); -#if LOCAL_REFS_ARE_GLOBAL - *result = (jthrowable) ToGlobalRef(env, *result); -#endif - } -}; - -NS_IMETHODIMP CSecureEnv::ExceptionOccurred(/*[out]*/ jthrowable* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - ExceptionOccurredMessage msg(this, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->ExceptionOccurred(); -#endif - - return NS_OK; -} - -NS_IMETHODIMP CSecureEnv::ExceptionDescribe(void) -{ - if (mJavaEnv == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - class ExceptionDescribeMessage : public JavaMessage { - public: - virtual void execute(JNIEnv* env) { env->ExceptionDescribe(); } - } msg; - sendMessageToJava(&msg); -#else - mJavaEnv->ExceptionDescribe(); -#endif - - return NS_OK; -} - -class ExceptionClearMessage : public JavaMessage { - CSecureEnv* secureEnv; -public: - ExceptionClearMessage(CSecureEnv* secureEnv) - { - this->secureEnv = secureEnv; - } - virtual void execute(JNIEnv* env) { secureEnv->clearPendingException(env); } -}; - -NS_IMETHODIMP CSecureEnv::ExceptionClear(void) -{ -#if PROXY_JNI_CALLS - ExceptionClearMessage msg(this); - sendMessageToJava(&msg); -#else - mJavaEnv->ExceptionClear(); -#endif - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::FatalError(/*[in]*/ const char* msg) -{ - mJavaEnv->FatalError(msg); - return NS_OK; -} - - -/** - * To give proper "local" refs, need to run this in the true thread. - */ - -class NewGlobalRefMessage : public JavaMessage { - jobject localRef; - jobject* result; -public: - NewGlobalRefMessage(jobject localRef, jobject* result) - { - this->localRef = localRef; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->NewGlobalRef(localRef); - } -}; - -NS_IMETHODIMP CSecureEnv::NewGlobalRef(/*[in]*/ jobject localRef, - /*[out]*/ jobject* result) -{ - if (result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - NewGlobalRefMessage msg(localRef, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->NewGlobalRef(localRef); -#endif - - return NS_OK; -} - -/** - * This should be safe to call from any thread, since global refs - * are thread independent. - */ -NS_IMETHODIMP CSecureEnv::DeleteGlobalRef(/*[in]*/ jobject globalRef) -{ - mJavaEnv->DeleteGlobalRef(globalRef); - return NS_OK; -} - -/** - * To give proper "local" refs, need to run this in the true thread. - */ -class DeleteLocalRefMessage : public JavaMessage { - jobject localRef; -public: - DeleteLocalRefMessage(jobject localRef) - { - this->localRef = localRef; - } - - virtual void execute(JNIEnv* env) - { -#if LOCAL_REFS_ARE_GLOBAL - env->DeleteGlobalRef(localRef); -#else - env->DeleteLocalRef(localRef); -#endif - } -}; - -NS_IMETHODIMP CSecureEnv::DeleteLocalRef(/*[in]*/ jobject localRef) -{ -#if PROXY_JNI_CALLS - DeleteLocalRefMessage msg(localRef); - sendMessageToJava(&msg); -#else - mJavaEnv->DeleteLocalRef(localRef); -#endif - return NS_OK; -} - -class IsSameObjectMessage : public JavaMessage { - jobject obj1; - jobject obj2; - jboolean* result; -public: - IsSameObjectMessage(jobject obj1, jobject obj2, jboolean* result) - { - this->obj1 = obj1; - this->obj2 = obj2; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->IsSameObject(obj1, obj2); - } -}; - -NS_IMETHODIMP CSecureEnv::IsSameObject(/*[in]*/ jobject obj1, - /*[in]*/ jobject obj2, - /*[out]*/ jboolean* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - IsSameObjectMessage msg(obj1, obj2, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->IsSameObject(obj1, obj2); -#endif - - return NS_OK; -} - - -class AllocObjectMessage : public JavaMessage { - jclass clazz; - jobject* result; -public: - AllocObjectMessage(jclass clazz, jobject* result) - { - this->clazz = clazz; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->AllocObject(clazz); -#if LOCAL_REFS_ARE_GLOBAL - *result = ToGlobalRef(env, *result); -#endif - } -}; - -NS_IMETHODIMP CSecureEnv::AllocObject(/*[in]*/ jclass clazz, - /*[out]*/ jobject* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - AllocObjectMessage msg(clazz, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->AllocObject(clazz); -#endif - - return NS_OK; -} - -class GetObjectClassMessage : public JavaMessage { - jobject obj; - jclass* result; -public: - GetObjectClassMessage(jobject obj, jclass* result) - { - this->obj = obj; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->GetObjectClass(obj); -#if LOCAL_REFS_ARE_GLOBAL - *result = (jclass) ToGlobalRef(env, *result); -#endif - } -}; - -NS_IMETHODIMP CSecureEnv::GetObjectClass(/*[in]*/ jobject obj, - /*[out]*/ jclass* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - GetObjectClassMessage msg(obj, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->GetObjectClass(obj); -#endif - - return NS_OK; -} - - -class IsInstanceOfMessage : public JavaMessage { - jobject obj; - jclass clazz; - jboolean* result; -public: - IsInstanceOfMessage(jobject obj, jclass clazz, jboolean* result) - { - this->obj = obj; - this->clazz = clazz; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->IsInstanceOf(obj, clazz); - } -}; - -NS_IMETHODIMP CSecureEnv::IsInstanceOf(/*[in]*/ jobject obj, - /*[in]*/ jclass clazz, - /*[out]*/ jboolean* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - IsInstanceOfMessage msg(obj, clazz, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->IsInstanceOf(obj, clazz); -#endif - - return NS_OK; -} - -class GetMethodIDMessage : public JavaMessage { - jclass clazz; - const char* name; - const char* sig; - jboolean isStatic; - jmethodID* result; -public: - GetMethodIDMessage(jclass clazz, const char* name, const char* sig, - jboolean isStatic, jmethodID* result) - { - this->clazz = clazz; - this->name = name; - this->sig = sig; - this->isStatic = isStatic; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = (isStatic ? env->GetStaticMethodID(clazz, name, sig) - : env->GetMethodID(clazz, name, sig)); - } -}; - -class GetFieldIDMessage : public JavaMessage { - jclass clazz; - const char* name; - const char* sig; - jboolean isStatic; - jfieldID* result; -public: - GetFieldIDMessage(jclass clazz, const char* name, const char* sig, - jboolean isStatic, jfieldID* result) - { - this->clazz = clazz; - this->name = name; - this->sig = sig; - this->isStatic = isStatic; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = (isStatic ? env->GetStaticFieldID(clazz, name, sig) - : env->GetFieldID(clazz, name, sig)); - } -}; - -NS_IMETHODIMP CSecureEnv::GetMethodID(/*[in]*/ jclass clazz, - /*[in]*/ const char* name, - /*[in]*/ const char* sig, - /*[out]*/ jmethodID* result) -{ - if (result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - GetMethodIDMessage msg(clazz, name, sig, JNI_FALSE, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->GetMethodID(clazz, name, sig); -#endif - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::GetFieldID(/*[in]*/ jclass clazz, - /*[in]*/ const char* name, - /*[in]*/ const char* sig, - /*[out]*/ jfieldID* result) -{ - if (result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - GetFieldIDMessage msg(clazz, name, sig, JNI_FALSE, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->GetFieldID(clazz, name, sig); -#endif - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::GetStaticMethodID(/*[in]*/ jclass clazz, - /*[in]*/ const char* name, - /*[in]*/ const char* sig, - /*[out]*/ jmethodID* result) -{ - if (result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - GetMethodIDMessage msg(clazz, name, sig, JNI_TRUE, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->GetStaticMethodID(clazz, name, sig); -#endif - - return NS_OK; -} - - -NS_IMETHODIMP CSecureEnv::GetStaticFieldID(/*[in]*/ jclass clazz, - /*[in]*/ const char* name, - /*[in]*/ const char* sig, - /*[out]*/ jfieldID* result) -{ - if (result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - GetFieldIDMessage msg(clazz, name, sig, JNI_TRUE, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->GetStaticFieldID(clazz, name, sig); -#endif - - return NS_OK; -} - -/** - * To give proper "local" refs, need to run this in the true thread. - */ - -class NewStringMessage : public JavaMessage { - const jchar* unicode; - jsize len; - jstring* result; -public: - NewStringMessage(const jchar* unicode, jsize len, jstring* result) - { - this->unicode = unicode; - this->len = len; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->NewString(unicode, len); -#if LOCAL_REFS_ARE_GLOBAL - *result = (jstring) ToGlobalRef(env, *result); -#endif - } -}; - -NS_IMETHODIMP CSecureEnv::NewString(/*[in]*/ const jchar* unicode, - /*[in]*/ jsize len, - /*[out]*/ jstring* result) -{ - if (result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - NewStringMessage msg(unicode, len, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->NewString(unicode, len); -#endif - - return NS_OK; -} - -class GetStringLengthMessage : public JavaMessage { - jstring str; - jsize* result; -public: - GetStringLengthMessage(jstring str, jsize* result) - { - this->str = str; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->GetStringLength(str); - } -}; - -NS_IMETHODIMP CSecureEnv::GetStringLength(/*[in]*/ jstring str, - /*[out]*/ jsize* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - GetStringLengthMessage msg(str, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->GetStringLength(str); -#endif - - return NS_OK; -} - -class GetStringCharsMessage : public JavaMessage { - jstring str; - jboolean* isCopy; - const jchar** result; -public: - GetStringCharsMessage(jstring str, jboolean* isCopy, const jchar** result) - { - this->str = str; - this->isCopy = isCopy; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->GetStringChars(str, isCopy); - } -}; - -NS_IMETHODIMP CSecureEnv::GetStringChars(/*[in]*/ jstring str, - /*[in]*/ jboolean *isCopy, - /*[out]*/ const jchar** result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - GetStringCharsMessage msg(str, isCopy, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->GetStringChars(str, isCopy); -#endif - - return NS_OK; -} - - -class ReleaseStringCharsMessage : public JavaMessage { - jstring str; - const jchar* chars; -public: - ReleaseStringCharsMessage(jstring str, const jchar* chars) - { - this->str = str; - this->chars = chars; - } - - virtual void execute(JNIEnv* env) - { - env->ReleaseStringChars(str, chars); - } -}; - -NS_IMETHODIMP CSecureEnv::ReleaseStringChars(/*[in]*/ jstring str, - /*[in]*/ const jchar *chars) -{ - if (mJavaEnv == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - ReleaseStringCharsMessage msg(str, chars); - sendMessageToJava(&msg); -#else - mJavaEnv->ReleaseStringChars(str, chars); -#endif - - return NS_OK; -} - -class NewStringUTFMessage : public JavaMessage { - const char *utf; - jstring* result; -public: - NewStringUTFMessage(const char *utf, jstring* result) - { - this->utf = utf; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->NewStringUTF(utf); -#if LOCAL_REFS_ARE_GLOBAL - *result = (jstring) ToGlobalRef(env, *result); -#endif - } -}; - -NS_IMETHODIMP CSecureEnv::NewStringUTF(/*[in]*/ const char *utf, - /*[out]*/ jstring* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - NewStringUTFMessage msg(utf, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->NewStringUTF(utf); -#endif - - return NS_OK; -} - - -class GetStringUTFLengthMessage : public JavaMessage { - jstring str; - jsize* result; -public: - GetStringUTFLengthMessage(jstring str, jsize* result) - { - this->str = str; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->GetStringUTFLength(str); - } -}; - -NS_IMETHODIMP CSecureEnv::GetStringUTFLength(/*[in]*/ jstring str, - /*[out]*/ jsize* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - GetStringUTFLengthMessage msg(str, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->GetStringUTFLength(str); -#endif - - return NS_OK; -} - - -class GetStringUTFCharsMessage : public JavaMessage { - jstring str; - jboolean* isCopy; - const char** result; -public: - GetStringUTFCharsMessage(jstring str, jboolean* isCopy, const char** result) - { - this->str = str; - this->isCopy = isCopy; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->GetStringUTFChars(str, isCopy); - } -}; - -NS_IMETHODIMP CSecureEnv::GetStringUTFChars(/*[in]*/ jstring str, - /*[in]*/ jboolean *isCopy, - /*[out]*/ const char** result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - GetStringUTFCharsMessage msg(str, isCopy, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->GetStringUTFChars(str, isCopy); -#endif - - return NS_OK; -} - - -class ReleaseStringUTFCharsMessage : public JavaMessage { - jstring str; - const char* chars; -public: - ReleaseStringUTFCharsMessage(jstring str, const char* chars) - { - this->str = str; - this->chars = chars; - } - - virtual void execute(JNIEnv* env) - { - env->ReleaseStringUTFChars(str, chars); - } -}; - -NS_IMETHODIMP CSecureEnv::ReleaseStringUTFChars(/*[in]*/ jstring str, - /*[in]*/ const char *chars) -{ - if (mJavaEnv == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - ReleaseStringUTFCharsMessage msg(str, chars); - sendMessageToJava(&msg); -#else - mJavaEnv->ReleaseStringUTFChars(str, chars); -#endif - - return NS_OK; -} - - -class GetArrayLengthMessage : public JavaMessage { - jarray array; - jsize* result; -public: - GetArrayLengthMessage(jarray array, jsize* result) - { - this->array = array; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->GetArrayLength(array); - } -}; - -NS_IMETHODIMP CSecureEnv::GetArrayLength(/*[in]*/ jarray array, - /*[out]*/ jsize* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - GetArrayLengthMessage msg(array, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->GetArrayLength(array); -#endif - - return NS_OK; -} - -class NewObjectArrayMessage : public JavaMessage { - jsize len; - jclass clazz; - jobject init; - jobjectArray* result; -public: - NewObjectArrayMessage(jsize len, jclass clazz, jobject init, jobjectArray* result) - { - this->len = len; - this->clazz = clazz; - this->init = init; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->NewObjectArray(len, clazz, init); -#if LOCAL_REFS_ARE_GLOBAL - *result = (jobjectArray) ToGlobalRef(env, *result); -#endif - } -}; - -NS_IMETHODIMP CSecureEnv::NewObjectArray(/*[in]*/ jsize len, - /*[in]*/ jclass clazz, - /*[in]*/ jobject init, - /*[out]*/ jobjectArray* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - NewObjectArrayMessage msg(len, clazz, init, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->NewObjectArray(len, clazz, init); -#endif - - return NS_OK; -} - -class GetObjectArrayElementMessage : public JavaMessage { - jobjectArray array; - jsize index; - jobject* result; -public: - GetObjectArrayElementMessage(jobjectArray array, jsize index, jobject* result) - { - this->array = array; - this->index = index; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->GetObjectArrayElement(array, index); -#if LOCAL_REFS_ARE_GLOBAL - *result = ToGlobalRef(env, *result); -#endif - } -}; - -NS_IMETHODIMP CSecureEnv::GetObjectArrayElement(/*[in]*/ jobjectArray array, - /*[in]*/ jsize index, - /*[out]*/ jobject* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - GetObjectArrayElementMessage msg(array, index, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->GetObjectArrayElement(array, index); -#endif - - return NS_OK; -} - - -class SetObjectArrayElementMessage : public JavaMessage { - jobjectArray array; - jsize index; - jobject val; -public: - SetObjectArrayElementMessage(jobjectArray array, jsize index, jobject val) - { - this->array = array; - this->index = index; - this->val = val; - } - - virtual void execute(JNIEnv* env) - { - env->SetObjectArrayElement(array, index, val); - } -}; - -NS_IMETHODIMP CSecureEnv::SetObjectArrayElement(/*[in]*/ jobjectArray array, - /*[in]*/ jsize index, - /*[in]*/ jobject val) -{ - if (mJavaEnv == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - SetObjectArrayElementMessage msg(array, index, val); - sendMessageToJava(&msg); -#else - mJavaEnv->SetObjectArrayElement(array, index, val); -#endif - - return NS_OK; -} - -class NewArrayMessage : public JavaMessage { - jni_type element_type; - jsize len; - jarray* result; -public: - NewArrayMessage(jni_type element_type, jsize len, jarray* result) - { - this->element_type = element_type; - this->len = len; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - switch (element_type) { - case jboolean_type: - *result = env->NewBooleanArray(len); - break; - case jbyte_type: - *result = env->NewByteArray(len); - break; - case jchar_type: - *result = env->NewCharArray(len); - break; - case jshort_type: - *result = env->NewShortArray(len); - break; - case jint_type: - *result = env->NewIntArray(len); - break; - case jlong_type: - *result = env->NewLongArray(len); - break; - case jfloat_type: - *result = env->NewFloatArray(len); - break; - case jdouble_type: - *result = env->NewDoubleArray(len); - break; - default: - *result = NULL; - } -#if LOCAL_REFS_ARE_GLOBAL - *result = (jarray) ToGlobalRef(env, *result); -#endif - } -}; - -NS_IMETHODIMP CSecureEnv::NewArray(/*[in]*/ jni_type element_type, - /*[in]*/ jsize len, - /*[out]*/ jarray* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - NewArrayMessage msg(element_type, len, result); - sendMessageToJava(&msg); -#else - JNIEnv* env = mJavaEnv; - switch (element_type) { - case jboolean_type: - *result = env->NewBooleanArray(len); - break; - case jbyte_type: - *result = env->NewByteArray(len); - break; - case jchar_type: - *result = env->NewCharArray(len); - break; - case jshort_type: - *result = env->NewShortArray(len); - break; - case jint_type: - *result = env->NewIntArray(len); - break; - case jlong_type: - *result = env->NewLongArray(len); - break; - case jfloat_type: - *result = env->NewFloatArray(len); - break; - case jdouble_type: - *result = env->NewDoubleArray(len); - break; - default: - *result = NULL; - } -#endif - - return NS_OK; -} - -class GetArrayElementsMessage : public JavaMessage { - jni_type element_type; - jarray array; - jboolean* isCopy; - void* result; -public: - GetArrayElementsMessage(jni_type element_type, jarray array, jboolean* isCopy, void* result) - { - this->element_type = element_type; - this->array = array; - this->isCopy = isCopy; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - switch (element_type) { - case jboolean_type: - *(jboolean**) result = env->GetBooleanArrayElements((jbooleanArray)array, isCopy); - break; - case jbyte_type: - *(jbyte**) result = env->GetByteArrayElements((jbyteArray)array, isCopy); - break; - case jchar_type: - *(jchar**) result = env->GetCharArrayElements((jcharArray)array, isCopy); - break; - case jshort_type: - * (jshort**) result = env->GetShortArrayElements((jshortArray)array, isCopy); - break; - case jint_type: - * (jint**) result = env->GetIntArrayElements((jintArray)array, isCopy); - break; - case jlong_type: - * (jlong**) result = env->GetLongArrayElements((jlongArray)array, isCopy); - break; - case jfloat_type: - * (jfloat**) result = env->GetFloatArrayElements((jfloatArray)array, isCopy); - break; - case jdouble_type: - * (jdouble**) result = env->GetDoubleArrayElements((jdoubleArray)array, isCopy); - break; - default: - *(void**)result = NULL; - } - } -}; - -NS_IMETHODIMP CSecureEnv::GetArrayElements(/*[in]*/ jni_type element_type, - /*[in]*/ jarray array, - /*[in]*/ jboolean *isCopy, - /*[out]*/ void* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - GetArrayElementsMessage msg(element_type, array, isCopy, result); - sendMessageToJava(&msg); -#else - JNIEnv* env = mJavaEnv; - switch (element_type) { - case jboolean_type: - *(jboolean**) result = env->GetBooleanArrayElements((jbooleanArray)array, isCopy); - break; - case jbyte_type: - *(jbyte**) result = env->GetByteArrayElements((jbyteArray)array, isCopy); - break; - case jchar_type: - *(jchar**) result = env->GetCharArrayElements((jcharArray)array, isCopy); - break; - case jshort_type: - * (jshort**) result = env->GetShortArrayElements((jshortArray)array, isCopy); - break; - case jint_type: - * (jint**) result = env->GetIntArrayElements((jintArray)array, isCopy); - break; - case jlong_type: - * (jlong**) result = env->GetLongArrayElements((jlongArray)array, isCopy); - break; - case jfloat_type: - * (jfloat**) result = env->GetFloatArrayElements((jfloatArray)array, isCopy); - break; - case jdouble_type: - * (jdouble**) result = env->GetDoubleArrayElements((jdoubleArray)array, isCopy); - break; - default: - *(void**)result = NULL; - } -#endif - - return NS_OK; -} - - -class ReleaseArrayElementsMessage : public JavaMessage { - jni_type element_type; - jarray array; - void* elems; - jint mode; -public: - ReleaseArrayElementsMessage(jni_type element_type, jarray array, void* elems, jint mode) - { - this->element_type = element_type; - this->array = array; - this->elems = elems; - this->mode = mode; - } - - virtual void execute(JNIEnv* env) - { - switch (element_type) { - case jboolean_type: - env->ReleaseBooleanArrayElements((jbooleanArray)array, (jboolean*)elems, mode); - break; - case jbyte_type: - env->ReleaseByteArrayElements((jbyteArray)array, (jbyte*)elems, mode); - break; - case jchar_type: - env->ReleaseCharArrayElements((jcharArray)array, (jchar*)elems, mode); - break; - case jshort_type: - env->ReleaseShortArrayElements((jshortArray)array, (jshort*)elems, mode); - break; - case jint_type: - env->ReleaseIntArrayElements((jintArray)array, (jint*)elems, mode); - break; - case jlong_type: - env->ReleaseLongArrayElements((jlongArray)array, (jlong*)elems, mode); - break; - case jfloat_type: - env->ReleaseFloatArrayElements((jfloatArray)array, (jfloat*)elems, mode); - break; - case jdouble_type: - env->ReleaseDoubleArrayElements((jdoubleArray)array, (jdouble*)elems, mode); - break; - } - } -}; - -NS_IMETHODIMP CSecureEnv::ReleaseArrayElements(/*[in]*/ jni_type element_type, - /*[in]*/ jarray array, - /*[in]*/ void *elems, - /*[in]*/ jint mode) -{ - if (mJavaEnv == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - ReleaseArrayElementsMessage msg(element_type, array, elems, mode); - sendMessageToJava(&msg); -#else - JNIEnv* env = mJavaEnv; - switch (element_type) { - case jboolean_type: - env->ReleaseBooleanArrayElements((jbooleanArray)array, (jboolean*)elems, mode); - break; - case jbyte_type: - env->ReleaseByteArrayElements((jbyteArray)array, (jbyte*)elems, mode); - break; - case jchar_type: - env->ReleaseCharArrayElements((jcharArray)array, (jchar*)elems, mode); - break; - case jshort_type: - env->ReleaseShortArrayElements((jshortArray)array, (jshort*)elems, mode); - break; - case jint_type: - env->ReleaseIntArrayElements((jintArray)array, (jint*)elems, mode); - break; - case jlong_type: - env->ReleaseLongArrayElements((jlongArray)array, (jlong*)elems, mode); - break; - case jfloat_type: - env->ReleaseFloatArrayElements((jfloatArray)array, (jfloat*)elems, mode); - break; - case jdouble_type: - env->ReleaseDoubleArrayElements((jdoubleArray)array, (jdouble*)elems, mode); - break; - } -#endif - - return NS_OK; -} - -class GetArrayRegionMessage : public JavaMessage { - jni_type element_type; - jarray array; - jsize start; - jsize len; - void* buf; -public: - GetArrayRegionMessage(jni_type element_type, jarray array, jsize start, jsize len, void* buf) - { - this->element_type = element_type; - this->array = array; - this->start = start; - this->len = len; - this->buf = buf; - } - - virtual void execute(JNIEnv* env) - { - switch (element_type) { - case jboolean_type: - env->GetBooleanArrayRegion((jbooleanArray)array, start, len, (jboolean*)buf); - break; - case jbyte_type: - env->GetByteArrayRegion((jbyteArray)array, start, len, (jbyte*)buf); - break; - case jchar_type: - env->GetCharArrayRegion((jcharArray)array, start, len, (jchar*)buf); - break; - case jshort_type: - env->GetShortArrayRegion((jshortArray)array, start, len, (jshort*)buf); - break; - case jint_type: - env->GetIntArrayRegion((jintArray)array, start, len, (jint*)buf); - break; - case jlong_type: - env->GetLongArrayRegion((jlongArray)array, start, len, (jlong*)buf); - break; - case jfloat_type: - env->GetFloatArrayRegion((jfloatArray)array, start, len, (jfloat*)buf); - break; - case jdouble_type: - env->GetDoubleArrayRegion((jdoubleArray)array, start, len, (jdouble*)buf); - break; - } - } -}; - -NS_IMETHODIMP CSecureEnv::GetArrayRegion(/*[in]*/ jni_type element_type, - /*[in]*/ jarray array, - /*[in]*/ jsize start, - /*[in]*/ jsize len, - /*[out]*/ void* buf) -{ - if (mJavaEnv == NULL || buf == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - GetArrayRegionMessage msg(element_type, array, start, len, buf); - sendMessageToJava(&msg); -#else - JNIEnv* env = mJavaEnv; - switch (element_type) { - case jboolean_type: - env->GetBooleanArrayRegion((jbooleanArray)array, start, len, (jboolean*)buf); - break; - case jbyte_type: - env->GetByteArrayRegion((jbyteArray)array, start, len, (jbyte*)buf); - break; - case jchar_type: - env->GetCharArrayRegion((jcharArray)array, start, len, (jchar*)buf); - break; - case jshort_type: - env->GetShortArrayRegion((jshortArray)array, start, len, (jshort*)buf); - break; - case jint_type: - env->GetIntArrayRegion((jintArray)array, start, len, (jint*)buf); - break; - case jlong_type: - env->GetLongArrayRegion((jlongArray)array, start, len, (jlong*)buf); - break; - case jfloat_type: - env->GetFloatArrayRegion((jfloatArray)array, start, len, (jfloat*)buf); - break; - case jdouble_type: - env->GetDoubleArrayRegion((jdoubleArray)array, start, len, (jdouble*)buf); - break; - default: - return NS_ERROR_FAILURE; - } -#endif - - return NS_OK; -} - - -class SetArrayRegionMessage : public JavaMessage { - jni_type element_type; - jarray array; - jsize start; - jsize len; - void* buf; -public: - SetArrayRegionMessage(jni_type element_type, jarray array, jsize start, jsize len, void* buf) - { - this->element_type = element_type; - this->array = array; - this->start = start; - this->len = len; - this->buf = buf; - } - - virtual void execute(JNIEnv* env) - { - switch (element_type) { - case jboolean_type: - env->SetBooleanArrayRegion((jbooleanArray)array, start, len, (jboolean*)buf); - break; - case jbyte_type: - env->SetByteArrayRegion((jbyteArray)array, start, len, (jbyte*)buf); - break; - case jchar_type: - env->SetCharArrayRegion((jcharArray)array, start, len, (jchar*)buf); - break; - case jshort_type: - env->SetShortArrayRegion((jshortArray)array, start, len, (jshort*)buf); - break; - case jint_type: - env->SetIntArrayRegion((jintArray)array, start, len, (jint*)buf); - break; - case jlong_type: - env->SetLongArrayRegion((jlongArray)array, start, len, (jlong*)buf); - break; - case jfloat_type: - env->SetFloatArrayRegion((jfloatArray)array, start, len, (jfloat*)buf); - break; - case jdouble_type: - env->SetDoubleArrayRegion((jdoubleArray)array, start, len, (jdouble*)buf); - break; - } - } -}; - -NS_IMETHODIMP CSecureEnv::SetArrayRegion(/*[in]*/ jni_type element_type, - /*[in]*/ jarray array, - /*[in]*/ jsize start, - /*[in]*/ jsize len, - /*[in]*/ void* buf) -{ - if (mJavaEnv == NULL || buf == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - SetArrayRegionMessage msg(element_type, array, start, len, buf); - sendMessageToJava(&msg); -#else - JNIEnv* env = mJavaEnv; - switch (type) { - case jboolean_type: - env->SetBooleanArrayRegion((jbooleanArray)array, start, len, (jboolean*)buf); - break; - case jbyte_type: - env->SetByteArrayRegion((jbyteArray)array, start, len, (jbyte*)buf); - break; - case jchar_type: - env->SetCharArrayRegion((jcharArray)array, start, len, (jchar*)buf); - break; - case jshort_type: - env->SetShortArrayRegion((jshortArray)array, start, len, (jshort*)buf); - break; - case jint_type: - env->SetIntArrayRegion((jintArray)array, start, len, (jint*)buf); - break; - case jlong_type: - env->SetLongArrayRegion((jlongArray)array, start, len, (jlong*)buf); - break; - case jfloat_type: - env->SetFloatArrayRegion((jfloatArray)array, start, len, (jfloat*)buf); - break; - case jdouble_type: - env->SetDoubleArrayRegion((jdoubleArray)array, start, len, (jdouble*)buf); - break; - default: - return NS_ERROR_FAILURE; - } -#endif - - return NS_OK; -} - - -class RegisterNativesMessage : public JavaMessage { - jclass clazz; - const JNINativeMethod *methods; - jint nMethods; - jint* result; -public: - RegisterNativesMessage(jclass clazz, const JNINativeMethod *methods, jint nMethods, jint* result) - { - this->clazz = clazz; - this->methods = methods; - this->nMethods = nMethods; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->RegisterNatives(clazz, methods, nMethods); - } -}; - -NS_IMETHODIMP CSecureEnv::RegisterNatives(/*[in]*/ jclass clazz, - /*[in]*/ const JNINativeMethod *methods, - /*[in]*/ jint nMethods, - /*[out]*/ jint* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - RegisterNativesMessage msg(clazz, methods, nMethods, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->RegisterNatives(clazz, methods, nMethods); -#endif - - return NS_OK; -} - - -class UnregisterNativesMessage : public JavaMessage { - jclass clazz; - jint* result; -public: - UnregisterNativesMessage(jclass clazz, jint* result) - { - this->clazz = clazz; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->UnregisterNatives(clazz); - } -}; - -NS_IMETHODIMP CSecureEnv::UnregisterNatives(/*[in]*/ jclass clazz, - /*[out]*/ jint* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - UnregisterNativesMessage msg(clazz, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->UnregisterNatives(clazz); -#endif - - return NS_OK; -} - - -class MonitorEnterMessage : public JavaMessage { - jobject obj; - jint* result; -public: - MonitorEnterMessage(jobject obj, jint* result) - { - this->obj = obj; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->MonitorEnter(obj); - } -}; - -NS_IMETHODIMP CSecureEnv::MonitorEnter(/*[in]*/ jobject obj, - /*[out]*/ jint* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - MonitorEnterMessage msg(obj, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->MonitorEnter(obj); -#endif - - return NS_OK; -} - -class MonitorExitMessage : public JavaMessage { - jobject obj; - jint* result; -public: - MonitorExitMessage(jobject obj, jint* result) - { - this->obj = obj; - this->result = result; - } - - virtual void execute(JNIEnv* env) - { - *result = env->MonitorExit(obj); - } -}; - -NS_IMETHODIMP CSecureEnv::MonitorExit(/*[in]*/ jobject obj, - /*[out]*/ jint* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - -#if PROXY_JNI_CALLS - MonitorExitMessage msg(obj, result); - sendMessageToJava(&msg); -#else - *result = mJavaEnv->MonitorExit(obj); -#endif - - return NS_OK; -} - -NS_IMETHODIMP CSecureEnv::GetJavaVM(/*[in]*/ JavaVM **vm, - /*[out]*/ jint* result) -{ - if (mJavaEnv == NULL || result == NULL) - return NS_ERROR_NULL_POINTER; - - *result = mJavaEnv->GetJavaVM(vm); - - return NS_OK; -} - -/** - * Runs a message loop. Puts the message in the sendQueue, then waits on the receiveQueue for the reply. - */ - -void CSecureEnv::messageLoop(JNIEnv* env, JavaMessage* msg, JavaMessageQueue* sendQueue, JavaMessageQueue* receiveQueue, Boolean busyWaiting) -{ - // put the message in the send queue, and wait for a reply. - sendQueue->putMessage(msg); - sendQueue->notify(); - JavaMessage* replyMsg = receiveQueue->getMessage(); - for (;;) { - // Fully synchronized approach. - if (replyMsg != NULL) { - if (replyMsg == msg) - break; - // must be a message that needs executing. - replyMsg->execute(env); - sendQueue->putMessage(replyMsg); - sendQueue->notify(); - // notify can cause a yield, so look again. - replyMsg = receiveQueue->getMessage(); - if (replyMsg != NULL) - continue; - } - // when busy waiting, must give time to browser between timed waits. - if (busyWaiting) { - receiveQueue->wait(1024); - replyMsg = receiveQueue->getMessage(); - if (replyMsg != NULL) - continue; - // mSession->lock(); - mThreadManager->Sleep(); - // mSession->unlock(); - } else { - // wait for a message to arrive. - receiveQueue->wait(); - } - replyMsg = receiveQueue->getMessage(); - } -} - -void CSecureEnv::savePendingException(JNIEnv* env) -{ - // first off, always restore the env to a known state. - jthrowable pendingException = env->ExceptionOccurred(); - if (pendingException) { -#if USE_LIVECONNECT_PROXY - env->ExceptionDescribe(); -#endif - env->ExceptionClear(); - - if (mPendingException) - env->DeleteGlobalRef(mPendingException); - - mPendingException = (jthrowable) env->NewGlobalRef(pendingException); - env->DeleteLocalRef(pendingException); - } -} - -jthrowable CSecureEnv::getPendingException(JNIEnv* env) -{ - if (mPendingException) - return (jthrowable) env->NewLocalRef(mPendingException); - return NULL; -} - -void CSecureEnv::clearPendingException(JNIEnv* env) -{ - if (mPendingException) { - env->DeleteGlobalRef(mPendingException); - mPendingException = NULL; - } -} - -CSecureEnv* GetSecureJNI(JNIEnv* env, jobject thread) -{ - CSecureEnv* secureJNI = NULL; - - jclass threadClass = env->GetObjectClass(thread); - if (threadClass != NULL) { - jfieldID fSecureEnvField = env->GetFieldID(threadClass, "fSecureEnv", "I"); - if (fSecureEnvField != NULL) { - secureJNI = (CSecureEnv*) env->GetIntField(thread, fSecureEnvField); - } else { - env->ExceptionClear(); - } - env->DeleteLocalRef(threadClass); - } - - return secureJNI; -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/CSecureEnv.h b/plugin/oji/MRJCarbon/plugin/Source/CSecureEnv.h deleted file mode 100644 index bbee6e6d687a..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/CSecureEnv.h +++ /dev/null @@ -1,429 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - CSecureEnv.h - - Rewritten for use with MRJ plugin by Patrick C. Beard. - */ - -#ifndef CSecureJNI2_h___ -#define CSecureJNI_h___ - -#include "nsISecureEnv.h" -#include "nsIThreadManager.h" -#include "SupportsMixin.h" - -class MRJPlugin; -class MRJSession; - -class Monitor; -class nsIThreadManager; -class nsIJVMManager; -class nsIScriptSecurityManager; -class nsIPrincipal; - -class JavaMessage; -class JavaMessageQueue; - -class CSecureEnv : public nsISecureEnv, public nsIRunnable, private SupportsMixin { -public: - DECL_SUPPORTS_MIXIN - - static NS_METHOD Create(MRJPlugin* plugin, JNIEnv* proxyEnv, const nsIID& aIID, void* *aInstancePtr); - - //////////////////////////////////////////////////////////////////////////// - // from nsISecureJNI2: - - - /** - * Create new Java object in LiveConnect. - * - * @param clazz -- Java Class object. - * @param methodID -- Method id - * @param args -- arguments for invoking the constructor. - * @param result -- return new Java object. - * @param ctx -- security context - */ - NS_IMETHOD NewObject(/*[in]*/ jclass clazz, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jobject* result, - /*[in]*/ nsISecurityContext* ctx = NULL); - - /** - * Invoke method on Java object in LiveConnect. - * - * @param type -- Return type - * @param obj -- Java object. - * @param methodID -- method id - * @param args -- arguments for invoking the constructor. - * @param result -- return result of invocation. - * @param ctx -- security context - */ - NS_IMETHOD CallMethod(/*[in]*/ jni_type type, - /*[in]*/ jobject obj, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx = NULL); - - /** - * Invoke non-virtual method on Java object in LiveConnect. - * - * @param type -- Return type - * @param obj -- Java object. - * @param clazz -- Class object - * @param methodID -- method id - * @param args -- arguments for invoking the constructor. - * @param ctx -- security context - * @param result -- return result of invocation. - */ - NS_IMETHOD CallNonvirtualMethod(/*[in]*/ jni_type type, - /*[in]*/ jobject obj, - /*[in]*/ jclass clazz, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx = NULL); - - /** - * Get a field on Java object in LiveConnect. - * - * @param type -- Return type - * @param obj -- Java object. - * @param fieldID -- field id - * @param result -- return field value - * @param ctx -- security context - */ - NS_IMETHOD GetField(/*[in]*/ jni_type type, - /*[in]*/ jobject obj, - /*[in]*/ jfieldID fieldID, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx = NULL); - - /** - * Set a field on Java object in LiveConnect. - * - * @param type -- Return type - * @param obj -- Java object. - * @param fieldID -- field id - * @param val -- field value to set - * @param ctx -- security context - */ - NS_IMETHOD SetField(/*[in]*/ jni_type type, - /*[in]*/ jobject obj, - /*[in]*/ jfieldID fieldID, - /*[in]*/ jvalue val, - /*[in]*/ nsISecurityContext* ctx = NULL); - - /** - * Invoke static method on Java object in LiveConnect. - * - * @param type -- Return type - * @param clazz -- Class object. - * @param methodID -- method id - * @param args -- arguments for invoking the constructor. - * @param result -- return result of invocation. - * @param ctx -- security context - */ - NS_IMETHOD CallStaticMethod(/*[in]*/ jni_type type, - /*[in]*/ jclass clazz, - /*[in]*/ jmethodID methodID, - /*[in]*/ jvalue *args, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx = NULL); - - /** - * Get a static field on Java object in LiveConnect. - * - * @param type -- Return type - * @param clazz -- Class object. - * @param fieldID -- field id - * @param result -- return field value - * @param ctx -- security context - */ - NS_IMETHOD GetStaticField(/*[in]*/ jni_type type, - /*[in]*/ jclass clazz, - /*[in]*/ jfieldID fieldID, - /*[out]*/ jvalue* result, - /*[in]*/ nsISecurityContext* ctx = NULL); - - - /** - * Set a static field on Java object in LiveConnect. - * - * @param type -- Return type - * @param clazz -- Class object. - * @param fieldID -- field id - * @param val -- field value to set - * @param ctx -- security context - */ - NS_IMETHOD SetStaticField(/*[in]*/ jni_type 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 NewObjectArray(/*[in]*/ jsize len, - /*[in]*/ jclass clazz, - /*[in]*/ jobject init, - /*[out]*/ jobjectArray* 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 NewArray(/*[in]*/ jni_type element_type, - /*[in]*/ jsize len, - /*[out]*/ jarray* result); - - NS_IMETHOD GetArrayElements(/*[in]*/ jni_type type, - /*[in]*/ jarray array, - /*[in]*/ jboolean *isCopy, - /*[out]*/ void* result); - - NS_IMETHOD ReleaseArrayElements(/*[in]*/ jni_type type, - /*[in]*/ jarray array, - /*[in]*/ void *elems, - /*[in]*/ jint mode); - - NS_IMETHOD GetArrayRegion(/*[in]*/ jni_type type, - /*[in]*/ jarray array, - /*[in]*/ jsize start, - /*[in]*/ jsize len, - /*[out]*/ void* buf); - - NS_IMETHOD SetArrayRegion(/*[in]*/ jni_type 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); - - //////////////////////////////////////////////////////////////////////////// - // from nsIRunnable: - - NS_IMETHOD Run(); - - CSecureEnv(MRJPlugin* plugin, JNIEnv* proxyEnv, JNIEnv* javaEnv = NULL); - virtual ~CSecureEnv(void); - - /** - * Called by the native run method, to connect the - * thread and the secure env. - */ - void initialize(JNIEnv* javaEnv, jboolean* isRunning, JavaMessageQueue* javaQueue, JavaMessageQueue* nativeQueue); - - jboolean isInitialized() { return mJavaQueue != NULL; } - - void setProxyEnv(JNIEnv* proxyEnv) { mProxyEnv = proxyEnv; } - JNIEnv* getProxyEnv() { return mProxyEnv; } - - void setJavaEnv(JNIEnv* javaEnv) { mJavaEnv = javaEnv; } - JNIEnv* getJavaEnv() { return mJavaEnv; } - - MRJSession* getSession() { return mSession; } - nsIThreadManager* getThreadManager() { return mThreadManager; } - - void getMessageQueues(JavaMessageQueue*& javaQueue, JavaMessageQueue*& nativeQueue) - { - javaQueue = mJavaQueue; - nativeQueue = mNativeQueue; - } - - void sendMessageToJava(JavaMessage* msg); - void sendMessageFromJava(JNIEnv* javaEnv, JavaMessage* msg, Boolean busyWaiting = false); - void messageLoop(JNIEnv* env, JavaMessage* msgToSend, JavaMessageQueue* sendQueue, JavaMessageQueue* receiveQueue, Boolean busyWaiting = false); - - void savePendingException(JNIEnv* env); - jthrowable getPendingException(JNIEnv* env); - void clearPendingException(JNIEnv* env); - -protected: - MRJPlugin* mPlugin; - JNIEnv* mProxyEnv; - JNIEnv* mJavaEnv; - MRJSession* mSession; - nsIThreadManager* mThreadManager; - - jboolean* mIsRunning; - JavaMessageQueue* mJavaQueue; - JavaMessageQueue* mNativeQueue; - - jthrowable mPendingException; - - nsIScriptSecurityManager* mScriptSecurityManager; - nsIPrincipal* mScriptPrincipal; - jclass mLiveConnectProxy; - -private: - // support for SupportsMixin. - static const InterfaceInfo sInterfaces[]; - static const UInt32 kInterfaceCount; -}; - -/** - * Returns the secure JNI associated with the current thread (if any). - */ -CSecureEnv* GetSecureJNI(JNIEnv* env, jobject thread); - -#endif // CSecureJNI2_h___ diff --git a/plugin/oji/MRJCarbon/plugin/Source/EmbeddedFrame.cpp b/plugin/oji/MRJCarbon/plugin/Source/EmbeddedFrame.cpp deleted file mode 100644 index 7c2fa090124a..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/EmbeddedFrame.cpp +++ /dev/null @@ -1,331 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - TopLevelFrame.cpp - - An MRJFrame sub-class that manages the behavior of a top-level window - running inside the Communicator. - - by Patrick C. Beard. - */ - -#include -#include - -#include "EmbeddedFrame.h" -#include "EmbeddedFramePluginInstance.h" -#include "MRJPlugin.h" -#include "MRJSession.h" - -#include "nsIPluginInstancePeer.h" -#include "nsIOutputStream.h" -#include "JSEvaluator.h" -#include "LocalPort.h" -#include "StringUtils.h" - -static void UnsetPort(GrafPtr port); - -EmbeddedFrame::EmbeddedFrame(MRJPluginInstance* pluginInstance, JMFrameRef frameRef, JMFrameKind kind, - const Rect* initialBounds, Boolean resizeable) - : MRJFrame(frameRef), - mPluginInstance(NULL), mEvaluator(NULL), mWindow(NULL), mBounds(*initialBounds) -{ - Boolean hasGoAway = true; - SInt16 windowProc = documentProc; - SInt16 resizeHeight = resizeable ? 15 : 0; - - switch (kind) { - case eBorderlessModelessWindowFrame: - hasGoAway = false; - windowProc = plainDBox; - // mBounds.bottom += resizeHeight; - resizeable = false; - break; - case eModelessWindowFrame: - case eModelessDialogFrame: - hasGoAway = true; - windowProc = resizeable ? zoomDocProc : documentProc; - // mBounds.bottom += resizeHeight; - break; - case eModalWindowFrame: - hasGoAway = true; - // We have to allow resizeable modal windows. - windowProc = resizeable ? documentProc : movableDBoxProc; - break; - } - -#if 0 - - // Note: opening a new window on a stream using the following code crashes 4.X browsers. - // The problem is that the window has no URL assigned to it, and so some variables are - // unitialized and the browser crashes in a call to strlen(). - - class NewStreamMessage : public NativeMessage { - nsIPluginInstancePeer* mPeer; - const char* mType; - public: - NewStreamMessage(nsIPluginInstancePeer* peer, const char* type) : mPeer(peer), mType(type) {} - - virtual void execute() { - nsIOutputStream* output = NULL; - if (mPeer->NewStream(mType, "_new", &output) == NS_OK) { - // write some data to the stream. - output->Close(); - NS_RELEASE(output); - } - } - }; - - // open a stream of type "application/x-java-frame", which should cause a full-screen plugin to get created for a Java frame's - // behalf. communicate with the other instance via this stream. - nsIPluginInstancePeer* peer = NULL; - if (pluginInstance->GetPeer(&peer) == NS_OK) { - NewStreamMessage msg(peer, "application/x-java-frame"); - pluginInstance->getSession()->sendMessage(&msg); - NS_RELEASE(peer); - } - -#else - // var w = window.open('', '_new','resizable=no,status=no,width=200,height=200'); d = w.document; d.open(); d.write('Hi'); d.close(); - - static UInt32 embeddedFrameCounter = 0; - - // Use JavaScript to create a window with an tag. - const char* kEmbeddedFrameScript = "var w = window.open('','__MRJ_JAVA_FRAME_%d__','resizable=no,status=no,width=%d,height=%d,screenX=%d,screenY=%d');" - "var d = w.document; d.open();" - "d.writeln(' ');" - "d.close();"; - - int width = mBounds.right - mBounds.left; - int height = mBounds.bottom - mBounds.top; - int screenX = mBounds.left; - int screenY = mBounds.top; - - char* script = new char[::strlen(kEmbeddedFrameScript) + 100]; - ::sprintf(script, kEmbeddedFrameScript, ++embeddedFrameCounter, width, height, screenX, screenY, width, height, this); - - JSEvaluator* evaluator = new JSEvaluator(pluginInstance); - evaluator->AddRef(); - - // create the window. It will have been created after returning from eval. - const char* result = evaluator->eval(script); - - evaluator->Release(); - - delete[] script; - -#endif - - if (mWindow != NULL) { - Point zeroPt = { 0, 0 }; - ::JMSetFrameVisibility(mFrameRef, mWindow, zeroPt, NULL); - } -} - -EmbeddedFrame::~EmbeddedFrame() -{ - if (mPluginInstance != NULL) - mPluginInstance->setFrame(NULL); - - // make sure the window is hidden (and unregistered with the browser). - showHide(false); - - // make sure this port isn't ever current again. - ::UnsetPort(mWindow); - - // if (mWindow != NULL) - // ::DisposeWindow(mWindow); -} - -void EmbeddedFrame::setSize(const Rect* newSize) -{ - mBounds = *newSize; - - if (mWindow != NULL) { - SInt16 width = newSize->right - newSize->left; - SInt16 height = newSize->bottom - newSize->top; - ::SizeWindow(mWindow, width, height, true); - ::MoveWindow(mWindow, newSize->left, newSize->top, false); - } -} - -void EmbeddedFrame::invalRect(const Rect* invalidRect) -{ - if (mWindow != NULL) { - ::InvalRect(invalidRect); - } -} - -void EmbeddedFrame::showHide(Boolean visible) -{ - if (mWindow != NULL && visible != IsWindowVisible(mWindow)) { - if (visible) { - // Have to notify the browser that this window exists, so that it will receive events. - ::ShowWindow(mWindow); - ::SelectWindow(mWindow); - } else { - ::HideWindow(mWindow); - } - - // ::ShowHide(mWindow, visible); - } -} - -void EmbeddedFrame::setTitle(const StringPtr title) -{ - if (mWindow != NULL) { - ::SetWTitle(mWindow, title); - } -} - -void EmbeddedFrame::checkUpdate() -{ -} - -void EmbeddedFrame::reorder(ReorderRequest request) -{ - switch (request) { - case eBringToFront: /* bring the window to front */ - break; - case eSendToBack: /* send the window to back */ - break; - case eSendBehindFront: /* send the window behind the front window */ - break; - } -} - -void EmbeddedFrame::setResizeable(Boolean resizeable) -{ - // this might have to recreate the window, no? -} - -static void computeBounds(WindowRef window, Rect* bounds) -{ - LocalPort port(window); - port.Enter(); - - Point position = { 0, 0 }; - ::LocalToGlobal(&position); - - *bounds = window->portRect; - - port.Exit(); - - ::OffsetRect(bounds, position.h, position.v); -} - -void EmbeddedFrame::activate(Boolean active) -{ - focusEvent(active); - MRJFrame::activate(active); -} - -void EmbeddedFrame::click(const EventRecord* event) -{ - Point where = event->where; - SInt16 modifiers = event->modifiers; - WindowRef hitWindow; - short partCode = ::FindWindow(where, &hitWindow); - switch (partCode) { - case inContent: - ::SelectWindow(mWindow); - MRJFrame::click(event); - break; - case inDrag: - Rect bounds = (**GetGrayRgn()).rgnBBox; - DragWindow(mWindow, where, &bounds); - computeBounds(mWindow, &mBounds); - break; - case inGrow: - Rect limits = { 30, 30, 5000, 5000 }; - long result = GrowWindow(mWindow, where, &limits); - if (result != 0) { - short width = (result & 0xFFFF); - short height = (result >> 16) & 0xFFFF; - Rect newBounds; - topLeft(newBounds) = topLeft(mBounds); - newBounds.right = newBounds.left + width; - newBounds.bottom = newBounds.top + height; - ::JMSetFrameSize(mFrameRef, &newBounds); - } - break; - case inGoAway: - if (::TrackGoAway(mWindow, where)) - ::JMFrameGoAway(mFrameRef); - break; - case inZoomIn: - case inZoomOut: - if (::TrackBox(mWindow, where, partCode)) { - ZoomWindow(mWindow, partCode, true); - computeBounds(mWindow, &mBounds); - ::JMSetFrameSize(mFrameRef, &mBounds); - } - break; - case inCollapseBox: - break; - } -} - -void EmbeddedFrame::setPluginInstance(EmbeddedFramePluginInstance* embeddedInstance) -{ - mPluginInstance = embeddedInstance; -} - -void EmbeddedFrame::setWindow(WindowRef window) -{ - mWindow = window; -} - -WindowRef EmbeddedFrame::getWindow() -{ - return mWindow; -} - -GrafPtr EmbeddedFrame::getPort() -{ - return mWindow; -} - -static void UnsetPort(GrafPtr port) -{ - GrafPtr curPort; - ::GetPort(&curPort); - if (curPort == port) { - ::GetWMgrPort(&port); - ::SetPort(port); - } -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/EmbeddedFrame.h b/plugin/oji/MRJCarbon/plugin/Source/EmbeddedFrame.h deleted file mode 100644 index 0a78f4b7cc79..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/EmbeddedFrame.h +++ /dev/null @@ -1,87 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - EmbeddedFrame.h - - An MRJFrame sub-class that manages the behavior of a top-level window - running inside the Communicator. - - by Patrick C. Beard. - */ - -#pragma once - -#include "MRJFrame.h" - -#ifndef __MACWINDOWS__ -#include -#endif - -class MRJPluginInstance; -class EmbeddedFramePluginInstance; -class JSEvaluator; - -class EmbeddedFrame : public MRJFrame { -public: - EmbeddedFrame(MRJPluginInstance* pluginInstance, JMFrameRef frameRef, JMFrameKind kind, const Rect* initialBounds, Boolean resizeable); - virtual ~EmbeddedFrame(); - - virtual void setSize(const Rect* newSize); - virtual void invalRect(const Rect* invalidRect); - virtual void showHide(Boolean visible); - virtual void setTitle(const StringPtr title); - virtual void checkUpdate(); - virtual void reorder(ReorderRequest request); - virtual void setResizeable(Boolean resizeable); - - virtual void activate(Boolean active); - virtual void click(const EventRecord* event); - - void setPluginInstance(EmbeddedFramePluginInstance* embeddedInstance); - - void setWindow(WindowRef window); - WindowRef getWindow(); - -protected: - virtual GrafPtr getPort(); - -private: - EmbeddedFramePluginInstance* mPluginInstance; - JSEvaluator* mEvaluator; - WindowRef mWindow; - Rect mBounds; -}; diff --git a/plugin/oji/MRJCarbon/plugin/Source/EmbeddedFramePluginInstance.cpp b/plugin/oji/MRJCarbon/plugin/Source/EmbeddedFramePluginInstance.cpp deleted file mode 100644 index c8be57104757..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/EmbeddedFramePluginInstance.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - EmbeddedFramePluginInstance.cpp - */ - -#include "EmbeddedFramePluginInstance.h" -#include "EmbeddedFrame.h" -#include "MRJPlugin.h" - -#include "nsIPluginInstancePeer.h" -#include "nsIPluginTagInfo.h" - -#include - -EmbeddedFramePluginInstance::EmbeddedFramePluginInstance() - : mPeer(NULL), mFrame(NULL) -{ -} - -EmbeddedFramePluginInstance::~EmbeddedFramePluginInstance() -{ - if (mFrame != NULL) - delete mFrame; -} - -NS_METHOD EmbeddedFramePluginInstance::Initialize(nsIPluginInstancePeer* peer) -{ - mPeer = peer; - NS_ADDREF(mPeer); - - nsIPluginTagInfo* tagInfo = NULL; - if (mPeer->QueryInterface(NS_GET_IID(nsIPluginTagInfo), (void**)&tagInfo) == NS_OK) { - const char* frameValue = NULL; - if (tagInfo->GetAttribute("JAVAFRAME", &frameValue) == NS_OK) { - sscanf(frameValue, "%X", &mFrame); - } - if (mFrame != NULL) - mFrame->setPluginInstance(this); - NS_RELEASE(tagInfo); - } - - return NS_OK; -} - -NS_METHOD EmbeddedFramePluginInstance::GetPeer(nsIPluginInstancePeer* *resultingPeer) -{ - if (mPeer != NULL) { - *resultingPeer = mPeer; - mPeer->AddRef(); - } - return NS_OK; -} - -NS_METHOD EmbeddedFramePluginInstance::Destroy() -{ - NS_IF_RELEASE(mPeer); - - // assume that Java will release this frame. - if (mFrame != NULL) { - mFrame->showHide(false); - // delete mFrame; - mFrame = NULL; - } - - return NS_OK; -} - -NS_METHOD EmbeddedFramePluginInstance::SetWindow(nsPluginWindow* pluginWindow) -{ - if (mFrame != NULL) { - if (pluginWindow != NULL) - mFrame->setWindow(WindowRef(pluginWindow->window->port)); - else - mFrame->setWindow(NULL); - } - return NS_OK; -} - -NS_METHOD EmbeddedFramePluginInstance::HandleEvent(nsPluginEvent* pluginEvent, PRBool* eventHandled) -{ - if (mFrame != NULL) - *eventHandled = mFrame->handleEvent(pluginEvent->event); - return NS_OK; -} - -void EmbeddedFramePluginInstance::setFrame(EmbeddedFrame* frame) -{ - mFrame = frame; -} - -NS_IMPL_ISUPPORTS1(EmbeddedFramePluginInstance, nsIPluginInstance) diff --git a/plugin/oji/MRJCarbon/plugin/Source/EmbeddedFramePluginInstance.h b/plugin/oji/MRJCarbon/plugin/Source/EmbeddedFramePluginInstance.h deleted file mode 100644 index bc253f2ef0be..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/EmbeddedFramePluginInstance.h +++ /dev/null @@ -1,196 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - EmbeddedFramePluginInstance.h - */ - -#pragma once - -#include "nsIPluginInstance.h" - -class EmbeddedFrame; -class MRJPluginInstance; - -class EmbeddedFramePluginInstance : public nsIPluginInstance { -public: - EmbeddedFramePluginInstance(); - virtual ~EmbeddedFramePluginInstance(); - - NS_DECL_ISUPPORTS - - /** - * Initializes a newly created plugin instance, passing to it the plugin - * instance peer which it should use for all communication back to the browser. - * - * @param peer - the corresponding plugin instance peer - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Initialize(nsIPluginInstancePeer* peer); - - /** - * Returns a reference back to the plugin instance peer. This method is - * used whenever the browser needs to obtain the peer back from a plugin - * instance. The implementation of this method should be sure to increment - * the reference count on the peer by calling AddRef. - * - * @param resultingPeer - the resulting plugin instance peer - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - GetPeer(nsIPluginInstancePeer* *resultingPeer); - - /** - * Called to instruct the plugin instance to start. This will be called after - * the plugin is first created and initialized, and may be called after the - * plugin is stopped (via the Stop method) if the plugin instance is returned - * to in the browser window's history. - * - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Start(void) - { - return NS_OK; - } - - /** - * Called to instruct the plugin instance to stop, thereby suspending its state. - * This method will be called whenever the browser window goes on to display - * another page and the page containing the plugin goes into the window's history - * list. - * - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Stop(void) - { - return NS_OK; - } - - /** - * Called to instruct the plugin instance to destroy itself. This is called when - * it become no longer possible to return to the plugin instance, either because - * the browser window's history list of pages is being trimmed, or because the - * window containing this page in the history is being closed. - * - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Destroy(void); - - /** - * Called when the window containing the plugin instance changes. - * - * (Corresponds to NPP_SetWindow.) - * - * @param window - the plugin window structure - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - SetWindow(nsPluginWindow* window); - - /** - * Called to tell the plugin that the initial src/data stream is - * ready. Expects the plugin to return a nsIPluginStreamListener. - * - * (Corresponds to NPP_NewStream.) - * - * @param listener - listener the browser will use to give the plugin the data - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - NewStream(nsIPluginStreamListener** listener) - { - *listener = NULL; - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * Called to instruct the plugin instance to print itself to a printer. - * - * (Corresponds to NPP_Print.) - * - * @param platformPrint - platform-specific printing information - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Print(nsPluginPrint* platformPrint) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * Returns the value of a variable associated with the plugin instance. - * - * @param variable - the plugin instance variable to get - * @param value - the address of where to store the resulting value - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - GetValue(nsPluginInstanceVariable variable, void *value) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * Handles an event. An nsIEventHandler can also get registered with with - * nsIPluginManager2::RegisterWindow and will be called whenever an event - * comes in for that window. - * - * Note that for Unix and Mac the nsPluginEvent structure is different - * from the old NPEvent structure -- it's no longer the native event - * record, but is instead a struct. This was done for future extensibility, - * and so that the Mac could receive the window argument too. For Windows - * and OS2, it's always been a struct, so there's no change for them. - * - * (Corresponds to NPP_HandleEvent.) - * - * @param event - the event to be handled - * @param handled - set to PR_TRUE if event was handled - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - HandleEvent(nsPluginEvent* event, PRBool* handled); - - void setFrame(EmbeddedFrame* frame); - -private: - nsIPluginInstancePeer* mPeer; - MRJPluginInstance* mParentInstance; - EmbeddedFrame* mFrame; -}; diff --git a/plugin/oji/MRJCarbon/plugin/Source/EventFilter.cpp b/plugin/oji/MRJCarbon/plugin/Source/EventFilter.cpp deleted file mode 100644 index c357811e31af..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/EventFilter.cpp +++ /dev/null @@ -1,174 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - EventFilter.cpp - - Provides a generalized event filtering service. - - Patches WaitNextEvent for events, and MenuSelect for menus. - - by Patrick C. Beard. - */ - -#include "EventFilter.h" - -#include -#include -#include -#include -#include -#include - -enum { - uppWaitNextEventProcInfo = kPascalStackBased - | RESULT_SIZE(SIZE_CODE(sizeof(Boolean))) - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(EventMask))) - | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(EventRecord*))) - | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(UInt32))) - | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(RgnHandle))), - uppMenuSelectProcInfo = kPascalStackBased - | RESULT_SIZE(SIZE_CODE(sizeof(long))) - | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Point))) -}; - -static pascal Boolean NewWaitNextEvent(EventMask eventMask, EventRecord* event, UInt32 sleep, RgnHandle mouseRgn); -static pascal long NewMenuSelect(Point where); - -enum { - kIsToolboxTrap = (1 << 11) -}; - -inline TrapType getTrapType(UInt16 trapNum) -{ - return ((trapNum & kIsToolboxTrap) != 0 ? kToolboxTrapType : kOSTrapType); -} - -static UniversalProcPtr SwapTrapAddress(UInt16 trapNum, UniversalProcPtr newTrapAddress) -{ - TrapType type = getTrapType(trapNum); - UniversalProcPtr oldTrapAddress = NGetTrapAddress(trapNum, type); - NSetTrapAddress(newTrapAddress, trapNum, type); - return oldTrapAddress; -} - -struct Patch { - UInt16 trap; - RoutineDescriptor descriptor; - UniversalProcPtr original; - - void Install() { original = SwapTrapAddress(trap, &descriptor); } - void Remove() { SwapTrapAddress(trap, original); original = NULL; } -}; - -static Patch WaitNextEventPatch = { - _WaitNextEvent, - BUILD_ROUTINE_DESCRIPTOR(uppWaitNextEventProcInfo, NewWaitNextEvent), - NULL -}; - -static Patch MenuSelectPatch = { - _MenuSelect, - BUILD_ROUTINE_DESCRIPTOR(uppMenuSelectProcInfo, NewMenuSelect), - NULL -}; - -static EventFilterProcPtr theEventFilter; -static MenuFilterProcPtr theMenuFilter; - -OSStatus InstallEventFilters(EventFilterProcPtr eventFilter, MenuFilterProcPtr menuFilter) -{ - if (theEventFilter == NULL) { - theEventFilter = eventFilter; - theMenuFilter = menuFilter; - - // Patch WNE, which will be used to filter events. - WaitNextEventPatch.Install(); - - // Patch MenuSelect, which will be used to filter menu selections. - MenuSelectPatch.Install(); - - return noErr; - } - return paramErr; -} - -OSStatus RemoveEventFilters() -{ - if (theEventFilter != NULL) { - WaitNextEventPatch.Remove(); - MenuSelectPatch.Remove(); - - theEventFilter = NULL; - theMenuFilter = NULL; - - return noErr; - } - return paramErr; -} - -static pascal Boolean NewWaitNextEvent(EventMask eventMask, EventRecord* event, UInt32 sleep, RgnHandle mouseRgn) -{ - Boolean gotEvent = CALL_FOUR_PARAMETER_UPP(WaitNextEventPatch.original, uppWaitNextEventProcInfo, eventMask, event, sleep, mouseRgn); - if (true) { - // prevent recursive calls to the filter. - static Boolean inFilter = false; - if (! inFilter) { - inFilter = true; - Boolean filteredEvent = theEventFilter(event); - if (filteredEvent) { - // consume the event by making it a nullEvent. - event->what = nullEvent; - gotEvent = false; - } - inFilter = false; - } - } - return gotEvent; -} - -static pascal long NewMenuSelect(Point where) -{ - long menuSelection = CALL_ONE_PARAMETER_UPP(MenuSelectPatch.original, uppMenuSelectProcInfo, where); - if (menuSelection != 0) { - Boolean filteredEvent = theMenuFilter(menuSelection); - if (filteredEvent) { - // consume the menu selection by zeroing it out. - menuSelection = 0; - } - } - return menuSelection; -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/EventFilter.h b/plugin/oji/MRJCarbon/plugin/Source/EventFilter.h deleted file mode 100644 index bd8fc0f7a67c..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/EventFilter.h +++ /dev/null @@ -1,55 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -#pragma once - -/* - EventFilter.h - - Provides a generalized event filtering service. - - by Patrick C. Beard. - */ - -#ifndef __EVENTS__ -#include -#endif - -typedef Boolean (*EventFilterProcPtr) (EventRecord* event); -typedef Boolean (*MenuFilterProcPtr) (long menuSelection); - -OSStatus InstallEventFilters(EventFilterProcPtr eventFilter, MenuFilterProcPtr menuFilter); -OSStatus RemoveEventFilters(); diff --git a/plugin/oji/MRJCarbon/plugin/Source/JNIThread.java b/plugin/oji/MRJCarbon/plugin/Source/JNIThread.java deleted file mode 100644 index 10f774051e5e..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/JNIThread.java +++ /dev/null @@ -1,69 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - JNIThread.java - - Provides a communication channel between native threads and Java threads. - - by Patrick C. Beard. - */ - -package netscape.oji; - -class JNIThread extends Thread { - private int fSecureEnv; - - private JNIThread(int secureEnv) { - super("JNIThread->0x" + Integer.toHexString(secureEnv)); - fSecureEnv = secureEnv; - setPriority(NORM_PRIORITY); - // setPriority(MAX_PRIORITY); - start(); - } - - public native void run(); -} - -class JNIRunnable implements Runnable { - private int mJavaMessage; - - private JNIRunnable(int javaMessage) { - mJavaMessage = javaMessage; - } - - public native void run(); -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/JNIUtils.java b/plugin/oji/MRJCarbon/plugin/Source/JNIUtils.java deleted file mode 100644 index 2a4268a02a99..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/JNIUtils.java +++ /dev/null @@ -1,80 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - JNIUtils.java - */ - -package netscape.oji; - -public class JNIUtils { - /** - * Returns a local reference for a passed-in global reference. - */ - public static Object NewLocalRef(Object object) { - return object; - } - - /** - * Returns the currently running thread. - */ - public static Object GetCurrentThread() { - return Thread.currentThread(); - } - - - /** - * Stub SecurityManager class, to expose access to class loaders. - */ - static class StubSecurityManager extends SecurityManager { - public ClassLoader getCurrentClassLoader() { - return currentClassLoader(); - } - } - - private static StubSecurityManager stubManager = new StubSecurityManager(); - - /** - * Returns the current class loader. - */ - public static Object GetCurrentClassLoader() { - return stubManager.getCurrentClassLoader(); - } - - public static Object GetObjectClassLoader(Object object) { - return object.getClass().getClassLoader(); - } -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/JSEvaluator.cpp b/plugin/oji/MRJCarbon/plugin/Source/JSEvaluator.cpp deleted file mode 100644 index df3f6db8cca3..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/JSEvaluator.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - JSEvaluator.cpp - */ - -#include "JSEvaluator.h" -#include "MRJPlugin.h" -#include "MRJSession.h" -#include "MRJMonitor.h" -#include "nsIPluginManager.h" - -#include - -extern nsIPluginManager* thePluginManager; - -JSEvaluator::JSEvaluator(MRJPluginInstance* pluginInstance) - : mPluginInstance(pluginInstance) -{ - NS_ADDREF(pluginInstance); - mSession = pluginInstance->getSession(); - mJSMonitor = new MRJMonitor(mSession); -} - -JSEvaluator::~JSEvaluator() -{ - NS_IF_RELEASE(mPluginInstance); - if (mJSMonitor != NULL) - delete mJSMonitor; -} - -NS_IMPL_ISUPPORTS1(JSEvaluator, nsIPluginStreamListener) - -const char* JSEvaluator::eval(const char* script) -{ - JNIEnv* env = mSession->getCurrentEnv(); - nsIPluginStreamListener* listener = this; - - mJSMonitor->enter(); - - while (mScript != NULL) { - // some other thread is evaluating a script. - mJSMonitor->wait(); - } - - // construct a "javascript:" URL from the passed-in script. - const char* kJavaScriptPrefix = "javascript:"; - mScript = new char[strlen(kJavaScriptPrefix) + strlen(script) + 1]; - if (mScript != NULL) { - strcpy(mScript, kJavaScriptPrefix); - strcat(mScript, script); - - // start an async evaluation of this script. - nsresult result = thePluginManager->GetURL((nsIPluginInstance*)mPluginInstance, mScript, NULL, (nsIPluginStreamListener*)this); - - // default result is NULL, in case JavaScript returns undefined value. - if (mResult != NULL) { - delete[] mResult; - mResult = NULL; - } - - // need to block until the result is ready. - mJSMonitor->wait(); - - // can now delete the script. - delete[] mScript; - mScript = NULL; - } - - mJSMonitor->notifyAll(); - - mJSMonitor->exit(); - - return mResult; -} - -NS_METHOD JSEvaluator::OnDataAvailable(nsIPluginStreamInfo* pluginInfo, nsIInputStream* input, PRUint32 length) -{ - // hopefully all our data is available. - mResult = new char[length + 1]; - if (mResult != NULL) { - if (input->Read(mResult, length, &length) == NS_OK) { - // We've delayed processing the applet tag, because we - // don't know the location of the curren document yet. - mResult[length] = '\0'; - } - } - return NS_OK; -} - -NS_METHOD JSEvaluator::OnStopBinding(nsIPluginStreamInfo* pluginInfo, nsresult status) -{ - // the stream has been closed, notify any waiting Java threads. - mJSMonitor->notifyAll(); - return NS_OK; -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/JSEvaluator.h b/plugin/oji/MRJCarbon/plugin/Source/JSEvaluator.h deleted file mode 100644 index ba308ddcb26a..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/JSEvaluator.h +++ /dev/null @@ -1,131 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - JSEvaluator.h - */ - -#pragma once - -#include "nsIPluginStreamListener.h" - -#ifndef JNI_H -#include "jni.h" -#endif - -class MRJMonitor; -class MRJSession; -class MRJPluginInstance; - -class JSEvaluator : public nsIPluginStreamListener { -public: - NS_DECL_ISUPPORTS - - JSEvaluator(MRJPluginInstance* pluginInstance); - virtual ~JSEvaluator(); - - const char* eval(const char* script); - - const char* getResult() - { - return mResult; - } - - // nsIPluginStreamListener implementation. - - /** - * Notify the observer that the URL has started to load. This method is - * called only once, at the beginning of a URL load.

- * - * @return The return value is currently ignored. In the future it may be - * used to cancel the URL load.. - */ - NS_IMETHOD - OnStartBinding(nsIPluginStreamInfo* pluginInfo) - { - return NS_OK; - } - - /** - * Notify the client that data is available in the input stream. This - * method is called whenver data is written into the input stream by the - * networking library...

- * - * @param aIStream The input stream containing the data. This stream can - * be either a blocking or non-blocking stream. - * @param length The amount of data that was just pushed into the stream. - * @return The return value is currently ignored. - */ - NS_IMETHOD - OnDataAvailable(nsIPluginStreamInfo* pluginInfo, nsIInputStream* input, PRUint32 length); - - NS_IMETHOD - OnFileAvailable(nsIPluginStreamInfo* pluginInfo, const char* fileName) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * Notify the observer that the URL has finished loading. This method is - * called once when the networking library has finished processing the - * URL transaction initiatied via the nsINetService::Open(...) call.

- * - * This method is called regardless of whether the URL loaded successfully.

- * - * @param status Status code for the URL load. - * @param msg A text string describing the error. - * @return The return value is currently ignored. - */ - NS_IMETHOD - OnStopBinding(nsIPluginStreamInfo* pluginInfo, nsresult status); - - /** - * What is this method supposed to do? - */ - NS_IMETHOD - GetStreamType(nsPluginStreamType *result) - { - *result = nsPluginStreamType_Normal; - return NS_OK; - } - -private: - MRJPluginInstance* mPluginInstance; - MRJSession* mSession; - MRJMonitor* mJSMonitor; - char* mScript; - char* mResult; -}; diff --git a/plugin/oji/MRJCarbon/plugin/Source/JavaMessageQueue.h b/plugin/oji/MRJCarbon/plugin/Source/JavaMessageQueue.h deleted file mode 100644 index 3007f8ef6a81..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/JavaMessageQueue.h +++ /dev/null @@ -1,82 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - JavaMessageQueue.h - */ - -#pragma once - -#ifndef JNI_H -#include "jni.h" -#endif - -class Monitor; - -class JavaMessage { -public: - JavaMessage() : mNext(NULL) {} - virtual ~JavaMessage() {} - - void setNext(JavaMessage* next) { mNext = next; } - JavaMessage* getNext() { return mNext; } - - virtual void execute(JNIEnv* env) = 0; - -private: - JavaMessage* mNext; -}; - -class JavaMessageQueue { -public: - JavaMessageQueue(Monitor* monitor); - - void putMessage(JavaMessage* msg); - JavaMessage* getMessage(); - - void enter(); - void exit(); - - void wait(); - void wait(long long millis); - void notify(); - -private: - // Message queue. - JavaMessage* mFirst; - JavaMessage* mLast; - Monitor* mMonitor; -}; diff --git a/plugin/oji/MRJCarbon/plugin/Source/JavaVMFramework.cpp b/plugin/oji/MRJCarbon/plugin/Source/JavaVMFramework.cpp deleted file mode 100644 index c324737b43c1..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/JavaVMFramework.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - JavaVMFramework.cpp - - CFM glue for the JavaVM.framework. - - by Patrick C. Beard. - */ - -#include -#include - -#include -#include -#include -#include - -static CFBundleRef getBundle(CFStringRef frameworkPath) -{ - CFBundleRef bundle = NULL; - - // Make a CFURLRef from the CFString representation of the bundle's path. - // See the Core Foundation URL Services chapter for details. - CFURLRef bundleURL = CFURLCreateWithFileSystemPath(NULL, frameworkPath, kCFURLPOSIXPathStyle, true); - if (bundleURL != NULL) { - bundle = CFBundleCreate(NULL, bundleURL); - if (bundle != NULL) - CFBundleLoadExecutable(bundle); - CFRelease(bundleURL); - } - - return bundle; -} - -#if DEBUG -static void* getSystemFunction(CFStringRef functionName) -{ - static CFBundleRef systemBundle = getBundle(CFSTR("/System/Library/Frameworks/System.framework")); - if (systemBundle) return CFBundleGetFunctionPointerForName(systemBundle, functionName); - return NULL; -} - -// Useful Carbon-CFM debugging tool, printf that goes to the system console. - -typedef int (*printf_proc_ptr) (const char* format, ...); -static printf_proc_ptr kprintf = (printf_proc_ptr) getSystemFunction(CFSTR("printf")); - -#endif - -// CFM glue functions for JNI_GetDefaultJavaVMInitArgs & JNI_CreateJavaVM. - -static void* getJavaVMFunction(CFStringRef functionName) -{ - static CFBundleRef javaBundle = getBundle(CFSTR("/System/Library/Frameworks/JavaVM.framework")); - if (javaBundle) return CFBundleGetFunctionPointerForName(javaBundle, functionName); - return NULL; -} - -typedef jint JNICALL (*JNI_GetDefaultJavaVMInitArgs_proc_ptr) (void *args); -static JNI_GetDefaultJavaVMInitArgs_proc_ptr _JNI_GetDefaultJavaVMInitArgs = (JNI_GetDefaultJavaVMInitArgs_proc_ptr) getJavaVMFunction(CFSTR("JNI_GetDefaultJavaVMInitArgs")); - -_JNI_IMPORT_OR_EXPORT_ jint JNICALL -JNI_GetDefaultJavaVMInitArgs(void *args) -{ -#if DEBUG - kprintf("_JNI_GetDefaultJavaVMInitArgs = 0x%08X\n", _JNI_GetDefaultJavaVMInitArgs); -#endif - if (_JNI_GetDefaultJavaVMInitArgs) return _JNI_GetDefaultJavaVMInitArgs(args); - return -1; -} - -typedef jint JNICALL (*JNI_CreateJavaVM_proc_ptr) (JavaVM **pvm, void **penv, void *args); -static JNI_CreateJavaVM_proc_ptr _JNI_CreateJavaVM = (JNI_CreateJavaVM_proc_ptr) getJavaVMFunction(CFSTR("JNI_CreateJavaVM")); - -_JNI_IMPORT_OR_EXPORT_ jint JNICALL -JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args) -{ -#if DEBUG - kprintf("_JNI_CreateJavaVM = 0x%08X\n", _JNI_CreateJavaVM); -#endif - if (_JNI_CreateJavaVM) return _JNI_CreateJavaVM(pvm, penv, args); - return -1; -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/LiveConnectNativeMethods.cpp b/plugin/oji/MRJCarbon/plugin/Source/LiveConnectNativeMethods.cpp deleted file mode 100644 index 70bf1492324f..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/LiveConnectNativeMethods.cpp +++ /dev/null @@ -1,1007 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - LiveConnectNativeMethods.cpp - */ - -#include - -#include "LiveConnectNativeMethods.h" - -#include "nsIComponentManagerObsolete.h" -#include "nsIPluginManager.h" -#include "nsIJVMManager.h" -#include "nsILiveconnect.h" -#include "nsIPluginInstancePeer2.h" - -#include "MRJPlugin.h" -#include "MRJContext.h" -#include "MRJSession.h" -#include "MRJSecurityContext.h" -#include "CSecureEnv.h" -#include "JavaMessageQueue.h" -#include "MRJMonitor.h" -#include "NativeMonitor.h" -#include "RunnableMixin.h" -#include "StringUtils.h" - -#include "netscape_javascript_JSObject.h" /* javah-generated headers */ - -extern nsIPluginManager* thePluginManager; - -static MRJPlugin* theJVMPlugin = NULL; -static nsILiveconnect* theLiveConnectManager = NULL; -static nsIComponentManagerObsolete* theComponentManager = NULL; - -static jclass netscape_javascript_JSObject = NULL; -static jmethodID netscape_javascript_JSObject_JSObject; -static jfieldID netscape_javascript_JSObject_internal; - -static jclass netscape_oji_JNIUtils = NULL; -static jmethodID netscape_oji_JNIUtils_NewLocalRef = NULL; -static jmethodID netscape_oji_JNIUtils_GetCurrentThread = NULL; -static jmethodID netscape_oji_JNIUtils_GetCurrentClassLoader = NULL; -static jmethodID netscape_oji_JNIUtils_GetObjectClassLoader = NULL; - -static NS_DEFINE_IID(kLiveConnectCID, NS_CLIVECONNECT_CID); -static NS_DEFINE_IID(kComponentManagerCID, NS_COMPONENTMANAGER_CID); - -static nsresult getGlobalComponentManager(nsIComponentManagerObsolete* *result) -{ - return MRJPlugin::GetService(kComponentManagerCID, NS_GET_IID(nsIComponentManagerObsolete), (void**)result); -} - -nsresult InitLiveConnectSupport(MRJPlugin* jvmPlugin) -{ - theJVMPlugin = jvmPlugin; - - getGlobalComponentManager(&theComponentManager); - - nsresult result = MRJPlugin::GetService(kLiveConnectCID, NS_GET_IID(nsILiveconnect), - (void**)&theLiveConnectManager); - if (result != NS_OK) - return result; - - // Manually load the required native methods. - static JNINativeMethod nativeMethods[] = { - "getMember", "(Ljava/lang/String;)Ljava/lang/Object;", (void*)&Java_netscape_javascript_JSObject_getMember, - "getSlot", "(I)Ljava/lang/Object;", (void*)&Java_netscape_javascript_JSObject_getSlot, - "setMember", "(Ljava/lang/String;Ljava/lang/Object;)V", (void*)&Java_netscape_javascript_JSObject_setMember, - "setSlot", "(ILjava/lang/Object;)V", (void*)&Java_netscape_javascript_JSObject_setSlot, - "removeMember", "(Ljava/lang/String;)V", (void*)&Java_netscape_javascript_JSObject_removeMember, - "call", "(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object;", (void*)&Java_netscape_javascript_JSObject_call, - "eval", "(Ljava/lang/String;)Ljava/lang/Object;", (void*)&Java_netscape_javascript_JSObject_eval, - "toString", "()Ljava/lang/String;", (void*)&Java_netscape_javascript_JSObject_toString, - "getWindow", "(Ljava/applet/Applet;)Lnetscape/javascript/JSObject;", (void*)&Java_netscape_javascript_JSObject_getWindow, - "finalize", "()V", (void*)&Java_netscape_javascript_JSObject_finalize, - }; - - MRJSession* session = jvmPlugin->getSession(); - JNIEnv* env = session->getCurrentEnv(); - if (env != NULL) { - jclass classJSObject = env->FindClass("netscape/javascript/JSObject"); - if (classJSObject != NULL) { - // register LiveConnect native methods. - netscape_javascript_JSObject = (jclass) env->NewGlobalRef(classJSObject); - env->DeleteLocalRef(classJSObject); - - netscape_javascript_JSObject_JSObject = env->GetMethodID(netscape_javascript_JSObject, "", "(I)V"); - if (env->ExceptionCheck()) { - env->ExceptionClear(); - result = NS_ERROR_FAILURE; - } - - netscape_javascript_JSObject_internal = env->GetFieldID(netscape_javascript_JSObject, "internal", "I"); - if (env->ExceptionCheck()) { - env->ExceptionClear(); - result = NS_ERROR_FAILURE; - } - - env->RegisterNatives(netscape_javascript_JSObject, nativeMethods, sizeof(nativeMethods) / sizeof(JNINativeMethod)); - if (env->ExceptionCheck()) { - env->ExceptionClear(); - result = NS_ERROR_FAILURE; - } - } - - // load netscape.oji.JNIUtils class. - jclass classJNIUtils = env->FindClass("netscape/oji/JNIUtils"); - if (classJNIUtils != NULL) { - netscape_oji_JNIUtils = (jclass) env->NewGlobalRef(classJNIUtils); - env->DeleteLocalRef(classJNIUtils); - netscape_oji_JNIUtils_NewLocalRef = env->GetStaticMethodID(netscape_oji_JNIUtils, "NewLocalRef", "(Ljava/lang/Object;)Ljava/lang/Object;"); - netscape_oji_JNIUtils_GetCurrentThread = env->GetStaticMethodID(netscape_oji_JNIUtils, "GetCurrentThread", "()Ljava/lang/Object;"); - netscape_oji_JNIUtils_GetCurrentClassLoader = env->GetStaticMethodID(netscape_oji_JNIUtils, "GetCurrentClassLoader", "()Ljava/lang/Object;"); - netscape_oji_JNIUtils_GetObjectClassLoader = env->GetStaticMethodID(netscape_oji_JNIUtils, "GetObjectClassLoader", "(Ljava/lang/Object;)Ljava/lang/Object;"); - } - } - - return result; -} - -nsresult ShutdownLiveConnectSupport() -{ - NS_IF_RELEASE(theLiveConnectManager); - NS_IF_RELEASE(theComponentManager); - - if (theJVMPlugin != NULL) { - theJVMPlugin = NULL; - } - - return NS_OK; -} - -jobject Wrap_JSObject(JNIEnv* env, jsobject js_obj) -{ - jmethodID constructorID = env->GetMethodID(netscape_javascript_JSObject, "", "(I)V"); - return env->NewObject(netscape_javascript_JSObject, constructorID, js_obj); -} - -jsobject Unwrap_JSObject(JNIEnv* env, jobject java_wrapper_obj) -{ - return env->GetIntField(java_wrapper_obj, netscape_javascript_JSObject_internal); -} - -static jobject NewLocalRef(JNIEnv* env, jobject global_ref) -{ - return env->CallStaticObjectMethod(netscape_oji_JNIUtils, netscape_oji_JNIUtils_NewLocalRef, global_ref); -} - -static jobject ToGlobalRef(JNIEnv* env, jobject localRef) -{ - jobject globalRef = env->NewGlobalRef(localRef); - env->DeleteLocalRef(localRef); - return globalRef; -} - -static jobject ToLocalRef(JNIEnv* env, jobject globalRef) -{ - jobject localRef = NewLocalRef(env, globalRef); - env->DeleteGlobalRef(globalRef); - return localRef; -} - -static jobject GetCurrentThread(JNIEnv* env) -{ - return env->CallStaticObjectMethod(netscape_oji_JNIUtils, netscape_oji_JNIUtils_GetCurrentThread); -} - -/** - * Security Considerations. - */ - -MRJSecurityContext::MRJSecurityContext(const char* location) - : mLocation(nsnull), mConnection(nsnull) -{ - mLocation = ::strdup(location); - if (mLocation) { - // find the 3rd slash of the URL, hopefully it's in canonical form. - char* colon = ::strchr(mLocation, ':'); - if (colon) { - if (colon[1] == '/' && colon[2] == '/') { - char* slash = ::strchr(colon + 3, '/'); - if (slash) *slash = '\0'; - } - } - } - - if (theComponentManager) { - theComponentManager->CreateInstance(kLiveConnectCID, nsnull, NS_GET_IID(nsILiveconnect), - (void**)&mConnection); - } else { - mConnection = theLiveConnectManager; - NS_IF_ADDREF(mConnection); - } -} - -MRJSecurityContext::~MRJSecurityContext() -{ - delete[] mLocation; - NS_IF_RELEASE(mConnection); -} - -// work around a bug in Metrowerks pre-processor. -NS_IMPL_ISUPPORTS1(MRJSecurityContext, nsISecurityContext) - -NS_METHOD MRJSecurityContext::Implies(const char* target, const char* action, PRBool *bAllowedAccess) -{ - *bAllowedAccess = (target != NULL && action == NULL); - return NS_OK; -} - -NS_METHOD -MRJSecurityContext::GetOrigin(char* buf, int len) -{ - char* origin = nsnull; - if (mLocation) { - ::strncpy(buf, mLocation, len); - return NS_OK; - } - return NS_ERROR_FAILURE; -} - -NS_METHOD -MRJSecurityContext::GetCertificateID(char* buf, int len) -{ - // ACTION: Implement me. - return NS_ERROR_NOT_IMPLEMENTED; -} - -// NOTE: this a weak reference to the MRJSecurityContext associated with this -// plugin instance. The MRJSecurityContext is owned by the MRJContext. - -static MRJSecurityContext* getSecurityContext(MRJPluginInstance* pluginInstance) -{ - if (pluginInstance != NULL) { - MRJContext* context = pluginInstance->getContext(); - MRJSecurityContext* securityContext = context->getSecurityContext(); - if (securityContext == NULL) { - securityContext = new MRJSecurityContext(context->getDocumentBase()); - context->setSecurityContext(securityContext); - } - return securityContext; - } - return NULL; -} - -inline nsILiveconnect* getLiveconnectInstance(MRJSecurityContext* securityContext) -{ - return (securityContext ? securityContext->getConnection() : theLiveConnectManager); -} - -static jobject GetCurrentClassLoader(JNIEnv* env) -{ - return env->CallStaticObjectMethod(netscape_oji_JNIUtils, netscape_oji_JNIUtils_GetCurrentClassLoader); -} - -static jobject GetObjectClassLoader(JNIEnv* env, jobject object) -{ - return env->CallStaticObjectMethod(netscape_oji_JNIUtils, netscape_oji_JNIUtils_GetObjectClassLoader, object); -} - -/** - * Maps the given JNIEnv to a given plugin instance by comparing the current class loader - * with the class loader of the applet of each plugin instance. This could be made - * faster, but it's probably good enough. Note: the reference count of the plugin - * instance isn't affected by this call. - */ -static MRJPluginInstance* GetCurrentInstance(JNIEnv* env) -{ - MRJPluginInstance* pluginInstance = NULL; - jobject classLoader = GetCurrentClassLoader(env); - if (classLoader != NULL) { - pluginInstance = MRJPluginInstance::getInstances(); - while (pluginInstance != NULL) { - jobject applet; - pluginInstance->GetJavaObject(&applet); - jobject appletClassLoader = GetObjectClassLoader(env, applet); - jboolean sameClassLoader = env->IsSameObject(appletClassLoader, classLoader); - env->DeleteLocalRef(appletClassLoader); - if (sameClassLoader) - break; - pluginInstance = pluginInstance->getNextInstance(); - } - env->DeleteLocalRef(classLoader); - } - return pluginInstance; -} - -/** - * Maps the given applet to a given plugin instance by walking the PluginInstance list looking - * for an instance which contains the current applet. - * Note: the reference count of the plugin instance isn't affected by this call. - */ -static MRJPluginInstance* GetCurrentInstance(JNIEnv* env, jobject applet) -{ - MRJPluginInstance* pluginInstance = MRJPluginInstance::getInstances(); - while (pluginInstance != NULL) { - jobject object = NULL; - if (pluginInstance->GetJavaObject(&object) == NS_OK && env->IsSameObject(applet, object)) { - return pluginInstance; - } - pluginInstance = pluginInstance->getNextInstance(); - } - return NULL; -} - -/** - * Wraps a JavaMessage in an nsIRunnable form, so that it runs on the correct native thread. - */ -class MessageRunnable : public JavaMessage, public RunnableMixin { -public: - MessageRunnable(PRUint32 threadID, JavaMessage* msg); - - virtual void execute(JNIEnv* env); - - NS_IMETHOD Run(); - -private: - PRUint32 mThreadID; - JavaMessage* mMessage; -}; - -MessageRunnable::MessageRunnable(PRUint32 threadID, JavaMessage* msg) - : mThreadID(threadID), mMessage(msg) -{ -} - -void MessageRunnable::execute(JNIEnv* env) -{ - // because a spontaneous Java thread called us, we have to switch to the JavaScript thread - // to handle this request. - nsIThreadManager* threadManager = NULL; - if (MRJPlugin::GetService(nsIJVMManager::GetCID(), NS_GET_IID(nsIThreadManager), (void**)&threadManager) == NS_OK) { - threadManager->PostEvent(mThreadID, this, PR_FALSE); - NS_RELEASE(threadManager); - } -} - -NS_IMETHODIMP MessageRunnable::Run() -{ - nsIJVMManager* javaManager = NULL; - if (MRJPlugin::GetService(nsIJVMManager::GetCID(), NS_GET_IID(nsIJVMManager), (void**)&javaManager) == NS_OK) { - JNIEnv* proxyEnv = NULL; - if (javaManager->GetProxyJNI(&proxyEnv) == NS_OK && proxyEnv != NULL) - mMessage->execute(proxyEnv); - NS_RELEASE(javaManager); - } - return NS_OK; -} - -static PRUint32 getJavaScriptThread(JNIEnv* env) -{ - PRUint32 threadID = 0; - MRJPluginInstance* pluginInstance = GetCurrentInstance(env); - if (pluginInstance != NULL) { - nsIPluginInstancePeer* peer; - if (pluginInstance->GetPeer(&peer) == NS_OK) { - nsIPluginInstancePeer2* peer2 = NULL; - if (peer->QueryInterface(NS_GET_IID(nsIPluginInstancePeer2), (void**)&peer2) == NS_OK) { - if (peer2->GetJSThread(&threadID) != NS_OK) - threadID = 0; - NS_RELEASE(peer2); - } - NS_RELEASE(peer); - } - } - return threadID; -} - -/** - * Sends a message by rendezvousing with an existing JavaScript thread, or creates a new one - * if none exists for this thread already. - */ -static void sendMessage(JNIEnv* env, JavaMessage* msg) -{ - // the main thread gets its own secure env, so it won't contend with other threads. this - // is needed to handle finalization, which seems to get called from the main thread sometimes. - if (env == theJVMPlugin->getSession()->getMainEnv()) { - static CSecureEnv* mainEnv = NULL; - if (mainEnv == NULL) { - mainEnv = new CSecureEnv(theJVMPlugin, NULL, env); - mainEnv->AddRef(); - } - mainEnv->setJavaEnv(env); - mainEnv->sendMessageFromJava(env, msg, true); - return; - } - - // If this is a call back into JavaScript from Java, there will be a secureEnv associated with this thread. - jobject thread = GetCurrentThread(env); - CSecureEnv* secureEnv = GetSecureJNI(env, thread); - env->DeleteLocalRef(thread); - if (secureEnv != NULL) { - secureEnv->sendMessageFromJava(env, msg); - } else { - // spontaneous call in from Java. this communicates with a shared server thread. this is *VERY* slow right now. - static MRJMonitor sharedMonitor(theJVMPlugin->getSession()); - // only 1 Java thread can use this at a time. - sharedMonitor.enter(); - { - static CSecureEnv* sharedEnv = NULL; - if (sharedEnv == NULL) { - sharedEnv = new CSecureEnv(theJVMPlugin, NULL, env); - sharedEnv->AddRef(); - } - sharedEnv->setJavaEnv(env); - - // In the current Seamonkey architecture, there's really only one thread that JavaScript - // can execute in. We take advantage of that fact here. When we have a more multithreaded - // system, this will have to be revisited. - static PRUint32 theJavaScriptThread = getJavaScriptThread(env); - - // if the JavaScript thread is known, wrap the message in a MessageRunnable to handle - // the message in the JavaScript thread. - if (theJavaScriptThread != 0) { - MessageRunnable* runnableMsg = new MessageRunnable(theJavaScriptThread, msg); - NS_ADDREF(runnableMsg); - sharedEnv->sendMessageFromJava(env, runnableMsg); - NS_IF_RELEASE(runnableMsg); - } - } - sharedMonitor.exit(); - } -} - -static nsIPrincipal* newCodebasePrincipal(const char* codebaseURL) -{ - nsIPrincipal* principal = NULL; -#if 0 - nsICapsManager* capsManager = NULL; - static NS_DEFINE_IID(kICapsManagerIID, NS_ICAPSMANAGER_IID); - if (thePluginManager->QueryInterface(kICapsManagerIID, &capsManager) == NS_OK) { - if (capsManager->CreateCodebasePrincipal(codebaseURL, &principal) != NS_OK) - principal = NULL; - capsManager->Release(); - } -#endif - return principal; -} - -/****************** Implementation of methods of JSObject *******************/ - -/* - * Class: netscape_javascript_JSObject - * Method: getMember - * Signature: (Ljava/lang/String;)Ljava/lang/Object; - */ - -class GetMemberMessage : public JavaMessage { - MRJPluginInstance* mPluginInstance; - jsobject mObject; - const jchar* mPropertyName; - jsize mLength; - jobject* mResultObject; -public: - GetMemberMessage(MRJPluginInstance* pluginInstance, jsobject js_obj, - const jchar* propertyName, jsize nameLength, jobject* member) - : mPluginInstance(pluginInstance), mObject(js_obj), mPropertyName(propertyName), - mLength(nameLength), mResultObject(member) - { - } - - virtual void execute(JNIEnv* env) - { - MRJSecurityContext* securityContext = getSecurityContext(mPluginInstance); - nsILiveconnect* connection = getLiveconnectInstance(securityContext); - jobject member; - nsresult result = connection->GetMember(env, mObject, mPropertyName, mLength, NULL, 0, securityContext, &member); - if (result == NS_OK) { - // convert reference to a global reference, in case we're switching threads. - *mResultObject = ToGlobalRef(env, member); - } - } -}; - -JNIEXPORT jobject JNICALL -Java_netscape_javascript_JSObject_getMember(JNIEnv* env, - jobject java_wrapper_obj, - jstring property_name_jstr) -{ - if (property_name_jstr == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal null member name"); - return NULL; - } - - MRJPluginInstance* pluginInstance = GetCurrentInstance(env); - if (pluginInstance == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal JNIEnv (can't find plugin)"); - return NULL; - } - - /* Get the Unicode string for the JS property name */ - jboolean is_copy; - const jchar* property_name_ucs2 = env->GetStringChars(property_name_jstr, &is_copy); - jsize property_name_len = env->GetStringLength(property_name_jstr); - - jsobject js_obj = Unwrap_JSObject(env, java_wrapper_obj); - jobject member = NULL; - - GetMemberMessage msg(pluginInstance, js_obj, property_name_ucs2, property_name_len, &member); - sendMessage(env, &msg); - - // convert the resulting reference back to a local reference. - if (member != NULL) - member = ToLocalRef(env, member); - - env->ReleaseStringChars(property_name_jstr, property_name_ucs2); - - return member; -} - -/* - * Class: netscape_javascript_JSObject - * Method: getSlot - * Signature: (I)Ljava/lang/Object; - */ - -class GetSlotMessage : public JavaMessage { - MRJPluginInstance* mPluginInstance; - jsobject mObject; - jint mSlot; - jobject* mResultObject; -public: - GetSlotMessage(MRJPluginInstance* pluginInstance, jsobject js_obj, - jint slot, jobject* member) - : mPluginInstance(pluginInstance), mObject(js_obj), mSlot(slot), mResultObject(member) - { - } - - virtual void execute(JNIEnv* env) - { - MRJSecurityContext* securityContext = getSecurityContext(mPluginInstance); - nsILiveconnect* connection = getLiveconnectInstance(securityContext); - jobject member; - nsresult result = connection->GetSlot(env, mObject, mSlot, NULL, 0, securityContext, &member); - if (result == NS_OK) { - // convert reference to a global reference, in case we're switching threads. - *mResultObject = ToGlobalRef(env, member); - } - } -}; - -JNIEXPORT jobject JNICALL -Java_netscape_javascript_JSObject_getSlot(JNIEnv* env, - jobject java_wrapper_obj, - jint slot) -{ - MRJPluginInstance* pluginInstance = GetCurrentInstance(env); - - if (pluginInstance == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal JNIEnv (can't find plugin)"); - return NULL; - } - - jsobject js_obj = Unwrap_JSObject(env, java_wrapper_obj); - jobject member = NULL; - - GetSlotMessage msg(pluginInstance, js_obj, slot, &member); - sendMessage(env, &msg); - - // convert the resulting reference back to a local reference. - if (member != NULL) - member = ToLocalRef(env, member); - return member; -} - -/* - * Class: netscape_javascript_JSObject - * Method: setMember - * Signature: (Ljava/lang/String;Ljava/lang/Object;)V - */ - -class SetMemberMessage : public JavaMessage { - MRJPluginInstance* mPluginInstance; - jsobject mObject; - const jchar* mPropertyName; - jsize mLength; - jobject mJavaObject; -public: - SetMemberMessage(MRJPluginInstance* pluginInstance, jsobject js_obj, const jchar* propertyName, - jsize nameLength, jobject java_obj) - : mPluginInstance(pluginInstance), mObject(js_obj), mPropertyName(propertyName), mLength(nameLength), mJavaObject(java_obj) - { - } - - virtual void execute(JNIEnv* env) - { - MRJSecurityContext* securityContext = getSecurityContext(mPluginInstance); - nsILiveconnect* connection = getLiveconnectInstance(securityContext); - nsresult result = connection->SetMember(env, mObject, mPropertyName, mLength, mJavaObject, 0, NULL, securityContext); - } -}; - -JNIEXPORT void JNICALL -Java_netscape_javascript_JSObject_setMember(JNIEnv* env, - jobject java_wrapper_obj, - jstring property_name_jstr, - jobject java_obj) -{ - if (property_name_jstr == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal null member name"); - return; - } - - MRJPluginInstance* pluginInstance = GetCurrentInstance(env); - if (pluginInstance == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal JNIEnv (can't find plugin)"); - return; - } - - /* Get the Unicode string for the JS property name */ - jboolean is_copy; - const jchar* property_name_ucs2 = env->GetStringChars(property_name_jstr, &is_copy); - jsize property_name_len = env->GetStringLength(property_name_jstr); - - jsobject js_obj = Unwrap_JSObject(env, java_wrapper_obj); - java_obj = ToGlobalRef(env, java_obj); - - SetMemberMessage msg(pluginInstance, js_obj, property_name_ucs2, property_name_len, java_obj); - sendMessage(env, &msg); - - env->DeleteGlobalRef(java_obj); - env->ReleaseStringChars(property_name_jstr, property_name_ucs2); -} - -/* - * Class: netscape_javascript_JSObject - * Method: setSlot - * Signature: (ILjava/lang/Object;)V - */ - -class SetSlotMessage : public JavaMessage { - MRJPluginInstance* mPluginInstance; - jsobject mObject; - jint mSlot; - jobject mJavaObject; -public: - SetSlotMessage(MRJPluginInstance* pluginInstance, jsobject js_obj, jint slot, jobject java_obj) - : mPluginInstance(pluginInstance), mObject(js_obj), mSlot(slot), mJavaObject(java_obj) - { - } - - virtual void execute(JNIEnv* env) - { - MRJSecurityContext* securityContext = getSecurityContext(mPluginInstance); - nsILiveconnect* connection = getLiveconnectInstance(securityContext); - nsresult result = connection->SetSlot(env, mObject, mSlot, mJavaObject, 0, NULL, securityContext); - } -}; - -JNIEXPORT void JNICALL -Java_netscape_javascript_JSObject_setSlot(JNIEnv* env, - jobject java_wrapper_obj, - jint slot, - jobject java_obj) -{ - MRJPluginInstance* pluginInstance = GetCurrentInstance(env); - - if (pluginInstance == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal JNIEnv (can't find plugin)"); - return; - } - - jsobject js_obj = Unwrap_JSObject(env, java_wrapper_obj); - java_obj = ToGlobalRef(env, java_obj); - - SetSlotMessage msg(pluginInstance, js_obj, slot, java_obj); - sendMessage(env, &msg); - env->DeleteGlobalRef(java_obj); -} - -/* - * Class: netscape_javascript_JSObject - * Method: removeMember - * Signature: (Ljava/lang/String;)V - */ - -class RemoveMemberMessage : public JavaMessage { - MRJPluginInstance* mPluginInstance; - jsobject mObject; - const jchar* mPropertyName; - jsize mLength; -public: - RemoveMemberMessage(MRJPluginInstance* pluginInstance, jsobject obj, - const jchar* propertyName, jsize length) - : mPluginInstance(pluginInstance), mObject(obj), - mPropertyName(propertyName), mLength(length) - { - } - - virtual void execute(JNIEnv* env) - { - MRJSecurityContext* securityContext = getSecurityContext(mPluginInstance); - nsILiveconnect* connection = getLiveconnectInstance(securityContext); - nsresult result = connection->RemoveMember(env, mObject, mPropertyName, mLength, NULL, 0, securityContext); - } -}; - -JNIEXPORT void JNICALL -Java_netscape_javascript_JSObject_removeMember(JNIEnv* env, - jobject java_wrapper_obj, - jstring property_name_jstr) -{ - if (property_name_jstr == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal null member name"); - return; - } - - MRJPluginInstance* pluginInstance = GetCurrentInstance(env); - if (pluginInstance == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal JNIEnv (can't find plugin)"); - return; - } - - /* Get the Unicode string for the JS property name */ - jboolean is_copy; - const jchar* property_name_ucs2 = env->GetStringChars(property_name_jstr, &is_copy); - jsize property_name_len = env->GetStringLength(property_name_jstr); - - jsobject js_obj = Unwrap_JSObject(env, java_wrapper_obj); - RemoveMemberMessage msg(pluginInstance, js_obj, property_name_ucs2, property_name_len); - - sendMessage(env, &msg); - - env->ReleaseStringChars(property_name_jstr, property_name_ucs2); -} - -/* - * Class: netscape_javascript_JSObject - * Method: call - * Signature: (Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object; - */ -class CallMessage : public JavaMessage { - MRJPluginInstance* mPluginInstance; - jsobject mObject; - const jchar* mFunctionName; - jsize mLength; - jobjectArray mJavaArgs; - jobject* mJavaResult; -public: - CallMessage(MRJPluginInstance* pluginInstance, jsobject obj, const jchar* functionName, - jsize length, jobjectArray javaArgs, jobject* javaResult) - : mPluginInstance(pluginInstance), mObject(obj), mFunctionName(functionName), - mLength(length), mJavaArgs(javaArgs), mJavaResult(javaResult) - { - } - - virtual void execute(JNIEnv* env) - { - /* If we have an applet, try to create a codebase principle. */ - MRJSecurityContext* securityContext = getSecurityContext(mPluginInstance); - nsILiveconnect* connection = getLiveconnectInstance(securityContext); - jobject jresult = NULL; - nsresult result = connection->Call(env, mObject, mFunctionName, mLength, mJavaArgs, NULL, 0, securityContext, &jresult); - if (result == NS_OK) - *mJavaResult = ToGlobalRef(env, jresult); - } -}; - -JNIEXPORT jobject JNICALL -Java_netscape_javascript_JSObject_call(JNIEnv* env, jobject java_wrapper_obj, - jstring function_name_jstr, jobjectArray java_args) -{ - if (function_name_jstr == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal null function name"); - return NULL; - } - - /* Try to determine which plugin instance is responsible for this thread. This is done by checking class loaders. */ - MRJPluginInstance* pluginInstance = GetCurrentInstance(env); - if (pluginInstance == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal JNIEnv (can't find plugin)"); - return NULL; - } - - /* Get the Unicode string for the JS function name */ - jboolean is_copy; - const jchar* function_name_ucs2 = env->GetStringChars(function_name_jstr, &is_copy); - jsize function_name_len = env->GetStringLength(function_name_jstr); - - jsobject js_obj = Unwrap_JSObject(env, java_wrapper_obj); - jobject jresult = NULL; - - CallMessage msg(pluginInstance, js_obj, function_name_ucs2, function_name_len, java_args, &jresult); - sendMessage(env, &msg); - - env->ReleaseStringChars(function_name_jstr, function_name_ucs2); - - if (jresult != NULL) - jresult = ToLocalRef(env, jresult); - - return jresult; -} - -/* - * Class: netscape_javascript_JSObject - * Method: eval - * Signature: (Ljava/lang/String;)Ljava/lang/Object; - */ -class EvalMessage : public JavaMessage { - MRJPluginInstance* mPluginInstance; - jsobject mObject; - const jchar* mScript; - jsize mLength; - jobject* mJavaResult; -public: - EvalMessage(MRJPluginInstance* pluginInstance, jsobject obj, const jchar* script, jsize length, jobject* javaResult) - : mPluginInstance(pluginInstance), mObject(obj), mScript(script), mLength(length), mJavaResult(javaResult) - { - } - - virtual void execute(JNIEnv* env) - { - jobject jresult = NULL; - MRJSecurityContext* securityContext = getSecurityContext(mPluginInstance); - nsILiveconnect* connection = getLiveconnectInstance(securityContext); - nsresult result = connection->Eval(env, mObject, mScript, mLength, NULL, 0, securityContext, &jresult); - if (result == NS_OK && jresult != NULL) - *mJavaResult = ToGlobalRef(env, jresult); - } -}; - -JNIEXPORT jobject JNICALL -Java_netscape_javascript_JSObject_eval(JNIEnv* env, - jobject java_wrapper_obj, - jstring script_jstr) -{ - /* Get the Unicode string for the JS function name */ - if (script_jstr == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal null script string"); - return NULL; - } - jboolean is_copy; - const jchar* script_ucs2 = env->GetStringChars(script_jstr, &is_copy); - jsize script_len = env->GetStringLength(script_jstr); - - /* unwrap the JS object from the Java object. */ - jsobject js_obj = Unwrap_JSObject(env, java_wrapper_obj); - jobject jresult = NULL; - - /* determine the plugin instance so we can obtain its codebase. */ - // beard: should file a bug with Apple that JMJNIToAWTContext doesn't work. - MRJPluginInstance* pluginInstance = GetCurrentInstance(env); - if (pluginInstance == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal JNIEnv (can't find plugin)"); - return NULL; - } - - EvalMessage msg(pluginInstance, js_obj, script_ucs2, script_len, &jresult); - sendMessage(env, &msg); - - if (jresult != NULL) - jresult = ToLocalRef(env, jresult); - - env->ReleaseStringChars(script_jstr, script_ucs2); - - return jresult; -} - -/* - * Class: netscape_javascript_JSObject - * Method: toString - * Signature: ()Ljava/lang/String; - */ -class ToStringMessage : public JavaMessage { - MRJPluginInstance* mPluginInstance; - jsobject mObject; - jstring* mStringResult; -public: - ToStringMessage(MRJPluginInstance* pluginInstance, jsobject js_obj, jstring* stringResult) - : mPluginInstance(pluginInstance), mObject(js_obj), mStringResult(stringResult) - { - } - - virtual void execute(JNIEnv* env) - { - MRJSecurityContext* securityContext = getSecurityContext(mPluginInstance); - nsILiveconnect* connection = getLiveconnectInstance(securityContext); - jstring jresult = NULL; - nsresult status = connection->ToString(env, mObject, &jresult); - if (status == NS_OK && jresult != NULL) - *mStringResult = (jstring) ToGlobalRef(env, jresult); - } -}; - -JNIEXPORT jstring JNICALL -Java_netscape_javascript_JSObject_toString(JNIEnv* env, jobject java_wrapper_obj) -{ - /* unwrap the JS object from the Java object. */ - jstring jresult = NULL; - jsobject js_obj = Unwrap_JSObject(env, java_wrapper_obj); - - MRJPluginInstance* pluginInstance = GetCurrentInstance(env); - if (pluginInstance == NULL) { - env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal JNIEnv (can't find plugin)"); - return NULL; - } - - ToStringMessage msg(pluginInstance, js_obj, &jresult); - sendMessage(env, &msg); - - if (jresult != NULL) - jresult = (jstring) ToLocalRef(env, jresult); - - return jresult; -} - -/* - * Class: netscape_javascript_JSObject - * Method: getWindow - * Signature: (Ljava/applet/Applet;)Lnetscape/javascript/JSObject; - */ -class GetWindowMessage : public JavaMessage { - MRJPluginInstance* mPluginInstance; - jsobject* mWindowResult; -public: - GetWindowMessage(MRJPluginInstance* pluginInstance, jsobject* windowResult) - : mPluginInstance(pluginInstance), mWindowResult(windowResult) - { - } - - virtual void execute(JNIEnv* env) - { - MRJSecurityContext* securityContext = getSecurityContext(mPluginInstance); - nsILiveconnect* connection = getLiveconnectInstance(securityContext); - nsresult status = connection->GetWindow(env, mPluginInstance, NULL, 0, securityContext, mWindowResult); - } -}; - -JNIEXPORT jobject JNICALL -Java_netscape_javascript_JSObject_getWindow(JNIEnv* env, - jclass js_object_class, - jobject java_applet_obj) -{ - MRJPluginInstance* pluginInstance = GetCurrentInstance(env, java_applet_obj); - if (pluginInstance != NULL) { - jsobject jswindow = NULL; - GetWindowMessage msg(pluginInstance, &jswindow); - sendMessage(env, &msg); - - if (jswindow != NULL) - return Wrap_JSObject(env, jswindow); - } - return NULL; -} - -/* - * Class: netscape_javascript_JSObject - * Method: finalize - * Signature: ()V - */ -class FinalizeMessage : public JavaMessage { - jsobject m_jsobj; -public: - FinalizeMessage(jsobject jsobj) - : m_jsobj(jsobj) - { - } - - virtual void execute(JNIEnv* env) - { - nsresult result = theLiveConnectManager->FinalizeJSObject(env, m_jsobj); - } -}; - -JNIEXPORT void JNICALL -Java_netscape_javascript_JSObject_finalize(JNIEnv* env, jobject java_wrapper_obj) -{ - jsobject jsobj = Unwrap_JSObject(env, java_wrapper_obj); - - FinalizeMessage msg(jsobj); - sendMessage(env, &msg); -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/LiveConnectNativeMethods.h b/plugin/oji/MRJCarbon/plugin/Source/LiveConnectNativeMethods.h deleted file mode 100644 index 3bdac9295cbb..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/LiveConnectNativeMethods.h +++ /dev/null @@ -1,53 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - LiveConnectNativeMethods.h - */ - -#pragma once - -#include "nsError.h" - -#include "jni.h" - -class MRJPlugin; - -nsresult InitLiveConnectSupport(MRJPlugin* jvmPlugin); -nsresult ShutdownLiveConnectSupport(void); - -jobject Wrap_JSObject(JNIEnv* env, jint js_obj); -jint Unwrap_JSObject(JNIEnv* env, jobject java_wrapper_obj); diff --git a/plugin/oji/MRJCarbon/plugin/Source/LiveConnectProxy.java b/plugin/oji/MRJCarbon/plugin/Source/LiveConnectProxy.java deleted file mode 100644 index 2f60f47f197f..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/LiveConnectProxy.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -package netscape.oji; - -/** - * This class is designed simply to be loaded into each class loader created - * by the ProxyClassLoaderFactory, so that code from that protection domain - * will appear on the stack. - * @see netscape.oji.ProxyClassLoaderFactory - * @see netscape.oji.ProxyClassLoaderFactory.ProxyClassLoader - */ -public class LiveConnectProxy { - public static void run(Runnable r) { - r.run(); - } -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/LocalPort.h b/plugin/oji/MRJCarbon/plugin/Source/LocalPort.h deleted file mode 100644 index 4a2b5a77cf03..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/LocalPort.h +++ /dev/null @@ -1,72 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - LocalPort.h - - Simple utility class to put a Quickdraw GrafPort into a known state. - - by Patrick C. Beard. - */ - -#pragma once - -#include - -class LocalPort { -public: - LocalPort(GrafPtr port) - { - fPort = port; - fOrigin.h = fOrigin.v = 0; - } - - LocalPort(GrafPtr port, Point origin) - { - fPort = port; - fOrigin.h = origin.h; - fOrigin.v = origin.v; - } - - void Enter(); - void Exit(); - -private: - GrafPtr fPort; - Point fOrigin; - GrafPtr fOldPort; - Point fOldOrigin; -}; diff --git a/plugin/oji/MRJCarbon/plugin/Source/MRJConsole.cpp b/plugin/oji/MRJCarbon/plugin/Source/MRJConsole.cpp deleted file mode 100644 index e6f1011eeabd..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/MRJConsole.cpp +++ /dev/null @@ -1,419 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - MRJConsole.cpp - - Implements the JVM console interface. - - by Patrick C. Beard. - */ - -#include -#include - -#include - -#include "MRJConsole.h" -#include "MRJPlugin.h" -#include "MRJSession.h" -#include "TopLevelFrame.h" - -#include "nsIPluginManager2.h" - -extern nsIPluginManager2* thePluginManager2; - -MRJConsole* theConsole = NULL; - -const InterfaceInfo MRJConsole::sInterfaces[] = { - { NS_IJVMCONSOLE_IID, INTERFACE_OFFSET(MRJConsole, nsIJVMConsole) }, - { NS_IEVENTHANDLER_IID, INTERFACE_OFFSET(MRJConsole, nsIEventHandler) }, -}; -const UInt32 MRJConsole::kInterfaceCount = sizeof(sInterfaces) / sizeof(InterfaceInfo); - -MRJConsole::MRJConsole(MRJPlugin* plugin) - : SupportsMixin(this, sInterfaces, kInterfaceCount, (nsIPlugin*) plugin), - mPlugin(plugin), mSession(NULL), mIsInitialized(PR_FALSE), - mConsoleClass(NULL), mInitMethod(NULL), mDisposeMethod(NULL), - mShowMethod(NULL), mHideMethod(NULL), mVisibleMethod(NULL), mPrintMethod(NULL), mFinishMethod(NULL), - mResults(NULL), mContext(NULL), mFrame(NULL) -{ - // Initialize(); -} - -MRJConsole::~MRJConsole() -{ - theConsole = NULL; - - if (mSession != NULL) { - JNIEnv* env = mSession->getCurrentEnv(); - - if (mConsoleClass != NULL) { - if (mDisposeMethod != NULL) - env->CallStaticVoidMethod(mConsoleClass, mDisposeMethod); - env->DeleteGlobalRef(mConsoleClass); - mConsoleClass = NULL; - } - - if (mResults != NULL) { - env->DeleteGlobalRef(mResults); - mResults = NULL; - } - -#if !TARGET_CARBON - if (mContext != NULL) { - JMDisposeAWTContext(mContext); - mContext = NULL; - } -#endif - } -} - -NS_METHOD MRJConsole::QueryInterface(const nsIID& aIID, void** aInstancePtr) -{ - nsresult result = queryInterface(aIID, aInstancePtr); - if (result == NS_NOINTERFACE) - result = mPlugin->queryInterface(aIID, aInstancePtr); - return result; -} -nsrefcnt MRJConsole::AddRef() { return addRef(); } -nsrefcnt MRJConsole::Release() { return release(); } - -#pragma mark ***** MRJConsole ***** - -NS_METHOD MRJConsole::Show() -{ - Initialize(); - - if (mShowMethod != NULL) { - CallConsoleMethod(mShowMethod); - return NS_OK; - } - - return NS_ERROR_FAILURE; -} - -NS_METHOD MRJConsole::Hide() -{ - Initialize(); - - if (mHideMethod != NULL) { - CallConsoleMethod(mHideMethod); - return NS_OK; - } - - return NS_ERROR_FAILURE; -} - -NS_METHOD MRJConsole::IsVisible(PRBool* isVisible) -{ - // don't initialize here, because if we haven't been initialized, it can't be visible. - *isVisible = PR_FALSE; - if (mVisibleMethod != NULL) { - CallConsoleMethod(mVisibleMethod, mResults); - jboolean isCopy; - JNIEnv* env = mSession->getCurrentEnv(); - jboolean* elements = env->GetBooleanArrayElements(mResults, &isCopy); - *isVisible = elements[0]; - env->ReleaseBooleanArrayElements(mResults, elements, JNI_ABORT); - } - return NS_OK; -} - -// Prints a message to the Java console. The encodingName specifies the -// encoding of the message, and if NULL, specifies the default platform -// encoding. - -NS_METHOD MRJConsole::Print(const char* msg, const char* encodingName) -{ - Initialize(); - - if (mPrintMethod != NULL) { - JNIEnv* env = mSession->getCurrentEnv(); - jstring jmsg = env->NewStringUTF(msg); - jvalue args[1]; args[0].l = jmsg; -#if TARGET_CARBON - // just use JNI? -#else - JMExecJNIStaticMethodInContext(mContext, env, mConsoleClass, mPrintMethod, 1, args); -#endif - env->DeleteLocalRef(jmsg); - return NS_OK; - } - - return NS_ERROR_FAILURE; -} - -// Writes a message to the Java console immediately, in the current thread. - -void MRJConsole::write(const void *message, UInt32 messageLengthInBytes) -{ - if (mPrintMethod != NULL) { - char* buffer = new char[messageLengthInBytes + 1]; - if (buffer != NULL) { - memcpy(buffer, message, messageLengthInBytes); - buffer[messageLengthInBytes] = '\0'; - - JNIEnv* env = mSession->getCurrentEnv(); - jstring jmsg = env->NewStringUTF(buffer); - if (jmsg != NULL) { - env->CallStaticVoidMethod(mConsoleClass, mPrintMethod, jmsg); - env->DeleteLocalRef(jmsg); - } - - delete buffer; - } - } -} - -NS_METHOD MRJConsole::HandleEvent(nsPluginEvent* pluginEvent, PRBool* eventHandled) -{ - *eventHandled = PR_TRUE; - - if (pluginEvent != NULL) { - EventRecord* event = pluginEvent->event; - - if (event->what == nullEvent) { - // Give MRJ another quantum of time. - MRJSession* session = mPlugin->getSession(); - session->idle(kDefaultJMTime); - } else { - TopLevelFrame* frame = mFrame; - if (frame != NULL) { - switch (event->what) { - case nsPluginEventType_GetFocusEvent: - frame->focusEvent(true); - break; - - case nsPluginEventType_LoseFocusEvent: - frame->focusEvent(false); - break; - - case nsPluginEventType_AdjustCursorEvent: - frame->idle(event->modifiers); - break; - - case nsPluginEventType_MenuCommandEvent: - frame->menuSelected(event->message, event->modifiers); - break; - - default: - *eventHandled = frame->handleEvent(event); - break; - } - } - } - } - - return NS_OK; -} - -OSStatus MRJConsole::CallConsoleMethod(jmethodID method) -{ - JNIEnv* env = mSession->getCurrentEnv(); -#if TARGET_CARBON - // just call directly? - env->CallStaticVoidMethod(mConsoleClass, method); - return noErr; -#else - OSStatus status = JMExecJNIStaticMethodInContext(mContext, env, mConsoleClass, method, 0, NULL); - env->CallStaticVoidMethod(mConsoleClass, mFinishMethod); - return status; -#endif -} - -OSStatus MRJConsole::CallConsoleMethod(jmethodID method, jobject arg) -{ - JNIEnv* env = mSession->getCurrentEnv(); -#if TARGET_CARBON - // just call directly? - env->CallStaticVoidMethod(mConsoleClass, method, arg); - return noErr; -#else - jvalue args[1]; - args[0].l = arg; - OSStatus status = JMExecJNIStaticMethodInContext(mContext, env, mConsoleClass, method, 1, args); - env->CallStaticVoidMethod(mConsoleClass, mFinishMethod); - return status; -#endif -} - -#if !TARGET_CARBON - -static OSStatus requestFrame(JMAWTContextRef contextRef, JMFrameRef frameRef, JMFrameKind kind, - const Rect* initialBounds, Boolean resizeable, JMFrameCallbacks* cb) -{ - extern JMFrameCallbacks theFrameCallbacks; - // set up the viewer frame's callbacks. - BlockMoveData(&theFrameCallbacks, cb, sizeof(theFrameCallbacks)); - - MRJConsole* thisConsole = NULL; - OSStatus status = ::JMGetAWTContextData(contextRef, (JMClientData*)&thisConsole); - if (status == noErr && thePluginManager2 != NULL) { - // Can only do this safely if we are using the new API. - TopLevelFrame* frame = new TopLevelFrame(thisConsole, frameRef, kind, initialBounds, resizeable); - status = ::JMSetFrameData(frameRef, frame); - thisConsole->setFrame(frame); - } - return status; -} - -static OSStatus releaseFrame(JMAWTContextRef contextRef, JMFrameRef frameRef) -{ - MRJConsole* thisConsole = NULL; - OSStatus status = ::JMGetAWTContextData(contextRef, (JMClientData*)&thisConsole); - MRJFrame* thisFrame = NULL; - status = ::JMGetFrameData(frameRef, (JMClientData*)&thisFrame); - if (thisFrame != NULL) { - status = ::JMSetFrameData(frameRef, NULL); - thisConsole->setFrame(NULL); - delete thisFrame; - } - return status; -} - -static SInt16 getUniqueMenuID(JMAWTContextRef contextRef, Boolean isSubmenu) -{ - MRJConsole* thisConsole = NULL; - OSStatus status = ::JMGetAWTContextData(contextRef, (JMClientData*)&thisConsole); - if (thePluginManager2 != NULL) { - PRInt16 menuID; - if (thePluginManager2->AllocateMenuID(thisConsole, isSubmenu, &menuID) == NS_OK) - return menuID; - } - return -1; -} - -static Boolean appearanceManagerExists() -{ - long response = 0; - return (Gestalt(gestaltAppearanceAttr, &response) == noErr && (response & (1 << gestaltAppearanceExists))); -} - -static OSStatus JMTextToStr255(JMTextRef textRef, Str255 str) -{ - UInt32 length = 0; - OSStatus status = JMGetTextBytes(textRef, kTextEncodingMacRoman, &str[1], sizeof(Str255) - 1, &length); - if (status == noErr) - str[0] = (unsigned char)(status == noErr ? length : 0); - return status; -} - -inline int min(int x, int y) { return (x <= y ? x : y); } - -static void push(StringPtr dest, StringPtr str) -{ - int length = dest[0]; - int newLength = min(255, length + str[0]); - if (newLength > length) - ::BlockMoveData(&str[1], &dest[1] + length, newLength - length); -} - -static void exceptionOccurred(JMAWTContextRef context, JMTextRef exceptionName, JMTextRef exceptionMsg, JMTextRef stackTrace) -{ - // why not display this using the Appearance Manager's wizzy new alert? - if (appearanceManagerExists()) { - OSStatus status; - Str255 preason = { '\0' }, pmessage = { '\0'}, ptrace = { '\0' }; - if (exceptionName != NULL) { - status = ::JMTextToStr255(exceptionName, preason); - if (exceptionMsg != NULL) { - status = ::JMTextToStr255(exceptionMsg, pmessage); - push(preason, "\p ("); - push(preason, pmessage); - push(preason, "\p)"); - } - } - - if (stackTrace != NULL) - status = ::JMTextToStr255(stackTrace, ptrace); - - SInt16 itemHit = 0; - OSErr result = ::StandardAlert(kAlertPlainAlert, preason, ptrace, NULL, &itemHit); - } -} - -#endif - -void MRJConsole::Initialize() -{ - if (mIsInitialized) - return; - - mSession = mPlugin->getSession(); - JNIEnv* env = mSession->getCurrentEnv(); - - jclass consoleClass = env->FindClass("netscape/oji/MRJConsole"); - if (consoleClass == NULL) return; - mConsoleClass = (jclass) env->NewGlobalRef(consoleClass); - - mInitMethod = env->GetStaticMethodID(consoleClass, "init", "()V"); - mDisposeMethod = env->GetStaticMethodID(consoleClass, "dispose", "()V"); - mShowMethod = env->GetStaticMethodID(consoleClass, "show", "()V"); - mHideMethod = env->GetStaticMethodID(consoleClass, "hide", "()V"); - mVisibleMethod = env->GetStaticMethodID(consoleClass, "visible", "([Z)V"); - mPrintMethod = env->GetStaticMethodID(consoleClass, "print", "(Ljava/lang/String;)V"); - mFinishMethod = env->GetStaticMethodID(consoleClass, "finish", "()V"); - env->DeleteLocalRef(consoleClass); - - jbooleanArray results = env->NewBooleanArray(1); - mResults = (jbooleanArray) env->NewGlobalRef(results); - env->DeleteLocalRef(results); - - OSStatus status = noErr; - -#if !TARGET_CARBON - // Create an AWT context to work in. - JMAWTContextCallbacks callbacks = { - kJMVersion, /* should be set to kJMVersion */ - &requestFrame, /* a new frame is being created. */ - &releaseFrame, /* an existing frame is being destroyed. */ - &getUniqueMenuID, /* a new menu will be created with this id. */ - &exceptionOccurred, /* just some notification that some recent operation caused an exception. You can't do anything really from here. */ - }; - status = ::JMNewAWTContext(&mContext, mSession->getSessionRef(), &callbacks, this); -#endif - - // Finally, call the Java initialize method, and wait for it to complete. - - if (mInitMethod != NULL && status == noErr) - status = CallConsoleMethod(mInitMethod); - - mIsInitialized = (status == noErr); - - if (mIsInitialized) - theConsole = this; -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/MRJConsole.h b/plugin/oji/MRJCarbon/plugin/Source/MRJConsole.h deleted file mode 100644 index a94e604a1622..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/MRJConsole.h +++ /dev/null @@ -1,126 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - MRJConsole.h - - Implements the JVM console interface. - - by Patrick C. Beard. - */ - -#include "nsIJVMConsole.h" -#include "nsIEventHandler.h" -#include "SupportsMixin.h" - -#include "jni.h" - -class MRJPlugin; -class MRJSession; -class TopLevelFrame; - -class MRJConsole : public nsIJVMConsole, - public nsIEventHandler, - public SupportsMixin { -public: - MRJConsole(MRJPlugin* plugin); - virtual ~MRJConsole(); - - // NS_DECL_ISUPPORTS - // DECL_SUPPORTS_MIXIN - NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr); - NS_IMETHOD_(nsrefcnt) AddRef(void); - NS_IMETHOD_(nsrefcnt) Release(void); - - // nsIJVMConsole methods. - - NS_IMETHOD - Show(void); - - NS_IMETHOD - Hide(void); - - NS_IMETHOD - IsVisible(PRBool* isVisible); - - // Prints a message to the Java console. The encodingName specifies the - // encoding of the message, and if NULL, specifies the default platform - // encoding. - NS_IMETHOD - Print(const char* msg, const char* encodingName = NULL); - - NS_IMETHOD - HandleEvent(nsPluginEvent* event, PRBool* eventHandled); - - // Private implementation methods. - - void setFrame(TopLevelFrame* frame) { mFrame = frame; } - - void write(const void *message, UInt32 messageLengthInBytes); - -private: - // Private implementation methods. - OSStatus CallConsoleMethod(jmethodID method); - OSStatus CallConsoleMethod(jmethodID method, jobject arg); - - void Initialize(); - -private: - MRJPlugin* mPlugin; - MRJSession* mSession; - PRBool mIsInitialized; - - jclass mConsoleClass; - jmethodID mInitMethod; - jmethodID mDisposeMethod; - jmethodID mShowMethod; - jmethodID mHideMethod; - jmethodID mVisibleMethod; - jmethodID mPrintMethod; - jmethodID mFinishMethod; - - jbooleanArray mResults; - -#if !TARGET_CARBON - JMAWTContextRef mContext; -#endif - - TopLevelFrame* mFrame; - - // support for SupportsMixin. - static const InterfaceInfo sInterfaces[]; - static const UInt32 kInterfaceCount; -}; diff --git a/plugin/oji/MRJCarbon/plugin/Source/MRJConsole.java b/plugin/oji/MRJCarbon/plugin/Source/MRJConsole.java deleted file mode 100644 index 9bd725902b7d..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/MRJConsole.java +++ /dev/null @@ -1,241 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - MJRConsole.java - - Simple Java console for MRJ. - - All methods are called asynchronously, using JMExecJNIStaticMethodInContext(). After posting - each call this way, MRJConsole.finish() is called, which waits on MRJConsole.class. Each - public method calls MRJConsole.done(), which notifies. This should probably be changed - to a pure Java approach. - - by Patrick C. Beard. - */ - -package netscape.oji; - -import java.io.*; -import java.awt.*; -import java.awt.event.*; - -class ConsoleWindow extends Frame { - TextArea text; - - ConsoleWindow(String title) { - super("Java Console"); - - addWindowListener( - new WindowAdapter() { - public void windowClosing(WindowEvent e) { - hide(); - } - }); - - add(text = new TextArea()); - setSize(300, 200); - - ActionListener dumpThreadsListener = - new ActionListener() { - public void actionPerformed(ActionEvent e) { - dumpThreads(); - } - }; - - // Create a console menu. - MenuBar menuBar = new MenuBar(); - Menu consoleMenu = new Menu("Console"); - consoleMenu.add(newItem("Dump Threads", dumpThreadsListener)); - - menuBar.add(consoleMenu); - setMenuBar(menuBar); - } - - private MenuItem newItem(String title, ActionListener listener) { - MenuItem item = new MenuItem(title); - item.addActionListener(listener); - return item; - } - - public void dumpThreads() { - System.out.println("Dumping threads..."); - } -} - -public class MRJConsole { - // Save primordial System streams. - private static InputStream in; - private static PrintStream out; - private static PrintStream err; - private static ConsoleWindow window; - - native static int readLine(byte[] buffer, int offset, int length); - native static void writeLine(byte[] buffer, int offset, int length); - - private static class Input extends InputStream { - byte[] buffer = new byte[1024]; - int position = 0; - int count = 0; - - private void fillBuffer() throws EOFException { - // int length = readLine(buffer, 0, buffer.length); - int length = 1024; - if (length == -1) - throw new EOFException(); - count = length; - position = 0; - } - - public int read() throws IOException { - synchronized(this) { - if (position >= count) - fillBuffer(); - return buffer[position++]; - } - } - - public int read(byte[] b, int offset, int length) throws IOException { - synchronized(this) { - // only fill the buffer at the outset, always returns at most one line of data. - if (position >= count) - fillBuffer(); - int initialOffset = offset; - while (offset < length && position < count) { - b[offset++] = buffer[position++]; - } - return (offset - initialOffset); - } - } - } - - private static class Output extends OutputStream implements Runnable { - StringBuffer buffer = new StringBuffer(); - - public Output() { - Thread flusher = new Thread(this, getClass().getName() + "-Flusher"); - flusher.setDaemon(true); - flusher.start(); - } - - public synchronized void write(int b) throws IOException { - this.buffer.append((char)b); - notify(); - } - - public synchronized void write(byte[] buffer, int offset, int count) throws IOException { - this.buffer.append(new String(buffer, 0, offset, count)); - notify(); - } - - public synchronized void flush() throws IOException { - String value = this.buffer.toString(); - window.text.append(value); - this.buffer.setLength(0); - } - - /** - * When I/O occurs, it is placed in a StringBuffer, which is flushed in a different thread. - * This prevents deadlocks that could occur when the AWT itself is printing messages. - */ - public synchronized void run() { - for (;;) { - try { - wait(); - flush(); - } catch (InterruptedException ie) { - } catch (IOException ioe) { - } - } - } - } - - private static class Error extends Output {} - - public static void init() { - in = System.in; - out = System.out; - err = System.err; - - window = new ConsoleWindow("Java Console"); - - System.setIn(new Input()); - System.setOut(new PrintStream(new Output())); - System.setErr(new PrintStream(new Error())); - - done(); - } - - public static void dispose() { - System.setIn(in); - System.setOut(out); - System.setErr(err); - window.dispose(); - window = null; - done(); - } - - public static void show() { - window.show(); - done(); - } - - public static void hide() { - window.hide(); - done(); - } - - public static void visible(boolean[] result) { - result[0] = window.isVisible(); - done(); - } - - public static void print(String text) { - System.out.print(text); - done(); - } - - public static synchronized void finish() { - try { - MRJConsole.class.wait(); - } catch (InterruptedException ie) { - } - } - - private static synchronized void done() { - MRJConsole.class.notify(); - } -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/MRJContext.cp b/plugin/oji/MRJCarbon/plugin/Source/MRJContext.cp deleted file mode 100644 index 95891d56a6c0..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/MRJContext.cp +++ /dev/null @@ -1,2006 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -#include -#include -#include -#include -#include - -#if TARGET_CARBON -#include -#include -#include - -template -class cfref { - RefType mRef; -public: - cfref() : mRef(NULL) {} - cfref(RefType ref) : mRef(ref) {} - ~cfref() { if(mRef) ::CFRelease(mRef); } - - RefType operator=(RefType ref) - { - if (mRef && mRef != ref) - ::CFRelease(mRef); - return (mRef = ref); - } - - operator RefType() { return mRef; } - operator int() { return (mRef != NULL); } - -private: - // cfref(const cfref& other) {} -}; - -#endif - -#include "MRJSession.h" -#include "MRJContext.h" -#include "MRJPlugin.h" -#include "MRJPage.h" -#include "MRJMonitor.h" -#include "AsyncMessage.h" -#include "LocalPort.h" -#include "StringUtils.h" -#include "TimedMessage.h" -#if !TARGET_CARBON -#include "TopLevelFrame.h" -#include "EmbeddedFrame.h" -#endif - -#include "nsIPluginManager2.h" -#include "nsIPluginInstancePeer.h" -#include "nsIJVMPluginTagInfo.h" -#include "MRJSecurityContext.h" - -#include - -using namespace std; - -extern nsIPluginManager* thePluginManager; -extern nsIPluginManager2* thePluginManager2; - -static void blinkRgn(RgnHandle rgn); - -void LocalPort::Enter() -{ - ::GetPort(&fOldPort); - if (fPort != fOldPort) - ::SetPort(fPort); - Rect portRect; - GetPortBounds(fPort, &portRect); - fOldOrigin.h = portRect.left, fOldOrigin.v = portRect.top; - if (fOldOrigin.h != fOrigin.h || fOldOrigin.v != fOrigin.v) - ::SetOrigin(fOrigin.h, fOrigin.v); -} - -void LocalPort::Exit() -{ - if (fOldOrigin.h != fOrigin.h || fOldOrigin.v != fOrigin.v) - ::SetOrigin(fOldOrigin.h, fOldOrigin.v); - if (fOldPort != fPort) - ::SetPort(fOldPort); -} - -static RgnHandle NewEmptyRgn() -{ - RgnHandle region = ::NewRgn(); - if (region != NULL) ::SetEmptyRgn(region); - return region; -} - -MRJContext::MRJContext(MRJSession* session, MRJPluginInstance* instance) - : mPluginInstance(instance), mSession(session), mPeer(NULL), -#if !TARGET_CARBON - mLocator(NULL), mContext(NULL), mViewer(NULL), mViewerFrame(NULL), -#endif - mIsActive(false), mIsFocused(false), mIsVisible(false), - mPluginClipping(NULL), mPluginWindow(NULL), mPluginPort(NULL), - mDocumentBase(NULL), mAppletHTML(NULL), mPage(NULL), mSecurityContext(NULL) -#if TARGET_CARBON - , mAppletFrame(NULL), mAppletObject(NULL), mAppletControl(NULL), mScrollCounter(0) -#endif -{ - instance->GetPeer(&mPeer); - - // we cache attributes of the window, and periodically notice when they change. - mCachedOrigin.x = mCachedOrigin.y = -1; - ::SetRect((Rect*)&mCachedClipRect, 0, 0, 0, 0); - mPluginClipping =::NewEmptyRgn(); - mPluginPort = getEmptyPort(); -} - -MRJContext::~MRJContext() -{ -#if !TARGET_CARBON - if (mLocator != NULL) { - JMDisposeAppletLocator(mLocator); - mLocator = NULL; - } - - if (mViewer != NULL) { - ::JMDisposeAppletViewer(mViewer); - mViewer = NULL; - } - - // hack: see if this allows the applet viewer to terminate gracefully. - // Re-enable. Else if opened a new window thru Java and then quit browser, - // get "SP_WARN: Yow! Invalid canvas->visRgn:0000000" in 'MRJSubPorts' - // several times while applet viewer is closing - - for (int i = 0; i < 100; i++) - ::JMIdle(mSessionRef, kDefaultJMTime); - - if (mContext != NULL) { - // hack: release any frames that we still see in the AWT context, before tossing it. - releaseFrames(); - - ::JMDisposeAWTContext(mContext); - mContext = NULL; - } -#endif /* !TARGET_CARBON */ - - if (mPeer != NULL) { - mPeer->Release(); - mPeer = NULL; - } - - if (mPage != NULL) { - mPage->Release(); - mPage = NULL; - } - - if (mPluginClipping != NULL) { - ::DisposeRgn(mPluginClipping); - mPluginClipping = NULL; - } - - if (mDocumentBase != NULL) { - delete[] mDocumentBase; - mDocumentBase = NULL; - } - - if (mAppletHTML != NULL) { - delete[] mAppletHTML; - mAppletHTML = NULL; - } - - if (mSecurityContext != NULL) { - mSecurityContext->Release(); - mSecurityContext = NULL; - } - -#if TARGET_CARBON - if (mSession) { - JNIEnv* env = mSession->getCurrentEnv(); - if (mAppletObject != NULL) { - env->DeleteGlobalRef(mAppletObject); - mAppletObject = NULL; - } - if (mAppletControl != NULL) { - ::DisposeControl(mAppletControl); - mAppletControl = NULL; - } - if (mAppletFrame != NULL) { - OSStatus status; - - // disconnect callbacks. - status = ::RegisterStatusCallback(env, mAppletFrame, NULL, NULL); - status = ::RegisterShowDocumentCallback(env, mAppletFrame, NULL, NULL); - - // destroy the applet. - status = ::SetJavaAppletState(env, mAppletFrame, kAppletDestroy); - - // env->DeleteGlobalRef(mAppletFrame); - mAppletFrame = NULL; - } - } -#endif -} - -#if !TARGET_CARBON - -JMAWTContextRef MRJContext::getContextRef() -{ - return mContext; -} - -JMAppletViewerRef MRJContext::getViewerRef() -{ - return mViewer; -} - -#endif - -Boolean MRJContext::appletLoaded() -{ -#if TARGET_CARBON - return (mAppletFrame && mAppletControl); -#else - return (mViewer != NULL); -#endif -} - -static char* slashify(char* url) -{ - int len = ::strlen(url); - if (url[len - 1] != '/') { - char* newurl = new char[len + 2]; - ::strcpy(newurl, url); - newurl[len] = '/'; - newurl[len + 1] = '\0'; - delete[] url; - url = newurl; - } - return url; -} - -static bool isAppletAttribute(const char* name) -{ - // this table must be kept in alphabetical order. - static const char* kAppletAttributes[] = { - "ALIGN", "ALT", "ARCHIVE", - "CODE", "CODEBASE", - "HEIGHT", "HSPACE", - "MAYSCRIPT", "NAME", "OBJECT", - "VSPACE", "WIDTH" - }; - int length = sizeof(kAppletAttributes) / sizeof(char*); - int minIndex = 0, maxIndex = length - 1; - int index = maxIndex / 2; - while (minIndex <= maxIndex) { - int diff = strcasecmp(name, kAppletAttributes[index]); - if (diff < 0) { - maxIndex = (index - 1); - index = (minIndex + maxIndex) / 2; - } else if (diff > 0) { - minIndex = (index + 1); - index = (minIndex + maxIndex) / 2; - } else { - return true; - } - } - return false; -} - -static void addAttribute(string& attrs, const char* name, const char* value) -{ - attrs += " "; - attrs += name; - attrs += "=\""; - attrs += value; - attrs += "\""; -} - -static void addParameter(string& params, const char* name, const char* value) -{ - params += "\n"; -} - -static void addAttributes(nsIPluginTagInfo* tagInfo, string& attributes) -{ - PRUint16 count; - const char* const* names; - const char* const* values; - if (tagInfo->GetAttributes(count, names, values) == NS_OK) { - for (PRUint16 i = 0; i < count; ++i) - addAttribute(attributes, names[i], values[i]); - } -} - -static void addParameters(nsIPluginTagInfo2* tagInfo2, string& parameters) -{ - PRUint16 count; - const char* const* names; - const char* const* values; - if (tagInfo2->GetParameters(count, names, values) == NS_OK) { - for (PRUint16 i = 0; i < count; ++i) - addParameter(parameters, names[i], values[i]); - } -} - -static void addObjectAttributes(nsIPluginTagInfo* tagInfo, string& attributes) -{ - PRUint16 count; - const char* const* names; - const char* const* values; - const char kClassID[] = "classid"; - const char kJavaPrefix[] = "java:"; - const size_t kJavaPrefixSize = sizeof(kJavaPrefix) - 1; - if (tagInfo->GetAttributes(count, names, values) == NS_OK) { - for (PRUint16 i = 0; i < count; ++i) { - const char* name = names[i]; - const char* value = values[i]; - if (strcasecmp(name, "classid") == 0 && strncmp(value, kJavaPrefix, kJavaPrefixSize) == 0) - addAttribute(attributes, "code", value + kJavaPrefixSize); - else - addAttribute(attributes, name, value); - } - } -} - -static void addEmbedAttributes(nsIPluginTagInfo* tagInfo, string& attributes, string& parameters) -{ - PRUint16 count; - const char* const* names; - const char* const* values; - const char kJavaPluginAttributePrefix[] = "java_"; - const size_t kJavaPluginAttributePrefixSize = sizeof(kJavaPluginAttributePrefix) - 1; - if (tagInfo->GetAttributes(count, names, values) == NS_OK) { - for (PRUint16 i = 0; i < count; ++i) { - const char* name = names[i]; - const char* value = values[i]; - if (strncmp(name, kJavaPluginAttributePrefix, kJavaPluginAttributePrefixSize) == 0) - name += kJavaPluginAttributePrefixSize; - if (isAppletAttribute(name)) { - addAttribute(attributes, name, value); - } else { - // assume it's a parameter. - addParameter(parameters, name, value); - } - } - } -} - -static char* synthesizeAppletElement(nsIPluginTagInfo* tagInfo) -{ - // just synthesize an element out of whole cloth. - // this may be used because of the way the applet is being - // instantiated, or it may be used to work around bugs - // in the shipping browser. - string element("QueryInterface(NS_GET_IID(nsIPluginTagInfo2), (void**)&tagInfo2) == NS_OK) { - nsPluginTagType tagType = nsPluginTagType_Unknown; - if (tagInfo2->GetTagType(&tagType) == NS_OK) { - switch (tagType) { - case nsPluginTagType_Applet: - addAttributes(tagInfo2, attributes); - addParameters(tagInfo2, parameters); - break; - case nsPluginTagType_Object: - addObjectAttributes(tagInfo2, attributes); - addParameters(tagInfo2, parameters); - break; - case nsPluginTagType_Embed: - addEmbedAttributes(tagInfo2, attributes, parameters); - break; - } - } - NS_RELEASE(tagInfo2); - } else { - addEmbedAttributes(tagInfo, attributes, parameters); - } - - element += attributes; - element += ">\n"; - element += parameters; - element += "\n"; - - return ::strdup(element.c_str()); -} - -#if !TARGET_CARBON -static void fetchCompleted(JMAppletLocatorRef ref, JMLocatorErrors status) {} -#endif - -#if TARGET_CARBON - -inline CFMutableDictionaryRef createStringDictionary(PRUint16 capacity) -{ - return CFDictionaryCreateMutable(NULL, capacity, - &kCFTypeDictionaryKeyCallBacks, - &kCFTypeDictionaryValueCallBacks); -} - -static CFStringRef createUppercaseString(const char* cstr, CFStringEncoding encoding) -{ - CFMutableStringRef str = CFStringCreateMutable(NULL, strlen(cstr)); - if (str) { - CFStringAppendCString(str, cstr, encoding); - CFStringUppercase(str, NULL); - } - return str; -} - -static CFMutableDictionaryRef getAttributes(nsIPluginTagInfo* tagInfo) -{ - PRUint16 count; - const char* const* names; - const char* const* values; - if (tagInfo->GetAttributes(count, names, values) == NS_OK) { - CFMutableDictionaryRef attributes = createStringDictionary(count); - if (attributes != NULL) { - for (PRUint16 i = 0; i < count; ++i) { - cfref name = createUppercaseString(names[i], kCFStringEncodingUTF8); - cfref value = CFStringCreateWithCString(NULL, values[i], kCFStringEncodingUTF8); - if (name && value) - CFDictionaryAddValue(attributes, name, value); - } - return attributes; - } - } - return NULL; -} - -static CFMutableDictionaryRef getParameters(nsIPluginTagInfo2* tagInfo2) -{ - PRUint16 count; - const char* const* names; - const char* const* values; - if (tagInfo2->GetParameters(count, names, values) == NS_OK) { - CFMutableDictionaryRef parameters = createStringDictionary(count); - if (parameters) { - for (PRUint16 i = 0; i < count; ++i) { - cfref name = createUppercaseString(names[i], kCFStringEncodingUTF8); - cfref value = CFStringCreateWithCString(NULL, values[i], kCFStringEncodingUTF8); - if (name && value) - CFDictionaryAddValue(parameters, name, value); - } - return parameters; - } - } - return NULL; -} - -#endif - -void MRJContext::processAppletTag() -{ - // use the applet's HTML element to create a locator. this is required - // in general, to specify a separate CODEBASE. - - nsIPluginTagInfo* tagInfo = NULL; - if (mPeer->QueryInterface(NS_GET_IID(nsIPluginTagInfo), (void**)&tagInfo) == NS_OK) { - nsIPluginTagInfo2* tagInfo2 = NULL; - if (tagInfo->QueryInterface(NS_GET_IID(nsIPluginTagInfo2), (void**)&tagInfo2) == NS_OK) { - nsPluginTagType tagType = nsPluginTagType_Unknown; - if (tagInfo2->GetTagType(&tagType) == NS_OK) { - // get the URL of the HTML document containing the applet, and the - // fragment of HTML that defines this applet itself. - const char* documentBase = NULL; - if (tagInfo2->GetDocumentBase(&documentBase) == NS_OK) - setDocumentBase(documentBase); - const char* appletHTML = NULL; - if (tagInfo2->GetTagText(&appletHTML) == NS_OK) - setAppletHTML(appletHTML, tagType); - else - mAppletHTML = synthesizeAppletElement(tagInfo); - } - - // to support applet communication, put applets from the same document, codebase, and mayscript setting - // in the same page. - - // establish a page context for this applet to run in. - nsIJVMPluginTagInfo* jvmTagInfo = NULL; - if (mPeer->QueryInterface(NS_GET_IID(nsIJVMPluginTagInfo), (void**)&jvmTagInfo) == NS_OK) { - PRUint32 documentID; - const char* codeBase; - const char* archive; - PRBool mayScript; - if (tagInfo2->GetUniqueID(&documentID) != NS_OK) documentID = 0; - if (jvmTagInfo->GetCodeBase(&codeBase) != NS_OK || codeBase == NULL) codeBase = ""; - if (jvmTagInfo->GetArchive(&archive) != NS_OK || archive == NULL) archive = ""; - if (jvmTagInfo->GetMayScript(&mayScript) != NS_OK) mayScript = PR_FALSE; - MRJPageAttributes pageAttributes = { documentID, codeBase, archive, mayScript }; - mPage = findPage(pageAttributes); - NS_RELEASE(jvmTagInfo); - } - - NS_RELEASE(tagInfo2); - } else { - mAppletHTML = synthesizeAppletElement(tagInfo); - } - - NS_RELEASE(tagInfo); - } - - if (mDocumentBase != NULL && mAppletHTML != NULL) { - // example that works. - // const char* kBaseURL = "http://java.sun.com/applets/other/ImageLoop/index.html"; - // const char* kAppletHTML = "\n" - // "\n" - // "\n" - // "\n" - // ""; - -#if !TARGET_CARBON - static JMAppletLocatorCallbacks callbacks = { - kJMVersion, /* should be set to kJMVersion */ - &fetchCompleted, /* called when the html has been completely fetched */ - }; - OSStatus status; - JMTextRef urlRef = NULL, htmlRef = NULL; - - TextEncoding utf8 = CreateTextEncoding(kTextEncodingUnicodeDefault, kTextEncodingDefaultVariant, kUnicodeUTF8Format); - - status = ::JMNewTextRef(mSessionRef, &urlRef, utf8, mDocumentBase, strlen(mDocumentBase)); - if (status != noErr) goto done; - - status = ::JMNewTextRef(mSessionRef, &htmlRef, utf8, mAppletHTML, strlen(mAppletHTML)); - if (status != noErr) goto done; - - status = ::JMNewAppletLocator(&mLocator, mSessionRef, &callbacks, - urlRef, htmlRef, JMClientData(this)); - - done: - if (urlRef != NULL) - ::JMDisposeTextRef(urlRef); - if (htmlRef != NULL) - ::JMDisposeTextRef(htmlRef); -#endif /* !TARGET_CARBON */ - - } -} - -#if !TARGET_CARBON -static MRJFrame* getFrame(JMFrameRef ref) -{ - MRJFrame* frame = NULL; - - if (ref != NULL) - ::JMGetFrameData(ref, (JMClientData*)&frame); - - return frame; -} -#endif - -Boolean MRJContext::createContext() -{ - return true; -} - - - -/* - FIXME: this code should really be called from a true browser thread, so should put message in a queue, and let - idle time processing handle it. Otherwise, the browser will get very confused. - */ - -static nsresult getURL(nsISupports* peer, const char* url, const char* target) -{ - nsresult result = NS_OK; - if (thePluginManager != NULL) { - result = thePluginManager->GetURL(peer, url, target); - } - return result; -} - -void AsyncMessage::send(Boolean async) -{ - // submit the message, and wait for the message to be executed asynchronously. - mSession->sendMessage(this, async); -} - -class GetURLMessage : public AsyncMessage { - MRJPluginInstance* mPluginInstance; - char* mURL; - char* mTarget; -public: - GetURLMessage(MRJPluginInstance* pluginInstance, const char* url, const char* target); - ~GetURLMessage(); - - virtual void execute(); -}; - -GetURLMessage::GetURLMessage(MRJPluginInstance* pluginInstance, const char* url, const char* target) - : AsyncMessage(pluginInstance->getSession()), - mPluginInstance(pluginInstance), mURL(::strdup(url)), mTarget(::strdup(target)) -{ - NS_ADDREF(mPluginInstance); -} - -GetURLMessage::~GetURLMessage() -{ - if (mURL != NULL) - delete[] mURL; - if (mTarget != NULL) - delete[] mTarget; - - NS_RELEASE(mPluginInstance); -} - -void GetURLMessage::execute() -{ - // get the URL. - nsIPluginInstance* pluginInstance = mPluginInstance; - nsresult result = thePluginManager->GetURL(pluginInstance, mURL, mTarget); - delete this; -} - -void MRJContext::showURL(const char* url, const char* target) -{ - if (thePluginManager != NULL) { -#if 0 - GetURLMessage* message = new GetURLMessage(mPluginInstance, url, target); - message->send(true); -#else - nsIPluginInstance* pluginInstance = mPluginInstance; - thePluginManager->GetURL(pluginInstance, url, target); -#endif - } -} - -#if !TARGET_CARBON -static SInt16 nextMenuId = 20000; -static SInt16 nextMenuPopupId = 200; - -SInt16 MRJContext::allocateMenuID(Boolean isSubmenu) -{ - // FIXME: can use more centralized approach to managing menu IDs which can be shared across all contexts. - if (thePluginManager2 != NULL) { - PRInt16 menuID = -1; - nsIEventHandler* eventHandler = mPluginInstance; - thePluginManager2->AllocateMenuID(eventHandler, isSubmenu, &menuID); - return menuID; - } else - return (isSubmenu ? nextMenuPopupId++ : nextMenuId++); -} - -OSStatus MRJContext::createFrame(JMFrameRef frameRef, JMFrameKind kind, const Rect* initialBounds, Boolean resizeable) -{ - OSStatus status = memFullErr; - MRJFrame* frame = NULL; - - // The first frame created will always be for the applet viewer. - if (mViewerFrame == NULL) { - // bind this newly created frame to this context, and vice versa. - mViewerFrame = frameRef; - frame = new AppletViewerFrame(frameRef, this); - - // make sure the frame's clipping is up-to-date. - synchronizeClipping(); - } else if (thePluginManager2 != NULL) { - // Can only do this safely if we are using the new API. - frame = new TopLevelFrame(mPluginInstance, frameRef, kind, initialBounds, resizeable); - } else { - // Try to create a frame that lives in a newly created browser window. - frame = new EmbeddedFrame(mPluginInstance, frameRef, kind, initialBounds, resizeable); - } - - if (frame != NULL) - status = ::JMSetFrameData(frameRef, frame); - - return status; -} - -void MRJContext::setProxyInfoForURL(char * url, JMProxyType proxyType) -{ - /* - * We then call 'nsIPluginManager2::FindProxyForURL' which will return - * proxy information which we can parse and set via JMSetProxyInfo. - */ - char* proxy = NULL; - nsresult rv = thePluginManager2->FindProxyForURL(url, &proxy); - if (NS_SUCCEEDED(rv) && proxy != NULL) { - /* See if a proxy was specified */ - if (strcmp("DIRECT", proxy) != 0) { - JMProxyInfo proxyInfo; - proxyInfo.useProxy = true; - char* space = strchr(proxy, ' '); - if (space != NULL) { - char* host = space + 1; - char* colon = ::strchr(host, ':'); - int length = (colon - host); - if (length < sizeof(proxyInfo.proxyHost)) { - strncpy(proxyInfo.proxyHost, host, length); - proxyInfo.proxyPort = atoi(colon + 1); - ::JMSetProxyInfo(mSessionRef, proxyType, &proxyInfo); - } - } - } - - delete[] proxy; - } -} - -#endif /* !TARGET_CARBON */ - -#if TARGET_CARBON - -void* TimedMessage::operator new(size_t n) -{ - return (void*) NewPtr(n); -} - -void TimedMessage::operator delete(void* ptr) -{ - DisposePtr(Ptr(ptr)); -} - -TimedMessage::TimedMessage() - : mTimerUPP(NULL) -{ - mTimerUPP = NewEventLoopTimerUPP(TimedMessageHandler); -} - -TimedMessage::~TimedMessage() -{ - if (mTimerUPP) ::DisposeEventLoopTimerUPP(mTimerUPP); -} - -OSStatus TimedMessage::send() -{ - EventLoopTimerRef timerRef; - return ::InstallEventLoopTimer(::GetMainEventLoop(), 0, 0, - mTimerUPP, this, &timerRef); -} - -pascal void TimedMessage::TimedMessageHandler(EventLoopTimerRef inTimer, void *inUserData) -{ - // prevent this timer from ever firing again. - RemoveEventLoopTimer(inTimer); - TimedMessage* message = reinterpret_cast(inUserData); - message->execute(); - delete message; -} - -static char* getCString(CFStringRef stringRef) -{ - // worst case length scenario would encode every character - CFIndex len = (1 + ::CFStringGetLength(stringRef)) * 3; - char* result = new char[len]; - if (result) - CFStringGetCString(stringRef, result, len, kCFStringEncodingUTF8); - return result; -} - -class SetStatusMessage : public TimedMessage { - nsIPluginInstance* mPluginInstance; - CFStringRef mStatus; - -public: - SetStatusMessage(nsIPluginInstance* pluginInstance, CFStringRef statusString) - : mPluginInstance(pluginInstance), mStatus(statusString) - { - NS_ADDREF(mPluginInstance); - ::CFRetain(mStatus); - } - - ~SetStatusMessage() - { - ::CFRelease(mStatus); - NS_RELEASE(mPluginInstance); - } - - virtual void execute(); -}; - -void SetStatusMessage::execute() -{ - char* status = getCString(mStatus); - if (status) { - nsIPluginInstancePeer* peer; - mPluginInstance->GetPeer(&peer); - if (peer) { - peer->ShowStatus(status); - NS_RELEASE(peer); - } - delete[] status; - } -} - -static void setStatusCallback(jobject applet, CFStringRef statusMessage, void *inUserData) -{ - // use a timer on the main event loop to handle this? - MRJContext* context = reinterpret_cast(inUserData); - SetStatusMessage* message = new SetStatusMessage(context->getInstance(), statusMessage); - if (message) { - OSStatus status = message->send(); - if (status != noErr) delete message; - } -} - -class ShowDocumentMessage : public TimedMessage { - MRJPluginInstance* mPluginInstance; - CFURLRef mURL; - CFStringRef mWindowName; - -public: - ShowDocumentMessage(MRJPluginInstance* pluginInstance, CFURLRef url, CFStringRef windowName) - : mPluginInstance(pluginInstance), mURL(url), mWindowName(windowName) - { - NS_ADDREF(mPluginInstance); - ::CFRetain(mURL); - ::CFRetain(mWindowName); - } - - ~ShowDocumentMessage() - { - ::CFRelease(mWindowName); - ::CFRelease(mURL); - NS_RELEASE(mPluginInstance); - } - - virtual void execute(); -}; - -static OSErr FSpGetFullPath(const FSSpec *spec, short *fullPathLength, Handle *fullPath) -{ - OSErr result; - OSErr realResult; - FSSpec tempSpec; - CInfoPBRec pb; - - *fullPathLength = 0; - *fullPath = NULL; - - // Default to noErr - realResult = noErr; - - /* Make a copy of the input FSSpec that can be modified */ - BlockMoveData(spec, &tempSpec, sizeof(FSSpec)); - - if ( tempSpec.parID == fsRtParID ) - { - /* The object is a volume */ - - /* Add a colon to make it a full pathname */ - ++tempSpec.name[0]; - tempSpec.name[tempSpec.name[0]] = ':'; - - /* We're done */ - result = PtrToHand(&tempSpec.name[1], fullPath, tempSpec.name[0]); - } - else - { - /* The object isn't a volume */ - - /* Is the object a file or a directory? */ - pb.dirInfo.ioNamePtr = tempSpec.name; - pb.dirInfo.ioVRefNum = tempSpec.vRefNum; - pb.dirInfo.ioDrDirID = tempSpec.parID; - pb.dirInfo.ioFDirIndex = 0; - result = PBGetCatInfoSync(&pb); - // Allow file/directory name at end of path to not exist. - realResult = result; - if ( (result == noErr) || (result == fnfErr) ) - { - /* if the object is a directory, append a colon so full pathname ends with colon */ - if ( (result == noErr) && (pb.hFileInfo.ioFlAttrib & ioDirMask) != 0 ) - { - ++tempSpec.name[0]; - tempSpec.name[tempSpec.name[0]] = ':'; - } - - /* Put the object name in first */ - result = PtrToHand(&tempSpec.name[1], fullPath, tempSpec.name[0]); - if ( result == noErr ) - { - /* Get the ancestor directory names */ - pb.dirInfo.ioNamePtr = tempSpec.name; - pb.dirInfo.ioVRefNum = tempSpec.vRefNum; - pb.dirInfo.ioDrParID = tempSpec.parID; - do /* loop until we have an error or find the root directory */ - { - pb.dirInfo.ioFDirIndex = -1; - pb.dirInfo.ioDrDirID = pb.dirInfo.ioDrParID; - result = PBGetCatInfoSync(&pb); - if ( result == noErr ) - { - /* Append colon to directory name */ - ++tempSpec.name[0]; - tempSpec.name[tempSpec.name[0]] = ':'; - - /* Add directory name to beginning of fullPath */ - (void) Munger(*fullPath, 0, NULL, 0, &tempSpec.name[1], tempSpec.name[0]); - result = MemError(); - } - } while ( (result == noErr) && (pb.dirInfo.ioDrDirID != fsRtDirID) ); - } - } - } - if ( result == noErr ) - { - /* Return the length */ - *fullPathLength = GetHandleSize(*fullPath); - result = realResult; // return realResult in case it was fnfErr - } - else - { - /* Dispose of the handle and return NULL and zero length */ - if ( *fullPath != NULL ) - { - DisposeHandle(*fullPath); - } - *fullPath = NULL; - *fullPathLength = 0; - } - - return ( result ); -} - -void ShowDocumentMessage::execute() -{ - // guard against the plugin instance already having been destroyed. - if (mPluginInstance->getContext() == NULL) { - return; - } - - char* url = NULL; - char* target = NULL; - - CFStringRef urlRef = ::CFURLGetString(mURL); - if (urlRef) { - if (::CFStringHasPrefix(urlRef, CFSTR("file:"))) { - // work around for bug #108519, convert to HFS+ file system path. - // question: why can't CFURLGetFSRef be used to extract the FSRef - // directly from the FSRef provided? I believe it's in the wrong - // format, file:/path/to/document.html - // 1. convert URL to an FSRef. - FSRef fileRef; - UInt8* urlBytes = (UInt8*) getCString(urlRef); - ::CFRelease(urlRef); - if (urlBytes && ::FSPathMakeRef(urlBytes + 5, &fileRef, NULL) == noErr) { - delete[] urlBytes; - // 2. convert FSRef to FSSpec. - FSSpec fileSpec; - if (::FSGetCatalogInfo(&fileRef, kFSCatInfoNone, NULL, NULL, &fileSpec, NULL) == noErr) { - // 3. Generate the full HFS+ path from the FSSpec. - Handle fullPath; - short fullPathLength; - if (::FSpGetFullPath(&fileSpec, &fullPathLength, &fullPath) == noErr) { - // 4. Prefix the HFS+ path with "file:///", convert ':' to '/'. - const char prefix[] = { "file:///" }; - const size_t prefixLength = sizeof(prefix) - 1; - size_t urlLength = fullPathLength + prefixLength; - url = new char[1 + urlLength]; - if (url) { - memcpy(url, prefix, prefixLength); - memcpy(url + prefixLength, *fullPath, fullPathLength); - ::DisposeHandle(fullPath); - url[urlLength] = '\0'; - char* colon = strchr(url + prefixLength, ':'); - while (colon) { - *colon = '/'; - colon = strchr(colon + 1, ':'); - } - } - } - } - } - } else { - url = getCString(urlRef); - ::CFRelease(urlRef); - } - } - - target = getCString(mWindowName); - - if (url && target) - thePluginManager->GetURL((nsIPluginInstance*)mPluginInstance, url, target); - - delete[] url; - delete[] target; -} - -static void showDocumentCallback(jobject applet, CFURLRef url, CFStringRef windowName, void *inUserData) -{ - // workaround for bug #108054, sometimes url parameter is NULL. - if (url) { - // use a timer on the main event loop to handle this? - MRJContext* context = reinterpret_cast(inUserData); - ShowDocumentMessage* message = new ShowDocumentMessage((MRJPluginInstance*)context->getInstance(), url, windowName); - if (message) { - OSStatus status = message->send(); - if (status != noErr) delete message; - } - } -} - -static void fixAttributes(CFMutableDictionaryRef attributes, nsIPluginTagInfo* tagInfo, nsPluginWindow* window) -{ - // check for WIDTH & HEIGHT attributes that end with % or *, and replace those with the physical values. - const char* width; - if (tagInfo->GetAttribute("WIDTH", &width) == NS_OK) { - if (strpbrk(width, "%*")) { - cfref actualWidth = CFStringCreateWithFormat(NULL, NULL, CFSTR("%d"), window->width); - CFDictionaryReplaceValue(attributes, CFSTR("WIDTH"), actualWidth); - } - } - - const char* height; - if (tagInfo->GetAttribute("HEIGHT", &height) == NS_OK) { - if (strpbrk(height, "%*")) { - cfref actualHeight = CFStringCreateWithFormat(NULL, NULL, CFSTR("%d"), window->height); - CFDictionaryReplaceValue(attributes, CFSTR("HEIGHT"), actualHeight); - } - } -} - -#endif /* TARGET_CARBON */ - -Boolean MRJContext::loadApplet() -{ - OSStatus status = noErr; - -#if TARGET_CARBON - // Use whizzy new JavaEmbedding APIs to construct an AppletDescriptor. - - // gather all attributes and parameters. - cfref attributes, parameters; - nsIPluginTagInfo2* tagInfo2 = NULL; - if (mPeer->QueryInterface(NS_GET_IID(nsIPluginTagInfo2), (void**)&tagInfo2) == NS_OK) { - attributes = getAttributes(tagInfo2); - fixAttributes(attributes, tagInfo2, mPluginWindow); - parameters = getParameters(tagInfo2); - NS_RELEASE(tagInfo2); - } - - cfref documentBase; - if (!TARGET_RT_MAC_MACHO && ::strncmp(mDocumentBase, "file:", 5) == 0) { - // file: URLs. Need to create the URL from HFS+ style using CFURLCreateWithFileSystemPath. - // this is to workaround the same problem in bug #108519, Mozilla uses HFS+ paths that are - // simply converted to '/' delimited URLs. The mach-o build won't have this problem, so - // we'll need to detect that build somehow. - char* path = mDocumentBase + 5; - while (*path == '/') ++path; - path = strdup(path); - if (path) { - // convert '/' to ':' characters. - char* slash = strchr(path + 1, '/'); - while (slash) { - *slash = ':'; - slash = strchr(slash + 1, '/'); - } - cfref pathRef = CFStringCreateWithCString(NULL, path, kCFStringEncodingUTF8); - delete[] path; - if (pathRef) { - // unescape the path in case there are spaces in it - cfref unescPathRef = CFURLCreateStringByReplacingPercentEscapes(NULL, pathRef, CFSTR("")); - if (unescPathRef) - documentBase = CFURLCreateWithFileSystemPath(NULL, unescPathRef, kCFURLHFSPathStyle, false); - } - } - } else { - documentBase = CFURLCreateWithBytes(NULL, (const UInt8*)mDocumentBase, - strlen(mDocumentBase), kCFStringEncodingUTF8, NULL); - } - - if (attributes && parameters && documentBase) { - AppletDescriptor desc = { - documentBase, - NULL, - attributes, - parameters, - }; - JNIEnv* env = mSession->getCurrentEnv(); - status = ::CreateJavaApplet(env, desc, false, kUniqueArena, &mAppletFrame); - if (status == noErr) { - // install status/document callbacks. - status = ::RegisterStatusCallback(env, mAppletFrame, &setStatusCallback, this); - status = ::RegisterShowDocumentCallback(env, mAppletFrame, &showDocumentCallback, this); - - // wrap applet in a control. - Rect bounds = { 0, 0, 100, 100 }; - status = ::CreateJavaControl(env, GetWindowFromPort(mPluginPort), &bounds, mAppletFrame, true, &mAppletControl); - if (status == noErr) { - status = ::SetJavaAppletState(env, mAppletFrame, kAppletStart); - } - } - } -#else - static JMAppletSecurity security = { - kJMVersion, /* should be set to kJMVersion */ - eAppletHostAccess, /* can this applet access network resources */ - eLocalAppletAccess, /* can this applet access network resources */ - true, /* restrict access to system packages (com.apple.*, sun.*, netscape.*) also found in the property "mrj.security.system.access" */ - true, /* restrict classes from loading system packages (com.apple.*, sun.*, netscape.*) also found in the property "mrj.security.system.define" */ - true, /* restrict access to application packages found in the property "mrj.security.application.access" */ - true, /* restrict access to application packages found in the property "mrj.security.application.access" */ - }; - static JMAppletViewerCallbacks callbacks = { - kJMVersion, /* should be set to kJMVersion */ - &showDocument, /* go to a url, optionally in a new window */ - &setStatusMessage, /* applet changed status message */ - }; - - /* Added by Mark: */ - /* - * Set proxy info - * It is only set if the new enhanced Plugin Manager exists. - */ - if (thePluginManager2 != NULL) { - /* Sample URL's to use for getting the HTTP proxy and FTP proxy */ - setProxyInfoForURL("http://www.mozilla.org/", eHTTPProxy); - setProxyInfoForURL("ftp://ftp.mozilla.org/", eFTPProxy); - } - /* End set proxy info code */ - - status = ::JMNewAppletViewer(&mViewer, mContext, mLocator, 0, - &security, &callbacks, this); - if (status == noErr) { - status = ::JMSetAppletViewerData(mViewer, JMClientData(this)); - status = ::JMReloadApplet(mViewer); - } - - if (status == noErr) { - // for grins, force the applet to load right away, so we can report any error we might encounter eagerly. - // jobject appletObject = getApplet(); - } -#endif - - return (status == noErr); -} - -void MRJContext::suspendApplet() -{ -#if !TARGET_CARBON - if (mViewer != NULL) - ::JMSuspendApplet(mViewer); -#endif -} - -void MRJContext::resumeApplet() -{ -#if !TARGET_CARBON - if (mViewer != NULL) - ::JMResumeApplet(mViewer); -#endif -} - -static const char* getAttribute(nsIPluginInstancePeer* peer, const char* name) -{ - const char* value = NULL; - nsIPluginTagInfo* tagInfo = NULL; - if (NS_SUCCEEDED(peer->QueryInterface(NS_GET_IID(nsIPluginTagInfo), (void**)&tagInfo))) { - tagInfo->GetAttribute(name, &value); - NS_RELEASE(tagInfo); - } - return value; -} - -jobject MRJContext::getApplet() -{ -#if TARGET_CARBON - if (appletLoaded() && mAppletObject == NULL) { - // mAppletFrame is an instance of javap com.apple.mrj.JavaEmbedding.JE_AppletViewer, as of Mac OS X 10.1. - // In Mac OS X 10.1, it implemented the java.applet.AppletContext interface, but this is no longer true - // in Mac OS X 10.2 (Jaguar). However both versions of JE_AppletViewer have a public field panel, which - // is an instance of com.apple.mrj.JavaEmbedding.JE_AppletViewerPanel, which extends sun.applet.AppletPanel, - // which contains the method public java.applet.Applet getApplet(). Apple needs to provide us with an API - // that we can use, but for now this is the best that we can do. - JNIEnv* env = mSession->getCurrentEnv(); - jclass frameClass = env->GetObjectClass(mAppletFrame); - if (frameClass) { - jfieldID panelID = env->GetFieldID(frameClass, "panel", "Lcom/apple/mrj/JavaEmbedding/JE_AppletViewerPanel;"); - if (panelID) { - jobject appletPanel = env->GetObjectField(mAppletFrame, panelID); - if (appletPanel) { - jclass panelClass = env->GetObjectClass(appletPanel); - jmethodID getAppletMethod = env->GetMethodID(panelClass, "getApplet", "()Ljava/applet/Applet;"); - if (getAppletMethod) { - jobject applet = env->CallObjectMethod(appletPanel, getAppletMethod); - if (applet) { - mAppletObject = env->NewGlobalRef(applet); - env->DeleteLocalRef(applet); - } - } else { - env->ExceptionClear(); - } - env->DeleteLocalRef(panelClass); - env->DeleteLocalRef(appletPanel); - } else { - env->ExceptionClear(); - } - } else { - env->ExceptionClear(); - } - env->DeleteLocalRef(frameClass); - } else { - env->ExceptionClear(); - } - } - return mAppletObject; -#else - if (appletLoaded() && &::JMGetAppletJNIObject != NULL) { - JNIEnv* env = ::JMGetCurrentEnv(mSessionRef); - jobject appletObject = ::JMGetAppletJNIObject(mViewer, env); - if (appletObject == NULL) { - // Give MRJ some time to try to comply. 100 calls to JMIdle should be enough. - // 10 seconds should be enough. Could ask the user... - UInt32 deadline = ::TickCount() + 600; - while (appletObject == NULL && ::TickCount() < deadline) { - mSession->idle(kDefaultJMTime); - appletObject = ::JMGetAppletJNIObject(mViewer, env); - } - if (appletObject == NULL) { - // assume the applet's hosed. - ::JMDisposeAppletViewer(mViewer); - mViewer = NULL; - // Let the user know the applet failed to load. - if (appearanceManagerExists()) { - SInt16 itemHit = 0; - Str255 appletURL = { "\pUnknown APPLET URL" }; - if (mDocumentBase != NULL) { - appletURL[0] = ::strlen(mDocumentBase); - ::BlockMoveData(mDocumentBase, appletURL + 1, mDocumentBase[0]); - } - ::StandardAlert(kAlertPlainAlert, "\pApplet failed to load from URL:", appletURL, NULL, &itemHit); - } - } - } - return appletObject; - } -#endif -} - -nsIPluginInstance* MRJContext::getInstance() -{ - return mPluginInstance; -} - -nsIPluginInstancePeer* MRJContext::getPeer() -{ - return mPeer; -} - -/** - * At various times during development, it is useful to see what bits are supposed to be drawn by - * the applet. Defining DEBUG_CLIPPING as 1 turns on this behavior. - */ -#define DEBUG_CLIPPING 0 - -void MRJContext::drawApplet() -{ -#if TARGET_CARBON - // ??? It's a control. Draw it with Draw1Control? - JNIEnv* env = mSession->getCurrentEnv(); - OSStatus status = ::DrawJavaControl(env, mAppletControl); -#else - // We assume the proper coordinate system for the frame has - // already been set up. - if (appletLoaded()) { -#if DEBUG_CLIPPING - nsPluginPort* npPort = (nsPluginPort*) mCache.window; - GrafPtr framePort = GrafPtr(npPort->port); - RgnHandle oldClip = NewRgn(); - if (oldClip != NULL) { - CopyRgn(framePort->clipRgn, oldClip); - SetClip(mPluginClipping); - InvertRgn(mPluginClipping); - SetClip(oldClip); - DisposeRgn(oldClip); - } -#endif - - // ::JMFrameUpdate(mViewerFrame, framePort->visRgn); - // OSStatus status = ::JMFrameUpdate(mViewerFrame, framePort->clipRgn); - OSStatus status = ::JMFrameUpdate(mViewerFrame, mPluginClipping); - } -#endif /* !TARGET_CARBON */ -} - -void MRJContext::printApplet(nsPluginWindow* printingWindow) -{ -#if TARGET_CARBON -#else - jobject frameObject = NULL; - jclass utilsClass = NULL; - OSStatus status = noErr; - JNIEnv* env = ::JMGetCurrentEnv(mSessionRef); - - // put the printing port into window coordinates: (0, 0) in upper left corner. - GrafPtr printingPort = GrafPtr(printingWindow->window->port); - LocalPort localPort(printingPort); - localPort.Enter(); - ::ClipRect((Rect*)&printingWindow->clipRect); - - do { - // try to use the printing API, if that fails, fall back on netscape.oji.AWTUtils.printContainer(). - if (&::JMDrawFrameInPort != NULL) { - Point frameOrigin = { printingWindow->y, printingWindow->x }; - status = ::JMDrawFrameInPort(mViewerFrame, printingPort, frameOrigin, printingPort->clipRgn, false); - if (status == noErr) break; - } - - // get the frame object to print. - frameObject = ::JMGetAWTFrameJNIObject(mViewerFrame, env); - if (frameObject == NULL) break; - - // call the print methods of the applet viewer's frame. - jclass utilsClass = env->FindClass("netscape/oji/AWTUtils"); - if (utilsClass == NULL) break; - jmethodID printContainerMethod = env->GetStaticMethodID(utilsClass, "printContainer", "(Ljava/awt/Container;IIILjava/lang/Object;)V"); - if (printContainerMethod == NULL) break; - - // create a monitor to synchronize with. - MRJMonitor notifier(mSession); - - // start the asynchronous print call. - jvalue args[5]; - args[0].l = frameObject; - args[1].i = jint(printingPort); - args[2].i = jint(printingWindow->x); - args[3].i = jint(printingWindow->y); - args[4].l = notifier.getObject(); - OSStatus status = ::JMExecJNIStaticMethodInContext(mContext, env, utilsClass, printContainerMethod, 5, args); - - // now, wait for the print method to complete. - if (status == noErr) - notifier.wait(); - } while (0); - - // restore the origin & port. - localPort.Exit(); - - if (frameObject != NULL) - env->DeleteLocalRef(frameObject); - if (utilsClass != NULL) - env->DeleteLocalRef(utilsClass); -#endif /* !TARGET_CARBON */ -} - -void MRJContext::activate(Boolean active) -{ -#if TARGET_CARBON - // ??? -#else - if (mViewerFrame != NULL) { - ::JMFrameActivate(mViewerFrame, active); - mIsActive = active; - } else { - mIsActive = false; - } -#endif -} - -void MRJContext::resume(Boolean inFront) -{ -#if TARGET_CARBON - // ??? -#else - if (mViewerFrame != NULL) { - ::JMFrameResume(mViewerFrame, inFront); - } -#endif -} - -void MRJContext::click(const EventRecord* event, MRJFrame* appletFrame) -{ -#if TARGET_CARBON - // won't Carbon events just take care of everything? - LocalPort port(mPluginPort); - port.Enter(); - - Point localWhere = event->where; - ::GlobalToLocal(&localWhere); - ::HandleControlClick(mAppletControl, localWhere, - event->modifiers, NULL); - - // the Java control seems to focus itself automatically when clicked in. - mIsFocused = true; - - port.Exit(); -#else - nsPluginPort* npPort = mPluginWindow->window; - - // make the plugin's port current, and move its origin to (0, 0). - LocalPort port(GrafPtr(npPort->port)); - port.Enter(); - - // will we always be called in the right coordinate system? - Point localWhere = event->where; - ::GlobalToLocal(&localWhere); - nsPluginRect& clipRect = mCachedClipRect; - Rect bounds = { clipRect.top, clipRect.left, clipRect.bottom, clipRect.right }; - if (PtInRect(localWhere, &bounds)) { - localToFrame(&localWhere); - appletFrame->click(event, localWhere); - } - - // restore the plugin port's origin, and restore the current port. - port.Exit(); -#endif -} - -void MRJContext::keyPress(long message, short modifiers) -{ -#if TARGET_CARBON - // won't Carbon events just take care of everything? -#else - if (mViewerFrame != NULL) { - ::JMFrameKey(mViewerFrame, message & charCodeMask, - (message & keyCodeMask) >> 8, modifiers); - } -#endif -} - -void MRJContext::keyRelease(long message, short modifiers) -{ -#if TARGET_CARBON - // won't Carbon events just take care of everything? -#else - if (mViewerFrame != NULL) { - ::JMFrameKeyRelease(mViewerFrame, message & charCodeMask, - (message & keyCodeMask) >> 8, modifiers); - } -#endif -} - -void MRJContext::scrollingBegins() -{ - if (mScrollCounter++ == 0) { - if (mAppletControl) { - JNIEnv* env = mSession->getCurrentEnv(); - StopJavaControlAsyncDrawing(env, mAppletControl); - } - } -} - -void MRJContext::scrollingEnds() -{ - if (--mScrollCounter == 0) { - if (mAppletControl) { - synchronizeClipping(); - JNIEnv* env = mSession->getCurrentEnv(); - RestartJavaControlAsyncDrawing(env, mAppletControl); - } - } -} - -Boolean MRJContext::handleEvent(EventRecord* event) -{ - Boolean eventHandled = false; - if (mAppletControl) { - eventHandled = true; - switch (event->what) { - case updateEvt: - drawApplet(); - break; - - case keyDown: - if (mIsFocused) { - ::HandleControlKey(mAppletControl, - (event->message & keyCodeMask) >> 8, - (event->message & charCodeMask), - event->modifiers); - eventHandled = true; - } - break; - - case mouseDown: - click(event, NULL); - eventHandled = mIsFocused; - break; - - case nsPluginEventType_GetFocusEvent: - if (!mIsFocused) { - ::SetKeyboardFocus(::GetWindowFromPort(mPluginPort), mAppletControl, kControlFocusNextPart); - mIsFocused = true; - } - break; - - case nsPluginEventType_LoseFocusEvent: - ::SetKeyboardFocus(::GetWindowFromPort(mPluginPort), mAppletControl, kControlFocusNoPart); - mIsFocused = true; - break; - - case nsPluginEventType_AdjustCursorEvent: - ::IdleControls(::GetWindowFromPort(mPluginPort)); - break; - - case nsPluginEventType_MenuCommandEvent: - // frame->menuSelected(event->message, event->modifiers); - break; - - case nsPluginEventType_ScrollingBeginsEvent: - scrollingBegins(); - break; - - case nsPluginEventType_ScrollingEndsEvent: - scrollingEnds(); - break; - } - } - return eventHandled; -} - -void MRJContext::idle(short modifiers) -{ -#if TARGET_CARBON - // won't Carbon events just take care of everything? -#else - // Put the port in to proper window coordinates. - nsPluginPort* npPort = mPluginWindow->window; - LocalPort port(GrafPtr(npPort->port)); - port.Enter(); - - Point pt; - ::GetMouse(&pt); - localToFrame(&pt); - ::JMFrameMouseOver(mViewerFrame, pt, modifiers); - - port.Exit(); -#endif -} - -// interim routine for compatibility between OLD plugin interface and new. - -// FIXME: when the window goes away, npWindow/pluginWindow is passed in as NULL. -// should tell the AWTContext that the window has gone away. could use an offscreen -// or empty clipped grafport. - - - -OSStatus MRJContext::installEventHandlers(WindowRef window) -{ - // install mouseDown/mouseUp handlers for this window, so we can disable - // async updates during mouse tracking. - return noErr; -} - -OSStatus MRJContext::removeEventHandlers(WindowRef window) -{ - return noErr; -} - -void MRJContext::setWindow(nsPluginWindow* pluginWindow) -{ - if (pluginWindow != NULL) { - mPluginWindow = pluginWindow; - - // establish the GrafPort the plugin will draw in. - mPluginPort = pluginWindow->window->port; - - if (! appletLoaded()) - loadApplet(); - } else { - // tell MRJ the window has gone away. - mPluginWindow = NULL; - - // use a single, 0x0, empty port for all future drawing. - mPluginPort = getEmptyPort(); - } - synchronizeClipping(); -} - -static Boolean equalRect(const nsPluginRect* r1, const nsPluginRect* r2) -{ - SInt32* r1p = (SInt32*)r1; - SInt32* r2p = (SInt32*)r2; - return (r1p[0] == r2p[0] && r1p[1] == r2p[1]); -} - -Boolean MRJContext::inspectWindow() -{ - // don't bother looking, if the applet doesn't exist yet. - if (!appletLoaded()) - return false; - - Boolean recomputeClipping = false; - - if (mPluginWindow != NULL) { - // Check for origin or clipping changes. - nsPluginPort* npPort = mPluginWindow->window; - if (mCachedOrigin.x != npPort->portx || mCachedOrigin.y != npPort->porty || !equalRect(&mCachedClipRect, &mPluginWindow->clipRect)) { - // transfer over values to the window cache. - recomputeClipping = true; - } - } - - if (recomputeClipping) - synchronizeClipping(); - - return recomputeClipping; -} - -/** - * This routine ensures that the browser and MRJ agree on what the current clipping - * should be. If the browser has assigned us a window to draw in (see setWindow() - * above), then we use that window's clipRect to set up clipping, which is cached - * in mPluginClipping, as a region. Otherwise, mPluginClipping is set to an empty - * region. - */ -void MRJContext::synchronizeClipping() -{ - // this is called on update events to make sure the clipping region is in sync with the browser's. - if (mPluginWindow != NULL) { - // plugin clipping is intersection of clipRgn and the clipRect. - nsPluginRect clipRect = mPluginWindow->clipRect; - nsPluginPort* pluginPort = mPluginWindow->window; - clipRect.left += pluginPort->portx, clipRect.right += pluginPort->portx; - clipRect.top += pluginPort->porty, clipRect.bottom += pluginPort->porty; - ::SetRectRgn(mPluginClipping, clipRect.left, clipRect.top, clipRect.right, clipRect.bottom); - } else { - ::SetEmptyRgn(mPluginClipping); - } - synchronizeVisibility(); -} - -MRJFrame* MRJContext::findFrame(WindowRef window) -{ - MRJFrame* frame = NULL; - -#if !TARGET_CARBON - // locates the frame corresponding to this window. - if (window == NULL || (CGrafPtr(window) == mPluginPort) && mViewerFrame != NULL) { - frame = getFrame(mViewerFrame); - } else { - // Scan the available frames for this context, and see if any of them correspond to this window. - UInt32 frameCount; - OSStatus status = ::JMCountAWTContextFrames(mContext, &frameCount); - if (status == noErr) { - for (UInt32 frameIndex = 1; frameIndex < frameCount; frameIndex++) { - JMFrameRef frameRef; - status = ::JMGetAWTContextFrame(mContext, frameIndex, &frameRef); - frame = getFrame(frameRef); - TopLevelFrame* tlFrame = dynamic_cast(frame); - if (tlFrame != NULL && tlFrame->getWindow() == window) - break; - } - } - } -#endif - - return frame; -} - -GrafPtr MRJContext::getPort() -{ - return GrafPtr(mPluginPort); -} - -void MRJContext::localToFrame(Point* pt) -{ - if (mPluginWindow != NULL) { - // transform mouse to frame coordinates. - nsPluginPort* npPort = mPluginWindow->window; - pt->v += npPort->porty; - pt->h += npPort->portx; - } -} - -void MRJContext::ensureValidPort() -{ - if (mPluginWindow != NULL) { - nsPluginPort* npPort = mPluginWindow->window; - if (npPort == NULL) - mPluginPort = getEmptyPort(); - ::SetPort(GrafPtr(mPluginPort)); - } -} - -static void blinkRgn(RgnHandle rgn) -{ - ::InvertRgn(rgn); - UInt32 ticks = ::TickCount(); - while (::TickCount() - ticks < 10) ; - ::InvertRgn(rgn); -} - -void MRJContext::synchronizeVisibility() -{ - OSStatus status; - - if (mAppletControl) { - JNIEnv* env = mSession->getCurrentEnv(); - if (mPluginWindow != NULL) { - nsPluginRect oldClipRect = mCachedClipRect; - nsPluginPort* pluginPort = mPluginWindow->window; - mCachedOrigin.x = pluginPort->portx; - mCachedOrigin.y = pluginPort->porty; - mCachedClipRect = mPluginWindow->clipRect; - - int posX = -pluginPort->portx; - int posY = -pluginPort->porty; - int clipX = mCachedClipRect.left; - int clipY = mCachedClipRect.top; - int clipWidth = (mCachedClipRect.right - mCachedClipRect.left); - int clipHeight = (mCachedClipRect.bottom - mCachedClipRect.top); - -#if TARGET_RT_MAC_MACHO - // XXX hack a little bit to make it work... - const SInt32 kTitleBarHeight = 22; - posY -= kTitleBarHeight; - clipY -= kTitleBarHeight; -#endif - - status = ::SizeJavaControl(env, mAppletControl, mPluginWindow->width, mPluginWindow->height); - status = ::MoveAndClipJavaControl(env, mAppletControl, posX, posY, - clipX, clipY, clipWidth, clipHeight); - - if (!mIsVisible) { - status = ::ShowHideJavaControl(env, mAppletControl, true); - mIsVisible = (status == noErr); - } else { - status = ::DrawJavaControl(env, mAppletControl); - } - -#if TARGET_RT_MAC_MACHO && 0 - if (GetCurrentKeyModifiers() & alphaLock) { - // raise(SIGINT); - printf("@@@ (posX = %d, posY = %d), (clipX = %d, clipY = %d, clipWidth = %d, clipHeight = %d) @@@\n", - posX, posY, clipX, clipY, clipWidth, clipHeight); - - Rect clipBounds; - clipBounds.left = clipX, clipBounds.top = clipY; - clipBounds.right = clipX + clipWidth, clipBounds.bottom = clipY + clipHeight; - LocalPort port(mPluginPort); - port.Enter(); - FrameRect(&clipBounds); - InvertRect(&clipBounds); - QDFlushPortBuffer(mPluginPort, NULL); - port.Exit(); - } -#endif - } else { - status = ::MoveAndClipJavaControl(env, mAppletControl, 0, 0, 0, 0, 0, 0); - status = ::ShowHideJavaControl(env, mAppletControl, false); - mIsVisible = false; - } - } -} - -void MRJContext::showFrames() -{ -#if TARGET_CARBON - // Won't Carbon events handle all of this? -#else - UInt32 frameCount; - OSStatus status = ::JMCountAWTContextFrames(mContext, &frameCount); - if (status == noErr) { - for (UInt32 frameIndex = 0; frameIndex < frameCount; frameIndex++) { - JMFrameRef frameRef; - status = ::JMGetAWTContextFrame(mContext, frameIndex, &frameRef); - if (status == noErr) { - ::JMFrameShowHide(frameRef, true); -// MRJFrame* frame = getFrame(frameRef); -// if (frame != NULL) -// frame->focusEvent(false); - } - } - } -#endif -} - -void MRJContext::hideFrames() -{ -#if TARGET_CARBON - // Won't Carbon events handle all of this? -#else - UInt32 frameCount; - OSStatus status = ::JMCountAWTContextFrames(mContext, &frameCount); - if (status == noErr) { - for (UInt32 frameIndex = 0; frameIndex < frameCount; frameIndex++) { - JMFrameRef frameRef; - status = ::JMGetAWTContextFrame(mContext, frameIndex, &frameRef); - if (status == noErr) { - // make sure the frame doesn't have the focus. - MRJFrame* frame = getFrame(frameRef); - if (frame != NULL) - frame->focusEvent(false); - ::JMFrameShowHide(frameRef, false); - } - } - } -#endif -} - -/** - * Ensure that any frames Java still has a reference to are no longer valid, so that we won't crash - * after a plugin instance gets shut down. This is called by the destructor just in case, to avoid - * some hard freeze crashes I've seen. - */ -void MRJContext::releaseFrames() -{ -#if TARGET_CARBON - // Won't Carbon events handle all of this? -#else - UInt32 frameCount; - OSStatus status = ::JMCountAWTContextFrames(mContext, &frameCount); - if (status == noErr) { - for (UInt32 frameIndex = 0; frameIndex < frameCount; frameIndex++) { - JMFrameRef frameRef = NULL; - status = ::JMGetAWTContextFrame(mContext, frameIndex, &frameRef); - if (status == noErr) { - frameShowHide(frameRef, false); - releaseFrame(mContext, frameRef); - } - } - } -#endif -} - -void MRJContext::setDocumentBase(const char* documentBase) -{ - if (mDocumentBase != NULL) - mDocumentBase = NULL; - mDocumentBase = ::strdup(documentBase); -} - -const char* MRJContext::getDocumentBase() -{ - return mDocumentBase; -} - -void MRJContext::setAppletHTML(const char* appletHTML, nsPluginTagType tagType) -{ - if (mAppletHTML != NULL) - delete[] mAppletHTML; - - switch (tagType) { - case nsPluginTagType_Applet: - mAppletHTML = ::strdup(appletHTML); - break; - - case nsPluginTagType_Object: - { - // If the HTML isn't an element, but is an element, then - // transform it so MRJ can deal with it gracefully. it sure would be - // nice if some DOM code would deal with this for us. This code - // is fragile, because it assumes the case of the classid attribute. - - // edit the element, converting to , - // classid="java:JitterText.class" to code="JitterText.class", - // and to . - string element(appletHTML); - - const char kAppletTag[] = "applet"; - const size_t kAppleTagSize = sizeof(kAppletTag) - 1; - string::size_type startTag = element.find(""); - if (endTag != string::npos) { - element.replace(endTag + 2, kAppleTagSize, kAppletTag); - } - - const char kClassIDAttribute[] = "classid=\"java:"; - const char kCodeAttribute[] = "code=\""; - size_t kClassIDAttributeSize = sizeof(kClassIDAttribute) - 1; - string::size_type classID = element.find(kClassIDAttribute); - if (classID != string::npos) { - element.replace(classID, kClassIDAttributeSize, kCodeAttribute); - } - - mAppletHTML = ::strdup(element.c_str()); - } - break; - case nsPluginTagType_Embed: - { - nsIPluginTagInfo* tagInfo = NULL; - if (mPeer->QueryInterface(NS_GET_IID(nsIPluginTagInfo), (void**)&tagInfo) == NS_OK) { - // just synthesize an element out of whole cloth. - mAppletHTML = synthesizeAppletElement(tagInfo); - NS_RELEASE(tagInfo); - } - } - break; - } -} - -const char* MRJContext::getAppletHTML() -{ - return mAppletHTML; -} - -void MRJContext::setSecurityContext(MRJSecurityContext* context) -{ - NS_ADDREF(context); - NS_IF_RELEASE(mSecurityContext); - mSecurityContext = context; -} - -MRJSecurityContext* MRJContext::getSecurityContext() -{ - return mSecurityContext; -} - -MRJPage* MRJContext::findPage(const MRJPageAttributes& attributes) -{ - MRJPage* page = MRJPage::getFirstPage(); - while (page != NULL) { - if (attributes.documentID == page->getDocumentID() && - ::strcasecmp(attributes.codeBase, page->getCodeBase()) == 0 && - ::strcasecmp(attributes.archive, page->getArchive()) == 0 && - attributes.mayScript == page->getMayScript()) { - page->AddRef(); - return page; - } - page = page->getNextPage(); - } - - // create a unique page for this URL. - page = new MRJPage(mSession, attributes); - page->AddRef(); - return page; -} - -#if TARGET_CARBON - -struct EmptyPort { - CGrafPtr mPort; - - EmptyPort() : mPort(NULL) - { - GrafPtr oldPort; - ::GetPort(&oldPort); - mPort = ::CreateNewPort(); - if (mPort) { - ::SetPort(mPort); - ::PortSize(0, 0); - } - ::SetPort(oldPort); - } - - ~EmptyPort() - { - if (mPort) - ::DisposePort(mPort); - } - - operator CGrafPtr() { return mPort; } -}; - -#else - -struct EmptyPort : public CGrafPort { - EmptyPort() { - GrafPtr oldPort; - ::GetPort(&oldPort); - ::OpenCPort(this); - ::PortSize(0, 0); - ::SetEmptyRgn(this->visRgn); - ::SetEmptyRgn(this->clipRgn); - ::SetPort(oldPort); - } - - ~EmptyPort() { - ::CloseCPort(this); - } - - operator CGrafPtr() { return this; } -}; - -#endif - -CGrafPtr MRJContext::getEmptyPort() -{ - static EmptyPort emptyPort; - return emptyPort; -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/MRJContext.h b/plugin/oji/MRJCarbon/plugin/Source/MRJContext.h deleted file mode 100644 index b58a6e41e50f..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/MRJContext.h +++ /dev/null @@ -1,192 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - MRJContext.h - - Manages Java content using the MacOS Runtime for Java. - - by Patrick C. Beard. - */ - -#pragma once - -#include "jni.h" -#include "nsIPluginTagInfo2.h" - - -// -// Instance state information about the plugin. -// -// *Developers*: Use this struct to hold per-instance -// information that you'll need in the -// various functions in this file. -// - -class MRJSession; -class MRJPluginInstance; -class nsIPluginInstancePeer; -struct nsPluginWindow; -class MRJFrame; -class MRJPage; -struct MRJPageAttributes; -class MRJSecurityContext; - -struct nsPluginPoint { - PRInt32 x; - PRInt32 y; -}; - -class MRJContext { -public: - MRJContext(MRJSession* session, MRJPluginInstance* instance); - ~MRJContext(); - - void processAppletTag(); - Boolean createContext(); - -#if !TARGET_CARBON - JMAWTContextRef getContextRef(); - JMAppletViewerRef getViewerRef(); -#endif - - Boolean appletLoaded(); - Boolean loadApplet(); - Boolean isActive(); - - void suspendApplet(); - void resumeApplet(); - jobject getApplet(); - - nsIPluginInstance* getInstance(); - nsIPluginInstancePeer* getPeer(); - - Boolean handleEvent(EventRecord* event); - - void idle(short modifiers); - void drawApplet(); - void printApplet(nsPluginWindow* printingWindow); - - void activate(Boolean active); - void resume(Boolean inFront); - - void click(const EventRecord* event, MRJFrame* frame); - void keyPress(long message, short modifiers); - void keyRelease(long message, short modifiers); - - void scrollingBegins(); - void scrollingEnds(); - - void setWindow(nsPluginWindow* pluginWindow); - Boolean inspectWindow(); - - MRJFrame* findFrame(WindowRef window); - GrafPtr getPort(); - - void showFrames(); - void hideFrames(); - void releaseFrames(); - - void setDocumentBase(const char* documentBase); - const char* getDocumentBase(); - - void setAppletHTML(const char* appletHTML, nsPluginTagType tagType); - const char* getAppletHTML(); - - void setSecurityContext(MRJSecurityContext* context); - MRJSecurityContext* getSecurityContext(); - - void showURL(const char* url, const char* target); - -private: - void localToFrame(Point* pt); - void ensureValidPort(); - void synchronizeClipping(); - void synchronizeVisibility(); - -#if !TARGET_CARBON - static OSStatus requestFrame(JMAWTContextRef context, JMFrameRef newFrame, JMFrameKind kind, - const Rect *initialBounds, Boolean resizeable, JMFrameCallbacks *callbacks); - static OSStatus releaseFrame(JMAWTContextRef context, JMFrameRef oldFrame); - static SInt16 getUniqueMenuID(JMAWTContextRef context, Boolean isSubmenu); - static void exceptionOccurred(JMAWTContextRef context, JMTextRef exceptionName, JMTextRef exceptionMsg, JMTextRef stackTrace); - - SInt16 allocateMenuID(Boolean isSubmenu); - - OSStatus createFrame(JMFrameRef frameRef, JMFrameKind kind, const Rect* initialBounds, Boolean resizeable); -#endif - - // Finds a suitable MRJPage object for this document URL, or creates one. - MRJPage* findPage(const MRJPageAttributes& attributes); - - static CGrafPtr getEmptyPort(); - -#if !TARGET_CARBON - void setProxyInfoForURL(char * url, JMProxyType proxyType); -#endif - - OSStatus installEventHandlers(WindowRef window); - OSStatus removeEventHandlers(WindowRef window); - -private: - MRJPluginInstance* mPluginInstance; - MRJSession* mSession; - nsIPluginInstancePeer* mPeer; -#if !TARGET_CARBON - JMAppletLocatorRef mLocator; - JMAWTContextRef mContext; - JMAppletViewerRef mViewer; - JMFrameRef mViewerFrame; -#endif - Boolean mIsActive; - Boolean mIsFocused; - Boolean mIsVisible; - nsPluginPoint mCachedOrigin; - nsPluginRect mCachedClipRect; - RgnHandle mPluginClipping; - nsPluginWindow* mPluginWindow; - CGrafPtr mPluginPort; - char* mDocumentBase; - char* mAppletHTML; - MRJPage* mPage; - MRJSecurityContext* mSecurityContext; -#if TARGET_CARBON - jobject mAppletFrame; - jobject mAppletObject; - ControlRef mAppletControl; - UInt32 mScrollCounter; -#endif -}; diff --git a/plugin/oji/MRJCarbon/plugin/Source/MRJFrame.cpp b/plugin/oji/MRJCarbon/plugin/Source/MRJFrame.cpp deleted file mode 100644 index cac08cb7bc6a..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/MRJFrame.cpp +++ /dev/null @@ -1,223 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - MRJFrame.cpp - - Encapsulates a JManager frame. - - by Patrick C. Beard. - */ - -#include "MRJFrame.h" -#include "LocalPort.h" -#include "nsplugindefs.h" - -MRJFrame::MRJFrame(JMFrameRef frameRef) - : mFrameRef(frameRef), mActive(false), mFocused(false) -{ -} - -MRJFrame::~MRJFrame() -{ -} - -/* Stub implementations. */ -void MRJFrame::setSize(const Rect* newSize) {} -void MRJFrame::invalRect(const Rect* invalidRect) {} -void MRJFrame::showHide(Boolean visible) {} -void MRJFrame::setTitle(const StringPtr title) {} -void MRJFrame::checkUpdate() {} -void MRJFrame::reorder(ReorderRequest request) {} -void MRJFrame::setResizeable(Boolean resizeable) {} - -Boolean MRJFrame::handleEvent(const EventRecord* event) -{ - Boolean eventHandled = true; - - switch (event->what) { - case nsPluginEventType_AdjustCursorEvent: - idle(event->modifiers); - break; - - case ::mouseDown: - click(event); - break; - - case keyDown: - case autoKey: - keyPress(event->message, event->modifiers); - break; - - case keyUp: - keyRelease(event->message, event->modifiers); - break; - - case updateEvt: - update(); - break; - - case activateEvt: - activate((event->modifiers & activeFlag) != 0); - break; - -#if 0 - case osEvt: - resume((event->message & resumeFlag) != 0); - eventHandled = false; - break; -#endif - - default: - eventHandled = false; - break; - } - - return eventHandled; -} - -void MRJFrame::idle(SInt16 modifiers) -{ - LocalPort port(getPort()); - port.Enter(); - - Point pt; - ::GetMouse(&pt); - ::JMFrameMouseOver(mFrameRef, pt, modifiers); - - port.Exit(); -} - -void MRJFrame::update() -{ - GrafPtr framePort = getPort(); - if (framePort != NULL) - ::JMFrameUpdate(mFrameRef, framePort->clipRgn); -} - -void MRJFrame::activate(Boolean active) -{ - if (mActive != active) { - mActive = active; - ::JMFrameActivate(mFrameRef, active); - } -} - -void MRJFrame::focusEvent(Boolean gotFocus) -{ - if (&::JMFrameFocus != NULL) { - if (gotFocus != mFocused) { - if (gotFocus) { - // HACK, until focus really works. - if (mActive != gotFocus) { - mActive = gotFocus; - ::JMFrameActivate(mFrameRef, gotFocus); - } - } - mFocused = gotFocus; - ::JMFrameFocus(mFrameRef, gotFocus); - } - } else { - if (mActive != gotFocus) { - mActive = gotFocus; - ::JMFrameActivate(mFrameRef, gotFocus); - } - } -} - -void MRJFrame::resume(Boolean inFront) -{ - ::JMFrameResume(mFrameRef, inFront); -} - -void MRJFrame::click(const EventRecord* event) -{ - // make the frame's port current, and move its origin to (0, 0). - // this is needed to transform the mouse click location to frame coordinates. - LocalPort port(getPort()); - port.Enter(); - - Point localWhere = event->where; - ::GlobalToLocal(&localWhere); - click(event, localWhere); - - // restore the plugin port's origin, and restore the current port. - port.Exit(); -} - -void MRJFrame::click(const EventRecord* event, Point localWhere) -{ - if (&::JMFrameClickWithEventRecord != NULL) - ::JMFrameClickWithEventRecord(mFrameRef, localWhere, event); - else - ::JMFrameClick(mFrameRef, localWhere, event->modifiers); -} - -void MRJFrame::keyPress(UInt32 message, SInt16 modifiers) -{ - ::JMFrameKey(mFrameRef, message & charCodeMask, (message & keyCodeMask) >> 8, modifiers); -} - -void MRJFrame::keyRelease(UInt32 message, SInt16 modifiers) -{ - ::JMFrameKeyRelease(mFrameRef, message & charCodeMask, (message & keyCodeMask) >> 8, modifiers); -} - -void MRJFrame::menuSelected(UInt32 message, SInt16 modifiers) -{ - MenuHandle menu = ::GetMenuHandle(short(message >> 16)); - if (menu != NULL) { - short item = short(message); - if (&::JMMenuSelectedWithModifiers != NULL) - ::JMMenuSelectedWithModifiers(::JMGetFrameContext(mFrameRef), menu, item, modifiers); - else - ::JMMenuSelected(::JMGetFrameContext(mFrameRef), menu, item); - } -} - -void MRJFrame::print(GrafPtr printingPort, Point frameOrigin) -{ -#if 0 - // this doesn't work, as Apple hasn't implemented it yet. - OSStatus status = JMDrawFrameInPort(mFrameRef, printingPort, frameOrigin, printingPort->clipRgn, false); - if (status != noErr) { - ::MoveTo(10, 12); - ::TextFont(0); - ::TextSize(12); - ::DrawString("\pMRJPlugin: printing failed."); - } -#endif -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/MRJFrame.h b/plugin/oji/MRJCarbon/plugin/Source/MRJFrame.h deleted file mode 100644 index bd6317faf7cd..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/MRJFrame.h +++ /dev/null @@ -1,95 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - MRJFrame.h - - Encapsulates a JManager frame. - - by Patrick C. Beard. - */ - -#pragma once - -#ifndef CALL_NOT_IN_CARBON - #define CALL_NOT_IN_CARBON 1 -#endif - -#include "jni.h" -#include "JManager.h" - -struct EventRecord; -struct nsPluginPrint; - -class MRJFrame { -public: - MRJFrame(JMFrameRef frameRef); - virtual ~MRJFrame(); - - /** Methods used to implement the JMFrame callback protocol. */ - virtual void setSize(const Rect* newSize); - virtual void invalRect(const Rect* invalidRect); - virtual void showHide(Boolean visible); - virtual void setTitle(const StringPtr title); - virtual void checkUpdate(); - virtual void reorder(ReorderRequest request); - virtual void setResizeable(Boolean resizeable); - - /** Methods to handle various events. */ - virtual Boolean handleEvent(const EventRecord* event); - - virtual void idle(SInt16 modifiers); - virtual void update(); - virtual void activate(Boolean active); - virtual void resume(Boolean inFront); - virtual void click(const EventRecord* event); - virtual void click(const EventRecord* event, Point localWhere); - virtual void keyPress(UInt32 message, SInt16 modifiers); - virtual void keyRelease(UInt32 message, SInt16 modifiers); - - virtual void focusEvent(Boolean gotFocus); - virtual void menuSelected(UInt32 message, SInt16 modifiers); - - virtual void print(GrafPtr printingPort, Point frameOrigin); - -protected: - virtual GrafPtr getPort() = 0; - -protected: - JMFrameRef mFrameRef; - Boolean mActive; - Boolean mFocused; -}; diff --git a/plugin/oji/MRJCarbon/plugin/Source/MRJMonitor.cpp b/plugin/oji/MRJCarbon/plugin/Source/MRJMonitor.cpp deleted file mode 100644 index 5d35f21235c7..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/MRJMonitor.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - MRJMonitor.cpp - - Provides a C++ interface to Java monitors. - - by Patrick C. Beard. - */ - -#include "MRJMonitor.h" -#include "MRJSession.h" - -MRJMonitor::MRJMonitor(MRJSession* session, jobject monitor) - : mSession(session), mMonitor(NULL), mWaitMethod(NULL), mNotifyMethod(NULL), mNotifyAllMethod(NULL) -{ - JNIEnv* env = mSession->getCurrentEnv(); - jclass javaLangObject = env->FindClass("java/lang/Object"); - if (javaLangObject != NULL) { - // look up method IDs. - mWaitMethod = env->GetMethodID(javaLangObject, "wait", "()V"); - mTimedWaitMethod = env->GetMethodID(javaLangObject, "wait", "(J)V"); - mNotifyMethod = env->GetMethodID(javaLangObject, "notify", "()V"); - mNotifyAllMethod = env->GetMethodID(javaLangObject, "notifyAll", "()V"); - - Boolean allocateMonitor = (monitor == NULL); - if (allocateMonitor) - monitor = env->AllocObject(javaLangObject); - - if (monitor != NULL) - mMonitor = env->NewGlobalRef(monitor); - - if (allocateMonitor) - env->DeleteLocalRef(monitor); - - env->DeleteLocalRef(javaLangObject); - } -} - -MRJMonitor::~MRJMonitor() -{ - if (mMonitor != NULL) { - JNIEnv* env = mSession->getCurrentEnv(); - env->DeleteGlobalRef(mMonitor); - mMonitor = NULL; - } -} - -void MRJMonitor::enter() -{ - JNIEnv* env = mSession->getCurrentEnv(); - env->MonitorEnter(mMonitor); -} - -void MRJMonitor::exit() -{ - JNIEnv* env = mSession->getCurrentEnv(); - env->MonitorExit(mMonitor); -} - -void MRJMonitor::wait() -{ - if (mMonitor != NULL && mWaitMethod != NULL) { - JNIEnv* env = mSession->getCurrentEnv(); - env->MonitorEnter(mMonitor); - env->CallVoidMethod(mMonitor, mWaitMethod); - env->MonitorExit(mMonitor); - } -} - -void MRJMonitor::wait(long long millis) -{ - if (mMonitor != NULL && mWaitMethod != NULL) { - JNIEnv* env = mSession->getCurrentEnv(); - env->MonitorEnter(mMonitor); - env->CallVoidMethod(mMonitor, mTimedWaitMethod, jlong(millis)); - env->MonitorExit(mMonitor); - } -} - -void MRJMonitor::notify() -{ - if (mMonitor != NULL && mNotifyMethod != NULL) { - JNIEnv* env = mSession->getCurrentEnv(); - env->MonitorEnter(mMonitor); - env->CallVoidMethod(mMonitor, mNotifyMethod); - env->MonitorExit(mMonitor); - } -} - -void MRJMonitor::notifyAll() -{ - if (mMonitor != NULL && mNotifyAllMethod != NULL) { - JNIEnv* env = mSession->getCurrentEnv(); - env->MonitorEnter(mMonitor); - env->CallVoidMethod(mMonitor, mNotifyAllMethod); - env->MonitorExit(mMonitor); - } -} - -jobject MRJMonitor::getObject() -{ - return mMonitor; -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/MRJMonitor.h b/plugin/oji/MRJCarbon/plugin/Source/MRJMonitor.h deleted file mode 100644 index 90fea27904ce..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/MRJMonitor.h +++ /dev/null @@ -1,75 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - MRJMonitor.h - - Provides a C++ interface to Java monitors. - - by Patrick C. Beard. - */ - -#include "Monitor.h" - -#ifndef JNI_H -#include "jni.h" -#endif - -class MRJSession; - -class MRJMonitor : public Monitor { -public: - MRJMonitor(MRJSession* session, jobject monitor = NULL); - ~MRJMonitor(); - - virtual void enter(); - virtual void exit(); - - virtual void wait(); - virtual void wait(long long millis); - virtual void notify(); - virtual void notifyAll(); - - virtual jobject getObject(); - -private: - MRJSession* mSession; - jobject mMonitor; - jmethodID mWaitMethod; - jmethodID mTimedWaitMethod; - jmethodID mNotifyMethod; - jmethodID mNotifyAllMethod; -}; diff --git a/plugin/oji/MRJCarbon/plugin/Source/MRJPage.cpp b/plugin/oji/MRJCarbon/plugin/Source/MRJPage.cpp deleted file mode 100644 index ab2f88b4aec1..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/MRJPage.cpp +++ /dev/null @@ -1,161 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - MRJPage.cpp - - Encapsulates the new MRJ Page API, which loads applets into a common context. - - by Patrick C. Beard. - */ - -#include "MRJPage.h" -#include "MRJSession.h" - -#include "StringUtils.h" - -MRJPage::MRJPage(MRJSession* session, UInt32 documentID, const char* codeBase, const char* archive, Boolean mayScript) - : mRefCount(0), mNextPage(NULL), mSession(session), - mDocumentID(documentID), mCodeBase(strdup(codeBase)), mArchive(strdup(archive)), mMayScript(mayScript) -{ - pushPage(); - -#if !TARGET_CARBON - if (&::JMNewAppletPage != NULL) { - OSStatus status = ::JMNewAppletPage(&mPageRef, session->getSessionRef()); - if (status != noErr) mPageRef = NULL; - } -#endif -} - -MRJPage::MRJPage(MRJSession* session, const MRJPageAttributes& attributes) - : mRefCount(0), mNextPage(NULL), mSession(session), - mDocumentID(attributes.documentID), mCodeBase(strdup(attributes.codeBase)), - mArchive(strdup(attributes.archive)), mMayScript(attributes.mayScript) -{ - pushPage(); - -#if !TARGET_CARBON - if (&::JMNewAppletPage != NULL) { - OSStatus status = ::JMNewAppletPage(&mPageRef, session->getSessionRef()); - if (status != noErr) mPageRef = NULL; - } -#endif -} - -MRJPage::~MRJPage() -{ - popPage(); - -#if !TARGET_CARBON - if (&::JMDisposeAppletPage != NULL && mPageRef != NULL) { - OSStatus status = ::JMDisposeAppletPage(mPageRef); - mPageRef = NULL; - } -#endif - - if (mCodeBase != NULL) { - delete[] mCodeBase; - mCodeBase = NULL; - } - - if (mArchive != NULL) { - delete[] mArchive; - mArchive = NULL; - } -} - -UInt16 MRJPage::AddRef() -{ - return (++mRefCount); -} - -UInt16 MRJPage::Release() -{ - UInt16 result = --mRefCount; - if (result == 0) { - delete this; - } - return result; -} - -#if !TARGET_CARBON -Boolean MRJPage::createContext(JMAWTContextRef* outContext, const JMAWTContextCallbacks * callbacks, JMClientData data) -{ - OSStatus status = noErr; - if (&::JMNewAWTContextInPage != NULL && mPageRef != NULL) { - status = ::JMNewAWTContextInPage(outContext, mSession->getSessionRef(), mPageRef, callbacks, data); - } else { - status = ::JMNewAWTContext(outContext, mSession->getSessionRef(), callbacks, data); - } - return (status == noErr); -} -#endif - -static MRJPage* thePageList = NULL; - -MRJPage* MRJPage::getFirstPage() -{ - return thePageList; -} - -MRJPage* MRJPage::getNextPage() -{ - return mNextPage; -} - -void MRJPage::pushPage() -{ - // put this on the global list of pages. - mNextPage = thePageList; - thePageList = this; -} - -void MRJPage::popPage() -{ - // Remove this page from the global list. - MRJPage** link = &thePageList; - MRJPage* page = *link; - while (page != NULL) { - if (page == this) { - *link = mNextPage; - mNextPage = NULL; - break; - } - link = &page->mNextPage; - page = *link; - } -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/MRJPage.h b/plugin/oji/MRJCarbon/plugin/Source/MRJPage.h deleted file mode 100644 index 37bf9640efd6..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/MRJPage.h +++ /dev/null @@ -1,87 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - MRJPage.h - - Encapsulates the MRJ data structure. - - by Patrick C. Beard. - */ - -#include - -class MRJSession; - -struct MRJPageAttributes { - UInt32 documentID; - const char* codeBase; - const char* archive; - Boolean mayScript; -}; - -class MRJPage { -public: - MRJPage(MRJSession* session, UInt32 documentID, const char* codeBase, const char* archive, Boolean mayScript); - MRJPage(MRJSession* session, const MRJPageAttributes& attributes); - ~MRJPage(); - - // Pages are reference counted. - UInt16 AddRef(void); - UInt16 Release(void); - - UInt32 getDocumentID() { return mDocumentID; } - const char* getCodeBase() { return mCodeBase; } - const char* getArchive() { return mArchive; } - Boolean getMayScript() { return mMayScript; } - - // Accessing the list of instances. - static MRJPage* getFirstPage(void); - MRJPage* getNextPage(void); - -private: - void pushPage(); - void popPage(); - -private: - UInt16 mRefCount; - MRJPage* mNextPage; - MRJSession* mSession; - UInt32 mDocumentID; - char* mCodeBase; - char* mArchive; - Boolean mMayScript; -}; diff --git a/plugin/oji/MRJCarbon/plugin/Source/MRJPlugin.cpp b/plugin/oji/MRJCarbon/plugin/Source/MRJPlugin.cpp deleted file mode 100644 index c58421a8d432..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/MRJPlugin.cpp +++ /dev/null @@ -1,969 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - MRJPlugin.cpp - - XP COM Plugin Implementation. - - by Patrick C. Beard. - */ - -#include "MRJPlugin.h" -#include "MRJSession.h" -#include "MRJContext.h" -#include "MRJConsole.h" -#include "EmbeddedFramePluginInstance.h" - -#if !TARGET_CARBON -#include "MRJFrame.h" -#endif - -#include "nsIServiceManager.h" -#include "nsIServiceManagerObsolete.h" -#include "nsObsoleteModuleLoading.h" - -#include "nsIMemory.h" -#include "nsIJVMManager.h" -#include "nsIJVMPluginTagInfo.h" -#include "nsIPluginManager2.h" -#include "nsIPluginInstancePeer.h" -#include "nsIWindowlessPlugInstPeer.h" -#include "LiveConnectNativeMethods.h" -#include "CSecureEnv.h" - -#include -#include -#include -#include - -nsIPluginManager* thePluginManager = NULL; -nsIPluginManager2* thePluginManager2 = NULL; -nsIMemory* theMemoryAllocator = NULL; - -FSSpec thePluginSpec; -short thePluginRefnum = -1; - -// Common interface IDs. - -static NS_DEFINE_IID(kPluginCID, NS_PLUGIN_CID); -static NS_DEFINE_IID(kPluginManagerCID, NS_PLUGINMANAGER_CID); -static NS_DEFINE_IID(kJVMManagerCID, NS_JVMMANAGER_CID); - -static NS_DEFINE_IID(kIWindowlessPluginInstancePeerIID, NS_IWINDOWLESSPLUGININSTANCEPEER_IID); - -/** - * Bottleneck all uses of the service manager, and use the obsolete service manager - * if the modern one is unavailable. - */ -static nsIServiceManager* theServiceManager = NULL; -static nsIServiceManagerObsolete* theServiceManagerObsolete = NULL; - -nsresult MRJPlugin::GetService(const nsCID& aCID, const nsIID& aIID, void* *aService) -{ - if (theServiceManager) - return theServiceManager->GetService(aCID, aIID, aService); - if (theServiceManagerObsolete) - return theServiceManagerObsolete->GetService(aCID, aIID, (nsISupports **)aService); - return NS_ERROR_FAILURE; -} - -nsresult MRJPlugin::GetService(const char* aContractID, const nsIID& aIID, void* *aService) -{ - if (theServiceManager) - return theServiceManager->GetServiceByContractID(aContractID, aIID, aService); - if (theServiceManagerObsolete) - return theServiceManagerObsolete->GetService(aContractID, aIID, (nsISupports **)aService); - return NS_ERROR_FAILURE; -} - -#pragma export on - -static long getSystemVersion() -{ - long version = 0; - Gestalt(gestaltSystemVersion, &version); - return version; -} - -extern "C" -nsresult NSGetFactory(nsISupports* serviceManager, const nsCID &aClass, const char *aClassName, const char *aContractID, nsIFactory **aFactory) -{ - nsresult result = NS_OK; - - // First off, fail if not running on AT LEAST Mac OS X, v10.1. - if (getSystemVersion() < 0x00001010) - return NS_ERROR_FAILURE; - - if (theServiceManager == NULL && theServiceManagerObsolete == NULL) { - if (NS_FAILED(serviceManager->QueryInterface(NS_GET_IID(nsIServiceManager), (void**)&theServiceManager))) - if (NS_FAILED(serviceManager->QueryInterface(NS_GET_IID(nsIServiceManagerObsolete), (void**)&theServiceManagerObsolete))) - return NS_ERROR_FAILURE; - - // Our global operator new wants to use nsIMalloc to do all of its allocation. - // This should be available from the Service Manager. - if (NS_FAILED(MRJPlugin::GetService("@mozilla.org/xpcom/memory-service;1", NS_GET_IID(nsIMemory), (void **)&theMemoryAllocator))) - return NS_ERROR_FAILURE; - } - - if (aClass.Equals(kPluginCID)) { - MRJPlugin* pluginFactory = new MRJPlugin(); - pluginFactory->AddRef(); - *aFactory = pluginFactory; - return NS_OK; - } - return NS_NOINTERFACE; -} - -#pragma export off - -#if TARGET_RT_MAC_CFM - -extern "C" { - -pascal OSErr __initialize(const CFragInitBlock *initBlock); -pascal void __terminate(void); - -#if defined(MRJPLUGIN_GC) -pascal OSErr __NSInitialize(const CFragInitBlock* initBlock); -pascal void __NSTerminate(void); -#define __initialize __NSInitialize -#define __terminate __NSTerminate -#endif - -pascal OSErr MRJPlugin__initialize(const CFragInitBlock *initBlock); -pascal void MRJPlugin__terminate(void); - -} - -pascal OSErr MRJPlugin__initialize(const CFragInitBlock *initBlock) -{ - OSErr err = __initialize(initBlock); - if (err != noErr) return err; - - if (initBlock->fragLocator.where == kDataForkCFragLocator) { - thePluginSpec = *initBlock->fragLocator.u.onDisk.fileSpec; - - // Open plugin's resource fork for read-only access. - thePluginRefnum = ::FSpOpenResFile(&thePluginSpec, fsRdPerm); - } - - return noErr; -} - -pascal void MRJPlugin__terminate() -{ -#if !TARGET_CARBON - // last ditch release of the memory allocator. - if (theMemoryAllocator != NULL) { - theMemoryAllocator->Release(); - theMemoryAllocator = NULL; - } -#endif - - // Close plugin's resource fork. - // If we don't, Mac OS X 10.1 crashes. - if (thePluginRefnum != -1) { - ::CloseResFile(thePluginRefnum); - thePluginRefnum = -1; - } - - __terminate(); -} - -#endif /* TARGET_RT_MAC_CFM */ - -#if TARGET_RT_MAC_MACHO - -extern "C" { -CF_EXPORT Boolean CFURLGetFSRef(CFURLRef url, FSRef *fsRef); -} - -static CFBundleRef getPluginBundle() -{ - printf("### MRJPlugin: getPluginBundle() here. ###\n"); - CFBundleRef bundle = CFBundleGetBundleWithIdentifier(CFSTR("com.netscape.MRJPlugin")); - if (bundle) { - printf("### MRJPlugin: CFBundleGetBundleWithIdentifier() succeeded. ###\n"); - // initialize thePluginSpec for later use. open our resource fork as well? - CFURLRef url = CFBundleCopyExecutableURL(bundle); - if (url) { - FSRef ref; - if (CFURLGetFSRef(url, &ref)) { - printf("### MRJPlugin: CFURLGetFSRef() succeeded. ###\n"); - FSGetCatalogInfo(&ref, kFSCatInfoNone, NULL, NULL, &thePluginSpec, NULL); - - // Open plugin's resource fork for read-only access. is this really necessary? - thePluginRefnum = ::CFBundleOpenBundleResourceMap(bundle); - } - CFRelease(url); - } - } - return bundle; -} - -CFBundleRef thePluginBundle = getPluginBundle(); - -#endif /* TARGET_RT_MAC_MACHO */ - -// -// The MEAT of the plugin. -// - -#pragma mark *** MRJPlugin *** - -const InterfaceInfo MRJPlugin::sInterfaces[] = { - { NS_IPLUGIN_IID, INTERFACE_OFFSET(MRJPlugin, nsIPlugin) }, - { NS_IJVMPLUGIN_IID, INTERFACE_OFFSET(MRJPlugin, nsIJVMPlugin) }, -#if USE_SYSTEM_CONSOLE - { NS_IJVMCONSOLE_IID, INTERFACE_OFFSET(MRJPlugin, nsIJVMConsole) }, -#endif - { NS_IRUNNABLE_IID, INTERFACE_OFFSET(MRJPlugin, nsIRunnable) }, -}; -const UInt32 MRJPlugin::kInterfaceCount = sizeof(sInterfaces) / sizeof(InterfaceInfo); - -MRJPlugin::MRJPlugin() - : SupportsMixin(this, sInterfaces, kInterfaceCount), - mManager(NULL), mThreadManager(NULL), mSession(NULL), mConsole(NULL), mPluginThreadID(NULL), mIsEnabled(false) -{ -} - -MRJPlugin::~MRJPlugin() -{ - // Release the console. - NS_IF_RELEASE(mConsole); - - // tear down the MRJ session, if it exists. - if (mSession != NULL) { - delete mSession; - mSession = NULL; - } - - // Release the managers. - NS_IF_RELEASE(mManager); - NS_IF_RELEASE(mThreadManager); -} - -#if !USE_SYSTEM_CONSOLE -/** - * MRJPlugin aggregates MRJConsole, so that it can be QI'd to be an nsIJVMConsole. - * To save code size, we use the SupportsMixin class instead of the macros in - * nsAgg.h. SupportsMixin::queryInterface, addRef, and release are all local - * operations, regardless of aggregation. The capitalized versions take aggregation - * into account. - */ -NS_METHOD MRJPlugin::QueryInterface(const nsIID& aIID, void** instancePtr) -{ - nsresult result = queryInterface(aIID, instancePtr); - if (result == NS_NOINTERFACE) { - result = mConsole->queryInterface(aIID, instancePtr); - } - return result; -} -#endif - -NS_METHOD MRJPlugin::CreateInstance(nsISupports *aOuter, const nsIID& aIID, void **aResult) -{ - nsresult result = StartupJVM(); - if (result == NS_OK) { - MRJPluginInstance* instance = new MRJPluginInstance(this); - if (instance == nsnull) - return NS_ERROR_OUT_OF_MEMORY; - result = instance->QueryInterface(aIID, aResult); - if (result != NS_OK) - delete instance; - } - return result; -} - -#define NS_APPLET_MIME_TYPE "application/x-java-applet" - -NS_METHOD MRJPlugin::CreatePluginInstance(nsISupports *aOuter, REFNSIID aIID, const char* aPluginMIMEType, void **aResult) -{ - nsresult result = NS_NOINTERFACE; - - if (::strcmp(aPluginMIMEType, "application/x-java-frame") == 0) { -#if !TARGET_CARBON - // create a special plugin instance that manages an embedded frame. - EmbeddedFramePluginInstance* instance = new EmbeddedFramePluginInstance(); - nsresult result = instance->QueryInterface(aIID, aResult); - if (result != NS_OK) - delete instance; -#endif - } else { - // assume it's some kind of an applet. - result = CreateInstance(aOuter, aIID, aResult); - } - return result; -} - -NS_METHOD MRJPlugin::Initialize() -{ - nsresult result = NS_OK; - - // try to get a plugin manager. - if (thePluginManager == NULL) { - result = MRJPlugin::GetService(kPluginManagerCID, NS_GET_IID(nsIPluginManager), (void**)&thePluginManager); - if (result != NS_OK || thePluginManager == NULL) - return NS_ERROR_FAILURE; - } - - // see if the enhanced plugin manager exists. - if (thePluginManager2 == NULL) { - if (thePluginManager->QueryInterface(NS_GET_IID(nsIPluginManager2), (void**)&thePluginManager2) != NS_OK) - thePluginManager2 = NULL; - } - - // try to get a JVM manager. we have to be able to run without one. - if (MRJPlugin::GetService(kJVMManagerCID, NS_GET_IID(nsIJVMManager), (void**)&mManager) != NS_OK) - mManager = NULL; - - // try to get a Thread manager. - if (mManager != NULL) { - if (mManager->QueryInterface(NS_GET_IID(nsIThreadManager), (void**)&mThreadManager) != NS_OK) - mThreadManager = NULL; - - if (mThreadManager != NULL) - mThreadManager->GetCurrentThread(&mPluginThreadID); - } - -#if !USE_SYSTEM_CONSOLE - // create a console, only if there's user interface for it. - if (thePluginManager2 != NULL) { - mConsole = new MRJConsole(this); - mConsole->AddRef(); - } -#endif - - return result; -} - -NS_METHOD MRJPlugin::Shutdown() -{ - // shutdown LiveConnect. - ShutdownLiveConnectSupport(); - - // release our reference to the plugin manager(s). - NS_IF_RELEASE(thePluginManager2); - NS_IF_RELEASE(thePluginManager); - - // release our reference(s) to the service manager. - NS_IF_RELEASE(theServiceManager); - NS_IF_RELEASE(theServiceManagerObsolete); - - return NS_OK; -} - -NS_METHOD MRJPlugin::GetMIMEDescription(const char* *result) -{ - *result = NS_JVM_MIME_TYPE; - return NS_OK; -} - -NS_METHOD MRJPlugin::GetValue(nsPluginVariable variable, void *value) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -MRJSession* MRJPlugin::getSession() -{ - StartupJVM(); - return mSession; -} - -nsIJVMManager* MRJPlugin::getManager() -{ - return mManager; -} - -nsIThreadManager* MRJPlugin::getThreadManager() -{ - return mThreadManager; -} - -static char* getJavaConsolePath(char* path, UInt32 maxPathSize) -{ - path[0] = '\0'; - FSRef ref; - OSErr err = FSFindFolder(kUserDomain, kDomainLibraryFolderType, true, &ref); - if (err == noErr) { - err = FSRefMakePath(&ref, (UInt8*) path, maxPathSize); - const char kJavaConsoleLog[] = { "/Logs/Java Console.log" }; - int len = strlen(path); - if (err == noErr && (len + sizeof(kJavaConsoleLog)) <= maxPathSize) { - strcat(path + len, kJavaConsoleLog); - } - } - return path; -} - -nsresult MRJPlugin::StartupJVM() -{ - if (mSession == NULL) { - // start a session with MRJ. - mSession = new MRJSession(); - - // Add "MRJPlugin.jar" to the class path. - FSSpec jarFileSpec = { thePluginSpec.vRefNum, thePluginSpec.parID, "\pMRJPlugin.jar" }; - mSession->addToClassPath(jarFileSpec); - - // Compute location of ~/Library/Logs/JavaConsole.log - char consolePath[512]; - mSession->open(getJavaConsolePath(consolePath, sizeof(consolePath))); - - if (mSession->getStatus() != noErr) { - // how can we signal an error? - delete mSession; - mSession = NULL; - return NS_ERROR_FAILURE; - } - - InitLiveConnectSupport(this); - -#if 0 - // start our idle thread. - if (mThreadManager != NULL) { - PRUint32 threadID; - mThreadManager->CreateThread(&threadID, this); - } -#endif - - mIsEnabled = true; - } - return NS_OK; -} - -NS_METHOD MRJPlugin::AddToClassPath(const char* dirPath) -{ - if (mSession != NULL) { - mSession->addToClassPath(dirPath); - return NS_OK; - } - return NS_ERROR_FAILURE; -} - -NS_METHOD MRJPlugin::GetClassPath(const char* *result) -{ - char* classPath = mSession->getProperty("java.class.path"); - *result = classPath; - return (classPath != NULL ? NS_OK : NS_ERROR_FAILURE); -} - -NS_METHOD MRJPlugin::GetJavaWrapper(JNIEnv* env, jint jsobj, jobject *jobj) -{ - // use jsobj as key into a table. - // if not in the table, then create a new netscape.javascript.JSObject that references this. - *jobj = Wrap_JSObject(env, jsobj); - return NS_OK; -} - -NS_METHOD MRJPlugin::UnwrapJavaWrapper(JNIEnv* env, jobject jobj, jint* jsobj) -{ - *jsobj = Unwrap_JSObject(env, jobj); - return NS_OK; -} - -NS_METHOD MRJPlugin::CreateSecureEnv(JNIEnv* proxyEnv, nsISecureEnv* *outSecureEnv) -{ - *outSecureEnv = NULL; - nsresult rv = StartupJVM(); - if (rv == NS_OK) { - // Need to spawn a new JVM communication thread here. - // rv = CSecureEnv::Create(this, proxyEnv, NS_GET_IID(nsISecureEnv), (void**)outSecureEnv); - static NS_DEFINE_IID(kISecureEnvIID, NS_ISECUREENV_IID); - rv = CSecureEnv::Create(this, proxyEnv, kISecureEnvIID, (void**)outSecureEnv); - } - return rv; -} - -NS_METHOD MRJPlugin::SpendTime(PRUint32 timeMillis) -{ - nsresult result = NS_OK; - // Only do this if there aren't any plugin instances. - if (MRJPluginInstance::getInstances() == NULL) { - if (mSession == NULL) - result = StartupJVM(); - if (mSession != NULL) - mSession->idle(timeMillis); - } - return result; -} - -/** - * Poor Man's Mac OS X Java Console implementation. MRJSession::open() - * opens ~/Library/Logs/JavaConsole.log, and redirects all output - * from System.out and System.err to this file. Rather than - * implementing a Java based console, just take advantage of - * Mac OS X's /Applications/Utilities/Console.app capability - * of showing log files. The following simply uses Launch Services - * to open whatever application normally opens ".log" files. - * A more sophisticated implementation would launch Console.app - * with the log file, but this works just fine for now. - */ -NS_METHOD MRJPlugin::Show() -{ - // Launch the system console application. - char consolePath[512]; - getJavaConsolePath(consolePath, sizeof(consolePath)); - CFURLRef consoleURL = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, (UInt8*)consolePath, strlen(consolePath), false); - if (consoleURL) { - LSOpenCFURLRef(consoleURL, NULL); - CFRelease(consoleURL); - } - return NS_OK; -} - -NS_METHOD MRJPlugin::Hide() -{ - // Hide system console? - return NS_OK; -} - -NS_METHOD MRJPlugin::IsVisible(PRBool *result) -{ - // *result = IsConsoleRunning(); - *result = PR_FALSE; - return NS_OK; -} - -NS_METHOD MRJPlugin::Print(const char* msg, const char* /* encodingName */) -{ - // printf onto the console. - return NS_OK; -} - -NS_METHOD MRJPlugin::Run() -{ - while (mSession != NULL) { - mSession->idle(); - mThreadManager->Sleep(); - } - return NS_OK; -} - -MRJPluginInstance* MRJPlugin::getPluginInstance(jobject applet) -{ - JNIEnv* env = mSession->getCurrentEnv(); - MRJPluginInstance* instance = MRJPluginInstance::getInstances(); - while (instance != NULL) { - jobject object = NULL; - if (instance->GetJavaObject(&object) == NS_OK && env->IsSameObject(applet, object)) { - instance->AddRef(); - return instance; - } - instance = instance->getNextInstance(); - } - return NULL; -} - -MRJPluginInstance* MRJPlugin::getPluginInstance(JNIEnv* jenv) -{ -#if !TARGET_CARBON - // Apple will provide an API that maps a JNIEnv to an JMAWTContextRef. We can map this to the MRJContext/Applet/Instance. - MRJPluginInstance* instance = MRJPluginInstance::getInstances(); - if (&::JMJNIToAWTContext != NULL) { - JMAWTContextRef contextRef = ::JMJNIToAWTContext(mSession->getSessionRef(), jenv); - if (contextRef != NULL) { - while (instance != NULL) { - if (instance->getContext()->getContextRef() == contextRef) { - instance->AddRef(); - return instance; - } - instance = instance->getNextInstance(); - } - } - } else { - if (instance != NULL) { - instance->AddRef(); - return instance; - } - } -#endif - return NULL; -} - -Boolean MRJPlugin::inPluginThread() -{ - Boolean result = false; - nsPluginThread *currentThreadID = NULL; - - if (mThreadManager != NULL) - mThreadManager->GetCurrentThread(¤tThreadID); - if ((NULL != currentThreadID) && (NULL != mPluginThreadID)) { - if (currentThreadID == mPluginThreadID) { - result = true; - } - } - - return result; -} - -#pragma mark *** MRJPluginInstance *** - -const InterfaceInfo MRJPluginInstance::sInterfaces[] = { - { NS_IPLUGININSTANCE_IID, INTERFACE_OFFSET(MRJPluginInstance, nsIPluginInstance) }, - { NS_IJVMPLUGININSTANCE_IID, INTERFACE_OFFSET(MRJPluginInstance, nsIJVMPluginInstance) }, - { NS_IEVENTHANDLER_IID, INTERFACE_OFFSET(MRJPluginInstance, nsIEventHandler) }, -}; -const UInt32 MRJPluginInstance::kInterfaceCount = sizeof(sInterfaces) / sizeof(InterfaceInfo); - -MRJPluginInstance::MRJPluginInstance(MRJPlugin* plugin) - : SupportsMixin(this, sInterfaces, kInterfaceCount), - mPeer(NULL), mWindowlessPeer(NULL), - mPlugin(plugin), mSession(plugin->getSession()), - mContext(NULL), mApplet(NULL), mPluginWindow(NULL), - mNext(NULL) -{ - // add this instance to the instance list. - pushInstance(); - - // Tell the plugin we are retaining a reference. - mPlugin->AddRef(); -} - -MRJPluginInstance::~MRJPluginInstance() -{ - // Remove this instance from the global list. - popInstance(); - -#if 0 - if (mContext != NULL) { - delete mContext; - mContext = NULL; - } - - if (mPlugin != NULL) { - mPlugin->Release(); - mPlugin = NULL; - } - - if (mWindowlessPeer != NULL) { - mWindowlessPeer->Release(); - mWindowlessPeer = NULL; - } - - if (mPeer != NULL) { - mPeer->Release(); - mPeer = NULL; - } - - if (mApplet != NULL) { - JNIEnv* env = mSession->getCurrentEnv(); - env->DeleteGlobalRef(mApplet); - mApplet = NULL; - } -#endif -} - -static const char* kGetCodeBaseScriptURL = "javascript:var href = window.location.href; href.substring(0, href.lastIndexOf('/') + 1)"; -static const char* kGetDocumentBaseScriptURL = "javascript:window.location"; - -static bool hasTagInfo(nsISupports* supports) -{ - nsIJVMPluginTagInfo* tagInfo; - if (supports->QueryInterface(NS_GET_IID(nsIJVMPluginTagInfo), (void**)&tagInfo) == NS_OK) { - NS_RELEASE(tagInfo); - return true; - } - return false; -} - -NS_METHOD MRJPluginInstance::Initialize(nsIPluginInstancePeer* peer) -{ - // Tell the peer we are retaining a reference. - mPeer = peer; - mPeer->AddRef(); - - // See if we have a windowless peer. - nsresult result = mPeer->QueryInterface(kIWindowlessPluginInstancePeerIID, (void**)&mWindowlessPeer); - if (result != NS_OK) mWindowlessPeer = NULL; - - // create a context for the applet we will run. - mContext = new MRJContext(mSession, this); - - if (hasTagInfo(mPeer)) { - mContext->processAppletTag(); - mContext->createContext(); - } else { - // we'll be using JavaScript to create windows. - // fire up a JavaScript URL to get the current document's location. - nsIPluginInstance* pluginInstance = this; - nsIPluginStreamListener* listener = this; - result = thePluginManager->GetURL(pluginInstance, kGetDocumentBaseScriptURL, NULL, listener); - } - - return NS_OK; -} - -NS_METHOD MRJPluginInstance::OnDataAvailable(nsIPluginStreamInfo* pluginInfo, nsIInputStream* input, PRUint32 length) -{ - // hopefully all our data is available. - char* documentBase = new char[length + 1]; - if (documentBase != NULL) { - if (input->Read(documentBase, length, &length) == NS_OK) { - // We've delayed processing the applet tag, because we - // don't know the location of the current document yet. - documentBase[length] = '\0'; - - // set up the default document location, which can be used to compute relative CODEBASE, etc. - mContext->setDocumentBase(documentBase); - delete[] documentBase; - - mContext->processAppletTag(); - mContext->createContext(); - - // SetWindow may be called at an inopportune time. - if (mPluginWindow != NULL) - mContext->setWindow(mPluginWindow); - } - } - return NS_OK; -} - -NS_METHOD MRJPluginInstance::GetPeer(nsIPluginInstancePeer* *result) -{ - NS_IF_ADDREF(mPeer); - *result = mPeer; - return NS_OK; -} - -NS_METHOD MRJPluginInstance::Start() -{ - // Take this moment to show the applet's frames (if any). - mContext->showFrames(); - - mContext->resumeApplet(); - - return NS_OK; -} - -NS_METHOD MRJPluginInstance::Stop() -{ - // Take this moment to hide the applet's frames. - mContext->hideFrames(); - - mContext->suspendApplet(); - - return NS_OK; -} - -NS_METHOD MRJPluginInstance::Destroy() -{ - // Use this opportunity to break any cycles that might exist, and reduce - // reference counts to their minimum values. - if (mContext != NULL) { - delete mContext; - mContext = NULL; - } - - if (mPlugin != NULL) { - mPlugin->Release(); - mPlugin = NULL; - } - - if (mWindowlessPeer != NULL) { - mWindowlessPeer->Release(); - mWindowlessPeer = NULL; - } - - if (mPeer != NULL) { - mPeer->Release(); - mPeer = NULL; - } - - if (mApplet != NULL) { - JNIEnv* env = mSession->getCurrentEnv(); - env->DeleteGlobalRef(mApplet); - mApplet = NULL; - } - - return NS_OK; -} - -/** FIXME: Need an intelligent way to track changes to the NPPluginWindow. */ - -NS_METHOD MRJPluginInstance::SetWindow(nsPluginWindow* pluginWindow) -{ - mPluginWindow = pluginWindow; - - mContext->setWindow(pluginWindow); - - return NS_OK; -} - -NS_METHOD MRJPluginInstance::HandleEvent(nsPluginEvent* pluginEvent, PRBool* eventHandled) -{ - *eventHandled = PR_TRUE; - Boolean isUpdate; - - if (pluginEvent != NULL) { - EventRecord* event = pluginEvent->event; - - // Check for coordinate/clipping changes. - // Too bad nsPluginEventType_ClippingChangedEvent events aren't implemented. - isUpdate = (event->what == updateEvt); - inspectInstance(isUpdate); - - if (event->what == nullEvent) { - // Give Java another quantum of time. We don't need this on Mac OS X. - mSession->idle(0x00000400); // now SpendTime does this. - } else { -#if TARGET_CARBON - *eventHandled = mContext->handleEvent(event); -#else - MRJFrame* frame = mContext->findFrame(pluginEvent->window); - if (frame != NULL) { - switch (event->what) { - case nsPluginEventType_GetFocusEvent: - frame->focusEvent(true); - break; - - case nsPluginEventType_LoseFocusEvent: - frame->focusEvent(false); - break; - - case nsPluginEventType_AdjustCursorEvent: - frame->idle(event->modifiers); - break; - - case nsPluginEventType_MenuCommandEvent: - frame->menuSelected(event->message, event->modifiers); - break; - - default: - *eventHandled = frame->handleEvent(event); - break; - } - } else { - if (event->what == updateEvt) { - mContext->drawApplet(); - } - } -#endif - } - } - - return NS_OK; -} - -NS_METHOD MRJPluginInstance::Print(nsPluginPrint* platformPrint) -{ - if (platformPrint->mode == nsPluginMode_Embedded) { - mContext->printApplet(&platformPrint->print.embedPrint.window); - return NS_OK; - } - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_METHOD MRJPluginInstance::GetValue(nsPluginInstanceVariable variable, void *value) -{ - switch (variable) { - case nsPluginInstanceVariable_WindowlessBool: - *(PRBool*)value = PR_FALSE; - break; - case nsPluginInstanceVariable_TransparentBool: - *(PRBool*)value = PR_FALSE; - break; - case nsPluginInstanceVariable_DoCacheBool: - *(PRBool*)value = PR_FALSE; - break; - default: - break; - } - return NS_OK; -} - -NS_METHOD MRJPluginInstance::GetJavaObject(jobject *result) -{ - if (mApplet == NULL) { - jobject applet = mContext->getApplet(); - JNIEnv* env = mSession->getCurrentEnv(); - mApplet = env->NewGlobalRef(applet); - } - *result = mApplet; - return NS_OK; -} - -// Accessing the list of instances. - -static MRJPluginInstance* theInstances = NULL; - -void MRJPluginInstance::pushInstance() -{ - mNext = theInstances; - theInstances = this; -} - -void MRJPluginInstance::popInstance() -{ - MRJPluginInstance** link = &theInstances; - MRJPluginInstance* instance = *link; - while (instance != NULL) { - if (instance == this) { - *link = mNext; - mNext = NULL; - break; - } - link = &instance->mNext; - instance = *link; - } -} - -MRJPluginInstance* MRJPluginInstance::getInstances() -{ - return theInstances; -} - -MRJPluginInstance* MRJPluginInstance::getNextInstance() -{ - return mNext; -} - -MRJContext* MRJPluginInstance::getContext() -{ - return mContext; -} - -MRJSession* MRJPluginInstance::getSession() -{ - return mSession; -} - -void MRJPluginInstance::inspectInstance(Boolean isUpdateEvt) -{ - if (mContext != NULL && mContext->inspectWindow() && !isUpdateEvt && mWindowlessPeer != NULL) - mWindowlessPeer->ForceRedraw(); -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/MRJPlugin.h b/plugin/oji/MRJCarbon/plugin/Source/MRJPlugin.h deleted file mode 100644 index 860357629499..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/MRJPlugin.h +++ /dev/null @@ -1,483 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - MRJPlugin.h - - MRJPlugin encapsulates the global state of the MRJ plugin as a single COM object. - MRJPluginInstance represents an instance of the MRJ plugin. - - by Patrick C. Beard. - */ - -#pragma once - -#include "nsIPlugin.h" -#include "nsIPluginInstance.h" -#include "nsIJVMPlugin.h" -#include "nsIJVMConsole.h" -#include "nsIJVMPluginInstance.h" -#include "nsIThreadManager.h" -#include "nsIEventHandler.h" -#include "nsIPluginStreamListener.h" -#include "SupportsMixin.h" - -class MRJPlugin; -class MRJPluginInstance; -class MRJSession; -class MRJContext; -class MRJConsole; - -class nsIJVMManager; - -class MRJPlugin : public nsIPlugin, public nsIJVMPlugin, - public nsIJVMConsole, public nsIRunnable, - public SupportsMixin { -public: - MRJPlugin(); - virtual ~MRJPlugin(); - - static nsresult GetService(const nsCID &aCID, const nsIID& aIID, void* *aService); - static nsresult GetService(const char* aContractID, const nsIID& aIID, void* *aService); - - // NS_DECL_ISUPPORTS -#if USE_SYSTEM_CONSOLE - DECL_SUPPORTS_MIXIN -#else - NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); - NS_IMETHOD_(nsrefcnt) AddRef(void) { return addRef(); } - NS_IMETHOD_(nsrefcnt) Release(void) { return release(); } -#endif - - // The Release method on NPIPlugin corresponds to NPP_Shutdown. - - // The old NPP_New call has been factored into two plugin instance methods: - // - // NewInstance -- called once, after the plugin instance is created. This - // method is used to initialize the new plugin instance (although the actual - // plugin instance object will be created by the plugin manager). - // - // NPIPluginInstance::Start -- called when the plugin instance is to be - // started. This happens in two circumstances: (1) after the plugin instance - // is first initialized, and (2) after a plugin instance is returned to - // (e.g. by going back in the window history) after previously being stopped - // by the Stop method. - - // nsIFactory Methods. - - NS_IMETHOD - CreateInstance(nsISupports *aOuter, const nsIID& aIID, void **aResult); - - NS_IMETHOD - LockFactory(PRBool aLock) { return NS_ERROR_NOT_IMPLEMENTED; } - - // nsIPlugin Methods. - - /** - * Creates a new plugin instance, based on the MIME type. This - * allows different impelementations to be created depending on - * the specified MIME type. - */ - NS_IMETHOD CreatePluginInstance(nsISupports *aOuter, REFNSIID aIID, - const char* aPluginMIMEType, - void **aResult); - - /** - * Initializes the plugin and will be called before any new instances are - * created. This separates out the phase when a plugin is loaded just to - * query for its mime type from the phase when a plugin is used for real. - * The plugin should load up any resources at this point. - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Initialize(void); - - /** - * Called when the browser is done with the plugin factory, or when - * the plugin is disabled by the user. - * - * (Corresponds to NPP_Shutdown.) - * - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Shutdown(void); - - /** - * Returns the MIME description for the plugin. The MIME description - * is a colon-separated string containg the plugin MIME type, plugin - * data file extension, and plugin name, e.g.: - * - * "application/x-simple-plugin:smp:Simple LiveConnect Sample Plug-in" - * - * (Corresponds to NPP_GetMIMEDescription.) - * - * @param resultingDesc - the resulting MIME description - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - GetMIMEDescription(const char* *result); - - /** - * Returns the value of a variable associated with the plugin. - * - * (Corresponds to NPP_GetValue.) - * - * @param variable - the plugin variable to get - * @param value - the address of where to store the resulting value - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - GetValue(nsPluginVariable variable, void *value); - - // nsIJVMPlugin Methods. - - // This method us used to start the Java virtual machine. - // It sets up any global state necessary to host Java programs. - // Note that calling this method is distinctly separate from - // initializing the nsIJVMPlugin object (done by the Initialize - // method). - nsresult - StartupJVM(void); - - // Causes the JVM to append a new directory to its classpath. - // If the JVM doesn't support this operation, an error is returned. - NS_IMETHOD - AddToClassPath(const char* dirPath); - - // Causes the JVM to remove a directory from its classpath. - // If the JVM doesn't support this operation, an error is returned. - NS_IMETHOD - RemoveFromClassPath(const char* dirPath) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - // Returns the current classpath in use by the JVM. - NS_IMETHOD - GetClassPath(const char* *result); - - NS_IMETHOD - GetJavaWrapper(JNIEnv* env, jint jsobj, jobject *jobj); - - /** - * This creates a new secure communication channel with Java. The second parameter, - * nativeEnv, if non-NULL, will be the actual thread for Java communication. - * Otherwise, a new thread should be created. - * @param proxyEnv the env to be used by all clients on the browser side - * @return outSecureEnv the secure environment used by the proxyEnv - */ - NS_IMETHOD - CreateSecureEnv(JNIEnv* proxyEnv, nsISecureEnv* *outSecureEnv); - - /** - * Gives time to the JVM from the main event loop of the browser. This is - * necessary when there aren't any plugin instances around, but Java threads exist. - */ - NS_IMETHOD - SpendTime(PRUint32 timeMillis); - - NS_IMETHOD - UnwrapJavaWrapper(JNIEnv* jenv, jobject jobj, jint* obj); - - - // nsIJVMConsole methods - - NS_IMETHOD - Show(void); - - NS_IMETHOD - Hide(void); - - NS_IMETHOD - IsVisible(PRBool *result); - - NS_IMETHOD - Print(const char* msg, const char* encodingName = NULL); - - // nsIRunnable methods - - /** - * The Run method gives time to the JVM periodically. This makes SpendTIme() obsolete. - */ - NS_IMETHOD - Run(); - - // NON-INTERFACE methods, for internal use only. - - MRJSession* getSession(); - nsIJVMManager* getManager(); - nsIThreadManager* getThreadManager(); - - MRJPluginInstance* getPluginInstance(jobject applet); - MRJPluginInstance* getPluginInstance(JNIEnv* jenv); - - Boolean inPluginThread(); - -private: - nsIJVMManager* mManager; - nsIThreadManager* mThreadManager; - MRJSession* mSession; - MRJConsole* mConsole; - nsPluginThread *mPluginThreadID; - Boolean mIsEnabled; - - // support for SupportsMixin. - static const InterfaceInfo sInterfaces[]; - static const UInt32 kInterfaceCount; -}; - -class MRJPluginInstance : public nsIPluginInstance, public nsIJVMPluginInstance, - public nsIEventHandler, public nsIPluginStreamListener, - private SupportsMixin { -public: - MRJPluginInstance(MRJPlugin* plugin); - virtual ~MRJPluginInstance(); - - // NS_DECL_ISUPPORTS - DECL_SUPPORTS_MIXIN - - // (Corresponds to NPP_HandleEvent.) - NS_IMETHOD - HandleEvent(nsPluginEvent* event, PRBool* handled); - - /** - * Initializes a newly created plugin instance, passing to it the plugin - * instance peer which it should use for all communication back to the browser. - * - * @param peer - the corresponding plugin instance peer - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Initialize(nsIPluginInstancePeer* peer); - - /** - * Returns a reference back to the plugin instance peer. This method is - * used whenever the browser needs to obtain the peer back from a plugin - * instance. The implementation of this method should be sure to increment - * the reference count on the peer by calling AddRef. - * - * @param resultingPeer - the resulting plugin instance peer - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - GetPeer(nsIPluginInstancePeer* *result); - - /** - * Called to instruct the plugin instance to start. This will be called after - * the plugin is first created and initialized, and may be called after the - * plugin is stopped (via the Stop method) if the plugin instance is returned - * to in the browser window's history. - * - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Start(void); - - /** - * Called to instruct the plugin instance to stop, thereby suspending its state. - * This method will be called whenever the browser window goes on to display - * another page and the page containing the plugin goes into the window's history - * list. - * - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Stop(void); - - /** - * Called to instruct the plugin instance to destroy itself. This is called when - * it become no longer possible to return to the plugin instance, either because - * the browser window's history list of pages is being trimmed, or because the - * window containing this page in the history is being closed. - * - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Destroy(void); - - /** - * Called when the window containing the plugin instance changes. - * - * (Corresponds to NPP_SetWindow.) - * - * @param window - the plugin window structure - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - SetWindow(nsPluginWindow* window); - - /** - * Called to tell the plugin that the initial src/data stream is - * ready. Expects the plugin to return a nsIPluginStreamListener. - * - * (Corresponds to NPP_NewStream.) - * - * @param listener - listener the browser will use to give the plugin the data - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - NewStream(nsIPluginStreamListener** listener) - { - *listener = this; - AddRef(); - return NS_OK; - } - - /** - * Called to instruct the plugin instance to print itself to a printer. - * - * (Corresponds to NPP_Print.) - * - * @param platformPrint - platform-specific printing information - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - Print(nsPluginPrint* platformPrint); - - /** - * Returns the value of a variable associated with the plugin instance. - * - * @param variable - the plugin instance variable to get - * @param value - the address of where to store the resulting value - * @result - NS_OK if this operation was successful - */ - NS_IMETHOD - GetValue(nsPluginInstanceVariable variable, void *value); - - // nsIJVMPluginInstance methods. - - // This method is called when LiveConnect wants to find the Java object - // associated with this plugin instance, e.g. the Applet or JavaBean object. - NS_IMETHOD - GetJavaObject(jobject *result); - - NS_IMETHOD - GetText(const char* *result) - { - *result = NULL; - return NS_OK; - } - - // nsIPluginStreamListener implementation. - - /** - * Notify the observer that the URL has started to load. This method is - * called only once, at the beginning of a URL load.

- * - * @return The return value is currently ignored. In the future it may be - * used to cancel the URL load.. - */ - NS_IMETHOD - OnStartBinding(nsIPluginStreamInfo* pluginInfo) - { - return NS_OK; - } - - /** - * Notify the client that data is available in the input stream. This - * method is called whenver data is written into the input stream by the - * networking library...

- * - * @param aIStream The input stream containing the data. This stream can - * be either a blocking or non-blocking stream. - * @param length The amount of data that was just pushed into the stream. - * @return The return value is currently ignored. - */ - NS_IMETHOD - OnDataAvailable(nsIPluginStreamInfo* pluginInfo, nsIInputStream* input, PRUint32 length); - - NS_IMETHOD - OnFileAvailable(nsIPluginStreamInfo* pluginInfo, const char* fileName) - { - return NS_ERROR_NOT_IMPLEMENTED; - } - - /** - * Notify the observer that the URL has finished loading. This method is - * called once when the networking library has finished processing the - * URL transaction initiatied via the nsINetService::Open(...) call.

- * - * This method is called regardless of whether the URL loaded successfully.

- * - * @param status Status code for the URL load. - * @param msg A text string describing the error. - * @return The return value is currently ignored. - */ - NS_IMETHOD - OnStopBinding(nsIPluginStreamInfo* pluginInfo, nsresult status) - { - return NS_OK; - } - - /** - * What is this method supposed to do? - */ - NS_IMETHOD - GetStreamType(nsPluginStreamType *result) - { - *result = nsPluginStreamType_Normal; - return NS_OK; - } - - // Accessing the list of instances. - static MRJPluginInstance* getInstances(void); - MRJPluginInstance* getNextInstance(void); - - MRJContext* getContext(void); - MRJSession* getSession(void); - -private: - void pushInstance(void); - void popInstance(void); - void inspectInstance(Boolean isUpdateEvt); - -private: - nsIPluginInstancePeer* mPeer; - nsIWindowlessPluginInstancePeer* mWindowlessPeer; - MRJPlugin* mPlugin; - MRJSession* mSession; - MRJContext* mContext; - jobject mApplet; - nsPluginWindow* mPluginWindow; - - // maintain a list of instances. - MRJPluginInstance* mNext; - - // support for SupportsMixin. - static const InterfaceInfo sInterfaces[]; - static const UInt32 kInterfaceCount; -}; diff --git a/plugin/oji/MRJCarbon/plugin/Source/MRJPluginCarbon_config.h b/plugin/oji/MRJCarbon/plugin/Source/MRJPluginCarbon_config.h deleted file mode 100644 index d69ce90bf6c8..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/MRJPluginCarbon_config.h +++ /dev/null @@ -1,48 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - MRJPluginCarbon_config.h - - Global configuration defines used by the MRJ plugin. - - by Patrick C. Beard. - */ - -#define TARGET_CARBON 1 -#define USE_SYSTEM_CONSOLE 1 - -#include diff --git a/plugin/oji/MRJCarbon/plugin/Source/MRJPlugin_4.x_config.h b/plugin/oji/MRJCarbon/plugin/Source/MRJPlugin_4.x_config.h deleted file mode 100644 index ca6dec772668..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/MRJPlugin_4.x_config.h +++ /dev/null @@ -1,48 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - MRJPlugin_4.x_config.h - - Global configuration defines used by the MRJ plugin. - - by Patrick C. Beard. - */ - -#include "MacHeaders.h" - -#define MRJPLUGIN_4X 1 - diff --git a/plugin/oji/MRJCarbon/plugin/Source/MRJPlugin_GC_config.h b/plugin/oji/MRJCarbon/plugin/Source/MRJPlugin_GC_config.h deleted file mode 100644 index 39dece5d68e5..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/MRJPlugin_GC_config.h +++ /dev/null @@ -1,47 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - MRJPlugin_GC_config.h - - Global configuration defines used by the MRJ plugin. - - by Patrick C. Beard. - */ - -#include "MacHeaders.h" - -#define MRJPLUGIN_GC 1 diff --git a/plugin/oji/MRJCarbon/plugin/Source/MRJPlugin_config.h b/plugin/oji/MRJCarbon/plugin/Source/MRJPlugin_config.h deleted file mode 100644 index 397e83936731..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/MRJPlugin_config.h +++ /dev/null @@ -1,47 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - MRJPlugin_config.h - - Global configuration defines used by the MRJ plugin. - - by Patrick C. Beard. - */ - -#include "MacHeaders.h" - -/* #define NEW_PLUGIN_STREAM_API */ diff --git a/plugin/oji/MRJCarbon/plugin/Source/MRJSecurityContext.h b/plugin/oji/MRJCarbon/plugin/Source/MRJSecurityContext.h deleted file mode 100644 index 34a993e0a705..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/MRJSecurityContext.h +++ /dev/null @@ -1,59 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -#pragma once - -#include "nsISecurityContext.h" - -class nsILiveconnect; - -class MRJSecurityContext : public nsISecurityContext { -public: - MRJSecurityContext(const char* location); - ~MRJSecurityContext(); - - NS_DECL_ISUPPORTS - - NS_IMETHOD Implies(const char* target, const char* action, PRBool *bAllowedAccess); - NS_IMETHOD GetOrigin(char* buf, int len); - NS_IMETHOD GetCertificateID(char* buf, int len); - - nsILiveconnect* getConnection() { return mConnection; } - -private: - char* mLocation; - nsILiveconnect* mConnection; -}; diff --git a/plugin/oji/MRJCarbon/plugin/Source/MRJSession.cpp b/plugin/oji/MRJCarbon/plugin/Source/MRJSession.cpp deleted file mode 100644 index d18c09fc05b6..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/MRJSession.cpp +++ /dev/null @@ -1,543 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - MRJSession.cpp - - Encapsulates a session with the MacOS Runtime for Java. - - by Patrick C. Beard. - */ - -#include "MRJSession.h" -#include "MRJPlugin.h" -#include "MRJContext.h" -#include "MRJConsole.h" -#include "MRJMonitor.h" -#include "TimedMessage.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -extern MRJConsole* theConsole; -extern short thePluginRefnum; -extern FSSpec thePluginSpec; - -static MRJSession* theSession; - -#if REDIRECT_VFPRINTF - -/** - * As of JDK 1.2, there is a standard way to redirect *LOW LEVEL* messages from the JVM by - * providing a vfprintf hook. Since this plugin is built using CFM compilers, this means - * the function pointer has to be wrapped in glue code which can be called from Mach-O. - * To get low level messages to go to the same location as Java's System.out/err, we can - * try various techniques. One way would be to have all output go through a common - * native method, which ends up calling java_vfprintf. Another way, is to send output - * to Java from java_vfprintf. It turns out that you can't always do this safely, - * so you have to send the messages later at a known safe time. The current implementation - * uses a Carbon Events timer to delay sending the message to Java. This has the unfortunate - * side effect of reordering messages sent through java_vfprintf with respect to those - * sent through System.out/err. - */ - -// -// This function allocates a block of CFM glue code which contains the instructions to call CFM routines -// -static void* NewMachOFunctionPointer(void* cfmfp) -{ -#if TARGET_RT_MAC_CFM - static UInt32 CFM_glue[6] = {0x3D800000, 0x618C0000, 0x800C0000, 0x804C0004, 0x7C0903A6, 0x4E800420}; - UInt32 *mfp = (UInt32*) NewPtr(sizeof(CFM_glue)); // Must later dispose of allocated memory - if (mfp) { - BlockMoveData(CFM_glue, mfp, sizeof(CFM_glue)); - mfp[0] |= ((UInt32)cfmfp >> 16); - mfp[1] |= ((UInt32)cfmfp & 0xFFFF); - MakeDataExecutable(mfp, sizeof(CFM_glue)); - } - return mfp; -#elif TARGET_RT_MAC_MACHO - return cfmfp; -#endif -} - -inline jobject ToGlobalRef(JNIEnv* env, jobject localRef) -{ - jobject globalRef = env->NewGlobalRef(localRef); - env->DeleteLocalRef(localRef); - return globalRef; -} - -static jobject Get_System_out(JNIEnv* env) -{ - jclass java_lang_System = env->FindClass("java/lang/System"); - if (java_lang_System) { - jfieldID outID = env->GetStaticFieldID(java_lang_System, "out", "Ljava/io/PrintStream;"); - jobject out = (outID ? env->GetStaticObjectField(java_lang_System, outID) : NULL); - env->DeleteLocalRef(java_lang_System); - return ToGlobalRef(env, out); - } - return NULL; -} - -static jmethodID GetObjectMethodID(JNIEnv* env, jobject object, const char* name, const char* sig) -{ - jclass clazz = env->GetObjectClass(object); - if (clazz) { - jmethodID result = env->GetMethodID(clazz, name, sig); - env->DeleteLocalRef(clazz); - return result; - } - return NULL; -} - -static void System_out_print(JNIEnv* env, const jchar* chars, jsize len) -{ - static jobject java_lang_System_out = Get_System_out(env); - static jmethodID java_io_PrintStream_print = GetObjectMethodID(env, java_lang_System_out, "print", "([C)V"); - jcharArray array = env->NewCharArray(len); - if (array) { - env->SetCharArrayRegion(array, 0, len, (jchar*) chars); - env->CallVoidMethod(java_lang_System_out, java_io_PrintStream_print, array); - env->DeleteLocalRef(array); - } -} - -/** - * Sends a message to the Java Console from a Carbon - * Events timer. This is done asynchronously so that - * messages from deep within the JavaVM can be processed - * using the JavaVM. - */ -class ConsoleMessage : public TimedMessage { - CFStringRef mMessage; - -public: - ConsoleMessage(CFStringRef message) - : mMessage(message) - { - ::CFRetain(mMessage); - } - - ~ConsoleMessage() - { - ::CFRelease(mMessage); - } - - virtual void execute(); -}; - -void ConsoleMessage::execute() -{ - if (theSession) { - jsize len = ::CFStringGetLength(mMessage); - jchar* buffer = new jchar[len]; - CFRange range = { 0, len }; - CFStringGetCharacters(mMessage, range, buffer); - System_out_print(theSession->getCurrentEnv(), buffer, len); - delete[] buffer; - } -} - -static jint JNICALL java_vfprintf(FILE *fp, const char *format, va_list args) -{ - jint result = 0; - CFStringRef formatRef = CFStringCreateWithCString(NULL, format, kCFStringEncodingASCII); - if (formatRef) { - CFStringRef text = CFStringCreateWithFormatAndArguments(NULL, NULL, formatRef, args); - CFRelease(formatRef); - if (text) { - ConsoleMessage* message = new ConsoleMessage(text); - if (message) { - if (message->send() != noErr) - delete message; - } - result = ::CFStringGetLength(text); - ::CFRelease(text); - } - } - return result; -} - -#endif /* REDIRECT_VFPRINTF */ - -MRJSession::MRJSession() - : mStatus(noErr), mMainEnv(NULL), mJavaVM(NULL), mSession(NULL), - mFirst(NULL), mLast(NULL), mMessageMonitor(NULL), mLockCount(0) -{ -} - -MRJSession::~MRJSession() -{ - close(); -} - -OSStatus MRJSession::open(const char* consolePath) -{ - // Use vanilla JNI invocation API to fire up a fresh JVM. - string classPath = getClassPath(); - string pluginHome = getPluginHome(); - JavaVMOption theOptions[] = { - { (char*) classPath.c_str() }, - { (char*) pluginHome.c_str() }, -#if REDIRECT_VFPRINTF - { "vfprintf", NewMachOFunctionPointer(&java_vfprintf) } -#endif - }; - - JavaVMInitArgs theInitArgs = { - JNI_VERSION_1_2, - sizeof(theOptions) / sizeof(JavaVMOption), - theOptions, - JNI_TRUE - }; - - mStatus = ::JNI_CreateJavaVM(&mJavaVM, (void**) &mMainEnv, &theInitArgs); - - if (mStatus == noErr) { - // create a monitor for the message queue to unblock Java threads. - mMessageMonitor = new MRJMonitor(this); - } - - JNIEnv* env = mMainEnv; - jclass session = env->FindClass("netscape/oji/MRJSession"); - if (session) { - mSession = (jclass) env->NewGlobalRef(session); - jmethodID openMethod = env->GetStaticMethodID(session, "open", "(Ljava/lang/String;)V"); - if (openMethod) { - jstring path = env->NewStringUTF(consolePath); - if (path) { - env->CallStaticVoidMethod(session, openMethod, path); - if (env->ExceptionCheck()) - env->ExceptionClear(); - env->DeleteLocalRef(path); - } - } else { - env->ExceptionClear(); - } - env->DeleteLocalRef(session); - } else { - env->ExceptionClear(); - } - - if (mStatus == noErr) - theSession = this; - -#if REDIRECT_VFPRINTF - // XXX test the vfprintf function. - jclass notThere = env->FindClass("class/not/Found"); - if (env->ExceptionCheck()) { - env->ExceptionDescribe(); - env->ExceptionClear(); - } -#endif - - return mStatus; -} - -OSStatus MRJSession::close() -{ - theSession = NULL; - - if (mJavaVM) { - if (mMessageMonitor != NULL) { - mMessageMonitor->notifyAll(); - delete mMessageMonitor; - mMessageMonitor = NULL; - } - - if (mSession) { - jclass session = mSession; - JNIEnv* env = mMainEnv; - jmethodID closeMethod = env->GetStaticMethodID(session, "close", "()V"); - if (closeMethod) - env->CallStaticVoidMethod(session, closeMethod); - else - env->ExceptionClear(); - env->DeleteGlobalRef(mSession); - mSession = NULL; - } - -#if !TARGET_RT_MAC_MACHO // XXX right now, this hangs Chimera... - mJavaVM->DestroyJavaVM(); -#endif - mJavaVM = NULL; - } - return noErr; -} - -JNIEnv* MRJSession::getCurrentEnv() -{ - JNIEnv* env; - if (mJavaVM->GetEnv((void**)&env, JNI_VERSION_1_2) == JNI_OK) - return env; - return NULL; -} - -JNIEnv* MRJSession::getMainEnv() -{ - return mMainEnv; -} - -JavaVM* MRJSession::getJavaVM() -{ - return mJavaVM; -} - -Boolean MRJSession::onMainThread() -{ - return (getCurrentEnv() == mMainEnv); -} - -inline StringPtr c2p(const char* cstr, StringPtr pstr) -{ - pstr[0] = (unsigned char)strlen(cstr); - ::BlockMoveData(cstr, pstr + 1, pstr[0]); - return pstr; -} - -Boolean MRJSession::addToClassPath(const FSSpec& fileSpec) -{ - // if the Java VM has started already, it's too late to do this (for now). - if (mJavaVM) - return false; - - // keep accumulating paths. - FSRef ref; - OSStatus status = FSpMakeFSRef(&fileSpec, &ref); - if (status == noErr) - mClassPath.push_back(ref); - - return true; -} - -Boolean MRJSession::addToClassPath(const char* dirPath) -{ - // Need to convert the path into an FSSpec, and add it MRJ's class path. - Str255 path; - FSSpec pathSpec; - OSStatus status = ::FSMakeFSSpec(0, 0, c2p(dirPath, path), &pathSpec); - if (status == noErr) - return addToClassPath(pathSpec); - return false; -} - -Boolean MRJSession::addURLToClassPath(const char* fileURL) -{ - Boolean success = false; - // Use CFURL, FSRef and FSSpec? - CFURLRef fileURLRef = CFURLCreateWithBytes(NULL, (UInt8*)fileURL, strlen(fileURL), - kCFStringEncodingUTF8, NULL); - if (fileURLRef) { - FSRef fsRef; - if (CFURLGetFSRef(fileURLRef, &fsRef)) { - mClassPath.push_back(fsRef); - success = true; - } - CFRelease(fileURLRef); - } - return success; -} - -char* MRJSession::getProperty(const char* propertyName) -{ - char* result = NULL; -#if !TARGET_CARBON - OSStatus status = noErr; - JMTextRef nameRef = NULL, valueRef = NULL; - status = ::JMNewTextRef(mSession, &nameRef, kTextEncodingMacRoman, propertyName, strlen(propertyName)); - if (status == noErr) { - status = ::JMGetSessionProperty(mSession, nameRef, &valueRef); - ::JMDisposeTextRef(nameRef); - if (status == noErr && valueRef != NULL) { - UInt32 valueLength = 0; - status = ::JMGetTextLengthInBytes(valueRef, kTextEncodingMacRoman, &valueLength); - if (status == noErr) { - result = new char[valueLength + 1]; - if (result != NULL) { - UInt32 actualLength; - status = ::JMGetTextBytes(valueRef, kTextEncodingMacRoman, result, valueLength, &actualLength); - result[valueLength] = '\0'; - } - ::JMDisposeTextRef(valueRef); - } - } - } -#endif - return result; -} - -void MRJSession::setStatus(OSStatus status) -{ - mStatus = status; -} - -OSStatus MRJSession::getStatus() -{ - return mStatus; -} - -void MRJSession::idle(UInt32 milliseconds) -{ - // Each call to idle processes a single message. - dispatchMessage(); - -#if !TARGET_CARBON - // Guard against entering the VM multiple times. - if (mLockCount == 0) { - lock(); - mStatus = ::JMIdle(mSession, milliseconds); - unlock(); - } -#endif -} - -void MRJSession::sendMessage(NativeMessage* message, Boolean async) -{ - // can't block the main env, otherwise messages will never be processed! - if (onMainThread()) { - message->execute(); - } else { - postMessage(message); - if (!async) - mMessageMonitor->wait(); - } -} - -/** - * Put a message on the queue. - */ -void MRJSession::postMessage(NativeMessage* message) -{ - if (mFirst == NULL) { - mFirst = mLast = message; - } else { - mLast->setNext(message); - mLast = message; - } - message->setNext(NULL); -} - -void MRJSession::dispatchMessage() -{ - if (mFirst != NULL) { - NativeMessage* message = mFirst; - mFirst = message->getNext(); - if (mFirst == NULL) mLast = NULL; - - message->setNext(NULL); - message->execute(); - mMessageMonitor->notify(); - } -} - -void MRJSession::lock() -{ - ++mLockCount; -} - -void MRJSession::unlock() -{ - --mLockCount; -} - -static OSStatus ref2path(const FSRef& ref, char* path, UInt32 maxPathSize) -{ - return FSRefMakePath(&ref, (UInt8*)path, maxPathSize); -} - -static OSStatus spec2path(const FSSpec& spec, char* path, UInt32 maxPathSize) -{ - FSRef ref; - OSStatus status = FSpMakeFSRef(&spec, &ref); - if (status == noErr) - status = ref2path(ref, path, maxPathSize); - return status; -} - -string MRJSession::getClassPath() -{ - // to work around problem in Mac OS X 10.2 (Jaguar) (bugzilla #164712), - // put our classes in the boot class path. - string classPath("-Xbootclasspath/p:"); - - // keep appending paths make from FSSpecs. - MRJClassPath::const_iterator i = mClassPath.begin(); - if (i != mClassPath.end()) { - char path[1024]; - if (ref2path(*i, path, sizeof(path)) == noErr) - classPath += path; - ++i; - while (i != mClassPath.end()) { - if (ref2path(*i, path, sizeof(path)) == noErr) { - classPath += ":"; - classPath += path; - } - ++i; - } - } - - return classPath; -} - -string MRJSession::getPluginHome() -{ - string pluginHome("-Dnetscape.oji.plugin.home="); - - char path[1024]; - if (spec2path(thePluginSpec, path, sizeof(path)) == noErr) { - char* lastSlash = strrchr(path, '/'); - if (lastSlash) { - *lastSlash = '\0'; - pluginHome += path; - } - } - - return pluginHome; -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/MRJSession.h b/plugin/oji/MRJCarbon/plugin/Source/MRJSession.h deleted file mode 100644 index 700a00679df0..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/MRJSession.h +++ /dev/null @@ -1,132 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - MRJSession.h - - Encapsulates a session with the MacOS Runtime for Java. - - by Patrick C. Beard. - */ - -#pragma once - -#include - -#include - -#include -#include - -using std::vector; -using std::string; - -class NativeMessage { -public: - NativeMessage() : mNext(NULL) {} - virtual ~NativeMessage() {} - - virtual void execute() = 0; - - void setNext(NativeMessage* next) { mNext = next; } - NativeMessage* getNext() { return mNext; } - -private: - NativeMessage* mNext; -}; - -// FIXME: need an interface for setting security options, etc. - -class MRJContext; -class Monitor; - -class MRJSession { -public: - MRJSession(); - virtual ~MRJSession(); - - OSStatus open(const char* consolePath); - OSStatus close(); - - JNIEnv* getCurrentEnv(); - JNIEnv* getMainEnv(); - JavaVM* getJavaVM(); - - Boolean onMainThread(); - - Boolean addToClassPath(const FSSpec& fileSpec); - Boolean addToClassPath(const char* dirPath); - Boolean addURLToClassPath(const char* fileURL); - - char* getProperty(const char* propertyName); - - void setStatus(OSStatus status); - OSStatus getStatus(); - - void idle(UInt32 milliseconds = 0x00000400); - - void sendMessage(NativeMessage* message, Boolean async = false); - - /** - * Used to prevent reentering the VM. - */ - void lock(); - void unlock(); - -private: - void postMessage(NativeMessage* message); - void dispatchMessage(); - - string getClassPath(); - string getPluginHome(); - -private: - OSStatus mStatus; - - typedef vector MRJClassPath; - MRJClassPath mClassPath; - - JNIEnv* mMainEnv; - JavaVM* mJavaVM; - jclass mSession; - - // Message queue. - NativeMessage* mFirst; - NativeMessage* mLast; - Monitor* mMessageMonitor; - - UInt32 mLockCount; -}; diff --git a/plugin/oji/MRJCarbon/plugin/Source/MRJSession.java b/plugin/oji/MRJCarbon/plugin/Source/MRJSession.java deleted file mode 100644 index 1f43ed18d3b2..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/MRJSession.java +++ /dev/null @@ -1,112 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -package netscape.oji; - -import java.io.*; -import java.awt.*; -import java.awt.event.*; -import java.util.Date; -import java.util.Properties; -import java.net.URL; - -/** - * Performs startup actions on behalf of the MRJ plugin. - * 1. Sends System.out/err to a specified disk file. - * 2. Installs an appropriate security manager for - * integrating with the Netscape 6 security system. - */ -public class MRJSession { - // Save primordial System streams. - private static PrintStream out; - private static PrintStream err; - private static PrintStream console; - - private static Properties loadProperties(String pluginHome) { - Properties props = new Properties(); - try { - InputStream propsStream = new FileInputStream(pluginHome + "/MRJPlugin.properties"); - props.load(propsStream); - propsStream.close(); - } catch (IOException ex) { - } - return props; - } - - public static void open(String consolePath) throws IOException { - String pluginHome = System.getProperty("netscape.oji.plugin.home"); - Properties props = loadProperties(pluginHome); - boolean append = Boolean.valueOf(props.getProperty("netscape.oji.plugin.console.append")).booleanValue(); - - // Make sure the parent directories exist. - File consoleFile = new File(consolePath); - File parentFile = consoleFile.getParentFile(); - if (!parentFile.exists()) { - parentFile.mkdirs(); - } - - // redirect console I/O to specified file. - MRJSession.out = System.out; - MRJSession.err = System.err; - console = new PrintStream(new FileOutputStream(consolePath, append)); - System.setOut(console); - System.setErr(console); - - Date date = new Date(); - String version = props.getProperty("netscape.oji.plugin.version"); - System.out.println("MRJ Plugin for Mac OS X v" + version); - System.out.println("[starting up Java Applet Security @ " + date + "]"); - - // bring up MRJ Applet Security. - if (System.getSecurityManager() == null) { - try { - // make sure that the classes in MRJPlugin.jar are granted all permissions. - // see p. 117 of "Inside Java 2 Platform Security" for more information. - System.setProperty("java.security.policy", "file:" + pluginHome + "/MRJPlugin.policy"); - String name = props.getProperty("netscape.oji.plugin.security"); - SecurityManager securityManager = (SecurityManager) Class.forName(name).newInstance(); - System.setSecurityManager(securityManager); - } catch (Exception ex) { - } - } - } - - public static void close() throws IOException { - System.setOut(MRJSession.out); - System.setErr(MRJSession.err); - console.close(); - } -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/Monitor.h b/plugin/oji/MRJCarbon/plugin/Source/Monitor.h deleted file mode 100644 index c6d27fa271d3..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/Monitor.h +++ /dev/null @@ -1,58 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - Monitor.h - - Abstract class representing monitors. - - by Patrick C. Beard. - */ - -#pragma once - -class Monitor { -public: - virtual ~Monitor() {} - - virtual void enter() = 0; - virtual void exit() = 0; - - virtual void wait() = 0; - virtual void wait(long long millis) = 0; - virtual void notify() = 0; - virtual void notifyAll() = 0; -}; diff --git a/plugin/oji/MRJCarbon/plugin/Source/NativeMonitor.cpp b/plugin/oji/MRJCarbon/plugin/Source/NativeMonitor.cpp deleted file mode 100644 index 02fbf89c5fd5..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/NativeMonitor.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - NativeMonitor.cpp - - Provides a C++ interface to native monitors. - - by Patrick C. Beard. - */ - -#include "NativeMonitor.h" -#include "MRJSession.h" -#include "nsIThreadManager.h" - -NativeMonitor::NativeMonitor(MRJSession* session, nsIThreadManager* manager, void* address) - : mSession(session), mManager(manager), mAddress(address) -{ - if (address == NULL) - mAddress = this; -} - -NativeMonitor::~NativeMonitor() {} - -void NativeMonitor::enter() -{ - mManager->EnterMonitor(mAddress); -} - -void NativeMonitor::exit() -{ - mManager->ExitMonitor(mAddress); -} - -void NativeMonitor::wait() -{ - // this is weird hackery, but we don't want to let the VM be reentered while we wait on a native monitor. - Boolean inJavaThread = (mSession->getMainEnv() != mSession->getCurrentEnv()); - if (inJavaThread) - mSession->lock(); - - if (mManager->EnterMonitor(mAddress) == NS_OK) { - mManager->Wait(mAddress); - mManager->ExitMonitor(mAddress); - } - - if (inJavaThread) - mSession->unlock(); -} - -void NativeMonitor::wait(long long millis) -{ - if (mManager->EnterMonitor(mAddress) == NS_OK) { - mManager->Wait(mAddress, PRUint32(millis)); - mManager->ExitMonitor(mAddress); - } -} - -void NativeMonitor::notify() -{ - if (mManager->EnterMonitor(mAddress) == NS_OK) { - mManager->Notify(mAddress); - mManager->ExitMonitor(mAddress); - } -} - -void NativeMonitor::notifyAll() -{ - if (mManager->EnterMonitor(mAddress) == NS_OK) { - mManager->NotifyAll(mAddress); - mManager->ExitMonitor(mAddress); - } -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/NativeMonitor.h b/plugin/oji/MRJCarbon/plugin/Source/NativeMonitor.h deleted file mode 100644 index eee7661db8c2..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/NativeMonitor.h +++ /dev/null @@ -1,67 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - NativeMonitor.h - - Provides a C++ interface to native monitors. - - by Patrick C. Beard. - */ - -#include "Monitor.h" - -class MRJSession; -class nsIThreadManager; - -class NativeMonitor : public Monitor { -public: - NativeMonitor(MRJSession* session, nsIThreadManager* manager, void* address = 0); - virtual ~NativeMonitor(); - - virtual void enter(); - virtual void exit(); - - virtual void wait(); - virtual void wait(long long millis); - virtual void notify(); - virtual void notifyAll(); - -private: - MRJSession* mSession; - nsIThreadManager* mManager; - void* mAddress; -}; diff --git a/plugin/oji/MRJCarbon/plugin/Source/PluginNew.cpp b/plugin/oji/MRJCarbon/plugin/Source/PluginNew.cpp deleted file mode 100644 index 39ad57faf68d..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/PluginNew.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - PluginNew.cpp - - new & delete operators for plugins. - - by Patrick C. Beard. - */ - -#include - -#include "nsIMemory.h" - -// Warning: this forces all C++ allocation to go through Navigator's memory allocation -// Routines. As such, static constructors that use operator new may not work. This can -// be fixed if we delay static construction (see the call to __InitCode__() in npmac.cpp). - -extern nsIMemory* theMemoryAllocator; - -void* operator new(size_t size) -{ - if (theMemoryAllocator) - return theMemoryAllocator->Alloc(size); - return NULL; -} - -void operator delete(void* ptr) -{ - if (ptr && theMemoryAllocator) - theMemoryAllocator->Free(ptr); -} - -void* operator new[](size_t size) -{ - if (theMemoryAllocator) - return theMemoryAllocator->Alloc(size); - return NULL; -} - -void operator delete[](void* ptr) -{ - if (ptr && theMemoryAllocator) - theMemoryAllocator->Free(ptr); -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/PrintingPort.java b/plugin/oji/MRJCarbon/plugin/Source/PrintingPort.java deleted file mode 100644 index 2423d888b56e..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/PrintingPort.java +++ /dev/null @@ -1,164 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - PrintingPort.java - - Wraps a Quickdraw printing port and provides a way to image on it - with a java.awt.Graphics object. - - by Patrick C. Beard. - */ - -package com.apple.mrj.internal.awt; - -import com.apple.mrj.macos.generated.RectStruct; -import com.apple.mrj.macos.generated.QuickdrawFunctions; -import java.awt.*; - -public class PrintingPort implements GraphicsHost { - private int mPrintingPort; - private int mOriginX; - private int mOriginY; - private PortManager mPortManager; - private QDPipeline mPipeline; - private Rectangle mClipping; - - public PrintingPort(int printingPort, int originX, int originY) { - mPrintingPort = printingPort; - mOriginX = originX; - mOriginY = originY; - mPortManager = new PortManager(printingPort, 0, 0, PortManager.kPrinting, 0); - mPipeline = new QDPipeline(); - mPortManager.setPipeline(mPipeline); - } - - public void dispose() { - // dispose of port manager flushes the pipeline. - if (mPortManager != null) { - mPortManager.dispose(); - mPortManager = null; - } - if (mPipeline != null) { - mPipeline.dispose(); - mPipeline = null; - } - } - - private static final short MAXSHORT = 32767, MINSHORT = -32768; - - static short pinToShort(int value) { - if (value > MAXSHORT) - return MAXSHORT; - else if (value < MINSHORT) - return MINSHORT; - return (short) value; - } - - final class PrintingGraphics extends QDGraphics { - /** Creates a new PrintingGraphics. You must call initialize on it next. */ - public PrintingGraphics() { - super(); - } - - public synchronized Graphics create() { - if( !internalMarkHostInUse ( ) ) - throw new AWTError("Using invalid Graphics object"); - try { - return (new PrintingGraphics()).initialize(this,fXoff,fYoff,fClip); - } finally { - internalDoneUsingHost ( ); - } - } - - public synchronized Graphics create(int x, int y, int width, int height) { - if( !internalMarkHostInUse() ) - throw new AWTError("Using invalid Graphics object"); - try { - VToolkit.intersect(sRectangle, fClip, fXoff+x,fYoff+y,width,height); - return (new PrintingGraphics()).initialize(this,fXoff+x,fYoff+y,sRectangle); - } finally { - internalDoneUsingHost ( ); - } - } - - /** - * Override QDGraphics.restore(), to reset origin and clipping during drawing. - */ - void restore() { - super.restore(); - - int port = VAWTDirect.FastGetThePort(); - if (port != mPrintingPort) - QuickdrawFunctions.SetPort(mPrintingPort); - - // restore default orgin. - QuickdrawFunctions.SetOrigin((short)0, (short)0); - - // set up correct clipping. - QDRectStruct clipRect = new QDRectStruct(); - clipRect.Set(pinToShort(mClipping.x), pinToShort(mClipping.y), - pinToShort(mClipping.x + mClipping.width), pinToShort(mClipping.y + mClipping.width)); - QuickdrawFunctions.ClipRect(clipRect); - - if (port != mPrintingPort) - QuickdrawFunctions.SetPort(port); - } - } - - /** - * Creates a graphics object that wraps the specified printing port. - * Assumes that the underlying port's coordinate system is already - * set up to have (0, 0) as the upper left corner. - */ - public Graphics getGraphics(Component component) { - mClipping = component.getBounds(); - mClipping.x = mOriginX; mClipping.y = mOriginY; - QDGraphics graphics = new PrintingGraphics(); - graphics.initialize(mPrintingPort, this, mPortManager, - mOriginX, mOriginY, mClipping, component.getForeground(), - component.getFont()); - return graphics; - } - - /** methods to satisfy GraphicsHost interface. */ - public void graphicsCreated(QDGraphics g) throws OutOfMemoryError {} - public void graphicsDisposed(QDGraphics g) {} - public RGBColorValue getBackgroundRGB() { return new RGBColorValue(Color.white); } - public void repaint(RectStruct r) {} - public boolean markInUse() { return (mPortManager != null); } - public void doneUsingIt() {} -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/ProxyClassLoaderFactory.java b/plugin/oji/MRJCarbon/plugin/Source/ProxyClassLoaderFactory.java deleted file mode 100644 index f39f6bb69e11..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/ProxyClassLoaderFactory.java +++ /dev/null @@ -1,119 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Patrick C. Beard - * Xiaobin Lu - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -package netscape.oji; - -import java.net.URLClassLoader; -import java.net.URL; -import java.net.MalformedURLException; - -import java.io.*; -import java.util.zip.*; -import java.util.WeakHashMap; - -import java.security.CodeSource; - -public abstract class ProxyClassLoaderFactory { - static void debug(String message) { - System.out.println("<<< " + message + " >>>"); - } - - /** - * Loads specified class file as an array of bytes from ${netscape.oji.plugin.home}/MRJPlugin.jar. - */ - private static byte[] getMRJPluginClassFile(String path) { - try { - String homeDir = System.getProperty("netscape.oji.plugin.home"); - ZipFile jarFile = new ZipFile(new File(homeDir, "MRJPlugin.jar")); - ZipEntry classEntry = jarFile.getEntry(path); - int size = (int) classEntry.getSize(); - if (size > 0) { - byte[] data = new byte[size]; - DataInputStream input = new DataInputStream(jarFile.getInputStream(classEntry)); - input.readFully(data); - input.close(); - jarFile.close(); - return data; - } - } catch (IOException ioe) { - } - return null; - } - - /** - * Trivial subclass of URLClassLoader that predefines the class netscape.oji.LiveConnectProxy - * as if it were loaded from the specified codebase URL passed to the constructor. - * @see netscape.oji.LiveConnectProxy - */ - private static class ProxyClassLoader extends URLClassLoader { - private static byte[] data = getMRJPluginClassFile("netscape/oji/LiveConnectProxy.class"); - ProxyClassLoader(URL[] documentURLs) { - super(documentURLs); - if (data != null) { - Class proxyClass = defineClass("netscape.oji.LiveConnectProxy", - data, 0, data.length, - new CodeSource(documentURLs[0], null)); - debug("ProxyClassLoader: defined LiveConnectProxy class."); - debug("Here're the permisssions you've got:"); - debug(proxyClass.getProtectionDomain().getPermissions().toString()); - } else { - debug("ProxyClassLoader: failed to define LiveConnectProxy class."); - } - } - } - - // XXX Should this be a weak table of some sort? - private static WeakHashMap mClassLoaders = new WeakHashMap(); - - public static ClassLoader createClassLoader(final String documentURL) throws MalformedURLException { - ClassLoader loader = (ClassLoader) mClassLoaders.get(documentURL); - if (loader == null) { - try { - URL[] documentURLs = new URL[] { new URL(documentURL) }; - loader = new ProxyClassLoader(documentURLs); - mClassLoaders.put(documentURL, loader); - } catch (MalformedURLException e) { - } - } - return loader; - } - - public static void destroyClassLoader(final String documentURL) { - mClassLoaders.remove(documentURL); - } -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/RunnableMixin.cpp b/plugin/oji/MRJCarbon/plugin/Source/RunnableMixin.cpp deleted file mode 100644 index 488584d6f657..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/RunnableMixin.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - RunnableMixin.cpp - - Provides a mixin nsIRunnable implementation. - - by Patrick C. Beard. - */ - -#include "RunnableMixin.h" - -const InterfaceInfo RunnableMixin::sInterfaces[] = { - { NS_IRUNNABLE_IID, INTERFACE_OFFSET(RunnableMixin, nsIRunnable) }, -}; -const UInt32 RunnableMixin::kInterfaceCount = sizeof(sInterfaces) / sizeof(InterfaceInfo); - -RunnableMixin::RunnableMixin() - : SupportsMixin(this, sInterfaces, kInterfaceCount) -{ -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/RunnableMixin.h b/plugin/oji/MRJCarbon/plugin/Source/RunnableMixin.h deleted file mode 100644 index ad7029aa019b..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/RunnableMixin.h +++ /dev/null @@ -1,64 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - RunnableMixin.h - - Provides a mixin nsIRunnable implementation. - - by Patrick C. Beard. - */ - -#pragma once - -#include - -#include "nsIThreadManager.h" -#include "SupportsMixin.h" - -class RunnableMixin : public nsIRunnable, private SupportsMixin { -public: - RunnableMixin(); - - DECL_SUPPORTS_MIXIN - - NS_IMETHOD Run() = 0; - -private: - // support for SupportsMixin. - static const InterfaceInfo sInterfaces[]; - static const UInt32 kInterfaceCount; -}; diff --git a/plugin/oji/MRJCarbon/plugin/Source/StringUtils.cpp b/plugin/oji/MRJCarbon/plugin/Source/StringUtils.cpp deleted file mode 100644 index 4529c758cd58..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/StringUtils.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - StringUtils.cpp - */ - -#include "StringUtils.h" - -#include - -inline unsigned char toupper(unsigned char c) -{ - return (c >= 'a' && c <= 'z') ? (c - ('a' - 'A')) : c; -} - -int strcasecmp(const char * str1, const char * str2) -{ -#if !__POWERPC__ - - const unsigned char * p1 = (unsigned char *) str1; - const unsigned char * p2 = (unsigned char *) str2; - unsigned char c1, c2; - - while (toupper(c1 = *p1++) == toupper(c2 = *p2++)) - if (!c1) - return(0); - -#else - - const unsigned char * p1 = (unsigned char *) str1 - 1; - const unsigned char * p2 = (unsigned char *) str2 - 1; - unsigned long c1, c2; - - while (toupper(c1 = *++p1) == toupper(c2 = *++p2)) - if (!c1) - return(0); - -#endif - - return(toupper(c1) - toupper(c2)); -} - -char* strdup(const char* str) -{ - if (str != NULL) { - char* result = new char[::strlen(str) + 1]; - if (result != NULL) - ::strcpy(result, str); - return result; - } - return NULL; -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/StringUtils.h b/plugin/oji/MRJCarbon/plugin/Source/StringUtils.h deleted file mode 100644 index cc54dfa0e916..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/StringUtils.h +++ /dev/null @@ -1,53 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - StringUtils.h - - String utilities. - */ - -#pragma once - -/** - * Case-insensitive string comparison. - */ -int strcasecmp(const char * str1, const char * str2); - -/** - * Duplicates a C string, returns NULL if failed, or passed NULL. - */ -char* strdup(const char* str); diff --git a/plugin/oji/MRJCarbon/plugin/Source/SupportsMixin.cpp b/plugin/oji/MRJCarbon/plugin/Source/SupportsMixin.cpp deleted file mode 100644 index 4f0e8f9cec4d..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/SupportsMixin.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - SupportsMixin.cpp - - Experimental way to implement nsISupports interface. - - by Patrick C. Beard. - */ - -#include "SupportsMixin.h" -#include "nsAgg.h" -#include - -// Standard nsISupport method implementations. - -#ifdef SUPPORT_AGGREGATION - -SupportsMixin::SupportsMixin(void* instance, const InterfaceInfo interfaces[], UInt32 interfaceCount, nsISupports* outer) - : mInstance(instance), mRefCount(0), mInterfaces(interfaces), mInterfaceCount(interfaceCount), mOuter(outer) -{ - if (mOuter != NULL) - mInner = new Inner(this); -} - -SupportsMixin::~SupportsMixin() -{ - if (mRefCount > 0) { - ::DebugStr("\pmRefCount > 0!"); - } - if (mInner != NULL) - delete mInner; -} - -/** - * The uppercase versions QueryInterface, AddRef, and Release are meant to be called by subclass - * implementations. They take aggregation into account. - */ -nsresult SupportsMixin::OuterQueryInterface(const nsIID& aIID, void** aInstancePtr) -{ - // first, see if we really implement this interface. - nsresult result = queryInterface(aIID, aInstancePtr); - // if not, then delegate to the outer object, if any. - if (result != NS_OK && mOuter != NULL) - return mOuter->QueryInterface(aIID, aInstancePtr); - else - return result; -} - -nsrefcnt SupportsMixin::OuterAddRef() -{ - nsrefcnt result = addRef(); - if (mOuter != NULL) - return mOuter->AddRef(); - return result; -} - -nsrefcnt SupportsMixin::OuterRelease() -{ - if (mOuter != NULL) { - nsIOuter* outer = NULL; - nsISupports* supports = mOuter; - static NS_DEFINE_IID(kIOuterIID, NS_IOUTER_IID); - if (mRefCount == 1 && supports->QueryInterface(kIOuterIID, &outer) == NS_OK) { - outer->ReleaseInner(mInner); - outer->Release(); - } else - release(); - return supports->Release(); - } else { - return release(); - } -} - -#else /* !SUPPORT_AGGREGATION */ - -SupportsMixin::SupportsMixin(void* instance, const InterfaceInfo interfaces[], UInt32 interfaceCount, nsISupports* /* outer */) - : mInstance(instance), mRefCount(0), mInterfaces(interfaces), mInterfaceCount(interfaceCount) -{ -} - -SupportsMixin::~SupportsMixin() -{ - if (mRefCount > 0) { - ::DebugStr("\pmRefCount > 0!"); - } -} - -#endif /* !SUPPORT_AGGREGATION */ - -/** - * The lowercase implementations of queryInterface, addRef, and release all act locally - * on the current object, regardless of aggregation. They are meant to be called by - * aggregating outer objects. - */ -NS_IMETHODIMP SupportsMixin::queryInterface(const nsIID& aIID, void** aInstancePtr) -{ - if (aInstancePtr == NULL) { - return NS_ERROR_NULL_POINTER; - } - // first check to see if it's one of our known interfaces. - // need to solve the non-left inheritance graph case. - const InterfaceInfo* interfaces = mInterfaces; - UInt32 count = mInterfaceCount; - for (UInt32 i = 0; i < count; i++) { - if (aIID.Equals(interfaces[i].mIID)) { - *aInstancePtr = (void*) (UInt32(mInstance) + interfaces[i].mOffset); - addRef(); - return NS_OK; - } - } - // finally, does the interface match nsISupports? - static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - if (aIID.Equals(kISupportsIID)) { - *aInstancePtr = (void*) mInstance; - addRef(); - return NS_OK; - } - return NS_NOINTERFACE; -} - -NS_IMETHODIMP_(nsrefcnt) SupportsMixin::addRef() -{ - IncrementAtomic((SInt32*)&mRefCount); - return mRefCount; -} - -NS_IMETHODIMP_(nsrefcnt) SupportsMixin::release() -{ - // NOTE: IncrementAtomic increments the value by 1 and DecrementAtomic decrements it by 1. - // These functions return the value as it was before the change. - if (DecrementAtomic((SInt32*)&mRefCount) == 1) { - delete this; - return 0; - } - return mRefCount; -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/SupportsMixin.h b/plugin/oji/MRJCarbon/plugin/Source/SupportsMixin.h deleted file mode 100644 index 2ffbfb3afa65..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/SupportsMixin.h +++ /dev/null @@ -1,123 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - SupportsMixin.h - - Experimental way to implement nsISupports interface. - - Uses table-driven approach for fast lookup. - - Aggregation support isn't quite here yet, it requires a helper object that is referenced only by the outer object, - whose QueryInterace, AddRef, and Release act only locally (i.e. they call queryInterface, addRef, and release). - However, if we're not using aggregation (hardly ever are) it seems wasteful to define the helper object. - - by Patrick C. Beard. - */ - -#pragma once - -#include - -#include "nsISupports.h" - -// #define SUPPORT_AGGREGATION - -struct InterfaceInfo { - nsID mIID; // the IID of this interface. - UInt32 mOffset; // the offset of this interface. -}; - -class SupportsMixin { -public: - // These act locally on the current object, and are meant to be called by sub-classes. - nsresult queryInterface(const nsIID& aIID, void** aInstancePtr); - nsrefcnt addRef(void); - nsrefcnt release(void); - -protected: - SupportsMixin(void* instance, const InterfaceInfo interfaces[], UInt32 interfaceCount, nsISupports* outer = NULL); - virtual ~SupportsMixin(); - -#ifdef SUPPORT_AGGREGATION - NS_METHOD OuterQueryInterface(REFNSIID aIID, void** aInstancePtr); - NS_METHOD_(nsrefcnt) OuterAddRef(void); - NS_METHOD_(nsrefcnt) OuterRelease(void); -#endif - -private: - void* mInstance; - nsrefcnt mRefCount; - const InterfaceInfo* mInterfaces; - UInt32 mInterfaceCount; - -#ifdef SUPPORT_AGGREGATION - nsISupports* mOuter; - - class Inner : public nsISupports { - public: - NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) { return mSupports->queryInterface(aIID, aInstancePtr); } - NS_IMETHOD_(nsrefcnt) AddRef(void) { return mSupports->addRef(); } - NS_IMETHOD_(nsrefcnt) Release(void) { return mSupports->release(); } - - Inner(SupportsMixin* supports) : mSupports(supports) {} - - private: - SupportsMixin* mSupports; - }; - - Inner* mInner; -#endif -}; - -#ifdef SUPPORT_AGGREGATION - -#define DECL_SUPPORTS_MIXIN \ - NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) { return OuterQueryInterface(aIID, aInstancePtr); } \ - NS_IMETHOD_(nsrefcnt) AddRef(void) { return OuterAddRef(); } \ - NS_IMETHOD_(nsrefcnt) Release(void) { return OuterRelease(); } - -#else - -#define DECL_SUPPORTS_MIXIN \ - NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) { return queryInterface(aIID, aInstancePtr); } \ - NS_IMETHOD_(nsrefcnt) AddRef(void) { return addRef(); } \ - NS_IMETHOD_(nsrefcnt) Release(void) { return release(); } - -#endif - -#define INTERFACE_OFFSET(leafType, interfaceType) \ - UInt32((interfaceType*) ((leafType*)0)) diff --git a/plugin/oji/MRJCarbon/plugin/Source/TimedMessage.h b/plugin/oji/MRJCarbon/plugin/Source/TimedMessage.h deleted file mode 100644 index 6f1e9cadc067..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/TimedMessage.h +++ /dev/null @@ -1,56 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -#pragma once - -#include - -class TimedMessage { -public: - // Override operator new/delete for thread-safe memory allocation. - void* operator new(size_t n); - void operator delete(void* ptr); - - TimedMessage(); - virtual ~TimedMessage(); - - OSStatus send(); - virtual void execute() = 0; - -private: - static pascal void TimedMessageHandler(EventLoopTimerRef inTimer, void *inUserData); - EventLoopTimerUPP mTimerUPP; -}; diff --git a/plugin/oji/MRJCarbon/plugin/Source/TopLevelFrame.cpp b/plugin/oji/MRJCarbon/plugin/Source/TopLevelFrame.cpp deleted file mode 100644 index a2eb4addf7bf..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/TopLevelFrame.cpp +++ /dev/null @@ -1,304 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - TopLevelFrame.cpp - - An MRJFrame sub-class that manages the behavior of a top-level window - running inside the Communicator. - - by Patrick C. Beard. - */ - -#include -#include - -#include "TopLevelFrame.h" -#include "LocalPort.h" - -#include "nsIPluginManager2.h" -#include "nsIEventHandler.h" - -#if !defined(MRJPLUGIN_4X) -#define USE_ALT_WINDOW_HANDLING -#endif - -#ifdef USE_ALT_WINDOW_HANDLING -#include "AltWindowHandling.h" -#endif - -#include "nsIEventHandler.h" -#include "AltWindowHandling.h" - -extern nsIPluginManager2* thePluginManager2; - -static void UnsetPort(GrafPtr port); -static short getModifiers(); - -TopLevelFrame::TopLevelFrame(nsIEventHandler* handler, JMFrameRef frameRef, JMFrameKind kind, - const Rect* initialBounds, Boolean resizeable) - : MRJFrame(frameRef), - mHandler(handler), mWindow(NULL), mBounds(*initialBounds) -{ - Boolean hasGoAway = true; - SInt16 windowProc = documentProc; - SInt16 resizeHeight = resizeable ? 15 : 0; - - switch (kind) { - case eBorderlessModelessWindowFrame: - hasGoAway = false; - windowProc = plainDBox; - // mBounds.bottom += resizeHeight; - resizeable = false; - break; - case eModelessWindowFrame: - case eModelessDialogFrame: - hasGoAway = true; - windowProc = resizeable ? zoomDocProc : documentProc; - // mBounds.bottom += resizeHeight; - break; - case eModalWindowFrame: - hasGoAway = true; - // We have to allow resizeable modal windows. - windowProc = resizeable ? documentProc : movableDBoxProc; - break; - } - - mWindow = ::NewCWindow(NULL, &mBounds, "\p", false, windowProc, WindowPtr(-1), hasGoAway, long(this)); - if (mWindow != NULL) { - Point zeroPt = { 0, 0 }; - ::JMSetFrameVisibility(frameRef, mWindow, zeroPt, mWindow->clipRgn); - } -} - -TopLevelFrame::~TopLevelFrame() -{ - // make sure the window is hidden (and unregistered with the browser). - showHide(false); - - // make sure this port isn't ever current again. - ::UnsetPort(mWindow); - - if (mWindow != NULL) - ::DisposeWindow(mWindow); -} - -void TopLevelFrame::setSize(const Rect* newSize) -{ - mBounds = *newSize; - - if (mWindow != NULL) { - SInt16 width = newSize->right - newSize->left; - SInt16 height = newSize->bottom - newSize->top; - ::SizeWindow(mWindow, width, height, true); - ::MoveWindow(mWindow, newSize->left, newSize->top, false); - } -} - -void TopLevelFrame::invalRect(const Rect* invalidRect) -{ - if (mWindow != NULL) { - ::InvalRect(invalidRect); - } -} - -void TopLevelFrame::showHide(Boolean visible) -{ - if (mWindow != NULL && visible != IsWindowVisible(mWindow)) { - if (visible) { -#if !defined(USE_ALT_WINDOW_HANDLING) - // Have to notify the browser that this window exists, so that it will receive events. - thePluginManager2->RegisterWindow(mHandler, mWindow); - // the plugin manager takes care of showing the window. - // ::ShowWindow(mWindow); - // ::SelectWindow(mWindow); -#else - AltRegisterWindow(mHandler, mWindow); -#endif - } else { -#if defined(USE_ALT_WINDOW_HANDLING) - AltUnregisterWindow(mHandler, mWindow); -#else - // the plugin manager takes care of hiding the window. - // ::HideWindow(mWindow); - // Let the browser know it doesn't have to send events anymore. - thePluginManager2->UnregisterWindow(mHandler, mWindow); -#endif - activate(false); - } - - // ::ShowHide(mWindow, visible); - } -} - -void TopLevelFrame::setTitle(const StringPtr title) -{ - if (mWindow != NULL) { - ::SetWTitle(mWindow, title); - } -} - -void TopLevelFrame::checkUpdate() -{ -} - -void TopLevelFrame::reorder(ReorderRequest request) -{ - switch (request) { - case eBringToFront: /* bring the window to front */ - ::BringToFront(mWindow); - break; - case eSendToBack: /* send the window to back */ - ::SendBehind(mWindow, NULL); - break; - case eSendBehindFront: /* send the window behind the front window */ - WindowPtr frontWindow = ::FrontWindow(); - if (mWindow == frontWindow) { - ::SendBehind(mWindow, GetNextWindow(mWindow)); - } else { - ::SendBehind(mWindow, frontWindow); - } - break; - } -} - -void TopLevelFrame::setResizeable(Boolean resizeable) -{ - // this might have to recreate the window, no? -} - -static void computeBounds(WindowRef window, Rect* bounds) -{ - LocalPort port(window); - port.Enter(); - - Point position = { 0, 0 }; - ::LocalToGlobal(&position); - - *bounds = window->portRect; - - port.Exit(); - - ::OffsetRect(bounds, position.h, position.v); -} - -void TopLevelFrame::activate(Boolean active) -{ - focusEvent(active); - MRJFrame::activate(active); -} - -void TopLevelFrame::click(const EventRecord* event) -{ - Point where = event->where; - SInt16 modifiers = event->modifiers; - WindowRef hitWindow; - short partCode = ::FindWindow(where, &hitWindow); - switch (partCode) { - case inContent: - ::SelectWindow(mWindow); - MRJFrame::click(event); - break; - case inDrag: - { - Rect bounds = (**GetGrayRgn()).rgnBBox; - DragWindow(mWindow, where, &bounds); - computeBounds(mWindow, &bounds); - ::JMSetFrameSize(mFrameRef, &bounds); - - Point zeroPt = { 0, 0 }; - ::JMSetFrameVisibility(mFrameRef, mWindow, zeroPt, mWindow->clipRgn); - } - break; - case inGrow: - Rect limits = { 30, 30, 5000, 5000 }; - long result = GrowWindow(mWindow, where, &limits); - if (result != 0) { - short width = (result & 0xFFFF); - short height = (result >> 16) & 0xFFFF; - Rect newBounds; - topLeft(newBounds) = topLeft(mBounds); - newBounds.right = newBounds.left + width; - newBounds.bottom = newBounds.top + height; - ::JMSetFrameSize(mFrameRef, &newBounds); - - Point zeroPt = { 0, 0 }; - ::JMSetFrameVisibility(mFrameRef, mWindow, zeroPt, mWindow->clipRgn); - } - break; - case inGoAway: - if (::TrackGoAway(mWindow, where)) - ::JMFrameGoAway(mFrameRef); - break; - case inZoomIn: - case inZoomOut: - if (::TrackBox(mWindow, where, partCode)) { - ZoomWindow(mWindow, partCode, true); - computeBounds(mWindow, &mBounds); - ::JMSetFrameSize(mFrameRef, &mBounds); - } - break; - case inCollapseBox: - break; - } -} - -WindowRef TopLevelFrame::getWindow() -{ - return mWindow; -} - -GrafPtr TopLevelFrame::getPort() -{ - return mWindow; -} - -static void UnsetPort(GrafPtr port) -{ - GrafPtr curPort; - ::GetPort(&curPort); - if (curPort == port) { - ::GetWMgrPort(&port); - ::SetPort(port); - } -} - -static short getModifiers() -{ - EventRecord event; - ::OSEventAvail(0, &event); - return event.modifiers; -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/TopLevelFrame.h b/plugin/oji/MRJCarbon/plugin/Source/TopLevelFrame.h deleted file mode 100644 index 793a38c8c5b3..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/TopLevelFrame.h +++ /dev/null @@ -1,81 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - TopLevelFrame.h - - An MRJFrame sub-class that manages the behavior of a top-level window - running inside the Communicator. - - by Patrick C. Beard. - */ - -#pragma once - -#include "MRJFrame.h" - -#ifndef __MACWINDOWS__ -#include -#endif - -class nsIEventHandler; - -class TopLevelFrame : public MRJFrame { -public: - TopLevelFrame(nsIEventHandler* handler, JMFrameRef frameRef, JMFrameKind kind, const Rect* initialBounds, Boolean resizeable); - virtual ~TopLevelFrame(); - - virtual void setSize(const Rect* newSize); - virtual void invalRect(const Rect* invalidRect); - virtual void showHide(Boolean visible); - virtual void setTitle(const StringPtr title); - virtual void checkUpdate(); - virtual void reorder(ReorderRequest request); - virtual void setResizeable(Boolean resizeable); - - virtual void activate(Boolean active); - virtual void click(const EventRecord* event); - - WindowRef getWindow(); - -protected: - virtual GrafPtr getPort(); - -private: - nsIEventHandler* mHandler; - WindowRef mWindow; - Rect mBounds; -}; diff --git a/plugin/oji/MRJCarbon/plugin/Source/jGNE.cpp b/plugin/oji/MRJCarbon/plugin/Source/jGNE.cpp deleted file mode 100644 index 84d9cc9d6595..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/jGNE.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -/* - jGNE.cpp - - Provides a generalized jGNE filtering service. - - by Patrick C. Beard. - */ - -#include "jGNE.h" - -#include -#include -#include -#include - -/** - * A 68K jump vector. - */ -#pragma options align=mac68k - -struct Jump { - unsigned short jmp; - UniversalProcPtr addr; -}; - -#pragma options align=reset - -static void GNEFilter(EventRecord *event, Boolean* result); - -static RoutineDescriptor theGNEFilterDescriptor = BUILD_ROUTINE_DESCRIPTOR(uppGetNextEventFilterProcInfo, GNEFilter); -static Jump* theGNEFilterJump; -static GetNextEventFilterUPP theOldGNEFilterUPP = NULL; -static EventFilterProcPtr theEventFilter = NULL; - -static Str63 theAppName; - -OSStatus InstallEventFilter(EventFilterProcPtr filter) -{ - if (theEventFilter == NULL) { - theEventFilter = filter; - - // record the current application's name. - StringPtr currentAppName = LMGetCurApName(); - ::BlockMoveData(currentAppName, theAppName, 1 + currentAppName[0]); - - // allocate a jump vector in the System heap, so it will be retained after termination. - if (theGNEFilterJump == NULL) { - theGNEFilterJump = (Jump*) NewPtrSys(sizeof(Jump)); - if (theGNEFilterJump == NULL) - return MemError(); - - theGNEFilterJump->jmp = 0x4EF9; - theGNEFilterJump->addr = &theGNEFilterDescriptor; - - // get previous event filter routine. - theOldGNEFilterUPP = LMGetGNEFilter(); - LMSetGNEFilter(GetNextEventFilterUPP(theGNEFilterJump)); - } else { - // our previously allocated Jump is still installed, use it. - theOldGNEFilterUPP = theGNEFilterJump->addr; - theGNEFilterJump->addr = &theGNEFilterDescriptor; - } - - return noErr; - } - return paramErr; -} - -OSStatus RemoveEventFilter() -{ - if (theEventFilter != NULL) { - // It's only truly safe to remove our filter, if nobody else installed one after us. - if (LMGetGNEFilter() == GetNextEventFilterUPP(theGNEFilterJump)) { - // can safely restore the old filter. - LMSetGNEFilter(theOldGNEFilterUPP); - DisposePtr(Ptr(theGNEFilterJump)); - theGNEFilterJump = NULL; - } else { - // modify the jump instruction to point to the previous filter. - theGNEFilterJump->addr = theOldGNEFilterUPP; - } - theOldGNEFilterUPP = NULL; - theEventFilter = NULL; - return noErr; - } - return paramErr; -} - -static void GNEFilter(EventRecord *event, Boolean* result) -{ - // call next filter in chain first. - if (theOldGNEFilterUPP != NULL) - CallGetNextEventFilterProc(theOldGNEFilterUPP, event, result); - - // now, let the filter proc have a crack at the event. - if (*result) { - // only call the filter if called in the current application's context. - /* if (::EqualString(theAppName, LMGetCurApName(), true, true)) */ - { - // prevent recursive calls to the filter. - static Boolean inFilter = false; - if (! inFilter) { - inFilter = true; - Boolean filteredEvent = theEventFilter(event); - if (filteredEvent) { - // consume the event by making it a nullEvent. - event->what = nullEvent; - *result = false; - } - inFilter = false; - } - } - } -} diff --git a/plugin/oji/MRJCarbon/plugin/Source/jGNE.h b/plugin/oji/MRJCarbon/plugin/Source/jGNE.h deleted file mode 100644 index ecc2c558e2fc..000000000000 --- a/plugin/oji/MRJCarbon/plugin/Source/jGNE.h +++ /dev/null @@ -1,54 +0,0 @@ -/* ----- BEGIN LICENSE BLOCK ----- - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 MRJ Carbon OJI Plugin. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Patrick C. Beard - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ----- END LICENSE BLOCK ----- */ - -#pragma once - -/* - jGNE.h - - Provides a generalized jGNE filtering service. - - by Patrick C. Beard. - */ - -#ifndef __EVENTS__ -#include -#endif - -typedef Boolean (*EventFilterProcPtr) (EventRecord* event); - -OSStatus InstallEventFilter(EventFilterProcPtr filter); -OSStatus RemoveEventFilter();