a=edburns

r=ashuk
bug=47357
M classes_spec/org/mozilla/webclient/wrapper_native/NativeEventThread.java
M src_moz/CBrowserContainer.cpp
M src_moz/NativeEventThread.cpp
M src_moz/ns_util.cpp
M src_moz/ns_util.h
M src_share/jni_util.cpp
M src_share/jni_util.h

tar -cvf 47357.2.tar classes_spec/org/mozilla/webclient/wrapper_native/NativeEventThread.java src_moz/CBrowserContainer.cpp src_moz/NativeEventThread.cpp src_moz/ns_util.cpp src_moz/ns_util.h src_share/jni_util.cpp src_share/jni_util.h

cvs diff -u classes_spec/org/mozilla/webclient/wrapper_native/NativeEventThread.java src_moz/CBrowserContainer.cpp src_moz/NativeEventThread.cpp src_moz/ns_util.cpp src_moz/ns_util.h src_share/jni_util.cpp src_share/jni_util.h

This change modifes what one has to do on the native side to add a
listener.

 * How to create a new listener type on the native side: <P>

 * 1. add an entry in the gSupportedListenerInterfaces array defined in
 * ns_util.cpp <P>

 * 2. add a corresponding entry in the LISTENER_CLASSES enum in
 * ns_util.h <P>

 * 3. add a jstring to the string constant list in
 * CBrowserContainer.cpp, below.

 * 4. Initialize this jstring constant in CBrowserContainer.cpp
 * initStringConstants() <P>

 * 5. add an entry to the switch statement in NativeEventThread.cpp
 * native{add,remove}Listener <P>

You have to clobber_all in webclient after this change.


git-svn-id: svn://10.0.0.236/trunk@76019 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
edburns%acm.org
2000-08-10 21:38:52 +00:00
parent 3064c5d83d
commit 1f01dae006
7 changed files with 100 additions and 38 deletions

View File

@@ -87,6 +87,7 @@ void util_ThrowExceptionToJava (JNIEnv * env, const char * message)
void util_SendEventToJava(JNIEnv *yourEnv, jobject nativeEventThread,
jobject webclientEventListener,
jstring eventListenerClassName,
jlong eventType, jobject eventData)
{
#ifdef BAL_INTERFACE
@@ -113,9 +114,10 @@ void util_SendEventToJava(JNIEnv *yourEnv, jobject nativeEventThread,
jclass clazz = env->GetObjectClass(nativeEventThread);
jmethodID mid = env->GetMethodID(clazz, "nativeEventOccurred",
"(Lorg/mozilla/webclient/WebclientEventListener;JLjava/lang/Object;)V");
"(Lorg/mozilla/webclient/WebclientEventListener;Ljava/lang/String;JLjava/lang/Object;)V");
if ( mid != nsnull) {
env->CallVoidMethod(nativeEventThread, mid, webclientEventListener,
eventListenerClassName,
eventType, eventData);
} else {
util_LogMessage(3, "cannot call the Java Method!\n");