From 8ab966398f67b7945f4d08ac1911beb0abd30657 Mon Sep 17 00:00:00 2001 From: Rob Kendrick Date: Tue, 15 Aug 2006 21:29:20 +0000 Subject: Merge new glade nsgtk window code into trunk. svn path=/trunk/netsurf/; revision=2853 --- gtk/gtk_gui.c | 6 + gtk/gtk_throbber.c | 131 ++ gtk/gtk_throbber.h | 24 + gtk/gtk_window.c | 1472 +++++++------- gtk/netsurf.glade | 5587 +++++++++++++++++++++++++++++----------------------- gtk/throbber.gif | Bin 0 -> 5175 bytes 6 files changed, 4090 insertions(+), 3130 deletions(-) create mode 100644 gtk/gtk_throbber.c create mode 100644 gtk/gtk_throbber.h create mode 100644 gtk/throbber.gif (limited to 'gtk') diff --git a/gtk/gtk_gui.c b/gtk/gtk_gui.c index 37fcea4e9..c6ade174f 100644 --- a/gtk/gtk_gui.c +++ b/gtk/gtk_gui.c @@ -30,6 +30,7 @@ #include "netsurf/gtk/gtk_options.h" #include "netsurf/gtk/gtk_completion.h" #include "netsurf/gtk/options.h" +#include "netsurf/gtk/gtk_throbber.h" #include "netsurf/render/box.h" #include "netsurf/render/form.h" #include "netsurf/render/html.h" @@ -113,6 +114,11 @@ void gui_init(int argc, char** argv) nsgtk_completion_init(); + nsgtk_throbber_initialise("./gtk/throbber.gif"); + + gladeWindows = glade_xml_new("./gtk/netsurf.glade", NULL, NULL); + wndChoices = glade_xml_get_widget(gladeWindows, "wndChoices"); + find_resource(buf, "Choices", "Choices"); LOG(("Using '%s' as Choices file", buf)); options_file_location = strdup(buf); diff --git a/gtk/gtk_throbber.c b/gtk/gtk_throbber.c new file mode 100644 index 000000000..a0b76b14d --- /dev/null +++ b/gtk/gtk_throbber.c @@ -0,0 +1,131 @@ +/* + * This file is part of NetSurf, http://netsurf.sourceforge.net/ + * Licensed under the GNU General Public License, + * http://www.opensource.org/licenses/gpl-license + * Copyright 2006 Rob Kendrick + */ + +#include +#include +#include "netsurf/utils/log.h" +#include "netsurf/image/gifread.h" +#include "netsurf/gtk/gtk_throbber.h" +#include "netsurf/gtk/gtk_bitmap.h" + +struct nsgtk_throbber *nsgtk_throbber = NULL; + +bool nsgtk_throbber_initialise(const char *fn) +{ + /* disect the GIF provided by filename in *fn into a series of + * GdkPixbuf for use later. + */ + struct gif_animation *gif; /**< structure for gifread.c */ + struct nsgtk_throbber *throb; /**< structure we generate */ + int i; + + FILE *fh = fopen(fn, "rb"); + + if (fh == NULL) { + LOG(("Unable to open throbber image '%s' for reading!", fn)); + return false; + } + + gif = (struct gif_animation *)malloc(sizeof(struct gif_animation)); + throb = (struct nsgtk_throbber *)malloc(sizeof(struct nsgtk_throbber)); + + /* discover the size of the data file. */ + fseek(fh, 0, SEEK_END); + gif->buffer_size = ftell(fh); + fseek(fh, 0, SEEK_SET); + + /* allocate a block of sufficient size, and load the data in. */ + gif->gif_data = (unsigned char *)malloc(gif->buffer_size); + fread(gif->gif_data, gif->buffer_size, 1, fh); + fclose(fh); + + /* set current position within GIF file to beginning, in order to + * signal to gifread that we're brand new. + */ + gif->buffer_position = 0; + + /* initialise the gif_animation structure. */ + switch (gif_initialise(gif)) + { + case GIF_INSUFFICIENT_FRAME_DATA: + case GIF_FRAME_DATA_ERROR: + case GIF_INSUFFICIENT_DATA: + case GIF_DATA_ERROR: + LOG(("GIF image '%s' appears invalid!", fn)); + free(gif->gif_data); + free(gif); + free(throb); + return false; + break; + case GIF_INSUFFICIENT_MEMORY: + LOG(("Ran out of memory decoding GIF image '%s'!", fn)); + free(gif->gif_data); + free(gif); + free(throb); + return false; + break; + } + + throb->nframes = gif->frame_count; + + if (throb->nframes < 2) + { + /* we need at least two frames - one for idle, one for active */ + LOG(("Insufficent number of frames in throbber image '%s'!", + fn)); + LOG(("(GIF contains %d frames, where 2 is a minimum.)", + throb->nframes)); + free(gif->gif_data); + free(gif); + free(throb); + return false; + } + + throb->framedata = (GdkPixbuf **)malloc(sizeof(GdkPixbuf *) + * throb->nframes); + + /* decode each frame in turn, extracting the struct bitmap * for each, + * and put that in our array of frames. + */ + for (i = 0; i < throb->nframes; i++) + { + gif_decode_frame(gif, i); + throb->framedata[i] = gdk_pixbuf_copy( + gtk_bitmap_get_primary(gif->frame_image)); + } + + gif_finalise(gif); + free(gif->gif_data); + free(gif); + + /* debug code: save out each frame as a PNG to make sure decoding is + * working correctly. + + for (i = 0; i < throb->nframes; i++) { + char fname[20]; + sprintf(fname, "frame%d.png", i); + gdk_pixbuf_save(throb->framedata[i], fname, "png", NULL, NULL); + } + */ + + nsgtk_throbber = throb; + + return true; +} + +void nsgtk_throbber_finalise(void) +{ + int i; + + for (i = 0; i < nsgtk_throbber->nframes; i++) + gdk_pixbuf_unref(nsgtk_throbber->framedata[i]); + + free(nsgtk_throbber->framedata); + free(nsgtk_throbber); + + nsgtk_throbber = NULL; +} diff --git a/gtk/gtk_throbber.h b/gtk/gtk_throbber.h new file mode 100644 index 000000000..4c04a6904 --- /dev/null +++ b/gtk/gtk_throbber.h @@ -0,0 +1,24 @@ +/* + * This file is part of NetSurf, http://netsurf.sourceforge.net/ + * Licensed under the GNU General Public License, + * http://www.opensource.org/licenses/gpl-license + * Copyright 2006 Rob Kendrick + */ + +#ifndef __GTK_THROBBER_H__ +#define __GTK_THROBBER_H__ + +#include + +struct nsgtk_throbber +{ + int nframes; /**< Number of frames in the throbber */ + GdkPixbuf **framedata; +}; + +extern struct nsgtk_throbber *nsgtk_throbber; + +bool nsgtk_throbber_initialise(const char *fn); +void nsgtk_throbber_finalise(void); + +#endif /* __GTK_THROBBER_H__ */ diff --git a/gtk/gtk_window.c b/gtk/gtk_window.c index 5eda0cb95..b10757b64 100644 --- a/gtk/gtk_window.c +++ b/gtk/gtk_window.c @@ -1,8 +1,8 @@ /* * This file is part of NetSurf, http://netsurf.sourceforge.net/ * Licensed under the GNU General Public License, - * http://www.opensource.org/licenses/gpl-license - * Copyright 2005 James Bursa + * http://www.opensource.org/licenses/gpl-license + * Copyright 2006 Rob Kendrick */ #include @@ -11,6 +11,7 @@ #include #include #include +#include #include "netsurf/content/content.h" #include "netsurf/desktop/browser.h" #include "netsurf/desktop/history_core.h" @@ -25,6 +26,7 @@ #include "netsurf/gtk/gtk_window.h" #include "netsurf/gtk/gtk_options.h" #include "netsurf/gtk/gtk_completion.h" +#include "netsurf/gtk/gtk_throbber.h" #include "netsurf/render/box.h" #include "netsurf/render/font.h" #include "netsurf/render/form.h" @@ -35,32 +37,41 @@ struct gtk_history_window; struct gui_window { - GtkWidget *window; - GtkWidget *url_bar; - GtkWidget *drawing_area; - GtkWidget *status_bar; - GtkWidget *progress_bar; - GtkWidget *stop_button; - GtkWidget *back_button; - GtkWidget *forward_button; - GtkWidget *reload_button; - struct browser_window *bw; - int target_width; - int target_height; - gui_pointer_shape current_pointer; - float scale; + GtkWindow *window; + GtkEntry *url_bar; + GtkEntryCompletion *url_bar_completion; + GtkDrawingArea *drawing_area; + GtkViewport *viewport; + GtkLabel *status_bar; + GtkToolButton *back_button; + GtkToolButton *forward_button; + GtkToolButton *stop_button; + GtkToolButton *reload_button; + GtkMenuItem *back_menu; + GtkMenuItem *forward_menu; + GtkMenuItem *stop_menu; + GtkMenuItem *reload_menu; + GtkImage *throbber; + + GladeXML *xml; + + struct browser_window *bw; + float scale; + int target_width, target_height; + int caretx, carety, careth; + gui_pointer_shape current_pointer; + int throb_frame; + struct gtk_history_window *history_window; - GtkWidget *history_window_widget; - int caretx, carety, careth; - int last_x, last_y; - struct gui_window *prev; - struct gui_window *next; + int last_x, last_y; }; struct gtk_history_window { - struct gui_window *g; - GtkWidget *drawing_area; + struct gui_window *g; + GtkWindow *window; + GtkScrolledWindow *scrolled; + GtkDrawingArea *drawing_area; }; GtkWidget *current_widget; @@ -70,673 +81,790 @@ GdkGC *current_gc; cairo_t *current_cr; #endif -struct gui_window *window_list = 0; -static int open_windows = 0; - -/* functions used by below event handlers */ -static void nsgtk_window_change_scale(struct gui_window *g, float scale); -static void nsgtk_window_update_back_forward(struct gui_window *g); - -/* main browser window toolbar event handlers */ -void nsgtk_window_back_button_clicked(GtkWidget *widget, gpointer data); -void nsgtk_window_forward_button_clicked(GtkWidget *widget, gpointer data); -void nsgtk_window_stop_button_clicked(GtkWidget *widget, gpointer data); -void nsgtk_window_reload_button_clicked(GtkWidget *widget, gpointer data); -void nsgtk_window_home_button_clicked(GtkWidget *widget, gpointer data); -void nsgtk_window_zoomin_button_clicked(GtkWidget *widget, gpointer data); -void nsgtk_window_zoom100_button_clicked(GtkWidget *widget, gpointer data); -void nsgtk_window_zoomout_button_clicked(GtkWidget *widget, gpointer data); -void nsgtk_window_history_button_clicked(GtkWidget *widget, gpointer data); -void nsgtk_window_choices_button_clicked(GtkWidget *widget, gpointer data); - -/* main browser window event handlers */ -void nsgtk_window_destroy_event(GtkWidget *widget, gpointer data); -gboolean nsgtk_window_expose_event(GtkWidget *widget, - GdkEventExpose *event, gpointer data); -gboolean nsgtk_window_url_activate_event(GtkWidget *widget, gpointer data); -gboolean nsgtk_window_url_changed(GtkWidget *widget, GdkEventKey *event, - gpointer data); -gboolean nsgtk_window_configure_event(GtkWidget *widget, - GdkEventConfigure *event, gpointer data); -gboolean nsgtk_window_motion_notify_event(GtkWidget *widget, - GdkEventMotion *event, gpointer data); -gboolean nsgtk_window_button_press_event(GtkWidget *widget, - GdkEventButton *event, gpointer data); -void nsgtk_window_size_allocate_event(GtkWidget *widget, - GtkAllocation *allocation, gpointer data); -gboolean nsgtk_window_keypress_event(GtkWidget *widget, - GdkEventKey *event, gpointer data); - -/* local history window event handlers */ -gboolean nsgtk_history_expose_event(GtkWidget *widget, - GdkEventExpose *event, gpointer data); -gboolean nsgtk_history_motion_notify_event(GtkWidget *widget, - GdkEventMotion *event, gpointer data); -gboolean nsgtk_history_button_press_event(GtkWidget *widget, - GdkEventButton *event, gpointer data); - - -/* misc support functions */ -static void nsgtk_perform_deferred_resize(void *p); -static wchar_t gdkkey_to_nskey(GdkEventKey *key); -static void nsgtk_pass_mouse_position(void *p); - -struct gui_window *gui_create_browser_window(struct browser_window *bw, - struct browser_window *clone) -{ - struct gui_window *g; - GtkWidget *window, *history_window; - GtkWidget *vbox; - GtkWidget *toolbar; - GtkToolItem *back_button, *forward_button, *stop_button, *reload_button; - GtkToolItem *zoomin_button, *zoomout_button, *zoom100_button; - GtkToolItem *home_button, *history_button, *choices_button; - GtkToolItem *url_item; - GtkWidget *url_bar; - GtkWidget *scrolled, *history_scrolled; - GtkWidget *drawing_area, *history_area; - GtkWidget *status_box; - GtkEntryCompletion *url_bar_completion; - - g = malloc(sizeof *g); - if (!g) { - warn_user("NoMemory", 0); - return 0; - } - - g->prev = 0; - g->next = window_list; - if (window_list) - window_list->prev = g; - window_list = g; - open_windows++; - - /* a height of zero means no caret */ - g->careth = 0; - - window = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_default_size(GTK_WINDOW(window), 600, 600); - gtk_window_set_title(GTK_WINDOW(window), "NetSurf"); - - g->history_window = malloc(sizeof(struct gtk_history_window)); - if (!g->history_window) { - warn_user("NoMemory", 0); - return 0; - } - g->history_window->g = g; - - history_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_transient_for(GTK_WINDOW(history_window), - GTK_WINDOW(window)); - gtk_window_set_default_size(GTK_WINDOW(history_window), 400, 400); - gtk_window_set_title(GTK_WINDOW(history_window), "NetSurf History"); - - g->history_window_widget = GTK_WIDGET(history_window); - - vbox = gtk_vbox_new(false, 0); - gtk_container_add(GTK_CONTAINER(window), vbox); - gtk_widget_show(vbox); - - toolbar = gtk_toolbar_new(); - gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS); - gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, TRUE, 0); - gtk_widget_show(toolbar); - - back_button = gtk_tool_button_new_from_stock(GTK_STOCK_GO_BACK); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), back_button, -1); - gtk_widget_show(GTK_WIDGET(back_button)); - g->back_button = GTK_WIDGET(back_button); - gtk_widget_set_sensitive(g->back_button, FALSE); - - forward_button = gtk_tool_button_new_from_stock(GTK_STOCK_GO_FORWARD); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), forward_button, -1); - gtk_widget_show(GTK_WIDGET(forward_button)); - g->forward_button = GTK_WIDGET(forward_button); - gtk_widget_set_sensitive(g->forward_button, FALSE); - - stop_button = gtk_tool_button_new_from_stock(GTK_STOCK_STOP); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), stop_button, -1); - gtk_widget_show(GTK_WIDGET(stop_button)); - g->stop_button = GTK_WIDGET(stop_button); - gtk_widget_set_sensitive(g->stop_button, FALSE); - - - reload_button = gtk_tool_button_new_from_stock(GTK_STOCK_REFRESH); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), reload_button, -1); - gtk_widget_show(GTK_WIDGET(reload_button)); - g->reload_button = GTK_WIDGET(reload_button); - gtk_widget_set_sensitive(g->reload_button, FALSE); - - home_button = gtk_tool_button_new_from_stock(GTK_STOCK_HOME); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), home_button, -1); - gtk_widget_show(GTK_WIDGET(home_button)); - - zoomin_button = gtk_tool_button_new_from_stock(GTK_STOCK_ZOOM_IN); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), zoomin_button, -1); - gtk_widget_show(GTK_WIDGET(zoomin_button)); - - zoom100_button = gtk_tool_button_new_from_stock(GTK_STOCK_ZOOM_100); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), zoom100_button, -1); - gtk_widget_show(GTK_WIDGET(zoom100_button)); - - zoomout_button = gtk_tool_button_new_from_stock(GTK_STOCK_ZOOM_OUT); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), zoomout_button, -1); - gtk_widget_show(GTK_WIDGET(zoomout_button)); - - history_button = gtk_tool_button_new_from_stock(GTK_STOCK_OPEN); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), history_button, -1); - gtk_widget_show(GTK_WIDGET(history_button)); - - choices_button = gtk_tool_button_new_from_stock(GTK_STOCK_PREFERENCES); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), choices_button, -1); - gtk_widget_show(GTK_WIDGET(choices_button)); - - url_item = gtk_tool_item_new(); - gtk_tool_item_set_expand(url_item, TRUE); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), url_item, -1); - gtk_widget_show(GTK_WIDGET(url_item)); - - url_bar = gtk_entry_new(); - gtk_container_add(GTK_CONTAINER(url_item), url_bar); - gtk_widget_show(url_bar); - g_signal_connect(G_OBJECT(url_bar), "activate", - G_CALLBACK(nsgtk_window_url_activate_event), g); - - scrolled = gtk_scrolled_window_new(0, 0); - gtk_box_pack_start(GTK_BOX(vbox), scrolled, TRUE, TRUE, 0); - gtk_widget_show(scrolled); - - history_scrolled = gtk_scrolled_window_new(0, 0); - gtk_container_add(GTK_CONTAINER(history_window), history_scrolled); - gtk_widget_show(history_scrolled); - - drawing_area = gtk_drawing_area_new(); - gtk_widget_set_events(drawing_area, - GDK_EXPOSURE_MASK | - GDK_LEAVE_NOTIFY_MASK | - GDK_BUTTON_PRESS_MASK | - GDK_POINTER_MOTION_MASK | - GDK_KEY_PRESS_MASK | - GDK_KEY_RELEASE_MASK); - GTK_WIDGET_SET_FLAGS(GTK_WIDGET(drawing_area), - GTK_CAN_FOCUS); - gtk_widget_modify_bg(drawing_area, GTK_STATE_NORMAL, - &((GdkColor) { 0, 0xffff, 0xffff, 0xffff })); - gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled), - drawing_area); - - gtk_widget_show(drawing_area); - - history_area = gtk_drawing_area_new(); - gtk_widget_set_events(history_area, - GDK_EXPOSURE_MASK | - GDK_POINTER_MOTION_MASK | - GDK_BUTTON_PRESS_MASK); - gtk_widget_modify_bg(history_area, GTK_STATE_NORMAL, - &((GdkColor) { 0, 0xffff, 0xffff, 0xffff })); - gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(history_scrolled), - history_area); - gtk_widget_show(history_area); - g->history_window->drawing_area = history_area; - - status_box = gtk_hbox_new(FALSE, 2); - gtk_box_pack_start(GTK_BOX(vbox), status_box, FALSE, TRUE, 3); - gtk_widget_show(status_box); - - g->status_bar = gtk_label_new(""); - gtk_box_pack_start(GTK_BOX(status_box), g->status_bar, FALSE, TRUE, 0); - gtk_widget_show(g->status_bar); - - g->progress_bar = gtk_progress_bar_new(); - gtk_progress_bar_set_pulse_step(GTK_PROGRESS_BAR(g->progress_bar), 0.20); - gtk_widget_set_size_request(g->progress_bar, 64, 0); - gtk_box_pack_end(GTK_BOX(status_box), g->progress_bar, FALSE, FALSE, 0); - - g->window = window; - gtk_widget_show(window); - - g->url_bar = url_bar; - g->drawing_area = drawing_area; - g->bw = bw; - g->current_pointer = GUI_POINTER_DEFAULT; - - if (clone) - g->scale = clone->window->scale; - else - g->scale = 1.0; - - /* set up URL bar completion */ - - url_bar_completion = gtk_entry_completion_new(); - gtk_entry_set_completion(GTK_ENTRY(url_bar), url_bar_completion); - gtk_entry_completion_set_match_func(url_bar_completion, - nsgtk_completion_match, NULL, NULL); - gtk_entry_completion_set_model(url_bar_completion, - GTK_TREE_MODEL(nsgtk_completion_list)); - gtk_entry_completion_set_text_column(url_bar_completion, 0); - gtk_entry_completion_set_minimum_key_length(url_bar_completion, 1); - gtk_entry_completion_set_popup_completion(url_bar_completion, TRUE); - g_object_set(G_OBJECT(url_bar_completion), - "popup-set-width", TRUE, - "popup-single-match", TRUE, - NULL); - -#define NS_SIGNAL_CONNECT(obj, sig, callback, ptr) \ - g_signal_connect(G_OBJECT(obj), (sig), G_CALLBACK(callback), (ptr)) +struct menu_events { + const char *widget; + GCallback handler; +}; - NS_SIGNAL_CONNECT(window, "destroy", nsgtk_window_destroy_event, g); - - g_signal_connect(G_OBJECT(url_bar), "changed", - G_CALLBACK(nsgtk_window_url_changed), g); -// g_signal_connect(G_OBJECT(url_bar_completion), "match-selected", -// G_CALLBACK(nsgtk_window_completion_selected), g); - g_signal_connect(G_OBJECT(drawing_area), "expose_event", - G_CALLBACK(nsgtk_window_expose_event), g); - g_signal_connect(G_OBJECT(drawing_area), "configure_event", - G_CALLBACK(nsgtk_window_configure_event), g); - g_signal_connect(G_OBJECT(drawing_area), "motion_notify_event", - G_CALLBACK(nsgtk_window_motion_notify_event), g); - g_signal_connect(G_OBJECT(drawing_area), "button_press_event", - G_CALLBACK(nsgtk_window_button_press_event), g); - g_signal_connect(G_OBJECT(scrolled), "size_allocate", - G_CALLBACK(nsgtk_window_size_allocate_event), g); - g_signal_connect(G_OBJECT(drawing_area), "key_press_event", - G_CALLBACK(nsgtk_window_keypress_event), g); - - g_signal_connect(G_OBJECT(zoomin_button), "clicked", - G_CALLBACK(nsgtk_window_zoomin_button_clicked), g); - g_signal_connect(G_OBJECT(zoom100_button), "clicked", - G_CALLBACK(nsgtk_window_zoom100_button_clicked), g); - g_signal_connect(G_OBJECT(zoomout_button), "clicked", - G_CALLBACK(nsgtk_window_zoomout_button_clicked), g); - g_signal_connect(G_OBJECT(g->stop_button), "clicked", - G_CALLBACK(nsgtk_window_stop_button_clicked), g); - - NS_SIGNAL_CONNECT(g->back_button, "clicked", nsgtk_window_back_button_clicked, g); - NS_SIGNAL_CONNECT(g->forward_button, "clicked", nsgtk_window_forward_button_clicked, g); - NS_SIGNAL_CONNECT(g->reload_button, "clicked", nsgtk_window_reload_button_clicked, g); - - NS_SIGNAL_CONNECT(history_button, "clicked", nsgtk_window_history_button_clicked, g); - NS_SIGNAL_CONNECT(choices_button, "clicked", nsgtk_window_choices_button_clicked, g); - NS_SIGNAL_CONNECT(home_button, "clicked", nsgtk_window_home_button_clicked, g); - - /* History window events */ - NS_SIGNAL_CONNECT(history_area, "expose_event", - nsgtk_history_expose_event, g->history_window); - NS_SIGNAL_CONNECT(history_area, "motion_notify_event", - nsgtk_history_motion_notify_event, g->history_window); - NS_SIGNAL_CONNECT(history_area, "button_press_event", - nsgtk_history_button_press_event, g->history_window); - NS_SIGNAL_CONNECT(g->history_window_widget, "delete_event", - gtk_widget_hide_on_delete, NULL); - -#undef NS_SIGNAL_CONNECT - - if( !bw->gesturer ) { - /* Prepare a gesturer */ - GestureRecogniser gr = gesture_recogniser_create(); - bw->gesturer = gesturer_create(gr); - gesture_recogniser_add(gr, "732187", 100); - gesture_recogniser_set_distance_threshold(gr, 50); - gesture_recogniser_set_count_threshold(gr, 20); - schedule(5, nsgtk_pass_mouse_position, g); - } +static int open_windows = 0; /**< current number of open browsers */ + +static wchar_t gdkkey_to_nskey(GdkEventKey *); +static void nsgtk_window_destroy_event(GtkWidget *, gpointer); +static gboolean nsgtk_window_expose_event(GtkWidget *, GdkEventExpose *, + gpointer); +static gboolean nsgtk_window_motion_notify_event(GtkWidget *, GdkEventMotion *, + gpointer); +static gboolean nsgtk_window_button_press_event(GtkWidget *, GdkEventButton *, + gpointer); +static gboolean nsgtk_window_keypress_event(GtkWidget *, GdkEventKey *, + gpointer); +static gboolean nsgtk_window_size_allocate_event(GtkWidget *, GtkAllocation *, + gpointer); + +static void nsgtk_perform_deferred_resize(void *); +static void nsgtk_window_update_back_forward(struct gui_window *); +static void nsgtk_throb(void *); +static void nsgtk_redraw_caret(struct gui_window *); + +static gboolean nsgtk_window_back_button_clicked(GtkWidget *, gpointer); +static gboolean nsgtk_window_forward_button_clicked(GtkWidget *, gpointer); +static gboolean nsgtk_window_stop_button_clicked(GtkWidget *, gpointer); +static gboolean nsgtk_window_reload_button_clicked(GtkWidget *, gpointer); +static gboolean nsgtk_window_home_button_clicked(GtkWidget *, gpointer); +static gboolean nsgtk_window_url_activate_event(GtkWidget *, gpointer); +static gboolean nsgtk_window_url_changed(GtkWidget *, GdkEventKey *, gpointer); + +static gboolean nsgtk_history_expose_event(GtkWidget *, GdkEventExpose *, + gpointer); +static gboolean nsgtk_history_motion_notify_event(GtkWidget *, GdkEventMotion *, + gpointer); +static gboolean nsgtk_history_button_press_event(GtkWidget *, GdkEventButton *, + gpointer); + +static void nsgtk_attach_menu_handlers(GladeXML *, gpointer); +static void nsgtk_window_change_scale(struct gui_window *, float); + +#define MENUEVENT(x) { #x, G_CALLBACK(nsgtk_on_##x##_activate) } +#define MENUPROTO(x) static gboolean nsgtk_on_##x##_activate( \ + GtkMenuItem *widget, gpointer g) +/* prototypes for menu handlers */ +/* file menu */ +MENUPROTO(new_window); +MENUPROTO(close_window); +MENUPROTO(quit); + +/* edit menu */ +MENUPROTO(choices); + +/* view menu */ +MENUPROTO(stop); +MENUPROTO(reload); +MENUPROTO(zoom_in); +MENUPROTO(normal_size); +MENUPROTO(zoom_out); + +/* navigate menu */ +MENUPROTO(back); +MENUPROTO(forward); +MENUPROTO(home); +MENUPROTO(local_history); + +/* help menu */ +MENUPROTO(about); + +/* structure used by nsgtk_attach_menu_handlers to connect menu items to + * their handling functions. + */ +static struct menu_events menu_events[] = { + /* file menu */ + MENUEVENT(new_window), + MENUEVENT(close_window), + MENUEVENT(quit), - return g; -} + /* edit menu */ + MENUEVENT(choices), + + /* view menu */ + MENUEVENT(stop), + MENUEVENT(reload), + MENUEVENT(zoom_in), + MENUEVENT(normal_size), + MENUEVENT(zoom_out), + + /* navigate menu */ + MENUEVENT(back), + MENUEVENT(forward), + MENUEVENT(home), + MENUEVENT(local_history), + + /* help menu */ + MENUEVENT(about), + + /* sentinel */ + { NULL, NULL } +}; -void nsgtk_pass_mouse_position(void *p) +void nsgtk_attach_menu_handlers(GladeXML *xml, gpointer g) { - struct gui_window *g = (struct gui_window*)p; - if( g->bw->gesturer ) - if( gesturer_add_point(g->bw->gesturer, g->last_x, g->last_y) == 100 ) - exit(0); - schedule(5, nsgtk_pass_mouse_position, p); + struct menu_events *event = menu_events; + + while (event->widget != NULL) + { + GtkWidget *w = glade_xml_get_widget(xml, event->widget); + g_signal_connect(G_OBJECT(w), "activate", event->handler, g); + event++; + } } -void nsgtk_window_change_scale(struct gui_window *g, float scale) +wchar_t gdkkey_to_nskey(GdkEventKey *key) { - g->scale = scale; - if (g->bw->current_content != NULL) - gui_window_set_extent(g, g->bw->current_content->width, - g->bw->current_content->height); - gtk_widget_queue_draw(g->drawing_area); + /* this function will need to become much more complex to support + * everything that the RISC OS version does. But this will do for + * now. I hope. + */ + + switch (key->keyval) + { + case GDK_BackSpace: return KEY_DELETE_LEFT; + case GDK_Delete: return KEY_DELETE_RIGHT; + case GDK_Linefeed: return 13; + case GDK_Return: return 10; + case GDK_Left: return KEY_LEFT; + case GDK_Right: return KEY_RIGHT; + case GDK_Up: return KEY_UP; + case GDK_Down: return KEY_DOWN; + + /* Modifiers - do nothing for now */ + case GDK_Shift_L: + case GDK_Shift_R: + case GDK_Control_L: + case GDK_Control_R: + case GDK_Caps_Lock: + case GDK_Shift_Lock: + case GDK_Meta_L: + case GDK_Meta_R: + case GDK_Alt_L: + case GDK_Alt_R: + case GDK_Super_L: + case GDK_Super_R: + case GDK_Hyper_L: + case GDK_Hyper_R: return 0; + + default: return key->keyval; + } } -void nsgtk_window_zoomin_button_clicked(GtkWidget *widget, gpointer data) +/* event handlers and support functions for them */ + +void nsgtk_window_destroy_event(GtkWidget *widget, gpointer data) { struct gui_window *g = data; - nsgtk_window_change_scale(g, g->scale + 0.05); + + gtk_widget_destroy(GTK_WIDGET(g->history_window->window)); + gui_window_destroy(g); + if (--open_windows == 0) + netsurf_quit = true; } -void nsgtk_window_zoom100_button_clicked(GtkWidget *widget, gpointer data) +gboolean nsgtk_window_expose_event(GtkWidget *widget, + GdkEventExpose *event, gpointer data) { struct gui_window *g = data; - nsgtk_window_change_scale(g, 1.00); + struct content *c = g->bw->current_content; + + if (c == NULL) + return FALSE; + + current_widget = widget; + current_drawable = widget->window; + current_gc = gdk_gc_new(current_drawable); +#ifdef CAIRO_VERSION + current_cr = gdk_cairo_create(current_drawable); +#endif + + plot = nsgtk_plotters; + nsgtk_plot_set_scale(g->scale); + content_redraw(c, 0, 0, + widget->allocation.width, + widget->allocation.height, + event->area.x, + event->area.y, + event->area.x + event->area.width, + event->area.y + event->area.height, + g->scale, 0xFFFFFF); + + if (g->careth != 0) + plot.line(g->caretx, g->carety, + g->caretx, g->carety + g->careth, 1, 0, false, false); + + g_object_unref(current_gc); +#ifdef CAIRO_VERSION + cairo_destroy(current_cr); +#endif + + return FALSE; } -void nsgtk_window_zoomout_button_clicked(GtkWidget *widget, gpointer data) +gboolean nsgtk_window_motion_notify_event(GtkWidget *widget, + GdkEventMotion *event, gpointer data) { struct gui_window *g = data; - nsgtk_window_change_scale(g, g->scale - 0.05); + + browser_window_mouse_track(g->bw, 0, event->x / g->scale, + event->y / g->scale); + + g->last_x = event->x; + g->last_y = event->y; + + return TRUE; } -void nsgtk_window_stop_button_clicked(GtkWidget *widget, gpointer data) +gboolean nsgtk_window_button_press_event(GtkWidget *widget, + GdkEventButton *event, gpointer data) { struct gui_window *g = data; - browser_window_stop(g->bw); + int button = BROWSER_MOUSE_CLICK_1; + + if (event->button == 2) /* 2 == middle button on X */ + button = BROWSER_MOUSE_CLICK_2; + + if (event->button == 3) /* 3 == right button on X */ + return TRUE; /* Do nothing for right click for now */ + + browser_window_mouse_click(g->bw, button, + event->x / g->scale, event->y / g->scale); + + return TRUE; } -void nsgtk_window_destroy_event(GtkWidget *widget, gpointer data) +gboolean nsgtk_window_keypress_event(GtkWidget *widget, GdkEventKey *event, + gpointer data) { struct gui_window *g = data; - gui_window_destroy(g); - if (--open_windows == 0) - netsurf_quit = true; + wchar_t nskey = gdkkey_to_nskey(event); + + browser_window_key_press(g->bw, nskey); + + return TRUE; } -void nsgtk_window_back_button_clicked(GtkWidget *widget, gpointer data) +gboolean nsgtk_window_size_allocate_event(GtkWidget *widget, + GtkAllocation *allocation, gpointer data) { struct gui_window *g = data; - if (!history_back_available(g->bw->history)) return; - history_back(g->bw, g->bw->history); - nsgtk_window_update_back_forward(g); + + g->target_width = widget->allocation.width - 2; + g->target_height = widget->allocation.height; + + /* schedule a callback to perform the resize for 1/10s from now */ + schedule(5, nsgtk_perform_deferred_resize, g); + + return TRUE; } -void nsgtk_window_forward_button_clicked(GtkWidget *widget, gpointer data) +void nsgtk_perform_deferred_resize(void *p) { - struct gui_window *g = data; - if (!history_forward_available(g->bw->history)) return; - history_forward(g->bw, g->bw->history); - nsgtk_window_update_back_forward(g); + struct gui_window *g = p; + + if (gui_in_multitask) + return; + + if (g->bw->current_content == NULL) + return; + + if (g->bw->current_content->status != CONTENT_STATUS_READY && + g->bw->current_content->status != CONTENT_STATUS_DONE) + return; + + content_reformat(g->bw->current_content, + g->target_width, g->target_height); + + if (GTK_WIDGET_SENSITIVE((GTK_WIDGET(g->stop_button)))) + schedule(100, nsgtk_perform_deferred_resize, g); } void nsgtk_window_update_back_forward(struct gui_window *g) { int width, height; - gtk_widget_set_sensitive(g->back_button, + + gtk_widget_set_sensitive(GTK_WIDGET(g->back_button), history_back_available(g->bw->history)); - gtk_widget_set_sensitive(g->forward_button, + gtk_widget_set_sensitive(GTK_WIDGET(g->forward_button), history_forward_available(g->bw->history)); + + gtk_widget_set_sensitive(GTK_WIDGET(g->back_menu), + history_back_available(g->bw->history)); + gtk_widget_set_sensitive(GTK_WIDGET(g->forward_menu), + history_forward_available(g->bw->history)); + + /* update the local history window, as well as queuing a redraw + * for it. + */ history_size(g->bw->history, &width, &height); gtk_widget_set_size_request(GTK_WIDGET(g->history_window->drawing_area), width, height); - gtk_widget_queue_draw(GTK_WIDGET(g->history_window_widget)); + gtk_widget_queue_draw(GTK_WIDGET(g->history_window->drawing_area)); } -void nsgtk_window_history_button_clicked(GtkWidget *widget, gpointer data) +void nsgtk_throb(void *p) +{ + struct gui_window *g = p; + + if (g->throb_frame >= (nsgtk_throbber->nframes - 1)) + g->throb_frame = 1; + else + g->throb_frame++; + + gtk_image_set_from_pixbuf(g->throbber, nsgtk_throbber->framedata[ + g->throb_frame]); + + schedule(10, nsgtk_throb, p); +} + +void nsgtk_redraw_caret(struct gui_window *g) +{ + if (g->careth == 0) + return; + + gui_window_redraw(g, g->caretx, g->carety, + g->caretx, g->carety + g->careth); +} + +/* signal handling functions for the toolbar and URL bar */ +gboolean nsgtk_window_back_button_clicked(GtkWidget *widget, gpointer data) { struct gui_window *g = data; - gtk_widget_show(GTK_WIDGET(g->history_window_widget)); - gdk_window_raise(g->history_window_widget->window); + + if (!history_back_available(g->bw->history)) + return TRUE; + + history_back(g->bw, g->bw->history); + nsgtk_window_update_back_forward(g); + + return TRUE; } -void nsgtk_window_choices_button_clicked(GtkWidget *widget, gpointer data) +gboolean nsgtk_window_forward_button_clicked(GtkWidget *widget, gpointer data) { - gtk_widget_show(GTK_WIDGET(wndChoices)); - gdk_window_raise(wndChoices); + struct gui_window *g = data; + + if (!history_forward_available(g->bw->history)) + return TRUE; + + history_forward(g->bw, g->bw->history); + nsgtk_window_update_back_forward(g); + + return TRUE; } -void nsgtk_window_reload_button_clicked(GtkWidget *widget, gpointer data) +gboolean nsgtk_window_stop_button_clicked(GtkWidget *widget, gpointer data) +{ + struct gui_window *g = data; + + browser_window_stop(g->bw); + + return TRUE; +} + +gboolean nsgtk_window_reload_button_clicked(GtkWidget *widget, gpointer data) { struct gui_window *g = data; + browser_window_reload(g->bw, true); + + return TRUE; } -void nsgtk_window_home_button_clicked(GtkWidget *widget, gpointer data) +gboolean nsgtk_window_home_button_clicked(GtkWidget *widget, gpointer data) { struct gui_window *g = data; - const char *addr = "http://netsurf.sourceforge.net/"; + static const char *addr = "http://netsurf.sourceforge.net/"; if (option_homepage_url != NULL) addr = option_homepage_url; browser_window_go(g->bw, addr, 0, true); + + return TRUE; } -gboolean nsgtk_window_expose_event(GtkWidget *widget, - GdkEventExpose *event, gpointer data) +gboolean nsgtk_window_url_activate_event(GtkWidget *widget, gpointer data) { struct gui_window *g = data; - struct content *c = g->bw->current_content; - - if (!c) - return FALSE; + char *referer = 0; - current_widget = widget; - current_drawable = widget->window; - current_gc = gdk_gc_new(current_drawable); -#ifdef CAIRO_VERSION - current_cr = gdk_cairo_create(current_drawable); -#endif + if (g->bw->current_content && g->bw->current_content->url) + referer = g->bw->current_content->url; - plot = nsgtk_plotters; - nsgtk_plot_set_scale(g->scale); + browser_window_go(g->bw, gtk_entry_get_text(GTK_ENTRY(g->url_bar)), + referer, true); - content_redraw(c, 0, 0, - widget->allocation.width, - widget->allocation.height, - event->area.x, - event->area.y, - event->area.x + event->area.width, - event->area.y + event->area.height, - g->scale, 0xFFFFFF); + return TRUE; +} - if (g->careth != 0) - plot.line(g->caretx, g->carety, - g->caretx, g->carety + g->careth, 1, 0, false, false); - g_object_unref(current_gc); -#ifdef CAIRO_VERSION - cairo_destroy(current_cr); -#endif +gboolean nsgtk_window_url_changed(GtkWidget *widget, GdkEventKey *event, + gpointer data) +{ + const char *prefix; + + prefix = gtk_entry_get_text(GTK_ENTRY(widget)); + nsgtk_completion_update(prefix); - return FALSE; + return TRUE; } -gboolean nsgtk_history_expose_event(GtkWidget *widget, - GdkEventExpose *event, - gpointer data) -{ - struct gtk_history_window *hw = data; - current_widget = widget; - current_drawable = widget->window; - current_gc = gdk_gc_new(current_drawable); -#ifdef CAIRO_VERSION - current_cr = gdk_cairo_create(current_drawable); -#endif - plot = nsgtk_plotters; - nsgtk_plot_set_scale(1.0); - history_redraw(hw->g->bw->history); +/* signal handlers for menu entries */ +#define MENUHANDLER(x) gboolean nsgtk_on_##x##_activate(GtkMenuItem *widget, \ + gpointer g) - g_object_unref(current_gc); -#ifdef CAIRO_VERSION - cairo_destroy(current_cr); -#endif - return FALSE; +MENUHANDLER(new_window) +{ + return TRUE; } -gboolean nsgtk_history_motion_notify_event(GtkWidget *widget, - GdkEventMotion *event, gpointer data) +MENUHANDLER(close_window) { - /* Not sure what to do here */ + struct gui_window *gw = (struct gui_window *)g; + gtk_widget_destroy(GTK_WIDGET(gw->window)); + return TRUE; } -gboolean nsgtk_history_button_press_event(GtkWidget *widget, - GdkEventButton *event, - gpointer data) +MENUHANDLER(quit) { - struct gtk_history_window *hw = data; - - history_click(hw->g->bw, hw->g->bw->history, - event->x, event->y, false); + netsurf_quit = true; + return TRUE; +} +MENUHANDLER(choices) +{ + gtk_widget_show(GTK_WIDGET(wndChoices)); + gdk_window_raise(GDK_WINDOW(wndChoices)); + return TRUE; } -gboolean nsgtk_window_url_activate_event(GtkWidget *widget, gpointer data) +void nsgtk_window_change_scale(struct gui_window *g, float scale) { - struct gui_window *g = data; - char *referer = 0; + g->scale = scale; + + if (g->bw->current_content != NULL) + gui_window_set_extent(g, g->bw->current_content->width, + g->bw->current_content->height); - if (g->bw->current_content && g->bw->current_content->url) - referer = g->bw->current_content->url; + gtk_widget_queue_draw(GTK_WIDGET(g->drawing_area)); +} - browser_window_go(g->bw, gtk_entry_get_text(GTK_ENTRY(g->url_bar)), - referer, true); +MENUHANDLER(zoom_in) +{ + struct gui_window *gw = g; + nsgtk_window_change_scale(gw, gw->scale + 0.05); + return TRUE; } -gboolean nsgtk_window_url_changed(GtkWidget *widget, GdkEventKey *event, - gpointer data) +MENUHANDLER(normal_size) { - const char *prefix; - prefix = gtk_entry_get_text(GTK_ENTRY(widget)); - nsgtk_completion_update(prefix); - + struct gui_window *gw = g; + + nsgtk_window_change_scale(gw, 1.00); + return TRUE; } -gboolean nsgtk_window_keypress_event(GtkWidget *widget, - GdkEventKey *event, - gpointer data) +MENUHANDLER(zoom_out) { - struct gui_window *g = data; - wchar_t nskey = gdkkey_to_nskey(event); - browser_window_key_press(g->bw, nskey); - + struct gui_window *gw = g; + + nsgtk_window_change_scale(gw, gw->scale - 0.05); + return TRUE; } -gboolean nsgtk_window_configure_event(GtkWidget *widget, - GdkEventConfigure *event, gpointer data) +MENUHANDLER(stop) { - struct gui_window *g = data; + return nsgtk_window_stop_button_clicked(GTK_WIDGET(widget), g); +} - if (gui_in_multitask) - return FALSE; +MENUHANDLER(reload) +{ + return nsgtk_window_reload_button_clicked(GTK_WIDGET(widget), g); +} - if (!g->bw->current_content) - return FALSE; - if (g->bw->current_content->status != CONTENT_STATUS_READY && - g->bw->current_content->status != CONTENT_STATUS_DONE) - return FALSE; +MENUHANDLER(back) +{ + return nsgtk_window_back_button_clicked(GTK_WIDGET(widget), g); +} -/* content_reformat(g->bw->current_content, event->width, event->height); */ +MENUHANDLER(forward) +{ + return nsgtk_window_forward_button_clicked(GTK_WIDGET(widget), g); +} - return FALSE; +MENUHANDLER(home) +{ + return nsgtk_window_home_button_clicked(GTK_WIDGET(widget), g); } -void nsgtk_perform_deferred_resize(void *p) +MENUHANDLER(local_history) { - struct gui_window *g = p; - if (gui_in_multitask) return; - if (!g->bw->current_content) return; - if (g->bw->current_content->status != CONTENT_STATUS_READY && - g->bw->current_content->status != CONTENT_STATUS_DONE) - return; - content_reformat(g->bw->current_content, g->target_width, g->target_height); - if (GTK_WIDGET_SENSITIVE (g->stop_button)) { - schedule(100, nsgtk_perform_deferred_resize, g); - } + struct gui_window *gw = (struct gui_window *)g; + + gtk_widget_show(GTK_WIDGET(gw->history_window->window)); + gdk_window_raise(GDK_WINDOW(gw->history_window->window)); + + return TRUE; } -void nsgtk_window_size_allocate_event(GtkWidget *widget, - GtkAllocation *allocation, gpointer data) +MENUHANDLER(about) { - struct gui_window *g = data; - GtkWidget *viewport = gtk_bin_get_child(GTK_BIN(widget)); - /* The widget is the scrolled window, which is a GtkBin. We want - * The width and height of the allocation of its child - */ - g->target_width = viewport->allocation.width - 2; - g->target_height = viewport->allocation.height; - /* Schedule a callback to perform the resize for 1/10s from now */ - schedule(5, nsgtk_perform_deferred_resize, g); + return TRUE; } -gboolean nsgtk_window_motion_notify_event(GtkWidget *widget, - GdkEventMotion *event, gpointer data) +/* signal handler functions for the local history window */ +gboolean nsgtk_history_expose_event(GtkWidget *widget, + GdkEventExpose *event, gpointer g) { - struct gui_window *g = data; + struct gtk_history_window *hw = g; + + current_widget = widget; + current_drawable = widget->window; + current_gc = gdk_gc_new(current_drawable); +#ifdef CAIRO_VERSION + current_cr = gdk_cairo_create(current_drawable); +#endif + plot = nsgtk_plotters; + nsgtk_plot_set_scale(1.0); - browser_window_mouse_track(g->bw, 0, event->x / g->scale, - event->y / g->scale); - g->last_x = event->x; - g->last_y = event->y; - return TRUE; + history_redraw(hw->g->bw->history); + + g_object_unref(current_gc); +#ifdef CAIRO_VERSION + cairo_destroy(current_cr); +#endif + return FALSE; } +gboolean nsgtk_history_motion_notify_event(GtkWidget *widget, + GdkEventMotion *event, gpointer g) +{ + return TRUE; +} -gboolean nsgtk_window_button_press_event(GtkWidget *widget, - GdkEventButton *event, gpointer data) +gboolean nsgtk_history_button_press_event(GtkWidget *widget, + GdkEventButton *event, gpointer g) { - struct gui_window *g = data; - int button = BROWSER_MOUSE_CLICK_1; + struct gtk_history_window *hw = g; - LOG(("BUTTON PRESS: %d", event->button)); - - if (event->button == 2) /* 2 == middle button on X */ - button = BROWSER_MOUSE_CLICK_2; - if (event->button == 3) /* 3 == right button on X */ - return TRUE; /* Do nothing for right click for now */ - - browser_window_mouse_click(g->bw, button, - event->x / g->scale, event->y / g->scale); + history_click(hw->g->bw, hw->g->bw->history, + event->x, event->y, false); return TRUE; } -void gui_window_destroy(struct gui_window *data) +/* functions called by the core to manipulate the GUI */ +#define GET_WIDGET(x) glade_xml_get_widget(g->xml, (x)) +struct gui_window *gui_create_browser_window(struct browser_window *bw, + struct browser_window *clone) { - /* XXX: Destroy history window etc here */ - - struct gui_window *g = data; + struct gui_window *g; /**< what we're creating to return */ + + g = malloc(sizeof(*g)); + + g->bw = bw; + g->current_pointer = GUI_POINTER_DEFAULT; + if (clone != NULL) + g->scale = clone->window->scale; + else + g->scale = 1.0; + + g->careth = 0; + + /* load the window template from the glade xml file, and extract + * widget references from it for later use. + */ + g->xml = glade_xml_new("./gtk/netsurf.glade", "wndBrowser", NULL); + glade_xml_signal_autoconnect(g->xml); + g->window = GTK_WINDOW(GET_WIDGET("wndBrowser")); + g->url_bar = GTK_ENTRY(GET_WIDGET("URLBar")); + g->drawing_area = GTK_DRAWING_AREA(GET_WIDGET("drawingArea")); + g->status_bar = GTK_LABEL(GET_WIDGET("statusBar")); + g->back_button = GTK_TOOL_BUTTON(GET_WIDGET("toolBack")); + g->forward_button = GTK_TOOL_BUTTON(GET_WIDGET("toolForward")); + g->stop_button = GTK_TOOL_BUTTON(GET_WIDGET("toolStop")); + g->reload_button = GTK_TOOL_BUTTON(GET_WIDGET("toolReload")); + g->back_menu = GTK_MENU_ITEM(GET_WIDGET("back")); + g->forward_menu = GTK_MENU_ITEM(GET_WIDGET("forward")); + g->stop_menu = GTK_MENU_ITEM(GET_WIDGET("stop")); + g->reload_menu = GTK_MENU_ITEM(GET_WIDGET("reload")); + g->throbber = GTK_IMAGE(GET_WIDGET("throbber")); + g->viewport = GTK_VIEWPORT(GET_WIDGET("viewport1")); + + /* connect our scrollbars to the viewport */ + gtk_viewport_set_hadjustment(g->viewport, + gtk_range_get_adjustment(GTK_RANGE(GET_WIDGET("hscrollbar1")))); + gtk_viewport_set_vadjustment(g->viewport, + gtk_range_get_adjustment(GTK_RANGE(GET_WIDGET("vscrollbar1")))); + gtk_widget_set_size_request(GTK_WIDGET(g->viewport), 0, 0); + + /* set the URL entry box to expand, as we can't do this from within + * glade because of the way it emulates toolbars. + */ + gtk_tool_item_set_expand(GTK_TOOL_ITEM(GET_WIDGET("toolURLBar")), TRUE); + + /* set the initial size of the browser window */ + gtk_window_set_default_size(g->window, 600, 600); + + /* set the events we're interested in receiving from the browser's + * drawing area. + */ + gtk_widget_set_events(GTK_WIDGET(g->drawing_area), + GDK_EXPOSURE_MASK | + GDK_LEAVE_NOTIFY_MASK | + GDK_BUTTON_PRESS_MASK | + GDK_POINTER_MOTION_MASK | + GDK_KEY_PRESS_MASK | + GDK_KEY_RELEASE_MASK); + GTK_WIDGET_SET_FLAGS(GTK_WIDGET(g->drawing_area), GTK_CAN_FOCUS); + + /* set the default background colour of the drawing area to white. */ + gtk_widget_modify_bg(GTK_WIDGET(g->drawing_area), GTK_STATE_NORMAL, + &((GdkColor) { 0, 0xffff, 0xffff, 0xffff } )); + + /* disable toolbar buttons that make no sense initially. */ + gtk_widget_set_sensitive(GTK_WIDGET(g->back_button), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(g->forward_button), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(g->stop_button), FALSE); + + /* create the local history window to be assoicated with this browser */ + g->history_window = malloc(sizeof(struct gtk_history_window)); + g->history_window->g = g; + g->history_window->window = GTK_WINDOW( + gtk_window_new(GTK_WINDOW_TOPLEVEL)); + gtk_window_set_transient_for(g->history_window->window, g->window); + gtk_window_set_default_size(g->history_window->window, 400, 400); + gtk_window_set_title(g->history_window->window, "NetSurf History"); + gtk_window_set_type_hint(g->history_window->window, + GDK_WINDOW_TYPE_HINT_UTILITY); + g->history_window->scrolled = GTK_SCROLLED_WINDOW( + gtk_scrolled_window_new(0, 0)); + gtk_container_add(GTK_CONTAINER(g->history_window->window), + GTK_WIDGET(g->history_window->scrolled)); + + gtk_widget_show(GTK_WIDGET(g->history_window->scrolled)); + g->history_window->drawing_area = GTK_DRAWING_AREA( + gtk_drawing_area_new()); + + gtk_widget_set_events(GTK_WIDGET(g->history_window->drawing_area), + GDK_EXPOSURE_MASK | + GDK_POINTER_MOTION_MASK | + GDK_BUTTON_PRESS_MASK); + gtk_widget_modify_bg(GTK_WIDGET(g->history_window->drawing_area), + GTK_STATE_NORMAL, + &((GdkColor) { 0, 0xffff, 0xffff, 0xffff } )); + gtk_scrolled_window_add_with_viewport(g->history_window->scrolled, + GTK_WIDGET(g->history_window->drawing_area)); + gtk_widget_show(GTK_WIDGET(g->history_window->drawing_area)); + + /* set up URL bar completion */ + g->url_bar_completion = gtk_entry_completion_new(); + gtk_entry_set_completion(g->url_bar, g->url_bar_completion); + gtk_entry_completion_set_match_func(g->url_bar_completion, + nsgtk_completion_match, NULL, NULL); + gtk_entry_completion_set_model(g->url_bar_completion, + GTK_TREE_MODEL(nsgtk_completion_list)); + gtk_entry_completion_set_text_column(g->url_bar_completion, 0); + gtk_entry_completion_set_minimum_key_length(g->url_bar_completion, 1); + gtk_entry_completion_set_popup_completion(g->url_bar_completion, TRUE); + g_object_set(G_OBJECT(g->url_bar_completion), + "popup-set-width", TRUE, + "popup-single-match", TRUE, + NULL); + + /* set up the throbber. */ + gtk_image_set_from_pixbuf(g->throbber, nsgtk_throbber->framedata[0]); + g->throb_frame = 0; + +#define CONNECT(obj, sig, callback, ptr) \ + g_signal_connect(G_OBJECT(obj), (sig), G_CALLBACK(callback), (ptr)) + + /* connect history window signals to their handlers */ + CONNECT(g->history_window->drawing_area, "expose_event", + nsgtk_history_expose_event, g->history_window); + CONNECT(g->history_window->drawing_area, "motion_notify_event", + nsgtk_history_motion_notify_event, g->history_window); + CONNECT(g->history_window->drawing_area, "button_press_event", + nsgtk_history_button_press_event, g->history_window); + CONNECT(g->history_window->window, "delete_event", + gtk_widget_hide_on_delete, NULL); + + /* connect signals to handlers. */ + CONNECT(g->window, "destroy", nsgtk_window_destroy_event, g); + CONNECT(g->drawing_area, "expose_event", nsgtk_window_expose_event, g); + CONNECT(g->drawing_area, "motion_notify_event", + nsgtk_window_motion_notify_event, g); + CONNECT(g->drawing_area, "button_press_event", + nsgtk_window_button_press_event, g); + CONNECT(g->drawing_area, "key_press_event", + nsgtk_window_keypress_event, g); + CONNECT(GET_WIDGET("viewport1"), "size_allocate", + nsgtk_window_size_allocate_event, g); + + /* toolbar and URL bar signal handlers */ + CONNECT(g->back_button, "clicked", nsgtk_window_back_button_clicked, g); + CONNECT(g->forward_button, "clicked", + nsgtk_window_forward_button_clicked, g); + CONNECT(g->stop_button, "clicked", nsgtk_window_stop_button_clicked, g); + CONNECT(g->reload_button, "clicked", + nsgtk_window_reload_button_clicked, g); + CONNECT(GET_WIDGET("toolHome"), "clicked", + nsgtk_window_home_button_clicked, g); + CONNECT(g->url_bar, "activate", nsgtk_window_url_activate_event, g); + CONNECT(g->url_bar, "changed", nsgtk_window_url_changed, g); + + /* set up the menu signal handlers */ + nsgtk_attach_menu_handlers(g->xml, g); + + /* increase the number of open windows. */ + open_windows++; - if (g->prev) - g->prev->next = g->next; - else - window_list = g->next; + /* finally, show the window. */ + gtk_widget_show(GTK_WIDGET(g->window)); - if (g->next) - g->next->prev = g->prev; + return g; } +void gui_window_destroy(struct gui_window *g) +{ + +} void gui_window_set_title(struct gui_window *g, const char *title) { - gtk_window_set_title(GTK_WINDOW(g->window), title); + static char suffix[] = " - NetSurf"; + char nt[strlen(title) + strlen(suffix) + 1]; + + if (title == NULL || title[0] == '\0') + { + gtk_window_set_title(g->window, "NetSurf"); + + } + else + { + strcpy(nt, title); + strcat(nt, suffix); + gtk_window_set_title(g->window, nt); + } } - void gui_window_redraw(struct gui_window *g, int x0, int y0, int x1, int y1) { - gtk_widget_queue_draw_area(g->drawing_area, x0, y0, x1-x0+1, y1-y0+1); + gtk_widget_queue_draw_area(GTK_WIDGET(g->drawing_area), + x0, y0, x1-x0+1, y1-y0+1); } - -void gui_window_redraw_window(struct gui_window* g) +void gui_window_redraw_window(struct gui_window *g) { - gtk_widget_queue_draw(g->drawing_area); + gtk_widget_queue_draw(GTK_WIDGET(g->drawing_area)); } - void gui_window_update_box(struct gui_window *g, - const union content_msg_data *data) + const union content_msg_data *data) { struct content *c = g->bw->current_content; - if (!c) return; + if (c == NULL) + return; - gtk_widget_queue_draw_area(g->drawing_area, data->redraw.x, data->redraw.y, - data->redraw.width, data->redraw.height); + gtk_widget_queue_draw_area(GTK_WIDGET(g->drawing_area), + data->redraw.x, data->redraw.y, + data->redraw.width, data->redraw.height); } - bool gui_window_get_scroll(struct gui_window *g, int *sx, int *sy) { *sx = 0; @@ -744,182 +872,179 @@ bool gui_window_get_scroll(struct gui_window *g, int *sx, int *sy) return true; } - void gui_window_set_scroll(struct gui_window *g, int sx, int sy) { -} +} int gui_window_get_width(struct gui_window* g) { - return g->drawing_area->allocation.width; + return GTK_WIDGET(g->drawing_area)->allocation.width; } - int gui_window_get_height(struct gui_window* g) { - return g->drawing_area->allocation.height; + return GTK_WIDGET(g->drawing_area)->allocation.height; } - void gui_window_set_extent(struct gui_window *g, int width, int height) { - gtk_widget_set_size_request(g->drawing_area, width * g->scale, - height * g->scale); + gtk_widget_set_size_request(GTK_WIDGET(g->drawing_area), + width * g->scale, height * g->scale); + gtk_widget_set_size_request(GTK_WIDGET(g->viewport), 0, 0); } - void gui_window_set_status(struct gui_window *g, const char *text) { - gtk_label_set_text(GTK_LABEL(g->status_bar), text); + gtk_label_set_text(g->status_bar, text); } - void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape) { - GdkCursor *cursor = NULL; - GdkCursorType cursortype; - bool nullcursor = false; - if (g->current_pointer == shape) return; + GdkCursor *cursor = NULL; + GdkCursorType cursortype; + bool nullcursor = false; + + if (g->current_pointer == shape) + return; + g->current_pointer = shape; + switch (shape) { - case GUI_POINTER_POINT: - cursortype = GDK_HAND1; - break; - case GUI_POINTER_CARET: - cursortype = GDK_XTERM; - break; - case GUI_POINTER_UP: - cursortype = GDK_TOP_SIDE; - break; - case GUI_POINTER_DOWN: - cursortype = GDK_BOTTOM_SIDE; - break; - case GUI_POINTER_LEFT: - cursortype = GDK_LEFT_SIDE; - break; - case GUI_POINTER_RIGHT: - cursortype = GDK_RIGHT_SIDE; - break; - case GUI_POINTER_LD: - cursortype = GDK_BOTTOM_LEFT_CORNER; - break; - case GUI_POINTER_RD: - cursortype = GDK_BOTTOM_RIGHT_CORNER; - break; - case GUI_POINTER_LU: - cursortype = GDK_TOP_LEFT_CORNER; - break; - case GUI_POINTER_RU: - cursortype = GDK_TOP_RIGHT_CORNER; - break; - case GUI_POINTER_CROSS: - cursortype = GDK_CROSS; - break; - case GUI_POINTER_MOVE: - cursortype = GDK_FLEUR; - break; - case GUI_POINTER_WAIT: - cursortype = GDK_WATCH; - break; - case GUI_POINTER_HELP: - cursortype = GDK_QUESTION_ARROW; - break; - case GUI_POINTER_MENU: - cursortype = GDK_RIGHTBUTTON; - break; - case GUI_POINTER_PROGRESS: - /* In reality, this needs to be the funky left_ptr_watch which we can't do easily yet */ - cursortype = GDK_WATCH; - break; - /* The following we're not sure about */ - case GUI_POINTER_NO_DROP: - case GUI_POINTER_NOT_ALLOWED: - case GUI_POINTER_DEFAULT: - default: - nullcursor = true; - } - if (!nullcursor) - cursor = gdk_cursor_new_for_display(gtk_widget_get_display(GTK_WIDGET(g->drawing_area)), cursortype); - gdk_window_set_cursor(g->drawing_area->window, cursor); + case GUI_POINTER_POINT: + cursortype = GDK_HAND1; + break; + case GUI_POINTER_CARET: + cursortype = GDK_XTERM; + break; + case GUI_POINTER_UP: + cursortype = GDK_TOP_SIDE; + break; + case GUI_POINTER_DOWN: + cursortype = GDK_BOTTOM_SIDE; + break; + case GUI_POINTER_LEFT: + cursortype = GDK_LEFT_SIDE; + break; + case GUI_POINTER_RIGHT: + cursortype = GDK_RIGHT_SIDE; + break; + case GUI_POINTER_LD: + cursortype = GDK_BOTTOM_LEFT_CORNER; + break; + case GUI_POINTER_RD: + cursortype = GDK_BOTTOM_RIGHT_CORNER; + break; + case GUI_POINTER_LU: + cursortype = GDK_TOP_LEFT_CORNER; + break; + case GUI_POINTER_RU: + cursortype = GDK_TOP_RIGHT_CORNER; + break; + case GUI_POINTER_CROSS: + cursortype = GDK_CROSS; + break; + case GUI_POINTER_MOVE: + cursortype = GDK_FLEUR; + break; + case GUI_POINTER_WAIT: + cursortype = GDK_WATCH; + break; + case GUI_POINTER_HELP: + cursortype = GDK_QUESTION_ARROW; + break; + case GUI_POINTER_MENU: + cursortype = GDK_RIGHTBUTTON; + break; + case GUI_POINTER_PROGRESS: + /* In reality, this needs to be the funky left_ptr_watch + * which we can't do easily yet. + */ + cursortype = GDK_WATCH; + break; + /* The following we're not sure about */ + case GUI_POINTER_NO_DROP: + case GUI_POINTER_NOT_ALLOWED: + case GUI_POINTER_DEFAULT: + default: + nullcursor = true; + } + + if (!nullcursor) + cursor = gdk_cursor_new_for_display( + gtk_widget_get_display( + GTK_WIDGET(g->drawing_area)), + cursortype); + gdk_window_set_cursor(GTK_WIDGET(g->drawing_area)->window, cursor); + if (!nullcursor) - gdk_cursor_unref(cursor); + gdk_cursor_unref(cursor); } - void gui_window_hide_pointer(struct gui_window *g) { -} +} void gui_window_set_url(struct gui_window *g, const char *url) { - gtk_entry_set_text(GTK_ENTRY(g->url_bar), url); -} - -static void nsgtk_throb(void *p) -{ - struct gui_window *g = p; - gtk_progress_bar_pulse(GTK_PROGRESS_BAR( - (struct gui_window *)(g)->progress_bar)); - schedule(10, nsgtk_throb, g); + gtk_entry_set_text(g->url_bar, url); } void gui_window_start_throbber(struct gui_window* g) { - gtk_widget_set_sensitive(g->stop_button, TRUE); - gtk_widget_set_sensitive(g->reload_button, FALSE); - gtk_widget_show(g->progress_bar); - schedule(100, nsgtk_perform_deferred_resize, g); + gtk_widget_set_sensitive(GTK_WIDGET(g->stop_button), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(g->reload_button), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(g->stop_menu), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(g->reload_button), FALSE); + nsgtk_window_update_back_forward(g); + schedule(10, nsgtk_throb, g); } - void gui_window_stop_throbber(struct gui_window* g) { - gtk_widget_set_sensitive(g->stop_button, FALSE); - gtk_widget_set_sensitive(g->reload_button, TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(g->stop_button), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(g->reload_button), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(g->stop_menu), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(g->reload_menu), TRUE); + nsgtk_window_update_back_forward(g); - gtk_widget_hide(g->progress_bar); + schedule_remove(nsgtk_throb, g); -} - -static void gui_window_redraw_caret(struct gui_window *g) -{ - if (g->careth == 0) - return; - - gui_window_redraw(g, g->caretx, g->carety, - g->caretx, g->carety + g->careth); + + gtk_image_set_from_pixbuf(g->throbber, nsgtk_throbber->framedata[0]); + // Issue a final reflow so that the content object reports its size correctly + schedule(5, nsgtk_perform_deferred_resize, g); } void gui_window_place_caret(struct gui_window *g, int x, int y, int height) { - gui_window_redraw_caret(g); + nsgtk_redraw_caret(g); g->caretx = x; g->carety = y + 1; g->careth = height; - gui_window_redraw_caret(g); + nsgtk_redraw_caret(g); - gtk_widget_grab_focus(g->drawing_area); + gtk_widget_grab_focus(GTK_WIDGET(g->drawing_area)); } - void gui_window_remove_caret(struct gui_window *g) { - gui_window_redraw_caret(g); + if (g->careth == 0) + return; - g->careth = 0; + gui_window_redraw(g, g->caretx, g->carety, + g->caretx, g->carety + g->careth); } - void gui_window_new_content(struct gui_window *g) { -} +} bool gui_window_scroll_start(struct gui_window *g) { @@ -927,44 +1052,42 @@ bool gui_window_scroll_start(struct gui_window *g) } bool gui_window_box_scroll_start(struct gui_window *g, - int x0, int y0, int x1, int y1) + int x0, int y0, int x1, int y1) { return true; } void gui_drag_save_object(gui_save_type type, struct content *c, - struct gui_window *g) + struct gui_window *g) { -} +} void gui_drag_save_selection(struct selection *s, struct gui_window *g) { -} +} void gui_start_selection(struct gui_window *g) { -} +} void gui_paste_from_clipboard(struct gui_window *g, int x, int y) { -} +} bool gui_empty_clipboard(void) { return true; } - bool gui_add_to_clipboard(const char *text, size_t length, bool space) { - return true; + return true; } - bool gui_commit_clipboard(void) { return true; @@ -976,41 +1099,4 @@ bool gui_copy_to_clipboard(struct selection *s) return true; } -wchar_t gdkkey_to_nskey(GdkEventKey *key) -{ - /* this function will need to become much more complex to support - * everything that the RISC OS version does. But this will do for - * now. I hope. - */ - - switch (key->keyval) - { - case GDK_BackSpace: return KEY_DELETE_LEFT; - case GDK_Delete: return KEY_DELETE_RIGHT; - case GDK_Linefeed: return 13; - case GDK_Return: return 10; - case GDK_Left: return KEY_LEFT; - case GDK_Right: return KEY_RIGHT; - case GDK_Up: return KEY_UP; - case GDK_Down: return KEY_DOWN; - - /* Modifiers - do nothing for now */ - case GDK_Shift_L: - case GDK_Shift_R: - case GDK_Control_L: - case GDK_Control_R: - case GDK_Caps_Lock: - case GDK_Shift_Lock: - case GDK_Meta_L: - case GDK_Meta_R: - case GDK_Alt_L: - case GDK_Alt_R: - case GDK_Super_L: - case GDK_Super_R: - case GDK_Hyper_L: - case GDK_Hyper_R: return 0; - - default: return key->keyval; - } -} diff --git a/gtk/netsurf.glade b/gtk/netsurf.glade index 697b282e6..e11a4d893 100644 --- a/gtk/netsurf.glade +++ b/gtk/netsurf.glade @@ -3,8 +3,8 @@ - - NetSurf Choices + + NetSurf GTK_WINDOW_TOPLEVEL GTK_WIN_POS_CENTER False @@ -13,272 +13,175 @@ True False False - GDK_WINDOW_TYPE_HINT_DIALOG + GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True False - True - - + + True False 0 - - - True - GTK_BUTTONBOX_END - - - - True - Revert any made changes. - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - - - True - Apply and save these changes now. - True - True - gtk-apply - True - GTK_RELIEF_NORMAL - True - -10 - - - - - - - 0 - False - True - GTK_PACK_END - - - - - 4 + True - True - True - True - GTK_POS_LEFT - False - False + GTK_PACK_DIRECTION_LTR + GTK_PACK_DIRECTION_LTR - + True - False - 0 + _File + True - - 5 - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN + - + True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 + Opens a new browser window. + New window + True + - - - 5 + + True - False - 5 + gtk-new + 1 + 0.5 + 0.5 + 0 + 0 + + + + - - - True - URL - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - + + + True + False + Open an address into this browser window. + Open _location... + True + + + - - - True - The page to visit when the Home button is pressed, or a new window is opened. - True - True - True - 0 - http://netsurf.sourceforge.net/ - True - - False - - - 0 - True - True - - + + + True + False + Open a file on your computer into this browser window. + Open _file... + True + + + + + True + gtk-open + 1 + 0.5 + 0.5 + 0 + 0 - + True - <b>Home page</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + Close this browser window. + _Close window + True + + + + + True + gtk-close + 1 + 0.5 + 0.5 + 0 + 0 + + - - label_item - - - - 0 - False - True - - - - - 5 - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN + + + True + + - + True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 + 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 + False + Export the page to a different format. + Export + True - - True - True - 0 + - + True - Attempt to hide images from known advertisement servers. - True - Hide advertisements + Plain ASCII text, readable in text editors and views. + Plain text... True - GTK_RELIEF_NORMAL - True - False - False - True - - 0 - False - False - - + True - False - Stop pop-up windows normally containing adverts appearing. - True - Disable pop-up windows + RISC OS Drawfile vector graphic. + Drawfile... True - GTK_RELIEF_NORMAL - True - False - False - True - - 0 - False - False - - + True - False - Do not allow the embedded of applets and plugins. - True - Disable plug-ins + PostScript for printing and converting to PDFs. + PostScript... True - GTK_RELIEF_NORMAL - True - False - False - True - - 0 - False - False - @@ -286,166 +189,325 @@ - + True - <b>Content blocking</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - label_item - + + + + + True + False + Show how a print out might look like. + Print preview... + True + + + + True + gtk-print-preview + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + False + Produce a hardcopy on your printer. + Print... + True + + + + + True + gtk-print + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + + + + + + True + gtk-quit + True + - - 0 - False - True - + + + + + + True + _Edit + True - - 5 - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN + - + True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 + False + gtk-cut + True + + - - - 1 + + + True + False + gtk-copy + True + + + + + + True + False + gtk-paste + True + + + + + + True + False + gtk-delete + True + + + + + + True + + + + + + True + False + Selects all text in the current browser window. + Select _all + True + + + + + + + True + + + + + + True + False + Find specific text in the current browser window. + _Find... + True + + + + + + + True + + + + + + True + Change how NetSurf functions. + _Choices... + True + + + True - False - 2 + 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 + + + + + - - 4 + True - False - 4 + Zoom _in + True + - - + + True - Keep history for - False - False - GTK_JUSTIFY_LEFT - False - False + gtk-zoom-in + 1 0.5 0.5 0 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - 0 - False - False - + + - - - True - False - Visited pages are forgotten after this many days - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 14 0 100 1 10 10 - - - 0 - False - False - - + + + True + _Normal size + True + - - + + True - days - False - False - GTK_JUSTIFY_LEFT - False - False + gtk-zoom-100 + 1 0.5 0.5 0 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - 0 - False - False - - - 0 - True - True - - + True - False - Show a tooltip showing the URL of a page in the local history tree. - True - Hover URLs by pointer in local history + Zoom _out True - GTK_RELIEF_NORMAL - True - False - False - True + + + + + True + gtk-zoom-out + 1 + 0.5 + 0.5 + 0 + 0 + + - - 0 - False - False - @@ -453,438 +515,698 @@ - + True - <b>History</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + 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 + + + + - - label_item - - - - 0 - False - False - - - - - - 5 - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - + True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 + False + Toolbars + True - - True - True - 0 + - + True False - Ask before overwriting files when downloading. - True - Request confirmation before overwriting files + Menu bar True - GTK_RELIEF_NORMAL - True False - False - True - - 0 - False - False - - + True - Show a drop-down list of recent addresses when typing into the address bar. - True - Display recently visited URLs as you type + False + Buttons True - GTK_RELIEF_NORMAL - True - False - False - True + True - - 0 - False - False - - + True - When requesting items or pages, tell the server what linked to them. - True - Send site referral information + False + Address bar + True + True + + + + + + True + False + Throbber + True + True + + + + + + True + False + Status bar True - GTK_RELIEF_NORMAL - True True - False - True - - 0 - False - False - - - - - True - <b>Misc</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - 0 - False - True - - - False - True - - - - - - True - General - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - + True - False - 0 + _Navigate + True - - 5 - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN + - + True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 + _Back + True + - - + + True - 4 - 2 - False - 3 - 3 + gtk-go-back + 1 + 0.5 + 0.5 + 0 + 0 + + + + - - - True - If your proxy server requires authentication, enter your username here. - True - True - True - 0 - - True - - False - - - 1 - 2 - 2 - 3 - - - + + + 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 + False + 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 book_marks... + 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 + + + + + True + False + + + + + + True + True + True + False + + + + True + 4 + gtk-yes + 0.5 + 0.5 + 2 + 0 + + + + + False + False + + + + + 0 + False + False + + + + + + True + 2 + 2 + False + 0 + 0 + + + + True + GTK_UPDATE_CONTINUOUS + False + 0 0 100 1 10 0 + + + 1 + 2 + 0 + 1 + fill + + + + + + True + GTK_SHADOW_IN + + + + True + True + True + + + + + 0 + 1 + 0 + 1 + fill + fill + + + + + + True + True + + + + True + Status bar text goes here + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.490000009537 + 0 + 0 + PANGO_ELLIPSIZE_MIDDLE + 50 + False + 0 + + + True + False + + + + + + True + GTK_UPDATE_CONTINUOUS + False + 0 0 100 1 10 0 + + + True + True + + + + + 0 + 1 + 1 + 2 + shrink + + + + + + 1 + True + True + + + 1 + 2 + 1 + 2 + fill + shrink|fill + + + + + 0 + True + True + + + + + + + + NetSurf Choices + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + True - - - True - False - None -Simple proxy -Basic authentication -NTML authentication - False - True - - - 1 - 2 - 0 - 1 - - - + + + True + False + 0 - - - True - False - 0 + + + True + GTK_BUTTONBOX_END - - - True - Host name of your proxy server. - True - True - True - 0 - - True - - False - - - 0 - True - True - - + + + True + Revert any made changes. + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + - - - True - : - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - + + + True + Apply and save these changes now. + True + True + gtk-apply + True + GTK_RELIEF_NORMAL + True + -10 + + + + + + + 0 + False + True + GTK_PACK_END + + - - - 64 - True - Port number to connect to on proxy server. - True - True - True - 0 - - True - - False - - - 0 - True - True - - - - - 1 - 2 - 1 - 2 - fill - fill - - + + + 4 + True + True + True + True + GTK_POS_LEFT + False + False - - - True - Password - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 3 - 4 - - expand - - + + + True + False + 0 - - - True - Username - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - - expand - - + + + 5 + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN - - - True - Host - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - - expand - - + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + 5 + True + False + 5 - + True - Proxy type + URL False False GTK_JUSTIFY_LEFT False False - 0 + 0.5 0.5 0 0 @@ -894,34 +1216,29 @@ NTML authentication 0 - 0 - 1 - 0 - 1 - - expand + 0 + False + False - + True - If your proxy server requires authentication, enter your password here. + The page to visit when the Home button is pressed, or a new window is opened. True True True 0 - + http://netsurf.sourceforge.net/ True False - 1 - 2 - 3 - 4 - + 0 + True + True @@ -930,9 +1247,9 @@ NTML authentication - + True - <b>HTTP Proxy</b> + <b>Home page</b> False True GTK_JUSTIFY_LEFT @@ -960,7 +1277,7 @@ NTML authentication - + 5 True 0 @@ -968,7 +1285,7 @@ NTML authentication GTK_SHADOW_ETCHED_IN - + True 0.5 0.5 @@ -980,159 +1297,237 @@ NTML authentication 0 - - 3 + True - 3 - 2 - False - 3 - 3 + True + 0 - + True - Maximum fetchers - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + Attempt to hide images from known advertisement servers. + True + Hide advertisements + True + GTK_RELIEF_NORMAL + True + False + False + True - 0 - 1 - 0 - 1 - expand + 0 + False + False - + True - Fetches per host - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + False + Stop pop-up windows normally containing adverts appearing. + True + Disable pop-up windows + True + GTK_RELIEF_NORMAL + True + False + False + True - 0 - 1 - 1 - 2 - expand + 0 + False + False - + True - Cached connections - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + False + Do not allow the embedded of applets and plugins. + True + Disable plug-ins + True + GTK_RELIEF_NORMAL + True + False + False + True - 0 - 1 - 2 - 3 - expand + 0 + False + False + + + + + + + + True + <b>Content blocking</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + 5 + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + 1 + True + False + 2 - + + 4 True - Number of connections to keep incase they are needed again. - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 1 0 100 1 10 10 - - - 1 - 2 - 2 - 3 - - - + False + 4 + + + + True + Keep history for + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + - - - True - Maximum number of item fetches per web server. - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 1 0 100 1 10 10 + + + True + False + Visited pages are forgotten after this many days + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 14 0 100 1 10 10 + + + 0 + False + False + + + + + + True + days + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + - 1 - 2 - 1 - 2 - + 0 + True + True - + True - Maximum number of concurrent items to fetch at once. + False + Show a tooltip showing the URL of a page in the local history tree. True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 1 0 100 1 10 10 + Hover URLs by pointer in local history + True + GTK_RELIEF_NORMAL + True + False + False + True - 1 - 2 - 0 - 1 - + 0 + False + False @@ -1141,9 +1536,9 @@ NTML authentication - + True - <b>Fetching</b> + <b>History</b> False True GTK_JUSTIFY_LEFT @@ -1166,47 +1561,12 @@ NTML authentication 0 False - True + False - - - False - True - - - - - - True - Network - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - True - False - 0 - + 5 True 0 @@ -1214,7 +1574,7 @@ NTML authentication GTK_SHADOW_ETCHED_IN - + True 0.5 0.5 @@ -1226,21 +1586,22 @@ NTML authentication 0 - + True - False + True 0 - + True - Enable the use of Cairo, which provides better looking results at the cost of speed. + False + Ask before overwriting files when downloading. True - Use Cairo for anti-aliased drawing + Request confirmation before overwriting files True GTK_RELIEF_NORMAL True - True + False False True @@ -1252,11 +1613,31 @@ NTML authentication - + True - Smoothly resize images when zooming in and out. + Show a drop-down list of recent addresses when typing into the address bar. True - Resample images when not at natural size + Display recently visited URLs as you type + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + When requesting items or pages, tell the server what linked to them. + True + Send site referral information True GTK_RELIEF_NORMAL True @@ -1276,9 +1657,9 @@ NTML authentication - + True - <b>Quality</b> + <b>Misc</b> False True GTK_JUSTIFY_LEFT @@ -1304,9 +1685,44 @@ NTML authentication True + + + False + True + + + + + + True + General + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + False + 0 - + 5 True 0 @@ -1314,7 +1730,7 @@ NTML authentication GTK_SHADOW_ETCHED_IN - + True 0.5 0.5 @@ -1325,22 +1741,87 @@ NTML authentication 12 0 - - - True - False - 0 + + + True + 4 + 2 + False + 3 + 3 + + + + True + If your proxy server requires authentication, enter your username here. + True + True + True + 0 + + True + + False + + + 1 + 2 + 2 + 3 + + + + + + + True + False + None +Simple proxy +Basic authentication +NTML authentication + False + True + + + 1 + 2 + 0 + 1 + + + - + True False - 5 + 0 - + True - Limit speed to + Host name of your proxy server. + True + True + True + 0 + + True + + False + + + 0 + True + True + + + + + + True + : False False GTK_JUSTIFY_LEFT @@ -1363,42 +1844,18 @@ NTML authentication - + + 64 True - Do not update animations any more often than this. + Port number to connect to on proxy server. True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 0.10000000149 0 100 0.10000000149 10 10 - - - 0 - True - False - - - - - - True - seconds between frames - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + True + True + 0 + + True + + False 0 @@ -1408,29 +1865,146 @@ NTML authentication - 0 - True - True + 1 + 2 + 1 + 2 + fill + fill - + True - Display only the first frame of animated images. + Password + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + + expand + + + + + + True + Username + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + + expand + + + + + + True + Host + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + + expand + + + + + + True + Proxy type + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + + expand + + + + + + True + If your proxy server requires authentication, enter your password here. True - Disable animations - True - GTK_RELIEF_NORMAL - True - False - False - True + True + True + 0 + + True + + False - 0 - False - False + 1 + 2 + 3 + 4 + @@ -1439,9 +2013,9 @@ NTML authentication - + True - <b>Animations</b> + <b>HTTP Proxy</b> False True GTK_JUSTIFY_LEFT @@ -1464,47 +2038,12 @@ NTML authentication 0 False - False + True - - - False - True - - - - - - True - Rendering - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - True - False - 0 - + 5 True 0 @@ -1512,7 +2051,7 @@ NTML authentication GTK_SHADOW_ETCHED_IN - + True 0.5 0.5 @@ -1524,19 +2063,19 @@ NTML authentication 0 - - 2 + + 3 True - 6 + 3 2 False 3 3 - + True - Sans-serif + Maximum fetchers False False GTK_JUSTIFY_LEFT @@ -1556,15 +2095,14 @@ NTML authentication 1 0 1 - fill - + expand - + True - Serif + Fetches per host False False GTK_JUSTIFY_LEFT @@ -1584,15 +2122,14 @@ NTML authentication 1 1 2 - fill - + expand - + True - Monospace + Cached connections False False GTK_JUSTIFY_LEFT @@ -1612,218 +2149,371 @@ NTML authentication 1 2 3 - fill - + expand - + True - Cursive - False - False - GTK_JUSTIFY_LEFT + Number of connections to keep incase they are needed again. + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + 1 0 100 1 10 10 - 0 - 1 - 3 - 4 - fill + 1 + 2 + 2 + 3 - + True - Fantasy - False - False - GTK_JUSTIFY_LEFT + Maximum number of item fetches per web server. + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + 1 0 100 1 10 10 - 0 - 1 - 4 - 5 - fill + 1 + 2 + 1 + 2 - + True - Default - False - False - GTK_JUSTIFY_LEFT + Maximum number of concurrent items to fetch at once. + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + 1 0 100 1 10 10 - 0 - 1 - 5 - 6 - fill + 1 + 2 + 0 + 1 + + + + + + + + True + <b>Fetching</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + False + True + + + + + + True + Network + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + False + 0 + + + + 5 + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 - + True - False + Enable the use of Cairo, which provides better looking results at the cost of speed. True - False - False - False - False + Use Cairo for anti-aliased drawing + True + GTK_RELIEF_NORMAL True + True + False + True - 1 - 2 - 1 - 2 - fill - + 0 + False + False - + True - False + Smoothly resize images when zooming in and out. True - False - False - False - False + Resample images when not at natural size + True + GTK_RELIEF_NORMAL True + True + False + True - 1 - 2 - 2 - 3 - fill - + 0 + False + False + + + + - - - True - False - True - False - False - False - False - True - - - 1 - 2 - 3 - 4 - fill - - - + + + True + <b>Quality</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + - - - True - False - True - False - False - False - False - True - - - 1 - 2 - 4 - 5 - fill - - - + + + 5 + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 - + True - False - Sans-serif -Sans -Monospace -Cursive -Fantasy - False - True + False + 5 + + + + True + Limit speed to + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + Do not update animations any more often than this. + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 0.10000000149 0 100 0.10000000149 10 10 + + + 0 + True + False + + + + + + True + seconds between frames + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + - 1 - 2 - 5 - 6 - fill - fill + 0 + True + True - + True - False + Display only the first frame of animated images. True - False - False - False - False + Disable animations + True + GTK_RELIEF_NORMAL True + False + False + True - 1 - 2 - 0 - 1 - + 0 + False + False @@ -1832,9 +2522,9 @@ Fantasy - + True - <b>Font faces</b> + <b>Animations</b> False True GTK_JUSTIFY_LEFT @@ -1857,12 +2547,47 @@ Fantasy 0 False - True + False + + + False + True + + + + + + True + Rendering + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + False + 0 - + 5 True 0 @@ -1870,7 +2595,7 @@ Fantasy GTK_SHADOW_ETCHED_IN - + True 0.5 0.5 @@ -1882,18 +2607,19 @@ Fantasy 0 - + + 2 True - 2 - 3 + 6 + 2 False 3 3 - + True - Default + Sans-serif False False GTK_JUSTIFY_LEFT @@ -1919,9 +2645,9 @@ Fantasy - + True - Minimum + Serif False False GTK_JUSTIFY_LEFT @@ -1947,210 +2673,43 @@ Fantasy - - True - The base-line font size to use. - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 1 0 100 1 10 10 - - - 1 - 2 - 0 - 1 - - - - - - - - True - Do not allow text to be displayed any smaller than this. - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 1 0 100 1 10 10 - - - 1 - 2 - 1 - 2 - - - - - - - - True - pt - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 0 - 1 - - - - - - + True - pt - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 1 - 2 - - - - - - - - - - - True - <b>Font size</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - True - - - - - False - True - - - - - - True - Fonts - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - True - False - 0 - - - - 5 - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 6 + Monospace + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + - + True - Size + Cursive False False GTK_JUSTIFY_LEFT False False - 0.5 + 0 0.5 0 0 @@ -2160,42 +2719,53 @@ Fantasy 0 - 0 - False - False + 0 + 1 + 3 + 4 + fill + - + True - How much memory to use for caching recently viewed objects in memory. - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False + Fantasy + False + False + GTK_JUSTIFY_LEFT False - 1 0 100 1 10 10 + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 - 0 - False - False + 0 + 1 + 4 + 5 + fill + - + True - MB + Default False False GTK_JUSTIFY_LEFT False False - 0.5 + 0 0.5 0 0 @@ -2205,700 +2775,830 @@ Fantasy 0 - 0 - False - False + 0 + 1 + 5 + 6 + fill + - - - - - - - - True - <b>Memory cache</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - False - - - - - - 5 - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 5 - + True - False - 3 - - - - True - Duration - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - How long to keep cached items around on disc. - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 1 0 100 1 10 10 - - - 0 - False - False - - + False + True + False + False + False + False + True + + + 1 + 2 + 1 + 2 + fill + + + - - - True - days - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - + + + True + False + True + False + False + False + False + True + + + 1 + 2 + 2 + 3 + fill + + + + + + + True + False + True + False + False + False + False + True - 0 - True - True + 1 + 2 + 3 + 4 + fill + - - 4 + True - False - 4 - - - - - - - - True - Flush cached items that are older than the maximum permitted age. - True - GTK_RELIEF_NORMAL - True - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-delete - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - False - Perform maintainance - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - 0 - False - False - - - - - - + False + True + False + False + False + False + True - 0 - False - False + 1 + 2 + 4 + 5 + fill + - - - - - - - - True - <b>Disc cache</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - True - - - - - False - True - - - - - - True - Cache - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - 0 - True - True - - - - - - - - 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 + False + Sans-serif +Sans +Monospace +Cursive +Fantasy + False + True + + + 1 + 2 + 5 + 6 + fill + fill + + - - - True - True - True - True - GTK_RELIEF_NORMAL - True - -5 - - + + + True + False + True + False + False + False + False + True + + + 1 + 2 + 0 + 1 + + + + + + + + + + + True + <b>Font faces</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + - + + 5 True - True - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 + 0 + 0.5 + GTK_SHADOW_ETCHED_IN - + True - False - 2 + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 - + True - gtk-ok - 4 - 0.5 - 0.5 - 0 - 0 + 2 + 3 + False + 3 + 3 + + + + True + Default + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Minimum + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + The base-line font size to use. + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 100 1 10 10 + + + 1 + 2 + 0 + 1 + + + + + + + + True + Do not allow text to be displayed any smaller than this. + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 100 1 10 10 + + + 1 + 2 + 1 + 2 + + + + + + + + True + pt + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 0 + 1 + + + + + + + True + pt + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 1 + 2 + + + - - 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 - - + + + True + <b>Font size</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + label_item + + + 0 + False + True + + + False + True + - - - 0 - False - True - GTK_PACK_END - - - - - - 3 - True - False - 0 - + True - 6 - gtk-dialog-authentication + Fonts + False + False + GTK_JUSTIFY_LEFT + False + False 0.5 - 0.10000000149 - 12 + 0.5 + 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 - 0 - False - False + tab - - 1 + True - 4 - 2 False - 10 - 11 + 0 - + + 5 True - True - True - True - True - 0 - sesame - True - - False - - - 1 - 2 - 2 - 3 - - - + 0 + 0.5 + GTK_SHADOW_ETCHED_IN - - - True - True - True - False - 0 - opensesame - True - * - True + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 6 + + + + True + Size + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + How much memory to use for caching recently viewed objects in memory. + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 100 1 10 10 + + + 0 + False + False + + + + + + True + MB + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + + True + <b>Memory cache</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + - 1 - 2 - 3 - 4 - + 0 + False + False - + + 5 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 - fill - - + 0 + 0.5 + GTK_SHADOW_ETCHED_IN - - - True - Realm - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 - - - True - Host - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - + + + True + False + 5 + + + + True + False + 3 + + + + True + Duration + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + How long to keep cached items around on disc. + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 100 1 10 10 + + + 0 + False + False + + + + + + True + days + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + True + True + + + + + + 4 + True + False + 4 + + + + + + + + True + Flush cached items that are older than the maximum permitted age. + True + GTK_RELIEF_NORMAL + True + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-delete + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + False + Perform maintainance + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + - - - True - Username - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - + + + + + + 0 + False + False + + + + + + - - - True - Password - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + + + True + <b>Disc cache</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + - 0 - 1 - 3 - 4 - fill + 0 + False + True + + + False + True + + - - - 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 - fill - - + + + True + Cache + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 - 1 - True - True + tab @@ -2912,11 +3612,10 @@ Fantasy - - 1 - SSL certificate problem + + Site Authentication GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE + GTK_WIN_POS_CENTER_ALWAYS False True False @@ -2930,103 +3629,45 @@ Fantasy True - + True False 0 - + True GTK_BUTTONBOX_END - + True - True True + gtk-cancel + 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 True GTK_RELIEF_NORMAL True -5 + + - + True + True + True 0.5 0.5 0 @@ -3037,15 +3678,15 @@ Fantasy 0 - + True False 2 - + True - gtk-apply + gtk-ok 4 0.5 0.5 @@ -3060,9 +3701,9 @@ Fantasy - + True - Accept + Login True False GTK_JUSTIFY_LEFT @@ -3099,19 +3740,20 @@ Fantasy - + + 3 True False 0 - + True 6 - gtk-dialog-warning + gtk-dialog-authentication 0.5 - 0 - 0 + 0.10000000149 + 12 0 @@ -3122,21 +3764,68 @@ Fantasy - + + 1 True + 4 + 2 False - 0 + 10 + 11 - + True - NetSurf failed to verify the authenticity of an SSL certificate. Please verify the details presented below. + True + True + True + True + 0 + sesame + True + + False + + + 1 + 2 + 2 + 3 + + + + + + + True + True + True + False + 0 + opensesame + True + * + True + + + 1 + 2 + 3 + 4 + + + + + + + True + my sekr3t area False False - GTK_JUSTIFY_CENTER - True + GTK_JUSTIFY_LEFT + False False - 0.5 + 0 0.5 0 0 @@ -3146,98 +3835,151 @@ Fantasy 0 - 0 - False - False + 1 + 2 + 1 + 2 + fill - - 5 + True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 + Realm + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + - - - True - True - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT + + + True + Host + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + - - - 200 - True - True - False - False - True - GTK_JUSTIFY_LEFT - GTK_WRAP_NONE - True - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - + + + True + Username + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + - - - 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 - - + + + True + Password + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 - 0 - True - True + 0 + 1 + 3 + 4 + fill + + + + + + 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 + fill - 0 + 1 True True @@ -3253,278 +3995,306 @@ Fantasy - - NetSurf + + 1 + SSL certificate problem GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER_ALWAYS + GTK_WIN_POS_NONE False True False True False False - GDK_WINDOW_TYPE_HINT_NORMAL + GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True False + True - - + + True False 0 - - + + True - GTK_ORIENTATION_HORIZONTAL - GTK_TOOLBAR_ICONS - 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 - - True - gtk-refresh - True - True - False - - - False - True - - - - - - True - - True - gtk-zoom-in - True - True - False - - - False - True - - - - - - True - - True - gtk-zoom-100 - True - True - False - - - False - True - - + GTK_BUTTONBOX_END - + True - - True - gtk-zoom-out - True - True - False - - - False - True - - + True + True + GTK_RELIEF_NORMAL + True + -6 - - - True - - True - gtk-open - True - True - False - - - False - True - - + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 - - - True - - True - gtk-preferences - True - True - False - - - False - True - - + + + True + False + 2 - - - True - True - True - False + + + True + gtk-cancel + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + - - - True - True - True - True - 0 - - True - - 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 - False - - + True - True - True - False + True + True + GTK_RELIEF_NORMAL + True + -5 - + True - 2 - stock_smiley-1 0.5 0.5 - 3 - 0 + 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 + + + + - - False - False - - - - - 0 False True + GTK_PACK_END - + True - 2 - 2 False - 0 - 0 + 0 - + True - GTK_UPDATE_CONTINUOUS - False - 0 0 100 1 10 0 + 6 + gtk-dialog-warning + 0.5 + 0 + 0 + 0 - 1 - 2 - 0 - 1 - fill + 0 + False + False - + True - 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 - False - 0 + 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 + + + + + + + - + True - Status bar text goes here + <b>Certificate chain</b> False - False + True GTK_JUSTIFY_LEFT False False @@ -3532,84 +4302,27 @@ Fantasy 0.5 0 0 - PANGO_ELLIPSIZE_MIDDLE + PANGO_ELLIPSIZE_NONE -1 False 0 - 0 - True - True + label_item - True - False - - - - - - True - GTK_UPDATE_CONTINUOUS - False - 0 0 100 1 10 0 - - - True - True + 0 + True + True - 0 - 1 - 1 - 2 - fill - - - - - - True - 1 - gtk-close - 0.5 - 0.5 - 0 - 0 - - - 1 - 2 - 1 - 2 - fill - fill - - - - - - True - GTK_SHADOW_NONE - - - - True - - - - - 0 - 1 - 0 - 1 - fill - fill + 0 + True + True diff --git a/gtk/throbber.gif b/gtk/throbber.gif new file mode 100644 index 000000000..f9d0c152d Binary files /dev/null and b/gtk/throbber.gif differ -- cgit v1.2.3