jint			height)
jint			height, jobject                 implObj)
Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellCreate (	JNIEnv		*	env,	jobject			obj,	jint			windowPtr,	jint			x,	jint			y,	jint			width,	jint			height){	jobject			jobj = obj;#ifdef XP_MAC	WindowPtr		pWindow = (WindowPtr) windowPtr;	Rect			webRect = pWindow->portRect;    // nsIWidget	*	pWidget = (nsIWidget *) widgetPtr;#elif defined(XP_PC)    // elif defined(XP_WIN)	HWND parentHWnd = (HWND)windowPtr;#elif defined(XP_UNIX)    GtkWidget * parentHWnd = (GtkWidget *) windowPtr;#endif	if (parentHWnd == nsnull) {		::ThrowExceptionToJava(env, "Exception: null window handle passed to raptorWebShellCreate");		return (jint) 0;	}	WebShellInitContext* initContext = new WebShellInitContext;	initContext->initComplete = FALSE;	initContext->initFailCode = 0;	initContext->parentHWnd = parentHWnd;	initContext->webShell = NULL;	initContext->embeddedThread = NULL;	initContext->actionQueue = NULL;	initContext->env = env;	initContext->stopThread = FALSE;	initContext->x = x;	initContext->y = y;	initContext->w = width;	initContext->h = height;#ifdef XP_UNIX    // This probably needs some explaining...    // On Unix, instead of using a NSPR thread to manage our Mozilla event loop, we    // use a Java Thread (for reasons I won't go into now, see     // org.mozilla.webclient.motif.NativeEventThread for more details). This java thread will     // process any pending native events in     // org.mozilla.webclient.motif.NativeEventThread.processNativeEventQueue()    // (see below). However, when processNativeEventQueue() gets called, it needs access to it's associated    // WebShellInitContext structure in order to process any GTK / Mozilla related events. So what we    // do is we keep a static Hashtable inside the class NativeEventThread to store mappings of    // gtkWindowID's to WebShellInitContext's (since there is one WebShellInitContext to one GTK Window).     // This is what this part of the code does:    //    // 1) It first accesses the class org.mozilla.webclient.motif.NativeEventThread    // 2) It then accesses a static method in this class called "storeContext()" which takes as    //    arguments, a GTK window pointer and a WebShellInitContext pointer    // 3) Then it invokes the method    // 4) Inside NativeEventThread.run(), you can see the code which fetches the appropriate     //    WebShellInitContext and then calls processNativeEventQueue() with it below.    // PENDING(mark): Should we cache this? Probably....    jclass mozillaEventThreadClass = env->FindClass("org/mozilla/webclient/motif/NativeEventThread");    if (mozillaEventThreadClass == NULL) {        printf("Error: Cannot find class org.mozilla.webclient.motif.NativeEventThread!\n");        ThrowExceptionToJava(env, "Error: Cannot find class org.mozilla.webclient.motif.NativeEventThread!");        return 0;    }    jmethodID storeMethodID = env->GetStaticMethodID(mozillaEventThreadClass, "storeContext", "(II)V");    if (storeMethodID == NULL) {        printf("Error: Cannot get static method storeContext(int, int) from NativeEventThread!\n");        ThrowExceptionToJava(env, "Error: Cannot get static method storeContext(int, int) from NativeEventThread!");        return 0;    }    // PENDING(mark): How do I catch this if there's an exception?    env->CallStaticVoidMethod(mozillaEventThreadClass, storeMethodID, windowPtr, (int) initContext);#else	InitEmbeddedEventHandler(initContext);#endif	return (jint) initContext;} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellCreate()