rem: g_print ("enter mainloop\n");
context: int main (int argc, char **argv){	TotemEmbedded *emb;	int i, xid;	emb = g_new0 (TotemEmbedded, 1);	emb->width = emb->height = -1;	emb->state = STATE_STOPPED;	emb->conn = bacon_message_connection_new ("totem-mozilla");	if (!emb->conn)		return 1;	bacon_message_connection_set_callback (emb->conn, cb_data, emb);	bacon_message_connection_send (emb->conn, "STARTUP OK");	if (XInitThreads () == 0)	{		gtk_init (&argc, &argv);		totem_embedded_error_and_exit (_("Could not initialise the thread-safe libraries."), _("Verify your system installation. The Totem plugin will now exit."), NULL);	}	g_thread_init (NULL);	bacon_video_widget_init_backend (NULL, NULL);	//gdk_threads_init ();	gtk_init (&argc, &argv);	g_print ("CMD line: ");	for (i = 0; i < argc; i++) {		g_print ("%s ", argv[i]);	}	g_print ("\n");	xid = 0;	/* TODO Add popt options */	for (i = 1; i < argc; i++) {		if (OPTION_IS (TOTEM_OPTION_XID)) {			if (i + 1 < argc) {				i++;				xid = atoi (argv[i]);			}		} else if (OPTION_IS (TOTEM_OPTION_WIDTH)) {			if (i + 1 < argc) {				i++;				emb->width = atoi (argv[i]);			}		} else if (OPTION_IS (TOTEM_OPTION_HEIGHT)) {			if (i + 1 < argc) {				i++;				emb->height = atoi (argv[i]);			}		} else if (OPTION_IS (TOTEM_OPTION_URL)) {			if (i + 1 < argc) {				i++;				emb->orig_filename = (const char *) argv[i];			}		} else if (OPTION_IS (TOTEM_OPTION_CONTROLS_HIDDEN)) {			emb->controller_hidden = TRUE;		} else if (OPTION_IS (TOTEM_OPTION_HREF)) {			if (i + 1 < argc) {				i++;				emb->href = g_strdup (argv[i]);			}		} else if (i + 1 == argc) {			emb->filename = g_strdup (argv[i]);		}	}	/* XEMBED or stand-alone */	if (xid != 0) {		GtkWidget *window;		/* The miraculous XEMBED protocol */		window = gtk_plug_new ((GdkNativeWindow)xid);		gtk_signal_connect(GTK_OBJECT(window), "embedded",				G_CALLBACK (embedded), NULL);		gtk_widget_realize (window);		emb->window = window;	} else {		/* Stand-alone version */		emb->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);	}	totem_embedded_add_children (emb);	totem_embedded_create_cursor (emb);	gtk_widget_show (emb->window);	/* wait until we're embedded if we're to be, or shown */	if (xid != 0) {		while (emb->embedded_done == FALSE && gtk_events_pending ())			gtk_main_iteration ();	} else {		while (gtk_events_pending ())			gtk_main_iteration ();	}	if (totem_embedded_open (emb) != FALSE)		totem_embedded_play (emb);g_print ("enter mainloop\n");	gtk_main ();g_print ("exit\n");	return 0;}