At long last, I have webclient running on Mac OSX. I only have a

PowerBook G4, so the only binary I can produce is for the PowerPC.
Perhaps someone lucky enough to own a MacBookPro can produce a binary
for me on that processor architecture.

Many thanks to the generous folks on #developers, in particular, timeless,
cbarrett, sdwilsh, and jhpedemonte.

Here are the changes.

SECTION: Changes

M dist/build.xml

- propogate clean on mac os x

- On mac os x, there is .jnilib and also .dylib

M dom/build.xml

- propogate make on mac os x

M webclient/build.xml

- new file for javah on mac

- propogate clobber_all on mac

M webclient/classes_spec/org/mozilla/webclient/BrowserControlCanvas.java

- get the tree lock before calling to native code to get the native window

A webclient/classes_spec/org/mozilla/webclient/impl/wrapper_native/CocoaAppKitThreadDelegatingNativeEventThread.java

- Allows running arbitrary code on the AppKit thread.  Prevents Thread
  Safety assertions.

M webclient/classes_spec/org/mozilla/webclient/impl/wrapper_native/CocoaBrowserControlCanvas.java

- adhere to informal protocol to create NativeEventThread

M webclient/classes_spec/org/mozilla/webclient/impl/wrapper_native/ImplObjectNative.java

- use NativeEventThread.instance.isNativeEventThread()

M webclient/classes_spec/org/mozilla/webclient/impl/wrapper_native/NativeEventThread.java

- implement isNativeEventThread()

M webclient/src_moz/Makefile.in

- turn on objc-exceptions on mac os x

M webclient/src_moz/NativeBrowserControl.cpp
M webclient/src_moz/NativeBrowserControl.h

- work with cocoa

M webclient/src_moz/NativeEventThread.cpp
M webclient/src_moz/cocoa/CocoaBrowserControlCanvas.h
M webclient/src_moz/cocoa/CocoaBrowserControlCanvasImpl.cpp

- two methods to run arbitrary code on the AppKit thread

M webclient/src_moz/cocoa/CocoaBrowserControlCanvas.mm
M webclient/test/manual/src/classes/org/mozilla/webclient/test/TestBrowser.java


git-svn-id: svn://10.0.0.236/trunk@227737 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
edburns%acm.org
2007-06-10 16:24:12 +00:00
parent 43dba5fc79
commit 4d80afa4ef
16 changed files with 489 additions and 185 deletions

View File

@@ -41,6 +41,11 @@
#include <windows.h>
#endif
#if (defined(XP_MAC) || defined(XP_MACOSX)) && defined(MOZ_WIDGET_COCOA)
#include "CocoaBrowserControlCanvas.h"
#include "org_mozilla_webclient_impl_wrapper_0005fnative_CocoaAppKitThreadDelegatingNativeEventThread.h"
#endif
//#include "nsAppShellCIDs.h" // for NS_SESSIONHISTORY_CID
#include "nsCOMPtr.h" // to get nsIBaseWindow from webshell
//nsIDocShell is included in ns_util.h
@@ -428,5 +433,43 @@ nsresult InitMozillaStuff (NativeBrowserControl * nativeBrowserControl)
return rv;
}
#if (defined(XP_MAC) || defined(XP_MACOSX)) && defined(MOZ_WIDGET_COCOA)
JNIEXPORT jobject JNICALL
Java_org_mozilla_webclient_impl_wrapper_1native_CocoaAppKitThreadDelegatingNativeEventThread_runReturnRunnableOnAppKitThread
(JNIEnv *env, jobject javaThis, jobject toInvoke)
{
jobject result = nsnull;
if (nsnull == javaThis || nsnull == toInvoke) {
::util_ThrowExceptionToJava(env, "CocoaAppKitThreadDelegatingNativeEventThread.runReturnRunnableOnAppKitThread: null arguments");
return;
}
result = CocoaBrowserControlCanvas::runReturnRunnableOnAppKitThread(env,
javaThis,
toInvoke);
return result;
}
JNIEXPORT void JNICALL
Java_org_mozilla_webclient_impl_wrapper_1native_CocoaAppKitThreadDelegatingNativeEventThread_runRunnableOnAppKitThread
(JNIEnv *env, jobject javaThis, jobject toInvoke)
{
// Store our pointer to the global vm
if (nsnull == gVm) { // declared in ../src_share/jni_util.h
::util_GetJavaVM(env, &gVm); // save this vm reference
}
if (nsnull == javaThis || nsnull == toInvoke) {
::util_ThrowExceptionToJava(env, "CocoaAppKitThreadDelegatingNativeEventThread.runReturnRunnableOnAppKitThread: null arguments");
return;
}
CocoaBrowserControlCanvas::runRunnableOnAppKitThread(env, javaThis,
toInvoke);
}
#endif