author = ashuk

r = edburns
a = edburns

Implements RemoveListener


git-svn-id: svn://10.0.0.236/trunk@74818 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ashuk%eng.sun.com
2000-07-26 20:07:11 +00:00
parent 4554a01d45
commit b5f214c647
5 changed files with 157 additions and 30 deletions

View File

@@ -307,6 +307,52 @@ JNIEXPORT void JNICALL Java_org_mozilla_webclient_wrapper_1native_NativeEventThr
break;
}
return;
}
JNIEXPORT void JNICALL
Java_org_mozilla_webclient_wrapper_1native_NativeEventThread_nativeRemoveListener
(JNIEnv *env, jobject obj, jint webShellPtr, jobject typedListener)
{
WebShellInitContext *initContext = (WebShellInitContext *)webShellPtr;
if (initContext == nsnull) {
::util_ThrowExceptionToJava(env, "Exception: null initContext passed to nativeRemoveListener");
return;
}
jclass clazz = nsnull;
int listenerType = 0;
while (nsnull != gSupportedListenerInterfaces[listenerType]) {
if (nsnull ==
(clazz =
::util_FindClass(env,
gSupportedListenerInterfaces[listenerType]))) {
return;
}
if (::util_IsInstanceOf(env, typedListener, clazz)) {
// We've got a winner!
break;
}
listenerType++;
}
if (LISTENER_NOT_FOUND == (LISTENER_CLASSES) listenerType) {
::util_ThrowExceptionToJava(env, "Exception: NativeEventThread.nativeRemoveListener(): can't find listener \n\tclass for argument");
return;
}
PR_ASSERT(initContext->browserContainer);
switch(listenerType) {
case DOCUMENT_LOAD_LISTENER:
initContext->browserContainer->RemoveDocumentLoadListener();
break;
case MOUSE_LISTENER:
initContext->browserContainer->RemoveMouseListener();
break;
}
}
JNIEXPORT void JNICALL
@@ -315,11 +361,11 @@ Java_org_mozilla_webclient_wrapper_1native_NativeEventThread_nativeRemoveAllList
WebShellInitContext *initContext = (WebShellInitContext *)webShellPtr;
if (initContext == nsnull) {
::util_ThrowExceptionToJava(env, "Exception: null initContext passed tonativeRemoveAllListeners");
::util_ThrowExceptionToJava(env, "Exception: null initContext passed to nativeRemoveAllListeners");
return;
}
// removeAllListeners(env, initContext);
initContext->browserContainer->RemoveAllListeners();
}
/**