Added Mark Goddard from OMTP's changes to add "Refresh" to API and implementation.

Also added Refresh button to EmbeddedMozilla.


git-svn-id: svn://10.0.0.236/trunk@45913 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
edburns%acm.org
1999-09-03 19:28:47 +00:00
parent 01b35cfe60
commit 19cc7f8d9d
8 changed files with 140 additions and 6 deletions

View File

@@ -1788,6 +1788,41 @@ Java_org_mozilla_webclient_BrowserControlMozillaShim_nativeWebShellGetURL (
return urlString;
} // Java_org_mozilla_webclient_BrowserControlMozillaShim_nativeWebShellGetURL()
// added my Mark Goddard OTMP 9/2/1999
/*
* Class: org_mozilla_webclient_BrowserControlMozillaShim
* Method: nativeWebShellRefresh
* Signature: (I)V
*/
JNIEXPORT jboolean JNICALL
Java_org_mozilla_webclient_BrowserControlMozillaShim_nativeWebShellRefresh (
JNIEnv * env,
jobject obj,
jint webShellPtr)
{
JNIEnv * pEnv = env;
jobject jobj = obj;
void * voidResult = nsnull;
WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr;
if (initContext == nsnull) {
::ThrowExceptionToJava(env, "Exception: null webShellPtr passed to raptorWebShellRefresh");
return JNI_FALSE;
}
if (initContext->initComplete) {
wsRefreshEvent * actionEvent = new wsRefreshEvent(initContext->webShell);
PLEvent * event = (PLEvent*) *actionEvent;
voidResult = ::PostSynchronousEvent(initContext, event);
return (NS_FAILED((nsresult) voidResult)) ? JNI_FALSE : JNI_TRUE;
}
return JNI_FALSE;
} // Java_org_mozilla_webclient_BrowserControlMozillaShim_nativeWebShellBack()
#ifdef XP_UNIX
/*

View File

@@ -71,6 +71,8 @@ jboolean (* nativeWebShellGoTo) (JNIEnv *, jobject, jint, jint);
jint (* nativeWebShellGetHistoryLength) (JNIEnv *, jobject, jint);
jint (* nativeWebShellGetHistoryIndex) (JNIEnv *, jobject, jint);
jstring (* nativeWebShellGetURL) (JNIEnv *, jobject, jint, jint);
// added by Mark Goddard OTMP 9/2/1999
jboolean (* nativeWebShellRefresh)(JNIEnv *, jobject, jint);
void (* processNativeEventQueue) (JNIEnv *, jobject, jint);
@@ -211,6 +213,13 @@ void locateBrowserControlStubFunctions(void * dll) {
if (!nativeWebShellGetURL) {
printf("got dlsym error %s\n", dlerror());
}
// added by Mark Goddard OTMP 9/2/1999
nativeWebShellRefresh = (jboolean (*) (JNIEnv *, jobject, jint)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlMozillaShim_nativeWebShellRefresh");
if (!nativeWebShellRefresh) {
printf("got dlsym error %s\n", dlerror());
}
processNativeEventQueue = (void (*) (JNIEnv *, jobject, jint)) dlsym(dll, "Java_org_mozilla_webclient_motif_MozillaEventThread_processNativeEventQueue");
if (!processNativeEventQueue) {
printf("got dlsym error %s\n", dlerror());
@@ -793,6 +802,20 @@ Java_org_mozilla_webclient_BrowserControlMozillaShim_nativeWebShellGetURL (
return (* nativeWebShellGetURL) (env, obj, webShellPtr, historyIndex);
} // Java_org_mozilla_webclient_BrowserControlMozillaShim_nativeWebShellGetURL()
// added by Mark Goddard OTMP 9/2/1999
/*
* Class: MozWebShellMozillaShim
* Method: raptorWebShellRefresh
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
Java_org_mozilla_webclient_BrowserControlMozillaShim_nativeWebShellRefresh (
JNIEnv * env,
jobject obj,
jint webShellPtr)
{
return (* nativeWebShellRefresh) (env, obj, webShellPtr);
} // Java_org_mozilla_webclient_BrowserControlMozillaShim_nativeWebShellRefresh()
// EOF

View File

@@ -564,6 +564,35 @@ wsGetURLEvent::handleEvent ()
return NULL;
} // handleEvent()
// Added by Mark Goddard OTMP 9/2/1999
/*
* wsRefreshEvent
*/
wsRefreshEvent::wsRefreshEvent(nsIWebShell* webShell) :
nsActionEvent(),
mWebShell(webShell)
{
}
void *
wsRefreshEvent::handleEvent ()
{
if (mWebShell) {
printf("handleEvent(Refresh())\n");
nsresult rv = mWebShell->Reload(nsIChannel::LOAD_NORMAL);
printf("result = %lx\n", rv);
return (void *) rv;
}
return NULL;
} // handleEvent()
// EOF

View File

@@ -237,6 +237,16 @@ protected:
PRInt32 mHistoryIndex;
};
// added by Mark Goddard OTMP 9/2/1999
class wsRefreshEvent : public nsActionEvent {
public:
wsRefreshEvent (nsIWebShell* webShell);
void * handleEvent (void);
protected:
nsIWebShell * mWebShell;
};
#endif /* nsActions_h___ */