2000-03-04 01:37:20 +00: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 00:01:58 +00:00
|
|
|
* Ashutosh Kulkarni <ashuk@eng.sun.com>
|
2000-03-04 01:37:20 +00:00
|
|
|
* Ann Sunhachawee
|
2000-09-19 00:18:18 +00:00
|
|
|
* Jason Mawdsley <jason@macadamian.com>
|
|
|
|
* Louis-Philippe Gagnon <louisphilippe@macadamian.com>
|
2000-03-04 01:37:20 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "jni_util.h"
|
|
|
|
|
2000-08-03 21:32:54 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
bug: http://bugzilla.mozilla.org/show_bug.cgi?id=34665
This change replaces all printfs in src_moz with calls to PR_LOG. No
printfs should appear in src_moz anymore.
You won't see any console output from native code unless you define
NSPR_LOG_MODULES=webclient:3
in your environment. Furthermore, if you want PR_LOG statements in
webclient to go to a file instead, define
WEBCLIENT_LOG_FILE=C:\VALIDDIR\filename.txt
in your environment. This file will get created fresh each time, since
PR_LOG uses fopen(filename, "w").
New Files:
I've created ns_globals.h, included from jni_util.h. ns_globals.h holds
an extern * to a struct used in the PR_LOG calls.
Significant changes:
WrapperFactoryImpl.cpp
nativeAppInitialize(){
Added:
#if DEBUG_RAPTOR_CANVAS
prLogModuleInfo = PR_NewLogModule("webclient");
const char *webclientLogFile = PR_GetEnv("WEBCLIENT_LOG_FILE");
if (nsnull != webclientLogFile) {
PR_SetLogFile(webclientLogFile);
// If this fails, it just goes to stdout/stderr
}
#endif
}
All the other files in this checkin follow the this pattern:
Before checkin:
printf("InitMozillaStuff(%lx): Create the Event Queue for the UI thread...\n",
initContext);
After checkin:
if (prLogModuleInfo) {
PR_LOG(prLogModuleInfo, 3,
("InitMozillaStuff(%lx): Create the Event Queue for the UI thread...\n",
initContext));
}
See http://lxr.mozilla.org/mozilla/source/nsprpub/pr/include/prlog.h#190
for the definition of PR_LOG
2000-04-05 21:38:27 +00:00
|
|
|
JavaVM *gVm = nsnull; // declared in ns_globals.h, which is included in
|
|
|
|
// jni_util.h
|
2000-03-04 01:37:20 +00:00
|
|
|
|
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-25 23:51:51 +00:00
|
|
|
//
|
|
|
|
// Local cache variables of JNI data items
|
|
|
|
//
|
|
|
|
|
|
|
|
static jmethodID gPropertiesInitMethodID = nsnull;
|
|
|
|
static jmethodID gPropertiesSetPropertyMethodID = nsnull;
|
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 02:16:06 +00:00
|
|
|
static jmethodID gPropertiesClearMethodID = nsnull;
|
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-25 23:51:51 +00:00
|
|
|
|
2000-08-17 18:29:18 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Listener data
|
|
|
|
//
|
|
|
|
|
|
|
|
jboolean STRING_CONSTANTS_INITED = JNI_FALSE;
|
|
|
|
|
|
|
|
jobject SCREEN_X_KEY;
|
|
|
|
jobject SCREEN_Y_KEY;
|
|
|
|
jobject CLIENT_X_KEY;
|
|
|
|
jobject CLIENT_Y_KEY;
|
|
|
|
jobject ALT_KEY;
|
|
|
|
jobject CTRL_KEY;
|
|
|
|
jobject SHIFT_KEY;
|
|
|
|
jobject META_KEY;
|
|
|
|
jobject BUTTON_KEY;
|
|
|
|
jobject CLICK_COUNT_KEY;
|
|
|
|
jobject TRUE_VALUE;
|
|
|
|
jobject FALSE_VALUE;
|
|
|
|
jobject ONE_VALUE;
|
|
|
|
jobject TWO_VALUE;
|
|
|
|
|
|
|
|
jstring DOCUMENT_LOAD_LISTENER_CLASSNAME;
|
|
|
|
jstring MOUSE_LISTENER_CLASSNAME;
|
|
|
|
|
|
|
|
jlong DocumentLoader_maskValues[] = { -1L };
|
|
|
|
char * DocumentLoader_maskNames[] = {
|
|
|
|
START_DOCUMENT_LOAD_EVENT_MASK_VALUE,
|
|
|
|
END_DOCUMENT_LOAD_EVENT_MASK_VALUE,
|
|
|
|
START_URL_LOAD_EVENT_MASK_VALUE,
|
|
|
|
END_URL_LOAD_EVENT_MASK_VALUE,
|
|
|
|
PROGRESS_URL_LOAD_EVENT_MASK_VALUE,
|
|
|
|
STATUS_URL_LOAD_EVENT_MASK_VALUE,
|
|
|
|
UNKNOWN_CONTENT_EVENT_MASK_VALUE,
|
|
|
|
FETCH_INTERRUPT_EVENT_MASK_VALUE,
|
|
|
|
nsnull
|
|
|
|
};
|
|
|
|
|
|
|
|
jlong DOMMouseListener_maskValues[] = { -1L };
|
|
|
|
char *DOMMouseListener_maskNames[] = {
|
|
|
|
MOUSE_DOWN_EVENT_MASK_VALUE,
|
|
|
|
MOUSE_UP_EVENT_MASK_VALUE,
|
|
|
|
MOUSE_CLICK_EVENT_MASK_VALUE,
|
|
|
|
MOUSE_DOUBLE_CLICK_EVENT_MASK_VALUE,
|
|
|
|
MOUSE_OVER_EVENT_MASK_VALUE,
|
|
|
|
MOUSE_OUT_EVENT_MASK_VALUE,
|
|
|
|
nsnull
|
|
|
|
};
|
|
|
|
|
2000-08-03 21:32:54 +00:00
|
|
|
void util_InitializeShareInitContext(void *yourInitContext)
|
|
|
|
{
|
|
|
|
ShareInitContext *initContext = (ShareInitContext *) yourInitContext;
|
|
|
|
initContext->propertiesClass = nsnull;
|
|
|
|
}
|
|
|
|
|
|
|
|
void util_DeallocateShareInitContext(void *yourInitContext)
|
|
|
|
{
|
|
|
|
// right now there is nothing to deallocate
|
|
|
|
}
|
|
|
|
|
2000-08-17 18:29:18 +00:00
|
|
|
jboolean util_InitStringConstants(JNIEnv *env)
|
|
|
|
{
|
|
|
|
if (nsnull == gVm) { // declared in jni_util.h
|
|
|
|
::util_GetJavaVM(env, &gVm); // save this vm reference away for the callback!
|
|
|
|
}
|
|
|
|
|
|
|
|
if (nsnull == (SCREEN_X_KEY =
|
|
|
|
::util_NewGlobalRef(env, (jobject)
|
|
|
|
::util_NewStringUTF(env, "ScreenX")))) {
|
|
|
|
return JNI_FALSE;
|
|
|
|
}
|
|
|
|
if (nsnull == (SCREEN_Y_KEY =
|
|
|
|
::util_NewGlobalRef(env, (jobject)
|
|
|
|
::util_NewStringUTF(env, "ScreenY")))) {
|
|
|
|
return JNI_FALSE;
|
|
|
|
}
|
|
|
|
if (nsnull == (CLIENT_X_KEY =
|
|
|
|
::util_NewGlobalRef(env, (jobject)
|
|
|
|
::util_NewStringUTF(env, "ClientX")))) {
|
|
|
|
return JNI_FALSE;
|
|
|
|
}
|
|
|
|
if (nsnull == (CLIENT_Y_KEY =
|
|
|
|
::util_NewGlobalRef(env, (jobject)
|
|
|
|
::util_NewStringUTF(env, "ClientY")))) {
|
|
|
|
return JNI_FALSE;
|
|
|
|
}
|
|
|
|
if (nsnull == (ALT_KEY =
|
|
|
|
::util_NewGlobalRef(env, (jobject)
|
|
|
|
::util_NewStringUTF(env, "Alt")))) {
|
|
|
|
return JNI_FALSE;
|
|
|
|
}
|
|
|
|
if (nsnull == (CTRL_KEY =
|
|
|
|
::util_NewGlobalRef(env, (jobject)
|
|
|
|
::util_NewStringUTF(env, "Ctrl")))) {
|
|
|
|
return JNI_FALSE;
|
|
|
|
}
|
|
|
|
if (nsnull == (SHIFT_KEY =
|
|
|
|
::util_NewGlobalRef(env, (jobject)
|
|
|
|
::util_NewStringUTF(env, "Shift")))) {
|
|
|
|
return JNI_FALSE;
|
|
|
|
}
|
|
|
|
if (nsnull == (META_KEY =
|
|
|
|
::util_NewGlobalRef(env, (jobject)
|
|
|
|
::util_NewStringUTF(env, "Meta")))) {
|
|
|
|
return JNI_FALSE;
|
|
|
|
}
|
|
|
|
if (nsnull == (BUTTON_KEY =
|
|
|
|
::util_NewGlobalRef(env, (jobject)
|
|
|
|
::util_NewStringUTF(env, "Button")))) {
|
|
|
|
return JNI_FALSE;
|
|
|
|
}
|
|
|
|
if (nsnull == (CLICK_COUNT_KEY =
|
|
|
|
::util_NewGlobalRef(env, (jobject)
|
|
|
|
::util_NewStringUTF(env,
|
|
|
|
"ClickCount")))) {
|
|
|
|
return JNI_FALSE;
|
|
|
|
}
|
|
|
|
if (nsnull == (TRUE_VALUE =
|
|
|
|
::util_NewGlobalRef(env, (jobject)
|
|
|
|
::util_NewStringUTF(env, "true")))) {
|
|
|
|
return JNI_FALSE;
|
|
|
|
}
|
|
|
|
if (nsnull == (FALSE_VALUE =
|
|
|
|
::util_NewGlobalRef(env, (jobject)
|
|
|
|
::util_NewStringUTF(env, "false")))) {
|
|
|
|
return JNI_FALSE;
|
|
|
|
}
|
|
|
|
if (nsnull == (ONE_VALUE =
|
|
|
|
::util_NewGlobalRef(env, (jobject)
|
|
|
|
::util_NewStringUTF(env, "1")))) {
|
|
|
|
return JNI_FALSE;
|
|
|
|
}
|
|
|
|
if (nsnull == (TWO_VALUE =
|
|
|
|
::util_NewGlobalRef(env, (jobject)
|
|
|
|
::util_NewStringUTF(env, "2")))) {
|
|
|
|
return JNI_FALSE;
|
|
|
|
}
|
|
|
|
if (nsnull == (DOCUMENT_LOAD_LISTENER_CLASSNAME = (jstring)
|
|
|
|
::util_NewGlobalRef(env, (jobject)
|
|
|
|
::util_NewStringUTF(env,
|
|
|
|
DOCUMENT_LOAD_LISTENER_CLASSNAME_VALUE)))) {
|
|
|
|
return JNI_FALSE;
|
|
|
|
}
|
|
|
|
if (nsnull == (MOUSE_LISTENER_CLASSNAME = (jstring)
|
|
|
|
::util_NewGlobalRef(env, (jobject)
|
|
|
|
::util_NewStringUTF(env,
|
|
|
|
MOUSE_LISTENER_CLASSNAME_VALUE)))) {
|
|
|
|
return JNI_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return STRING_CONSTANTS_INITED = JNI_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
jboolean util_StringConstantsAreInitialized()
|
|
|
|
{
|
|
|
|
return STRING_CONSTANTS_INITED;
|
|
|
|
}
|
|
|
|
|
2000-03-04 01:37:20 +00:00
|
|
|
void util_ThrowExceptionToJava (JNIEnv * env, const char * message)
|
|
|
|
{
|
|
|
|
if (env->ExceptionOccurred()) {
|
|
|
|
env->ExceptionClear();
|
|
|
|
}
|
|
|
|
jclass excCls = env->FindClass("java/lang/Exception");
|
|
|
|
|
|
|
|
if (excCls == 0) { // Unable to find the exception class, give up.
|
|
|
|
if (env->ExceptionOccurred())
|
|
|
|
env->ExceptionClear();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Throw the exception with the error code and description
|
|
|
|
jmethodID jID = env->GetMethodID(excCls, "<init>", "(Ljava/lang/String;)V"); // void Exception(String)
|
|
|
|
|
2000-03-09 05:12:42 +00:00
|
|
|
if (jID != nsnull) {
|
2000-03-04 01:37:20 +00:00
|
|
|
jstring exceptionString = env->NewStringUTF(message);
|
|
|
|
jthrowable newException = (jthrowable) env->NewObject(excCls, jID, exceptionString);
|
|
|
|
|
2000-03-09 05:12:42 +00:00
|
|
|
if (newException != nsnull) {
|
2000-03-04 01:37:20 +00:00
|
|
|
env->Throw(newException);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (env->ExceptionOccurred())
|
|
|
|
env->ExceptionClear();
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (env->ExceptionOccurred())
|
|
|
|
env->ExceptionClear();
|
|
|
|
}
|
|
|
|
} // ThrowExceptionToJava()
|
|
|
|
|
|
|
|
void util_SendEventToJava(JNIEnv *yourEnv, jobject nativeEventThread,
|
|
|
|
jobject webclientEventListener,
|
2000-08-10 21:38:52 +00:00
|
|
|
jstring eventListenerClassName,
|
2000-04-18 21:58:29 +00:00
|
|
|
jlong eventType, jobject eventData)
|
2000-03-04 01:37:20 +00:00
|
|
|
{
|
2000-04-13 00:12:50 +00:00
|
|
|
#ifdef BAL_INTERFACE
|
|
|
|
if (nsnull != externalEventOccurred) {
|
2000-04-15 00:27:35 +00:00
|
|
|
externalEventOccurred(yourEnv, nativeEventThread,
|
2000-04-18 21:58:29 +00:00
|
|
|
webclientEventListener, eventType, eventData);
|
2000-04-13 00:12:50 +00:00
|
|
|
}
|
|
|
|
#else
|
2000-03-09 05:12:42 +00:00
|
|
|
if (nsnull == gVm) {
|
2000-03-04 01:37:20 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-09-19 00:18:18 +00:00
|
|
|
JNIEnv *env = (JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION);
|
2000-03-04 01:37:20 +00:00
|
|
|
|
2000-03-09 05:12:42 +00:00
|
|
|
if (nsnull == env) {
|
2000-03-04 01:37:20 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
jthrowable exception;
|
|
|
|
|
2000-03-09 05:12:42 +00:00
|
|
|
if (nsnull != (exception = env->ExceptionOccurred())) {
|
2000-03-04 01:37:20 +00:00
|
|
|
env->ExceptionDescribe();
|
|
|
|
}
|
|
|
|
|
|
|
|
jclass clazz = env->GetObjectClass(nativeEventThread);
|
|
|
|
jmethodID mid = env->GetMethodID(clazz, "nativeEventOccurred",
|
2000-08-10 21:38:52 +00:00
|
|
|
"(Lorg/mozilla/webclient/WebclientEventListener;Ljava/lang/String;JLjava/lang/Object;)V");
|
2000-03-09 05:12:42 +00:00
|
|
|
if ( mid != nsnull) {
|
2000-03-04 01:37:20 +00:00
|
|
|
env->CallVoidMethod(nativeEventThread, mid, webclientEventListener,
|
2000-08-10 21:38:52 +00:00
|
|
|
eventListenerClassName,
|
2000-04-18 21:58:29 +00:00
|
|
|
eventType, eventData);
|
2000-03-04 01:37:20 +00:00
|
|
|
} else {
|
2000-08-03 21:32:54 +00:00
|
|
|
util_LogMessage(3, "cannot call the Java Method!\n");
|
2000-03-04 01:37:20 +00:00
|
|
|
}
|
2000-04-13 00:12:50 +00:00
|
|
|
#endif
|
2000-03-04 01:37:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @return: the string name of the current java thread. Must be freed!
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
char *util_GetCurrentThreadName(JNIEnv *env)
|
|
|
|
{
|
|
|
|
jclass threadClass = env->FindClass("java/lang/Thread");
|
|
|
|
jobject currentThread;
|
|
|
|
jstring name;
|
2000-03-09 05:12:42 +00:00
|
|
|
char *result = nsnull;
|
2000-03-04 01:37:20 +00:00
|
|
|
const char *cstr;
|
|
|
|
jboolean isCopy;
|
|
|
|
|
2000-03-09 05:12:42 +00:00
|
|
|
if (nsnull != threadClass) {
|
2000-03-04 01:37:20 +00:00
|
|
|
jmethodID currentThreadID =
|
|
|
|
env->GetStaticMethodID(threadClass,"currentThread",
|
|
|
|
"()Ljava/lang/Thread;");
|
|
|
|
currentThread = env->CallStaticObjectMethod(threadClass,
|
|
|
|
currentThreadID);
|
2000-03-09 05:12:42 +00:00
|
|
|
if (nsnull != currentThread) {
|
2000-03-04 01:37:20 +00:00
|
|
|
jmethodID getNameID = env->GetMethodID(threadClass,
|
|
|
|
"getName",
|
|
|
|
"()Ljava/lang/String;");
|
|
|
|
name = (jstring) env->CallObjectMethod(currentThread, getNameID,
|
2000-03-09 05:12:42 +00:00
|
|
|
nsnull);
|
2000-03-04 01:37:20 +00:00
|
|
|
result = strdup(cstr = env->GetStringUTFChars(name, &isCopy));
|
|
|
|
if (JNI_TRUE == isCopy) {
|
|
|
|
env->ReleaseStringUTFChars(name, cstr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
|
|
|
void util_DumpJavaStack(JNIEnv *env)
|
|
|
|
{
|
|
|
|
jclass threadClass = env->FindClass("java/lang/Thread");
|
2000-03-09 05:12:42 +00:00
|
|
|
if (nsnull != threadClass) {
|
2000-03-04 01:37:20 +00:00
|
|
|
jmethodID dumpStackID = env->GetStaticMethodID(threadClass,
|
|
|
|
"dumpStack",
|
|
|
|
"()V");
|
|
|
|
env->CallStaticVoidMethod(threadClass, dumpStackID);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-03-16 23:07:03 +00:00
|
|
|
jobject util_NewGlobalRef(JNIEnv *env, jobject obj)
|
|
|
|
{
|
|
|
|
jobject result = nsnull;
|
|
|
|
#ifdef BAL_INTERFACE
|
2000-04-13 00:12:50 +00:00
|
|
|
// PENDING(edburns): do we need to do anything here?
|
|
|
|
result = obj;
|
2000-03-16 23:07:03 +00:00
|
|
|
#else
|
|
|
|
result = env->NewGlobalRef(obj);
|
|
|
|
#endif
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
void util_DeleteGlobalRef(JNIEnv *env, jobject obj)
|
|
|
|
{
|
|
|
|
#ifdef BAL_INTERFACE
|
|
|
|
#else
|
|
|
|
env->DeleteGlobalRef(obj);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
jthrowable util_ExceptionOccurred(JNIEnv *env)
|
|
|
|
{
|
|
|
|
jthrowable result = nsnull;
|
|
|
|
#ifdef BAL_INTERFACE
|
|
|
|
#else
|
|
|
|
result = env->ExceptionOccurred();
|
|
|
|
#endif
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
jint util_GetJavaVM(JNIEnv *env, JavaVM **vm)
|
|
|
|
{
|
|
|
|
int result = -1;
|
|
|
|
#ifdef BAL_INTERFACE
|
|
|
|
#else
|
|
|
|
result = env->GetJavaVM(vm);
|
|
|
|
#endif
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
jclass util_FindClass(JNIEnv *env, const char *fullyQualifiedClassName)
|
|
|
|
{
|
|
|
|
jclass result = nsnull;
|
|
|
|
#ifdef BAL_INTERFACE
|
2000-04-15 00:27:35 +00:00
|
|
|
result = util_GetClassMapping(fullyQualifiedClassName);
|
2000-03-16 23:07:03 +00:00
|
|
|
#else
|
|
|
|
result = env->FindClass(fullyQualifiedClassName);
|
|
|
|
#endif
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
jfieldID util_GetStaticFieldID(JNIEnv *env, jclass clazz,
|
|
|
|
const char *fieldName,
|
|
|
|
const char *signature)
|
|
|
|
{
|
|
|
|
jfieldID result = nsnull;
|
|
|
|
#ifdef BAL_INTERFACE
|
|
|
|
#else
|
|
|
|
result = env->GetStaticFieldID(clazz, fieldName, signature);
|
|
|
|
#endif
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
jlong util_GetStaticLongField(JNIEnv *env, jclass clazz, jfieldID id)
|
|
|
|
{
|
|
|
|
jlong result = -1;
|
|
|
|
#ifdef BAL_INTERFACE
|
|
|
|
#else
|
|
|
|
result = env->GetStaticLongField(clazz, id);
|
|
|
|
#endif
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
jboolean util_IsInstanceOf(JNIEnv *env, jobject obj, jclass clazz)
|
|
|
|
{
|
|
|
|
jboolean result = JNI_FALSE;
|
|
|
|
#ifdef BAL_INTERFACE
|
2000-04-15 00:27:35 +00:00
|
|
|
if (nsnull != externalInstanceOf) {
|
|
|
|
result = externalInstanceOf(env, obj, clazz);
|
|
|
|
}
|
2000-03-16 23:07:03 +00:00
|
|
|
#else
|
|
|
|
result = env->IsInstanceOf(obj, clazz);
|
|
|
|
#endif
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
jint util_GetIntValueFromInstance(JNIEnv *env, jobject obj,
|
|
|
|
const char *fieldName)
|
|
|
|
{
|
|
|
|
int result = -1;
|
|
|
|
#ifdef BAL_INTERFACE
|
|
|
|
#else
|
|
|
|
jclass objClass = env->GetObjectClass(obj);
|
|
|
|
if (nsnull == objClass) {
|
2000-08-03 21:32:54 +00:00
|
|
|
util_LogMessage(3,
|
|
|
|
"util_GetIntValueFromInstance: Can't get object class from instance.\n");
|
2000-03-16 23:07:03 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
jfieldID theFieldID = env->GetFieldID(objClass, fieldName, "I");
|
|
|
|
if (nsnull == theFieldID) {
|
2000-08-03 21:32:54 +00:00
|
|
|
util_LogMessage(3,
|
|
|
|
"util_GetIntValueFromInstance: Can't get fieldID for fieldName.\n");
|
2000-03-16 23:07:03 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
result = env->GetIntField(obj, theFieldID);
|
|
|
|
#endif
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
void util_SetIntValueForInstance(JNIEnv *env, jobject obj,
|
|
|
|
const char *fieldName, jint newValue)
|
|
|
|
{
|
|
|
|
#ifdef BAL_INTERFACE
|
|
|
|
#else
|
|
|
|
jclass objClass = env->GetObjectClass(obj);
|
|
|
|
if (nsnull == objClass) {
|
2000-08-03 21:32:54 +00:00
|
|
|
util_LogMessage(3,
|
|
|
|
"util_SetIntValueForInstance: Can't get object class from instance.\n");
|
2000-03-16 23:07:03 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
jfieldID fieldID = env->GetFieldID(objClass, fieldName, "I");
|
|
|
|
if (nsnull == fieldID) {
|
2000-08-03 21:32:54 +00:00
|
|
|
util_LogMessage(3,
|
|
|
|
"util_SetIntValueForInstance: Can't get fieldID for fieldName.\n");
|
2000-03-16 23:07:03 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
env->SetIntField(obj, fieldID, newValue);
|
2000-09-19 00:18:18 +00:00
|
|
|
#endif
|
2000-03-16 23:07:03 +00:00
|
|
|
}
|
|
|
|
|
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 02:16:06 +00:00
|
|
|
jobject util_CreatePropertiesObject(JNIEnv *env, jobject initContextObj)
|
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-25 23:51:51 +00:00
|
|
|
{
|
|
|
|
jobject result = nsnull;
|
|
|
|
#ifdef BAL_INTERFACE
|
|
|
|
if (nsnull != externalCreatePropertiesObject) {
|
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 02:16:06 +00:00
|
|
|
result = externalCreatePropertiesObject(env, initContextObj);
|
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-25 23:51:51 +00:00
|
|
|
}
|
|
|
|
#else
|
2000-08-03 21:32:54 +00:00
|
|
|
util_Assert(initContextObj);
|
|
|
|
ShareInitContext *initContext = (ShareInitContext *) initContextObj;
|
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 02:16:06 +00:00
|
|
|
|
|
|
|
if (nsnull == initContext->propertiesClass) {
|
|
|
|
if (nsnull == (initContext->propertiesClass =
|
|
|
|
::util_FindClass(env, "java/util/Properties"))) {
|
|
|
|
return result;
|
|
|
|
}
|
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-25 23:51:51 +00:00
|
|
|
}
|
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 02:16:06 +00:00
|
|
|
|
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-25 23:51:51 +00:00
|
|
|
if (nsnull == gPropertiesInitMethodID) {
|
2000-08-03 21:32:54 +00:00
|
|
|
util_Assert(initContext->propertiesClass);
|
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-25 23:51:51 +00:00
|
|
|
if (nsnull == (gPropertiesInitMethodID =
|
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 02:16:06 +00:00
|
|
|
env->GetMethodID(initContext->propertiesClass,
|
|
|
|
"<init>", "()V"))) {
|
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-25 23:51:51 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
2000-08-03 21:32:54 +00:00
|
|
|
util_Assert(gPropertiesInitMethodID);
|
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 02:16:06 +00:00
|
|
|
|
|
|
|
result = ::util_NewGlobalRef(env,
|
|
|
|
env->NewObject(initContext->propertiesClass,
|
|
|
|
gPropertiesInitMethodID));
|
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-25 23:51:51 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
void util_DestroyPropertiesObject(JNIEnv *env, jobject propertiesObject,
|
|
|
|
jobject reserved_NotUsed)
|
|
|
|
{
|
|
|
|
#ifdef BAL_INTERFACE
|
|
|
|
if (nsnull != externalDestroyPropertiesObject) {
|
|
|
|
externalDestroyPropertiesObject(env, propertiesObject,
|
|
|
|
reserved_NotUsed);
|
|
|
|
}
|
|
|
|
#else
|
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 02:16:06 +00:00
|
|
|
::util_DeleteGlobalRef(env, propertiesObject);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void util_ClearPropertiesObject(JNIEnv *env, jobject propertiesObject,
|
|
|
|
jobject initContextObj)
|
|
|
|
{
|
|
|
|
#ifdef BAL_INTERFACE
|
|
|
|
if (nsnull != externalClearPropertiesObject) {
|
|
|
|
externalClearPropertiesObject(env, propertiesObject, initContextObj);
|
|
|
|
}
|
|
|
|
#else
|
2000-08-03 21:32:54 +00:00
|
|
|
util_Assert(initContextObj);
|
|
|
|
ShareInitContext *initContext = (ShareInitContext *) initContextObj;
|
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 02:16:06 +00:00
|
|
|
|
|
|
|
if (nsnull == gPropertiesClearMethodID) {
|
2000-08-03 21:32:54 +00:00
|
|
|
util_Assert(initContext->propertiesClass);
|
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 02:16:06 +00:00
|
|
|
if (nsnull == (gPropertiesClearMethodID =
|
|
|
|
env->GetMethodID(initContext->propertiesClass, "clear", "()V"))) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2000-08-03 21:32:54 +00:00
|
|
|
util_Assert(gPropertiesClearMethodID);
|
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 02:16:06 +00:00
|
|
|
env->CallVoidMethod(propertiesObject, gPropertiesClearMethodID);
|
|
|
|
|
|
|
|
return;
|
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-25 23:51:51 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
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 02:16:06 +00:00
|
|
|
jobject name, jobject value,
|
|
|
|
jobject initContextObj)
|
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-25 23:51:51 +00:00
|
|
|
{
|
|
|
|
#ifdef BAL_INTERFACE
|
|
|
|
if (nsnull != externalStoreIntoPropertiesObject) {
|
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 02:16:06 +00:00
|
|
|
externalStoreIntoPropertiesObject(env, propertiesObject, name, value,
|
|
|
|
initContextObj);
|
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-25 23:51:51 +00:00
|
|
|
}
|
|
|
|
#else
|
2000-08-03 21:32:54 +00:00
|
|
|
util_Assert(initContextObj);
|
|
|
|
ShareInitContext *initContext = (ShareInitContext *) initContextObj;
|
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 02:16:06 +00:00
|
|
|
|
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-25 23:51:51 +00:00
|
|
|
if (nsnull == gPropertiesSetPropertyMethodID) {
|
2000-08-03 21:32:54 +00:00
|
|
|
util_Assert(initContext->propertiesClass);
|
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-25 23:51:51 +00:00
|
|
|
if (nsnull == (gPropertiesSetPropertyMethodID =
|
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 02:16:06 +00:00
|
|
|
env->GetMethodID(initContext->propertiesClass,
|
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-25 23:51:51 +00:00
|
|
|
"setProperty",
|
|
|
|
"(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;"))) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2000-08-03 21:32:54 +00:00
|
|
|
util_Assert(gPropertiesSetPropertyMethodID);
|
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-25 23:51:51 +00:00
|
|
|
|
|
|
|
env->CallObjectMethod(propertiesObject, gPropertiesSetPropertyMethodID,
|
|
|
|
name, value);
|
|
|
|
|
2000-03-16 23:07:03 +00:00
|
|
|
|
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-25 23:51:51 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
2000-03-16 23:07:03 +00:00
|
|
|
|
2000-03-04 01:37:20 +00:00
|
|
|
JNIEXPORT jvalue JNICALL
|
|
|
|
JNU_CallMethodByName(JNIEnv *env,
|
|
|
|
jboolean *hasException,
|
|
|
|
jobject obj,
|
|
|
|
const char *name,
|
|
|
|
const char *signature,
|
|
|
|
...)
|
|
|
|
{
|
|
|
|
jvalue result;
|
|
|
|
va_list args;
|
|
|
|
|
|
|
|
va_start(args, signature);
|
|
|
|
result = JNU_CallMethodByNameV(env, hasException, obj, name, signature,
|
|
|
|
args);
|
|
|
|
va_end(args);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
JNIEXPORT jvalue JNICALL
|
|
|
|
JNU_CallMethodByNameV(JNIEnv *env,
|
|
|
|
jboolean *hasException,
|
|
|
|
jobject obj,
|
|
|
|
const char *name,
|
|
|
|
const char *signature,
|
|
|
|
va_list args)
|
|
|
|
{
|
|
|
|
jclass clazz;
|
|
|
|
jmethodID mid;
|
|
|
|
jvalue result;
|
|
|
|
const char *p = signature;
|
|
|
|
/* find out the return type */
|
|
|
|
while (*p && *p != ')')
|
|
|
|
p++;
|
|
|
|
p++;
|
|
|
|
|
|
|
|
result.i = 0;
|
|
|
|
|
2000-09-19 00:18:18 +00:00
|
|
|
#ifdef JNI_VERSION_1_2
|
|
|
|
|
2000-03-04 01:37:20 +00:00
|
|
|
if (env->EnsureLocalCapacity(3) < 0)
|
|
|
|
goto done2;
|
2000-09-19 00:18:18 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2000-03-04 01:37:20 +00:00
|
|
|
clazz = env->GetObjectClass(obj);
|
|
|
|
mid = env->GetMethodID(clazz, name, signature);
|
|
|
|
if (mid == 0)
|
|
|
|
goto done1;
|
|
|
|
switch (*p) {
|
|
|
|
case 'V':
|
|
|
|
env->CallVoidMethodV(obj, mid, args);
|
|
|
|
break;
|
|
|
|
case '[':
|
|
|
|
case 'L':
|
|
|
|
result.l = env->CallObjectMethodV(obj, mid, args);
|
|
|
|
break;
|
|
|
|
case 'Z':
|
|
|
|
result.z = env->CallBooleanMethodV(obj, mid, args);
|
|
|
|
break;
|
|
|
|
case 'B':
|
|
|
|
result.b = env->CallByteMethodV(obj, mid, args);
|
|
|
|
break;
|
|
|
|
case 'C':
|
|
|
|
result.c = env->CallCharMethodV(obj, mid, args);
|
|
|
|
break;
|
|
|
|
case 'S':
|
|
|
|
result.s = env->CallShortMethodV(obj, mid, args);
|
|
|
|
break;
|
|
|
|
case 'I':
|
|
|
|
result.i = env->CallIntMethodV(obj, mid, args);
|
|
|
|
break;
|
|
|
|
case 'J':
|
|
|
|
result.j = env->CallLongMethodV(obj, mid, args);
|
|
|
|
break;
|
|
|
|
case 'F':
|
|
|
|
result.f = env->CallFloatMethodV(obj, mid, args);
|
|
|
|
break;
|
|
|
|
case 'D':
|
|
|
|
result.d = env->CallDoubleMethodV(obj, mid, args);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
env->FatalError("JNU_CallMethodByNameV: illegal signature");
|
|
|
|
}
|
|
|
|
done1:
|
|
|
|
env->DeleteLocalRef(clazz);
|
|
|
|
done2:
|
|
|
|
if (hasException) {
|
2000-09-19 00:18:18 +00:00
|
|
|
#ifdef JNI_VERSION_1_2
|
2000-03-04 01:37:20 +00:00
|
|
|
*hasException = env->ExceptionCheck();
|
2000-09-19 00:18:18 +00:00
|
|
|
#else
|
|
|
|
jthrowable exception = env->ExceptionOccurred();
|
|
|
|
if ( exception != NULL ) {
|
|
|
|
*hasException = true;
|
|
|
|
env->DeleteLocalRef( exception );
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
*hasException = false;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
} // END
|
2000-03-04 01:37:20 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
JNIEXPORT void * JNICALL
|
|
|
|
JNU_GetEnv(JavaVM *vm, jint version)
|
|
|
|
{
|
|
|
|
// void *result;
|
|
|
|
//vm->GetEnv(&result, version);
|
2000-03-09 05:12:42 +00:00
|
|
|
JNIEnv *result = nsnull;
|
2000-04-22 02:01:20 +00:00
|
|
|
#ifdef BAL_INTERFACE
|
|
|
|
#else
|
2000-09-19 00:18:18 +00:00
|
|
|
|
|
|
|
#ifdef JNI_VERSION_1_2
|
2000-03-04 01:37:20 +00:00
|
|
|
vm->AttachCurrentThread((void **)&result, (void *) version);
|
2000-09-19 00:18:18 +00:00
|
|
|
#else
|
|
|
|
vm->AttachCurrentThread( &result, ( void * )version);
|
|
|
|
#endif
|
|
|
|
|
2000-04-22 02:01:20 +00:00
|
|
|
#endif
|
2000-03-04 01:37:20 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|