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

@@ -351,20 +351,22 @@ void removeListener(WCEventListenerWrapper newListener)
*/
void nativeEventOccurred(WebclientEventListener target, long eventType,
void nativeEventOccurred(WebclientEventListener target,
String targetClassName, long eventType,
Object eventData)
{
ParameterCheck.nonNull(target);
ParameterCheck.nonNull(targetClassName);
Assert.assert(-1 != nativeWebShell);
Assert.assert(null != windowControl);
WebclientEvent event = null;
if (target instanceof DocumentLoadListener) {
if (DocumentLoadListener.class.getName().equals(targetClassName)) {
event = new DocumentLoadEvent(this, eventType, eventData);
}
else if (target instanceof MouseListener) {
else if (MouseListener.class.getName().equals(targetClassName)) {
Assert.assert(target instanceof WCMouseListenerImpl);
// We create a plain vanilla WebclientEvent, which the