if (!NS_SetupRegistryCalled) { NS_SetupRegistry(); NS_SetupRegistryCalled = PR_TRUE; }  if (!ThreadQueueSetup) { nsIEventQueueService* eventQService; nsresult rv; rv = nsServiceManager::GetService(kEventQueueServiceCID, NS_GET_IID(nsIEventQueueService), (nsISupports **)&eventQService); if (NS_OK == rv) {  rv = eventQService->CreateThreadEventQueue(); g_return_if_fail(NS_SUCCEEDED(rv));
gtk_moz_embed_class_init(GtkMozEmbedClass *klass){  GtkContainerClass  *container_class;  GtkBinClass        *bin_class;  GtkWidgetClass     *widget_class;  GtkObjectClass     *object_class;    container_class = GTK_CONTAINER_CLASS(klass);  bin_class       = GTK_BIN_CLASS(klass);  widget_class    = GTK_WIDGET_CLASS(klass);  object_class    = (GtkObjectClass *)klass;  parent_class = (GtkBinClass *)gtk_type_class(gtk_bin_get_type());  widget_class->realize = gtk_moz_embed_realize;  widget_class->unrealize = gtk_moz_embed_unrealize;  widget_class->size_allocate = gtk_moz_embed_size_allocate;  widget_class->map = gtk_moz_embed_map;  object_class->destroy = gtk_moz_embed_destroy;  // check to see if NS_SetupRegistry has been called  if (!NS_SetupRegistryCalled)  {    NS_SetupRegistry();    NS_SetupRegistryCalled = PR_TRUE;  }  // check to see if we have to set up our thread event queue  if (!ThreadQueueSetup)  {    nsIEventQueueService* eventQService;    nsresult rv;    rv = nsServiceManager::GetService(kEventQueueServiceCID,				      NS_GET_IID(nsIEventQueueService),				      (nsISupports **)&eventQService);    if (NS_OK == rv)    {      // create the event queue      rv = eventQService->CreateThreadEventQueue();      g_return_if_fail(NS_SUCCEEDED(rv));      nsIEventQueue *eventQueue;      rv = eventQService->GetThreadEventQueue(NS_CURRENT_THREAD, &eventQueue);      g_return_if_fail(NS_SUCCEEDED(rv));      gdk_input_add(eventQueue->GetEventQueueSelectFD(),		    GDK_INPUT_READ,		    gtk_moz_embed_handle_event_queue,		    eventQueue);      NS_RELEASE(eventQService);    }    ThreadQueueSetup = PR_TRUE;  }    // set up our signals  moz_embed_signals[LINK_MESSAGE] =     gtk_signal_new ("link_message",		    GTK_RUN_FIRST,		    object_class->type,		    GTK_SIGNAL_OFFSET(GtkMozEmbedClass, link_message),		    gtk_marshal_NONE__NONE,		    GTK_TYPE_NONE, 0);  moz_embed_signals[JS_STATUS] =    gtk_signal_new ("js_status",		    GTK_RUN_FIRST,		    object_class->type,		    GTK_SIGNAL_OFFSET(GtkMozEmbedClass, js_status),		    gtk_marshal_NONE__NONE,		    GTK_TYPE_NONE, 0);  moz_embed_signals[LOCATION] =    gtk_signal_new ("location",		    GTK_RUN_FIRST,		    object_class->type,		    GTK_SIGNAL_OFFSET(GtkMozEmbedClass, location),		    gtk_marshal_NONE__NONE,		    GTK_TYPE_NONE, 0);  moz_embed_signals[TITLE] =     gtk_signal_new("title",		   GTK_RUN_FIRST,		   object_class->type,		   GTK_SIGNAL_OFFSET(GtkMozEmbedClass, title),		   gtk_marshal_NONE__NONE,		   GTK_TYPE_NONE, 0);  moz_embed_signals[PROGRESS] =    gtk_signal_new("progress",		   GTK_RUN_FIRST,		   object_class->type,		   GTK_SIGNAL_OFFSET(GtkMozEmbedClass, progress),		   gtk_marshal_NONE__INT_INT,		   GTK_TYPE_NONE, 2, GTK_TYPE_INT, GTK_TYPE_INT);  moz_embed_signals[NET_STATE] =    gtk_signal_new("net_state",		   GTK_RUN_FIRST,		   object_class->type,		   GTK_SIGNAL_OFFSET(GtkMozEmbedClass, net_state),		   gtk_marshal_NONE__INT,		   GTK_TYPE_NONE, 2, GTK_TYPE_INT, GTK_TYPE_UINT);  moz_embed_signals[NET_START] =    gtk_signal_new("net_start",		   GTK_RUN_FIRST,		   object_class->type,		   GTK_SIGNAL_OFFSET(GtkMozEmbedClass, net_start),		   gtk_marshal_NONE__NONE,		   GTK_TYPE_NONE, 0);  moz_embed_signals[NET_STOP] =    gtk_signal_new("net_stop",		   GTK_RUN_FIRST,		   object_class->type,		   GTK_SIGNAL_OFFSET(GtkMozEmbedClass, net_stop),		   gtk_marshal_NONE__NONE,		   GTK_TYPE_NONE, 0);  moz_embed_signals[NEW_WINDOW] =    gtk_signal_new("new_window",		   GTK_RUN_FIRST,		   object_class->type,		   GTK_SIGNAL_OFFSET(GtkMozEmbedClass, new_window),		   gtk_marshal_NONE__POINTER_UINT,		   GTK_TYPE_NONE, 2, GTK_TYPE_POINTER, GTK_TYPE_UINT);  moz_embed_signals[VISIBILITY] =    gtk_signal_new("visibility",		   GTK_RUN_FIRST,		   object_class->type,		   GTK_SIGNAL_OFFSET(GtkMozEmbedClass, visibility),		   gtk_marshal_NONE__BOOL,		   GTK_TYPE_NONE, 1, GTK_TYPE_BOOL);  moz_embed_signals[DESTROY_BROWSER] =    gtk_signal_new("destroy_browser",		   GTK_RUN_FIRST,		   object_class->type,		   GTK_SIGNAL_OFFSET(GtkMozEmbedClass, destroy_brsr),		   gtk_marshal_NONE__NONE,		   GTK_TYPE_NONE, 0);  moz_embed_signals[OPEN_URI] =     gtk_signal_new("open_uri",		   GTK_RUN_LAST,		   object_class->type,		   GTK_SIGNAL_OFFSET(GtkMozEmbedClass, open_uri),		   gtk_marshal_BOOL__POINTER,		   GTK_TYPE_BOOL, 1, GTK_TYPE_POINTER);  gtk_object_class_add_signals(object_class, moz_embed_signals, LAST_SIGNAL);}