2000-03-04 04:37:20 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
|
|
|
*
|
|
|
|
* The Original Code is RaptorCanvas.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Kirk Baker and
|
|
|
|
* Ian Wilkinson. Portions created by Kirk Baker and Ian Wilkinson are
|
|
|
|
* Copyright (C) 1999 Kirk Baker and Ian Wilkinson. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s): Kirk Baker <kbaker@eb.com>
|
|
|
|
* Ian Wilkinson <iw@ennoble.com>
|
|
|
|
* Mark Lin <mark.lin@eng.sun.com>
|
|
|
|
* Mark Goddard
|
|
|
|
* Ed Burns <edburns@acm.org>
|
2000-06-30 04:01:58 +04:00
|
|
|
* Ashutosh Kulkarni <ashuk@eng.sun.com>
|
2000-03-04 04:37:20 +03:00
|
|
|
* Ann Sunhachawee
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Util methods
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef jni_util_h
|
|
|
|
#define jni_util_h
|
|
|
|
|
|
|
|
#include <jni.h>
|
|
|
|
|
|
|
|
//
|
2000-08-17 22:29:18 +04:00
|
|
|
// String constants, defined in jni_util.cpp
|
|
|
|
//
|
|
|
|
|
|
|
|
extern jobject SCREEN_X_KEY;
|
|
|
|
extern jobject SCREEN_Y_KEY;
|
|
|
|
extern jobject CLIENT_X_KEY;
|
|
|
|
extern jobject CLIENT_Y_KEY;
|
|
|
|
extern jobject ALT_KEY;
|
|
|
|
extern jobject CTRL_KEY;
|
|
|
|
extern jobject SHIFT_KEY;
|
|
|
|
extern jobject META_KEY;
|
|
|
|
extern jobject BUTTON_KEY;
|
|
|
|
extern jobject CLICK_COUNT_KEY;
|
|
|
|
extern jobject TRUE_VALUE;
|
|
|
|
extern jobject FALSE_VALUE;
|
|
|
|
extern jobject ONE_VALUE;
|
|
|
|
extern jobject TWO_VALUE;
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 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 or ie_util.cpp <P>
|
|
|
|
|
|
|
|
* 2. add a corresponding entry in the LISTENER_CLASSES enum in
|
|
|
|
* jni_util.h <P>
|
|
|
|
|
|
|
|
* 3. add a jstring to the string constant list in
|
|
|
|
* jni_util.cpp, below.
|
|
|
|
|
|
|
|
* 4. Initialize this jstring constant in jni_util.cpp
|
|
|
|
* util_InitStringConstants() <P>
|
|
|
|
|
|
|
|
* 5. add an entry to the switch statement in NativeEventThread.cpp
|
|
|
|
* native{add,remove}Listener <P>
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* We need one of these for each of the classes in
|
|
|
|
* gSupportedListenerInterfaces, defined in ns_util.cpp
|
|
|
|
|
|
|
|
*/
|
|
|
|
extern jstring DOCUMENT_LOAD_LISTENER_CLASSNAME;
|
|
|
|
extern jstring MOUSE_LISTENER_CLASSNAME;
|
|
|
|
|
|
|
|
|
2000-08-04 01:32:54 +04:00
|
|
|
//
|
2000-08-17 22:29:18 +04:00
|
|
|
// Listener support
|
|
|
|
//
|
|
|
|
|
|
|
|
// these index into the gSupportedListenerInterfaces array
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
DOCUMENT_LOAD_LISTENER = 0,
|
|
|
|
MOUSE_LISTENER,
|
|
|
|
LISTENER_NOT_FOUND
|
|
|
|
} LISTENER_CLASSES;
|
|
|
|
|
|
|
|
// listener names and values, tightly correspond to java listener interfaces
|
|
|
|
|
|
|
|
#define DOCUMENT_LOAD_LISTENER_CLASSNAME_VALUE "org.mozilla.webclient.DocumentLoadListener"
|
|
|
|
#define MOUSE_LISTENER_CLASSNAME_VALUE "java.awt.event.MouseListener"
|
|
|
|
|
|
|
|
|
|
|
|
#define START_DOCUMENT_LOAD_EVENT_MASK_VALUE "START_DOCUMENT_LOAD_EVENT_MASK"
|
|
|
|
#define END_DOCUMENT_LOAD_EVENT_MASK_VALUE "END_DOCUMENT_LOAD_EVENT_MASK"
|
|
|
|
#define START_URL_LOAD_EVENT_MASK_VALUE "START_URL_LOAD_EVENT_MASK"
|
|
|
|
#define END_URL_LOAD_EVENT_MASK_VALUE "END_URL_LOAD_EVENT_MASK"
|
|
|
|
#define PROGRESS_URL_LOAD_EVENT_MASK_VALUE "PROGRESS_URL_LOAD_EVENT_MASK"
|
|
|
|
#define STATUS_URL_LOAD_EVENT_MASK_VALUE "STATUS_URL_LOAD_EVENT_MASK"
|
|
|
|
#define UNKNOWN_CONTENT_EVENT_MASK_VALUE "UNKNOWN_CONTENT_EVENT_MASK"
|
|
|
|
#define FETCH_INTERRUPT_EVENT_MASK_VALUE "FETCH_INTERRUPT_EVENT_MASK"
|
|
|
|
|
|
|
|
#define MOUSE_DOWN_EVENT_MASK_VALUE "MOUSE_DOWN_EVENT_MASK"
|
|
|
|
#define MOUSE_UP_EVENT_MASK_VALUE "MOUSE_UP_EVENT_MASK"
|
|
|
|
#define MOUSE_CLICK_EVENT_MASK_VALUE "MOUSE_CLICK_EVENT_MASK"
|
|
|
|
#define MOUSE_DOUBLE_CLICK_EVENT_MASK_VALUE "MOUSE_DOUBLE_CLICK_EVENT_MASK"
|
|
|
|
#define MOUSE_OVER_EVENT_MASK_VALUE "MOUSE_OVER_EVENT_MASK"
|
|
|
|
#define MOUSE_OUT_EVENT_MASK_VALUE "MOUSE_OUT_EVENT_MASK"
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
START_DOCUMENT_LOAD_EVENT_MASK = 0,
|
|
|
|
END_DOCUMENT_LOAD_EVENT_MASK,
|
|
|
|
START_URL_LOAD_EVENT_MASK,
|
|
|
|
END_URL_LOAD_EVENT_MASK,
|
|
|
|
PROGRESS_URL_LOAD_EVENT_MASK,
|
|
|
|
STATUS_URL_LOAD_EVENT_MASK,
|
|
|
|
UNKNOWN_CONTENT_EVENT_MASK,
|
|
|
|
FETCH_INTERRUPT_EVENT_MASK,
|
|
|
|
NUMBER_OF_DOCUMENT_LOADER_MASK_NAMES
|
|
|
|
} DOCUMENT_LOADER_EVENT_MASK_NAMES;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
MOUSE_DOWN_EVENT_MASK = 0,
|
|
|
|
MOUSE_UP_EVENT_MASK,
|
|
|
|
MOUSE_CLICK_EVENT_MASK,
|
|
|
|
MOUSE_DOUBLE_CLICK_EVENT_MASK,
|
|
|
|
MOUSE_OVER_EVENT_MASK,
|
|
|
|
MOUSE_OUT_EVENT_MASK,
|
|
|
|
NUMBER_OF_DOM_MOUSE_LISTENER_MASK_NAMES
|
|
|
|
} DOM_MOUSE_LISTENER_EVENT_MASK_NAMES;
|
|
|
|
|
|
|
|
extern jlong DocumentLoader_maskValues [NUMBER_OF_DOCUMENT_LOADER_MASK_NAMES];
|
|
|
|
extern char *DocumentLoader_maskNames [NUMBER_OF_DOCUMENT_LOADER_MASK_NAMES + 1];
|
|
|
|
|
|
|
|
extern jlong DOMMouseListener_maskValues [NUMBER_OF_DOM_MOUSE_LISTENER_MASK_NAMES];
|
|
|
|
extern char *DOMMouseListener_maskNames [NUMBER_OF_DOM_MOUSE_LISTENER_MASK_NAMES + 1];
|
2000-03-04 04:37:20 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
|
2000-08-04 01:32:54 +04:00
|
|
|
* This struct contains all non browser specific per-window data. The
|
|
|
|
* WebShellInitContext struct, in the src_moz and src_ie directories
|
|
|
|
* contains a pointer to a ShareInitContext struct.
|
2000-03-04 04:37:20 +03:00
|
|
|
|
|
|
|
*/
|
|
|
|
|
2000-08-04 01:32:54 +04:00
|
|
|
struct ShareInitContext {
|
|
|
|
jclass propertiesClass;
|
|
|
|
};
|
2000-03-04 04:37:20 +03:00
|
|
|
|
2000-08-04 01:32:54 +04:00
|
|
|
extern JavaVM *gVm; // defined in jni_util.cpp
|
2000-03-04 04:37:20 +03:00
|
|
|
|
2000-08-04 01:32:54 +04:00
|
|
|
#ifndef nsnull
|
|
|
|
#define nsnull 0
|
|
|
|
#endif
|
2000-03-04 04:37:20 +03:00
|
|
|
|
2000-08-04 01:32:54 +04:00
|
|
|
void util_InitializeShareInitContext(void *initContext);
|
|
|
|
void util_DeallocateShareInitContext(void *initContext);
|
2000-03-04 04:37:20 +03:00
|
|
|
|
2000-08-17 22:29:18 +04:00
|
|
|
/**
|
|
|
|
|
|
|
|
* Initialize the above extern jobject string constants as jstrings
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
jboolean util_InitStringConstants(JNIEnv *env);
|
|
|
|
jboolean util_StringConstantsAreInitialized();
|
|
|
|
|
2000-08-04 01:32:54 +04:00
|
|
|
void util_ThrowExceptionToJava (JNIEnv * env, const char * message);
|
2000-03-04 04:37:20 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* simply call the java method nativeEventOccurred on
|
|
|
|
* eventRegistrationImpl, passing webclientEventListener and eventType
|
|
|
|
* as arguments.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
void util_SendEventToJava(JNIEnv *env, jobject eventRegistrationImpl,
|
|
|
|
jobject webclientEventListener,
|
2000-08-11 01:38:52 +04:00
|
|
|
jstring eventListenerClassName,
|
2000-04-19 01:58:29 +04:00
|
|
|
jlong eventType,
|
|
|
|
jobject eventData);
|
2000-03-04 04:37:20 +03:00
|
|
|
|
|
|
|
char *util_GetCurrentThreadName(JNIEnv *env);
|
|
|
|
|
|
|
|
void util_DumpJavaStack(JNIEnv *env);
|
|
|
|
|
2000-03-17 02:07:03 +03:00
|
|
|
//
|
|
|
|
// Functions to wrap JNIEnv functions.
|
|
|
|
//
|
|
|
|
|
2000-03-21 22:27:13 +03:00
|
|
|
#include "jni_util_export.h"
|
2000-03-17 02:07:03 +03:00
|
|
|
|
|
|
|
jobject util_NewGlobalRef(JNIEnv *env, jobject toAddRef);
|
|
|
|
|
|
|
|
void util_DeleteGlobalRef(JNIEnv *env, jobject toAddRef);
|
|
|
|
|
|
|
|
jthrowable util_ExceptionOccurred(JNIEnv *env);
|
|
|
|
|
|
|
|
jint util_GetJavaVM(JNIEnv *env, JavaVM **vm);
|
|
|
|
|
|
|
|
jclass util_FindClass(JNIEnv *env, const char *fullyQualifiedClassName);
|
|
|
|
|
|
|
|
jfieldID util_GetStaticFieldID(JNIEnv *env, jclass clazz,
|
|
|
|
const char *fieldName,
|
|
|
|
const char *signature);
|
|
|
|
|
|
|
|
jlong util_GetStaticLongField(JNIEnv *env, jclass clazz, jfieldID id);
|
|
|
|
|
|
|
|
jboolean util_IsInstanceOf(JNIEnv *env, jobject obj, jclass clazz);
|
|
|
|
|
|
|
|
jint util_GetIntValueFromInstance(JNIEnv *env, jobject instance,
|
|
|
|
const char *fieldName);
|
|
|
|
|
|
|
|
void util_SetIntValueForInstance(JNIEnv *env, jobject instance,
|
|
|
|
const char *fieldName, jint newValue);
|
|
|
|
|
bug: 20659
r=gbarney
a=edburns
This checkin adds java.awt.event.MouseListener support to webclient for
mozilla. The following files are include in this checkin. "A" is new
file "M" is modified file.
A classes_spec/org/mozilla/webclient/WCMouseEvent.java
A classes_spec/org/mozilla/webclient/wrapper_native/WCMouseListenerImpl.java
A src_moz/DOMMouseListenerImpl.cpp
A src_moz/DOMMouseListenerImpl.h
A src_moz/dom_util.cpp
A src_moz/dom_util.h
M classes_spec/org/mozilla/webclient/EventRegistration.java
M classes_spec/org/mozilla/webclient/test/EMWindow.java
M classes_spec/org/mozilla/webclient/wrapper_native/EventRegistrationImpl.java
M classes_spec/org/mozilla/webclient/wrapper_native/NativeEventThread.java
M src_moz/DocumentLoaderObserverImpl.cpp
M src_moz/DocumentLoaderObserverImpl.h
M src_moz/EventRegistration.cpp
M src_moz/EventRegistration.h
M src_moz/Makefile.solaris
M src_moz/Makefile.win
M src_moz/NativeEventThread.cpp
M src_moz/NavigationImpl.cpp
M src_moz/RDFTreeNode.cpp
M src_moz/bal_util.cpp
M src_moz/jni_util.cpp
M src_moz/jni_util.h
M src_moz/jni_util_export.cpp
M src_moz/jni_util_export.h
A classes_spec/org/mozilla/webclient/WCMouseEvent.java
* <P> This java.awt.event.MouseEvent subclass allows the user to access the
* WebclientEvent. This eventData of this WebclientEvent, if non-null,
* is a java.util.Properties instance that contains information about
* this event. </P>
* <P>The following are some interesting keys:</P>
* <UL>
* <LI> href
* </LI>
* <LI> #text
* </LI>
* </UL>
A classes_spec/org/mozilla/webclient/wrapper_native/WCMouseListenerImpl.java
* This class wraps the user provided instance of
* java.awt.event.MouseListener so it can be installed as a
* WebclientEventListener. Note that we implement MouseListener so we
* can be detected by the webclient event system. We don't do anything
* with these methods here, though.
A src_moz/DOMMouseListenerImpl.cpp
A src_moz/DOMMouseListenerImpl.h
* This class is the shim between the mozilla listener event system for
* mouse events and the java MouseListener interface.
* For each of the Mouse* methods, we call the appropriate method in java.
* See the implementation of MouseOver for an example.
* For each mouseEvent, we create a Properties object containing
* information about the event. We use methods in dom_util to do this.
A src_moz/dom_util.cpp
A src_moz/dom_util.h
/**
* Methods to simplify webclient accessing the mozilla DOM.
*/
M classes_spec/org/mozilla/webclient/EventRegistration.java
Added support for java.awt.event.MouseListener
M classes_spec/org/mozilla/webclient/test/EMWindow.java
Implemented simle MouseListener
M classes_spec/org/mozilla/webclient/wrapper_native/EventRegistrationImpl.java
Added support for java.awt.event.MouseListener
M classes_spec/org/mozilla/webclient/wrapper_native/NativeEventThread.java
Added support for java.awt.event.MouseListener
M src_moz/DocumentLoaderObserverImpl.cpp
M src_moz/DocumentLoaderObserverImpl.h
* We define a local IID to allow the addDocumentLoadListener and
* addMouseListener functions in EventRegistration.{h,cpp} to
* interrogate the currently installed DocumentLoaderObserver instance
* in mozilla.
*/
#define NS_IDOCLOADEROBSERVERIMPL_IID_STR "fdadb2e0-3028-11d4-8a96-0080c7b9c5ba"
#define NS_IDOCLOADEROBSERVERIMPL_IID {0xfdadb2e0, 0x3028, 0x11d4, { 0x8a, 0x96, 0x00, 0x80, 0xc7, 0xb9, 0xc5, 0xba }}
/**
* This class is the shim between the mozilla listener event system for
* document load events and the java DocumentLoadListener interface.
* For each of the On* methods, we call the appropriate method in java.
* See the implementation of OnEndDocumentLoad for an example.
* A DocumentLoaderObserverImpl instance has a "jobject target", which
* is the Java object that should ultimately receive the events. This
* target will be null if the user just wants to listen for mouse
* events. It willl be non-null if the user wants to listen for
* DocumentLoad events.
* It also hosts a nsIDOMMouseListener instance, which piggybacks on the
* nsIDocumentLoaderObserver instance.
M src_moz/EventRegistration.cpp
M src_moz/EventRegistration.h
Add support for MouseListener
M src_moz/Makefile.win
Added classes for MouseListener and Dom access
M src_moz/NativeEventThread.cpp
Added support for MouseListener
M src_moz/NavigationImpl.cpp
Added call to ReleaseStringChars for bal case.
M src_moz/RDFTreeNode.cpp
Added call to ReleaseStringChars for bal case.
M src_moz/bal_util.cpp
Added #include "wchar.h" so this file compiles on Solaris.
M src_moz/jni_util.cpp
Added implementations for util_CreatePropertiesObject,
util_DestroyPropertiesObject and util_StoreIntoPropertiesObject.
M src_moz/jni_util.h
/**
* A JNI wrapper to create a java.util.Properties object, or the
* equivalent object in the BAL case.
*/
jobject util_CreatePropertiesObject(JNIEnv *env, jobject reserved_NotUsed);
/**
* A JNI wrapper to destroy the object from CreatePropertiesObject
*/
void util_DestroyPropertiesObject(JNIEnv *env, jobject propertiesObject,
jobject reserved_NotUsed);
/**
* A JNI wrapper for storing a name/value pair into the Properties
* object created by CreatePropertiesObject
*/
void util_StoreIntoPropertiesObject(JNIEnv *env, jobject propertiesObject,
jobject name, jobject value);
M src_moz/jni_util_export.cpp
M src_moz/jni_util_export.h
Added functions for allowing the BAL user to specify functions for
{creating, destroying, setting values into} properties objects.
2000-05-26 03:51:51 +04:00
|
|
|
/**
|
|
|
|
|
|
|
|
* A JNI wrapper to create a java.util.Properties object, or the
|
|
|
|
* equivalent object in the BAL case.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
jobject util_CreatePropertiesObject(JNIEnv *env, jobject reserved_NotUsed);
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* A JNI wrapper to destroy the object from CreatePropertiesObject
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
void util_DestroyPropertiesObject(JNIEnv *env, jobject propertiesObject,
|
|
|
|
jobject reserved_NotUsed);
|
|
|
|
|
bug 40330
a=edburns
This checkin mainly does two things:
1. Correctly populates the java.awt.event.MouseEvent subclass with the
correct modifiers, x, y, and clickCount for the mozilla mouse event.
2. Adds a performance optimization: previously, every mouse event was
causing a new instance of java.util.Properties to be created. Now,
only one Properties instance is created per-page, and it is cleared on
each mouse event.
Also, I made the DOMMouseListenerImpl constructor initialize the
refCount to 0. This allows the object to be correctly deleted.
M classes_spec/org/mozilla/webclient/test/EMWindow.java
M classes_spec/org/mozilla/webclient/wrapper_native/WCMouseListenerImpl.java
M src_moz/DOMMouseListenerImpl.cpp
M src_moz/DOMMouseListenerImpl.h
M src_moz/WindowControlImpl.cpp
M src_moz/jni_util.cpp
M src_moz/jni_util.h
M src_moz/jni_util_export.cpp
M src_moz/jni_util_export.h
M classes_spec/org/mozilla/webclient/test/EMWindow.java
* Added test code for MouseListener properties: buttons, modifiers, etc.
M classes_spec/org/mozilla/webclient/wrapper_native/WCMouseListenerImpl.java
* Added support for mouse modifiers. Pull values out of the hash table,
put them in the MouseEvent constructor.
M src_moz/DOMMouseListenerImpl.cpp
* Modified constructors so they initialize all ivars.
* changed usage model of properties object to share the lifetime of the
DOMMouseListenerImpl instance. Needed to make use of the new function
util_ClearPropertiesObject() to do this. Now we have only one call to
util_DestroyPropertiesObject(), in the DOMMouseListenerImpl
destructor.
M src_moz/DOMMouseListenerImpl.h
> virtual ~DOMMouseListenerImpl();
>
98a101
> protected:
100a104,105
>
> void JNICALL addMouseEventDataToProperties(nsIDOMEvent *aMouseEvent);
M src_moz/WindowControlImpl.cpp
* Initialize new WebShellInitConext member propertiesClass to nsnull
M src_moz/jni_util.cpp
* Added util_ClearPropertiesObject() an optimization.
* Store the jclass for java/util/Properties in an element in
WebShellInitContext. This prevents us from having to do FindClass
each time a mouse event occurs.
* Added a parameter to util_StoreIntoPropertiesObject.
M src_moz/jni_util.h
* Added propertiesClass to WebShellInitContext
* Added new method ClearPropertiesObject
* Added new last argument to DestroyPropertiesObject
M src_moz/jni_util_export.cpp
M src_moz/jni_util_export.h
* Added function pointer for util_ClearPropertiesObject.
2000-06-08 06:16:06 +04:00
|
|
|
/**
|
|
|
|
|
|
|
|
* A JNI wrapper to clear the object from CreatePropertiesObject
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
void util_ClearPropertiesObject(JNIEnv *env, jobject propertiesObject,
|
|
|
|
jobject reserved_NotUsed);
|
|
|
|
|
bug: 20659
r=gbarney
a=edburns
This checkin adds java.awt.event.MouseListener support to webclient for
mozilla. The following files are include in this checkin. "A" is new
file "M" is modified file.
A classes_spec/org/mozilla/webclient/WCMouseEvent.java
A classes_spec/org/mozilla/webclient/wrapper_native/WCMouseListenerImpl.java
A src_moz/DOMMouseListenerImpl.cpp
A src_moz/DOMMouseListenerImpl.h
A src_moz/dom_util.cpp
A src_moz/dom_util.h
M classes_spec/org/mozilla/webclient/EventRegistration.java
M classes_spec/org/mozilla/webclient/test/EMWindow.java
M classes_spec/org/mozilla/webclient/wrapper_native/EventRegistrationImpl.java
M classes_spec/org/mozilla/webclient/wrapper_native/NativeEventThread.java
M src_moz/DocumentLoaderObserverImpl.cpp
M src_moz/DocumentLoaderObserverImpl.h
M src_moz/EventRegistration.cpp
M src_moz/EventRegistration.h
M src_moz/Makefile.solaris
M src_moz/Makefile.win
M src_moz/NativeEventThread.cpp
M src_moz/NavigationImpl.cpp
M src_moz/RDFTreeNode.cpp
M src_moz/bal_util.cpp
M src_moz/jni_util.cpp
M src_moz/jni_util.h
M src_moz/jni_util_export.cpp
M src_moz/jni_util_export.h
A classes_spec/org/mozilla/webclient/WCMouseEvent.java
* <P> This java.awt.event.MouseEvent subclass allows the user to access the
* WebclientEvent. This eventData of this WebclientEvent, if non-null,
* is a java.util.Properties instance that contains information about
* this event. </P>
* <P>The following are some interesting keys:</P>
* <UL>
* <LI> href
* </LI>
* <LI> #text
* </LI>
* </UL>
A classes_spec/org/mozilla/webclient/wrapper_native/WCMouseListenerImpl.java
* This class wraps the user provided instance of
* java.awt.event.MouseListener so it can be installed as a
* WebclientEventListener. Note that we implement MouseListener so we
* can be detected by the webclient event system. We don't do anything
* with these methods here, though.
A src_moz/DOMMouseListenerImpl.cpp
A src_moz/DOMMouseListenerImpl.h
* This class is the shim between the mozilla listener event system for
* mouse events and the java MouseListener interface.
* For each of the Mouse* methods, we call the appropriate method in java.
* See the implementation of MouseOver for an example.
* For each mouseEvent, we create a Properties object containing
* information about the event. We use methods in dom_util to do this.
A src_moz/dom_util.cpp
A src_moz/dom_util.h
/**
* Methods to simplify webclient accessing the mozilla DOM.
*/
M classes_spec/org/mozilla/webclient/EventRegistration.java
Added support for java.awt.event.MouseListener
M classes_spec/org/mozilla/webclient/test/EMWindow.java
Implemented simle MouseListener
M classes_spec/org/mozilla/webclient/wrapper_native/EventRegistrationImpl.java
Added support for java.awt.event.MouseListener
M classes_spec/org/mozilla/webclient/wrapper_native/NativeEventThread.java
Added support for java.awt.event.MouseListener
M src_moz/DocumentLoaderObserverImpl.cpp
M src_moz/DocumentLoaderObserverImpl.h
* We define a local IID to allow the addDocumentLoadListener and
* addMouseListener functions in EventRegistration.{h,cpp} to
* interrogate the currently installed DocumentLoaderObserver instance
* in mozilla.
*/
#define NS_IDOCLOADEROBSERVERIMPL_IID_STR "fdadb2e0-3028-11d4-8a96-0080c7b9c5ba"
#define NS_IDOCLOADEROBSERVERIMPL_IID {0xfdadb2e0, 0x3028, 0x11d4, { 0x8a, 0x96, 0x00, 0x80, 0xc7, 0xb9, 0xc5, 0xba }}
/**
* This class is the shim between the mozilla listener event system for
* document load events and the java DocumentLoadListener interface.
* For each of the On* methods, we call the appropriate method in java.
* See the implementation of OnEndDocumentLoad for an example.
* A DocumentLoaderObserverImpl instance has a "jobject target", which
* is the Java object that should ultimately receive the events. This
* target will be null if the user just wants to listen for mouse
* events. It willl be non-null if the user wants to listen for
* DocumentLoad events.
* It also hosts a nsIDOMMouseListener instance, which piggybacks on the
* nsIDocumentLoaderObserver instance.
M src_moz/EventRegistration.cpp
M src_moz/EventRegistration.h
Add support for MouseListener
M src_moz/Makefile.win
Added classes for MouseListener and Dom access
M src_moz/NativeEventThread.cpp
Added support for MouseListener
M src_moz/NavigationImpl.cpp
Added call to ReleaseStringChars for bal case.
M src_moz/RDFTreeNode.cpp
Added call to ReleaseStringChars for bal case.
M src_moz/bal_util.cpp
Added #include "wchar.h" so this file compiles on Solaris.
M src_moz/jni_util.cpp
Added implementations for util_CreatePropertiesObject,
util_DestroyPropertiesObject and util_StoreIntoPropertiesObject.
M src_moz/jni_util.h
/**
* A JNI wrapper to create a java.util.Properties object, or the
* equivalent object in the BAL case.
*/
jobject util_CreatePropertiesObject(JNIEnv *env, jobject reserved_NotUsed);
/**
* A JNI wrapper to destroy the object from CreatePropertiesObject
*/
void util_DestroyPropertiesObject(JNIEnv *env, jobject propertiesObject,
jobject reserved_NotUsed);
/**
* A JNI wrapper for storing a name/value pair into the Properties
* object created by CreatePropertiesObject
*/
void util_StoreIntoPropertiesObject(JNIEnv *env, jobject propertiesObject,
jobject name, jobject value);
M src_moz/jni_util_export.cpp
M src_moz/jni_util_export.h
Added functions for allowing the BAL user to specify functions for
{creating, destroying, setting values into} properties objects.
2000-05-26 03:51:51 +04:00
|
|
|
/**
|
|
|
|
|
|
|
|
* A JNI wrapper for storing a name/value pair into the Properties
|
|
|
|
* object created by CreatePropertiesObject
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
void util_StoreIntoPropertiesObject(JNIEnv *env, jobject propertiesObject,
|
bug 40330
a=edburns
This checkin mainly does two things:
1. Correctly populates the java.awt.event.MouseEvent subclass with the
correct modifiers, x, y, and clickCount for the mozilla mouse event.
2. Adds a performance optimization: previously, every mouse event was
causing a new instance of java.util.Properties to be created. Now,
only one Properties instance is created per-page, and it is cleared on
each mouse event.
Also, I made the DOMMouseListenerImpl constructor initialize the
refCount to 0. This allows the object to be correctly deleted.
M classes_spec/org/mozilla/webclient/test/EMWindow.java
M classes_spec/org/mozilla/webclient/wrapper_native/WCMouseListenerImpl.java
M src_moz/DOMMouseListenerImpl.cpp
M src_moz/DOMMouseListenerImpl.h
M src_moz/WindowControlImpl.cpp
M src_moz/jni_util.cpp
M src_moz/jni_util.h
M src_moz/jni_util_export.cpp
M src_moz/jni_util_export.h
M classes_spec/org/mozilla/webclient/test/EMWindow.java
* Added test code for MouseListener properties: buttons, modifiers, etc.
M classes_spec/org/mozilla/webclient/wrapper_native/WCMouseListenerImpl.java
* Added support for mouse modifiers. Pull values out of the hash table,
put them in the MouseEvent constructor.
M src_moz/DOMMouseListenerImpl.cpp
* Modified constructors so they initialize all ivars.
* changed usage model of properties object to share the lifetime of the
DOMMouseListenerImpl instance. Needed to make use of the new function
util_ClearPropertiesObject() to do this. Now we have only one call to
util_DestroyPropertiesObject(), in the DOMMouseListenerImpl
destructor.
M src_moz/DOMMouseListenerImpl.h
> virtual ~DOMMouseListenerImpl();
>
98a101
> protected:
100a104,105
>
> void JNICALL addMouseEventDataToProperties(nsIDOMEvent *aMouseEvent);
M src_moz/WindowControlImpl.cpp
* Initialize new WebShellInitConext member propertiesClass to nsnull
M src_moz/jni_util.cpp
* Added util_ClearPropertiesObject() an optimization.
* Store the jclass for java/util/Properties in an element in
WebShellInitContext. This prevents us from having to do FindClass
each time a mouse event occurs.
* Added a parameter to util_StoreIntoPropertiesObject.
M src_moz/jni_util.h
* Added propertiesClass to WebShellInitContext
* Added new method ClearPropertiesObject
* Added new last argument to DestroyPropertiesObject
M src_moz/jni_util_export.cpp
M src_moz/jni_util_export.h
* Added function pointer for util_ClearPropertiesObject.
2000-06-08 06:16:06 +04:00
|
|
|
jobject name, jobject value,
|
|
|
|
jobject reserved);
|
bug: 20659
r=gbarney
a=edburns
This checkin adds java.awt.event.MouseListener support to webclient for
mozilla. The following files are include in this checkin. "A" is new
file "M" is modified file.
A classes_spec/org/mozilla/webclient/WCMouseEvent.java
A classes_spec/org/mozilla/webclient/wrapper_native/WCMouseListenerImpl.java
A src_moz/DOMMouseListenerImpl.cpp
A src_moz/DOMMouseListenerImpl.h
A src_moz/dom_util.cpp
A src_moz/dom_util.h
M classes_spec/org/mozilla/webclient/EventRegistration.java
M classes_spec/org/mozilla/webclient/test/EMWindow.java
M classes_spec/org/mozilla/webclient/wrapper_native/EventRegistrationImpl.java
M classes_spec/org/mozilla/webclient/wrapper_native/NativeEventThread.java
M src_moz/DocumentLoaderObserverImpl.cpp
M src_moz/DocumentLoaderObserverImpl.h
M src_moz/EventRegistration.cpp
M src_moz/EventRegistration.h
M src_moz/Makefile.solaris
M src_moz/Makefile.win
M src_moz/NativeEventThread.cpp
M src_moz/NavigationImpl.cpp
M src_moz/RDFTreeNode.cpp
M src_moz/bal_util.cpp
M src_moz/jni_util.cpp
M src_moz/jni_util.h
M src_moz/jni_util_export.cpp
M src_moz/jni_util_export.h
A classes_spec/org/mozilla/webclient/WCMouseEvent.java
* <P> This java.awt.event.MouseEvent subclass allows the user to access the
* WebclientEvent. This eventData of this WebclientEvent, if non-null,
* is a java.util.Properties instance that contains information about
* this event. </P>
* <P>The following are some interesting keys:</P>
* <UL>
* <LI> href
* </LI>
* <LI> #text
* </LI>
* </UL>
A classes_spec/org/mozilla/webclient/wrapper_native/WCMouseListenerImpl.java
* This class wraps the user provided instance of
* java.awt.event.MouseListener so it can be installed as a
* WebclientEventListener. Note that we implement MouseListener so we
* can be detected by the webclient event system. We don't do anything
* with these methods here, though.
A src_moz/DOMMouseListenerImpl.cpp
A src_moz/DOMMouseListenerImpl.h
* This class is the shim between the mozilla listener event system for
* mouse events and the java MouseListener interface.
* For each of the Mouse* methods, we call the appropriate method in java.
* See the implementation of MouseOver for an example.
* For each mouseEvent, we create a Properties object containing
* information about the event. We use methods in dom_util to do this.
A src_moz/dom_util.cpp
A src_moz/dom_util.h
/**
* Methods to simplify webclient accessing the mozilla DOM.
*/
M classes_spec/org/mozilla/webclient/EventRegistration.java
Added support for java.awt.event.MouseListener
M classes_spec/org/mozilla/webclient/test/EMWindow.java
Implemented simle MouseListener
M classes_spec/org/mozilla/webclient/wrapper_native/EventRegistrationImpl.java
Added support for java.awt.event.MouseListener
M classes_spec/org/mozilla/webclient/wrapper_native/NativeEventThread.java
Added support for java.awt.event.MouseListener
M src_moz/DocumentLoaderObserverImpl.cpp
M src_moz/DocumentLoaderObserverImpl.h
* We define a local IID to allow the addDocumentLoadListener and
* addMouseListener functions in EventRegistration.{h,cpp} to
* interrogate the currently installed DocumentLoaderObserver instance
* in mozilla.
*/
#define NS_IDOCLOADEROBSERVERIMPL_IID_STR "fdadb2e0-3028-11d4-8a96-0080c7b9c5ba"
#define NS_IDOCLOADEROBSERVERIMPL_IID {0xfdadb2e0, 0x3028, 0x11d4, { 0x8a, 0x96, 0x00, 0x80, 0xc7, 0xb9, 0xc5, 0xba }}
/**
* This class is the shim between the mozilla listener event system for
* document load events and the java DocumentLoadListener interface.
* For each of the On* methods, we call the appropriate method in java.
* See the implementation of OnEndDocumentLoad for an example.
* A DocumentLoaderObserverImpl instance has a "jobject target", which
* is the Java object that should ultimately receive the events. This
* target will be null if the user just wants to listen for mouse
* events. It willl be non-null if the user wants to listen for
* DocumentLoad events.
* It also hosts a nsIDOMMouseListener instance, which piggybacks on the
* nsIDocumentLoaderObserver instance.
M src_moz/EventRegistration.cpp
M src_moz/EventRegistration.h
Add support for MouseListener
M src_moz/Makefile.win
Added classes for MouseListener and Dom access
M src_moz/NativeEventThread.cpp
Added support for MouseListener
M src_moz/NavigationImpl.cpp
Added call to ReleaseStringChars for bal case.
M src_moz/RDFTreeNode.cpp
Added call to ReleaseStringChars for bal case.
M src_moz/bal_util.cpp
Added #include "wchar.h" so this file compiles on Solaris.
M src_moz/jni_util.cpp
Added implementations for util_CreatePropertiesObject,
util_DestroyPropertiesObject and util_StoreIntoPropertiesObject.
M src_moz/jni_util.h
/**
* A JNI wrapper to create a java.util.Properties object, or the
* equivalent object in the BAL case.
*/
jobject util_CreatePropertiesObject(JNIEnv *env, jobject reserved_NotUsed);
/**
* A JNI wrapper to destroy the object from CreatePropertiesObject
*/
void util_DestroyPropertiesObject(JNIEnv *env, jobject propertiesObject,
jobject reserved_NotUsed);
/**
* A JNI wrapper for storing a name/value pair into the Properties
* object created by CreatePropertiesObject
*/
void util_StoreIntoPropertiesObject(JNIEnv *env, jobject propertiesObject,
jobject name, jobject value);
M src_moz/jni_util_export.cpp
M src_moz/jni_util_export.h
Added functions for allowing the BAL user to specify functions for
{creating, destroying, setting values into} properties objects.
2000-05-26 03:51:51 +04:00
|
|
|
|
2000-03-17 02:07:03 +03:00
|
|
|
|
2000-08-04 01:32:54 +04:00
|
|
|
//
|
|
|
|
// Functions provided by the browser specific native code
|
|
|
|
//
|
|
|
|
|
|
|
|
void util_LogMessage(int level, const char *fmt);
|
|
|
|
|
|
|
|
void util_Assert(void *test);
|
|
|
|
|
2000-03-04 04:37:20 +03:00
|
|
|
//
|
|
|
|
// Functions from secret JDK files
|
|
|
|
//
|
|
|
|
|
|
|
|
JNIEXPORT jvalue JNICALL
|
|
|
|
JNU_CallMethodByName(JNIEnv *env,
|
|
|
|
jboolean *hasException,
|
|
|
|
jobject obj,
|
|
|
|
const char *name,
|
|
|
|
const char *signature,
|
|
|
|
...);
|
|
|
|
|
|
|
|
JNIEXPORT jvalue JNICALL
|
|
|
|
JNU_CallMethodByNameV(JNIEnv *env,
|
|
|
|
jboolean *hasException,
|
|
|
|
jobject obj,
|
|
|
|
const char *name,
|
|
|
|
const char *signature,
|
|
|
|
va_list args);
|
|
|
|
|
|
|
|
JNIEXPORT void * JNICALL
|
|
|
|
JNU_GetEnv(JavaVM *vm, jint version);
|
|
|
|
|
|
|
|
#endif // jni_util_h
|