browser->progressAreaHBox = gtk_hbox_new(FALSE, 0);
new_gtk_browser(guint32 chromeMask){  guint32         actualChromeMask = chromeMask;  MinimoBrowser *browser = 0;  num_browsers++;  browser = g_new0(MinimoBrowser, 1);  browser_list = g_list_prepend(browser_list, browser);  browser->toolBarOn = FALSE;  browser->locationBarOn = FALSE;  browser->statusBarOn = FALSE;  browser->loading = TRUE;  if (chromeMask == GTK_MOZ_EMBED_FLAG_DEFAULTCHROME)    actualChromeMask = GTK_MOZ_EMBED_FLAG_ALLCHROME;  if (actualChromeMask & GTK_MOZ_EMBED_FLAG_TOOLBARON)  {    browser->toolBarOn = TRUE;  }  if (actualChromeMask & GTK_MOZ_EMBED_FLAG_LOCATIONBARON)  {    browser->locationBarOn = TRUE;  }  if (actualChromeMask & GTK_MOZ_EMBED_FLAG_STATUSBARON)  {    browser->statusBarOn = TRUE;  }  // create our new toplevel window  browser->topLevelWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);  // new vbox  browser->topLevelVBox = gtk_vbox_new(FALSE, 0);  // add it to the toplevel window  gtk_container_add(GTK_CONTAINER(browser->topLevelWindow),		    browser->topLevelVBox);  // create the hbox that will contain the toolbar and the url text entry bar  browser->toolbarHBox = gtk_hbox_new(false, 0);  // add that hbox to the vbox  gtk_box_pack_start(GTK_BOX(browser->topLevelVBox), 		     browser->toolbarHBox,		     FALSE, // expand		     FALSE, // fill		     0);    // padding  // new horiz toolbar with buttons + icons#ifdef MOZ_WIDGET_GTK  browser->toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL,				     GTK_TOOLBAR_ICONS);#endif /* MOZ_WIDGET_GTK */#ifdef MOZ_WIDGET_GTK2  browser->toolbar = gtk_toolbar_new();  gtk_toolbar_set_orientation(GTK_TOOLBAR(browser->toolbar),			      GTK_ORIENTATION_HORIZONTAL);  gtk_toolbar_set_style(GTK_TOOLBAR(browser->toolbar),			GTK_TOOLBAR_ICONS);#endif /* MOZ_WIDGET_GTK2 */  // setup the icons  browser->backIcon = NewIconFromXPM(browser->toolbar, back_xpm);  browser->forwardIcon = NewIconFromXPM(browser->toolbar, forward_xpm);  browser->homeIcon = NewIconFromXPM(browser->toolbar, home_xpm);  browser->reloadIcon = NewIconFromXPM(browser->toolbar, reload_xpm);    browser->throbberID  = 0;  browser->stopIcon[0] = NewIconFromXPM(browser->toolbar, stop_1_xpm);  browser->stopIcon[1] = NewIconFromXPM(browser->toolbar, stop_2_xpm);  browser->stopIcon[2] = NewIconFromXPM(browser->toolbar, stop_3_xpm);  browser->stopIcon[3] = NewIconFromXPM(browser->toolbar, stop_4_xpm);  // This is really just an allocation  browser->stopReloadIcon = NewIconFromXPM(browser->toolbar, stop_1_xpm);  // add it to the hbox  gtk_box_pack_start(GTK_BOX(browser->toolbarHBox), browser->toolbar,		     FALSE, // expand		     FALSE, // fill		     0);    // padding  // new back button  browser->backButton =    gtk_toolbar_append_item(GTK_TOOLBAR(browser->toolbar),			    "Back",			    "Go Back",			    "Go Back",			    browser->backIcon,			    GTK_SIGNAL_FUNC(back_clicked_cb),			    browser);  // new forward button  browser->forwardButton =    gtk_toolbar_append_item(GTK_TOOLBAR(browser->toolbar),			    "Forward",			    "Forward",			    "Forward",			    browser->forwardIcon, 			    GTK_SIGNAL_FUNC(forward_clicked_cb),			    browser);  // new stop and reload button  browser->stopReloadButton =     gtk_toolbar_append_item(GTK_TOOLBAR(browser->toolbar),			    "Stop/Reload",			    "Stop/Reload",			    "Stop/Reload",			    browser->stopReloadIcon,			    GTK_SIGNAL_FUNC(stop_reload_clicked_cb),			    browser);  update_toolbar(browser);  // new home button  browser->homeButton =     gtk_toolbar_append_item(GTK_TOOLBAR(browser->toolbar),			    "Home",			    "Home",			    "Home",			    browser->homeIcon, 			    GTK_SIGNAL_FUNC(home_clicked_cb),			    browser);  // create the url text entry  browser->urlEntry = gtk_entry_new();  g_signal_connect(G_OBJECT(browser->urlEntry), "focus-in-event",		   G_CALLBACK(urlEntry_focus_in), browser);  g_signal_connect(G_OBJECT(browser->urlEntry), "focus-out-event",		   G_CALLBACK(urlEntry_focus_out), browser);  // add it to the hbox  gtk_box_pack_start(GTK_BOX(browser->toolbarHBox), browser->urlEntry,		     TRUE, // expand		     TRUE, // fill		     0);    // padding  // create our new gtk moz embed widget  browser->mozEmbed = gtk_moz_embed_new();  // add it to the toplevel vbox  gtk_box_pack_start(GTK_BOX(browser->topLevelVBox), browser->mozEmbed,		     TRUE, // expand		     TRUE, // fill		     0);   // padding  // create the new hbox for the progress area  browser->progressAreaHBox = gtk_hbox_new(FALSE, 0);  // create our new progress bar  browser->progressBar = gtk_progress_bar_new();  // add it to the hbox  gtk_box_pack_start(GTK_BOX(browser->progressAreaHBox), browser->progressBar,		     FALSE, // expand		     FALSE, // fill		     0); // padding  // create our status area and the alignment object that will keep it  // from expanding  browser->statusAlign = gtk_alignment_new(0, 0, 1, 1);  gtk_widget_set_usize(browser->statusAlign, 1, -1);  // create the status bar  browser->statusBar = gtk_statusbar_new();  gtk_container_add(GTK_CONTAINER(browser->statusAlign), browser->statusBar);  // add it to the hbox  gtk_box_pack_start(GTK_BOX(browser->progressAreaHBox), browser->statusAlign,		     TRUE, // expand		     TRUE, // fill		     0);   // padding  // by default none of the buttons are marked as sensitive.  gtk_widget_set_sensitive(browser->backButton, FALSE);  gtk_widget_set_sensitive(browser->forwardButton, FALSE);    // catch the destruction of the toplevel window  gtk_signal_connect(GTK_OBJECT(browser->topLevelWindow), "delete_event",		     GTK_SIGNAL_FUNC(delete_cb), browser);  // hook up the activate signal to the right callback  gtk_signal_connect(GTK_OBJECT(browser->urlEntry), "activate",		     GTK_SIGNAL_FUNC(url_activate_cb), browser);  // hook up the location change to update the urlEntry  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "location",		     GTK_SIGNAL_FUNC(location_changed_cb), browser);  // hook up the title change to update the window title  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "title",		     GTK_SIGNAL_FUNC(title_changed_cb), browser);  // hook up the start and stop signals  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "net_start",		     GTK_SIGNAL_FUNC(load_started_cb), browser);  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "net_stop",		     GTK_SIGNAL_FUNC(load_finished_cb), browser);  // hook up to the change in network status  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "net_state",		     GTK_SIGNAL_FUNC(net_state_change_cb), browser);  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "net_state_all",		     GTK_SIGNAL_FUNC(net_state_change_all_cb), browser);  // hookup to changes in progress  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "progress",		     GTK_SIGNAL_FUNC(progress_change_cb), browser);  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "progress_all",		     GTK_SIGNAL_FUNC(progress_change_all_cb), browser);  // hookup to changes in over-link message  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "link_message",		     GTK_SIGNAL_FUNC(link_message_cb), browser);  // hookup to changes in js status message  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "js_status",		     GTK_SIGNAL_FUNC(js_status_cb), browser);  // hookup to see whenever a new window is requested  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "new_window",		     GTK_SIGNAL_FUNC(new_window_cb), browser);  // hookup to any requested visibility changes  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "visibility",		     GTK_SIGNAL_FUNC(visibility_cb), browser);  // hookup to the signal that says that the browser requested to be  // destroyed  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "destroy_browser",		     GTK_SIGNAL_FUNC(destroy_brsr_cb), browser);  // hookup to the signal that is called when someone clicks on a link  // to load a new uri  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "open_uri",		     GTK_SIGNAL_FUNC(open_uri_cb), browser);  // this signal is emitted when there's a request to change the  // containing browser window to a certain height, like with width  // and height args for a window.open in javascript  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "size_to",		     GTK_SIGNAL_FUNC(size_to_cb), browser);  // key event signals  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_key_down",		     GTK_SIGNAL_FUNC(dom_key_down_cb), browser);  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_key_press",		     GTK_SIGNAL_FUNC(dom_key_press_cb), browser);  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_key_up",		     GTK_SIGNAL_FUNC(dom_key_up_cb), browser);  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_mouse_down",		     GTK_SIGNAL_FUNC(dom_mouse_down_cb), browser);  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_mouse_up",		     GTK_SIGNAL_FUNC(dom_mouse_up_cb), browser);  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_mouse_click",		     GTK_SIGNAL_FUNC(dom_mouse_click_cb), browser);  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_mouse_dbl_click",		     GTK_SIGNAL_FUNC(dom_mouse_dbl_click_cb), browser);  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_mouse_over",		     GTK_SIGNAL_FUNC(dom_mouse_over_cb), browser);  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "dom_mouse_out",		     GTK_SIGNAL_FUNC(dom_mouse_out_cb), browser);  // hookup to when the window is destroyed  gtk_signal_connect(GTK_OBJECT(browser->mozEmbed), "destroy",		     GTK_SIGNAL_FUNC(destroy_cb), browser);    // set the chrome type so it's stored in the object  gtk_moz_embed_set_chrome_mask(GTK_MOZ_EMBED(browser->mozEmbed),				actualChromeMask);  return browser;}