/* htmlapp_delete */ void _htmlapp_delete(HTMLApp * htmlapp) { if(htmlapp->source != 0) g_source_remove(htmlapp->source); if(htmlapp->ab_window != NULL) gtk_widget_destroy(htmlapp->ab_window); if(htmlapp->fi_dialog != NULL) gtk_widget_destroy(htmlapp->fi_dialog); gtk_widget_destroy(htmlapp->window); surfer_delete(htmlapp); }
/* on_create_web_view */ static WebKitWebView * _on_create_web_view(WebKitWebView * view, WebKitWebFrame * frame, gpointer data) { GHtml * ghtml; Surfer * surfer; GtkWidget * widget; if((surfer = surfer_new(NULL)) == NULL) return NULL; /* FIXME we may want the history to be copied (and then more) */ if((widget = surfer_get_view(surfer)) == NULL) { surfer_delete(surfer); return NULL; } ghtml = g_object_get_data(G_OBJECT(widget), "ghtml"); g_signal_connect(G_OBJECT(ghtml->view), "web-view-ready", G_CALLBACK( _on_web_view_ready), widget); return WEBKIT_WEB_VIEW(ghtml->view); }