This checkin enables the KeyListener feature.
A webclient/test/automated/src/classes/org/mozilla/webclient/KeyListenerTest.java
A webclient/test/automated/src/test/KeyListenerTest1.html
M webclient/build-tests.xml
- add new testcase
M webclient/classes_spec/org/mozilla/webclient/BrowserControlCanvas.java
M webclient/classes_spec/org/mozilla/webclient/EventRegistration2.java
- allow KeyListeners to be added and removed.
M webclient/classes_spec/org/mozilla/webclient/impl/wrapper_native/EventRegistrationImpl.java
- Lazily create listener lists.
- Change the contract of queueEvent() to discard null events silently.
- Add createKeyEvent() method.
M webclient/src_moz/EmbedEventListener.cpp
- new mask names and values, DOMDOMKeyListener_maskNames,
DOMKeyListener_maskValues.
- flesh out Key*() events.
- add addKeyEventDataToProperties.
- use eventType to discern how to populate the properties, with either key or
mouse data.
M webclient/src_moz/EmbedEventListener.h
- key event includes and support methods.
M webclient/src_moz/EmbedProgress.cpp
- honor new last argument to util_InitializeEventMaskValuesFromClass().
M webclient/src_share/jni_util.cpp
M webclient/src_share/jni_util.h
- new constants
+jobject CHAR_CODE;
+jobject KEY_CODE;
+jstring KEY_LISTENER_CLASSNAME;
+char *DOMKeyListener_maskNames[] = {
M webclient/src_share/jni_util_export.cpp
M webclient/src_share/jni_util_export.h
- new last argument to
util_InitializeEventMaskValuesFromClass(const char *className,
char *maskNames[],
- jlong maskValues[])
+ jlong maskValuesLong[],
+ jint maskValuesInt[])
Used when the maskValues are ints, otherwise null.
git-svn-id: svn://10.0.0.236/trunk@166003 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -225,7 +225,8 @@ JNIEXPORT void JNICALL util_SetGetFromPropertiesObjectFunction(fpGetFromProperti
|
||||
JNIEXPORT void JNICALL
|
||||
util_InitializeEventMaskValuesFromClass(const char *className,
|
||||
char *maskNames[],
|
||||
jlong maskValues[])
|
||||
jlong maskValuesLong[],
|
||||
jint maskValuesInt[])
|
||||
{
|
||||
int i = 0;
|
||||
JNIEnv *env = nsnull;
|
||||
@@ -246,7 +247,7 @@ util_InitializeEventMaskValuesFromClass(const char *className,
|
||||
#ifdef BAL_INTERFACE
|
||||
if (nsnull != externalInitializeEventMask) {
|
||||
externalInitializeEventMask(env, clazz,
|
||||
(const char **) maskNames, maskValues);
|
||||
(const char **) maskNames, maskValuesLong);
|
||||
}
|
||||
#else
|
||||
if (nsnull == env) {
|
||||
@@ -256,15 +257,28 @@ util_InitializeEventMaskValuesFromClass(const char *className,
|
||||
jfieldID fieldID;
|
||||
|
||||
while (nsnull != maskNames[i]) {
|
||||
fieldID = ::util_GetStaticFieldID(env, clazz,
|
||||
maskNames[i], "J");
|
||||
|
||||
if (nsnull == fieldID) {
|
||||
return;
|
||||
if (nsnull != maskValuesLong) {
|
||||
fieldID = ::util_GetStaticFieldID(env, clazz,
|
||||
maskNames[i], "J");
|
||||
|
||||
if (nsnull == fieldID) {
|
||||
return;
|
||||
}
|
||||
|
||||
maskValuesLong[i] = ::util_GetStaticLongField(env, clazz,
|
||||
fieldID);
|
||||
}
|
||||
else if (nsnull != maskValuesInt) {
|
||||
fieldID = ::util_GetStaticFieldID(env, clazz,
|
||||
maskNames[i], "I");
|
||||
|
||||
if (nsnull == fieldID) {
|
||||
return;
|
||||
}
|
||||
|
||||
maskValuesInt[i] = ::util_GetStaticIntField(env, clazz,
|
||||
fieldID);
|
||||
}
|
||||
|
||||
maskValues[i] = ::util_GetStaticLongField(env, clazz,
|
||||
fieldID);
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user