Ok after this checkin we now have all the functionality of Sun's JDIC

WebBrowser
<https://jdic.dev.java.net/nonav/documentation/javadoc/jdic/org/jdesktop/jdic/browser/WebBrowser.html>, with the following exceptions:

- we're based on mozilla 1.6

- it only works on windows

- we don't have mouse event support

- we only support mozilla, not IE

So, webclient still has a ways to go until we reach its former glory.
However, I'm going to get together a 2.0 alpha release, including build
instructions, from what we have now.

I'd love it if someone could get the unit tests working on GNU/Linux
again.  I think the problem has to do with our old friend GDKSUPERWIN.

M webclient/classes_spec/org/mozilla/webclient/impl/wrapper_native/NavigationImpl.java
M webclient/src_moz/NavigationImpl.cpp

- re-enable POST

M webclient/src_moz/EmbedWindow.cpp
M webclient/src_moz/EmbedWindow.h

- expose DocShell post method.

M webclient/test/automated/src/classes/org/mozilla/util/THTTPD.java
M webclient/test/automated/src/classes/org/mozilla/webclient/NavigationTest.java

- test code for POST


git-svn-id: svn://10.0.0.236/trunk@158414 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
edburns%acm.org
2004-06-24 16:23:42 +00:00
parent 46db035f5c
commit 433bcfa4c7
6 changed files with 221 additions and 52 deletions

View File

@@ -39,6 +39,7 @@
#include "NativeBrowserControl.h"
#include "NavigationActionEvents.h"
#include "EmbedWindow.h"
#include "ns_util.h"
JNIEXPORT void JNICALL Java_org_mozilla_webclient_impl_wrapper_1native_NavigationImpl_nativeLoadURL
@@ -150,10 +151,6 @@ JNIEXPORT void JNICALL Java_org_mozilla_webclient_impl_wrapper_1native_Navigatio
// wsLoadFromStreamEvent destructor.
}
/**********************
JNIEXPORT void JNICALL Java_org_mozilla_webclient_impl_wrapper_1native_NavigationImpl_nativePost
(JNIEnv *env, jobject obj, jint nativeBCPtr, jstring absoluteURL, jstring target, jint postDataLength,
jstring postData, jint postHeadersLength, jstring postHeaders)
@@ -166,30 +163,30 @@ JNIEXPORT void JNICALL Java_org_mozilla_webclient_impl_wrapper_1native_Navigatio
const char *postDataChars = nsnull;
const char *postHeadersChars = nsnull;
char *headersAndData = nsnull;
wsPostEvent *actionEvent = nsnull;
nsresult rv = NS_OK;
nsCOMPtr<nsIIOService> ioService = do_GetService(NS_IOSERVICE_CONTRACTID,
&rv);
nsCOMPtr<nsIURI> uri;
NS_ConvertUCS2toUTF8 uriACString(urlChars);
if (!ioService || NS_FAILED(rv)) {
return;
}
if (nativeBrowserControl == nsnull || !nativeBrowserControl->initComplete) {
if (nativeBrowserControl == nsnull) {
::util_ThrowExceptionToJava(env, "Exception: null nativeBCPtr passed to nativePost");
return;
}
urlChars = (PRUnichar *) ::util_GetStringChars(env, absoluteURL);
urlLen = (PRInt32) ::util_GetStringLength(env, absoluteURL);
NS_ConvertUCS2toUTF8 uriACString(urlChars);
if (::util_ExceptionOccurred(env)) {
::util_ThrowExceptionToJava(env, "nativePost Exception: unable to extract Java string");
goto NPFS_CLEANUP;
}
if (target){
targetChars = (PRUnichar *) ::util_GetStringChars(env, target);
targetLen = (PRInt32) ::util_GetStringLength(env, target);
@@ -242,23 +239,17 @@ JNIEXPORT void JNICALL Java_org_mozilla_webclient_impl_wrapper_1native_Navigatio
goto NPFS_CLEANUP;
}
if (!(actionEvent = new wsPostEvent(nativeBrowserControl,
uri,
targetChars,
targetLen,
(PRInt32) postDataLength,
headersAndData ? headersAndData : postDataChars,
(PRInt32) postHeadersLength,
postHeadersChars))) {
::util_ThrowExceptionToJava(env, "Exception: nativePost: can't create wsPostEvent");
goto NPFS_CLEANUP;
}
::util_PostSynchronousEvent(nativeBrowserControl, (PLEvent *) *actionEvent);
rv = nativeBrowserControl->mWindow->Post(uri,
targetChars,
targetLen,
(PRInt32) postDataLength,
headersAndData ? headersAndData : postDataChars,
(PRInt32) postHeadersLength,
postHeadersChars);
NPFS_CLEANUP:
if (urlChars != nsnull)
::util_ReleaseStringChars(env, absoluteURL, (const jchar *) urlChars);
if (targetChars != nsnull)
@@ -271,7 +262,6 @@ JNIEXPORT void JNICALL Java_org_mozilla_webclient_impl_wrapper_1native_Navigatio
delete [] headersAndData;
return;
}
*********************/
JNIEXPORT void JNICALL Java_org_mozilla_webclient_impl_wrapper_1native_NavigationImpl_nativeRefresh
(JNIEnv *env, jobject obj, jint nativeBCPtr, jlong loadFlags)