зеркало из https://github.com/mozilla/gecko-dev.git
Updated event loop stuff so that it's easier to read.
Also made it compilable with latest mozilla source. Haven't tested yet on windows though.
This commit is contained in:
Родитель
ba84089a26
Коммит
07c7783444
|
@ -58,7 +58,7 @@ Solaris support is coming soon):
|
|||
========================================================================
|
||||
Requirements:
|
||||
|
||||
* built M8 mozilla tree for some variant of Linux
|
||||
* built mozilla tree for some variant of Linux
|
||||
|
||||
* JDK1.2 with native threads support from http://www.blackdown.org
|
||||
(JDK1.1 doesn't seem to work)
|
||||
|
|
|
@ -34,7 +34,11 @@
|
|||
#include "nsIComponentManager.h"
|
||||
#include "nsString.h"
|
||||
#include "nsRepository.h"
|
||||
#ifdef NECKO
|
||||
#include "nsNeckoUtil.h"
|
||||
#else
|
||||
#include "nsINetService.h"
|
||||
#endif
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIEventQueueService.h"
|
||||
|
||||
|
@ -188,12 +192,12 @@ static void event_processor_callback(gpointer data,
|
|||
gint source,
|
||||
GdkInputCondition condition) {
|
||||
#if DEBUG_RAPTOR_CANVAS
|
||||
printf("event_processor_callback()\n");
|
||||
printf("EventHandler: event_processor_callback()\n");
|
||||
#endif
|
||||
nsIEventQueue *eventQueue = (nsIEventQueue*)data;
|
||||
eventQueue->ProcessPendingEvents();
|
||||
#if DEBUG_RAPTOR_CANVAS
|
||||
printf("Done processing pending events...\n");
|
||||
printf("EventHandler: Done processing pending events\n");
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
@ -223,9 +227,13 @@ EmbeddedEventHandler (void * arg) {
|
|||
|
||||
// Create the event queue.
|
||||
rv = aEventQService->CreateThreadEventQueue();
|
||||
|
||||
|
||||
#ifndef NECKO
|
||||
NS_InitINetService();
|
||||
|
||||
#endif
|
||||
// HACK(mark): EmbeddedThread isn't set until after this method returns!!
|
||||
initContext->embeddedThread = PR_GetCurrentThread();
|
||||
|
||||
// Create the action queue
|
||||
if (initContext->embeddedThread) {
|
||||
|
||||
|
@ -236,10 +244,29 @@ EmbeddedEventHandler (void * arg) {
|
|||
#if DEBUG_RAPTOR_CANVAS
|
||||
printf("EmbeddedEventHandler(%lx): Create the action queue\n", initContext);
|
||||
#endif
|
||||
#ifdef XP_UNIX
|
||||
// We need to do something different for Unix
|
||||
nsIEventQueue * EQueue = nsnull;
|
||||
|
||||
rv = aEventQService->GetThreadEventQueue(PR_GetCurrentThread(), &EQueue);
|
||||
gdk_input_add(EQueue->GetEventQueueSelectFD(),
|
||||
GDK_INPUT_READ,
|
||||
event_processor_callback,
|
||||
EQueue);
|
||||
|
||||
PLEventQueue * plEventQueue = nsnull;
|
||||
|
||||
EQueue->GetPLEventQueue(&plEventQueue);
|
||||
initContext->actionQueue = plEventQueue;
|
||||
#else
|
||||
initContext->actionQueue = ::PL_CreateMonitoredEventQueue("Action Queue", initContext->embeddedThread);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// PENDING(mark): This is a test
|
||||
//PL_ENTER_EVENT_QUEUE_MONITOR(initContext->actionQueue);
|
||||
|
||||
#if DEBUG_RAPTOR_CANVAS
|
||||
printf("EmbeddedEventHandler(%lx): Create the WebShell...\n", initContext);
|
||||
#endif
|
||||
|
@ -276,21 +303,8 @@ EmbeddedEventHandler (void * arg) {
|
|||
printf("EmbeddedEventHandler(%lx): enter event loop\n", initContext);
|
||||
#endif
|
||||
|
||||
#ifdef XP_UNIX
|
||||
// PENDING(mark): I'm not sure why the following code is needed....
|
||||
// All I know is that when I add the code here, the document
|
||||
// loader will try to load any clicked urls before crashing.
|
||||
// Whereas, if I left it out, nothing happens when the user clicks on
|
||||
// a URL
|
||||
nsIEventQueue * EQueue = nsnull;
|
||||
|
||||
rv = aEventQService->GetThreadEventQueue(PR_GetCurrentThread(), &EQueue);
|
||||
|
||||
gdk_input_add(EQueue->GetEventQueueSelectFD(),
|
||||
GDK_INPUT_READ,
|
||||
event_processor_callback,
|
||||
EQueue);
|
||||
#endif
|
||||
// PENDING(mark): This is a test
|
||||
//PL_EXIT_EVENT_QUEUE_MONITOR(initContext->actionQueue);
|
||||
|
||||
do {
|
||||
if (!processEventLoop(initContext)) {
|
||||
|
@ -1822,8 +1836,11 @@ Java_org_mozilla_webclient_BrowserControlMozillaShim_nativeWebShellGetURL (
|
|||
|
||||
if (voidResult != nsnull) {
|
||||
|
||||
#ifdef NECKO
|
||||
nsString * string = new nsString((PRUnichar *) voidResult);
|
||||
#else
|
||||
nsString1 * string = new nsString1((PRUnichar *) voidResult);
|
||||
|
||||
#endif
|
||||
if (string == nsnull) {
|
||||
::ThrowExceptionToJava(env, "raptorWebShellGetURL Exception: unable to create Java string");
|
||||
return nsnull;
|
||||
|
|
|
@ -12,14 +12,21 @@ GTKINCLUDES = -I/usr/X11R6/include -I/usr/lib/glib/include
|
|||
GTKLIBS = -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk -rdynamic -lgmodule -lglib -ldl -lXext -lX11 -lm
|
||||
JAVAINCLUDE = -I${JAVADIR}/include -I${JAVADIR}/include/genunix -I${JAVADIR}/include/linux
|
||||
# For JDK1.2
|
||||
# Native threads
|
||||
JAVALIBS = -L${JAVADIR}/jre/lib/i386 -L${JAVADIR}/jre/lib/i386/classic -L${JAVADIR}/jre/lib/i386/native_threads -ljava
|
||||
# Green threads
|
||||
#JAVALIBS = -L${JAVADIR}/jre/lib/i386 -L${JAVADIR}/jre/lib/i386/classic -L${JAVADIR}/jre/lib/i386/green_threads -ljava
|
||||
INCLUDE = ${JAVAINCLUDE} -I${DIST}/include ${GTKINCLUDES} ${GTKMOZILLAINCLUDE}
|
||||
DEFINES = -D_REENTRANT -DXP_UNIX -DDEBUG_RAPTOR_CANVAS -DMOZ_DLL_SUFFIX=\".so\"
|
||||
DEFINES = -D_REENTRANT -DNECKO -DXP_UNIX -DDEBUG_RAPTOR_CANVAS -DMOZ_DLL_SUFFIX=\".so\"
|
||||
STUBDEFINES = -D_REENTRANT
|
||||
STUBINCLUDE = ${JAVAINCLUDE}
|
||||
STUBLIBS = ${JAVALIBS}
|
||||
# For the latest mozilla build
|
||||
LIBS = ${GTKLIBS} ${JAVALIBS} \
|
||||
-L${DIST}/lib -lraptorgfx -lexpat -lxmltok -labouturl -lfileurl -lftpurl -lgophurl -lhttpurl -lremoturl -lsockstuburl -lmimetype -lnetcache -lnetcnvts -lnetwork -ljsurl -lmozdbm -lpwcac -lreg -lmozjs -lsecfree -lmozutil -lnspr3 -lxp -ljpeg -lpng -lz -lpthread -lXm -lXt -L${DIST}/lib -lxpcom -limg -lplds3 -lwidgetgtk -lgfxgtk -lraptorwebwidget -lraptorhtmlpars -lnetlib -lpref -lplds3 -lplc3 -ljsdom
|
||||
-L${DIST}/bin -lraptorgfx -lexpat -lxmltok -ljsurl -lmozdbm -lmozjs -lsecfree -lmozutil -lnspr3 -lxp -ljpeg -lpng -lz -lpthread -lXm -lXt -L${DIST}/lib -lxpcom -limg -lplds3 -lgfx_gtk -lraptorwebwidget -lraptorhtmlpars -lraptorplugin -lpref -lplds3 -lplc3 -ljsdom -L${DIST}/lib -ltimer_gtk_s
|
||||
# For the old m8 mozilla
|
||||
#LIBS = ${GTKLIBS} ${JAVALIBS} \
|
||||
#-L${DIST}/lib -lraptorgfx -lexpat -lxmltok -labouturl -lfileurl -lftpurl -lgophurl -lhttpurl -lremoturl -lsockstuburl -lmimetype -lnetcache -lnetcnvts -lnetwork -ljsurl -lmozdbm -lpwcac -lreg -lmozjs -lsecfree -lmozutil -lnspr3 -lxp -ljpeg -lpng -lz -lpthread -lXm -lXt -L${DIST}/lib -lxpcom -limg -lplds3 -lwidgetgtk -lgfxgtk -lraptorwebwidget -lraptorhtmlpars -lnetlib -lpref -lplds3 -lplc3 -ljsdom
|
||||
LN = ln -f -s
|
||||
|
||||
all: libwebclientstub.so libwebclient.so component.reg components
|
||||
|
|
|
@ -45,6 +45,34 @@ extern "C" {
|
|||
JNIEXPORT jint JNICALL Java_org_mozilla_webclient_motif_MotifBrowserControlCanvas_createTopLevelWindow
|
||||
(JNIEnv * env, jobject obj) {
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
// PENDING(mark): This is a hack needed in order to get those error
|
||||
// messages about:
|
||||
/***************************************************
|
||||
*nsComponentManager: Load(/disk4/mozilla/mozilla/dist/bin/components/librdf.so)
|
||||
*FAILED with error: libsunwjdga.so: cannot open shared object file:
|
||||
*No such file or directory
|
||||
****************************************************/
|
||||
// But the weird thing is, libhistory.so isn't linked with libsunwjdga.so.
|
||||
// In fact, libsunwjdga.so doesn't even exist anywhere! I know it's
|
||||
// a JDK library, but I think it is only supposed to get used on
|
||||
// Solaris, not Linux. And why the hell is nsComponentManager trying
|
||||
// to open this JDK library anyways? I need to try and get my stuff
|
||||
// building on Solaris. Also, I will have to scan the Linux
|
||||
// JDK1.2 sources and figure out what's going on. In the meantime....
|
||||
//
|
||||
// -Mark
|
||||
void * dll;
|
||||
|
||||
dll = dlopen("components/libhistory.so", RTLD_NOW | RTLD_GLOBAL);
|
||||
if (!dll) {
|
||||
printf("Got Error: %s\n", dlerror());
|
||||
}
|
||||
dll = dlopen("components/librdf.so", RTLD_NOW | RTLD_GLOBAL);
|
||||
if (!dll) {
|
||||
printf("Got Error: %s\n", dlerror());
|
||||
}
|
||||
|
||||
NS_SetupRegistry();
|
||||
|
||||
/* Initialise GTK */
|
||||
|
@ -138,14 +166,10 @@ JNIEXPORT void JNICALL Java_org_mozilla_webclient_motif_MotifBrowserControlCanva
|
|||
*/
|
||||
JNIEXPORT void JNICALL Java_org_mozilla_webclient_motif_MotifBrowserControlCanvas_setGTKWindowSize
|
||||
(JNIEnv * env, jobject obj, jint gtkWinPtr, jint width, jint height) {
|
||||
#ifdef DEBUG_RAPTOR_CANVAS
|
||||
printf("set gtk window size....width=%i, height=%i\n", width, height);
|
||||
#endif
|
||||
if (gtkWinPtr != 0) {
|
||||
GtkWidget * gtkWidgetPtr = (GtkWidget *) gtkWinPtr;
|
||||
|
||||
if (gtkWidgetPtr) {
|
||||
printf("size is being set...\n");
|
||||
gtk_widget_set_usize(gtkWidgetPtr, width, height);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -127,7 +127,11 @@ wsLoadURLEvent::wsLoadURLEvent(nsIWebShell* webShell, PRUnichar * urlString) :
|
|||
mWebShell(webShell),
|
||||
mURL(nsnull)
|
||||
{
|
||||
#ifdef NECKO
|
||||
mURL = new nsString(urlString);
|
||||
#else
|
||||
mURL = new nsString1(urlString);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -74,7 +74,11 @@ public:
|
|||
|
||||
protected:
|
||||
nsIWebShell * mWebShell;
|
||||
#ifdef NECKO
|
||||
nsString * mURL;
|
||||
#else
|
||||
nsString1 * mURL;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -9,9 +9,9 @@ export MOZILLA_FIVE_HOME
|
|||
JDK_LOCATION=${JDKHOME}
|
||||
# Native Threads
|
||||
LD_LIBRARY_PATH=${JDK_LOCATION}/jre/lib/i386:${JDK_LOCATION}/jre/lib/i386/classic:${JDK_LOCATION}/jre/lib/i386/native_threads:/disk4/mozilla/mozilla/dist/bin:.:/usr/local/lib:/usr/lib:/lib:.
|
||||
export LD_LIBRARY_PATH
|
||||
# Green Threads
|
||||
#LD_LIBRARY_PATH=${JDK_LOCATION}/jre/lib/i386:${JDK_LOCATION}/jre/lib/i386/classic:${JDK_LOCATION}/jre/lib/i386/green_threads:/disk4/mozilla/mozilla/dist/bin:.:/usr/local/lib:/usr/lib:/lib
|
||||
export LD_LIBRARY_PATH
|
||||
JAVA=${JDK_LOCATION}/bin/java
|
||||
OUTPUT_DIR=${MOZILLA_DIST}/classes
|
||||
# JDK 1.2 CLASSES
|
||||
|
|
Загрузка…
Ссылка в новой задаче