Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/021efe70b5348fba8664027cc1095480bd0fa846
...commit
http://git.netsurf-browser.org/netsurf.git/commit/021efe70b5348fba8664027cc1095480bd0fa846
...tree
http://git.netsurf-browser.org/netsurf.git/tree/021efe70b5348fba8664027cc1095480bd0fa846
The branch, vince/gtk-tab-restyle has been updated
via 021efe70b5348fba8664027cc1095480bd0fa846 (commit)
via 8167e022a8fb81d31094da6a26918d0387101ffb (commit)
via 47ea0989037f2d5eddf23230f154ed3399e48477 (commit)
from 5701bae85911a3b1b003e1b717114388af151567 (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=021efe70b5348fba8664027cc1095480bd0fa846
commit 021efe70b5348fba8664027cc1095480bd0fa846
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>
set menu activation handler using toolbar items
diff --git a/frontends/gtk/scaffolding.c b/frontends/gtk/scaffolding.c
index 350d5a9..7432812 100644
--- a/frontends/gtk/scaffolding.c
+++ b/frontends/gtk/scaffolding.c
@@ -459,8 +459,8 @@ nsgtk_window_tabs_remove(GtkNotebook *notebook,
/**
* handle menu activate signals by calling toolbar item activation
*/
-#define TOOLBAR_ITEM_y(identifier, name) \
-static gboolean
\
+#define TOOLBAR_ITEM_y(identifier, name) \
+ static gboolean \
nsgtk_on_##name##_activate_menu(GtkMenuItem *widget, gpointer data) \
{ \
struct nsgtk_scaffolding *gs = (struct nsgtk_scaffolding *)data;\
@@ -468,8 +468,8 @@ nsgtk_on_##name##_activate_menu(GtkMenuItem *widget,
gpointer data) \
return TRUE; \
}
#define TOOLBAR_ITEM_n(identifier, name)
-#define TOOLBAR_ITEM(identifier, name, snstvty, clicked, activate) \
- TOOLBAR_ITEM_ ## activate(identifier, name)
+#define TOOLBAR_ITEM(identifier, name, snstvty, clicked, activate, pass) \
+ TOOLBAR_ITEM_ ## pass(identifier, name)
#include "gtk/toolbar_items.h"
#undef TOOLBAR_ITEM_y
#undef TOOLBAR_ITEM_n
@@ -881,40 +881,42 @@ create_scaffolding_link_menu(struct nsgtk_scaffolding *g,
GtkAccelGroup *group)
*/
static nserror nsgtk_menu_initialise(struct nsgtk_scaffolding *g)
{
-#define TOOLBAR_ITEM(identifier, name, snstvty, clicked, activate) \
- g->menus[identifier].sensitivity = snstvty;
+#define TOOLBAR_ITEM_y(identifier, name) \
+ g->menus[identifier].mhandler = nsgtk_on_##name##_activate_menu;
+#define TOOLBAR_ITEM_n(identifier, name) \
+ g->menus[identifier].mhandler = NULL;
+#define TOOLBAR_ITEM(identifier, name, snstvty, clicked, activate, pass) \
+ g->menus[identifier].sensitivity = snstvty; \
+ TOOLBAR_ITEM_ ## activate(identifier, name)
#include "gtk/toolbar_items.h"
+#undef TOOLBAR_ITEM_y
+#undef TOOLBAR_ITEM_n
#undef TOOLBAR_ITEM
/* items on menubar, burger */
#define ITEM_MAIN(p, q, r) \
- g->menus[p##_BUTTON].mhandler = nsgtk_on_##r##_activate_menu; \
g->menus[p##_BUTTON].main = g->menu_bar->q->r##_menuitem; \
g->menus[p##_BUTTON].burger = g->burger_menu->q->r##_menuitem
/* submenu items on menubar, burger */
#define ITEM_SUB(p, q, r, s) \
- g->menus[p##_BUTTON].mhandler = nsgtk_on_##s##_activate_menu; \
g->menus[p##_BUTTON].main = g->menu_bar->q->r##_submenu->s##_menuitem;\
g->menus[p##_BUTTON].burger =
g->burger_menu->q->r##_submenu->s##_menuitem
/* items on menubar, burger and context popup */
#define ITEM_POP(p, q, r) \
- g->menus[p##_BUTTON].mhandler = nsgtk_on_##r##_activate_menu; \
g->menus[p##_BUTTON].main = g->menu_bar->q->r##_menuitem; \
g->menus[p##_BUTTON].burger = g->burger_menu->q->r##_menuitem; \
g->menus[p##_BUTTON].popup = g->popup_menu->r##_menuitem
/* items on menubar, burger and context popup */
#define ITEM_MAINPOP(p, q, r) \
- g->menus[p##_BUTTON].mhandler = nsgtk_on_##r##_activate_menu; \
g->menus[p##_BUTTON].main = g->menu_bar->q->r##_menuitem; \
g->menus[p##_BUTTON].burger = g->burger_menu->q->r##_menuitem; \
g->menus[p##_BUTTON].popup = g->popup_menu->q->r##_menuitem
/* sub submenu items on menubar, burger and context popup */
#define ITEM_SUBPOP(p, q, r, s)
\
- g->menus[p##_BUTTON].mhandler = nsgtk_on_##s##_activate_menu; \
g->menus[p##_BUTTON].main = g->menu_bar->q->r##_submenu->s##_menuitem;\
g->menus[p##_BUTTON].burger =
g->burger_menu->q->r##_submenu->s##_menuitem; \
g->menus[p##_BUTTON].popup = g->popup_menu->q->r##_submenu->s##_menuitem
diff --git a/frontends/gtk/toolbar.c b/frontends/gtk/toolbar.c
index 02097ea..aa5585b 100644
--- a/frontends/gtk/toolbar.c
+++ b/frontends/gtk/toolbar.c
@@ -202,7 +202,7 @@ int nsgtk_toolbar_get_id_from_widget(GtkWidget *widget,
struct nsgtk_scaffolding
/* define data plus and data minus handlers */
-#define TOOLBAR_ITEM(identifier, name, sensitivity, clicked, activate) \
+#define TOOLBAR_ITEM(identifier, name, sensitivity, clicked, activate, pass)\
static gboolean
\
nsgtk_toolbar_##name##_data_plus(GtkWidget *widget, \
GdkDragContext *cont, \
@@ -3300,7 +3300,7 @@ toolbar_item_create(nsgtk_toolbar_button id,
item->bhandler = name##_button_clicked_cb;
#define TOOLBAR_ITEM_n(name) \
item->bhandler = NULL;
-#define TOOLBAR_ITEM(identifier, name, snstvty, clicked, activate) \
+#define TOOLBAR_ITEM(identifier, name, snstvty, clicked, activate, pass)\
case identifier: \
item->sensitivity = snstvty; \
item->dataplus = nsgtk_toolbar_##name##_data_plus; \
diff --git a/frontends/gtk/toolbar_items.h b/frontends/gtk/toolbar_items.h
index 0de276f..ae5c6bb 100644
--- a/frontends/gtk/toolbar_items.h
+++ b/frontends/gtk/toolbar_items.h
@@ -83,66 +83,67 @@ typedef enum {
* name
* initial sensitivity
* if there is a toolbar click signal handler
+ * if there is a menu activate signal handler
* if the menu activate signal handler calls the toolbar click handler
*/
#ifndef TOOLBAR_ITEM
-#define TOOLBAR_ITEM(a, b, c, d, e)
+#define TOOLBAR_ITEM(a, b, c, d, e, f)
#define TOOLBAR_ITEM_SET
#endif
-TOOLBAR_ITEM(BACK_BUTTON, back, false, y, y)
-TOOLBAR_ITEM(HISTORY_BUTTON, history, true, y, n)
-TOOLBAR_ITEM(FORWARD_BUTTON, forward, false, y, y)
-TOOLBAR_ITEM(STOP_BUTTON, stop, false, y, y)
-TOOLBAR_ITEM(RELOAD_BUTTON, reload, true, y, y)
-TOOLBAR_ITEM(HOME_BUTTON, home, true, y, y)
-TOOLBAR_ITEM(URL_BAR_ITEM, url_bar, true, n, n)
-TOOLBAR_ITEM(WEBSEARCH_ITEM, websearch, true, n, n)
-TOOLBAR_ITEM(THROBBER_ITEM, throbber, true, n, n)
-TOOLBAR_ITEM(NEWWINDOW_BUTTON, newwindow, true, y, y)
-TOOLBAR_ITEM(NEWTAB_BUTTON, newtab, true, y, y)
-TOOLBAR_ITEM(OPENFILE_BUTTON, openfile, true, y, y)
-TOOLBAR_ITEM(CLOSETAB_BUTTON, closetab, false, n, n)
-TOOLBAR_ITEM(CLOSEWINDOW_BUTTON, closewindow, true, y, y)
-TOOLBAR_ITEM(SAVEPAGE_BUTTON, savepage, true, y, y)
-TOOLBAR_ITEM(PDF_BUTTON, pdf, false, y, y)
-TOOLBAR_ITEM(PLAINTEXT_BUTTON, plaintext, true, y, y)
-TOOLBAR_ITEM(DRAWFILE_BUTTON, drawfile, false, n, n)
-TOOLBAR_ITEM(POSTSCRIPT_BUTTON, postscript, false, n, n)
-TOOLBAR_ITEM(PRINTPREVIEW_BUTTON, printpreview, false, n, y)
-TOOLBAR_ITEM(PRINT_BUTTON, print, true, y, y)
-TOOLBAR_ITEM(QUIT_BUTTON, quit, true, y, y)
-TOOLBAR_ITEM(CUT_BUTTON, cut, true, y, y)
-TOOLBAR_ITEM(COPY_BUTTON, copy, true, y, y)
-TOOLBAR_ITEM(PASTE_BUTTON, paste, true, y, y)
-TOOLBAR_ITEM(DELETE_BUTTON, delete, false, y, y)
-TOOLBAR_ITEM(SELECTALL_BUTTON, selectall, true, y, y)
-TOOLBAR_ITEM(FIND_BUTTON, find, true, n, n)
-TOOLBAR_ITEM(PREFERENCES_BUTTON, preferences, true, y, y)
-TOOLBAR_ITEM(ZOOMPLUS_BUTTON, zoomplus, true, y, y)
-TOOLBAR_ITEM(ZOOMMINUS_BUTTON, zoomminus, true, y, y)
-TOOLBAR_ITEM(ZOOMNORMAL_BUTTON, zoomnormal, true, y, y)
-TOOLBAR_ITEM(FULLSCREEN_BUTTON, fullscreen, true, y, y)
-TOOLBAR_ITEM(VIEWSOURCE_BUTTON, viewsource, true, y, y)
-TOOLBAR_ITEM(DOWNLOADS_BUTTON, downloads, true, y, y)
-TOOLBAR_ITEM(SAVEWINDOWSIZE_BUTTON, savewindowsize, true, y, y)
-TOOLBAR_ITEM(TOGGLEDEBUGGING_BUTTON, toggledebugging, true, y, y)
-TOOLBAR_ITEM(SAVEBOXTREE_BUTTON, debugboxtree, true, y, y)
-TOOLBAR_ITEM(SAVEDOMTREE_BUTTON, debugdomtree, true, y, y)
-TOOLBAR_ITEM(LOCALHISTORY_BUTTON, localhistory, true, y, y)
-TOOLBAR_ITEM(GLOBALHISTORY_BUTTON, globalhistory, true, y, y)
-TOOLBAR_ITEM(ADDBOOKMARKS_BUTTON, addbookmarks, true, y, y)
-TOOLBAR_ITEM(SHOWBOOKMARKS_BUTTON, showbookmarks, true, y, y)
-TOOLBAR_ITEM(SHOWCOOKIES_BUTTON, showcookies, true, y, y)
-TOOLBAR_ITEM(OPENLOCATION_BUTTON, openlocation, true, y, y)
-TOOLBAR_ITEM(NEXTTAB_BUTTON, nexttab, false, n, n)
-TOOLBAR_ITEM(PREVTAB_BUTTON, prevtab, false, n, n)
-TOOLBAR_ITEM(CONTENTS_BUTTON, contents, true, y, y)
-TOOLBAR_ITEM(GUIDE_BUTTON, guide, true, y, y)
-TOOLBAR_ITEM(INFO_BUTTON, info, true, y, y)
-TOOLBAR_ITEM(ABOUT_BUTTON, about, true, y, y)
-TOOLBAR_ITEM(OPENMENU_BUTTON, openmenu, true, y, n)
+TOOLBAR_ITEM(BACK_BUTTON, back, false, y, y, y)
+TOOLBAR_ITEM(HISTORY_BUTTON, history, true, y, n, n)
+TOOLBAR_ITEM(FORWARD_BUTTON, forward, false, y, y, y)
+TOOLBAR_ITEM(STOP_BUTTON, stop, false, y, y, y)
+TOOLBAR_ITEM(RELOAD_BUTTON, reload, true, y, y, y)
+TOOLBAR_ITEM(HOME_BUTTON, home, true, y, y, y)
+TOOLBAR_ITEM(URL_BAR_ITEM, url_bar, true, n, n, n)
+TOOLBAR_ITEM(WEBSEARCH_ITEM, websearch, true, n, n, n)
+TOOLBAR_ITEM(THROBBER_ITEM, throbber, true, n, n, n)
+TOOLBAR_ITEM(NEWWINDOW_BUTTON, newwindow, true, y, y, y)
+TOOLBAR_ITEM(NEWTAB_BUTTON, newtab, true, y, y, y)
+TOOLBAR_ITEM(OPENFILE_BUTTON, openfile, true, y, y, y)
+TOOLBAR_ITEM(CLOSETAB_BUTTON, closetab, false, n, y, n)
+TOOLBAR_ITEM(CLOSEWINDOW_BUTTON, closewindow, true, y, y, y)
+TOOLBAR_ITEM(SAVEPAGE_BUTTON, savepage, true, y, y, y)
+TOOLBAR_ITEM(PDF_BUTTON, pdf, false, y, y, y)
+TOOLBAR_ITEM(PLAINTEXT_BUTTON, plaintext, true, y, y, y)
+TOOLBAR_ITEM(DRAWFILE_BUTTON, drawfile, false, n, n, n)
+TOOLBAR_ITEM(POSTSCRIPT_BUTTON, postscript, false, n, n, n)
+TOOLBAR_ITEM(PRINTPREVIEW_BUTTON, printpreview, false, n, y, y)
+TOOLBAR_ITEM(PRINT_BUTTON, print, true, y, y, y)
+TOOLBAR_ITEM(QUIT_BUTTON, quit, true, y, y, y)
+TOOLBAR_ITEM(CUT_BUTTON, cut, true, y, y, y)
+TOOLBAR_ITEM(COPY_BUTTON, copy, true, y, y, y)
+TOOLBAR_ITEM(PASTE_BUTTON, paste, true, y, y, y)
+TOOLBAR_ITEM(DELETE_BUTTON, delete, false, y, y, y)
+TOOLBAR_ITEM(SELECTALL_BUTTON, selectall, true, y, y, y)
+TOOLBAR_ITEM(FIND_BUTTON, find, true, n, y, n)
+TOOLBAR_ITEM(PREFERENCES_BUTTON, preferences, true, y, y, y)
+TOOLBAR_ITEM(ZOOMPLUS_BUTTON, zoomplus, true, y, y, y)
+TOOLBAR_ITEM(ZOOMMINUS_BUTTON, zoomminus, true, y, y, y)
+TOOLBAR_ITEM(ZOOMNORMAL_BUTTON, zoomnormal, true, y, y, y)
+TOOLBAR_ITEM(FULLSCREEN_BUTTON, fullscreen, true, y, y, y)
+TOOLBAR_ITEM(VIEWSOURCE_BUTTON, viewsource, true, y, y, y)
+TOOLBAR_ITEM(DOWNLOADS_BUTTON, downloads, true, y, y, y)
+TOOLBAR_ITEM(SAVEWINDOWSIZE_BUTTON, savewindowsize, true, y, y, y)
+TOOLBAR_ITEM(TOGGLEDEBUGGING_BUTTON, toggledebugging, true, y, y, y)
+TOOLBAR_ITEM(SAVEBOXTREE_BUTTON, debugboxtree, true, y, y, y)
+TOOLBAR_ITEM(SAVEDOMTREE_BUTTON, debugdomtree, true, y, y, y)
+TOOLBAR_ITEM(LOCALHISTORY_BUTTON, localhistory, true, y, y, y)
+TOOLBAR_ITEM(GLOBALHISTORY_BUTTON, globalhistory, true, y, y, y)
+TOOLBAR_ITEM(ADDBOOKMARKS_BUTTON, addbookmarks, true, y, y, y)
+TOOLBAR_ITEM(SHOWBOOKMARKS_BUTTON, showbookmarks, true, y, y, y)
+TOOLBAR_ITEM(SHOWCOOKIES_BUTTON, showcookies, true, y, y, y)
+TOOLBAR_ITEM(OPENLOCATION_BUTTON, openlocation, true, y, y, y)
+TOOLBAR_ITEM(NEXTTAB_BUTTON, nexttab, false, n, y, n)
+TOOLBAR_ITEM(PREVTAB_BUTTON, prevtab, false, n, y, n)
+TOOLBAR_ITEM(CONTENTS_BUTTON, contents, true, y, y, y)
+TOOLBAR_ITEM(GUIDE_BUTTON, guide, true, y, y, y)
+TOOLBAR_ITEM(INFO_BUTTON, info, true, y, y, y)
+TOOLBAR_ITEM(ABOUT_BUTTON, about, true, y, y, y)
+TOOLBAR_ITEM(OPENMENU_BUTTON, openmenu, true, y, n, n)
#ifdef TOOLBAR_ITEM_SET
#undef TOOLBAR_ITEM
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=8167e022a8fb81d31094da6a26918d0387101ffb
commit 8167e022a8fb81d31094da6a26918d0387101ffb
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>
use toolbar_items to generate more boilerplate code through macros
diff --git a/frontends/gtk/scaffolding.c b/frontends/gtk/scaffolding.c
index 3a097cc..350d5a9 100644
--- a/frontends/gtk/scaffolding.c
+++ b/frontends/gtk/scaffolding.c
@@ -459,221 +459,21 @@ nsgtk_window_tabs_remove(GtkNotebook *notebook,
/**
* handle menu activate signals by calling toolbar item activation
*/
-#define MENUHANDLER(name, itemid) \
+#define TOOLBAR_ITEM_y(identifier, name) \
static gboolean
\
nsgtk_on_##name##_activate_menu(GtkMenuItem *widget, gpointer data) \
{ \
struct nsgtk_scaffolding *gs = (struct nsgtk_scaffolding *)data;\
- nsgtk_window_item_activate(gs->top_level, itemid); \
+ nsgtk_window_item_activate(gs->top_level, identifier); \
return TRUE; \
}
-
-/**
- * menu signal handler for activation on new window item
- */
-MENUHANDLER(newwindow, NEWWINDOW_BUTTON);
-
-/**
- * menu signal handler for activation on new tab item
- */
-MENUHANDLER(newtab, NEWTAB_BUTTON);
-
-/**
- * menu signal handler for activation on open file item
- */
-MENUHANDLER(openfile, OPENFILE_BUTTON);
-
-/**
- * menu signal handler for activation on export complete page item
- */
-MENUHANDLER(savepage, SAVEPAGE_BUTTON);
-
-/**
- * menu signal handler for activation on export pdf item
- */
-MENUHANDLER(pdf, PDF_BUTTON);
-
-/**
- * menu signal handler for activation on export plain text item
- */
-MENUHANDLER(plaintext, PLAINTEXT_BUTTON);
-
-/**
- * menu signal handler for activation on print preview item
- */
-MENUHANDLER(printpreview, PRINTPREVIEW_BUTTON);
-
-/**
- * menu signal handler for activation on print item
- */
-MENUHANDLER(print, PRINT_BUTTON);
-
-/**
- * menu signal handler for activation on close window item
- */
-MENUHANDLER(closewindow, CLOSEWINDOW_BUTTON);
-
-/**
- * menu signal handler for activation on close window item
- */
-MENUHANDLER(quit, QUIT_BUTTON);
-
-/**
- * menu signal handler for activation on cut item
- */
-MENUHANDLER(cut, CUT_BUTTON);
-
-/**
- * menu signal handler for activation on copy item
- */
-MENUHANDLER(copy, COPY_BUTTON);
-
-/**
- * menu signal handler for activation on paste item
- */
-MENUHANDLER(paste, PASTE_BUTTON);
-
-/**
- * menu signal handler for activation on delete item
- */
-MENUHANDLER(delete, DELETE_BUTTON);
-
-/**
- * menu signal handler for activation on selectall item
- */
-MENUHANDLER(selectall, SELECTALL_BUTTON);
-
-/**
- * menu signal handler for activation on preferences item
- */
-MENUHANDLER(preferences, PREFERENCES_BUTTON);
-
-/**
- * menu signal handler for activation on zoom plus item
- */
-MENUHANDLER(zoomplus, ZOOMPLUS_BUTTON);
-
-/**
- * menu signal handler for activation on zoom minus item
- */
-MENUHANDLER(zoomminus, ZOOMMINUS_BUTTON);
-
-/**
- * menu signal handler for activation on zoom normal item
- */
-MENUHANDLER(zoomnormal, ZOOMNORMAL_BUTTON);
-
-/**
- * menu signal handler for activation on full screen item
- */
-MENUHANDLER(fullscreen, FULLSCREEN_BUTTON);
-
-/**
- * menu signal handler for activation on view source item
- */
-MENUHANDLER(viewsource, VIEWSOURCE_BUTTON);
-
-/**
- * menu signal handler for activation on downloads item
- */
-MENUHANDLER(downloads, DOWNLOADS_BUTTON);
-
-/**
- * menu signal handler for activation on save window size item
- */
-MENUHANDLER(savewindowsize, SAVEWINDOWSIZE_BUTTON);
-
-/**
- * menu signal handler for activation on toggle debug render item
- */
-MENUHANDLER(toggledebugging, TOGGLEDEBUGGING_BUTTON);
-
-/**
- * menu signal handler for activation on debug box tree item
- */
-MENUHANDLER(debugboxtree, SAVEBOXTREE_BUTTON);
-
-/**
- * menu signal handler for activation on debug dom tree item
- */
-MENUHANDLER(debugdomtree, SAVEDOMTREE_BUTTON);
-
-/**
- * menu signal handler for activation on stop item
- */
-MENUHANDLER(stop, STOP_BUTTON);
-
-/**
- * menu signal handler for activation on reload item
- */
-MENUHANDLER(reload, RELOAD_BUTTON);
-
-/**
- * menu signal handler for activation on back item
- */
-MENUHANDLER(back, BACK_BUTTON);
-
-/**
- * menu signal handler for activation on forward item
- */
-MENUHANDLER(forward, FORWARD_BUTTON);
-
-/**
- * menu signal handler for activation on home item
- */
-MENUHANDLER(home, HOME_BUTTON);
-
-/**
- * menu signal handler for activation on localhistory item
- */
-MENUHANDLER(localhistory, LOCALHISTORY_BUTTON);
-
-/**
- * menu signal handler for activation on globalhistory item
- */
-MENUHANDLER(globalhistory, GLOBALHISTORY_BUTTON);
-
-/**
- * menu signal handler for activation on addbookmarks item
- */
-MENUHANDLER(addbookmarks, ADDBOOKMARKS_BUTTON);
-
-/**
- * menu signal handler for activation on showbookmarks item
- */
-MENUHANDLER(showbookmarks, SHOWBOOKMARKS_BUTTON);
-
-/**
- * menu signal handler for activation on showcookies item
- */
-MENUHANDLER(showcookies, SHOWCOOKIES_BUTTON);
-
-/**
- * menu signal handler for activation on showcookies item
- */
-MENUHANDLER(openlocation, OPENLOCATION_BUTTON);
-
-/**
- * menu signal handler for activation on showcookies item
- */
-MENUHANDLER(contents, CONTENTS_BUTTON);
-
-/**
- * menu signal handler for activation on showcookies item
- */
-MENUHANDLER(guide, GUIDE_BUTTON);
-
-/**
- * menu signal handler for activation on showcookies item
- */
-MENUHANDLER(info, INFO_BUTTON);
-
-/**
- * menu signal handler for activation on showcookies item
- */
-MENUHANDLER(about, ABOUT_BUTTON);
-
-#undef MENUHANDLER
+#define TOOLBAR_ITEM_n(identifier, name)
+#define TOOLBAR_ITEM(identifier, name, snstvty, clicked, activate) \
+ TOOLBAR_ITEM_ ## activate(identifier, name)
+#include "gtk/toolbar_items.h"
+#undef TOOLBAR_ITEM_y
+#undef TOOLBAR_ITEM_n
+#undef TOOLBAR_ITEM
static gboolean
@@ -1081,7 +881,7 @@ create_scaffolding_link_menu(struct nsgtk_scaffolding *g,
GtkAccelGroup *group)
*/
static nserror nsgtk_menu_initialise(struct nsgtk_scaffolding *g)
{
-#define TOOLBAR_ITEM(identifier, name, snstvty, clicked) \
+#define TOOLBAR_ITEM(identifier, name, snstvty, clicked, activate) \
g->menus[identifier].sensitivity = snstvty;
#include "gtk/toolbar_items.h"
#undef TOOLBAR_ITEM
diff --git a/frontends/gtk/toolbar.c b/frontends/gtk/toolbar.c
index e27d6a8..02097ea 100644
--- a/frontends/gtk/toolbar.c
+++ b/frontends/gtk/toolbar.c
@@ -202,7 +202,7 @@ int nsgtk_toolbar_get_id_from_widget(GtkWidget *widget,
struct nsgtk_scaffolding
/* define data plus and data minus handlers */
-#define TOOLBAR_ITEM(identifier, name, sensitivity, clicked) \
+#define TOOLBAR_ITEM(identifier, name, sensitivity, clicked, activate) \
static gboolean
\
nsgtk_toolbar_##name##_data_plus(GtkWidget *widget, \
GdkDragContext *cont, \
@@ -3058,6 +3058,19 @@ localhistory_button_clicked_cb(GtkWidget *widget,
gpointer data)
return TRUE;
}
+/**
+ * handler for history tool bar item clicked signal
+ *
+ * \param widget The widget the signal is being delivered to.
+ * \param data The toolbar context passed when the signal was connected
+ * \return TRUE
+ */
+static gboolean
+history_button_clicked_cb(GtkWidget *widget, gpointer data)
+{
+ return localhistory_button_clicked_cb(widget, data);
+}
+
/**
* handler for global history tool bar item clicked signal
@@ -3283,14 +3296,20 @@ toolbar_item_create(nsgtk_toolbar_button id,
/* set item defaults from macro */
switch (id) {
-#define TOOLBAR_ITEM(identifier, name, snstvty, clicked) \
+#define TOOLBAR_ITEM_y(name) \
+ item->bhandler = name##_button_clicked_cb;
+#define TOOLBAR_ITEM_n(name) \
+ item->bhandler = NULL;
+#define TOOLBAR_ITEM(identifier, name, snstvty, clicked, activate) \
case identifier: \
item->sensitivity = snstvty; \
item->dataplus = nsgtk_toolbar_##name##_data_plus; \
item->dataminus = nsgtk_toolbar_##name##_data_minus; \
- item->bhandler = clicked; \
+ TOOLBAR_ITEM_ ## clicked(name) \
break;
#include "gtk/toolbar_items.h"
+#undef TOOLBAR_ITEM_y
+#undef TOOLBAR_ITEM_n
#undef TOOLBAR_ITEM
case PLACEHOLDER_BUTTON:
diff --git a/frontends/gtk/toolbar_items.h b/frontends/gtk/toolbar_items.h
index cbb6a24..0de276f 100644
--- a/frontends/gtk/toolbar_items.h
+++ b/frontends/gtk/toolbar_items.h
@@ -79,68 +79,70 @@ typedef enum {
/*
* Item fields are:
- * item identifier enum
- * item name
- * item initial visibility
+ * identifier enum
+ * name
+ * initial sensitivity
+ * if there is a toolbar click signal handler
+ * if the menu activate signal handler calls the toolbar click handler
*/
#ifndef TOOLBAR_ITEM
-#define TOOLBAR_ITEM(a, b, c, d)
+#define TOOLBAR_ITEM(a, b, c, d, e)
#define TOOLBAR_ITEM_SET
#endif
-TOOLBAR_ITEM(BACK_BUTTON, back, false, back_button_clicked_cb)
-TOOLBAR_ITEM(HISTORY_BUTTON, history, true, localhistory_button_clicked_cb)
-TOOLBAR_ITEM(FORWARD_BUTTON, forward, false, forward_button_clicked_cb)
-TOOLBAR_ITEM(STOP_BUTTON, stop, false, stop_button_clicked_cb)
-TOOLBAR_ITEM(RELOAD_BUTTON, reload, true, reload_button_clicked_cb)
-TOOLBAR_ITEM(HOME_BUTTON, home, true, home_button_clicked_cb)
-TOOLBAR_ITEM(URL_BAR_ITEM, url_bar, true, NULL)
-TOOLBAR_ITEM(WEBSEARCH_ITEM, websearch, true, NULL)
-TOOLBAR_ITEM(THROBBER_ITEM, throbber, true, NULL)
-TOOLBAR_ITEM(NEWWINDOW_BUTTON, newwindow, true, newwindow_button_clicked_cb)
-TOOLBAR_ITEM(NEWTAB_BUTTON, newtab, true, newtab_button_clicked_cb)
-TOOLBAR_ITEM(OPENFILE_BUTTON, openfile, true, openfile_button_clicked_cb)
-TOOLBAR_ITEM(CLOSETAB_BUTTON, closetab, false, NULL)
-TOOLBAR_ITEM(CLOSEWINDOW_BUTTON, closewindow, true,
closewindow_button_clicked_cb)
-TOOLBAR_ITEM(SAVEPAGE_BUTTON, savepage, true, savepage_button_clicked_cb)
-TOOLBAR_ITEM(PDF_BUTTON, pdf, false, pdf_button_clicked_cb)
-TOOLBAR_ITEM(PLAINTEXT_BUTTON, plaintext, true, plaintext_button_clicked_cb)
-TOOLBAR_ITEM(DRAWFILE_BUTTON, drawfile, false, NULL)
-TOOLBAR_ITEM(POSTSCRIPT_BUTTON, postscript, false, NULL)
-TOOLBAR_ITEM(PRINTPREVIEW_BUTTON, printpreview, false, NULL)
-TOOLBAR_ITEM(PRINT_BUTTON, print, true, print_button_clicked_cb)
-TOOLBAR_ITEM(QUIT_BUTTON, quit, true, quit_button_clicked_cb)
-TOOLBAR_ITEM(CUT_BUTTON, cut, true, cut_button_clicked_cb)
-TOOLBAR_ITEM(COPY_BUTTON, copy, true, copy_button_clicked_cb)
-TOOLBAR_ITEM(PASTE_BUTTON, paste, true, paste_button_clicked_cb)
-TOOLBAR_ITEM(DELETE_BUTTON, delete, false, delete_button_clicked_cb)
-TOOLBAR_ITEM(SELECTALL_BUTTON, selectall, true, selectall_button_clicked_cb)
-TOOLBAR_ITEM(FIND_BUTTON, find, true, NULL)
-TOOLBAR_ITEM(PREFERENCES_BUTTON, preferences, true,
preferences_button_clicked_cb)
-TOOLBAR_ITEM(ZOOMPLUS_BUTTON, zoomplus, true, zoomplus_button_clicked_cb)
-TOOLBAR_ITEM(ZOOMMINUS_BUTTON, zoomminus, true, zoomminus_button_clicked_cb)
-TOOLBAR_ITEM(ZOOMNORMAL_BUTTON, zoomnormal, true, zoomnormal_button_clicked_cb)
-TOOLBAR_ITEM(FULLSCREEN_BUTTON, fullscreen, true, fullscreen_button_clicked_cb)
-TOOLBAR_ITEM(VIEWSOURCE_BUTTON, viewsource, true, viewsource_button_clicked_cb)
-TOOLBAR_ITEM(DOWNLOADS_BUTTON, downloads, true, downloads_button_clicked_cb)
-TOOLBAR_ITEM(SAVEWINDOWSIZE_BUTTON, savewindowsize, true,
savewindowsize_button_clicked_cb)
-TOOLBAR_ITEM(TOGGLEDEBUGGING_BUTTON, toggledebugging, true,
toggledebugging_button_clicked_cb)
-TOOLBAR_ITEM(SAVEBOXTREE_BUTTON, debugboxtree, true,
debugboxtree_button_clicked_cb)
-TOOLBAR_ITEM(SAVEDOMTREE_BUTTON, debugdomtree, true,
debugdomtree_button_clicked_cb)
-TOOLBAR_ITEM(LOCALHISTORY_BUTTON, localhistory, true,
localhistory_button_clicked_cb)
-TOOLBAR_ITEM(GLOBALHISTORY_BUTTON, globalhistory, true,
globalhistory_button_clicked_cb)
-TOOLBAR_ITEM(ADDBOOKMARKS_BUTTON, addbookmarks, true,
addbookmarks_button_clicked_cb)
-TOOLBAR_ITEM(SHOWBOOKMARKS_BUTTON, showbookmarks, true,
showbookmarks_button_clicked_cb)
-TOOLBAR_ITEM(SHOWCOOKIES_BUTTON, showcookies, true,
showcookies_button_clicked_cb)
-TOOLBAR_ITEM(OPENLOCATION_BUTTON, openlocation, true,
openlocation_button_clicked_cb)
-TOOLBAR_ITEM(NEXTTAB_BUTTON, nexttab, false, NULL)
-TOOLBAR_ITEM(PREVTAB_BUTTON, prevtab, false, NULL)
-TOOLBAR_ITEM(CONTENTS_BUTTON, contents, true, contents_button_clicked_cb)
-TOOLBAR_ITEM(GUIDE_BUTTON, guide, true, guide_button_clicked_cb)
-TOOLBAR_ITEM(INFO_BUTTON, info, true, info_button_clicked_cb)
-TOOLBAR_ITEM(ABOUT_BUTTON, about, true, about_button_clicked_cb)
-TOOLBAR_ITEM(OPENMENU_BUTTON, openmenu, true, openmenu_button_clicked_cb)
+TOOLBAR_ITEM(BACK_BUTTON, back, false, y, y)
+TOOLBAR_ITEM(HISTORY_BUTTON, history, true, y, n)
+TOOLBAR_ITEM(FORWARD_BUTTON, forward, false, y, y)
+TOOLBAR_ITEM(STOP_BUTTON, stop, false, y, y)
+TOOLBAR_ITEM(RELOAD_BUTTON, reload, true, y, y)
+TOOLBAR_ITEM(HOME_BUTTON, home, true, y, y)
+TOOLBAR_ITEM(URL_BAR_ITEM, url_bar, true, n, n)
+TOOLBAR_ITEM(WEBSEARCH_ITEM, websearch, true, n, n)
+TOOLBAR_ITEM(THROBBER_ITEM, throbber, true, n, n)
+TOOLBAR_ITEM(NEWWINDOW_BUTTON, newwindow, true, y, y)
+TOOLBAR_ITEM(NEWTAB_BUTTON, newtab, true, y, y)
+TOOLBAR_ITEM(OPENFILE_BUTTON, openfile, true, y, y)
+TOOLBAR_ITEM(CLOSETAB_BUTTON, closetab, false, n, n)
+TOOLBAR_ITEM(CLOSEWINDOW_BUTTON, closewindow, true, y, y)
+TOOLBAR_ITEM(SAVEPAGE_BUTTON, savepage, true, y, y)
+TOOLBAR_ITEM(PDF_BUTTON, pdf, false, y, y)
+TOOLBAR_ITEM(PLAINTEXT_BUTTON, plaintext, true, y, y)
+TOOLBAR_ITEM(DRAWFILE_BUTTON, drawfile, false, n, n)
+TOOLBAR_ITEM(POSTSCRIPT_BUTTON, postscript, false, n, n)
+TOOLBAR_ITEM(PRINTPREVIEW_BUTTON, printpreview, false, n, y)
+TOOLBAR_ITEM(PRINT_BUTTON, print, true, y, y)
+TOOLBAR_ITEM(QUIT_BUTTON, quit, true, y, y)
+TOOLBAR_ITEM(CUT_BUTTON, cut, true, y, y)
+TOOLBAR_ITEM(COPY_BUTTON, copy, true, y, y)
+TOOLBAR_ITEM(PASTE_BUTTON, paste, true, y, y)
+TOOLBAR_ITEM(DELETE_BUTTON, delete, false, y, y)
+TOOLBAR_ITEM(SELECTALL_BUTTON, selectall, true, y, y)
+TOOLBAR_ITEM(FIND_BUTTON, find, true, n, n)
+TOOLBAR_ITEM(PREFERENCES_BUTTON, preferences, true, y, y)
+TOOLBAR_ITEM(ZOOMPLUS_BUTTON, zoomplus, true, y, y)
+TOOLBAR_ITEM(ZOOMMINUS_BUTTON, zoomminus, true, y, y)
+TOOLBAR_ITEM(ZOOMNORMAL_BUTTON, zoomnormal, true, y, y)
+TOOLBAR_ITEM(FULLSCREEN_BUTTON, fullscreen, true, y, y)
+TOOLBAR_ITEM(VIEWSOURCE_BUTTON, viewsource, true, y, y)
+TOOLBAR_ITEM(DOWNLOADS_BUTTON, downloads, true, y, y)
+TOOLBAR_ITEM(SAVEWINDOWSIZE_BUTTON, savewindowsize, true, y, y)
+TOOLBAR_ITEM(TOGGLEDEBUGGING_BUTTON, toggledebugging, true, y, y)
+TOOLBAR_ITEM(SAVEBOXTREE_BUTTON, debugboxtree, true, y, y)
+TOOLBAR_ITEM(SAVEDOMTREE_BUTTON, debugdomtree, true, y, y)
+TOOLBAR_ITEM(LOCALHISTORY_BUTTON, localhistory, true, y, y)
+TOOLBAR_ITEM(GLOBALHISTORY_BUTTON, globalhistory, true, y, y)
+TOOLBAR_ITEM(ADDBOOKMARKS_BUTTON, addbookmarks, true, y, y)
+TOOLBAR_ITEM(SHOWBOOKMARKS_BUTTON, showbookmarks, true, y, y)
+TOOLBAR_ITEM(SHOWCOOKIES_BUTTON, showcookies, true, y, y)
+TOOLBAR_ITEM(OPENLOCATION_BUTTON, openlocation, true, y, y)
+TOOLBAR_ITEM(NEXTTAB_BUTTON, nexttab, false, n, n)
+TOOLBAR_ITEM(PREVTAB_BUTTON, prevtab, false, n, n)
+TOOLBAR_ITEM(CONTENTS_BUTTON, contents, true, y, y)
+TOOLBAR_ITEM(GUIDE_BUTTON, guide, true, y, y)
+TOOLBAR_ITEM(INFO_BUTTON, info, true, y, y)
+TOOLBAR_ITEM(ABOUT_BUTTON, about, true, y, y)
+TOOLBAR_ITEM(OPENMENU_BUTTON, openmenu, true, y, n)
#ifdef TOOLBAR_ITEM_SET
#undef TOOLBAR_ITEM
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=47ea0989037f2d5eddf23230f154ed3399e48477
commit 47ea0989037f2d5eddf23230f154ed3399e48477
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>
fix toolbar property update
diff --git a/frontends/gtk/preferences.c b/frontends/gtk/preferences.c
index efef4a2..3aaaa90 100644
--- a/frontends/gtk/preferences.c
+++ b/frontends/gtk/preferences.c
@@ -512,7 +512,7 @@ SPINBUTTON_SIGNALS(spinDefaultSize, font_size, 10.0)
G_MODULE_EXPORT void
nsgtk_preferences_fontPreview_clicked(GtkButton *button, struct ppref *priv)
{
- nsgtk_reflow_all_windows();
+ nsgtk_window_update_all();
}
@@ -714,7 +714,7 @@
nsgtk_preferences_checkShowSingleTab_toggled(GtkToggleButton *togglebutton,
{
nsoption_set_bool(show_single_tab,
gtk_toggle_button_get_active(togglebutton));
- nsgtk_reflow_all_windows();
+ nsgtk_window_update_all();
}
G_MODULE_EXPORT void
@@ -736,20 +736,11 @@ G_MODULE_EXPORT void
nsgtk_preferences_comboTabPosition_changed(GtkComboBox *widget,
struct ppref *priv)
{
- struct nsgtk_scaffolding *current;
-
/* set the option */
nsoption_set_int(position_tab, gtk_combo_box_get_active(widget));
- /* update all notebooks in all scaffolds */
- current = nsgtk_scaffolding_iterate(NULL);
- while (current) {
- nsgtk_scaffolding_reset_offset(current);
-
- nsgtk_reflow_all_windows();
-
- current = nsgtk_scaffolding_iterate(current);
- }
+ /* update all windows */
+ nsgtk_window_update_all();
}
G_MODULE_EXPORT void
@@ -792,18 +783,10 @@ G_MODULE_EXPORT void
nsgtk_preferences_comboButtonType_changed(GtkComboBox *widget,
struct ppref *priv)
{
- struct nsgtk_scaffolding *current;
-
nsoption_set_int(button_type, gtk_combo_box_get_active(widget) + 1);
- current = nsgtk_scaffolding_iterate(NULL);
- while (current != NULL) {
- nsgtk_scaffolding_reset_offset(current);
-
- nsgtk_scaffolding_toolbars(current);
-
- current = nsgtk_scaffolding_iterate(current);
- }
+ /* update all windows to adopt change */
+ nsgtk_window_update_all();
}
G_MODULE_EXPORT void
diff --git a/frontends/gtk/scaffolding.c b/frontends/gtk/scaffolding.c
index 17cbb5a..3a097cc 100644
--- a/frontends/gtk/scaffolding.c
+++ b/frontends/gtk/scaffolding.c
@@ -1400,14 +1400,6 @@ struct nsgtk_scaffolding *nsgtk_current_scaffolding(void)
}
-/* exported interface documented in gtk/scaffolding.h */
-void nsgtk_scaffolding_toolbars(struct nsgtk_scaffolding *g)
-{
- // nsgtk_toolbar_update(g->toolbar);
- nsgtk_search_update(g->search);
-}
-
-
/* exported function documented in gtk/scaffolding.h */
void nsgtk_window_set_title(struct gui_window *gw, const char *title)
{
@@ -1528,13 +1520,6 @@ struct nsgtk_scaffolding
*nsgtk_scaffolding_iterate(struct nsgtk_scaffolding *g)
/* exported interface documented in gtk/scaffolding.h */
-void nsgtk_scaffolding_reset_offset(struct nsgtk_scaffolding *g)
-{
- //g->offset = 0;
-}
-
-
-/* exported interface documented in gtk/scaffolding.h */
struct gui_window *nsgtk_scaffolding_top_level(struct nsgtk_scaffolding *g)
{
return g->top_level;
diff --git a/frontends/gtk/scaffolding.h b/frontends/gtk/scaffolding.h
index 43ad1a9..16aaf03 100644
--- a/frontends/gtk/scaffolding.h
+++ b/frontends/gtk/scaffolding.h
@@ -115,14 +115,6 @@ struct gtk_history_window
*nsgtk_scaffolding_history_window(struct nsgtk_scaffol
struct gui_window *nsgtk_scaffolding_top_level(struct nsgtk_scaffolding *g);
-/**
- * reset the scaffold offset value to 0.
- *
- * \todo The value is only ever altered in
- * nsgtk_scaffolding_toolbar_size_allocate and is something to do with
- * the history button either clarify or remove!
- */
-void nsgtk_scaffolding_reset_offset(struct nsgtk_scaffolding *g);
/**
* Iterate through available scaffolding.
@@ -177,9 +169,5 @@ void nsgtk_scaffolding_context_menu(struct
nsgtk_scaffolding *g, gdouble x, gdou
*/
void nsgtk_window_set_title(struct gui_window *gw, const char *title);
-/**
- * toolbar style changed
- */
-void nsgtk_scaffolding_toolbars(struct nsgtk_scaffolding *g);
#endif /* NETSURF_GTK_SCAFFOLDING_H */
diff --git a/frontends/gtk/toolbar.c b/frontends/gtk/toolbar.c
index ad2990a..e27d6a8 100644
--- a/frontends/gtk/toolbar.c
+++ b/frontends/gtk/toolbar.c
@@ -812,6 +812,11 @@ make_toolbar_item(nsgtk_toolbar_button i, struct
nsgtk_theme *theme)
return w;
}
+/* exported interface documented in gtk/scaffolding.h */
+static void nsgtk_scaffolding_reset_offset(struct nsgtk_scaffolding *g)
+{
+ //g->offset = 0;
+}
/**
* called when a widget is dropped onto the toolbar
@@ -2928,10 +2933,9 @@ toggledebugging_button_clicked_cb(GtkWidget *widget,
gpointer data)
browser_window_debug(bw, CONTENT_DEBUG_REDRAW);
- nsgtk_reflow_all_windows();
+ nsgtk_window_update_all();
return TRUE;
-
}
@@ -3564,6 +3568,12 @@ nserror nsgtk_toolbar_destroy(struct nsgtk_toolbar *tb)
/* exported interface documented in toolbar.h */
nserror nsgtk_toolbar_update(struct nsgtk_toolbar *tb)
{
+ /*
+ * reset toolbar size allocation so icon size change affects
+ * allocated widths.
+ */
+ tb->offset = 0;
+
switch (nsoption_int(button_type)) {
case 1: /* Small icons */
diff --git a/frontends/gtk/window.c b/frontends/gtk/window.c
index b43a0ec..0daf0fe 100644
--- a/frontends/gtk/window.c
+++ b/frontends/gtk/window.c
@@ -904,11 +904,15 @@ nsgtk_window_item_activate(struct gui_window *gw,
nsgtk_toolbar_button itemid)
return nsgtk_toolbar_item_activate(gw->toolbar, itemid);
}
-void nsgtk_reflow_all_windows(void)
+/* exported interface documented in window.h */
+void nsgtk_window_update_all(void)
{
- for (struct gui_window *g = window_list; g; g = g->next) {
-
nsgtk_tab_options_changed(nsgtk_scaffolding_notebook(g->scaffold));
- browser_window_schedule_reformat(g->bw);
+ struct gui_window *gw;
+ for (gw = window_list; gw != NULL; gw = gw->next) {
+
nsgtk_tab_options_changed(nsgtk_scaffolding_notebook(gw->scaffold));
+ nsgtk_toolbar_update(gw->toolbar);
+ /** \todo update search bar */
+ browser_window_schedule_reformat(gw->bw);
}
}
diff --git a/frontends/gtk/window.h b/frontends/gtk/window.h
index dd49c71..b6e00a6 100644
--- a/frontends/gtk/window.h
+++ b/frontends/gtk/window.h
@@ -46,9 +46,13 @@ struct browser_window *nsgtk_get_browser_window(struct
gui_window *gw);
struct nsgtk_scaffolding *nsgtk_get_scaffold(struct gui_window *gw);
/**
- * cause all windows be be reflowed
+ * Every window will have its tab, toolbar and drawing area updated
+ *
+ * The update will ensure the correct tab options are used, the
+ * toolbar size and style is changed and the browser window contents
+ * redrawn.
*/
-void nsgtk_reflow_all_windows(void);
+void nsgtk_window_update_all(void);
/**
* update targets
-----------------------------------------------------------------------
Summary of changes:
frontends/gtk/preferences.c | 29 +----
frontends/gtk/scaffolding.c | 251 ++++-------------------------------------
frontends/gtk/scaffolding.h | 12 --
frontends/gtk/toolbar.c | 39 ++++++-
frontends/gtk/toolbar_items.h | 115 ++++++++++---------
frontends/gtk/window.c | 12 +-
frontends/gtk/window.h | 8 +-
7 files changed, 132 insertions(+), 334 deletions(-)
diff --git a/frontends/gtk/preferences.c b/frontends/gtk/preferences.c
index efef4a2..3aaaa90 100644
--- a/frontends/gtk/preferences.c
+++ b/frontends/gtk/preferences.c
@@ -512,7 +512,7 @@ SPINBUTTON_SIGNALS(spinDefaultSize, font_size, 10.0)
G_MODULE_EXPORT void
nsgtk_preferences_fontPreview_clicked(GtkButton *button, struct ppref *priv)
{
- nsgtk_reflow_all_windows();
+ nsgtk_window_update_all();
}
@@ -714,7 +714,7 @@
nsgtk_preferences_checkShowSingleTab_toggled(GtkToggleButton *togglebutton,
{
nsoption_set_bool(show_single_tab,
gtk_toggle_button_get_active(togglebutton));
- nsgtk_reflow_all_windows();
+ nsgtk_window_update_all();
}
G_MODULE_EXPORT void
@@ -736,20 +736,11 @@ G_MODULE_EXPORT void
nsgtk_preferences_comboTabPosition_changed(GtkComboBox *widget,
struct ppref *priv)
{
- struct nsgtk_scaffolding *current;
-
/* set the option */
nsoption_set_int(position_tab, gtk_combo_box_get_active(widget));
- /* update all notebooks in all scaffolds */
- current = nsgtk_scaffolding_iterate(NULL);
- while (current) {
- nsgtk_scaffolding_reset_offset(current);
-
- nsgtk_reflow_all_windows();
-
- current = nsgtk_scaffolding_iterate(current);
- }
+ /* update all windows */
+ nsgtk_window_update_all();
}
G_MODULE_EXPORT void
@@ -792,18 +783,10 @@ G_MODULE_EXPORT void
nsgtk_preferences_comboButtonType_changed(GtkComboBox *widget,
struct ppref *priv)
{
- struct nsgtk_scaffolding *current;
-
nsoption_set_int(button_type, gtk_combo_box_get_active(widget) + 1);
- current = nsgtk_scaffolding_iterate(NULL);
- while (current != NULL) {
- nsgtk_scaffolding_reset_offset(current);
-
- nsgtk_scaffolding_toolbars(current);
-
- current = nsgtk_scaffolding_iterate(current);
- }
+ /* update all windows to adopt change */
+ nsgtk_window_update_all();
}
G_MODULE_EXPORT void
diff --git a/frontends/gtk/scaffolding.c b/frontends/gtk/scaffolding.c
index 17cbb5a..7432812 100644
--- a/frontends/gtk/scaffolding.c
+++ b/frontends/gtk/scaffolding.c
@@ -459,221 +459,21 @@ nsgtk_window_tabs_remove(GtkNotebook *notebook,
/**
* handle menu activate signals by calling toolbar item activation
*/
-#define MENUHANDLER(name, itemid) \
-static gboolean
\
+#define TOOLBAR_ITEM_y(identifier, name) \
+ static gboolean \
nsgtk_on_##name##_activate_menu(GtkMenuItem *widget, gpointer data) \
{ \
struct nsgtk_scaffolding *gs = (struct nsgtk_scaffolding *)data;\
- nsgtk_window_item_activate(gs->top_level, itemid); \
+ nsgtk_window_item_activate(gs->top_level, identifier); \
return TRUE; \
}
-
-/**
- * menu signal handler for activation on new window item
- */
-MENUHANDLER(newwindow, NEWWINDOW_BUTTON);
-
-/**
- * menu signal handler for activation on new tab item
- */
-MENUHANDLER(newtab, NEWTAB_BUTTON);
-
-/**
- * menu signal handler for activation on open file item
- */
-MENUHANDLER(openfile, OPENFILE_BUTTON);
-
-/**
- * menu signal handler for activation on export complete page item
- */
-MENUHANDLER(savepage, SAVEPAGE_BUTTON);
-
-/**
- * menu signal handler for activation on export pdf item
- */
-MENUHANDLER(pdf, PDF_BUTTON);
-
-/**
- * menu signal handler for activation on export plain text item
- */
-MENUHANDLER(plaintext, PLAINTEXT_BUTTON);
-
-/**
- * menu signal handler for activation on print preview item
- */
-MENUHANDLER(printpreview, PRINTPREVIEW_BUTTON);
-
-/**
- * menu signal handler for activation on print item
- */
-MENUHANDLER(print, PRINT_BUTTON);
-
-/**
- * menu signal handler for activation on close window item
- */
-MENUHANDLER(closewindow, CLOSEWINDOW_BUTTON);
-
-/**
- * menu signal handler for activation on close window item
- */
-MENUHANDLER(quit, QUIT_BUTTON);
-
-/**
- * menu signal handler for activation on cut item
- */
-MENUHANDLER(cut, CUT_BUTTON);
-
-/**
- * menu signal handler for activation on copy item
- */
-MENUHANDLER(copy, COPY_BUTTON);
-
-/**
- * menu signal handler for activation on paste item
- */
-MENUHANDLER(paste, PASTE_BUTTON);
-
-/**
- * menu signal handler for activation on delete item
- */
-MENUHANDLER(delete, DELETE_BUTTON);
-
-/**
- * menu signal handler for activation on selectall item
- */
-MENUHANDLER(selectall, SELECTALL_BUTTON);
-
-/**
- * menu signal handler for activation on preferences item
- */
-MENUHANDLER(preferences, PREFERENCES_BUTTON);
-
-/**
- * menu signal handler for activation on zoom plus item
- */
-MENUHANDLER(zoomplus, ZOOMPLUS_BUTTON);
-
-/**
- * menu signal handler for activation on zoom minus item
- */
-MENUHANDLER(zoomminus, ZOOMMINUS_BUTTON);
-
-/**
- * menu signal handler for activation on zoom normal item
- */
-MENUHANDLER(zoomnormal, ZOOMNORMAL_BUTTON);
-
-/**
- * menu signal handler for activation on full screen item
- */
-MENUHANDLER(fullscreen, FULLSCREEN_BUTTON);
-
-/**
- * menu signal handler for activation on view source item
- */
-MENUHANDLER(viewsource, VIEWSOURCE_BUTTON);
-
-/**
- * menu signal handler for activation on downloads item
- */
-MENUHANDLER(downloads, DOWNLOADS_BUTTON);
-
-/**
- * menu signal handler for activation on save window size item
- */
-MENUHANDLER(savewindowsize, SAVEWINDOWSIZE_BUTTON);
-
-/**
- * menu signal handler for activation on toggle debug render item
- */
-MENUHANDLER(toggledebugging, TOGGLEDEBUGGING_BUTTON);
-
-/**
- * menu signal handler for activation on debug box tree item
- */
-MENUHANDLER(debugboxtree, SAVEBOXTREE_BUTTON);
-
-/**
- * menu signal handler for activation on debug dom tree item
- */
-MENUHANDLER(debugdomtree, SAVEDOMTREE_BUTTON);
-
-/**
- * menu signal handler for activation on stop item
- */
-MENUHANDLER(stop, STOP_BUTTON);
-
-/**
- * menu signal handler for activation on reload item
- */
-MENUHANDLER(reload, RELOAD_BUTTON);
-
-/**
- * menu signal handler for activation on back item
- */
-MENUHANDLER(back, BACK_BUTTON);
-
-/**
- * menu signal handler for activation on forward item
- */
-MENUHANDLER(forward, FORWARD_BUTTON);
-
-/**
- * menu signal handler for activation on home item
- */
-MENUHANDLER(home, HOME_BUTTON);
-
-/**
- * menu signal handler for activation on localhistory item
- */
-MENUHANDLER(localhistory, LOCALHISTORY_BUTTON);
-
-/**
- * menu signal handler for activation on globalhistory item
- */
-MENUHANDLER(globalhistory, GLOBALHISTORY_BUTTON);
-
-/**
- * menu signal handler for activation on addbookmarks item
- */
-MENUHANDLER(addbookmarks, ADDBOOKMARKS_BUTTON);
-
-/**
- * menu signal handler for activation on showbookmarks item
- */
-MENUHANDLER(showbookmarks, SHOWBOOKMARKS_BUTTON);
-
-/**
- * menu signal handler for activation on showcookies item
- */
-MENUHANDLER(showcookies, SHOWCOOKIES_BUTTON);
-
-/**
- * menu signal handler for activation on showcookies item
- */
-MENUHANDLER(openlocation, OPENLOCATION_BUTTON);
-
-/**
- * menu signal handler for activation on showcookies item
- */
-MENUHANDLER(contents, CONTENTS_BUTTON);
-
-/**
- * menu signal handler for activation on showcookies item
- */
-MENUHANDLER(guide, GUIDE_BUTTON);
-
-/**
- * menu signal handler for activation on showcookies item
- */
-MENUHANDLER(info, INFO_BUTTON);
-
-/**
- * menu signal handler for activation on showcookies item
- */
-MENUHANDLER(about, ABOUT_BUTTON);
-
-#undef MENUHANDLER
+#define TOOLBAR_ITEM_n(identifier, name)
+#define TOOLBAR_ITEM(identifier, name, snstvty, clicked, activate, pass) \
+ TOOLBAR_ITEM_ ## pass(identifier, name)
+#include "gtk/toolbar_items.h"
+#undef TOOLBAR_ITEM_y
+#undef TOOLBAR_ITEM_n
+#undef TOOLBAR_ITEM
static gboolean
@@ -1081,40 +881,42 @@ create_scaffolding_link_menu(struct nsgtk_scaffolding
*g, GtkAccelGroup *group)
*/
static nserror nsgtk_menu_initialise(struct nsgtk_scaffolding *g)
{
-#define TOOLBAR_ITEM(identifier, name, snstvty, clicked) \
- g->menus[identifier].sensitivity = snstvty;
+#define TOOLBAR_ITEM_y(identifier, name) \
+ g->menus[identifier].mhandler = nsgtk_on_##name##_activate_menu;
+#define TOOLBAR_ITEM_n(identifier, name) \
+ g->menus[identifier].mhandler = NULL;
+#define TOOLBAR_ITEM(identifier, name, snstvty, clicked, activate, pass) \
+ g->menus[identifier].sensitivity = snstvty; \
+ TOOLBAR_ITEM_ ## activate(identifier, name)
#include "gtk/toolbar_items.h"
+#undef TOOLBAR_ITEM_y
+#undef TOOLBAR_ITEM_n
#undef TOOLBAR_ITEM
/* items on menubar, burger */
#define ITEM_MAIN(p, q, r) \
- g->menus[p##_BUTTON].mhandler = nsgtk_on_##r##_activate_menu; \
g->menus[p##_BUTTON].main = g->menu_bar->q->r##_menuitem; \
g->menus[p##_BUTTON].burger = g->burger_menu->q->r##_menuitem
/* submenu items on menubar, burger */
#define ITEM_SUB(p, q, r, s) \
- g->menus[p##_BUTTON].mhandler = nsgtk_on_##s##_activate_menu; \
g->menus[p##_BUTTON].main = g->menu_bar->q->r##_submenu->s##_menuitem;\
g->menus[p##_BUTTON].burger =
g->burger_menu->q->r##_submenu->s##_menuitem
/* items on menubar, burger and context popup */
#define ITEM_POP(p, q, r) \
- g->menus[p##_BUTTON].mhandler = nsgtk_on_##r##_activate_menu; \
g->menus[p##_BUTTON].main = g->menu_bar->q->r##_menuitem; \
g->menus[p##_BUTTON].burger = g->burger_menu->q->r##_menuitem; \
g->menus[p##_BUTTON].popup = g->popup_menu->r##_menuitem
/* items on menubar, burger and context popup */
#define ITEM_MAINPOP(p, q, r) \
- g->menus[p##_BUTTON].mhandler = nsgtk_on_##r##_activate_menu; \
g->menus[p##_BUTTON].main = g->menu_bar->q->r##_menuitem; \
g->menus[p##_BUTTON].burger = g->burger_menu->q->r##_menuitem; \
g->menus[p##_BUTTON].popup = g->popup_menu->q->r##_menuitem
/* sub submenu items on menubar, burger and context popup */
#define ITEM_SUBPOP(p, q, r, s)
\
- g->menus[p##_BUTTON].mhandler = nsgtk_on_##s##_activate_menu; \
g->menus[p##_BUTTON].main = g->menu_bar->q->r##_submenu->s##_menuitem;\
g->menus[p##_BUTTON].burger =
g->burger_menu->q->r##_submenu->s##_menuitem; \
g->menus[p##_BUTTON].popup = g->popup_menu->q->r##_submenu->s##_menuitem
@@ -1400,14 +1202,6 @@ struct nsgtk_scaffolding *nsgtk_current_scaffolding(void)
}
-/* exported interface documented in gtk/scaffolding.h */
-void nsgtk_scaffolding_toolbars(struct nsgtk_scaffolding *g)
-{
- // nsgtk_toolbar_update(g->toolbar);
- nsgtk_search_update(g->search);
-}
-
-
/* exported function documented in gtk/scaffolding.h */
void nsgtk_window_set_title(struct gui_window *gw, const char *title)
{
@@ -1528,13 +1322,6 @@ struct nsgtk_scaffolding
*nsgtk_scaffolding_iterate(struct nsgtk_scaffolding *g)
/* exported interface documented in gtk/scaffolding.h */
-void nsgtk_scaffolding_reset_offset(struct nsgtk_scaffolding *g)
-{
- //g->offset = 0;
-}
-
-
-/* exported interface documented in gtk/scaffolding.h */
struct gui_window *nsgtk_scaffolding_top_level(struct nsgtk_scaffolding *g)
{
return g->top_level;
diff --git a/frontends/gtk/scaffolding.h b/frontends/gtk/scaffolding.h
index 43ad1a9..16aaf03 100644
--- a/frontends/gtk/scaffolding.h
+++ b/frontends/gtk/scaffolding.h
@@ -115,14 +115,6 @@ struct gtk_history_window
*nsgtk_scaffolding_history_window(struct nsgtk_scaffol
struct gui_window *nsgtk_scaffolding_top_level(struct nsgtk_scaffolding *g);
-/**
- * reset the scaffold offset value to 0.
- *
- * \todo The value is only ever altered in
- * nsgtk_scaffolding_toolbar_size_allocate and is something to do with
- * the history button either clarify or remove!
- */
-void nsgtk_scaffolding_reset_offset(struct nsgtk_scaffolding *g);
/**
* Iterate through available scaffolding.
@@ -177,9 +169,5 @@ void nsgtk_scaffolding_context_menu(struct
nsgtk_scaffolding *g, gdouble x, gdou
*/
void nsgtk_window_set_title(struct gui_window *gw, const char *title);
-/**
- * toolbar style changed
- */
-void nsgtk_scaffolding_toolbars(struct nsgtk_scaffolding *g);
#endif /* NETSURF_GTK_SCAFFOLDING_H */
diff --git a/frontends/gtk/toolbar.c b/frontends/gtk/toolbar.c
index ad2990a..aa5585b 100644
--- a/frontends/gtk/toolbar.c
+++ b/frontends/gtk/toolbar.c
@@ -202,7 +202,7 @@ int nsgtk_toolbar_get_id_from_widget(GtkWidget *widget,
struct nsgtk_scaffolding
/* define data plus and data minus handlers */
-#define TOOLBAR_ITEM(identifier, name, sensitivity, clicked) \
+#define TOOLBAR_ITEM(identifier, name, sensitivity, clicked, activate, pass)\
static gboolean
\
nsgtk_toolbar_##name##_data_plus(GtkWidget *widget, \
GdkDragContext *cont, \
@@ -812,6 +812,11 @@ make_toolbar_item(nsgtk_toolbar_button i, struct
nsgtk_theme *theme)
return w;
}
+/* exported interface documented in gtk/scaffolding.h */
+static void nsgtk_scaffolding_reset_offset(struct nsgtk_scaffolding *g)
+{
+ //g->offset = 0;
+}
/**
* called when a widget is dropped onto the toolbar
@@ -2928,10 +2933,9 @@ toggledebugging_button_clicked_cb(GtkWidget *widget,
gpointer data)
browser_window_debug(bw, CONTENT_DEBUG_REDRAW);
- nsgtk_reflow_all_windows();
+ nsgtk_window_update_all();
return TRUE;
-
}
@@ -3054,6 +3058,19 @@ localhistory_button_clicked_cb(GtkWidget *widget,
gpointer data)
return TRUE;
}
+/**
+ * handler for history tool bar item clicked signal
+ *
+ * \param widget The widget the signal is being delivered to.
+ * \param data The toolbar context passed when the signal was connected
+ * \return TRUE
+ */
+static gboolean
+history_button_clicked_cb(GtkWidget *widget, gpointer data)
+{
+ return localhistory_button_clicked_cb(widget, data);
+}
+
/**
* handler for global history tool bar item clicked signal
@@ -3279,14 +3296,20 @@ toolbar_item_create(nsgtk_toolbar_button id,
/* set item defaults from macro */
switch (id) {
-#define TOOLBAR_ITEM(identifier, name, snstvty, clicked) \
+#define TOOLBAR_ITEM_y(name) \
+ item->bhandler = name##_button_clicked_cb;
+#define TOOLBAR_ITEM_n(name) \
+ item->bhandler = NULL;
+#define TOOLBAR_ITEM(identifier, name, snstvty, clicked, activate, pass)\
case identifier: \
item->sensitivity = snstvty; \
item->dataplus = nsgtk_toolbar_##name##_data_plus; \
item->dataminus = nsgtk_toolbar_##name##_data_minus; \
- item->bhandler = clicked; \
+ TOOLBAR_ITEM_ ## clicked(name) \
break;
#include "gtk/toolbar_items.h"
+#undef TOOLBAR_ITEM_y
+#undef TOOLBAR_ITEM_n
#undef TOOLBAR_ITEM
case PLACEHOLDER_BUTTON:
@@ -3564,6 +3587,12 @@ nserror nsgtk_toolbar_destroy(struct nsgtk_toolbar *tb)
/* exported interface documented in toolbar.h */
nserror nsgtk_toolbar_update(struct nsgtk_toolbar *tb)
{
+ /*
+ * reset toolbar size allocation so icon size change affects
+ * allocated widths.
+ */
+ tb->offset = 0;
+
switch (nsoption_int(button_type)) {
case 1: /* Small icons */
diff --git a/frontends/gtk/toolbar_items.h b/frontends/gtk/toolbar_items.h
index cbb6a24..ae5c6bb 100644
--- a/frontends/gtk/toolbar_items.h
+++ b/frontends/gtk/toolbar_items.h
@@ -79,68 +79,71 @@ typedef enum {
/*
* Item fields are:
- * item identifier enum
- * item name
- * item initial visibility
+ * identifier enum
+ * name
+ * initial sensitivity
+ * if there is a toolbar click signal handler
+ * if there is a menu activate signal handler
+ * if the menu activate signal handler calls the toolbar click handler
*/
#ifndef TOOLBAR_ITEM
-#define TOOLBAR_ITEM(a, b, c, d)
+#define TOOLBAR_ITEM(a, b, c, d, e, f)
#define TOOLBAR_ITEM_SET
#endif
-TOOLBAR_ITEM(BACK_BUTTON, back, false, back_button_clicked_cb)
-TOOLBAR_ITEM(HISTORY_BUTTON, history, true, localhistory_button_clicked_cb)
-TOOLBAR_ITEM(FORWARD_BUTTON, forward, false, forward_button_clicked_cb)
-TOOLBAR_ITEM(STOP_BUTTON, stop, false, stop_button_clicked_cb)
-TOOLBAR_ITEM(RELOAD_BUTTON, reload, true, reload_button_clicked_cb)
-TOOLBAR_ITEM(HOME_BUTTON, home, true, home_button_clicked_cb)
-TOOLBAR_ITEM(URL_BAR_ITEM, url_bar, true, NULL)
-TOOLBAR_ITEM(WEBSEARCH_ITEM, websearch, true, NULL)
-TOOLBAR_ITEM(THROBBER_ITEM, throbber, true, NULL)
-TOOLBAR_ITEM(NEWWINDOW_BUTTON, newwindow, true, newwindow_button_clicked_cb)
-TOOLBAR_ITEM(NEWTAB_BUTTON, newtab, true, newtab_button_clicked_cb)
-TOOLBAR_ITEM(OPENFILE_BUTTON, openfile, true, openfile_button_clicked_cb)
-TOOLBAR_ITEM(CLOSETAB_BUTTON, closetab, false, NULL)
-TOOLBAR_ITEM(CLOSEWINDOW_BUTTON, closewindow, true,
closewindow_button_clicked_cb)
-TOOLBAR_ITEM(SAVEPAGE_BUTTON, savepage, true, savepage_button_clicked_cb)
-TOOLBAR_ITEM(PDF_BUTTON, pdf, false, pdf_button_clicked_cb)
-TOOLBAR_ITEM(PLAINTEXT_BUTTON, plaintext, true, plaintext_button_clicked_cb)
-TOOLBAR_ITEM(DRAWFILE_BUTTON, drawfile, false, NULL)
-TOOLBAR_ITEM(POSTSCRIPT_BUTTON, postscript, false, NULL)
-TOOLBAR_ITEM(PRINTPREVIEW_BUTTON, printpreview, false, NULL)
-TOOLBAR_ITEM(PRINT_BUTTON, print, true, print_button_clicked_cb)
-TOOLBAR_ITEM(QUIT_BUTTON, quit, true, quit_button_clicked_cb)
-TOOLBAR_ITEM(CUT_BUTTON, cut, true, cut_button_clicked_cb)
-TOOLBAR_ITEM(COPY_BUTTON, copy, true, copy_button_clicked_cb)
-TOOLBAR_ITEM(PASTE_BUTTON, paste, true, paste_button_clicked_cb)
-TOOLBAR_ITEM(DELETE_BUTTON, delete, false, delete_button_clicked_cb)
-TOOLBAR_ITEM(SELECTALL_BUTTON, selectall, true, selectall_button_clicked_cb)
-TOOLBAR_ITEM(FIND_BUTTON, find, true, NULL)
-TOOLBAR_ITEM(PREFERENCES_BUTTON, preferences, true,
preferences_button_clicked_cb)
-TOOLBAR_ITEM(ZOOMPLUS_BUTTON, zoomplus, true, zoomplus_button_clicked_cb)
-TOOLBAR_ITEM(ZOOMMINUS_BUTTON, zoomminus, true, zoomminus_button_clicked_cb)
-TOOLBAR_ITEM(ZOOMNORMAL_BUTTON, zoomnormal, true, zoomnormal_button_clicked_cb)
-TOOLBAR_ITEM(FULLSCREEN_BUTTON, fullscreen, true, fullscreen_button_clicked_cb)
-TOOLBAR_ITEM(VIEWSOURCE_BUTTON, viewsource, true, viewsource_button_clicked_cb)
-TOOLBAR_ITEM(DOWNLOADS_BUTTON, downloads, true, downloads_button_clicked_cb)
-TOOLBAR_ITEM(SAVEWINDOWSIZE_BUTTON, savewindowsize, true,
savewindowsize_button_clicked_cb)
-TOOLBAR_ITEM(TOGGLEDEBUGGING_BUTTON, toggledebugging, true,
toggledebugging_button_clicked_cb)
-TOOLBAR_ITEM(SAVEBOXTREE_BUTTON, debugboxtree, true,
debugboxtree_button_clicked_cb)
-TOOLBAR_ITEM(SAVEDOMTREE_BUTTON, debugdomtree, true,
debugdomtree_button_clicked_cb)
-TOOLBAR_ITEM(LOCALHISTORY_BUTTON, localhistory, true,
localhistory_button_clicked_cb)
-TOOLBAR_ITEM(GLOBALHISTORY_BUTTON, globalhistory, true,
globalhistory_button_clicked_cb)
-TOOLBAR_ITEM(ADDBOOKMARKS_BUTTON, addbookmarks, true,
addbookmarks_button_clicked_cb)
-TOOLBAR_ITEM(SHOWBOOKMARKS_BUTTON, showbookmarks, true,
showbookmarks_button_clicked_cb)
-TOOLBAR_ITEM(SHOWCOOKIES_BUTTON, showcookies, true,
showcookies_button_clicked_cb)
-TOOLBAR_ITEM(OPENLOCATION_BUTTON, openlocation, true,
openlocation_button_clicked_cb)
-TOOLBAR_ITEM(NEXTTAB_BUTTON, nexttab, false, NULL)
-TOOLBAR_ITEM(PREVTAB_BUTTON, prevtab, false, NULL)
-TOOLBAR_ITEM(CONTENTS_BUTTON, contents, true, contents_button_clicked_cb)
-TOOLBAR_ITEM(GUIDE_BUTTON, guide, true, guide_button_clicked_cb)
-TOOLBAR_ITEM(INFO_BUTTON, info, true, info_button_clicked_cb)
-TOOLBAR_ITEM(ABOUT_BUTTON, about, true, about_button_clicked_cb)
-TOOLBAR_ITEM(OPENMENU_BUTTON, openmenu, true, openmenu_button_clicked_cb)
+TOOLBAR_ITEM(BACK_BUTTON, back, false, y, y, y)
+TOOLBAR_ITEM(HISTORY_BUTTON, history, true, y, n, n)
+TOOLBAR_ITEM(FORWARD_BUTTON, forward, false, y, y, y)
+TOOLBAR_ITEM(STOP_BUTTON, stop, false, y, y, y)
+TOOLBAR_ITEM(RELOAD_BUTTON, reload, true, y, y, y)
+TOOLBAR_ITEM(HOME_BUTTON, home, true, y, y, y)
+TOOLBAR_ITEM(URL_BAR_ITEM, url_bar, true, n, n, n)
+TOOLBAR_ITEM(WEBSEARCH_ITEM, websearch, true, n, n, n)
+TOOLBAR_ITEM(THROBBER_ITEM, throbber, true, n, n, n)
+TOOLBAR_ITEM(NEWWINDOW_BUTTON, newwindow, true, y, y, y)
+TOOLBAR_ITEM(NEWTAB_BUTTON, newtab, true, y, y, y)
+TOOLBAR_ITEM(OPENFILE_BUTTON, openfile, true, y, y, y)
+TOOLBAR_ITEM(CLOSETAB_BUTTON, closetab, false, n, y, n)
+TOOLBAR_ITEM(CLOSEWINDOW_BUTTON, closewindow, true, y, y, y)
+TOOLBAR_ITEM(SAVEPAGE_BUTTON, savepage, true, y, y, y)
+TOOLBAR_ITEM(PDF_BUTTON, pdf, false, y, y, y)
+TOOLBAR_ITEM(PLAINTEXT_BUTTON, plaintext, true, y, y, y)
+TOOLBAR_ITEM(DRAWFILE_BUTTON, drawfile, false, n, n, n)
+TOOLBAR_ITEM(POSTSCRIPT_BUTTON, postscript, false, n, n, n)
+TOOLBAR_ITEM(PRINTPREVIEW_BUTTON, printpreview, false, n, y, y)
+TOOLBAR_ITEM(PRINT_BUTTON, print, true, y, y, y)
+TOOLBAR_ITEM(QUIT_BUTTON, quit, true, y, y, y)
+TOOLBAR_ITEM(CUT_BUTTON, cut, true, y, y, y)
+TOOLBAR_ITEM(COPY_BUTTON, copy, true, y, y, y)
+TOOLBAR_ITEM(PASTE_BUTTON, paste, true, y, y, y)
+TOOLBAR_ITEM(DELETE_BUTTON, delete, false, y, y, y)
+TOOLBAR_ITEM(SELECTALL_BUTTON, selectall, true, y, y, y)
+TOOLBAR_ITEM(FIND_BUTTON, find, true, n, y, n)
+TOOLBAR_ITEM(PREFERENCES_BUTTON, preferences, true, y, y, y)
+TOOLBAR_ITEM(ZOOMPLUS_BUTTON, zoomplus, true, y, y, y)
+TOOLBAR_ITEM(ZOOMMINUS_BUTTON, zoomminus, true, y, y, y)
+TOOLBAR_ITEM(ZOOMNORMAL_BUTTON, zoomnormal, true, y, y, y)
+TOOLBAR_ITEM(FULLSCREEN_BUTTON, fullscreen, true, y, y, y)
+TOOLBAR_ITEM(VIEWSOURCE_BUTTON, viewsource, true, y, y, y)
+TOOLBAR_ITEM(DOWNLOADS_BUTTON, downloads, true, y, y, y)
+TOOLBAR_ITEM(SAVEWINDOWSIZE_BUTTON, savewindowsize, true, y, y, y)
+TOOLBAR_ITEM(TOGGLEDEBUGGING_BUTTON, toggledebugging, true, y, y, y)
+TOOLBAR_ITEM(SAVEBOXTREE_BUTTON, debugboxtree, true, y, y, y)
+TOOLBAR_ITEM(SAVEDOMTREE_BUTTON, debugdomtree, true, y, y, y)
+TOOLBAR_ITEM(LOCALHISTORY_BUTTON, localhistory, true, y, y, y)
+TOOLBAR_ITEM(GLOBALHISTORY_BUTTON, globalhistory, true, y, y, y)
+TOOLBAR_ITEM(ADDBOOKMARKS_BUTTON, addbookmarks, true, y, y, y)
+TOOLBAR_ITEM(SHOWBOOKMARKS_BUTTON, showbookmarks, true, y, y, y)
+TOOLBAR_ITEM(SHOWCOOKIES_BUTTON, showcookies, true, y, y, y)
+TOOLBAR_ITEM(OPENLOCATION_BUTTON, openlocation, true, y, y, y)
+TOOLBAR_ITEM(NEXTTAB_BUTTON, nexttab, false, n, y, n)
+TOOLBAR_ITEM(PREVTAB_BUTTON, prevtab, false, n, y, n)
+TOOLBAR_ITEM(CONTENTS_BUTTON, contents, true, y, y, y)
+TOOLBAR_ITEM(GUIDE_BUTTON, guide, true, y, y, y)
+TOOLBAR_ITEM(INFO_BUTTON, info, true, y, y, y)
+TOOLBAR_ITEM(ABOUT_BUTTON, about, true, y, y, y)
+TOOLBAR_ITEM(OPENMENU_BUTTON, openmenu, true, y, n, n)
#ifdef TOOLBAR_ITEM_SET
#undef TOOLBAR_ITEM
diff --git a/frontends/gtk/window.c b/frontends/gtk/window.c
index b43a0ec..0daf0fe 100644
--- a/frontends/gtk/window.c
+++ b/frontends/gtk/window.c
@@ -904,11 +904,15 @@ nsgtk_window_item_activate(struct gui_window *gw,
nsgtk_toolbar_button itemid)
return nsgtk_toolbar_item_activate(gw->toolbar, itemid);
}
-void nsgtk_reflow_all_windows(void)
+/* exported interface documented in window.h */
+void nsgtk_window_update_all(void)
{
- for (struct gui_window *g = window_list; g; g = g->next) {
-
nsgtk_tab_options_changed(nsgtk_scaffolding_notebook(g->scaffold));
- browser_window_schedule_reformat(g->bw);
+ struct gui_window *gw;
+ for (gw = window_list; gw != NULL; gw = gw->next) {
+
nsgtk_tab_options_changed(nsgtk_scaffolding_notebook(gw->scaffold));
+ nsgtk_toolbar_update(gw->toolbar);
+ /** \todo update search bar */
+ browser_window_schedule_reformat(gw->bw);
}
}
diff --git a/frontends/gtk/window.h b/frontends/gtk/window.h
index dd49c71..b6e00a6 100644
--- a/frontends/gtk/window.h
+++ b/frontends/gtk/window.h
@@ -46,9 +46,13 @@ struct browser_window *nsgtk_get_browser_window(struct
gui_window *gw);
struct nsgtk_scaffolding *nsgtk_get_scaffold(struct gui_window *gw);
/**
- * cause all windows be be reflowed
+ * Every window will have its tab, toolbar and drawing area updated
+ *
+ * The update will ensure the correct tab options are used, the
+ * toolbar size and style is changed and the browser window contents
+ * redrawn.
*/
-void nsgtk_reflow_all_windows(void);
+void nsgtk_window_update_all(void);
/**
* update targets
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org