diff --git a/gtk/gtk_scaffolding.c b/gtk/gtk_scaffolding.c index 69b0c4f9a..7f988c4a9 100644 --- a/gtk/gtk_scaffolding.c +++ b/gtk/gtk_scaffolding.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "content/content.h" #include "desktop/browser.h" #include "desktop/history_core.h" @@ -176,6 +177,7 @@ MENUPROTO(downloads); MENUPROTO(save_window_size); MENUPROTO(toggle_debug_rendering); MENUPROTO(save_box_tree); +MENUPROTO(save_dom_tree); /* navigate menu */ MENUPROTO(back); @@ -228,6 +230,7 @@ static struct menu_events menu_events[] = { MENUEVENT(save_window_size), MENUEVENT(toggle_debug_rendering), MENUEVENT(save_box_tree), + MENUEVENT(save_dom_tree), /* navigate menu */ MENUEVENT(back), @@ -868,6 +871,55 @@ MENUHANDLER(save_box_tree) gtk_widget_destroy(save_dialog); } +MENUHANDLER(save_dom_tree) +{ + GtkWidget *save_dialog; + struct gtk_scaffolding *gw = (struct gtk_scaffolding *)g; + + save_dialog = gtk_file_chooser_dialog_new("Save File", gw->window, + GTK_FILE_CHOOSER_ACTION_SAVE, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, + NULL); + + gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(save_dialog), + getenv("HOME") ? getenv("HOME") : "/"); + + gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(save_dialog), + "domtree.txt"); + + if (gtk_dialog_run(GTK_DIALOG(save_dialog)) == GTK_RESPONSE_ACCEPT) { + char *filename = gtk_file_chooser_get_filename( + GTK_FILE_CHOOSER(save_dialog)); + FILE *fh; + LOG(("Saving dom tree to %s...\n", filename)); + + fh = fopen(filename, "w"); + if (fh == NULL) { + warn_user("Error saving box tree dump.", + "Unable to open file for writing."); + } else { + struct browser_window *bw; + bw = nsgtk_get_browser_window(gw->top_level); + + if (bw->current_content && + bw->current_content->type == + CONTENT_HTML) { + xmlDebugDumpDocument(fh, + bw->current_content-> + data.html.document); + } + + fclose(fh); + } + + g_free(filename); + } + + gtk_widget_destroy(save_dialog); +} + + MENUHANDLER(stop) { return nsgtk_window_stop_button_clicked(GTK_WIDGET(widget), g); diff --git a/gtk/res/netsurf.glade b/gtk/res/netsurf.glade index 499433d1d..0bbc45f25 100644 --- a/gtk/res/netsurf.glade +++ b/gtk/res/netsurf.glade @@ -1,1789 +1,2675 @@ - - - + + + - - NetSurf - GTK_WIN_POS_CENTER - - - True - - - True - - - True - _File - True - - - - - True - Opens a new browser window. - _New Window - True - - - - True - gtk-new - 1 - - - - - - - True - Opens a new browser tab. - New _Tab - True - - - - True - gtk-new - 1 - - - - - - - True - Open a file on your computer into this browser window. - _Open File... - True - - - - True - gtk-open - 1 - - - - - - - True - Close this browser window. - _Close Window - True - - - - True - gtk-close - 1 - - - - - - - True - - - - - True - False - Save this page to disc, optionally including images, etc. - Save page... - True - - - True - gtk-save-as - 1 - - - - - - - True - Export the page to a different format. - Export - True - - - - - True - False - Plain ASCII text, readable in text editors and views. - Plain text... - True - - - - - True - False - RISC OS Drawfile vector graphic. - Drawfile... - True - - - - - True - False - PostScript for printing and converting to PDFs. - PostScript... - True - - - - - True - Portable Document Format. - PDF... - True - - - - - - - - - True - - - - - True - Show how a print out might look like. - Print preview... - True - - - - True - gtk-print-preview - 1 - - - - - - - True - Produce a hardcopy on your printer. - Print... - True - - - - True - gtk-print - 1 - - - - - - - True - - - - - True - gtk-quit - True - True - - - - - - - - - True - _Edit - True - - - - - True - gtk-cut - True - True - - - - - True - gtk-copy - True - True - - - - - True - gtk-paste - True - True - - - - - True - False - gtk-delete - True - True - - - - - True - - - - - True - Selects all text in the current browser window. - gtk-select-all - True - True - - - - - - True - - - - - True - False - Find specific text in the current browser window. - _Find... - True - - - - - - True - - - - - True - Change how NetSurf functions. - P_references... - True - - - True - gtk-preferences - 1 - - - - - - - - - - - True - _View - True - - - - - True - _Stop - True - - - - True - gtk-stop - 1 - - - - - - - True - _Reload - True - - - - True - gtk-refresh - 1 - - - - - - - True - - - - - True - Scale the page in the current browser window to be smaller or larger. - _Scale View... - True - - - - - True - Zoom _in - True - - - True - gtk-zoom-in - 1 - - - - - - - True - _Normal size - True - - - True - gtk-zoom-100 - 1 - - - - - - - True - Zoom _out - True - - - True - gtk-zoom-out - 1 - - - - - - - - - True - gtk-zoom-in - 1 - - - - - - - True - _Fullscreen - True - - - - True - gtk-fullscreen - 1 - - - - - - - True - - - - - True - False - _Images... - True - - - - - True - False - Toggle the display of images in the foreground. - _Foreground Images - True - - - - - True - False - Toggle the display of images in the background. - _Background Images - True - - - - - - - - - True - _Toolbars... - True - - - - - True - _Menu Bar - True - True - - - - - True - _Button Bar - True - True - - - - - True - _Status Bar - True - True - - - - - - - - - True - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Shows the downloads window - _Downloads... - True - - - - - - True - Save this window's size and position for use with new windows. - S_ave Window Size - True - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - De_bugging - True - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - T_oggle debug rendering - True - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - _Save box tree - True - - - - - - - - - - - - - True - _Navigate - True - - - - - True - _Back - True - - - - True - gtk-go-back - 1 - - - - - - - True - _Forward - True - - - - True - gtk-go-forward - 1 - - - - - - - True - _Home - True - - - - True - gtk-home - 1 - - - - - - - True - - - - - True - Show the history tree for this browser window. - _Local history... - True - - - - - - True - Show the history tree for all windows. - _Global history... - True - - - - - - True - - - - - True - False - Add the current page to your bookmarks. - _Add to Bookmarks - True - - - - - True - False - Open a window showing all your bookmarks. - _Show Bookmarks... - True - - - - - - True - - - - - True - Open an address into this browser window. - _Open location... - True - - - - - - - - - - True - _Tabs - True - - - True - - - True - 1 - _Next Tab - True - - - - - - True - _Previous Tab - True - - - - - - - - - - True - _Help - True - - - - - True - False - Shows the contents of the NetSurf manual. - _Contents... - True - - - True - gtk-help - 1 - - - - - - - True - False - Shows a guide and tutorial. - User _guide... - True - - - - - True - False - User _information... - True - - - - - True - - - - - True - gtk-about - True - True - - - - - - - - - False - False - - - - - True - GTK_TOOLBAR_BOTH_HORIZ - - - True - gtk-go-back - - - False - - - - - True - gtk-go-forward - - - False - - - - - True - gtk-stop - - - False - - - - - True - gtk-refresh - - - False - - - - - True - gtk-home - - - False - - - - - True - - - True - True - - - - - False - False - - - - - True - - - True - 2 - gtk-yes - - - - - False - False - - - - - False - False - 1 - - - - - True - True - False - False - True - - - - - - True - page 1 - - - tab - False - - - - - - - - True - page 2 - - - tab - 1 - False - - - - - - - - True - page 3 - - - tab - 2 - False - - - - - 2 - - - - - True - - - False - False - 3 - - - - - - - Site Authentication - GTK_WIN_POS_CENTER_ALWAYS - GDK_WINDOW_TYPE_HINT_DIALOG - - - True - - - True - 3 - - - True - 0.10000000149011612 - 12 - 6 - gtk-dialog-authentication - - - False - False - - - - - True - 1 - 4 - 2 - 11 - 10 - - - True - 0 - moo.yoo.com - - - 1 - 2 - GTK_FILL - - - - - True - 0 - Password - - - 3 - 4 - GTK_FILL - - - - - True - 0 - Username - - - 2 - 3 - GTK_FILL - - - - - True - 0 - Host - - - GTK_FILL - - - - - True - 0 - Realm - - - 1 - 2 - GTK_FILL - - - - - True - 0 - my sekr3t area - - - 1 - 2 - 1 - 2 - GTK_FILL - - - - - True - True - False - True - opensesame - - - 1 - 2 - 3 - 4 - - - - - - True - True - True - sesame - - - 1 - 2 - 2 - 3 - - - - - - 1 - 1 - - - - - 2 - - - - - True - GTK_BUTTONBOX_END - - - True - True - gtk-cancel - True - -6 - - - - - True - True - True - True - -5 - - - True - True - True - 0 - 0 - - - True - 2 - - - True - gtk-ok - - - False - False - - - - - True - Login - True - - - False - False - 1 - - - - - - - - - 1 - - - - - False - GTK_PACK_END - - - - - - - 1 - SSL certificate problem - True - GDK_WINDOW_TYPE_HINT_DIALOG - - - True - - - True - - - True - 0 - 6 - gtk-dialog-warning - - - False - False - - - - - True - - - True - NetSurf failed to verify the authenticity of an SSL certificate. Please verify the details presented below. - GTK_JUSTIFY_CENTER - True - - - False - False - - - - - True - 5 - 0 - - - True - 12 - - - True - True - GTK_SHADOW_IN - - - 200 - True - True - False - (not implemented) - - - - - - - - - True - <b>Certificate chain</b> - True - - - label_item - - - - - 1 - - - - - 1 - - - - - 2 - - - - - True - GTK_BUTTONBOX_END - - - True - True - True - -6 - - - True - 0 - 0 - - - True - 2 - - - True - gtk-cancel - - - False - False - - - - - True - Reject - True - - - False - False - 1 - - - - - - - - - - - True - True - True - -5 - - - True - 0 - 0 - - - True - 2 - - - True - gtk-apply - - - False - False - - - - - True - Accept - True - - - False - False - 1 - - - - - - - - - 1 - - - - - False - GTK_PACK_END - - - - - - - Warning from NetSurf - GTK_WIN_POS_CENTER - gtk-dialog-warning - GDK_WINDOW_TYPE_HINT_DIALOG - True - - - True - 2 - - - True - 3 - - - True - 12 - 6 - gtk-dialog-warning - - - False - False - - - - - True - Help help help! I'm being held prisoner by a bunch of RISC OS zealots! - True - - - 1 - 1 - - - - - - - True - - - False - 3 - 1 - - - - - True - GTK_BUTTONBOX_END - - - True - True - True - gtk-ok - True - 0 - - - - - - False - False - 2 - - - - - - - - - True - _Back - True - - - True - gtk-go-back - 1 - - - - - - - True - _Forward - True - - - True - gtk-go-forward - 1 - - - - - - - True - _Reload - True - - - True - gtk-refresh - 1 - - - - - - - True - - - - - True - Cu_t - True - - - gtk-cut - - - - - - - True - _Copy - True - - - gtk-copy - - - - - - - True - _Paste - True - - - gtk-paste - - - - - - - True - File - True - - - - - True - Edit - True - - - - - True - View - True - - - - - True - Navigate - True - - - - - True - False - Object - True - - - - - True - Help - True - - - - - PDF Password - True - GTK_WIN_POS_CENTER - - - True - - - True - 0.10000000149011612 - 12 - 6 - gtk-dialog-authentication - - - False - False - - - - - True - 5 - - - True - 0 - Write and confirm passwords: - - - False - - - - - True - 5 - - - True - Owner password: - 15 - - - False - False - - - - - True - True - 20 - False - 20 - - - False - False - 1 - - - - - False - False - 1 - - - - - True - 5 - - - True - Repeat password: - 15 - - - False - False - - - - - True - True - 20 - False - 20 - - - False - False - 1 - - - - - False - False - 2 - - - - - True - 5 - - - True - User password: - 15 - - - False - False - - - - - True - True - 20 - False - 20 - - - False - False - 1 - - - - - False - False - 3 - - - - - True - 5 - - - True - Repeat password: - 15 - - - False - False - - - - - True - True - 20 - False - 20 - - - False - False - 1 - - - - - False - False - 4 - - - - - True - 5 - 10 - GTK_BUTTONBOX_END - - - True - True - True - 0 - - - True - - - True - gtk-ok - - - False - False - - - - - True - Set password - - - 1 - - - - - - - - - True - True - True - 0 - - - True - - - True - - - True - gtk-cancel - - - False - False - - - - - True - No password - - - 1 - - - - - - - - - 1 - - - - - False - False - 5 - - - - - 1 - - - - - + + + NetSurf + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + True + False + 0 + + + + True + GTK_PACK_DIRECTION_LTR + GTK_PACK_DIRECTION_LTR + + + + True + _File + True + + + + + + + True + Opens a new browser window. + _New Window + True + + + + + True + gtk-new + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Opens a new browser tab. + New _Tab + True + + + + + True + gtk-new + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Open a file on your computer into this browser window. + _Open File... + True + + + + + True + gtk-open + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Close this browser window. + _Close Window + True + + + + + True + gtk-close + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + + + + + + True + False + Save this page to disc, optionally including images, etc. + Save page... + True + + + + True + gtk-save-as + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Export the page to a different format. + Export + True + + + + + + + True + False + Plain ASCII text, readable in text editors and views. + Plain text... + True + + + + + + True + False + RISC OS Drawfile vector graphic. + Drawfile... + True + + + + + + True + False + PostScript for printing and converting to PDFs. + PostScript... + True + + + + + + True + Portable Document Format. + PDF... + True + + + + + + + + + + True + + + + + + True + Show how a print out might look like. + Print preview... + True + + + + + True + gtk-print-preview + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Produce a hardcopy on your printer. + Print... + True + + + + + True + gtk-print + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + + + + + + True + gtk-quit + True + + + + + + + + + + True + _Edit + True + + + + + + + True + gtk-cut + True + + + + + + True + gtk-copy + True + + + + + + True + gtk-paste + True + + + + + + True + False + gtk-delete + True + + + + + + True + + + + + + True + Selects all text in the current browser window. + gtk-select-all + True + + + + + + + True + + + + + + True + False + Find specific text in the current browser window. + _Find... + True + + + + + + + True + + + + + + True + Change how NetSurf functions. + P_references... + True + + + + True + gtk-preferences + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + + + True + _View + True + + + + + + + True + _Stop + True + + + + + True + gtk-stop + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _Reload + True + + + + + True + gtk-refresh + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + + + + + + True + Scale the page in the current browser window to be smaller or larger. + _Scale View... + True + + + + True + gtk-zoom-in + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + + True + Zoom _in + True + + + + True + gtk-zoom-in + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _Normal size + True + + + + True + gtk-zoom-100 + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Zoom _out + True + + + + True + gtk-zoom-out + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + + + True + _Fullscreen + True + + + + + True + gtk-fullscreen + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + + + + + + True + False + _Images... + True + + + + + + + True + False + Toggle the display of images in the foreground. + _Foreground Images + True + False + + + + + + True + False + Toggle the display of images in the background. + _Background Images + True + False + + + + + + + + + + True + _Toolbars... + True + + + + + + + True + _Menu Bar + True + True + + + + + + True + _Button Bar + True + True + + + + + + True + _Status Bar + True + True + + + + + + + + + + True + + + + + + True + Shows the downloads window + _Downloads... + True + + + + + + + True + Save this window's size and position for use with new windows. + S_ave Window Size + True + + + + + + True + De_bugging + True + + + + + + + True + T_oggle debug rendering + True + + + + + + True + _Save box tree + True + + + + + + True + Save DOM tree + True + + + + + + + + + + + + + + True + _Navigate + True + + + + + + + True + _Back + True + + + + + True + gtk-go-back + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _Forward + True + + + + + True + gtk-go-forward + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _Home + True + + + + + True + gtk-home + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + + + + + + True + Show the history tree for this browser window. + _Local history... + True + + + + + + + True + Show the history tree for all windows. + _Global history... + True + + + + + + + True + + + + + + True + False + Add the current page to your bookmarks. + _Add to Bookmarks + True + + + + + + True + False + Open a window showing all your bookmarks. + _Show Bookmarks... + True + + + + + + + True + + + + + + True + Open an address into this browser window. + _Open location... + True + + + + + + + + + + + True + _Tabs + True + + + + + + + True + _Next Tab + True + + + + + + + True + _Previous Tab + True + + + + + + + + + + + True + _Help + True + + + + + + + True + False + Shows the contents of the NetSurf manual. + _Contents... + True + + + + True + gtk-help + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + False + Shows a guide and tutorial. + User _guide... + True + + + + + + True + False + User _information... + True + + + + + + True + + + + + + True + gtk-about + True + + + + + + + + + 0 + False + False + + + + + + True + GTK_ORIENTATION_HORIZONTAL + GTK_TOOLBAR_BOTH_HORIZ + True + True + + + + True + gtk-go-back + True + True + False + + + False + True + + + + + + True + gtk-go-forward + True + True + False + + + False + True + + + + + + True + gtk-stop + True + True + False + + + False + True + + + + + + True + gtk-refresh + True + True + False + + + False + True + + + + + + True + gtk-home + True + True + False + + + False + True + + + + + + True + True + True + False + + + + True + True + True + True + 0 + + True + + False + + + + + False + False + + + + + + True + True + True + False + + + + True + 4 + gtk-yes + 0.5 + 0.5 + 2 + 0 + + + + + False + False + + + + + 0 + False + False + + + + + + True + False + False + GTK_POS_TOP + True + False + + + + + + + + True + page 1 + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + + + + + True + page 2 + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + + + + + True + page 3 + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + 0 + True + True + + + + + + True + True + + + 0 + False + False + + + + + + + + Site Authentication + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ALWAYS + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + True + True + True + True + GTK_RELIEF_NORMAL + True + -5 + + + + True + True + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-ok + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Login + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + + + 0 + False + True + GTK_PACK_END + + + + + + 3 + True + False + 0 + + + + True + 6 + gtk-dialog-authentication + 0.5 + 0.10000000149 + 12 + 0 + + + 0 + False + False + + + + + + 1 + True + 4 + 2 + False + 10 + 11 + + + + True + moo.yoo.com + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 0 + 1 + + + + + + + True + Password + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + + + + + + + True + Username + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + + + + + + + True + Host + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + + + + + + + True + Realm + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + + + + + + + True + my sekr3t area + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 1 + 2 + + + + + + + True + True + True + False + 0 + opensesame + True + + True + + + 1 + 2 + 3 + 4 + + + + + + + True + True + True + True + True + 0 + sesame + True + + False + + + 1 + 2 + 2 + 3 + + + + + + 1 + True + True + + + + + 0 + True + True + + + + + + + + 1 + SSL certificate problem + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + True + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + GTK_RELIEF_NORMAL + True + -6 + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-cancel + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Reject + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + + + + True + True + True + GTK_RELIEF_NORMAL + True + -5 + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-apply + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Accept + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + False + 0 + + + + True + 6 + gtk-dialog-warning + 0.5 + 0 + 0 + 0 + + + 0 + False + False + + + + + + True + False + 0 + + + + True + NetSurf failed to verify the authenticity of an SSL certificate. Please verify the details presented below. + False + False + GTK_JUSTIFY_CENTER + True + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + 5 + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + 200 + True + True + False + False + True + GTK_JUSTIFY_LEFT + GTK_WRAP_NONE + True + 0 + 0 + 0 + 0 + 0 + 0 + (not implemented) + + + + + + + + + + True + <b>Certificate chain</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + Warning from NetSurf + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + False + True + False + gtk-dialog-warning + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + True + + + + 2 + True + False + 0 + + + + 3 + True + False + 0 + + + + True + 6 + gtk-dialog-warning + 0.5 + 0.5 + 12 + 0 + + + 0 + False + False + + + + + + True + Help help help! I'm being held prisoner by a bunch of RISC OS zealots! + False + False + GTK_JUSTIFY_LEFT + True + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + True + True + + + + + 0 + True + True + + + + + + True + + + 3 + False + True + + + + + + True + GTK_BUTTONBOX_END + 0 + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + False + False + + + + + + + + + + + True + _Back + True + + + + True + gtk-go-back + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _Forward + True + + + + True + gtk-go-forward + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _Reload + True + + + + True + gtk-refresh + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + + + + + + True + Cu_t + True + + + + gtk-cut + 4 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _Copy + True + + + + gtk-copy + 4 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _Paste + True + + + + gtk-paste + 4 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + File + True + + + + + + True + Edit + True + + + + + + True + View + True + + + + + + True + Navigate + True + + + + + + True + False + Object + True + + + + + + True + Help + True + + + + + + PDF Password + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + True + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + True + False + 0 + + + + True + 6 + gtk-dialog-authentication + 0.5 + 0.10000000149 + 12 + 0 + + + 0 + False + False + + + + + + 5 + True + False + 0 + + + + True + Write and confirm passwords: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + True + + + + + + 5 + True + False + 0 + + + + True + Owner password: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 15 + False + 0 + + + 0 + False + False + + + + + + True + True + True + False + 20 + + True + + False + 20 + + + 0 + False + False + + + + + 0 + False + False + + + + + + 5 + True + False + 0 + + + + True + Repeat password: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 15 + False + 0 + + + 0 + False + False + + + + + + True + True + True + False + 20 + + True + + False + 20 + + + 0 + False + False + + + + + 0 + False + False + + + + + + 5 + True + False + 0 + + + + True + User password: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 15 + False + 0 + + + 0 + False + False + + + + + + True + True + True + False + 20 + + True + + False + 20 + + + 0 + False + False + + + + + 0 + False + False + + + + + + 5 + True + False + 0 + + + + True + Repeat password: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 15 + False + 0 + + + 0 + False + False + + + + + + True + True + True + False + 20 + + True + + False + 20 + + + 0 + False + False + + + + + 0 + False + False + + + + + + 5 + True + GTK_BUTTONBOX_END + 10 + + + + True + True + GTK_RELIEF_NORMAL + True + + + + True + False + 0 + + + + True + gtk-ok + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Set password + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + gtk-cancel + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + No password + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + + + + + + 0 + False + False + + + + + 0 + True + True + + + + + + diff --git a/render/html.c b/render/html.c index 3d5a70ae1..627e39c4c 100644 --- a/render/html.c +++ b/render/html.c @@ -486,8 +486,8 @@ bool html_create(struct content *c, const char *params[]) union content_msg_data msg_data; html->parser = 0; -#ifdef WITH_HUBBUB html->document = 0; +#ifdef WITH_HUBBUB html->has_ns = false; memset(html->ns, 0, sizeof(html->ns)); #endif @@ -869,7 +869,6 @@ const char *html_detect_encoding(const char **data, unsigned int *size) bool html_convert(struct content *c, int width, int height) { - xmlDoc *document; xmlNode *html, *head; union content_msg_data msg_data; unsigned int time_before, time_taken; @@ -887,18 +886,18 @@ bool html_convert(struct content *c, int width, int height) #ifndef WITH_HUBBUB htmlParseChunk(c->data.html.parser, "", 0, 1); - document = c->data.html.parser->myDoc; - /*xmlDebugDumpDocument(stderr, c->data.html.parser->myDoc);*/ + c->data.html.document = c->data.html.parser->myDoc; + /*xmlDebugDumpDocument(stderr, c->data.html.document);*/ htmlFreeParserCtxt(c->data.html.parser); c->data.html.parser = 0; #else hubbub_parser_completed(c->data.html.parser); hubbub_parser_destroy(c->data.html.parser); c->data.html.parser = 0; - document = c->data.html.document; + c->data.html.document = c->data.html.document; /*xmlDebugDumpDocument(stderr, document);*/ #endif - if (!document) { + if (!c->data.html.document) { LOG(("Parsing failed")); msg_data.error = messages_get("ParsingFail"); content_broadcast(c, CONTENT_MSG_ERROR, msg_data); @@ -906,10 +905,10 @@ bool html_convert(struct content *c, int width, int height) } /* locate html and head elements */ - html = xmlDocGetRootElement(document); + html = xmlDocGetRootElement(c->data.html.document); if (html == 0 || strcmp((const char *) html->name, "html") != 0) { LOG(("html element not found")); - xmlFreeDoc(document); + xmlFreeDoc(c->data.html.document); msg_data.error = messages_get("ParsingFail"); content_broadcast(c, CONTENT_MSG_ERROR, msg_data); return false; @@ -961,9 +960,6 @@ bool html_convert(struct content *c, int width, int height) } /*imagemap_dump(c);*/ - /* XML tree not required past this point */ - xmlFreeDoc(document); - /* layout the box tree */ html_set_status(c, messages_get("Formatting")); content_broadcast(c, CONTENT_MSG_STATUS, msg_data); @@ -2218,6 +2214,9 @@ void html_destroy(struct content *c) hubbub_parser_destroy(c->data.html.parser); #endif + if (c->data.html.document) + xmlFreeDoc(c->data.html.document); + /* Free base target */ if (c->data.html.base_target) { talloc_free(c->data.html.base_target); diff --git a/render/html.h b/render/html.h index d7347f427..a67900f29 100644 --- a/render/html.h +++ b/render/html.h @@ -126,11 +126,11 @@ struct content_html_data { #else hubbub_parser *parser; /**< HTML parser context. */ hubbub_tree_handler tree_handler; - xmlDoc *document; bool has_ns; xmlNs *ns[NUM_NAMESPACES]; #endif + xmlDoc *document; /** HTML parser encoding handler. */ xmlCharEncodingHandler *encoding_handler;