netsurf: branch master updated. release/3.0-205-ga93e32d
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/a93e32de3767ade3931aa...
...commit http://git.netsurf-browser.org/netsurf.git/commit/a93e32de3767ade3931aaf6...
...tree http://git.netsurf-browser.org/netsurf.git/tree/a93e32de3767ade3931aaf661...
The branch, master has been updated
via a93e32de3767ade3931aaf661a720f53e7a27f90 (commit)
from 2f280f16eb7e6ed9317f4bdf7aa818c53925fd9b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=a93e32de3767ade3931...
commit a93e32de3767ade3931aaf661a720f53e7a27f90
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
work round missing functionality
diff --git a/gtk/compat.h b/gtk/compat.h
index ff3222c..b8c91d9 100644
--- a/gtk/compat.h
+++ b/gtk/compat.h
@@ -56,6 +56,17 @@ typedef enum {
#if !GTK_CHECK_VERSION(3,0,0)
typedef GtkStateType GtkStateFlags;
typedef GtkStyle GtkStyleContext;
+
+#if GTK_CHECK_VERSION(2,22,0)
+enum {
+ GTK_IN_DESTRUCTION = 1 << 0,
+};
+#define GTK_OBJECT_FLAGS(obj) (GTK_OBJECT (obj)->flags)
+#endif
+
+#define gtk_widget_in_destruction(widget) \
+ (GTK_OBJECT_FLAGS(GTK_OBJECT(widget)) & GTK_IN_DESTRUCTION)
+
#endif
GtkWidget *nsgtk_entry_new(void);
-----------------------------------------------------------------------
Summary of changes:
gtk/compat.h | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/gtk/compat.h b/gtk/compat.h
index ff3222c..b8c91d9 100644
--- a/gtk/compat.h
+++ b/gtk/compat.h
@@ -56,6 +56,17 @@ typedef enum {
#if !GTK_CHECK_VERSION(3,0,0)
typedef GtkStateType GtkStateFlags;
typedef GtkStyle GtkStyleContext;
+
+#if GTK_CHECK_VERSION(2,22,0)
+enum {
+ GTK_IN_DESTRUCTION = 1 << 0,
+};
+#define GTK_OBJECT_FLAGS(obj) (GTK_OBJECT (obj)->flags)
+#endif
+
+#define gtk_widget_in_destruction(widget) \
+ (GTK_OBJECT_FLAGS(GTK_OBJECT(widget)) & GTK_IN_DESTRUCTION)
+
#endif
GtkWidget *nsgtk_entry_new(void);
--
NetSurf Browser
10 years, 2 months
netsurf: branch master updated. release/3.0-204-g2f280f1
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/2f280f16eb7e6ed9317f4...
...commit http://git.netsurf-browser.org/netsurf.git/commit/2f280f16eb7e6ed9317f4bd...
...tree http://git.netsurf-browser.org/netsurf.git/tree/2f280f16eb7e6ed9317f4bdf7...
The branch, master has been updated
via 2f280f16eb7e6ed9317f4bdf7aa818c53925fd9b (commit)
from 3d7f79683c770a197e9d67aee840b76dde422e11 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=2f280f16eb7e6ed9317...
commit 2f280f16eb7e6ed9317f4bdf7aa818c53925fd9b
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
completely rework scaffolding window destruction using gtkwidget destroy signals
diff --git a/gtk/scaffolding.c b/gtk/scaffolding.c
index 5a95844..b10fb69 100644
--- a/gtk/scaffolding.c
+++ b/gtk/scaffolding.c
@@ -139,7 +139,6 @@ struct gtk_scaffolding {
int throb_frame;
struct gui_window *top_level;
- int being_destroyed;
bool fullscreen;
@@ -147,9 +146,6 @@ struct gtk_scaffolding {
struct gtk_scaffolding *next, *prev;
};
-/** current number of open browser windows */
-static int open_windows = 0;
-
/** current window for model dialogue use */
static struct gtk_scaffolding *current_model;
@@ -251,60 +247,57 @@ static void popup_menu_show(struct nsgtk_popup_submenu *menu, bool submenu,
/* event handlers and support functions for them */
/**
- * resource cleanup function for window closure.
+ * resource cleanup function for window destruction.
*/
-static void nsgtk_window_close(struct gtk_scaffolding *g)
+static void scaffolding_window_destroy(GtkWidget *widget, gpointer data)
{
- /* close all tabs first */
- gint numbertabs = gtk_notebook_get_n_pages(g->notebook);
- while (numbertabs-- > 1) {
- nsgtk_tab_close_current(g->notebook);
- }
- LOG(("Being Destroyed = %d", g->being_destroyed));
+ struct gtk_scaffolding *gs = data;
- if ((g->history_window) && (g->history_window->window)) {
- gtk_widget_destroy(GTK_WIDGET(g->history_window->window));
- }
+ LOG(("scaffold:%p", gs));
- if (--open_windows == 0)
- netsurf_quit = true;
+ if ((gs->history_window) && (gs->history_window->window)) {
+ gtk_widget_destroy(GTK_WIDGET(gs->history_window->window));
+ }
- if (!g->being_destroyed) {
- g->being_destroyed = 1;
- nsgtk_window_destroy_browser(g->top_level);
+ if (gs->prev != NULL) {
+ gs->prev->next = gs->next;
+ } else {
+ scaf_list = gs->next;
+ }
+ if (gs->next != NULL) {
+ gs->next->prev = gs->prev;
}
- if (g->prev != NULL)
- g->prev->next = g->next;
- else
- scaf_list = g->next;
- if (g->next != NULL)
- g->next->prev = g->prev;
+ LOG(("scaffold list head: %p", scaf_list));
+ if (scaf_list == NULL) {
+ /* no more open windows */
+ netsurf_quit = true;
+ }
}
-static gboolean nsgtk_window_delete_event(GtkWidget *widget,
+/* signal delivered on window delete event, allowing to halt close if
+ * download is in progress
+ */
+static gboolean scaffolding_window_delete_event(GtkWidget *widget,
GdkEvent *event, gpointer data)
{
- struct gtk_scaffolding *g = (struct gtk_scaffolding *)data;
- if ((open_windows != 1) ||
- nsgtk_check_for_downloads(GTK_WINDOW(widget)) == false) {
- nsgtk_window_close(g);
+ struct gtk_scaffolding *g = data;
+
+ if (nsgtk_check_for_downloads(GTK_WINDOW(widget)) == false) {
gtk_widget_destroy(GTK_WIDGET(g->window));
}
return TRUE;
}
/* exported interface documented in gtk_scaffold.h */
-void nsgtk_scaffolding_destroy(nsgtk_scaffolding *g)
+void nsgtk_scaffolding_destroy(nsgtk_scaffolding *gs)
{
- /* Our top_level has asked us to die */
- LOG(("Being Destroyed = %d", g->being_destroyed));
- if (g->being_destroyed) return;
- g->being_destroyed = 1;
- nsgtk_window_close(g);
- /* We're now unlinked, so let's finally destroy ourselves */
- nsgtk_window_destroy_browser(g->top_level);
+ LOG(("scaffold: %p", gs));
+
+ if (gtk_widget_in_destruction(GTK_WIDGET(gs->window)) != TRUE) {
+ gtk_widget_destroy(GTK_WIDGET(gs->window));
+ }
}
/**
@@ -522,21 +515,32 @@ static void nsgtk_window_tabs_add(GtkNotebook *notebook,
/**
* Update the menus when the number of tabs changes.
*/
-static void nsgtk_window_tabs_remove(GtkNotebook *notebook,
- GtkWidget *page, guint page_num, struct gtk_scaffolding *g)
-{
+static void
+nsgtk_window_tabs_remove(GtkNotebook *notebook,
+ GtkWidget *page,
+ guint page_num,
+ struct gtk_scaffolding *gs)
+{
+ /* if the scaffold is being destroyed it is not useful to
+ * update the state, futher many of the widgets may have
+ * already been destroyed.
+ */
+ if (gtk_widget_in_destruction(GTK_WIDGET(gs->window)) == TRUE) {
+ return;
+ }
- if (gtk_notebook_get_n_pages(notebook) == 0) {
- nsgtk_scaffolding_destroy(g);
- } else {
- gboolean visible = gtk_notebook_get_show_tabs(g->notebook);
- g_object_set(g->menu_bar->view_submenu->tabs_menuitem, "visible", visible, NULL);
- g_object_set(g->menu_popup->view_submenu->tabs_menuitem, "visible", visible, NULL);
- g->buttons[NEXTTAB_BUTTON]->sensitivity = visible;
- g->buttons[PREVTAB_BUTTON]->sensitivity = visible;
- g->buttons[CLOSETAB_BUTTON]->sensitivity = visible;
- nsgtk_scaffolding_set_sensitivity(g);
+ if (gtk_notebook_get_n_pages(notebook) == 1) {
+ nsgtk_scaffolding_destroy(gs);
+ return;
}
+
+ gboolean visible = gtk_notebook_get_show_tabs(gs->notebook);
+ g_object_set(gs->menu_bar->view_submenu->tabs_menuitem, "visible", visible, NULL);
+ g_object_set(gs->menu_popup->view_submenu->tabs_menuitem, "visible", visible, NULL);
+ gs->buttons[NEXTTAB_BUTTON]->sensitivity = visible;
+ gs->buttons[PREVTAB_BUTTON]->sensitivity = visible;
+ gs->buttons[CLOSETAB_BUTTON]->sensitivity = visible;
+ nsgtk_scaffolding_set_sensitivity(gs);
}
/**
@@ -639,7 +643,8 @@ nserror nsgtk_scaffolding_new_tab(struct gui_window *gw)
MULTIHANDLER(newtab)
{
nserror error;
- nsgtk_scaffolding_new_tab(g->top_level);
+
+ error = nsgtk_scaffolding_new_tab(g->top_level);
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
}
@@ -947,7 +952,6 @@ MULTIHANDLER(print)
MULTIHANDLER(closewindow)
{
- nsgtk_window_close(g);
gtk_widget_destroy(GTK_WIDGET(g->window));
return TRUE;
}
@@ -1842,12 +1846,13 @@ static bool nsgtk_new_scaffolding_popup(struct gtk_scaffolding *g, GtkAccelGroup
nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
{
- struct gtk_scaffolding *g = malloc(sizeof(*g));
+ struct gtk_scaffolding *g;
char *searchname;
int i;
GtkAccelGroup *group;
GError* error = NULL;
+ g = malloc(sizeof(*g));
if (g == NULL) {
warn_user("NoMemory", 0);
return NULL;
@@ -1857,8 +1862,6 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
g->top_level = toplevel;
- open_windows++;
-
/* load the window template from the glade xml file, and extract
* widget references from it for later use.
*/
@@ -2083,8 +2086,9 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
g_signal_connect_after(g->notebook, "page-removed",
G_CALLBACK(nsgtk_window_tabs_remove), g);
- /* connect signals to handlers. */
- CONNECT(g->window, "delete-event", nsgtk_window_delete_event, g);
+ /* connect main window signals to their handlers. */
+ CONNECT(g->window, "delete-event", scaffolding_window_delete_event, g);
+ CONNECT(g->window, "destroy", scaffolding_window_destroy, g);
/* toolbar URL bar menu bar search bar signal handlers */
CONNECT(g->menu_bar->edit_submenu->edit, "show", nsgtk_window_edit_menu_clicked, g);
@@ -2132,8 +2136,6 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
nsgtk_scaffolding_initial_sensitivity(g);
- g->being_destroyed = 0;
-
g->fullscreen = false;
@@ -2469,8 +2471,10 @@ void nsgtk_scaffolding_set_top_level(struct gui_window *gw)
}
}
+/* exported interface documented in scaffolding.h */
void nsgtk_scaffolding_set_sensitivity(struct gtk_scaffolding *g)
{
+ int i;
#define SENSITIVITY(q)\
i = q##_BUTTON;\
if (g->buttons[i]->main != NULL)\
@@ -2491,7 +2495,6 @@ void nsgtk_scaffolding_set_sensitivity(struct gtk_scaffolding *g)
g->buttons[i]->popup),\
g->buttons[i]->sensitivity);
- int i;
SENSITIVITY(STOP)
SENSITIVITY(RELOAD)
SENSITIVITY(CUT)
diff --git a/gtk/scaffolding.h b/gtk/scaffolding.h
index e6426de..79e3fa0 100644
--- a/gtk/scaffolding.h
+++ b/gtk/scaffolding.h
@@ -144,7 +144,27 @@ void nsgtk_scaffolding_set_top_level(struct gui_window *g);
void nsgtk_scaffolding_destroy(nsgtk_scaffolding *g);
+/** update the sensitivity of context sensitive UI elements
+ *
+ * widgets altered in arrays:
+ * main
+ * right click menu
+ * location
+ * popup
+ * current arrays are:
+ * stop
+ * reload
+ * cut
+ * copy
+ * paste
+ * back
+ * forward
+ * nexttab
+ * prevtab
+ * closetab
+ */
void nsgtk_scaffolding_set_sensitivity(struct gtk_scaffolding *g);
+
void nsgtk_scaffolding_initial_sensitivity(struct gtk_scaffolding *g);
void nsgtk_scaffolding_popup_menu(struct gtk_scaffolding *g, gdouble x,
gdouble y);
diff --git a/gtk/tabs.c b/gtk/tabs.c
index b275f12..c5ef6fe 100644
--- a/gtk/tabs.c
+++ b/gtk/tabs.c
@@ -115,7 +115,7 @@ static GtkWidget *nsgtk_tab_label_setup(struct gui_window *window)
/** callback when page is switched */
-static gint srcpagenum;
+static gint srcpagenum;
/** The switch-page signal handler
*
@@ -146,7 +146,8 @@ nsgtk_tab_switch_page_after(GtkNotebook *notebook,
addpage = g_object_get_data(G_OBJECT(notebook), "addtab");
if (selpage == addpage) {
- if ((srcpagenum != -1) && (srcpagenum != selpagenum)) {
+ if ((srcpagenum != -1) &&
+ (srcpagenum != (gint)selpagenum)) {
/* ensure the add tab is not actually selected */
LOG(("src %d sel %d",srcpagenum,selpagenum ));
srcpage = gtk_notebook_get_nth_page(notebook, srcpagenum);
@@ -176,7 +177,8 @@ static void nsgtk_tab_page_reordered(GtkNotebook *notebook,
pages = gtk_notebook_get_n_pages(notebook);
addpage = g_object_get_data(G_OBJECT(notebook), "addtab");
- if ((page_num == (pages - 1)) && (child != addpage)) {
+ if (((gint)page_num == (pages - 1)) &&
+ (child != addpage)) {
/* moved tab to end */
gtk_notebook_reorder_child(notebook, addpage, -1);
}
@@ -242,7 +244,7 @@ nsgtk_tab_visibility_update(GtkNotebook *notebook, GtkWidget *child, guint page)
if (addpage != NULL) {
pagec--; /* skip the add tab */
- if (page == pagec) {
+ if ((gint)page == pagec) {
/* ensure the add new tab cannot be current */
gtk_notebook_set_current_page(notebook, page - 1);
}
@@ -289,40 +291,42 @@ void nsgtk_tab_init(struct gtk_scaffolding *gs)
}
/* exported interface documented in gtk/tabs.h */
-void nsgtk_tab_add(struct gui_window *window,
+void nsgtk_tab_add(struct gui_window *gw,
GtkWidget *tab_contents,
bool background)
{
- GtkNotebook *tabs;
+ GtkNotebook *notebook;
GtkWidget *tabBox;
gint remember;
gint pages;
gint newpage;
- tabs = nsgtk_scaffolding_notebook(nsgtk_get_scaffold(window));
+ g_object_set_data(G_OBJECT(tab_contents), "gui_window", gw);
+
+ notebook = nsgtk_scaffolding_notebook(nsgtk_get_scaffold(gw));
- tabBox = nsgtk_tab_label_setup(window);
+ tabBox = nsgtk_tab_label_setup(gw);
- nsgtk_window_set_tab(window, tabBox);
+ nsgtk_window_set_tab(gw, tabBox);
- remember = gtk_notebook_get_current_page(tabs);
+ remember = gtk_notebook_get_current_page(notebook);
- pages = gtk_notebook_get_n_pages(tabs);
+ pages = gtk_notebook_get_n_pages(notebook);
- newpage = gtk_notebook_insert_page(tabs, tab_contents, tabBox, pages - 1);
+ newpage = gtk_notebook_insert_page(notebook, tab_contents, tabBox, pages - 1);
- gtk_notebook_set_tab_reorderable(tabs, tab_contents, true);
+ gtk_notebook_set_tab_reorderable(notebook, tab_contents, true);
gtk_widget_show_all(tab_contents);
if (background) {
- gtk_notebook_set_current_page(tabs, remember);
+ gtk_notebook_set_current_page(notebook, remember);
} else {
- gtk_notebook_set_current_page(tabs, newpage);
+ gtk_notebook_set_current_page(notebook, newpage);
}
gtk_widget_grab_focus(GTK_WIDGET(nsgtk_scaffolding_urlbar(
- nsgtk_get_scaffold(window))));
+ nsgtk_get_scaffold(gw))));
}
/* exported interface documented in gtk/tabs.h */
@@ -370,7 +374,7 @@ nserror nsgtk_tab_close_current(GtkNotebook *notebook)
if (gw == NULL) {
return NSERROR_OK;
}
-
+
nsgtk_window_destroy_browser(gw);
return NSERROR_OK;
diff --git a/gtk/window.c b/gtk/window.c
index 43908ba..34d7a4c 100644
--- a/gtk/window.c
+++ b/gtk/window.c
@@ -78,6 +78,9 @@ struct gui_window {
/** previous event location */
int last_x, last_y;
+ /** The top level container (tabContents) */
+ GtkWidget *container;
+
/** display widget for this page or frame */
GtkLayout *layout;
@@ -644,6 +647,14 @@ static gboolean nsgtk_paned_size_allocate_event(GtkWidget *widget,
return TRUE;
}
+/* destroy the browsing context as there is nothing to display it now */
+static void window_destroy(GtkWidget *widget, gpointer data)
+{
+ struct gui_window *gw = data;
+
+ browser_window_destroy(gw->bw);
+}
+
/* Core interface docuemnted in desktop/gui.h to create a gui_window */
struct gui_window *gui_create_browser_window(struct browser_window *bw,
struct browser_window *clone,
@@ -651,6 +662,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
{
struct gui_window *g; /**< what we're creating to return */
GError* error = NULL;
+ bool tempback;
g = calloc(1, sizeof(*g));
if (!g) {
@@ -685,7 +697,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
/* Construct our primary elements */
- /* top-level document (not a frame) => create a new tab */
+ /* top-level document create a new tab */
GtkBuilder* xml = gtk_builder_new();
if (!gtk_builder_add_from_file(xml,
glade_file_location->tabcontents,
@@ -695,33 +707,16 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
return 0;
}
+ g->container = GTK_WIDGET(gtk_builder_get_object(xml, "tabContents"));
g->layout = GTK_LAYOUT(gtk_builder_get_object(xml, "layout"));
g->status_bar = GTK_LABEL(gtk_builder_get_object(xml, "status_bar"));
g->paned = GTK_PANED(gtk_builder_get_object(xml, "hpaned1"));
- /* add the tab to the scaffold */
- bool tempback = true;
- switch (temp_open_background) {
- case -1:
- tempback = !(nsoption_bool(focus_new));
- break;
- case 0:
- tempback = false;
- break;
- case 1:
- tempback = true;
- break;
- }
-
- GtkWidget *tab_contents = GTK_WIDGET(gtk_builder_get_object(xml, "tabContents"));
- g_object_set_data(G_OBJECT(tab_contents), "gui_window", g);
- nsgtk_tab_add(g, tab_contents, tempback);
-
- g_object_unref(xml);
- /* Attach ourselves to the list (push_top) */
- if (window_list)
+ /* add new gui window to global list (push_top) */
+ if (window_list) {
window_list->prev = g;
+ }
g->next = window_list;
g->prev = NULL;
window_list = g;
@@ -743,8 +738,8 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
/* set the default background colour of the drawing area to white. */
nsgtk_widget_override_background_color(GTK_WIDGET(g->layout),
- GTK_STATE_NORMAL, 0, 0xffff, 0xffff, 0xffff);
-
+ GTK_STATE_NORMAL,
+ 0, 0xffff, 0xffff, 0xffff);
nsgtk_connect_draw_event(GTK_WIDGET(g->layout),
G_CALLBACK(nsgtk_window_draw_event), g);
@@ -771,6 +766,29 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
CONNECT(g->paned, "notify::position",
nsgtk_paned_notify__position, g);
+ /* gtk container destructor */
+ CONNECT(g->container, "destroy",
+ window_destroy, g);
+
+ /* add the tab container to the scaffold notebook */
+ switch (temp_open_background) {
+ case -1:
+ tempback = !(nsoption_bool(focus_new));
+ break;
+ case 0:
+ tempback = false;
+ break;
+ default:
+ tempback = true;
+ break;
+ }
+ nsgtk_tab_add(g, g->container, tempback);
+
+ /* safe to drop the reference to the xml as the container is
+ * referenced by the notebook now.
+ */
+ g_object_unref(xml);
+
return g;
}
@@ -811,31 +829,30 @@ void nsgtk_window_process_reformats(void)
}
}
-
void nsgtk_window_destroy_browser(struct gui_window *gw)
{
- browser_window_destroy(gw->bw);
+ /* remove tab */
+ gtk_widget_destroy(gw->container);
}
void gui_window_destroy(struct gui_window *g)
{
- if (g->prev)
+ LOG(("gui_window: %p", g));
+ assert(g != NULL);
+ assert(g->bw != NULL);
+ LOG(("scaffolding: %p", g->scaffold));
+
+ if (g->prev) {
g->prev->next = g->next;
- else
+ } else {
window_list = g->next;
+ }
- if (g->next)
+ if (g->next) {
g->next->prev = g->prev;
+ }
-
- LOG(("Destroying gui_window %p", g));
- assert(g != NULL);
- assert(g->bw != NULL);
- LOG((" Scaffolding: %p", g->scaffold));
- LOG((" Window name: %s", g->bw->name));
-
- /* tab => remove tab */
- gtk_widget_destroy(gtk_widget_get_parent(GTK_WIDGET(g->layout)));
+ LOG(("window list head: %p", window_list));
}
/**
-----------------------------------------------------------------------
Summary of changes:
gtk/scaffolding.c | 127 +++++++++++++++++++++++++++--------------------------
gtk/scaffolding.h | 20 ++++++++
gtk/tabs.c | 38 +++++++++-------
gtk/window.c | 93 +++++++++++++++++++++++----------------
4 files changed, 161 insertions(+), 117 deletions(-)
diff --git a/gtk/scaffolding.c b/gtk/scaffolding.c
index 5a95844..b10fb69 100644
--- a/gtk/scaffolding.c
+++ b/gtk/scaffolding.c
@@ -139,7 +139,6 @@ struct gtk_scaffolding {
int throb_frame;
struct gui_window *top_level;
- int being_destroyed;
bool fullscreen;
@@ -147,9 +146,6 @@ struct gtk_scaffolding {
struct gtk_scaffolding *next, *prev;
};
-/** current number of open browser windows */
-static int open_windows = 0;
-
/** current window for model dialogue use */
static struct gtk_scaffolding *current_model;
@@ -251,60 +247,57 @@ static void popup_menu_show(struct nsgtk_popup_submenu *menu, bool submenu,
/* event handlers and support functions for them */
/**
- * resource cleanup function for window closure.
+ * resource cleanup function for window destruction.
*/
-static void nsgtk_window_close(struct gtk_scaffolding *g)
+static void scaffolding_window_destroy(GtkWidget *widget, gpointer data)
{
- /* close all tabs first */
- gint numbertabs = gtk_notebook_get_n_pages(g->notebook);
- while (numbertabs-- > 1) {
- nsgtk_tab_close_current(g->notebook);
- }
- LOG(("Being Destroyed = %d", g->being_destroyed));
+ struct gtk_scaffolding *gs = data;
- if ((g->history_window) && (g->history_window->window)) {
- gtk_widget_destroy(GTK_WIDGET(g->history_window->window));
- }
+ LOG(("scaffold:%p", gs));
- if (--open_windows == 0)
- netsurf_quit = true;
+ if ((gs->history_window) && (gs->history_window->window)) {
+ gtk_widget_destroy(GTK_WIDGET(gs->history_window->window));
+ }
- if (!g->being_destroyed) {
- g->being_destroyed = 1;
- nsgtk_window_destroy_browser(g->top_level);
+ if (gs->prev != NULL) {
+ gs->prev->next = gs->next;
+ } else {
+ scaf_list = gs->next;
+ }
+ if (gs->next != NULL) {
+ gs->next->prev = gs->prev;
}
- if (g->prev != NULL)
- g->prev->next = g->next;
- else
- scaf_list = g->next;
- if (g->next != NULL)
- g->next->prev = g->prev;
+ LOG(("scaffold list head: %p", scaf_list));
+ if (scaf_list == NULL) {
+ /* no more open windows */
+ netsurf_quit = true;
+ }
}
-static gboolean nsgtk_window_delete_event(GtkWidget *widget,
+/* signal delivered on window delete event, allowing to halt close if
+ * download is in progress
+ */
+static gboolean scaffolding_window_delete_event(GtkWidget *widget,
GdkEvent *event, gpointer data)
{
- struct gtk_scaffolding *g = (struct gtk_scaffolding *)data;
- if ((open_windows != 1) ||
- nsgtk_check_for_downloads(GTK_WINDOW(widget)) == false) {
- nsgtk_window_close(g);
+ struct gtk_scaffolding *g = data;
+
+ if (nsgtk_check_for_downloads(GTK_WINDOW(widget)) == false) {
gtk_widget_destroy(GTK_WIDGET(g->window));
}
return TRUE;
}
/* exported interface documented in gtk_scaffold.h */
-void nsgtk_scaffolding_destroy(nsgtk_scaffolding *g)
+void nsgtk_scaffolding_destroy(nsgtk_scaffolding *gs)
{
- /* Our top_level has asked us to die */
- LOG(("Being Destroyed = %d", g->being_destroyed));
- if (g->being_destroyed) return;
- g->being_destroyed = 1;
- nsgtk_window_close(g);
- /* We're now unlinked, so let's finally destroy ourselves */
- nsgtk_window_destroy_browser(g->top_level);
+ LOG(("scaffold: %p", gs));
+
+ if (gtk_widget_in_destruction(GTK_WIDGET(gs->window)) != TRUE) {
+ gtk_widget_destroy(GTK_WIDGET(gs->window));
+ }
}
/**
@@ -522,21 +515,32 @@ static void nsgtk_window_tabs_add(GtkNotebook *notebook,
/**
* Update the menus when the number of tabs changes.
*/
-static void nsgtk_window_tabs_remove(GtkNotebook *notebook,
- GtkWidget *page, guint page_num, struct gtk_scaffolding *g)
-{
+static void
+nsgtk_window_tabs_remove(GtkNotebook *notebook,
+ GtkWidget *page,
+ guint page_num,
+ struct gtk_scaffolding *gs)
+{
+ /* if the scaffold is being destroyed it is not useful to
+ * update the state, futher many of the widgets may have
+ * already been destroyed.
+ */
+ if (gtk_widget_in_destruction(GTK_WIDGET(gs->window)) == TRUE) {
+ return;
+ }
- if (gtk_notebook_get_n_pages(notebook) == 0) {
- nsgtk_scaffolding_destroy(g);
- } else {
- gboolean visible = gtk_notebook_get_show_tabs(g->notebook);
- g_object_set(g->menu_bar->view_submenu->tabs_menuitem, "visible", visible, NULL);
- g_object_set(g->menu_popup->view_submenu->tabs_menuitem, "visible", visible, NULL);
- g->buttons[NEXTTAB_BUTTON]->sensitivity = visible;
- g->buttons[PREVTAB_BUTTON]->sensitivity = visible;
- g->buttons[CLOSETAB_BUTTON]->sensitivity = visible;
- nsgtk_scaffolding_set_sensitivity(g);
+ if (gtk_notebook_get_n_pages(notebook) == 1) {
+ nsgtk_scaffolding_destroy(gs);
+ return;
}
+
+ gboolean visible = gtk_notebook_get_show_tabs(gs->notebook);
+ g_object_set(gs->menu_bar->view_submenu->tabs_menuitem, "visible", visible, NULL);
+ g_object_set(gs->menu_popup->view_submenu->tabs_menuitem, "visible", visible, NULL);
+ gs->buttons[NEXTTAB_BUTTON]->sensitivity = visible;
+ gs->buttons[PREVTAB_BUTTON]->sensitivity = visible;
+ gs->buttons[CLOSETAB_BUTTON]->sensitivity = visible;
+ nsgtk_scaffolding_set_sensitivity(gs);
}
/**
@@ -639,7 +643,8 @@ nserror nsgtk_scaffolding_new_tab(struct gui_window *gw)
MULTIHANDLER(newtab)
{
nserror error;
- nsgtk_scaffolding_new_tab(g->top_level);
+
+ error = nsgtk_scaffolding_new_tab(g->top_level);
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
}
@@ -947,7 +952,6 @@ MULTIHANDLER(print)
MULTIHANDLER(closewindow)
{
- nsgtk_window_close(g);
gtk_widget_destroy(GTK_WIDGET(g->window));
return TRUE;
}
@@ -1842,12 +1846,13 @@ static bool nsgtk_new_scaffolding_popup(struct gtk_scaffolding *g, GtkAccelGroup
nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
{
- struct gtk_scaffolding *g = malloc(sizeof(*g));
+ struct gtk_scaffolding *g;
char *searchname;
int i;
GtkAccelGroup *group;
GError* error = NULL;
+ g = malloc(sizeof(*g));
if (g == NULL) {
warn_user("NoMemory", 0);
return NULL;
@@ -1857,8 +1862,6 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
g->top_level = toplevel;
- open_windows++;
-
/* load the window template from the glade xml file, and extract
* widget references from it for later use.
*/
@@ -2083,8 +2086,9 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
g_signal_connect_after(g->notebook, "page-removed",
G_CALLBACK(nsgtk_window_tabs_remove), g);
- /* connect signals to handlers. */
- CONNECT(g->window, "delete-event", nsgtk_window_delete_event, g);
+ /* connect main window signals to their handlers. */
+ CONNECT(g->window, "delete-event", scaffolding_window_delete_event, g);
+ CONNECT(g->window, "destroy", scaffolding_window_destroy, g);
/* toolbar URL bar menu bar search bar signal handlers */
CONNECT(g->menu_bar->edit_submenu->edit, "show", nsgtk_window_edit_menu_clicked, g);
@@ -2132,8 +2136,6 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
nsgtk_scaffolding_initial_sensitivity(g);
- g->being_destroyed = 0;
-
g->fullscreen = false;
@@ -2469,8 +2471,10 @@ void nsgtk_scaffolding_set_top_level(struct gui_window *gw)
}
}
+/* exported interface documented in scaffolding.h */
void nsgtk_scaffolding_set_sensitivity(struct gtk_scaffolding *g)
{
+ int i;
#define SENSITIVITY(q)\
i = q##_BUTTON;\
if (g->buttons[i]->main != NULL)\
@@ -2491,7 +2495,6 @@ void nsgtk_scaffolding_set_sensitivity(struct gtk_scaffolding *g)
g->buttons[i]->popup),\
g->buttons[i]->sensitivity);
- int i;
SENSITIVITY(STOP)
SENSITIVITY(RELOAD)
SENSITIVITY(CUT)
diff --git a/gtk/scaffolding.h b/gtk/scaffolding.h
index e6426de..79e3fa0 100644
--- a/gtk/scaffolding.h
+++ b/gtk/scaffolding.h
@@ -144,7 +144,27 @@ void nsgtk_scaffolding_set_top_level(struct gui_window *g);
void nsgtk_scaffolding_destroy(nsgtk_scaffolding *g);
+/** update the sensitivity of context sensitive UI elements
+ *
+ * widgets altered in arrays:
+ * main
+ * right click menu
+ * location
+ * popup
+ * current arrays are:
+ * stop
+ * reload
+ * cut
+ * copy
+ * paste
+ * back
+ * forward
+ * nexttab
+ * prevtab
+ * closetab
+ */
void nsgtk_scaffolding_set_sensitivity(struct gtk_scaffolding *g);
+
void nsgtk_scaffolding_initial_sensitivity(struct gtk_scaffolding *g);
void nsgtk_scaffolding_popup_menu(struct gtk_scaffolding *g, gdouble x,
gdouble y);
diff --git a/gtk/tabs.c b/gtk/tabs.c
index b275f12..c5ef6fe 100644
--- a/gtk/tabs.c
+++ b/gtk/tabs.c
@@ -115,7 +115,7 @@ static GtkWidget *nsgtk_tab_label_setup(struct gui_window *window)
/** callback when page is switched */
-static gint srcpagenum;
+static gint srcpagenum;
/** The switch-page signal handler
*
@@ -146,7 +146,8 @@ nsgtk_tab_switch_page_after(GtkNotebook *notebook,
addpage = g_object_get_data(G_OBJECT(notebook), "addtab");
if (selpage == addpage) {
- if ((srcpagenum != -1) && (srcpagenum != selpagenum)) {
+ if ((srcpagenum != -1) &&
+ (srcpagenum != (gint)selpagenum)) {
/* ensure the add tab is not actually selected */
LOG(("src %d sel %d",srcpagenum,selpagenum ));
srcpage = gtk_notebook_get_nth_page(notebook, srcpagenum);
@@ -176,7 +177,8 @@ static void nsgtk_tab_page_reordered(GtkNotebook *notebook,
pages = gtk_notebook_get_n_pages(notebook);
addpage = g_object_get_data(G_OBJECT(notebook), "addtab");
- if ((page_num == (pages - 1)) && (child != addpage)) {
+ if (((gint)page_num == (pages - 1)) &&
+ (child != addpage)) {
/* moved tab to end */
gtk_notebook_reorder_child(notebook, addpage, -1);
}
@@ -242,7 +244,7 @@ nsgtk_tab_visibility_update(GtkNotebook *notebook, GtkWidget *child, guint page)
if (addpage != NULL) {
pagec--; /* skip the add tab */
- if (page == pagec) {
+ if ((gint)page == pagec) {
/* ensure the add new tab cannot be current */
gtk_notebook_set_current_page(notebook, page - 1);
}
@@ -289,40 +291,42 @@ void nsgtk_tab_init(struct gtk_scaffolding *gs)
}
/* exported interface documented in gtk/tabs.h */
-void nsgtk_tab_add(struct gui_window *window,
+void nsgtk_tab_add(struct gui_window *gw,
GtkWidget *tab_contents,
bool background)
{
- GtkNotebook *tabs;
+ GtkNotebook *notebook;
GtkWidget *tabBox;
gint remember;
gint pages;
gint newpage;
- tabs = nsgtk_scaffolding_notebook(nsgtk_get_scaffold(window));
+ g_object_set_data(G_OBJECT(tab_contents), "gui_window", gw);
+
+ notebook = nsgtk_scaffolding_notebook(nsgtk_get_scaffold(gw));
- tabBox = nsgtk_tab_label_setup(window);
+ tabBox = nsgtk_tab_label_setup(gw);
- nsgtk_window_set_tab(window, tabBox);
+ nsgtk_window_set_tab(gw, tabBox);
- remember = gtk_notebook_get_current_page(tabs);
+ remember = gtk_notebook_get_current_page(notebook);
- pages = gtk_notebook_get_n_pages(tabs);
+ pages = gtk_notebook_get_n_pages(notebook);
- newpage = gtk_notebook_insert_page(tabs, tab_contents, tabBox, pages - 1);
+ newpage = gtk_notebook_insert_page(notebook, tab_contents, tabBox, pages - 1);
- gtk_notebook_set_tab_reorderable(tabs, tab_contents, true);
+ gtk_notebook_set_tab_reorderable(notebook, tab_contents, true);
gtk_widget_show_all(tab_contents);
if (background) {
- gtk_notebook_set_current_page(tabs, remember);
+ gtk_notebook_set_current_page(notebook, remember);
} else {
- gtk_notebook_set_current_page(tabs, newpage);
+ gtk_notebook_set_current_page(notebook, newpage);
}
gtk_widget_grab_focus(GTK_WIDGET(nsgtk_scaffolding_urlbar(
- nsgtk_get_scaffold(window))));
+ nsgtk_get_scaffold(gw))));
}
/* exported interface documented in gtk/tabs.h */
@@ -370,7 +374,7 @@ nserror nsgtk_tab_close_current(GtkNotebook *notebook)
if (gw == NULL) {
return NSERROR_OK;
}
-
+
nsgtk_window_destroy_browser(gw);
return NSERROR_OK;
diff --git a/gtk/window.c b/gtk/window.c
index 43908ba..34d7a4c 100644
--- a/gtk/window.c
+++ b/gtk/window.c
@@ -78,6 +78,9 @@ struct gui_window {
/** previous event location */
int last_x, last_y;
+ /** The top level container (tabContents) */
+ GtkWidget *container;
+
/** display widget for this page or frame */
GtkLayout *layout;
@@ -644,6 +647,14 @@ static gboolean nsgtk_paned_size_allocate_event(GtkWidget *widget,
return TRUE;
}
+/* destroy the browsing context as there is nothing to display it now */
+static void window_destroy(GtkWidget *widget, gpointer data)
+{
+ struct gui_window *gw = data;
+
+ browser_window_destroy(gw->bw);
+}
+
/* Core interface docuemnted in desktop/gui.h to create a gui_window */
struct gui_window *gui_create_browser_window(struct browser_window *bw,
struct browser_window *clone,
@@ -651,6 +662,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
{
struct gui_window *g; /**< what we're creating to return */
GError* error = NULL;
+ bool tempback;
g = calloc(1, sizeof(*g));
if (!g) {
@@ -685,7 +697,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
/* Construct our primary elements */
- /* top-level document (not a frame) => create a new tab */
+ /* top-level document create a new tab */
GtkBuilder* xml = gtk_builder_new();
if (!gtk_builder_add_from_file(xml,
glade_file_location->tabcontents,
@@ -695,33 +707,16 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
return 0;
}
+ g->container = GTK_WIDGET(gtk_builder_get_object(xml, "tabContents"));
g->layout = GTK_LAYOUT(gtk_builder_get_object(xml, "layout"));
g->status_bar = GTK_LABEL(gtk_builder_get_object(xml, "status_bar"));
g->paned = GTK_PANED(gtk_builder_get_object(xml, "hpaned1"));
- /* add the tab to the scaffold */
- bool tempback = true;
- switch (temp_open_background) {
- case -1:
- tempback = !(nsoption_bool(focus_new));
- break;
- case 0:
- tempback = false;
- break;
- case 1:
- tempback = true;
- break;
- }
-
- GtkWidget *tab_contents = GTK_WIDGET(gtk_builder_get_object(xml, "tabContents"));
- g_object_set_data(G_OBJECT(tab_contents), "gui_window", g);
- nsgtk_tab_add(g, tab_contents, tempback);
-
- g_object_unref(xml);
- /* Attach ourselves to the list (push_top) */
- if (window_list)
+ /* add new gui window to global list (push_top) */
+ if (window_list) {
window_list->prev = g;
+ }
g->next = window_list;
g->prev = NULL;
window_list = g;
@@ -743,8 +738,8 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
/* set the default background colour of the drawing area to white. */
nsgtk_widget_override_background_color(GTK_WIDGET(g->layout),
- GTK_STATE_NORMAL, 0, 0xffff, 0xffff, 0xffff);
-
+ GTK_STATE_NORMAL,
+ 0, 0xffff, 0xffff, 0xffff);
nsgtk_connect_draw_event(GTK_WIDGET(g->layout),
G_CALLBACK(nsgtk_window_draw_event), g);
@@ -771,6 +766,29 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
CONNECT(g->paned, "notify::position",
nsgtk_paned_notify__position, g);
+ /* gtk container destructor */
+ CONNECT(g->container, "destroy",
+ window_destroy, g);
+
+ /* add the tab container to the scaffold notebook */
+ switch (temp_open_background) {
+ case -1:
+ tempback = !(nsoption_bool(focus_new));
+ break;
+ case 0:
+ tempback = false;
+ break;
+ default:
+ tempback = true;
+ break;
+ }
+ nsgtk_tab_add(g, g->container, tempback);
+
+ /* safe to drop the reference to the xml as the container is
+ * referenced by the notebook now.
+ */
+ g_object_unref(xml);
+
return g;
}
@@ -811,31 +829,30 @@ void nsgtk_window_process_reformats(void)
}
}
-
void nsgtk_window_destroy_browser(struct gui_window *gw)
{
- browser_window_destroy(gw->bw);
+ /* remove tab */
+ gtk_widget_destroy(gw->container);
}
void gui_window_destroy(struct gui_window *g)
{
- if (g->prev)
+ LOG(("gui_window: %p", g));
+ assert(g != NULL);
+ assert(g->bw != NULL);
+ LOG(("scaffolding: %p", g->scaffold));
+
+ if (g->prev) {
g->prev->next = g->next;
- else
+ } else {
window_list = g->next;
+ }
- if (g->next)
+ if (g->next) {
g->next->prev = g->prev;
+ }
-
- LOG(("Destroying gui_window %p", g));
- assert(g != NULL);
- assert(g->bw != NULL);
- LOG((" Scaffolding: %p", g->scaffold));
- LOG((" Window name: %s", g->bw->name));
-
- /* tab => remove tab */
- gtk_widget_destroy(gtk_widget_get_parent(GTK_WIDGET(g->layout)));
+ LOG(("window list head: %p", window_list));
}
/**
--
NetSurf Browser
10 years, 2 months
netsurf: branch master updated. release/3.0-203-g3d7f796
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/3d7f79683c770a197e9d6...
...commit http://git.netsurf-browser.org/netsurf.git/commit/3d7f79683c770a197e9d67a...
...tree http://git.netsurf-browser.org/netsurf.git/tree/3d7f79683c770a197e9d67aee...
The branch, master has been updated
via 3d7f79683c770a197e9d67aee840b76dde422e11 (commit)
from 59dc2931565c56ee2d037568758db23bf4893169 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=3d7f79683c770a197e9...
commit 3d7f79683c770a197e9d67aee840b76dde422e11
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
add new tab tab
diff --git a/gtk/scaffolding.c b/gtk/scaffolding.c
index 016e24f..5a95844 100644
--- a/gtk/scaffolding.c
+++ b/gtk/scaffolding.c
@@ -605,9 +605,9 @@ MULTIHANDLER(newwindow)
return TRUE;
}
-MULTIHANDLER(newtab)
+nserror nsgtk_scaffolding_new_tab(struct gui_window *gw)
{
- struct browser_window *bw = nsgtk_get_browser_window(g->top_level);
+ struct browser_window *bw = nsgtk_get_browser_window(gw);
nsurl *url;
nserror error;
@@ -633,16 +633,16 @@ MULTIHANDLER(newtab)
if (url != NULL) {
nsurl_unref(url);
}
+ return error;
+}
+
+MULTIHANDLER(newtab)
+{
+ nserror error;
+ nsgtk_scaffolding_new_tab(g->top_level);
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
- } else if (nsoption_bool(new_blank)) {
- /** @todo what the heck is this for? */
- GtkWidget *window = gtk_notebook_get_nth_page(g->notebook, -1);
- nsgtk_widget_override_background_color(window,
- GTK_STATE_NORMAL,
- 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF);
}
-
return TRUE;
}
@@ -947,11 +947,6 @@ MULTIHANDLER(print)
MULTIHANDLER(closewindow)
{
- /* close all tabs first */
- gint numbertabs = gtk_notebook_get_n_pages(g->notebook);
- while (numbertabs-- > 1) {
- nsgtk_tab_close_current(g->notebook);
- }
nsgtk_window_close(g);
gtk_widget_destroy(GTK_WIDGET(g->window));
return TRUE;
@@ -1570,14 +1565,15 @@ MULTIHANDLER(openlocation)
MULTIHANDLER(nexttab)
{
- gtk_notebook_next_page(g->notebook);
+ nsgtk_tab_next(g->notebook);
return TRUE;
}
MULTIHANDLER(prevtab)
{
- gtk_notebook_prev_page(g->notebook);
+
+ nsgtk_tab_prev(g->notebook);
return TRUE;
}
@@ -2015,7 +2011,7 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
gtk_toolbar_set_show_arrow(g->tool_bar, TRUE);
gtk_widget_show_all(GTK_WIDGET(g->tool_bar));
- nsgtk_tab_init(g->notebook);
+ nsgtk_tab_init(g);
gtk_widget_set_size_request(GTK_WIDGET(
g->buttons[HISTORY_BUTTON]->button), 20, -1);
@@ -2164,21 +2160,21 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
return g;
}
-void gui_window_set_title(struct gui_window *_g, const char *title)
+void gui_window_set_title(struct gui_window *gw, const char *title)
{
static char suffix[] = " - NetSurf";
char nt[strlen(title) + strlen(suffix) + 1];
- struct gtk_scaffolding *g = nsgtk_get_scaffold(_g);
+ struct gtk_scaffolding *gs = nsgtk_get_scaffold(gw);
- nsgtk_tab_set_title(_g, title);
+ nsgtk_tab_set_title(gw, title);
- if (g->top_level == _g) {
+ if (gs->top_level == gw) {
if (title == NULL || title[0] == '\0') {
- gtk_window_set_title(g->window, "NetSurf");
+ gtk_window_set_title(gs->window, "NetSurf");
} else {
strcpy(nt, title);
strcat(nt, suffix);
- gtk_window_set_title(g->window, nt);
+ gtk_window_set_title(gs->window, nt);
}
}
}
diff --git a/gtk/scaffolding.h b/gtk/scaffolding.h
index cf75f0a..e6426de 100644
--- a/gtk/scaffolding.h
+++ b/gtk/scaffolding.h
@@ -155,4 +155,6 @@ void nsgtk_scaffolding_set_icon(struct gui_window *gw);
gboolean nsgtk_window_url_activate_event(GtkWidget *, gpointer);
gboolean nsgtk_window_url_changed(GtkWidget *, GdkEventKey *, gpointer);
+nserror nsgtk_scaffolding_new_tab(struct gui_window *gw);
+
#endif /* NETSURF_GTK_SCAFFOLDING_H */
diff --git a/gtk/tabs.c b/gtk/tabs.c
index 462f666..b275f12 100644
--- a/gtk/tabs.c
+++ b/gtk/tabs.c
@@ -46,7 +46,7 @@ static void nsgtk_tab_update_size(GtkWidget *hbox, GtkStyle *previous_style,
style = nsgtk_widget_get_style_context(hbox);
context = gtk_widget_get_pango_context(hbox);
- metrics = pango_context_get_metrics(context,
+ metrics = pango_context_get_metrics(context,
nsgtk_style_context_get_font(style, state),
pango_context_get_language(context));
@@ -107,21 +107,78 @@ static GtkWidget *nsgtk_tab_label_setup(struct gui_window *window)
g_object_set_data(G_OBJECT(hbox), "label", label);
g_object_set_data(G_OBJECT(hbox), "close-button", button);
- nsgtk_window_set_tab(window, hbox);
gtk_widget_show_all(hbox);
return hbox;
}
+#include "utils/log.h"
/** callback when page is switched */
-static void nsgtk_tab_page_changed(GtkNotebook *notebook, gpointer *page,
- gint page_num)
+
+static gint srcpagenum;
+
+/** The switch-page signal handler
+ *
+ * This signal is handled both before and after delivery to work round
+ * issue that setting the selected tab during the switch-page signal
+ * fails
+ */
+static void
+nsgtk_tab_switch_page(GtkNotebook *notebook,
+ GtkWidget *page,
+ guint selpagenum,
+ gpointer user_data)
+{
+ srcpagenum = gtk_notebook_get_current_page(notebook);
+}
+
+static void
+nsgtk_tab_switch_page_after(GtkNotebook *notebook,
+ GtkWidget *selpage,
+ guint selpagenum,
+ gpointer user_data)
{
- GtkWidget *window = gtk_notebook_get_nth_page(notebook, page_num);
- struct gui_window *gw = g_object_get_data(G_OBJECT(window),
- "gui_window");
- if (gw != NULL) {
- nsgtk_scaffolding_set_top_level(gw);
+ GtkWidget *srcpage;
+ GtkWidget *addpage;
+ struct gui_window *gw;
+ nserror error;
+
+ addpage = g_object_get_data(G_OBJECT(notebook), "addtab");
+
+ if (selpage == addpage) {
+ if ((srcpagenum != -1) && (srcpagenum != selpagenum)) {
+ /* ensure the add tab is not actually selected */
+ LOG(("src %d sel %d",srcpagenum,selpagenum ));
+ srcpage = gtk_notebook_get_nth_page(notebook, srcpagenum);
+ gw = g_object_get_data(G_OBJECT(srcpage), "gui_window");
+ if ((gw != NULL) && (nsgtk_get_scaffold(gw) != NULL)) {
+ error = nsgtk_scaffolding_new_tab(gw);
+ }
+ }
+ } else {
+ LOG(("sel %d", selpagenum ));
+ /* tab with page in it */
+ gw = g_object_get_data(G_OBJECT(selpage), "gui_window");
+ if (gw != NULL) {
+ nsgtk_scaffolding_set_top_level(gw);
+ }
+ }
+}
+
+static void nsgtk_tab_page_reordered(GtkNotebook *notebook,
+ GtkWidget *child,
+ guint page_num,
+ gpointer user_data)
+{
+ gint pages;
+ GtkWidget *addpage;
+
+ pages = gtk_notebook_get_n_pages(notebook);
+ addpage = g_object_get_data(G_OBJECT(notebook), "addtab");
+
+ if ((page_num == (pages - 1)) && (child != addpage)) {
+ /* moved tab to end */
+ gtk_notebook_reorder_child(notebook, addpage, -1);
}
}
@@ -148,16 +205,53 @@ nsgtk_tab_orientation(GtkNotebook *notebook)
}
}
+/** adds a "new tab" tab */
+static GtkWidget *
+nsgtk_tab_add_newtab(GtkNotebook *notebook)
+{
+ GtkWidget *tablabel;
+ GtkWidget *tabcontents;
+ GtkWidget *add;
+
+ tablabel = nsgtk_hbox_new(FALSE, 1);
+ tabcontents = nsgtk_hbox_new(FALSE, 1);
+
+ add = gtk_image_new_from_stock("gtk-add", GTK_ICON_SIZE_MENU);
+
+ gtk_box_pack_start(GTK_BOX(tablabel), add, FALSE, FALSE, 0);
+
+ gtk_widget_show_all(tablabel);
+
+ gtk_notebook_append_page(notebook, tabcontents, tablabel);
+
+ gtk_notebook_set_tab_reorderable(notebook, tabcontents, false);
+
+ gtk_widget_show_all(tabcontents);
+
+ g_object_set_data(G_OBJECT(notebook), "addtab", tabcontents);
+
+ return tablabel;
+}
+
/** callback to alter tab visibility when pages are added or removed */
-static void
+static void
nsgtk_tab_visibility_update(GtkNotebook *notebook, GtkWidget *child, guint page)
{
- gint num_pages = gtk_notebook_get_n_pages(notebook);
+ gint pagec = gtk_notebook_get_n_pages(notebook);
+ GtkWidget *addpage = g_object_get_data(G_OBJECT(notebook), "addtab");
+
+ if (addpage != NULL) {
+ pagec--; /* skip the add tab */
+ if (page == pagec) {
+ /* ensure the add new tab cannot be current */
+ gtk_notebook_set_current_page(notebook, page - 1);
+ }
+ }
- if ((nsoption_bool(show_single_tab) == true) || (num_pages > 1)) {
- gtk_notebook_set_show_tabs(notebook, TRUE);
+ if ((nsoption_bool(show_single_tab) == true) || (pagec > 1)) {
+ gtk_notebook_set_show_tabs(notebook, TRUE);
} else {
- gtk_notebook_set_show_tabs(notebook, FALSE);
+ gtk_notebook_set_show_tabs(notebook, FALSE);
}
}
@@ -165,43 +259,66 @@ nsgtk_tab_visibility_update(GtkNotebook *notebook, GtkWidget *child, guint page)
void nsgtk_tab_options_changed(GtkNotebook *notebook)
{
nsgtk_tab_orientation(notebook);
- nsgtk_tab_visibility_update(notebook, NULL, 0);
+ nsgtk_tab_visibility_update(notebook, NULL, 0);
}
+
/* exported interface documented in gtk/tabs.h */
-void nsgtk_tab_init(GtkNotebook *notebook)
+void nsgtk_tab_init(struct gtk_scaffolding *gs)
{
+ GtkNotebook *notebook;
+
+ notebook = nsgtk_scaffolding_notebook(gs);
+
+ nsgtk_tab_add_newtab(notebook);
+
g_signal_connect(notebook, "switch-page",
- G_CALLBACK(nsgtk_tab_page_changed), NULL);
+ G_CALLBACK(nsgtk_tab_switch_page), NULL);
+ g_signal_connect_after(notebook, "switch-page",
+ G_CALLBACK(nsgtk_tab_switch_page_after), NULL);
g_signal_connect(notebook, "page-removed",
- G_CALLBACK(nsgtk_tab_visibility_update), NULL);
+ G_CALLBACK(nsgtk_tab_visibility_update), NULL);
g_signal_connect(notebook, "page-added",
- G_CALLBACK(nsgtk_tab_visibility_update), NULL);
+ G_CALLBACK(nsgtk_tab_visibility_update), NULL);
+ g_signal_connect(notebook, "page-reordered",
+ G_CALLBACK(nsgtk_tab_page_reordered), NULL);
+
- nsgtk_tab_options_changed(notebook);
+ nsgtk_tab_options_changed(notebook);
}
/* exported interface documented in gtk/tabs.h */
-void nsgtk_tab_add(struct gui_window *window,
- GtkWidget *tab_contents, bool background)
+void nsgtk_tab_add(struct gui_window *window,
+ GtkWidget *tab_contents,
+ bool background)
{
- GtkWidget *tabs = GTK_WIDGET(nsgtk_scaffolding_notebook(
- nsgtk_get_scaffold(window)));
- GtkWidget *tabBox = nsgtk_tab_label_setup(window);
- gint remember = gtk_notebook_get_current_page(GTK_NOTEBOOK(tabs));
-
- gtk_notebook_append_page(GTK_NOTEBOOK(tabs), tab_contents, tabBox);
- /*causes gtk errors can't set a parent */
- gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(tabs),
- tab_contents,
- true);
+ GtkNotebook *tabs;
+ GtkWidget *tabBox;
+ gint remember;
+ gint pages;
+ gint newpage;
+
+ tabs = nsgtk_scaffolding_notebook(nsgtk_get_scaffold(window));
+
+ tabBox = nsgtk_tab_label_setup(window);
+
+ nsgtk_window_set_tab(window, tabBox);
+
+ remember = gtk_notebook_get_current_page(tabs);
+
+ pages = gtk_notebook_get_n_pages(tabs);
+
+ newpage = gtk_notebook_insert_page(tabs, tab_contents, tabBox, pages - 1);
+
+ gtk_notebook_set_tab_reorderable(tabs, tab_contents, true);
+
gtk_widget_show_all(tab_contents);
- gtk_notebook_set_current_page(GTK_NOTEBOOK(tabs),
- gtk_notebook_get_n_pages(GTK_NOTEBOOK(tabs)) - 1);
if (background) {
- gtk_notebook_set_current_page(GTK_NOTEBOOK(tabs), remember);
+ gtk_notebook_set_current_page(tabs, remember);
+ } else {
+ gtk_notebook_set_current_page(tabs, newpage);
}
gtk_widget_grab_focus(GTK_WIDGET(nsgtk_scaffolding_urlbar(
@@ -222,21 +339,74 @@ void nsgtk_tab_set_title(struct gui_window *g, const char *title)
label = g_object_get_data(G_OBJECT(tab), "label");
gtk_label_set_text(GTK_LABEL(label), title);
gtk_widget_set_tooltip_text(tab, title);
-
+
}
/* exported interface documented in gtk/tabs.h */
-void nsgtk_tab_close_current(GtkNotebook *notebook)
+nserror nsgtk_tab_close_current(GtkNotebook *notebook)
{
- gint curr_page = gtk_notebook_get_current_page(notebook);
- GtkWidget *window = gtk_notebook_get_nth_page(notebook, curr_page);
- struct gui_window *gw = g_object_get_data(G_OBJECT(window),
- "gui_window");
+ gint pagen;
+ GtkWidget *page;
+ struct gui_window *gw;
+ GtkWidget *addpage;
+
+ pagen = gtk_notebook_get_current_page(notebook);
+ if (pagen == -1) {
+ return NSERROR_OK;
+ }
+
+ page = gtk_notebook_get_nth_page(notebook, pagen);
+ if (page == NULL) {
+ return NSERROR_OK;
+ }
- if (gtk_notebook_get_n_pages(notebook) < 2)
- return; /* wicked things happen if we close the last tab */
+ addpage = g_object_get_data(G_OBJECT(notebook), "addtab");
+ if (page == addpage) {
+ /* the add new tab page is current, cannot close that */
+ return NSERROR_OK;
+ }
+ gw = g_object_get_data(G_OBJECT(page), "gui_window");
+ if (gw == NULL) {
+ return NSERROR_OK;
+ }
+
nsgtk_window_destroy_browser(gw);
- /* deletes 2 notebook tabs at a time!
- gtk_notebook_remove_page(notebook, curr_page); */
+
+ return NSERROR_OK;
+}
+
+nserror nsgtk_tab_prev(GtkNotebook *notebook)
+{
+ gtk_notebook_prev_page(notebook);
+
+ return NSERROR_OK;
+
+}
+
+nserror nsgtk_tab_next(GtkNotebook *notebook)
+{
+ gint pagen;
+ GtkWidget *page;
+ GtkWidget *addpage;
+
+ pagen = gtk_notebook_get_current_page(notebook);
+ if (pagen == -1) {
+ return NSERROR_OK;
+ }
+
+ page = gtk_notebook_get_nth_page(notebook, pagen + 1);
+ if (page == NULL) {
+ return NSERROR_OK;
+ }
+
+ addpage = g_object_get_data(G_OBJECT(notebook), "addtab");
+ if (page == addpage) {
+ /* cannot make add new tab page current */
+ return NSERROR_OK;
+ }
+
+ gtk_notebook_set_current_page(notebook, pagen + 1);
+
+ return NSERROR_OK;
}
diff --git a/gtk/tabs.h b/gtk/tabs.h
index 862e2d9..959799e 100644
--- a/gtk/tabs.h
+++ b/gtk/tabs.h
@@ -21,10 +21,12 @@
struct gui_window;
-void nsgtk_tab_init(GtkNotebook *notebook);
+void nsgtk_tab_init(struct gtk_scaffolding *gs);
void nsgtk_tab_add(struct gui_window *window, GtkWidget *tab_contents, bool background);
void nsgtk_tab_set_title(struct gui_window *g, const char *title);
void nsgtk_tab_options_changed(GtkNotebook *notebook);
-void nsgtk_tab_close_current(GtkNotebook *notebook);
+nserror nsgtk_tab_close_current(GtkNotebook *notebook);
+nserror nsgtk_tab_prev(GtkNotebook *notebook);
+nserror nsgtk_tab_next(GtkNotebook *notebook);
#endif
diff --git a/gtk/window.c b/gtk/window.c
index 6a5cce1..43908ba 100644
--- a/gtk/window.c
+++ b/gtk/window.c
@@ -812,9 +812,9 @@ void nsgtk_window_process_reformats(void)
}
-void nsgtk_window_destroy_browser(struct gui_window *g)
+void nsgtk_window_destroy_browser(struct gui_window *gw)
{
- browser_window_destroy(g->bw);
+ browser_window_destroy(gw->bw);
}
void gui_window_destroy(struct gui_window *g)
-----------------------------------------------------------------------
Summary of changes:
gtk/scaffolding.c | 42 ++++-----
gtk/scaffolding.h | 2 +
gtk/tabs.c | 260 +++++++++++++++++++++++++++++++++++++++++++---------
gtk/tabs.h | 6 +-
gtk/window.c | 4 +-
5 files changed, 242 insertions(+), 72 deletions(-)
diff --git a/gtk/scaffolding.c b/gtk/scaffolding.c
index 016e24f..5a95844 100644
--- a/gtk/scaffolding.c
+++ b/gtk/scaffolding.c
@@ -605,9 +605,9 @@ MULTIHANDLER(newwindow)
return TRUE;
}
-MULTIHANDLER(newtab)
+nserror nsgtk_scaffolding_new_tab(struct gui_window *gw)
{
- struct browser_window *bw = nsgtk_get_browser_window(g->top_level);
+ struct browser_window *bw = nsgtk_get_browser_window(gw);
nsurl *url;
nserror error;
@@ -633,16 +633,16 @@ MULTIHANDLER(newtab)
if (url != NULL) {
nsurl_unref(url);
}
+ return error;
+}
+
+MULTIHANDLER(newtab)
+{
+ nserror error;
+ nsgtk_scaffolding_new_tab(g->top_level);
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
- } else if (nsoption_bool(new_blank)) {
- /** @todo what the heck is this for? */
- GtkWidget *window = gtk_notebook_get_nth_page(g->notebook, -1);
- nsgtk_widget_override_background_color(window,
- GTK_STATE_NORMAL,
- 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF);
}
-
return TRUE;
}
@@ -947,11 +947,6 @@ MULTIHANDLER(print)
MULTIHANDLER(closewindow)
{
- /* close all tabs first */
- gint numbertabs = gtk_notebook_get_n_pages(g->notebook);
- while (numbertabs-- > 1) {
- nsgtk_tab_close_current(g->notebook);
- }
nsgtk_window_close(g);
gtk_widget_destroy(GTK_WIDGET(g->window));
return TRUE;
@@ -1570,14 +1565,15 @@ MULTIHANDLER(openlocation)
MULTIHANDLER(nexttab)
{
- gtk_notebook_next_page(g->notebook);
+ nsgtk_tab_next(g->notebook);
return TRUE;
}
MULTIHANDLER(prevtab)
{
- gtk_notebook_prev_page(g->notebook);
+
+ nsgtk_tab_prev(g->notebook);
return TRUE;
}
@@ -2015,7 +2011,7 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
gtk_toolbar_set_show_arrow(g->tool_bar, TRUE);
gtk_widget_show_all(GTK_WIDGET(g->tool_bar));
- nsgtk_tab_init(g->notebook);
+ nsgtk_tab_init(g);
gtk_widget_set_size_request(GTK_WIDGET(
g->buttons[HISTORY_BUTTON]->button), 20, -1);
@@ -2164,21 +2160,21 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
return g;
}
-void gui_window_set_title(struct gui_window *_g, const char *title)
+void gui_window_set_title(struct gui_window *gw, const char *title)
{
static char suffix[] = " - NetSurf";
char nt[strlen(title) + strlen(suffix) + 1];
- struct gtk_scaffolding *g = nsgtk_get_scaffold(_g);
+ struct gtk_scaffolding *gs = nsgtk_get_scaffold(gw);
- nsgtk_tab_set_title(_g, title);
+ nsgtk_tab_set_title(gw, title);
- if (g->top_level == _g) {
+ if (gs->top_level == gw) {
if (title == NULL || title[0] == '\0') {
- gtk_window_set_title(g->window, "NetSurf");
+ gtk_window_set_title(gs->window, "NetSurf");
} else {
strcpy(nt, title);
strcat(nt, suffix);
- gtk_window_set_title(g->window, nt);
+ gtk_window_set_title(gs->window, nt);
}
}
}
diff --git a/gtk/scaffolding.h b/gtk/scaffolding.h
index cf75f0a..e6426de 100644
--- a/gtk/scaffolding.h
+++ b/gtk/scaffolding.h
@@ -155,4 +155,6 @@ void nsgtk_scaffolding_set_icon(struct gui_window *gw);
gboolean nsgtk_window_url_activate_event(GtkWidget *, gpointer);
gboolean nsgtk_window_url_changed(GtkWidget *, GdkEventKey *, gpointer);
+nserror nsgtk_scaffolding_new_tab(struct gui_window *gw);
+
#endif /* NETSURF_GTK_SCAFFOLDING_H */
diff --git a/gtk/tabs.c b/gtk/tabs.c
index 462f666..b275f12 100644
--- a/gtk/tabs.c
+++ b/gtk/tabs.c
@@ -46,7 +46,7 @@ static void nsgtk_tab_update_size(GtkWidget *hbox, GtkStyle *previous_style,
style = nsgtk_widget_get_style_context(hbox);
context = gtk_widget_get_pango_context(hbox);
- metrics = pango_context_get_metrics(context,
+ metrics = pango_context_get_metrics(context,
nsgtk_style_context_get_font(style, state),
pango_context_get_language(context));
@@ -107,21 +107,78 @@ static GtkWidget *nsgtk_tab_label_setup(struct gui_window *window)
g_object_set_data(G_OBJECT(hbox), "label", label);
g_object_set_data(G_OBJECT(hbox), "close-button", button);
- nsgtk_window_set_tab(window, hbox);
gtk_widget_show_all(hbox);
return hbox;
}
+#include "utils/log.h"
/** callback when page is switched */
-static void nsgtk_tab_page_changed(GtkNotebook *notebook, gpointer *page,
- gint page_num)
+
+static gint srcpagenum;
+
+/** The switch-page signal handler
+ *
+ * This signal is handled both before and after delivery to work round
+ * issue that setting the selected tab during the switch-page signal
+ * fails
+ */
+static void
+nsgtk_tab_switch_page(GtkNotebook *notebook,
+ GtkWidget *page,
+ guint selpagenum,
+ gpointer user_data)
+{
+ srcpagenum = gtk_notebook_get_current_page(notebook);
+}
+
+static void
+nsgtk_tab_switch_page_after(GtkNotebook *notebook,
+ GtkWidget *selpage,
+ guint selpagenum,
+ gpointer user_data)
{
- GtkWidget *window = gtk_notebook_get_nth_page(notebook, page_num);
- struct gui_window *gw = g_object_get_data(G_OBJECT(window),
- "gui_window");
- if (gw != NULL) {
- nsgtk_scaffolding_set_top_level(gw);
+ GtkWidget *srcpage;
+ GtkWidget *addpage;
+ struct gui_window *gw;
+ nserror error;
+
+ addpage = g_object_get_data(G_OBJECT(notebook), "addtab");
+
+ if (selpage == addpage) {
+ if ((srcpagenum != -1) && (srcpagenum != selpagenum)) {
+ /* ensure the add tab is not actually selected */
+ LOG(("src %d sel %d",srcpagenum,selpagenum ));
+ srcpage = gtk_notebook_get_nth_page(notebook, srcpagenum);
+ gw = g_object_get_data(G_OBJECT(srcpage), "gui_window");
+ if ((gw != NULL) && (nsgtk_get_scaffold(gw) != NULL)) {
+ error = nsgtk_scaffolding_new_tab(gw);
+ }
+ }
+ } else {
+ LOG(("sel %d", selpagenum ));
+ /* tab with page in it */
+ gw = g_object_get_data(G_OBJECT(selpage), "gui_window");
+ if (gw != NULL) {
+ nsgtk_scaffolding_set_top_level(gw);
+ }
+ }
+}
+
+static void nsgtk_tab_page_reordered(GtkNotebook *notebook,
+ GtkWidget *child,
+ guint page_num,
+ gpointer user_data)
+{
+ gint pages;
+ GtkWidget *addpage;
+
+ pages = gtk_notebook_get_n_pages(notebook);
+ addpage = g_object_get_data(G_OBJECT(notebook), "addtab");
+
+ if ((page_num == (pages - 1)) && (child != addpage)) {
+ /* moved tab to end */
+ gtk_notebook_reorder_child(notebook, addpage, -1);
}
}
@@ -148,16 +205,53 @@ nsgtk_tab_orientation(GtkNotebook *notebook)
}
}
+/** adds a "new tab" tab */
+static GtkWidget *
+nsgtk_tab_add_newtab(GtkNotebook *notebook)
+{
+ GtkWidget *tablabel;
+ GtkWidget *tabcontents;
+ GtkWidget *add;
+
+ tablabel = nsgtk_hbox_new(FALSE, 1);
+ tabcontents = nsgtk_hbox_new(FALSE, 1);
+
+ add = gtk_image_new_from_stock("gtk-add", GTK_ICON_SIZE_MENU);
+
+ gtk_box_pack_start(GTK_BOX(tablabel), add, FALSE, FALSE, 0);
+
+ gtk_widget_show_all(tablabel);
+
+ gtk_notebook_append_page(notebook, tabcontents, tablabel);
+
+ gtk_notebook_set_tab_reorderable(notebook, tabcontents, false);
+
+ gtk_widget_show_all(tabcontents);
+
+ g_object_set_data(G_OBJECT(notebook), "addtab", tabcontents);
+
+ return tablabel;
+}
+
/** callback to alter tab visibility when pages are added or removed */
-static void
+static void
nsgtk_tab_visibility_update(GtkNotebook *notebook, GtkWidget *child, guint page)
{
- gint num_pages = gtk_notebook_get_n_pages(notebook);
+ gint pagec = gtk_notebook_get_n_pages(notebook);
+ GtkWidget *addpage = g_object_get_data(G_OBJECT(notebook), "addtab");
+
+ if (addpage != NULL) {
+ pagec--; /* skip the add tab */
+ if (page == pagec) {
+ /* ensure the add new tab cannot be current */
+ gtk_notebook_set_current_page(notebook, page - 1);
+ }
+ }
- if ((nsoption_bool(show_single_tab) == true) || (num_pages > 1)) {
- gtk_notebook_set_show_tabs(notebook, TRUE);
+ if ((nsoption_bool(show_single_tab) == true) || (pagec > 1)) {
+ gtk_notebook_set_show_tabs(notebook, TRUE);
} else {
- gtk_notebook_set_show_tabs(notebook, FALSE);
+ gtk_notebook_set_show_tabs(notebook, FALSE);
}
}
@@ -165,43 +259,66 @@ nsgtk_tab_visibility_update(GtkNotebook *notebook, GtkWidget *child, guint page)
void nsgtk_tab_options_changed(GtkNotebook *notebook)
{
nsgtk_tab_orientation(notebook);
- nsgtk_tab_visibility_update(notebook, NULL, 0);
+ nsgtk_tab_visibility_update(notebook, NULL, 0);
}
+
/* exported interface documented in gtk/tabs.h */
-void nsgtk_tab_init(GtkNotebook *notebook)
+void nsgtk_tab_init(struct gtk_scaffolding *gs)
{
+ GtkNotebook *notebook;
+
+ notebook = nsgtk_scaffolding_notebook(gs);
+
+ nsgtk_tab_add_newtab(notebook);
+
g_signal_connect(notebook, "switch-page",
- G_CALLBACK(nsgtk_tab_page_changed), NULL);
+ G_CALLBACK(nsgtk_tab_switch_page), NULL);
+ g_signal_connect_after(notebook, "switch-page",
+ G_CALLBACK(nsgtk_tab_switch_page_after), NULL);
g_signal_connect(notebook, "page-removed",
- G_CALLBACK(nsgtk_tab_visibility_update), NULL);
+ G_CALLBACK(nsgtk_tab_visibility_update), NULL);
g_signal_connect(notebook, "page-added",
- G_CALLBACK(nsgtk_tab_visibility_update), NULL);
+ G_CALLBACK(nsgtk_tab_visibility_update), NULL);
+ g_signal_connect(notebook, "page-reordered",
+ G_CALLBACK(nsgtk_tab_page_reordered), NULL);
+
- nsgtk_tab_options_changed(notebook);
+ nsgtk_tab_options_changed(notebook);
}
/* exported interface documented in gtk/tabs.h */
-void nsgtk_tab_add(struct gui_window *window,
- GtkWidget *tab_contents, bool background)
+void nsgtk_tab_add(struct gui_window *window,
+ GtkWidget *tab_contents,
+ bool background)
{
- GtkWidget *tabs = GTK_WIDGET(nsgtk_scaffolding_notebook(
- nsgtk_get_scaffold(window)));
- GtkWidget *tabBox = nsgtk_tab_label_setup(window);
- gint remember = gtk_notebook_get_current_page(GTK_NOTEBOOK(tabs));
-
- gtk_notebook_append_page(GTK_NOTEBOOK(tabs), tab_contents, tabBox);
- /*causes gtk errors can't set a parent */
- gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(tabs),
- tab_contents,
- true);
+ GtkNotebook *tabs;
+ GtkWidget *tabBox;
+ gint remember;
+ gint pages;
+ gint newpage;
+
+ tabs = nsgtk_scaffolding_notebook(nsgtk_get_scaffold(window));
+
+ tabBox = nsgtk_tab_label_setup(window);
+
+ nsgtk_window_set_tab(window, tabBox);
+
+ remember = gtk_notebook_get_current_page(tabs);
+
+ pages = gtk_notebook_get_n_pages(tabs);
+
+ newpage = gtk_notebook_insert_page(tabs, tab_contents, tabBox, pages - 1);
+
+ gtk_notebook_set_tab_reorderable(tabs, tab_contents, true);
+
gtk_widget_show_all(tab_contents);
- gtk_notebook_set_current_page(GTK_NOTEBOOK(tabs),
- gtk_notebook_get_n_pages(GTK_NOTEBOOK(tabs)) - 1);
if (background) {
- gtk_notebook_set_current_page(GTK_NOTEBOOK(tabs), remember);
+ gtk_notebook_set_current_page(tabs, remember);
+ } else {
+ gtk_notebook_set_current_page(tabs, newpage);
}
gtk_widget_grab_focus(GTK_WIDGET(nsgtk_scaffolding_urlbar(
@@ -222,21 +339,74 @@ void nsgtk_tab_set_title(struct gui_window *g, const char *title)
label = g_object_get_data(G_OBJECT(tab), "label");
gtk_label_set_text(GTK_LABEL(label), title);
gtk_widget_set_tooltip_text(tab, title);
-
+
}
/* exported interface documented in gtk/tabs.h */
-void nsgtk_tab_close_current(GtkNotebook *notebook)
+nserror nsgtk_tab_close_current(GtkNotebook *notebook)
{
- gint curr_page = gtk_notebook_get_current_page(notebook);
- GtkWidget *window = gtk_notebook_get_nth_page(notebook, curr_page);
- struct gui_window *gw = g_object_get_data(G_OBJECT(window),
- "gui_window");
+ gint pagen;
+ GtkWidget *page;
+ struct gui_window *gw;
+ GtkWidget *addpage;
+
+ pagen = gtk_notebook_get_current_page(notebook);
+ if (pagen == -1) {
+ return NSERROR_OK;
+ }
+
+ page = gtk_notebook_get_nth_page(notebook, pagen);
+ if (page == NULL) {
+ return NSERROR_OK;
+ }
- if (gtk_notebook_get_n_pages(notebook) < 2)
- return; /* wicked things happen if we close the last tab */
+ addpage = g_object_get_data(G_OBJECT(notebook), "addtab");
+ if (page == addpage) {
+ /* the add new tab page is current, cannot close that */
+ return NSERROR_OK;
+ }
+ gw = g_object_get_data(G_OBJECT(page), "gui_window");
+ if (gw == NULL) {
+ return NSERROR_OK;
+ }
+
nsgtk_window_destroy_browser(gw);
- /* deletes 2 notebook tabs at a time!
- gtk_notebook_remove_page(notebook, curr_page); */
+
+ return NSERROR_OK;
+}
+
+nserror nsgtk_tab_prev(GtkNotebook *notebook)
+{
+ gtk_notebook_prev_page(notebook);
+
+ return NSERROR_OK;
+
+}
+
+nserror nsgtk_tab_next(GtkNotebook *notebook)
+{
+ gint pagen;
+ GtkWidget *page;
+ GtkWidget *addpage;
+
+ pagen = gtk_notebook_get_current_page(notebook);
+ if (pagen == -1) {
+ return NSERROR_OK;
+ }
+
+ page = gtk_notebook_get_nth_page(notebook, pagen + 1);
+ if (page == NULL) {
+ return NSERROR_OK;
+ }
+
+ addpage = g_object_get_data(G_OBJECT(notebook), "addtab");
+ if (page == addpage) {
+ /* cannot make add new tab page current */
+ return NSERROR_OK;
+ }
+
+ gtk_notebook_set_current_page(notebook, pagen + 1);
+
+ return NSERROR_OK;
}
diff --git a/gtk/tabs.h b/gtk/tabs.h
index 862e2d9..959799e 100644
--- a/gtk/tabs.h
+++ b/gtk/tabs.h
@@ -21,10 +21,12 @@
struct gui_window;
-void nsgtk_tab_init(GtkNotebook *notebook);
+void nsgtk_tab_init(struct gtk_scaffolding *gs);
void nsgtk_tab_add(struct gui_window *window, GtkWidget *tab_contents, bool background);
void nsgtk_tab_set_title(struct gui_window *g, const char *title);
void nsgtk_tab_options_changed(GtkNotebook *notebook);
-void nsgtk_tab_close_current(GtkNotebook *notebook);
+nserror nsgtk_tab_close_current(GtkNotebook *notebook);
+nserror nsgtk_tab_prev(GtkNotebook *notebook);
+nserror nsgtk_tab_next(GtkNotebook *notebook);
#endif
diff --git a/gtk/window.c b/gtk/window.c
index 6a5cce1..43908ba 100644
--- a/gtk/window.c
+++ b/gtk/window.c
@@ -812,9 +812,9 @@ void nsgtk_window_process_reformats(void)
}
-void nsgtk_window_destroy_browser(struct gui_window *g)
+void nsgtk_window_destroy_browser(struct gui_window *gw)
{
- browser_window_destroy(g->bw);
+ browser_window_destroy(gw->bw);
}
void gui_window_destroy(struct gui_window *g)
--
NetSurf Browser
10 years, 2 months
netsurf: branch master updated. release/3.0-202-g59dc293
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/59dc2931565c56ee2d037...
...commit http://git.netsurf-browser.org/netsurf.git/commit/59dc2931565c56ee2d03756...
...tree http://git.netsurf-browser.org/netsurf.git/tree/59dc2931565c56ee2d0375687...
The branch, master has been updated
via 59dc2931565c56ee2d037568758db23bf4893169 (commit)
from 6358290e78e340ee82c26ab8e327b48db1f8c43e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=59dc2931565c56ee2d0...
commit 59dc2931565c56ee2d037568758db23bf4893169
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
fix status/toolbar bottom split position and setting user option in gtk
diff --git a/gtk/scaffolding.c b/gtk/scaffolding.c
index 566197d..016e24f 100644
--- a/gtk/scaffolding.c
+++ b/gtk/scaffolding.c
@@ -127,7 +127,6 @@ struct gtk_scaffolding {
GtkImage *throbber;
struct gtk_search *search;
GtkWidget *webSearchEntry;
- GtkPaned *status_pane;
int offset;
int toolbarmem;
@@ -545,7 +544,7 @@ static void nsgtk_window_tabs_remove(GtkNotebook *notebook,
*/
static void nsgtk_openfile_open(const char *filename)
{
- struct browser_window *bw;
+ struct browser_window *bw;
char *urltxt;
nsurl *url;
nserror error;
@@ -639,11 +638,11 @@ MULTIHANDLER(newtab)
} else if (nsoption_bool(new_blank)) {
/** @todo what the heck is this for? */
GtkWidget *window = gtk_notebook_get_nth_page(g->notebook, -1);
- nsgtk_widget_override_background_color(window,
- GTK_STATE_NORMAL,
+ nsgtk_widget_override_background_color(window,
+ GTK_STATE_NORMAL,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF);
}
-
+
return TRUE;
}
@@ -1016,7 +1015,7 @@ MENUHANDLER(link_openwin)
}
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
- }
+ }
return TRUE;
}
@@ -1050,7 +1049,7 @@ MENUHANDLER(link_opentab)
}
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
- }
+ }
temp_open_background = -1;
@@ -1285,10 +1284,6 @@ MULTIHANDLER(savewindowsize)
{
int x,y,w,h;
- if (GTK_IS_PANED(g->status_pane)) {
- nsoption_set_int(toolbar_status_size,
- gtk_paned_get_position(g->status_pane));
- }
gtk_window_get_position(g->window, &x, &y);
gtk_window_get_size(g->window, &w, &h);
@@ -1682,7 +1677,7 @@ BUTTONHANDLER(history)
#if GTK_CHECK_VERSION(3,0,0)
-static gboolean
+static gboolean
nsgtk_history_draw_event(GtkWidget *widget, cairo_t *cr, gpointer data)
{
struct rect clip;
@@ -1721,7 +1716,7 @@ nsgtk_history_draw_event(GtkWidget *widget, cairo_t *cr, gpointer data)
#else
/* signal handler functions for the local history window */
-static gboolean
+static gboolean
nsgtk_history_draw_event(GtkWidget *widget, GdkEventExpose *event, gpointer g)
{
struct rect clip;
@@ -1820,25 +1815,25 @@ static bool nsgtk_new_scaffolding_popup(struct gtk_scaffolding *g, GtkAccelGroup
SIG_CONNECT(nmenu->popup_menu, "hide",
nsgtk_window_popup_menu_hidden, g);
- g_signal_connect(nmenu->savelink_menuitem, "activate",
+ g_signal_connect(nmenu->savelink_menuitem, "activate",
G_CALLBACK(nsgtk_on_savelink_activate_menu), g);
- g_signal_connect(nmenu->opentab_menuitem, "activate",
+ g_signal_connect(nmenu->opentab_menuitem, "activate",
G_CALLBACK(nsgtk_on_link_opentab_activate_menu), g);
- g_signal_connect(nmenu->openwin_menuitem, "activate",
+ g_signal_connect(nmenu->openwin_menuitem, "activate",
G_CALLBACK(nsgtk_on_link_openwin_activate_menu), g);
- g_signal_connect(nmenu->cut_menuitem, "activate",
+ g_signal_connect(nmenu->cut_menuitem, "activate",
G_CALLBACK(nsgtk_on_cut_activate_menu), g);
- g_signal_connect(nmenu->copy_menuitem, "activate",
+ g_signal_connect(nmenu->copy_menuitem, "activate",
G_CALLBACK(nsgtk_on_copy_activate_menu), g);
- g_signal_connect(nmenu->paste_menuitem, "activate",
+ g_signal_connect(nmenu->paste_menuitem, "activate",
G_CALLBACK(nsgtk_on_paste_activate_menu), g);
- g_signal_connect(nmenu->customize_menuitem, "activate",
+ g_signal_connect(nmenu->customize_menuitem, "activate",
G_CALLBACK(nsgtk_on_customize_activate_menu), g);
/* set initial popup menu visibility */
@@ -1942,10 +1937,10 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
* or some sensible default if they're not set yet.
*/
if (nsoption_int(window_width) > 0) {
- gtk_window_move(g->window,
- nsoption_int(window_x),
+ gtk_window_move(g->window,
+ nsoption_int(window_x),
nsoption_int(window_y));
- gtk_window_resize(g->window,
+ gtk_window_resize(g->window,
nsoption_int(window_width),
nsoption_int(window_height));
} else {
@@ -1962,7 +1957,7 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
GtkIconSize tooliconsize;
GtkToolbarStyle toolbarstyle;
- g_object_get(settings,
+ g_object_get(settings,
"gtk-toolbar-icon-size", &tooliconsize,
"gtk-toolbar-style", &toolbarstyle, NULL);
@@ -2077,8 +2072,8 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
g_signal_connect(G_OBJECT(obj), (sig), G_CALLBACK(callback), (ptr))
/* connect history window signals to their handlers */
- nsgtk_connect_draw_event(GTK_WIDGET(g->history_window->drawing_area),
- G_CALLBACK(nsgtk_history_draw_event),
+ nsgtk_connect_draw_event(GTK_WIDGET(g->history_window->drawing_area),
+ G_CALLBACK(nsgtk_history_draw_event),
g->history_window);
/*CONNECT(g->history_window->drawing_area, "motion_notify_event",
nsgtk_history_motion_notify_event, g->history_window);*/
@@ -2107,12 +2102,10 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
CONNECT(g->search->entry, "key-press-event", nsgtk_search_entry_key, g);
CONNECT(g->search->buttons[2], "clicked",
nsgtk_search_close_button_clicked, g);
- CONNECT(g->search->caseSens, "toggled", nsgtk_search_entry_changed,
- g);
-
+ CONNECT(g->search->caseSens, "toggled", nsgtk_search_entry_changed, g);
CONNECT(g->tool_bar, "popup-context-menu",
- nsgtk_window_tool_bar_clicked, g);
+ nsgtk_window_tool_bar_clicked, g);
/* create popup menu */
nsgtk_new_scaffolding_popup(g, group);
@@ -2242,13 +2235,13 @@ nsgtk_scaffolding_set_icon(struct gui_window *gw)
GdkPixbuf *icon_pixbuf = nsgtk_get_icon(gw);
/* check icon needs to be shown */
- if ((icon_pixbuf == NULL) ||
+ if ((icon_pixbuf == NULL) ||
(sc->top_level != gw)) {
return;
}
- nsgtk_entry_set_icon_from_pixbuf(sc->url_bar,
- GTK_ENTRY_ICON_PRIMARY,
+ nsgtk_entry_set_icon_from_pixbuf(sc->url_bar,
+ GTK_ENTRY_ICON_PRIMARY,
icon_pixbuf);
gtk_widget_show_all(GTK_WIDGET(sc->buttons[URL_BAR_ITEM]->button));
@@ -2260,7 +2253,7 @@ void gui_window_set_search_ico(hlcache_handle *ico)
nsgtk_scaffolding *current;
GdkPixbuf *srch_pixbuf;
- if ((ico == NULL) &&
+ if ((ico == NULL) &&
(ico = search_web_ico()) == NULL) {
return;
}
@@ -2278,7 +2271,7 @@ void gui_window_set_search_ico(hlcache_handle *ico)
/* add ico to each window's toolbar */
for (current = scaf_list; current != NULL; current = current->next) {
- nsgtk_entry_set_icon_from_pixbuf(current->webSearchEntry,
+ nsgtk_entry_set_icon_from_pixbuf(current->webSearchEntry,
GTK_ENTRY_ICON_PRIMARY,
srch_pixbuf);
}
diff --git a/gtk/window.c b/gtk/window.c
index 5edace8..6a5cce1 100644
--- a/gtk/window.c
+++ b/gtk/window.c
@@ -44,6 +44,10 @@
#include "utils/log.h"
#include "utils/utils.h"
+/* helper macro to conenct signals to callbacks */
+#define CONNECT(obj, sig, callback, ptr) \
+ g_signal_connect(G_OBJECT(obj), (sig), G_CALLBACK(callback), (ptr))
+
extern const GdkPixdata menu_cursor_pixdata;
struct gui_window {
@@ -83,9 +87,12 @@ struct gui_window {
/** statusbar */
GtkLabel *status_bar;
- /** scrollbar paned */
+ /** status pane */
GtkPaned *paned;
+ /** has the status pane had its first size operation yet? */
+ bool paned_sized;
+
/** to allow disactivation / resume of normal window behaviour */
gulong signalhandler[NSGTK_WINDOW_SIGNAL_COUNT];
@@ -147,7 +154,7 @@ float nsgtk_get_scale_for_gui(struct gui_window *g)
#if GTK_CHECK_VERSION(3,0,0)
-static gboolean
+static gboolean
nsgtk_window_draw_event(GtkWidget *widget, cairo_t *cr, gpointer data)
{
struct gui_window *gw = data;
@@ -202,7 +209,7 @@ nsgtk_window_draw_event(GtkWidget *widget, cairo_t *cr, gpointer data)
#else
-static gboolean
+static gboolean
nsgtk_window_draw_event(GtkWidget *widget, GdkEventExpose *event, gpointer data)
{
struct gui_window *gw = data;
@@ -480,7 +487,7 @@ static gboolean nsgtk_window_keypress_event(GtkWidget *widget,
if (browser_window_key_press(g->bw, nskey))
return TRUE;
- if ((event->state & 0x7) != 0)
+ if ((event->state & 0x7) != 0)
return TRUE;
double value;
@@ -591,17 +598,49 @@ static gboolean nsgtk_window_size_allocate_event(GtkWidget *widget,
g->bw->reformat_pending = true;
browser_reformat_pending = true;
- if (g->paned != NULL) {
- /* Set status bar / scroll bar proportion according to
- * option_toolbar_status_size */
- /* TODO: Probably want to detect when the user adjusts the
- * status bar width, remember that proportion for the
- * window, and use that here. */
- gtk_paned_set_position(g->paned,
- (nsoption_int(toolbar_status_size) *
- allocation->width) / 10000);
+
+ return TRUE;
+}
+
+
+/** when the pane position is changed update the user option
+ *
+ * The slightly awkward implementation with the first allocation flag
+ * is necessary because the initial window creation does not cause an
+ * allocate-event signal so the position value in the pane is incorrect
+ * and we cannot know what it should be until after the allocation
+ * (which did not generate a signal) is done as the user position is a
+ * percentage of pane total width not an absolute value.
+ */
+static void
+nsgtk_paned_notify__position(GObject *gobject, GParamSpec *pspec, gpointer data)
+{
+ struct gui_window *g = data;
+ GtkAllocation pane_alloc;
+
+ gtk_widget_get_allocation(GTK_WIDGET(g->paned), &pane_alloc);
+
+ if (g->paned_sized == false)
+ {
+ g->paned_sized = true;
+ gtk_paned_set_position(g->paned,
+ (nsoption_int(toolbar_status_size) * pane_alloc.width) / 10000);
+ return;
}
+ nsoption_set_int(toolbar_status_size,
+ ((gtk_paned_get_position(g->paned) * 10000) / (pane_alloc.width - 1)));
+}
+
+/** Set status bar / scroll bar proportion according to user option
+ * when pane is resized.
+ */
+static gboolean nsgtk_paned_size_allocate_event(GtkWidget *widget,
+ GtkAllocation *allocation, gpointer data)
+{
+ gtk_paned_set_position(GTK_PANED(widget),
+ (nsoption_int(toolbar_status_size) * allocation->width) / 10000);
+
return TRUE;
}
@@ -611,6 +650,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
bool new_tab)
{
struct gui_window *g; /**< what we're creating to return */
+ GError* error = NULL;
g = calloc(1, sizeof(*g));
if (!g) {
@@ -621,7 +661,6 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
LOG(("Creating gui window %p for browser window %p", g, bw));
g->bw = bw;
- g->paned = NULL;
g->mouse.state = 0;
g->current_pointer = GUI_POINTER_DEFAULT;
if (clone != NULL) {
@@ -630,8 +669,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
bw->scale = (float) nsoption_int(scale) / 100.0;
}
- g->careth = 0;
-
+ /* attach scaffold */
if (new_tab) {
assert(clone != NULL);
g->scaffold = clone->window->scaffold;
@@ -639,7 +677,6 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
/* Now construct and attach a scaffold */
g->scaffold = nsgtk_new_scaffolding(g);
}
-
if (g->scaffold == NULL) {
warn_user("NoMemory", 0);
free(g);
@@ -649,10 +686,9 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
/* Construct our primary elements */
/* top-level document (not a frame) => create a new tab */
- GError* error = NULL;
GtkBuilder* xml = gtk_builder_new();
- if (!gtk_builder_add_from_file(xml,
- glade_file_location->tabcontents,
+ if (!gtk_builder_add_from_file(xml,
+ glade_file_location->tabcontents,
&error)) {
g_warning ("Couldn't load builder file: %s", error->message);
g_error_free(error);
@@ -706,28 +742,35 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
nsgtk_widget_set_can_focus(GTK_WIDGET(g->layout), TRUE);
/* set the default background colour of the drawing area to white. */
- nsgtk_widget_override_background_color(GTK_WIDGET(g->layout),
+ nsgtk_widget_override_background_color(GTK_WIDGET(g->layout),
GTK_STATE_NORMAL, 0, 0xffff, 0xffff, 0xffff);
- nsgtk_connect_draw_event(GTK_WIDGET(g->layout), G_CALLBACK(nsgtk_window_draw_event), g);
+ nsgtk_connect_draw_event(GTK_WIDGET(g->layout),
+ G_CALLBACK(nsgtk_window_draw_event), g);
-#define CONNECT(obj, sig, callback, ptr) \
- g_signal_connect(G_OBJECT(obj), (sig), G_CALLBACK(callback), (ptr))
-
- CONNECT(g->layout, "motion_notify_event",
+ /* layout signals */
+ CONNECT(g->layout, "motion-notify-event",
nsgtk_window_motion_notify_event, g);
g->signalhandler[NSGTK_WINDOW_SIGNAL_CLICK] =
- CONNECT(g->layout, "button_press_event",
+ CONNECT(g->layout, "button-press-event",
nsgtk_window_button_press_event, g);
- CONNECT(g->layout, "button_release_event",
+ CONNECT(g->layout, "button-release-event",
nsgtk_window_button_release_event, g);
- CONNECT(g->layout, "key_press_event",
+ CONNECT(g->layout, "key-press-event",
nsgtk_window_keypress_event, g);
- CONNECT(g->layout, "size_allocate",
+ CONNECT(g->layout, "size-allocate",
nsgtk_window_size_allocate_event, g);
CONNECT(g->layout, "scroll-event",
nsgtk_window_scroll_event, g);
+
+ /* status pane signals */
+ CONNECT(g->paned, "size-allocate",
+ nsgtk_paned_size_allocate_event, g);
+
+ CONNECT(g->paned, "notify::position",
+ nsgtk_paned_notify__position, g);
+
return g;
}
@@ -813,8 +856,8 @@ void gui_window_set_icon(struct gui_window *gw, hlcache_handle *icon)
if (icon_bitmap != NULL) {
LOG(("Using %p bitmap", icon_bitmap));
gw->icon = nsgdk_pixbuf_get_from_surface(icon_bitmap->surface, 16, 16);
- }
- }
+ }
+ }
if (gw->icon == NULL) {
LOG(("Using default favicon"));
@@ -1029,7 +1072,7 @@ void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape)
gtk_widget_get_display(
GTK_WIDGET(g->layout)),
cursortype);
- gdk_window_set_cursor(nsgtk_widget_get_window(GTK_WIDGET(g->layout)),
+ gdk_window_set_cursor(nsgtk_widget_get_window(GTK_WIDGET(g->layout)),
cursor);
if (!nullcursor)
@@ -1100,4 +1143,3 @@ void gui_window_get_dimensions(struct gui_window *g, int *width, int *height,
LOG(("width: %i", *width));
LOG(("height: %i", *height));
}
-
-----------------------------------------------------------------------
Summary of changes:
gtk/scaffolding.c | 63 +++++++++++++-----------------
gtk/window.c | 110 ++++++++++++++++++++++++++++++++++++----------------
2 files changed, 104 insertions(+), 69 deletions(-)
diff --git a/gtk/scaffolding.c b/gtk/scaffolding.c
index 566197d..016e24f 100644
--- a/gtk/scaffolding.c
+++ b/gtk/scaffolding.c
@@ -127,7 +127,6 @@ struct gtk_scaffolding {
GtkImage *throbber;
struct gtk_search *search;
GtkWidget *webSearchEntry;
- GtkPaned *status_pane;
int offset;
int toolbarmem;
@@ -545,7 +544,7 @@ static void nsgtk_window_tabs_remove(GtkNotebook *notebook,
*/
static void nsgtk_openfile_open(const char *filename)
{
- struct browser_window *bw;
+ struct browser_window *bw;
char *urltxt;
nsurl *url;
nserror error;
@@ -639,11 +638,11 @@ MULTIHANDLER(newtab)
} else if (nsoption_bool(new_blank)) {
/** @todo what the heck is this for? */
GtkWidget *window = gtk_notebook_get_nth_page(g->notebook, -1);
- nsgtk_widget_override_background_color(window,
- GTK_STATE_NORMAL,
+ nsgtk_widget_override_background_color(window,
+ GTK_STATE_NORMAL,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF);
}
-
+
return TRUE;
}
@@ -1016,7 +1015,7 @@ MENUHANDLER(link_openwin)
}
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
- }
+ }
return TRUE;
}
@@ -1050,7 +1049,7 @@ MENUHANDLER(link_opentab)
}
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
- }
+ }
temp_open_background = -1;
@@ -1285,10 +1284,6 @@ MULTIHANDLER(savewindowsize)
{
int x,y,w,h;
- if (GTK_IS_PANED(g->status_pane)) {
- nsoption_set_int(toolbar_status_size,
- gtk_paned_get_position(g->status_pane));
- }
gtk_window_get_position(g->window, &x, &y);
gtk_window_get_size(g->window, &w, &h);
@@ -1682,7 +1677,7 @@ BUTTONHANDLER(history)
#if GTK_CHECK_VERSION(3,0,0)
-static gboolean
+static gboolean
nsgtk_history_draw_event(GtkWidget *widget, cairo_t *cr, gpointer data)
{
struct rect clip;
@@ -1721,7 +1716,7 @@ nsgtk_history_draw_event(GtkWidget *widget, cairo_t *cr, gpointer data)
#else
/* signal handler functions for the local history window */
-static gboolean
+static gboolean
nsgtk_history_draw_event(GtkWidget *widget, GdkEventExpose *event, gpointer g)
{
struct rect clip;
@@ -1820,25 +1815,25 @@ static bool nsgtk_new_scaffolding_popup(struct gtk_scaffolding *g, GtkAccelGroup
SIG_CONNECT(nmenu->popup_menu, "hide",
nsgtk_window_popup_menu_hidden, g);
- g_signal_connect(nmenu->savelink_menuitem, "activate",
+ g_signal_connect(nmenu->savelink_menuitem, "activate",
G_CALLBACK(nsgtk_on_savelink_activate_menu), g);
- g_signal_connect(nmenu->opentab_menuitem, "activate",
+ g_signal_connect(nmenu->opentab_menuitem, "activate",
G_CALLBACK(nsgtk_on_link_opentab_activate_menu), g);
- g_signal_connect(nmenu->openwin_menuitem, "activate",
+ g_signal_connect(nmenu->openwin_menuitem, "activate",
G_CALLBACK(nsgtk_on_link_openwin_activate_menu), g);
- g_signal_connect(nmenu->cut_menuitem, "activate",
+ g_signal_connect(nmenu->cut_menuitem, "activate",
G_CALLBACK(nsgtk_on_cut_activate_menu), g);
- g_signal_connect(nmenu->copy_menuitem, "activate",
+ g_signal_connect(nmenu->copy_menuitem, "activate",
G_CALLBACK(nsgtk_on_copy_activate_menu), g);
- g_signal_connect(nmenu->paste_menuitem, "activate",
+ g_signal_connect(nmenu->paste_menuitem, "activate",
G_CALLBACK(nsgtk_on_paste_activate_menu), g);
- g_signal_connect(nmenu->customize_menuitem, "activate",
+ g_signal_connect(nmenu->customize_menuitem, "activate",
G_CALLBACK(nsgtk_on_customize_activate_menu), g);
/* set initial popup menu visibility */
@@ -1942,10 +1937,10 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
* or some sensible default if they're not set yet.
*/
if (nsoption_int(window_width) > 0) {
- gtk_window_move(g->window,
- nsoption_int(window_x),
+ gtk_window_move(g->window,
+ nsoption_int(window_x),
nsoption_int(window_y));
- gtk_window_resize(g->window,
+ gtk_window_resize(g->window,
nsoption_int(window_width),
nsoption_int(window_height));
} else {
@@ -1962,7 +1957,7 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
GtkIconSize tooliconsize;
GtkToolbarStyle toolbarstyle;
- g_object_get(settings,
+ g_object_get(settings,
"gtk-toolbar-icon-size", &tooliconsize,
"gtk-toolbar-style", &toolbarstyle, NULL);
@@ -2077,8 +2072,8 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
g_signal_connect(G_OBJECT(obj), (sig), G_CALLBACK(callback), (ptr))
/* connect history window signals to their handlers */
- nsgtk_connect_draw_event(GTK_WIDGET(g->history_window->drawing_area),
- G_CALLBACK(nsgtk_history_draw_event),
+ nsgtk_connect_draw_event(GTK_WIDGET(g->history_window->drawing_area),
+ G_CALLBACK(nsgtk_history_draw_event),
g->history_window);
/*CONNECT(g->history_window->drawing_area, "motion_notify_event",
nsgtk_history_motion_notify_event, g->history_window);*/
@@ -2107,12 +2102,10 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
CONNECT(g->search->entry, "key-press-event", nsgtk_search_entry_key, g);
CONNECT(g->search->buttons[2], "clicked",
nsgtk_search_close_button_clicked, g);
- CONNECT(g->search->caseSens, "toggled", nsgtk_search_entry_changed,
- g);
-
+ CONNECT(g->search->caseSens, "toggled", nsgtk_search_entry_changed, g);
CONNECT(g->tool_bar, "popup-context-menu",
- nsgtk_window_tool_bar_clicked, g);
+ nsgtk_window_tool_bar_clicked, g);
/* create popup menu */
nsgtk_new_scaffolding_popup(g, group);
@@ -2242,13 +2235,13 @@ nsgtk_scaffolding_set_icon(struct gui_window *gw)
GdkPixbuf *icon_pixbuf = nsgtk_get_icon(gw);
/* check icon needs to be shown */
- if ((icon_pixbuf == NULL) ||
+ if ((icon_pixbuf == NULL) ||
(sc->top_level != gw)) {
return;
}
- nsgtk_entry_set_icon_from_pixbuf(sc->url_bar,
- GTK_ENTRY_ICON_PRIMARY,
+ nsgtk_entry_set_icon_from_pixbuf(sc->url_bar,
+ GTK_ENTRY_ICON_PRIMARY,
icon_pixbuf);
gtk_widget_show_all(GTK_WIDGET(sc->buttons[URL_BAR_ITEM]->button));
@@ -2260,7 +2253,7 @@ void gui_window_set_search_ico(hlcache_handle *ico)
nsgtk_scaffolding *current;
GdkPixbuf *srch_pixbuf;
- if ((ico == NULL) &&
+ if ((ico == NULL) &&
(ico = search_web_ico()) == NULL) {
return;
}
@@ -2278,7 +2271,7 @@ void gui_window_set_search_ico(hlcache_handle *ico)
/* add ico to each window's toolbar */
for (current = scaf_list; current != NULL; current = current->next) {
- nsgtk_entry_set_icon_from_pixbuf(current->webSearchEntry,
+ nsgtk_entry_set_icon_from_pixbuf(current->webSearchEntry,
GTK_ENTRY_ICON_PRIMARY,
srch_pixbuf);
}
diff --git a/gtk/window.c b/gtk/window.c
index 5edace8..6a5cce1 100644
--- a/gtk/window.c
+++ b/gtk/window.c
@@ -44,6 +44,10 @@
#include "utils/log.h"
#include "utils/utils.h"
+/* helper macro to conenct signals to callbacks */
+#define CONNECT(obj, sig, callback, ptr) \
+ g_signal_connect(G_OBJECT(obj), (sig), G_CALLBACK(callback), (ptr))
+
extern const GdkPixdata menu_cursor_pixdata;
struct gui_window {
@@ -83,9 +87,12 @@ struct gui_window {
/** statusbar */
GtkLabel *status_bar;
- /** scrollbar paned */
+ /** status pane */
GtkPaned *paned;
+ /** has the status pane had its first size operation yet? */
+ bool paned_sized;
+
/** to allow disactivation / resume of normal window behaviour */
gulong signalhandler[NSGTK_WINDOW_SIGNAL_COUNT];
@@ -147,7 +154,7 @@ float nsgtk_get_scale_for_gui(struct gui_window *g)
#if GTK_CHECK_VERSION(3,0,0)
-static gboolean
+static gboolean
nsgtk_window_draw_event(GtkWidget *widget, cairo_t *cr, gpointer data)
{
struct gui_window *gw = data;
@@ -202,7 +209,7 @@ nsgtk_window_draw_event(GtkWidget *widget, cairo_t *cr, gpointer data)
#else
-static gboolean
+static gboolean
nsgtk_window_draw_event(GtkWidget *widget, GdkEventExpose *event, gpointer data)
{
struct gui_window *gw = data;
@@ -480,7 +487,7 @@ static gboolean nsgtk_window_keypress_event(GtkWidget *widget,
if (browser_window_key_press(g->bw, nskey))
return TRUE;
- if ((event->state & 0x7) != 0)
+ if ((event->state & 0x7) != 0)
return TRUE;
double value;
@@ -591,17 +598,49 @@ static gboolean nsgtk_window_size_allocate_event(GtkWidget *widget,
g->bw->reformat_pending = true;
browser_reformat_pending = true;
- if (g->paned != NULL) {
- /* Set status bar / scroll bar proportion according to
- * option_toolbar_status_size */
- /* TODO: Probably want to detect when the user adjusts the
- * status bar width, remember that proportion for the
- * window, and use that here. */
- gtk_paned_set_position(g->paned,
- (nsoption_int(toolbar_status_size) *
- allocation->width) / 10000);
+
+ return TRUE;
+}
+
+
+/** when the pane position is changed update the user option
+ *
+ * The slightly awkward implementation with the first allocation flag
+ * is necessary because the initial window creation does not cause an
+ * allocate-event signal so the position value in the pane is incorrect
+ * and we cannot know what it should be until after the allocation
+ * (which did not generate a signal) is done as the user position is a
+ * percentage of pane total width not an absolute value.
+ */
+static void
+nsgtk_paned_notify__position(GObject *gobject, GParamSpec *pspec, gpointer data)
+{
+ struct gui_window *g = data;
+ GtkAllocation pane_alloc;
+
+ gtk_widget_get_allocation(GTK_WIDGET(g->paned), &pane_alloc);
+
+ if (g->paned_sized == false)
+ {
+ g->paned_sized = true;
+ gtk_paned_set_position(g->paned,
+ (nsoption_int(toolbar_status_size) * pane_alloc.width) / 10000);
+ return;
}
+ nsoption_set_int(toolbar_status_size,
+ ((gtk_paned_get_position(g->paned) * 10000) / (pane_alloc.width - 1)));
+}
+
+/** Set status bar / scroll bar proportion according to user option
+ * when pane is resized.
+ */
+static gboolean nsgtk_paned_size_allocate_event(GtkWidget *widget,
+ GtkAllocation *allocation, gpointer data)
+{
+ gtk_paned_set_position(GTK_PANED(widget),
+ (nsoption_int(toolbar_status_size) * allocation->width) / 10000);
+
return TRUE;
}
@@ -611,6 +650,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
bool new_tab)
{
struct gui_window *g; /**< what we're creating to return */
+ GError* error = NULL;
g = calloc(1, sizeof(*g));
if (!g) {
@@ -621,7 +661,6 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
LOG(("Creating gui window %p for browser window %p", g, bw));
g->bw = bw;
- g->paned = NULL;
g->mouse.state = 0;
g->current_pointer = GUI_POINTER_DEFAULT;
if (clone != NULL) {
@@ -630,8 +669,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
bw->scale = (float) nsoption_int(scale) / 100.0;
}
- g->careth = 0;
-
+ /* attach scaffold */
if (new_tab) {
assert(clone != NULL);
g->scaffold = clone->window->scaffold;
@@ -639,7 +677,6 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
/* Now construct and attach a scaffold */
g->scaffold = nsgtk_new_scaffolding(g);
}
-
if (g->scaffold == NULL) {
warn_user("NoMemory", 0);
free(g);
@@ -649,10 +686,9 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
/* Construct our primary elements */
/* top-level document (not a frame) => create a new tab */
- GError* error = NULL;
GtkBuilder* xml = gtk_builder_new();
- if (!gtk_builder_add_from_file(xml,
- glade_file_location->tabcontents,
+ if (!gtk_builder_add_from_file(xml,
+ glade_file_location->tabcontents,
&error)) {
g_warning ("Couldn't load builder file: %s", error->message);
g_error_free(error);
@@ -706,28 +742,35 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
nsgtk_widget_set_can_focus(GTK_WIDGET(g->layout), TRUE);
/* set the default background colour of the drawing area to white. */
- nsgtk_widget_override_background_color(GTK_WIDGET(g->layout),
+ nsgtk_widget_override_background_color(GTK_WIDGET(g->layout),
GTK_STATE_NORMAL, 0, 0xffff, 0xffff, 0xffff);
- nsgtk_connect_draw_event(GTK_WIDGET(g->layout), G_CALLBACK(nsgtk_window_draw_event), g);
+ nsgtk_connect_draw_event(GTK_WIDGET(g->layout),
+ G_CALLBACK(nsgtk_window_draw_event), g);
-#define CONNECT(obj, sig, callback, ptr) \
- g_signal_connect(G_OBJECT(obj), (sig), G_CALLBACK(callback), (ptr))
-
- CONNECT(g->layout, "motion_notify_event",
+ /* layout signals */
+ CONNECT(g->layout, "motion-notify-event",
nsgtk_window_motion_notify_event, g);
g->signalhandler[NSGTK_WINDOW_SIGNAL_CLICK] =
- CONNECT(g->layout, "button_press_event",
+ CONNECT(g->layout, "button-press-event",
nsgtk_window_button_press_event, g);
- CONNECT(g->layout, "button_release_event",
+ CONNECT(g->layout, "button-release-event",
nsgtk_window_button_release_event, g);
- CONNECT(g->layout, "key_press_event",
+ CONNECT(g->layout, "key-press-event",
nsgtk_window_keypress_event, g);
- CONNECT(g->layout, "size_allocate",
+ CONNECT(g->layout, "size-allocate",
nsgtk_window_size_allocate_event, g);
CONNECT(g->layout, "scroll-event",
nsgtk_window_scroll_event, g);
+
+ /* status pane signals */
+ CONNECT(g->paned, "size-allocate",
+ nsgtk_paned_size_allocate_event, g);
+
+ CONNECT(g->paned, "notify::position",
+ nsgtk_paned_notify__position, g);
+
return g;
}
@@ -813,8 +856,8 @@ void gui_window_set_icon(struct gui_window *gw, hlcache_handle *icon)
if (icon_bitmap != NULL) {
LOG(("Using %p bitmap", icon_bitmap));
gw->icon = nsgdk_pixbuf_get_from_surface(icon_bitmap->surface, 16, 16);
- }
- }
+ }
+ }
if (gw->icon == NULL) {
LOG(("Using default favicon"));
@@ -1029,7 +1072,7 @@ void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape)
gtk_widget_get_display(
GTK_WIDGET(g->layout)),
cursortype);
- gdk_window_set_cursor(nsgtk_widget_get_window(GTK_WIDGET(g->layout)),
+ gdk_window_set_cursor(nsgtk_widget_get_window(GTK_WIDGET(g->layout)),
cursor);
if (!nullcursor)
@@ -1100,4 +1143,3 @@ void gui_window_get_dimensions(struct gui_window *g, int *width, int *height,
LOG(("width: %i", *width));
LOG(("height: %i", *height));
}
-
--
NetSurf Browser
10 years, 2 months
netsurf: branch master updated. release/3.0-201-g6358290
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/6358290e78e340ee82c26...
...commit http://git.netsurf-browser.org/netsurf.git/commit/6358290e78e340ee82c26ab...
...tree http://git.netsurf-browser.org/netsurf.git/tree/6358290e78e340ee82c26ab8e...
The branch, master has been updated
via 6358290e78e340ee82c26ab8e327b48db1f8c43e (commit)
from ba297a71796a61dfd4d50a3611587cd01550c4e0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=6358290e78e340ee82c...
commit 6358290e78e340ee82c26ab8e327b48db1f8c43e
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Correct the readme a bit
diff --git a/amiga/dist/netsurf.readme b/amiga/dist/netsurf.readme
index 47a9381..bd37b2e 100755
--- a/amiga/dist/netsurf.readme
+++ b/amiga/dist/netsurf.readme
@@ -2,13 +2,10 @@ Short: Fast CSS capable web browser
Uploader: chris(a)unsatisfactorysoftware.co.uk (Chris Young)
Author: NetSurf contributors (OS4 port by Chris Young)
Type: comm/www
-Version: 3.0 development
+Version: 3.1 development
Architecture: ppc-amigaos >= 4.0.0
-Install manually with Installer script only -
-INTENTIONALLY NOT AVAILABLE VIA AMIUPDATE
-
-This is a test build of NetSurf 3.0 for AmigaOS 4.
+This is a test build of NetSurf 3.1 for AmigaOS 4.
It is beta software, which means it is unstable and missing
features - use at your own risk!
-----------------------------------------------------------------------
Summary of changes:
amiga/dist/netsurf.readme | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/amiga/dist/netsurf.readme b/amiga/dist/netsurf.readme
index 47a9381..bd37b2e 100755
--- a/amiga/dist/netsurf.readme
+++ b/amiga/dist/netsurf.readme
@@ -2,13 +2,10 @@ Short: Fast CSS capable web browser
Uploader: chris(a)unsatisfactorysoftware.co.uk (Chris Young)
Author: NetSurf contributors (OS4 port by Chris Young)
Type: comm/www
-Version: 3.0 development
+Version: 3.1 development
Architecture: ppc-amigaos >= 4.0.0
-Install manually with Installer script only -
-INTENTIONALLY NOT AVAILABLE VIA AMIUPDATE
-
-This is a test build of NetSurf 3.0 for AmigaOS 4.
+This is a test build of NetSurf 3.1 for AmigaOS 4.
It is beta software, which means it is unstable and missing
features - use at your own risk!
--
NetSurf Browser
10 years, 3 months
netsurf: branch master updated. release/3.0-200-gba297a7
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/ba297a71796a61dfd4d50...
...commit http://git.netsurf-browser.org/netsurf.git/commit/ba297a71796a61dfd4d50a3...
...tree http://git.netsurf-browser.org/netsurf.git/tree/ba297a71796a61dfd4d50a361...
The branch, master has been updated
via ba297a71796a61dfd4d50a3611587cd01550c4e0 (commit)
from 6549c066837eeb5e022f697450e743d40404c3d8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=ba297a71796a61dfd4d...
commit ba297a71796a61dfd4d50a3611587cd01550c4e0
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Create a helper launch script, and make launch-handler use it
diff --git a/amiga/dist/Install b/amiga/dist/Install
index 3977629..61defec 100755
--- a/amiga/dist/Install
+++ b/amiga/dist/Install
@@ -426,6 +426,7 @@
" by launching a web browser.\n\n"
"The installation will update the configuration of "
"OS4.1 to allow URLs to be opened by NetSurf.")
+ (default 1)
)
)
)
@@ -610,6 +611,54 @@
(p_setmimetype "zip" "application/x-zip")
(p_setmimetype "js" "application/javascript")
+(complete 97)
+
+(if (>= osver 53)
+ (if (= (exists "Rexx:NetSurf") 0)
+ (
+ (textfile
+ (prompt "Creating NetSurf launch helper")
+ (help @textfile-help)
+ (dest "Rexx:NetSurf")
+ (append "/*\n"
+" * Copyright 2013 Chris Young <chris(a)unsatisfactorysoftware.co.uk>\n"
+" *\n"
+" * This file is part of NetSurf, http://www.netsurf-browser.org/\n"
+" *\n"
+" * NetSurf is free software; you can redistribute it and/or modify\n"
+" * it under the terms of the GNU General Public License as published by\n"
+" * the Free Software Foundation; version 2 of the License.\n"
+" *\n"
+" * NetSurf is distributed in the hope that it will be useful,\n"
+" * but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+" * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
+" * GNU General Public License for more details.\n"
+" *\n"
+" * You should have received a copy of the GNU General Public License\n"
+" * along with this program. If not, see <http://www.gnu.org/licenses/>.\n"
+" */\n"
+"\n"
+"/* This is a convenience script for launching NetSurf from the Shell.\n"
+" * If NetSurf is already running it will open the supplied URL in a new tab.\n"
+" * This can be used in URL Prefs in place of directly calling APPDIR:NetSurf.\n"
+" */\n"
+"\n"
+"options results\n"
+"parse arg url\n"
+"\n"
+"if show('P', 'NETSURF') then do\n"
+" address NETSURF 'OPEN' url 'NEWTAB'\n"
+" address NETSURF 'TOFRONT'\n"
+"end\n"
+"else do\n"
+" address command 'APPDIR:NetSurf URL' url\n"
+"end\n")
+ )
+ (protect "Rexx:NetSurf" "+se")
+ )
+ )
+)
+
(complete 98)
(if (= #addlaunchhandler 1)
@@ -621,23 +670,23 @@
(working "Adding NetSurf to launch-handler config")
(if (= (p_chk_launch-handler "FILE.LH") 0)
- (p_fitr "ENVARC:launch-handler/URL/FILE.LH" "ClientName=\"NETSURF\" ClientPath=\"APPDIR:NETSURF\" CMDFORMAT=\"URL=*\"file:///%s*\"\"")
+ (p_fitr "ENVARC:launch-handler/URL/FILE.LH" "ClientName=\"NETSURF\" ClientPath=\"Rexx:NetSurf\" CMDFORMAT=\"*\"file:///%s*\"\"")
)
(if (= (p_chk_launch-handler "HTTP.LH") 0)
- (p_fitr "ENVARC:launch-handler/URL/HTTP.LH" "ClientName=\"NETSURF\" ClientPath=\"APPDIR:NETSURF\" CMDFORMAT=\"URL=*\"http://%s*\"\"")
+ (p_fitr "ENVARC:launch-handler/URL/HTTP.LH" "ClientName=\"NETSURF\" ClientPath=\"Rexx:NetSurf\" CMDFORMAT=\"*\"http://%s*\"\"")
)
(if (= (p_chk_launch-handler "HTTPS.LH") 0)
- (p_fitr "ENVARC:launch-handler/URL/HTTPS.LH" "ClientName=\"NETSURF\" ClientPath=\"APPDIR:NETSURF\" CMDFORMAT=\"URL=*\"https://%s*\"\"")
+ (p_fitr "ENVARC:launch-handler/URL/HTTPS.LH" "ClientName=\"NETSURF\" ClientPath=\"Rexx:NetSurf\" CMDFORMAT=\"*\"https://%s*\"\"")
)
(if (= (p_chk_launch-handler "WWW.LH") 0)
- (p_fitr "ENVARC:launch-handler/URL/WWW.LH" "ClientName=\"NETSURF\" ClientPath=\"APPDIR:NETSURF\" CMDFORMAT=\"URL=*\"http://www.%s*\"\"")
+ (p_fitr "ENVARC:launch-handler/URL/WWW.LH" "ClientName=\"NETSURF\" ClientPath=\"Rexx:NetSurf\" CMDFORMAT=\"*\"http://www.%s*\"\"")
)
; (if (= (p_chk_launch-handler "FTP.LH") 0)
-; (p_fitr "ENVARC:launch-handler/URL/FTP.LH" "ClientName=\"NETSURF\" ClientPath=\"APPDIR:NETSURF\" CMDFORMAT=\"URL=*\"ftp://%s*\"\"")
+; (p_fitr "ENVARC:launch-handler/URL/FTP.LH" "ClientName=\"NETSURF\" ClientPath=\"Rexx:NetSurf\" CMDFORMAT=\"*\"ftp://%s*\"\"")
; )
)
)
-----------------------------------------------------------------------
Summary of changes:
amiga/dist/Install | 59 +++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 54 insertions(+), 5 deletions(-)
diff --git a/amiga/dist/Install b/amiga/dist/Install
index 3977629..61defec 100755
--- a/amiga/dist/Install
+++ b/amiga/dist/Install
@@ -426,6 +426,7 @@
" by launching a web browser.\n\n"
"The installation will update the configuration of "
"OS4.1 to allow URLs to be opened by NetSurf.")
+ (default 1)
)
)
)
@@ -610,6 +611,54 @@
(p_setmimetype "zip" "application/x-zip")
(p_setmimetype "js" "application/javascript")
+(complete 97)
+
+(if (>= osver 53)
+ (if (= (exists "Rexx:NetSurf") 0)
+ (
+ (textfile
+ (prompt "Creating NetSurf launch helper")
+ (help @textfile-help)
+ (dest "Rexx:NetSurf")
+ (append "/*\n"
+" * Copyright 2013 Chris Young <chris(a)unsatisfactorysoftware.co.uk>\n"
+" *\n"
+" * This file is part of NetSurf, http://www.netsurf-browser.org/\n"
+" *\n"
+" * NetSurf is free software; you can redistribute it and/or modify\n"
+" * it under the terms of the GNU General Public License as published by\n"
+" * the Free Software Foundation; version 2 of the License.\n"
+" *\n"
+" * NetSurf is distributed in the hope that it will be useful,\n"
+" * but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+" * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
+" * GNU General Public License for more details.\n"
+" *\n"
+" * You should have received a copy of the GNU General Public License\n"
+" * along with this program. If not, see <http://www.gnu.org/licenses/>.\n"
+" */\n"
+"\n"
+"/* This is a convenience script for launching NetSurf from the Shell.\n"
+" * If NetSurf is already running it will open the supplied URL in a new tab.\n"
+" * This can be used in URL Prefs in place of directly calling APPDIR:NetSurf.\n"
+" */\n"
+"\n"
+"options results\n"
+"parse arg url\n"
+"\n"
+"if show('P', 'NETSURF') then do\n"
+" address NETSURF 'OPEN' url 'NEWTAB'\n"
+" address NETSURF 'TOFRONT'\n"
+"end\n"
+"else do\n"
+" address command 'APPDIR:NetSurf URL' url\n"
+"end\n")
+ )
+ (protect "Rexx:NetSurf" "+se")
+ )
+ )
+)
+
(complete 98)
(if (= #addlaunchhandler 1)
@@ -621,23 +670,23 @@
(working "Adding NetSurf to launch-handler config")
(if (= (p_chk_launch-handler "FILE.LH") 0)
- (p_fitr "ENVARC:launch-handler/URL/FILE.LH" "ClientName=\"NETSURF\" ClientPath=\"APPDIR:NETSURF\" CMDFORMAT=\"URL=*\"file:///%s*\"\"")
+ (p_fitr "ENVARC:launch-handler/URL/FILE.LH" "ClientName=\"NETSURF\" ClientPath=\"Rexx:NetSurf\" CMDFORMAT=\"*\"file:///%s*\"\"")
)
(if (= (p_chk_launch-handler "HTTP.LH") 0)
- (p_fitr "ENVARC:launch-handler/URL/HTTP.LH" "ClientName=\"NETSURF\" ClientPath=\"APPDIR:NETSURF\" CMDFORMAT=\"URL=*\"http://%s*\"\"")
+ (p_fitr "ENVARC:launch-handler/URL/HTTP.LH" "ClientName=\"NETSURF\" ClientPath=\"Rexx:NetSurf\" CMDFORMAT=\"*\"http://%s*\"\"")
)
(if (= (p_chk_launch-handler "HTTPS.LH") 0)
- (p_fitr "ENVARC:launch-handler/URL/HTTPS.LH" "ClientName=\"NETSURF\" ClientPath=\"APPDIR:NETSURF\" CMDFORMAT=\"URL=*\"https://%s*\"\"")
+ (p_fitr "ENVARC:launch-handler/URL/HTTPS.LH" "ClientName=\"NETSURF\" ClientPath=\"Rexx:NetSurf\" CMDFORMAT=\"*\"https://%s*\"\"")
)
(if (= (p_chk_launch-handler "WWW.LH") 0)
- (p_fitr "ENVARC:launch-handler/URL/WWW.LH" "ClientName=\"NETSURF\" ClientPath=\"APPDIR:NETSURF\" CMDFORMAT=\"URL=*\"http://www.%s*\"\"")
+ (p_fitr "ENVARC:launch-handler/URL/WWW.LH" "ClientName=\"NETSURF\" ClientPath=\"Rexx:NetSurf\" CMDFORMAT=\"*\"http://www.%s*\"\"")
)
; (if (= (p_chk_launch-handler "FTP.LH") 0)
-; (p_fitr "ENVARC:launch-handler/URL/FTP.LH" "ClientName=\"NETSURF\" ClientPath=\"APPDIR:NETSURF\" CMDFORMAT=\"URL=*\"ftp://%s*\"\"")
+; (p_fitr "ENVARC:launch-handler/URL/FTP.LH" "ClientName=\"NETSURF\" ClientPath=\"Rexx:NetSurf\" CMDFORMAT=\"*\"ftp://%s*\"\"")
; )
)
)
--
NetSurf Browser
10 years, 3 months
netsurf: branch master updated. release/3.0-199-g6549c06
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/6549c066837eeb5e022f6...
...commit http://git.netsurf-browser.org/netsurf.git/commit/6549c066837eeb5e022f697...
...tree http://git.netsurf-browser.org/netsurf.git/tree/6549c066837eeb5e022f69745...
The branch, master has been updated
via 6549c066837eeb5e022f697450e743d40404c3d8 (commit)
via 18f7d29a192536834ab727981b13958317c30d93 (commit)
via f432efa2b170c4f7eced378af2e4f80df560e641 (commit)
via 38966b1daa6aba9593ca4748e3a016a2488b384e (commit)
from 6c17aa78a7cae12edd12ff7d6ad543302462c585 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=6549c066837eeb5e022...
commit 6549c066837eeb5e022f697450e743d40404c3d8
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fix ARexx OPEN NEWTAB
diff --git a/amiga/arexx.c b/amiga/arexx.c
index ed05f6c..436aa8f 100644
--- a/amiga/arexx.c
+++ b/amiga/arexx.c
@@ -262,7 +262,7 @@ STATIC VOID rx_open(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu
BROWSER_WINDOW_TAB,
url,
NULL,
- NULL,
+ bw,
NULL);
}
else if(cmd->ac_ArgList[1])
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=18f7d29a192536834ab...
commit 18f7d29a192536834ab727981b13958317c30d93
Merge: f432efa 6c17aa7
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Merge branch 'master' of git://git.netsurf-browser.org/netsurf
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=f432efa2b170c4f7ece...
commit f432efa2b170c4f7eced378af2e4f80df560e641
Merge: f9e950b 38966b1
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Merge branch 'chris/scheduled-fetches'
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=38966b1daa6aba9593c...
commit 38966b1daa6aba9593ca4748e3a016a2488b384e
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
remove include
diff --git a/amiga/gui.c b/amiga/gui.c
index fbe46d0..e2616cf 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -17,7 +17,6 @@
*/
/* NetSurf core includes */
-#include "content/hlcache.h"
#include "content/urldb.h"
#include "css/utils.h"
#include "desktop/browser_private.h"
-----------------------------------------------------------------------
Summary of changes:
amiga/arexx.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/amiga/arexx.c b/amiga/arexx.c
index ed05f6c..436aa8f 100644
--- a/amiga/arexx.c
+++ b/amiga/arexx.c
@@ -262,7 +262,7 @@ STATIC VOID rx_open(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu
BROWSER_WINDOW_TAB,
url,
NULL,
- NULL,
+ bw,
NULL);
}
else if(cmd->ac_ArgList[1])
--
NetSurf Browser
10 years, 3 months
netsurf: branch master updated. release/3.0-195-g6c17aa7
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/6c17aa78a7cae12edd12f...
...commit http://git.netsurf-browser.org/netsurf.git/commit/6c17aa78a7cae12edd12ff7...
...tree http://git.netsurf-browser.org/netsurf.git/tree/6c17aa78a7cae12edd12ff7d6...
The branch, master has been updated
via 6c17aa78a7cae12edd12ff7d6ad543302462c585 (commit)
via 9b54d6bb9c49fa4127ec6b62f21a44c20ca912aa (commit)
from 431f9fde5f009f70b9519bbbfb6113f8461a2b9b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=6c17aa78a7cae12edd1...
commit 6c17aa78a7cae12edd12ff7d6ad543302462c585
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Add proxy bypass option
diff --git a/amiga/gui_options.c b/amiga/gui_options.c
index e436cd2..a1bd291 100755
--- a/amiga/gui_options.c
+++ b/amiga/gui_options.c
@@ -96,6 +96,7 @@ enum
GID_OPTS_PROXY_PORT,
GID_OPTS_PROXY_USER,
GID_OPTS_PROXY_PASS,
+ GID_OPTS_PROXY_BYPASS,
GID_OPTS_FETCHMAX,
GID_OPTS_FETCHHOST,
GID_OPTS_FETCHCACHE,
@@ -278,6 +279,7 @@ void ami_gui_opts_setup(void)
gadlab[GID_OPTS_PROXY_HOST] = (char *)ami_utf8_easy((char *)messages_get("Host"));
gadlab[GID_OPTS_PROXY_USER] = (char *)ami_utf8_easy((char *)messages_get("Username"));
gadlab[GID_OPTS_PROXY_PASS] = (char *)ami_utf8_easy((char *)messages_get("Password"));
+ gadlab[GID_OPTS_PROXY_BYPASS] = (char *)ami_utf8_easy((char *)messages_get("ProxyBypass"));
gadlab[GID_OPTS_FETCHMAX] = (char *)ami_utf8_easy((char *)messages_get("FetchesMax"));
gadlab[GID_OPTS_FETCHHOST] = (char *)ami_utf8_easy((char *)messages_get("FetchesHost"));
gadlab[GID_OPTS_FETCHCACHE] = (char *)ami_utf8_easy((char *)messages_get("FetchesCached"));
@@ -401,7 +403,7 @@ void ami_gui_opts_open(void)
ULONG screenmodeid = 0;
ULONG proxytype = 0;
BOOL screenmodedisabled = FALSE, screennamedisabled = FALSE;
- BOOL proxyhostdisabled = TRUE, proxyauthdisabled = TRUE;
+ BOOL proxyhostdisabled = TRUE, proxyauthdisabled = TRUE, proxybypassdisabled = FALSE;
BOOL disableanims, animspeeddisabled = FALSE, acceptlangdisabled = FALSE;
BOOL scaleselected = nsoption_bool(scale_quality), scaledisabled = FALSE;
BOOL download_notify_disabled = FALSE;
@@ -441,7 +443,7 @@ void ami_gui_opts_open(void)
screenmodeid = strtoul(nsoption_charp(screen_modeid),NULL,0);
}
- if(nsoption_bool(http_proxy))
+ if(nsoption_bool(http_proxy) == true)
{
proxytype = nsoption_int(http_proxy_auth) + 1;
switch(nsoption_int(http_proxy_auth))
@@ -453,6 +455,8 @@ void ami_gui_opts_open(void)
proxyhostdisabled = FALSE;
break;
}
+ } else {
+ proxybypassdisabled = TRUE;
}
sprintf(animspeed,"%.2f",(float)(nsoption_int(minimum_gif_delay)/100.0));
@@ -819,6 +823,16 @@ void ami_gui_opts_open(void)
CHILD_Label, LabelObject,
LABEL_Text, gadlab[GID_OPTS_PROXY_PASS],
LabelEnd,
+ LAYOUT_AddChild, gow->objects[GID_OPTS_PROXY_BYPASS] = StringObject,
+ GA_ID, GID_OPTS_PROXY_BYPASS,
+ GA_RelVerify, TRUE,
+ GA_Disabled, proxybypassdisabled,
+ STRINGA_TextVal, nsoption_charp(http_proxy_noproxy),
+ STRINGA_BufferPos, 0,
+ StringEnd,
+ CHILD_Label, LabelObject,
+ LABEL_Text, gadlab[GID_OPTS_PROXY_BYPASS],
+ LabelEnd,
LayoutEnd, // proxy
CHILD_WeightedHeight, 0,
LAYOUT_AddChild,VGroupObject,
@@ -1642,6 +1656,9 @@ void ami_gui_opts_use(bool save)
GetAttr(STRINGA_TextVal,gow->objects[GID_OPTS_PROXY_PASS],(ULONG *)&data);
nsoption_set_charp(http_proxy_auth_pass, (char *)strdup((char *)data));
+ GetAttr(STRINGA_TextVal,gow->objects[GID_OPTS_PROXY_BYPASS],(ULONG *)&data);
+ nsoption_set_charp(http_proxy_noproxy, (char *)strdup((char *)data));
+
GetAttr(INTEGER_Number,gow->objects[GID_OPTS_FETCHMAX],(ULONG *)&nsoption_int(max_fetchers));
GetAttr(INTEGER_Number,gow->objects[GID_OPTS_FETCHHOST],(ULONG *)&nsoption_int(max_fetchers_per_host));
GetAttr(INTEGER_Number,gow->objects[GID_OPTS_FETCHCACHE],(ULONG *)&nsoption_int(max_cached_fetch_handles));
@@ -2013,6 +2030,8 @@ BOOL ami_gui_opts_event(void)
gow->win,NULL, GA_Disabled, TRUE, TAG_DONE);
RefreshSetGadgetAttrs((struct Gadget *)gow->objects[GID_OPTS_PROXY_PASS],
gow->win,NULL, GA_Disabled, TRUE, TAG_DONE);
+ RefreshSetGadgetAttrs((struct Gadget *)gow->objects[GID_OPTS_PROXY_BYPASS],
+ gow->win,NULL, GA_Disabled, TRUE, TAG_DONE);
break;
case 1:
RefreshSetGadgetAttrs((struct Gadget *)gow->objects[GID_OPTS_PROXY_HOST],
@@ -2024,6 +2043,8 @@ BOOL ami_gui_opts_event(void)
gow->win,NULL, GA_Disabled, TRUE, TAG_DONE);
RefreshSetGadgetAttrs((struct Gadget *)gow->objects[GID_OPTS_PROXY_PASS],
gow->win,NULL, GA_Disabled, TRUE, TAG_DONE);
+ RefreshSetGadgetAttrs((struct Gadget *)gow->objects[GID_OPTS_PROXY_BYPASS],
+ gow->win,NULL, GA_Disabled, FALSE, TAG_DONE);
break;
case 2:
@@ -2037,6 +2058,8 @@ BOOL ami_gui_opts_event(void)
gow->win,NULL, GA_Disabled, FALSE, TAG_DONE);
RefreshSetGadgetAttrs((struct Gadget *)gow->objects[GID_OPTS_PROXY_PASS],
gow->win,NULL, GA_Disabled, FALSE, TAG_DONE);
+ RefreshSetGadgetAttrs((struct Gadget *)gow->objects[GID_OPTS_PROXY_BYPASS],
+ gow->win,NULL, GA_Disabled, FALSE, TAG_DONE);
break;
}
break;
diff --git a/resources/FatMessages b/resources/FatMessages
index d25af01..5230783 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -5475,6 +5475,11 @@ de.all.Proxy:HTTP Proxy
fr.all.Proxy:HTTP Proxy
it.all.Proxy:Proxy HTTP
nl.all.Proxy:HTTP Proxy
+en.ami.ProxyBypass:Bypass proxy for
+de.ami.ProxyBypass:Bypass proxy for
+fr.ami.ProxyBypass:Bypass proxy for
+it.ami.ProxyBypass:Bypass proxy for
+nl.ami.ProxyBypass:Bypass proxy for
en.all.Fetching:Fetching
de.all.Fetching:Fetching
fr.all.Fetching:Fetching
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=9b54d6bb9c49fa4127e...
commit 9b54d6bb9c49fa4127ec6b62f21a44c20ca912aa
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Remove PDF menu item if built without PDF export
diff --git a/amiga/menu.c b/amiga/menu.c
index bcf42af..3e9ac97 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -192,8 +192,10 @@ void ami_init_menulabs(struct gui_window_2 *gwin)
ami_menu_item_project_save, (void *)AMINS_SAVE_TEXT);
ami_menu_alloc_item(gwin, M_SAVECOMP, NM_SUB, "SaveCompNS", 0, NULL,
ami_menu_item_project_save, (void *)AMINS_SAVE_COMPLETE);
+#ifdef WITH_PDF_EXPORT
ami_menu_alloc_item(gwin, M_SAVEPDF, NM_SUB, "PDFNS", 0, NULL,
ami_menu_item_project_save, (void *)AMINS_SAVE_PDF);
+#endif
ami_menu_alloc_item(gwin, M_SAVEIFF, NM_SUB, "IFF", 0, NULL,
ami_menu_item_project_save, (void *)AMINS_SAVE_IFF);
ami_menu_alloc_item(gwin, M_BAR_P2, NM_ITEM, NM_BARLABEL, 0, NULL, NULL, NULL);
@@ -317,9 +319,6 @@ struct NewMenu *ami_create_menu(struct gui_window_2 *gwin)
if(gwin->menu_hook[i].h_Entry) gwin->menu[i].nm_UserData = &gwin->menu_hook[i];
}
-#ifndef WITH_PDF_EXPORT
- gwin->menu[M_SAVEPDF].nm_Flags = NM_ITEMDISABLED;
-#endif
#if defined(WITH_JS) || defined(WITH_MOZJS)
gwin->menu[M_JS].nm_Flags = CHECKIT | MENUTOGGLE;
if(nsoption_bool(enable_javascript) == true)
@@ -466,7 +465,7 @@ void ami_menu_update_checked(struct gui_window_2 *gwin)
GetAttr(WINDOW_MenuStrip, gwin->objects[OID_MAIN], (ULONG *)&menustrip);
if(!menustrip) return;
-
+#if defined(WITH_JS) || defined(WITH_MOZJS)
if(nsoption_bool(enable_javascript) == true) {
if((ItemAddress(menustrip, AMI_MENU_JS)->Flags & CHECKED) == 0)
ItemAddress(menustrip, AMI_MENU_JS)->Flags ^= CHECKED;
@@ -474,7 +473,7 @@ void ami_menu_update_checked(struct gui_window_2 *gwin)
if(ItemAddress(menustrip, AMI_MENU_JS)->Flags & CHECKED)
ItemAddress(menustrip, AMI_MENU_JS)->Flags ^= CHECKED;
}
-
+#endif
if(nsoption_bool(foreground_images) == true) {
if((ItemAddress(menustrip, AMI_MENU_FOREIMG)->Flags & CHECKED) == 0)
ItemAddress(menustrip, AMI_MENU_FOREIMG)->Flags ^= CHECKED;
diff --git a/amiga/menu.h b/amiga/menu.h
index 53c2db5..e96fcf0 100755
--- a/amiga/menu.h
+++ b/amiga/menu.h
@@ -41,8 +41,10 @@ enum {
M_SAVESRC,
M_SAVETXT,
M_SAVECOMP,
- M_SAVEPDF,
M_SAVEIFF,
+#ifdef WITH_PDF_EXPORT
+ M_SAVEPDF,
+#endif
M_BAR_P2,
M_CLOSETAB,
M_CLOSEWIN,
@@ -108,8 +110,8 @@ enum {
/* The Intuition menu numbers of some menus we might need to modify */
#define AMI_MENU_SAVEAS_TEXT FULLMENUNUM(0,4,1)
#define AMI_MENU_SAVEAS_COMPLETE FULLMENUNUM(0,4,2)
-#define AMI_MENU_SAVEAS_PDF FULLMENUNUM(0,4,3)
-#define AMI_MENU_SAVEAS_IFF FULLMENUNUM(0,4,4)
+#define AMI_MENU_SAVEAS_IFF FULLMENUNUM(0,4,3)
+#define AMI_MENU_SAVEAS_PDF FULLMENUNUM(0,4,4)
#define AMI_MENU_CLOSETAB FULLMENUNUM(0,6,0)
#define AMI_MENU_CUT FULLMENUNUM(1,0,0)
#define AMI_MENU_COPY FULLMENUNUM(1,1,0)
-----------------------------------------------------------------------
Summary of changes:
amiga/gui_options.c | 27 +++++++++++++++++++++++++--
amiga/menu.c | 9 ++++-----
amiga/menu.h | 8 +++++---
resources/FatMessages | 5 +++++
4 files changed, 39 insertions(+), 10 deletions(-)
diff --git a/amiga/gui_options.c b/amiga/gui_options.c
index e436cd2..a1bd291 100755
--- a/amiga/gui_options.c
+++ b/amiga/gui_options.c
@@ -96,6 +96,7 @@ enum
GID_OPTS_PROXY_PORT,
GID_OPTS_PROXY_USER,
GID_OPTS_PROXY_PASS,
+ GID_OPTS_PROXY_BYPASS,
GID_OPTS_FETCHMAX,
GID_OPTS_FETCHHOST,
GID_OPTS_FETCHCACHE,
@@ -278,6 +279,7 @@ void ami_gui_opts_setup(void)
gadlab[GID_OPTS_PROXY_HOST] = (char *)ami_utf8_easy((char *)messages_get("Host"));
gadlab[GID_OPTS_PROXY_USER] = (char *)ami_utf8_easy((char *)messages_get("Username"));
gadlab[GID_OPTS_PROXY_PASS] = (char *)ami_utf8_easy((char *)messages_get("Password"));
+ gadlab[GID_OPTS_PROXY_BYPASS] = (char *)ami_utf8_easy((char *)messages_get("ProxyBypass"));
gadlab[GID_OPTS_FETCHMAX] = (char *)ami_utf8_easy((char *)messages_get("FetchesMax"));
gadlab[GID_OPTS_FETCHHOST] = (char *)ami_utf8_easy((char *)messages_get("FetchesHost"));
gadlab[GID_OPTS_FETCHCACHE] = (char *)ami_utf8_easy((char *)messages_get("FetchesCached"));
@@ -401,7 +403,7 @@ void ami_gui_opts_open(void)
ULONG screenmodeid = 0;
ULONG proxytype = 0;
BOOL screenmodedisabled = FALSE, screennamedisabled = FALSE;
- BOOL proxyhostdisabled = TRUE, proxyauthdisabled = TRUE;
+ BOOL proxyhostdisabled = TRUE, proxyauthdisabled = TRUE, proxybypassdisabled = FALSE;
BOOL disableanims, animspeeddisabled = FALSE, acceptlangdisabled = FALSE;
BOOL scaleselected = nsoption_bool(scale_quality), scaledisabled = FALSE;
BOOL download_notify_disabled = FALSE;
@@ -441,7 +443,7 @@ void ami_gui_opts_open(void)
screenmodeid = strtoul(nsoption_charp(screen_modeid),NULL,0);
}
- if(nsoption_bool(http_proxy))
+ if(nsoption_bool(http_proxy) == true)
{
proxytype = nsoption_int(http_proxy_auth) + 1;
switch(nsoption_int(http_proxy_auth))
@@ -453,6 +455,8 @@ void ami_gui_opts_open(void)
proxyhostdisabled = FALSE;
break;
}
+ } else {
+ proxybypassdisabled = TRUE;
}
sprintf(animspeed,"%.2f",(float)(nsoption_int(minimum_gif_delay)/100.0));
@@ -819,6 +823,16 @@ void ami_gui_opts_open(void)
CHILD_Label, LabelObject,
LABEL_Text, gadlab[GID_OPTS_PROXY_PASS],
LabelEnd,
+ LAYOUT_AddChild, gow->objects[GID_OPTS_PROXY_BYPASS] = StringObject,
+ GA_ID, GID_OPTS_PROXY_BYPASS,
+ GA_RelVerify, TRUE,
+ GA_Disabled, proxybypassdisabled,
+ STRINGA_TextVal, nsoption_charp(http_proxy_noproxy),
+ STRINGA_BufferPos, 0,
+ StringEnd,
+ CHILD_Label, LabelObject,
+ LABEL_Text, gadlab[GID_OPTS_PROXY_BYPASS],
+ LabelEnd,
LayoutEnd, // proxy
CHILD_WeightedHeight, 0,
LAYOUT_AddChild,VGroupObject,
@@ -1642,6 +1656,9 @@ void ami_gui_opts_use(bool save)
GetAttr(STRINGA_TextVal,gow->objects[GID_OPTS_PROXY_PASS],(ULONG *)&data);
nsoption_set_charp(http_proxy_auth_pass, (char *)strdup((char *)data));
+ GetAttr(STRINGA_TextVal,gow->objects[GID_OPTS_PROXY_BYPASS],(ULONG *)&data);
+ nsoption_set_charp(http_proxy_noproxy, (char *)strdup((char *)data));
+
GetAttr(INTEGER_Number,gow->objects[GID_OPTS_FETCHMAX],(ULONG *)&nsoption_int(max_fetchers));
GetAttr(INTEGER_Number,gow->objects[GID_OPTS_FETCHHOST],(ULONG *)&nsoption_int(max_fetchers_per_host));
GetAttr(INTEGER_Number,gow->objects[GID_OPTS_FETCHCACHE],(ULONG *)&nsoption_int(max_cached_fetch_handles));
@@ -2013,6 +2030,8 @@ BOOL ami_gui_opts_event(void)
gow->win,NULL, GA_Disabled, TRUE, TAG_DONE);
RefreshSetGadgetAttrs((struct Gadget *)gow->objects[GID_OPTS_PROXY_PASS],
gow->win,NULL, GA_Disabled, TRUE, TAG_DONE);
+ RefreshSetGadgetAttrs((struct Gadget *)gow->objects[GID_OPTS_PROXY_BYPASS],
+ gow->win,NULL, GA_Disabled, TRUE, TAG_DONE);
break;
case 1:
RefreshSetGadgetAttrs((struct Gadget *)gow->objects[GID_OPTS_PROXY_HOST],
@@ -2024,6 +2043,8 @@ BOOL ami_gui_opts_event(void)
gow->win,NULL, GA_Disabled, TRUE, TAG_DONE);
RefreshSetGadgetAttrs((struct Gadget *)gow->objects[GID_OPTS_PROXY_PASS],
gow->win,NULL, GA_Disabled, TRUE, TAG_DONE);
+ RefreshSetGadgetAttrs((struct Gadget *)gow->objects[GID_OPTS_PROXY_BYPASS],
+ gow->win,NULL, GA_Disabled, FALSE, TAG_DONE);
break;
case 2:
@@ -2037,6 +2058,8 @@ BOOL ami_gui_opts_event(void)
gow->win,NULL, GA_Disabled, FALSE, TAG_DONE);
RefreshSetGadgetAttrs((struct Gadget *)gow->objects[GID_OPTS_PROXY_PASS],
gow->win,NULL, GA_Disabled, FALSE, TAG_DONE);
+ RefreshSetGadgetAttrs((struct Gadget *)gow->objects[GID_OPTS_PROXY_BYPASS],
+ gow->win,NULL, GA_Disabled, FALSE, TAG_DONE);
break;
}
break;
diff --git a/amiga/menu.c b/amiga/menu.c
index bcf42af..3e9ac97 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -192,8 +192,10 @@ void ami_init_menulabs(struct gui_window_2 *gwin)
ami_menu_item_project_save, (void *)AMINS_SAVE_TEXT);
ami_menu_alloc_item(gwin, M_SAVECOMP, NM_SUB, "SaveCompNS", 0, NULL,
ami_menu_item_project_save, (void *)AMINS_SAVE_COMPLETE);
+#ifdef WITH_PDF_EXPORT
ami_menu_alloc_item(gwin, M_SAVEPDF, NM_SUB, "PDFNS", 0, NULL,
ami_menu_item_project_save, (void *)AMINS_SAVE_PDF);
+#endif
ami_menu_alloc_item(gwin, M_SAVEIFF, NM_SUB, "IFF", 0, NULL,
ami_menu_item_project_save, (void *)AMINS_SAVE_IFF);
ami_menu_alloc_item(gwin, M_BAR_P2, NM_ITEM, NM_BARLABEL, 0, NULL, NULL, NULL);
@@ -317,9 +319,6 @@ struct NewMenu *ami_create_menu(struct gui_window_2 *gwin)
if(gwin->menu_hook[i].h_Entry) gwin->menu[i].nm_UserData = &gwin->menu_hook[i];
}
-#ifndef WITH_PDF_EXPORT
- gwin->menu[M_SAVEPDF].nm_Flags = NM_ITEMDISABLED;
-#endif
#if defined(WITH_JS) || defined(WITH_MOZJS)
gwin->menu[M_JS].nm_Flags = CHECKIT | MENUTOGGLE;
if(nsoption_bool(enable_javascript) == true)
@@ -466,7 +465,7 @@ void ami_menu_update_checked(struct gui_window_2 *gwin)
GetAttr(WINDOW_MenuStrip, gwin->objects[OID_MAIN], (ULONG *)&menustrip);
if(!menustrip) return;
-
+#if defined(WITH_JS) || defined(WITH_MOZJS)
if(nsoption_bool(enable_javascript) == true) {
if((ItemAddress(menustrip, AMI_MENU_JS)->Flags & CHECKED) == 0)
ItemAddress(menustrip, AMI_MENU_JS)->Flags ^= CHECKED;
@@ -474,7 +473,7 @@ void ami_menu_update_checked(struct gui_window_2 *gwin)
if(ItemAddress(menustrip, AMI_MENU_JS)->Flags & CHECKED)
ItemAddress(menustrip, AMI_MENU_JS)->Flags ^= CHECKED;
}
-
+#endif
if(nsoption_bool(foreground_images) == true) {
if((ItemAddress(menustrip, AMI_MENU_FOREIMG)->Flags & CHECKED) == 0)
ItemAddress(menustrip, AMI_MENU_FOREIMG)->Flags ^= CHECKED;
diff --git a/amiga/menu.h b/amiga/menu.h
index 53c2db5..e96fcf0 100755
--- a/amiga/menu.h
+++ b/amiga/menu.h
@@ -41,8 +41,10 @@ enum {
M_SAVESRC,
M_SAVETXT,
M_SAVECOMP,
- M_SAVEPDF,
M_SAVEIFF,
+#ifdef WITH_PDF_EXPORT
+ M_SAVEPDF,
+#endif
M_BAR_P2,
M_CLOSETAB,
M_CLOSEWIN,
@@ -108,8 +110,8 @@ enum {
/* The Intuition menu numbers of some menus we might need to modify */
#define AMI_MENU_SAVEAS_TEXT FULLMENUNUM(0,4,1)
#define AMI_MENU_SAVEAS_COMPLETE FULLMENUNUM(0,4,2)
-#define AMI_MENU_SAVEAS_PDF FULLMENUNUM(0,4,3)
-#define AMI_MENU_SAVEAS_IFF FULLMENUNUM(0,4,4)
+#define AMI_MENU_SAVEAS_IFF FULLMENUNUM(0,4,3)
+#define AMI_MENU_SAVEAS_PDF FULLMENUNUM(0,4,4)
#define AMI_MENU_CLOSETAB FULLMENUNUM(0,6,0)
#define AMI_MENU_CUT FULLMENUNUM(1,0,0)
#define AMI_MENU_COPY FULLMENUNUM(1,1,0)
diff --git a/resources/FatMessages b/resources/FatMessages
index d25af01..5230783 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -5475,6 +5475,11 @@ de.all.Proxy:HTTP Proxy
fr.all.Proxy:HTTP Proxy
it.all.Proxy:Proxy HTTP
nl.all.Proxy:HTTP Proxy
+en.ami.ProxyBypass:Bypass proxy for
+de.ami.ProxyBypass:Bypass proxy for
+fr.ami.ProxyBypass:Bypass proxy for
+it.ami.ProxyBypass:Bypass proxy for
+nl.ami.ProxyBypass:Bypass proxy for
en.all.Fetching:Fetching
de.all.Fetching:Fetching
fr.all.Fetching:Fetching
--
NetSurf Browser
10 years, 3 months
netsurf: branch chris/gadtools-53-5 updated. release/3.0-196-gee82850
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/ee82850ee11cd7b3deff1...
...commit http://git.netsurf-browser.org/netsurf.git/commit/ee82850ee11cd7b3deff123...
...tree http://git.netsurf-browser.org/netsurf.git/tree/ee82850ee11cd7b3deff1233f...
The branch, chris/gadtools-53-5 has been updated
via ee82850ee11cd7b3deff1233fea1c7befd5ddfab (commit)
from cb10537b0b5ce71d38b300b4b0b4860493760cc4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=ee82850ee11cd7b3def...
commit ee82850ee11cd7b3deff1233fea1c7befd5ddfab
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Don't add a bitmap if the item is a folder (this seems to be buggy)
diff --git a/amiga/menu.c b/amiga/menu.c
index 844b44b..dfea80b 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -149,6 +149,7 @@ static void ami_menu_alloc_item(struct gui_window_2 *gwin, int num, UBYTE type,
if((label == NM_BARLABEL) || (strcmp(label, "--") == 0)) {
gwin->menulab[num] = NM_BARLABEL;
+ bm = NULL;
} else {
if((num >= AMI_MENU_HOTLIST) && (num <= AMI_MENU_HOTLIST_MAX)) {
gwin->menulab[num] = ami_utf8_easy(label);
@@ -163,7 +164,7 @@ static void ami_menu_alloc_item(struct gui_window_2 *gwin, int num, UBYTE type,
((GadToolsBase->lib_Version == 53) && (GadToolsBase->lib_Revision >= 5))) {
/* GadTools 53.5+ only. For now we will only create the menu
using label.image if there's a bitmap associated with the item. */
- if((bm != NULL) && (num == AMI_MENU_HOTLIST)) {
+ if(bm != NULL) {
struct DrawInfo *dri = GetScreenDrawInfo(scrn);
// struct BitMap *menu_icon = ami_bitmap_get_native(bm, 16, 16, NULL);
@@ -179,10 +180,10 @@ static void ami_menu_alloc_item(struct gui_window_2 *gwin, int num, UBYTE type,
BITMAP_Height, 16,
BitMapEnd,
*/
- LABEL_Text, gwin->menulab[num],
+ LABEL_Text, "test", //gwin->menulab[num],
LabelEnd;
- gwin->menutype[num] |= MENU_IMAGE;
+ if(gwin->menuobj[num]) gwin->menutype[num] |= MENU_IMAGE;
// }
FreeScreenDrawInfo(scrn, dri);
}
@@ -327,7 +328,7 @@ void ami_menu_refresh(struct gui_window_2 *gwin)
struct NewMenu *ami_create_menu(struct gui_window_2 *gwin)
{
int i;
-
+
gwin->menu = AllocVec(sizeof(struct NewMenu) * (AMI_MENU_AREXX_MAX + 1), MEMF_CLEAR);
ami_init_menulabs(gwin);
ami_menu_scan(ami_tree_get_tree(hotlist_window), gwin);
@@ -336,13 +337,12 @@ struct NewMenu *ami_create_menu(struct gui_window_2 *gwin)
for(i=0;i<=AMI_MENU_AREXX_MAX;i++)
{
gwin->menu[i].nm_Type = gwin->menutype[i];
- if(gwin->menuobj[i])
- gwin->menu[i].nm_Label = (void *)gwin->menuobj[i];
+ if(gwin->menutype[i] & MENU_IMAGE)
+ gwin->menu[i].nm_Label = (void *)gwin->menuobj[i];
else
gwin->menu[i].nm_Label = gwin->menulab[i];
if(gwin->menukey[i]) gwin->menu[i].nm_CommKey = &gwin->menukey[i];
- gwin->menu[i].nm_Flags = 0;
if(gwin->menu_hook[i].h_Entry) gwin->menu[i].nm_UserData = &gwin->menu_hook[i];
}
@@ -461,6 +461,7 @@ void ami_menu_scan_2(struct tree *tree, struct node *root, WORD *gen,
struct node_element *element=NULL;
struct node *node;
UBYTE menu_type;
+ struct bitmap *bm = NULL;
*gen = *gen + 1;
@@ -472,7 +473,9 @@ void ami_menu_scan_2(struct tree *tree, struct node *root, WORD *gen,
if(*gen == 1) menu_type = NM_ITEM;
if(*gen == 2) menu_type = NM_SUB;
-struct bitmap *bm = tree_url_node_get_icon(node); //ami_bitmap_from_datatype("TBimages:list_arexx");
+
+ if(tree_node_is_folder(node) == false)
+ bm = tree_url_node_get_icon(node); //ami_bitmap_from_datatype("TBimages:list_arexx");
ami_menu_alloc_item(gwin, *item, menu_type, tree_url_node_get_title(node),
0, bm,
ami_menu_item_hotlist_entries, (void *)tree_url_node_get_url(node));
-----------------------------------------------------------------------
Summary of changes:
amiga/menu.c | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/amiga/menu.c b/amiga/menu.c
index 844b44b..dfea80b 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -149,6 +149,7 @@ static void ami_menu_alloc_item(struct gui_window_2 *gwin, int num, UBYTE type,
if((label == NM_BARLABEL) || (strcmp(label, "--") == 0)) {
gwin->menulab[num] = NM_BARLABEL;
+ bm = NULL;
} else {
if((num >= AMI_MENU_HOTLIST) && (num <= AMI_MENU_HOTLIST_MAX)) {
gwin->menulab[num] = ami_utf8_easy(label);
@@ -163,7 +164,7 @@ static void ami_menu_alloc_item(struct gui_window_2 *gwin, int num, UBYTE type,
((GadToolsBase->lib_Version == 53) && (GadToolsBase->lib_Revision >= 5))) {
/* GadTools 53.5+ only. For now we will only create the menu
using label.image if there's a bitmap associated with the item. */
- if((bm != NULL) && (num == AMI_MENU_HOTLIST)) {
+ if(bm != NULL) {
struct DrawInfo *dri = GetScreenDrawInfo(scrn);
// struct BitMap *menu_icon = ami_bitmap_get_native(bm, 16, 16, NULL);
@@ -179,10 +180,10 @@ static void ami_menu_alloc_item(struct gui_window_2 *gwin, int num, UBYTE type,
BITMAP_Height, 16,
BitMapEnd,
*/
- LABEL_Text, gwin->menulab[num],
+ LABEL_Text, "test", //gwin->menulab[num],
LabelEnd;
- gwin->menutype[num] |= MENU_IMAGE;
+ if(gwin->menuobj[num]) gwin->menutype[num] |= MENU_IMAGE;
// }
FreeScreenDrawInfo(scrn, dri);
}
@@ -327,7 +328,7 @@ void ami_menu_refresh(struct gui_window_2 *gwin)
struct NewMenu *ami_create_menu(struct gui_window_2 *gwin)
{
int i;
-
+
gwin->menu = AllocVec(sizeof(struct NewMenu) * (AMI_MENU_AREXX_MAX + 1), MEMF_CLEAR);
ami_init_menulabs(gwin);
ami_menu_scan(ami_tree_get_tree(hotlist_window), gwin);
@@ -336,13 +337,12 @@ struct NewMenu *ami_create_menu(struct gui_window_2 *gwin)
for(i=0;i<=AMI_MENU_AREXX_MAX;i++)
{
gwin->menu[i].nm_Type = gwin->menutype[i];
- if(gwin->menuobj[i])
- gwin->menu[i].nm_Label = (void *)gwin->menuobj[i];
+ if(gwin->menutype[i] & MENU_IMAGE)
+ gwin->menu[i].nm_Label = (void *)gwin->menuobj[i];
else
gwin->menu[i].nm_Label = gwin->menulab[i];
if(gwin->menukey[i]) gwin->menu[i].nm_CommKey = &gwin->menukey[i];
- gwin->menu[i].nm_Flags = 0;
if(gwin->menu_hook[i].h_Entry) gwin->menu[i].nm_UserData = &gwin->menu_hook[i];
}
@@ -461,6 +461,7 @@ void ami_menu_scan_2(struct tree *tree, struct node *root, WORD *gen,
struct node_element *element=NULL;
struct node *node;
UBYTE menu_type;
+ struct bitmap *bm = NULL;
*gen = *gen + 1;
@@ -472,7 +473,9 @@ void ami_menu_scan_2(struct tree *tree, struct node *root, WORD *gen,
if(*gen == 1) menu_type = NM_ITEM;
if(*gen == 2) menu_type = NM_SUB;
-struct bitmap *bm = tree_url_node_get_icon(node); //ami_bitmap_from_datatype("TBimages:list_arexx");
+
+ if(tree_node_is_folder(node) == false)
+ bm = tree_url_node_get_icon(node); //ami_bitmap_from_datatype("TBimages:list_arexx");
ami_menu_alloc_item(gwin, *item, menu_type, tree_url_node_get_title(node),
0, bm,
ami_menu_item_hotlist_entries, (void *)tree_url_node_get_url(node));
--
NetSurf Browser
10 years, 3 months
netsurf: branch master updated. release/3.0-193-g431f9fd
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/431f9fde5f009f70b9519...
...commit http://git.netsurf-browser.org/netsurf.git/commit/431f9fde5f009f70b9519bb...
...tree http://git.netsurf-browser.org/netsurf.git/tree/431f9fde5f009f70b9519bbbf...
The branch, master has been updated
via 431f9fde5f009f70b9519bbbfb6113f8461a2b9b (commit)
from 1f14790d47ffb81095d778cbef80cc638518a685 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=431f9fde5f009f70b95...
commit 431f9fde5f009f70b9519bbbfb6113f8461a2b9b
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Apply vertical alignment to objects on line.
diff --git a/render/layout.c b/render/layout.c
index 14d06ee..fd518d9 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -2911,7 +2911,8 @@ bool layout_line(struct box *first, int *width, int *y,
if ((d->type == BOX_INLINE && d->inline_end) ||
d->type == BOX_BR ||
d->type == BOX_TEXT ||
- d->type == BOX_INLINE_END) {
+ d->type == BOX_INLINE_END ||
+ d->object != NULL) {
css_fixed value = 0;
css_unit unit = CSS_UNIT_PX;
switch (css_computed_vertical_align(d->style, &value,
-----------------------------------------------------------------------
Summary of changes:
render/layout.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/render/layout.c b/render/layout.c
index 14d06ee..fd518d9 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -2911,7 +2911,8 @@ bool layout_line(struct box *first, int *width, int *y,
if ((d->type == BOX_INLINE && d->inline_end) ||
d->type == BOX_BR ||
d->type == BOX_TEXT ||
- d->type == BOX_INLINE_END) {
+ d->type == BOX_INLINE_END ||
+ d->object != NULL) {
css_fixed value = 0;
css_unit unit = CSS_UNIT_PX;
switch (css_computed_vertical_align(d->style, &value,
--
NetSurf Browser
10 years, 3 months