This fix was contributed by
* Jason Mawdsley <jason@macadamian.com> * Louis-Philippe Gagnon <louisphilippe@macadamian.com> It enables webclient to be built and run under JDK1.1.x. Note that JavaDOM does not work under jdk1.1.x. The fix consists of two elements: On the Java side, replace all JDK1.2 specific calls with JDK1.1.x equivalents. On the native side use pre-processer macro for JNI_VERSION, like this: #ifdef JNI_VERSION_1_2 #ifndef JNI_VERSION #define JNI_VERSION JNI_VERSION_1_2 #endif #else #ifndef JNI_VERSION_1_1 #define JNI_VERSION_1_1 0x00010001 #endif #ifndef JNI_VERSION #define JNI_VERSION JNI_VERSION_1_1 #endif #endif // END: JNI_VERSION_1_2 This fix has been tested on win32, solaris, and linux. The following files are in this fix: M webclient/classes_spec/org/mozilla/webclient/test/DOMTreeModel.java M webclient/classes_spec/org/mozilla/webclient/test/DOMViewerFrame.java M webclient/classes_spec/org/mozilla/webclient/test/EMWindow.java M webclient/classes_spec/org/mozilla/webclient/wrapper_native/BookmarksImpl.java M webclient/classes_spec/org/mozilla/webclient/wrapper_native/NativeEventThread.java M webclient/src_moz/CBrowserContainer.cpp M webclient/src_moz/nsActions.cpp M webclient/src_share/jni_util.cpp M webclient/src_share/jni_util.h M webclient/src_share/jni_util_export.cpp git-svn-id: svn://10.0.0.236/trunk@79490 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -20,6 +20,8 @@
|
||||
*
|
||||
* Contributor(s): Ashutosh Kulkarni <ashuk@eng.sun.com>
|
||||
* Ed Burns <edburns@acm.org>
|
||||
* Jason Mawdsley <jason@macadamian.com>
|
||||
* Louis-Philippe Gagnon <louisphilippe@macadamian.com>
|
||||
*/
|
||||
|
||||
|
||||
@@ -68,7 +70,7 @@ CBrowserContainer::~CBrowserContainer()
|
||||
mMouseTarget = nsnull;
|
||||
mDomEventTarget = nsnull;
|
||||
inverseDepth = -1;
|
||||
JNIEnv *env = (JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION_1_2);
|
||||
JNIEnv *env = (JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION);
|
||||
if (properties) {
|
||||
::util_DeleteGlobalRef(env, properties);
|
||||
}
|
||||
@@ -645,7 +647,7 @@ CBrowserContainer::OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL,
|
||||
// IMPORTANT: do not use initContext->env here since it comes
|
||||
// from another thread. Use JNU_GetEnv instead.
|
||||
|
||||
JNIEnv *env = (JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION_1_2);
|
||||
JNIEnv *env = (JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION);
|
||||
|
||||
aURL->GetSpec(&urlStr);
|
||||
if (nsnull != urlStr) {
|
||||
@@ -782,7 +784,7 @@ CBrowserContainer::OnStatusURLLoad(nsIDocumentLoader* loader,
|
||||
// IMPORTANT: do not use initContext->env here since it comes
|
||||
// from another thread. Use JNU_GetEnv instead.
|
||||
|
||||
JNIEnv *env = (JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION_1_2);
|
||||
JNIEnv *env = (JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION);
|
||||
jstring statusMessage = ::util_NewString(env, (const jchar *)
|
||||
aMsg.GetUnicode(), length);
|
||||
|
||||
@@ -877,7 +879,7 @@ CBrowserContainer::MouseClick(nsIDOMEvent* aMouseEvent)
|
||||
|
||||
getPropertiesFromEvent(aMouseEvent);
|
||||
|
||||
JNIEnv *env = (JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION_1_2);
|
||||
JNIEnv *env = (JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION);
|
||||
::util_StoreIntoPropertiesObject(env, properties, CLICK_COUNT_KEY,
|
||||
ONE_VALUE, (jobject)
|
||||
&(mInitContext->shareContext));
|
||||
@@ -902,7 +904,7 @@ CBrowserContainer::MouseDblClick(nsIDOMEvent* aMouseEvent)
|
||||
|
||||
getPropertiesFromEvent(aMouseEvent);
|
||||
|
||||
JNIEnv *env = (JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION_1_2);
|
||||
JNIEnv *env = (JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION);
|
||||
::util_StoreIntoPropertiesObject(env, properties, CLICK_COUNT_KEY,
|
||||
TWO_VALUE, (jobject)
|
||||
&(mInitContext->shareContext));
|
||||
@@ -1001,7 +1003,7 @@ NS_IMETHODIMP CBrowserContainer::RemoveMouseListener()
|
||||
}
|
||||
|
||||
|
||||
::util_DeleteGlobalRef((JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION_1_2), mMouseTarget);
|
||||
::util_DeleteGlobalRef((JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION), mMouseTarget);
|
||||
mMouseTarget = nsnull;
|
||||
return rv;
|
||||
}
|
||||
@@ -1013,7 +1015,7 @@ NS_IMETHODIMP CBrowserContainer::RemoveDocumentLoadListener()
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
::util_DeleteGlobalRef((JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION_1_2), mDocTarget);
|
||||
::util_DeleteGlobalRef((JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION), mDocTarget);
|
||||
mDocTarget = nsnull;
|
||||
return rv;
|
||||
}
|
||||
@@ -1030,8 +1032,8 @@ NS_IMETHODIMP CBrowserContainer::RemoveAllListeners()
|
||||
mDomEventTarget = nsnull;
|
||||
}
|
||||
|
||||
::util_DeleteGlobalRef((JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION_1_2), mDocTarget);
|
||||
::util_DeleteGlobalRef((JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION_1_2), mMouseTarget);
|
||||
::util_DeleteGlobalRef((JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION), mDocTarget);
|
||||
::util_DeleteGlobalRef((JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION), mMouseTarget);
|
||||
|
||||
mMouseTarget = nsnull;
|
||||
mDocTarget = nsnull;
|
||||
@@ -1080,7 +1082,7 @@ jobject JNICALL CBrowserContainer::getPropertiesFromEvent(nsIDOMEvent *event)
|
||||
return properties;
|
||||
}
|
||||
inverseDepth = 0;
|
||||
JNIEnv *env = (JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION_1_2);
|
||||
JNIEnv *env = (JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION);
|
||||
|
||||
if (properties) {
|
||||
util_ClearPropertiesObject(env, properties, (jobject)
|
||||
@@ -1122,7 +1124,7 @@ void JNICALL CBrowserContainer::addMouseEventDataToProperties(nsIDOMEvent *aMous
|
||||
PRBool boolVal;
|
||||
char buf[20];
|
||||
jstring strVal;
|
||||
JNIEnv *env = (JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION_1_2);
|
||||
JNIEnv *env = (JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION);
|
||||
|
||||
// PENDING(edburns): perhaps use a macro to speed this up?
|
||||
rv = mouseEvent->GetScreenX(&intVal);
|
||||
@@ -1223,7 +1225,7 @@ nsresult JNICALL CBrowserContainer::takeActionOnNode(nsCOMPtr<nsIDOMNode> curren
|
||||
CBrowserContainer *curThis = nsnull;
|
||||
const PRUint32 depthStrLen = 20;
|
||||
// char depthStr[depthStrLen];
|
||||
JNIEnv *env = (JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION_1_2);
|
||||
JNIEnv *env = (JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION);
|
||||
|
||||
PR_ASSERT(nsnull != myObject);
|
||||
curThis = (CBrowserContainer *) myObject;
|
||||
|
||||
Reference in New Issue
Block a user