bug=32011

r=ashuk
a=edburns
This set of changes replaces all occurrences of

env->Func(args...)

with

::util_Func(env, args...)

Except of course, for the implementations of the above mentioned
::util_Func() functions.

This is done to allow the JNI functions to be called from a non JNI
context, such as UNO.


git-svn-id: svn://10.0.0.236/trunk@63190 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
edburns%acm.org
2000-03-16 23:07:03 +00:00
parent 53322f1498
commit b233b02f87
13 changed files with 337 additions and 133 deletions

View File

@@ -62,7 +62,6 @@ JNIEXPORT jint JNICALL Java_org_mozilla_webclient_wrapper_1native_WindowControlI
(JNIEnv *env, jobject obj, jint windowPtr, jint x, jint y,
jint width, jint height, jobject aBrowserControlImpl)
{
jobject jobj = obj;
#ifdef XP_MAC
WindowPtr pWindow = (WindowPtr) windowPtr;
Rect webRect = pWindow->portRect;
@@ -87,8 +86,8 @@ JNIEXPORT jint JNICALL Java_org_mozilla_webclient_wrapper_1native_WindowControlI
initContext->embeddedThread = nsnull;
initContext->sessionHistory = nsnull;
initContext->actionQueue = nsnull;
initContext->nativeEventThread = nsnull;
initContext->env = env;
initContext->nativeEventThread = nsnull;
initContext->stopThread = FALSE;
initContext->x = x;
initContext->y = y;
@@ -96,36 +95,8 @@ JNIEXPORT jint JNICALL Java_org_mozilla_webclient_wrapper_1native_WindowControlI
initContext->h = height;
#ifdef XP_UNIX
jclass cls = env->GetObjectClass(aBrowserControlImpl); // Get Class for BrowserControlImpl object
jclass clz = env->FindClass("org/mozilla/webclient/BrowserControlImpl");
if (nsnull == clz) {
::util_ThrowExceptionToJava(env, "Exception: Could not find class for BrowserControlImpl");
return (jint) 0;
}
jboolean ans = env->IsInstanceOf(aBrowserControlImpl, clz);
if (JNI_FALSE == ans) {
::util_ThrowExceptionToJava(env, "Exception: We have a problem");
return (jint) 0;
}
// Get myCanvas IVar
jfieldID fid = env->GetFieldID(cls, "myCanvas", "Lorg/mozilla/webclient/BrowserControlCanvas;");
if (nsnull == fid) {
::util_ThrowExceptionToJava(env, "Exception: field myCanvas not found in the jobject for BrowserControlImpl");
return (jint) 0;
}
jobject canvasObj = env->GetObjectField(aBrowserControlImpl, fid);
jclass canvasCls = env->GetObjectClass(canvasObj);
if (nsnull == canvasCls) {
::util_ThrowExceptionToJava(env, "Exception: Could Not find Class for CanvasObj");
return (jint) 0;
}
jfieldID gtkfid = env->GetFieldID(canvasCls, "gtkWinPtr", "I");
if (nsnull == gtkfid) {
::util_ThrowExceptionToJava(env, "Exception: field gtkWinPtr not found in the jobject for BrowserControlCanvas");
return (jint) 0;
}
jint mozPtr = env->GetIntField(canvasObj, gtkfid);
initContext->gtkWinPtr = (int) mozPtr;
initContext->gtkWinPtr =
(int)::util_GetGTKWinPtrFromCanvas(env, aBrowserControlImpl);
#else
initContext->gtkWinPtr = nsnull;
#endif
@@ -174,9 +145,6 @@ Java_org_mozilla_webclient_wrapper_1native_WindowControlImpl_nativeDestroyInitCo
JNIEXPORT void JNICALL Java_org_mozilla_webclient_wrapper_1native_WindowControlImpl_nativeMoveWindowTo
(JNIEnv *env, jobject obj, jint webShellPtr, jint x, jint y)
{
JNIEnv * pEnv = env;
jobject jobj = obj;
WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr;
if (initContext == nsnull) {
@@ -195,9 +163,6 @@ JNIEXPORT void JNICALL Java_org_mozilla_webclient_wrapper_1native_WindowControlI
JNIEXPORT void JNICALL Java_org_mozilla_webclient_wrapper_1native_WindowControlImpl_nativeRemoveFocus
(JNIEnv *env, jobject obj, jint webShellPtr)
{
JNIEnv * pEnv = env;
jobject jobj = obj;
WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr;
if (initContext == nsnull) {
@@ -216,9 +181,6 @@ JNIEXPORT void JNICALL Java_org_mozilla_webclient_wrapper_1native_WindowControlI
JNIEXPORT void JNICALL Java_org_mozilla_webclient_wrapper_1native_WindowControlImpl_nativeRepaint
(JNIEnv *env, jobject obj, jint webShellPtr, jboolean forceRepaint)
{
JNIEnv * pEnv = env;
jobject jobj = obj;
WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr;
if (initContext == nsnull) {
@@ -261,9 +223,6 @@ JNIEXPORT void JNICALL Java_org_mozilla_webclient_wrapper_1native_WindowControlI
JNIEXPORT void JNICALL Java_org_mozilla_webclient_wrapper_1native_WindowControlImpl_nativeSetFocus
(JNIEnv *env, jobject obj, jint webShellPtr)
{
JNIEnv * pEnv = env;
jobject jobj = obj;
WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr;
if (initContext == nsnull) {