printf("debug: glenn: nativeAddListener\n");
WebShellInitContext *initContext = (WebShellInitContext *)webShellPtr;  if (initContext == nsnull) { ::util_ThrowExceptionToJava(env, "Exception: null initContext passed tonativeAddListener"); return; }  if (nsnull == initContext->nativeEventThread) {  initContext->nativeEventThread = ::util_NewGlobalRef(env, obj);   }  jclass clazz = nsnull; int listenerType = 0; const char *listenerStringChars = ::util_GetStringUTFChars(env, listenerString); if (listenerStringChars == nsnull) { ::util_ThrowExceptionToJava(env, "Exception: nativeAddListener: Can't get className for listener."); return; }  while (nsnull != gSupportedListenerInterfaces[listenerType]) { if (0 == strcmp(gSupportedListenerInterfaces[listenerType], listenerStringChars)) {  break; } listenerType++; } ::util_ReleaseStringUTFChars(env, listenerString, listenerStringChars); listenerStringChars = nsnull;  if (LISTENER_NOT_FOUND == (LISTENER_CLASSES) listenerType) { ::util_ThrowExceptionToJava(env, "Exception: NativeEventThread.nativeAddListener(): can't find listener \n\tclass for argument"); return; }  jobject globalRef = nsnull;   if (nsnull == (globalRef = ::util_NewGlobalRef(env, typedListener))) { ::util_ThrowExceptionToJava(env, "Exception: NativeEventThread.nativeAddListener(): can't create NewGlobalRef\n\tfor argument"); return; } util_Assert(initContext->browserObject);  switch(listenerType) { case DOCUMENT_LOAD_LISTENER: initContext->browserObject->AddDocumentLoadListener(globalRef); break; }  return;
JNIEXPORT void JNICALL Java_org_mozilla_webclient_wrapper_1native_NativeEventThread_nativeAddListener(JNIEnv *env, jobject obj, jint webShellPtr, jobject typedListener){    printf("debug: glenn: nativeAddListener\n");}