From c94f91ee63ee0a5c3dd969dcf2b40771d93cc5ac Mon Sep 17 00:00:00 2001 From: "beard%netscape.com" Date: Sun, 14 Mar 1999 03:04:44 +0000 Subject: [PATCH] MRJPLUGIN_4X support. --- .../MRJ/plugin/Source/LiveConnectNativeMethods.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/plugin/oji/MRJ/plugin/Source/LiveConnectNativeMethods.cpp b/plugin/oji/MRJ/plugin/Source/LiveConnectNativeMethods.cpp index bf71e4199bc6..aa28bde25750 100644 --- a/plugin/oji/MRJ/plugin/Source/LiveConnectNativeMethods.cpp +++ b/plugin/oji/MRJ/plugin/Source/LiveConnectNativeMethods.cpp @@ -522,6 +522,9 @@ Java_netscape_javascript_JSObject_eval(JNIEnv* env, 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. */ MRJPluginInstance* pluginInstance = theJVMPlugin->getPluginInstance(env); if (pluginInstance == NULL) { @@ -534,7 +537,8 @@ Java_netscape_javascript_JSObject_eval(JNIEnv* env, // Make sure it gets released! pluginInstance->Release(); - +#endif + env->ReleaseStringChars(script_jstr, script_ucs2); return jresult; @@ -601,14 +605,20 @@ Java_netscape_javascript_JSObject_getWindow(JNIEnv* env, jclass js_object_class, jobject java_applet_obj) { - jsobject jswindow = NULL; MRJPluginInstance* pluginInstance = theJVMPlugin->getPluginInstance(java_applet_obj); if (pluginInstance != NULL) { +#ifdef MRJPLUGIN_4X + jobject jwindow = Wrap_JSObject(env, jsobject(pluginInstance)); + pluginInstance->Release(); + return jwindow; +#else + jsobject jswindow = NULL; GetWindowMessage msg(pluginInstance, &jswindow); sendMessage(env, &msg); pluginInstance->Release(); if (jswindow != NULL) return Wrap_JSObject(env, jswindow); +#endif } return NULL; }